/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.129 * * Copyright 2011-2022 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ var xSe=Object.create;var TU=Object.defineProperty;var TSe=Object.getOwnPropertyDescriptor;var ASe=Object.getOwnPropertyNames;var CSe=Object.getPrototypeOf,ESe=Object.prototype.hasOwnProperty;var SSe=(e,t)=>()=>(e&&(t=e(e=0)),t);var Xn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),uJ=(e,t)=>{for(var n in t)TU(e,n,{get:t[n],enumerable:!0})},fJ=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ASe(t))!ESe.call(e,o)&&o!==n&&TU(e,o,{get:()=>t[o],enumerable:!(i=TSe(t,o))||i.enumerable});return e};var Zo=(e,t,n)=>(n=e!=null?xSe(CSe(e)):{},fJ(t||!e||!e.__esModule?TU(n,"default",{value:e,enumerable:!0}):n,e)),nm=e=>fJ(TU({},"__esModule",{value:!0}),e);var AU=Xn((pDt,dJ)=>{var Tp=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)};Tp.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Tp.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};Tp.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>>1^t[e&1];for(;n>>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};Tp.prototype.random_int31=function(){return this.random_int()>>>1};Tp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Tp.prototype.random=function(){return this.random_int()*(1/4294967296)};Tp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Tp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};dJ.exports=Tp});var BJ=Xn((JA,eC)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof JA=="object"&&JA&&!JA.nodeType&&JA,n=typeof eC=="object"&&eC&&!eC.nodeType&&eC,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,l=26,u=38,f=700,h=72,p=128,g="-",m=/^xn--/,y=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=s-a,C=Math.floor,S=String.fromCharCode,v;function P(V){throw new RangeError(x[V])}function M(V,j){for(var U=V.length,q=[];U--;)q[U]=j(V[U]);return q}function R(V,j){var U=V.split("@"),q="";U.length>1&&(q=U[0]+"@",V=U[1]),V=V.replace(b,".");var Y=V.split("."),te=M(Y,j).join(".");return q+te}function L(V){for(var j=[],U=0,q=V.length,Y,te;U=55296&&Y<=56319&&U65535&&(j-=65536,U+=S(j>>>10&1023|55296),j=56320|j&1023),U+=S(j),U}).join("")}function _(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:s}function w(V,j){return V+22+75*(V<26)-((j!=0)<<5)}function D(V,j,U){var q=0;for(V=U?C(V/f):V>>1,V+=C(V/j);V>A*l>>1;q+=s)V=C(V/A);return C(q+(A+1)*V/(V+u))}function I(V){var j=[],U=V.length,q,Y=0,te=p,K=h,Z,ee,me,Te,ue,ye,Ae,Pe,Ee;for(Z=V.lastIndexOf(g),Z<0&&(Z=0),ee=0;ee=128&&P("not-basic"),j.push(V.charCodeAt(ee));for(me=Z>0?Z+1:0;me=U&&P("invalid-input"),Ae=_(V.charCodeAt(me++)),(Ae>=s||Ae>C((r-Y)/ue))&&P("overflow"),Y+=Ae*ue,Pe=ye<=K?a:ye>=K+l?l:ye-K,!(AeC(r/Ee)&&P("overflow"),ue*=Ee;q=j.length+1,K=D(Y-Te,q,Te==0),C(Y/q)>r-te&&P("overflow"),te+=C(Y/q),Y%=q,j.splice(Y++,0,te)}return F(j)}function N(V){var j,U,q,Y,te,K,Z,ee,me,Te,ue,ye=[],Ae,Pe,Ee,ze;for(V=L(V),Ae=V.length,j=p,U=0,te=h,K=0;K=j&&ueC((r-U)/Pe)&&P("overflow"),U+=(Z-j)*Pe,j=Z,K=0;Kr&&P("overflow"),ue==j){for(ee=U,me=s;Te=me<=te?a:me>=te+l?l:me-te,!(ee{/*! * 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 jU=="object"&&jU.exports?jU.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(kJ,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,l=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(l=7);var u;for(u=0;u1);p++)f.splice(0,1);s[h]=f.join("")}var g=-1,m=0,y=0,b=-1,x=!1;for(h=0;hm&&(g=b,m=y)):s[h]==="0"&&(x=!0,b=h,y=1);y>m&&(g=b,m=y),m>1&&s.splice(g,m,""),a=s.length;var A="";for(s[0]===""&&(A=":"),h=0;h{/*! * 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 WU=="object"&&WU.exports?WU.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(VJ,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var du=Xn((HJ,qU)=>{/*! * 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 qU=="object"&&qU.exports?qU.exports=t(BJ(),UJ(),zJ()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(HJ,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(w,D){var I=arguments.length>=1,N=arguments.length>=2;if(!(this instanceof r))return I?N?new r(w,D):new r(w):new r;if(w===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?w=location.href+"":w=""}if(w===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(w),D!==void 0?this.absoluteTo(D):this}function s(w){return/^[0-9]+$/.test(w)}r.version="1.19.11";var a=r.prototype,l=Object.prototype.hasOwnProperty;function u(w){return w.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(w){return w===void 0?"Undefined":String(Object.prototype.toString.call(w)).slice(8,-1)}function h(w){return f(w)==="Array"}function p(w,D){var I={},N,k;if(f(D)==="RegExp")I=null;else if(h(D))for(N=0,k=D.length;N]+|\(([^\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(w){if(!(!w||!w.nodeName)){var D=w.nodeName.toLowerCase();if(!(D==="input"&&w.type!=="image"))return r.domAttributes[D]}};function b(w){return escape(w)}function x(w){return encodeURIComponent(w).replace(/[!'()*]/g,b).replace(/\*/g,"%2A")}r.encode=x,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=x,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(w,D){var I=r.encode(w+"");return D===void 0&&(D=r.escapeQuerySpace),D?I.replace(/%20/g,"+"):I},r.decodeQuery=function(w,D){w+="",D===void 0&&(D=r.escapeQuerySpace);try{return r.decode(D?w.replace(/\+/g,"%20"):w)}catch{return w}};var A={encode:"encode",decode:"decode"},C,S=function(w,D){return function(I){try{return r[D](I+"").replace(r.characters[w][D].expression,function(N){return r.characters[w][D].map[N]})}catch{return I}}};for(C in A)r[C+"PathSegment"]=S("pathname",A[C]),r[C+"UrnPathSegment"]=S("urnpath",A[C]);var v=function(w,D,I){return function(N){var k;I?k=function(U){return r[D](r[I](U))}:k=r[D];for(var z=(N+"").split(w),V=0,j=z.length;V-1&&(D.fragment=w.substring(I+1)||null,w=w.substring(0,I)),I=w.indexOf("?"),I>-1&&(D.query=w.substring(I+1)||null,w=w.substring(0,I)),w=w.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),w=w.replace(/^[/\\]{2,}/i,"//"),w.substring(0,2)==="//"?(D.protocol=null,w=w.substring(2),w=r.parseAuthority(w,D)):(I=w.indexOf(":"),I>-1&&(D.protocol=w.substring(0,I)||null,D.protocol&&!D.protocol.match(r.protocol_expression)?D.protocol=void 0:w.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(w=w.substring(I+3),w=r.parseAuthority(w,D)):(w=w.substring(I+1),D.urn=!0))),D.path=w,D},r.parseHost=function(w,D){w||(w=""),w=w.replace(/\\/g,"/");var I=w.indexOf("/"),N,k;if(I===-1&&(I=w.length),w.charAt(0)==="[")N=w.indexOf("]"),D.hostname=w.substring(1,N)||null,D.port=w.substring(N+2,I)||null,D.port==="/"&&(D.port=null);else{var z=w.indexOf(":"),V=w.indexOf("/"),j=w.indexOf(":",z+1);j!==-1&&(V===-1||j-1?k:w.length-1),V;return z>-1&&(k===-1||z-1?K=K.slice(0,Z)+K.slice(Z).replace(z,""):K=K.replace(z,""),!(K.length<=U[0].length)&&!(I.ignore&&I.ignore.test(K))){te=q+K.length;var Te=D(K,q,te,w);if(Te===void 0){N.lastIndex=te;continue}Te=String(Te),w=w.slice(0,q)+Te+w.slice(te),N.lastIndex=q+Te.length}}return N.lastIndex=0,w},r.ensureValidHostname=function(w,D){var I=!!w,N=!!D,k=!1;if(N&&(k=g(r.hostProtocols,D)),k&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+D);if(w&&w.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(w).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(w){if(w){var D=Number(w);if(!(s(D)&&D>0&&D<65536))throw new TypeError('Port "'+w+'" is not a valid port')}},r.noConflict=function(w){if(w){var D={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(D.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(D.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(D.SecondLevelDomains=i.SecondLevelDomains.noConflict()),D}else i.URI===this&&(i.URI=o);return this},a.build=function(w){return w===!0?this._deferred_build=!0:(w===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function P(w){return function(D,I){return D===void 0?this._parts[w]||"":(this._parts[w]=D||null,this.build(!I),this)}}function M(w,D){return function(I,N){return I===void 0?this._parts[w]||"":(I!==null&&(I=I+"",I.charAt(0)===D&&(I=I.substring(1))),this._parts[w]=I,this.build(!N),this)}}a.protocol=P("protocol"),a.username=P("username"),a.password=P("password"),a.hostname=P("hostname"),a.port=P("port"),a.query=M("query","?"),a.fragment=M("fragment","#"),a.search=function(w,D){var I=this.query(w,D);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(w,D){var I=this.fragment(w,D);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(w,D){if(w===void 0||w===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return w?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=w?r.recodeUrnPath(w):"":this._parts.path=w?r.recodePath(w):"/",this.build(!D),this},a.path=a.pathname,a.href=function(w,D){var I;if(w===void 0)return this.toString();this._string="",this._parts=r._parts();var N=w instanceof r,k=typeof w=="object"&&(w.hostname||w.path||w.pathname);if(w.nodeName){var z=r.getDomAttribute(w);w=w[z]||"",k=!1}if(!N&&k&&w.pathname!==void 0&&(w=w.toString()),typeof w=="string"||w instanceof String)this._parts=r.parse(String(w),this._parts);else if(N||k){var V=N?w._parts:w;for(I in V)I!=="query"&&l.call(this._parts,I)&&(this._parts[I]=V[I]);V.query&&this.query(V.query,!1)}else throw new TypeError("invalid input");return this.build(!D),this},a.is=function(w){var D=!1,I=!1,N=!1,k=!1,z=!1,V=!1,j=!1,U=!this._parts.urn;switch(this._parts.hostname&&(U=!1,I=r.ip4_expression.test(this._parts.hostname),N=r.ip6_expression.test(this._parts.hostname),D=I||N,k=!D,z=k&&n&&n.has(this._parts.hostname),V=k&&r.idn_expression.test(this._parts.hostname),j=k&&r.punycode_expression.test(this._parts.hostname)),w.toLowerCase()){case"relative":return U;case"absolute":return!U;case"domain":case"name":return k;case"sld":return z;case"ip":return D;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return N;case"idn":return V;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var R=a.protocol,L=a.port,F=a.hostname;a.protocol=function(w,D){if(w&&(w=w.replace(/:(\/\/)?$/,""),!w.match(r.protocol_expression)))throw new TypeError('Protocol "'+w+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,w,D)},a.scheme=a.protocol,a.port=function(w,D){return this._parts.urn?w===void 0?"":this:(w!==void 0&&(w===0&&(w=null),w&&(w+="",w.charAt(0)===":"&&(w=w.substring(1)),r.ensureValidPort(w))),L.call(this,w,D))},a.hostname=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},N=r.parseHost(w,I);if(N!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');w=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(w,this._parts.protocol)}return F.call(this,w,D)},a.origin=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){var I=this.protocol(),N=this.authority();return N?(I?I+"://":"")+this.authority():""}else{var k=r(w);return this.protocol(k.protocol()).authority(k.authority()).build(!D),this}},a.host=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(w,this._parts);if(I!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');return this.build(!D),this},a.authority=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(w,this._parts);if(I!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');return this.build(!D),this},a.userinfo=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return w[w.length-1]!=="@"&&(w+="@"),r.parseUserinfo(w,this._parts),this.build(!D),this},a.resource=function(w,D){var I;return w===void 0?this.path()+this.search()+this.hash():(I=r.parse(w),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!D),this)},a.subdomain=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var N=this._parts.hostname.length-this.domain().length,k=this._parts.hostname.substring(0,N),z=new RegExp("^"+u(k));if(w&&w.charAt(w.length-1)!=="."&&(w+="."),w.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return w&&r.ensureValidHostname(w,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(z,w),this.build(!D),this}},a.domain=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(typeof w=="boolean"&&(D=w,w=void 0),w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var N=this._parts.hostname.length-this.tld(D).length-1;return N=this._parts.hostname.lastIndexOf(".",N-1)+1,this._parts.hostname.substring(N)||""}else{if(!w)throw new TypeError("cannot set domain empty");if(w.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(w,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=w;else{var k=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(k,w)}return this.build(!D),this}},a.tld=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(typeof w=="boolean"&&(D=w,w=void 0),w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),N=this._parts.hostname.substring(I+1);return D!==!0&&n&&n.list[N.toLowerCase()]&&n.get(this._parts.hostname)||N}else{var k;if(w)if(w.match(/[^a-zA-Z0-9-]/))if(n&&n.is(w))k=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(k,w);else throw new TypeError('TLD "'+w+'" 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");k=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(k,w)}else throw new TypeError("cannot set TLD empty");return this.build(!D),this}},a.directory=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0||w===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,N=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return w?r.decodePath(N):N}else{var k=this._parts.path.length-this.filename().length,z=this._parts.path.substring(0,k),V=new RegExp("^"+u(z));return this.is("relative")||(w||(w="/"),w.charAt(0)!=="/"&&(w="/"+w)),w&&w.charAt(w.length-1)!=="/"&&(w+="/"),w=r.recodePath(w),this._parts.path=this._parts.path.replace(V,w),this.build(!D),this}},a.filename=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(typeof w!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),N=this._parts.path.substring(I+1);return w?r.decodePathSegment(N):N}else{var k=!1;w.charAt(0)==="/"&&(w=w.substring(1)),w.match(/\.?\//)&&(k=!0);var z=new RegExp(u(this.filename())+"$");return w=r.recodePath(w),this._parts.path=this._parts.path.replace(z,w),k?this.normalizePath(D):this.build(!D),this}},a.suffix=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0||w===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),N=I.lastIndexOf("."),k,z;return N===-1?"":(k=I.substring(N+1),z=/^[a-z0-9%]+$/i.test(k)?k:"",w?r.decodePathSegment(z):z)}else{w.charAt(0)==="."&&(w=w.substring(1));var V=this.suffix(),j;if(V)w?j=new RegExp(u(V)+"$"):j=new RegExp(u("."+V)+"$");else{if(!w)return this;this._parts.path+="."+r.recodePath(w)}return j&&(w=r.recodePath(w),this._parts.path=this._parts.path.replace(j,w)),this.build(!D),this}},a.segment=function(w,D,I){var N=this._parts.urn?":":"/",k=this.path(),z=k.substring(0,1)==="/",V=k.split(N);if(w!==void 0&&typeof w!="number"&&(I=D,D=w,w=void 0),w!==void 0&&typeof w!="number")throw new Error('Bad segment "'+w+'", must be 0-based integer');if(z&&V.shift(),w<0&&(w=Math.max(V.length+w,0)),D===void 0)return w===void 0?V:V[w];if(w===null||V[w]===void 0)if(h(D)){V=[];for(var j=0,U=D.length;j{var JV=function(){"use strict";var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:G:Qdkr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq;A9pLdbk;QqeKu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRbN:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9Uc;WFbGgecjdaecjd6Ehqcbhkindndnaiak9nmbaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndnaec9WGgsTmbcbhzaPhHawhOxekdnaxmbalheinaraw9Ram6miawcbamzNjjjbamfhwaecufgembxvkkcbhAaPhOinaDaAfRbbhCaDcjlfheaOhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkaraw9Ram6mdaOcefhOawcbamzNjjjbamfhwaAcefgAal9hmbxlkkindnaxTmbaDazfRbbhCaDcjlfheaHhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkkaraO9Ram6mearaOcbamzNjjjbgLamfgw9RcK6mecbhKaDcjlfhOinaDcjlfaKfhYcwhAczhQceheindndnaegXce9hmbcuhoaYRbbmecbhodninaogecsSmeaecefhoaOaefcefRbbTmbkkcucbaecs6EhoxekaXcethocuaXtc;:bGcFb7hCcbheinaoaCaOaefRbb9nfhoaecefgecz9hmbkkaoaQaoaQ6geEhQaXaAaeEhAaXcetheaXcl6mbkdndndndnaAcufPdiebkaLaKco4fgeaeRbbcdciaAclSEaKci4coGtV86bbaAcw9hmeawaY8Pbb83bbawcwfaYcwf8Pbb83bbawczfhwxdkaLaKco4fgeaeRbbceaKci4coGtV86bbkdncwaA9Tg8Ambinawcb86bbawcefhwxbkkcuaAtcu7hYcbhEaOh3ina3hea8AhCcbhoinaeRbbgQaYcFeGgXaQaX6EaoaAtVhoaecefheaCcufgCmbkawao86bba3a8Afh3awcefhwaEa8AfgEcz6mbkcbheindnaOaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaKczfgKas9pmbaOczfhOaraw9RcL0mekkaKas6meawTmeaHcefhHawhOazcefgzalSmixbkkcbhoxikcbhoaraw9Ralcaalca0E6mddnalc8F0mbawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9RhoxdkaDaPaxcufal2falz:tjjjb8Aaxakfhkawmbkcbhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBdN:kjjbk:zse5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:e:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc:y1jjbfydbcdtfydbh3aLaocN1jjbfydbcdtfydbh8AaLaoc:q1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc:q1jjbfydbcdtfydbgKTaLavcN1jjbfydbcdtfydbg8AceSGaLavc:y1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavcj1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:e:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:e:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b9kEc:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A9kEc:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk;HqdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgradcFFFFi0Ecbyd:m:kjjbHjjjjbbgeBd:SeavceBd:mdaeabarz:tjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaeadaiavc:Sefz:njjjbavyd:Gehwadci9UgDcbyd:m:kjjbHjjjjbbhravc:Sefavyd:mdgqcdtfarBdbavaqcefgkBd:mdarcbaDzNjjjbhxavc:SefakcdtfcuaicdtaicFFFFi0Ecbyd:m:kjjbHjjjjbbgmBdbavaqcdfgPBd:mdawhramhkinakalIdbalarydbgscwascw6Ecdtfc;ebfIdbMUdbarclfhrakclfhkaicufgimbkavc:SefaPcdtfcuaDcdtadcFFFF970Ecbyd:m:kjjbHjjjjbbgPBdbdnadci6mbaehraPhkaDhiinakamarydbcdtfIdbamarclfydbcdtfIdbMamarcwfydbcdtfIdbMUdbarcxfhrakclfhkaicufgimbkkaqcifhoavc;qbfhzavhravyd:KehHavyd:OehOcbhscbhkcbhAcehCinarhXcihQaeakci2gLcdtfgrydbhdarclfydbhqabaAcx2fgicwfarcwfydbgKBdbaiclfaqBdbaiadBdbaxakfce86bbazaKBdwazaqBdlazadBdbaPakcdtfcbBdbdnasTmbcihQaXhiinazaQcdtfaiydbgrBdbaQaraK9harad9haraq9hGGfhQaiclfhiascufgsmbkkaAcefhAcbhsinaOaHaeasaLfcdtfydbcdtgifydbcdtfgKhrawaifgqydbgdhidnadTmbdninarydbakSmearclfhraicufgiTmdxbkkaraKadcdtfc98fydbBdbaqaqydbcufBdbkascefgsci9hmbkdndnaQTmbcuhkJbbbbhYcbhqavyd:KehKavyd:OehLindndnawazaqcdtfydbcdtgsfydbgrmbaqcefhqxekaqcs0hiamasfgdIdbh8AadalcbaqcefgqaiEcdtfIdbalarcwarcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEarcdthiaLaKasfydbcdtfhrinaParydbgscdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYasakadEhkarclfhraic98fgimbkkaqaQ9hmbkakcu9hmekaCaD9pmdindnaxaCfRbbmbaChkxdkaDaCcefgC9hmbxikkaQczaQcz6EhsazhraXhzakcu9hmbkkaocdtavc:Seffc98fhrdninaoTmearydbcbyd1:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd:m:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Wkivuo99lu8Jjjjjbc;W;Gb9Rgl8Kjjjjbcbhvalcj;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:m:kjjbHjjjjbbgrBdj9GalceBd;G9GalcFFF;7rBdwal9cFFF;7;3FF:;Fb83dbalcFFF97Bd;S9Gal9cFFF;7FFF:;u83d;K9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;K;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;S9GhDalIdlhkalId;O9GhxalIdbhmalId;K9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhHalaocbyd:m:kjjbHjjjjbbgiBd:e9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealcj;Gbfaifydbcbyd1:kjjbH:bjjjbbaic98fhixbkkalc;W;Gbf8Kjjjjbk9teiucbcbyd:q:kjjbgeabcifc98GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:kjjbgeabcrfc94GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:kjjbfgdBd:q:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkzebbbebbbdbbba:vbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(g){for(var m=new Uint8Array(g.length),y=0;y96?b-97:b>64?b-39:b+4}for(var x=0,y=0;y=3),l(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,y){r(y>0&&y<=256),r(y%4==0);var b=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBuffer,b,g,m,y)},encodeIndexBuffer:function(g,m,y){r(y==2||y==4),r(m%3==0);var b=h(g,y),x=n.exports.meshopt_encodeIndexBufferBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexBuffer,x,b,m,4)},encodeIndexSequence:function(g,m,y){r(y==2||y==4);var b=h(g,y),x=n.exports.meshopt_encodeIndexSequenceBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexSequence,x,b,m,4)},encodeGltfBuffer:function(g,m,y,b){var x={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(x[b]),x[b](g,m,y)},encodeFilterOct:function(g,m,y,b){return r(y==4||y==8),r(b>=1&&b<=16),p(n.exports.meshopt_encodeFilterOct,g,m,y,b,16)},encodeFilterQuat:function(g,m,y,b){return r(y==8),r(b>=4&&b<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,y,b,16)},encodeFilterExp:function(g,m,y,b,x){r(y>0&&y%4==0),r(b>=1&&b<=24);var A={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,g,m,y,b,y,x?A[x]:1)}}}();typeof s1=="object"&&typeof h9=="object"?h9.exports=JV:typeof define=="function"&&define.amd?define([],function(){return JV}):typeof s1=="object"?s1.MeshoptEncoder=JV:(typeof self<"u"?self:s1).MeshoptEncoder=JV});var qre=Xn((a1,m9)=>{var ez=function(){"use strict";var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(x){r=x.instance,r.exports.__wasm_call_ctors()});function a(x){for(var A=new Uint8Array(x.length),C=0;C96?S-97:S>64?S-39:S+4}for(var v=0,C=0;C0?y(x,A,C,f[S],u[v]):s.then(function(){var P=new Uint8Array(x*A);return l(r,r.exports[f[S]],P,x,A,C,r.exports[u[v]]),P})}}}();typeof a1=="object"&&typeof m9=="object"?m9.exports=ez:typeof define=="function"&&define.amd?define([],function(){return ez}):typeof a1=="object"?a1.MeshoptDecoder=ez:(typeof self<"u"?self:a1).MeshoptDecoder=ez});var Yre=Xn((c1,p9)=>{var tz=function(){"use strict";var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq;UMesdbk:kfvKue99euY99Qu8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd;S1jjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhCcbhLinabaXcdtfgKydbgAc:v;t;h;Ev2hOcbhedndninaQaOaCGgOcdtfgYydbgHcuSmeazaHcdtfydbaASmdaecefgeaOfhOaeaC9nmbxdkkazaLcdtfaABdbaYaLBdbaLhHaLcefhLkaKaHBdbaXcefgXad9hmbkkaQcbyd;O1jjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd;S1jjbHjjjjbbhQascxfasyd2gecdtfaQBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhLcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhXdnalTmbavcd4hCaecufhHinaLhednazTmbazaLcdtfydbhekaiaeaC2cdtfgeydlgOcH4aO7c:F:b:DD2aeydbgOcH4aO7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aHGheaLcdth8FdndndndndnazTmbaza8FfhKcbhOinaXaecdtfgYydbgAcuSmlaiazaAcdtfydbaC2cdtfaiaKydbaC2cdtfcxz:ojjjbTmiaOcefgOaefaHGheaOaH9nmbxdkkaiaLaC2cdtfhKcbhOinaXaecdtfgYydbgAcuSmiaiaAaC2cdtfaKcxz:ojjjbTmdaOcefgOaefaHGheaOaH9nmbkkcbhYkaYydbgecu9hmekaYaLBdbaLhekaQa8FfaeBdbaLcefgLal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaQhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaXcbyd;O1jjbH:bjjjbbasasyd2cufBd2alcbyd;S1jjbHjjjjbbhXascxfasyd2gecdtfaXBdbasaecefBd2a5cbyd;S1jjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd;S1jjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhLcbhAindndna3aAcitfydbgYaO9hmbaLaOBdba8KaOBdbxekdna8AaYcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhKa8JaCfhHcbheinaKaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaYaeydbcuSEBdbaLaYaOaLydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaQhHa8EhOaghCahhAcbheindndnaeaHydbgY9hmbdnaeaOydbgY9hmbaAydbhYdnaCydbgKcu9hmbaYcu9hmbaXaefcb86bbxikaXaefhLdnaeaKSmbaeaYSmbaLce86bbxikaLcl86bbxdkdnaea8EaYcdtgKfydb9hmbdnaCydbgLcuSmbaeaLSmbaAydbg8FcuSmbaea8FSmbagaKfydbg3cuSmba3aYSmbahaKfydbgKcuSmbaKaYSmbdnaQaLcdtfydbgYaQaKcdtfydb9hmbaYaQa8FcdtfydbgKSmbaKaQa3cdtfydb9hmbaXaefcd86bbxlkaXaefcl86bbxikaXaefcl86bbxdkaXaefcl86bbxekaXaefaXaYfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaQhHalhOindnaqaeydbfRbbTmbaXaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaQhealhHindnaqRbbTmbaXaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaQhealhOaXhHindnaXaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaXhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hLdnazTmba8JcdthicbhYayhKinaoazaYcdtfydbaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbxdkka8JcdthicbhYayhKinaoaYaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbkkcualc8S2gHalc;D;O;f8U0EgCcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhqdndndndna8JTmbaCcbyd;S1jjbHjjjjbbhvascxfasyd2gecdtfavBdbcehOasaecefBd2avcbaHz:ljjjb8Acua8Jal2gecltgHaecFFFFb0Ecbyd;S1jjbHjjjjbbhrascxfasyd2gecdtfarBdbasaecefBd2arcbaHz:ljjjb8AadmexikcbhvadTmecbhrkcbhAabhHindnaaaHclfydbgYcx2fgeIdbaaaHydbgKcx2fgOIdbg8P:tgIaaaHcwfydbgLcx2fgCIdlaOIdlg8R:tg8SNaCIdba8P:tgRaeIdla8R:tg8UN:tg8Va8VNa8UaCIdwaOIdwg8W:tg8XNa8SaeIdwa8W:tg8UN:tg8Sa8SNa8UaRNa8XaIN:tgIaINMM:rgRJbbbb9ETmba8VaR:vh8VaIaR:vhIa8SaR:vh8SkaqaQaKcdtfydbc8S2fgea8SaR:rgRa8SNNg8UaeIdbMUdbaeaIaRaINg8YNg8XaeIdlMUdlaea8VaRa8VNg8ZNg80aeIdwMUdwaea8Ya8SNg8YaeIdxMUdxaea8Za8SNg81aeIdzMUdzaea8ZaINg8ZaeIdCMUdCaea8SaRa8Va8WNa8Sa8PNa8RaINMM:mg8RNg8PNg8SaeIdKMUdKaeaIa8PNgIaeId3MUd3aea8Va8PNg8VaeIdaMUdaaea8Pa8RNg8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaYcdtfydbc8S2fgea8UaeIdbMUdbaea8XaeIdlMUdlaea80aeIdwMUdwaea8YaeIdxMUdxaea81aeIdzMUdzaea8ZaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaLcdtfydbc8S2fgea8UaeIdbMUdbaea8XaeIdlMUdlaea80aeIdwMUdwaea8YaeIdxMUdxaea81aeIdzMUdzaea8ZaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdyaHcxfhHaAcifgAad6mbkcbhiabhKinabaicdtfhYcbhHinaXaYaHc:G1jjbfydbcdtfydbgOfRbbhedndnaXaKaHfydbgCfRbbgAc99fcFeGcpe0mbaeceSmbaecd9hmekdnaAcufcFeGce0mbahaCcdtfydbaO9hmekdnaecufcFeGce0mbagaOcdtfydbaC9hmekdnaAcv2aefcj1jjbfRbbTmbaQaOcdtfydbaQaCcdtfydb0mekJbbacJbbacJbbjZaeceSEaAceSEh8ZdnaaaYaHc:K1jjbfydbcdtfydbcx2fgeIdwaaaCcx2fgAIdwg8R:tg8VaaaOcx2fgLIdwa8R:tg8Sa8SNaLIdbaAIdbg8W:tgIaINaLIdlaAIdlg8U:tgRaRNMMg8PNa8Va8SNaeIdba8W:tg80aINaRaeIdla8U:tg8YNMMg8Xa8SN:tg8Va8VNa80a8PNa8XaIN:tg8Sa8SNa8Ya8PNa8XaRN:tgIaINMM:rgRJbbbb9ETmba8VaR:vh8VaIaR:vhIa8SaR:vh8SkaqaQaCcdtfydbc8S2fgea8Sa8Za8P:rNgRa8SNNg8XaeIdbMUdbaeaIaRaINg8ZNg80aeIdlMUdlaea8VaRa8VNg8PNg8YaeIdwMUdwaea8Za8SNg8ZaeIdxMUdxaea8Pa8SNg81aeIdzMUdzaea8PaINgBaeIdCMUdCaea8SaRa8Va8RNa8Sa8WNa8UaINMM:mg8RNg8PNg8SaeIdKMUdKaeaIa8PNgIaeId3MUd3aea8Va8PNg8VaeIdaMUdaaea8Pa8RNg8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaOcdtfydbc8S2fgea8XaeIdbMUdbaea80aeIdlMUdlaea8YaeIdwMUdwaea8ZaeIdxMUdxaea81aeIdzMUdzaeaBaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdykaHclfgHcx9hmbkaKcxfhKaicifgiad6mbkdna8JTmbcbhKinJbbbbh8WaaabaKcdtfgeclfydbgLcx2fgHIdwaaaeydbgicx2fgOIdwg8Y:tgIaINaHIdbaOIdbg81:tg8Va8VNaHIdlaOIdlgB:tgRaRNMMg8Zaaaecwfydbg8Fcx2fgeIdwa8Y:tg8PNaIaIa8PNa8VaeIdba81:tg8RNaRaeIdlaB:tg8UNMMg8SN:tJbbbbJbbjZa8Za8Pa8PNa8Ra8RNa8Ua8UNMMg80Na8Sa8SN:tg8X:va8XJbbbb9BEg8XNh83a80aINa8Pa8SN:ta8XNhUa8Za8UNaRa8SN:ta8XNh85a80aRNa8Ua8SN:ta8XNh86a8Za8RNa8Va8SN:ta8XNh87a80a8VNa8Ra8SN:ta8XNh88a8Va8UNa8RaRN:tg8Sa8SNaRa8PNa8UaIN:tg8Sa8SNaIa8RNa8Pa8VN:tg8Sa8SNMM:rJbbbZNh8Sayaia8J2g3cdtfhHaya8Fa8J2gwcdtfhOayaLa8J2g8LcdtfhCa8Y:mh89aB:mh8:a81:mhZcbhAa8JhYJbbbbh8UJbbbbh8XJbbbbh8ZJbbbbh80Jbbbbh8YJbbbbh81JbbbbhBJbbbbhnJbbbbhcinasc;WbfaAfgecwfa8SaUaCIdbaHIdbg8P:tgRNa83aOIdba8P:tg8RNMgINUdbaeclfa8Sa86aRNa85a8RNMg8VNUdbaea8Sa88aRNa87a8RNMgRNUdbaecxfa8Sa89aINa8:a8VNa8PaZaRNMMMg8PNUdba8SaIa8VNNa80Mh80a8SaIaRNNa8YMh8Ya8Sa8VaRNNa81Mh81a8Sa8Pa8PNNa8WMh8Wa8SaIa8PNNa8UMh8Ua8Sa8Va8PNNa8XMh8Xa8SaRa8PNNa8ZMh8Za8SaIaINNaBMhBa8Sa8Va8VNNanMhna8SaRaRNNacMhcaHclfhHaCclfhCaOclfhOaAczfhAaYcufgYmbkavaic8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyavaLc8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyava8Fc8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyara3cltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkara8LcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkarawcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaKcifgKad6mbkkcbhOxekcehOcbhrkcbh8FdndnamcwGg9cmbJbbbbh8ZcbhJcbhocbhCxekcbhea5cbyd;S1jjbHjjjjbbhCascxfasyd2gHcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadalaQz:cjjjbabh8FcbhEcbh5inaba5cdtfh3cbheindnaQa8FaefydbgOcdtgifydbgYaQa3aec:W1jjbfydbcdtfydbgHcdtgwfydbgKSmbaXaHfRbbgLcv2aXaOfRbbgAfc;a1jjbfRbbg8AaAcv2aLfg8Lc;a1jjbfRbbg8KVcFeGTmbdnaKaY9nmba8Lcj1jjbfRbbcFeGmekaAcufhYdnaAaL9hmbaYcFeGce0mbahaifydbaH9hmekdndnaAclSmbaLcl9hmekdnaYcFeGce0mbahaifydbaH9hmdkaLcufcFeGce0mbagawfydbaO9hmekaDaEcx2fgAaHaOa8KcFeGgYEBdlaAaOaHaYEBdbaAaYa8AGcb9hBdwaEcefhEkaeclfgecx9hmbkdna5cifg5ad9pmba8Fcxfh8FaEcifaT9nmekkaETmdcbhiinJbbbbJbbjZaqaQaDaicx2fgAydlgKaAydbgYaAydwgHEgLcdtfydbc8S2fgeIdyg8S:va8SJbbbb9BEaeIdwaaaYaKaHEg8Fcx2fgHIdwgRNaeIdzaHIdbg8PNaeIdaMg8Sa8SMMaRNaeIdlaHIdlg8RNaeIdCaRNaeId3Mg8Sa8SMMa8RNaeIdba8PNaeIdxa8RNaeIdKMg8Sa8SMMa8PNaeId8KMMM:lNh80JbbbbJbbjZaqaQaYcdtfydbc8S2fgeIdyg8S:va8SJbbbb9BEaeIdwaaaKcx2fgHIdwg8VNaeIdzaHIdbg8WNaeIdaMg8Sa8SMMa8VNaeIdlaHIdlg8UNaeIdCa8VNaeId3Mg8Sa8SMMa8UNaeIdba8WNaeIdxa8UNaeIdKMg8Sa8SMMa8WNaeId8KMMM:lNh8YaAcwfh3aAclfhwdna8JTmbavaYc8S2fgOIdwa8VNaOIdza8WNaOIdaMg8Sa8SMMa8VNaOIdla8UNaOIdCa8VNaOId3Mg8Sa8SMMa8UNaOIdba8WNaOIdxa8UNaOIdKMg8Sa8SMMa8WNaOId8KMMMh8SayaKa8J2cdtfhHaraYa8J2cltfheaOIdyh8Xa8JhOinaHIdbgIaIa8XNaecxfIdba8VaecwfIdbNa8WaeIdbNa8UaeclfIdbNMMMgIaIM:tNa8SMh8SaHclfhHaeczfheaOcufgOmbkavaLc8S2fgOIdwaRNaOIdza8PNaOIdaMgIaIMMaRNaOIdla8RNaOIdCaRNaOId3MgIaIMMa8RNaOIdba8PNaOIdxa8RNaOIdKMgIaIMMa8PNaOId8KMMMhIaya8Fa8J2cdtfhHaraLa8J2cltfheaOIdyh8Wa8JhOinaHIdbg8Va8Va8WNaecxfIdbaRaecwfIdbNa8PaeIdbNa8RaeclfIdbNMMMg8Va8VM:tNaIMhIaHclfhHaeczfheaOcufgOmbka80aI:lMh80a8Ya8S:lMh8YkawaKa8Fa8Ya809FgeEBdbaAaYaLaeEBdba3a8Ya80aeEUdbaicefgiaE9hmbkasc;Wbfcbcj;qbz:ljjjb8Aa6heaEhHinasc;WbfaeydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbcefBdbaecxfheaHcufgHmbkcbhecbhHinasc;WbfaefgOydbhAaOaHBdbaAaHfhHaeclfgecj;qb9hmbkcbhea6hHinasc;WbfaHydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbgOcefBdbaSaOcdtfaeBdbaHcxfhHaEaecefge9hmbkadak9RgOci9Uh9kdnalTmbcbhea8MhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh0a9hcbalz:ljjjbh9maOcO9Uh9na9kce4h9oasydwh9pcbh8KcbhwdninaDaSawcdtfydbcx2fg3Idwg8Sac9Emea8Ka9k9pmeJFFuuhIdna9oaE9pmbaDaSa9ocdtfydbcx2fIdwJbb;aZNhIkdna8SaI9ETmba8San9ETmba8Ka9n0mdkdna9maQa3ydlgicdtg9qfydbgAfg9rRbba9maQa3ydbgLcdtg9sfydbgHfg9tRbbVmbaXaLfRbbh9udna9eaHcdtfgeclfydbgOaeydbgeSmbaOae9RhKa9paecitfheaaaAcx2fg8Lcwfh5a8Lclfh9vaaaHcx2fg8Acwfh9wa8Aclfh9xcbhHceh8Fdnindna8MaeydbcdtfydbgOaASmba8MaeclfydbcdtfydbgYaASmbaOaYSmbaaaYcx2fgYIdbaaaOcx2fgOIdbg8V:tg8Sa9xIdbaOIdlgR:tg8WNa8AIdba8V:tg8UaYIdlaR:tgIN:tg8Pa8Sa9vIdbaR:tg8XNa8LIdba8V:tg80aIN:tgRNaIa9wIdbaOIdwg8R:tg8YNa8WaYIdwa8R:tg8VN:tg8WaIa5Idba8R:tg81Na8Xa8VN:tgINa8Va8UNa8Ya8SN:tg8Ra8Va80Na81a8SN:tg8SNMMa8Pa8PNa8Wa8WNa8Ra8RNMMaRaRNaIaINa8Sa8SNMMN:rJbbj8:N9FmdkaecwfheaHcefgHaK6h8FaKaH9hmbkka8FceGTmba9ocefh9oxeka3cwfhHdndndndna9uc9:fPdebdkaLheina8MaecdtgefaiBdba8EaefydbgeaL9hmbxikkdnagahaha9sfydbaiSEa8Ea9sfydbgLcdtfydbgecu9hmba8Ea9qfydbheka8Ma9sfaiBdbaehika8MaLcdtfaiBdbka9tce86bba9rce86bbaHIdbg8Sanana8S9DEhna0cefh0cecda9uceSEa8Kfh8KkawcefgwaE9hmbkka0TmddnalTmbcbhKcbhiindna8MaicdtgefydbgOaiSmbaQaOcdtfydbh8FdnaiaQaefydb9hg3mbaqa8Fc8S2fgeaqaic8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdyka8JTmbavaOc8S2fgeavaic8S2gwfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9iaO2hLarhHa8JhAinaHaLfgeaHaKfgOIdbaeIdbMUdbaeclfgYaOclfIdbaYIdbMUdbaecwfgYaOcwfIdbaYIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbka3mbJbbbbJbbjZaqawfgeIdyg8S:va8SJbbbb9BEaeIdwaaa8Fcx2fgHIdwg8SNaeIdzaHIdbgINaeIdaMg8Va8VMMa8SNaeIdlaHIdlg8VNaeIdCa8SNaeId3Mg8Sa8SMMa8VNaeIdbaINaeIdxa8VNaeIdKMg8Sa8SMMaINaeId8KMMM:lNg8SaBaBa8S9DEhBkaKa9ifhKaicefgial9hmbkcbhHahheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOahaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHagheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhYabhecbhKindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Zac9FmbadhOxekina8ZJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgYaABdbaYclfaeclfydbBdbaYcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8ZdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8ZaAEh8ZaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Zac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhQabheinaXaeydbgAfRbbc3thKaecwfgLydbhHdndnahaAcdtg8FfydbaeclfgiydbgCSmbcbhYagaCcdtfydbaA9hmekcjjjj94hYkaeaKaYVaAVBdbaXaCfRbbc3thKdndnahaCcdtfydbaHSmbcbhYagaHcdtfydbaC9hmekcjjjj94hYkaiaKaYVaCVBdbaXaHfRbbc3thYdndnahaHcdtfydbaASmbcbhCaga8FfydbaH9hmekcjjjj94hCkaLaYaCVaHVBdbaecxfheaQcifgQaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd;O1jjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:nCoDud99rue99lul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd;S1jjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbh8Eindna3axa8EcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5a8Ecefg8Ead9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8FaD:Y:tgaa8FaK:Y:tgha5:ZggaH:tNNNaOaH:tahNa8Aag:tNa8AaH:taaNagaO:tNM:va8FMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg8EBdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbh5inaxa5cdtgYfydbgCcm4aC7c:v;t;h;Ev2gics4ai7hecbhidndnina3aeaAGgmcdtfgEydbgecuSmednaxaecdtgEfydbaCSmbaicefgiamfheaiaA9nmekka8EaEfydbhixekaEa5BdbaDhiaDcefhDka8EaYfaiBdba5cefg5ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hxdnadTmbdnalTmbaxcdth3a8EhCalheaqhmadhAinaEaCydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaea3fheamcxfhmaAcufgAmbxdkka8EhmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbg3Bd8KaecFeaYz:ljjjbh5dnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaEa8EydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna5aAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka8Eclfh8EaeaxfheaqcxfhqadaCcefgC9hmbkkaba5aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc;OwkxebbbdbbbjNbb",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(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var y=new Uint8Array(m.length),b=0;b96?x-97:x>64?x-39:x+4}for(var A=0,b=0;b=3),r(x>=0&&x<=m.length),r(x%3==0),r(A>=0);for(var S=0,v=0;v<(C?C.length:0);++v)r(C[v]in g),r(this.useExperimentalFeatures||C[v]!="Prune"),S|=g[C[v]];var P=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),M=u(n.exports.meshopt_simplify,P,m.length,y,y.length/b,b*4,x,A,S);return M[0]=m instanceof Uint32Array?M[0]:new m.constructor(M[0]),M},simplifyWithAttributes:function(m,y,b,x,A,C,S,v,P,M){r(this.useExperimentalFeatures),r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),r(x instanceof Float32Array),r(x.length%A==0),r(A>=0),r(S==null||S instanceof Uint8Array),r(S==null||S.length==y.length/b),r(v>=0&&v<=m.length),r(v%3==0),r(P>=0),r(Array.isArray(C)),r(A>=C.length),r(C.length<=32);for(var R=0;R=0);for(var L=0,R=0;R<(M?M.length:0);++R)r(M[R]in g),L|=g[M[R]];var F=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),_=f(n.exports.meshopt_simplifyWithAttributes,F,m.length,y,y.length/b,b*4,x,A*4,new Float32Array(C),S?new Uint8Array(S):null,v,P,L);return _[0]=m instanceof Uint32Array?_[0]:new m.constructor(_[0]),_},getScale:function(m,y){return r(m instanceof Float32Array),r(m.length%y==0),r(y>=3),h(n.exports.meshopt_simplifyScale,m,m.length/y,y*4)},simplifyPoints:function(m,y,b,x,A,C){return r(this.useExperimentalFeatures),r(m instanceof Float32Array),r(m.length%y==0),r(y>=3),r(b>=0&&b<=m.length/y),x?(r(x instanceof Float32Array),r(x.length%A==0),r(A>=3),r(m.length/y==x.length/A),p(n.exports.meshopt_simplifyPoints,m,m.length/y,y*4,x,A*4,C,b)):p(n.exports.meshopt_simplifyPoints,m,m.length/y,y*4,void 0,0,0,b)}}}();typeof c1=="object"&&typeof p9=="object"?p9.exports=tz:typeof define=="function"&&define.amd?define([],function(){return tz}):typeof c1=="object"?c1.MeshoptSimplifier=tz:(typeof self<"u"?self:c1).MeshoptSimplifier=tz});var Xre=Xn((l1,_9)=>{var nz=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgzBd9uakazBd9iakciBd:SeaPcbaxz:njjjbhHalci9UhOdnalTmbaihPalhAinaHaPydbcdtfgCaCydbcefBdbaPclfhPaAcufgAmbkkdnaoTmbcbhPashAaHhCaohXinaAaPBdbaAclfhAaCydbaPfhPaCclfhCaXcufgXmbkkdnalci6mbcbhPaihAinaAcwfydbhCaAclfydbhXasaAydbcdtfgQaQydbgQcefBdbazaQcdtfaPBdbasaXcdtfgXaXydbgXcefBdbazaXcdtfaPBdbasaCcdtfgCaCydbgCcefBdbazaCcdtfaPBdbaAcxfhAaOaPcefgP9hmbkkdnaoTmbaHhAashPaohCinaPaPydbaAydb9RBdbaAclfhAaPclfhPaCcufgCmbkkakamcbyd:e1jjbHjjjjbbgPBd9yakclBd:SeaPaHaxz:mjjjbhmakaOcbyd:e1jjbHjjjjbbgPBd9CakcvBd:SeaPcbaOz:njjjbhLakcuaOcK2alcjjjjd0Ecbyd:e1jjbHjjjjbbgKBd9GakcoBd:SeJbbbbhYdnalci6g8Ambarcd4hxaihAaKhPaOhrJbbbbhEinavaAclfydbax2cdtfgCIdlh3avaAydbax2cdtfgXIdlhYavaAcwfydbax2cdtfgQIdlh5aCIdwh8EaXIdwh8FaQIdwhaaPaCIdbghaXIdbggMaQIdbg8JMJbbnn:vUdbaPclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8KaCIdwh8LaXIdwh8MaPcxfa3aY:tg3aaa8F:tgaNa5aY:tg5a8Ea8F:tg8EN:tgYJbbbbJbbjZahag:tgha5Na8Jag:tgga3N:tg8Fa8FNaYaYNa8EagNaaahN:tgYaYNMM:rgg:vagJbbbb9BEg3NUdbaPczfaYa3NUdbaPcCfa8Fa3NUdbaPcwfa8Ka8Ma8LMMJbbnn:vUdbaEagMhEaAcxfhAaPcKfhParcufgrmbkaEaO:Z:vJbbbZNhYkakcuaOcdtalcFFFF970Ecbyd:e1jjbHjjjjbbgCBd9KakcrBd:SeaYaD:ZN:rhYdna8AmbcbhPaChAinaAaPBdbaAclfhAaOaPcefgP9hmbkkaYJbbbZNh8MakcuaOcltalcFFFFd0Ecbyd:e1jjbHjjjjbbg8ABd9OakcwBd:Secba8AaKaCaOz:djjjb8Aakaocbyd:e1jjbHjjjjbbgPBd2aPcFeaoz:njjjbhrakc8Wfcwf9cb83ibak9cb83i8WcbhPJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgcbhlinJbbbbh3dnaPTmbJbbjZaP:Z:vh3kaka8Ea3NgaUdaaka5a3NghUd3akaEa3Ng8JUdKJbbbbh3dnagagNaYaYNa8Fa8FNMMg8KJbbbb9BmbJbbjZa8K:r:vh3kakaga3NUd8Saka8Fa3NUdyakaYa3NUd8Kdndndnakyd8WgQakydUgAakcKfaeaiakc;abfaKamara8Maqz:ejjjbgCcuSmbdnaPaD9pmbaAaraiaCcx2fgXydbfRbbcFeSfaraXclfydbfRbbcFeSfaraXcwfydbfRbbcFeSfaw9nmdkaQaAcbaeaiakc;abfaKamara8MJbbbbz:ejjjbgCcu9hmekakaaUdCakahUdzaka8JUdxakcuBdwakcFFF;7rBdla8AcbaKaLakcxfakcwfakclfz:fjjjbakydwgCcuSmekdnakc8WfaiaCcx2fgOydbgPaOclfydbgAaOcwfydbgXarabaeadalawaDz:gjjjbTmbalcefhlJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz:njjjb8AkabalcltfgPak8Pi8W83dbaPcwfakc8Wfcwf8Pib83dbalcefhlkcahPdninaPc98Smeakc;mbfaPfydbcbydj1jjbH:bjjjbbaPc98fhPxbkkakc:Wef8Kjjjjbalk;3vivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbaeabcitfgrarydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark;Bloeue99vue99Due99dndnaembcuhkxekJbbjZaq:thxaiabcdtfhmavydbhPavydlhsavydwhzcbhHJFFuuhOcvhbcuhkindnaPamaHcdtfydbcdtgvfydbgATmbazasavfydbcdtfhiindndnawalaiydbgCcx2fgvclfydbgXfRbbcFeSawavydbgQfRbbcFeSfawavcwfydbgLfRbbcFeSfgKmbcbhvxekcehvaraQcdtfydbgYceSmbcehvaraXcdtfydbg8AceSmbcehvaraLcdtfydbgEceSmbdna8AcdSaYcdSfaEcdSfcd6mbaKcefhvxekaKcdfhvkdnavab9kmbdndnadTmbaoaCcK2fgQIdwadIdw:tg3a3NaQIdbadIdb:tg3a3NaQIdladIdl:tg3a3NMM:raD:vaxNJbbjZMJ9VO:d86JbbjZaQIdCadIdCNaQIdxadIdxNaQIdzadIdzNMMaqN:tg3a3J9VO:d869DENh3xekaraQcdtfydbaraXcdtfydbfaraLcdtfydbfc99f:Zh3kaCakavab6a3aO9DVgQEhkavabaQEhba3aOaQEhOkaiclfhiaAcufgAmbkkaHcefgHae9hmbkkakk;bddlue99dndndnabaecitfgrydlgwciGgDci9hmbarclfhqxekinabcbawcd4gwalaDcdtfIdbabaecitfIdb:tgkJbbbb9FEgDaecefgefadaialavaoz:fjjjbak:laoIdb9FTmdabaDaw7aefgecitfgrydlgwciGgDci9hmbkarclfhqkabaecitfhecuhbindnaiaeydbgDfRbbmbadaDcK2fgrIdwalIdw:tgkakNarIdbalIdb:tgkakNarIdlalIdl:tgkakNMM:rgkaoIdb9DTmbaoakUdbavaDBdbaqydbhwkaecwfheabcefgbawcd46mbkkk;yleoudnaladfgkRbbcFeSalaefgxRbbgmcFeSfabydwgPfalaifgsRbbcFeSfaD0abydxaq9pVgzce9hmbavawcltfgmab8Pdb83dbamcwfabcwfgm8Pdb83dbdndnamydbmbcbhqxekcbhDaohminalamabydbcdtfydbfcFe86bbamclfhmaDcefgDabydwgq6mbkkdnabydxglci2gDabydlgmfgPciGTmbaraPfcbalamcu7fciGcefz:njjjb8Aabydxci2hDabydlhmabydwhqkab9cb83dwababydbaqfBdbabaDcifc98GamfBdlaxRbbhmcbhPkdnamcFeGcFe9hmbaxaP86bbababydwgmcefBdwaoabydbcdtfamcdtfaeBdbkdnakRbbcFe9hmbakabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfadBdbkdnasRbbcFe9hmbasabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfaiBdbkarabydlfabydxci2faxRbb86bbarabydlfabydxci2fcefakRbb86bbarabydlfabydxci2fcdfasRbb86bbababydxcefBdxazk;Ckovud99euv99eul998Jjjjjbc:G;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:G:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaocafawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeao9cb83iKao9cb83izaoczfaocafawci2z1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:G:qefawz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:G:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:G:qefheaocafhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabazUd3abc8KfaxUdbabcafasUdbabcKfaCaxaPN:tUdbabcCfaXasaPN:tUdbabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabc8Ufae86bbdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabcRfav86bbdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:G;aef8Kjjjjbk:mvdouq99cbhi8Jjjjjbca9RglczfcwfcbBdbal9cb83izalcwfcbBdbal9cb83ibdnadTmbcbhvinaeaifhocbhrinalczfarfgwavawydbgwaoarfIdbgDaearawcx2ffIdb9DEBdbalarfgwavawydbgwaDaearawcx2ffIdb9EEBdbarclfgrcx9hmbkaicxfhiavcefgvad9hmbkkJbbbbhDcbhrcbhicbhvinaealarfydbcx2fgwIdwaealczfarfydbcx2fgoIdw:tgqaqNawIdbaoIdb:tgqaqNawIdlaoIdl:tgqaqNMMgqaDaqaD9EgwEhDavaiawEhiarclfhravcefgvci9hmbkaealczfaicdtgvfydbcx2fgrIdwaealavfydbcx2fglIdwMJbbbZNhqarIdlalIdlMJbbbZNhkarIdbalIdbMJbbbZNhxaD:rJbbbZNhDdnadTmbindnaecwfIdbgmaq:tgPaPNaeIdbgsax:tgPaPNaeclfIdbgzak:tgPaPNMMgPaDaDN9ETmbaqaDaP:rgH:vJbbbZNJbbbZMgPNamJbbjZaP:tgONMhqakaPNazaONMhkaxaPNasaONMhxaDaHMJbbbZNhDkaecxfheadcufgdmbkkabaDUdxabaqUdwabakUdlabaxUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Ylequ8Jjjjjbcjx9Rgl8Kjjjjbcbhvalcjqfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjqfaDcefRbbfRbb9RcFeGci6aoalcjqfaDRbbfRbb9RcFeGci6faoalcjqfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjqffaocefgo86bbaxalcjqffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjqffao86bbarcifhravcefgvad9hmbkalcFeaiz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkfgwRbbgDcFe9hmbawax86bbaocjdfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjdfaDz:mjjjb8Aalcjxf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",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(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var y=new Uint8Array(m.length),b=0;b96?x-97:x>64?x-39:x+4}for(var A=0,b=0;b=3),r(x<=255||x>0),r(A<=512),r(A%4==0),C=C||0;var S=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return f(S,y,y.length/b,b*4,x,A,C)},computeClusterBounds:function(m,y,b){r(m.length%3==0),r(m.length/3<=512),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3);var x=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return g(x,y,y.length/b,b*4)},computeMeshletBounds:function(m,y,b){return r(m.meshletCount!=0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),p(m,y,y.length/b,b*4)},extractMeshlet:function(m,y){return r(y>=0&&y{var dke=Wre(),hke=qre(),mke=Yre(),pke=Xre();Kre.exports={MeshoptEncoder:dke,MeshoptDecoder:hke,MeshoptSimplifier:mke,MeshoptClusterizer:pke}});var lue=Xn((WRn,cue)=>{"use strict";cue.exports=Eqe;var sL=1e20;function Eqe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,l,u,f,h,p,g,m,y;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,l=e,t.stride?f=t.stride:f=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,h=p.getContext("2d"),r=p.width,s=p.height,g=h.getImageData(0,0,r,s),l=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,h=e,r=p.width,s=p.height,g=h.getImageData(0,0,r,s),l=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,l=g.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(r*s),m=0,y=Math.floor(u.length/f);m{function Nqe(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,l=8,u=9,f=10,h=11,p=12,g=13,m=14,y=15,b=16,x=17,A=0,C=1,S=2,v=3,P=4;function M(_,w){return 55296<=_.charCodeAt(w)&&_.charCodeAt(w)<=56319&&56320<=_.charCodeAt(w+1)&&_.charCodeAt(w+1)<=57343}function R(_,w){w===void 0&&(w=0);var D=_.charCodeAt(w);if(55296<=D&&D<=56319&&w<_.length-1){var I=D,N=_.charCodeAt(w+1);return 56320<=N&&N<=57343?(I-55296)*1024+(N-56320)+65536:I}if(56320<=D&&D<=57343&&w>=1){var I=_.charCodeAt(w-1),N=D;return 55296<=I&&I<=56319?(I-55296)*1024+(N-56320)+65536:N}return D}function L(_,w,D){var I=[_].concat(w).concat([D]),N=I[I.length-2],k=D,z=I.lastIndexOf(m);if(z>1&&I.slice(1,z).every(function(U){return U==i})&&[i,g,x].indexOf(_)==-1)return S;var V=I.lastIndexOf(o);if(V>0&&I.slice(1,V).every(function(U){return U==o})&&[p,o].indexOf(N)==-1)return I.filter(function(U){return U==o}).length%2==1?v:P;if(N==e&&k==t)return A;if(N==n||N==e||N==t)return k==m&&w.every(function(U){return U==i})?S:C;if(k==n||k==e||k==t)return C;if(N==s&&(k==s||k==a||k==u||k==f))return A;if((N==u||N==a)&&(k==a||k==l))return A;if((N==f||N==l)&&k==l)return A;if(k==i||k==y)return A;if(k==r)return A;if(N==p)return A;var j=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,x].indexOf(I[j])!=-1&&I.slice(j+1,-1).every(function(U){return U==i})&&k==m||N==y&&[b,x].indexOf(k)!=-1?A:w.indexOf(o)!=-1?S:N==o&&k==o?A:C}this.nextBreak=function(_,w){if(w===void 0&&(w=0),w<0)return 0;if(w>=_.length-1)return _.length;for(var D=F(R(_,w)),I=[],N=w+1;N<_.length;N++)if(!M(_,N-1)){var k=F(R(_,N));if(L(D,I,k))return N;I.push(k)}return _.length},this.splitGraphemes=function(_){for(var w=[],D=0,I;(I=this.nextBreak(_,D))<_.length;)w.push(_.slice(D,I)),D=I;return D<_.length&&w.push(_.slice(D)),w},this.iterateGraphemes=function(_){var w=0,D={next:function(){var I,N;return(N=this.nextBreak(_,w))<_.length?(I=_.slice(w,N),w=N,{value:I,done:!1}):w<_.length?(I=_.slice(w),w=_.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(D[Symbol.iterator]=function(){return D}),D},this.countGraphemes=function(_){for(var w=0,D=0,I;(I=this.nextBreak(_,D))<_.length;)D=I,w++;return D<_.length&&w++,w};function F(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?o:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?r:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?l:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?y:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?b:128102<=_&&_<=128105?x:h}return this}typeof kz<"u"&&kz.exports&&(kz.exports=Nqe)});var npe=Xn((T7,A7)=>{(function(e,t){typeof T7=="object"&&typeof A7<"u"?A7.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.RBush=t())})(T7,function(){"use strict";function e(C,S,v,P,M){t(C,S,v||0,P||C.length-1,M||i)}function t(C,S,v,P,M){for(;P>v;){if(P-v>600){var R=P-v+1,L=S-v+1,F=Math.log(R),_=.5*Math.exp(2*F/3),w=.5*Math.sqrt(F*_*(R-_)/R)*(L-R/2<0?-1:1),D=Math.max(v,Math.floor(S-L*_/R+w)),I=Math.min(P,Math.floor(S+(R-L)*_/R+w));t(C,S,D,I,M)}var N=C[S],k=v,z=P;for(n(C,v,S),M(C[P],N)>0&&n(C,v,P);k0;)z--}M(C[v],N)===0?n(C,v,z):(z++,n(C,z,P)),z<=S&&(v=z+1),S<=z&&(P=z-1)}}function n(C,S,v){var P=C[S];C[S]=C[v],C[v]=P}function i(C,S){return CS?1:0}var o=function(S){S===void 0&&(S=9),this._maxEntries=Math.max(4,S),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(S){var v=this.data,P=[];if(!b(S,v))return P;for(var M=this.toBBox,R=[];v;){for(var L=0;L=0&&R[v].children.length>this._maxEntries;)this._split(R,v),v--;this._adjustParentBBoxes(M,R,v)},o.prototype._split=function(S,v){var P=S[v],M=P.children.length,R=this._minEntries;this._chooseSplitAxis(P,R,M);var L=this._chooseSplitIndex(P,R,M),F=x(P.children.splice(L,P.children.length-L));F.height=P.height,F.leaf=P.leaf,s(P,this.toBBox),s(F,this.toBBox),v?S[v-1].children.push(F):this._splitRoot(P,F)},o.prototype._splitRoot=function(S,v){this.data=x([S,v]),this.data.height=S.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(S,v,P){for(var M,R=1/0,L=1/0,F=v;F<=P-v;F++){var _=a(S,0,F,this.toBBox),w=a(S,F,P,this.toBBox),D=m(_,w),I=h(_)+h(w);D=v;I--){var N=S.children[I];l(F,S.leaf?R(N):N),_+=p(F)}return _},o.prototype._adjustParentBBoxes=function(S,v,P){for(var M=P;M>=0;M--)l(v[M],S)},o.prototype._condense=function(S){for(var v=S.length-1,P=void 0;v>=0;v--)S[v].children.length===0?v>0?(P=S[v-1].children,P.splice(P.indexOf(S[v]),1)):this.clear():s(S[v],this.toBBox)};function r(C,S,v){if(!v)return S.indexOf(C);for(var P=0;P=C.minX&&S.maxY>=C.minY}function x(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(C,S,v,P,M){for(var R=[S,v];R.length;)if(v=R.pop(),S=R.pop(),!(v-S<=P)){var L=S+Math.ceil((v-S)/P/2)*P;e(C,L,S,v,M),R.push(S,L,L,v)}}return o})});var xge=Xn((R8,bge)=>{(function(e,t){typeof R8=="object"&&typeof bge<"u"?t(R8):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(R8,function(e){"use strict";function t(C){return C}function n(C){if(C==null)return t;var S,v,P=C.scale[0],M=C.scale[1],R=C.translate[0],L=C.translate[1];return function(F,_){_||(S=v=0);var w=2,D=F.length,I=new Array(D);for(I[0]=(S+=F[0])*P+R,I[1]=(v+=F[1])*M+L;wR&&(R=w[0]),w[1]L&&(L=w[1])}function _(w){switch(w.type){case"GeometryCollection":w.geometries.forEach(_);break;case"Point":F(w.coordinates);break;case"MultiPoint":w.coordinates.forEach(F);break}}C.arcs.forEach(function(w){for(var D=-1,I=w.length,N;++DR&&(R=N[0]),N[1]L&&(L=N[1])});for(v in C.objects)_(C.objects[v]);return[P,M,R,L]}function o(C,S){for(var v,P=C.length,M=P-S;M<--P;)v=C[M],C[M++]=C[P],C[P]=v}function r(C,S){return typeof S=="string"&&(S=C.objects[S]),S.type==="GeometryCollection"?{type:"FeatureCollection",features:S.geometries.map(function(v){return s(C,v)})}:s(C,S)}function s(C,S){var v=S.id,P=S.bbox,M=S.properties==null?{}:S.properties,R=a(C,S);return v==null&&P==null?{type:"Feature",properties:M,geometry:R}:P==null?{type:"Feature",id:v,properties:M,geometry:R}:{type:"Feature",id:v,bbox:P,properties:M,geometry:R}}function a(C,S){var v=n(C.transform),P=C.arcs;function M(D,I){I.length&&I.pop();for(var N=P[D<0?~D:D],k=0,z=N.length;k1)P=h(C,S,v);else for(M=0,P=new Array(R=C.arcs.length);M1)for(var I=1,N=F(w[0]),k,z;IN&&(z=w[0],w[0]=w[I],w[I]=z,N=k);return w}).filter(function(_){return _.length>0})}}function y(C,S){for(var v=0,P=C.length;v>>1;C[M]=2))throw new Error("n must be \u22652");_=C.bbox||i(C);var v=_[0],P=_[1],M=_[2],R=_[3],L;S={scale:[M-v?(M-v)/(L-1):1,R-P?(R-P)/(L-1):1],translate:[v,P]}}else _=C.bbox;var F=x(S),_,w,D=C.objects,I={};function N(V){return F(V)}function k(V){var j;switch(V.type){case"GeometryCollection":j={type:"GeometryCollection",geometries:V.geometries.map(k)};break;case"Point":j={type:"Point",coordinates:N(V.coordinates)};break;case"MultiPoint":j={type:"MultiPoint",coordinates:V.coordinates.map(N)};break;default:return V}return V.id!=null&&(j.id=V.id),V.bbox!=null&&(j.bbox=V.bbox),V.properties!=null&&(j.properties=V.properties),j}function z(V){var j=0,U=1,q=V.length,Y,te=new Array(q);for(te[0]=F(V[0],0);++j{"use strict";Object.defineProperty(N8,"__esModule",{value:!0});N8.version=void 0;N8.version="4.1.0"});var IT=Xn(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});cg.isUndefined=zge;cg.isBoolean=irt;cg.defaults=ort;cg.ellipsis=rrt;cg.remove=srt;cg.removeWithPredicate=art;cg.assertNever=crt;function zge(e){return e===void 0}function irt(e){return typeof e=="boolean"}function ort(e,t){for(var n in t)t.hasOwnProperty(n)&&zge(e[n])&&(e[n]=t[n]);return e}function rrt(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function srt(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function art(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function crt(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}});var OT=Xn(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.alphaNumericAndMarksRe=Ii.alphaNumericAndMarksCharsStr=Ii.alphaNumericCharsRe=Ii.decimalNumbersStr=Ii.alphaCharsAndMarksStr=Ii.marksStr=Ii.emojiStr=Ii.alphaCharsStr=Ii.controlCharsRe=Ii.quoteRe=Ii.whitespaceRe=Ii.nonDigitRe=Ii.digitRe=Ii.letterRe=void 0;Ii.letterRe=/[A-Za-z]/;Ii.digitRe=/[\d]/;Ii.nonDigitRe=/[\D]/;Ii.whitespaceRe=/\s/;Ii.quoteRe=/['"]/;Ii.controlCharsRe=/[\x00-\x1F\x7F]/;Ii.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;Ii.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;Ii.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;Ii.alphaCharsAndMarksStr=Ii.alphaCharsStr+Ii.emojiStr+Ii.marksStr;Ii.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;Ii.alphaNumericCharsRe=new RegExp("[".concat(Ii.alphaCharsStr+Ii.decimalNumbersStr,"]"));Ii.alphaNumericAndMarksCharsStr=Ii.alphaCharsAndMarksStr+Ii.decimalNumbersStr;Ii.alphaNumericAndMarksRe=new RegExp("[".concat(Ii.alphaNumericAndMarksCharsStr,"]"))});var k8=Xn(B8=>{"use strict";Object.defineProperty(B8,"__esModule",{value:!0});B8.HtmlTag=void 0;var F8=OT(),lrt=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(F8.whitespaceRe):[],o=t.split(F8.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(F8.whitespaceRe):[],o=t.split(F8.whitespaceRe),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),""].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}();B8.HtmlTag=lrt});var Hge=Xn(GY=>{"use strict";Object.defineProperty(GY,"__esModule",{value:!0});GY.truncateSmart=urt;function urt(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(A){var C={},S=A,v=S.match(/^([a-z]+):\/\//i);return v&&(C.scheme=v[1],S=S.substr(v[0].length)),v=S.match(/^(.*?)(?=(\?|#|\/|$))/i),v&&(C.host=v[1],S=S.substr(v[0].length)),v=S.match(/^\/(.*?)(?=(\?|#|$))/i),v&&(C.path=v[1],S=S.substr(v[0].length)),v=S.match(/^\?(.*?)(?=(#|$))/i),v&&(C.query=v[1],S=S.substr(v[0].length)),v=S.match(/^#(.*?)$/i),v&&(C.fragment=v[1]),C},s=function(A){var C="";return A.scheme&&A.host&&(C+=A.scheme+"://"),A.host&&(C+=A.host),A.path&&(C+="/"+A.path),A.query&&(C+="?"+A.query),A.fragment&&(C+="#"+A.fragment),C},a=function(A,C){var S=C/2,v=Math.ceil(S),P=-1*Math.floor(S),M="";return P<0&&(M=A.substr(P)),A.substr(0,v)+n+M};if(e.length<=t)return e;var l=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=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var h="";if(u.host&&(h+=u.host),h.length>=l)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,l+i):a(h,l).substr(0,l+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((h+p).length>=l){if((h+p).length==t)return(h+p).substr(0,t);var g=l-h.length;return(h+a(p,g)).substr(0,l+i)}else h+=p;if(u.fragment){var m="#"+u.fragment;if((h+m).length>=l){if((h+m).length==t)return(h+m).substr(0,t);var y=l-h.length;return(h+a(m,y)).substr(0,l+i)}else h+=m}if(u.scheme&&u.host){var b=u.scheme+"://";if((h+b).length0&&(x=h.substr(-1*Math.floor(l/2))),(h.substr(0,Math.ceil(l/2))+n+x).substr(0,l+i)}});var Gge=Xn(jY=>{"use strict";Object.defineProperty(jY,"__esModule",{value:!0});jY.truncateMiddle=frt;function frt(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}});var jge=Xn(WY=>{"use strict";Object.defineProperty(WY,"__esModule",{value:!0});WY.truncateEnd=hrt;var drt=IT();function hrt(e,t,n){return(0,drt.ellipsis)(e,t,n)}});var qY=Xn(U8=>{"use strict";Object.defineProperty(U8,"__esModule",{value:!0});U8.AnchorTagBuilder=void 0;var mrt=k8(),prt=Hge(),_rt=Gge(),grt=jge(),yrt=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 mrt.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.lengthpye,__assign:()=>V8,__asyncDelegator:()=>aye,__asyncGenerator:()=>sye,__asyncValues:()=>cye,__await:()=>jS,__awaiter:()=>eye,__classPrivateFieldGet:()=>dye,__classPrivateFieldIn:()=>mye,__classPrivateFieldSet:()=>hye,__createBinding:()=>H8,__decorate:()=>Yge,__disposeResources:()=>_ye,__esDecorate:()=>Kge,__exportStar:()=>nye,__extends:()=>Wge,__generator:()=>tye,__importDefault:()=>fye,__importStar:()=>uye,__makeTemplateObject:()=>lye,__metadata:()=>Jge,__param:()=>Xge,__propKey:()=>Zge,__read:()=>KY,__rest:()=>qge,__rewriteRelativeImportExtension:()=>gye,__runInitializers:()=>$ge,__setFunctionName:()=>Qge,__spread:()=>iye,__spreadArray:()=>rye,__spreadArrays:()=>oye,__values:()=>z8,default:()=>Trt});function Wge(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");YY(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function qge(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=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}function Xge(e,t){return function(n,i){t(n,i,e)}}function Kge(e,t,n,i,o,r){function s(x){if(x!==void 0&&typeof x!="function")throw new TypeError("Function expected");return x}for(var a=i.kind,l=a==="getter"?"get":a==="setter"?"set":"value",u=!t&&e?i.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),h,p=!1,g=n.length-1;g>=0;g--){var m={};for(var y in i)m[y]=y==="access"?{}:i[y];for(var y in i.access)m.access[y]=i.access[y];m.addInitializer=function(x){if(p)throw new TypeError("Cannot add initializers after decoration has completed");r.push(s(x||null))};var b=(0,n[g])(a==="accessor"?{get:f.get,set:f.set}:f[l],m);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(h=s(b.get))&&(f.get=h),(h=s(b.set))&&(f.set=h),(h=s(b.init))&&o.unshift(h)}else(h=s(b))&&(a==="field"?o.unshift(h):f[l]=h)}u&&Object.defineProperty(u,i.name,f),p=!0}function $ge(e,t,n){for(var i=arguments.length>2,o=0;o0&&r[r.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]=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 KY(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),o,r=[],s;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return r}function iye(){for(var e=[],t=0;t1||l(g,y)})},m&&(o[g]=m(o[g])))}function l(g,m){try{u(i[g](m))}catch(y){p(r[0][3],y)}}function u(g){g.value instanceof jS?Promise.resolve(g.value.v).then(f,h):p(r[0][2],g)}function f(g){l("next",g)}function h(g){l("throw",g)}function p(g,m){g(m),r.shift(),r.length&&l(r[0][0],r[0][1])}}function aye(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(s){return(n=!n)?{value:jS(e[o](s)),done:!1}:r?r(s):s}:r}}function cye(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 z8=="function"?z8(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(s){return new Promise(function(a,l){s=e[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(u){r({value:u,done:a})},s)}}function lye(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function uye(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=XY(e),i=0;i{YY=function(e,t){return YY=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])},YY(e,t)};V8=function(){return V8=Object.assign||function(t){for(var n,i=1,o=arguments.length;i{"use strict";Object.defineProperty(G8,"__esModule",{value:!0});G8.AbstractMatch=void 0;var Art=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}();G8.AbstractMatch=Art});var yye=Xn(MT=>{"use strict";Object.defineProperty(MT,"__esModule",{value:!0});MT.tldRegex=MT.tldRegexStr=void 0;MT.tldRegexStr="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|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--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|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|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|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|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|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|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|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|banamex|bauhaus|bentley|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|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|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|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|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\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|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|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|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|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|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|lipsy|loans|locus|lotte|lotto|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|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|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|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|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|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|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|scb|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|\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)";MT.tldRegex=new RegExp("^"+MT.tldRegexStr+"$")});var j8=Xn(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.tldUrlHostRe=pi.schemeUrlRe=pi.invalidSchemeRe=pi.urlSuffixedCharsNotAllowedAtEndRe=pi.httpSchemePrefixRe=pi.httpSchemeRe=pi.urlSuffixNotAllowedAsLastCharRe=pi.urlSuffixAllowedSpecialCharsRe=pi.urlSuffixStartCharsRe=pi.domainNameCharRegex=void 0;pi.isSchemeStartChar=Ert;pi.isSchemeChar=Srt;pi.isDomainLabelStartChar=bye;pi.isDomainLabelChar=wrt;pi.isPathChar=vrt;pi.isUrlSuffixStartChar=Drt;pi.isKnownTld=xye;pi.isValidSchemeUrl=Prt;pi.isValidTldMatch=Irt;pi.isValidIpV4Address=Mrt;var LT=OT(),Crt=yye();pi.domainNameCharRegex=LT.alphaNumericAndMarksRe;pi.urlSuffixStartCharsRe=/[\/?#]/;pi.urlSuffixAllowedSpecialCharsRe=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/;pi.urlSuffixNotAllowedAsLastCharRe=/[?!:,.;^]/;pi.httpSchemeRe=/https?:\/\//i;pi.httpSchemePrefixRe=new RegExp("^"+pi.httpSchemeRe.source,"i");pi.urlSuffixedCharsNotAllowedAtEndRe=new RegExp(pi.urlSuffixNotAllowedAsLastCharRe.source+"$");pi.invalidSchemeRe=/^(javascript|vbscript):/i;pi.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;pi.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;function Ert(e){return LT.letterRe.test(e)}function Srt(e){return LT.letterRe.test(e)||LT.digitRe.test(e)||e==="+"||e==="-"||e==="."}function bye(e){return LT.alphaNumericAndMarksRe.test(e)}function wrt(e){return e==="_"||bye(e)}function vrt(e){return LT.alphaNumericAndMarksRe.test(e)||pi.urlSuffixAllowedSpecialCharsRe.test(e)||pi.urlSuffixNotAllowedAsLastCharRe.test(e)}function Drt(e){return pi.urlSuffixStartCharsRe.test(e)}function xye(e){return Crt.tldRegex.test(e.toLowerCase())}function Prt(e){if(pi.invalidSchemeRe.test(e))return!1;var t=e.match(pi.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!LT.letterRe.test(i))}function Irt(e){var t=e.match(pi.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!!xye(o)}var Ort=/^(?:(?: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]?)$/,Rrt=/[:/?#]/;function Mrt(e){var t=e.split(Rrt,1)[0];return Ort.test(t)}});var $Y=Xn(W8=>{"use strict";Object.defineProperty(W8,"__esModule",{value:!0});W8.UrlMatch=void 0;var Lrt=($m(),nm(Km)),Nrt=RT(),Frt=j8(),Brt=/^(https?:\/\/)?(www\.)?/i,krt=/^\/\//,Urt=function(e){Lrt.__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(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=Hrt(n)),this.stripPrefix.scheme&&(n=Vrt(n)),this.stripPrefix.www&&(n=zrt(n)),this.stripTrailingSlash&&(n=Grt(n)),this.decodePercentEncoding&&(n=jrt(n)),n},t}(Nrt.AbstractMatch);W8.UrlMatch=Urt;function Vrt(e){return e.replace(Frt.httpSchemePrefixRe,"")}function zrt(e){return e.replace(Brt,"$1")}function Hrt(e){return e.replace(krt,"")}function Grt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function jrt(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}}});var Aye=Xn(NT=>{"use strict";Object.defineProperty(NT,"__esModule",{value:!0});NT.mailtoSchemePrefixRe=void 0;NT.isEmailLocalPartStartChar=Yrt;NT.isEmailLocalPartChar=Xrt;NT.isValidEmail=Krt;var Tye=OT(),Wrt=j8();NT.mailtoSchemePrefixRe=/^mailto:/i;var qrt=new RegExp("[".concat(Tye.alphaNumericAndMarksCharsStr,"!#$%&'*+/=?^_`{|}~-]"));function Yrt(e){return Tye.alphaNumericAndMarksRe.test(e)}function Xrt(e){return qrt.test(e)}function Krt(e){var t=e.split(".").pop()||"";return(0,Wrt.isKnownTld)(t)}});var ZY=Xn(q8=>{"use strict";Object.defineProperty(q8,"__esModule",{value:!0});q8.EmailMatch=void 0;var $rt=($m(),nm(Km)),Zrt=RT(),Qrt=function(e){$rt.__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}(Zrt.AbstractMatch);q8.EmailMatch=Qrt});var QY=Xn(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});WS.hashtagServices=void 0;WS.isHashtagTextChar=est;WS.isValidHashtag=tst;var Jrt=OT();function est(e){return e==="_"||Jrt.alphaNumericAndMarksRe.test(e)}function tst(e){return e.length<=140}WS.hashtagServices=["twitter","facebook","instagram","tiktok","youtube"]});var JY=Xn(Y8=>{"use strict";Object.defineProperty(Y8,"__esModule",{value:!0});Y8.HashtagMatch=void 0;var nst=($m(),nm(Km)),ist=IT(),ost=RT(),rst=function(e){nst.__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;case"youtube":return"https://youtube.com/hashtag/"+i;default:throw(0,ist.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}(ost.AbstractMatch);Y8.HashtagMatch=rst});var eX=Xn(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});qS.mentionServices=void 0;qS.isMentionTextChar=cst;qS.isValidMention=lst;var sst={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/},ast=/[-\w.]/;function cst(e){return ast.test(e)}function lst(e,t){var n=sst[t];return n.test(e)}qS.mentionServices=["twitter","instagram","soundcloud","tiktok","youtube"]});var tX=Xn(X8=>{"use strict";Object.defineProperty(X8,"__esModule",{value:!0});X8.MentionMatch=void 0;var ust=($m(),nm(Km)),fst=IT(),dst=RT(),hst=function(e){ust.__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;case"youtube":return"https://youtube.com/@"+this.mention;default:throw(0,fst.assertNever)(this.serviceName),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}(dst.AbstractMatch);X8.MentionMatch=hst});var Cye=Xn(MF=>{"use strict";Object.defineProperty(MF,"__esModule",{value:!0});MF.isPhoneNumberSeparatorChar=xst;MF.isPhoneNumberControlChar=Tst;MF.isValidPhoneNumber=Ast;var mst=/[-. ]/,pst=/[-. ()]/,_st=/[,;]/,gst=/(?:(?:(?:(\+)?\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]+#?)*/,yst=/(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})/,bst=new RegExp("^".concat(gst.source,"|").concat(yst.source,"$"));function xst(e){return mst.test(e)}function Tst(e){return _st.test(e)}function Ast(e){var t=e.charAt(0)==="+"||pst.test(e);return t&&bst.test(e)}});var nX=Xn(K8=>{"use strict";Object.defineProperty(K8,"__esModule",{value:!0});K8.PhoneMatch=void 0;var Cst=($m(),nm(Km)),Est=RT(),Sst=function(e){Cst.__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}(Est.AbstractMatch);K8.PhoneMatch=Sst});var aX=Xn(Z8=>{"use strict";Object.defineProperty(Z8,"__esModule",{value:!0});Z8.parseMatches=Ost;Z8.excludeUnbalancedTrailingBracesAndPunctuation=wye;var Wa=OT(),wst=$Y(),vo=IT(),$o=j8(),YS=Aye(),vst=ZY(),iX=QY(),Dst=JY(),oX=eX(),Pst=tX(),XS=Cye(),Ist=nX();function Ost(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,l=[],u=e.length,f=[],h=0;h=0;g--){var m=f[g];switch(m.state){case 11:M(m,p);break;case 12:R(m,p);break;case 0:A(m,p);break;case 1:C(m,p);break;case 2:S(m,p);break;case 3:v(m,p);break;case 4:P(m,p);break;case 5:L(m,p);break;case 6:F(m,p);break;case 7:_(m,p);break;case 13:w(m,p);break;case 14:D(m,p);break;case 8:I(m,p);break;case 9:N(m,p);break;case 10:k(m,p);break;case 15:z(m,p);break;case 16:V(m,p);break;case 17:j(m,p);break;case 18:U(m,p);break;case 19:q(m,p);break;case 20:Y(m,p);break;case 21:te(m,p);break;case 22:K(m,p);break;case 23:Z(m,p);break;case 24:ee(m,p);break;case 25:me(m,p);break;case 26:Te(m,p);break;case 27:ue(m,p);break;case 28:ye(m,p);break;case 29:Ae(m,p);break;case 30:Pe(m,p);break;case 31:Ee(m,p);break;case 32:qe(m,p);break;case 33:it(m,p);break;case 34:Dt(m,p);break;case 35:jt(m,p);break;case 36:$e(m,p);break;case 37:ze(m,p);break;case 38:un(m,p);break;case 39:zt(m,p);break;case 40:Ct(m,p);break;case 41:Ei(m,p);break;default:(0,vo.assertNever)(m.state)}}if(h>0&&(0,$o.isSchemeStartChar)(p)){var y=e.charAt(h-1);!(0,$o.isSchemeStartChar)(y)&&!f.some(Bst)&&f.push($8(h,0))}}}for(var b=f.length-1;b>=0;b--)f.forEach(function(_e){return an(_e)});return l;function x(_e){if(_e==="#")f.push(Nst(h,28));else if(_e==="@")f.push(Fst(h,30));else if(_e==="/")f.push(rX(h,11));else if(_e==="+")f.push(sX(h,37));else if(_e==="(")f.push(sX(h,32));else{if(Wa.digitRe.test(_e)&&(f.push(sX(h,38)),f.push(Mst(h,13))),(0,YS.isEmailLocalPartStartChar)(_e)){var Ce=_e.toLowerCase()==="m"?15:22;f.push(Lst(h,Ce))}(0,$o.isSchemeStartChar)(_e)&&f.push($8(h,0)),Wa.alphaNumericAndMarksRe.test(_e)&&f.push(rX(h,5))}}function A(_e,Ce){Ce===":"?_e.state=2:Ce==="-"?_e.state=1:(0,$o.isSchemeChar)(Ce)||(0,vo.remove)(f,_e)}function C(_e,Ce){Ce==="-"||(Ce==="/"?((0,vo.remove)(f,_e),f.push(rX(h,11))):(0,$o.isSchemeChar)(Ce)?_e.state=0:(0,vo.remove)(f,_e))}function S(_e,Ce){Ce==="/"?_e.state=3:Ce==="."?(0,vo.remove)(f,_e):(0,$o.isDomainLabelStartChar)(Ce)?(_e.state=5,(0,$o.isSchemeStartChar)(Ce)&&f.push($8(h,0))):(0,vo.remove)(f,_e)}function v(_e,Ce){Ce==="/"?_e.state=4:(0,$o.isPathChar)(Ce)?(_e.state=10,_e.acceptStateReached=!0):an(_e)}function P(_e,Ce){Ce==="/"?_e.state=10:(0,$o.isDomainLabelStartChar)(Ce)?(_e.state=5,_e.acceptStateReached=!0):(0,vo.remove)(f,_e)}function M(_e,Ce){Ce==="/"?_e.state=12:(0,vo.remove)(f,_e)}function R(_e,Ce){(0,$o.isDomainLabelStartChar)(Ce)?_e.state=5:(0,vo.remove)(f,_e)}function L(_e,Ce){Ce==="."?_e.state=7:Ce==="-"?_e.state=6:Ce===":"?_e.state=8:(0,$o.isUrlSuffixStartChar)(Ce)?_e.state=10:(0,$o.isDomainLabelChar)(Ce)||an(_e)}function F(_e,Ce){Ce==="-"||(Ce==="."?an(_e):(0,$o.isDomainLabelStartChar)(Ce)?_e.state=5:an(_e))}function _(_e,Ce){Ce==="."?an(_e):(0,$o.isDomainLabelStartChar)(Ce)?(_e.state=5,_e.acceptStateReached=!0):an(_e)}function w(_e,Ce){Ce==="."?_e.state=14:Ce===":"?_e.state=8:Wa.digitRe.test(Ce)||((0,$o.isUrlSuffixStartChar)(Ce)?_e.state=10:Wa.alphaNumericAndMarksRe.test(Ce)?(0,vo.remove)(f,_e):an(_e))}function D(_e,Ce){Wa.digitRe.test(Ce)?(_e.octetsEncountered++,_e.octetsEncountered===4&&(_e.acceptStateReached=!0),_e.state=13):an(_e)}function I(_e,Ce){Wa.digitRe.test(Ce)?_e.state=9:an(_e)}function N(_e,Ce){Wa.digitRe.test(Ce)||((0,$o.isUrlSuffixStartChar)(Ce)?_e.state=10:an(_e))}function k(_e,Ce){(0,$o.isPathChar)(Ce)||an(_e)}function z(_e,Ce){Ce.toLowerCase()==="a"?_e.state=16:K(_e,Ce)}function V(_e,Ce){Ce.toLowerCase()==="i"?_e.state=17:K(_e,Ce)}function j(_e,Ce){Ce.toLowerCase()==="l"?_e.state=18:K(_e,Ce)}function U(_e,Ce){Ce.toLowerCase()==="t"?_e.state=19:K(_e,Ce)}function q(_e,Ce){Ce.toLowerCase()==="o"?_e.state=20:K(_e,Ce)}function Y(_e,Ce){Ce.toLowerCase()===":"?_e.state=21:K(_e,Ce)}function te(_e,Ce){(0,YS.isEmailLocalPartChar)(Ce)?_e.state=22:(0,vo.remove)(f,_e)}function K(_e,Ce){Ce==="."?_e.state=23:Ce==="@"?_e.state=24:(0,YS.isEmailLocalPartChar)(Ce)?_e.state=22:(0,vo.remove)(f,_e)}function Z(_e,Ce){Ce==="."||Ce==="@"?(0,vo.remove)(f,_e):(0,YS.isEmailLocalPartChar)(Ce)?_e.state=22:(0,vo.remove)(f,_e)}function ee(_e,Ce){(0,$o.isDomainLabelStartChar)(Ce)?_e.state=25:(0,vo.remove)(f,_e)}function me(_e,Ce){Ce==="."?_e.state=27:Ce==="-"?_e.state=26:(0,$o.isDomainLabelChar)(Ce)||an(_e)}function Te(_e,Ce){Ce==="-"||Ce==="."?an(_e):(0,$o.isDomainLabelChar)(Ce)?_e.state=25:an(_e)}function ue(_e,Ce){Ce==="."||Ce==="-"?an(_e):(0,$o.isDomainLabelStartChar)(Ce)?(_e.state=25,_e.acceptStateReached=!0):an(_e)}function ye(_e,Ce){(0,iX.isHashtagTextChar)(Ce)?(_e.state=29,_e.acceptStateReached=!0):(0,vo.remove)(f,_e)}function Ae(_e,Ce){(0,iX.isHashtagTextChar)(Ce)||an(_e)}function Pe(_e,Ce){(0,oX.isMentionTextChar)(Ce)?(_e.state=31,_e.acceptStateReached=!0):(0,vo.remove)(f,_e)}function Ee(_e,Ce){(0,oX.isMentionTextChar)(Ce)||(Wa.alphaNumericAndMarksRe.test(Ce)?(0,vo.remove)(f,_e):an(_e))}function ze(_e,Ce){Wa.digitRe.test(Ce)?_e.state=38:((0,vo.remove)(f,_e),x(Ce))}function qe(_e,Ce){Wa.digitRe.test(Ce)?_e.state=33:(0,vo.remove)(f,_e),x(Ce)}function it(_e,Ce){Wa.digitRe.test(Ce)?_e.state=34:(0,vo.remove)(f,_e)}function Dt(_e,Ce){Wa.digitRe.test(Ce)?_e.state=35:(0,vo.remove)(f,_e)}function jt(_e,Ce){Ce===")"?_e.state=36:(0,vo.remove)(f,_e)}function $e(_e,Ce){Wa.digitRe.test(Ce)?_e.state=38:(0,XS.isPhoneNumberSeparatorChar)(Ce)?_e.state=39:(0,vo.remove)(f,_e)}function un(_e,Ce){_e.acceptStateReached=!0,(0,XS.isPhoneNumberControlChar)(Ce)?_e.state=40:Ce==="#"?_e.state=41:Wa.digitRe.test(Ce)||(Ce==="("?_e.state=32:(0,XS.isPhoneNumberSeparatorChar)(Ce)?_e.state=39:(an(_e),(0,$o.isSchemeStartChar)(Ce)&&f.push($8(h,0))))}function zt(_e,Ce){Wa.digitRe.test(Ce)?_e.state=38:Ce==="("?_e.state=32:(an(_e),x(Ce))}function Ct(_e,Ce){(0,XS.isPhoneNumberControlChar)(Ce)||(Ce==="#"?_e.state=41:Wa.digitRe.test(Ce)?_e.state=38:an(_e))}function Ei(_e,Ce){(0,XS.isPhoneNumberControlChar)(Ce)?_e.state=40:Wa.digitRe.test(Ce)?(0,vo.remove)(f,_e):an(_e)}function an(_e){if((0,vo.remove)(f,_e),!!_e.acceptStateReached){var Ce=_e.startIdx,pn=e.slice(_e.startIdx,h);if(pn=wye(pn),_e.type==="url"){var mt=e.charAt(_e.startIdx-1);if(mt==="@")return;var so=_e.matchType;if(so==="scheme"){var Ro=$o.httpSchemeRe.exec(pn);if(Ro&&(Ce=Ce+Ro.index,pn=pn.slice(Ro.index)),!(0,$o.isValidSchemeUrl)(pn))return}else if(so==="tld"){if(!(0,$o.isValidTldMatch)(pn))return}else if(so==="ipV4"){if(!(0,$o.isValidIpV4Address)(pn))return}else(0,vo.assertNever)(so);l.push(new wst.UrlMatch({tagBuilder:n,matchedText:pn,offset:Ce,urlMatchType:so,url:pn,protocolRelativeMatch:pn.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(_e.type==="email")(0,YS.isValidEmail)(pn)&&l.push(new vst.EmailMatch({tagBuilder:n,matchedText:pn,offset:Ce,email:pn.replace(YS.mailtoSchemePrefixRe,"")}));else if(_e.type==="hashtag")(0,iX.isValidHashtag)(pn)&&l.push(new Dst.HashtagMatch({tagBuilder:n,matchedText:pn,offset:Ce,serviceName:s,hashtag:pn.slice(1)}));else if(_e.type==="mention")(0,oX.isValidMention)(pn,a)&&l.push(new Pst.MentionMatch({tagBuilder:n,matchedText:pn,offset:Ce,serviceName:a,mention:pn.slice(1)}));else if(_e.type==="phone"){if(pn=pn.replace(/ +$/g,""),(0,XS.isValidPhoneNumber)(pn)){var aa=pn.replace(/[^0-9,;#]/g,"");l.push(new Ist.PhoneMatch({tagBuilder:n,matchedText:pn,offset:Ce,number:aa,plusSign:pn.charAt(0)==="+"}))}}else(0,vo.assertNever)(_e)}}}var Rst=/[\(\{\[]/,Eye=/[\)\}\]]/,Sye={")":"(","}":"{","]":"["};function wye(e){for(var t={"(":0,"{":0,"[":0},n=0;n=0;)if(r=e.charAt(o),Eye.test(r)){var s=Sye[r];if(t[s]<0)t[s]++,o--;else break}else if($o.urlSuffixedCharsNotAllowedAtEndRe.test(r))o--;else break;return e.slice(0,o+1)}function $8(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function rX(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Mst(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Lst(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Nst(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Fst(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function sX(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function Bst(e){return e.type==="url"&&e.matchType==="scheme"}});var vye=Xn(cX=>{"use strict";Object.defineProperty(cX,"__esModule",{value:!0});cX.parseHtml=Ust;var Pc=($m(),nm(Km)),_l=OT(),kst=IT();function Ust(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Zm,l=0,u=e.length,f=0,h=0,p=a;l"?(p=new Zm(Pc.__assign(Pc.__assign({},p),{name:te()})),q()):!_l.letterRe.test(Z)&&!_l.digitRe.test(Z)&&Z!==":"&&j()}function x(Z){Z===">"?j():_l.letterRe.test(Z)?f=3:j()}function A(Z){_l.whitespaceRe.test(Z)||(Z==="/"?f=12:Z===">"?q():Z==="<"?U():Z==="="||_l.quoteRe.test(Z)||_l.controlCharsRe.test(Z)?j():f=5)}function C(Z){_l.whitespaceRe.test(Z)?f=6:Z==="/"?f=12:Z==="="?f=7:Z===">"?q():Z==="<"?U():_l.quoteRe.test(Z)&&j()}function S(Z){_l.whitespaceRe.test(Z)||(Z==="/"?f=12:Z==="="?f=7:Z===">"?q():Z==="<"?U():_l.quoteRe.test(Z)?j():f=5)}function v(Z){_l.whitespaceRe.test(Z)||(Z==='"'?f=8:Z==="'"?f=9:/[>=`]/.test(Z)?j():Z==="<"?U():f=10)}function P(Z){Z==='"'&&(f=11)}function M(Z){Z==="'"&&(f=11)}function R(Z){_l.whitespaceRe.test(Z)?f=4:Z===">"?q():Z==="<"&&U()}function L(Z){_l.whitespaceRe.test(Z)?f=4:Z==="/"?f=12:Z===">"?q():Z==="<"?U():(f=4,K())}function F(Z){Z===">"?(p=new Zm(Pc.__assign(Pc.__assign({},p),{isClosing:!0})),q()):f=4}function _(Z){e.substr(l,2)==="--"?(l+=2,p=new Zm(Pc.__assign(Pc.__assign({},p),{type:"comment"})),f=14):e.substr(l,7).toUpperCase()==="DOCTYPE"?(l+=7,p=new Zm(Pc.__assign(Pc.__assign({},p),{type:"doctype"})),f=20):j()}function w(Z){Z==="-"?f=15:Z===">"?j():f=16}function D(Z){Z==="-"?f=18:Z===">"?j():f=16}function I(Z){Z==="-"&&(f=17)}function N(Z){Z==="-"?f=18:f=16}function k(Z){Z===">"?q():Z==="!"?f=19:Z==="-"||(f=16)}function z(Z){Z==="-"?f=17:Z===">"?q():f=16}function V(Z){Z===">"?q():Z==="<"&&U()}function j(){f=0,p=a}function U(){f=1,p=new Zm({idx:l})}function q(){var Z=e.slice(h,p.idx);Z&&o(Z,h),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),j(),h=l+1}function Y(){var Z=e.slice(h,l);o(Z,h),h=l+1}function te(){var Z=p.idx+(p.isClosing?2:1);return e.slice(Z,l).toLowerCase()}function K(){l--}}var Zm=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 Q8=Xn(lX=>{"use strict";Object.defineProperty(lX,"__esModule",{value:!0});var Vst=Vge(),Ls=IT(),zst=qY(),Hst=k8(),Gst=aX(),jst=vye(),Wst=eX(),qst=QY(),Yst=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=Xst(t.urls),this.email=(0,Ls.isBoolean)(t.email)?t.email:this.email,this.phone=(0,Ls.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,Ls.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Kst(t.stripPrefix),this.stripTrailingSlash=(0,Ls.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,Ls.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Wst.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&qst.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=$st(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,jst.parseHtml)(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var l=/( | |<|<|>|>|"|"|')/gi,u=s.split(l),f=a;u.forEach(function(h,p){if(p%2===0){var g=n.parseText(h,f);r.push.apply(r,g)}f+=h.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(l,u){return l.getOffset()-u.getOffset()});for(var n=0;nr?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()/g,">"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r{"use strict";Object.defineProperty(Dye,"__esModule",{value:!0})});var Iye=Xn(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});var FT=($m(),nm(Km));FT.__exportStar(Pye(),lg);FT.__exportStar(ZY(),lg);FT.__exportStar(JY(),lg);FT.__exportStar(RT(),lg);FT.__exportStar(tX(),lg);FT.__exportStar(nX(),lg);FT.__exportStar($Y(),lg)});var Oye=Xn(uX=>{"use strict";Object.defineProperty(uX,"__esModule",{value:!0});var Zst=($m(),nm(Km));Zst.__exportStar(aX(),uX)});var fX=Xn((Nh,Mye)=>{"use strict";Nh=Mye.exports=Q8().default;Object.defineProperty(Nh,"__esModule",{value:!0});Nh.Autolinker=void 0;var KS=($m(),nm(Km)),Rye=KS.__importDefault(Q8());Nh.Autolinker=Rye.default;Nh.default=Rye.default;KS.__exportStar(Q8(),Nh);KS.__exportStar(qY(),Nh);KS.__exportStar(k8(),Nh);KS.__exportStar(Iye(),Nh);KS.__exportStar(Oye(),Nh)});var fZ=Xn((exports,module)=>{/*! * protobuf.js v7.4.0 (c) 2016, daniel wirtz * compiled thu, 22 aug 2024 20:30:39 utc * licensed under the bsd-3-clause license * see: https://github.com/dcodeio/protobuf.js for details */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,l=2,u=!0;l1&&u.charAt(f)==="=";)++h;return Math.ceil(u.length*3)/4-h};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,h){for(var p=null,g=[],m=0,y=0,b;f>2],b=(x&3)<<4,y=1;break;case 1:g[m++]=o[b|x>>4],b=(x&15)<<2,y=2;break;case 2:g[m++]=o[b|x>>6],g[m++]=o[x&63],y=0;break}m>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),m=0)}return y&&(g[m++]=o[b],g[m++]=61,y===1&&(g[m++]=61)),p?(m&&p.push(String.fromCharCode.apply(String,g.slice(0,m))),p.join("")):String.fromCharCode.apply(String,g.slice(0,m))};var a="invalid encoding";i.decode=function(u,f,h){for(var p=h,g=0,m,y=0;y1)break;if((b=r[b])===undefined)throw Error(a);switch(g){case 0:m=b,g=1;break;case 1:f[h++]=m<<2|(b&48)>>4,m=b,g=2;break;case 2:f[h++]=(m&15)<<4|(b&60)>>2,m=b,g=3;break;case 3:f[h++]=(m&3)<<6|b,g=0;break}}if(g===1)throw Error(a);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,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],l=0;l0?0:2147483648,g,m);else if(isNaN(p))h(2143289344,g,m);else if(p>34028234663852886e22)h((y<<31|2139095040)>>>0,g,m);else if(p<11754943508222875e-54)h((y<<31|Math.round(p/1401298464324817e-60))>>>0,g,m);else{var b=Math.floor(Math.log(p)/Math.LN2),x=Math.round(p*Math.pow(2,-b)*8388608)&8388607;h((y<<31|b+127<<23|x)>>>0,g,m)}}l.writeFloatLE=u.bind(null,o),l.writeFloatBE=u.bind(null,r);function f(h,p,g){var m=h(p,g),y=(m>>31)*2+1,b=m>>>23&255,x=m&8388607;return b===255?x?NaN:y*(1/0):b===0?y*1401298464324817e-60*x:y*Math.pow(2,b-150)*(x+8388608)}l.readFloatLE=f.bind(null,s),l.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),h=f[7]===128;function p(b,x,A){u[0]=b,x[A]=f[0],x[A+1]=f[1],x[A+2]=f[2],x[A+3]=f[3],x[A+4]=f[4],x[A+5]=f[5],x[A+6]=f[6],x[A+7]=f[7]}function g(b,x,A){u[0]=b,x[A]=f[7],x[A+1]=f[6],x[A+2]=f[5],x[A+3]=f[4],x[A+4]=f[3],x[A+5]=f[2],x[A+6]=f[1],x[A+7]=f[0]}l.writeDoubleLE=h?p:g,l.writeDoubleBE=h?g:p;function m(b,x){return f[0]=b[x],f[1]=b[x+1],f[2]=b[x+2],f[3]=b[x+3],f[4]=b[x+4],f[5]=b[x+5],f[6]=b[x+6],f[7]=b[x+7],u[0]}function y(b,x){return f[7]=b[x],f[6]=b[x+1],f[5]=b[x+2],f[4]=b[x+3],f[3]=b[x+4],f[2]=b[x+5],f[1]=b[x+6],f[0]=b[x+7],u[0]}l.readDoubleLE=h?m:y,l.readDoubleBE=h?y:m}():function(){function u(h,p,g,m,y,b){var x=m<0?1:0;if(x&&(m=-m),m===0)h(0,y,b+p),h(1/m>0?0:2147483648,y,b+g);else if(isNaN(m))h(0,y,b+p),h(2146959360,y,b+g);else if(m>17976931348623157e292)h(0,y,b+p),h((x<<31|2146435072)>>>0,y,b+g);else{var A;if(m<22250738585072014e-324)A=m/5e-324,h(A>>>0,y,b+p),h((x<<31|A/4294967296)>>>0,y,b+g);else{var C=Math.floor(Math.log(m)/Math.LN2);C===1024&&(C=1023),A=m*Math.pow(2,-C),h(A*4503599627370496>>>0,y,b+p),h((x<<31|C+1023<<20|A*1048576&1048575)>>>0,y,b+g)}}}l.writeDoubleLE=u.bind(null,o,0,4),l.writeDoubleBE=u.bind(null,r,4,0);function f(h,p,g,m,y){var b=h(m,y+p),x=h(m,y+g),A=(x>>31)*2+1,C=x>>>20&2047,S=4294967296*(x&1048575)+b;return C===2047?S?NaN:A*(1/0):C===0?A*5e-324*S:A*Math.pow(2,C-1075)*(S+4503599627370496)}l.readDoubleLE=f.bind(null,s,0,4),l.readDoubleBE=f.bind(null,a,4,0)}(),l}function o(l,u,f){u[f]=l&255,u[f+1]=l>>>8&255,u[f+2]=l>>>16&255,u[f+3]=l>>>24}function r(l,u,f){u[f]=l>>>24,u[f+1]=l>>>16&255,u[f+2]=l>>>8&255,u[f+3]=l&255}function s(l,u){return(l[u]|l[u+1]<<8|l[u+2]<<16|l[u+3]<<24)>>>0}function a(l,u){return(l[u]<<24|l[u+1]<<16|l[u+2]<<8|l[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,s){var a=s||8192,l=a>>>1,u=null,f=a;return function(p){if(p<1||p>l)return o(p);f+p>a&&(u=o(a),f=0);var g=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,l=0;l191&&p<224?f[h++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,f[h++]=55296+(p>>10),f[h++]=56320+(p&1023)):f[h++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&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,s,a){for(var l=a,u,f,h=0;h>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(h+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++h,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-l}},{}],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=l;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(m,y){return RangeError("index out of range: "+m.pos+" + "+(y||1)+" > "+m.len)}function l(m){this.buf=m,this.pos=0,this.len=m.length}var u=typeof Uint8Array<"u"?function(y){if(y instanceof Uint8Array||Array.isArray(y))return new l(y);throw Error("illegal buffer")}:function(y){if(Array.isArray(y))return new l(y);throw Error("illegal buffer")},f=function(){return i.Buffer?function(b){return(l.create=function(A){return i.Buffer.isBuffer(A)?new o(A):u(A)})(b)}:u};l.create=f(),l.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,l.prototype.uint32=function(){var y=4294967295;return function(){if(y=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(y=(y|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return y;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return y}}(),l.prototype.int32=function(){return this.uint32()|0},l.prototype.sint32=function(){var y=this.uint32();return y>>>1^-(y&1)|0};function h(){var m=new r(0,0),y=0;if(this.len-this.pos>4){for(;y<4;++y)if(m.lo=(m.lo|(this.buf[this.pos]&127)<>>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;y=0}else{for(;y<3;++y){if(this.pos>=this.len)throw a(this);if(m.lo=(m.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<>>0,m}if(this.len-this.pos>4){for(;y<5;++y)if(m.hi=(m.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return m}else for(;y<5;++y){if(this.pos>=this.len)throw a(this);if(m.hi=(m.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return m}throw Error("invalid varint encoding")}l.prototype.bool=function(){return this.uint32()!==0};function p(m,y){return(m[y-4]|m[y-3]<<8|m[y-2]<<16|m[y-1]<<24)>>>0}l.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}l.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var y=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,y},l.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var y=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,y},l.prototype.bytes=function(){var y=this.uint32(),b=this.pos,x=this.pos+y;if(x>this.len)throw a(this,y);if(this.pos+=y,Array.isArray(this.buf))return this.buf.slice(b,x);if(b===x){var A=i.Buffer;return A?A.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,b,x)},l.prototype.string=function(){var y=this.bytes();return s.read(y,0,y.length)},l.prototype.skip=function(y){if(typeof y=="number"){if(this.pos+y>this.len)throw a(this,y);this.pos+=y}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},l.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},l._configure=function(m){o=m,l.create=f(),o._configure();var y=i.Long?"toLong":"toNumber";i.merge(l.prototype,{int64:function(){return h.call(this)[y](!1)},uint64:function(){return h.call(this)[y](!0)},sint64:function(){return h.call(this).zzDecode()[y](!1)},fixed64:function(){return g.call(this)[y](!0)},sfixed64:function(){return g.call(this)[y](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,l,u,f){if(!u)throw TypeError("request must be specified");var h=this;if(!f)return i.asPromise(r,h,s,a,l,u);if(!h.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return h.rpcImpl(s,a[h.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,m){if(g)return h.emit("error",g,s),f(g);if(m===null)return h.end(!0),undefined;if(!(m instanceof l))try{m=l[h.responseDelimited?"decodeDelimited":"decode"](m)}catch(y){return h.emit("error",y,s),f(y)}return h.emit("data",m,s),f(null,m)})}catch(p){return h.emit("error",p,s),setTimeout(function(){f(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(l,u){this.lo=l>>>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 s=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 a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.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(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,l){var u=a[l];return u!=null&&a.hasOwnProperty(l)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,l){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,l):u.toNumber(!!l)};function o(s,a,l){for(var u=Object.keys(a),f=0;f-1;--h)if(l[f[h]]===1&&this[f[h]]!==undefined&&this[f[h]]!==null)return f[h]}},i.oneOfSetter=function(a){return function(l){for(var u=0;u127;)S[v++]=C&127|128,C>>>=7;S[v]=C}function y(C,S){this.len=C,this.next=undefined,this.val=S}y.prototype=Object.create(l.prototype),y.prototype.fn=m,h.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new y((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},h.prototype.int32=function(S){return S<0?this._push(b,10,r.fromNumber(S)):this.uint32(S)},h.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function b(C,S,v){for(;C.hi;)S[v++]=C.lo&127|128,C.lo=(C.lo>>>7|C.hi<<25)>>>0,C.hi>>>=7;for(;C.lo>127;)S[v++]=C.lo&127|128,C.lo=C.lo>>>7;S[v++]=C.lo}h.prototype.uint64=function(S){var v=r.from(S);return this._push(b,v.length(),v)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(S){var v=r.from(S).zzEncode();return this._push(b,v.length(),v)},h.prototype.bool=function(S){return this._push(g,1,S?1:0)};function x(C,S,v){S[v]=C&255,S[v+1]=C>>>8&255,S[v+2]=C>>>16&255,S[v+3]=C>>>24}h.prototype.fixed32=function(S){return this._push(x,4,S>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(S){var v=r.from(S);return this._push(x,4,v.lo)._push(x,4,v.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},h.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var A=i.Array.prototype.set?function(S,v,P){v.set(S,P)}:function(S,v,P){for(var M=0;M>>0;if(!v)return this._push(g,1,0);if(i.isString(S)){var P=h.alloc(v=s.length(S));s.decode(S,P,0),S=P}return this.uint32(v)._push(A,v,S)},h.prototype.string=function(S){var v=a.length(S);return v?this.uint32(v)._push(a.write,v,S):this._push(g,1,0)},h.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new l(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 l(u,0,0),this.len=0),this},h.prototype.ldelim=function(){var S=this.head,v=this.tail,P=this.len;return this.reset().uint32(P),P&&(this.tail.next=S.next,this.tail=v,this.len+=P),this},h.prototype.finish=function(){for(var S=this.head.next,v=this.constructor.alloc(this.len),P=0;S;)S.fn(S.val,v,P),P+=S.len,S=S.next;return v},h._configure=function(C){o=C,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(l,u,f){u.set(l,f)}:function(l,u,f){if(l.copy)l.copy(u,f,0,l.length);else for(var h=0;h>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,l),this};function s(a,l,u){a.length<40?o.utf8.write(a,l,u):l.utf8Write?l.utf8Write(a,u):l.write(a,u)}r.prototype.string=function(l){var u=o.Buffer.byteLength(l);return this.uint32(u),u&&this._push(s,u,l),this},r._configure()},{15:15,16:16}]},{},[8])})()});var vEe=Xn((N9i,QG)=>{/* 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,g=l(f,h.inputOffset||0,p),m=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,y=r(g,h.pixelType||Float32Array,h.encodedMaskData,m,h.returnMask),b={width:g.width,height:g.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return y.resultMask&&(b.maskData=y.resultMask),h.returnEncodedMask&&g.mask&&(b.encodedMaskData=g.mask.bitset?g.mask.bitset:null),h.returnFileInfo&&(b.fileInfo=s(g),h.computeUsedBitDepths&&(b.fileInfo.bitDepths=a(g))),b};var r=function(f,h,p,g,m){var y=0,b=f.pixels.numBlocksX,x=f.pixels.numBlocksY,A=Math.floor(f.width/b),C=Math.floor(f.height/x),S=2*f.maxZError,v=Number.MAX_VALUE,P;p=p||(f.mask?f.mask.bitset:null);var M,R;M=new h(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var L=new Float32Array(A*C),F,_,w=0;w<=x;w++){var D=w!==x?C:f.height%x;if(D!==0)for(var I=0;I<=b;I++){var N=I!==b?A:f.width%b;if(N!==0){var k=w*f.width*C+I*A,z=f.width-N,V=f.pixels.blocks[y],j,U,q;V.encoding<2?(V.encoding===0?j=V.rawData:(u(V.stuffedData,V.bitsPerPixel,V.numValidPixels,V.offset,S,L,f.pixels.maxValue),j=L),U=0):V.encoding===2?q=0:q=V.offset;var Y;if(p)for(_=0;_>3],Y<<=k&7),F=0;F>3]),Y&128?(R&&(R[k]=1),P=V.encoding<2?j[U++]:q,v=v>P?P:v,M[k++]=P):(R&&(R[k]=0),M[k++]=g),Y<<=1;k+=z}else if(V.encoding<2)for(_=0;_P?P:v,M[k++]=P;k+=z}else for(v=v>q?q:v,_=0;_0){var b=new Uint8Array(Math.ceil(g.width*g.height/8));y=new DataView(f,h,g.mask.numBytes);var x=y.getInt16(0,!0),A=2,C=0;do{if(x>0)for(;x--;)b[C++]=y.getUint8(A++);else{var S=y.getUint8(A++);for(x=-x;x--;)b[C++]=S}x=y.getInt16(A,!0),A+=2}while(A0?1:0),R=P+(g.height%P>0?1:0);g.pixels.blocks=new Array(M*R);for(var L=0,F=0;F3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){h++;continue}if(N!==0&&N!==2){if(N>>=6,I.offsetType=N,N===2)I.offset=y.getInt8(1),w++;else if(N===1)I.offset=y.getInt16(1,!0),w+=2;else if(N===0)I.offset=y.getFloat32(1,!0),w+=4;else throw"Invalid block offset type";if(I.encoding===1)if(N=y.getUint8(w),w++,I.bitsPerPixel=N&63,N>>=6,I.numValidPixelsType=N,N===2)I.numValidPixels=y.getUint8(w),w++;else if(N===1)I.numValidPixels=y.getUint16(w,!0),w+=2;else if(N===0)I.numValidPixels=y.getUint32(w,!0),w+=4;else throw"Invalid valid pixel count type"}if(h+=w,I.encoding!==3){var k,z;if(I.encoding===0){var V=(g.pixels.numBytes-1)/4;if(V!==Math.floor(V))throw"uncompressed block has invalid length";k=new ArrayBuffer(V*4),z=new Uint8Array(k),z.set(new Uint8Array(f,h,V*4));var j=new Float32Array(k);I.rawData=j,h+=V*4}else if(I.encoding===1){var U=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),q=Math.ceil(U/4);k=new ArrayBuffer(q*4),z=new Uint8Array(k),z.set(new Uint8Array(f,h,U)),I.stuffedData=new Uint32Array(k),h+=U}}}return g.eofOffset=h,g},u=function(f,h,p,g,m,y,b){var x=(1<=h)v=P>>>S-h&x,S-=h;else{var L=h-S;v=(P&x)<>>S}y[C]=v=f?(S=v>>>C-f&b,C-=f):(P=f-C,S=(v&b)<>>C),u[A]=p[S];else for(M=Math.ceil((y-g)/m),A=0;A=f?(S=v>>>C-f&b,C-=f):(P=f-C,S=(v&b)<>>C),u[A]=S=u?(C=S>>>A-u&m,A-=u):(x=u-A,C=(S&m)<>>A),v[b]=C=f?(v=P>>>S&b,C-=f,S+=f):(M=f-C,v=P>>>S&b,P=l[x++],C=32-M,v|=(P&(1<=f?(v=P>>>S&b,C-=f,S+=f):(M=f-C,v=P>>>S&b,P=l[x++],C=32-M,v|=(P&(1<=u?(C=v>>>S&m,A-=u,S+=u):(x=u-A,C=v>>>S&m,v=l[y++],A=32-x,C|=(v&(1<=f?(b=x>>>y-f&p,y-=f):(A=f-y,b=(x&p)<>>y),u[m]=b;return u},originalUnstuff2:function(l,u,f,h){var p=(1<=f?(x=A>>>b&p,y-=f,b+=f):(C=f-y,x=A>>>b&p,A=l[g++],y=32-C,x|=(A&(1<=359?359:p;p-=m;do u+=l[g++]<<8,f+=u+=l[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return h&1&&(f+=u+=l[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(l,u){var f=u.ptr,h=new Uint8Array(l,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 g=new DataView(l,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(l,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(l,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var y,b;if(m>=3&&(b=m>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(l,f-b,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(l,u){var f=u.headerInfo,h=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(l,u.ptr,h,p),m=this.readSubArray(l,u.ptr+p,h,p);u.ptr+=2*p;var y,b=!0;for(y=0;y0){b=new Uint8Array(Math.ceil(p/8)),m=new DataView(l,f,y.numBytes);var A=m.getInt16(0,!0),C=2,S=0,v=0;do{if(A>0)for(;A--;)b[S++]=m.getUint8(C++);else for(v=m.getUint8(C++),A=-A;A--;)b[S++]=v;A=m.getInt16(C,!0),C+=2}while(C>3],P<<=M&7):P=b[M>>3],P&128&&(x[M]=1);u.pixels.resultMask=x,y.bitset=b,f+=y.numBytes}return u.ptr=f,u.mask=y,!0},readDataOneSweep:function(l,u,f){var h=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,y=p.imageType,b=p.numValidPixel*r.getDataTypeSize(y)*g,x,A=u.pixels.resultMask;if(f===Uint8Array)x=new Uint8Array(l,h,b);else{var C=new ArrayBuffer(b),S=new Uint8Array(C);S.set(new Uint8Array(l,h,b)),x=new f(C)}if(x.length===m*g)u.pixels.resultPixels=x;else{u.pixels.resultPixels=new f(m*g);var v=0,P=0,M=0,R=0;if(g>1)for(M=0;M=y)return!1;var b=new Uint32Array(y-m);r.decodeBits(l,u,b);var x=[],A,C,S,v;for(A=m;A0&&(x[C].second=w<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,D++,w=F[D])):(_+=v-32,D++,w=F[D],x[C].second|=w>>>32-_));var I=0,N=0,k=new s;for(A=0;A=f?N=f:N=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var z=[],V,j,U,q,Y,te;for(A=m;A0)if(V=[v,C],v<=N)for(j=x[C].second<=0;q--)Y=j>>>q&1,Y?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),q===0&&!te.val&&(te.val=V[1]);return{decodeLut:z,numBitsLUTQick:N,numBitsLUT:I,tree:k,stuffedData:F,srcPtr:D,bitPos:_}},readHuffman:function(l,u,f){var h=u.headerInfo,p=h.numDims,g=u.headerInfo.height,m=u.headerInfo.width,y=m*g,b=this.readHuffmanTree(l,u),x=b.decodeLut,A=b.tree,C=b.stuffedData,S=b.srcPtr,v=b.bitPos,P=b.numBitsLUTQick,M=b.numBitsLUT,R=u.headerInfo.imageType===0?128:0,L,F,_,w=u.pixels.resultMask,D,I,N,k,z,V,j,U=0;v>0&&(S++,v=0);var q=C[S],Y=u.encodeMode===1,te=new f(y*p),K=te,Z;for(Z=0;Z1&&(K=new f(te.buffer,y*Z,y),U=0),u.headerInfo.numValidPixel===m*g)for(V=0,k=0;k>>32-P,I=D,32-v>>64-v-P,I=D),x[I])F=x[I][1],v+=x[I][0];else for(D=q<>>32-M,I=D,32-v>>64-v-M,I=D),L=A,j=0;j>>M-j-1&1,L=N?L.right:L.left,!(L.left||L.right)){F=L.val,v=v+j+1;break}v>=32&&(v-=32,S++,q=C[S]),_=F-R,Y?(z>0?_+=U:k>0?_+=K[V-m]:_+=U,_&=255,K[V]=_,U=_):K[V]=_}else for(V=0,k=0;k>>32-P,I=D,32-v>>64-v-P,I=D),x[I])F=x[I][1],v+=x[I][0];else for(D=q<>>32-M,I=D,32-v>>64-v-M,I=D),L=A,j=0;j>>M-j-1&1,L=N?L.right:L.left,!(L.left||L.right)){F=L.val,v=v+j+1;break}v>=32&&(v-=32,S++,q=C[S]),_=F-R,Y?(z>0&&w[V-1]?_+=U:k>0&&w[V-m]?_+=K[V-m]:_+=U,_&=255,K[V]=_,U=_):K[V]=_}u.ptr=u.ptr+(S+1)*4+(v>0?4:0)}u.pixels.resultPixels=te},decodeBits:function(l,u,f,h,p){{var g=u.headerInfo,m=g.fileVersion,y=0,b=new DataView(l,u.ptr,5),x=b.getUint8(0);y++;var A=x>>6,C=A===0?4:3-A,S=(x&32)>0,v=x&31,P=0;if(C===1)P=b.getUint8(y),y++;else if(C===2)P=b.getUint16(y,!0),y+=2;else if(C===4)P=b.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var M=2*g.maxZError,R,L,F,_,w,D,I,N,k,z,V=g.numDims>1?g.maxValues[p]:g.zMax;if(S){for(u.counter.lut++,N=b.getUint8(y),k=v,y++,_=Math.ceil((N-1)*v/8),w=Math.ceil(_/4),L=new ArrayBuffer(w*4),F=new Uint8Array(L),u.ptr+=y,F.set(new Uint8Array(l,u.ptr,_)),I=new Uint32Array(L),u.ptr+=_,z=0;N-1>>>z;)z++;_=Math.ceil(P*z/8),w=Math.ceil(_/4),L=new ArrayBuffer(w*4),F=new Uint8Array(L),F.set(new Uint8Array(l,u.ptr,_)),R=new Uint32Array(L),u.ptr+=_,m>=3?D=o.unstuffLUT2(I,v,N-1,h,M,V):D=o.unstuffLUT(I,v,N-1,h,M,V),m>=3?o.unstuff2(R,f,z,P,D):o.unstuff(R,f,z,P,D)}else u.counter.bitstuffer++,z=v,u.ptr+=y,z>0&&(_=Math.ceil(P*z/8),w=Math.ceil(_/4),L=new ArrayBuffer(w*4),F=new Uint8Array(L),F.set(new Uint8Array(l,u.ptr,_)),R=new Uint32Array(L),u.ptr+=_,m>=3?h==null?o.originalUnstuff2(R,f,z,P):o.unstuff2(R,f,z,P,!1,h,M,V):h==null?o.originalUnstuff(R,f,z,P):o.unstuff(R,f,z,P,!1,h,M,V))}},readTiles:function(l,u,f){var h=u.headerInfo,p=h.width,g=h.height,m=h.microBlockSize,y=h.imageType,b=r.getDataTypeSize(y),x=Math.ceil(p/m),A=Math.ceil(g/m);u.pixels.numBlocksY=A,u.pixels.numBlocksX=x,u.pixels.ptr=0;var C=0,S=0,v=0,P=0,M=0,R=0,L=0,F=0,_=0,w=0,D=0,I=0,N=0,k=0,z=0,V=0,j,U,q,Y,te,K,Z=new f(m*m),ee=g%m||m,me=p%m||m,Te,ue,ye=h.numDims,Ae,Pe=u.pixels.resultMask,Ee=u.pixels.resultPixels;for(v=0;v1&&(Ee=new f(u.pixels.resultPixels.buffer,p*g*Ae*b,p*g)),L=l.byteLength-u.ptr,j=new DataView(l,u.ptr,Math.min(10,L)),U={},V=0,F=j.getUint8(0),V++,_=F>>6&255,w=F>>2&15,w!==(P*m>>3&15))throw"integrity issue";if(K=F&3,K>3)throw u.ptr+=V,"Invalid block encoding ("+K+")";if(K===2){u.counter.constant++,u.ptr+=V;continue}else if(K===0){if(u.counter.uncompressed++,u.ptr+=V,N=M*R*b,k=l.byteLength-u.ptr,N=N1)for(g=0;g=-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(l){var u=0;switch(l){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=l}return u},getDataTypeUsed:function(l,u){var f=l;switch(l){case 2:case 4:f=l-u;break;case 3:case 5:f=l-2*u;break;case 6:u===0?f=l:u===1?f=2:f=1;break;case 7:u===0?f=l:f=l-2*u+1;break;default:f=l;break}return f},getOnePixel:function(l,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}},s=function(l,u,f){this.val=l,this.left=u,this.right=f},a={decode:function(l,u){u=u||{};var f=u.noDataValue,h=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(l,p)){var g=p.headerInfo,m=g.fileVersion,y=r.getDataTypeArray(g.imageType);r.readMask(l,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var b=g.width*g.height;if(p.pixels.resultPixels=new y(b*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(p);else if(m>=4&&r.checkMinMaxRanges(l,p))r.constructConstantSurface(p);else{var x=new DataView(l,p.ptr,2),A=x.getUint8(0);if(p.ptr++,A)r.readDataOneSweep(l,p,y);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var C=x.getUint8(1);if(p.ptr++,p.encodeMode=C,C>2||m<4&&C>1)throw"Invalid Huffman flag "+C;C?r.readHuffman(l,p,y):r.readTiles(l,p,y)}else r.readTiles(l,p,y)}p.eofOffset=p.ptr;var S;u.inputOffset?(S=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(S)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(S=p.headerInfo.blobSize-p.ptr,Math.abs(S)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(g.imageType,f)){var P=p.pixels.resultMask;for(h=0;h1&&A.fileInfo.mask&&A.fileInfo.mask.numBytes>0&&m.push(A.maskData),h++,x.pixels.push(A.pixelData),x.statistics.push({minValue:A.minValue,maxValue:A.maxValue,noDataValue:A.noDataValue,dimStats:A.dimStats})}var C,S,v;if(f>1&&m.length>1){for(v=x.width*x.height,x.bandMasks=m,b=new Uint8Array(v),b.set(m[0]),C=1;C{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof yU=="object"&&typeof JQ=="object"?JQ.exports=t():typeof define=="function"&&define.amd?define([],t):typeof yU=="object"?yU.NoSleep=t():e.NoSleep=t()})(yU,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 s in i)n.d(r,s,function(a){return i[a]}.bind(null,s));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 g=0;g.5&&(h.noSleepVideo.currentTime=Math.random())})}))}return i(f,[{key:"_addSourceToVideo",value:function(h,p,g){var m=document.createElement("source");m.src=g,m.type="video/"+p,h.appendChild(m)}},{key:"enable",value:function(){var h=this;return l()?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}):a()?(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(){l()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):a()?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,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK",mp4:"data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}}])})});var aDt={};uJ(aDt,{AlphaMode:()=>Em,AlphaPipelineStage:()=>YR,AnchorPointDirect:()=>Z1,AnchorPointIndirect:()=>Q1,Animation:()=>Lk,AnimationViewModel:()=>Nk,Appearance:()=>io,ApproximateTerrainHeights:()=>ui,ArcGISTiledElevationTerrainProvider:()=>Y$,ArcGisBaseMapType:()=>Vh,ArcGisMapServerImageryProvider:()=>dg,ArcGisMapService:()=>Zu,ArcType:()=>qt,ArticulationStageType:()=>xc,AssociativeArray:()=>Et,Atmosphere:()=>Ex,AtmospherePipelineStage:()=>vR,AttributeCompression:()=>Ln,AttributeType:()=>nn,AutoExposure:()=>WB,AutomaticUniforms:()=>Ap,Axis:()=>Fo,AxisAlignedBoundingBox:()=>Qg,B3dmLoader:()=>fR,B3dmParser:()=>cR,BaseLayerPicker:()=>Bk,BaseLayerPickerViewModel:()=>Fk,BatchTable:()=>Rb,BatchTableHierarchy:()=>nx,BatchTexture:()=>el,BatchTexturePipelineStage:()=>XR,Billboard:()=>lo,BillboardCollection:()=>Ru,BillboardGraphics:()=>fc,BillboardLoadState:()=>ss,BillboardTexture:()=>T_,BillboardVisualizer:()=>II,BingMapsGeocoderService:()=>K$,BingMapsImageryProvider:()=>b2,BingMapsStyle:()=>cw,BlendEquation:()=>Fa,BlendFunction:()=>Eo,BlendOption:()=>wo,BlendingState:()=>ln,BoundingRectangle:()=>Ke,BoundingSphere:()=>le,BoundingSphereState:()=>lt,BoundingVolumeSemantics:()=>bx,BoxEmitter:()=>VZ,BoxGeometry:()=>La,BoxGeometryUpdater:()=>HO,BoxGraphics:()=>Vb,BoxOutlineGeometry:()=>Ud,BrdfLutGenerator:()=>K2,Buffer:()=>yt,BufferLoader:()=>ax,BufferUsage:()=>Be,CPUStylingPipelineStage:()=>QR,CallbackPositionProperty:()=>GO,CallbackProperty:()=>Wd,Camera:()=>ro,CameraEventAggregator:()=>QB,CameraEventType:()=>Vi,CameraFlightPath:()=>Z2,Cartesian2:()=>H,Cartesian3:()=>d,Cartesian4:()=>se,Cartographic:()=>he,CartographicGeocoderService:()=>Z$,CatmullRomSpline:()=>Q$,Cesium3DContentGroup:()=>tx,Cesium3DTile:()=>Zf,Cesium3DTileBatchTable:()=>Kp,Cesium3DTileColorBlendMode:()=>Bl,Cesium3DTileContent:()=>zZ,Cesium3DTileContentFactory:()=>Ux,Cesium3DTileContentState:()=>Xo,Cesium3DTileContentType:()=>Ps,Cesium3DTileFeature:()=>Ws,Cesium3DTileFeatureTable:()=>sh,Cesium3DTileOptimizationHint:()=>qf,Cesium3DTileOptimizations:()=>NL,Cesium3DTilePass:()=>Uo,Cesium3DTilePassState:()=>gd,Cesium3DTilePointFeature:()=>A_,Cesium3DTileRefine:()=>qo,Cesium3DTileStyle:()=>NA,Cesium3DTileStyleEngine:()=>zL,Cesium3DTilesInspector:()=>Gk,Cesium3DTilesInspectorViewModel:()=>Hk,Cesium3DTilesVoxelProvider:()=>HZ,Cesium3DTileset:()=>bs,Cesium3DTilesetBaseTraversal:()=>YL,Cesium3DTilesetCache:()=>kL,Cesium3DTilesetGraphics:()=>Yb,Cesium3DTilesetHeatmap:()=>UL,Cesium3DTilesetMetadata:()=>Kx,Cesium3DTilesetMostDetailedTraversal:()=>jL,Cesium3DTilesetSkipTraversal:()=>$L,Cesium3DTilesetStatistics:()=>gh,Cesium3DTilesetTraversal:()=>Zs,Cesium3DTilesetVisualizer:()=>ZL,CesiumInspector:()=>qk,CesiumInspectorViewModel:()=>Wk,CesiumTerrainProvider:()=>DA,CesiumWidget:()=>q3,Check:()=>T,CheckerboardMaterialProperty:()=>kE,CircleEmitter:()=>sk,CircleGeometry:()=>oZ,CircleOutlineGeometry:()=>rZ,ClassificationModelDrawCommand:()=>jM,ClassificationPipelineStage:()=>KR,ClassificationPrimitive:()=>EC,ClassificationType:()=>Un,ClearCommand:()=>ei,ClippingPlane:()=>xx,ClippingPlaneCollection:()=>gs,ClippingPolygon:()=>eE,ClippingPolygonCollection:()=>th,Clock:()=>Ah,ClockRange:()=>$r,ClockStep:()=>mo,ClockViewModel:()=>Ok,CloudCollection:()=>XZ,CloudType:()=>FA,Color:()=>G,ColorBlendMode:()=>bc,ColorGeometryInstanceAttribute:()=>Gt,ColorMaterialProperty:()=>Ut,Command:()=>kQ,ComponentDatatype:()=>$,Composite3DTileContent:()=>QO,CompositeEntityCollection:()=>bq,CompositeMaterialProperty:()=>VE,CompositePositionProperty:()=>ba,CompositeProperty:()=>Sc,CompressedTextureBuffer:()=>Iv,ComputeCommand:()=>Uc,ComputeEngine:()=>Pv,ConditionsExpression:()=>nk,ConeEmitter:()=>$Z,ConstantPositionProperty:()=>qc,ConstantProperty:()=>Kn,ConstantSpline:()=>pR,ContentMetadata:()=>wL,Context:()=>AI,ContextLimits:()=>ut,CoplanarPolygonGeometry:()=>NN,CoplanarPolygonGeometryLibrary:()=>O_,CoplanarPolygonOutlineGeometry:()=>$f,CornerType:()=>Bi,CorrelationGroup:()=>J1,CorridorGeometry:()=>tT,CorridorGeometryLibrary:()=>Wi,CorridorGeometryUpdater:()=>sN,CorridorGraphics:()=>Hb,CorridorOutlineGeometry:()=>rN,Credit:()=>Tt,CreditDisplay:()=>tB,CubeMap:()=>Go,CubeMapFace:()=>Vv,CubicRealPolynomial:()=>gb,CullFace:()=>xi,CullingVolume:()=>_s,CumulusCloud:()=>uf,CustomDataSource:()=>dN,CustomHeightmapTerrainProvider:()=>sZ,CustomShader:()=>pA,CustomShaderMode:()=>y_,CustomShaderPipelineStage:()=>rM,CustomShaderTranslucencyMode:()=>Ly,CylinderGeometry:()=>hN,CylinderGeometryLibrary:()=>nT,CylinderGeometryUpdater:()=>pN,CylinderGraphics:()=>Gb,CylinderOutlineGeometry:()=>mN,CzmlDataSource:()=>SN,DataSource:()=>Kr,DataSourceClock:()=>Ch,DataSourceCollection:()=>wN,DataSourceDisplay:()=>uF,DebugAppearance:()=>tQ,DebugCameraPrimitive:()=>sp,DebugInspector:()=>s3,DebugModelMatrixPrimitive:()=>lk,DefaultProxy:()=>cZ,DepthFunction:()=>dc,DepthPlane:()=>aB,DequantizationPipelineStage:()=>aM,DerivedCommand:()=>ap,DeveloperError:()=>E,DeviceOrientationCameraController:()=>cB,DirectionalLight:()=>nQ,DiscardEmptyTileImagePolicy:()=>lw,DiscardMissingTileImagePolicy:()=>g2,DistanceDisplayCondition:()=>Mt,DistanceDisplayConditionGeometryInstanceAttribute:()=>kn,DoubleEndedPriorityQueue:()=>xA,DoublyLinkedList:()=>BL,DracoLoader:()=>n_,DrawCommand:()=>Qe,DynamicAtmosphereLightingType:()=>a_,DynamicEnvironmentMapManager:()=>c_,DynamicGeometryBatch:()=>cT,DynamicGeometryUpdater:()=>ni,EarthOrientationParameters:()=>xv,EarthOrientationParametersSample:()=>Bg,EasingFunction:()=>Qr,EllipseGeometry:()=>dl,EllipseGeometryLibrary:()=>$l,EllipseGeometryUpdater:()=>DN,EllipseGraphics:()=>jb,EllipseOutlineGeometry:()=>Hu,Ellipsoid:()=>ie,EllipsoidGeodesic:()=>kp,EllipsoidGeometry:()=>Js,EllipsoidGeometryUpdater:()=>IN,EllipsoidGraphics:()=>Wb,EllipsoidOutlineGeometry:()=>Nu,EllipsoidPrimitive:()=>j2,EllipsoidRhumbLine:()=>Ba,EllipsoidSurfaceAppearance:()=>iQ,EllipsoidTangentPlane:()=>ns,EllipsoidTerrainProvider:()=>np,EllipsoidalOccluder:()=>H_,Empty3DTileContent:()=>SE,EncodedCartesian3:()=>Hn,Entity:()=>nr,EntityCluster:()=>Bu,EntityCollection:()=>Qs,EntityView:()=>dF,Event:()=>pe,EventHelper:()=>gr,Expression:()=>Lf,ExpressionNodeType:()=>_t,ExtrapolationType:()=>cl,FeatureDetection:()=>Vt,FeatureIdPipelineStage:()=>My,Fog:()=>lB,ForEach:()=>Oe,FrameRateMonitor:()=>dk,FrameState:()=>uB,Framebuffer:()=>Ur,FramebufferManager:()=>hi,Frozen:()=>W,FrustumCommands:()=>pB,FrustumGeometry:()=>YT,FrustumOutlineGeometry:()=>oB,Fullscreen:()=>Cr,FullscreenButton:()=>Xk,FullscreenButtonViewModel:()=>Yk,GeoJsonDataSource:()=>T0,GeoJsonLoader:()=>dR,GeocodeType:()=>W0,Geocoder:()=>Qk,GeocoderService:()=>Yw,GeocoderViewModel:()=>Zk,GeographicProjection:()=>Oi,GeographicTilingScheme:()=>Ki,Geometry:()=>ct,Geometry3DTileContent:()=>n1,GeometryAttribute:()=>ve,GeometryAttributes:()=>fn,GeometryFactory:()=>uZ,GeometryInstance:()=>St,GeometryInstanceAttribute:()=>hc,GeometryOffsetAttribute:()=>Zt,GeometryPipeline:()=>Nn,GeometryPipelineStage:()=>fM,GeometryType:()=>xf,GeometryUpdater:()=>ii,GeometryUpdaterSet:()=>bT,GeometryVisualizer:()=>QN,GetFeatureInfoFormat:()=>GT,Globe:()=>V2,GlobeDepth:()=>_B,GlobeSurfaceShaderSet:()=>_2,GlobeSurfaceTile:()=>md,GlobeSurfaceTileProvider:()=>I2,GlobeTranslucency:()=>O2,GlobeTranslucencyFramebuffer:()=>gB,GlobeTranslucencyState:()=>fB,GltfBufferViewLoader:()=>kC,GltfDracoLoader:()=>UC,GltfGpmLoader:()=>tR,GltfGpmLocal:()=>nE,GltfImageLoader:()=>VC,GltfIndexBufferLoader:()=>zC,GltfJsonLoader:()=>GC,GltfLoader:()=>rh,GltfLoaderUtil:()=>Vl,GltfMeshPrimitiveGpmLoader:()=>rR,GltfStructuralMetadataLoader:()=>K1,GltfTextureLoader:()=>jC,GltfVertexBufferLoader:()=>WC,GoogleEarthEnterpriseImageryProvider:()=>rQ,GoogleEarthEnterpriseMapsProvider:()=>A2,GoogleEarthEnterpriseMetadata:()=>Og,GoogleEarthEnterpriseTerrainData:()=>Xw,GoogleEarthEnterpriseTerrainProvider:()=>yZ,GoogleEarthEnterpriseTileInformation:()=>Z3,GoogleGeocoderService:()=>xZ,GoogleMaps:()=>OA,GpxDataSource:()=>BF,GregorianDate:()=>im,GridImageryProvider:()=>sQ,GridMaterialProperty:()=>$E,GroundGeometryUpdater:()=>Gn,GroundPolylineGeometry:()=>Fb,GroundPolylinePrimitive:()=>Vd,GroundPrimitive:()=>jc,GroupMetadata:()=>NE,HeadingPitchRange:()=>cd,HeadingPitchRoll:()=>Oa,Heap:()=>_v,HeightReference:()=>We,HeightmapEncoding:()=>fd,HeightmapTerrainData:()=>qa,HeightmapTessellator:()=>ow,HermitePolynomialApproximation:()=>_N,HermiteSpline:()=>Iy,HilbertOrder:()=>LC,HomeButton:()=>$k,HomeButtonViewModel:()=>Kk,HorizontalOrigin:()=>bi,I3SBuildingSceneLayerExplorer:()=>YQ,I3SBuildingSceneLayerExplorerViewModel:()=>Jk,I3SDataProvider:()=>Jh,I3SDecoder:()=>hk,I3SFeature:()=>mk,I3SField:()=>pk,I3SGeometry:()=>Qw,I3SLayer:()=>zA,I3SNode:()=>Jw,I3SStatistics:()=>yk,I3SSublayer:()=>xk,I3SSymbology:()=>gk,I3dmLoader:()=>mR,I3dmParser:()=>hR,ITwinData:()=>uQ,ITwinPlatform:()=>us,Iau2000Orientation:()=>H2,Iau2006XysData:()=>Tv,Iau2006XysSample:()=>hb,IauOrientationAxes:()=>G2,IauOrientationParameters:()=>z2,ImageBasedLighting:()=>ex,ImageBasedLightingPipelineStage:()=>PR,ImageMaterialProperty:()=>ny,Imagery:()=>pw,ImageryLayer:()=>Xa,ImageryLayerCollection:()=>R2,ImageryLayerFeatureInfo:()=>Uh,ImageryProvider:()=>yl,ImageryState:()=>ai,Implicit3DTileContent:()=>XC,ImplicitAvailabilityBitstream:()=>FC,ImplicitMetadataView:()=>BC,ImplicitSubdivisionScheme:()=>or,ImplicitSubtree:()=>gx,ImplicitSubtreeCache:()=>ok,ImplicitSubtreeMetadata:()=>i1,ImplicitTileCoordinates:()=>Qx,ImplicitTileset:()=>Zx,IndexDatatype:()=>Fe,InfoBox:()=>tU,InfoBoxViewModel:()=>eU,InspectorShared:()=>fu,InstanceAttributeSemantic:()=>rs,InstancingPipelineStage:()=>GR,InterpolationAlgorithm:()=>TZ,InterpolationType:()=>ih,Intersect:()=>Wt,IntersectionTests:()=>Zn,Intersections2D:()=>Pg,Interval:()=>Ma,InvertClassification:()=>ww,Ion:()=>Xd,IonGeocodeProviderType:()=>Rg,IonGeocoderService:()=>RA,IonImageryProvider:()=>hg,IonResource:()=>Cu,IonWorldImageryStyle:()=>mg,Iso8601:()=>Ge,JobScheduler:()=>dB,JobType:()=>pa,JsonMetadataTable:()=>l_,JulianDate:()=>Q,KTX2Transcoder:()=>Ov,KeyboardEventModifier:()=>ra,KeyframeNode:()=>go,KmlCamera:()=>kF,KmlDataSource:()=>kT,KmlLookAt:()=>UF,KmlTour:()=>VF,KmlTourFlyTo:()=>HF,KmlTourWait:()=>GF,Label:()=>Uy,LabelCollection:()=>Om,LabelGraphics:()=>Hd,LabelStyle:()=>Yo,LabelVisualizer:()=>JN,LagrangePolynomialApproximation:()=>gN,LeapSecond:()=>Yi,Light:()=>fQ,LightingModel:()=>Dm,LightingPipelineStage:()=>hM,LinearApproximation:()=>Jy,LinearSpline:()=>Py,ManagedArray:()=>Jc,MapMode2D:()=>ru,MapProjection:()=>EZ,MapboxImageryProvider:()=>C2,MapboxStyleImageryProvider:()=>dQ,Material:()=>Xi,MaterialAppearance:()=>ao,MaterialPipelineStage:()=>pM,MaterialProperty:()=>tr,Math:()=>O,Matrix2:()=>Ri,Matrix3:()=>J,Matrix4:()=>B,Megatexture:()=>Lw,MeshPrimitiveGpmLocal:()=>oR,MetadataClass:()=>Qd,MetadataClassProperty:()=>Tm,MetadataComponentType:()=>Nt,MetadataEntity:()=>Bn,MetadataEnum:()=>v1,MetadataEnumValue:()=>w1,MetadataPicking:()=>hB,MetadataPickingPipelineStage:()=>Pu,MetadataPipelineStage:()=>Uf,MetadataSchema:()=>vu,MetadataSchemaLoader:()=>qC,MetadataSemantic:()=>yx,MetadataTable:()=>Nf,MetadataTableProperty:()=>r1,MetadataType:()=>at,MipmapHint:()=>Cf,Model:()=>lh,Model3DTileContent:()=>Ou,ModelAlphaOptions:()=>MM,ModelAnimation:()=>bR,ModelAnimationChannel:()=>yR,ModelAnimationCollection:()=>xR,ModelAnimationLoop:()=>Hl,ModelAnimationState:()=>ah,ModelArticulation:()=>OR,ModelArticulationStage:()=>IR,ModelClippingPlanesPipelineStage:()=>LR,ModelClippingPolygonsPipelineStage:()=>BR,ModelColorPipelineStage:()=>Ry,ModelComponents:()=>Tn,ModelDrawCommand:()=>WM,ModelDrawCommands:()=>XM,ModelFeature:()=>TR,ModelFeatureTable:()=>CR,ModelGraphics:()=>Gp,ModelLightingOptions:()=>zM,ModelMatrixUpdateStage:()=>jR,ModelNode:()=>kR,ModelRenderResources:()=>LM,ModelRuntimeNode:()=>qR,ModelRuntimePrimitive:()=>OM,ModelSceneGraph:()=>KM,ModelSilhouettePipelineStage:()=>BM,ModelSkin:()=>RM,ModelSplitterPipelineStage:()=>UM,ModelStatistics:()=>$M,ModelType:()=>pr,ModelUtility:()=>$t,ModelVisualizer:()=>eF,Moon:()=>q2,MorphTargetsPipelineStage:()=>gM,MorphWeightSpline:()=>SZ,MortonOrder:()=>Wy,Multiple3DTileContent:()=>PL,MultisampleFramebuffer:()=>CI,NavigationHelpButton:()=>aU,NavigationHelpButtonViewModel:()=>sU,NearFarScalar:()=>Bt,NeverTileDiscardPolicy:()=>mQ,NodeRenderResources:()=>VM,NodeStatisticsPipelineStage:()=>WR,NodeTransformationProperty:()=>qb,OIT:()=>yB,Occluder:()=>Y2,OffsetGeometryInstanceAttribute:()=>eo,OpenCageGeocoderService:()=>vZ,OpenStreetMapImageryProvider:()=>Lg,OrderedGroundPrimitiveCollection:()=>vN,OrientedBoundingBox:()=>Dn,OrthographicFrustum:()=>on,OrthographicOffCenterFrustum:()=>jo,Packable:()=>DZ,PackableForInterpolation:()=>PZ,Particle:()=>nv,ParticleBurst:()=>_Q,ParticleEmitter:()=>gQ,ParticleSystem:()=>yQ,Pass:()=>De,PassState:()=>lc,PathGraphics:()=>jp,PathVisualizer:()=>nF,PeliasGeocoderService:()=>J3,PerInstanceColorAppearance:()=>rn,PerformanceDisplay:()=>yg,PerformanceWatchdog:()=>rU,PerformanceWatchdogViewModel:()=>oU,PerspectiveFrustum:()=>Ci,PerspectiveOffCenterFrustum:()=>bl,PickDepth:()=>mB,PickDepthFramebuffer:()=>xB,PickFramebuffer:()=>AB,PickedMetadataInfo:()=>L3,Picking:()=>wB,PickingPipelineStage:()=>yM,PinBuilder:()=>ag,PixelDatatype:()=>Ue,PixelFormat:()=>ke,Plane:()=>sn,PlaneGeometry:()=>ON,PlaneGeometryUpdater:()=>MN,PlaneGraphics:()=>NO,PlaneOutlineGeometry:()=>RN,PntsLoader:()=>QM,PntsParser:()=>Rx,PointCloud:()=>j3,PointCloudEyeDomeLighting:()=>f_,PointCloudShading:()=>vm,PointCloudStylingPipelineStage:()=>xM,PointGraphics:()=>Xb,PointPrimitive:()=>Os,PointPrimitiveCollection:()=>WE,PointVisualizer:()=>oF,PolygonGeometry:()=>s_,PolygonGeometryLibrary:()=>zn,PolygonGeometryUpdater:()=>BN,PolygonGraphics:()=>Gd,PolygonHierarchy:()=>ka,PolygonOutlineGeometry:()=>FN,PolygonPipeline:()=>si,Polyline:()=>Gf,PolylineArrowMaterialProperty:()=>QE,PolylineCollection:()=>dh,PolylineColorAppearance:()=>is,PolylineDashMaterialProperty:()=>eS,PolylineGeometry:()=>ng,PolylineGeometryUpdater:()=>aF,PolylineGlowMaterialProperty:()=>nS,PolylineGraphics:()=>mc,PolylineMaterialAppearance:()=>ha,PolylineOutlineMaterialProperty:()=>e0,PolylinePipeline:()=>Fi,PolylineVisualizer:()=>lF,PolylineVolumeGeometry:()=>VN,PolylineVolumeGeometryLibrary:()=>yh,PolylineVolumeGeometryUpdater:()=>jN,PolylineVolumeGraphics:()=>Kb,PolylineVolumeOutlineGeometry:()=>GN,PositionProperty:()=>zd,PositionPropertyArray:()=>q_,PostProcessStage:()=>ho,PostProcessStageCollection:()=>XB,PostProcessStageComposite:()=>au,PostProcessStageLibrary:()=>tf,PostProcessStageSampleMode:()=>ef,PostProcessStageTextureCache:()=>rA,PpeMetadata:()=>iR,PpeSource:()=>LQ,PpeTexture:()=>nR,Primitive:()=>Pn,PrimitiveCollection:()=>fl,PrimitiveLoadPlan:()=>vx,PrimitiveOutlineGenerator:()=>wx,PrimitiveOutlinePipelineStage:()=>CM,PrimitivePipeline:()=>Mb,PrimitiveRenderResources:()=>HM,PrimitiveState:()=>Pr,PrimitiveStatisticsPipelineStage:()=>EM,PrimitiveType:()=>Me,ProjectionPicker:()=>iU,ProjectionPickerViewModel:()=>nU,Property:()=>X,PropertyArray:()=>oS,PropertyAttribute:()=>Sx,PropertyAttributeProperty:()=>W1,PropertyBag:()=>Xc,PropertyTable:()=>nl,PropertyTexture:()=>u_,PropertyTextureProperty:()=>j1,ProviderViewModel:()=>ds,Proxy:()=>OZ,QuadraticRealPolynomial:()=>Vc,QuadtreeOccluders:()=>M2,QuadtreePrimitive:()=>U2,QuadtreeTile:()=>L2,QuadtreeTileLoadState:()=>ta,QuadtreeTileProvider:()=>bQ,QuantizedMeshTerrainData:()=>vA,QuarticRealPolynomial:()=>Lv,Quaternion:()=>Le,QuaternionSpline:()=>gR,Queue:()=>Cy,Ray:()=>mn,Rectangle:()=>ce,RectangleCollisionChecker:()=>TT,RectangleGeometry:()=>hT,RectangleGeometryLibrary:()=>Is,RectangleGeometryUpdater:()=>WN,RectangleGraphics:()=>jd,RectangleOutlineGeometry:()=>Hx,ReferenceFrame:()=>Hi,ReferenceProperty:()=>Y_,RenderState:()=>Ve,Renderbuffer:()=>_u,RenderbufferFormat:()=>uc,Request:()=>Qo,RequestErrorEvent:()=>sm,RequestScheduler:()=>sc,RequestState:()=>$n,RequestType:()=>ms,Resource:()=>we,ResourceCache:()=>vi,ResourceCacheKey:()=>zl,ResourceCacheStatistics:()=>I1,ResourceLoader:()=>$i,ResourceLoaderState:()=>gt,Rotation:()=>td,RuntimeError:()=>ae,S2Cell:()=>Qp,SDFSettings:()=>Ks,SampledPositionProperty:()=>Ta,SampledProperty:()=>Vu,Sampler:()=>Qt,ScaledPositionProperty:()=>zm,Scene:()=>F3,SceneFramebuffer:()=>QT,SceneMode:()=>oe,SceneMode2DPipelineStage:()=>SM,SceneModePicker:()=>dU,SceneModePickerViewModel:()=>fU,SceneTransforms:()=>Gi,SceneTransitioner:()=>ZB,ScreenSpaceCameraController:()=>t3,ScreenSpaceEventHandler:()=>of,ScreenSpaceEventType:()=>An,SelectedFeatureIdPipelineStage:()=>Ny,SelectionIndicator:()=>uU,SelectionIndicatorViewModel:()=>lU,SensorVolumePortionToDisplay:()=>cS,ShaderBuilder:()=>wb,ShaderCache:()=>gI,ShaderDestination:()=>ge,ShaderFunction:()=>vI,ShaderProgram:()=>Jt,ShaderSource:()=>He,ShaderStruct:()=>wI,ShadowMap:()=>Tg,ShadowMapShader:()=>up,ShadowMode:()=>xn,ShadowVolumeAppearance:()=>bu,ShowGeometryInstanceAttribute:()=>bn,Simon1994PlanetaryPositions:()=>Xg,SimplePolylineGeometry:()=>RZ,SingleTileImageryProvider:()=>E2,SkinningPipelineStage:()=>vM,SkyAtmosphere:()=>B3,SkyBox:()=>k3,SpatialNode:()=>O3,Spdcf:()=>eR,SpecularEnvironmentCubeMap:()=>Yd,SphereEmitter:()=>TQ,SphereGeometry:()=>MZ,SphereOutlineGeometry:()=>M_,Spherical:()=>yN,Spline:()=>Ni,SplitDirection:()=>Vr,Splitter:()=>kw,StaticGeometryColorBatch:()=>rd,StaticGeometryPerMaterialBatch:()=>sd,StaticGroundGeometryColorBatch:()=>wS,StaticGroundGeometryPerMaterialBatch:()=>ZN,StaticGroundPolylinePerMaterialBatch:()=>cF,StaticOutlineGeometryBatch:()=>PS,StencilConstants:()=>kt,StencilFunction:()=>Vn,StencilOperation:()=>ft,SteppedSpline:()=>_R,Stereographic:()=>yc,StorageType:()=>wm,StripeMaterialProperty:()=>sS,StripeOrientation:()=>Eh,StructuralMetadata:()=>Ys,StyleCommandsNeeded:()=>ch,StyleExpression:()=>AQ,Sun:()=>z3,SunLight:()=>Rp,SunPostProcess:()=>o3,SupportedImageFormats:()=>$1,SvgPathBindingHandler:()=>Pk,TaskProcessor:()=>yi,Terrain:()=>Ek,TerrainData:()=>kh,TerrainEncoding:()=>Oc,TerrainFillMesh:()=>bw,TerrainMesh:()=>hd,TerrainOffsetProperty:()=>$b,TerrainProvider:()=>cs,TerrainQuantization:()=>ea,TerrainState:()=>fo,Texture:()=>Rt,TextureAtlas:()=>vb,TextureCache:()=>yI,TextureMagnificationFilter:()=>li,TextureManager:()=>w3,TextureMinificationFilter:()=>Yt,TexturePacker:()=>_C,TextureUniform:()=>RQ,TextureWrap:()=>gn,TileAvailability:()=>Xh,TileBoundingRegion:()=>Lu,TileBoundingS2Cell:()=>ML,TileBoundingSphere:()=>L_,TileBoundingVolume:()=>CQ,TileCoordinatesImageryProvider:()=>wk,TileDiscardPolicy:()=>SQ,TileEdge:()=>yn,TileImagery:()=>_w,TileMapServiceImageryProvider:()=>D0,TileMetadata:()=>vL,TileOrientedBoundingBox:()=>Yl,TileProviderError:()=>Po,TileReplacementQueue:()=>N2,TileSelectionResult:()=>Yn,TileState:()=>wQ,Tileset3DTileContent:()=>tL,TilesetMetadata:()=>LL,TilesetPipelineStage:()=>ER,TilingScheme:()=>LZ,TimeConstants:()=>qn,TimeDynamicImagery:()=>jT,TimeDynamicPointCloud:()=>Vw,TimeInterval:()=>En,TimeIntervalCollection:()=>Xr,TimeIntervalCollectionPositionProperty:()=>X_,TimeIntervalCollectionProperty:()=>K_,TimeStandard:()=>Wn,Timeline:()=>pU,TimelineHighlightRange:()=>hU,TimelineTrack:()=>mU,Tipsify:()=>Nv,ToggleButtonViewModel:()=>Z0,Tonemapper:()=>Cg,TrackingReferenceFrame:()=>Bp,Transforms:()=>Ot,TranslationRotationScale:()=>iy,TranslucentTileClassification:()=>CB,TridiagonalSystemSolver:()=>lE,TrustedServers:()=>iC,TweenCollection:()=>lA,UniformState:()=>TI,UniformType:()=>hA,UrlTemplateImageryProvider:()=>Ya,VERSION:()=>sDt,VRButton:()=>xU,VRButtonViewModel:()=>bU,VRTheWorldTerrainProvider:()=>FZ,VaryingType:()=>MQ,Vector3DTileBatch:()=>bm,Vector3DTileClampedPolylines:()=>CL,Vector3DTileContent:()=>SL,Vector3DTileGeometry:()=>Zp,Vector3DTilePoints:()=>_L,Vector3DTilePolygons:()=>gL,Vector3DTilePolylines:()=>kx,Vector3DTilePrimitive:()=>rx,VelocityOrientationProperty:()=>xN,VelocityVectorProperty:()=>$_,VertexArray:()=>ti,VertexArrayFacade:()=>Mp,VertexAttributeSemantic:()=>ht,VertexFormat:()=>Ie,VerticalExaggeration:()=>Dr,VerticalExaggerationPipelineStage:()=>PM,VerticalOrigin:()=>Fn,VideoSynchronizer:()=>NZ,View:()=>tA,Viewer:()=>tJ,ViewportQuad:()=>vQ,Visibility:()=>xr,Visualizer:()=>MX,VoxelBoxShape:()=>gA,VoxelCell:()=>a3,VoxelContent:()=>_A,VoxelCylinderShape:()=>yA,VoxelEllipsoidShape:()=>bA,VoxelInspector:()=>gU,VoxelInspectorViewModel:()=>_U,VoxelMetadataOrder:()=>Td,VoxelPrimitive:()=>V0,VoxelProvider:()=>PQ,VoxelRenderResources:()=>A3,VoxelShape:()=>IQ,VoxelShapeType:()=>va,VoxelTraversal:()=>R3,VulkanConstants:()=>BZ,WallGeometry:()=>YN,WallGeometryLibrary:()=>mT,WallGeometryUpdater:()=>$N,WallGraphics:()=>Wp,WallOutlineGeometry:()=>KN,WebGLConstants:()=>ne,WebMapServiceImageryProvider:()=>w2,WebMapTileServiceImageryProvider:()=>D2,WebMercatorProjection:()=>Mi,WebMercatorTilingScheme:()=>ls,WindingOrder:()=>ts,WireframeIndexGenerator:()=>gE,WireframePipelineStage:()=>IM,_shadersAcesTonemappingStage:()=>vB,_shadersAdditiveBlend:()=>n3,_shadersAdjustTranslucentFS:()=>JS,_shadersAllMaterialAppearanceFS:()=>MI,_shadersAllMaterialAppearanceVS:()=>LI,_shadersAmbientOcclusionGenerate:()=>DB,_shadersAmbientOcclusionModulate:()=>PB,_shadersAspectRampMaterial:()=>UI,_shadersAtmosphereCommon:()=>nh,_shadersAtmosphereStageFS:()=>SR,_shadersAtmosphereStageVS:()=>wR,_shadersBasicMaterialAppearanceFS:()=>NI,_shadersBasicMaterialAppearanceVS:()=>FI,_shadersBillboardCollectionFS:()=>nL,_shadersBillboardCollectionVS:()=>iL,_shadersBlackAndWhite:()=>IB,_shadersBloomComposite:()=>OB,_shadersBrdfLutGeneratorFS:()=>YF,_shadersBrightPass:()=>i3,_shadersBrightness:()=>RB,_shadersBumpMapMaterial:()=>VI,_shadersCPUStylingStageFS:()=>ZR,_shadersCPUStylingStageVS:()=>$R,_shadersCheckerboardMaterial:()=>zI,_shadersCloudCollectionFS:()=>XF,_shadersCloudCollectionVS:()=>KF,_shadersCloudNoiseFS:()=>$F,_shadersCloudNoiseVS:()=>ZF,_shadersCompareAndPackTranslucentDepth:()=>QF,_shadersCompositeOITFS:()=>JF,_shadersCompositeTranslucentClassification:()=>eA,_shadersComputeIrradianceFS:()=>B1,_shadersComputeRadianceMapFS:()=>k1,_shadersContrastBias:()=>MB,_shadersConvolveSpecularMapFS:()=>U1,_shadersConvolveSpecularMapVS:()=>V1,_shadersCustomShaderStageFS:()=>eM,_shadersCustomShaderStageVS:()=>JR,_shadersCzmBuiltins:()=>Cb,_shadersDepthOfField:()=>LB,_shadersDepthPlaneFS:()=>e2,_shadersDepthPlaneVS:()=>t2,_shadersDepthView:()=>NB,_shadersDepthViewPacked:()=>OQ,_shadersDotMaterial:()=>HI,_shadersEdgeDetection:()=>FB,_shadersElevationBandMaterial:()=>GI,_shadersElevationContourMaterial:()=>jI,_shadersElevationRampMaterial:()=>WI,_shadersEllipsoidFS:()=>ew,_shadersEllipsoidSurfaceAppearanceFS:()=>uk,_shadersEllipsoidSurfaceAppearanceVS:()=>fk,_shadersEllipsoidVS:()=>tw,_shadersFXAA:()=>UB,_shadersFXAA3_11:()=>n2,_shadersFadeMaterial:()=>qI,_shadersFeatureIdStageFS:()=>tM,_shadersFeatureIdStageVS:()=>nM,_shadersFilmicTonemapping:()=>BB,_shadersGaussianBlur1D:()=>F0,_shadersGeometryStageFS:()=>cM,_shadersGeometryStageVS:()=>lM,_shadersGlobeFS:()=>i2,_shadersGlobeVS:()=>o2,_shadersGridMaterial:()=>YI,_shadersGroundAtmosphere:()=>nw,_shadersHSBToRGB:()=>_P,_shadersHSLToRGB:()=>gP,_shadersImageBasedLightingStageFS:()=>DR,_shadersInstancingStageCommon:()=>UR,_shadersInstancingStageVS:()=>VR,_shadersIntersectBox:()=>m3,_shadersIntersectClippingPlanes:()=>h3,_shadersIntersectCylinder:()=>p3,_shadersIntersectDepth:()=>d3,_shadersIntersectEllipsoid:()=>_3,_shadersIntersectLongitude:()=>Rw,_shadersIntersection:()=>dA,_shadersIntersectionUtils:()=>f3,_shadersLegacyInstancingStageVS:()=>zR,_shadersLensFlare:()=>VB,_shadersLightingStageFS:()=>dM,_shadersMaterialStageFS:()=>mM,_shadersMegatexture:()=>T3,_shadersMetadataStageFS:()=>iM,_shadersMetadataStageVS:()=>oM,_shadersModelClippingPlanesStageFS:()=>MR,_shadersModelClippingPolygonsStageFS:()=>FR,_shadersModelClippingPolygonsStageVS:()=>NR,_shadersModelColorStageFS:()=>RR,_shadersModelFS:()=>YM,_shadersModelSilhouetteStageFS:()=>NM,_shadersModelSilhouetteStageVS:()=>FM,_shadersModelSplitterStageFS:()=>kM,_shadersModelVS:()=>qM,_shadersModifiedReinhardTonemapping:()=>zB,_shadersMorphTargetsStageVS:()=>_M,_shadersNightVision:()=>HB,_shadersNormalMapMaterial:()=>XI,_shadersOctree:()=>x3,_shadersPassThrough:()=>su,_shadersPassThroughDepth:()=>M0,_shadersPbrNeutralTonemapping:()=>kB,_shadersPerInstanceColorAppearanceFS:()=>rO,_shadersPerInstanceColorAppearanceVS:()=>sO,_shadersPerInstanceFlatColorAppearanceFS:()=>Ob,_shadersPerInstanceFlatColorAppearanceVS:()=>aO,_shadersPointCloudEyeDomeLighting:()=>sR,_shadersPointCloudStylingStageVS:()=>bM,_shadersPointPrimitiveCollectionFS:()=>Qy,_shadersPointPrimitiveCollectionVS:()=>aN,_shadersPolygonSignedDistanceFS:()=>N1,_shadersPolylineArrowMaterial:()=>KI,_shadersPolylineColorAppearanceVS:()=>AO,_shadersPolylineCommon:()=>xu,_shadersPolylineDashMaterial:()=>$I,_shadersPolylineFS:()=>kb,_shadersPolylineGlowMaterial:()=>ZI,_shadersPolylineMaterialAppearanceVS:()=>CO,_shadersPolylineOutlineMaterial:()=>QI,_shadersPolylineShadowVolumeFS:()=>yO,_shadersPolylineShadowVolumeMorphFS:()=>bO,_shadersPolylineShadowVolumeMorphVS:()=>xO,_shadersPolylineShadowVolumeVS:()=>TO,_shadersPolylineVS:()=>uL,_shadersPrimitiveOutlineStageFS:()=>AM,_shadersPrimitiveOutlineStageVS:()=>TM,_shadersRGBToHSB:()=>GP,_shadersRGBToHSL:()=>jP,_shadersRGBToXYZ:()=>WP,_shadersReinhardTonemapping:()=>GB,_shadersReprojectWebMercatorFS:()=>r2,_shadersReprojectWebMercatorVS:()=>s2,_shadersRimLightingMaterial:()=>JI,_shadersSelectedFeatureIdStageCommon:()=>_E,_shadersShadowVolumeAppearanceFS:()=>AC,_shadersShadowVolumeAppearanceVS:()=>uO,_shadersShadowVolumeFS:()=>Jg,_shadersSilhouette:()=>jB,_shadersSkinningStageVS:()=>wM,_shadersSkyAtmosphereCommon:()=>iw,_shadersSkyAtmosphereFS:()=>a2,_shadersSkyAtmosphereVS:()=>c2,_shadersSkyBoxFS:()=>l2,_shadersSkyBoxVS:()=>u2,_shadersSlopeRampMaterial:()=>eO,_shadersStripeMaterial:()=>tO,_shadersSunFS:()=>f2,_shadersSunTextureFS:()=>d2,_shadersSunVS:()=>h2,_shadersTexturedMaterialAppearanceFS:()=>BI,_shadersTexturedMaterialAppearanceVS:()=>kI,_shadersVector3DTileClampedPolylinesFS:()=>TL,_shadersVector3DTileClampedPolylinesVS:()=>xL,_shadersVector3DTilePolylinesVS:()=>yL,_shadersVectorTileVS:()=>MC,_shadersVerticalExaggerationStageVS:()=>DM,_shadersViewportQuadFS:()=>m2,_shadersViewportQuadVS:()=>mb,_shadersVoxelFS:()=>l3,_shadersVoxelUtils:()=>c3,_shadersVoxelVS:()=>u3,_shadersWater:()=>iO,_shadersWaterMaskMaterial:()=>nO,_shadersXYZToRGB:()=>pI,_shadersacesTonemapping:()=>LD,_shadersalphaWeight:()=>ND,_shadersantialias:()=>FD,_shadersapplyHSBShift:()=>BD,_shadersapproximateSphericalCoordinates:()=>kD,_shadersapproximateTanh:()=>UD,_shadersbackFacing:()=>VD,_shadersbranchFreeTernary:()=>zD,_shaderscascadeColor:()=>HD,_shaderscascadeDistance:()=>GD,_shaderscascadeMatrix:()=>jD,_shaderscascadeWeights:()=>WD,_shadersclipPolygons:()=>qD,_shaderscolumbusViewMorph:()=>YD,_shaderscomputeAtmosphereColor:()=>XD,_shaderscomputeGroundAtmosphereScattering:()=>KD,_shaderscomputePosition:()=>$D,_shaderscomputeScattering:()=>ZD,_shadersconvertUvToBox:()=>g3,_shadersconvertUvToCylinder:()=>y3,_shadersconvertUvToEllipsoid:()=>b3,_shaderscosineAndSine:()=>QD,_shadersdecompressTextureCoordinates:()=>JD,_shadersdegreesPerRadian:()=>Hv,_shadersdepthClamp:()=>eP,_shadersdepthRange:()=>Gv,_shadersdepthRangeStruct:()=>wD,_shaderseastNorthUpToEyeCoordinates:()=>tP,_shadersellipsoidContainsPoint:()=>nP,_shadersellipsoidTextureCoordinates:()=>iP,_shadersepsilon1:()=>jv,_shadersepsilon2:()=>Wv,_shadersepsilon3:()=>qv,_shadersepsilon4:()=>Yv,_shadersepsilon5:()=>Xv,_shadersepsilon6:()=>Kv,_shadersepsilon7:()=>$v,_shadersequalsEpsilon:()=>oP,_shaderseyeOffset:()=>rP,_shaderseyeToWindowCoordinates:()=>sP,_shadersfastApproximateAtan:()=>aP,_shadersfog:()=>cP,_shadersgammaCorrect:()=>lP,_shadersgeodeticSurfaceNormal:()=>uP,_shadersgetDefaultMaterial:()=>fP,_shadersgetDynamicAtmosphereLightDirection:()=>dP,_shadersgetLambertDiffuse:()=>hP,_shadersgetSpecular:()=>mP,_shadersgetWaterNoise:()=>pP,_shadershue:()=>yP,_shadersinfinity:()=>Zv,_shadersinverseGamma:()=>bP,_shadersisEmpty:()=>xP,_shadersisFull:()=>TP,_shaderslatitudeToWebMercatorFraction:()=>AP,_shaderslineDistance:()=>EP,_shaderslinearToSrgb:()=>CP,_shadersluminance:()=>SP,_shadersmaterial:()=>vD,_shadersmaterialInput:()=>DD,_shadersmaximumComponent:()=>wP,_shadersmetersPerPixel:()=>vP,_shadersmodelMaterial:()=>PD,_shadersmodelToWindowCoordinates:()=>DP,_shadersmodelVertexOutput:()=>ID,_shadersmultiplyWithColorBalance:()=>PP,_shadersnearFarScalar:()=>IP,_shadersoctDecode:()=>OP,_shadersoneOverPi:()=>Qv,_shadersoneOverTwoPi:()=>Jv,_shaderspackDepth:()=>RP,_shaderspassCesium3DTile:()=>eD,_shaderspassCesium3DTileClassification:()=>tD,_shaderspassCesium3DTileClassificationIgnoreShow:()=>nD,_shaderspassClassification:()=>iD,_shaderspassCompute:()=>oD,_shaderspassEnvironment:()=>rD,_shaderspassGlobe:()=>sD,_shaderspassOpaque:()=>aD,_shaderspassOverlay:()=>cD,_shaderspassTerrainClassification:()=>lD,_shaderspassTranslucent:()=>uD,_shaderspassVoxels:()=>fD,_shaderspbrLighting:()=>MP,_shaderspbrNeutralTonemapping:()=>LP,_shadersphong:()=>NP,_shaderspi:()=>dD,_shaderspiOverFour:()=>hD,_shaderspiOverSix:()=>mD,_shaderspiOverThree:()=>pD,_shaderspiOverTwo:()=>_D,_shadersplaneDistance:()=>FP,_shaderspointAlongRay:()=>BP,_shadersradiansPerDegree:()=>gD,_shadersray:()=>OD,_shadersrayEllipsoidIntersectionInterval:()=>kP,_shadersraySegment:()=>RD,_shadersraySphereIntersectionInterval:()=>UP,_shadersreadDepth:()=>VP,_shadersreadNonPerspective:()=>zP,_shadersreverseLogDepth:()=>HP,_shadersround:()=>qP,_shaderssaturation:()=>YP,_shaderssceneMode2D:()=>yD,_shaderssceneMode3D:()=>bD,_shaderssceneModeColumbusView:()=>xD,_shaderssceneModeMorphing:()=>TD,_shadersshadowDepthCompare:()=>XP,_shadersshadowParameters:()=>MD,_shadersshadowVisibility:()=>KP,_shaderssignNotZero:()=>$P,_shaderssolarRadius:()=>AD,_shaderssphericalHarmonics:()=>ZP,_shaderssrgbToLinear:()=>QP,_shaderstangentToEyeSpaceMatrix:()=>JP,_shaderstextureCube:()=>eI,_shadersthreePiOver2:()=>CD,_shaderstransformPlane:()=>tI,_shaderstranslateRelativeToEye:()=>nI,_shaderstranslucentPhong:()=>iI,_shaderstranspose:()=>oI,_shaderstwoPi:()=>ED,_shadersunpackClippingExtents:()=>rI,_shadersunpackDepth:()=>sI,_shadersunpackFloat:()=>aI,_shadersunpackUint:()=>cI,_shadersvalueTransform:()=>lI,_shadersvertexLogDepth:()=>uI,_shaderswebMercatorMaxLatitude:()=>SD,_shaderswindowToEyeCoordinates:()=>fI,_shaderswriteDepthClamp:()=>dI,_shaderswriteLogDepth:()=>hI,_shaderswriteNonPerspective:()=>mI,addBuffer:()=>y1,addDefaults:()=>u1,addExtensionsRequired:()=>p1,addExtensionsUsed:()=>Ff,addPipelineExtras:()=>py,addToArray:()=>vs,appendForwardSlash:()=>dv,arrayRemoveDuplicates:()=>xo,barycentricCoordinates:()=>_b,binarySearch:()=>Lo,buildModuleUrl:()=>tn,buildVoxelDrawCommands:()=>E3,clone:()=>je,combine:()=>xt,computeFlyToLocationForRectangle:()=>VT,createBillboardPointCallback:()=>Lx,createCommand:()=>Sn,createDefaultImageryProviderViewModels:()=>kk,createDefaultTerrainProviderViewModels:()=>Uk,createElevationBandMaterial:()=>ZZ,createGooglePhotorealistic3DTileset:()=>QZ,createGuid:()=>jn,createMaterialPropertyDescriptor:()=>No,createOsmBuildingsAsync:()=>JZ,createPropertyDescriptor:()=>fe,createRawPropertyDescriptor:()=>Yc,createTangentSpaceDebugPrimitive:()=>eQ,createTaskProcessorWorker:()=>NQ,createUniform:()=>wv,createUniformArray:()=>vv,createWorldBathymetryAsync:()=>K3,createWorldImageryAsync:()=>pg,createWorldTerrainAsync:()=>PA,decodeGoogleEarthEnterpriseData:()=>$3,decodeVectorPolylinePositions:()=>EL,defaultValue:()=>lZ,defer:()=>Dl,defined:()=>c,demodernizeShader:()=>_I,deprecationWarning:()=>ws,destroyObject:()=>de,exportKml:()=>MY,findAccessorMinMax:()=>hx,findContentMetadata:()=>Vx,findGroupMetadata:()=>zx,findTileMetadata:()=>DL,forEachTextureInMaterial:()=>HC,formatError:()=>ep,freezeRenderState:()=>Sv,getAbsoluteUri:()=>om,getAccessorByteStride:()=>Ul,getBaseUri:()=>hv,getBinaryAccessor:()=>Eu,getClipAndStyleCode:()=>H3,getClippingFunction:()=>fg,getComponentReader:()=>o_,getElement:()=>In,getExtensionFromUri:()=>rb,getFilenameFromUri:()=>j_,getImageFromTypedArray:()=>S3,getImagePixels:()=>Id,getJsonFromTypedArray:()=>ir,getMagic:()=>Kd,getMetadataClassProperty:()=>M3,getMetadataProperty:()=>N3,getStringFromTypedArray:()=>Fl,getTimestamp:()=>Ti,hasExtension:()=>oi,heightReferenceOnEntityPropertyChanged:()=>qp,isBitSet:()=>Fc,isBlobUri:()=>sb,isCrossOriginUrl:()=>Ug,isDataUri:()=>Ep,isLeapYear:()=>Dd,knockout:()=>xe,knockout_3_5_1:()=>GA,knockout_es5:()=>Dk,loadAndExecuteScript:()=>ab,loadCubeMap:()=>SI,loadImageFromTypedArray:()=>ux,loadKTX2:()=>Il,mergeSort:()=>gg,moveTechniqueRenderStates:()=>m1,moveTechniquesToExtension:()=>_1,numberOfComponentsForType:()=>wu,objectToQuery:()=>cb,oneTimeWarning:()=>dt,parseBatchTable:()=>m_,parseFeatureMetadataLegacy:()=>X1,parseGlb:()=>d1,parseResponseHeaders:()=>mv,parseStructuralMetadata:()=>Y1,pickModel:()=>xE,pointInsideTriangle:()=>IZ,preprocess3DTileContent:()=>I_,processVoxelProperties:()=>C3,queryToObject:()=>hu,readAccessorPacked:()=>b1,removeExtension:()=>mx,removeExtensionsRequired:()=>f1,removeExtensionsUsed:()=>dx,removePipelineExtras:()=>h1,removeUnusedElements:()=>g1,resizeImageToNextPowerOfTwo:()=>yy,sampleTerrain:()=>p2,sampleTerrainMostDetailed:()=>UT,scaleToGeodeticSurface:()=>ob,srgbToLinear:()=>MA,subdivideArray:()=>fO,subscribeAndEvaluate:()=>Da,updateAccessorComponentTypes:()=>x1,updateVersion:()=>T1,usesExtension:()=>mr,viewerCesium3DTilesInspectorMixin:()=>nJ,viewerCesiumInspectorMixin:()=>iJ,viewerDragDropMixin:()=>rJ,viewerPerformanceWatchdogMixin:()=>sJ,viewerVoxelInspectorMixin:()=>aJ,webGLConstantToGlslType:()=>kZ,wrapFunction:()=>tk,writeTextToCanvas:()=>Fx});module.exports=nm(aDt);function wSe(e){return e!=null}var c=wSe;function nb(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}c(Object.create)&&(nb.prototype=Object.create(Error.prototype),nb.prototype.constructor=nb);nb.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return c(this.stack)&&(e+=` ${this.stack.toString()}`),e};nb.throwInstantiationError=function(){throw new nb("This function defines an interface and should not be called directly.")};var E=nb;var Es={};Es.typeOf={};function vSe(e){return`${e} is required, actual value was undefined`}function YA(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Es.defined=function(e,t){if(!c(t))throw new E(vSe(e))};Es.typeOf.func=function(e,t){if(typeof t!="function")throw new E(YA(typeof t,"function",e))};Es.typeOf.string=function(e,t){if(typeof t!="string")throw new E(YA(typeof t,"string",e))};Es.typeOf.number=function(e,t){if(typeof t!="number")throw new E(YA(typeof t,"number",e))};Es.typeOf.number.lessThan=function(e,t,n){if(Es.typeOf.number(e,t),t>=n)throw new E(`Expected ${e} to be less than ${n}, actual value was ${t}`)};Es.typeOf.number.lessThanOrEquals=function(e,t,n){if(Es.typeOf.number(e,t),t>n)throw new E(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};Es.typeOf.number.greaterThan=function(e,t,n){if(Es.typeOf.number(e,t),t<=n)throw new E(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};Es.typeOf.number.greaterThanOrEquals=function(e,t,n){if(Es.typeOf.number(e,t),t0?1:-1};st.signNotZero=function(e){return e<0?-1:1};st.toSNorm=function(e,t){return t=t??255,Math.round((st.clamp(e,-1,1)*.5+.5)*t)};st.fromSNorm=function(e,t){return t=t??255,st.clamp(e,0,t)/t*2-1};st.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:st.clamp((e-t)/n,0,1)};st.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};st.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};st.lerp=function(e,t,n){return(1-n)*e+n*t};st.PI=Math.PI;st.ONE_OVER_PI=1/Math.PI;st.PI_OVER_TWO=Math.PI/2;st.PI_OVER_THREE=Math.PI/3;st.PI_OVER_FOUR=Math.PI/4;st.PI_OVER_SIX=Math.PI/6;st.THREE_PI_OVER_TWO=3*Math.PI/2;st.TWO_PI=2*Math.PI;st.ONE_OVER_TWO_PI=1/(2*Math.PI);st.RADIANS_PER_DEGREE=Math.PI/180;st.DEGREES_PER_RADIAN=180/Math.PI;st.RADIANS_PER_ARCSECOND=st.RADIANS_PER_DEGREE/3600;st.toRadians=function(e){if(!c(e))throw new E("degrees is required.");return e*st.RADIANS_PER_DEGREE};st.toDegrees=function(e){if(!c(e))throw new E("radians is required.");return e*st.DEGREES_PER_RADIAN};st.convertLongitudeRange=function(e){if(!c(e))throw new E("angle is required.");let t=st.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};st.clampToLatitudeRange=function(e){if(!c(e))throw new E("angle is required.");return st.clamp(e,-1*st.PI_OVER_TWO,st.PI_OVER_TWO)};st.negativePiToPi=function(e){if(!c(e))throw new E("angle is required.");return e>=-st.PI&&e<=st.PI?e:st.zeroToTwoPi(e+st.PI)-st.PI};st.zeroToTwoPi=function(e){if(!c(e))throw new E("angle is required.");if(e>=0&&e<=st.TWO_PI)return e;let t=st.mod(e,st.TWO_PI);return Math.abs(t)st.EPSILON14?st.TWO_PI:t};st.mod=function(e,t){if(!c(e))throw new E("m is required.");if(!c(t))throw new E("n is required.");if(t===0)throw new E("divisor cannot be 0.");return st.sign(e)===st.sign(t)&&Math.abs(e)n};st.greaterThanOrEquals=function(e,t,n){if(!c(e))throw new E("first is required.");if(!c(t))throw new E("second is required.");if(!c(n))throw new E("absoluteEpsilon is required.");return e-t>-n};var CU=[1];st.factorial=function(e){if(typeof e!="number"||e<0)throw new E("A number greater than or equal to 0 is required.");let t=CU.length;if(e>=t){let n=CU[t-1];for(let i=t;i<=e;i++){let o=n*i;CU.push(o),n=o}}return CU[e]};st.incrementWrap=function(e,t,n){if(n=n??0,!c(e))throw new E("n is required.");if(t<=n)throw new E("maximumValue must be greater than minimumValue.");return++e,e>t&&(e=n),e};st.isPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new E("A number between 0 and (2^32)-1 is required.");return e!==0&&(e&e-1)===0};st.nextPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>2147483648)throw new E("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};st.previousPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new E("A number between 0 and (2^32)-1 is required.");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};st.clamp=function(e,t,n){return T.typeOf.number("value",e),T.typeOf.number("min",t),T.typeOf.number("max",n),en?n:e};var hJ=new v5.default;st.setRandomNumberSeed=function(e){if(!c(e))throw new E("seed is required.");hJ=new v5.default(e)};st.nextRandomNumber=function(){return hJ.random()};st.randomBetween=function(e,t){return st.nextRandomNumber()*(t-e)+e};st.acosClamped=function(e){if(!c(e))throw new E("value is required.");return Math.acos(st.clamp(e,-1,1))};st.asinClamped=function(e){if(!c(e))throw new E("value is required.");return Math.asin(st.clamp(e,-1,1))};st.chordLength=function(e,t){if(!c(e))throw new E("angle is required.");if(!c(t))throw new E("radius is required.");return 2*t*Math.sin(e*.5)};st.logBase=function(e,t){if(!c(e))throw new E("number is required.");if(!c(t))throw new E("base is required.");return Math.log(e)/Math.log(t)};st.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};st.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};st.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};st.fastApproximateAtan=function(e){return T.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};st.fastApproximateAtan2=function(e,t){T.typeOf.number("x",e),T.typeOf.number("y",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;if(isNaN(r))throw new E("either x or y must be nonzero");return i=st.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?st.PI_OVER_TWO-i:i,i=e<0?st.PI-i:i,i=t<0?-i:i,i};var O=st;function Je(e,t,n){this.x=e??0,this.y=t??0,this.z=n??0}Je.fromSpherical=function(e,t){T.typeOf.object("spherical",e),c(t)||(t=new Je);let n=e.clock,i=e.cone,o=e.magnitude??1,r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};Je.fromElements=function(e,t,n,i){return c(i)?(i.x=e,i.y=t,i.z=n,i):new Je(e,t,n)};Je.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Je(e.x,e.y,e.z)};Je.fromCartesian4=Je.clone;Je.packedLength=3;Je.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};Je.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Je),n.x=e[t++],n.y=e[t++],n.z=e[t],n};Je.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*3;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new E("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==i&&(t.length=i)}for(let o=0;oi&&(o=u,i=f)}let r=1,s=0,a=R5[o],l=M5[o];if(Math.abs(e[tt.getElementIndex(l,a)])>n){let u=e[tt.getElementIndex(l,l)],f=e[tt.getElementIndex(a,a)],h=e[tt.getElementIndex(l,a)],p=(u-f)/2/h,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+g*g),s=g*r}return t=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(l,l)]=r,t[tt.getElementIndex(l,a)]=s,t[tt.getElementIndex(a,l)]=-s,t}var vU=new tt,yJ=new tt;tt.computeEigenDecomposition=function(e,t){T.typeOf.object("matrix",e);let n=O.EPSILON20,i=10,o=0,r=0;c(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),l=n*FSe(a);for(;rl;)kSe(a,vU),tt.transpose(vU,yJ),tt.multiply(a,vU,a),tt.multiply(yJ,a,a),tt.multiply(s,vU,s),++o>2&&(++r,o=0);return t};tt.abs=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};tt.determinant=function(e){T.typeOf.object("matrix",e);let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],l=e[5],u=e[8];return t*(r*u-l*s)+o*(l*i-n*u)+a*(n*s-r*i)};tt.inverse=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],l=e[6],u=e[7],f=e[8],h=tt.determinant(e);if(Math.abs(h)<=O.EPSILON15)throw new E("matrix is not invertible");t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=l*a-r*f,t[4]=n*f-l*o,t[5]=r*o-n*a,t[6]=r*u-l*s,t[7]=l*i-n*u,t[8]=n*s-r*i;let p=1/h;return tt.multiplyByScalar(t,p,t)};var USe=new tt;tt.inverseTranspose=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),tt.inverse(tt.transpose(e,USe),t)};tt.equals=function(e,t){return e===t||c(e)&&c(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};tt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;Object.defineProperties(tt.prototype,{length:{get:function(){return tt.packedLength}}});tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) (${this[2]}, ${this[5]}, ${this[8]})`};var J=tt;function lv(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}c(Object.create)&&(lv.prototype=Object.create(Error.prototype),lv.prototype.constructor=lv);lv.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return c(this.stack)&&(e+=` ${this.stack.toString()}`),e};var ae=lv;function et(e,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y){this[0]=e??0,this[1]=o??0,this[2]=l??0,this[3]=p??0,this[4]=t??0,this[5]=r??0,this[6]=u??0,this[7]=g??0,this[8]=n??0,this[9]=s??0,this[10]=f??0,this[11]=m??0,this[12]=i??0,this[13]=a??0,this[14]=h??0,this[15]=y??0}et.packedLength=16;et.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),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};et.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new et),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};et.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*16;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new E("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==i&&(t.length=i)}for(let o=0;o=O.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Vs.createTypedArrayFromArrayBuffer=function(e,t,n,i){if(!c(e))throw new E("numberOfVertices is required.");if(!c(t))throw new E("sourceArray is required.");if(!c(n))throw new E("byteOffset is required.");return e>=O.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Vs.fromTypedArray=function(e){if(e instanceof Uint8Array)return Vs.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Vs.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Vs.UNSIGNED_INT;throw new E("array must be a Uint8Array, Uint16Array, or Uint32Array.")};var Fe=Object.freeze(Vs);var DU={STREAM_DRAW:ne.STREAM_DRAW,STATIC_DRAW:ne.STATIC_DRAW,DYNAMIC_DRAW:ne.DYNAMIC_DRAW,validate:function(e){return e===DU.STREAM_DRAW||e===DU.STATIC_DRAW||e===DU.DYNAMIC_DRAW}},Be=Object.freeze(DU);function yf(e){if(e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context),!c(e.typedArray)&&!c(e.sizeInBytes))throw new E("Either options.sizeInBytes or options.typedArray is required.");if(c(e.typedArray)&&c(e.sizeInBytes))throw new E("Cannot pass in both options.sizeInBytes and options.typedArray.");if(c(e.typedArray)&&(T.typeOf.object("options.typedArray",e.typedArray),T.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!Be.validate(e.usage))throw new E("usage is invalid.");let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=c(i);s&&(o=i.byteLength),T.typeOf.number.greaterThan("sizeInBytes",o,0);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?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=a,this.vertexArrayDestroyable=!0}yf.createVertexBuffer=function(e){return T.defined("options.context",e.context),new yf({context:e.context,bufferTarget:ne.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};yf.createIndexBuffer=function(e){if(T.defined("options.context",e.context),!Fe.validate(e.indexDatatype))throw new E("Invalid indexDatatype.");if(e.indexDatatype===Fe.UNSIGNED_INT&&!e.context.elementIndexUint)throw new E("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.");let t=e.context,n=e.indexDatatype,i=Fe.getSizeInBytes(n),o=new yf({context:t,bufferTarget:ne.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(yf.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});yf.prototype._getBuffer=function(){return this._buffer};yf.prototype.copyFromArrayView=function(e,t){t=t??0,T.defined("arrayView",e),T.typeOf.number.lessThanOrEquals("offsetInBytes + arrayView.byteLength",t+e.byteLength,this._sizeInBytes);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};yf.prototype.copyFromBuffer=function(e,t,n,i){if(!this._webgl2)throw new E("A WebGL 2 context is required.");if(!c(e))throw new E("readBuffer must be defined.");if(!c(i)||i<=0)throw new E("sizeInBytes must be defined and be greater than zero.");if(!c(t)||t<0||t+i>e._sizeInBytes)throw new E("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!c(n)||n<0||n+i>this._sizeInBytes)throw new E("writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.");if(this._buffer===e._buffer&&(n>=t&&nn&&ts)throw new E("destinationOffset must be greater than zero and less than the arrayView length.");if(n+o>s)throw new E("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new E("sourceOffset must be greater than zero and less than the buffers size.");if(t+o*r>this._sizeInBytes)throw new E("sourceOffset + length must be less than the buffers size.");let a=this._gl,l=ne.COPY_READ_BUFFER;a.bindBuffer(l,this._buffer),a.getBufferSubData(l,t,e,n,i),a.bindBuffer(l,null)};yf.prototype.isDestroyed=function(){return!1};yf.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),de(this)};var yt=yf;var Fg,Br={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},vl={};Object.defineProperties(vl,{element:{get:function(){if(vl.supportsFullscreen())return document[Br.fullscreenElement]}},changeEventName:{get:function(){if(vl.supportsFullscreen())return Br.fullscreenchange}},errorEventName:{get:function(){if(vl.supportsFullscreen())return Br.fullscreenerror}},enabled:{get:function(){if(vl.supportsFullscreen())return document[Br.fullscreenEnabled]}},fullscreen:{get:function(){if(vl.supportsFullscreen())return vl.element!==null}}});vl.supportsFullscreen=function(){if(c(Fg))return Fg;Fg=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Br.requestFullscreen="requestFullscreen",Br.exitFullscreen="exitFullscreen",Br.fullscreenEnabled="fullscreenEnabled",Br.fullscreenElement="fullscreenElement",Br.fullscreenchange="fullscreenchange",Br.fullscreenerror="fullscreenerror",Fg=!0,Fg;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i{let t=new Image;t.onload=function(){ic._result=t.width>0&&t.height>0,e(ic._result)},t.onerror=function(){ic._result=!1,e(ic._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),ic._promise};Object.defineProperties(ic,{initialized:{get:function(){return c(ic._result)}}});var ZA=[];typeof ArrayBuffer<"u"&&(ZA.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&ZA.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&ZA.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&ZA.push(BigInt64Array),typeof BigUint64Array<"u"&&ZA.push(BigUint64Array));var bf={isChrome:V5,chromeVersion:twe,isSafari:AJ,safariVersion:nwe,isWebkit:CJ,webkitVersion:iwe,isInternetExplorer:EJ,internetExplorerVersion:owe,isEdge:NU,edgeVersion:rwe,isFirefox:FU,firefoxVersion:cwe,isWindows:swe,isIPadOrIOS:awe,hardwareConcurrency:oc.hardwareConcurrency??3,supportsPointerEvents:lwe,supportsImageRenderingPixelated:vJ,supportsWebP:ic,imageRenderingValue:uwe,typedArrayTypes:ZA};bf.supportsBasis=function(e){return bf.supportsWebAssembly()&&e.context.supportsBasis};bf.supportsFullscreen=function(){return Cr.supportsFullscreen()};bf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};bf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};bf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};bf.supportsBigInt=function(){return typeof BigInt<"u"};bf.supportsWebWorkers=function(){return typeof Worker<"u"};bf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};bf.supportsWebgl2=function(e){return T.defined("scene",e),e.context.webgl2};bf.supportsEsmWebWorkers=function(){return!FU()||parseInt(z5)>=114};var Vt=bf;function H5(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function re(e,t,n,i){this.red=e??1,this.green=t??1,this.blue=n??1,this.alpha=i??1}re.fromCartesian4=function(e,t){return T.typeOf.object("cartesian",e),c(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new re(e.x,e.y,e.z,e.w)};re.fromBytes=function(e,t,n,i,o){return e=re.byteToFloat(e??255),t=re.byteToFloat(t??255),n=re.byteToFloat(n??255),i=re.byteToFloat(i??255),c(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new re(e,t,n,i)};re.fromAlpha=function(e,t,n){return T.typeOf.object("color",e),T.typeOf.number("alpha",t),c(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new re(e.red,e.green,e.blue,t)};var G5,j5,Cp;Vt.supportsTypedArrays()&&(G5=new ArrayBuffer(4),j5=new Uint32Array(G5),Cp=new Uint8Array(G5));re.fromRgba=function(e,t){return j5[0]=e,re.fromBytes(Cp[0],Cp[1],Cp[2],Cp[3],t)};re.fromHsl=function(e,t,n,i,o){e=(e??0)%1,t=t??0,n=n??0,i=i??1;let r=n,s=n,a=n;if(t!==0){let l;n<.5?l=n*(1+t):l=n+t-n*t;let u=2*n-l;r=H5(u,l,e+1/3),s=H5(u,l,e),a=H5(u,l,e-1/3)}return c(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new re(r,s,a,i)};re.fromRandom=function(e,t){e=e??W.EMPTY_OBJECT;let n=e.red;if(!c(n)){let s=e.minimumRed??0,a=e.maximumRed??1;T.typeOf.number.lessThanOrEquals("minimumRed",s,a),n=s+O.nextRandomNumber()*(a-s)}let i=e.green;if(!c(i)){let s=e.minimumGreen??0,a=e.maximumGreen??1;T.typeOf.number.lessThanOrEquals("minimumGreen",s,a),i=s+O.nextRandomNumber()*(a-s)}let o=e.blue;if(!c(o)){let s=e.minimumBlue??0,a=e.maximumBlue??1;T.typeOf.number.lessThanOrEquals("minimumBlue",s,a),o=s+O.nextRandomNumber()*(a-s)}let r=e.alpha;if(!c(r)){let s=e.minimumAlpha??0,a=e.maximumAlpha??1;T.typeOf.number.lessThanOrEquals("minimumAlpha",s,a),r=s+O.nextRandomNumber()*(a-s)}return c(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new re(n,i,o,r)};var fwe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,dwe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,hwe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,mwe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;re.fromCssColorString=function(e,t){T.typeOf.string("color",e),c(t)||(t=new re),e=e.trim();let n=re[e.toUpperCase()];if(c(n))return re.clone(n,t),t;let i=fwe.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=dwe.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=hwe.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=mwe.exec(e),i!==null?re.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(i[4]??"1.0"),t):(t=void 0,t))))};re.packedLength=4;re.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};re.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new re),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};re.byteToFloat=function(e){return e/255};re.floatToByte=function(e){return e===1?255:e*256|0};re.clone=function(e,t){if(c(e))return c(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new re(e.red,e.green,e.blue,e.alpha)};re.equals=function(e,t){return e===t||c(e)&&c(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};re.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};re.prototype.clone=function(e){return re.clone(this,e)};re.prototype.equals=function(e){return re.equals(this,e)};re.prototype.equalsEpsilon=function(e,t){return this===e||c(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};re.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};re.prototype.toCssColorString=function(){let e=re.floatToByte(this.red),t=re.floatToByte(this.green),n=re.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};re.prototype.toCssHexString=function(){let e=re.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=re.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=re.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=re.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};re.prototype.toBytes=function(e){let t=re.floatToByte(this.red),n=re.floatToByte(this.green),i=re.floatToByte(this.blue),o=re.floatToByte(this.alpha);return c(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};re.prototype.toRgba=function(){return Cp[0]=re.floatToByte(this.red),Cp[1]=re.floatToByte(this.green),Cp[2]=re.floatToByte(this.blue),Cp[3]=re.floatToByte(this.alpha),j5[0]};re.prototype.brighten=function(e,t){return T.typeOf.number("magnitude",e),T.typeOf.number.greaterThanOrEquals("magnitude",e,0),T.typeOf.object("result",t),e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};re.prototype.darken=function(e,t){return T.typeOf.number("magnitude",e),T.typeOf.number.greaterThanOrEquals("magnitude",e,0),T.typeOf.object("result",t),e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};re.prototype.withAlpha=function(e,t){return re.fromAlpha(this,e,t)};re.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};re.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};re.multiply=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};re.divide=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};re.mod=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};re.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),i.red=O.lerp(e.red,t.red,n),i.green=O.lerp(e.green,t.green,n),i.blue=O.lerp(e.blue,t.blue,n),i.alpha=O.lerp(e.alpha,t.alpha,n),i};re.multiplyByScalar=function(e,t,n){return T.typeOf.object("color",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};re.divideByScalar=function(e,t,n){return T.typeOf.object("color",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};re.ALICEBLUE=Object.freeze(re.fromCssColorString("#F0F8FF"));re.ANTIQUEWHITE=Object.freeze(re.fromCssColorString("#FAEBD7"));re.AQUA=Object.freeze(re.fromCssColorString("#00FFFF"));re.AQUAMARINE=Object.freeze(re.fromCssColorString("#7FFFD4"));re.AZURE=Object.freeze(re.fromCssColorString("#F0FFFF"));re.BEIGE=Object.freeze(re.fromCssColorString("#F5F5DC"));re.BISQUE=Object.freeze(re.fromCssColorString("#FFE4C4"));re.BLACK=Object.freeze(re.fromCssColorString("#000000"));re.BLANCHEDALMOND=Object.freeze(re.fromCssColorString("#FFEBCD"));re.BLUE=Object.freeze(re.fromCssColorString("#0000FF"));re.BLUEVIOLET=Object.freeze(re.fromCssColorString("#8A2BE2"));re.BROWN=Object.freeze(re.fromCssColorString("#A52A2A"));re.BURLYWOOD=Object.freeze(re.fromCssColorString("#DEB887"));re.CADETBLUE=Object.freeze(re.fromCssColorString("#5F9EA0"));re.CHARTREUSE=Object.freeze(re.fromCssColorString("#7FFF00"));re.CHOCOLATE=Object.freeze(re.fromCssColorString("#D2691E"));re.CORAL=Object.freeze(re.fromCssColorString("#FF7F50"));re.CORNFLOWERBLUE=Object.freeze(re.fromCssColorString("#6495ED"));re.CORNSILK=Object.freeze(re.fromCssColorString("#FFF8DC"));re.CRIMSON=Object.freeze(re.fromCssColorString("#DC143C"));re.CYAN=Object.freeze(re.fromCssColorString("#00FFFF"));re.DARKBLUE=Object.freeze(re.fromCssColorString("#00008B"));re.DARKCYAN=Object.freeze(re.fromCssColorString("#008B8B"));re.DARKGOLDENROD=Object.freeze(re.fromCssColorString("#B8860B"));re.DARKGRAY=Object.freeze(re.fromCssColorString("#A9A9A9"));re.DARKGREEN=Object.freeze(re.fromCssColorString("#006400"));re.DARKGREY=re.DARKGRAY;re.DARKKHAKI=Object.freeze(re.fromCssColorString("#BDB76B"));re.DARKMAGENTA=Object.freeze(re.fromCssColorString("#8B008B"));re.DARKOLIVEGREEN=Object.freeze(re.fromCssColorString("#556B2F"));re.DARKORANGE=Object.freeze(re.fromCssColorString("#FF8C00"));re.DARKORCHID=Object.freeze(re.fromCssColorString("#9932CC"));re.DARKRED=Object.freeze(re.fromCssColorString("#8B0000"));re.DARKSALMON=Object.freeze(re.fromCssColorString("#E9967A"));re.DARKSEAGREEN=Object.freeze(re.fromCssColorString("#8FBC8F"));re.DARKSLATEBLUE=Object.freeze(re.fromCssColorString("#483D8B"));re.DARKSLATEGRAY=Object.freeze(re.fromCssColorString("#2F4F4F"));re.DARKSLATEGREY=re.DARKSLATEGRAY;re.DARKTURQUOISE=Object.freeze(re.fromCssColorString("#00CED1"));re.DARKVIOLET=Object.freeze(re.fromCssColorString("#9400D3"));re.DEEPPINK=Object.freeze(re.fromCssColorString("#FF1493"));re.DEEPSKYBLUE=Object.freeze(re.fromCssColorString("#00BFFF"));re.DIMGRAY=Object.freeze(re.fromCssColorString("#696969"));re.DIMGREY=re.DIMGRAY;re.DODGERBLUE=Object.freeze(re.fromCssColorString("#1E90FF"));re.FIREBRICK=Object.freeze(re.fromCssColorString("#B22222"));re.FLORALWHITE=Object.freeze(re.fromCssColorString("#FFFAF0"));re.FORESTGREEN=Object.freeze(re.fromCssColorString("#228B22"));re.FUCHSIA=Object.freeze(re.fromCssColorString("#FF00FF"));re.GAINSBORO=Object.freeze(re.fromCssColorString("#DCDCDC"));re.GHOSTWHITE=Object.freeze(re.fromCssColorString("#F8F8FF"));re.GOLD=Object.freeze(re.fromCssColorString("#FFD700"));re.GOLDENROD=Object.freeze(re.fromCssColorString("#DAA520"));re.GRAY=Object.freeze(re.fromCssColorString("#808080"));re.GREEN=Object.freeze(re.fromCssColorString("#008000"));re.GREENYELLOW=Object.freeze(re.fromCssColorString("#ADFF2F"));re.GREY=re.GRAY;re.HONEYDEW=Object.freeze(re.fromCssColorString("#F0FFF0"));re.HOTPINK=Object.freeze(re.fromCssColorString("#FF69B4"));re.INDIANRED=Object.freeze(re.fromCssColorString("#CD5C5C"));re.INDIGO=Object.freeze(re.fromCssColorString("#4B0082"));re.IVORY=Object.freeze(re.fromCssColorString("#FFFFF0"));re.KHAKI=Object.freeze(re.fromCssColorString("#F0E68C"));re.LAVENDER=Object.freeze(re.fromCssColorString("#E6E6FA"));re.LAVENDAR_BLUSH=Object.freeze(re.fromCssColorString("#FFF0F5"));re.LAWNGREEN=Object.freeze(re.fromCssColorString("#7CFC00"));re.LEMONCHIFFON=Object.freeze(re.fromCssColorString("#FFFACD"));re.LIGHTBLUE=Object.freeze(re.fromCssColorString("#ADD8E6"));re.LIGHTCORAL=Object.freeze(re.fromCssColorString("#F08080"));re.LIGHTCYAN=Object.freeze(re.fromCssColorString("#E0FFFF"));re.LIGHTGOLDENRODYELLOW=Object.freeze(re.fromCssColorString("#FAFAD2"));re.LIGHTGRAY=Object.freeze(re.fromCssColorString("#D3D3D3"));re.LIGHTGREEN=Object.freeze(re.fromCssColorString("#90EE90"));re.LIGHTGREY=re.LIGHTGRAY;re.LIGHTPINK=Object.freeze(re.fromCssColorString("#FFB6C1"));re.LIGHTSEAGREEN=Object.freeze(re.fromCssColorString("#20B2AA"));re.LIGHTSKYBLUE=Object.freeze(re.fromCssColorString("#87CEFA"));re.LIGHTSLATEGRAY=Object.freeze(re.fromCssColorString("#778899"));re.LIGHTSLATEGREY=re.LIGHTSLATEGRAY;re.LIGHTSTEELBLUE=Object.freeze(re.fromCssColorString("#B0C4DE"));re.LIGHTYELLOW=Object.freeze(re.fromCssColorString("#FFFFE0"));re.LIME=Object.freeze(re.fromCssColorString("#00FF00"));re.LIMEGREEN=Object.freeze(re.fromCssColorString("#32CD32"));re.LINEN=Object.freeze(re.fromCssColorString("#FAF0E6"));re.MAGENTA=Object.freeze(re.fromCssColorString("#FF00FF"));re.MAROON=Object.freeze(re.fromCssColorString("#800000"));re.MEDIUMAQUAMARINE=Object.freeze(re.fromCssColorString("#66CDAA"));re.MEDIUMBLUE=Object.freeze(re.fromCssColorString("#0000CD"));re.MEDIUMORCHID=Object.freeze(re.fromCssColorString("#BA55D3"));re.MEDIUMPURPLE=Object.freeze(re.fromCssColorString("#9370DB"));re.MEDIUMSEAGREEN=Object.freeze(re.fromCssColorString("#3CB371"));re.MEDIUMSLATEBLUE=Object.freeze(re.fromCssColorString("#7B68EE"));re.MEDIUMSPRINGGREEN=Object.freeze(re.fromCssColorString("#00FA9A"));re.MEDIUMTURQUOISE=Object.freeze(re.fromCssColorString("#48D1CC"));re.MEDIUMVIOLETRED=Object.freeze(re.fromCssColorString("#C71585"));re.MIDNIGHTBLUE=Object.freeze(re.fromCssColorString("#191970"));re.MINTCREAM=Object.freeze(re.fromCssColorString("#F5FFFA"));re.MISTYROSE=Object.freeze(re.fromCssColorString("#FFE4E1"));re.MOCCASIN=Object.freeze(re.fromCssColorString("#FFE4B5"));re.NAVAJOWHITE=Object.freeze(re.fromCssColorString("#FFDEAD"));re.NAVY=Object.freeze(re.fromCssColorString("#000080"));re.OLDLACE=Object.freeze(re.fromCssColorString("#FDF5E6"));re.OLIVE=Object.freeze(re.fromCssColorString("#808000"));re.OLIVEDRAB=Object.freeze(re.fromCssColorString("#6B8E23"));re.ORANGE=Object.freeze(re.fromCssColorString("#FFA500"));re.ORANGERED=Object.freeze(re.fromCssColorString("#FF4500"));re.ORCHID=Object.freeze(re.fromCssColorString("#DA70D6"));re.PALEGOLDENROD=Object.freeze(re.fromCssColorString("#EEE8AA"));re.PALEGREEN=Object.freeze(re.fromCssColorString("#98FB98"));re.PALETURQUOISE=Object.freeze(re.fromCssColorString("#AFEEEE"));re.PALEVIOLETRED=Object.freeze(re.fromCssColorString("#DB7093"));re.PAPAYAWHIP=Object.freeze(re.fromCssColorString("#FFEFD5"));re.PEACHPUFF=Object.freeze(re.fromCssColorString("#FFDAB9"));re.PERU=Object.freeze(re.fromCssColorString("#CD853F"));re.PINK=Object.freeze(re.fromCssColorString("#FFC0CB"));re.PLUM=Object.freeze(re.fromCssColorString("#DDA0DD"));re.POWDERBLUE=Object.freeze(re.fromCssColorString("#B0E0E6"));re.PURPLE=Object.freeze(re.fromCssColorString("#800080"));re.RED=Object.freeze(re.fromCssColorString("#FF0000"));re.ROSYBROWN=Object.freeze(re.fromCssColorString("#BC8F8F"));re.ROYALBLUE=Object.freeze(re.fromCssColorString("#4169E1"));re.SADDLEBROWN=Object.freeze(re.fromCssColorString("#8B4513"));re.SALMON=Object.freeze(re.fromCssColorString("#FA8072"));re.SANDYBROWN=Object.freeze(re.fromCssColorString("#F4A460"));re.SEAGREEN=Object.freeze(re.fromCssColorString("#2E8B57"));re.SEASHELL=Object.freeze(re.fromCssColorString("#FFF5EE"));re.SIENNA=Object.freeze(re.fromCssColorString("#A0522D"));re.SILVER=Object.freeze(re.fromCssColorString("#C0C0C0"));re.SKYBLUE=Object.freeze(re.fromCssColorString("#87CEEB"));re.SLATEBLUE=Object.freeze(re.fromCssColorString("#6A5ACD"));re.SLATEGRAY=Object.freeze(re.fromCssColorString("#708090"));re.SLATEGREY=re.SLATEGRAY;re.SNOW=Object.freeze(re.fromCssColorString("#FFFAFA"));re.SPRINGGREEN=Object.freeze(re.fromCssColorString("#00FF7F"));re.STEELBLUE=Object.freeze(re.fromCssColorString("#4682B4"));re.TAN=Object.freeze(re.fromCssColorString("#D2B48C"));re.TEAL=Object.freeze(re.fromCssColorString("#008080"));re.THISTLE=Object.freeze(re.fromCssColorString("#D8BFD8"));re.TOMATO=Object.freeze(re.fromCssColorString("#FF6347"));re.TURQUOISE=Object.freeze(re.fromCssColorString("#40E0D0"));re.VIOLET=Object.freeze(re.fromCssColorString("#EE82EE"));re.WHEAT=Object.freeze(re.fromCssColorString("#F5DEB3"));re.WHITE=Object.freeze(re.fromCssColorString("#FFFFFF"));re.WHITESMOKE=Object.freeze(re.fromCssColorString("#F5F5F5"));re.YELLOW=Object.freeze(re.fromCssColorString("#FFFF00"));re.YELLOWGREEN=Object.freeze(re.fromCssColorString("#9ACD32"));re.TRANSPARENT=Object.freeze(new re(0,0,0,0));var G=re;function BU(e){e=e??W.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}BU.ALL=Object.freeze(new BU({color:new G(0,0,0,0),depth:1,stencil:0}));BU.prototype.execute=function(e,t){e.clear(this,t)};var ei=BU;var pwe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},De=Object.freeze(pwe);function DJ(e){e=e??W.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=De.COMPUTE,this.owner=e.owner}DJ.prototype.execute=function(e){e.execute(this)};var Uc=DJ;function Ft(e,t){this.x=e??0,this.y=t??0}Ft.fromElements=function(e,t,n){return c(n)?(n.x=e,n.y=t,n):new Ft(e,t)};Ft.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t):new Ft(e.x,e.y)};Ft.fromCartesian3=Ft.clone;Ft.fromCartesian4=Ft.clone;Ft.packedLength=2;Ft.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n]=e.y,t};Ft.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Ft),n.x=e[t++],n.y=e[t],n};Ft.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*2;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new E("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==i&&(t.length=i)}for(let o=0;oO.EPSILON12);return c(o)?(o.x=r*L,o.y=s*F,o.z=a*_,o):new d(r*L,s*F,a*_)}var ob=bwe;function zo(e,t,n){this.longitude=e??0,this.latitude=t??0,this.height=n??0}zo.fromRadians=function(e,t,n,i){return T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),n=n??0,c(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new zo(e,t,n)};zo.fromDegrees=function(e,t,n,i){return T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),e=O.toRadians(e),t=O.toRadians(t),zo.fromRadians(e,t,n,i)};var xwe=new d,Twe=new d,Awe=new d;zo._ellipsoidOneOverRadii=new d(1/6378137,1/6378137,1/6356752314245179e-9);zo._ellipsoidOneOverRadiiSquared=new d(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));zo._ellipsoidCenterToleranceSquared=O.EPSILON1;zo.fromCartesian=function(e,t,n){let i=c(t)?t.oneOverRadii:zo._ellipsoidOneOverRadii,o=c(t)?t.oneOverRadiiSquared:zo._ellipsoidOneOverRadiiSquared,r=c(t)?t._centerToleranceSquared:zo._ellipsoidCenterToleranceSquared,s=ob(e,i,o,r,Twe);if(!c(s))return;let a=d.multiplyComponents(s,o,xwe);a=d.normalize(a,a);let l=d.subtract(e,s,Awe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),h=O.sign(d.dot(l,e))*d.magnitude(l);return c(n)?(n.longitude=u,n.latitude=f,n.height=h,n):new zo(u,f,h)};zo.toCartesian=function(e,t,n){return T.defined("cartographic",e),d.fromRadians(e.longitude,e.latitude,e.height,t,n)};zo.clone=function(e,t){if(c(e))return c(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new zo(e.longitude,e.latitude,e.height)};zo.equals=function(e,t){return e===t||c(e)&&c(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};zo.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};zo.ZERO=Object.freeze(new zo(0,0,0));zo.prototype.clone=function(e){return zo.clone(this,e)};zo.prototype.equals=function(e){return zo.equals(this,e)};zo.prototype.equalsEpsilon=function(e,t){return zo.equalsEpsilon(this,e,t)};zo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=zo;function MJ(e,t,n,i){t=t??0,n=n??0,i=i??0,T.typeOf.number.greaterThanOrEquals("x",t,0),T.typeOf.number.greaterThanOrEquals("y",n,0),T.typeOf.number.greaterThanOrEquals("z",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=O.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function gi(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,MJ(this,e,t,n)}Object.defineProperties(gi.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}}});gi.clone=function(e,t){if(!c(e))return;let n=e._radii;return c(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 gi(n.x,n.y,n.z)};gi.fromCartesian3=function(e,t){return c(t)||(t=new gi),c(e)&&MJ(t,e.x,e.y,e.z),t};gi.WGS84=Object.freeze(new gi(6378137,6378137,6356752314245179e-9));gi.UNIT_SPHERE=Object.freeze(new gi(1,1,1));gi.MOON=Object.freeze(new gi(O.LUNAR_RADIUS,O.LUNAR_RADIUS,O.LUNAR_RADIUS));gi._default=gi.WGS84;Object.defineProperties(gi,{default:{get:function(){return gi._default},set:function(e){T.typeOf.object("value",e),gi._default=e,d._ellipsoidRadiiSquared=e.radiiSquared,he._ellipsoidOneOverRadii=e.oneOverRadii,he._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});gi.prototype.clone=function(e){return gi.clone(this,e)};gi.packedLength=d.packedLength;gi.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,d.pack(e._radii,t,n),t};gi.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t);return gi.fromCartesian3(i,n)};gi.prototype.geocentricSurfaceNormal=d.normalize;gi.prototype.geodeticSurfaceNormalCartographic=function(e,t){T.typeOf.object("cartographic",e);let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return c(t)||(t=new d),t.x=r,t.y=s,t.z=a,d.normalize(t,t)};gi.prototype.geodeticSurfaceNormal=function(e,t){if(T.typeOf.object("cartesian",e),isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new E("cartesian has a NaN component");if(!d.equalsEpsilon(e,d.ZERO,O.EPSILON14))return c(t)||(t=new d),t=d.multiplyComponents(e,this._oneOverRadiiSquared,t),d.normalize(t,t)};var Cwe=new d,Ewe=new d;gi.prototype.cartographicToCartesian=function(e,t){let n=Cwe,i=Ewe;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),c(t)||(t=new d),d.add(i,n,t)};gi.prototype.cartographicArrayToCartesianArray=function(e,t){T.defined("cartographics",e);let n=e.length;c(t)?t.length=n:t=new Array(n);for(let i=0;i=this._radii.z-t))return n};var Dwe=new d;gi.prototype.getLocalCurvature=function(e,t){T.typeOf.object("surfacePosition",e),c(t)||(t=new H);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,Dwe),i=d.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return H.fromElements(1/i,1/r,t)};var Pwe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],Iwe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function RJ(e,t,n){T.typeOf.number("a",e),T.typeOf.number("b",t),T.typeOf.func("func",n);let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*Pwe[s];r+=Iwe[s]*(n(i+a)+n(i-a))}return r*=o,r}gi.prototype.surfaceArea=function(e){T.typeOf.object("rectangle",e);let t=e.west,n=e.east,i=e.south,o=e.north;for(;n0){o=r-1;continue}return r}return~(o+1)}var Lo=Rwe;function Mwe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var Bg=Mwe;function Lwe(e){if(e===null||isNaN(e))throw new E("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var Dd=Lwe;var LJ=[31,28,31,30,31,30,31,31,30,31,30,31];function Nwe(e,t,n,i,o,r,s,a){e=e??1,t=t??1,n=n??1,i=i??0,o=o??0,r=r??0,s=s??0,a=a??!1,y(),b(),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function y(){T.typeOf.number.greaterThanOrEquals("Year",e,1),T.typeOf.number.lessThanOrEquals("Year",e,9999),T.typeOf.number.greaterThanOrEquals("Month",t,1),T.typeOf.number.lessThanOrEquals("Month",t,12),T.typeOf.number.greaterThanOrEquals("Day",n,1),T.typeOf.number.lessThanOrEquals("Day",n,31),T.typeOf.number.greaterThanOrEquals("Hour",i,0),T.typeOf.number.lessThanOrEquals("Hour",i,23),T.typeOf.number.greaterThanOrEquals("Minute",o,0),T.typeOf.number.lessThanOrEquals("Minute",o,59),T.typeOf.bool("IsLeapSecond",a),T.typeOf.number.greaterThanOrEquals("Second",r,0),T.typeOf.number.lessThanOrEquals("Second",r,a?60:59),T.typeOf.number.greaterThanOrEquals("Millisecond",s,0),T.typeOf.number.lessThan("Millisecond",s,1e3)}function b(){let x=t===2&&Dd(e)?LJ[t-1]+1:LJ[t-1];if(n>x)throw new E("Month and Day represents invalid date")}}var im=Nwe;function Fwe(e,t){this.julianDate=e,this.offset=t}var Yi=Fwe;var Bwe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},qn=Object.freeze(Bwe);var kwe={UTC:0,TAI:1},Wn=Object.freeze(kwe);var FJ=new im,VU=[31,28,31,30,31,30,31,31,30,31,30,31],zU=29;function W5(e,t){return It.compare(e.julianDate,t.julianDate)}var QA=new Yi;function GU(e){QA.julianDate=e;let t=It.leapSeconds,n=Lo(t,QA,W5);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&It.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),It.addSeconds(e,i,e)}function NJ(e,t){QA.julianDate=e;let n=It.leapSeconds,i=Lo(n,QA,W5);if(i<0&&(i=~i),i===0)return It.addSeconds(e,-n[0].offset,t);if(i>=n.length)return It.addSeconds(e,-n[i-1].offset,t);let o=It.secondsDifference(n[i].julianDate,e);if(o===0)return It.addSeconds(e,-n[i].offset,t);if(!(o<=1))return It.addSeconds(e,-n[--i].offset,t)}function kg(e,t,n){let i=t/qn.SECONDS_PER_DAY|0;return e+=i,t-=qn.SECONDS_PER_DAY*i,t<0&&(e--,t+=qn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function q5(e,t,n,i,o,r,s){let a=(t-14)/12|0,l=e+4800+a,u=(1461*l/4|0)+(367*(t-2-12*a)/12|0)-(3*((l+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*qn.SECONDS_PER_HOUR+o*qn.SECONDS_PER_MINUTE+s*qn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var Uwe=/^(\d{4})$/,Vwe=/^(\d{4})-(\d{2})$/,zwe=/^(\d{4})-?(\d{3})$/,Hwe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,Gwe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Y5=/([Z+\-])?(\d{2})?:?(\d{2})?$/,jwe=/^(\d{2})(\.\d+)?/.source+Y5.source,Wwe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Y5.source,qwe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Y5.source,Pd="Invalid ISO 8601 date.";function It(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??Wn.UTC;let i=e|0;t=t+(e-i)*qn.SECONDS_PER_DAY,kg(i,t,this),n===Wn.UTC&&GU(this)}It.fromGregorianDate=function(e,t){if(!(e instanceof im))throw new E("date must be a valid GregorianDate.");let n=q5(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return c(t)?(kg(n[0],n[1],t),GU(t),t):new It(n[0],n[1],Wn.UTC)};It.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new E("date must be a valid JavaScript Date.");let n=q5(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return c(t)?(kg(n[0],n[1],t),GU(t),t):new It(n[0],n[1],Wn.UTC)};It.fromIso8601=function(e,t){if(typeof e!="string")throw new E(Pd);e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,l=0,u=0,f=n[0],h=n[1],p,g;if(!c(f))throw new E(Pd);let m;if(n=f.match(Gwe),n!==null){if(m=f.split("-").length-1,m>0&&m!==2)throw new E(Pd);i=+n[1],o=+n[2],r=+n[3]}else if(n=f.match(Vwe),n!==null)i=+n[1],o=+n[2];else if(n=f.match(Uwe),n!==null)i=+n[1];else{let A;if(n=f.match(zwe),n!==null){if(i=+n[1],A=+n[2],g=Dd(i),A<1||g&&A>366||!g&&A>365)throw new E(Pd)}else if(n=f.match(Hwe),n!==null){i=+n[1];let C=+n[2],S=+n[3]||0;if(m=f.split("-").length-1,m>0&&(!c(n[3])&&m!==1||c(n[3])&&m!==2))throw new E(Pd);let v=new Date(Date.UTC(i,0,4));A=C*7+S-v.getUTCDay()-3}else throw new E(Pd);p=new Date(Date.UTC(i,0,1)),p.setUTCDate(A),o=p.getUTCMonth()+1,r=p.getUTCDate()}if(g=Dd(i),o<1||o>12||r<1||(o!==2||!g)&&r>VU[o-1]||g&&o===2&&r>zU)throw new E(Pd);let y;if(c(h)){if(n=h.match(qwe),n!==null){if(m=h.split(":").length-1,m>0&&m!==2&&m!==3)throw new E(Pd);s=+n[1],a=+n[2],l=+n[3],u=+(n[4]||0)*1e3,y=5}else if(n=h.match(Wwe),n!==null){if(m=h.split(":").length-1,m>2)throw new E(Pd);s=+n[1],a=+n[2],l=+(n[3]||0)*60,y=4}else if(n=h.match(jwe),n!==null)s=+n[1],a=+(n[2]||0)*60,y=3;else throw new E(Pd);if(a>=60||l>=61||s>24||s===24&&(a>0||l>0||u>0))throw new E(Pd);let A=n[y],C=+n[y+1],S=+(n[y+2]||0);switch(A){case"+":s=s-C,a=a-S;break;case"-":s=s+C,a=a+S;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let b=l===60;for(b&&l--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?zU:VU[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?zU:VU[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=g&&o===2?zU:VU[o-1],r+=p;let x=q5(i,o,r,s,a,l,u);return c(t)?(kg(x[0],x[1],t),GU(t)):t=new It(x[0],x[1],Wn.UTC),b&&It.addSeconds(t,1,t),t};It.now=function(e){return It.fromDate(new Date,e)};var HU=new It(0,0,Wn.TAI);It.toGregorianDate=function(e,t){if(!c(e))throw new E("julianDate is required.");let n=!1,i=NJ(e,HU);c(i)||(It.addSeconds(e,-1,HU),i=NJ(HU,HU),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let l=4e3*(s+1)/1461001|0;s=s-(1461*l/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let h=u+2-12*s|0,p=100*(a-49)+l+s|0,g=r/qn.SECONDS_PER_HOUR|0,m=r-g*qn.SECONDS_PER_HOUR,y=m/qn.SECONDS_PER_MINUTE|0;m=m-y*qn.SECONDS_PER_MINUTE;let b=m|0,x=(m-b)/qn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(b+=1),c(t)?(t.year=p,t.month=h,t.day=f,t.hour=g,t.minute=y,t.second=b,t.millisecond=x,t.isLeapSecond=n,t):new im(p,h,f,g,y,b,x,n)};It.toDate=function(e){if(!c(e))throw new E("julianDate is required.");let t=It.toGregorianDate(e,FJ),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))};It.toIso8601=function(e,t){if(!c(e))throw new E("julianDate is required.");let n=It.toGregorianDate(e,FJ),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,l=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&l===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;if(!c(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${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${f}Z`}return!c(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${l.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${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${f}Z`)};It.clone=function(e,t){if(c(e))return c(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new It(e.dayNumber,e.secondsOfDay,Wn.TAI)};It.compare=function(e,t){if(!c(e))throw new E("left is required.");if(!c(t))throw new E("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};It.equals=function(e,t){return e===t||c(e)&&c(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};It.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(It.secondsDifference(e,t))<=n};It.totalDays=function(e){if(!c(e))throw new E("julianDate is required.");return e.dayNumber+e.secondsOfDay/qn.SECONDS_PER_DAY};It.secondsDifference=function(e,t){if(!c(e))throw new E("left is required.");if(!c(t))throw new E("right is required.");return(e.dayNumber-t.dayNumber)*qn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};It.daysDifference=function(e,t){if(!c(e))throw new E("left is required.");if(!c(t))throw new E("right is required.");let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/qn.SECONDS_PER_DAY;return n+i};It.computeTaiMinusUtc=function(e){QA.julianDate=e;let t=It.leapSeconds,n=Lo(t,QA,W5);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};It.addSeconds=function(e,t,n){if(!c(e))throw new E("julianDate is required.");if(!c(t))throw new E("seconds is required.");if(!c(n))throw new E("result is required.");return kg(e.dayNumber,e.secondsOfDay+t,n)};It.addMinutes=function(e,t,n){if(!c(e))throw new E("julianDate is required.");if(!c(t))throw new E("minutes is required.");if(!c(n))throw new E("result is required.");let i=e.secondsOfDay+t*qn.SECONDS_PER_MINUTE;return kg(e.dayNumber,i,n)};It.addHours=function(e,t,n){if(!c(e))throw new E("julianDate is required.");if(!c(t))throw new E("hours is required.");if(!c(n))throw new E("result is required.");let i=e.secondsOfDay+t*qn.SECONDS_PER_HOUR;return kg(e.dayNumber,i,n)};It.addDays=function(e,t,n){if(!c(e))throw new E("julianDate is required.");if(!c(t))throw new E("days is required.");if(!c(n))throw new E("result is required.");let i=e.dayNumber+t;return kg(i,e.secondsOfDay,n)};It.lessThan=function(e,t){return It.compare(e,t)<0};It.lessThanOrEquals=function(e,t){return It.compare(e,t)<=0};It.greaterThan=function(e,t){return It.compare(e,t)>0};It.greaterThanOrEquals=function(e,t){return It.compare(e,t)>=0};It.prototype.clone=function(e){return It.clone(this,e)};It.prototype.equals=function(e){return It.equals(this,e)};It.prototype.equalsEpsilon=function(e,t){return It.equalsEpsilon(this,e,t)};It.prototype.toString=function(){return It.toIso8601(this)};It.leapSeconds=[new Yi(new It(2441317,43210,Wn.TAI),10),new Yi(new It(2441499,43211,Wn.TAI),11),new Yi(new It(2441683,43212,Wn.TAI),12),new Yi(new It(2442048,43213,Wn.TAI),13),new Yi(new It(2442413,43214,Wn.TAI),14),new Yi(new It(2442778,43215,Wn.TAI),15),new Yi(new It(2443144,43216,Wn.TAI),16),new Yi(new It(2443509,43217,Wn.TAI),17),new Yi(new It(2443874,43218,Wn.TAI),18),new Yi(new It(2444239,43219,Wn.TAI),19),new Yi(new It(2444786,43220,Wn.TAI),20),new Yi(new It(2445151,43221,Wn.TAI),21),new Yi(new It(2445516,43222,Wn.TAI),22),new Yi(new It(2446247,43223,Wn.TAI),23),new Yi(new It(2447161,43224,Wn.TAI),24),new Yi(new It(2447892,43225,Wn.TAI),25),new Yi(new It(2448257,43226,Wn.TAI),26),new Yi(new It(2448804,43227,Wn.TAI),27),new Yi(new It(2449169,43228,Wn.TAI),28),new Yi(new It(2449534,43229,Wn.TAI),29),new Yi(new It(2450083,43230,Wn.TAI),30),new Yi(new It(2450630,43231,Wn.TAI),31),new Yi(new It(2451179,43232,Wn.TAI),32),new Yi(new It(2453736,43233,Wn.TAI),33),new Yi(new It(2454832,43234,Wn.TAI),34),new Yi(new It(2456109,43235,Wn.TAI),35),new Yi(new It(2457204,43236,Wn.TAI),36),new Yi(new It(2457754,43237,Wn.TAI),37)];var Q=It;var tee=Zo(du(),1);function Ywe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var dv=Ywe;function GJ(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=GJ(o,t)),n[i]=o}return n}var je=GJ;function jJ(e,t,n){n=n??!1;let i={},o=c(e),r=c(t),s,a,l;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(l=t[s],typeof l=="object"?i[s]=jJ(a,l,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(l=t[s],i[s]=l);return i}var xt=jJ;function Xwe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Dl=Xwe;var WJ=Zo(du(),1);function X5(e,t){let n;return typeof document<"u"&&(n=document),X5._implementation(e,t,n)}X5._implementation=function(e,t,n){if(!c(e))throw new E("relative uri is required.");if(!c(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new WJ.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var om=X5;var qJ=Zo(du(),1);function Kwe(e,t){if(!c(e))throw new E("uri is required.");let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new qJ.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var hv=Kwe;var YJ=Zo(du(),1);function $we(e){if(!c(e))throw new E("uri is required.");let t=new YJ.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 rb=$we;var XJ={};function Zwe(e,t,n){c(t)||(t=e.width),c(n)||(n=e.height);let i=XJ[t];c(i)||(i={},XJ[t]=i);let o=i[n];if(!c(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 Id=Zwe;var Qwe=/^blob:/i;function Jwe(e){return T.typeOf.string("uri",e),Qwe.test(e)}var sb=Jwe;var rm;function eve(e){c(rm)||(rm=document.createElement("a")),rm.href=window.location.href;let t=rm.host,n=rm.protocol;return rm.href=e,rm.href=rm.href,n!==rm.protocol||t!==rm.host}var Ug=eve;var tve=/^data:/i;function nve(e){return T.typeOf.string("uri",e),tve.test(e)}var Ep=nve;function ive(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 ab=ive;function ove(e){if(!c(e))throw new E("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var mv=cve;function KJ(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=mv(this.responseHeaders))}KJ.prototype.toString=function(){let e="Request has failed.";return c(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var sm=KJ;var XU=Zo(du(),1);function pv(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(pv.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});pv.prototype.addEventListener=function(e,t){T.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};pv.prototype.removeEventListener=function(e,t){T.typeOf.func("listener",e);let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r0){for(o.sort(lve),e=0;e=0;--t)this.heapify(t)};lb.prototype.insert=function(e){T.defined("element",e);let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(oi&&(r=t[i],this._length=i),r};lb.prototype.pop=function(e){if(e=e??0,this._length===0)return;T.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return K5(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var _v=lb;function uve(e,t){return e.priority-t.priority}var to={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},tC=20,rc=new _v({comparator:uve});rc.maximumLength=tC;rc.reserve(tC);var am=[],Sp={},fve=typeof document<"u"?new XU.default(document.location.href):new XU.default,KU=new pe;function Jo(){}Jo.maximumRequests=50;Jo.maximumRequestsPerServer=18;Jo.requestsByServer={};Jo.throttleRequests=!0;Jo.debugShowStatistics=!1;Jo.requestCompletedEvent=KU;Object.defineProperties(Jo,{statistics:{get:function(){return to}},priorityHeapLength:{get:function(){return tC},set:function(e){if(ee;){let t=rc.pop();ub(t)}tC=e,rc.maximumLength=e,rc.reserve(e)}}});function $J(e){c(e.priorityFunction)&&(e.priority=e.priorityFunction())}Jo.serverHasOpenSlots=function(e,t){t=t??1;let n=Jo.requestsByServer[e]??Jo.maximumRequestsPerServer;return Sp[e]+t<=n};Jo.heapHasOpenSlots=function(e){return rc.length+e<=tC};function ZJ(e){return e.state===$n.UNISSUED&&(e.state=$n.ISSUED,e.deferred=Dl()),e.deferred.promise}function dve(e){return function(t){if(e.state===$n.CANCELLED)return;let n=e.deferred;--to.numberOfActiveRequests,--Sp[e.serverKey],KU.raiseEvent(),e.state=$n.RECEIVED,e.deferred=void 0,n.resolve(t)}}function hve(e){return function(t){e.state!==$n.CANCELLED&&(++to.numberOfFailedRequests,--to.numberOfActiveRequests,--Sp[e.serverKey],KU.raiseEvent(t),e.state=$n.FAILED,e.deferred.reject(t))}}function QJ(e){let t=ZJ(e);return e.state=$n.ACTIVE,am.push(e),++to.numberOfActiveRequests,++to.numberOfActiveRequestsEver,++Sp[e.serverKey],e.requestFunction().then(dve(e)).catch(hve(e)),t}function ub(e){let t=e.state===$n.ACTIVE;if(e.state=$n.CANCELLED,++to.numberOfCancelledRequests,c(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--to.numberOfActiveRequests,--Sp[e.serverKey],++to.numberOfCancelledActiveRequests),c(e.cancelFunction)&&e.cancelFunction()}Jo.update=function(){let e,t,n=0,i=am.length;for(e=0;e0&&(am[e-n]=t)}am.length-=n;let o=rc.internalArray,r=rc.length;for(e=0;e0;){if(t=rc.pop(),t.cancelled){ub(t);continue}if(t.throttleByServer&&!Jo.serverHasOpenSlots(t.serverKey)){ub(t);continue}QJ(t),++a}mve()};Jo.getServerKey=function(e){T.typeOf.string("url",e);let t=new XU.default(e);t.scheme()===""&&(t=t.absoluteTo(fve),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Sp[n];return c(i)||(Sp[n]=0),n};Jo.request=function(e){if(T.typeOf.object("request",e),T.typeOf.string("request.url",e.url),T.typeOf.func("request.requestFunction",e.requestFunction),Ep(e.url)||sb(e.url))return KU.raiseEvent(),e.state=$n.RECEIVED,e.requestFunction();if(++to.numberOfAttemptedRequests,c(e.serverKey)||(e.serverKey=Jo.getServerKey(e.url)),Jo.throttleRequests&&e.throttleByServer&&!Jo.serverHasOpenSlots(e.serverKey))return;if(!Jo.throttleRequests||!e.throttle)return QJ(e);if(am.length>=Jo.maximumRequests)return;$J(e);let t=rc.insert(e);if(c(t)){if(t===e)return;ub(t)}return ZJ(e)};function mve(){Jo.debugShowStatistics&&(to.numberOfActiveRequests===0&&to.lastNumberOfActiveRequests>0&&(to.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${to.numberOfAttemptedRequests}`),to.numberOfAttemptedRequests=0),to.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${to.numberOfCancelledRequests}`),to.numberOfCancelledRequests=0),to.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${to.numberOfCancelledActiveRequests}`),to.numberOfCancelledActiveRequests=0),to.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${to.numberOfFailedRequests}`),to.numberOfFailedRequests=0)),to.lastNumberOfActiveRequests=to.numberOfActiveRequests)}Jo.clearForSpecs=function(){for(;rc.length>0;){let t=rc.pop();ub(t)}let e=am.length;for(let t=0;t0}},credits:{get:function(){return this._credits}}});vt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};vt.prototype.parseUrl=function(e,t,n,i){let o=new tee.default(e),r=_ve(o.query());this._queryParameters=t?ZU(r,this.queryParameters,n):r,o.search(""),o.fragment(""),c(i)&&o.scheme()===""&&(o=o.absoluteTo(om(i))),this._url=o.toString()};function _ve(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:hu(e)}function ZU(e,t,n){if(!n)return xt(e,t);let i=je(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];c(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}vt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${gve(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return c(s)?encodeURIComponent(s):o})),t&&c(this.proxy)&&(n=this.proxy.getURL(n)),n};function gve(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!c(e[t[0]])?`?${t[0]}`:`?${cb(e)}`}vt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=ZU(this._queryParameters,e,!1):this._queryParameters=ZU(e,this._queryParameters,!1)};vt.prototype.appendQueryParameters=function(e){this._queryParameters=ZU(e,this._queryParameters,!0)};vt.prototype.setTemplateValues=function(e,t){t?this._templateValues=xt(this._templateValues,e):this._templateValues=xt(e,this._templateValues)};vt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,c(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return c(e.queryParameters)&&(t._queryParameters=xt(e.queryParameters,t.queryParameters)),c(e.templateValues)&&(t._templateValues=xt(e.templateValues,t.templateValues)),c(e.headers)&&(t.headers=xt(e.headers,t.headers)),c(e.proxy)&&(t.proxy=e.proxy),c(e.request)&&(t.request=e.request),c(e.retryCallback)&&(t.retryCallback=e.retryCallback),c(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};vt.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})};vt.prototype.clone=function(e){return c(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 vt({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:c(this.credits)?this.credits.slice():void 0})};vt.prototype.getBaseUri=function(e){return hv(this.getUrlComponent(e),e)};vt.prototype.appendForwardSlash=function(){this._url=dv(this._url)};vt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};vt.fetchArrayBuffer=function(e){return new vt(e).fetchArrayBuffer()};vt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};vt.fetchBlob=function(e){return new vt(e).fetchBlob()};vt.prototype.fetchImage=function(e){e=e??W.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(Z5(this.request),!nee||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return $5({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!c(r))return;let s,a,l,u;return vt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!c(f))return;if(u=f,a)return vt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(f);return l=new vt({url:h}),$5({resource:l,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(c(f))return f.blob=u,a||window.URL.revokeObjectURL(l.url),f}).catch(function(f){return c(l)&&window.URL.revokeObjectURL(l.url),f.blob=u,Promise.reject(f)})};function $5(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let l=Dl();return vt._Implementations.createImage(r,a,l,n,i,o),l.promise};let s=sc.request(r);if(c(s))return s.catch(function(a){return r.state!==$n.FAILED?Promise.reject(a):t.retryOnError(a).then(function(l){return l?(r.state=$n.UNISSUED,r.deferred=void 0,$5({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}vt.fetchImage=function(e){return new vt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};vt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};vt.fetchText=function(e){return new vt(e).fetchText()};vt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(c(e))return e.then(function(t){if(c(t))return JSON.parse(t)})};vt.fetchJson=function(e){return new vt(e).fetchJson()};vt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};vt.fetchXML=function(e){return new vt(e).fetchXML()};vt.prototype.fetchJsonp=function(e){e=e??"callback",Z5(this.request);let t;do t=`loadJsonp${O.nextRandomNumber().toString().substring(2,8)}`;while(c(window[t]));return iee(this,e,t)};function iee(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=Dl();return window[n]=function(l){a.resolve(l);try{delete window[n]}catch{window[n]=void 0}},vt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=sc.request(o);if(c(s))return s.catch(function(a){return o.state!==$n.FAILED?Promise.reject(a):e.retryOnError(a).then(function(l){return l?(o.state=$n.UNISSUED,o.deferred=void 0,iee(e,t,n)):Promise.reject(a)})})}vt.fetchJsonp=function(e){return new vt(e).fetchJsonp(e.callbackParameterName)};vt.prototype._makeRequest=function(e){let t=this;Z5(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=xt(e.headers,t.headers),a=e.overrideMimeType,l=e.method,u=e.data,f=Dl(),h=vt._Implementations.loadWithXhr(i,r,l,u,s,f,a);return c(h)&&c(h.abort)&&(n.cancelFunction=function(){h.abort()}),f.promise};let o=sc.request(n);if(c(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==$n.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=$n.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function Z5(e){if(e.state===$n.ISSUED||e.state===$n.ACTIVE)throw new ae("The Resource is already being fetched.");e.state=$n.UNISSUED,e.deferred=void 0}var yve=/^data:(.*?)(;base64)?,(.*)$/;function $U(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function eee(e,t){let n=$U(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r{if(!a.ok){let l={};a.headers.forEach((u,f)=>{l[f]=u}),r.reject(new sm(a.status,a,l));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new sm)})}var Tve=typeof XMLHttpRequest>"u";vt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=yve.exec(e);if(a!==null){r.resolve(bve(a,t));return}if(Tve){xve(e,t,n,i,o,r,s);return}let l=new XMLHttpRequest;if(iC.contains(e)&&(l.withCredentials=!0),l.open(n,e,!0),c(s)&&c(l.overrideMimeType)&&l.overrideMimeType(s),c(o))for(let f in o)o.hasOwnProperty(f)&&l.setRequestHeader(f,o[f]);c(t)&&(l.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),l.onload=function(){if((l.status<200||l.status>=300)&&!(u&&l.status===0)){r.reject(new sm(l.status,l.response,l.getAllResponseHeaders()));return}let f=l.response,h=l.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=l.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){let b=y.split(": "),x=b.shift();m[x]=b.join(": ")}),r.resolve(m);return}if(l.status===204)r.resolve(void 0);else if(c(f)&&(!c(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")&&c(l.responseXML)&&l.responseXML.hasChildNodes()?r.resolve(l.responseXML):(h===""||h==="text")&&c(l.responseText)?r.resolve(l.responseText):r.reject(new ae("Invalid XMLHttpRequest response type."))},l.onerror=function(f){r.reject(new sm)},l.send(i),l};vt._Implementations.loadAndExecuteScript=function(e,t,n){return ab(e,t).catch(function(i){n.reject(i)})};vt._DefaultImplementations={};vt._DefaultImplementations.createImage=vt._Implementations.createImage;vt._DefaultImplementations.loadWithXhr=vt._Implementations.loadWithXhr;vt._DefaultImplementations.loadAndExecuteScript=vt._Implementations.loadAndExecuteScript;vt.DEFAULT=Object.freeze(new vt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var we=vt;function bv(e){e=e??W.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,c(e.data)?oee(this,e.data):oee(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}bv.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new ae(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new bv({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};bv.NONE=Object.freeze({compute:function(e,t){return c(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Bg(0,0,0,0,0),t}});bv.prototype.compute=function(e,t){if(!c(this._samples))return;if(c(t)||(t=new Bg(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(c(i)){let a=n[i],l=n[i+1],u=Q.lessThanOrEquals(a,e),f=!c(l),h=f||Q.greaterThanOrEquals(l,e);if(u&&h)return o=i,!f&&l.equals(e)&&++o,r=o+1,see(this,n,this._samples,e,o,r,t),t}let s=Lo(n,e,Q.compare,this._dateColumn);return s>=0?(st.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let l=t[o],u=t[r];if(l.equals(u)||i.equals(l))return ree(e,n,o,a,s),s;if(i.equals(u))return ree(e,n,r,a,s),s;let f=Q.secondsDifference(i,l)/Q.secondsDifference(u,l),h=o*a,p=r*a,g=n[h+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],y=m-g;if(y>.5||y<-.5){let b=n[h+e._taiMinusUtcSecondsColumn],x=n[p+e._taiMinusUtcSecondsColumn];b!==x&&(u.equals(i)?g=m:m-=x-b)}return s.xPoleWander=yv(f,n[h+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=yv(f,n[h+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=yv(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=yv(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=yv(f,g,m),s}var xv=bv;function ac(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}ac.fromQuaternion=function(e,t){if(!c(e))throw new E("quaternion is required");c(t)||(t=new ac);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-O.asinClamped(n),t};ac.fromDegrees=function(e,t,n,i){if(!c(e))throw new E("heading is required");if(!c(t))throw new E("pitch is required");if(!c(n))throw new E("roll is required");return c(i)||(i=new ac),i.heading=e*O.RADIANS_PER_DEGREE,i.pitch=t*O.RADIANS_PER_DEGREE,i.roll=n*O.RADIANS_PER_DEGREE,i};ac.clone=function(e,t){if(c(e))return c(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new ac(e.heading,e.pitch,e.roll)};ac.equals=function(e,t){return e===t||c(e)&&c(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};ac.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&O.equalsEpsilon(e.heading,t.heading,n,i)&&O.equalsEpsilon(e.pitch,t.pitch,n,i)&&O.equalsEpsilon(e.roll,t.roll,n,i)};ac.prototype.clone=function(e){return ac.clone(this,e)};ac.prototype.equals=function(e){return ac.equals(this,e)};ac.prototype.equalsEpsilon=function(e,t,n){return ac.equalsEpsilon(this,e,t,n)};ac.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Oa=ac;var aee={},cee=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Cve(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t"u"?e:(c(QU)||(QU=document.createElement("a")),QU.href=e,QU.href)}var fb;function uee(){if(c(fb))return fb;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:c(aee?.url)?e=om(".",aee.url):typeof define=="object"&&c(define.amd)&&!define.amd.toUrlUndefined&&c(require.toUrl)?e=om("..",db("Core/buildModuleUrl.js")):e=Cve(),!c(e))throw new E("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return fb=new we({url:lee(e)}),fb.appendForwardSlash(),fb}function Eve(e){return lee(require.toUrl(`../${e}`))}function fee(e){return uee().getDerivedResource({url:e}).url}var JU;function db(e){return c(JU)||(typeof define=="object"&&c(define.amd)&&!define.amd.toUrlUndefined&&c(require.toUrl)?JU=Eve:JU=fee),JU(e)}db._cesiumScriptRegex=cee;db._buildModuleUrlFromBaseUrl=fee;db._clearBaseResource=function(){fb=void 0};db.setBaseUrl=function(e){fb=we.DEFAULT.getDerivedResource({url:e})};db.getCesiumBaseUrl=uee;var tn=db;function Sve(e,t,n){this.x=e,this.y=t,this.s=n}var hb=Sve;function ej(e){e=e??W.EMPTY_OBJECT,this._xysFileUrlTemplate=we.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new Q(this._sampleZeroJulianEphemerisDate,0,Wn.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 s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var wve=new Q(0,0,Wn.TAI);function Q5(e,t,n){let i=wve;return i.dayNumber=t,i.secondsOfDay=n,Q.daysDifference(i,e._sampleZeroDateTT)}ej.prototype.preload=function(e,t,n,i){let o=Q5(this,e,t),r=Q5(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let l=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let h=l;h<=u;++h)f.push(J5(this,h));return Promise.all(f)};ej.prototype.computeXysRadians=function(e,t,n){let i=Q5(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let l=!1,u=this._samples;if(c(u[s*3])||(J5(this,s/this._samplesPerXysFile|0),l=!0),c(u[a*3])||(J5(this,a/this._samplesPerXysFile|0),l=!0),l)return;c(n)?(n.x=0,n.y=0,n.s=0):n=new hb(0,0,0);let f=i-s*this._stepSizeDays,h=this._work,p=this._denominators,g=this._coef,m=this._xTable,y,b;for(y=0;y<=r;++y)h[y]=f-m[y];for(y=0;y<=r;++y){for(g[y]=1,b=0;b<=r;++b)b!==y&&(g[y]*=h[b]);g[y]*=p[y];let x=(s+y)*3;n.x+=g[y]*u[x++],n.y+=g[y]*u[x++],n.s+=g[y]*u[x]}return n};function J5(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;c(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new we({url:tn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,l=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u0)n=Math.sqrt(f+1),s=.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=vve,p=0;l>a&&(p=1),u>a&&u>l&&(p=2);let g=h[p],m=h[g];n=Math.sqrt(e[J.getElementIndex(p,p)]-e[J.getElementIndex(g,g)]-e[J.getElementIndex(m,m)]+1);let y=Dve;y[p]=.5*n,n=.5/n,s=(e[J.getElementIndex(m,g)]-e[J.getElementIndex(g,m)])*n,y[g]=(e[J.getElementIndex(g,p)]+e[J.getElementIndex(p,g)])*n,y[m]=(e[J.getElementIndex(m,p)]+e[J.getElementIndex(p,m)])*n,i=-y[0],o=-y[1],r=-y[2]}return c(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new nt(i,o,r,s)};var dee=new nt,hee=new nt,tj=new nt,mee=new nt;nt.fromHeadingPitchRoll=function(e,t){return T.typeOf.object("headingPitchRoll",e),mee=nt.fromAxisAngle(d.UNIT_X,e.roll,dee),tj=nt.fromAxisAngle(d.UNIT_Y,-e.pitch,t),t=nt.multiply(tj,mee,tj),hee=nt.fromAxisAngle(d.UNIT_Z,-e.heading,dee),nt.multiply(hee,t,t)};var eV=new d,nj=new d,Od=new nt,pee=new nt,tV=new nt;nt.packedLength=4;nt.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};nt.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new nt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};nt.packedInterpolationLength=3;nt.convertPackedArrayForInterpolation=function(e,t,n,i){nt.unpack(e,n*4,tV),nt.conjugate(tV,tV);for(let o=0,r=n-t+1;o=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,l=n*n,u=a*a;for(let g=7;g>=0;--g)wp[g]=(nV[g]*l-iV[g])*s,vp[g]=(nV[g]*u-iV[g])*s;let f=r*n*(1+wp[0]*(1+wp[1]*(1+wp[2]*(1+wp[3]*(1+wp[4]*(1+wp[5]*(1+wp[6]*(1+wp[7])))))))),h=a*(1+vp[0]*(1+vp[1]*(1+vp[2]*(1+vp[3]*(1+vp[4]*(1+vp[5]*(1+vp[6]*(1+vp[7])))))))),p=nt.multiplyByScalar(e,h,Ove);return nt.multiplyByScalar(t,f,i),nt.add(p,i,i)};nt.fastSquad=function(e,t,n,i,o,r){T.typeOf.object("q0",e),T.typeOf.object("q1",t),T.typeOf.object("s0",n),T.typeOf.object("s1",i),T.typeOf.number("t",o),T.typeOf.object("result",r);let s=nt.fastSlerp(e,t,o,Cv),a=nt.fastSlerp(n,i,o,rC);return nt.fastSlerp(s,a,2*o*(1-o),r)};nt.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};nt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};nt.ZERO=Object.freeze(new nt(0,0,0,0));nt.IDENTITY=Object.freeze(new nt(0,0,0,1));nt.prototype.clone=function(e){return nt.clone(this,e)};nt.prototype.equals=function(e){return nt.equals(this,e)};nt.prototype.equalsEpsilon=function(e,t){return nt.equalsEpsilon(this,e,t)};nt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Le=nt;var fi={},sj={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"}},sC={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},aj={},Pl={east:new d,north:new d,up:new d,west:new d,south:new d,down:new d},Vg=new d,zg=new d,Hg=new d;fi.localFrameToFixedFrameGenerator=function(e,t){if(!sj.hasOwnProperty(e)||!sj[e].hasOwnProperty(t))throw new E("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=sj[e][t],i,o=e+t;return c(aj[o])?i=aj[o]:(i=function(r,s,a){if(!c(r))throw new E("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new E("origin has a NaN component");if(c(a)||(a=new B),d.equalsEpsilon(r,d.ZERO,O.EPSILON14))d.unpack(sC[e],0,Vg),d.unpack(sC[t],0,zg),d.unpack(sC[n],0,Hg);else if(O.equalsEpsilon(r.x,0,O.EPSILON14)&&O.equalsEpsilon(r.y,0,O.EPSILON14)){let l=O.sign(r.z);d.unpack(sC[e],0,Vg),e!=="east"&&e!=="west"&&d.multiplyByScalar(Vg,l,Vg),d.unpack(sC[t],0,zg),t!=="east"&&t!=="west"&&d.multiplyByScalar(zg,l,zg),d.unpack(sC[n],0,Hg),n!=="east"&&n!=="west"&&d.multiplyByScalar(Hg,l,Hg)}else{s=s??ie.default,s.geodeticSurfaceNormal(r,Pl.up);let l=Pl.up,u=Pl.east;u.x=-r.y,u.y=r.x,u.z=0,d.normalize(u,Pl.east),d.cross(l,u,Pl.north),d.multiplyByScalar(Pl.up,-1,Pl.down),d.multiplyByScalar(Pl.east,-1,Pl.west),d.multiplyByScalar(Pl.north,-1,Pl.south),Vg=Pl[e],zg=Pl[t],Hg=Pl[n]}return a[0]=Vg.x,a[1]=Vg.y,a[2]=Vg.z,a[3]=0,a[4]=zg.x,a[5]=zg.y,a[6]=zg.z,a[7]=0,a[8]=Hg.x,a[9]=Hg.y,a[10]=Hg.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},aj[o]=i),i};fi.eastNorthUpToFixedFrame=fi.localFrameToFixedFrameGenerator("east","north");fi.northEastDownToFixedFrame=fi.localFrameToFixedFrameGenerator("north","east");fi.northUpEastToFixedFrame=fi.localFrameToFixedFrameGenerator("north","up");fi.northWestUpToFixedFrame=fi.localFrameToFixedFrameGenerator("north","west");var Rve=new Le,Mve=new d(1,1,1),Lve=new B;fi.headingPitchRollToFixedFrame=function(e,t,n,i,o){T.typeOf.object("HeadingPitchRoll",t),i=i??fi.eastNorthUpToFixedFrame;let r=Le.fromHeadingPitchRoll(t,Rve),s=B.fromTranslationQuaternionRotationScale(d.ZERO,r,Mve,Lve);return o=i(e,n,o),B.multiply(o,s,o)};var Nve=new B,Fve=new J;fi.headingPitchRollQuaternion=function(e,t,n,i,o){T.typeOf.object("HeadingPitchRoll",t);let r=fi.headingPitchRollToFixedFrame(e,t,n,i,Nve),s=B.getMatrix3(r,Fve);return Le.fromRotationMatrix(s,o)};var Bve=new d(1,1,1),kve=new d,yee=new B,Uve=new B,Vve=new J,zve=new Le;fi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){T.defined("transform",e),t=t??ie.default,n=n??fi.eastNorthUpToFixedFrame,c(i)||(i=new Oa);let o=B.getTranslation(e,kve);if(d.equals(o,d.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=B.inverseTransformation(n(o,t,yee),yee),s=B.setScale(e,Bve,Uve);s=B.setTranslation(s,d.ZERO,s),r=B.multiply(r,s,r);let a=Le.fromRotationMatrix(B.getMatrix3(r,Vve),zve);return a=Le.normalize(a,a),Oa.fromQuaternion(a,i)};var Hve=6*3600+41*60+50.54841,Gve=8640184812866e-6,jve=.093104,Wve=-62e-7,qve=11772758384668e-32,Yve=72921158553e-15,Xve=O.TWO_PI/86400,oV=new Q;fi.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=fi.computeIcrfToFixedMatrix(e,t);return c(n)||(n=fi.computeTemeToPseudoFixedMatrix(e,t)),n};fi.computeTemeToPseudoFixedMatrix=function(e,t){if(!c(e))throw new E("date is required.");oV=Q.addSeconds(e,-Q.computeTaiMinusUtc(e),oV);let n=oV.dayNumber,i=oV.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/qn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/qn.DAYS_PER_JULIAN_CENTURY;let a=(Hve+o*(Gve+o*(jve+o*Wve)))*Xve%O.TWO_PI,l=Yve+qve*(n-24515455e-1),u=(i+qn.SECONDS_PER_DAY*.5)%qn.SECONDS_PER_DAY,f=a+l*u,h=Math.cos(f),p=Math.sin(f);return c(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)};fi.iau2006XysData=new Tv;fi.earthOrientationParameters=xv.NONE;var uj=32.184,Kve=2451545;fi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+uj,i=e.stop.dayNumber,o=e.stop.secondsOfDay+uj;return fi.iau2006XysData.preload(t,n,i,o)};fi.computeIcrfToFixedMatrix=function(e,t){if(!c(e))throw new E("date is required.");c(t)||(t=new J);let n=fi.computeFixedToIcrfMatrix(e,t);if(c(n))return J.transpose(n,t)};var $ve=32.184,Zve=2451545,rV=new Oa,Qve=new J,Jve=new Q;fi.computeMoonFixedToIcrfMatrix=function(e,t){if(!c(e))throw new E("date is required.");c(t)||(t=new J);let n=Q.addSeconds(e,$ve,Jve),i=Q.totalDays(n)-Zve,o=O.toRadians(12.112)-O.toRadians(.052992)*i,r=O.toRadians(24.224)-O.toRadians(.105984)*i,s=O.toRadians(227.645)+O.toRadians(13.012)*i,a=O.toRadians(261.105)+O.toRadians(13.340716)*i,l=O.toRadians(358)+O.toRadians(.9856)*i;return rV.pitch=O.toRadians(180)-O.toRadians(3.878)*Math.sin(o)-O.toRadians(.12)*Math.sin(r)+O.toRadians(.07)*Math.sin(s)-O.toRadians(.017)*Math.sin(a),rV.roll=O.toRadians(66.53-90)+O.toRadians(1.543)*Math.cos(o)+O.toRadians(.24)*Math.cos(r)-O.toRadians(.028)*Math.cos(s)+O.toRadians(.007)*Math.cos(a),rV.heading=O.toRadians(244.375-90)+O.toRadians(13.17635831)*i+O.toRadians(3.558)*Math.sin(o)+O.toRadians(.121)*Math.sin(r)-O.toRadians(.064)*Math.sin(s)+O.toRadians(.016)*Math.sin(a)+O.toRadians(.025)*Math.sin(l),J.fromHeadingPitchRoll(rV,Qve)};fi.computeIcrfToMoonFixedMatrix=function(e,t){if(!c(e))throw new E("date is required.");c(t)||(t=new J);let n=fi.computeMoonFixedToIcrfMatrix(e,t);if(c(n))return J.transpose(n,t)};var eDe=new hb(0,0,0),tDe=new Bg(0,0,0,0,0,0),cj=new J,lj=new J;fi.computeFixedToIcrfMatrix=function(e,t){if(!c(e))throw new E("date is required.");c(t)||(t=new J);let n=fi.earthOrientationParameters.compute(e,tDe);if(!c(n))return;let i=e.dayNumber,o=e.secondsOfDay+uj,r=fi.iau2006XysData.computeXysRadians(i,o,eDe);if(!c(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,l=1/(1+Math.sqrt(1-s*s-a*a)),u=cj;u[0]=1-l*s*s,u[3]=-l*s*a,u[6]=s,u[1]=-l*s*a,u[4]=1-l*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-l*(s*s+a*a);let f=J.fromRotationZ(-r.s,lj),h=J.multiply(u,f,cj),p=e.dayNumber,g=e.secondsOfDay-Q.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=g/qn.SECONDS_PER_DAY,b=.779057273264+y+.00273781191135448*(m+y);b=b%1*O.TWO_PI;let x=J.fromRotationZ(b,lj),A=J.multiply(h,x,cj),C=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),P=Math.sin(n.yPoleWander),M=i-Kve+o/qn.SECONDS_PER_DAY;M/=36525;let R=-47e-6*M*O.RADIANS_PER_DEGREE/3600,L=Math.cos(R),F=Math.sin(R),_=lj;return _[0]=C*L,_[1]=C*F,_[2]=v,_[3]=-S*F+P*v*L,_[4]=S*L+P*v*F,_[5]=-P*C,_[6]=-P*F-S*v*L,_[7]=P*L-S*v*F,_[8]=S*C,J.multiply(A,_,t)};var nDe=new se;fi.pointToWindowCoordinates=function(e,t,n,i){return i=fi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};fi.pointToGLWindowCoordinates=function(e,t,n,i){if(!c(e))throw new E("modelViewProjectionMatrix is required.");if(!c(t))throw new E("viewportTransformation is required.");if(!c(n))throw new E("point is required.");c(i)||(i=new H);let o=nDe;return B.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,o),o),se.multiplyByScalar(o,1/o.w,o),B.multiplyByVector(t,o,o),H.fromCartesian4(o,i)};var iDe=new d,oDe=new d,rDe=new d;fi.rotationMatrixFromPositionVelocity=function(e,t,n,i){if(!c(e))throw new E("position is required.");if(!c(t))throw new E("velocity is required.");let o=(n??ie.default).geodeticSurfaceNormal(e,iDe),r=d.cross(t,o,oDe);d.equalsEpsilon(r,d.ZERO,O.EPSILON6)&&(r=d.clone(d.UNIT_X,r));let s=d.cross(r,t,rDe);return d.normalize(s,s),d.cross(t,s,r),d.negate(r,r),d.normalize(r,r),c(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]=s.x,i[7]=s.y,i[8]=s.z,i};var bee=new B(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),xee=new he,fj=new d,sDe=new d,aDe=new J,dj=new B,Tee=new B;fi.basisTo2D=function(e,t,n){if(!c(e))throw new E("projection is required.");if(!c(t))throw new E("matrix is required.");if(!c(n))throw new E("result is required.");let i=B.getTranslation(t,sDe),o=e.ellipsoid,r;if(d.equals(i,d.ZERO))r=d.clone(d.ZERO,fj);else{let f=o.cartesianToCartographic(i,xee);r=e.project(f,fj),d.fromElements(r.z,r.x,r.y,r)}let s=fi.eastNorthUpToFixedFrame(i,o,dj),a=B.inverseTransformation(s,Tee),l=B.getMatrix3(t,aDe),u=B.multiplyByMatrix3(a,l,n);return B.multiply(bee,u,n),B.setTranslation(n,r,n),n};fi.ellipsoidTo2DModelMatrix=function(e,t,n){if(!c(e))throw new E("projection is required.");if(!c(t))throw new E("center is required.");if(!c(n))throw new E("result is required.");let i=e.ellipsoid,o=fi.eastNorthUpToFixedFrame(t,i,dj),r=B.inverseTransformation(o,Tee),s=i.cartesianToCartographic(t,xee),a=e.project(s,fj);d.fromElements(a.z,a.x,a.y,a);let l=B.fromTranslation(a,dj);return B.multiply(bee,r,n),B.multiply(l,n,n),n};var Ot=fi;function vn(e,t,n,i){this.west=e??0,this.south=t??0,this.east=n??0,this.north=i??0}Object.defineProperties(vn.prototype,{width:{get:function(){return vn.computeWidth(this)}},height:{get:function(){return vn.computeHeight(this)}}});vn.packedLength=4;vn.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};vn.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new vn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};vn.computeWidth=function(e){T.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t=0?f.longitude:f.longitude+O.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>O.PI&&(i=i-O.TWO_PI),n>O.PI&&(n=n-O.TWO_PI)),c(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new vn(n,s,i,a)};vn.fromCartesianArray=function(e,t,n){T.defined("cartesians",e),t=t??ie.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let u=0,f=e.length;u=0?h.longitude:h.longitude+O.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>O.PI&&(o=o-O.TWO_PI),i>O.PI&&(i=i-O.TWO_PI)),c(n)?(n.west=i,n.south=a,n.east=o,n.north=l,n):new vn(i,a,o,l)};var cDe=new d,lDe=new d,uDe=new d,fDe=new d,dDe=new d,hj=new Array(5);for(let e=0;e0?i+=O.TWO_PI:r0&&(r+=O.TWO_PI),i=f))return c(n)?(n.west=a,n.south=u,n.east=l,n.north=f,n):new vn(a,u,l,f)};vn.simpleIntersection=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("otherRectangle",t);let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return c(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new vn(i,o,r,s)};vn.union=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("otherRectangle",t),c(n)||(n=new vn);let i=e.east,o=e.west,r=t.east,s=t.west;i0?i+=O.TWO_PI:r0&&(r+=O.TWO_PI),io||O.equalsEpsilon(n,o,O.EPSILON14))&&(n=e.south&&i<=e.north};var hDe=new he;vn.subsample=function(e,t,n,i){T.typeOf.object("rectangle",e),t=t??ie.default,n=n??0,c(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,l=e.west,u=hDe;u.height=n,u.longitude=l,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=l,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*O.PI_OVER_TWO,vn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=l,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};vn.subsection=function(e,t,n,i,o,r){if(T.typeOf.object("rectangle",e),T.typeOf.number.greaterThanOrEquals("westLerp",t,0),T.typeOf.number.lessThanOrEquals("westLerp",t,1),T.typeOf.number.greaterThanOrEquals("southLerp",n,0),T.typeOf.number.lessThanOrEquals("southLerp",n,1),T.typeOf.number.greaterThanOrEquals("eastLerp",i,0),T.typeOf.number.lessThanOrEquals("eastLerp",i,1),T.typeOf.number.greaterThanOrEquals("northLerp",o,0),T.typeOf.number.lessThanOrEquals("northLerp",o,1),T.typeOf.number.lessThanOrEquals("westLerp",t,i),T.typeOf.number.lessThanOrEquals("southLerp",n,o),c(r)||(r=new vn),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=O.TWO_PI+e.east-e.west;r.west=O.negativePiToPi(e.west+t*a),r.east=O.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};vn.MAX_VALUE=Object.freeze(new vn(-Math.PI,-O.PI_OVER_TWO,Math.PI,O.PI_OVER_TWO));var ce=vn;function kr(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}kr.packedLength=4;kr.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};kr.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new kr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};kr.fromPoints=function(e,t){if(c(t)||(t=new kr),!c(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;an.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};kr.intersect=function(e,t){T.typeOf.object("left",e),T.typeOf.object("right",t);let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.widthr+t.height?Wt.OUTSIDE:Wt.INTERSECTING};kr.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};kr.prototype.clone=function(e){return kr.clone(this,e)};kr.prototype.intersect=function(e){return kr.intersect(this,e)};kr.prototype.equals=function(e){return kr.equals(this,e)};var Ke=kr;var Ra={POINTS:ne.POINTS,LINES:ne.LINES,LINE_LOOP:ne.LINE_LOOP,LINE_STRIP:ne.LINE_STRIP,TRIANGLES:ne.TRIANGLES,TRIANGLE_STRIP:ne.TRIANGLE_STRIP,TRIANGLE_FAN:ne.TRIANGLE_FAN};Ra.isLines=function(e){return e===Ra.LINES||e===Ra.LINE_LOOP||e===Ra.LINE_STRIP};Ra.isTriangles=function(e){return e===Ra.TRIANGLES||e===Ra.TRIANGLE_STRIP||e===Ra.TRIANGLE_FAN};Ra.validate=function(e){return e===Ra.POINTS||e===Ra.LINES||e===Ra.LINE_LOOP||e===Ra.LINE_STRIP||e===Ra.TRIANGLES||e===Ra.TRIANGLE_STRIP||e===Ra.TRIANGLE_FAN};var Me=Object.freeze(Ra);var mb=`in vec4 position; in vec2 textureCoordinates; out vec2 v_textureCoordinates; void main() { gl_Position = position; v_textureCoordinates = textureCoordinates; } `;var Er={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 Ev(e){e=e??W.EMPTY_OBJECT,this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=e.primitiveType??Me.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 cc(e,t){return(e._flags&t)===t}function Gg(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(Ev.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 cc(this,Er.CULL)},set:function(e){cc(this,Er.CULL)!==e&&(Gg(this,Er.CULL,e),this.dirty=!0)}},occlude:{get:function(){return cc(this,Er.OCCLUDE)},set:function(e){cc(this,Er.OCCLUDE)!==e&&(Gg(this,Er.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 cc(this,Er.CAST_SHADOWS)},set:function(e){cc(this,Er.CAST_SHADOWS)!==e&&(Gg(this,Er.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return cc(this,Er.RECEIVE_SHADOWS)},set:function(e){cc(this,Er.RECEIVE_SHADOWS)!==e&&(Gg(this,Er.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 cc(this,Er.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){cc(this,Er.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Gg(this,Er.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 cc(this,Er.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){cc(this,Er.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Gg(this,Er.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 cc(this,Er.PICK_ONLY)},set:function(e){cc(this,Er.PICK_ONLY)!==e&&(Gg(this,Er.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return cc(this,Er.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){cc(this,Er.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Gg(this,Er.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});Ev.shallowClone=function(e,t){if(c(e))return c(t)||(t=new Ev),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};Ev.prototype.execute=function(e,t){e.draw(this,t)};var Qe=Ev;var di={UNSIGNED_BYTE:ne.UNSIGNED_BYTE,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,UNSIGNED_INT:ne.UNSIGNED_INT,FLOAT:ne.FLOAT,HALF_FLOAT:ne.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ne.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ne.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ne.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ne.UNSIGNED_SHORT_5_6_5};di.toWebGLConstant=function(e,t){switch(e){case di.UNSIGNED_BYTE:return ne.UNSIGNED_BYTE;case di.UNSIGNED_SHORT:return ne.UNSIGNED_SHORT;case di.UNSIGNED_INT:return ne.UNSIGNED_INT;case di.FLOAT:return ne.FLOAT;case di.HALF_FLOAT:return t.webgl2?ne.HALF_FLOAT:ne.HALF_FLOAT_OES;case di.UNSIGNED_INT_24_8:return ne.UNSIGNED_INT_24_8;case di.UNSIGNED_SHORT_4_4_4_4:return ne.UNSIGNED_SHORT_4_4_4_4;case di.UNSIGNED_SHORT_5_5_5_1:return ne.UNSIGNED_SHORT_5_5_5_1;case di.UNSIGNED_SHORT_5_6_5:return di.UNSIGNED_SHORT_5_6_5}};di.isPacked=function(e){return e===di.UNSIGNED_INT_24_8||e===di.UNSIGNED_SHORT_4_4_4_4||e===di.UNSIGNED_SHORT_5_5_5_1||e===di.UNSIGNED_SHORT_5_6_5};di.sizeInBytes=function(e){switch(e){case di.UNSIGNED_BYTE:return 1;case di.UNSIGNED_SHORT:case di.UNSIGNED_SHORT_4_4_4_4:case di.UNSIGNED_SHORT_5_5_5_1:case di.UNSIGNED_SHORT_5_6_5:case di.HALF_FLOAT:return 2;case di.UNSIGNED_INT:case di.FLOAT:case di.UNSIGNED_INT_24_8:return 4}};di.validate=function(e){return e===di.UNSIGNED_BYTE||e===di.UNSIGNED_SHORT||e===di.UNSIGNED_INT||e===di.FLOAT||e===di.HALF_FLOAT||e===di.UNSIGNED_INT_24_8||e===di.UNSIGNED_SHORT_4_4_4_4||e===di.UNSIGNED_SHORT_5_5_5_1||e===di.UNSIGNED_SHORT_5_6_5};di.getTypedArrayConstructor=function(e){let t=di.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===di.FLOAT?Float32Array:Uint32Array};var Ue=Object.freeze(di);var rt={DEPTH_COMPONENT:ne.DEPTH_COMPONENT,DEPTH_STENCIL:ne.DEPTH_STENCIL,ALPHA:ne.ALPHA,RED:ne.RED,RG:ne.RG,RGB:ne.RGB,RGBA:ne.RGBA,LUMINANCE:ne.LUMINANCE,LUMINANCE_ALPHA:ne.LUMINANCE_ALPHA,RGB_DXT1:ne.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ne.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ne.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ne.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ne.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ne.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ne.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ne.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ne.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ne.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ne.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ne.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ne.COMPRESSED_RGBA_BPTC_UNORM};rt.componentsLength=function(e){switch(e){case rt.RGB:return 3;case rt.RGBA:return 4;case rt.LUMINANCE_ALPHA:case rt.RG:return 2;case rt.ALPHA:case rt.RED:case rt.LUMINANCE:return 1;default:return 1}};rt.validate=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL||e===rt.ALPHA||e===rt.RED||e===rt.RG||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA||e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isColorFormat=function(e){return e===rt.RED||e===rt.ALPHA||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA};rt.isDepthFormat=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL};rt.isCompressedFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isDXTFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5};rt.isPVRTCFormat=function(e){return e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1};rt.isASTCFormat=function(e){return e===rt.RGBA_ASTC};rt.isETC1Format=function(e){return e===rt.RGB_ETC1};rt.isETC2Format=function(e){return e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC};rt.isBC7Format=function(e){return e===rt.RGBA_BC7};rt.compressedTextureSizeInBytes=function(e,t,n){switch(e){case rt.RGB_DXT1:case rt.RGBA_DXT1:case rt.RGB_ETC1:case rt.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case rt.RGBA_DXT3:case rt.RGBA_DXT5:case rt.RGBA_ASTC:case rt.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case rt.RGB_PVRTC_4BPPV1:case rt.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case rt.RGB_PVRTC_2BPPV1:case rt.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case rt.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};rt.textureSizeInBytes=function(e,t,n,i){let o=rt.componentsLength(e);return Ue.isPacked(t)&&(o=1),o*Ue.sizeInBytes(t)*n*i};rt.alignmentInBytes=function(e,t,n){let i=rt.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};rt.createTypedArray=function(e,t,n,i){let o=Ue.getTypedArrayConstructor(t),r=rt.componentsLength(e)*n*i;return new o(r)};rt.flipY=function(e,t,n,i,o){if(o===1)return e;let r=rt.createTypedArray(t,n,i,o),s=rt.componentsLength(t),a=i*s;for(let l=0;li)throw new E("The number of color attachments exceeds the number supported.");for(let l=0;li)throw new E("The number of color attachments exceeds the number supported.");for(let l=0;l=this._colorTextures.length)throw new E("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorTextures[e]};Rd.prototype.getColorRenderbuffer=function(e){if(!c(e)||e<0||e>=this._colorRenderbuffers.length)throw new E("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorRenderbuffers[e]};Rd.prototype.isDestroyed=function(){return!1};Rd.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;nut.maximumAliasedLineWidth)throw new E("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!ts.validate(this.frontFace))throw new E("Invalid renderState.frontFace.");if(!_De(this.cull.face))throw new E("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new E("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new E("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new E("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new E("renderState.depthRange.far must be less than or equal to one.");if(!gDe(this.depthTest.func))throw new E("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new E("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!Eee(this.blending.equationRgb))throw new E("Invalid renderState.blending.equationRgb.");if(!Eee(this.blending.equationAlpha))throw new E("Invalid renderState.blending.equationAlpha.");if(!cV(this.blending.functionSourceRgb))throw new E("Invalid renderState.blending.functionSourceRgb.");if(!cV(this.blending.functionSourceAlpha))throw new E("Invalid renderState.blending.functionSourceAlpha.");if(!cV(this.blending.functionDestinationRgb))throw new E("Invalid renderState.blending.functionDestinationRgb.");if(!cV(this.blending.functionDestinationAlpha))throw new E("Invalid renderState.blending.functionDestinationAlpha.");if(!See(this.stencilTest.frontFunction))throw new E("Invalid renderState.stencilTest.frontFunction.");if(!See(this.stencilTest.backFunction))throw new E("Invalid renderState.stencilTest.backFunction.");if(!aC(this.stencilTest.frontOperation.fail))throw new E("Invalid renderState.stencilTest.frontOperation.fail.");if(!aC(this.stencilTest.frontOperation.zFail))throw new E("Invalid renderState.stencilTest.frontOperation.zFail.");if(!aC(this.stencilTest.frontOperation.zPass))throw new E("Invalid renderState.stencilTest.frontOperation.zPass.");if(!aC(this.stencilTest.backOperation.fail))throw new E("Invalid renderState.stencilTest.backOperation.fail.");if(!aC(this.stencilTest.backOperation.zFail))throw new E("Invalid renderState.stencilTest.backOperation.zFail.");if(!aC(this.stencilTest.backOperation.zPass))throw new E("Invalid renderState.stencilTest.backOperation.zPass.");if(c(this.viewport)){if(this.viewport.width<0)throw new E("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new E("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>ut.maximumViewportWidth)throw new E(`renderState.viewport.width must be less than or equal to the maximum viewport width (${ut.maximumViewportWidth.toString()}). Check maximumViewportWidth.`);if(this.viewport.height>ut.maximumViewportHeight)throw new E(`renderState.viewport.height must be less than or equal to the maximum viewport height (${ut.maximumViewportHeight.toString()}). Check maximumViewportHeight.`)}this.id=0,this._applyFunctions=[]}var yDe=0,lm={};um.fromCache=function(e){let t=JSON.stringify(e),n=lm[t];if(c(n))return++n.referenceCount,n.state;let i=new um(e),o=JSON.stringify(i);return n=lm[o],c(n)||(i.id=yDe++,i=Sv(i),n={referenceCount:0,state:i},lm[o]=n),++n.referenceCount,lm[t]={referenceCount:1,state:n.state},n.state};um.removeFromCache=function(e){let t=new um(e),n=JSON.stringify(t),i=lm[n],o=JSON.stringify(e),r=lm[o];c(r)&&(--r.referenceCount,r.referenceCount===0&&(delete lm[o],c(i)&&--i.referenceCount)),c(i)&&i.referenceCount===0&&delete lm[n]};um.getCache=function(){return lm};um.clearCache=function(){lm={}};function pb(e,t,n){n?e.enable(t):e.disable(t)}function wee(e,t){e.frontFace(t.frontFace)}function vee(e,t){let n=t.cull,i=n.enabled;pb(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function Dee(e,t){e.lineWidth(t.lineWidth)}function Pee(e,t){let n=t.polygonOffset,i=n.enabled;pb(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function Iee(e,t,n){let i=t.scissorTest,o=c(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(pb(e,e.SCISSOR_TEST,o),o){let r=c(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function Oee(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function Ree(e,t){let n=t.depthTest,i=n.enabled;pb(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function Mee(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Lee(e,t){e.depthMask(t.depthMask)}function Nee(e,t){e.stencilMask(t.stencilMask)}function bDe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Fee(e,t,n){let i=t.blending,o=c(n.blendingEnabled)?n.blendingEnabled:i.enabled;pb(e,e.BLEND,o),o&&(bDe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Bee(e,t){let n=t.stencilTest,i=n.enabled;if(pb(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let l=n.frontOperation,u=l.fail,f=l.zFail,h=l.zPass;e.stencilOpSeparate(e.FRONT,u,f,h);let p=n.backOperation,g=p.fail,m=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,g,m,y)}}function kee(e,t){let n=t.sampleCoverage,i=n.enabled;pb(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var xDe=new Ke;function Uee(e,t,n){let i=t.viewport??n.viewport;c(i)||(i=xDe,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)}um.apply=function(e,t,n){wee(e,t),vee(e,t),Dee(e,t),Pee(e,t),Oee(e,t),Ree(e,t),Mee(e,t),Lee(e,t),Nee(e,t),Bee(e,t),kee(e,t),Iee(e,t,n),Fee(e,t,n),Uee(e,t,n)};function TDe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(wee),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(vee),e.lineWidth!==t.lineWidth&&n.push(Dee),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Pee),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(Oee),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(Ree),(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(Mee),e.depthMask!==t.depthMask&&n.push(Lee),e.stencilMask!==t.stencilMask&&n.push(Nee),(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(Bee),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(kee),n}um.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];c(f)||(f=TDe(t,n),n._applyFunctions[t.id]=f);let h=f.length;for(let p=0;p0&&console.log(`${fm}Vertex shader compile log: ${l}`),l=e.getShaderInfoLog(r),c(l)&&l.length>0&&console.log(`${fm}Fragment shader compile log: ${l}`),l=e.getProgramInfoLog(s),c(l)&&l.length>0&&console.log(`${fm}Shader program link log: ${l}`)),e.deleteShader(o),e.deleteShader(r),s;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(l=e.getProgramInfoLog(s),console.error(`${fm}Shader program link log: ${l}`),h(o,"vertex"),h(r,"fragment"),u=`Program failed to link. Link log: ${l}`):(l=e.getShaderInfoLog(o),console.error(`${fm}Vertex shader compile log: ${l}`),console.error(`${fm} Vertex shader source: ${n}`),u=`Vertex shader failed to compile. Compile log: ${l}`):(l=e.getShaderInfoLog(r),console.error(`${fm}Fragment shader compile log: ${l}`),console.error(`${fm} Fragment shader source: ${i}`),u=`Fragment shader failed to compile. Compile log: ${l}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new ae(u);function h(p,g){if(!c(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${fm}${g} shader translation failed.`);return}console.error(`${fm}Translated ${g} shaderSource: ${m}`)}}function LDe(e,t,n){let i={};for(let o=0;o=0){if(f=n[u.slice(0,m)],!c(f))continue;h=f._locations,h.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(h.push(g),p.push(e.getUniform(t,g))))}else{h=[];for(let y=0;y4)throw new E("options.componentsPerAttribute must be between 1 and 4.");if(!c(e.values))throw new E("options.values is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var ve=JDe;function cC(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(cC.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}}});cC.clone=function(e){if(c(e))return new cC(e._format,e._datatype,e._width,e._height,e._buffer)};cC.prototype.clone=function(){return cC.clone(this)};var Iv=cC;var hte=Zo(du(),1);function mte(){if(!c(fa._canTransferArrayBuffer)){let e=xj("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return fa._canTransferArrayBuffer=!1,fa._canTransferArrayBuffer}fa._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=c(r)&&r[0]===t;i(s),e.terminate(),fa._canTransferArrayBuffer=s}})}return fa._canTransferArrayBuffer}var bj=new pe;function yj(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 xj(e){let t=new hte.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(Ug(e))s=e;else if(!n){let a=tn(`${fa._workerModulePrefix}/${i}.js`);Ug(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=yj(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` importScripts("${yj(CESIUM_WORKERS)}"); CesiumWorkers["${i}"](); `;return r=yj(a),new Worker(r,o)}if(r=e,n||(r=tn(`${fa._workerModulePrefix+i}.js`)),!Vt.supportsEsmWebWorkers())throw new ae("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function ePe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Vt.supportsWebAssembly()){if(!c(t.fallbackModulePath))throw new ae(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=tn(t.fallbackModulePath),n}n.wasmBinaryFile=tn(t.wasmBinaryFile);let i=await we.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function fa(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var tPe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(c(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new ae(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new E(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),bj.raiseEvent(s),i(s)}else bj.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},nPe=[];async function iPe(e,t,n){let i=await Promise.resolve(mte());c(n)?i||(n.length=0):n=nPe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",tPe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:tn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function oPe(e,t,n){++e._activeTasks;try{let i=await iPe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}fa.prototype.scheduleTask=function(e,t){if(c(this._worker)||(this._worker=xj(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return oPe(this,e,t)};fa.prototype.initWebAssemblyModule=async function(e){if(c(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=xj(this._workerPath),i=await ePe(this,e),o=await Promise.resolve(mte()),r,s=i.wasmBinary;c(s)&&o&&(r=[s]);let a=new Promise((l,u)=>{n.onmessage=function({data:f}){c(f)?l(f.result):u(new ae("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};fa.prototype.isDestroyed=function(){return!1};fa.prototype.destroy=function(){return c(this._worker)&&this._worker.terminate(),de(this)};fa.taskCompletedEvent=bj;fa._defaultWorkerModulePrefix="Workers/";fa._workerModulePrefix=fa._defaultWorkerModulePrefix;fa._canTransferArrayBuffer=void 0;var yi=fa;function Pp(){}Pp._transcodeTaskProcessor=new yi("transcodeKTX2",Number.POSITIVE_INFINITY);Pp._readyPromise=void 0;function rPe(){let e=Pp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return Pp._transcodeTaskProcessor;throw new ae("KTX2 transcoder could not be initialized.")});Pp._readyPromise=e}Pp.transcode=function(e,t){return T.defined("supportedTargetFormats",t),c(Pp._readyPromise)||rPe(),Pp._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;rs.x&&d.clone(n,s),La.y&&d.clone(n,a),Fl.z&&d.clone(n,l)}let h=d.magnitudeSquared(d.subtract(s,i,da)),p=d.magnitudeSquared(d.subtract(a,o,da)),g=d.magnitudeSquared(d.subtract(l,r,da)),m=i,y=s,b=h;p>b&&(b=p,m=o,y=a),g>b&&(b=g,m=r,y=l);let x=Ij;x.x=(m.x+y.x)*.5,x.y=(m.y+y.y)*.5,x.z=(m.z+y.z)*.5;let A=d.magnitudeSquared(d.subtract(y,x,da)),C=Math.sqrt(A),S=Oj;S.x=i.x,S.y=o.y,S.z=r.z;let v=Rj;v.x=s.x,v.y=a.y,v.z=l.z;let P=d.midpoint(S,v,Mj),M=0;for(f=0;fM&&(M=R);let L=d.magnitudeSquared(d.subtract(n,x,da));if(L>A){let F=Math.sqrt(L);C=(C+F)*.5,A=C*C;let _=F-C;x.x=(C*x.x+_*n.x)/F,x.y=(C*x.y+_*n.y)/F,x.z=(C*x.z+_*n.z)/F}}return Cl.x&&d.clone(o,l),_u.y&&d.clone(o,u),wf.z&&d.clone(o,f)}let g=d.magnitudeSquared(d.subtract(l,r,da)),m=d.magnitudeSquared(d.subtract(u,s,da)),y=d.magnitudeSquared(d.subtract(f,a,da)),b=r,x=l,A=g;m>A&&(A=m,b=s,x=u),y>A&&(A=y,b=a,x=f);let C=Ij;C.x=(b.x+x.x)*.5,C.y=(b.y+x.y)*.5,C.z=(b.z+x.z)*.5;let S=d.magnitudeSquared(d.subtract(x,C,da)),v=Math.sqrt(S),P=Oj;P.x=r.x,P.y=s.y,P.z=a.z;let M=Rj;M.x=l.x,M.y=u.y,M.z=f.z;let R=d.midpoint(P,M,Mj),L=0;for(p=0;pL&&(L=F);let _=d.magnitudeSquared(d.subtract(o,C,da));if(_>S){let w=Math.sqrt(_);v=(v+w)*.5,S=v*v;let D=w-v;C.x=(v*C.x+D*o.x)/w,C.y=(v*C.y+D*o.y)/w,C.z=(v*C.z+D*o.z)/w}}return va.x&&d.clone(i,a),Fl.y&&d.clone(i,l),_u.z&&d.clone(i,u)}let p=d.magnitudeSquared(d.subtract(a,o,da)),g=d.magnitudeSquared(d.subtract(l,r,da)),m=d.magnitudeSquared(d.subtract(u,s,da)),y=o,b=a,x=p;g>x&&(x=g,y=r,b=l),m>x&&(x=m,y=s,b=u);let A=Ij;A.x=(y.x+b.x)*.5,A.y=(y.y+b.y)*.5,A.z=(y.z+b.z)*.5;let C=d.magnitudeSquared(d.subtract(b,A,da)),S=Math.sqrt(C),v=Oj;v.x=o.x,v.y=r.y,v.z=s.z;let P=Rj;P.x=a.x,P.y=l.y,P.z=u.z;let M=d.midpoint(v,P,Mj),R=0;for(h=0;hR&&(R=L);let F=d.magnitudeSquared(d.subtract(i,A,da));if(F>C){let _=Math.sqrt(F);S=(S+_)*.5,C=S*S;let w=_-S;A.x=(S*A.x+w*i.x)/_,A.y=(S*A.y+w*i.y)/_,A.z=(S*A.z+w*i.z)/_}}return S=l+s)return e.clone(n),n;if(s>=l+o)return t.clone(n),n;let u=(o+l+s)*.5,f=d.multiplyByScalar(a,(-o+u)/l,yPe);return d.add(f,i,f),d.clone(f,n.center),n.radius=u,n};var bPe=new d;hn.expand=function(e,t,n){T.typeOf.object("sphere",e),T.typeOf.object("point",t),n=hn.clone(e,n);let i=d.magnitude(d.subtract(t,n.center,bPe));return i>n.radius&&(n.radius=i),n};hn.intersectPlane=function(e,t){T.typeOf.object("sphere",e),T.typeOf.object("plane",t);let n=e.center,i=e.radius,o=t.normal,r=d.dot(o,n)+t.distance;return r<-i?Wt.OUTSIDE:rO.EPSILON6)throw new E("vector must be normalized.");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 o=n.x,r=n.y;n.x=(1-Math.abs(r))*O.signNotZero(o),n.y=(1-Math.abs(o))*O.signNotZero(r)}return n.x=O.toSNorm(n.x,t),n.y=O.toSNorm(n.y,t),n};bo.octEncode=function(e,t){return bo.octEncodeInRange(e,255,t)};var Rv=new H,vte=new Uint8Array(1);function fV(e){return vte[0]=e,vte[0]}bo.octEncodeToCartesian4=function(e,t){return bo.octEncodeInRange(e,65535,Rv),t.x=fV(Rv.x*Ste),t.y=fV(Rv.x),t.z=fV(Rv.y*Ste),t.w=fV(Rv.y),t};bo.octDecodeInRange=function(e,t,n,i){if(T.defined("result",i),e<0||e>n||t<0||t>n)throw new E(`x and y must be unsigned normalized integers between 0 and ${n}`);if(i.x=O.fromSNorm(e,n),i.y=O.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))*O.signNotZero(o),i.y=(1-Math.abs(o))*O.signNotZero(i.y)}return d.normalize(i,i)};bo.octDecode=function(e,t,n){return bo.octDecodeInRange(e,t,255,n)};bo.octDecodeFromCartesian4=function(e,t){T.typeOf.object("encoded",e),T.typeOf.object("result",t);let n=e.x,i=e.y,o=e.z,r=e.w;if(n<0||n>255||i<0||i>255||o<0||o>255||r<0||r>255)throw new E("x, y, z, and w must be unsigned normalized integers between 0 and 255");let s=n*wte+i,a=o*wte+r;return bo.octDecodeInRange(s,a,65535,t)};bo.octPackFloat=function(e){return T.defined("encoded",e),256*e.x+e.y};var Fj=new H;bo.octEncodeFloat=function(e){return bo.octEncode(e,Fj),bo.octPackFloat(Fj)};bo.octDecodeFloat=function(e,t){T.defined("value",e);let n=e/256,i=Math.floor(n),o=(n-i)*256;return bo.octDecode(i,o,t)};bo.octPack=function(e,t,n,i){T.defined("v1",e),T.defined("v2",t),T.defined("v3",n),T.defined("result",i);let o=bo.octEncodeFloat(e),r=bo.octEncodeFloat(t),s=bo.octEncode(n,Fj);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};bo.octUnpack=function(e,t,n,i){T.defined("packed",e),T.defined("v1",t),T.defined("v2",n),T.defined("v3",i);let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),l=(o-a)*65536;bo.octDecodeFloat(s,t),bo.octDecodeFloat(l,n),bo.octDecode(r,a,i)};bo.compressTextureCoordinates=function(e){T.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};bo.decompressTextureCoordinates=function(e,t){T.defined("compressed",e),T.defined("result",t);let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function Nj(e){return e>>1^-(e&1)}bo.zigZagDeltaDecode=function(e,t,n){T.defined("uBuffer",e),T.defined("vBuffer",t),T.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),c(n)&&T.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let i=e.length,o=0,r=0,s=0;for(let a=0;a>11,h=u>>5&r,p=u&o,g=3*l;t[g]=f*s,t[g+1]=h*a,t[g+2]=p*s}return t};var Ln=bo;var Dte=new d,Pte=new d,Ite=new d;function IPe(e,t,n,i,o){T.defined("point",e),T.defined("p0",t),T.defined("p1",n),T.defined("p2",i),c(o)||(o=new d);let r,s,a,l,u,f,h,p;if(c(t.z)){if(d.equalsEpsilon(e,t,O.EPSILON14))return d.clone(d.UNIT_X,o);if(d.equalsEpsilon(e,n,O.EPSILON14))return d.clone(d.UNIT_Y,o);if(d.equalsEpsilon(e,i,O.EPSILON14))return d.clone(d.UNIT_Z,o);r=d.subtract(n,t,Dte),s=d.subtract(i,t,Pte),a=d.subtract(e,t,Ite),l=d.dot(r,r),u=d.dot(r,s),f=d.dot(r,a),h=d.dot(s,s),p=d.dot(s,a)}else{if(H.equalsEpsilon(e,t,O.EPSILON14))return d.clone(d.UNIT_X,o);if(H.equalsEpsilon(e,n,O.EPSILON14))return d.clone(d.UNIT_Y,o);if(H.equalsEpsilon(e,i,O.EPSILON14))return d.clone(d.UNIT_Z,o);r=H.subtract(n,t,Dte),s=H.subtract(i,t,Pte),a=H.subtract(e,t,Ite),l=H.dot(r,r),u=H.dot(r,s),f=H.dot(r,a),h=H.dot(s,s),p=H.dot(s,a)}o.y=h*f-u*p,o.z=l*p-u*f;let g=l*h-u*u;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var _b=IPe;function dm(){this.high=d.clone(d.ZERO),this.low=d.clone(d.ZERO)}dm.encode=function(e,t){T.typeOf.number("value",e),c(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 Ip={high:0,low:0};dm.fromCartesian=function(e,t){T.typeOf.object("cartesian",e),c(t)||(t=new dm);let n=t.high,i=t.low;return dm.encode(e.x,Ip),n.x=Ip.high,i.x=Ip.low,dm.encode(e.y,Ip),n.y=Ip.high,i.y=Ip.low,dm.encode(e.z,Ip),n.z=Ip.high,i.z=Ip.low,t};var Bj=new dm;dm.writeElements=function(e,t,n){T.defined("cartesianArray",t),T.typeOf.number("index",n),T.typeOf.number.greaterThanOrEquals("index",n,0),dm.fromCartesian(e,Bj);let i=Bj.high,o=Bj.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 Hn=dm;var kj={};kj.computeDiscriminant=function(e,t,n){if(typeof e!="number")throw new E("a is a required number.");if(typeof t!="number")throw new E("b is a required number.");if(typeof n!="number")throw new E("c is a required number.");return t*t-4*e*n};function Ote(e,t,n){let i=e+t;return O.sign(e)!==O.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))u&&u/l0?[a/e,n/a]:[n/a,a/e]};var Vc=kj;var Vj={};Vj.computeDiscriminant=function(e,t,n,i){if(typeof e!="number")throw new E("a is a required number.");if(typeof t!="number")throw new E("b is a required number.");if(typeof n!="number")throw new E("c is a required number.");if(typeof i!="number")throw new E("d is a required number.");let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function Uj(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,l=o*s,u=r*a,f=r*r,h=s*s,p=o*s-f,g=o*a-r*s,m=r*a-h,y=4*p*m-g*g,b,x;if(y<0){let q,Y,te;f*u>=l*h?(q=o,Y=p,te=-2*r*p+o*g):(q=a,Y=m,te=-a*g+2*s*m);let Z=-(te<0?-1:1)*Math.abs(q)*Math.sqrt(-y);x=-te+Z;let ee=x/2,me=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),Te=x===Z?-me:-Y/me;return b=Y<=0?me+Te:-te/(me*me+Te*Te+Y),f*u>=l*h?[(b-r)/o]:[-a/(b+s)]}let A=p,C=-2*r*p+o*g,S=m,v=-a*g+2*s*m,P=Math.sqrt(y),M=Math.sqrt(3)/2,R=Math.abs(Math.atan2(o*P,-C)/3);b=2*Math.sqrt(-A);let L=Math.cos(R);x=b*L;let F=b*(-L/2-M*Math.sin(R)),_=x+F>2*r?x-r:F-r,w=o,D=_/w;R=Math.abs(Math.atan2(a*P,-v)/3),b=2*Math.sqrt(-S),L=Math.cos(R),x=b*L,F=b*(-L/2-M*Math.sin(R));let I=-a,N=x+F<2*s?x+s:F+s,k=I/N,z=w*N,V=-_*N-w*I,j=_*I,U=(s*V-r*j)/(-r*V+s*z);return D<=U?D<=k?U<=k?[D,U,k]:[D,k,U]:[k,D,U]:D<=k?[U,D,k]:U<=k?[U,k,D]:[k,U,D]}Vj.computeRealRoots=function(e,t,n,i){if(typeof e!="number")throw new E("a is a required number.");if(typeof t!="number")throw new E("b is a required number.");if(typeof n!="number")throw new E("c is a required number.");if(typeof i!="number")throw new E("d is a required number.");let o,r;if(e===0)return Vc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=Vc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return Uj(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):Uj(e,t,0,i);if(i===0)return o=Vc.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return Uj(e,t,n,i)};var gb=Vj;var zj={};zj.computeDiscriminant=function(e,t,n,i,o){if(typeof e!="number")throw new E("a is a required number.");if(typeof t!="number")throw new E("b is a required number.");if(typeof n!="number")throw new E("c is a required number.");if(typeof i!="number")throw new E("d is a required number.");if(typeof o!="number")throw new E("e is a required number.");let r=e*e,s=r*e,a=t*t,l=a*t,u=n*n,f=u*n,h=i*i,p=h*i,g=o*o,m=g*o;return a*u*h-4*l*p-4*e*f*h+18*e*t*n*p-27*r*h*h+256*s*m+o*(18*l*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*h+144*r*n*h)+g*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function Md(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,l=gb.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(l.length>0){let u=-e/4,f=l[l.length-1];if(Math.abs(f)=0&&g>=0){let y=Math.sqrt(p),b=Math.sqrt(g);return[u-b,u-y,u+y,u+b]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let h=Math.sqrt(f),p=(r+f-s/h)/2,g=(r+f+s/h)/2,m=Vc.computeRealRoots(1,h,p),y=Vc.computeRealRoots(1,-h,g);return m.length!==0?(m[0]+=u,m[1]+=u,y.length!==0?(y[0]+=u,y[1]+=u,m[1]<=y[0]?[m[0],m[1],y[0],y[1]]:y[1]<=m[0]?[y[0],y[1],m[0],m[1]]:m[0]>=y[0]&&m[1]<=y[1]?[y[0],m[0],m[1],y[1]]:y[0]>=m[0]&&y[1]<=m[1]?[m[0],y[0],y[1],m[1]]:m[0]>y[0]&&m[0]0){let h=f[0],p=t-h,g=p*p,m=e/2,y=p/2,b=g-4*i,x=g+4*Math.abs(i),A=s-4*h,C=s+4*Math.abs(h),S,v;if(h<0||b*C=_[0]&&F[1]<=_[1]?[_[0],F[0],F[1],_[1]]:_[0]>=F[0]&&_[1]<=F[1]?[F[0],_[0],_[1],F[1]]:F[0]>_[0]&&F[0]<_[1]?[_[0],F[0],_[1],F[1]]:[F[0],_[0],F[1],_[1]]:F;if(_.length!==0)return _}return[]}zj.computeRealRoots=function(e,t,n,i,o){if(typeof e!="number")throw new E("a is a required number.");if(typeof t!="number")throw new E("b is a required number.");if(typeof n!="number")throw new E("c is a required number.");if(typeof i!="number")throw new E("d is a required number.");if(typeof o!="number")throw new E("e is a required number.");if(Math.abs(e)f)||(p=d.cross(h,a,Mte),m=d.dot(s,p),m<0||g+m>f))return;y=d.dot(l,p)/f}else{if(Math.abs(f)1||(p=d.cross(h,a,Mte),m=d.dot(s,p)*b,m<0||g+m>1))return;y=d.dot(l,p)*b}return y};Ho.rayTriangle=function(e,t,n,i,o,r){let s=Ho.rayTriangleParametric(e,t,n,i,o);if(!(!c(s)||s<0))return c(r)||(r=new d),d.multiplyByScalar(e.direction,s,r),d.add(e.origin,r,r)};var MPe=new mn;Ho.lineSegmentTriangle=function(e,t,n,i,o,r,s){if(!c(e))throw new E("v0 is required.");if(!c(t))throw new E("v1 is required.");if(!c(n))throw new E("p0 is required.");if(!c(i))throw new E("p1 is required.");if(!c(o))throw new E("p2 is required.");let a=MPe;d.clone(e,a.origin),d.subtract(t,e,a.direction),d.normalize(a.direction,a.direction);let l=Ho.rayTriangleParametric(a,n,i,o,r);if(!(!c(l)||l<0||l>d.distance(e,t)))return c(s)||(s=new d),d.multiplyByScalar(a.direction,l,s),d.add(a.origin,s,s)};function LPe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),l=(-t+a)*s,u=(-t-a)*s;return ls))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var BPe=new d,kPe=new d;Ho.rayEllipsoid=function(e,t){if(!c(e))throw new E("ray is required.");if(!c(t))throw new E("ellipsoid is required.");let n=t.oneOverRadii,i=d.multiplyComponents(n,e.origin,BPe),o=d.multiplyComponents(n,e.direction,kPe),r=d.magnitudeSquared(i),s=d.dot(i,o),a,l,u,f,h;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,l=d.magnitudeSquared(o),u=l*a,pu){f=s*s-u,h=-s+Math.sqrt(f);let m=h/l,y=a/h;return m0?g.push(new d(i,o*L,o*-w)):w!==0?(g.push(new d(i,o*L,o*-w)),g.push(new d(i,o*L,o*w)),++R):g.push(new d(i,o*L,o*w))}return g};var Hj=new d,Lte=new d,Nte=new d,hV=new d,UPe=new d,VPe=new J,zPe=new J,HPe=new J,GPe=new J,jPe=new J,Fte=new J,Bte=new J,kte=new d,WPe=new d,qPe=new he;Ho.grazingAltitudeLocation=function(e,t){if(!c(e))throw new E("ray is required.");if(!c(t))throw new E("ellipsoid is required.");let n=e.origin,i=e.direction;if(!d.equals(n,d.ZERO)){let P=t.geodeticSurfaceNormal(n,Hj);if(d.dot(i,P)>=0)return n}let o=c(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,Hj),s=d.normalize(r,r),a=d.mostOrthogonalAxis(r,hV),l=d.normalize(d.cross(a,s,Lte),Lte),u=d.normalize(d.cross(s,l,Nte),Nte),f=VPe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=l.x,f[4]=l.y,f[5]=l.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let h=J.transpose(f,zPe),p=J.fromScale(t.radii,HPe),g=J.fromScale(t.oneOverRadii,GPe),m=jPe;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 y=J.multiply(J.multiply(h,g,Fte),m,Fte),b=J.multiply(J.multiply(y,p,Bte),f,Bte),x=J.multiplyByVector(y,n,UPe),A=Ho.quadraticVectorExpression(b,d.negate(x,Hj),0,0,1),C,S,v=A.length;if(v>0){let P=d.clone(d.ZERO,WPe),M=Number.NEGATIVE_INFINITY;for(let L=0;LM&&(M=_,P=d.clone(C,P))}let R=t.cartesianToCartographic(P,qPe);return M=O.clamp(M,0,1),S=d.magnitude(d.subtract(P,n,hV))*Math.sqrt(1-M*M),S=o?-S:S,R.height=S,t.cartographicToCartesian(R,new d)}};var YPe=new d;Ho.lineSegmentPlane=function(e,t,n,i){if(!c(e))throw new E("endPoint0 is required.");if(!c(t))throw new E("endPoint1 is required.");if(!c(n))throw new E("plane is required.");c(i)||(i=new d);let o=d.subtract(t,e,YPe),r=n.normal,s=d.dot(r,o);if(Math.abs(s)1))return d.multiplyByScalar(o,l,i),d.add(e,i,i),i};Ho.trianglePlaneIntersection=function(e,t,n,i){if(!c(e)||!c(t)||!c(n)||!c(i))throw new E("p0, p1, p2, and plane are required.");let o=i.normal,r=i.distance,s=d.dot(o,e)+r<0,a=d.dot(o,t)+r<0,l=d.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=l?1:0;let f,h;if((u===1||u===2)&&(f=new d,h=new d),u===1){if(s)return Ho.lineSegmentPlane(e,t,i,f),Ho.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Ho.lineSegmentPlane(t,n,i,f),Ho.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(l)return Ho.lineSegmentPlane(n,e,i,f),Ho.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(s)if(a){if(!l)return Ho.lineSegmentPlane(e,n,i,f),Ho.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}else return Ho.lineSegmentPlane(n,t,i,f),Ho.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};else return Ho.lineSegmentPlane(t,e,i,f),Ho.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,f,h],indices:[1,2,4,1,4,3,0,3,4]}};var Zn=Ho;function zs(e,t){if(T.typeOf.object("normal",e),!O.equalsEpsilon(d.magnitude(e),1,O.EPSILON6))throw new E("normal must be normalized.");T.typeOf.number("distance",t),this.normal=d.clone(e),this.distance=t}zs.fromPointNormal=function(e,t,n){if(T.typeOf.object("point",e),T.typeOf.object("normal",t),!O.equalsEpsilon(d.magnitude(t),1,O.EPSILON6))throw new E("normal must be normalized.");let i=-d.dot(t,e);return c(n)?(d.clone(t,n.normal),n.distance=i,n):new zs(t,i)};var XPe=new d;zs.fromCartesian4=function(e,t){T.typeOf.object("coefficients",e);let n=d.fromCartesian4(e,XPe),i=e.w;if(!O.equalsEpsilon(d.magnitude(n),1,O.EPSILON6))throw new E("normal must be normalized.");return c(t)?(d.clone(n,t.normal),t.distance=i,t):new zs(n,i)};zs.getPointDistance=function(e,t){return T.typeOf.object("plane",e),T.typeOf.object("point",t),d.dot(e.normal,t)+e.distance};var KPe=new d;zs.projectPointOntoPlane=function(e,t,n){T.typeOf.object("plane",e),T.typeOf.object("point",t),c(n)||(n=new d);let i=zs.getPointDistance(e,t),o=d.multiplyByScalar(e.normal,i,KPe);return d.subtract(t,o,n)};var $Pe=new B,ZPe=new se,QPe=new d;zs.transform=function(e,t,n){T.typeOf.object("plane",e),T.typeOf.object("transform",t);let i=e.normal,o=e.distance,r=B.inverseTranspose(t,$Pe),s=se.fromElements(i.x,i.y,i.z,o,ZPe);s=B.multiplyByVector(r,s,s);let a=d.fromCartesian4(s,QPe);return s=se.divideByScalar(s,d.magnitude(a),s),zs.fromCartesian4(s,n)};zs.clone=function(e,t){return T.typeOf.object("plane",e),c(t)?(d.clone(e.normal,t.normal),t.distance=e.distance,t):new zs(e.normal,e.distance)};zs.equals=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.distance===t.distance&&d.equals(e.normal,t.normal)};zs.ORIGIN_XY_PLANE=Object.freeze(new zs(d.UNIT_Z,0));zs.ORIGIN_YZ_PLANE=Object.freeze(new zs(d.UNIT_X,0));zs.ORIGIN_ZX_PLANE=Object.freeze(new zs(d.UNIT_Y,0));var sn=zs;var Gj={};Gj.calculateACMR=function(e){e=e??W.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24;if(!c(t))throw new E("indices is required.");let o=t.length;if(o<3||o%3!==0)throw new E("indices length must be a multiple of three.");if(n<=0)throw new E("maximumIndex must be greater than zero.");if(i<3)throw new E("cacheSize must be greater than two.");if(!c(n)){n=0;let a=0,l=t[a];for(;an&&(n=l),++a,l=t[a]}let r=[];for(let a=0;ai&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};Gj.tipsify=function(e){e=e??W.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(_,w,D,I){for(;w.length>=1;){let N=w[w.length-1];if(w.splice(w.length-1,1),_[N].numLiveTriangles>0)return N}for(;o0)return++o,o-1;++o}return-1}function s(_,w,D,I,N,k,z){let V=-1,j,U=-1,q=0;for(;qU||U===-1)&&(U=j,V=Y)),++q}return V===-1?r(I,k,_,z):V}if(!c(t))throw new E("indices is required.");let a=t.length;if(a<3||a%3!==0)throw new E("indices length must be a multiple of three.");if(n<=0)throw new E("maximumIndex must be greater than zero.");if(i<3)throw new E("cacheSize must be greater than two.");let l=0,u=0,f=t[u],h=a;if(c(n))l=n+1;else{for(;ul&&(l=f),++u,f=t[u];if(l===-1)return 0;++l}let p=[],g;for(g=0;gi&&(C.timeStamp=b,++b),++u}y=s(t,i,x,p,b,A,l)}return P};var Nv=Gj;var zc={};function xV(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function JPe(e){let t=e.length,n=t/3*6,i=Fe.createTypedArray(t,n),o=0;for(let r=0;r=3){let n=(t-2)*6,i=Fe.createTypedArray(t,n);xV(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r0){let t=e.length-1,n=(t-1)*6,i=Fe.createTypedArray(t,n),o=e[0],r=0;for(let s=1;so&&(o=n[r]);e.indices=Nv.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function zte(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){let i=e[n];t[n]=new ve({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function nIe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&c(t[i])&&c(t[i].values)){let o=t[i];for(let r=0;r=O.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=zte(e.attributes),a=e.indices,l=a.length,u;e.primitiveType===Me.TRIANGLES?u=3:e.primitiveType===Me.LINES?u=2:e.primitiveType===Me.POINTS&&(u=1);for(let f=0;f=O.SIXTY_FOUR_KILOBYTES&&(t.push(new ct({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=zte(e.attributes))}o.length!==0&&t.push(new ct({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Hte=new d,iIe=new he;zc.projectTo2D=function(e,t,n,i,o){if(!c(e))throw new E("geometry is required.");if(!c(t))throw new E("attributeName is required.");if(!c(n))throw new E("attributeName3D is required.");if(!c(i))throw new E("attributeName2D is required.");if(!c(e.attributes[t]))throw new E(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==$.DOUBLE)throw new E("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let r=e.attributes[t];o=c(o)?o:new Oi;let s=o.ellipsoid,a=r.values,l=new Float64Array(a.length),u=0;for(let f=0;fb&&(b=A)}return new ct({attributes:f,indices:m,primitiveType:u,boundingSphere:c(y)?new le(y,b):void 0})}zc.combineInstances=function(e){if(!c(e)||e.length<1)throw new E("instances is required and must have length greater than zero.");let t=[],n=[],i=e.length;for(let r=0;r0&&o.push(Yj(t,"geometry")),n.length>0&&(o.push(Yj(n,"westHemisphereGeometry")),o.push(Yj(n,"eastHemisphereGeometry"))),o};var Tf=new d,Fv=new d,lC=new d,uC=new d;zc.computeNormal=function(e){if(!c(e))throw new E("geometry is required.");if(!c(e.attributes.position)||!c(e.attributes.position.values))throw new E("geometry.attributes.position.values is required.");if(!c(e.indices))throw new E("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!==0)throw new E("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==Me.TRIANGLES)throw new E("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),l=new Array(r),u;for(u=0;u0){for(f=0;f3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;oo?i>r?s=O.sign(e.y):s=O.sign(n.y):o>r?s=O.sign(t.y):s=O.sign(n.y);let a=s<0;jg(e,a),jg(t,a),jg(n,a)}var qte=new d;function Af(e,t,n,i){d.add(e,d.multiplyByScalar(d.subtract(t,e,qte),e.y/(e.y-t.y),qte),n),d.clone(n,i),jg(n,!0),jg(i,!1)}var bb=new d,xb=new d,Tb=new d,Ab=new d,Xj={positions:new Array(7),indices:new Array(3*3)};function _Ie(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;pIe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=Xj.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Af(e,t,bb,Tb),Af(e,n,xb,Ab),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Af(t,n,bb,Tb),Af(t,e,xb,Ab),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Af(n,e,bb,Tb),Af(n,t,xb,Ab),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(Af(n,e,bb,Tb),Af(n,t,xb,Ab),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Af(t,n,bb,Tb),Af(t,e,xb,Ab),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Af(e,t,bb,Tb),Af(e,n,xb,Ab),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let l=Xj.positions;return l[0]=e,l[1]=t,l[2]=n,l.length=3,(s===1||s===2)&&(l[3]=bb,l[4]=xb,l[5]=Tb,l[6]=Ab,l.length=7),Xj}function Yte(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&c(n[o])&&c(n[o].values)){let r=n[o];r.values=$.createTypedArray(r.componentDatatype,r.values)}let i=ct.computeNumberOfVertices(e);return e.indices=Fe.createTypedArray(i,e.indices),t&&(e.boundingSphere=le.fromVertices(n.position.values)),e}function dC(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&c(t[i])&&c(t[i].values)){let o=t[i];n[i]=new ve({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new ct({attributes:n,indices:[],primitiveType:e.primitiveType})}function Qj(e,t,n){let i=c(e.geometry.boundingSphere);t=Yte(t,i),n=Yte(n,i),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function Jj(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,l,u,f,h,p){let g=e.fromArray(u,r*t,n),m=e.fromArray(u,s*t,i),y=e.fromArray(u,a*t,o);e.multiplyByScalar(g,l.x,g),e.multiplyByScalar(m,l.y,m),e.multiplyByScalar(y,l.z,y);let b=e.add(g,m,g);e.add(b,y,b),p&&e.normalize(b,b),e.pack(b,f,h*t)}}var gIe=Jj(se,4),bV=Jj(d,3),Jte=Jj(H,2),yIe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,l=o[t]*i.y,u=o[n]*i.z;r[s]=a+l+u>O.EPSILON6?1:0},kv=new d,Kj=new d,$j=new d,bIe=new d;function gV(e,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y){if(!c(r)&&!c(s)&&!c(a)&&!c(l)&&!c(u)&&g===0)return;let b=d.fromArray(o,e*3,kv),x=d.fromArray(o,t*3,Kj),A=d.fromArray(o,n*3,$j),C=_b(i,b,x,A,bIe);if(c(C)){if(c(r)&&bV(e,t,n,C,r,h.normal.values,y,!0),c(u)){let S=d.fromArray(u,e*3,kv),v=d.fromArray(u,t*3,Kj),P=d.fromArray(u,n*3,$j);d.multiplyByScalar(S,C.x,S),d.multiplyByScalar(v,C.y,v),d.multiplyByScalar(P,C.z,P);let M;!d.equals(S,d.ZERO)||!d.equals(v,d.ZERO)||!d.equals(P,d.ZERO)?(M=d.add(S,v,S),d.add(M,P,M),d.normalize(M,M)):(M=kv,M.x=0,M.y=0,M.z=0),d.pack(M,h.extrudeDirection.values,y*3)}if(c(f)&&yIe(e,t,n,C,f,h.applyOffset.values,y),c(s)&&bV(e,t,n,C,s,h.tangent.values,y,!0),c(a)&&bV(e,t,n,C,a,h.bitangent.values,y,!0),c(l)&&Jte(e,t,n,C,l,h.st.values,y),g>0)for(let S=0;S3){let I=D.positions,N=D.indices,k=N.length;for(let z=0;z0)continue;let l=d.unpack(i,s,nne);(a.y<0&&l.y>0||a.y>0&&l.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):d.pack(a,i,s));let u=d.unpack(o,s,Zj);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+30||le.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==Wt.INTERSECTING))return e;if(t.geometryType!==xf.NONE)switch(t.geometryType){case xf.POLYLINES:PIe(e);break;case xf.TRIANGLES:Xte(e);break;case xf.LINES:Kte(e);break}else mIe(t),t.primitiveType===Me.TRIANGLES?Xte(e):t.primitiveType===Me.LINES&&Kte(e);return e};var Nn=zc;function Uv(e,t,n,i,o,r,s,a,l,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=l,this._flipY=u,this._initialized=f}Object.defineProperties(Uv.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});Uv.prototype.copyFrom=function(e){T.defined("options",e);let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(T.defined("options.source",i),T.typeOf.number.greaterThanOrEquals("xOffset",t,0),T.typeOf.number.greaterThanOrEquals("yOffset",n,0),t+i.width>this._size)throw new E("xOffset + options.source.width must be less than or equal to width.");if(n+i.height>this._size)throw new E("yOffset + options.source.height must be less than or equal to height.");let{width:r,height:s}=i,a=this._context._gl,l=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(l,this._texture);let f=i.arrayBufferView,h=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,y=this._preMultiplyAlpha,b=this._flipY,x=4;c(f)&&(x=ke.alignmentInBytes(p,m,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,x),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let A=!1;if(!this._initialized){let C;t===0&&n===0&&r===h&&s===h?(c(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=ke.flipY(f,p,m,h,h)),C=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),C=i),A=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),C=ke.createTypedArray(p,m,h,h)),a.texImage2D(u,0,g,h,h,0,p,Ue.toWebGLConstant(m,this._context),C),this._initialized=!0}A||(c(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=ke.flipY(f,p,m,r,s)),a.texSubImage2D(u,0,t,n,r,s,p,Ue.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),a.texSubImage2D(u,0,t,n,p,Ue.toWebGLConstant(m,this._context),i))),a.bindTexture(l,null)};Uv.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){if(e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._size,r=r??this._size,T.typeOf.number.greaterThanOrEquals("xOffset",e,0),T.typeOf.number.greaterThanOrEquals("yOffset",t,0),T.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),T.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),e+o>this._size)throw new E("xOffset + source.width must be less than or equal to width.");if(t+r>this._size)throw new E("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Ue.FLOAT)throw new E("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new E("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};Uv.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){if(e=e??0,t=t??0,n=n??this._size,i=i??this._size,o=o??0,T.typeOf.number.greaterThanOrEquals("xOffset",e,0),T.typeOf.number.greaterThanOrEquals("yOffset",t,0),e+n>this._size)throw new E("xOffset + source.width must be less than or equal to width.");if(t+i>this._size)throw new E("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Ue.FLOAT)throw new E("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new E("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var Vv=Uv;var TV={DONT_CARE:ne.DONT_CARE,FASTEST:ne.FASTEST,NICEST:ne.NICEST,validate:function(e){return e===TV.DONT_CARE||e===TV.FASTEST||e===TV.NICEST}},Cf=Object.freeze(TV);var AV={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR};AV.validate=function(e){return e===AV.NEAREST||e===AV.LINEAR};var li=Object.freeze(AV);var Wg={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR,NEAREST_MIPMAP_NEAREST:ne.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ne.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ne.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ne.LINEAR_MIPMAP_LINEAR};Wg.validate=function(e){return e===Wg.NEAREST||e===Wg.LINEAR||e===Wg.NEAREST_MIPMAP_NEAREST||e===Wg.LINEAR_MIPMAP_NEAREST||e===Wg.NEAREST_MIPMAP_LINEAR||e===Wg.LINEAR_MIPMAP_LINEAR};var Yt=Object.freeze(Wg);var CV={CLAMP_TO_EDGE:ne.CLAMP_TO_EDGE,REPEAT:ne.REPEAT,MIRRORED_REPEAT:ne.MIRRORED_REPEAT,validate:function(e){return e===CV.CLAMP_TO_EDGE||e===CV.REPEAT||e===CV.MIRRORED_REPEAT}},gn=Object.freeze(CV);function zv(e){e=e??W.EMPTY_OBJECT;let{wrapS:t=gn.CLAMP_TO_EDGE,wrapT:n=gn.CLAMP_TO_EDGE,minificationFilter:i=Yt.LINEAR,magnificationFilter:o=li.LINEAR,maximumAnisotropy:r=1}=e;if(!gn.validate(t))throw new E("Invalid sampler.wrapS.");if(!gn.validate(n))throw new E("Invalid sampler.wrapT.");if(!Yt.validate(i))throw new E("Invalid sampler.minificationFilter.");if(!li.validate(o))throw new E("Invalid sampler.magnificationFilter.");T.typeOf.number.greaterThanOrEquals("maximumAnisotropy",r,1),this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(zv.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});zv.equals=function(e,t){return e===t||c(e)&&c(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};zv.NEAREST=Object.freeze(new zv({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.NEAREST,magnificationFilter:li.NEAREST}));var Qt=zv;function IIe(e,t,n,i){let o=c(t.vertexBuffer),r=c(t.value),s=t.value?t.value.length:t.componentsPerAttribute;if(!o&&!r)throw new E("attribute must have a vertexBuffer or a value.");if(o&&r)throw new E("attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.");if(s!==1&&s!==2&&s!==3&&s!==4)throw r?new E("attribute.value.length must be in the range [1, 4]."):new E("attribute.componentsPerAttribute must be in the range [1, 4].");if(c(t.componentDatatype)&&!$.validate(t.componentDatatype))throw new E("attribute must have a valid componentDatatype or not specify it.");if(c(t.strideInBytes)&&t.strideInBytes>255)throw new E("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if(c(t.instanceDivisor)&&t.instanceDivisor>0&&!i.instancedArrays)throw new E("instanced arrays is not supported");if(c(t.instanceDivisor)&&t.instanceDivisor<0)throw new E("attribute must have an instanceDivisor greater than or equal to zero");if(c(t.instanceDivisor)&&r)throw new E("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if(c(t.instanceDivisor)&&t.instanceDivisor>0&&t.index===0)throw new E("attribute zero cannot have an instanceDivisor greater than 0");let a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??$.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)a.vertexAttrib=function(l){let u=this.index;l.bindBuffer(l.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),l.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),l.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(l){l.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(l){l.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(l){l.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(l){l.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(l){l.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(l){}}e.push(a)}function one(e,t,n){for(let i=0;i0&&(l=!0),c(s[r].value)&&(u=!0);let h={};for(r=0;r0)for(r=ine(e[o[0]]),t=1;t0){let u=$.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let h=r*a,p=new ArrayBuffer(h),g={};for(t=0;t=O.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=yt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Fe.UNSIGNED_INT}):p=yt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Fe.UNSIGNED_SHORT})),new Op({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Op.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Op.prototype.getAttribute=function(e){return T.defined("index",e),this._attributes[e]};function MIe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=ut.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function LIe(e,t){let n=e._attributes,i=n.length;for(let o=0;oc(n[C])))throw new E(`options.source requires faces ${Object.values(Co.FaceName).join(", ")}.`);({width:u,height:f}=n.positiveX);for(let C of Co.faceNames()){let S=n[C];if(Number(S.width)!==u||Number(S.height)!==f)throw new E("Each face in options.source must have the same width and height.")}}let h=u;if(!c(u)||!c(f))throw new E("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(u!==f)throw new E("Width must equal height.");if(h<=0)throw new E("Width and height must be greater than zero.");if(h>ut.maximumCubeMapSize)throw new E(`Width and height must be less than or equal to the maximum cube map size (${ut.maximumCubeMapSize}). Check maximumCubeMapSize.`);if(!ke.validate(i))throw new E("Invalid options.pixelFormat.");if(ke.isDepthFormat(i))throw new E("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!Ue.validate(o))throw new E("Invalid options.pixelDatatype.");if(o===Ue.FLOAT&&!t.floatingPointTexture)throw new E("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(o===Ue.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new E("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.");let p=ke.textureSizeInBytes(i,o,h,h)*6,g=ke.toInternalFormat(i,o,t),m=t._gl,y=m.TEXTURE_CUBE_MAP,b=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=b,this._pixelFormat=i,this._pixelDatatype=o,this._size=h,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=l,this._flipY=r;let x=c(n);function A(C){return new Vv(t,b,y,C,g,i,o,h,l,r,x)}this._positiveX=A(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=A(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=A(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=A(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=A(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=A(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,rne(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(y,b),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let C of Co.faceNames())e6(this[C],n?.[C],0);m.bindTexture(y,null)}Co.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new Ur({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),r._unBind(),r.destroy()};Co.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*NIe(){yield Co.FaceName.POSITIVEX,yield Co.FaceName.NEGATIVEX,yield Co.FaceName.POSITIVEY,yield Co.FaceName.NEGATIVEY,yield Co.FaceName.POSITIVEZ,yield Co.FaceName.NEGATIVEZ}Co.faceNames=function(){return NIe()};function e6(e,t,n){n=n??0;let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,l=e._flipY,u=e._preMultiplyAlpha,f=e._context,h=f._gl;if(!c(t)){h.texImage2D(i,n,a,o,o,0,r,Ue.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,g=4;c(p)&&(g=ke.alignmentInBytes(r,s,o)),h.pixelStorei(h.UNPACK_ALIGNMENT,g),c(p)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),l&&(p=ke.flipY(p,r,s,o,o)),h.texImage2D(i,n,a,o,o,0,r,Ue.toWebGLConstant(s,f),p)):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,l),h.texImage2D(i,n,a,r,Ue.toWebGLConstant(s,f),t))}Co.loadFace=e6;Object.defineProperties(Co.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){rne(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}}});Co.getDirection=function(e,t){switch(e){case Co.FaceName.POSITIVEX:return d.clone(d.UNIT_X,t);case Co.FaceName.NEGATIVEX:return d.negate(d.UNIT_X,t);case Co.FaceName.POSITIVEY:return d.clone(d.UNIT_Y,t);case Co.FaceName.NEGATIVEY:return d.negate(d.UNIT_Y,t);case Co.FaceName.POSITIVEZ:return d.clone(d.UNIT_Z,t);case Co.FaceName.NEGATIVEZ:return d.negate(d.UNIT_Z,t)}};function rne(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Yt.NEAREST_MIPMAP_NEAREST,Yt.NEAREST_MIPMAP_LINEAR,Yt.LINEAR_MIPMAP_NEAREST,Yt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===Ue.FLOAT&&!r.textureFloatLinear||s===Ue.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Yt.NEAREST_MIPMAP_NEAREST:Yt.NEAREST,i=li.NEAREST);let a=r._gl,l=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(l,e._texture),a.texParameteri(l,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(l,a.TEXTURE_MAG_FILTER,i),a.texParameteri(l,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(l,a.TEXTURE_WRAP_T,t.wrapT),c(e._textureFilterAnisotropic)&&a.texParameteri(l,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(l,null)}Co.prototype.loadMipmaps=function(e,t){if(T.defined("source",e),!Array.isArray(e))throw new E("source must be an array");let n=Math.log2(this._size);if(e.length!==n)throw new E("all mip levels must be defined");t=t??!1;let i=this._context._gl,o=this._texture,r=this._textureTarget;i.activeTexture(i.TEXTURE0),i.bindTexture(r,o),t?i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE):i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL);for(let s=0;s1&&!O.isPowerOfTwo(this._size))throw new E("width and height must be a power of two to call generateMipmap().");if(!Cf.validate(e))throw new E("hint is invalid.");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)};Co.createVertexArray=function(e){let t=La.createGeometry(La.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY})),n=this._attributeLocations=Nn.createAttributeLocations(t);return ti.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Be.STATIC_DRAW})};Co.prototype.isDestroyed=function(){return!1};Co.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=de(this._positiveX),this._negativeX=de(this._negativeX),this._positiveY=de(this._positiveY),this._negativeY=de(this._negativeY),this._positiveZ=de(this._positiveZ),this._negativeZ=de(this._negativeZ),de(this)};var Go=Co;function FIe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var lc=FIe;var Hv=`const float czm_degreesPerRadian = 57.29577951308232; `;var Gv=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); `;var jv=`const float czm_epsilon1 = 0.1; `;var Wv=`const float czm_epsilon2 = 0.01; `;var qv=`const float czm_epsilon3 = 0.001; `;var Yv=`const float czm_epsilon4 = 0.0001; `;var Xv=`const float czm_epsilon5 = 0.00001; `;var Kv=`const float czm_epsilon6 = 0.000001; `;var $v=`const float czm_epsilon7 = 0.0000001; `;var Zv=`const float czm_infinity = 5906376272000.0; `;var Qv=`const float czm_oneOverPi = 0.3183098861837907; `;var Jv=`const float czm_oneOverTwoPi = 0.15915494309189535; `;var eD=`const float czm_passCesium3DTile = 4.0; `;var tD=`const float czm_passCesium3DTileClassification = 5.0; `;var nD=`const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; `;var iD=`const float czm_passClassification = 7.0; `;var oD=`const float czm_passCompute = 1.0; `;var rD=`const float czm_passEnvironment = 0.0; `;var sD=`const float czm_passGlobe = 2.0; `;var aD=`const float czm_passOpaque = 7.0; `;var cD=`const float czm_passOverlay = 10.0; `;var lD=`const float czm_passTerrainClassification = 3.0; `;var uD=`const float czm_passTranslucent = 8.0; `;var fD=`const float czm_passVoxels = 9.0; `;var dD=`const float czm_pi = 3.141592653589793; `;var hD=`const float czm_piOverFour = 0.7853981633974483; `;var mD=`const float czm_piOverSix = 0.5235987755982988; `;var pD=`const float czm_piOverThree = 1.0471975511965976; `;var _D=`const float czm_piOverTwo = 1.5707963267948966; `;var gD=`const float czm_radiansPerDegree = 0.017453292519943295; `;var yD=`const float czm_sceneMode2D = 2.0; `;var bD=`const float czm_sceneMode3D = 3.0; `;var xD=`const float czm_sceneModeColumbusView = 1.0; `;var TD=`const float czm_sceneModeMorphing = 0.0; `;var AD=`const float czm_solarRadius = 695500000.0; `;var CD=`const float czm_threePiOver2 = 4.71238898038469; `;var ED=`const float czm_twoPi = 6.283185307179586; `;var SD=`const float czm_webMercatorMaxLatitude = 1.4844222297453324; `;var wD=`struct czm_depthRangeStruct { float near; float far; }; `;var vD=`struct czm_material { vec3 diffuse; float specular; float shininess; vec3 normal; vec3 emission; float alpha; }; `;var DD=`struct czm_materialInput { float s; vec2 st; vec3 str; vec3 normalEC; mat3 tangentToEyeMatrix; vec3 positionToEyeEC; float height; float slope; float aspect; float waterMask; }; `;var PD=`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; #endif }; `;var ID=`struct czm_modelVertexOutput { vec3 positionMC; float pointSize; }; `;var OD=`struct czm_ray { vec3 origin; vec3 direction; }; `;var RD=`struct czm_raySegment { float start; float stop; }; const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity); const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); `;var MD=`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 LD=`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 ND=`float czm_alphaWeight(float a) { float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; 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 FD=`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); 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 BD=`vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) { vec3 hsb = czm_RGBToHSB(rgb); hsb.x += hsbShift.x; hsb.y = clamp(hsb.y + hsbShift.y, 0.0, 1.0); 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); return czm_HSBToRGB(hsb); } `;var kD=`vec2 czm_approximateSphericalCoordinates(vec3 normal) { 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 UD=`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 VD=`bool czm_backFacing() { return gl_FrontFacing == false; } `;var zD=`float czm_branchFreeTernary(bool comparison, float a, float b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } `;var HD=`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 GD=`uniform vec4 shadowMap_cascadeDistances; float czm_cascadeDistance(vec4 weights) { return dot(shadowMap_cascadeDistances, weights); } `;var jD=`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 WD=`uniform vec4 shadowMap_cascadeSplits[2]; vec4 czm_cascadeWeights(float depthEye) { vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); return near * far; } `;var qD=`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) { 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 YD=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) { vec3 p = mix(position2D.xyz, position3D.xyz, time); return vec4(p, 1.0); } `;var XD=`vec4 czm_computeAtmosphereColor( vec3 positionWC, vec3 lightDirection, vec3 rayleighColor, vec3 mieColor, float opacity ) { 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; float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq); 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)); vec3 rayleigh = rayleighPhase * rayleighColor; vec3 mie = miePhase * mieColor; vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity; return vec4(color, opacity); } 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; float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq); 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)); vec3 rayleigh = rayleighPhase * rayleighColor; vec3 mie = miePhase * mieColor; vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity; return vec4(color, opacity); } `;var KD=`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 $D=`vec4 czm_computePosition(); `;var ZD=`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; const int PRIMARY_STEPS_MAX = 16; const int LIGHT_STEPS_MAX = 4; rayleighColor = vec3(0.0); mieColor = vec3(0.0); opacity = 0.0; float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; vec3 origin = vec3(0.0); czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius); if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) { return; } float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength); float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x)); float start_0 = primaryRayAtmosphereIntersect.start; primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0); primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength)); float x_o_a = start_0 - ATMOSPHERE_THICKNESS; 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); int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); float rayPositionLength = primaryRayAtmosphereIntersect.start; 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); for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { if (i >= PRIMARY_STEPS) { break; } vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength); float sampleHeight = length(samplePosition) - atmosphereInnerRadius; vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength; opticalDepth += sampleDensity; 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); for (int j = 0; j < LIGHT_STEPS_MAX; ++j) { if (j >= LIGHT_STEPS) { break; } vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); float lightHeight = length(lightPosition) - atmosphereInnerRadius; lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; lightPositionLength += lightStepLength; } vec3 attenuation = exp(-((czm_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (czm_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); rayleighAccumulation += sampleDensity.x * attenuation; mieAccumulation += sampleDensity.y * attenuation; rayPositionLength += (rayStepLength += rayStepLengthIncrease); } rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation; mieColor = czm_atmosphereMieCoefficient * mieAccumulation; opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x)))); } `;var QD=`vec2 cordic(float angle) { vec2 vector = vec2(6.0725293500888267e-1, 0.0); float sense = (angle < 0.0) ? -1.0 : 1.0; mat2 rotation = mat2(1.0, sense, -sense, 1.0); vector = rotation * vector; angle -= sense * 7.8539816339744828e-1; sense = (angle < 0.0) ? -1.0 : 1.0; float factor = sense * 5.0e-1; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 4.6364760900080609e-1; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 2.5e-1; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 2.4497866312686414e-1; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.25e-1; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 1.2435499454676144e-1; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 6.25e-2; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 6.2418809995957350e-2; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 3.125e-2; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 3.1239833430268277e-2; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.5625e-2; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 1.5623728620476831e-2; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 7.8125e-3; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 7.8123410601011111e-3; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 3.90625e-3; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 3.9062301319669718e-3; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.953125e-3; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 1.9531225164788188e-3; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 9.765625e-4; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 9.7656218955931946e-4; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 4.8828125e-4; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 4.8828121119489829e-4; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 2.44140625e-4; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 2.4414062014936177e-4; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.220703125e-4; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 1.2207031189367021e-4; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 6.103515625e-5; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 6.1035156174208773e-5; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 3.0517578125e-5; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 3.0517578115526096e-5; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.52587890625e-5; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 1.5258789061315762e-5; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 7.62939453125e-6; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 7.6293945311019700e-6; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 3.814697265625e-6; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 3.8146972656064961e-6; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.9073486328125e-6; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 1.9073486328101870e-6; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 9.5367431640625e-7; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 9.5367431640596084e-7; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 4.76837158203125e-7; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 4.7683715820308884e-7; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 2.384185791015625e-7; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 2.3841857910155797e-7; sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.1920928955078125e-7; rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; return vector; } 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 JD=`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 eP=`#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) out float v_WindowZ; #endif 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 tP=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) { vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); vec3 tangentEC = normalize(czm_normal3D * tangentMC); vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); return mat3( tangentEC.x, tangentEC.y, tangentEC.z, bitangentEC.x, bitangentEC.y, bitangentEC.z, normalEC.x, normalEC.y, normalEC.z); } `;var nP=`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 iP=`vec2 czm_ellipsoidTextureCoordinates(vec3 normal) { return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); } `;var oP=`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 rP=`vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) { vec4 p = positionEC; vec4 zEyeOffset = normalize(p) * eyeOffset.z; p.xy += eyeOffset.xy + zEyeOffset.xy; p.z += zEyeOffset.z; return p; } `;var sP=`vec4 czm_eyeToWindowCoordinates(vec4 positionEC) { vec4 q = czm_projection * positionEC; q.xyz /= q.w; q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; return q; } `;var aP=`float czm_fastApproximateAtan(float x) { return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); } float czm_fastApproximateAtan(float x, float y) { float t = abs(x); float opposite = abs(y); float adjacent = max(t, opposite); opposite = min(t, opposite); t = czm_fastApproximateAtan(opposite / adjacent); 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 cP=`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); } 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 lP=`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 uP=`vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) { return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); } `;var fP=`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 dP=`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 hP=`float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) { return max(dot(lightDirectionEC, normalEC), 0.0); } `;var mP=`float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) { vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); float specular = max(dot(toReflectedLight, toEyeEC), 0.0); return pow(specular, max(shininess, czm_epsilon2)); } `;var pP=`vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) { float cosAngle = cos(angleInRadians); float sinAngle = sin(angleInRadians); 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); 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)); return ((noise / 4.0) - 0.5) * 2.0; } `;var _P=`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 gP=`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 yP=`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 bP=`vec3 czm_inverseGamma(vec3 color) { return pow(color, vec3(1.0 / czm_gamma)); } `;var xP=`bool czm_isEmpty(czm_raySegment interval) { return (interval.stop < 0.0); } `;var TP=`bool czm_isFull(czm_raySegment interval) { return (interval.start == 0.0 && interval.stop == czm_infinity); } `;var AP=`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 CP=`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 EP=`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 SP=`float czm_luminance(vec3 rgb) { const vec3 W = vec3(0.2125, 0.7154, 0.0721); return dot(rgb, W); } `;var wP=`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 vP=`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; } float czm_metersPerPixel(vec4 positionEC) { return czm_metersPerPixel(positionEC, czm_pixelRatio); } `;var DP=`vec4 czm_modelToWindowCoordinates(vec4 position) { vec4 q = czm_modelViewProjection * position; q.xyz /= q.w; q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; return q; } `;var PP=`vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) { 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 IP=`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 OP=`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); } vec3 czm_octDecode(vec2 encoded) { return czm_octDecode(encoded, 255.0); } 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)); } 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 RP=`vec4 czm_packDepth(float depth) { 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 MP=`vec3 lambertianDiffuse(vec3 diffuseColor) { return diffuseColor / czm_pi; } vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) { float versine = 1.0 - VdotH; float versineSquared = versine * versine; return f0 + (f90 - f0) * versineSquared * versineSquared * versine; } #ifdef USE_ANISOTROPY 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); } 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 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; } float GGX(float alphaRoughness, float NdotH) { float alphaRoughnessSquared = alphaRoughness * alphaRoughness; float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0; return alphaRoughnessSquared / (czm_pi * f * f); } 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; } 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); 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; vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); return (diffuseContribution + specularContribution) * NdotL; } `;var LP=`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 NP=`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); } vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material); if (czm_sceneMode == czm_sceneMode3D) { diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material); } float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); 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 FP=`float czm_planeDistance(vec4 plane, vec3 point) { return (dot(plane.xyz, point) + plane.w); } float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { return (dot(planeNormal, point) + planeDistance); } `;var BP=`vec3 czm_pointAlongRay(czm_ray ray, float time) { return ray.origin + (time * ray.direction); } `;var kP=`czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) { 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) { if (qw >= 0.0) { return czm_emptyRaySegment; } else { float qw2 = qw * qw; float difference = q2 - 1.0; float w2 = dot(w, w); float product = w2 * difference; if (qw2 < product) { return czm_emptyRaySegment; } else if (qw2 > product) { float discriminant = qw * qw - product; float temp = -qw + sqrt(discriminant); 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 { float root = sqrt(difference / w2); czm_raySegment i = czm_raySegment(root, root); return i; } } } else if (q2 < 1.0) { float difference = q2 - 1.0; float w2 = dot(w, w); float product = w2 * difference; float discriminant = qw * qw - product; float temp = -qw + sqrt(discriminant); czm_raySegment i = czm_raySegment(0.0, temp / w2); return i; } else { if (qw < 0.0) { float w2 = dot(w, w); czm_raySegment i = czm_raySegment(0.0, -qw / w2); return i; } else { return czm_emptyRaySegment; } } } `;var UP=`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 VP=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) { return czm_reverseLogDepth(texture(depthTexture, texCoords).r); } `;var zP=`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 HP=`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 GP=`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 jP=`vec3 RGBtoHCV(vec3 rgb) { 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 WP=`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 qP=`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 YP=`vec3 czm_saturation(vec3 rgb, float adjustment) { const vec3 W = vec3(0.2125, 0.7154, 0.0721); vec3 intensity = vec3(dot(rgb, W)); return mix(intensity, rgb, adjustment); } `;var XP=`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 KP=`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 $P=`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 ZP=`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 QP=`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 JP=`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 eI=`vec4 czm_textureCube(samplerCube sampler, vec3 p) { #if __VERSION__ == 300 return texture(sampler, p); #else return textureCube(sampler, p); #endif } 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 tI=`vec4 czm_transformPlane(vec4 plane, mat4 transform) { vec4 transformedPlane = transform * plane; float normalMagnitude = length(transformedPlane.xyz); return transformedPlane / normalMagnitude; } `;var nI=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low) { vec3 highDifference = high - czm_encodedCameraPositionMCHigh; if (length(highDifference) == 0.0) { highDifference = vec3(0); } vec3 lowDifference = low - czm_encodedCameraPositionMCLow; return vec4(highDifference + lowDifference, 1.0); } `;var iI=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); if (czm_sceneMode == czm_sceneMode3D) { 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); 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 oI=`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 rI=`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; 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 sI=`float czm_unpackDepth(vec4 packedDepth) { return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); } `;var aI=`float czm_unpackFloat(vec4 packedFloat) { 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 cI=`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 lI=`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 uI=`#ifdef LOG_DEPTH 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 coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w; #endif return coords; } void czm_vertexLogDepth() { #ifdef LOG_DEPTH v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0; gl_Position = czm_updatePositionDepth(gl_Position); #endif } void czm_vertexLogDepth(vec4 clipCoords) { #ifdef LOG_DEPTH v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; czm_updatePositionDepth(clipCoords); #endif } `;var fI=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) { 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); q /= screenCoordinate.w; if (!(czm_inverseProjection == mat4(0.0))) { 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; } 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) { #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; return eyeCoordinate; #else vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); #endif return eyeCoordinate; } vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) { vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); } `;var dI=`#if !defined(LOG_DEPTH) in float v_WindowZ; #endif 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 hI=`#ifdef LOG_DEPTH in float v_depthFromNearPlusOne; #ifdef POLYGON_OFFSET uniform vec2 u_polygonOffset; #endif #endif void czm_writeLogDepth(float depth) { #if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { discard; } #ifdef POLYGON_OFFSET float factor = u_polygonOffset[0]; float units = u_polygonOffset[1]; #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) if (factor != 0.0) { float x = dFdx(depth); float y = dFdy(depth); float m = sqrt(x * x + y * y); depth += m * factor; } #endif #endif gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne; #ifdef POLYGON_OFFSET gl_FragDepth += czm_epsilon7 * units; #endif #endif } void czm_writeLogDepth() { #ifdef LOG_DEPTH czm_writeLogDepth(v_depthFromNearPlusOne); #endif } `;var mI=`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 pI=`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 Cb={czm_degreesPerRadian:Hv,czm_depthRange:Gv,czm_epsilon1:jv,czm_epsilon2:Wv,czm_epsilon3:qv,czm_epsilon4:Yv,czm_epsilon5:Xv,czm_epsilon6:Kv,czm_epsilon7:$v,czm_infinity:Zv,czm_oneOverPi:Qv,czm_oneOverTwoPi:Jv,czm_passCesium3DTile:eD,czm_passCesium3DTileClassification:tD,czm_passCesium3DTileClassificationIgnoreShow:nD,czm_passClassification:iD,czm_passCompute:oD,czm_passEnvironment:rD,czm_passGlobe:sD,czm_passOpaque:aD,czm_passOverlay:cD,czm_passTerrainClassification:lD,czm_passTranslucent:uD,czm_passVoxels:fD,czm_pi:dD,czm_piOverFour:hD,czm_piOverSix:mD,czm_piOverThree:pD,czm_piOverTwo:_D,czm_radiansPerDegree:gD,czm_sceneMode2D:yD,czm_sceneMode3D:bD,czm_sceneModeColumbusView:xD,czm_sceneModeMorphing:TD,czm_solarRadius:AD,czm_threePiOver2:CD,czm_twoPi:ED,czm_webMercatorMaxLatitude:SD,czm_depthRangeStruct:wD,czm_material:vD,czm_materialInput:DD,czm_modelMaterial:PD,czm_modelVertexOutput:ID,czm_ray:OD,czm_raySegment:RD,czm_shadowParameters:MD,czm_acesTonemapping:LD,czm_alphaWeight:ND,czm_antialias:FD,czm_applyHSBShift:BD,czm_approximateSphericalCoordinates:kD,czm_approximateTanh:UD,czm_backFacing:VD,czm_branchFreeTernary:zD,czm_cascadeColor:HD,czm_cascadeDistance:GD,czm_cascadeMatrix:jD,czm_cascadeWeights:WD,czm_clipPolygons:qD,czm_columbusViewMorph:YD,czm_computeAtmosphereColor:XD,czm_computeGroundAtmosphereScattering:KD,czm_computePosition:$D,czm_computeScattering:ZD,czm_cosineAndSine:QD,czm_decompressTextureCoordinates:JD,czm_depthClamp:eP,czm_eastNorthUpToEyeCoordinates:tP,czm_ellipsoidContainsPoint:nP,czm_ellipsoidTextureCoordinates:iP,czm_equalsEpsilon:oP,czm_eyeOffset:rP,czm_eyeToWindowCoordinates:sP,czm_fastApproximateAtan:aP,czm_fog:cP,czm_gammaCorrect:lP,czm_geodeticSurfaceNormal:uP,czm_getDefaultMaterial:fP,czm_getDynamicAtmosphereLightDirection:dP,czm_getLambertDiffuse:hP,czm_getSpecular:mP,czm_getWaterNoise:pP,czm_HSBToRGB:_P,czm_HSLToRGB:gP,czm_hue:yP,czm_inverseGamma:bP,czm_isEmpty:xP,czm_isFull:TP,czm_latitudeToWebMercatorFraction:AP,czm_linearToSrgb:CP,czm_lineDistance:EP,czm_luminance:SP,czm_maximumComponent:wP,czm_metersPerPixel:vP,czm_modelToWindowCoordinates:DP,czm_multiplyWithColorBalance:PP,czm_nearFarScalar:IP,czm_octDecode:OP,czm_packDepth:RP,czm_pbrLighting:MP,czm_pbrNeutralTonemapping:LP,czm_phong:NP,czm_planeDistance:FP,czm_pointAlongRay:BP,czm_rayEllipsoidIntersectionInterval:kP,czm_raySphereIntersectionInterval:UP,czm_readDepth:VP,czm_readNonPerspective:zP,czm_reverseLogDepth:HP,czm_RGBToHSB:GP,czm_RGBToHSL:jP,czm_RGBToXYZ:WP,czm_round:qP,czm_saturation:YP,czm_shadowDepthCompare:XP,czm_shadowVisibility:KP,czm_signNotZero:$P,czm_sphericalHarmonics:ZP,czm_srgbToLinear:QP,czm_tangentToEyeSpaceMatrix:JP,czm_textureCube:eI,czm_transformPlane:tI,czm_translateRelativeToEye:nI,czm_translucentPhong:iI,czm_transpose:oI,czm_unpackClippingExtents:rI,czm_unpackDepth:sI,czm_unpackFloat:aI,czm_unpackUint:cI,czm_valueTransform:lI,czm_vertexLogDepth:uI,czm_windowToEyeCoordinates:fI,czm_writeDepthClamp:dI,czm_writeLogDepth:hI,czm_writeNonPerspective:mI,czm_XYZToRGB:pI};function BIe(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 _I=BIe;function sne(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;o0;){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=0;--o)i=`${i+t[o].glslSource} `;return i.replace(n.glslSource,"")}function lne(e,t,n){let i,o,r="",s=e.sources;if(c(s))for(i=0,o=s.length;i-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Fd.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(c(o))return o.shaderProgram};Fd.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new He({sources:[r]})),typeof s=="string"&&(s=new He({sources:[s]}));let l=this._context,u=r.createCombinedVertexShader(l),f=s.createCombinedFragmentShader(l),h=new Jt({gl:l._gl,logShaderCompilation:l.logShaderCompilation,debugShaders:l.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:h,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),h._cachedShader=p,this._shaders[o]=p,h};function t6(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;out.maximumTextureSize)throw new E(`Width must be less than or equal to the maximum texture size (${ut.maximumTextureSize}). Check maximumTextureSize.`);if(T.typeOf.number.greaterThan("height",u,0),u>ut.maximumTextureSize)throw new E(`Height must be less than or equal to the maximum texture size (${ut.maximumTextureSize}). Check maximumTextureSize.`);if(!ke.validate(i))throw new E("Invalid options.pixelFormat.");if(!p&&!Ue.validate(o))throw new E("Invalid options.pixelDatatype.");if(i===ke.DEPTH_COMPONENT&&o!==Ue.UNSIGNED_SHORT&&o!==Ue.UNSIGNED_INT)throw new E("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(i===ke.DEPTH_STENCIL&&o!==Ue.UNSIGNED_INT_24_8)throw new E("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(o===Ue.FLOAT&&!t.floatingPointTexture)throw new E("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(o===Ue.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new E("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(ke.isDepthFormat(i)){if(c(n))throw new E("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!t.depthTexture)throw new E("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.")}if(p){if(!c(n)||!c(n.arrayBufferView))throw new E("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(ke.isDXTFormat(h)&&!t.s3tc)throw new E("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(ke.isPVRTCFormat(h)&&!t.pvrtc)throw new E("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(ke.isASTCFormat(h)&&!t.astc)throw new E("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(ke.isETC2Format(h)&&!t.etc)throw new E("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");if(ke.isETC1Format(h)&&!t.etc1)throw new E("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");if(ke.isBC7Format(h)&&!t.bc7)throw new E("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(ke.compressedTextureSizeInBytes(h,l,u)!==n.arrayBufferView.byteLength)throw new E("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}let g=t._gl,m=p?ke.compressedTextureSizeInBytes(i,l,u):ke.textureSizeInBytes(i,o,l,u);this._id=e.id??jn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=h,this._pixelFormat=i,this._pixelDatatype=o,this._width=l,this._height=u,this._dimensions=new H(l,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,pne(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),c(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),c(n.arrayBufferView)?ke.isCompressedFormat(h)?jIe(this,n):dne(this,n):c(n.framebuffer)?qIe(this,n):hne(this,n),this._initialized=!0):mne(this),g.bindTexture(this._textureTarget,null)}function jIe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),c(t.mipLevels)){let l=s,u=a;for(let f=0;fn.drawingBufferWidth)throw new E("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(r+a>n.drawingBufferHeight)throw new E("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new Bd({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:c(l)?l:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(Bd.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){pne(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 pne(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Yt.NEAREST_MIPMAP_NEAREST,Yt.NEAREST_MIPMAP_LINEAR,Yt.LINEAR_MIPMAP_NEAREST,Yt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===Ue.FLOAT&&!r.textureFloatLinear||a===Ue.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Yt.NEAREST_MIPMAP_NEAREST:Yt.NEAREST,i=li.NEAREST),r.webgl2&&ke.isDepthFormat(s)&&(n=Yt.NEAREST,i=li.NEAREST);let l=r._gl,u=e._textureTarget;l.activeTexture(l.TEXTURE0),l.bindTexture(u,e._texture),l.texParameteri(u,l.TEXTURE_MIN_FILTER,n),l.texParameteri(u,l.TEXTURE_MAG_FILTER,i),l.texParameteri(u,l.TEXTURE_WRAP_S,t.wrapS),l.texParameteri(u,l.TEXTURE_WRAP_T,t.wrapT),c(e._textureFilterAnisotropic)&&l.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),l.bindTexture(u,null)}Bd.prototype.copyFrom=function(e){T.defined("options",e);let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(T.defined("options.source",i),ke.isDepthFormat(this._pixelFormat))throw new E("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ke.isCompressedFormat(this._pixelFormat))throw new E("Cannot call copyFrom with a compressed texture pixel format.");T.typeOf.number.greaterThanOrEquals("xOffset",t,0),T.typeOf.number.greaterThanOrEquals("yOffset",n,0),T.typeOf.number.lessThanOrEquals("xOffset + options.source.width",t+i.width,this._width),T.typeOf.number.lessThanOrEquals("yOffset + options.source.height",n+i.height,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:l,height:u}=i;c(i.videoWidth)&&c(i.videoHeight)?(l=i.videoWidth,u=i.videoHeight):c(i.naturalWidth)&&c(i.naturalHeight)&&(l=i.naturalWidth,u=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&l===this._width&&u===this._height?(c(i.arrayBufferView)?dne(this,i):hne(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),mne(this)),this._initialized=!0),f||(c(i.arrayBufferView)?WIe(this,i.arrayBufferView,t,n,l,u):YIe(this,i,t,n)),s.bindTexture(a,null)};Bd.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){if(e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._width,r=r??this._height,ke.isDepthFormat(this._pixelFormat))throw new E("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===Ue.FLOAT)throw new E("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new E("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(ke.isCompressedFormat(this._pixelFormat))throw new E("Cannot call copyFrom with a compressed texture pixel format.");T.typeOf.number.greaterThanOrEquals("xOffset",e,0),T.typeOf.number.greaterThanOrEquals("yOffset",t,0),T.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),T.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),T.typeOf.number.lessThanOrEquals("xOffset + width",e+o,this._width),T.typeOf.number.lessThanOrEquals("yOffset + height",t+r,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};Bd.prototype.generateMipmap=function(e){if(e=e??Cf.DONT_CARE,ke.isDepthFormat(this._pixelFormat))throw new E("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ke.isCompressedFormat(this._pixelFormat))throw new E("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!O.isPowerOfTwo(this._width))throw new E("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!O.isPowerOfTwo(this._height))throw new E("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!Cf.validate(e))throw new E("hint is invalid.");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)};Bd.prototype.isDestroyed=function(){return!1};Bd.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),de(this)};var Rt=Bd;function Eb(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Eb.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Eb.prototype.getTexture=function(e){let t=this._textures[e];if(c(t))return delete this._texturesToRelease[e],++t.count,t.texture};Eb.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};Eb.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={}};Eb.prototype.isDestroyed=function(){return!1};Eb.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return de(this)};var yI=Eb;function Ef(e){this.planes=e??[]}var bI=[new d,new d,new d];d.clone(d.UNIT_X,bI[0]);d.clone(d.UNIT_Y,bI[1]);d.clone(d.UNIT_Z,bI[2]);var qg=new d,XIe=new d,_ne=new sn(new d(1,0,0),0);Ef.fromBoundingSphere=function(e,t){if(!c(e))throw new E("boundingSphere is required.");c(t)||(t=new Ef);let n=bI.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;ae.right)throw new E("right must be greater than left.");if(e.bottom>e.top)throw new E("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new E("near must be greater than zero and less than 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=B.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(mm.prototype,{projectionMatrix:{get:function(){return gne(this),this._orthographicMatrix}}});var KIe=new d,$Ie=new d,ZIe=new d,n6=new d;mm.prototype.computeCullingVolume=function(e,t,n){if(!c(e))throw new E("position is required.");if(!c(t))throw new E("direction is required.");if(!c(n))throw new E("up is required.");let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,l=this.near,u=this.far,f=d.cross(t,n,KIe);d.normalize(f,f);let h=$Ie;d.multiplyByScalar(t,l,h),d.add(e,h,h);let p=ZIe;d.multiplyByScalar(f,a,p),d.add(h,p,p);let g=i[0];return c(g)||(g=i[0]=new se),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-d.dot(f,p),d.multiplyByScalar(f,s,p),d.add(h,p,p),g=i[1],c(g)||(g=i[1]=new se),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-d.dot(d.negate(f,n6),p),d.multiplyByScalar(n,r,p),d.add(h,p,p),g=i[2],c(g)||(g=i[2]=new se),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-d.dot(n,p),d.multiplyByScalar(n,o,p),d.add(h,p,p),g=i[3],c(g)||(g=i[3]=new se),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-d.dot(d.negate(n,n6),p),g=i[4],c(g)||(g=i[4]=new se),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-d.dot(t,h),d.multiplyByScalar(t,u,p),d.add(e,p,p),g=i[5],c(g)||(g=i[5]=new se),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-d.dot(d.negate(t,n6),p),this._cullingVolume};mm.prototype.getPixelDimensions=function(e,t,n,i,o){if(gne(this),!c(e)||!c(t))throw new E("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new E("drawingBufferWidth must be greater than zero.");if(t<=0)throw new E("drawingBufferHeight must be greater than zero.");if(!c(n))throw new E("distance is required.");if(!c(i))throw new E("pixelRatio is required.");if(i<=0)throw new E("pixelRatio must be greater than zero.");if(!c(o))throw new E("A result object is required.");let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,l=i*s/t;return o.x=a,o.y=l,o};mm.prototype.clone=function(e){return c(e)||(e=new mm),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};mm.prototype.equals=function(e){return c(e)&&e instanceof mm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};mm.prototype.equalsEpsilon=function(e,t,n){return e===this||c(e)&&e instanceof mm&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var jo=mm;function Ol(e){e=e??W.EMPTY_OBJECT,this._offCenterFrustum=new jo,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}Ol.packedLength=4;Ol.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};Ol.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Ol),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Yg(e){if(!c(e.width)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new E("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new E("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new E("near must be greater than zero and less than 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(Ol.prototype,{projectionMatrix:{get:function(){return Yg(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Yg(this),this._offCenterFrustum}}});Ol.prototype.computeCullingVolume=function(e,t,n){return Yg(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Ol.prototype.getPixelDimensions=function(e,t,n,i,o){return Yg(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Ol.prototype.clone=function(e){return c(e)||(e=new Ol),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};Ol.prototype.equals=function(e){return!c(e)||!(e instanceof Ol)?!1:(Yg(this),Yg(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Ol.prototype.equalsEpsilon=function(e,t,n){return!c(e)||!(e instanceof Ol)?!1:(Yg(this),Yg(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var on=Ol;var i6={};function QIe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var JIe=32.184,eOe=2451545;function Bne(e,t){t=Q.addSeconds(e,JIe,t);let n=Q.totalDays(t)-eOe;return t=Q.addSeconds(t,QIe(n),t),t}var SV=new Q(2451545,0,Wn.TAI),tOe=1e3,Sf=O.RADIANS_PER_DEGREE,pu=O.RADIANS_PER_ARCSECOND,Na=14959787e4,yne=new J;function kne(e,t,n,i,o,r,s){if(n<0&&(n=-n,o+=O.PI),n<0||n>O.PI)throw new E("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");let a=e*(1-t),l=i-o,u=o,f=iOe(r-i,t);if(nOe(t,0)==="Hyperbolic"&&Math.abs(O.negativePiToPi(f))>=Math.acos(-1/t))throw new E("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");aOe(l,n,u,yne);let p=a*(1+t),g=Math.cos(f),m=Math.sin(f),y=1+t*g;if(y<=O.Epsilon10)throw new E("elements cannot be converted to cartesian");let b=p/y;return c(s)?(s.x=b*g,s.y=b*m,s.z=0):s=new d(b*g,b*m,0),J.multiplyByVector(yne,s,s)}function nOe(e,t){if(e<0)throw new E("eccentricity cannot be negative.");return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function iOe(e,t){if(t<0||t>=1)throw new E("eccentricity out of range.");let n=rOe(e,t);return sOe(n,t)}var bne=50,oOe=O.EPSILON8;function rOe(e,t){if(t<0||t>=1)throw new E("eccentricity out of range.");let n=Math.floor(e/O.TWO_PI);e-=n*O.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;roOe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}if(r>=bne)throw new E("Kepler equation did not converge");return o=i+n*O.TWO_PI,o}function sOe(e,t){if(t<0||t>=1)throw new E("eccentricity out of range.");let n=Math.floor(e/O.TWO_PI);e-=n*O.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=O.zeroToTwoPi(r),e<0&&(r-=O.TWO_PI),r+=n*O.TWO_PI,r}function aOe(e,t,n,i){if(t<0||t>O.PI)throw new E("inclination out of range");let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),l=Math.cos(n),u=Math.sin(n);return c(i)?(i[0]=l*o-u*r*s,i[1]=u*o+l*r*s,i[2]=r*a,i[3]=-l*r-u*o*s,i[4]=-u*r+l*o*s,i[5]=o*a,i[6]=u*a,i[7]=-l*a,i[8]=s):i=new J(l*o-u*r*s,-l*r-u*o*s,u*a,u*o+l*r*s,-u*r+l*o*s,-l*a,r*a,o*a,s),i}var cOe=1.0000010178*Na,lOe=100.46645683*Sf,uOe=129597742283429e-5*pu,xne=16002,Tne=21863,Ane=32004,Cne=10931,Ene=14529,Sne=16368,wne=15318,vne=32794,fOe=64*1e-7*Na,dOe=-152*1e-7*Na,hOe=62*1e-7*Na,mOe=-8*1e-7*Na,pOe=32*1e-7*Na,_Oe=-41*1e-7*Na,gOe=19*1e-7*Na,yOe=-11*1e-7*Na,bOe=-150*1e-7*Na,xOe=-46*1e-7*Na,TOe=68*1e-7*Na,AOe=54*1e-7*Na,COe=14*1e-7*Na,EOe=24*1e-7*Na,SOe=-28*1e-7*Na,wOe=22*1e-7*Na,Dne=10,Pne=16002,Ine=21863,One=10931,Rne=1473,Mne=32004,Lne=4387,Nne=73,vOe=-325*1e-7,DOe=-322*1e-7,POe=-79*1e-7,IOe=232*1e-7,OOe=-52*1e-7,ROe=97*1e-7,MOe=55*1e-7,LOe=-41*1e-7,NOe=-105*1e-7,FOe=-137*1e-7,BOe=258*1e-7,kOe=35*1e-7,UOe=-116*1e-7,VOe=-88*1e-7,zOe=-112*1e-7,HOe=-80*1e-7,hC=new Q(0,0,Wn.TAI);function GOe(e,t){Bne(e,hC);let i=(hC.dayNumber-SV.dayNumber+(hC.secondsOfDay-SV.secondsOfDay)/qn.SECONDS_PER_DAY)/(qn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=cOe+fOe*Math.cos(xne*o)+bOe*Math.sin(xne*o)+dOe*Math.cos(Tne*o)+xOe*Math.sin(Tne*o)+hOe*Math.cos(Ane*o)+TOe*Math.sin(Ane*o)+mOe*Math.cos(Cne*o)+AOe*Math.sin(Cne*o)+pOe*Math.cos(Ene*o)+COe*Math.sin(Ene*o)+_Oe*Math.cos(Sne*o)+EOe*Math.sin(Sne*o)+gOe*Math.cos(wne*o)+SOe*Math.sin(wne*o)+yOe*Math.cos(vne*o)+wOe*Math.sin(vne*o),s=lOe+uOe*i+vOe*Math.cos(Dne*o)+NOe*Math.sin(Dne*o)+DOe*Math.cos(Pne*o)+FOe*Math.sin(Pne*o)+POe*Math.cos(Ine*o)+BOe*Math.sin(Ine*o)+IOe*Math.cos(One*o)+kOe*Math.sin(One*o)+OOe*Math.cos(Rne*o)+UOe*Math.sin(Rne*o)+ROe*Math.cos(Mne*o)+VOe*Math.sin(Mne*o)+MOe*Math.cos(Lne*o)+zOe*Math.sin(Lne*o)+LOe*Math.cos(Nne*o)+HOe*Math.sin(Nne*o),a=.0167086342-.0004203654*i,l=102.93734808*Sf+11612.3529*pu*i,u=469.97289*pu*i,f=174.87317577*Sf-8679.27034*pu*i;return kne(r,a,u,l,f,s,t)}function Une(e,t){Bne(e,hC);let i=(hC.dayNumber-SV.dayNumber+(hC.secondsOfDay-SV.secondsOfDay)/qn.SECONDS_PER_DAY)/qn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,l=.055545526-16e-9*i,u=5.15668983*Sf,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,h=83.35324312*Sf,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*Sf,m=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,y=218.31664563*Sf,b=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,x=297.85019547*Sf+pu*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),A=93.27209062*Sf+pu*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),C=134.96340251*Sf+pu*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),S=357.52910918*Sf+pu*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),v=310.17137918*Sf-pu*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),P=2*x,M=4*x,R=6*x,L=2*C,F=3*C,_=4*C,w=2*A;a+=3400.4*Math.cos(P)-635.6*Math.cos(P-C)-235.6*Math.cos(C)+218.1*Math.cos(P-S)+181*Math.cos(P+C),l+=.014216*Math.cos(P-C)+.008551*Math.cos(P-L)-.001383*Math.cos(C)+.001356*Math.cos(P+C)-.001147*Math.cos(M-F)-914e-6*Math.cos(M-L)+869e-6*Math.cos(P-S-C)-627e-6*Math.cos(P)-394e-6*Math.cos(M-_)+282e-6*Math.cos(P-S-L)-279e-6*Math.cos(x-C)-236e-6*Math.cos(L)+231e-6*Math.cos(M)+229e-6*Math.cos(R-_)-201e-6*Math.cos(L-w),f+=486.26*Math.cos(P-w)-40.13*Math.cos(P)+37.51*Math.cos(w)+25.73*Math.cos(L-w)+19.97*Math.cos(P-S-w),p+=-55609*Math.sin(P-C)-34711*Math.sin(P-L)-9792*Math.sin(C)+9385*Math.sin(M-F)+7505*Math.sin(M-L)+5318*Math.sin(P+C)+3484*Math.sin(M-_)-3417*Math.sin(P-S-C)-2530*Math.sin(R-_)-2376*Math.sin(P)-2075*Math.sin(P-F)-1883*Math.sin(L)-1736*Math.sin(R-5*C)+1626*Math.sin(S)-1370*Math.sin(R-F),m+=-5392*Math.sin(P-w)-540*Math.sin(S)-441*Math.sin(P)+423*Math.sin(w)-288*Math.sin(L-w),b+=-3332.9*Math.sin(P)+1197.4*Math.sin(P-C)-662.5*Math.sin(S)+396.3*Math.sin(C)-218*Math.sin(P-S);let D=2*v,I=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(P-w+v)*i+.614*Math.cos(P-w-v)*i-.0297*Math.cos(D)*o-.0335*Math.cos(v)*o+.0012*Math.cos(P-w+D)*o-16e-5*Math.cos(v)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(D)*r;let N=2.116*Math.sin(v)*i-.111*Math.sin(P-w-v)*i-.0015*Math.sin(v)*o;p+=N,b+=N,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(P-w+v)*i+1.12*Math.sin(P-v)*i-1.06*Math.sin(w-v)*i+.66*Math.sin(D)*o+.371*Math.sin(v)*o-.035*Math.sin(P-w+D)*o-.015*Math.sin(P-w+v)*o+.0014*Math.sin(v)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(D)*r,a*=tOe;let k=u+f*pu,z=h+p*pu,V=y+b*pu,j=g+m*pu;return kne(a,l,k,z,j,V,t)}var Fne=.012300034,jOe=Fne/(Fne+1)*-1;function WOe(e,t){return t=Une(e,t),d.multiplyByScalar(t,jOe,t)}var Vne=new J(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),xI=new d;i6.computeSunPositionInEarthInertialFrame=function(e,t){return c(e)||(e=Q.now()),c(t)||(t=new d),xI=GOe(e,xI),t=d.negate(xI,t),WOe(e,xI),d.subtract(t,xI,t),J.multiplyByVector(Vne,t,t),t};i6.computeMoonPositionInEarthInertialFrame=function(e,t){return c(e)||(e=Q.now()),t=Une(e,t),J.multiplyByVector(Vne,t,t),t};var Xg=i6;var wV={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};wV.getMorphTime=function(e){return e===wV.SCENE3D?1:e===wV.MORPHING?void 0:0};var oe=Object.freeze(wV);function qOe(e){e=e??W.EMPTY_OBJECT,this.color=G.clone(e.color??G.WHITE),this.intensity=e.intensity??2}var Rp=qOe;function mC(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Ke,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=B.clone(B.IDENTITY),this._viewportTransformation=B.clone(B.IDENTITY),this._model=B.clone(B.IDENTITY),this._view=B.clone(B.IDENTITY),this._inverseView=B.clone(B.IDENTITY),this._projection=B.clone(B.IDENTITY),this._infiniteProjection=B.clone(B.IDENTITY),this._entireFrustum=new H,this._currentFrustum=new H,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=J.clone(B.IDENTITY),this._view3DDirty=!0,this._view3D=new B,this._inverseView3DDirty=!0,this._inverseView3D=new B,this._inverseModelDirty=!0,this._inverseModel=new B,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 B,this._modelViewDirty=!0,this._modelView=new B,this._modelView3DDirty=!0,this._modelView3D=new B,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new B,this._inverseModelViewDirty=!0,this._inverseModelView=new B,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new B,this._viewProjectionDirty=!0,this._viewProjection=new B,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new B,this._modelViewProjectionDirty=!0,this._modelViewProjection=new B,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new B,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new B,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new B,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 Hn,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 H,this._eyeEllipsoidNormalEC=new d,this._eyeEllipsoidCurvature=new H,this._modelToEnu=new B,this._enuToModel=new B,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new G,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(mC.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Ke.equals(e,this._viewport)){Ke.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Hne(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Hne(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){B.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,B.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,B.getMatrix3(this.inverseModel,e),J.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return r6(this),this._view3D}},viewRotation:{get:function(){return r6(this),this._viewRotation}},viewRotation3D:{get:function(){return r6(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Wne(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Wne(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return i1e(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return o1e(this),this._modelView}},modelView3D:{get:function(){return r1e(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return f1e(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return s1e(this),this._inverseModelView}},inverseModelView3D:{get:function(){return a1e(this),this._inverseModelView3D}},viewProjection:{get:function(){return c1e(this),this._viewProjection}},inverseViewProjection:{get:function(){return l1e(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return u1e(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return d1e(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return h1e(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return m1e(this),this._modelViewInfiniteProjection}},normal:{get:function(){return p1e(this),this._normal}},normal3D:{get:function(){return _1e(this),this._normal3D}},inverseNormal:{get:function(){return g1e(this),this._inverseNormal}},inverseNormal3D:{get:function(){return y1e(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 jne(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return jne(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??ie.default}}});function YOe(e,t){B.clone(t,e._view),B.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 XOe(e,t){B.clone(t,e._inverseView),B.getMatrix3(t,e._inverseViewRotation)}function KOe(e,t){B.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function $Oe(e,t){B.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var zne=new d,ZOe=new B;function QOe(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(c(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=d.fromRadians(o.longitude,o.latitude,0,n,zne)):(e._eyeHeight=-n.maximumRadius,d.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=d.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,zne)),e._encodedCameraPositionMCDirty=!0,!c(i))return;e._eyeEllipsoidNormalEC=J.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Ot.eastNorthUpToFixedFrame(i,n,ZOe);e._enuToModel=B.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=B.inverseTransformation(e._enuToModel,e._modelToEnu),O.equalsEpsilon(n._radii.x,n._radii.y,O.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var o6=new J,JOe=new he;function e1e(e,t){Ot.computeIcrfToCentralBodyFixedMatrix(t.time,o6);let n=Xg.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);J.multiplyByVector(o6,n,n),d.normalize(n,e._sunDirectionWC),n=J.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),d.normalize(n,n),n=Xg.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),J.multiplyByVector(o6,n,n),J.multiplyByVector(e.viewRotation3D,n,n),d.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,JOe);i.project(r,e._sunPositionColumbusView)}mC.prototype.updateCamera=function(e){YOe(this,e.viewMatrix),XOe(this,e.inverseViewMatrix),QOe(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 on};mC.prototype.updateFrustum=function(e){KOe(this,e.projectionMatrix),c(e.infiniteProjectionMatrix)&&$Oe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=O.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;c(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};mC.prototype.updatePass=function(e){this._pass=e};var t1e=[],n1e=new Rp;mC.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),e1e(this,e);let n=e.light??n1e;n instanceof Rp?(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 s=e.brdfLutGenerator,a=c(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??t1e,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let l=e.atmosphere;c(l)&&(this._atmosphereHsbShift=d.fromElements(l.hueShift,l.saturationShift,l.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=l.lightIntensity,this._atmosphereRayleighCoefficient=d.clone(l.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=l.rayleighScaleHeight,this._atmosphereMieCoefficient=d.clone(l.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=l.mieScaleHeight,this._atmosphereMieAnisotropy=l.mieAnisotropy,this._atmosphereDynamicLighting=l.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Ot.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,h;c(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,G.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Hne(e){if(e._viewportDirty){let t=e._viewport;B.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),B.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function i1e(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?B.inverse(e._projection,e._inverseProjection):B.clone(B.ZERO,e._inverseProjection))}function o1e(e){e._modelViewDirty&&(e._modelViewDirty=!1,B.multiplyTransformation(e._view,e._model,e._modelView))}function r1e(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,B.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function s1e(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,B.inverse(e.modelView,e._inverseModelView))}function a1e(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,B.inverse(e.modelView3D,e._inverseModelView3D))}function c1e(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,B.multiply(e._projection,e._view,e._viewProjection))}function l1e(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,B.inverse(e.viewProjection,e._inverseViewProjection))}function u1e(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,B.multiply(e._projection,e.modelView,e._modelViewProjection))}function f1e(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 d1e(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,B.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function h1e(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,B.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function m1e(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,B.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function p1e(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;B.getMatrix3(e.inverseModelView,t),J.transpose(t,t)}}function _1e(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;B.getMatrix3(e.inverseModelView3D,t),J.transpose(t,t)}}function g1e(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;B.getMatrix3(e.modelView,t),J.transpose(t,t)}}function y1e(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;B.getMatrix3(e.modelView3D,t),J.transpose(t,t)}}var Gne=new d;function jne(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,B.multiplyByPoint(e.inverseModel,e._cameraPosition,Gne),Hn.fromCartesian(Gne,e._encodedCameraPositionMC))}var b1e=new d,x1e=new d,T1e=new d,A1e=new d,C1e=new he,E1e=new d,S1e=new B;function w1e(e,t,n,i,o,r,s,a){let l=b1e;l.x=e.y,l.y=e.z,l.z=e.x;let u=x1e;u.x=n.y,u.y=n.z,u.z=n.x;let f=T1e;f.x=i.y,f.y=i.z,f.z=i.x;let h=A1e;h.x=t.y,h.y=t.z,h.z=t.x,r===oe.SCENE2D&&(l.z=o*.5);let p=s.unproject(l,C1e);p.longitude=O.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=O.clamp(p.latitude,-O.PI_OVER_TWO,O.PI_OVER_TWO);let g=s.ellipsoid,m=g.cartographicToCartesian(p,E1e),y=Ot.eastNorthUpToFixedFrame(m,g,S1e);return B.multiplyByPointAsVector(y,u,u),B.multiplyByPointAsVector(y,f,f),B.multiplyByPointAsVector(y,h,h),c(a)||(a=new B),a[0]=u.x,a[1]=f.x,a[2]=-h.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-h.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-h.z,a[11]=0,a[12]=-d.dot(u,m),a[13]=-d.dot(f,m),a[14]=d.dot(h,m),a[15]=1,a}function r6(e){e._view3DDirty&&(e._mode===oe.SCENE3D?B.clone(e._view,e._view3D):w1e(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),B.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Wne(e){e._inverseView3DDirty&&(B.inverseTransformation(e.view3D,e._inverseView3D),B.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var TI=mC;function wf(e,t){T.defined("canvas",e);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 s=c(n)?n(e,o):v1e(e,o,i),l=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=l,this._id=jn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new gI(this),this._textureCache=new yI;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),ut._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),ut._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),ut._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),ut._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),ut._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),ut._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),ut._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),ut._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),ut._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),ut._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),ut._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);ut._minimumAliasedLineWidth=f[0],ut._maximumAliasedLineWidth=f[1];let h=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);ut._minimumAliasedPointSize=h[0],ut._maximumAliasedPointSize=h[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);ut._maximumViewportWidth=p[0],ut._maximumViewportHeight=p[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);ut._highpFloatSupported=g.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);ut._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!wr(u,["OES_standard_derivatives"]),this._blendMinmax=!!wr(u,["EXT_blend_minmax"]),this._elementIndexUint=!!wr(u,["OES_element_index_uint"]),this._depthTexture=!!wr(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!wr(u,["EXT_frag_depth"]),this._debugShaders=wr(u,["WEBGL_debug_shaders"]),this._textureFloat=!!wr(u,["OES_texture_float"]),this._textureHalfFloat=!!wr(u,["OES_texture_half_float"]),this._textureFloatLinear=!!wr(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!wr(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!wr(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!wr(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!wr(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!wr(u,["EXT_color_buffer_half_float"]),this._s3tc=!!wr(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!wr(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!wr(u,["WEBGL_compressed_texture_astc"]),this._etc=!!wr(u,["WEBG_compressed_texture_etc"]),this._etc1=!!wr(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!wr(u,["EXT_texture_compression_bptc"]),Il.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let y=r?wr(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=y,ut._maximumTextureFilterAnisotropy=c(y)?u.getParameter(y.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,x,A,C,S,v,P,M,R,L;if(l){let D=this;b=function(){return D._gl.createVertexArray()},x=function(I){D._gl.bindVertexArray(I)},A=function(I){D._gl.deleteVertexArray(I)},C=function(I,N,k,z,V){u.drawElementsInstanced(I,N,k,z,V)},S=function(I,N,k,z){u.drawArraysInstanced(I,N,k,z)},v=function(I,N){u.vertexAttribDivisor(I,N)},P=function(I){u.drawBuffers(I)}}else M=wr(u,["OES_vertex_array_object"]),c(M)&&(b=function(){return M.createVertexArrayOES()},x=function(D){M.bindVertexArrayOES(D)},A=function(D){M.deleteVertexArrayOES(D)}),R=wr(u,["ANGLE_instanced_arrays"]),c(R)&&(C=function(D,I,N,k,z){R.drawElementsInstancedANGLE(D,I,N,k,z)},S=function(D,I,N,k){R.drawArraysInstancedANGLE(D,I,N,k)},v=function(D,I){R.vertexAttribDivisorANGLE(D,I)}),L=wr(u,["WEBGL_draw_buffers"]),c(L)&&(P=function(D){L.drawBuffersWEBGL(D)});this.glCreateVertexArray=b,this.glBindVertexArray=x,this.glDeleteVertexArray=A,this.glDrawElementsInstanced=C,this.glDrawArraysInstanced=S,this.glVertexAttribDivisor=v,this.glDrawBuffers=P,this._vertexArrayObject=!!M,this._instancedArrays=!!R,this._drawBuffers=!!L,ut._maximumDrawBuffers=this.drawBuffers?u.getParameter(ne.MAX_DRAW_BUFFERS):1,ut._maximumColorAttachments=this.drawBuffers?u.getParameter(ne.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new G(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let F=new TI,_=new lc(this),w=Ve.fromCache();this._defaultPassState=_,this._defaultRenderState=w,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=F,this._currentRenderState=w,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let D=0;D"u")throw new ae("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(!c(r))throw new ae("The browser supports WebGL, but initialization failed.");return r}function D1e(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 P1e(e,t,n,i){let o=`${D1e(e,i)}: ${t.name}(`;for(let r=0;r=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=R1e(this._originalGLContext,e?I1e:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Rt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,0])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Rt({context:this,pixelFormat:ke.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 Rt({context:this,pixelFormat:ke.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 Go({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 M1e}}});function L1e(e){if(e.validateFramebuffer){let t=e._gl,n=t.checkFramebufferStatus(t.FRAMEBUFFER);if(n!==t.FRAMEBUFFER_COMPLETE){let i;switch(n){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:i="Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:i="Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:i="Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:i="Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions.";break}throw new E(i)}}}function qne(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 s6;typeof WebGLRenderingContext<"u"&&(s6=[ne.BACK]);function a6(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=s6;if(c(t))t._bind(),L1e(e),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var N1e=new ei;wf.prototype.clear=function(e,t){e=e??N1e,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;c(o)&&(G.equals(this._clearColor,o)||(G.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),c(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),c(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;qne(this,a,t,!0);let l=e.framebuffer??t.framebuffer;a6(this,l),n.clear(i)};function F1e(e,t,n,i,o){if(c(t)&&o.depthTest&&o.depthTest.enabled&&!t.hasDepthAttachment)throw new E("The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer.");a6(e,t),qne(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function B1e(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,l=t.instanceCount;if(!Me.validate(o))throw new E("drawCommand.primitiveType is required and must be valid.");if(T.defined("drawCommand.vertexArray",r),T.typeOf.number.greaterThanOrEquals("drawCommand.offset",s,0),c(a)&&T.typeOf.number.greaterThanOrEquals("drawCommand.count",a,0),T.typeOf.number.greaterThanOrEquals("drawCommand.instanceCount",l,0),l>0&&!e.instancedArrays)throw new E("Instanced arrays extension is not supported");e._us.model=t._modelMatrix??B.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;c(u)?(s=s*u.bytesPerIndex,c(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,l===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,l)):(c(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,l===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,l)),r._unBind()}wf.prototype.draw=function(e,t,n,i){T.defined("drawCommand",e),T.defined("drawCommand.shaderProgram",e._shaderProgram),t=t??this._defaultPassState;let o=e._framebuffer??t.framebuffer,r=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,F1e(this,o,t,n,r),B1e(this,e,n,i)};wf.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=s6;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i0&&(a=s.getColorTexture(0).pixelDatatype);let l=ke.createTypedArray(ke.RGBA,a,o,r);return a6(this,s),t.readPixels(n,i,o,r,ke.RGBA,Ue.toWebGLConstant(a,this),l),l};var Yne={position:0,textureCoordinates:1};wf.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!c(e)){let t=new ct({attributes:{position:new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Me.TRIANGLES});e=ti.fromGeometry({context:this,geometry:t,attributeLocations:Yne,bufferUsage:Be.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};wf.prototype.createViewportQuadCommand=function(e,t){return t=t??W.EMPTY_OBJECT,new Qe({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Me.TRIANGLES,renderState:t.renderState,shaderProgram:Jt.fromCache({context:this,vertexShaderSource:mb,fragmentShaderSource:e,attributeLocations:Yne}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};wf.prototype.getObjectByPickColor=function(e){return T.defined("pickColor",e),this._pickObjects[e.toRgba()]};function c6(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(c6.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});c6.prototype.destroy=function(){delete this._pickObjects[this.key]};wf.prototype.createPickId=function(e){T.defined("object",e),++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new ae("Out of unique Pick IDs.");return this._pickObjects[t]=e,new c6(this._pickObjects,t,G.fromRgba(t))};wf.prototype.isDestroyed=function(){return!1};wf.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];c(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(),de(this)};var AI=wf;function pC(e){e=e??W.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:l}=e;if(T.defined("options.context",t),T.defined("options.width",n),T.defined("options.height",i),this._width=n,this._height=i,c(o)!==c(r))throw new E("Both color renderbuffer and texture attachments must be provided.");if(c(s)!==c(a))throw new E("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Ur({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:l}),this._colorFramebuffer=new Ur({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:l})}pC.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};pC.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};pC.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),c(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};pC.prototype.isDestroyed=function(){return!1};pC.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),de(this)};var CI=pC;var Rl={RGBA4:ne.RGBA4,RGBA8:ne.RGBA8,RGBA16F:ne.RGBA16F,RGBA32F:ne.RGBA32F,RGB5_A1:ne.RGB5_A1,RGB565:ne.RGB565,DEPTH_COMPONENT16:ne.DEPTH_COMPONENT16,STENCIL_INDEX8:ne.STENCIL_INDEX8,DEPTH_STENCIL:ne.DEPTH_STENCIL,DEPTH24_STENCIL8:ne.DEPTH24_STENCIL8,validate:function(e){return e===Rl.RGBA4||e===Rl.RGBA8||e===Rl.RGBA16F||e===Rl.RGBA32F||e===Rl.RGB5_A1||e===Rl.RGB565||e===Rl.DEPTH_COMPONENT16||e===Rl.STENCIL_INDEX8||e===Rl.DEPTH_STENCIL||e===Rl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ne.FLOAT?Rl.RGBA32F:e===ne.HALF_FLOAT_OES?Rl.RGBA16F:Rl.RGBA8}},uc=Object.freeze(Rl);function EI(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let n=e.context._gl,i=ut.maximumRenderbufferSize,o=e.format??uc.RGBA4,r=c(e.width)?e.width:n.drawingBufferWidth,s=c(e.height)?e.height:n.drawingBufferHeight,a=e.numSamples??1;if(!uc.validate(o))throw new E("Invalid format.");if(T.typeOf.number.greaterThan("width",r,0),r>i)throw new E(`Width must be less than or equal to the maximum renderbuffer size (${i}). Check maximumRenderbufferSize.`);if(T.typeOf.number.greaterThan("height",s,0),s>i)throw new E(`Height must be less than or equal to the maximum renderbuffer size (${i}). Check maximumRenderbufferSize.`);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(EI.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});EI.prototype._getRenderbuffer=function(){return this._renderbuffer};EI.prototype.isDestroyed=function(){return!1};EI.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),de(this)};var _u=EI;function Ss(e){if(e=e??W.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._color&&!this._depth&&!this._depthStencil)throw new E("Must enable at least one type of framebuffer attachment.");if(this._depth&&this._depthStencil)throw new E("Cannot have both a depth and depth-stencil attachment.");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(Ss.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}}});Ss.prototype.isDirty=function(e,t,n,i,o){n=n??1;let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=c(i)&&this._pixelDatatype!==i||c(o)&&this._pixelFormat!==o,l=n===1?c(this._framebuffer):c(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!l||this._color&&!c(this._colorTextures[0])};Ss.prototype.update=function(e,t,n,i,o,r){if(!c(t)||!c(n))throw new E("width and height must be defined.");if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??Ue.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??ke.RGBA:void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s1){let a=uc.getColorFormat(o);this._colorRenderbuffers[s]=new _u({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Rt({context:e,width:t,height:n,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Qt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new _u({context:e,width:t,height:n,format:uc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new _u({context:e,width:t,height:n,format:uc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Rt({context:e,width:t,height:n,pixelFormat:ke.DEPTH_COMPONENT,pixelDatatype:Ue.UNSIGNED_INT,sampler:Qt.NEAREST}):this._depthRenderbuffer=new _u({context:e,width:t,height:n,format:uc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new CI({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 Ur({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Ss.prototype.getColorTexture=function(e){if(e=e??0,e>=this._colorAttachmentsLength)throw new E("index must be smaller than total number of color attachments.");return this._colorTextures[e]};Ss.prototype.setColorTexture=function(e,t){if(t=t??0,this._createColorAttachments)throw new E("createColorAttachments must be false if setColorTexture is called.");if(t>=this._colorAttachmentsLength)throw new E("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Ss.prototype.getColorRenderbuffer=function(e){if(e=e??0,e>=this._colorAttachmentsLength)throw new E("index must be smaller than total number of color attachments.");return this._colorRenderbuffers[e]};Ss.prototype.setColorRenderbuffer=function(e,t){if(t=t??0,this._createColorAttachments)throw new E("createColorAttachments must be false if setColorRenderbuffer is called.");if(t>=this._colorAttachmentsLength)throw new E("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Ss.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Ss.prototype.setDepthRenderbuffer=function(e){if(this._createDepthAttachments)throw new E("createDepthAttachments must be false if setDepthRenderbuffer is called.");this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Ss.prototype.getDepthTexture=function(){return this._depthTexture};Ss.prototype.setDepthTexture=function(e){if(this._createDepthAttachments)throw new E("createDepthAttachments must be false if setDepthTexture is called.");this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Ss.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Ss.prototype.setDepthStencilRenderbuffer=function(e){if(this._createDepthAttachments)throw new E("createDepthAttachments must be false if setDepthStencilRenderbuffer is called.");this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Ss.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Ss.prototype.setDepthStencilTexture=function(e){if(this._createDepthAttachments)throw new E("createDepthAttachments must be false if setDepthStencilTexture is called.");this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};Ss.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};Ss.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};Ss.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};Ss.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n!c(t[r])))throw new E("urls must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[we.createIfNeeded(t.positiveX).fetchImage(i),we.createIfNeeded(t.negativeX).fetchImage(i),we.createIfNeeded(t.positiveY).fetchImage(i),we.createIfNeeded(t.negativeY).fetchImage(i),we.createIfNeeded(t.positiveZ).fetchImage(i),we.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Go({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var SI=k1e;var Sb={VERTEX:0,FRAGMENT:1,BOTH:2};Sb.includesVertexShader=function(e){return T.typeOf.number("destination",e),e===Sb.VERTEX||e===Sb.BOTH};Sb.includesFragmentShader=function(e){return T.typeOf.number("destination",e),e===Sb.FRAGMENT||e===Sb.BOTH};var ge=Object.freeze(Sb);function l6(e){this.name=e,this.fields=[]}l6.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};l6.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var wI=l6;function u6(e){this.signature=e,this.body=[]}u6.prototype.addLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new E(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;ia?(e.childNode1=new DI({x:i.x,y:i.y,width:t,height:r}),e.childNode2=new DI({x:i.x+t,y:i.y,width:s,height:r}),this._findNode(e.childNode1,{width:t,height:n})):(e.childNode1=new DI({x:i.x,y:i.y,width:o,height:n}),e.childNode2=new DI({x:i.x,y:i.y+n,width:o,height:a}),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 _C=f6;var Xne=16;function Ml(e){e=e??W.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new H(Xne,Xne);T.typeOf.number.greaterThanOrEquals("options.borderWidthInPixels",t,0),T.typeOf.number.greaterThan("options.initialSize.x",n.x,0),T.typeOf.number.greaterThan("options.initialSize.y",n.y,0),this._pixelFormat=e.pixelFormat??ke.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(Ml.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 c(this._texture)?this._texture.sizeInBytes:0}}});Ml.prototype.computeTextureCoordinates=function(e,t){T.typeOf.number.greaterThanOrEquals("index",e,0);let n=this._texture,i=this._rectangles[e];if(c(t)||(t=new Ke),!c(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let o=n.width,r=n.height,s=i.width,a=i.height,l=i.x,u=i.y,f=this._subRegions.get(e);if(c(f)){let h=this._rectangles[f];l+=h.x,u+=h.y}return t.x=l/o,t.y=u/r,t.width=s/o,t.height=a/r,t};Ml.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new Rt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,l=s._textureTarget,u=this._texture,f=new Ur({context:e,colorTextures:[u],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(l,s._texture),f._bind();let h=this.rectangles,p=this._subRegions;for(let g=0;gnew Kne({index:C,image:A})).filter((A,C)=>c(A.image)&&!c(l.get(C))),f=0,h=0,p=0;for(let A=t;A=1;)m*=2,s>a?a*=m:s*=m;u.sort(({image:A},{image:C})=>C.height*C.width-A.height*A.width);let y=new Array(this._nextIndex);for(let A of this._subRegions.keys())c(l.get(A))&&(y[A]=i[A]);let b,x=!1;for(;!x;){b=new _C({height:a,width:s,borderPadding:n});let A;for(A=0;Aa?a*=2:s*=2;break}y[C]=v.rectangle}x=A===u.length}this._texturePacker=b,this._texture=this._copyFromTexture(e,s,a,y),r.destroy(),this._rectangles=y,this._guid=jn()};Ml.prototype.getImageIndex=function(e){return T.typeOf.string("id",e),this._indexById.get(e)};Ml.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}),c(n)&&n(e)}catch(s){if(c(i)){i(s);return}}};function Kne({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}Ml.prototype._addImage=function(e,t){return T.typeOf.number.greaterThanOrEquals("index",e,0),T.defined("image",t),new Promise((n,i)=>{this._imagesToAddQueue.push(new Kne({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};Ml.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=await H1e(t,e),T.defined("image",t),this.isDestroyed()||!c(t)?-1:this._addImage(i,t)))(),this._indexPromiseById.set(e,n),n};Ml.prototype.addImageSubRegion=function(e,t){T.typeOf.string("id",e),T.defined("subRegion",t);let n=this._indexById.get(e);if(!c(n))throw new ae(`image with id "${e}" not found in the atlas.`);let i=this._indexPromiseById.get(e);for(let[r,s]of this._subRegions.entries())if(n===s&&this._rectangles[r].equals(t))return i.then(l=>l===-1?-1:r);let o=this._nextIndex++;return this._subRegions.set(o,n),this._rectangles[o]=t.clone(),i.then(r=>{if(r===-1)return-1;let s=this._rectangles[r];return T.typeOf.number.lessThanOrEquals("subRegion.x",t.x,s.width),T.typeOf.number.lessThanOrEquals("subRegion.x + subRegion.width",t.x+t.width,s.width),T.typeOf.number.lessThanOrEquals("subRegion.y",t.y,s.height),T.typeOf.number.lessThanOrEquals("subRegion.y + subRegion.height",t.y+t.height,s.height),o})};Ml.prototype.isDestroyed=function(){return!1};Ml.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{c(e)&&e(-1)}),de(this)};var vb=Ml;function Gs(e,t,n,i){if(T.defined("context",e),!t||t.length===0)throw new E("At least one attribute is required.");let o=Gs._verifyAttributes(t);n=n??0;let r=[],s={},a,l,u=o.length;for(let h=0;h0?$.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Gs._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(c(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let l=0;l0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=c(n);if(!o||n.sizeInBytes=this._size)throw new E("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new E("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");let n=this._allBuffers;for(let i=0,o=n.length;i0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Gs.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t0&&(this._hash={},e.length=0)};var Et=Db;function gu(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(gu.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}}});gu.packedLength=2;gu.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");return n=n??0,t[n++]=e.near,t[n]=e.far,t};gu.unpack=function(e,t,n){if(!c(e))throw new E("array is required");return t=t??0,c(n)||(n=new gu),n.near=e[t++],n.far=e[t],n};gu.equals=function(e,t){return e===t||c(e)&&c(t)&&e.near===t.near&&e.far===t.far};gu.clone=function(e,t){if(c(e))return c(t)||(t=new gu),t.near=e.near,t.far=e.far,t};gu.prototype.clone=function(e){return gu.clone(this,e)};gu.prototype.equals=function(e){return gu.equals(this,e)};var Mt=gu;function vf(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}vf.clone=function(e,t){if(c(e))return c(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new vf(e.near,e.nearValue,e.far,e.farValue)};vf.packedLength=4;vf.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};vf.unpack=function(e,t,n){if(!c(e))throw new E("array is required");return t=t??0,c(n)||(n=new vf),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};vf.equals=function(e,t){return e===t||c(e)&&c(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};vf.prototype.clone=function(e){return vf.clone(this,e)};vf.prototype.equals=function(e){return vf.equals(this,e)};var Bt=vf;var Pb={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,CLIP_TO_GROUND:7},We=Object.freeze(Pb);function Df(e){return e===Pb.CLAMP_TO_GROUND||e===Pb.CLAMP_TO_3D_TILE||e===Pb.CLAMP_TO_TERRAIN}function gC(e){return e===Pb.RELATIVE_TO_GROUND||e===Pb.RELATIVE_TO_3D_TILE||e===Pb.RELATIVE_TO_TERRAIN}var K1e={CENTER:0,LEFT:1,RIGHT:-1},bi=Object.freeze(K1e);var $1e={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Fn=Object.freeze($1e);var Z1e=Object.freeze({DONE:0,PENDING:1,FAILED:2}),lt=Z1e;function kd(){E.throwInstantiationError()}Object.defineProperties(kd.prototype,{isConstant:{get:E.throwInstantiationError},definitionChanged:{get:E.throwInstantiationError}});kd.prototype.getValue=E.throwInstantiationError;kd.prototype.equals=E.throwInstantiationError;kd.equals=function(e,t){return e===t||c(e)&&e.equals(t)};kd.arrayEquals=function(e,t){if(e===t)return!0;if(!c(e)||!c(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i-1;o--)r=t[o],c(r._billboard)&&c(r._position)&&s.set(r.id,new $ne(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._billboard)&&c(r._position)?s.contains(r.id)||s.set(r.id,new $ne(r)):(h6(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],h6(s.get(r.id),r,a),s.remove(r.id)};function h6(e,t,n){c(e)&&(e.billboard=void 0,n.removeBillboard(t))}var II=$g;var bRe=new d;function pm(e){e=e??W.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;if(T.typeOf.object("min",t),T.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new E("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._min=d.clone(t),this._max=d.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}pm.fromDimensions=function(e){e=e??W.EMPTY_OBJECT;let t=e.dimensions;T.typeOf.object("dimensions",t),T.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),T.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),T.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=d.multiplyByScalar(t,.5,new d);return new pm({minimum:d.negate(n,new d),maximum:n,offsetAttribute:e.offsetAttribute})};pm.fromAxisAlignedBoundingBox=function(e){return T.typeOf.object("boundindBox",e),new pm({minimum:e.minimum,maximum:e.maximum})};pm.packedLength=2*d.packedLength+1;pm.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),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 Qne=new d,Jne=new d,Zne={minimum:Qne,maximum:Jne,offsetAttribute:void 0};pm.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t,Qne),o=d.unpack(e,t+d.packedLength,Jne),r=e[t+d.packedLength*2];return c(n)?(n._min=d.clone(i,n._min),n._max=d.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Zne.offsetAttribute=r===-1?void 0:r,new pm(Zne))};pm.createGeometry=function(e){let t=e._min,n=e._max;if(d.equals(t,n))return;let i=new fn,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=d.subtract(n,t,bRe),a=d.magnitude(s)*.5;if(c(e._offsetAttribute)){let l=r.length,u=e._offsetAttribute===Zt.NONE?0:1,f=new Uint8Array(l/3).fill(u);i.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new ct({attributes:i,indices:o,primitiveType:Me.LINES,boundingSphere:new le(d.ZERO,a),offsetAttribute:e._offsetAttribute})};var Ud=pm;function yC(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([G.floatToByte(e),G.floatToByte(t),G.floatToByte(n),G.floatToByte(i)])}Object.defineProperties(yC.prototype,{componentDatatype:{get:function(){return $.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});yC.fromColor=function(e){if(!c(e))throw new E("color is required.");return new yC(e.red,e.green,e.blue,e.alpha)};yC.toValue=function(e,t){if(!c(e))throw new E("color is required.");return c(t)?e.toBytes(t):new Uint8Array(e.toBytes())};yC.equals=function(e,t){return e===t||c(e)&&c(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 Gt=yC;function OI(e,t){if(e=e??0,t=t??Number.MAX_VALUE,t<=e)throw new E("far distance must be greater than near distance.");this.value=new Float32Array([e,t])}Object.defineProperties(OI.prototype,{componentDatatype:{get:function(){return $.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});OI.fromDistanceDisplayCondition=function(e){if(!c(e))throw new E("distanceDisplayCondition is required.");if(e.far<=e.near)throw new E("distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance.");return new OI(e.near,e.far)};OI.toValue=function(e,t){if(!c(e))throw new E("distanceDisplayCondition is required.");return c(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var kn=OI;function xRe(e){if(e=e??W.EMPTY_OBJECT,!c(e.geometry))throw new E("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var St=xRe;function er(e){e=e??W.EMPTY_OBJECT,this.start=c(e.start)?Q.clone(e.start):new Q,this.stop=c(e.stop)?Q.clone(e.stop):new Q,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(er.prototype,{isEmpty:{get:function(){let e=Q.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var bC={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};er.fromIso8601=function(e,t){T.typeOf.object("options",e),T.typeOf.string("options.iso8601",e.iso8601);let n=e.iso8601.split("/");if(n.length!==2)throw new E("options.iso8601 is an invalid ISO 8601 interval.");let i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return c(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(bC.start=i,bC.stop=o,bC.isStartIncluded=r,bC.isStopIncluded=s,bC.data=a,new er(bC))};er.toIso8601=function(e,t){return T.typeOf.object("timeInterval",e),`${Q.toIso8601(e.start,t)}/${Q.toIso8601(e.stop,t)}`};er.clone=function(e,t){if(c(e))return c(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new er(e)};er.equals=function(e,t,n){return e===t||c(e)&&c(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Q.equals(e.start,t.start)&&Q.equals(e.stop,t.stop)&&(e.data===t.data||c(n)&&n(e.data,t.data)))};er.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||c(e)&&c(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Q.equalsEpsilon(e.start,t.start,n)&&Q.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||c(i)&&i(e.data,t.data)))};er.intersect=function(e,t,n,i){if(T.typeOf.object("left",e),!c(t))return er.clone(er.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,l=Q.greaterThanOrEquals(s,o)&&Q.greaterThanOrEquals(r,s),u=!l&&Q.lessThanOrEquals(s,o)&&Q.lessThanOrEquals(o,a);if(!l&&!u)return er.clone(er.EMPTY,n);let f=e.isStartIncluded,h=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=Q.lessThan(r,a);return c(n)||(n=new er),n.start=l?s:o,n.isStartIncluded=f&&p||!Q.equals(s,o)&&(l&&p||u&&f),n.stop=m?r:a,n.isStopIncluded=m?h:h&&g||!Q.equals(a,r)&&g,n.data=c(i)?i(e.data,t.data):e.data,n};er.contains=function(e,t){if(T.typeOf.object("timeInterval",e),T.typeOf.object("julianDate",t),e.isEmpty)return!1;let n=Q.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=Q.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};er.prototype.clone=function(e){return er.clone(this,e)};er.prototype.equals=function(e,t){return er.equals(this,e,t)};er.prototype.equalsEpsilon=function(e,t,n){return er.equalsEpsilon(this,e,t,n)};er.prototype.toString=function(){return er.toIso8601(this)};er.EMPTY=Object.freeze(new er({start:new Q,stop:new Q,isStartIncluded:!1,isStopIncluded:!1}));var En=er;var eie=Object.freeze(Q.fromIso8601("0000-01-01T00:00:00Z")),tie=Object.freeze(Q.fromIso8601("9999-12-31T24:00:00Z")),TRe=Object.freeze(new En({start:eie,stop:tie})),ARe={MINIMUM_VALUE:eie,MAXIMUM_VALUE:tie,MAXIMUM_INTERVAL:TRe},Ge=ARe;function RI(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(RI.prototype,{componentDatatype:{get:function(){return $.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});RI.fromCartesian3=function(e){return T.defined("offset",e),new RI(e.x,e.y,e.z)};RI.toValue=function(e,t){return T.defined("offset",e),c(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var eo=RI;function vV(e){e=e??!0,this.value=vV.toValue(e)}Object.defineProperties(vV.prototype,{componentDatatype:{get:function(){return $.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});vV.toValue=function(e,t){if(!c(e))throw new E("show is required.");return c(t)?(t[0]=e,t):new Uint8Array([e])};var bn=vV;var MI=`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 LI=`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; v_normalEC = czm_normal * normal; v_tangentEC = czm_normal * tangent; v_bitangentEC = czm_normal * bitangent; v_st = st; gl_Position = czm_modelViewProjectionRelativeToEye * p; } `;var NI=`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 FI=`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; v_normalEC = czm_normal * normal; gl_Position = czm_modelViewProjectionRelativeToEye * p; } `;var BI=`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 kI=`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; v_normalEC = czm_normal * normal; v_st = st; gl_Position = czm_modelViewProjectionRelativeToEye * p; } `;var CRe={ADD:ne.FUNC_ADD,SUBTRACT:ne.FUNC_SUBTRACT,REVERSE_SUBTRACT:ne.FUNC_REVERSE_SUBTRACT,MIN:ne.MIN,MAX:ne.MAX},Fa=Object.freeze(CRe);var ERe={ZERO:ne.ZERO,ONE:ne.ONE,SOURCE_COLOR:ne.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ne.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ne.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ne.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ne.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ne.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ne.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ne.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ne.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ne.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ne.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ne.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ne.SRC_ALPHA_SATURATE},Eo=Object.freeze(ERe);var SRe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Eo.SOURCE_ALPHA,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Eo.ONE,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Eo.SOURCE_ALPHA,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE,functionDestinationAlpha:Eo.ONE})},ln=Object.freeze(SRe);var wRe={FRONT:ne.FRONT,BACK:ne.BACK,FRONT_AND_BACK:ne.FRONT_AND_BACK},xi=Object.freeze(wRe);function xC(e){e=e??W.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(xC.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}}});xC.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),c(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` `)};xC.prototype.isTranslucent=function(){return c(this.material)&&this.material.isTranslucent()||!c(this.material)&&this.translucent};xC.prototype.getRenderState=function(){let e=this.isTranslucent(),t=je(this.renderState,!1);return e?(t.depthMask=!1,t.blending=ln.ALPHA_BLEND):t.depthMask=!0,t};xC.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=ln.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:xi.BACK}),c(n)&&(i=xt(n,i,!0)),i};var io=xC;var UI=`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 VI=`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 zI=`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; float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); 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 HI=`uniform vec4 lightColor; uniform vec4 darkColor; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); vec4 color = mix(lightColor, darkColor, b); color = czm_gammaCorrect(color); material.diffuse = color.rgb; material.alpha = color.a; return material; } `;var GI=`uniform sampler2D heights; uniform sampler2D colors; 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); if (height < minHeight || height > maxHeight) { material.diffuse = vec3(0.0); material.alpha = 0.0; return material; } int idxBelow = 0; int idxAbove = heightsDimensions.x; float heightBelow = minHeight; float heightAbove = maxHeight; 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); 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 jI=`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 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 WI=`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 qI=`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 YI=`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; #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) const float fuzz = 1.2; vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; 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 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 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 XI=`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 KI=`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 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); 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 $I=`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; float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); float maskIndex = floor(dashPosition * maskLength); float maskTest = floor(dashPattern / pow(2.0, maskIndex)); vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; if (fragColor.a < 0.005) { discard; } fragColor = czm_gammaCorrect(fragColor); material.emission = fragColor.rgb; material.alpha = fragColor.a; return material; } `;var ZI=`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 QI=`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); 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 JI=`uniform vec4 color; uniform vec4 rimColor; uniform float width; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); 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 eO=`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 tO=`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); 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 nO=`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 iO=`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; float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); float specularMapValue = texture(specularMap, materialInput.st).r; vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); normalTangentSpace.xy /= fade; normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); normalTangentSpace = normalize(normalTangentSpace); float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); 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 Ye(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=e.minificationFilter??Yt.LINEAR,this._magnificationFilter=e.magnificationFilter??li.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,vRe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),c(Ye._uniformList[this.type])||(Ye._uniformList[this.type]=Object.keys(this._uniforms))}Ye._uniformList={};Ye.fromType=function(e,t){if(!c(Ye._materialCache.getMaterial(e)))throw new E(`material with type '${e}' does not exist.`);let n=new Ye({fabric:{type:e}});if(c(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Ye.prototype.isTranslucent=function(){if(c(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-1)return!0;return!1}function MRe(e){let t=e._template.components,n=e._template.source;if(c(n))e.shaderSource+=`${n} `;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) { `,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); `,c(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&RRe(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; `}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; `:e.shaderSource+=`material.${o} = ${t[o]}; `}e.shaderSource+=`return material; } `}}var iie={mat2:Ri,mat3:J,mat4:B},LRe=/\.ktx2$/i;function NRe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!c(r)||r===Ye.DefaultImageId;t=r;let l=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&c(l)&&(l!==i.defaultTexture&&l.destroy(),l=void 0),!c(l)||l===i.defaultTexture){let p=new Qt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});l=new Rt({context:i,source:r,sampler:p}),n._textures[e]=l;return}l.copyFrom({source:r})}else c(l)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Rt&&r!==l){n._texturePaths[e]=void 0;let p=n._textures[e];c(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(s&&c(l)&&a&&(l!==n._defaultTexture&&l.destroy(),l=void 0),c(l)||(n._texturePaths[e]=void 0,l=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=l._width,f.y=l._height)),a)return;let h=r instanceof we;if(!c(n._texturePaths[e])||h&&r.url!==n._texturePaths[e].url||!h&&r!==n._texturePaths[e]){if(typeof r=="string"||h){let p=h?r:we.createIfNeeded(r),g;LRe.test(p.url)?g=Il(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(m){n._loadedImages.push({id:e,image:m})}).catch(function(){c(l)&&l!==n._defaultTexture&&l.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function FRe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Go){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(c(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Ye.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[we.createIfNeeded(i.positiveX).fetchImage(),we.createIfNeeded(i.negativeX).fetchImage(),we.createIfNeeded(i.positiveY).fetchImage(),we.createIfNeeded(i.negativeY).fetchImage(),we.createIfNeeded(i.positiveZ).fetchImage(),we.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function BRe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&oie(e,n)}function oie(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=kRe(o);if(!c(r))throw new E(`fabric: uniform '${t}' has invalid type.`);let s;if(r==="channels"){if(s=oO(e,t,o,!1),s===0&&n)throw new E(`strict: shader source does not use channels '${t}'.`)}else{if(r==="sampler2D"){let u=`${t}Dimensions`;VRe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},oie(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 l=`${t}_${e._count++}`;if(s=oO(e,t,l),s===1&&n)throw new E(`strict: shader source does not use uniform '${t}'.`);if(e.uniforms[t]=o,r==="sampler2D")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(NRe(t));else if(r==="samplerCube")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(FRe(t));else if(r.indexOf("mat")!==-1){let u=new iie[r];e._uniforms[l]=function(){return iie[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[l]=function(){return e.uniforms[t]}}}function kRe(e){let t=e.type;if(!c(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof we||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Ye.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 URe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new Ye({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=xt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;oO(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`;if(oO(e,i,a)===0&&t)throw new E(`strict: shader source does not use material '${i}'.`)}}function oO(e,t,n,i){i=i??!0;let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(l,u,f){return u||f?l:(o+=1,n)}),o}function VRe(e,t,n){return oO(e,t,t,n)}Ye._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Ye.DefaultImageId="czm_defaultImage";Ye.DefaultCubeMapId="czm_defaultCubeMap";Ye.ColorType="Color";Ye._materialCache.addMaterial(Ye.ColorType,{fabric:{type:Ye.ColorType,uniforms:{color:new G(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Ye.ImageType="Image";Ye._materialCache.addMaterial(Ye.ImageType,{fabric:{type:Ye.ImageType,uniforms:{image:Ye.DefaultImageId,repeat:new H(1,1),color:new G(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}});Ye.DiffuseMapType="DiffuseMap";Ye._materialCache.addMaterial(Ye.DiffuseMapType,{fabric:{type:Ye.DiffuseMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Ye.AlphaMapType="AlphaMap";Ye._materialCache.addMaterial(Ye.AlphaMapType,{fabric:{type:Ye.AlphaMapType,uniforms:{image:Ye.DefaultImageId,channel:"a",repeat:new H(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Ye.SpecularMapType="SpecularMap";Ye._materialCache.addMaterial(Ye.SpecularMapType,{fabric:{type:Ye.SpecularMapType,uniforms:{image:Ye.DefaultImageId,channel:"r",repeat:new H(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Ye.EmissionMapType="EmissionMap";Ye._materialCache.addMaterial(Ye.EmissionMapType,{fabric:{type:Ye.EmissionMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Ye.BumpMapType="BumpMap";Ye._materialCache.addMaterial(Ye.BumpMapType,{fabric:{type:Ye.BumpMapType,uniforms:{image:Ye.DefaultImageId,channel:"r",strength:.8,repeat:new H(1,1)},source:VI},translucent:!1});Ye.NormalMapType="NormalMap";Ye._materialCache.addMaterial(Ye.NormalMapType,{fabric:{type:Ye.NormalMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",strength:.8,repeat:new H(1,1)},source:XI},translucent:!1});Ye.GridType="Grid";Ye._materialCache.addMaterial(Ye.GridType,{fabric:{type:Ye.GridType,uniforms:{color:new G(0,1,0,1),cellAlpha:.1,lineCount:new H(8,8),lineThickness:new H(1,1),lineOffset:new H(0,0)},source:YI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Ye.StripeType="Stripe";Ye._materialCache.addMaterial(Ye.StripeType,{fabric:{type:Ye.StripeType,uniforms:{horizontal:!0,evenColor:new G(1,1,1,.5),oddColor:new G(0,0,1,.5),offset:0,repeat:5},source:tO},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Ye.CheckerboardType="Checkerboard";Ye._materialCache.addMaterial(Ye.CheckerboardType,{fabric:{type:Ye.CheckerboardType,uniforms:{lightColor:new G(1,1,1,.5),darkColor:new G(0,0,0,.5),repeat:new H(5,5)},source:zI},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Ye.DotType="Dot";Ye._materialCache.addMaterial(Ye.DotType,{fabric:{type:Ye.DotType,uniforms:{lightColor:new G(1,1,0,.75),darkColor:new G(0,1,1,.75),repeat:new H(5,5)},source:HI},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Ye.WaterType="Water";Ye._materialCache.addMaterial(Ye.WaterType,{fabric:{type:Ye.WaterType,uniforms:{baseWaterColor:new G(.2,.3,.6,1),blendColor:new G(0,1,.699,1),specularMap:Ye.DefaultImageId,normalMap:Ye.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:iO},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Ye.RimLightingType="RimLighting";Ye._materialCache.addMaterial(Ye.RimLightingType,{fabric:{type:Ye.RimLightingType,uniforms:{color:new G(1,0,0,.7),rimColor:new G(1,1,1,.4),width:.3},source:JI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Ye.FadeType="Fade";Ye._materialCache.addMaterial(Ye.FadeType,{fabric:{type:Ye.FadeType,uniforms:{fadeInColor:new G(1,0,0,1),fadeOutColor:new G(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new H(.5,.5)},source:qI},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Ye.PolylineArrowType="PolylineArrow";Ye._materialCache.addMaterial(Ye.PolylineArrowType,{fabric:{type:Ye.PolylineArrowType,uniforms:{color:new G(1,1,1,1)},source:KI},translucent:!0});Ye.PolylineDashType="PolylineDash";Ye._materialCache.addMaterial(Ye.PolylineDashType,{fabric:{type:Ye.PolylineDashType,uniforms:{color:new G(1,0,1,1),gapColor:new G(0,0,0,0),dashLength:16,dashPattern:255},source:$I},translucent:!0});Ye.PolylineGlowType="PolylineGlow";Ye._materialCache.addMaterial(Ye.PolylineGlowType,{fabric:{type:Ye.PolylineGlowType,uniforms:{color:new G(0,.5,1,1),glowPower:.25,taperPower:1},source:ZI},translucent:!0});Ye.PolylineOutlineType="PolylineOutline";Ye._materialCache.addMaterial(Ye.PolylineOutlineType,{fabric:{type:Ye.PolylineOutlineType,uniforms:{color:new G(1,1,1,1),outlineColor:new G(1,0,0,1),outlineWidth:1},source:QI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Ye.ElevationContourType="ElevationContour";Ye._materialCache.addMaterial(Ye.ElevationContourType,{fabric:{type:Ye.ElevationContourType,uniforms:{spacing:100,color:new G(1,0,0,1),width:1},source:jI},translucent:!1});Ye.ElevationRampType="ElevationRamp";Ye._materialCache.addMaterial(Ye.ElevationRampType,{fabric:{type:Ye.ElevationRampType,uniforms:{image:Ye.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:WI},translucent:!1});Ye.SlopeRampMaterialType="SlopeRamp";Ye._materialCache.addMaterial(Ye.SlopeRampMaterialType,{fabric:{type:Ye.SlopeRampMaterialType,uniforms:{image:Ye.DefaultImageId},source:eO},translucent:!1});Ye.AspectRampMaterialType="AspectRamp";Ye._materialCache.addMaterial(Ye.AspectRampMaterialType,{fabric:{type:Ye.AspectRampMaterialType,uniforms:{image:Ye.DefaultImageId},source:UI},translucent:!1});Ye.ElevationBandType="ElevationBand";Ye._materialCache.addMaterial(Ye.ElevationBandType,{fabric:{type:Ye.ElevationBandType,uniforms:{heights:Ye.DefaultImageId,colors:Ye.DefaultImageId},source:GI},translucent:!0});Ye.WaterMaskType="WaterMask";Ye._materialCache.addMaterial(Ye.WaterMaskType,{fabric:{type:Ye.WaterMaskType,source:nO,uniforms:{waterColor:new G(1,1,1,1),landColor:new G(0,0,0,0)}},translucent:!1});var Xi=Ye;function Ib(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??Ib.MaterialSupport.TEXTURED;this.material=c(e.material)?e.material:Xi.fromType(Xi.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(Ib.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}}});Ib.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Ib.prototype.isTranslucent=io.prototype.isTranslucent;Ib.prototype.getRenderState=io.prototype.getRenderState;Ib.MaterialSupport={BASIC:Object.freeze({vertexFormat:Ie.POSITION_AND_NORMAL,vertexShaderSource:FI,fragmentShaderSource:NI}),TEXTURED:Object.freeze({vertexFormat:Ie.POSITION_NORMAL_AND_ST,vertexShaderSource:kI,fragmentShaderSource:BI}),ALL:Object.freeze({vertexFormat:Ie.ALL,vertexShaderSource:LI,fragmentShaderSource:MI})};var ao=Ib;var rO=`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 sO=`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; v_normalEC = czm_normal * normal; v_color = color; gl_Position = czm_modelViewProjectionRelativeToEye * p; } `;var Ob=`in vec4 v_color; void main() { out_FragColor = czm_gammaCorrect(v_color); } `;var aO=`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 Lp(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?aO:sO,r=i?Ob:rO,s=i?Lp.FLAT_VERTEX_FORMAT:Lp.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=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(Lp.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}}});Lp.VERTEX_FORMAT=Ie.POSITION_AND_NORMAL;Lp.FLAT_VERTEX_FORMAT=Ie.POSITION_ONLY;Lp.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Lp.prototype.isTranslucent=io.prototype.isTranslucent;Lp.prototype.getRenderState=io.prototype.getRenderState;var rn=Lp;function TC(e){this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(TC.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color")});TC.prototype.getType=function(e){return"Color"};var zRe=new Q;TC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(zRe)),c(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,G.WHITE,t.color),t};TC.prototype.equals=function(e){return this===e||e instanceof TC&&X.equals(this._color,e._color)};var Ut=TC;function Zg(e){e=e??W.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??ie.default,this._rectangle=e.rectangle??ce.MAX_VALUE,this._projection=new Oi(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(Zg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Zg.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=o&&(u=o-1);let f=(i.north-e.latitude)/a|0;return f>=r&&(f=r-1),c(n)?(n.x=u,n.y=f,n):new H(u,f)};var Ki=Zg;var rie=new d,sie=new d,aie=new he,p6=new d,HRe=new d,cie=new le,GRe=new Ki,cO=[new he,new he,new he,new he],lO=new H,vr={};vr.initialize=function(){let e=vr._initPromise;return c(e)||(e=we.fetchJson(tn("Assets/approximateTerrainHeights.json")).then(function(t){vr._terrainHeights=t}),vr._initPromise=e),e};vr.getMinimumMaximumHeights=function(e,t){if(T.defined("rectangle",e),!c(vr._terrainHeights))throw new E("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=t??ie.default;let n=lie(e),i=vr._defaultMinTerrainHeight,o=vr._defaultMaxTerrainHeight;if(c(n)){let r=`${n.level}-${n.x}-${n.y}`,s=vr._terrainHeights[r];c(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(ce.northeast(e,aie),rie),t.cartographicToCartesian(ce.southwest(e,aie),sie),d.midpoint(sie,rie,p6);let a=t.scaleToGeodeticSurface(p6,HRe);if(c(a)){let l=d.distance(p6,a);i=Math.min(i,-l)}else i=vr._defaultMinTerrainHeight}return i=Math.max(vr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};vr.getBoundingSphere=function(e,t){if(T.defined("rectangle",e),!c(vr._terrainHeights))throw new E("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=t??ie.default;let n=lie(e),i=vr._defaultMaxTerrainHeight;if(c(n)){let r=`${n.level}-${n.x}-${n.y}`,s=vr._terrainHeights[r];c(s)&&(i=s[1])}let o=le.fromRectangle3D(e,t,0);return le.fromRectangle3D(e,t,i,cie),le.union(o,cie,o)};function lie(e){he.fromRadians(e.east,e.north,0,cO[0]),he.fromRadians(e.west,e.north,0,cO[1]),he.fromRadians(e.east,e.south,0,cO[2]),he.fromRadians(e.west,e.south,0,cO[3]);let t=0,n=0,i=0,o=0,r=vr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let l=0;l<4;++l){let u=cO[l];if(GRe.positionToTileXY(u,s,lO),l===0)i=lO.x,o=lO.y;else if(i!==lO.x||o!==lO.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}vr._terrainHeightsMaxLevel=6;vr._defaultMaxTerrainHeight=9e3;vr._defaultMinTerrainHeight=-1e5;vr._terrainHeights=void 0;vr._initPromise=void 0;Object.defineProperties(vr,{initialized:{get:function(){return c(vr._terrainHeights)}}});var ui=vr;function Gc(e,t,n){this.minimum=d.clone(e??d.ZERO),this.maximum=d.clone(t??d.ZERO),c(n)?n=d.clone(n):n=d.midpoint(this.minimum,this.maximum,new d),this.center=n}Gc.fromCorners=function(e,t,n){return T.defined("minimum",e),T.defined("maximum",t),c(n)||(n=new Gc),n.minimum=d.clone(e,n.minimum),n.maximum=d.clone(t,n.maximum),n.center=d.midpoint(e,t,n.center),n};Gc.fromPoints=function(e,t){if(c(t)||(t=new Gc),!c(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,s=e[0].y,a=e[0].z,l=e.length;for(let h=1;h0?Wt.INSIDE:r+o<0?Wt.OUTSIDE:Wt.INTERSECTING};Gc.prototype.clone=function(e){return Gc.clone(this,e)};Gc.prototype.intersectPlane=function(e){return Gc.intersectPlane(this,e)};Gc.prototype.equals=function(e){return Gc.equals(this,e)};var Qg=Gc;var _6=new se;function _m(e,t){if(T.defined("origin",e),t=t??ie.default,e=t.scaleToGeodeticSurface(e),!c(e))throw new E("origin must not be at the center of the ellipsoid.");let n=Ot.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=d.fromCartesian4(B.getColumn(n,0,_6)),this._yAxis=d.fromCartesian4(B.getColumn(n,1,_6));let i=d.fromCartesian4(B.getColumn(n,2,_6));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(_m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var jRe=new Qg;_m.fromPoints=function(e,t){T.defined("cartesians",e);let n=Qg.fromPoints(e,jRe);return new _m(n.center,t)};var uie=new mn,PV=new d;_m.prototype.projectPointOntoPlane=function(e,t){T.defined("cartesian",e);let n=uie;n.origin=e,d.normalize(e,n.direction);let i=Zn.rayPlane(n,this._plane,PV);if(c(i)||(d.negate(n.direction,n.direction),i=Zn.rayPlane(n,this._plane,PV)),c(i)){let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),s=d.dot(this._yAxis,o);return c(t)?(t.x=r,t.y=s,t):new H(r,s)}};_m.prototype.projectPointsOntoPlane=function(e,t){T.defined("cartesians",e),c(t)||(t=[]);let n=0,i=e.length;for(let o=0;oO.TWO_PI)throw new E("Rectangle width must be between 0 and 2 * pi");if(e.height<0||e.height>O.PI)throw new E("Rectangle height must be between 0 and pi");if(c(i)&&!O.equalsEpsilon(i.radii.x,i.radii.y,O.EPSILON15))throw new E("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t=t??0,n=n??0,i=i??ie.default;let r,s,a,l,u,f,h;if(e.width<=O.PI){let M=ce.center(e,die),R=i.cartographicToCartesian(M,tMe),L=new ns(R,i);h=L.plane;let F=M.longitude,_=e.south<0&&e.north>0?0:M.latitude,w=he.fromRadians(F,e.north,n,nMe),D=he.fromRadians(e.west,e.north,n,iMe),I=he.fromRadians(e.west,_,n,oMe),N=he.fromRadians(e.west,e.south,n,rMe),k=he.fromRadians(F,e.south,n,sMe),z=i.cartographicToCartesian(w,aMe),V=i.cartographicToCartesian(D,hie),j=i.cartographicToCartesian(I,cMe),U=i.cartographicToCartesian(N,mie),q=i.cartographicToCartesian(k,lMe),Y=L.projectPointToNearestOnPlane(z,uMe),te=L.projectPointToNearestOnPlane(V,fMe),K=L.projectPointToNearestOnPlane(j,dMe),Z=L.projectPointToNearestOnPlane(U,hMe),ee=L.projectPointToNearestOnPlane(q,mMe);return r=Math.min(te.x,K.x,Z.x),s=-r,l=Math.max(te.y,Y.y),a=Math.min(Z.y,ee.y),D.height=N.height=t,V=i.cartographicToCartesian(D,hie),U=i.cartographicToCartesian(N,mie),u=Math.min(sn.getPointDistance(h,V),sn.getPointDistance(h,U)),f=n,fie(L.origin,L.xAxis,L.yAxis,L.zAxis,r,s,a,l,u,f,o)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,y=ce.center(e,die).longitude,b=d.fromRadians(y,m,n,i,pMe);b.z=0;let A=Math.abs(b.x)=l?Wt.INSIDE:Wt.INTERSECTING};var gie=new d,yie=new d,bie=new d,EMe=new d,pie=new d,SMe=new d;zi.distanceSquaredTo=function(e,t){if(!c(e))throw new E("box is required.");if(!c(t))throw new E("cartesian is required.");let n=d.subtract(t,e.center,_ie),i=e.halfAxes,o=J.getColumn(i,0,gie),r=J.getColumn(i,1,yie),s=J.getColumn(i,2,bie),a=d.magnitude(o),l=d.magnitude(r),u=d.magnitude(s),f=!0,h=!0,p=!0;a>0?d.divideByScalar(o,a,o):f=!1,l>0?d.divideByScalar(r,l,r):h=!1,u>0?d.divideByScalar(s,u,s):p=!1;let g=!f+!h+!p,m,y,b;if(g===1){let S=o;m=r,y=s,h?p||(S=s,y=o):(S=r,m=o),b=d.cross(m,y,pie),S===o?o=b:S===r?r=b:S===s&&(s=b)}else if(g===2){m=o,h?m=r:p&&(m=s);let S=d.UNIT_Y;S.equalsEpsilon(m,O.EPSILON3)&&(S=d.UNIT_X),y=d.cross(m,S,EMe),d.normalize(y,y),b=d.cross(m,y,pie),d.normalize(b,b),m===o?(r=y,s=b):m===r?(s=y,o=b):m===s&&(o=y,r=b)}else g===3&&(o=d.UNIT_X,r=d.UNIT_Y,s=d.UNIT_Z);let x=SMe;x.x=d.dot(n,o),x.y=d.dot(n,r),x.z=d.dot(n,s);let A=0,C;return x.x<-a?(C=x.x+a,A+=C*C):x.x>a&&(C=x.x-a,A+=C*C),x.y<-l?(C=x.y+l,A+=C*C):x.y>l&&(C=x.y-l,A+=C*C),x.z<-u?(C=x.z+u,A+=C*C):x.z>u&&(C=x.z-u,A+=C*C),A};var wMe=new d,vMe=new d;zi.computePlaneDistances=function(e,t,n,i){if(!c(e))throw new E("box is required.");if(!c(t))throw new E("position is required.");if(!c(n))throw new E("direction is required.");c(i)||(i=new Ma);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,l=J.getColumn(a,0,gie),u=J.getColumn(a,1,yie),f=J.getColumn(a,2,bie),h=d.add(l,u,wMe);d.add(h,f,h),d.add(h,s,h);let p=d.subtract(h,t,vMe),g=d.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),d.add(s,l,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.add(s,l,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.add(s,l,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.add(h,u,h),d.add(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var DMe=new d,PMe=new d,IMe=new d;zi.computeCorners=function(e,t){T.typeOf.object("box",e),c(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,DMe),r=J.getColumn(i,1,PMe),s=J.getColumn(i,2,IMe);return d.clone(n,t[0]),d.subtract(t[0],o,t[0]),d.subtract(t[0],r,t[0]),d.subtract(t[0],s,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],s,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],s,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],s,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],s,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],s,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],s,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],s,t[7]),t};var OMe=new J;zi.computeTransformation=function(e,t){T.typeOf.object("box",e),c(t)||(t=new B);let n=e.center,i=J.multiplyByUniformScale(e.halfAxes,2,OMe);return B.fromRotationTranslation(i,n,t)};var RMe=new le;zi.isOccluded=function(e,t){if(!c(e))throw new E("box is required.");if(!c(t))throw new E("occluder is required.");let n=le.fromOrientedBoundingBox(e,RMe);return!t.isBoundingSphereVisible(n)};zi.prototype.intersectPlane=function(e){return zi.intersectPlane(this,e)};zi.prototype.distanceSquaredTo=function(e){return zi.distanceSquaredTo(this,e)};zi.prototype.computePlaneDistances=function(e,t,n){return zi.computePlaneDistances(this,e,t,n)};zi.prototype.computeCorners=function(e){return zi.computeCorners(this,e)};zi.prototype.computeTransformation=function(e){return zi.computeTransformation(this,e)};zi.prototype.isOccluded=function(e){return zi.isOccluded(this,e)};zi.equals=function(e,t){return e===t||c(e)&&c(t)&&d.equals(e.center,t.center)&&J.equals(e.halfAxes,t.halfAxes)};zi.prototype.clone=function(e){return zi.clone(this,e)};zi.prototype.equals=function(e){return zi.equals(this,e)};var Dn=zi;var IV={};IV.getHeight=function(e,t,n){if(!Number.isFinite(t))throw new E("scale must be a finite number.");if(!Number.isFinite(n))throw new E("relativeHeight must be a finite number.");return(e-n)*t+n};var MMe=new he;IV.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,MMe);if(!c(r))return d.clone(e,o);let s=IV.getHeight(r.height,n,i);return d.fromRadians(r.longitude,r.latitude,s,t,o)};var Dr=IV;var uO=`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; 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); 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); 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 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 Jg=`#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 xie={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};xie.NUMBER_OF_CLASSIFICATION_TYPES=3;var Un=Object.freeze(xie);var LMe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},dc=Object.freeze(LMe);function NMe(e,t){if(!c(e))throw new E("array is required.");if(!c(t)||t<1)throw new E("numberOfArrays must be greater than 0.");let n=[],i=e.length,o=0;for(;o=this._numberOfInstances)throw new E("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new E("attributeIndex is out of range");let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==Ue.UNSIGNED_BYTE?a=UMe(this._batchValues,s,Tie):a=se.unpack(this._batchValues,s,Tie);let l=Aie(i,t);return c(l.fromCartesian4)?l.fromCartesian4(a,n):c(l.clone)?l.clone(a,n):a.x};var zMe=[void 0,void 0,new H,new d,new se],HMe=new se;Np.prototype.setBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new E("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new E("attributeIndex is out of range");if(!c(n))throw new E("value is required.");let i=this._attributes,o=zMe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=Aie(this._attributes,t);if(c(s.equals)?s.equals(r,n):r===n)return;let l=HMe;l.x=c(n.x)?n.x:n,l.y=c(n.y)?n.y:0,l.z=c(n.z)?n.z:0,l.w=c(n.w)?n.w:0;let u=this._offsets[t],h=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==Ue.UNSIGNED_BYTE?VMe(l,this._batchValues,h):se.pack(l,this._batchValues,h),this._batchValuesDirty=!0};function GMe(e,t){let n=e._textureDimensions;e._texture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Qt.NEAREST,flipY:!1})}function jMe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Np.prototype.update=function(e){c(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,c(this._texture)||GMe(this,e.context),jMe(this))};Np.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:xt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function WMe(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 qMe(e){return e===1?"float":`vec${e}`}function YMe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function XMe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=qMe(o),a=YMe(o),l=e._offsets[t],u=`${s} ${r}(float batchId) { vec2 st = computeSt(batchId); st.x += batchTextureStep.x * float(${l}); `;return e._packFloats&&i.componentDatatype!==Ue.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+=` ${s} value = textureValue${a}; `,e._pixelDatatype===Ue.UNSIGNED_BYTE&&i.componentDatatype===$.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; `:e._pixelDatatype===Ue.FLOAT&&i.componentDatatype===$.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; `),u+=` return value; } `,u}Np.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; `;t+=`${WMe(this)} `;let n=e.length;for(let i=0;iLl.MaximumLatitude?e=Ll.MaximumLatitude:e<-Ll.MaximumLatitude&&(e=-Ll.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};Ll.MaximumLatitude=Ll.mercatorAngleToGeodeticLatitude(Math.PI);Ll.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=Ll.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return c(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};Ll.prototype.unproject=function(e,t){if(!c(e))throw new E("cartesian is required");let n=this._oneOverSemimajorAxis,i=e.x*n,o=Ll.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return c(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Mi=Ll;function KMe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let l=e.length;for(let u=0;ur&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function QMe(e,t){let n=[];return y6(e,"geometry",t,n),y6(e,"westHemisphereGeometry",t,n),y6(e,"eastHemisphereGeometry",t,n),n}var Fp={};Fp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=ZMe(e),t.length>0&&(n=Nn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=QMe(i,t))),c(i[0].attributes)&&c(i[0].attributes.offset)&&(s=new Array(o),a=!0));let l=new Array(o),u=new Array(o);for(let f=0;f0&&(n.set(l.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};Fp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s0){let v=b.length/x;for(S=Fe.createTypedArray(v,y),i=0;i= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; gl_Position *= show; }`,`${i} ${o}`};function vie(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",l="compressedAttributes",u=`in ${a} ${l};`,f="",h="";if(i){f+=`vec2 st; `;let m=s>1?`${l}.x`:l;h+=` st = czm_decompressTextureCoordinates(${m}); `}n&&o&&r?(f+=`vec3 normal; vec3 tangent; vec3 bitangent; `,h+=` czm_octDecode(${l}.${i?"yz":"xy"}, normal, tangent, bitangent); `):(n&&(f+=`vec3 normal; `,h+=` normal = czm_octDecode(${l}${s>1?`.${i?"y":"x"}`:""}); `),o&&(f+=`vec3 tangent; `,h+=` tangent = czm_octDecode(${l}.${i&&n?"z":"y"}); `),r&&(f+=`vec3 bitangent; `,h+=` bitangent = czm_octDecode(${l}.${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=He.replaceMain(p,"czm_non_compressed_main");let g=`void main() { ${h} czm_non_compressed_main(); }`;return[u,f,p,g].join(` `)}function hLe(e){let t=He.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { czm_non_depth_clamp_main(); gl_Position = czm_depthClamp(gl_Position);} `,t}function mLe(e){let t=He.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 Die(e,t){let n=e.vertexAttributes;for(let i in n)if(n.hasOwnProperty(i)&&!c(t[i]))throw new E(`Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '${i}', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.`)}function pLe(e,t){return function(){return e[t]}}var b6=Math.max(Vt.hardwareConcurrency-1,1),OV,_Le=new yi("combineGeometry");function gLe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Pr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,l=[],u=[];for(o=0;o0){let y=new Float64Array(h);for(m=[y.buffer],r=0;r0?(e._recomputeBoundingSpheres=!0,e._state=Pr.COMBINED):mO(e,t,Pr.FAILED,void 0)}).catch(function(h){mO(e,t,Pr.FAILED,h)})}}function yLe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,l=0;for(a=0;a0?(e._recomputeBoundingSpheres=!0,e._state=Pr.COMBINED):mO(e,t,Pr.FAILED,void 0)}function bLe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!c(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!c(a)){for(a=new Array(s),i=0;i0||le.intersectPlane(y,sn.ORIGIN_ZX_PLANE)!==Wt.INTERSECTING?l.push(y):(u.push(y),f.push(y))}let h=l[0],p=f[0],g=u[0];for(i=1;i0){if(ut.maximumVertexTextureImageUnits===0)throw new ae("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!==Pr.COMPLETE&&this._state!==Pr.COMBINED&&(this.asynchronous?gLe(this,e):yLe(this,e)),this._state===Pr.COMBINED&&(xLe(this,e),Iie(this,e),ALe(this,e)),!this.show||this._state!==Pr.COMPLETE)return;this._batchTableOffsetsUpdated||Iie(this,e),this._recomputeBoundingSpheres&&bLe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=c(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let l=this._appearance.isTranslucent();this._translucent!==l&&(this._translucent=l,o=!0),c(this._material)&&this._material.update(t);let u=n.closed&&l;o&&(this._createRenderStatesFunction??CLe)(this,t,n,u),r&&(this._createShaderProgramFunction??ELe)(this,e,n),(o||r)&&(this._createCommandsFunction??SLe)(this,n,i,l,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??wLe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var vLe=new le,DLe=new le;function kie(e,t,n){if(n===Zt.TOP){let i=le.clone(e,vLe),o=le.clone(e,DLe);o.center=d.add(o.center,t,o.center),e=le.union(i,o,e)}else n===Zt.ALL&&(e.center=d.add(e.center,t,e.center));return e}function PLe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=$.createTypedArray(o.componentDatatype,r);return c(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function ILe(e,t,n,i,o){return function(r){if(!c(r)||!c(r.length)||r.length<1||r.length>4)throw new E("value must be and array with length between 1 and 4.");let s=Lie(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var OLe=new d;function RLe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(c(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;c(r)&&kie(i,d.fromArray(r.get(),0,OLe),e._offsetInstanceExtend[n]),c(o)&&(i=le.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function MLe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Ir.prototype.getGeometryInstanceAttributes=function(e){if(!c(e))throw new E("id is required");if(!c(this._batchTable))throw new E("must call update before calling getGeometryInstanceAttributes");let t=this._perInstanceAttributeCache.get(e);if(c(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u4)throw new E("options.componentsPerAttribute must be between 1 and 4.");if(!c(e.value))throw new E("options.value is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var hc=LLe;var AC=`#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; float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); 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 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 uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; #endif // SPHERICAL #endif // TEXTURE_COORDINATES #ifdef PICK #ifdef CULL_FRAGMENTS if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { out_FragColor.a = 1.0; czm_writeDepthClamp(); } #else // CULL_FRAGMENTS out_FragColor.a = 1.0; #endif // CULL_FRAGMENTS #else // PICK #ifdef CULL_FRAGMENTS if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { discard; } #endif #ifdef NORMAL_EC 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 out_FragColor.rgb *= out_FragColor.a; #else // PER_INSTANCE_COLOR 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 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 out_FragColor.rgb *= out_FragColor.a; #endif // PER_INSTANCE_COLOR czm_writeDepthClamp(); #endif // PICK } `;function Pf(e,t,n){T.typeOf.bool("extentsCulling",e),T.typeOf.bool("planarExtents",t),T.typeOf.object("appearance",n),this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new T6;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new T6;if(o.requiresTextureCoordinates=e,n instanceof rn)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}Pf.prototype.createFragmentShader=function(e){T.typeOf.bool("columbusView2D",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 rn&&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 rn||(o=t.material.shaderSource),new He({defines:i,sources:[o,AC]})};Pf.prototype.createPickFragmentShader=function(e){T.typeOf.bool("columbusView2D",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 He({defines:n,sources:[AC],pickColorQualifier:"in"})};Pf.prototype.createVertexShader=function(e,t,n,i){return T.defined("defines",e),T.typeOf.string("vertexShaderSource",t),T.typeOf.bool("columbusView2D",n),T.defined("mapProjection",i),qie(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Pf.prototype.createPickVertexShader=function(e,t,n,i){return T.defined("defines",e),T.typeOf.string("vertexShaderSource",t),T.typeOf.bool("columbusView2D",n),T.defined("mapProjection",i),qie(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Uie=new d,Vie=new he,zie={high:0,low:0};function qie(e,t,n,i,o,r,s,a){let l=i.slice();if(a.eastMostYhighDefine===""){let u=Vie;u.longitude=O.PI,u.latitude=0,u.height=0;let f=s.project(u,Uie),h=Hn.encode(f.x,zie);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`;let p=Vie;p.longitude=-O.PI,p.latitude=0,p.height=0;let g=s.project(p,Uie);h=Hn.encode(g.x,zie),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`}return n&&(l.push(a.eastMostYhighDefine),l.push(a.eastMostYlowDefine),l.push(a.westMostYhighDefine),l.push(a.westMostYlowDefine)),c(r)&&r instanceof rn&&l.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(l.push("TEXTURE_COORDINATES"),t||n||l.push("SPHERICAL"),n&&l.push("COLUMBUS_VIEW_2D")),new He({defines:l,sources:[o]})}function T6(){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(T6.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 Hie(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)/H.distance(t,e)}var NLe=[new H,new H,new H,new H];function Yie(e,t){let n=NLe,i=H.unpack(t,0,n[0]),o=H.unpack(t,2,n[1]),r=H.unpack(t,4,n[2]);e.uMaxVmax=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/Hie(i,o,r),a=1/Hie(i,r,o);e.uvMinAndExtents=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Xie=new he,Kie=new d,FLe=new d,BLe=new d,RV={high:0,low:0};function $ie(e,t,n){let i=Xie;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,Kie);i.latitude=e.north;let r=t.project(i,FLe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,BLe),a=[0,0,0,0],l=[0,0,0,0],u=Hn.encode(o.x,RV);a[0]=u.high,l[0]=u.low,u=Hn.encode(o.y,RV),a[1]=u.high,l[1]=u.low,u=Hn.encode(r.y,RV),a[2]=u.high,l[2]=u.low,u=Hn.encode(s.x,RV),a[3]=u.high,l[3]=u.low,n.planes2D_HIGH=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:l})}var kLe=new B,ULe=new B,Gie=new d,VLe=new he,zLe=[new he,new he,new he,new he,new he,new he,new he,new he];function HLe(e,t,n,i,o,r){let s=ce.center(e,VLe);s.height=n;let a=he.toCartesian(s,t,Gie),l=Ot.eastNorthUpToFixedFrame(a,t,kLe),u=B.inverse(l,ULe),f=e.west,h=e.east,p=e.north,g=e.south,m=zLe;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=h,m[3].latitude=g,m[3].longitude=h;let y=(f+h)*.5,b=(p+g)*.5;m[4].latitude=g,m[4].longitude=y,m[5].latitude=p,m[5].longitude=y,m[6].latitude=b,m[6].longitude=f,m[7].latitude=b,m[7].longitude=h;let x=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,C=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let L=he.toCartesian(m[R],t,Gie);B.multiplyByPoint(u,L,L),L.z=0,x=Math.min(x,L.x),A=Math.max(A,L.x),C=Math.min(C,L.y),S=Math.max(S,L.y)}let v=i;v.x=x,v.y=C,v.z=0,B.multiplyByPoint(l,v,v);let P=o;P.x=A,P.y=C,P.z=0,B.multiplyByPoint(l,P,P),d.subtract(P,v,o);let M=r;M.x=x,M.y=S,M.z=0,B.multiplyByPoint(l,M,M),d.subtract(M,v,r)}var GLe=new d,jLe=new d,WLe=new Hn;Pf.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){T.typeOf.object("boundingRectangle",e),T.defined("textureCoordinateRotationPoints",t),T.typeOf.object("ellipsoid",n),T.typeOf.object("projection",i);let r=Kie,s=GLe,a=jLe;HLe(e,n,o??0,r,s,a);let l={};Yie(l,t);let u=Hn.fromCartesian(r,WLe);return l.southWest_HIGH=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.high,[0,0,0])}),l.southWest_LOW=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.low,[0,0,0])}),l.eastward=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(s,[0,0,0])}),l.northward=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(a,[0,0,0])}),$ie(e,i,l),l};var qLe=new d;function jie(e,t,n,i){let o=Xie;o.latitude=e,o.longitude=t,o.height=0;let r=he.toCartesian(o,n,qLe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=O.fastApproximateAtan2(s,r.z),l=O.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=l,i}var Wie=new H;Pf.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){T.typeOf.object("boundingRectangle",e),T.defined("textureCoordinateRotationPoints",t),T.typeOf.object("ellipsoid",n),T.typeOf.object("projection",i);let o=jie(e.south,e.west,n,Wie),r=o.x,s=o.y,a=jie(e.north,e.east,n,Wie),l=a.x,u=a.y,f=0;s>u&&(f=O.PI-s,s=-O.PI,u+=f),r-=O.EPSILON5,s-=O.EPSILON5,l+=O.EPSILON5,u+=O.EPSILON5;let h=1/(u-s),p=1/(l-r),g={sphericalExtents:new hc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,h]}),longitudeRotation:new hc({componentDatatype:$.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Yie(g,t),$ie(e,i,g),g};Pf.hasAttributesForTextureCoordinatePlanes=function(e){return c(e.southWest_HIGH)&&c(e.southWest_LOW)&&c(e.northward)&&c(e.eastward)&&c(e.planes2D_HIGH)&&c(e.planes2D_LOW)&&c(e.uMaxVmax)&&c(e.uvMinAndExtents)};Pf.hasAttributesForSphericalExtents=function(e){return c(e.sphericalExtents)&&c(e.longitudeRotation)&&c(e.planes2D_HIGH)&&c(e.planes2D_LOW)&&c(e.uMaxVmax)&&c(e.uvMinAndExtents)};function YLe(e){return Math.max(e.width,e.height)>Pf.MAX_WIDTH_FOR_PLANAR_EXTENTS}Pf.shouldUseSphericalCoordinates=function(e){return T.typeOf.object("rectangle",e),YLe(e)};Pf.MAX_WIDTH_FOR_PLANAR_EXTENTS=O.toRadians(1);var bu=Pf;var XLe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},Vn=Object.freeze(XLe);var KLe={ZERO:ne.ZERO,KEEP:ne.KEEP,REPLACE:ne.REPLACE,INCREMENT:ne.INCR,DECREMENT:ne.DECR,INVERT:ne.INVERT,INCREMENT_WRAP:ne.INCR_WRAP,DECREMENT_WRAP:ne.DECR_WRAP},ft=Object.freeze(KLe);var MV={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};MV.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Vn.ALWAYS,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},backFunction:Vn.ALWAYS,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},reference:MV.CESIUM_3D_TILE_MASK,mask:MV.CESIUM_3D_TILE_MASK}};var kt=Object.freeze(MV);function Lb(e){e=e??W.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??Un.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(Lb.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}}});Lb.isSupported=function(e){return e.context.stencilBuffer};function CC(e,t){let n=t?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:n,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:dc.LESS_OR_EQUAL},depthMask:!1}}function C6(e){return{stencilTest:{enabled:e,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND}}var $Le={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function ZLe(e,t,n,i){if(c(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(CC(o,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(CC(o,!0)),e._rsColorPass=Ve.fromCache(C6(o,!1)),e._rsPickPass=Ve.fromCache($Le)}function QLe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection; `,r=` extrudeDirection = czm_octDecode(${n}, 65535.0); `,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=He.replaceMain(s,"czm_non_compressed_main");let a=`void main() { ${r} czm_non_compressed_main(); }`;return[i,o,s,a].join(` `)}}function JLe(e,t){let n=t.context,i=e._primitive,o=uO;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Pn._appendDistanceDisplayConditionToShader(i,o),o=Pn._modifyShaderPosition(e,o,t.scene3DOnly),o=Pn._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=QLe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",l=new He({defines:[a],sources:[o]}),u=new He({sources:[Jg]}),f=e._primitive._attributeLocations,h=new bu(s,r,e.appearance);if(e._spStencil=Jt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=He.createPickVertexShaderSource(o);m=Pn._appendShowToShader(i,m),m=Pn._updatePickColorAttribute(m);let y=h.createPickFragmentShader(!1),b=h.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=Jt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:y,attributeLocations:f}),s){let x=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!c(x)){let A=h.createPickFragmentShader(!0),C=h.createPickVertexShader([a],m,!0,t.mapProjection);x=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:f})}e._spPick2D=x}}else e._spPick=Jt.fromCache({context:n,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:f});o=Pn._appendShowToShader(i,o),l=new He({defines:[a],sources:[o]}),e._sp=Jt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:f});let p=h.createFragmentShader(!1),g=h.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=Jt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!c(m)){let y=h.createFragmentShader(!0),b=h.createVertexShader([a],o,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:y,attributeLocations:f})}e._spColor2D=m}}function eNe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,l=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o0&&(l=o[0].attributes,p=bu.hasAttributesForSphericalExtents(l),g=bu.hasAttributesForTextureCoordinatePlanes(l),h=l.color),s=0;s{c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Lb.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new E("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};Lb.prototype.isDestroyed=function(){return!1};Lb.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,de(this)};var EC=Lb;var oNe={u_globeMinimumAltitude:function(){return 55e3}};function Nl(e){e=e??W.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!c(t)&&c(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s{!this._ready&&c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Nl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Nl.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new E("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};Nl.prototype.isDestroyed=function(){return!1};Nl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};Nl._supportsMaterials=function(e){return e.depthTexture};Nl.supportsMaterials=function(e){return T.typeOf.object("scene",e),Nl._supportsMaterials(e.frameState.context)};var jc=Nl;function SC(){E.throwInstantiationError()}Object.defineProperties(SC.prototype,{isConstant:{get:E.throwInstantiationError},definitionChanged:{get:E.throwInstantiationError}});SC.prototype.getType=E.throwInstantiationError;SC.prototype.getValue=E.throwInstantiationError;SC.prototype.equals=E.throwInstantiationError;var hNe=new Q;SC.getValue=function(e,t,n){let i;return c(e)||(e=Q.now(hNe)),c(t)&&(i=t.getType(e),c(i))?((!c(n)||n.type!==i)&&(n=Xi.fromType(i)),t.getValue(e,n.uniforms),n):((!c(n)||n.type!==Xi.ColorType)&&(n=Xi.fromType(Xi.ColorType)),G.clone(G.WHITE,n.uniforms.color),n)};var tr=SC;function Nb(e,t,n){T.defined("geometryUpdater",e),T.defined("primitives",t),T.defined("orderedGroundPrimitives",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}Nb.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};Nb.prototype._setOptions=E.throwInstantiationError;Nb.prototype.update=function(e){T.defined("time",e);let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),l=this._options;if(!c(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Ut,h,p=t._getIsClosed(l);if(f)h=new rn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=tr.getValue(e,u,this._material);this._material=g,h=new ao({material:g,translucent:g.isTranslucent(),closed:p})}if(n)l.vertexFormat=rn.VERTEX_FORMAT,this._primitive=o.add(new jc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),X.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{l.vertexFormat=h.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(h.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Pn({geometryInstances:g,appearance:h,asynchronous:!1,shadows:a}))}}if(!n&&c(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=X.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Pn({geometryInstances:u,appearance:new rn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};Nb.prototype.getBoundingSphere=function(e){if(!c(e))throw new E("result is required.");let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return c(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),c(o)&&c(o.boundingSphere))?(le.clone(o.boundingSphere,e),lt.DONE):c(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),c(o)&&c(o.boundingSphere))?(le.clone(o.boundingSphere,e),lt.DONE):c(n)&&!n.ready||c(i)&&!i.ready?lt.PENDING:lt.FAILED};Nb.prototype.isDestroyed=function(){return!1};Nb.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),de(this)};var ni=Nb;var noe={};function pO(e,t){if(!c(e))throw new E("identifier is required.");c(noe[e])||(noe[e]=!0,console.warn(t??e))}pO.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.";pO.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";pO.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";pO.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var dt=pO;var mNe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},Bp=Object.freeze(mNe);var pNe={NONE:0,GEODESIC:1,RHUMB:2},qt=Object.freeze(pNe);var ioe=O.EPSILON10;function _Ne(e,t,n,i){if(T.defined("equalsEpsilon",t),!c(e))return;n=n??!1;let o=c(i),r=e.length;if(r<2)return e;let s,a=e[0],l,u,f=0,h=-1;for(s=1;sO.EPSILON12);let w=F*(t*t-n*n)/(n*n),D=1+w*(4096+w*(w*(320-175*w)-768))/16384,I=w*(256+w*(w*(74-47*w)-128))/1024,N=_*_,k=I*L*(_+I*(R*(2*N-1)-I*_*(4*L*L-3)*(4*N-3)/6)/4),z=n*D*(M-k),V=Math.atan2(g*P,b-A*v),j=Math.atan2(h*P,b*v-A);e._distance=z,e._startHeading=V,e._endHeading=j,e._uSquared=w}var xNe=new d,w6=new d;function roe(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,w6),xNe),r=d.normalize(i.cartographicToCartesian(n,w6),w6);T.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(d.angleBetween(o,r))-Math.PI),.0125),bNe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,gNe(e)}function _O(e,t,n){let i=n??ie.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,c(e)&&c(t)&&roe(this,e,t,i)}Object.defineProperties(_O.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return T.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return T.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return T.defined("distance",this._distance),this._endHeading}}});_O.prototype.setEndPoints=function(e,t){T.defined("start",e),T.defined("end",t),roe(this,e,t,this._ellipsoid)};_O.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};_O.prototype.interpolateUsingSurfaceDistance=function(e,t){T.defined("distance",this._distance);let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),l=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),h=i*i,p=i*h,g=n.u8Over256,m=n.u2Over4,y=n.u6Over64,b=n.u4Over16,x=2*p*g*o/3+i*(1-m+7*b/4-15*y/4+579*g/64-(b-15*y/4+187*g/16)*o-(5*y/4-115*g/16)*r-29*g*s/16)+(m/2-b+71*y/32-85*g/16)*a+(5*b/16-5*y/4+383*g/96)*l-h*((y-11*g/2)*a+5*g*l/2)+(29*y/96-29*g/16)*u+539*g*f/1536,A=Math.asin(Math.sin(x)*n.cosineAlpha),C=Math.atan(n.a/n.b*Math.tan(A));x=x-n.sigma;let S=Math.cos(2*n.sigma+x),v=Math.sin(x),P=Math.cos(x),M=n.cosineU*P,R=n.sineU*v,F=Math.atan2(v*n.sineHeading,M-R*n.cosineHeading)-ooe(n.f,n.sineAlpha,n.cosineSquaredAlpha,x,v,P,S);return c(t)?(t.longitude=this._start.longitude+F,t.latitude=C,t.height=0,t):new he(this._start.longitude+F,C,0)};var kp=_O;function D6(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,l=a*i,u=n,f=Math.sin(2*u),h=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),y=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*l/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*l/524288)*f+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*l/8388608)*h-(35*r/3072+175*s/12288+3675*a/262144+13475*l/1048576)*p+(315*s/131072+2205*a/524288+43659*l/8388608)*g-(693*a/1310720+6237*l/5242880)*m+1001*l/8388608*y)}function TNe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,l=a*a,u=l*l,f=u*l,h=f*l,p=h*l,g=p*l,m=Math.sin(2*i),y=Math.cos(2*i),b=Math.sin(4*i),x=Math.cos(4*i),A=Math.sin(6*i),C=Math.cos(6*i),S=Math.sin(8*i),v=Math.cos(8*i),P=Math.sin(10*i),M=Math.cos(10*i),R=Math.sin(12*i);return i+i*l/4+7*i*u/64+15*i*f/256+579*i*h/16384+1515*i*p/65536+16837*i*g/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*s)*g/5242880)*y+(21*i*f/256+483*i*h/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*x+(151*i*h/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*C+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*M+(3*l/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+s*p/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*m+(21*u/256+21*f/256+533*h/8192-21*o*h/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*b+(151*f/6144+151*h/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*A+(1097*h/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*S+(8011*p/2621440+8011*g/1048576)*P+293393*g/251658240*R}function wC(e,t){if(e===0)return Math.log(Math.tan(.5*(O.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(O.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function ANe(e,t,n,i,o){let r=wC(e._ellipticity,n),s=wC(e._ellipticity,o);return Math.atan2(O.negativePiToPi(i-t),s-r)}function CNe(e,t,n,i,o,r,s){let a=e._heading,l=r-i,u=0;if(O.equalsEpsilon(Math.abs(a),O.PI_OVER_TWO,O.EPSILON8))if(t===n)u=t*Math.cos(o)*O.negativePiToPi(l);else{let f=Math.sin(o);u=t*Math.cos(o)*O.negativePiToPi(l)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=D6(e._ellipticity,t,o);u=(D6(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var ENe=new d,v6=new d;function soe(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,v6),ENe),r=d.normalize(i.cartographicToCartesian(n,v6),v6);T.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(d.angleBetween(o,r))-Math.PI),.0125);let s=i.maximumRadius,a=i.minimumRadius,l=s*s,u=a*a;e._ellipticitySquared=(l-u)/l,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=ANe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=CNe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function aoe(e,t,n,i,o,r){if(n===0)return he.clone(e,r);let s=o*o,a,l,u;if(Math.abs(O.PI_OVER_TWO-Math.abs(t))>O.EPSILON8){let f=D6(o,i,e.latitude),h=n*Math.cos(t),p=f+h;if(l=TNe(p,o,i),Math.abs(t)0?a=O.negativePiToPi(e.longitude+u):a=O.negativePiToPi(e.longitude-u)}return c(r)?(r.longitude=a,r.latitude=l,r.height=0,r):new he(a,l,0)}function Up(e,t,n){let i=n??ie.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,c(e)&&c(t)&&soe(this,e,t,i)}Object.defineProperties(Up.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return T.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return T.defined("distance",this._distance),this._heading}}});Up.fromStartHeadingDistance=function(e,t,n,i,o){T.defined("start",e),T.defined("heading",t),T.defined("distance",n),T.typeOf.number.greaterThan("distance",n,0);let r=i??ie.default,s=r.maximumRadius,a=r.minimumRadius,l=s*s,u=a*a,f=Math.sqrt((l-u)/l);t=O.negativePiToPi(t);let h=aoe(e,t,n,r.maximumRadius,f);return!c(o)||c(i)&&!i.equals(o.ellipsoid)?new Up(e,h,r):(o.setEndPoints(e,h),o)};Up.prototype.setEndPoints=function(e,t){T.defined("start",e),T.defined("end",t),soe(this,e,t,this._ellipsoid)};Up.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Up.prototype.interpolateUsingSurfaceDistance=function(e,t){if(T.typeOf.number("distance",e),!c(this._distance)||this._distance===0)throw new E("EllipsoidRhumbLine must have distinct start and end set.");return aoe(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Up.prototype.findIntersectionWithLongitude=function(e,t){if(T.typeOf.number("intersectionLongitude",e),!c(this._distance)||this._distance===0)throw new E("EllipsoidRhumbLine must have distinct start and end set.");let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=O.negativePiToPi(e),O.equalsEpsilon(Math.abs(e),Math.PI,O.EPSILON14)&&(e=O.sign(r.longitude)*Math.PI),c(t)||(t=new he),Math.abs(O.PI_OVER_TWO-o)<=O.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(O.equalsEpsilon(Math.abs(O.PI_OVER_TWO-o),O.PI_OVER_TWO,O.EPSILON8))return O.equalsEpsilon(e,r.longitude,O.EPSILON12)?void 0:(t.longitude=e,t.latitude=O.PI_OVER_TWO*O.sign(O.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),l=Math.tan(.5*(O.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,h;do{h=f;let p=n*Math.sin(h),g=(1+p)/(1-p);f=2*Math.atan(l*Math.pow(g/u,n/2))-O.PI_OVER_TWO}while(!O.equalsEpsilon(f,h,O.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};Up.prototype.findIntersectionWithLatitude=function(e,t){if(T.typeOf.number("intersectionLatitude",e),!c(this._distance)||this._distance===0)throw new E("EllipsoidRhumbLine must have distinct start and end set.");let n=this._ellipticity,i=this._heading,o=this._start;if(O.equalsEpsilon(Math.abs(i),O.PI_OVER_TWO,O.EPSILON8))return;let r=wC(n,o.latitude),s=wC(n,e),a=Math.tan(i)*(s-r),l=O.negativePiToPi(o.longitude+a);return c(t)?(t.longitude=l,t.latitude=e,t.height=0,t):new he(l,e,0)};var Ba=Up;var F6=[Oi,Mi],SNe=F6.length,voe=Math.cos(O.toRadians(30)),coe=Math.cos(O.toRadians(150)),Doe=0,Poe=1e3;function ty(e){e=e??W.EMPTY_OBJECT;let t=e.positions;if(!c(t)||t.length<2)throw new E("At least two positions are required.");if(c(e.arcType)&&e.arcType!==qt.GEODESIC&&e.arcType!==qt.RHUMB)throw new E("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??qt.GEODESIC,this._ellipsoid=ie.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(ty.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ie.packedLength+1+1}}});ty.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;ivoe||rO.PI_OVER_TWO&&(a=!0,s=d.subtract(r,n,_oe),u=l.cartesianToCartographic(s,poe)),u.height=0;let f=e.project(u,o);return o=d.subtract(f,i,o),o.z=0,o=d.normalize(o,o),a&&d.negate(o,o),o}var WNe=new d,goe=new d;function yoe(e,t,n,i,o,r){let s=d.subtract(t,e,WNe);d.normalize(s,s);let a=n-Doe,l=d.multiplyByScalar(s,a,goe);d.add(e,l,o);let u=i-Poe;l=d.multiplyByScalar(s,u,goe),d.add(t,l,r)}var qNe=new d;function BV(e,t){let n=sn.getPointDistance(kV,e),i=sn.getPointDistance(kV,t),o=qNe;O.equalsEpsilon(n,0,O.EPSILON2)?(o=Vp(t,e,o),d.multiplyByScalar(o,O.EPSILON2,o),d.add(e,o,e)):O.equalsEpsilon(i,0,O.EPSILON2)&&(o=Vp(e,t,o),d.multiplyByScalar(o,O.EPSILON2,o),d.add(t,o,t))}function YNe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(O.equalsEpsilon(n,O.PI,O.EPSILON11)){let o=O.sign(t.longitude);return e.longitude=o*(n-O.EPSILON11),1}else if(O.equalsEpsilon(i,O.PI,O.EPSILON11)){let o=O.sign(e.longitude);return t.longitude=o*(i-O.EPSILON11),2}return 0}var Ooe=new he,Roe=new he,boe=new d,R6=new d,xoe=new d,Toe=new d,XNe=new d,Aoe=new d,KNe=[Ooe,Roe],$Ne=new ce,ZNe=new d,QNe=new d,JNe=new d,eFe=new d,tFe=new d,nFe=new d,M6=new d,L6=new d,iFe=new d,oFe=new d,rFe=new d,Coe=new d,sFe=new d,aFe=new d,cFe=new Hn,lFe=new Hn,Eoe=new d,uFe=new d,Soe=new d,fFe=[new le,new le],Moe=[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],woe=Moe.length;function dFe(e,t,n,i,o,r,s){let a,l,u=t._ellipsoid,f=n.length/3-1,h=f*8,p=h*4,g=f*36,m=h>65535?new Uint32Array(g):new Uint16Array(g),y=new Float64Array(h*3),b=new Float32Array(p),x=new Float32Array(p),A=new Float32Array(p),C=new Float32Array(p),S=new Float32Array(p),v,P,M,R;s&&(v=new Float32Array(p),P=new Float32Array(p),M=new Float32Array(p),R=new Float32Array(h*2));let L=r.length/2,F=0,_=Ooe;_.height=0;let w=Roe;w.height=0;let D=boe,I=R6;if(s)for(l=0,a=1;avoe?(jt=gO(t,_,qe,it,M6),$e=gO(t,w,Z,Dt,L6)):_i===1?($e=gO(t,w,Z,Dt,L6),jt.x=0,jt.y=O.sign(_.longitude-Math.abs(w.longitude)),jt.z=0):(jt=gO(t,_,qe,it,M6),$e.x=0,$e.y=O.sign(_.longitude-w.longitude),$e.z=0)}let un=d.distance(ze,K),zt=Hn.fromCartesian(Ee,cFe),Ct=d.subtract(te,Ee,iFe),Ei=d.normalize(Ct,Coe),an=d.subtract(ze,Ee,oFe);an=d.normalize(an,an);let _e=d.cross(Ei,an,Coe);_e=d.normalize(_e,_e);let Ce=d.cross(an,qe,sFe);Ce=d.normalize(Ce,Ce);let pn=d.subtract(K,te,rFe);pn=d.normalize(pn,pn);let mt=d.cross(Z,pn,aFe);mt=d.normalize(mt,mt);let so=un/k,Ro=ee/k,aa=0,Nr,Cs,Ne,ot=0,Xe=0;if(s){aa=d.distance(it,Dt),Nr=Hn.fromCartesian(it,lFe),Cs=d.subtract(Dt,it,Eoe),Ne=d.normalize(Cs,uFe);let _i=Ne.x;Ne.x=Ne.y,Ne.y=-_i,ot=aa/F,Xe=me/F}for(z=0;z<8;z++){let _i=q+z*4,ca=j+z*2,Jr=_i+3,El=z<4?1:-1,yo=z===2||z===3||z===6||z===7?1:-1;d.pack(zt.high,b,_i),b[Jr]=Ct.x,d.pack(zt.low,x,_i),x[Jr]=Ct.y,d.pack(Ce,A,_i),A[Jr]=Ct.z,d.pack(mt,C,_i),C[Jr]=so*El,d.pack(_e,S,_i);let Fr=Ro*yo;Fr===0&&yo<0&&(Fr=9),S[Jr]=Fr,s&&(v[_i]=Nr.high.x,v[_i+1]=Nr.high.y,v[_i+2]=Nr.low.x,v[_i+3]=Nr.low.y,M[_i]=-jt.y,M[_i+1]=jt.x,M[_i+2]=$e.y,M[_i+3]=-$e.x,P[_i]=Cs.x,P[_i+1]=Cs.y,P[_i+2]=Ne.x,P[_i+3]=Ne.y,R[ca]=ot*El,Fr=Xe*yo,Fr===0&&yo<0&&(Fr=9),R[ca+1]=Fr)}let Ze=JNe,pt=eFe,Ht=ZNe,Cn=QNe,Mo=ce.fromCartographicArray(KNe,$Ne),Ao=ui.getMinimumMaximumHeights(Mo,u),Za=Ao.minimumTerrainHeight,Qa=Ao.maximumTerrainHeight;Te+=Math.abs(Za),Te+=Math.abs(Qa),yoe(Ee,ze,Za,Qa,Ze,Ht),yoe(te,K,Za,Qa,pt,Cn);let Si=d.multiplyByScalar(_e,O.EPSILON5,Soe);d.add(Ze,Si,Ze),d.add(pt,Si,pt),d.add(Ht,Si,Ht),d.add(Cn,Si,Cn),BV(Ze,pt),BV(Ht,Cn),d.pack(Ze,y,U),d.pack(pt,y,U+3),d.pack(Cn,y,U+6),d.pack(Ht,y,U+9),Si=d.multiplyByScalar(_e,-2*O.EPSILON5,Soe),d.add(Ze,Si,Ze),d.add(pt,Si,pt),d.add(Ht,Si,Ht),d.add(Cn,Si,Cn),BV(Ze,pt),BV(Ht,Cn),d.pack(Ze,y,U+12),d.pack(pt,y,U+15),d.pack(Cn,y,U+18),d.pack(Ht,y,U+21),V+=2,l+=3,j+=16,U+=24,q+=32,ee+=un,me+=aa}l=0;let ue=0;for(a=0;a 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 } vec3 alignedPlaneNormal; alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); 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 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 out_FragColor.rgb *= out_FragColor.a; czm_writeDepthClamp(); } `;var bO=`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) { 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 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); 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 xO=`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; #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 void main() { v_batchId = batchId; 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; 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); 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); 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)); 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); 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 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 vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); 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)); vec3 normalEC = normalize(cross(planeDirection, upOrDown)); vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; positionEc3D.xyz += geodeticSurfaceNormal; normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); 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)); normalEC = normalize(cross(planeDirection, upOrDown)); geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; positionEc2D.xyz += geodeticSurfaceNormal; normalEC *= sign(texcoordNormalization2D.x); #ifndef PER_INSTANCE_COLOR v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); #endif positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); #ifdef ANGLE_VARYING 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 TO=`in vec3 position3DHigh; in vec3 position3DLow; #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; #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); v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); vec4 startPlaneEC; startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); 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); vec4 startPlaneEC; startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); vec4 endPlaneEC; endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); 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 vec4 positionRelativeToEye = czm_computePosition(); vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; 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)); vec3 normalEC = normalize(cross(planeDirection, upOrDown)); 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)); 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 = width / dot(normalEC, v_rightPlaneEC.xyz); #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 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 AO=`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 xu=`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); float endPoint0Distance = czm_currentFrustum.x + p0.z; float denominator = -direction.z; if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) { culledByNearPlane = true; } else if (endPoint0Distance > 0.0) { float t = endPoint0Distance / denominator; if (t < 0.0 || t > magnitude) { culledByNearPlane = true; } else { p0 = p0 + t * direction; 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) { #ifdef POLYLINE_DASH vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); 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; 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 (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; 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); 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 B6=`${xu} ${AO}`,hFe=Ob;Vt.isInternetExplorer()||(B6=`#define CLIP_POLYLINE ${B6}`);function Bb(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Bb.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??B6,this._fragmentShaderSource=e.fragmentShaderSource??hFe,this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Bb.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}}});Bb.VERTEX_FORMAT=Ie.POSITION_ONLY;Bb.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Bb.prototype.isTranslucent=io.prototype.isTranslucent;Bb.prototype.getRenderState=io.prototype.getRenderState;var is=Bb;var CO=`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 kb=`#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 k6=`${xu} ${CO}`,mFe=kb;Vt.isInternetExplorer()||(k6=`#define CLIP_POLYLINE ${k6}`);function Ub(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Ub.VERTEX_FORMAT;this.material=c(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??k6,this._fragmentShaderSource=e.fragmentShaderSource??mFe,this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Ub.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}}});Ub.VERTEX_FORMAT=Ie.POSITION_AND_ST;Ub.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Ub.prototype.isTranslucent=io.prototype.isTranslucent;Ub.prototype.getRenderState=io.prototype.getRenderState;var ha=Ub;function zp(e){e=e??W.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;c(t)||(t=new ha),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??Un.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=Loe(!1),this._renderState3DTiles=Loe(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:!0},blending:ln.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(zp.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}}});zp.initializeTerrainHeights=function(){return ui.initialize()};function pFe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(TO);s=Pn._appendShowToShader(o,s),s=Pn._appendDistanceDisplayConditionToShader(o,s),s=Pn._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(xO);a=Pn._appendShowToShader(o,a),a=Pn._appendDistanceDisplayConditionToShader(o,a),a=Pn._modifyShaderPosition(e,a,t.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(yO),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",h="";c(n.material)?(h=c(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],g=new He({defines:u,sources:[s]}),m=new He({defines:p,sources:[h,l]});e._sp=Jt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:r});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!c(y)){let x=new He({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:x,fragmentShaderSource:m,attributeLocations:r})}e._sp2D=y;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!c(b)){let x=new He({defines:u.concat([`MAX_TERRAIN_HEIGHT ${ui._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});l=o._batchTable.getVertexShaderCallback()(bO);let A=new He({defines:p,sources:[h,l]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:x,fragmentShaderSource:A,attributeLocations:r})}e._spMorph=b}function Loe(e){return Ve.fromCache({cull:{enabled:!0},blending:ln.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function _Fe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof is?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let h=0;h{!this._ready&&c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};zp.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new E("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};zp.isSupported=function(e){return e.frameState.context.depthTexture};zp.prototype.isDestroyed=function(){return!1};zp.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,de(this)};var Vd=zp;var yFe=new H(1,1),bFe=!1,xFe=G.WHITE;function vC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(vC.prototype,{isConstant:{get:function(){return X.isConstant(this._image)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:fe("image"),repeat:fe("repeat"),color:fe("color"),transparent:fe("transparent")});vC.prototype.getType=function(e){return"Image"};var TFe=new Q;vC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(TFe)),c(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,yFe,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,xFe,t.color),X.getValueOrDefault(this._transparent,e,bFe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};vC.prototype.equals=function(e){return this===e||e instanceof vC&&X.equals(this._image,e._image)&&X.equals(this._repeat,e._repeat)&&X.equals(this._color,e._color)&&X.equals(this._transparent,e._transparent)};var ny=vC;function AFe(e){if(e instanceof G)return new Ut(e);if(typeof e=="string"||e instanceof we||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new ny;return t.image=e,t}throw new E(`Unable to infer material type: ${e}`)}function CFe(e,t){return fe(e,t,AFe)}var No=CFe;function EO(e){this._definitionChanged=new pe,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??W.EMPTY_OBJECT)}Object.defineProperties(EO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),dimensions:fe("dimensions"),heightReference:fe("heightReference"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});EO.prototype.clone=function(e){return c(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 EO(this)};EO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");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 Vb=EO;var EFe={FIXED:0,INERTIAL:1},Hi=Object.freeze(EFe);function DC(){E.throwInstantiationError()}Object.defineProperties(DC.prototype,{isConstant:{get:E.throwInstantiationError},definitionChanged:{get:E.throwInstantiationError},referenceFrame:{get:E.throwInstantiationError}});DC.prototype.getValue=E.throwInstantiationError;DC.prototype.getValueInReferenceFrame=E.throwInstantiationError;DC.prototype.equals=E.throwInstantiationError;var Foe=new J;DC.convertToReferenceFrame=function(e,t,n,i,o){if(!c(t))return t;if(c(o)||(o=new d),n===i)return d.clone(t,o);let r=Ot.computeIcrfToCentralBodyFixedMatrix(e,Foe);if(n===Hi.INERTIAL)return J.multiplyByVector(r,t,o);if(n===Hi.FIXED)return J.multiplyByVector(J.transpose(r,Foe),t,o)};var zd=DC;function zb(e,t){this._definitionChanged=new pe,this._value=d.clone(e),this._referenceFrame=t??Hi.FIXED}Object.defineProperties(zb.prototype,{isConstant:{get:function(){return!c(this._value)||this._referenceFrame===Hi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var SFe=new Q;zb.prototype.getValue=function(e,t){return c(e)||(e=Q.now(SFe)),this.getValueInReferenceFrame(e,Hi.FIXED,t)};zb.prototype.setValue=function(e,t){let n=!1;d.equals(this._value,e)||(n=!0,this._value=d.clone(e)),c(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};zb.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new E("time is required.");if(!c(t))throw new E("referenceFrame is required.");return zd.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};zb.prototype.equals=function(e){return this===e||e instanceof zb&&d.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var qc=zb;function SO(e){this._definitionChanged=new pe,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??W.EMPTY_OBJECT)}Object.defineProperties(SO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),width:fe("width"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),cornerType:fe("cornerType"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});SO.prototype.clone=function(e){return c(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 SO(this)};SO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");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 Hb=SO;function wFe(e){return e}function vFe(e,t){return fe(e,t,wFe)}var Yc=vFe;function wO(e){this._definitionChanged=new pe,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??W.EMPTY_OBJECT)}Object.defineProperties(wO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),length:fe("length"),topRadius:fe("topRadius"),bottomRadius:fe("bottomRadius"),heightReference:fe("heightReference"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),numberOfVerticalLines:fe("numberOfVerticalLines"),slices:fe("slices"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});wO.prototype.clone=function(e){return c(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 wO(this)};wO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");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 Gb=wO;function vO(e){this._definitionChanged=new pe,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??W.EMPTY_OBJECT)}Object.defineProperties(vO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),semiMajorAxis:fe("semiMajorAxis"),semiMinorAxis:fe("semiMinorAxis"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),rotation:fe("rotation"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),numberOfVerticalLines:fe("numberOfVerticalLines"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});vO.prototype.clone=function(e){return c(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 vO(this)};vO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");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 jb=vO;function DO(e){this._definitionChanged=new pe,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??W.EMPTY_OBJECT)}Object.defineProperties(DO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),radii:fe("radii"),innerRadii:fe("innerRadii"),minimumClock:fe("minimumClock"),maximumClock:fe("maximumClock"),minimumCone:fe("minimumCone"),maximumCone:fe("maximumCone"),heightReference:fe("heightReference"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),stackPartitions:fe("stackPartitions"),slicePartitions:fe("slicePartitions"),subdivisions:fe("subdivisions"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});DO.prototype.clone=function(e){return c(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 DO(this)};DO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");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 Wb=DO;function PO(e){this._definitionChanged=new pe,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??W.EMPTY_OBJECT)}Object.defineProperties(PO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),text:fe("text"),font:fe("font"),style:fe("style"),scale:fe("scale"),showBackground:fe("showBackground"),backgroundColor:fe("backgroundColor"),backgroundPadding:fe("backgroundPadding"),pixelOffset:fe("pixelOffset"),eyeOffset:fe("eyeOffset"),horizontalOrigin:fe("horizontalOrigin"),verticalOrigin:fe("verticalOrigin"),heightReference:fe("heightReference"),fillColor:fe("fillColor"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),translucencyByDistance:fe("translucencyByDistance"),pixelOffsetScaleByDistance:fe("pixelOffsetScaleByDistance"),scaleByDistance:fe("scaleByDistance"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance")});PO.prototype.clone=function(e){return c(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 PO(this)};PO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");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 Hd=PO;var DFe=new d(1,1,1),PFe=d.ZERO,IFe=Le.IDENTITY;function Boe(e,t,n){this.translation=d.clone(e??PFe),this.rotation=Le.clone(t??IFe),this.scale=d.clone(n??DFe)}Boe.prototype.equals=function(e){return this===e||c(e)&&d.equals(this.translation,e.translation)&&Le.equals(this.rotation,e.rotation)&&d.equals(this.scale,e.scale)};var iy=Boe;var U6=new iy;function IO(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(IO.prototype,{isConstant:{get:function(){return X.isConstant(this._translation)&&X.isConstant(this._rotation)&&X.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:fe("translation"),rotation:fe("rotation"),scale:fe("scale")});var OFe=new Q;IO.prototype.getValue=function(e,t){return c(e)||(e=Q.now(OFe)),c(t)||(t=new iy),t.translation=X.getValueOrClonedDefault(this._translation,e,U6.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,U6.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,U6.scale,t.scale),t};IO.prototype.equals=function(e){return this===e||e instanceof IO&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var qb=IO;function Hp(e,t){this._propertyNames=[],this._definitionChanged=new pe,c(e)&&this.merge(e,t)}Object.defineProperties(Hp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var QFe=new Q;IC.prototype.getValue=function(e,t){c(e)||(e=Q.now(QFe));let n=X.getValueOrDefault(this._heightReference,e,We.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,We.NONE);if(n===We.NONE&&!gC(i))return this._position=d.clone(d.ZERO,this._position),d.clone(d.ZERO,t);if(this._positionProperty.isConstant&&n!==We.CLIP_TO_GROUND)return d.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Hoe);if(!c(r)||d.equals(r,d.ZERO)||!c(o.globe))return d.clone(d.ZERO,t);if(d.equalsEpsilon(this._position,r,O.EPSILON10)&&n!==We.CLIP_TO_GROUND)return d.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=d.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);if(n===We.CLIP_TO_GROUND){let l=o.globe.ellipsoid.cartesianToCartographic(r,scratchCarto);return this._terrainHeight>=l.height?d.multiplyByScalar(s,this._terrainHeight-l.height,t):d.clone(d.ZERO,t)}return d.multiplyByScalar(s,this._terrainHeight,t)};IC.prototype.isDestroyed=function(){return!1};IC.prototype.destroy=function(){return c(this._removeEventListener)&&this._removeEventListener(),c(this._removeModeListener)&&this._removeModeListener(),c(this._removeCallbackFunc)&&this._removeCallbackFunc(),de(this)};var $b=IC;function JFe(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(!c(o))return;c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(c(r)){let s=new Wd(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new $b(this._scene,s,r)}}var qp=JFe;var Goe=d.ZERO,joe=new d,e2e=new d,Woe=new G;function t2e(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Tu(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new t2e(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}c(Object.create)&&(Tu.prototype=Object.create(ii.prototype),Tu.prototype.constructor=Tu);Object.defineProperties(Tu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Tu.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new E("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Woe)),c(a)||(a=G.WHITE),s.color=Gt.fromColor(a)}return c(this._options.offsetAttribute)&&(s.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Goe,joe))),new St({id:t,geometry:La.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Tu.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new E("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Woe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Goe,joe))),new St({id:t,geometry:Ud.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Tu.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Tu.prototype._isHidden=function(e,t){return!c(t.dimensions)||!c(e.position)||ii.prototype._isHidden.call(this,e,t)};Tu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};Tu.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==We.NONE?Zt.ALL:void 0};Tu.prototype._onEntityPropertyChanged=qp;Tu.DynamicGeometryUpdater=OC;function OC(e,t,n){ni.call(this,e,t,n)}c(Object.create)&&(OC.prototype=Object.create(ni.prototype),OC.prototype.constructor=OC);OC.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,e2e),o=this._options.dimensions;return!c(i)||!c(o)||ni.prototype._isHidden.call(this,e,t,n)};OC.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),o=this._options;o.dimensions=X.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==We.NONE?Zt.ALL:void 0};var HO=Tu;function Zb(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Hi.FIXED,this._definitionChanged=new pe,this.setCallback(e,t)}Object.defineProperties(Zb.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var n2e=new Q;Zb.prototype.getValue=function(e,t){return c(e)||(e=Q.now(n2e)),this.getValueInReferenceFrame(e,Hi.FIXED,t)};Zb.prototype.setCallback=function(e,t){if(!c(e))throw new E("callback is required.");if(!c(t))throw new E("isConstant is required.");let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Zb.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new E("time is required.");if(!c(t))throw new E("referenceFrame is required.");let i=this._callback(e,n);return zd.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Zb.prototype.equals=function(e){return this===e||e instanceof Zb&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var GO=Zb;/*! @license DOMPurify 3.2.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.2.3/LICENSE */var{entries:tre,setPrototypeOf:qoe,isFrozen:i2e,getPrototypeOf:o2e,getOwnPropertyDescriptor:r2e}=Object,{freeze:Zc,seal:Of,create:nre}=Object,{apply:Y6,construct:X6}=typeof Reflect<"u"&&Reflect;Zc||(Zc=function(t){return t});Of||(Of=function(t){return t});Y6||(Y6=function(t,n,i){return t.apply(n,i)});X6||(X6=function(t,n){return new t(...n)});var UV=Au(Array.prototype.forEach),Yoe=Au(Array.prototype.pop),jO=Au(Array.prototype.push),zV=Au(String.prototype.toLowerCase),H6=Au(String.prototype.toString),Xoe=Au(String.prototype.match),WO=Au(String.prototype.replace),s2e=Au(String.prototype.indexOf),a2e=Au(String.prototype.trim),qd=Au(Object.prototype.hasOwnProperty),$c=Au(RegExp.prototype.test),qO=c2e(TypeError);function Au(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:zV;qoe&&qoe(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(i2e(t)||(t[i]=r),o=r)}e[o]=!0}return e}function l2e(e){for(let t=0;t/gm),m2e=Of(/\$\{[\w\W]*}/gm),p2e=Of(/^data-[\-\w.\u00B7-\uFFFF]+$/),_2e=Of(/^aria-[\-\w]+$/),ire=Of(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),g2e=Of(/^(?:\w+script|data):/i),y2e=Of(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ore=Of(/^html$/i),b2e=Of(/^[a-z][.\w]*(-[.\w]+)+$/i),Joe=Object.freeze({__proto__:null,ARIA_ATTR:_2e,ATTR_WHITESPACE:y2e,CUSTOM_ELEMENT:b2e,DATA_ATTR:p2e,DOCTYPE_NAME:ore,ERB_EXPR:h2e,IS_ALLOWED_URI:ire,IS_SCRIPT_OR_DATA:g2e,MUSTACHE_EXPR:d2e,TMPLIT_EXPR:m2e}),XO={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},x2e=function(){return typeof window>"u"?null:window},T2e=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(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},ere=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function rre(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x2e(),t=cn=>rre(cn);if(t.version="3.2.3",t.removed=[],!e||!e.document||e.document.nodeType!==XO.document)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:g}=e,m=l.prototype,y=YO(m,"cloneNode"),b=YO(m,"remove"),x=YO(m,"nextSibling"),A=YO(m,"childNodes"),C=YO(m,"parentNode");if(typeof s=="function"){let cn=n.createElement("template");cn.content&&cn.content.ownerDocument&&(n=cn.content.ownerDocument)}let S,v="",{implementation:P,createNodeIterator:M,createDocumentFragment:R,getElementsByTagName:L}=n,{importNode:F}=i,_=ere();t.isSupported=typeof tre=="function"&&typeof C=="function"&&P&&P.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:w,ERB_EXPR:D,TMPLIT_EXPR:I,DATA_ATTR:N,ARIA_ATTR:k,IS_SCRIPT_OR_DATA:z,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:j}=Joe,{IS_ALLOWED_URI:U}=Joe,q=null,Y=Li({},[...Koe,...G6,...j6,...W6,...$oe]),te=null,K=Li({},[...Zoe,...q6,...Qoe,...VV]),Z=Object.seal(nre(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}})),ee=null,me=null,Te=!0,ue=!0,ye=!1,Ae=!0,Pe=!1,Ee=!0,ze=!1,qe=!1,it=!1,Dt=!1,jt=!1,$e=!1,un=!0,zt=!1,Ct="user-content-",Ei=!0,an=!1,_e={},Ce=null,pn=Li({},["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"]),mt=null,so=Li({},["audio","video","img","source","image","track"]),Ro=null,aa=Li({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Nr="http://www.w3.org/1998/Math/MathML",Cs="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml",ot=Ne,Xe=!1,Ze=null,pt=Li({},[Nr,Cs,Ne],H6),Ht=Li({},["mi","mo","mn","ms","mtext"]),Cn=Li({},["annotation-xml"]),Mo=Li({},["title","style","font","a","script"]),Ao=null,Za=["application/xhtml+xml","text/html"],Qa="text/html",Si=null,_i=null,ca=n.createElement("form"),Jr=function(Se){return Se instanceof RegExp||Se instanceof Function},El=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(_i&&_i===Se)){if((!Se||typeof Se!="object")&&(Se={}),Se=Qb(Se),Ao=Za.indexOf(Se.PARSER_MEDIA_TYPE)===-1?Qa:Se.PARSER_MEDIA_TYPE,Si=Ao==="application/xhtml+xml"?H6:zV,q=qd(Se,"ALLOWED_TAGS")?Li({},Se.ALLOWED_TAGS,Si):Y,te=qd(Se,"ALLOWED_ATTR")?Li({},Se.ALLOWED_ATTR,Si):K,Ze=qd(Se,"ALLOWED_NAMESPACES")?Li({},Se.ALLOWED_NAMESPACES,H6):pt,Ro=qd(Se,"ADD_URI_SAFE_ATTR")?Li(Qb(aa),Se.ADD_URI_SAFE_ATTR,Si):aa,mt=qd(Se,"ADD_DATA_URI_TAGS")?Li(Qb(so),Se.ADD_DATA_URI_TAGS,Si):so,Ce=qd(Se,"FORBID_CONTENTS")?Li({},Se.FORBID_CONTENTS,Si):pn,ee=qd(Se,"FORBID_TAGS")?Li({},Se.FORBID_TAGS,Si):{},me=qd(Se,"FORBID_ATTR")?Li({},Se.FORBID_ATTR,Si):{},_e=qd(Se,"USE_PROFILES")?Se.USE_PROFILES:!1,Te=Se.ALLOW_ARIA_ATTR!==!1,ue=Se.ALLOW_DATA_ATTR!==!1,ye=Se.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=Se.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pe=Se.SAFE_FOR_TEMPLATES||!1,Ee=Se.SAFE_FOR_XML!==!1,ze=Se.WHOLE_DOCUMENT||!1,Dt=Se.RETURN_DOM||!1,jt=Se.RETURN_DOM_FRAGMENT||!1,$e=Se.RETURN_TRUSTED_TYPE||!1,it=Se.FORCE_BODY||!1,un=Se.SANITIZE_DOM!==!1,zt=Se.SANITIZE_NAMED_PROPS||!1,Ei=Se.KEEP_CONTENT!==!1,an=Se.IN_PLACE||!1,U=Se.ALLOWED_URI_REGEXP||ire,ot=Se.NAMESPACE||Ne,Ht=Se.MATHML_TEXT_INTEGRATION_POINTS||Ht,Cn=Se.HTML_INTEGRATION_POINTS||Cn,Z=Se.CUSTOM_ELEMENT_HANDLING||{},Se.CUSTOM_ELEMENT_HANDLING&&Jr(Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Z.tagNameCheck=Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&Jr(Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Z.attributeNameCheck=Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&typeof Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Z.allowCustomizedBuiltInElements=Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pe&&(ue=!1),jt&&(Dt=!0),_e&&(q=Li({},$oe),te=[],_e.html===!0&&(Li(q,Koe),Li(te,Zoe)),_e.svg===!0&&(Li(q,G6),Li(te,q6),Li(te,VV)),_e.svgFilters===!0&&(Li(q,j6),Li(te,q6),Li(te,VV)),_e.mathMl===!0&&(Li(q,W6),Li(te,Qoe),Li(te,VV))),Se.ADD_TAGS&&(q===Y&&(q=Qb(q)),Li(q,Se.ADD_TAGS,Si)),Se.ADD_ATTR&&(te===K&&(te=Qb(te)),Li(te,Se.ADD_ATTR,Si)),Se.ADD_URI_SAFE_ATTR&&Li(Ro,Se.ADD_URI_SAFE_ATTR,Si),Se.FORBID_CONTENTS&&(Ce===pn&&(Ce=Qb(Ce)),Li(Ce,Se.FORBID_CONTENTS,Si)),Ei&&(q["#text"]=!0),ze&&Li(q,["html","head","body"]),q.table&&(Li(q,["tbody"]),delete ee.tbody),Se.TRUSTED_TYPES_POLICY){if(typeof Se.TRUSTED_TYPES_POLICY.createHTML!="function")throw qO('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Se.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qO('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=Se.TRUSTED_TYPES_POLICY,v=S.createHTML("")}else S===void 0&&(S=T2e(g,o)),S!==null&&typeof v=="string"&&(v=S.createHTML(""));Zc&&Zc(Se),_i=Se}},yo=Li({},[...G6,...j6,...u2e]),Fr=Li({},[...W6,...f2e]),xp=function(Se){let Pt=C(Se);(!Pt||!Pt.tagName)&&(Pt={namespaceURI:ot,tagName:"template"});let _n=zV(Se.tagName),Ar=zV(Pt.tagName);return Ze[Se.namespaceURI]?Se.namespaceURI===Cs?Pt.namespaceURI===Ne?_n==="svg":Pt.namespaceURI===Nr?_n==="svg"&&(Ar==="annotation-xml"||Ht[Ar]):!!yo[_n]:Se.namespaceURI===Nr?Pt.namespaceURI===Ne?_n==="math":Pt.namespaceURI===Cs?_n==="math"&&Cn[Ar]:!!Fr[_n]:Se.namespaceURI===Ne?Pt.namespaceURI===Cs&&!Cn[Ar]||Pt.namespaceURI===Nr&&!Ht[Ar]?!1:!Fr[_n]&&(Mo[_n]||!yo[_n]):!!(Ao==="application/xhtml+xml"&&Ze[Se.namespaceURI]):!1},es=function(Se){jO(t.removed,{element:Se});try{C(Se).removeChild(Se)}catch{b(Se)}},hf=function(Se,Pt){try{jO(t.removed,{attribute:Pt.getAttributeNode(Se),from:Pt})}catch{jO(t.removed,{attribute:null,from:Pt})}if(Pt.removeAttribute(Se),Se==="is")if(Dt||jt)try{es(Pt)}catch{}else try{Pt.setAttribute(Se,"")}catch{}},Ja=function(Se){let Pt=null,_n=null;if(it)Se=""+Se;else{let Ia=Xoe(Se,/^[\r\n\t ]+/);_n=Ia&&Ia[0]}Ao==="application/xhtml+xml"&&ot===Ne&&(Se=''+Se+"");let Ar=S?S.createHTML(Se):Se;if(ot===Ne)try{Pt=new p().parseFromString(Ar,Ao)}catch{}if(!Pt||!Pt.documentElement){Pt=P.createDocument(ot,"template",null);try{Pt.documentElement.innerHTML=Xe?v:Ar}catch{}}let tc=Pt.body||Pt.documentElement;return Se&&_n&&tc.insertBefore(n.createTextNode(_n),tc.childNodes[0]||null),ot===Ne?L.call(Pt,ze?"html":"body")[0]:ze?Pt.documentElement:tc},tb=function(Se){return M.call(Se.ownerDocument||Se,Se,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},la=function(Se){return Se instanceof h&&(typeof Se.nodeName!="string"||typeof Se.textContent!="string"||typeof Se.removeChild!="function"||!(Se.attributes instanceof f)||typeof Se.removeAttribute!="function"||typeof Se.setAttribute!="function"||typeof Se.namespaceURI!="string"||typeof Se.insertBefore!="function"||typeof Se.hasChildNodes!="function")},Sl=function(Se){return typeof a=="function"&&Se instanceof a};function ec(cn,Se,Pt){UV(cn,_n=>{_n.call(t,Se,Pt,_i)})}let hs=function(Se){let Pt=null;if(ec(_.beforeSanitizeElements,Se,null),la(Se))return es(Se),!0;let _n=Si(Se.nodeName);if(ec(_.uponSanitizeElement,Se,{tagName:_n,allowedTags:q}),Se.hasChildNodes()&&!Sl(Se.firstElementChild)&&$c(/<[/\w]/g,Se.innerHTML)&&$c(/<[/\w]/g,Se.textContent)||Se.nodeType===XO.progressingInstruction||Ee&&Se.nodeType===XO.comment&&$c(/<[/\w]/g,Se.data))return es(Se),!0;if(!q[_n]||ee[_n]){if(!ee[_n]&&pf(_n)&&(Z.tagNameCheck instanceof RegExp&&$c(Z.tagNameCheck,_n)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(_n)))return!1;if(Ei&&!Ce[_n]){let Ar=C(Se)||Se.parentNode,tc=A(Se)||Se.childNodes;if(tc&&Ar){let Ia=tc.length;for(let wl=Ia-1;wl>=0;--wl){let tm=y(tc[wl],!0);tm.__removalCount=(Se.__removalCount||0)+1,Ar.insertBefore(tm,x(Se))}}}return es(Se),!0}return Se instanceof l&&!xp(Se)||(_n==="noscript"||_n==="noembed"||_n==="noframes")&&$c(/<\/no(script|embed|frames)/i,Se.innerHTML)?(es(Se),!0):(Pe&&Se.nodeType===XO.text&&(Pt=Se.textContent,UV([w,D,I],Ar=>{Pt=WO(Pt,Ar," ")}),Se.textContent!==Pt&&(jO(t.removed,{element:Se.cloneNode()}),Se.textContent=Pt)),ec(_.afterSanitizeElements,Se,null),!1)},mf=function(Se,Pt,_n){if(un&&(Pt==="id"||Pt==="name")&&(_n in n||_n in ca))return!1;if(!(ue&&!me[Pt]&&$c(N,Pt))){if(!(Te&&$c(k,Pt))){if(!te[Pt]||me[Pt]){if(!(pf(Se)&&(Z.tagNameCheck instanceof RegExp&&$c(Z.tagNameCheck,Se)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(Se))&&(Z.attributeNameCheck instanceof RegExp&&$c(Z.attributeNameCheck,Pt)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(Pt))||Pt==="is"&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&$c(Z.tagNameCheck,_n)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(_n))))return!1}else if(!Ro[Pt]){if(!$c(U,WO(_n,V,""))){if(!((Pt==="src"||Pt==="xlink:href"||Pt==="href")&&Se!=="script"&&s2e(_n,"data:")===0&&mt[Se])){if(!(ye&&!$c(z,WO(_n,V,"")))){if(_n)return!1}}}}}}return!0},pf=function(Se){return Se!=="annotation-xml"&&Xoe(Se,j)},_f=function(Se){ec(_.beforeSanitizeAttributes,Se,null);let{attributes:Pt}=Se;if(!Pt||la(Se))return;let _n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0},Ar=Pt.length;for(;Ar--;){let tc=Pt[Ar],{name:Ia,namespaceURI:wl,value:tm}=tc,cv=Si(Ia),kc=Ia==="value"?tm:a2e(tm);if(_n.attrName=cv,_n.attrValue=kc,_n.keepAttr=!0,_n.forceKeepAttr=void 0,ec(_.uponSanitizeAttribute,Se,_n),kc=_n.attrValue,zt&&(cv==="id"||cv==="name")&&(hf(Ia,Se),kc=Ct+kc),Ee&&$c(/((--!?|])>)|<\/(style|title)/i,kc)){hf(Ia,Se);continue}if(_n.forceKeepAttr||(hf(Ia,Se),!_n.keepAttr))continue;if(!Ae&&$c(/\/>/i,kc)){hf(Ia,Se);continue}Pe&&UV([w,D,I],lJ=>{kc=WO(kc,lJ," ")});let cJ=Si(Se.nodeName);if(mf(cJ,cv,kc)){if(S&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!wl)switch(g.getAttributeType(cJ,cv)){case"TrustedHTML":{kc=S.createHTML(kc);break}case"TrustedScriptURL":{kc=S.createScriptURL(kc);break}}try{wl?Se.setAttributeNS(wl,Ia,kc):Se.setAttribute(Ia,kc),la(Se)?es(Se):Yoe(t.removed)}catch{}}}ec(_.afterSanitizeAttributes,Se,null)},Vo=function cn(Se){let Pt=null,_n=tb(Se);for(ec(_.beforeSanitizeShadowDOM,Se,null);Pt=_n.nextNode();)ec(_.uponSanitizeShadowNode,Pt,null),hs(Pt),_f(Pt),Pt.content instanceof r&&cn(Pt.content);ec(_.afterSanitizeShadowDOM,Se,null)};return t.sanitize=function(cn){let Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Pt=null,_n=null,Ar=null,tc=null;if(Xe=!cn,Xe&&(cn=""),typeof cn!="string"&&!Sl(cn))if(typeof cn.toString=="function"){if(cn=cn.toString(),typeof cn!="string")throw qO("dirty is not a string, aborting")}else throw qO("toString is not a function");if(!t.isSupported)return cn;if(qe||El(Se),t.removed=[],typeof cn=="string"&&(an=!1),an){if(cn.nodeName){let tm=Si(cn.nodeName);if(!q[tm]||ee[tm])throw qO("root node is forbidden and cannot be sanitized in-place")}}else if(cn instanceof a)Pt=Ja(""),_n=Pt.ownerDocument.importNode(cn,!0),_n.nodeType===XO.element&&_n.nodeName==="BODY"||_n.nodeName==="HTML"?Pt=_n:Pt.appendChild(_n);else{if(!Dt&&!Pe&&!ze&&cn.indexOf("<")===-1)return S&&$e?S.createHTML(cn):cn;if(Pt=Ja(cn),!Pt)return Dt?null:$e?v:""}Pt&&it&&es(Pt.firstChild);let Ia=tb(an?cn:Pt);for(;Ar=Ia.nextNode();)hs(Ar),_f(Ar),Ar.content instanceof r&&Vo(Ar.content);if(an)return cn;if(Dt){if(jt)for(tc=R.call(Pt.ownerDocument);Pt.firstChild;)tc.appendChild(Pt.firstChild);else tc=Pt;return(te.shadowroot||te.shadowrootmode)&&(tc=F.call(i,tc,!0)),tc}let wl=ze?Pt.outerHTML:Pt.innerHTML;return ze&&q["!doctype"]&&Pt.ownerDocument&&Pt.ownerDocument.doctype&&Pt.ownerDocument.doctype.name&&$c(ore,Pt.ownerDocument.doctype.name)&&(wl=" `+wl),Pe&&UV([w,D,I],tm=>{wl=WO(wl,tm," ")}),S&&$e?S.createHTML(wl):wl},t.setConfig=function(){let cn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};El(cn),qe=!0},t.clearConfig=function(){_i=null,qe=!1},t.isValidAttribute=function(cn,Se,Pt){_i||El({});let _n=Si(cn),Ar=Si(Se);return mf(_n,Ar,Pt)},t.addHook=function(cn,Se){typeof Se=="function"&&jO(_[cn],Se)},t.removeHook=function(cn){return Yoe(_[cn])},t.removeHooks=function(cn){_[cn]=[]},t.removeAllHooks=function(){_=ere()},t}var sre=rre();var A2e=0,K6={};function gm(e,t){T.typeOf.string("html",e);let n,i=e;c(K6[i])?n=K6[i]:(n=A2e++,K6[i]=n),t=t??!1,this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(gm.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(!c(this._element)){let e=sre.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{f[h]=void 0});for(let h=r;h0||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 c(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function E2e(e,t){if(Yd.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),c(e._specularEnvironmentMaps)){let n=new Yd(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}KO.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;H.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=H.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||c(this._previousSphericalHarmonicCoefficients)!==c(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(E2e(this,t),this._specularEnvironmentCubeMapDirty=!1),c(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!c(this._specularEnvironmentCubeMap)&&c(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!c(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!c(this._sphericalHarmonicCoefficients)&&c(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!c(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!c(this._specularEnvironmentCubeMap)&&c(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!c(this._sphericalHarmonicCoefficients)&&c(e.sphericalHarmonicCoefficients)};KO.prototype.isDestroyed=function(){return!1};KO.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),de(this)};var ex=KO;var Q6=Zo(du(),1);var Z6,are="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjNjVkZDYxOC01NmEwLTQ1ZmEtOGE2ZS1lYWUyODM4ZWQxYzQiLCJpZCI6MjU5LCJpYXQiOjE3NDYxMTA0Njl9.uyhPpCQKB1dodfbqTx0ZUPOLhnrSXd-qWixDxc4GYXk",HV={};HV.defaultAccessToken=are;HV.defaultServer=new we({url:"https://api.cesium.com/"});HV.getDefaultTokenCredit=function(e){if(e===are){if(!c(Z6)){let t=` This application is using Cesium's default ion access token. Please assign Cesium.Ion.defaultAccessToken with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at https://cesium.com.`;Z6=new Tt(t,!0)}return Z6}};var Xd=HV;function Qc(e,t){T.defined("endpoint",e),T.defined("endpointResource",t);let n,i=e.externalType,o=c(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:S2e};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new ae("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");we.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new Q6.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}c(Object.create)&&(Qc.prototype=Object.create(we.prototype),Qc.prototype.constructor=Qc);Qc.fromAssetId=function(e,t){let n=Qc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Qc(i,n)})};Object.defineProperties(Qc.prototype,{credits:{get:function(){return c(this._ionRoot)?this._ionRoot.credits:c(this._credits)?this._credits:(this._credits=Qc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Qc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Tt.getIonCredit),i=Xd.getDefaultTokenCredit(t.queryParameters.access_token);return c(i)&&n.push(Tt.clone(i)),n};Qc.prototype.clone=function(e){let t=this._ionRoot??this;return c(e)||(e=new Qc(t._ionEndpoint,t._ionEndpointResource)),e=we.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Qc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},c(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return we.prototype.fetchImage.call(this,e)};Qc.prototype._makeRequest=function(e){return this._isExternal||new Q6.default(this.url).authority()!==this._ionEndpointDomain?we.prototype._makeRequest.call(this,e):(c(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),we.prototype._makeRequest.call(this,e))};Qc._createEndpointResource=function(e,t){T.defined("assetId",e),t=t??W.EMPTY_OBJECT;let n=t.server??Xd.defaultServer,i=t.accessToken??Xd.defaultAccessToken;n=we.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return c(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function S2e(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,o=typeof Image<"u";return!c(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(c(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var Cu=Qc;function ym(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(ym.prototype,{length:{get:function(){return this._length},set:function(e){T.typeOf.number.greaterThanOrEquals("length",e,0);let t=this._array,n=this._length;if(et.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});ym.prototype.get=function(e){return T.typeOf.number.lessThan("index",e,this._array.length),this._array[e]};ym.prototype.set=function(e,t){T.typeOf.number("index",e),e>=this._length&&(this.length=e+1),this._array[e]=t};ym.prototype.peek=function(){return this._array[this._length-1]};ym.prototype.push=function(e){let t=this.length++;this._array[t]=e};ym.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};ym.prototype.reserve=function(e){T.typeOf.number.greaterThanOrEquals("length",e,0),e>this._array.length&&(this._array.length=e)};ym.prototype.resize=function(e){T.typeOf.number.greaterThanOrEquals("length",e,0),this.length=e};ym.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Jc=ym;var Yp={X:0,Y:1,Z:2};Yp.Y_UP_TO_Z_UP=B.fromRotationTranslation(J.fromArray([1,0,0,0,0,1,0,-1,0]));Yp.Z_UP_TO_Y_UP=B.fromRotationTranslation(J.fromArray([1,0,0,0,0,-1,0,1,0]));Yp.X_UP_TO_Z_UP=B.fromRotationTranslation(J.fromArray([0,0,1,0,1,0,-1,0,0]));Yp.Z_UP_TO_X_UP=B.fromRotationTranslation(J.fromArray([0,0,-1,0,1,0,1,0,0]));Yp.X_UP_TO_Y_UP=B.fromRotationTranslation(J.fromArray([0,1,0,-1,0,0,0,0,1]));Yp.Y_UP_TO_X_UP=B.fromRotationTranslation(J.fromArray([0,-1,0,1,0,0,0,0,1]));Yp.fromName=function(e){return T.typeOf.string("name",e),Yp[e]};var Fo=Object.freeze(Yp);function cre(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.metadata",e.metadata),this._metadata=e.metadata}Object.defineProperties(cre.prototype,{metadata:{get:function(){return this._metadata}}});var tx=cre;function oy(e,t,n){if(!c(e))throw new E("uint8Array is required.");if(t<0)throw new E("byteOffset cannot be negative.");if(n<0)throw new E("byteLength cannot be negative.");if(t+n>e.byteLength)throw new E("sub-region exceeds array bounds.");return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),oy.decode(e)}oy.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};oy.decodeWithFromCharCode=function(e){let t="",n=w2e(e),i=n.length;for(let o=0;o>10)+55296,(r&1023)+56320))}return t};function $O(e,t,n){return t<=e&&e<=n}function w2e(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let l=0;l0){let o=Math.min(t,ut.maximumTextureSize),r=Math.ceil(t/ut.maximumTextureSize),s=1/o,a=s*.5,l=1/r,u=l*.5;n=new H(o,r),i=new se(s,a,l,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(pc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return c(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),c(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}}});pc.DEFAULT_COLOR_VALUE=G.WHITE;pc.DEFAULT_SHOW_VALUE=!0;function lre(e){let t=e._textureDimensions;return t.x*t.y*4}function ure(e){if(!c(e._batchValues)){let t=lre(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function fre(e){if(!c(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}function JO(e,t){if(!c(e)||e<0||e>=t)throw new E(`batchId is required and between zero and featuresLength - 1 (${t}`-+").")}pc.prototype.setShow=function(e,t){if(JO(e,this._featuresLength),T.typeOf.bool("show",t),t&&!c(this._showAlphaProperties))return;let n=fre(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=ure(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};pc.prototype.setAllShow=function(e){T.typeOf.bool("show",e);let t=this._featuresLength;for(let n=0;n0){let i=e._pickIds,o=lre(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let l=0;l=a)throw new E(`Parent index ${t} exceeds the total number of instances: ${a}`);if(n.indexOf(t)>-1)throw new E("Circular dependency detected in the batch table hierarchy.");n.push(t);let l=c(i)?i[t]:1,u=c(i)?r[t]:t;for(let f=0;f0;){if(t=f.pop(),l[t]===u)continue;l[t]=u;let h=n(e,t);if(c(h))return h;let p=o[t],g=s[t];for(let m=0;m=t)throw new E(`batchId is required and must be between zero and featuresLength - 1 (${t}`-+").")}To.prototype.isClass=function(e,t){RC(e,this.featuresLength),T.typeOf.string("className",t);let n=this._batchTableHierarchy;return c(n)?n.isClass(e,t):!1};To.prototype.isExactClass=function(e,t){return T.typeOf.string("className",t),this.getExactClassName(e)===t};To.prototype.getExactClassName=function(e){RC(e,this.featuresLength);let t=this._batchTableHierarchy;if(c(t))return t.getClassName(e)};To.prototype.hasProperty=function(e,t){return RC(e,this.featuresLength),T.typeOf.string("name",t),c(this._properties[t])||c(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};To.prototype.hasPropertyBySemantic=function(){return!1};To.prototype.getPropertyIds=function(e,t){RC(e,this.featuresLength),t=c(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),c(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};To.prototype.getPropertyBySemantic=function(e,t){};To.prototype.getProperty=function(e,t){if(RC(e,this.featuresLength),T.typeOf.string("name",t),c(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(c(i))return Q2e(i,e)}let n=this._properties[t];if(c(n))return je(n[e],!0);if(c(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(c(i))return i}};To.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(RC(e,i),T.typeOf.string("name",t),c(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(c(r)){J2e(r,e,n);return}}if(c(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];c(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=je(n,!0)};function eBe(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)); } `}To.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=_re(o,n,!1),s;return ut.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; `),s+=`uniform sampler2D tile_batchTexture; out vec4 tile_featureColor; out vec2 tile_featureSt; void main() { vec2 st = computeSt(${t}); vec4 featureProperties = texture(tile_batchTexture, st); tile_color(featureProperties); float show = ceil(featureProperties.a); gl_Position *= show; `,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); if (czm_pass == czm_passTranslucent) { if (!isStyleTranslucent && !tile_translucentCommand) { gl_Position *= 0.0; } } else { if (isStyleTranslucent) { gl_Position *= 0.0; } } `),s+=` tile_featureColor = featureProperties; tile_featureSt = st; }`):s=`out vec2 tile_featureSt; void main() { tile_color(vec4(1.0)); tile_featureSt = computeSt(${t}); }`,`${r} ${eBe(i)}${s}`}};function mre(e,t){return e=He.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 tBe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u0?(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 nBe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Bl.HIGHLIGHT)return 0;if(n===Bl.REPLACE)return 1;if(n===Bl.MIX)return O.clamp(i,O.EPSILON4,1);throw new E(`Invalid color blend mode "${n}".`)}To.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return xt(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 nBe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};To.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var ry={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};To.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,l=iBe(this);for(let u=t;u>>kt.SKIP_LOD_BIT_SHIFT}function fBe(e){let t=je(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=ln.ALPHA_BLEND,t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}function dBe(e){let t=je(e,!0);return t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}To.prototype.update=function(e,t){this._batchTexture.update(e,t)};To.prototype.isDestroyed=function(){return!1};To.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),de(this)};var Kp=To;function hBe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var bm=hBe;var MC=`in vec3 position; in float a_batchId; uniform mat4 u_modifiedModelViewProjection; void main() { gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); } `;function Mf(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Mf.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return c(this._color)||(this._color=new G),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(c(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});Mf.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Mf.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Mf.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Mf.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(c(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(c(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(c(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(c(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),c(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let l=c(e.group)?e.group.metadata:void 0;if(c(l)){if(l.hasPropertyBySemantic(n))return l.getPropertyBySemantic(n);if(l.hasProperty(n))return l.getProperty(n)}let u=e.tileset.metadata;if(c(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};Mf.prototype.getPropertyInherited=function(e){return Mf.getPropertyInherited(this._content,this._batchId,e)};Mf.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Mf.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Mf.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Mf.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Ws=Mf;var t9=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)})}},n9=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)})}},kl=class e{static get version(){return"1.4.0"}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.index0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.lengthr.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&f(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),o.push(r,t)}for(l=o.length-1,t=o[l];l>1;)t={type:e.BINARY_EXP,operator:o[l-1].value,left:o[l-2],right:t},l-=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=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});kl.max_unop_len=kl.getMaxKeyLen(kl.unary_ops);kl.max_binop_len=kl.getMaxKeyLen(kl.binary_ops);var sy=e=>new kl(e).parse(),pBe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(kl).filter(e=>!pBe.includes(e)&&sy[e]===void 0).forEach(e=>{sy[e]=kl[e]});sy.Jsep=kl;var _Be="ConditionalExpression",gBe={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:_Be,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};sy.plugins.register(gBe);var yBe={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},_t=Object.freeze(yBe);function $d(e,t){T.typeOf.string("expression",e),this._expression=e,e=OBe(e,t),e=MBe(RBe(e)),sy.addBinaryOp("=~",0),sy.addBinaryOp("!~",0);let n;try{n=sy(e)}catch(i){throw new ae(i)}this._runtimeAst=wi(this,n)}Object.defineProperties($d.prototype,{expression:{get:function(){return this._expression}}});var Rn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new H],cartesian3Array:[new d],cartesian4Array:[new se],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new H),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 se),this.cartesian4Array[this.cartesian4Index++]}};$d.prototype.evaluate=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof G&&n instanceof se?G.fromCartesian4(n,t):n instanceof H||n instanceof d||n instanceof se?n.clone(t):n};$d.prototype.evaluateColor=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return G.fromCartesian4(n,t)};$d.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} { return ${o}; } `,o};$d.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};$d.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var bBe=["!","-","+"],gre=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],t1=/\${(.*?)}/g,xBe=/\\/g,TBe="@#%",ABe=/@#%/g,WV=new G,qV={abs:qs(Math.abs),sqrt:qs(Math.sqrt),cos:qs(Math.cos),sin:qs(Math.sin),tan:qs(Math.tan),acos:qs(Math.acos),asin:qs(Math.asin),atan:qs(Math.atan),radians:qs(O.toRadians),degrees:qs(O.toDegrees),sign:qs(O.sign),floor:qs(Math.floor),ceil:qs(Math.ceil),round:qs(Math.round),exp:qs(Math.exp),exp2:qs(EBe),log:qs(Math.log),log2:qs(SBe),fract:qs(CBe),length:wBe,normalize:vBe},YV={atan2:GV(Math.atan2,!1),pow:GV(Math.pow,!1),min:GV(Math.min,!0),max:GV(Math.max,!0),distance:DBe,dot:PBe,cross:IBe},r9={clamp:yre(O.clamp,!0),mix:yre(O.lerp,!0)};function CBe(e){return e-Math.floor(e)}function EBe(e){return Math.pow(2,e)}function SBe(e){return O.log2(e)}function qs(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof H)return H.fromElements(e(n.x),e(n.y),Rn.getCartesian2());if(n instanceof d)return d.fromElements(e(n.x),e(n.y),e(n.z),Rn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Rn.getCartesian4());throw new ae(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function GV(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof H)return H.fromElements(e(i.x,o),e(i.y,o),Rn.getCartesian2());if(i instanceof d)return d.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Rn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Rn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof H&&o instanceof H)return H.fromElements(e(i.x,o.x),e(i.y,o.y),Rn.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),Rn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),Rn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function yre(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 H&&o instanceof H)return H.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),Rn.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),Rn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),Rn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof H&&o instanceof H&&r instanceof H)return H.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),Rn.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),Rn.getCartesian3());if(i instanceof se&&o instanceof se&&r instanceof se)return se.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),Rn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function wBe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof H)return H.magnitude(t);if(t instanceof d)return d.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function vBe(e,t){if(typeof t=="number")return 1;if(t instanceof H)return H.normalize(t,Rn.getCartesian2());if(t instanceof d)return d.normalize(t,Rn.getCartesian3());if(t instanceof se)return se.normalize(t,Rn.getCartesian4());throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function DBe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof H&&n instanceof H)return H.distance(t,n);if(t instanceof d&&n instanceof d)return d.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function PBe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof H&&n instanceof H)return H.dot(t,n);if(t instanceof d&&n instanceof d)return d.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function IBe(e,t,n){if(t instanceof d&&n instanceof d)return d.cross(t,n,Rn.getCartesian3());throw new ae(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function At(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,GBe(this)}function OBe(e,t){if(!c(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;c(o)&&(e=e.replace(i,o))}return e}function RBe(e){return e.replace(xBe,TBe)}function o9(e){return e.replace(ABe,"\\")}function MBe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o=0&&r=0?new At(_t.VARIABLE_IN_STRING,e.value):new At(_t.LITERAL_STRING,o9(e.value))}function NBe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let l=t.callee.object;if(o==="test"||o==="exec"){if(!c(l.callee)||l.callee.name!=="regExp")throw new ae(`${o} is not a function.`);return i===0?o==="test"?new At(_t.LITERAL_BOOLEAN,!1):new At(_t.LITERAL_NULL,null):(s=wi(e,l),a=wi(e,n[0]),new At(_t.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=wi(e,l),new At(_t.FUNCTION_CALL,o,r);throw new ae(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new At(_t.LITERAL_COLOR,o);if(r=wi(e,n[0]),c(n[1])){let l=wi(e,n[1]);return new At(_t.LITERAL_COLOR,o,[r,l])}return new At(_t.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ae(`${o} requires three arguments.`);return r=[wi(e,n[0]),wi(e,n[1]),wi(e,n[2])],new At(_t.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ae(`${o} requires four arguments.`);return r=[wi(e,n[0]),wi(e,n[1]),wi(e,n[2]),wi(e,n[3])],new At(_t.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let l=0;l1)throw new ae(`${o} requires exactly one argument.`);return r=wi(e,n[0]),new At(_t.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ae(`${o} does not take any argument.`);return new At(_t.UNARY,o)}else if(c(qV[o])){if(i!==1)throw new ae(`${o} requires exactly one argument.`);return r=wi(e,n[0]),new At(_t.UNARY,o,r)}else if(c(YV[o])){if(i!==2)throw new ae(`${o} requires exactly two arguments.`);return s=wi(e,n[0]),a=wi(e,n[1]),new At(_t.BINARY,o,s,a)}else if(c(r9[o])){if(i!==3)throw new ae(`${o} requires exactly three arguments.`);s=wi(e,n[0]),a=wi(e,n[1]);let l=wi(e,n[2]);return new At(_t.TERNARY,o,s,a,l)}else{if(o==="Boolean")return i===0?new At(_t.LITERAL_BOOLEAN,!1):(r=wi(e,n[0]),new At(_t.UNARY,o,r));if(o==="Number")return i===0?new At(_t.LITERAL_NUMBER,0):(r=wi(e,n[0]),new At(_t.UNARY,o,r));if(o==="String")return i===0?new At(_t.LITERAL_STRING,""):(r=wi(e,n[0]),new At(_t.UNARY,o,r));if(o==="regExp")return FBe(e,t)}}throw new ae(`Unexpected function call "${o}".`)}function FBe(e,t){let n=t.arguments;if(n.length===0)return new At(_t.LITERAL_REGEX,new RegExp);let i=wi(e,n[0]),o;if(n.length>1){let r=wi(e,n[1]);if(i9(i)&&i9(r)){try{o=new RegExp(o9(String(i._value)),r._value)}catch(s){throw new ae(s)}return new At(_t.LITERAL_REGEX,o)}return new At(_t.REGEX,i,r)}if(i9(i)){try{o=new RegExp(o9(String(i._value)))}catch(r){throw new ae(r)}return new At(_t.LITERAL_REGEX,o)}return new At(_t.REGEX,i)}function BBe(e){if(zBe(e.name)){let t=HBe(e.name);return t.substr(0,8)==="tiles3d_"?new At(_t.BUILTIN_VARIABLE,t):new At(_t.VARIABLE,t)}else{if(e.name==="NaN")return new At(_t.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new At(_t.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new At(_t.LITERAL_UNDEFINED,void 0)}throw new ae(`${e.name} is not defined.`)}function kBe(e){let t=e.property.name;if(t==="PI")return new At(_t.LITERAL_NUMBER,Math.PI);if(t==="E")return new At(_t.LITERAL_NUMBER,Math.E)}function UBe(e){if(e.property.name==="POSITIVE_INFINITY")return new At(_t.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function VBe(e,t){if(t.object.name==="Math")return kBe(t);if(t.object.name==="Number")return UBe(t);let n,i=wi(e,t.object);return t.computed?(n=wi(e,t.property),new At(_t.MEMBER,"brackets",i,n)):(n=new At(_t.LITERAL_STRING,t.property.name),new At(_t.MEMBER,"dot",i,n))}function i9(e){return e._type>=_t.LITERAL_NULL}function zBe(e){return e.substr(0,4)==="czm_"}function HBe(e){return e.substr(4)}function wi(e,t){let n,i,o,r;if(t.type==="Literal")n=LBe(t);else if(t.type==="CallExpression")n=NBe(e,t);else if(t.type==="Identifier")n=BBe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=wi(e,t.argument);if(bBe.indexOf(i)>-1)n=new At(_t.UNARY,i,s);else throw new ae(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=wi(e,t.left),r=wi(e,t.right),gre.indexOf(i)>-1)n=new At(_t.BINARY,i,o,r);else throw new ae(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=wi(e,t.left),r=wi(e,t.right),gre.indexOf(i)>-1&&(n=new At(_t.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=wi(e,t.test);o=wi(e,t.consequent),r=wi(e,t.alternate),n=new At(_t.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=VBe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a"?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:c(YV[e._value])&&(e.evaluate=qBe(e._value)):e._type===_t.TERNARY?e.evaluate=YBe(e._value):e._type===_t.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===_t.ARRAY?e.evaluate=e._evaluateArray:e._type===_t.VARIABLE?e.evaluate=e._evaluateVariable:e._type===_t.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===_t.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===_t.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===_t.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===_t.REGEX?e.evaluate=e._evaluateRegExp:e._type===_t.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=jBe):e.evaluate=e._evaluateLiteral}function jBe(e){return c(e)?e.content.tileset.timeSinceLoad:0}function WBe(e){let t=qV[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function qBe(e){let t=YV[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function YBe(e){let t=r9[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 XV(e,t){if(c(e))return e.getPropertyInherited(t)}At.prototype._evaluateLiteral=function(){return this._value};At.prototype._evaluateLiteralColor=function(e){let t=WV,n=this._left;if(this._value==="color")c(n)?n.length>1?(G.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):G.fromCssColorString(n[0].evaluate(e),t):G.fromBytes(255,255,255,255,t);else if(this._value==="rgb")G.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;G.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?G.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&G.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,Rn.getCartesian4())};At.prototype._evaluateLiteralVector=function(e){let t=Rn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a1)throw new ae(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new ae(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return H.fromArray(t,0,Rn.getCartesian2());if(n==="vec3")return d.fromArray(t,0,Rn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,Rn.getCartesian4())};At.prototype._evaluateLiteralString=function(){return this._value};At.prototype._evaluateVariableString=function(e){let t=this._value,n=t1.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=XV(e,o);c(r)||(r=""),t=t.replace(i,r),t1.lastIndex+=r.length-i.length,n=t1.exec(t)}return t};At.prototype._evaluateVariable=function(e){return XV(e,this._value)};function ix(e){return e._value==="feature"}At.prototype._evaluateMemberDot=function(e){if(ix(this._left))return XV(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!c(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof d||t instanceof se){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};At.prototype._evaluateMemberBrackets=function(e){if(ix(this._left))return XV(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!c(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof d||t instanceof se){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};At.prototype._evaluateArray=function(e){let t=[];for(let n=0;n" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};At.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};At.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};At.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};At.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.add(t,n,Rn.getCartesian2());if(n instanceof d&&t instanceof d)return d.add(t,n,Rn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,Rn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new ae(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};At.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.subtract(t,n,Rn.getCartesian2());if(n instanceof d&&t instanceof d)return d.subtract(t,n,Rn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new ae(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};At.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.multiplyComponents(t,n,Rn.getCartesian2());if(n instanceof H&&typeof t=="number")return H.multiplyByScalar(n,t,Rn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.multiplyByScalar(t,n,Rn.getCartesian2());if(n instanceof d&&t instanceof d)return d.multiplyComponents(t,n,Rn.getCartesian3());if(n instanceof d&&typeof t=="number")return d.multiplyByScalar(n,t,Rn.getCartesian3());if(t instanceof d&&typeof n=="number")return d.multiplyByScalar(t,n,Rn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,Rn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,Rn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new ae(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};At.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.divideComponents(t,n,Rn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.divideByScalar(t,n,Rn.getCartesian2());if(n instanceof d&&t instanceof d)return d.divideComponents(t,n,Rn.getCartesian3());if(t instanceof d&&typeof n=="number")return d.divideByScalar(t,n,Rn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,Rn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new ae(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};At.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.fromElements(t.x%n.x,t.y%n.y,Rn.getCartesian2());if(n instanceof d&&t instanceof d)return d.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Rn.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new ae(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};At.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof d&&t instanceof d||n instanceof se&&t instanceof se?t.equals(n):t===n};At.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof d&&t instanceof d||n instanceof se&&t instanceof se?!t.equals(n):t!==n};At.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new ae(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};At.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};At.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};At.prototype._evaluateIsExactClass=function(e){return c(e)?e.isExactClass(this._left.evaluate(e)):!1};At.prototype._evaluateIsClass=function(e){return c(e)?e.isClass(this._left.evaluate(e)):!1};At.prototype._evaluateGetExactClassName=function(e){if(c(e))return e.getExactClassName()};At.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};At.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};At.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};At.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";c(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new ae(o)}return i};At.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`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)};At.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 ae(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};At.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 ae(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};At.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`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 c(i)?i[1]:null};At.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof H||t instanceof d||t instanceof se)return String(t);throw new ae(`Unexpected function call "${this._value}".`)};function bre(e){let t=e._left,n=t.length;for(let a=0;a1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(l==="rgb")return i=xre(this),c(i)?jV(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(l==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=xre(this),c(i)?jV(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(l==="hsl")return i=bre(this),c(i)?jV(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(l==="hsla")return i=bre(this),c(i)?(i.alpha!==1&&(t.translucent=!0),jV(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case _t.LITERAL_VECTOR:if(!c(o))throw new E("left should always be defined for type ExpressionNodeType.LITERAL_VECTOR");f=o.length,h=`${l}(`;for(let p=0;p0;){let f=t.pop();if(G.equals(f.color,a.color))u=s9(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let h=u;u=s9(n,s,u,i,o,f.batchIds,r),f.offset=h,f.count=u-h,l.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=l}function a9(e,t,n,i,o,r,s){let a=e.bytesPerIndex,l=r.length;for(let u=0;u0;){let h=t.pop();if(G.equals(h.color,r.color))u=a9(a,l,u,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=u-r.offset;else{let p=u;u=a9(a,l,u,n,i,h.batchIds,o),h.offset=p,h.count=u-p,s.push(h),r=h}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function o3e(e,t){return t.color.toRgba()-e.color.toRgba()}function r3e(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s=y&&s{e.isDestroyed()||(e._error=m)}):void 0}}function T3e(e){c(e._primitive)||(e._primitive=new rx({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)}Su.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Su.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Su.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Su.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Su.prototype.update=function(e){if(!this._ready){if(c(this._promise)||(this._promise=x3e(this)),c(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)};Su.prototype.isDestroyed=function(){return!1};Su.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var Zp=Su;function xm(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,E3e(this,i,o)}Object.defineProperties(xm.prototype,{featuresLength:{get:function(){return c(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return c(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return c(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 A3e(e){return function(t,n){c(e._geometries)&&e._geometries.updateCommands(t,n)}}function C3e(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,l=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(a>0&&c(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(l>0&&c(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,l)}if(u>0&&c(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,u)}if(f>0&&c(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,f)}let h=c(n)||c(i)||c(o)||c(r),p=a>0&&!c(n)||l>0&&!c(i)||u>0&&!c(o)||f>0&&!c(r);if(h&&p)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!c(n)&&!c(i)&&!c(o)&&!c(r)){let m=0;if(!c(n)&&a>0)for(n=new Uint16Array(a),s=0;s0)for(i=new Uint16Array(l),s=0;s0)for(o=new Uint16Array(u),s=0;s0)for(r=new Uint16Array(f),s=0;s0&&(g=ir(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let y=h.BOXES_LENGTH??0,b=h.CYLINDERS_LENGTH??0,x=h.ELLIPSOIDS_LENGTH??0,A=h.SPHERES_LENGTH??0,C=y+b+x+A,S=new Kp(e,C,g,m,A3e(e));if(e._batchTable=S,C===0)return;let v=e.tile.computedTransform,P;c(h.RTC_CENTER)&&(P=d.unpack(h.RTC_CENTER),B.multiplyByPoint(v,P,P));let M=C3e(h,p);if(y>0||b>0||x>0||A>0){let R,L,F,_;if(y>0){let w=p.byteOffset+h.BOXES.byteOffset;R=new Float32Array(p.buffer,w,Zp.packedBoxLength*y)}if(b>0){let w=p.byteOffset+h.CYLINDERS.byteOffset;L=new Float32Array(p.buffer,w,Zp.packedCylinderLength*b)}if(x>0){let w=p.byteOffset+h.ELLIPSOIDS.byteOffset;F=new Float32Array(p.buffer,w,Zp.packedEllipsoidLength*x)}if(A>0){let w=p.byteOffset+h.SPHERES.byteOffset;_=new Float32Array(p.buffer,w,Zp.packedSphereLength*A)}return e._geometries=new Zp({boxes:R,boxBatchIds:M.boxes,cylinders:L,cylinderBatchIds:M.cylinders,ellipsoids:F,ellipsoidBatchIds:M.ellipsoids,spheres:_,sphereBatchIds:M.spheres,center:P,modelMatrix:v,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function wre(e){let t=e.featuresLength;if(!c(e._features)&&t>0){let n=new Array(t);c(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}xm.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};xm.prototype.getFeature=function(e){let t=this.featuresLength;if(!c(e)||e<0||e>=t)throw new E(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return wre(this),this._features[e]};xm.prototype.applyDebugSettings=function(e,t){c(this._geometries)&&this._geometries.applyDebugSettings(e,t)};xm.prototype.applyStyle=function(e){wre(this),c(this._geometries)&&this._geometries.applyStyle(e,this._features)};xm.prototype.update=function(e,t){c(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),c(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};xm.prototype.pick=function(e,t,n){};xm.prototype.isDestroyed=function(){return!1};xm.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};var n1=xm;var c9={};c9.encode2D=function(e,t,n){let i=Math.pow(2,e);if(T.typeOf.number("level",e),T.typeOf.number("x",t),T.typeOf.number("y",n),e<1)throw new E("Hilbert level cannot be less than 1.");if(t<0||t>=i||n<0||n>=i)throw new E("Invalid coordinates for given level.");let o={x:t,y:n},r,s,a,l=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,l+=BigInt((3*r^s)*a*a),vre(i,o,r,s);return l};c9.decode2D=function(e,t){if(T.typeOf.number("level",e),T.typeOf.bigint("index",t),e<1)throw new E("Hilbert level cannot be less than 1.");if(t=BigInt(Math.pow(4,e)))throw new E("Hilbert index exceeds valid maximum for given level.");let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s>>0,l9=2*fy+1,cy=4,Ire=[],Ore=[],v3e=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],ly=1,NC=2,KV=[ly,0,0,ly|NC];function hr(e){if(!Vt.supportsBigInt())throw new ae("S2 required BigInt support");if(!c(e))throw new E("cell ID is required.");if(!hr.isValidId(e))throw new E("cell ID is invalid.");this._cellId=e,this._level=hr.getLevel(e)}hr.fromToken=function(e){if(T.typeOf.string("token",e),!hr.isValidToken(e))throw new E("token is invalid.");return new hr(hr.getIdFromToken(e))};hr.isValidId=function(e){return T.typeOf.bigint("cellId",e),!(e<=0||e>>BigInt(l9)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};hr.isValidToken=function(e){return T.typeOf.string("token",e),/^[0-9a-fA-F]{1,16}$/.test(e)?hr.isValidId(hr.getIdFromToken(e)):!1};hr.getIdFromToken=function(e){return T.typeOf.string("token",e),BigInt("0x"+e+"0".repeat(16-e.length))};hr.getTokenFromId=function(e){T.typeOf.bigint("cellId",e);let t=Math.floor(B3e(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};hr.getLevel=function(e){if(T.typeOf.bigint("cellId",e),!hr.isValidId(e))throw new E;let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return fy-(t>>1)};hr.prototype.getChild=function(e){if(T.typeOf.number("index",e),e<0||e>3)throw new E("child index must be in the range [0-3].");if(this._level===30)throw new E("cannot get child of leaf cell.");let t=Lre(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new hr(n)};hr.prototype.getParent=function(){if(this._level===0)throw new E("cannot get parent of root cell.");let e=Lre(this._cellId)<3)throw new E("vertex index must be in the range [0-3].");t=t??ie.WGS84;let n=P3e(this._cellId,this._level,e);n=d.normalize(n,n);let i=new he.fromCartesian(n,ie.UNIT_SPHERE);return he.toCartesian(i,t,new d)};hr.fromFacePositionLevel=function(e,t,n){if(T.typeOf.bigint("position",t),e<0||e>5)throw new E("Invalid S2 Face (must be within 0-5)");if(n<0||n>fy)throw new E("Invalid level (must be within 0-30)");if(t<0||t>=Math.pow(4,n))throw new E("Invalid Hilbert position for level");let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array(l9-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new hr(a)};function D3e(e,t){let n=I3e(e,t);return O3e(n[0],n[1],n[2])}function P3e(e,t,n){let i=Rre(e,t),o=R3e([i[1],i[2]],t),r=n>>1&1;return Mre(i[0],o[0][r^n&1],o[1][r])}function I3e(e,t){let n=Rre(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),l=s?1:a?2:0,u=(o<<1)+l,f=(r<<1)+l;return[i,u,f]}function Rre(e){Ire.length===0&&L3e();let t=Number(e>>BigInt(l9)),n=t&ly,i=(1<=0;s--){let l=(1<<2*(s===7?fy-7*cy:cy))-1;n+=Number(e>>BigInt(s*2*cy+1)&BigInt(l))<<2,n=Ore[n];let u=s*cy;o+=n>>cy+2<>2&i)<=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Dre(e){return 1/w3e*e}function R3e(e,t){let n=[[],[]],i=M3e(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=$V(Pre(r)),n[o][1]=$V(Pre(s))}return n}function M3e(e){return 1<>>0}function Pre(e){return 1/S3e*e}function uy(e,t,n,i,o,r){if(e===cy){let s=(t<>1),n+(s[0]&1),i,o,r^KV[0]),uy(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^KV[1]),uy(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^KV[2]),uy(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^KV[3])}}function L3e(){uy(0,0,0,0,0,0),uy(0,0,0,ly,0,ly),uy(0,0,0,NC,0,NC),uy(0,0,0,ly|NC,0,ly|NC)}function Lre(e){return e&~e+BigInt(1)}function N3e(e){return BigInt(1)<>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(u9.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});u9.prototype.getBit=function(e){if(e<0||e>=this._lengthBits)throw new E("Bit index out of bounds.");if(c(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var FC=u9;function Jp(e){e=e??W.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;T.typeOf.object("options.metadataTable",t),T.typeOf.object("options.class",n),T.typeOf.number("options.entityId",i),T.typeOf.object("options.propertyTableJson",o),this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(Jp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Jp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Jp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Jp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Jp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Jp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Jp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Jp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var BC=Jp;var ZV={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};ZV.getBranchingFactor=function(e){switch(e){case ZV.OCTREE:return 8;case ZV.QUADTREE:return 4;default:throw new E("subdivisionScheme is not a valid value.")}};var or=Object.freeze(ZV);function ma(){}Object.defineProperties(ma.prototype,{class:{get:function(){E.throwInstantiationError()}}});ma.prototype.hasProperty=function(e){E.throwInstantiationError()};ma.prototype.hasPropertyBySemantic=function(e){E.throwInstantiationError()};ma.prototype.getPropertyIds=function(e){E.throwInstantiationError()};ma.prototype.getProperty=function(e){E.throwInstantiationError()};ma.prototype.setProperty=function(e,t){E.throwInstantiationError()};ma.prototype.getPropertyBySemantic=function(e){E.throwInstantiationError()};ma.prototype.setPropertyBySemantic=function(e,t){E.throwInstantiationError()};ma.hasProperty=function(e,t,n){if(T.typeOf.string("propertyId",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n),c(t[e]))return!0;let i=n.properties;if(!c(i))return!1;let o=i[e];return!!(c(o)&&c(o.default))};ma.hasPropertyBySemantic=function(e,t,n){T.typeOf.string("semantic",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n);let i=n.propertiesBySemantic;if(!c(i))return!1;let o=i[e];return c(o)};ma.getPropertyIds=function(e,t,n){T.typeOf.object("properties",e),T.typeOf.object("classDefinition",t),n=c(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&c(e[o])&&n.push(o);let i=t.properties;if(c(i))for(let o in i)i.hasOwnProperty(o)&&!c(e[o])&&c(i[o].default)&&n.push(o);return n};ma.getProperty=function(e,t,n){if(T.typeOf.string("propertyId",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n),!c(n.properties[e]))throw new E(`Class definition missing property ${e}`);let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!c(o)&&c(i.default))return o=je(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(c(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};ma.setProperty=function(e,t,n,i){if(T.typeOf.string("propertyId",e),T.defined("value",t),T.typeOf.object("properties",n),T.typeOf.object("classDefinition",i),!c(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return c(r)&&(o=r[e]),c(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};ma.getPropertyBySemantic=function(e,t,n){T.typeOf.string("semantic",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n);let i=n.propertiesBySemantic;if(!c(i))return;let o=i[e];if(c(o))return ma.getProperty(o.id,t,n)};ma.setPropertyBySemantic=function(e,t,n,i){T.typeOf.string("semantic",e),T.defined("value",t),T.typeOf.object("properties",n),T.typeOf.object("classDefinition",i);let o=i.propertiesBySemantic;if(!c(o))return!1;let r=i.propertiesBySemantic[e];return c(r)?ma.setProperty(r.id,t,n,i):!1};var Bn=ma;function e_(e){e=e??W.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class;T.typeOf.object("options.subtreeMetadata",t),T.typeOf.object("options.class",n);let i=c(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(e_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});e_.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};e_.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};e_.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};e_.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};e_.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};e_.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};e_.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var i1=e_;var Lt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Lt.getMinimum=function(e){switch(T.typeOf.string("type",e),e){case Lt.INT8:return-128;case Lt.UINT8:return 0;case Lt.INT16:return-32768;case Lt.UINT16:return 0;case Lt.INT32:return-2147483648;case Lt.UINT32:return 0;case Lt.INT64:return Vt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Lt.UINT64:return Vt.supportsBigInt()?BigInt(0):0;case Lt.FLOAT32:return-34028234663852886e22;case Lt.FLOAT64:return-Number.MAX_VALUE}};Lt.getMaximum=function(e){switch(T.typeOf.string("type",e),e){case Lt.INT8:return 127;case Lt.UINT8:return 255;case Lt.INT16:return 32767;case Lt.UINT16:return 65535;case Lt.INT32:return 2147483647;case Lt.UINT32:return 4294967295;case Lt.INT64:return Vt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Lt.UINT64:return Vt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Lt.FLOAT32:return 34028234663852886e22;case Lt.FLOAT64:return Number.MAX_VALUE}};Lt.isIntegerType=function(e){switch(T.typeOf.string("type",e),e){case Lt.INT8:case Lt.UINT8:case Lt.INT16:case Lt.UINT16:case Lt.INT32:case Lt.UINT32:case Lt.INT64:case Lt.UINT64:return!0;default:return!1}};Lt.isUnsignedIntegerType=function(e){switch(T.typeOf.string("type",e),e){case Lt.UINT8:case Lt.UINT16:case Lt.UINT32:case Lt.UINT64:return!0;default:return!1}};Lt.isVectorCompatible=function(e){switch(T.typeOf.string("type",e),e){case Lt.INT8:case Lt.UINT8:case Lt.INT16:case Lt.UINT16:case Lt.INT32:case Lt.UINT32:case Lt.FLOAT32:case Lt.FLOAT64:return!0;default:return!1}};Lt.normalize=function(e,t){if(typeof e!="number"&&typeof e!="bigint")throw new E("value must be a number or a BigInt");if(!Lt.isIntegerType(t))throw new E("type must be an integer type");return Math.max(Number(e)/Number(Lt.getMaximum(t)),-1)};Lt.unnormalize=function(e,t){if(T.typeOf.number("value",e),!Lt.isIntegerType(t))throw new E("type must be an integer type");let n=Lt.getMaximum(t),i=Lt.isUnsignedIntegerType(t)?0:-n;return e=O.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Lt.INT64||t===Lt.UINT64)&&Vt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};Ua.prototype.handleNoData=function(e){let t=this._noData;if(!c(t))return e;if(!kre(e,t))return e};function kre(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n1;return c(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Ua.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=at.getMathType(this._type),i=this._isArray,o=at.getComponentCount(this._type),r=i&&o>1;return c(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Ua.prototype.validate=function(e){if(!(!c(e)&&c(this._default)))return this._required&&!c(e)?"required property must have a value":this._isArray?H3e(this,e):Ure(this,e)};function H3e(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;i1?Nre(e,t,n):void 0}if(eNt.getMaximum(t))return Nre(e,t,n)}function Bre(e,t){return`value ${e} of type ${t} must be finite`}function f9(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i=n){let i=n-1;throw new E(`index is required and between zero and count - 1. Actual value: ${i}`)}}function K3e(e,t){Gre(e)&&jre(e);let n=e._classProperty,i=n.isArray,o=n.type,r=at.getComponentCount(o);if(c(e._unpackedValues)){let s=e._unpackedValues[t];return i?je(s,!0):s}return!i&&r===1?e._getValue(t):Hre(e,n,t)}function Hre(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=at.getComponentCount(t.type);i*=s,o*=s}else{let a=(t.arrayLength??1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function J3e(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<0,s=!0;for(let a=0;a<8;++a){let l=n.getUint8(i+a);r&&(s?l!==0&&(l=~(l-1)&255,s=!1):l=~l&255),o+=l*Math.pow(256,a)}return r&&(o=-o),o}function tke(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let l=n.getUint8(i+a);r&&(s?l!==0&&(l=~(l-1)&255,s=!1):l=~l&255),o+=BigInt(l)*(BigInt(1)<{zr._error=t}),zr._decoderTaskProcessor=e}return zr._decoderTaskProcessor};zr.decodePointCloud=function(e){let t=zr._getDecoderTaskProcessor();if(c(zr._error))throw zr._error;if(zr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};zr.decodeBufferView=function(e){let t=zr._getDecoderTaskProcessor();if(c(zr._error))throw zr._error;if(zr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var n_=zr;var ri={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function yke(e){switch(e){case ri.POSITION:return"positionMC";case ri.NORMAL:return"normalMC";case ri.TANGENT:return"tangentMC";case ri.TEXCOORD:return"texCoord";case ri.COLOR:return"color";case ri.JOINTS:return"joints";case ri.WEIGHTS:return"weights";case ri.FEATURE_ID:return"featureId";default:throw new E("semantic is not a valid value.")}}ri.hasSetIndex=function(e){switch(T.typeOf.string("semantic",e),e){case ri.POSITION:case ri.NORMAL:case ri.TANGENT:return!1;case ri.TEXCOORD:case ri.COLOR:case ri.JOINTS:case ri.WEIGHTS:case ri.FEATURE_ID:return!0;default:throw new E("semantic is not a valid value.")}};ri.fromGltfSemantic=function(e){T.typeOf.string("gltfSemantic",e);let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return ri.POSITION;case"NORMAL":return ri.NORMAL;case"TANGENT":return ri.TANGENT;case"TEXCOORD":return ri.TEXCOORD;case"COLOR":return ri.COLOR;case"JOINTS":return ri.JOINTS;case"WEIGHTS":return ri.WEIGHTS;case"_FEATURE_ID":return ri.FEATURE_ID}};ri.fromPntsSemantic=function(e){switch(T.typeOf.string("pntsSemantic",e),e){case"POSITION":case"POSITION_QUANTIZED":return ri.POSITION;case"RGBA":case"RGB":case"RGB565":return ri.COLOR;case"NORMAL":case"NORMAL_OCT16P":return ri.NORMAL;case"BATCH_ID":return ri.FEATURE_ID;default:throw new E("pntsSemantic is not a valid value.")}};ri.getGlslType=function(e){switch(T.typeOf.string("semantic",e),e){case ri.POSITION:case ri.NORMAL:case ri.TANGENT:return"vec3";case ri.TEXCOORD:return"vec2";case ri.COLOR:return"vec4";case ri.JOINTS:return"ivec4";case ri.WEIGHTS:return"vec4";case ri.FEATURE_ID:return"int";default:throw new E("semantic is not a valid value.")}};ri.getVariableName=function(e,t){T.typeOf.string("semantic",e);let n=yke(e);return c(t)&&(n+=`_${t}`),n};var ht=Object.freeze(ri);function hy(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.primitive,o=e.draco,r=e.gltfResource,s=e.baseResource,a=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.object("options.primitive",i),T.typeOf.object("options.draco",o),T.typeOf.object("options.gltfResource",r),T.typeOf.object("options.baseResource",s),this._resourceCache=t,this._gltfResource=r,this._baseResource=s,this._gltf=n,this._primitive=i,this._draco=o,this._cacheKey=a,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}c(Object.create)&&(hy.prototype=Object.create($i.prototype),hy.prototype.constructor=hy);Object.defineProperties(hy.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function bke(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;Qre(e,n)}}hy.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=bke(this),this._promise)};function Qre(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load Draco",t)}async function xke(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 lx={};lx[ht.POSITION]="POSITION";lx[ht.NORMAL]="NORMAL";lx[ht.COLOR]="COLOR";lx[ht.TEXCOORD]="TEX_COORD";function Tke(e){for(let t in lx)if(lx.hasOwnProperty(t)&&e.startsWith(t))return lx[t]}hy.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.PROCESSING||(c(this._dracoError)&&Qre(this,this._dracoError),!c(this._bufferViewTypedArray))||c(this._decodePromise))return!1;let t=this._draco,n=this._primitive,i=this._gltf,o=i.bufferViews,r=t.bufferView,s=o[r],a=t.attributes,l=[];for(let h in n.attributes)if(n.attributes.hasOwnProperty(h)){let p=Tke(h);c(p)&&i.accessors[n.attributes[h]].componentType===$.FLOAT&&(l.includes(p)||l.push(p))}let u={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:a,dequantizeInShader:!0,attributesToSkipTransform:l},f=n_.decodeBufferView(u);if(!c(f))return!1;this._decodePromise=xke(this,f)};hy.prototype.unload=function(){c(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};var UC=hy;function Ake(e){let t=e.uint8Array,n=e.format,i=e.request,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1;T.typeOf.object("uint8Array",t),T.typeOf.string("format",n);let s=new Blob([t],{type:n}),a;return we.supportsImageBitmapOptions().then(function(l){return l?Promise.resolve(we.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new we({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(l){return c(a)&&window.URL.revokeObjectURL(a),l}).catch(function(l){return c(a)&&window.URL.revokeObjectURL(a),Promise.reject(l)})}var ux=Ake;function i_(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.number("options.imageId",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r);let a=n.images[i],l=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=l,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(i_.prototype=Object.create($i.prototype),i_.prototype.constructor=i_);Object.defineProperties(i_.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});i_.prototype.load=function(){return c(this._promise)?this._promise:c(this._bufferViewId)?(this._promise=Cke(this),this._promise):(this._promise=Eke(this),this._promise)};function Jre(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 Cke(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 wke(i);if(e.isDestroyed())return;let r=Jre(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(n){return e.isDestroyed()?void 0:ese(e,n,"Failed to load embedded image")}}async function Eke(e){e._state=gt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await Dke(i);if(e.isDestroyed())return;let r=Jre(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(o){return e.isDestroyed()?void 0:ese(e,o,`Failed to load image: ${n}`)}}function ese(e,t,n){return e.unload(),e._state=gt.FAILED,Promise.reject(e.getError(n,t))}function Ske(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 ae("Image format is not recognized")}async function wke(e){let t=Ske(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Il(n)}return i_._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var vke=/(^data:image\/ktx2)|(\.ktx2$)/i;function Dke(e){let t=e.getUrlComponent(!1,!0);return vke.test(t)?Il(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}i_.prototype.unload=function(){c(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};i_._loadImageFromTypedArray=ux;var VC=i_;var Pke={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},pa=Object.freeze(Pke);function my(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.primitive,a=e.draco,l=e.cacheKey,u=e.asynchronous??!0,f=e.loadBuffer??!1,h=e.loadTypedArray??!1;if(T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.number("options.accessorId",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r),!f&&!h)throw new E("At least one of loadBuffer and loadTypedArray must be true.");let p=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=p,this._primitive=s,this._draco=a,this._cacheKey=l,this._asynchronous=u,this._loadBuffer=f,this._loadTypedArray=h,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(my.prototype=Object.create($i.prototype),my.prototype.constructor=my);Object.defineProperties(my.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var Ike=new y9;my.prototype.load=async function(){return c(this._promise)?this._promise:c(this._draco)?(this._promise=Oke(this),this._promise):(this._promise=Rke(this),this._promise)};async function Oke(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;g9(e,n)}}async function Rke(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=gt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=Mke(e,a),e._state=gt.PROCESSING,e}catch(s){if(e.isDestroyed())return;g9(e,s)}}function Mke(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Fe.getSizeInBytes(s),l=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let h=r*a,p=new Uint8Array(l,u,h);l=new Uint8Array(p).buffer,u=0,ws("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Fe.UNSIGNED_BYTE?f=new Uint8Array(l,u,r):s===Fe.UNSIGNED_SHORT?f=new Uint16Array(l,u,r):s===Fe.UNSIGNED_INT&&(f=new Uint32Array(l,u,r)),f}function g9(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load index buffer",t)}function y9(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}y9.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};y9.prototype.execute=function(){this.buffer=tse(this.typedArray,this.indexDatatype,this.context)};function tse(e,t,n){let i=yt.createIndexBuffer({typedArray:e,context:n,usage:Be.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}my.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(c(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=$.fromTypedArray(t),this._indexDatatype=n)}catch(o){g9(this,o)}if(!c(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=Ike;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,pa.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=tse(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};my.prototype.unload=function(){c(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;c(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),c(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0};var zC=my;function Lke(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 vs=Lke;function Nke(e,t){return c(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var mr=Nke;function Xt(){}Xt.objectLegacy=function(e,t){if(c(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(c(o))return o}}};Xt.object=function(e,t){if(c(e)){let n=e.length;for(let i=0;i0)return i.byteStride}return $.getSizeInBytes(t.componentType)*wu(t.type)}var Ul=Bke;function kke(e){Oe.accessor(e,function(n){c(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),Oe.bufferView(e,function(n){c(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){if(i.mode=i.mode??ne.TRIANGLES,!c(i.material)){c(e.materials)||(e.materials=[]);let o={name:"default"};i.material=vs(e.materials,o)}})}),Oe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=i.normalized??!1,c(o)){let r=e.bufferViews[o];r.byteStride=Ul(e,i),r.target=ne.ARRAY_BUFFER}}),Oe.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(c(o)){let r=e.bufferViews[o];r.target=ne.ELEMENT_ARRAY_BUFFER}}),Oe.material(e,function(n){let i=n.extensions??W.EMPTY_OBJECT,o=i.KHR_materials_common;if(c(o)){let l=o.technique,u=c(o.values)?o.values:{};o.values=u,u.ambient=c(u.ambient)?u.ambient:[0,0,0,1],u.emission=c(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,l!=="CONSTANT"&&(u.diffuse=c(u.diffuse)?u.diffuse:[0,0,0,1],l!=="LAMBERT"&&(u.specular=c(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;c(r)&&Oe.materialValue(n,function(l){c(l.index)&&fx(l)}),fx(n.emissiveTexture),fx(n.normalTexture),fx(n.occlusionTexture);let s=n.pbrMetallicRoughness;c(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,fx(s.baseColorTexture),fx(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;c(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,fx(a.specularGlossinessTexture))}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=Uke(e);return Oe.node(e,function(n,i){c(t[i])||c(n.translation)||c(n.rotation)||c(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]}),Oe.sampler(e,function(n){n.wrapS=n.wrapS??ne.REPEAT,n.wrapT=n.wrapT??ne.REPEAT}),c(e.scenes)&&!c(e.scene)&&(e.scene=0),e}function Uke(e){let t={};return Oe.animation(e,function(n){Oe.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function fx(e){c(e)&&(e.texCoord=e.texCoord??0)}var u1=kke;function Vke(e){return Oe.shader(e,function(t){iz(t)}),Oe.buffer(e,function(t){iz(t)}),Oe.image(e,function(t){iz(t)}),iz(e),e}function iz(e){e.extras=c(e.extras)?e.extras:{},e.extras._pipeline=c(e.extras._pipeline)?e.extras._pipeline:{}}var py=Vke;function zke(e,t){let n=e.extensionsRequired;if(c(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var f1=zke;function Hke(e,t){let n=e.extensionsUsed;if(c(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),f1(e,t),n.length===0&&delete e.extensionsUsed}}var dx=Hke;var Gke=4;function jke(e){if(Kd(e)!=="glTF")throw new ae("File is not valid binary glTF");let n=nse(e,0,5),i=n[1];if(i!==1&&i!==2)throw new ae("Binary glTF version is not 1 or 2");return i===1?Wke(e,n):qke(e,n)}function nse(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r0){let h=f.binary_glTF??f.KHR_binary_glTF;c(h)&&(h.extras._pipeline.source=u,delete h.uri)}return dx(l,"KHR_binary_glTF"),l}function qke(e,t){let n=t[2],i=12,o,r;for(;i0){let a=s[0];a.extras._pipeline.source=r}}return o}var d1=jke;function Yke(e){return Oe.shader(e,function(t){oz(t)}),Oe.buffer(e,function(t){oz(t)}),Oe.image(e,function(t){oz(t)}),oz(e),e}function oz(e){c(e.extras)&&(c(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var h1=Yke;function Xke(e,t){let n=e.extensionsUsed;c(n)||(n=[],e.extensionsUsed=n),vs(n,t,!0)}var Ff=Xke;function Kke(e){switch(e){case $.BYTE:return function(t,n,i,o,r){for(let s=0;s-1:!1}var Jke=[ne.ZERO,ne.ONE,ne.SRC_COLOR,ne.ONE_MINUS_SRC_COLOR,ne.SRC_ALPHA,ne.ONE_MINUS_SRC_ALPHA,ne.DST_ALPHA,ne.ONE_MINUS_DST_ALPHA,ne.DST_COLOR,ne.ONE_MINUS_DST_COLOR];function eUe(e,t){if(!c(e))return t;for(let n=0;n<4;n++)if(Jke.indexOf(e[n])===-1)return t;return e}function tUe(e){let t={},n={},i=e.techniques;return c(i)&&(Oe.technique(e,function(o,r){let s=o.states;if(c(s)){let a=n[r]={};if(ise(s,ne.BLEND)){a.alphaMode="BLEND";let l=s.functions;c(l)&&(c(l.blendEquationSeparate)||c(l.blendFuncSeparate))&&(t[r]={blendEquation:l.blendEquationSeparate??Zke,blendFactors:eUe(l.blendFuncSeparate,Qke)})}ise(s,ne.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(c(e.extensions)||(e.extensions={}),Ff(e,"KHR_blend")),Oe.material(e,function(o){if(c(o.technique)){let r=n[o.technique];Oe.objectLegacy(r,function(a,l){o[l]=a});let s=t[o.technique];c(s)&&(c(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var m1=tUe;function nUe(e,t){let n=e.extensionsRequired;c(n)||(n=[],e.extensionsRequired=n),vs(n,t,!0),Ff(e,t)}var p1=nUe;function iUe(e){let t=e.techniques,n={},i={},o={};if(c(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Oe.technique(e,function(a,l){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Oe.techniqueAttribute(a,function(h,p){f=a.parameters[h],u.attributes[p]={semantic:f.semantic}}),Oe.techniqueUniform(a,function(h,p){f=a.parameters[h],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},c(n[l])||(n[l]={}),n[l][h]=p}),c(o[a.program]))u.program=o[a.program];else{let h=e.programs[a.program],p={name:h.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[h.fragmentShader];p.fragmentShader=vs(r.shaders,g,!0);let m=e.shaders[h.vertexShader];p.vertexShader=vs(r.shaders,m,!0),u.program=vs(r.programs,p),o[a.program]=u.program}i[l]=vs(r.techniques,u)}),r.techniques.length>0&&(c(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Ff(e,"KHR_techniques_webgl"),p1(e,"KHR_techniques_webgl"))}return Oe.material(e,function(r){if(c(r.technique)){let s={technique:i[r.technique]};Oe.objectLegacy(r.values,function(a,l){c(s.values)||(s.values={});let u=n[r.technique][l];c(u)&&(s.values[u]=a)}),c(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var _1=iUe;function oUe(e,t){T.typeOf.object("material",e),T.defined("handler",t);let n=e.pbrMetallicRoughness;if(c(n)){if(c(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(c(s))return s}if(c(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(c(s))return s}}let{extensions:i}=e;if(c(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(c(r)){if(c(r.diffuseTexture)){let l=r.diffuseTexture,u=t(l.index,l);if(c(u))return u}if(c(r.specularGlossinessTexture)){let l=r.specularGlossinessTexture,u=t(l.index,l);if(c(u))return u}}let s=i.KHR_materials_specular;if(c(s)){let{specularTexture:l,specularColorTexture:u}=s;if(c(l)){let f=t(l.index,l);if(c(f))return f}if(c(u)){let f=t(u.index,u);if(c(f))return f}}let a=i.KHR_materials_common;if(c(a)&&c(a.values)){let{diffuse:l,ambient:u,emission:f,specular:h}=a.values;if(c(l)&&c(l.index)){let p=t(l.index,l);if(c(p))return p}if(c(u)&&c(u.index)){let p=t(u.index,u);if(c(p))return p}if(c(f)&&c(f.index)){let p=t(f.index,f);if(c(p))return p}if(c(h)&&c(h.index)){let p=t(h.index,h);if(c(p))return p}}}let o=Oe.materialValue(e,function(r){if(c(r.index)){let s=t(r.index,r);if(c(s))return s}});if(c(o))return o;if(c(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(c(s))return s}if(c(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(c(s))return s}if(c(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(c(s))return s}}var HC=oUe;var ose=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function rUe(e,t){return t=t??ose,ose.forEach(function(n){t.indexOf(n)>-1&&aUe(e,n)}),e}var sUe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function aUe(e,t){let n=sUe[t],i=e[n];if(c(i)){let o=0,r=Cm[t](e),s=i.length;for(let a=0;at&&o.attributes[l]--}),Oe.meshPrimitiveTarget(o,function(a){Oe.meshPrimitiveTargetAttribute(a,function(l,u){l>t&&a[u]--})});let r=o.indices;c(r)&&r>t&&o.indices--;let s=o.extensions;c(s)&&c(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Oe.skin(e,function(i){c(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Oe.animation(e,function(i){Oe.animationSampler(i,function(o){c(o.input)&&o.input>t&&o.input--,c(o.output)&&o.output>t&&o.output--})})};Am.buffer=function(e,t){e.buffers.splice(t,1),Oe.bufferView(e,function(i){c(i.buffer)&&i.buffer>t&&i.buffer--,c(i.extensions)&&c(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};Am.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Oe.accessor(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.shader(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.image(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),mr(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){c(o.extensions)&&c(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),mr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(c(a)){for(let l in a)if(a.hasOwnProperty(l)){let u=a[l];c(u.bufferView)&&u.bufferView>t&&u.bufferView--,c(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,c(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(mr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(c(o)){let r=o.length;for(let s=0;st&&f.values--,c(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,c(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Am.image=function(e,t){e.images.splice(t,1),Oe.texture(e,function(i){c(i.source)&&i.source>t&&--i.source;let o=i.extensions;c(o)&&c(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:c(o)&&c(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Am.mesh=function(e,t){e.meshes.splice(t,1),Oe.node(e,function(i){c(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Am.node=function(e,t){e.nodes.splice(t,1),Oe.skin(e,function(i){c(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),Oe.animation(e,function(i){Oe.animationChannel(i,function(o){c(o.target)&&c(o.target.node)&&o.target.node>t&&o.target.node--})}),Oe.technique(e,function(i){Oe.techniqueUniform(i,function(o){c(o.node)&&o.node>t&&o.node--})}),Oe.node(e,function(i){c(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),Oe.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Am.material=function(e,t){e.materials.splice(t,1),Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){c(o.material)&&o.material>t&&o.material--})})};Am.sampler=function(e,t){e.samplers.splice(t,1),Oe.texture(e,function(i){c(i.sampler)&&i.sampler>t&&--i.sampler})};Am.texture=function(e,t){if(e.textures.splice(t,1),Oe.material(e,function(i){HC(i,function(o,r){r.index>t&&--r.index})}),mr(e,"EXT_feature_metadata")){Oe.mesh(e,function(r){Oe.meshPrimitive(r,function(s){let a=s.extensions;if(c(a)&&c(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(c(u)){let f=u.length;for(let h=0;ht&&--g.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(c(a)){for(let l in a)if(a.hasOwnProperty(l)){let f=a[l].texture;f.index>t&&--f.index}}}}if(mr(e,"EXT_mesh_features")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){let r=o.extensions;if(c(r)&&c(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(c(a)){let l=a.length;for(let u=0;ut&&--f.texture.index}}}})}),mr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(c(o)){let r=o.length;for(let s=0;st&&--f.index}}}}};function Cm(){}Cm.accessor=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){Oe.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Oe.meshPrimitiveTarget(i,function(r){Oe.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;c(o)&&(t[o]=!0)})}),Oe.skin(e,function(n){c(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){c(i.input)&&(t[i.input]=!0),c(i.output)&&(t[i.output]=!0)})}),mr(e,"EXT_mesh_gpu_instancing")&&Oe.node(e,function(n){c(n.extensions)&&c(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})}),mr(e,"CESIUM_primitive_outline")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){let o=i.extensions;if(c(o)&&c(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;c(s)&&(t[s]=!0)}})}),t};Cm.buffer=function(e){let t={};return Oe.bufferView(e,function(n){c(n.buffer)&&(t[n.buffer]=!0),c(n.extensions)&&c(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};Cm.bufferView=function(e){let t={};if(Oe.accessor(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.shader(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.image(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),mr(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){c(i.extensions)&&c(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),mr(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(c(s)){for(let a in s)if(s.hasOwnProperty(a)){let l=s[a];c(l.bufferView)&&(t[l.bufferView]=!0),c(l.arrayOffsetBufferView)&&(t[l.arrayOffsetBufferView]=!0),c(l.stringOffsetBufferView)&&(t[l.stringOffsetBufferView]=!0)}}}}if(mr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(c(i)){let o=i.length;for(let r=0;r0&&(t[n.mesh]=!0)}}),t};function rse(e,t,n){let i=e.nodes[t];return c(i.mesh)||c(i.camera)||c(i.skin)||c(i.weights)||c(i.extras)||c(i.extensions)&&Object.keys(i.extensions).length!==0||c(n[t])?!1:!c(i.children)||i.children.filter(function(o){return!rse(e,o,n)}).length===0}Cm.node=function(e){let t={};return Oe.skin(e,function(n){c(n.skeleton)&&(t[n.skeleton]=!0),Oe.skinJoint(n,function(i){t[i]=!0})}),Oe.animation(e,function(n){Oe.animationChannel(n,function(i){c(i.target)&&c(i.target.node)&&(t[i.target.node]=!0)})}),Oe.technique(e,function(n){Oe.techniqueUniform(n,function(i){c(i.node)&&(t[i.node]=!0)})}),Oe.node(e,function(n,i){rse(e,i,t)||(t[i]=!0)}),t};Cm.material=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){c(i.material)&&(t[i.material]=!0)})}),t};Cm.texture=function(e){let t={};if(Oe.material(e,function(n){HC(n,function(i){t[i]=!0})}),mr(e,"EXT_feature_metadata")){Oe.mesh(e,function(o){Oe.meshPrimitive(o,function(r){let s=r.extensions;if(c(s)&&c(s.EXT_feature_metadata)){let l=s.EXT_feature_metadata.featureIdTextures;if(c(l)){let u=l.length;for(let f=0;f0)for(s.mesh=n.meshes[l[0]],t=1;t0&&c(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[l[0]]}delete s.skeletons}c(s.jointName)&&delete s.jointName}),Oe.skin(e,function(s){c(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(c(a)){let l=[],u=a.length;for(t=0;t=0&&(a=r.substring(0,s),l=r.substring(s));let u,f=IUe[a];c(f)?(u=f+l,t[r]=u):c(PUe[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];c(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Oe.technique(e,function(n){Oe.techniqueParameter(n,function(i){let o=t[i.semantic];c(o)&&(i.semantic=o)})})}function RUe(e){Oe.camera(e,function(t){let n=t.perspective;if(c(n)){let i=n.aspectRatio;c(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;c(o)&&o===0&&(n.yfov=1)}})}function T9(e,t){return c(t.byteStride)&&t.byteStride!==0?t.byteStride:Ul(e,t)}function MUe(e){Oe.buffer(e,function(t){c(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Oe.accessor(e,function(t){let n=t.bufferView;if(c(n)){let i=e.bufferViews[n],o=T9(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function LUe(e){let t,n,i,o=e.bufferViews,r={};Oe.accessorContainingVertexAttributeData(e,function(a){let l=e.accessors[a];c(l.bufferView)&&(r[l.bufferView]=!0)});let s={};Oe.accessor(e,function(a){c(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let l=s[a];l.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,h=l.length;for(t=0;t=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Oe.node(e,function(n,i){if(c(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),lse(n)&&use(e,i))}}),delete e.nodes[t]}function FUe(e){return Oe.node(e,function(t,n){lse(t)&&use(e,n)}),e}function BUe(e){Oe.animation(e,function(t){Oe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!c(i.min)||!c(i.max)){let o=hx(e,i);i.min=o.min,i.max=o.max}})})}function kUe(e){Oe.accessor(e,function(t){if(c(t.min)||c(t.max)){let n=hx(e,t);c(t.min)&&(t.min=n.min),c(t.max)&&(t.max=n.max)}})}function UUe(e){e.asset=e.asset??{},e.asset.version="2.0",cse(e),bUe(e),FUe(e),xUe(e),TUe(e),CUe(e),SUe(e),MUe(e),LUe(e),NUe(e),BUe(e),kUe(e),wUe(e),vUe(e),DUe(e),OUe(e),x1(e),RUe(e),m1(e),_1(e),AUe(e)}var VUe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],zUe=["u_diffuse","u_diffuse_mat"];function A9(e){e.pbrMetallicRoughness=c(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function C9(e){return c(e.index)}function E9(e){return Array.isArray(e)&&e.length===4}function fse(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 HUe(e,t){t=t??W.EMPTY_OBJECT;let n=t.baseColorTextureNames??VUe,i=t.baseColorFactorNames??zUe;Oe.material(e,function(o){Oe.materialValue(o,function(r,s){n.indexOf(s)!==-1&&C9(r)?(A9(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&E9(r)&&(A9(o),o.pbrMetallicRoughness.baseColorFactor=fse(r))})}),mx(e,"KHR_techniques_webgl"),mx(e,"KHR_blend")}function x9(e,t){c(t)&&(E9(t)?e.pbrMetallicRoughness.baseColorFactor=fse(t):C9(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function ase(e,t){c(t)&&(E9(t)?e.emissiveFactor=t.slice(0,3):C9(t)&&(e.emissiveTexture=t))}function GUe(e){Oe.material(e,function(t){let n=(t.extensions??W.EMPTY_OBJECT).KHR_materials_common;if(!c(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,l=n.doubleSided,u=n.transparent;A9(t),n.technique==="CONSTANT"?(Ff(e,"KHR_materials_unlit"),t.extensions=c(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},x9(t,s),x9(t,o)):(x9(t,r),ase(t,o),ase(t,s)),c(l)&&(t.doubleSided=l),c(a)&&(c(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),c(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),mx(e,"KHR_materials_common")}var T1=hUe;function _c(){}_c.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;c(n)&&c(n.message)&&(i+=` ${n.message}`);let o=new ae(i);return c(n)&&(o.stack=`Original stack: ${n.stack} Handler stack: ${o.stack}`),o};_c.getNodeTransform=function(e){return c(e.matrix)?e.matrix:B.fromTranslationQuaternionRotationScale(c(e.translation)?e.translation:d.ZERO,c(e.rotation)?e.rotation:Le.IDENTITY,c(e.scale)?e.scale:d.ONE)};_c.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r=this._contentAvailabilityBitstreams.length)throw new E("contentIndex out of bounds.");return this._contentAvailabilityBitstreams[t].getBit(e)};_a.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};_a.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};_a.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};_a.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};_a.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===or.OCTREE&&(t=3),e>>t};_a.fromSubtreeJson=async function(e,t,n,i,o){if(T.typeOf.object("resource",e),c(t)===c(n))throw new E("One of json and subtreeView must be defined.");T.typeOf.object("implicitTileset",i),T.typeOf.object("implicitCoordinates",o);let r=new _a(e,i,o),s;c(t)?s={json:t,binary:void 0}:s=LVe(n);let a=s.json;r._subtreeJson=a;let l;if(oi(a,"3DTILES_metadata"))l=a.extensions["3DTILES_metadata"];else if(c(a.tileMetadata)){let A=a.tileMetadata;l=a.propertyTables[A]}let u=[];if(c(a.contentMetadata)){let A=a.contentMetadata.length;for(let C=0;C0;f=f||h;for(let p=0;p>BigInt(61)),u=l%2===0?LC.encode2D(i,o,r):LC.encode2D(i,r,o),f=Qp.fromFacePositionLevel(l,BigInt(u),i),h,p;if(c(s)){let g=(a.maximumHeight+a.minimumHeight)/2;h=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else h=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Qp.getTokenFromId(f._cellId),minimumHeight:h,maximumHeight:p}}}}var nze=new d,ize=new d,R9=new d,oze=new J;function wse(e,t,n,i,o){if(T.typeOf.object("rootBox",e),T.typeOf.number("level",t),T.typeOf.number("x",n),T.typeOf.number("y",i),c(o)&&T.typeOf.number("z",o),t===0)return e;let r=d.unpack(e,0,ize),s=J.unpack(e,3,oze),a=Math.pow(2,-t),l=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,h=d.fromElements(a,a,1,nze);c(o)&&(f=-1+(2*o+1)*a,h.z=a);let p=d.fromElements(l,u,f,R9);p=J.multiplyByVector(s,p,R9),p=d.add(p,r,R9);let g=J.clone(s);g=J.multiplyByScale(g,h,g);let m=new Array(12);return d.pack(p,m),J.pack(g,m,3),m}var rze=new ce;function vse(e,t,n,i,o){if(T.typeOf.object("rootRegion",e),T.typeOf.number("level",t),T.typeOf.number("x",n),T.typeOf.number("y",i),c(o)&&T.typeOf.number("z",o),t===0)return e.slice();let r=ce.unpack(e,0,rze),s=e[4],a=e[5],l=Math.pow(2,-t),u=l*r.width,f=O.negativePiToPi(r.west+n*u),h=O.negativePiToPi(f+u),p=l*r.height,g=O.negativePiToPi(r.south+i*p),m=O.negativePiToPi(g+p),y=s,b=a;if(c(o)){let x=l*(a-s);y+=o*x,b=y+x}return[f,g,h,m,y,b]}function sze(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Ese(i,o,n,!1,t),s=Cse(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,l={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Dse(e,i.baseResource,l,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function Dse(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}tl.prototype.hasProperty=function(e,t){return!1};tl.prototype.getFeature=function(e){};tl.prototype.applyDebugSettings=function(e,t){};tl.prototype.applyStyle=function(e){};tl.prototype.update=function(e,t){};tl.prototype.pick=function(e,t,n){};tl.prototype.isDestroyed=function(){return!1};tl.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),de(this)};tl._deriveBoundingBox=wse;tl._deriveBoundingRegion=vse;tl._deriveBoundingVolumeS2=Sse;var XC=tl;var aze={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Hl=Object.freeze(aze);function KC(e,t){T.typeOf.object("normal",e),T.typeOf.number("distance",t),this._distance=t,this._normal=new Pse(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(KC.prototype,{distance:{get:function(){return this._distance},set:function(e){T.typeOf.number("value",e),c(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){T.typeOf.object("value",e),c(this.onChangeCallback)&&!d.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),d.clone(e,this._normal._cartesian3)}}});KC.fromPlane=function(e,t){return T.typeOf.object("plane",e),c(t)?(t.normal=e.normal,t.distance=e.distance):t=new KC(e.normal,e.distance),t};KC.clone=function(e,t){return c(t)?(t.normal=e.normal,t.distance=e.distance,t):new KC(e.normal,e.distance)};function Pse(e,t){this._clippingPlane=t,this._cartesian3=d.clone(e)}Object.defineProperties(Pse.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){T.typeOf.number("value",e),c(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){T.typeOf.number("value",e),c(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){T.typeOf.number("value",e),c(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var xx=KC;function gc(e){e=e??W.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this.edgeColor=G.clone(e.edgeColor??G.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new pe,this.planeRemoved=new pe,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?Lse:Nse,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(c(n)){let i=n.length;for(let o=0;o0&&(r=Wt.OUTSIDE);for(let s=0;s80*n){a=1/0,l=1/0;let f=-1/0,h=-1/0;for(let p=n;pf&&(f=g),m>h&&(h=m)}u=Math.max(f-a,h-l),u=u!==0?32767/u:0}return R1(r,s,n,a,l,u,0),s}function Use(e,t,n,i,o){let r;if(o===vze(e,t,n,i)>0)for(let s=t;s=t;s-=i)r=kse(s/i|0,e[s],e[s+1],r);return r&&$C(r,r.next)&&(L1(r),r=r.next),r}function Tx(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&($C(n,n.next)||Hr(n.prev,n,n.next)===0)){if(L1(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function R1(e,t,n,i,o,r,s){if(!e)return;!s&&r&&Tze(e,i,o,r);let a=e;for(;e.prev!==e.next;){let l=e.prev,u=e.next;if(r?hze(e,i,o,r):dze(e)){t.push(l.i,e.i,u.i),L1(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=mze(Tx(e),t),R1(e,t,n,i,o,r,2)):s===2&&pze(e,t,n,i,o,r):R1(Tx(e),t,n,i,o,r,1);break}}}function dze(e){let t=e.prev,n=e,i=e.next;if(Hr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,l=n.y,u=i.y,f=Math.min(o,r,s),h=Math.min(a,l,u),p=Math.max(o,r,s),g=Math.max(a,l,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=h&&m.y<=g&&O1(o,a,r,l,s,u,m.x,m.y)&&Hr(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function hze(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Hr(o,r,s)>=0)return!1;let a=o.x,l=r.x,u=s.x,f=o.y,h=r.y,p=s.y,g=Math.min(a,l,u),m=Math.min(f,h,p),y=Math.max(a,l,u),b=Math.max(f,h,p),x=L9(g,m,t,n,i),A=L9(y,b,t,n,i),C=e.prevZ,S=e.nextZ;for(;C&&C.z>=x&&S&&S.z<=A;){if(C.x>=g&&C.x<=y&&C.y>=m&&C.y<=b&&C!==o&&C!==s&&O1(a,f,l,h,u,p,C.x,C.y)&&Hr(C.prev,C,C.next)>=0||(C=C.prevZ,S.x>=g&&S.x<=y&&S.y>=m&&S.y<=b&&S!==o&&S!==s&&O1(a,f,l,h,u,p,S.x,S.y)&&Hr(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;C&&C.z>=x;){if(C.x>=g&&C.x<=y&&C.y>=m&&C.y<=b&&C!==o&&C!==s&&O1(a,f,l,h,u,p,C.x,C.y)&&Hr(C.prev,C,C.next)>=0)return!1;C=C.prevZ}for(;S&&S.z<=A;){if(S.x>=g&&S.x<=y&&S.y>=m&&S.y<=b&&S!==o&&S!==s&&O1(a,f,l,h,u,p,S.x,S.y)&&Hr(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function mze(e,t){let n=e;do{let i=n.prev,o=n.next.next;!$C(i,o)&&zse(i,n,n.next,o)&&M1(i,o)&&M1(o,i)&&(t.push(i.i,n.i,o.i),L1(n),L1(n.next),n=e=o),n=n.next}while(n!==e);return Tx(n)}function pze(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&Eze(s,a)){let l=Hse(s,a);s=Tx(s,s.next),l=Tx(l,l.next),R1(s,t,n,i,o,r,0),R1(l,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function _ze(e,t,n,i){let o=[];for(let r=0,s=t.length;r=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,s=n.x=n.x&&n.x>=l&&i!==n.x&&Vse(os.x||n.x===s.x&&xze(s,n)))&&(s=n,f=h)}n=n.next}while(n!==a);return s}function xze(e,t){return Hr(e.prev,e,t.prev)<0&&Hr(t.next,e,e.next)<0}function Tze(e,t,n,i){let o=e;do o.z===0&&(o.z=L9(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,Aze(o)}function Aze(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u0||l>0&&s;)a!==0&&(l===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,l--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function L9(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 Cze(e){let t=e,n=e;do(t.x=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function O1(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&Vse(e,t,n,i,o,r,s,a)}function Eze(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Sze(e,t)&&(M1(e,t)&&M1(t,e)&&wze(e,t)&&(Hr(e.prev,e,t.prev)||Hr(e,t.prev,t))||$C(e,t)&&Hr(e.prev,e,e.next)>0&&Hr(t.prev,t,t.next)>0)}function Hr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function $C(e,t){return e.x===t.x&&e.y===t.y}function zse(e,t,n,i){let o=mz(Hr(e,t,n)),r=mz(Hr(e,t,i)),s=mz(Hr(n,i,e)),a=mz(Hr(n,i,t));return!!(o!==r&&s!==a||o===0&&hz(e,n,t)||r===0&&hz(e,i,t)||s===0&&hz(n,e,i)||a===0&&hz(n,t,i))}function hz(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 mz(e){return e>0?1:e<0?-1:0}function Sze(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&&zse(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function M1(e,t){return Hr(e.prev,e,e.next)<0?Hr(e,t,e.next)>=0&&Hr(e,e.prev,t)>=0:Hr(e,t,e.prev)<0||Hr(e,e.next,t)<0}function wze(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 Hse(e,t){let n=N9(e.i,e.x,e.y),i=N9(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 kse(e,t,n,i){let o=N9(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 L1(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 N9(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function vze(e,t,n,i){let o=0;for(let r=t,s=n-i;r0?ts.COUNTER_CLOCKWISE:ts.CLOCKWISE};Ty.triangulate=function(e,t){T.defined("positions",e);let n=H.packArray(e);return F9(n,t,2)};var qse=new d,Yse=new d,Xse=new d,Gse=new d,jse=new d,Wse=new d,r_=new d,Kse=new H,$se=new H,Zse=new H,ZC=new H;Ty.computeSubdivision=function(e,t,n,i,o){o=o??O.RADIANS_PER_DEGREE;let r=c(i);T.typeOf.object("ellipsoid",e),T.defined("positions",t),T.defined("indices",n),T.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),T.typeOf.number.equals("indices.length % 3","0",n.length%3,0),T.typeOf.number.greaterThan("granularity",o,0);let s=n.slice(0),a,l=t.length,u=new Array(l*3),f=new Array(l*2),h=0,p=0;for(a=0;a0;){let C=s.pop(),S=s.pop(),v=s.pop(),P=d.fromArray(u,v*3,qse),M=d.fromArray(u,S*3,Yse),R=d.fromArray(u,C*3,Xse),L,F,_;r&&(L=H.fromArray(f,v*2,Kse),F=H.fromArray(f,S*2,$se),_=H.fromArray(f,C*2,Zse));let w=d.multiplyByScalar(d.normalize(P,Gse),y,Gse),D=d.multiplyByScalar(d.normalize(M,jse),y,jse),I=d.multiplyByScalar(d.normalize(R,Wse),y,Wse),N=d.magnitudeSquared(d.subtract(w,D,r_)),k=d.magnitudeSquared(d.subtract(D,I,r_)),z=d.magnitudeSquared(d.subtract(I,w,r_)),V=Math.max(N,k,z),j,U,q;V>x?N===V?(j=`${Math.min(v,S)} ${Math.max(v,S)}`,a=m[j],c(a)||(U=d.add(P,M,r_),d.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,m[j]=a,r&&(q=H.add(L,F,ZC),H.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(v,a,C),s.push(a,S,C)):k===V?(j=`${Math.min(S,C)} ${Math.max(S,C)}`,a=m[j],c(a)||(U=d.add(M,R,r_),d.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,m[j]=a,r&&(q=H.add(F,_,ZC),H.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(S,a,v),s.push(a,C,v)):z===V&&(j=`${Math.min(C,v)} ${Math.max(C,v)}`,a=m[j],c(a)||(U=d.add(R,P,r_),d.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,m[j]=a,r&&(q=H.add(_,L,ZC),H.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(C,a,S),s.push(a,v,S)):(g.push(v),g.push(S),g.push(C))}let A={attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return r&&(A.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:f})),new ct(A)};var Ize=new he,Oze=new he,Rze=new he,B9=new he;Ty.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??O.RADIANS_PER_DEGREE;let r=c(i);T.typeOf.object("ellipsoid",e),T.defined("positions",t),T.defined("indices",n),T.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),T.typeOf.number.equals("indices.length % 3","0",n.length%3,0),T.typeOf.number.greaterThan("granularity",o,0);let s=n.slice(0),a,l=t.length,u=new Array(l*3),f=new Array(l*2),h=0,p=0;for(a=0;a0;){let v=s.pop(),P=s.pop(),M=s.pop(),R=d.fromArray(u,M*3,qse),L=d.fromArray(u,P*3,Yse),F=d.fromArray(u,v*3,Xse),_,w,D;r&&(_=H.fromArray(f,M*2,Kse),w=H.fromArray(f,P*2,$se),D=H.fromArray(f,v*2,Zse));let I=e.cartesianToCartographic(R,Ize),N=e.cartesianToCartographic(L,Oze),k=e.cartesianToCartographic(F,Rze);x.setEndPoints(I,N);let z=x.surfaceDistance;A.setEndPoints(N,k);let V=A.surfaceDistance;C.setEndPoints(k,I);let j=C.surfaceDistance,U=Math.max(z,V,j),q,Y,te,K,Z;U>b?z===U?(q=`${Math.min(M,P)} ${Math.max(M,P)}`,a=m[q],c(a)||(Y=x.interpolateUsingFraction(.5,B9),te=(I.height+N.height)*.5,K=d.fromRadians(Y.longitude,Y.latitude,te,e,r_),u.push(K.x,K.y,K.z),a=u.length/3-1,m[q]=a,r&&(Z=H.add(_,w,ZC),H.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),s.push(M,a,v),s.push(a,P,v)):V===U?(q=`${Math.min(P,v)} ${Math.max(P,v)}`,a=m[q],c(a)||(Y=A.interpolateUsingFraction(.5,B9),te=(N.height+k.height)*.5,K=d.fromRadians(Y.longitude,Y.latitude,te,e,r_),u.push(K.x,K.y,K.z),a=u.length/3-1,m[q]=a,r&&(Z=H.add(w,D,ZC),H.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),s.push(P,a,M),s.push(a,v,M)):j===U&&(q=`${Math.min(v,M)} ${Math.max(v,M)}`,a=m[q],c(a)||(Y=C.interpolateUsingFraction(.5,B9),te=(k.height+I.height)*.5,K=d.fromRadians(Y.longitude,Y.latitude,te,e,r_),u.push(K.x,K.y,K.z),a=u.length/3-1,m[q]=a,r&&(Z=H.add(D,_,ZC),H.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),s.push(v,a,P),s.push(a,M,P)):(g.push(M),g.push(P),g.push(v))}let S={attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return r&&(S.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:f})),new ct(S)};Ty.scaleToGeodeticHeight=function(e,t,n,i){n=n??ie.default;let o=Dze,r=Pze;if(t=t??0,i=i??!0,c(e)){let s=e.length;for(let a=0;a10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};Ay.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};Ay.prototype.contains=function(e){return this._array.indexOf(e)!==-1};Ay.prototype.clear=function(){this._array.length=this._offset=this._length=0};Ay.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var Cy=Ay;var rr={};rr.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!c(o))continue;n+=2;let r=o.positions,s=o.holes;if(c(r)&&r.length>0&&(n+=r.length*t.packedLength),c(s)){let a=s.length;for(let l=0;l0;){let r=o.pop();if(!c(r))continue;let s=r.positions,a=r.holes;if(t[n++]=c(s)?s.length:0,t[n++]=c(a)?a.length:0,c(s)){let l=s.length;for(let u=0;u0?new Array(o):void 0;for(let a=0;aO.PI){let l=s;s=a,a=l}if(!(r.longitudea))return n.cartographicToCartesian(r)}function Hze(e,t,n,i){if(i===qt.RHUMB)return zze(e,t,n);let o=Zn.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(c(o))return n.scaleToGeodeticSurface(o,o)}var Gze=new he;function jze(e,t,n){let i=[],o,r,s,a,l,u=0;for(;ut.cartesianToCartographic(h,Gze).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(o)});else if(a!==0){if(l=Hze(o,r,t,n),++u,!c(l))continue;e.splice(u,0,l),i.push({position:u,type:s,visited:!1,next:a,theta:f(l)})}++u}return i}function tae(e,t,n,i,o,r,s){let a=[],l=r,u=h=>p=>p.position===h,f=[];do{let h=n[l];a.push(h);let p=i.findIndex(u(l)),g=i[p];if(!c(g)){++l;continue}let{visited:m,type:y,next:b}=g;if(g.visited=!0,y===0){if(b===0){let S=i[p-(s?1:-1)];if(S?.position===l+1)S.visited=!0;else{++l;continue}}if(!m&&s&&b>0||r===l&&!s&&b<0){++l;continue}}if(!(s?y>=0:y<=0)){++l;continue}m||f.push(l);let A=p+(s?1:-1),C=i[A];if(!c(C)){++l;continue}l=C.position}while(l=0&&l!==r&&a.lengthu.theta-f.theta);let l=s[0].z>=0;o=tae(i,o,s,a,1,0,l)}return i};rr.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],l=new Cy;l.enqueue(e);let u=c(r);for(;l.length!==0;){let f=l.dequeue(),h=f.positions,p=f.holes,g,m;if(i)for(m=h.length,g=0;g1){for(let M of P)l.enqueue(new ka(M,p));continue}}let A=h.slice(),C=c(p)?p.length:0,S=[],v;for(g=0;gMath.PI&&(e-=O.TWO_PI),e}}});var QC=new he,Zze=new d;Gr.prototype.getLatitude=function(e){c(e)||(e=ie.default),QC.latitude=this.conformalLatitude,QC.longitude=this.longitude,QC.height=0;let t=this.ellipsoid.cartographicToCartesian(QC,Zze);return e.cartesianToCartographic(t,QC),QC.latitude};var Qze=new mn,Jze=new d,e4e=new d;Gr.fromCartesian=function(e,t){T.defined("cartesian",e);let n=O.signNotZero(e.z),i=Gr.NORTH_POLE_TANGENT_PLANE,o=Gr.SOUTH_POLE;n<0&&(i=Gr.SOUTH_POLE_TANGENT_PLANE,o=Gr.NORTH_POLE);let r=Qze;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=d.subtract(r.origin,o,Jze),d.normalize(r.direction,r.direction);let s=Zn.rayPlane(r,i.plane,e4e),a=d.subtract(s,o,s),l=d.dot(i.xAxis,a),u=n*d.dot(i.yAxis,a);return c(t)?(t.position=new H(l,u),t.tangentPlane=i,t):new Gr(new H(l,u),i)};Gr.fromCartesianArray=function(e,t){T.defined("cartesians",e);let n=e.length;c(t)?t.length=n:t=new Array(n);for(let i=0;i=0?s:s+O.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let l=e.getLatitude(n),u=l;if(r.south=Math.min(r.south,l),r.north=Math.max(r.north,l),i!==qt.RHUMB){let p=H.subtract(t.position,e.position,y4e),g=H.dot(t.position,p)/H.dot(p,p);if(g>0&&g<1){let m=H.add(t.position,H.multiplyByScalar(p,-g,p),b4e),y=yc.clone(t,x4e);y.position=m;let b=y.getLatitude(n);r.south=Math.min(r.south,b),r.north=Math.max(r.north,b),Math.abs(l)>Math.abs(b)&&(u=b)}}let f=t.x*e.y-e.x*t.y,h=Math.sign(f);h!==0&&(h*=H.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=h),u<=0&&(o.southAngle+=h)}var aae=new yc,T4e=new yc,Bf={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};kf.computeRectangleFromPositions=function(e,t,n,i){if(T.defined("positions",e),c(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,Bf.northAngle=0,Bf.southAngle=0,Bf.westOverIdl=Number.POSITIVE_INFINITY,Bf.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=yc.fromCartesian(e[0],T4e);for(let s=1;sBf.eastOverIdl-Bf.westOverIdl&&(i.west=Bf.westOverIdl,i.east=Bf.eastOverIdl,i.east>O.PI&&(i.east=i.east-O.TWO_PI),i.west>O.PI&&(i.west=i.west-O.TWO_PI)),O.equalsEpsilon(Math.abs(Bf.northAngle),O.TWO_PI,O.EPSILON10)&&(i.north=O.PI_OVER_TWO,i.east=O.PI,i.west=-O.PI),O.equalsEpsilon(Math.abs(Bf.southAngle),O.TWO_PI,O.EPSILON10)&&(i.south=-O.PI_OVER_TWO,i.east=O.PI,i.west=-O.PI),i};var A4e=new yc;function C4e(e,t,n){return e.height>=O.PI||e.width>=O.PI?yc.fromCartesian(t[0],A4e).tangentPlane:ns.fromPoints(t,n)}var cae=new he;function E4e(e,t,n){return(i,o)=>{if(e.height>=O.PI||e.width>=O.PI){if(e.south<0&&e.north>0){c(o)||(o=[]);for(let s=0;s=O.PI||e.width>=O.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,cae);return c(r)||(r=new H),r.x=s.longitude/O.PI,r.y=s.latitude/O.PI_OVER_TWO,r}return yc.fromCartesian(o,r)};let i=ns.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function w4e(e,t,n,i){return(o,r)=>!i&&(e.height>=O.PI_OVER_TWO||e.width>=2*O.PI_OVER_THREE)?zn.splitPolygonsOnEquator(o,t,n,r):o}function v4e(e,t,n,i){if(t.height>=O.PI||t.width>=O.PI)return Ke.fromRectangle(t,void 0,iae);let o=e,r=ns.fromPoints(o,n);return zn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,iae)}kf.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,l=e._closeBottom,u=e._arcType,f=e._textureCoordinates,h=c(f),p=r.positions;if(p.length<3)return;let g=e.rectangle,m=zn.polygonsFromHierarchy(r,h,E4e(g,p,n),!s,n,w4e(g,n,u,s)),y=m.hierarchy,b=m.polygons,x=function(I){return I},A=h?zn.polygonsFromHierarchy(f,!0,x,!1,n).polygons:void 0;if(y.length===0)return;let C=y[0].outerRing,S=v4e(C,g,n,o),v=[],P=e._height,M=e._extrudedHeight,R=e._perPositionHeightExtrude||!O.equalsEpsilon(P,M,0,O.EPSILON2),L={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:C4e(g,C,n).plane.normal,projectTo2d:S4e(g,C,n),boundingRectangle:S,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},F;if(R)for(L.extrude=!0,L.top=a,L.bottom=l,L.shadowVolume=e._shadowVolume,L.offsetAttribute=e._offsetAttribute,F=0;F 2) { dimension = ceil(log2(float(u_extentsLength))); } int regionIndex = getPolygonIndex(dimension, v_textureCoordinates); for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) { ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex); int positionsLength = positionsLengthAndExtents.x; int polygonExtentsIndex = positionsLengthAndExtents.y; lastPolygonIndex += 1; if (polygonExtentsIndex == regionIndex) { float clipAmount = czm_infinity; vec4 extents = getExtents(polygonExtentsIndex); vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension; vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents); float s = 1.0; for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) { vec2 a = getPolygonPosition(lastPolygonIndex + i); vec2 b = getPolygonPosition(lastPolygonIndex + j); vec2 ab = b - a; vec2 pa = p - a; float t = dot(pa, ab) / dot(ab, ab); t = clamp(t, 0.0, 1.0); vec2 pq = pa - t * ab; float d = length(pq); 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; } } vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5; out_FragColor = min(out_FragColor, result); } lastPolygonIndex += positionsLength; } } `;function os(e){e=e??W.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.polygonAdded=new pe,this.polygonRemoved=new pe,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(c(t)){let n=t.length;for(let i=0;ieE.equals(t,e))};os.prototype.remove=function(e){T.typeOf.object("polygon",e);let t=this._polygons,n=t.findIndex(i=>eE.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var I4e=new ce;function O4e(e){let t=[],n=[],i=e.length;for(let r=0;rce.union(e[b].computeSphericalExtents(I4e),y,y),a),t[p]=void 0,n[p]=void 0,l=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=ce.clone(a,f),f.south-=l,f.west-=u,f.north+=l,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI),p=-1}}t.push(f),n.push(h)}let o=new Map;return n.filter(c).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(c),extentsIndexByPolygon:o}}os.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;ns+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;c(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(c(i)){let s=i.width*i.height;(s{e._signedDistanceComputeCommand=void 0}})}var uae=new ce,L4e=new ce;os.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Wt.OUTSIDE;this.inverse&&(o=Wt.INSIDE);for(let r=0;r= PRIMARY_STEPS) { break; } vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength); float sampleHeight = length(samplePosition) - atmosphereInnerRadius; vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength; opticalDepth += sampleDensity; 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); for (int j = 0; j < LIGHT_STEPS_MAX; ++j) { if (j >= LIGHT_STEPS) { break; } vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); float lightHeight = length(lightPosition) - atmosphereInnerRadius; lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; lightPositionLength += lightStepLength; } vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); rayleighAccumulation += sampleDensity.x * attenuation; mieAccumulation += sampleDensity.y * attenuation; rayPositionLength += (rayStepLength += rayStepLengthIncrease); } rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; mieColor = u_atmosphereMieCoefficient * mieAccumulation; opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); } vec4 computeAtmosphereColor( vec3 positionWC, vec3 lightDirection, vec3 rayleighColor, vec3 mieColor, float opacity ) { 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; float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq); 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)); vec3 rayleigh = rayleighPhase * rayleighColor; vec3 mie = miePhase * mieColor; vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity; return vec4(color, opacity); } `;var B1=`uniform samplerCube u_radianceMap; in vec2 v_textureCoordinates; const float twoSqrtPi = 2.0 * sqrt(czm_pi); float computeShBasis(int index, vec3 s) { if (index == 0) { return 1.0 / twoSqrtPi; } if (index == 1) { return -sqrt(3.0) * s.y / twoSqrtPi; } if (index == 2) { return sqrt(3.0) * s.z / twoSqrtPi; } if (index == 3) { return -sqrt(3.0) * s.x / twoSqrtPi; } if (index == 4) { return sqrt(15.0) * s.y * s.x / twoSqrtPi; } if (index == 5) { return -sqrt(15.0) * s.y * s.z / twoSqrtPi; } if (index == 6) { return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi; } if (index == 7) { return -sqrt(15.0) * s.x * s.z / twoSqrtPi; } if (index == 8) { 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)); } const int samples = 256; const float solidAngle = 1.0 / float(samples); void main() { 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))); float Ylm = computeShBasis(coefficientIndex, direction); vec3 lookupDirection = -direction.xyz; lookupDirection.z = -lookupDirection.z; vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); out_FragColor += Ylm * color * solidAngle * sinTheta; } } `;var k1=`precision highp float; in vec2 v_textureCoordinates; uniform vec3 u_faceDirection; uniform vec3 u_positionWC; uniform mat4 u_enuToFixedFrame; uniform vec4 u_brightnessSaturationGammaIntensity; uniform vec4 u_groundColor; 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); 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); 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; lookupDirection.x = -lookupDirection.x; lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection); lookupDirection.x = -lookupDirection.x; float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0); skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); 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); 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)); color.rgb = czm_gammaCorrect(color.rgb); out_FragColor = color; } `;var U1=`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; } 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; 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 V1=`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 Qn(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??W.EMPTY_OBJECT;let t=Math.min(e.mipmapLevels??7,Math.log2(ut.maximumCubeMapSize));this._mipmapLevels=t,this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array((t-1)*6),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((t-1)*6),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=Qn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new Q;let n=Math.pow(2,t-1);this._textureDimensions=new H(n,n),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??60*60,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??Qn.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Qn.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}}});Qn._maximumComputeCommandCount=8;Qn._activeComputeCommandCount=0;Qn._nextFrameCommandQueue=[];Qn._queueCommand=(e,t)=>{if(Qn._activeComputeCommandCount>=Qn._maximumComputeCommandCount){Qn._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Qn._activeComputeCommandCount++};Qn._updateCommandQueue=e=>{if(Qn._maximumComputeCommandCount=Math.log2(ut.maximumCubeMapSize),Qn._nextFrameCommandQueue.length>0&&Qn._activeComputeCommandCounts,u_enuToFixedFrame:()=>l,u_faceDirection:()=>Go.getDirection(h,dae),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,V4e)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Qn._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let b=new Ur({context:n,colorTextures:[e._radianceMapTextures[g]]});b._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),b._unBind(),b.destroy(),Qn._activeComputeCommandCount--,y.some(c)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Qn._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function H4e(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,l=0,u=(h,p,g,m,y)=>()=>{if(e.isDestroyed()||h.canceled){Qn._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[p]=void 0,n.copyFace(t,g,m,y),l++,Qn._activeComputeCommandCount--,g.destroy(),e._specularMapTextures[p]=void 0;let x=e._specularMapTextures.length;l>=x&&(e._irradianceCommandDirty=!0,n.sampler=new Qt({minificationFilter:Yt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0)},f=0;for(let h=1;hh/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>Go.getDirection(p,dae)}});b.postExecute=u(b,f,g,p,h),e._convolutionComputeCommands[f]=b,Qn._queueCommand(b,t),++f}r/=2,s/=2}}var hae=new H(3,3);function G4e(e,t){let n=t.context,i=hae,o=e._irradianceMapTexture;c(o)&&!o.isDestroyed()&&o.destroy(),o=new Rt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.FLOAT,pixelFormat:ke.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;c(r)||(r=new He({sources:[B1]}),e._irradianceMapFS=r);let s=new Uc({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Qn._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Qn._activeComputeCommandCount--},e._irradianceComputeCommand=s,Qn._queueCommand(s,t),e._irradianceTextureDirty=!0}function j4e(e,t){let n=t.context;if(!c(e._irradianceMapTexture))return;let i=new Ur({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=hae,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=d.unpack(r,s*4),d.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Qn.prototype.update=function(e){let t=e.mode;if(!Qn.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!c(this._position)||t===oe.MORPHING){this._shouldRegenerateShaders=!1;return}Qn._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=B4e(this,e)||i===a_.SUNLIGHT&&!Q.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=Q.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(z4e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(H4e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(G4e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){j4e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Qn.prototype.isDestroyed=function(){return!1};Qn.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t=this._count)throw new E(`index must be in the range [0, ${this._count})`);let n=this._properties[t];if(c(n))return je(n[e],!0)};H1.prototype.setProperty=function(e,t,n){if(T.typeOf.number("index",e),T.typeOf.string("propertyId",t),e<0||e>=this._count)throw new E(`index must be in the range [0, ${this._count})`);let i=this._properties[t];c(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=je(n,!0)};var l_=H1;function Tc(e){e=e??W.EMPTY_OBJECT,T.typeOf.number("options.count",e.count),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(Tc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(c(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return c(this._metadataTable)&&(e+=this._metadataTable.byteLength),c(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});Tc.prototype.hasProperty=function(e,t){return T.typeOf.number("index",e),T.typeOf.string("propertyId",t),!!(c(this._metadataTable)&&this._metadataTable.hasProperty(t)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||c(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};Tc.prototype.hasPropertyBySemantic=function(e,t){return T.typeOf.number("index",e),T.typeOf.string("semantic",t),c(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Tc.prototype.propertyExists=function(e){return T.typeOf.string("propertyId",e),!!(c(this._metadataTable)&&this._metadataTable.hasProperty(e)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||c(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};Tc.prototype.propertyExistsBySemantic=function(e){return T.typeOf.string("semantic",e),c(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var V9=[];Tc.prototype.getPropertyIds=function(e,t){return t=c(t)?t:[],t.length=0,c(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(V9)),c(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,V9)),c(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(V9)),t};Tc.prototype.getProperty=function(e,t){let n;if(c(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),c(n))||c(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),c(n))||c(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),c(n)))return n};Tc.prototype.setProperty=function(e,t,n){c(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(c(this._jsonMetadataTable)||(this._jsonMetadataTable=new l_({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Tc.prototype.getPropertyBySemantic=function(e,t){if(c(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Tc.prototype.setPropertyBySemantic=function(e,t,n){return c(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Tc.prototype.getPropertyTypedArray=function(e){if(T.typeOf.string("propertyId",e),c(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Tc.prototype.getPropertyTypedArrayBySemantic=function(e){if(T.typeOf.string("semantic",e),c(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};function z9(e,t){if(!c(e)||e<0||e>=t)throw new E(`featureId is required and must be between zero and featuresLength - 1 (${t}`-+").")}Tc.prototype.isClass=function(e,t){z9(e,this.count),T.typeOf.string("className",t);let n=this._batchTableHierarchy;return c(n)?n.isClass(e,t):!1};Tc.prototype.isExactClass=function(e,t){return z9(e,this.count),T.typeOf.string("className",t),this.getExactClassName(e)===t};Tc.prototype.getExactClassName=function(e){z9(e,this.count);let t=this._batchTableHierarchy;if(c(t))return t.getClassName(e)};var nl=Tc;function G1(e){e=e??W.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures;T.typeOf.object("options.property",t),T.typeOf.object("options.classProperty",n),T.typeOf.object("options.textures",i);let o=c(t.channels)?t.channels:[0],r=t,s=Vl.createModelTextureReader({textureInfo:r,channels:K4e(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,l=t.scale,u=n.hasValueTransform||c(a)||c(l);a=a??n.offset,l=l??n.scale,a=n.unpackVectorAndMatrixTypes(a),l=n.unpackVectorAndMatrixTypes(l),this._offset=a,this._scale=l,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(G1.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}}});G1.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(dt(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(dt(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==at.SCALAR?(dt(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==Nt.UINT8?(dt(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:at.isVectorType(t)||t===at.SCALAR?n!==Nt.UINT8?(dt(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(dt(`Property texture property ${e.id} has an unsupported type`),!1)};var Y4e=[void 0,"float","vec2","vec3","vec4"],X4e=[void 0,"int","ivec2","ivec3","ivec4"];G1.prototype.getGlslType=function(){let e=this._classProperty,t=at.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?Y4e[t]:X4e[t]};G1.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function K4e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var j1=G1;function H9(e){e=e??W.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures;T.typeOf.object("options.propertyTexture",t),T.typeOf.object("options.class",n),T.typeOf.object("options.textures",i);let o=t.extensions,r=t.extras,s={};if(c(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new j1({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(H9.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}}});H9.prototype.getProperty=function(e){return T.typeOf.string("propertyId",e),this._properties[e]};var u_=H9;function pae(e){e=e??W.EMPTY_OBJECT;let t=e.property,n=e.classProperty;T.typeOf.object("options.property",t),T.typeOf.object("options.classProperty",n),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||c(i)||c(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(pae.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 W1=pae;function G9(e){e=e??W.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class;T.typeOf.object("options.propertyAttribute",t),T.typeOf.object("options.class",n);let i={};if(c(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new W1({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(G9.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}}});G9.prototype.getProperty=function(e){return T.typeOf.string("propertyId",e),this._properties[e]};var Sx=G9;function q1(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.schema",e.schema),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=c(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(q1.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(!c(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n=r;)x=o[x-r];o.push(x),s[y]=b}b>h8e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):b>m8e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===l?(l=b,t[a]=b):y===u?(u=b,t[a+1]=b):(f=b,t[a+2]=b),y=gae(i,l,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function gae(e,t,n,i,o,r,s){let a=s?1:0,l=o?1:0,u=0,f=j9(e,t,a,l,u);if(f===0)return t;let h=0,p=o?1:0,g=r?1:0,m=j9(e,n,h,p,g);if(m===0)return n;let y=s?1:0,b=0,x=r?1:0,A=j9(e,i,y,b,x);if(A===0)return i;let C=f&m&A,S,v,P;if(C&1)S=0,v=1,P=2;else if(C&2)S=0,P=1,v=2;else if(C&4)v=0,S=1,P=2;else if(C&8)v=0,P=1,S=2;else if(C&16)P=0,S=1,v=2;else if(C&32)P=0,v=1,S=2;else{let F=W9(f),_=W9(m),w=W9(A);return F<_&&F>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}bz.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a1;)i>>=1,r.push(yae(i));let s=new Rt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:ke.LUMINANCE,sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR_MIPMAP_LINEAR,magnificationFilter:li.LINEAR})});return t.outlineTexture=s,s};function yae(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 bae(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),c(this._processError)){this._state=Bo.FAILED;let o=this._processError;this._processError=void 0,Tz(this,o)}let t=this._textureErrors.pop();if(c(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===Bo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=Bo.FAILED,Tz(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=Bo.FAILED,Tz(this,o)}return this._incrementallyLoadTextures?n:n&&i};function eHe(e,t,n,i,o,r,s,a){let l=e.gltfJson,f=l.accessors[t].bufferView;return vi.getVertexBufferLoader({gltf:l,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:f,primitive:i,draco:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:s})}function tHe(e,t,n,i,o,r,s){return vi.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function nHe(e,t){let n=vi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function Mae(e,t,n){let i=t.byteOffset,o=Ul(e,t),r=t.count,s=wu(t.type),a=t.componentType,l=$.getSizeInBytes(a),u=l*s,f=r*s;if(o===u)return n=new Uint8Array(n),$.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let h=$.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),m=o_(t.componentType);i=n.byteOffset+i;for(let y=0;y{c(o)&&c(o.attributes)&&c(o.attributes[h])?mHe(b,x,r,s):pHe(l,u,b,x,r,s)},b}function Fae(e,t,n,i,o,r,s,a){let l=n.modelSemantic,u=l===ht.POSITION,f=l===ht.FEATURE_ID,h=u&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=u&&e._enablePick&&!a.context.webgl2,g=e._loadForClassification&&f,m=e._loadAttributesAsTypedArray,y=!m,b=m||h||p||g,C=Nae(e,t,n,i,o,s?!1:y,s?!0:b,a),S=new vx.AttributeLoadPlan(C);return S.loadBuffer=y,S.loadTypedArray=b,S}function _He(e,t,n,i,o){let r=e.gltfJson.accessors,s=c(n.ROTATION),a=c(n.TRANSLATION)&&c(r[n.TRANSLATION].min)&&c(r[n.TRANSLATION].max),l=X9(e,rs,i),u=l.modelSemantic,f=u===rs.TRANSLATION||u===rs.ROTATION||u===rs.SCALE,h=u===rs.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!o.scene3DOnly;return Nae(e,t,l,void 0,void 0,m,p||h&&(!a||y||g),o)}function gHe(e,t,n,i,o,r,s){let a=e.gltfJson.accessors[t],l=a.bufferView;if(!c(i)&&!c(l))return;let u=new P8e;u.count=a.count;let f=e._loadAttributesAsTypedArray,h=(e._loadIndicesForWireframe||e._enablePick)&&!s.context.webgl2,p=e._loadForClassification&&o,m=!f,y=f||h||p,A=tHe(e,t,n,i,r?!1:m,r?!0:y,s),C=e._geometryLoaders.length;e._geometryLoaders.push(A);let S=A.load();e._loaderPromises.push(S),e._geometryCallbacks[C]=()=>{u.indexDatatype=A.indexDatatype,u.buffer=A.buffer,u.typedArray=A.typedArray};let v=new vx.IndicesLoadPlan(u);return v.loadBuffer=m,v.loadTypedArray=y,v}function il(e,t,n,i){let o=e.gltfJson,r=Vl.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!c(r))return;let s=vi.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=Vl.createModelTextureReader({textureInfo:t}),l=e._textureLoaders.length;e._textureLoaders.push(s);let u=s.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=Bo.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[l]=()=>{a.texture=s.texture,c(i)&&(a.texture.sampler=i)},a}function yHe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,l=new q8e;return c(i)&&(l.diffuseTexture=il(e,i,n)),c(o)&&(l.specularGlossinessTexture=il(e,o,n)),l.diffuseFactor=Du(se,r),l.specularFactor=Du(d,s),l.glossinessFactor=a,l}function bHe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,l=new W8e;return c(i)&&(l.baseColorTexture=il(e,i,n)),c(o)&&(l.metallicRoughnessTexture=il(e,o,n)),l.baseColorFactor=Du(se,r),l.metallicFactor=s,l.roughnessFactor=a,l}function xHe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new Y8e;return c(o)&&(a.specularTexture=il(e,o,n)),c(s)&&(a.specularColorTexture=il(e,s,n)),a.specularFactor=i,a.specularColorFactor=Du(d,r),a}function THe(e,t,n){let{anisotropyStrength:i=q9.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=q9.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new q9;return c(r)&&(s.anisotropyTexture=il(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function AHe(e,t,n){let{clearcoatFactor:i=Y9.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=Y9.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,l=new Y9;return c(o)&&(l.clearcoatTexture=il(e,o,n)),c(s)&&(l.clearcoatRoughnessTexture=il(e,s,n)),c(a)&&(l.clearcoatNormalTexture=il(e,a,n)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function CHe(e,t,n){let i=new X8e,o=t.extensions??W.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;return i.unlit=c(o.KHR_materials_unlit),c(r)?i.specularGlossiness=yHe(e,r,n):(c(u)&&(i.metallicRoughness=bHe(e,u,n)),c(s)&&!i.unlit&&(i.specular=xHe(e,s,n)),c(a)&&!i.unlit&&(i.anisotropy=THe(e,a,n)),c(l)&&!i.unlit&&(i.clearcoat=AHe(e,l,n))),c(t.emissiveTexture)&&(i.emissiveTexture=il(e,t.emissiveTexture,n)),c(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=il(e,t.normalTexture,n)),c(t.occlusionTexture)&&(i.occlusionTexture=il(e,t.occlusionTexture,n)),i.emissiveFactor=Du(d,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function Bae(e,t){let n=new Iae;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 kae(e,t,n,i){let o=new Iae,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Lae(r.attribute),o.positionalLabel=i,o}function Uae(e,t){let n=new Rae;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 Vae(e,t,n,i){let o=new Rae,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=r.constant??0;let s=r.divisor??0;return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function EHe(e,t,n,i){let o=new Oae;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=il(e,r,n,Qt.NEAREST);let a=(c(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=a,o}function SHe(e,t,n,i,o,r){let s=new Oae,a=t.featureIds,l=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=il(e,l,i,Qt.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function wHe(e,t,n,i,o){let r=new I8e,s=void 0,a=void 0,l=!1;for(let u in t){if(!t.hasOwnProperty(u))continue;let f=t[u],h=X9(e,ht,u),p=Fae(e,f,h,s,a,l,n,o);r.attributes.push(p.attribute),i.attributePlans.push(p)}return r}function vHe(e,t,n,i){let o=new O8e,r=new vx(o);e._primitiveLoadPlans.push(r);let s=t.material;c(s)&&(o.material=CHe(e,e.gltfJson.materials[s],i));let a=t.extensions??W.EMPTY_OBJECT,l=!1,u=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&c(u)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=DHe(e,u,r));let f=e._loadForClassification,h=a.KHR_draco_mesh_compression,p=!1,g=t.attributes;if(c(g))for(let v in g){if(!g.hasOwnProperty(v))continue;let P=g[v],M=X9(e,ht,v),R=M.modelSemantic;if(f&&!hHe(R))continue;R===ht.FEATURE_ID&&(p=!0);let L=Fae(e,P,M,t,h,n,l,i);r.attributePlans.push(L),o.attributes.push(L.attribute)}let m=t.targets;if(c(m)&&!f)for(let v=0;vn[s]);let r=t.inverseBindMatrices;if(c(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=Az(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(B.IDENTITY);return i}function UHe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!c(n))return[];let i=n.map(function(r,s){let a=kHe(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r=s.clientWidth)u=!0;else{if(C.x>s.clientWidth*.5){a.width=C.x,l.frustum.right=p.x-x,Ac=aR(r,n,l,Ac),Va.clipToGLWindowCoordinates(a,Ac,$9),a.x+=C.x,l.position.x=-l.position.x;let S=l.frustum.right;l.frustum.right=-l.frustum.left,l.frustum.left=-S,Ac=aR(r,n,l,Ac),Va.clipToGLWindowCoordinates(a,Ac,Z9)}else{a.x+=C.x,a.width-=C.x,l.frustum.left=-p.x-x,Ac=aR(r,n,l,Ac),Va.clipToGLWindowCoordinates(a,Ac,$9),a.x=a.x-a.width,l.position.x=-l.position.x;let S=l.frustum.left;l.frustum.left=-l.frustum.right,l.frustum.right=-S,Ac=aR(r,n,l,Ac),Va.clipToGLWindowCoordinates(a,Ac,Z9)}d.clone(g,l.position),l.frustum=m.clone(),i=H.clone($9,i),(i.x<0||i.x>s.clientWidth)&&(i.x=Z9.x)}}if(o.mode!==oe.SCENE2D||u){if(Ac=aR(r,n,l,Ac),Ac.z<0&&!(l.frustum instanceof on)&&!(l.frustum instanceof jo))return;i=Va.clipToGLWindowCoordinates(a,Ac,i)}return i.y=s.clientHeight-i.y,i};Va.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Va.worldToWindowCoordinates(e,t,n),!!c(n))return Va.transformWindowToDrawingBuffer(e,n,n)};var d_=new d,mGe=new he;Va.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,mGe);if(!c(r))return;if(o.project(r,d_),i===oe.COLUMBUS_VIEW)return d.fromElements(d_.z,d_.x,d_.y,n);if(i===oe.SCENE2D)return d.fromElements(0,d_.x,d_.y,n);let s=e.morphTime;return d.fromElements(O.lerp(d_.z,t.x,s),O.lerp(d_.x,t.y,s),O.lerp(d_.y,t.z,s),n)};var qae=new d,Yae=new d,Xae=new B;Va.clipToGLWindowCoordinates=function(e,t,n){return d.divideByScalar(t,t.w,qae),B.computeViewportTransformation(e,0,1,Xae),B.multiplyByPoint(Xae,qae,Yae),H.fromCartesian3(Yae,n)};Va.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return H.fromElements(t.x*o,t.y*r,n)};var pGe=new se,Kae=new se;Va.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,l=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=l*(1-a/(m+a))/(l-a)}let u=e.view.passState.viewport,f=se.clone(se.UNIT_W,pGe);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(c(p.fovy)){h=B.multiplyByVector(r.inverseViewProjection,f,Kae);let g=1/h.w;d.multiplyByScalar(h,g,h)}else{let g=p.offCenterFrustum;c(g)&&(p=g),h=Kae,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*(a-l)-a-l)*.5,h.w=1,h=B.multiplyByVector(r.inverseView,h,h)}return d.fromCartesian4(h,i)};var Gi=Va;var rE={};rE._deprecationWarning=ws;var h_=Uint32Array.BYTES_PER_ELEMENT;rE.parse=function(e,t){let n=t??0;T.defined("arrayBuffer",e),t=n;let i=new Uint8Array(e),o=new DataView(e);t+=h_;let r=o.getUint32(t,!0);if(r!==1)throw new ae(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=h_;let s=o.getUint32(t,!0);t+=h_;let a=o.getUint32(t,!0);t+=h_;let l=o.getUint32(t,!0);t+=h_;let u=o.getUint32(t,!0);t+=h_;let f=o.getUint32(t,!0);t+=h_;let h;u>=570425344?(t-=h_*2,h=a,u=l,f=0,a=0,l=0,rE._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-=h_,h=u,u=a,f=l,a=0,l=0,rE._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:h??0}:(p=ir(i,t,a),t+=a);let g=new Uint8Array(e,t,l);t+=l;let m,y;u>0&&(m=ir(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let b=n+s-t;if(b===0)throw new ae("glTF byte length must be greater than 0.");let x;return t%4===0?x=new Uint8Array(e,t,b):(rE._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),x=new Uint8Array(i.subarray(t,t+b))),{batchLength:h,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:x}};var cR=rE;function lR(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function $ae(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return c(a)||(a=$.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function _Ge(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return c(r)||(r=$.createTypedArray(n,i),o[t]=r),r}lR.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(c(i))return c(i.byteOffset)?(t=t??$.UNSIGNED_INT,n=n??1,$ae(this,e,t,n,1,i.byteOffset)):i};lR.prototype.hasProperty=function(e){return c(this.json[e])};lR.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(c(i))return c(i.byteOffset)?(c(i.componentType)&&(t=$.fromName(i.componentType)),$ae(this,e,t,n,this.featuresLength,i.byteOffset)):_Ge(this,e,t,i)};lR.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!c(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a0&&(m=ir(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let b=n+s-t;if(b===0)throw new ae("glTF byte length must be greater than 0.");let x;return t%4===0?x=new Uint8Array(e,t,b):(Ez._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),x=new Uint8Array(i.subarray(t,t+b))),{gltfFormat:h,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:x}};var hR=Ez;var p_={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},Sz=Tn.Attribute,BGe=Tn.FeatureIdAttribute,nce=Tn.Instances;function __(e){e=e??W.EMPTY_OBJECT;let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=e.byteOffset??0,r=e.releaseGltfJson??!1,s=e.asynchronous??!0,a=e.incrementallyLoadTextures??!0,l=e.upAxis??Fo.Y,u=e.forwardAxis??Fo.X,f=e.loadAttributesAsTypedArray??!1,h=e.loadIndicesForWireframe??!1,p=e.loadPrimitiveOutline??!0,g=e.enablePick??!1;T.typeOf.object("options.i3dmResource",t),T.typeOf.object("options.arrayBuffer",n),i=c(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=l,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._enablePick=g,this._state=p_.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=B.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}c(Object.create)&&(__.prototype=Object.create($i.prototype),__.prototype.constructor=__);Object.defineProperties(__.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});__.prototype.load=function(){if(c(this._promise))return this._promise;let e=hR.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new sh(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!c(a))throw new ae("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let l=s.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(l)&&(this._transform=B.fromTranslation(d.fromArray(l))),this._batchTable={json:i,binary:o};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let h=Fl(e.gltf);h=h.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:h});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new rh(u);return this._gltfLoader=f,this._state=p_.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=p_.PROCESSING,this}).catch(h=>{if(!this.isDestroyed())throw kGe(this,h)}),this._promise};function kGe(e,t){return e.unload(),e._state=p_.FAILED,e.getError("Failed to load i3dm",t)}__.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===p_.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===p_.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=B.multiplyTransformation(this._transform,i.transform,i.transform),zGe(this,i,e),UGe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=p_.READY,!0};function UGe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(c(n.json))o=m_({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new nl({name:Qd.BATCH_TABLE_CLASS_NAME,count:i});o=new Ys({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var wz=new d,eW=new Array(4),VGe=new B;function zGe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",$.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),l=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=GGe(o,r),h;l&&(h=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let g=new Float32Array(r),m=d.unpackArray(f),y=new d,b=new d,x=new d,A=new d,C=new J,S=new Le,v=new Array(4),P=new d,M=new Array(3),R=new B;if(!c(s)||d.equals(d.unpack(s),d.ZERO)){let V=le.fromPoints(m);for(i=0;i0&&(V.instances=z?HGe(L):L,z=!0)}}function HGe(e){let t=new nce;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;on[i-1])throw new E("time is out of range.");if(t=t??0,e>=n[t]){if(t+1=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o=n[o]&&e=0&&!(e>=n[o]&&en&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};sE.prototype.clampTime=function(e){T.typeOf.number("time",e);let t=this.times;return O.clamp(e,t[0],t[t.length-1])};var Ni=sE;function aE(e){this._value=e,this._valueType=Ni.getPointType(e)}Object.defineProperties(aE.prototype,{value:{get:function(){return this._value}}});aE.prototype.findTimeInterval=function(e){throw new E("findTimeInterval cannot be called on a ConstantSpline.")};aE.prototype.wrapTime=function(e){return T.typeOf.number("time",e),0};aE.prototype.clampTime=function(e){return T.typeOf.number("time",e),0};aE.prototype.evaluate=function(e,t){T.typeOf.number("time",e);let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var pR=aE;function cE(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new E("points and times are required.");if(t.length<2)throw new E("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new E("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=Ni.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(cE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});cE.prototype.findTimeInterval=Ni.prototype.findTimeInterval;cE.prototype.wrapTime=Ni.prototype.wrapTime;cE.prototype.clampTime=Ni.prototype.clampTime;cE.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]:(c(t)||(t=new d),d.lerp(n[o],n[o+1],r,t))};var Py=cE;var ice={};ice.solve=function(e,t,n,i){if(!c(e)||!(e instanceof Array))throw new E("The array lower is required.");if(!c(t)||!(t instanceof Array))throw new E("The array diagonal is required.");if(!c(n)||!(n instanceof Array))throw new E("The array upper is required.");if(!c(i)||!(i instanceof Array))throw new E("The array right is required.");if(t.length!==i.length)throw new E("diagonal and right must have the same lengths.");if(e.length!==n.length)throw new E("lower and upper must have the same lengths.");if(e.length!==t.length-1)throw new E("lower and upper must be one less than the length of diagonal.");let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a=0;--a)s[a]=d.subtract(r[a],d.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var lE=ice;var oce=[],rce=[],sce=[],ace=[];function XGe(e,t,n){let i=oce,o=sce,r=rce,s=ace;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let l=s[0];for(c(l)||(l=s[0]=new d),d.clone(t,l),a=1;a=n.length||e.index<0))throw new E("options.index must be a valid animation index.");let i=e.index;if(c(i))return iW(this,n[i],e);let o=n.length;for(let r=0;r=this._runtimeAnimations.length||e<0)throw new E("index must be valid within the range of the collection");return this._runtimeAnimations[e]};var vz=[];function o5e(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&&Q.equals(e.time,this._previousTime))return!1;this._previousTime=Q.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Hl.REPEAT)g=g-Math.floor(g);else if(a.loop===Hl.MIRRORED_REPEAT){let A=Math.floor(g),C=g-A;g=A%2===1?1-C:C}let b=a.startOffset;a.reverse&&(g=1-g,b=-b);let x=g*u*a.multiplier+b;x=O.clamp(x,a.localStartTime,a.localStopTime),a.animate(x),a.update.numberOfListeners>0&&(a._updateEventTime=x,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=ah.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&vz.push(a))}}n=vz.length;for(let s=0;sO.EPSILON3}};var vR=uce;var DR=`#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) { 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) 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); 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 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 fce={name:"ImageBasedLightingPipelineStage"},a5e=new H;fce.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;c(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,ge.FRAGMENT),r.addUniform("vec2","model_iblFactor",ge.FRAGMENT),Yd.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",ge.FRAGMENT),c(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),c(a)&&c(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,ge.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",ge.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),c(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||c(s)?(r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,ge.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",ge.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",ge.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT)),r.addFragmentLines(DR);let l={model_iblFactor:function(){return H.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,a5e)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};c(s)&&(l.model_specularEnvironmentMaps=function(){return s},l.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=xt(l,e.uniformMap)};var PR=fce;var c5e=O.EPSILON16;function rW(e){e=e??W.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;T.typeOf.object("options.stage",t),T.typeOf.object("options.runtimeArticulation",n),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(rW.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){T.typeOf.number("value",e),e=O.clamp(e,this.minimumValue,this.maximumValue),O.equalsEpsilon(this._currentValue,e,c5e)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var l5e=new d,oW=new J;rW.prototype.applyStageToMatrix=function(e){T.typeOf.object("result",e);let t=this.type,n=this.currentValue,i=l5e,o;switch(t){case xc.XROTATE:o=J.fromRotationX(O.toRadians(n),oW),e=B.multiplyByMatrix3(e,o,e);break;case xc.YROTATE:o=J.fromRotationY(O.toRadians(n),oW),e=B.multiplyByMatrix3(e,o,e);break;case xc.ZROTATE:o=J.fromRotationZ(O.toRadians(n),oW),e=B.multiplyByMatrix3(e,o,e);break;case xc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=B.multiplyByTranslation(e,i,e);break;case xc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=B.multiplyByTranslation(e,i,e);break;case xc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=B.multiplyByTranslation(e,i,e);break;case xc.XSCALE:i.x=n,i.y=1,i.z=1,e=B.multiplyByScale(e,i,e);break;case xc.YSCALE:i.x=1,i.y=n,i.z=1,e=B.multiplyByScale(e,i,e);break;case xc.ZSCALE:i.x=1,i.y=1,i.z=n,e=B.multiplyByScale(e,i,e);break;case xc.UNIFORMSCALE:e=B.multiplyByUniformScale(e,n,e);break;default:break}return e};var IR=rW;function Dz(e){e=e??W.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;T.typeOf.object("options.articulation",t),T.typeOf.object("options.sceneGraph",n),this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,u5e(this)}Object.defineProperties(Dz.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 u5e(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s 0.0 && clipDistance < clippingPlanesEdgeWidth) { color = clippingPlanesEdgeColor; } } `;var dce={name:"ModelClippingPlanesPipelineStage"},h5e=new H;dce.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,ge.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,ge.FRAGMENT),gs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,ge.FRAGMENT);let s=gs.getTextureResolution(i,o,h5e);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,ge.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",ge.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",ge.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",ge.FRAGMENT),r.addFragmentLines(MR);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let l=G.clone(i.edgeColor);return l.alpha=i.edgeWidth,l},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=xt(a,e.uniformMap)};var LR=dce;var NR=`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 FR=`void modelClippingPolygonsStage() { vec2 clippingPosition = v_clippingPosition; int regionIndex = v_regionIndex; czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); } `;var hce={name:"ModelClippingPolygonsPipelineStage"};hce.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,ge.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,ge.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,ge.BOTH),o.addUniform("sampler2D","model_clippingDistance",ge.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",ge.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(NR),o.addFragmentLines(FR);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=xt(r,e.uniformMap)};var BR=hce;function mce(e,t){T.typeOf.object("model",e),T.typeOf.object("runtimeNode",t),this._model=e,this._runtimeNode=t}Object.defineProperties(mce.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){c(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 kR=mce;var UR=`mat4 getInstancingTransform() { mat4 instancingTransform; #ifdef HAS_INSTANCE_MATRICES instancingTransform = mat4( a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 ); #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, a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 ); #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 VR=`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 zR=`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 Pz=new B,m5e=new B,p5e=new B,_ce={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Tce,_transformsToTypedArray:aW};_ce.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(UR);let s=e.model,a=s.sceneGraph,l=e.runtimeNode,u=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,h=[];I5e(e,n,i,h,u,f),M5e(e,n,i,h);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",ge.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",ge.VERTEX),p.u_instance_modifiedModelView=function(){let g=B.multiplyTransformation(s.modelMatrix,a.components.transform,Pz);return u?B.multiplyTransformation(n.context.uniformState.view3D,g,Pz):(n.mode!==oe.SCENE3D&&(g=Ot.basisTo2D(n.mapProjection,g,Pz)),B.multiplyTransformation(n.context.uniformState.view,g,Pz))},p.u_instance_nodeTransform=function(){return B.multiplyTransformation(a.axisCorrectionMatrix,l.computedTransform,m5e)},r.addVertexLines(zR)):r.addVertexLines(VR),u){r.addDefine("USE_2D_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_modelView2D",ge.VERTEX);let g=n.context,m=B.fromTranslation(l.instancingReferencePoint2D,new B);p.u_modelView2D=function(){return B.multiplyTransformation(g.uniformState.view,m,p5e)}}e.uniformMap=xt(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,h)};var HR=new B,_5e=new d;function g5e(e,t,n,i,o){let r=B.multiplyTransformation(t,e,HR);return r=B.multiplyTransformation(r,n,HR),o=Ot.basisTo2D(i.mapProjection,r,o),o}function y5e(e,t,n,i,o){let r=B.fromTranslation(e,HR),s=B.multiplyTransformation(t,r,HR);s=B.multiplyTransformation(s,n,HR);let a=B.getTranslation(s,_5e);return o=Gi.computeActualEllipsoidPosition(i,a,o),o}function gce(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=B.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=B.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=B.clone(o.computedModelMatrix,t),t=B.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=B.clone(B.IDENTITY,n))}var yce=new B,bce=new B,b5e=new B,x5e=new d;function T5e(e,t,n,i){let o=yce,r=bce;gce(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,l=e.length;for(let u=0;u=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:nn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var GR=_ce;var lW={};lW.name="ModelMatrixUpdateStage";lW.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;Ace(e,t,o,e.transformToRoot),e._transformDirty=!1}};function L5e(e,t,n){e.modelMatrix=B.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=$t.getCullFace(e.modelMatrix,e.primitiveType)}function Ace(e,t,n,i){let o;i=B.multiplyTransformation(i,e.transform,new B),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o=this.children.length)throw new E("index must be greater than or equal to 0 and less than the number of children.");return this.sceneGraph._runtimeNodes[this.children[e]]};pE.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,c(e.instances)&&t.push(GR),t.push(WR),n.push(jR)};pE.prototype.updateComputedTransform=function(){this._computedTransform=B.multiply(this._transformToRoot,this._transform,this._computedTransform)};pE.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!c(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return l.textureDimensions}),e.uniformMap=xt(o,e.uniformMap)};var XR=vce;var Dce={name:"ClassificationPipelineStage"};Dce.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,ge.BOTH);let o=e.runtimePrimitive;c(o.batchLengths)||F5e(t,o)};function F5e(e,t){let n=$t.getAttributeBySemantic(e,ht.POSITION);if(!c(n))throw new ae("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=c(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=$t.getAttributeBySemantic(e,ht.FEATURE_ID,0);if(!c(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let l=a.typedArray;a.typedArray=void 0;let u=[],f=[0],h=r?i[0]:0,p=l[h],g=0;for(let y=1;yq5e(i,t,n)):[]}function q5e(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=$t,s=e.class.id,a=n?.classes[s],l=Object.entries(e.properties),u=new Array(l.length);for(let f=0;fX5e(n,t)):[]}function X5e(e,t){let{sanitizeGlslIdentifier:n}=$t,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,l])=>l.isGpuCompatible()),s=new Array(r.length);for(let a=0;af),n.addStructField(Di.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,m=g;if(c(h)&&!J.equals(h,J.IDENTITY)){let C=`${p}Transform`;n.addUniform("mat3",C,ge.FRAGMENT),i[C]=function(){return h},m=`vec2(${C} * vec3(${g}, 1.0))`}let y=`texture(${p}, ${m}).${l}`,b=s.unpackInShader(y),x=Fce({valueExpression:b,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:ge.FRAGMENT,property:s}),A=`metadata.${o} = ${x};`;n.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,[A])}function Mce(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Nce(Di.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Di.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,s),ge.includesVertexShader(r)&&(e.addStructField(Di.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Lce(e,t){let{propertyStatistics:n}=t;if(!c(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===at.ENUM)return;let s=Di.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,l=Nce(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(Di.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,l),ge.includesVertexShader(t.shaderDestination)&&(e.addStructField(Di.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,l))}function Nce(e,t,n,i){function o(r){let s=t[r.specName];if(c(s))return`${n}.${r.shaderName} = ${i}(${s});`}return c(t)?e.map(o).filter(c):[]}function Fce(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:l,shaderDestination:u}=e;s.addUniform(l,o,u),s.addUniform(l,r,u);let{offset:f,scale:h}=n;return a[o]=()=>f,a[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}var Uf=Di;var ije={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Ly=Object.freeze(ije);var ga={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:dt};ga.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:l}=s;c(a)&&(e.lightingOptions.lightingModel=a),l===Ly.TRANSLUCENT?r.pass=De.TRANSLUCENT:l===Ly.OPAQUE&&(r.pass=void 0);let u=fje(s,t);if(!u.customShaderEnabled)return;if(pje(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,ge.BOTH),c(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,ge.VERTEX),c(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,ge.FRAGMENT);let p=y_.getDefineName(s.mode);i.addDefine(p,void 0,ge.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[p];i.addUniform(g.type,p)}let h=s.varyings;for(let p in h)if(h.hasOwnProperty(p)){let g=h[p];i.addVarying(g,p)}e.uniformMap=xt(e.uniformMap,s.uniformMap)};function oje(e){let t={};for(let n=0;n1?(g=e.attributeIndex,e.attributeIndex+=h):p&&!a?g=0:g=e.attributeIndex++,Aje(e,f,g,h,r,s)}Oje(i,t.attributes),t.primitiveType===Me.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(lM),i.addFragmentLines(cM)};function Aje(e,t,n,i,o,r){let s=e.shaderBuilder,a=$t.getAttributeInfo(t),l=o&&!r;i>1?Sje(e,t,n,i):Eje(e,t,n,l),vje(s,a,l),wje(s,a),c(t.semantic)&&Cje(s,t),Dje(s,a,o),Pje(s,a,l),Ije(s,a)}function Cje(e,t){let{semantic:n,setIndex:i}=t;switch(n){case ht.NORMAL:e.addDefine("HAS_NORMALS");break;case ht.TANGENT:e.addDefine("HAS_TANGENTS");break;case ht.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case ht.TEXCOORD:case ht.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function Eje(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:l}=c(o)?o:t;r===ht.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=r===ht.POSITION,f=u?0:n,h=nn.getNumberOfComponents(a),p={index:f,value:c(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:h,componentDatatype:l,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:h,componentDatatype:$.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function Sje(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=c(o)?o:t,u=nn.getNumberOfComponents(s)/i,f=$.getSizeInBytes(a),h=u*f,p=t.byteStride;for(let g=0;g0,u=!c(a)&&l;if(c(r)&&!u){let y=n6e(a),b=i6e(r,y);o6e(i,b);let A=r6e(b).indexOf("normalMC")>=0,C=$t.getAttributeBySemantic(t,ht.NORMAL);if(A&&!C)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,ge.VERTEX),b.styleTranslucent&&(e.alphaOptions.pass=De.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,ge.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,ge.VERTEX);let h,p,g;pr.is3DTiles(o.type)&&(p=!0,h=o.content,g=h.tile.refine===qo.ADD),i.addUniform("vec4","model_pointCloudParameters",ge.VERTEX),i.addVertexLines(bM);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=Qje,b=1;p&&(b=g?5:h.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??b,y.x*=n.pixelRatio;let x=Jje(e,t,f,h);y.y=x*f.geometricErrorScale;let A=n.context,C=n.camera.frustum,S;return n.mode===oe.SCENE2D||C instanceof on?S=Number.POSITIVE_INFINITY:S=A.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=S,p&&(y.w=h.tileset.timeSinceLoad),y}};var $ce=new d;function Jje(e,t,n,i){if(c(i)){let f=i.tile.geometricError;if(f>0)return f}if(c(n.baseResolution))return n.baseResolution;let o=$t.getAttributeBySemantic(t,ht.POSITION),r=o.count,s=e.runtimeNode.transform,a=d.subtract(o.max,o.min,$ce);a=B.multiplyByPointAsVector(s,a,$ce);let l=a.x*a.y*a.z;return O.cbrt(l/r)}var e6e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},t6e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function n6e(e){let t=je(t6e);if(!c(e))return t;for(let n=0;n0,p=c(i.skin),g=c(r),y=!(g&&c(r.fragmentShaderText))||r.mode!==y_.REPLACE_MATERIAL,b=$t.hasQuantizedAttributes(n.attributes),x=o.debugWireframe&&Me.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),A=o.pointCloudShading,C=c(A)&&A.attenuation,S=c(A)&&A.backFaceCulling,v=n.primitiveType===Me.POINTS&&(c(s)||C||S),P=o._enableShowOutline&&c(n.outlineCoordinates),M=v6e(o,i,n),R=c(o.classificationType);u&&t.push(SM),t.push(fM),x&&t.push(IM),R&&t.push(KR),h&&t.push(gM),p&&t.push(vM),v&&t.push(xM),b&&t.push(aM),y&&t.push(pM),t.push(My),t.push(Uf),t.push(Pu),M.hasPropertyTable&&(t.push(Ny),t.push(XR),t.push(QR)),f&&t.push(PM),g&&t.push(rM),t.push(hM),o.allowPicking&&t.push(yM),P&&t.push(CM),t.push(YR),t.push(EM)};function v6e(e,t,n){let i;return c(t.instances)&&(i=$t.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),c(i))?{hasFeatureIds:!0,hasPropertyTable:c(i.propertyTableId)}:(i=$t.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),c(i)?{hasFeatureIds:!0,hasPropertyTable:c(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var OM=ule;function _W(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.skin",e.skin),T.typeOf.object("options.sceneGraph",e.sceneGraph),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],D6e(this)}Object.defineProperties(_W.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 D6e(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let l=0;l czm_splitPosition) discard; if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; #endif } `;var Oz={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};Oz.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,ge.FRAGMENT),i.addFragmentLines(kM);let o={};i.addUniform("float",Oz.SPLIT_DIRECTION_UNIFORM_NAME,ge.FRAGMENT),o[Oz.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=xt(o,e.uniformMap)};var UM=Oz;function O6e(e,t){T.typeOf.object("modelRenderResources",e),T.typeOf.object("runtimeNode",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}var VM=O6e;function R6e(e){e=e??W.EMPTY_OBJECT,this.lightingModel=e.lightingModel??Dm.UNLIT}var zM=R6e;function M6e(e,t){T.typeOf.object("nodeRenderResources",e),T.typeOf.object("runtimePrimitive",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=c(n.indices)?n.indices.count:$t.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=$t.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 zM,this.pickId=void 0}var HM=M6e;function yW(e){e=e??W.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources;T.typeOf.object("options.command",t),T.typeOf.object("options.primitiveRenderResources",n);let 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!==Un.CESIUM_3D_TILE,this._classifies3DTiles=o!==Un.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],B6e(this)}function L6e(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:e,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:dc.LESS_OR_EQUAL},depthMask:!1}}var N6e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND},F6e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},mle=[];function B6e(e){let t=e._command,n=mle;if(e._useDebugWireframe){t.pass=De.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=GM(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;as||o<-s&&r>-s}function yE(e,t){if(!c(t))return;let n=b_.clone(t),i=Qe.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 W6e(e){yE(e,e._originalCommand),yE(e,e._translucentCommand),yE(e,e._skipLodBackfaceCommand),yE(e,e._skipLodStencilCommand),yE(e,e._silhouetteModelCommand),yE(e,e._silhouetteColorCommand)}function q6e(e){let t=Qe.shallowClone(e);t.pass=De.TRANSLUCENT;let n=je(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=ln.ALPHA_BLEND,t.renderState=Ve.fromCache(n),t}function Y6e(e,t){let n=t._silhouetteId%255,i=Qe.shallowClone(e),o=je(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ne.ALWAYS,backFunction:ne.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ve.fromCache(o),i}function X6e(e,t){let n=t._silhouetteId%255,i=Qe.shallowClone(e),o=je(e.renderState,!0);o.cull.enabled=!1,(e.pass===De.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=De.TRANSLUCENT,o.depthMask=!1,o.blending=ln.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ne.NOTEQUAL,backFunction:ne.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP}};let s=je(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ve.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function K6e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=$6e(o);if(r!==s){let a=Z6e(r),l=je(o.renderState,!0);l.stencilTest.reference=a,o.renderState=Ve.fromCache(l),n&&(i.derivedCommand2D.renderState=l)}}function $6e(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function Z6e(e){return kt.CESIUM_3D_TILE_MASK|e<0&&(h=ir(n,t,a),t+=a,l>0&&(p=new Uint8Array(e,t,l),t+=l));let g=new sh(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!c(m))throw new ae("Feature table global property: POINTS_LENGTH must be defined");let y=g.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(y)&&(y=d.unpack(y));let b=y9e(g,h);if(b.rtcCenter=y,b.pointsLength=m,!b.hasPositions){let x=b9e(g);b.positions=x,b.hasPositions=b.hasPositions||c(x)}if(!b.hasPositions)throw new ae("Either POSITION or POSITION_QUANTIZED must be defined.");if(!b.hasNormals){let x=T9e(g);b.normals=x,b.hasNormals=b.hasNormals||c(x)}if(!b.hasColors){let x=x9e(g);b.colors=x,b.hasColors=b.hasColors||c(x),b.hasConstantColor=c(b.constantColor),b.isTranslucent=c(x)&&x.isTranslucent}if(!b.hasBatchIds){let x=A9e(g);b.batchIds=x,b.hasBatchIds=b.hasBatchIds||c(x)}if(b.hasBatchIds){let x=g.getGlobalProperty("BATCH_LENGTH");if(!c(x))throw new ae("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");b.batchLength=x}return c(p)&&(p=new Uint8Array(p),b.batchTableJson=h,b.batchTableBinary=p),b};function y9e(e,t){let n=e.json,i,o,r,s=c(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=c(t)&&c(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;c(a)&&(r=a.properties);let l,u,f,h,p;if(c(s)){o=s.properties;let m=s.byteOffset,y=s.byteLength;if(!c(o)||!c(m)||!c(y))throw new ae("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+y),l=c(o.POSITION),u=c(o.RGB)||c(o.RGBA),f=c(o.NORMAL),h=c(o.BATCH_ID),p=c(o.RGBA)}let g;return c(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:xt(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:l,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:h}}function b9e(e){let t=e.json,n;if(c(t.POSITION))return n=e.getPropertyArray("POSITION",$.FLOAT,3),{name:ht.POSITION,semantic:ht.POSITION,typedArray:n,isQuantized:!1,componentDatatype:$.FLOAT,type:nn.VEC3};if(c(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",$.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",$.FLOAT,3);if(!c(i))throw new ae("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",$.FLOAT,3);if(!c(r))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:ht.POSITION,semantic:ht.POSITION,typedArray:n,isQuantized:!0,componentDatatype:$.FLOAT,type:nn.VEC3,quantizedRange:o,quantizedVolumeOffset:d.unpack(r),quantizedVolumeScale:d.unpack(i),quantizedComponentDatatype:$.UNSIGNED_SHORT,quantizedType:nn.VEC3}}}function x9e(e){let t=e.json,n;if(c(t.RGBA))return n=e.getPropertyArray("RGBA",$.UNSIGNED_BYTE,4),{name:ht.COLOR,semantic:ht.COLOR,setIndex:0,typedArray:n,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(c(t.RGB))return n=e.getPropertyArray("RGB",$.UNSIGNED_BYTE,3),{name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(c(t.RGB565))return n=e.getPropertyArray("RGB565",$.UNSIGNED_SHORT,1),{name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n,componentDatatype:$.FLOAT,type:nn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(c(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",$.UNSIGNED_BYTE,4),o=i[3],r=G.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:ht.COLOR,semantic:ht.COLOR,setIndex:0,constantColor:r,componentDatatype:$.FLOAT,type:nn.VEC4,isQuantized:!1,isTranslucent:s}}}function T9e(e){let t=e.json,n;if(c(t.NORMAL))return n=e.getPropertyArray("NORMAL",$.FLOAT,3),{name:ht.NORMAL,semantic:ht.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:$.FLOAT,type:nn.VEC3};if(c(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",$.UNSIGNED_BYTE,2),{name:ht.NORMAL,semantic:ht.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:nn.VEC2,quantizedComponentDatatype:$.UNSIGNED_BYTE,componentDatatype:$.FLOAT,type:nn.VEC3}}function A9e(e){let t=e.json;if(c(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",$.UNSIGNED_SHORT,1);return{name:ht.FEATURE_ID,semantic:ht.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:$.fromTypedArray(n),type:nn.SCALAR}}}var Rx=Tle;var C9e=Tn.Components,E9e=Tn.Scene,S9e=Tn.Node,w9e=Tn.Primitive,v9e=Tn.Attribute,Ale=Tn.Quantization,D9e=Tn.FeatureIdAttribute,P9e=Tn.Material,I9e=Tn.MetallicRoughness;function By(e){e=e??W.EMPTY_OBJECT;let t=e.arrayBuffer,n=e.byteOffset??0;T.typeOf.object("options.arrayBuffer",t),this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=e.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=gt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=B.IDENTITY}c(Object.create)&&(By.prototype=Object.create($i.prototype),By.prototype.constructor=By);Object.defineProperties(By.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});By.prototype.load=function(){if(c(this._promise))return this._promise;this._parsedContent=Rx.parse(this._arrayBuffer,this._byteOffset),this._state=gt.PROCESSING,this._promise=Promise.resolve(this)};By.prototype.process=function(e){if(c(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===gt.READY)return!0;if(this._state===gt.PROCESSING){if(c(this._decodePromise))return!1;this._decodePromise=O9e(this,e.context)}return!1};function O9e(e,t){let i=e._parsedContent.draco,o;if(c(i)?o=n_.decodePointCloud(i,t):o=Promise.resolve(),!!c(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return c(r)&&R9e(e,i,r),G9e(e,t),e._state=gt.READY,e}).catch(function(r){e.unload(),e._state=gt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function R9e(e,t,n){e._state=gt.READY;let i=e._parsedContent,o;if(c(n.POSITION)){if(o={name:"POSITION",semantic:ht.POSITION,typedArray:n.POSITION.array,componentDatatype:$.FLOAT,type:nn.VEC3,isQuantized:!1},c(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,l=a.range,u=d.fromElements(l,l,l),f=d.unpack(a.minValues),h=(1<0&&j9e(e,a,h,t),c(n.rtcCenter)&&(f.transform=B.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;c(p)&&p.isQuantized&&(f.transform=B.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function j9e(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s=0&&(a=ye)}}}}if(a!==Number.MAX_VALUE){if(s=mn.getPoint(t,a,s),n.mode!==oe.SCENE3D){d.fromElements(s.y,s.z,s.x,s);let f=n.mapProjection,h=f.ellipsoid,p=f.unproject(s,Z9e);h.cartographicToCartesian(p,s)}return s}}function bW(e,t,n,i,o,r,s,a,l,u){let f=n+t*i;if(u.x=e[f],u.y=e[f+1],u.z=e[f+2],c(o))if(o.octEncoded){if(u=Ln.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=B.multiplyByPoint(r,u,u),s!==1&&Dr.getPosition(u,l,s,a,u),u}function co(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.loader",e.loader),T.typeOf.object("options.resource",e.resource),this._loader=e.loader,this._resource=e.resource,this.type=e.type??pr.GLTF,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this._modelMatrix=B.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=c(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 xR(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=G.clone(e.color),this._colorBlendMode=e.colorBlendMode??bc.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??G.RED;this._silhouetteColor=G.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??De.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??We.NONE,this._heightDirty=this._heightReference!==We.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;c(o)&&c(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new vm(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;c(s)&&s.owner===void 0?gs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=B.clone(B.IDENTITY);let a=e.clippingPolygons;c(a)&&a.owner===void 0?th.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=d.clone(e.lightColor),this._imageBasedLighting=c(e.imageBasedLighting)?e.imageBasedLighting:new ex,this._shouldDestroyImageBasedLighting=!c(e.imageBasedLighting),this._environmentMapManager=void 0;let l=new c_(e.environmentMapOptions);c_.setOwner(l,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??xn.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===pr.GLTF&&dt("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 Tt(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Vr.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??G.BLACK,this._classificationType=e.classificationType,this._statistics=new $M,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 pe,this._readyEvent=new pe,this._texturesReadyEvent=new pe,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function xW(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function J9e(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){if(!this._ready)throw new E("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");let e=c(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return vle(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===pr.GLTF&&dt("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}`),T.typeOf.string("value",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}`),T.typeOf.string("value",e),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(gs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(th.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}},lightColor:{get:function(){return this._lightColor},set:function(e){c(e)!==c(this._lightColor)&&this.resetDrawCommands(),this._lightColor=d.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){T.typeOf.object("imageBasedLighting",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){T.typeOf.object("environmentMapManager",e),e!==this.environmentMapManager&&(c_.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}}});co.prototype.getNode=function(e){if(!this._ready)throw new E("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return T.typeOf.string("name",e),this._nodesByName[e]};co.prototype.setArticulationStage=function(e,t){if(T.typeOf.number("value",t),!this._ready)throw new E("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.setArticulationStage(e,t)};co.prototype.applyArticulations=function(){if(!this._ready)throw new E("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.applyArticulations()};co.prototype.getExtension=function(e){if(T.typeOf.string("extensionName",e),!this._ready)throw new E("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return this._loader.components.extensions[e]};co.prototype.makeStyleDirty=function(){this._styleDirty=!0};co.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var tWe=new B,nWe=new J,iWe=new B;co.prototype.update=function(e){let t=!1;try{t=oWe(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")xW(this,n);else{let i=$t.getError("model",this._resource,n);xW(this,i)}}if(rWe(this,e),sWe(this,e),aWe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!c(n)){if(this._loader.isUnloaded())return;let r=$t.getError("model",this._resource,new ae("Failed to load model."));xW(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;c(i)&&i.propertyTableCount>0&&J9e(this,i);let o=new KM({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===oe.MORPHING)){if(cWe(this),lWe(this),uWe(this,e),fWe(this),dWe(this,e),hWe(this,e),mWe(this,e),pWe(this,e),_We(this,e),gWe(this,e),yWe(this,e),this._defaultTexture=e.context.defaultTexture,bWe(this,e),xWe(this,e),TWe(this),AWe(this,e),wWe(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)),EWe(this),vWe(this,e),DWe(this),PWe(this,e)}};function oWe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function rWe(e,t){c(e._customShader)&&e._customShader.update(t)}function sWe(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=!c(e._imageBasedLighting.sphericalHarmonicCoefficients)||!c(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function aWe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function cWe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;c(n)&&n.propertyTableCount>0&&(e.featureTableId=eWe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function lWe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function uWe(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r=i.height&&(i.height=n.height):gC(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,Nz);let o=e._clampedModelMatrix;B.clone(e.modelMatrix,o),o[12]=Nz.x,o[13]=Nz.y,o[14]=Nz.z,e._heightDirty=!0}}var OWe=new d;function RWe(e,t){let n=e.distanceDisplayCondition;if(!c(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===oe.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=B.getTranslation(e.modelMatrix,OWe);Gi.computeActualEllipsoidPosition(t,s,s),r=d.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function MWe(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r0&&e.alpha<1};co.prototype.isInvisible=function(){let e=this.color;return c(e)&&e.alpha===0};function Dle(e){return e.context.stencilBuffer}co.prototype.hasSilhouette=function(e){return Dle(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!c(this._classificationType)};co.prototype.hasSkipLevelOfDetail=function(e){if(!pr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};co.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return c(e)&&e.enabled&&e.length!==0};co.prototype.pick=function(e,t,n,i,o){return xE(this,e,t,n,i,o)};co.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return c(e)&&e.enabled&&e.length!==0};co.prototype.isDestroyed=function(){return!1};co.prototype.destroy=function(){let e=this._loader;c(e)&&e.destroy();let t=this._featureTables;if(c(t)){let r=t.length;for(let s=0;s0,i=c(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=c(i)&&c(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),wle(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function JM(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}}var lh=co;function Wr(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(Wr.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return c(t)&&c(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(c(t)&&c(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}}});Wr.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};Wr.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};Wr.prototype.getExtension=function(e){return this._model.getExtension(e)};Wr.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;if(!c(n))throw new E("No feature ID set is selected. Make sure Cesium3DTileset.featureIdLabel or Cesium3DTileset.instanceFeatureIdLabel is defined");let i=t.featureTables[n];if(!c(i))throw new E("No feature table found for the selected feature ID set");let o=i.featuresLength;if(!c(e)||e<0||e>=o)throw new E(`featureId is required and must be between 0 and featuresLength - 1 (${o-1}).`);return i.getFeature(e)};Wr.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return c(i)?n.featureTables[i].hasProperty(e,t):!1};Wr.prototype.applyDebugSettings=function(e,t){t=e?t:G.WHITE,this.featuresLength===0?this._model.color=t:c(this.batchTable)&&this.batchTable.setAllColor(t)};Wr.prototype.applyStyle=function(e){this._model.style=e};Wr.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,c(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),c(o)&&c(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;c(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),c(s)&&c(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Hl.REPEAT}),this._ready=!0)};Wr.prototype.isDestroyed=function(){return!1};Wr.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),de(this)};Wr.fromGltf=async function(e,t,n,i){let o=new Wr(e,t,n),s=eL(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let l=await lh.fromGltfAsync(s);return o._model=l,o};Wr.fromB3dm=async function(e,t,n,i,o){let r=new Wr(e,t,n),a=eL(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=l;let u=await lh.fromB3dm(a);return r._model=u,r};Wr.fromI3dm=async function(e,t,n,i,o){let r=new Wr(e,t,n),a=eL(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=await lh.fromI3dm(a);return r._model=l,r};Wr.fromPnts=async function(e,t,n,i,o){let r=new Wr(e,t,n),a=eL(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=await lh.fromPnts(a);return r._model=l,r};Wr.fromGeoJson=async function(e,t,n,i){let o=new Wr(e,t,n),s=eL(e,t,o,{geoJson:i,resource:n}),a=await lh.fromGeoJson(s);return o._model=a,o};Wr.prototype.pick=function(e,t,n){if(!c(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ie.WGS84,n)};function eL(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:De.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return xt(i,o)}var Ou=Wr;function Vf(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(Vf.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}}});Vf.fromJson=function(e,t,n,i){let o=new Vf(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};Vf.prototype.hasProperty=function(e,t){return!1};Vf.prototype.getFeature=function(e){};Vf.prototype.applyDebugSettings=function(e,t){};Vf.prototype.applyStyle=function(e){};Vf.prototype.update=function(e,t){};Vf.prototype.pick=function(e,t,n){};Vf.prototype.isDestroyed=function(){return!1};Vf.prototype.destroy=function(){return de(this)};var tL=Vf;var nL=`uniform sampler2D u_atlas; #ifdef VECTOR_TILE uniform vec4 u_highlightColor; #endif in vec2 v_textureCoordinates; in vec4 v_pickColor; in vec4 v_color; in float v_splitDirection; #ifdef SDF in vec4 v_outlineColor; in float v_outlineWidth; #endif #ifdef FRAGMENT_DEPTH_CHECK in vec4 v_textureCoordinateBounds; in vec4 v_originTextureCoordinateAndTranslate; in vec4 v_compressed; in mat2 v_rotationMatrix; const float SHIFT_LEFT12 = 4096.0; const float SHIFT_LEFT1 = 2.0; const float SHIFT_RIGHT12 = 1.0 / 4096.0; const float SHIFT_RIGHT1 = 1.0 / 2.0; float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize) { vec2 lookupVector = imageSize * (depthLookupST - adjustedST); lookupVector = v_rotationMatrix * lookupVector; vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); vec2 translation = v_originTextureCoordinateAndTranslate.zw; if (applyTranslate) { translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0)); } vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw; float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); if (logDepthOrDepth == 0.0) { return 0.0; } vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); return eyeCoordinate.z / eyeCoordinate.w; } #endif #ifdef SDF float getDistance(vec2 position) { return texture(u_atlas, position).r; } vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing) { float distance = getDistance(position); if (outlineWidth > 0.0) { float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); return vec4(sdfColor.rgb, sdfColor.a * alpha); } else { float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); return vec4(v_color.rgb, v_color.a * alpha); } } #endif void main() { if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; vec4 color = texture(u_atlas, v_textureCoordinates); #ifdef SDF float outlineWidth = v_outlineWidth; vec4 outlineColor = v_outlineColor; float distance = getDistance(v_textureCoordinates); #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) float smoothing = fwidth(distance); vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); 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); color = (center + color1 + color2 + color3 + color4)/5.0; #else 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 #if !defined(OPAQUE) && !defined(TRANSLUCENT) if (color.a < 0.005) { discard; } #else #ifdef OPAQUE if (color.a < 0.995) { discard; } #else if (color.a >= 0.995) { discard; } #endif #endif #ifdef VECTOR_TILE color *= u_highlightColor; #endif out_FragColor = color; #ifdef LOG_DEPTH czm_writeLogDepth(); #endif #ifdef FRAGMENT_DEPTH_CHECK float temp = v_compressed.y; temp = temp * SHIFT_RIGHT1; float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; bool enableDepthTest = temp2 != 0.0; bool applyTranslate = floor(temp) != 0.0; if (enableDepthTest) { temp = v_compressed.z; temp = temp * SHIFT_RIGHT12; vec2 dimensions; dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; dimensions.x = floor(temp); temp = v_compressed.w; temp = temp * SHIFT_RIGHT12; vec2 imageSize; imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12; imageSize.x = floor(temp); vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy; adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y); float epsilonEyeDepth = v_compressed.x + czm_epsilon1; float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize); if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth) { float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth) { float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth) { discard; } } } } #endif } `;var iL=`#ifdef INSTANCED in vec2 direction; #endif in vec4 positionHighAndScale; in vec4 positionLowAndRotation; in vec4 compressedAttribute0; in vec4 compressedAttribute1; in vec4 compressedAttribute2; in vec4 eyeOffset; in vec4 scaleByDistance; in vec4 pixelOffsetScaleByDistance; in vec4 compressedAttribute3; in vec2 sdf; in float splitDirection; #if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) in vec4 textureCoordinateBoundsOrLabelTranslate; #endif #ifdef VECTOR_TILE in float a_batchId; #endif out vec2 v_textureCoordinates; #ifdef FRAGMENT_DEPTH_CHECK out vec4 v_textureCoordinateBounds; out vec4 v_originTextureCoordinateAndTranslate; out vec4 v_compressed; out mat2 v_rotationMatrix; #endif out vec4 v_pickColor; out vec4 v_color; out float v_splitDirection; #ifdef SDF out vec4 v_outlineColor; out float v_outlineWidth; #endif const float UPPER_BOUND = 32768.0; const float SHIFT_LEFT16 = 65536.0; const float SHIFT_LEFT12 = 4096.0; const float SHIFT_LEFT8 = 256.0; const float SHIFT_LEFT7 = 128.0; const float SHIFT_LEFT5 = 32.0; const float SHIFT_LEFT3 = 8.0; const float SHIFT_LEFT2 = 4.0; const float SHIFT_LEFT1 = 2.0; const float SHIFT_RIGHT12 = 1.0 / 4096.0; const float SHIFT_RIGHT8 = 1.0 / 256.0; const float SHIFT_RIGHT7 = 1.0 / 128.0; const float SHIFT_RIGHT5 = 1.0 / 32.0; const float SHIFT_RIGHT3 = 1.0 / 8.0; const float SHIFT_RIGHT2 = 1.0 / 4.0; const float SHIFT_RIGHT1 = 1.0 / 2.0; vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) { vec2 halfSize = imageSize * scale * 0.5; halfSize *= ((direction * 2.0) - 1.0); vec2 originTranslate = origin * abs(halfSize); #if defined(ROTATION) || defined(ALIGNED_AXIS) if (validAlignedAxis || rotation != 0.0) { float angle = rotation; if (validAlignedAxis) { vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); } float cosTheta = cos(angle); float sinTheta = sin(angle); rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); halfSize = rotationMatrix * halfSize; } else { rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); } #endif mpp = czm_metersPerPixel(positionEC); positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); positionEC.xy += (translate + pixelOffset) * mpp; return positionEC; } #ifdef VERTEX_DEPTH_CHECK float getGlobeDepth(vec4 positionEC) { vec4 posWC = czm_eyeToWindowCoordinates(positionEC); float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw)); if (globeDepth == 0.0) { return 0.0; } vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth); return eyeCoordinate.z / eyeCoordinate.w; } #endif void main() { vec3 positionHigh = positionHighAndScale.xyz; vec3 positionLow = positionLowAndRotation.xyz; float scale = positionHighAndScale.w; #if defined(ROTATION) || defined(ALIGNED_AXIS) float rotation = positionLowAndRotation.w; #else float rotation = 0.0; #endif float compressed = compressedAttribute0.x; vec2 pixelOffset; pixelOffset.x = floor(compressed * SHIFT_RIGHT7); compressed -= pixelOffset.x * SHIFT_LEFT7; pixelOffset.x -= UPPER_BOUND; vec2 origin; origin.x = floor(compressed * SHIFT_RIGHT5); compressed -= origin.x * SHIFT_LEFT5; origin.y = floor(compressed * SHIFT_RIGHT3); compressed -= origin.y * SHIFT_LEFT3; #ifdef FRAGMENT_DEPTH_CHECK vec2 depthOrigin = origin.xy; #endif origin -= vec2(1.0); float show = floor(compressed * SHIFT_RIGHT2); compressed -= show * SHIFT_LEFT2; #ifdef INSTANCED vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w); vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w); vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange; #else vec2 direction; direction.x = floor(compressed * SHIFT_RIGHT1); direction.y = compressed - direction.x * SHIFT_LEFT1; vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w); #endif float temp = compressedAttribute0.y * SHIFT_RIGHT8; pixelOffset.y = -(floor(temp) - UPPER_BOUND); vec2 translate; translate.y = (temp - floor(temp)) * SHIFT_LEFT16; temp = compressedAttribute0.z * SHIFT_RIGHT8; translate.x = floor(temp) - UPPER_BOUND; translate.y += (temp - floor(temp)) * SHIFT_LEFT8; translate.y -= UPPER_BOUND; temp = compressedAttribute1.x * SHIFT_RIGHT8; float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2); vec2 imageSize = vec2(floor(temp), temp2); #ifdef FRAGMENT_DEPTH_CHECK float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2)); float applyTranslate = 0.0; if (labelHorizontalOrigin != 0.0) { applyTranslate = 1.0; labelHorizontalOrigin -= 2.0; depthOrigin.x = labelHorizontalOrigin + 1.0; } depthOrigin = vec2(1.0) - (depthOrigin * 0.5); #endif #ifdef EYE_DISTANCE_TRANSLUCENCY vec4 translucencyByDistance; translucencyByDistance.x = compressedAttribute1.z; translucencyByDistance.z = compressedAttribute1.w; translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; temp = compressedAttribute1.y * SHIFT_RIGHT8; translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; #endif #if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) temp = compressedAttribute3.w; temp = temp * SHIFT_RIGHT12; vec2 dimensions; dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; dimensions.x = floor(temp); #endif #ifdef ALIGNED_AXIS vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8)); temp = compressedAttribute2.z * SHIFT_RIGHT5; bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; #else vec3 alignedAxis = vec3(0.0); bool validAlignedAxis = false; #endif vec4 pickColor; vec4 color; temp = compressedAttribute2.y; temp = temp * SHIFT_RIGHT8; pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; pickColor.r = floor(temp); temp = compressedAttribute2.x; temp = temp * SHIFT_RIGHT8; color.b = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; color.g = (temp - floor(temp)) * SHIFT_LEFT8; color.r = floor(temp); temp = compressedAttribute2.z * SHIFT_RIGHT8; bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0; temp = floor(temp) * SHIFT_RIGHT8; pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; pickColor /= 255.0; color.a = floor(temp); color /= 255.0; vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); vec4 positionEC = czm_modelViewRelativeToEye * p; #if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK) float eyeDepth = positionEC.z; #endif positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); positionEC.xyz *= show; #if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) float lengthSq; if (czm_sceneMode == czm_sceneMode2D) { 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; if (scale == 0.0) { positionEC.xyz = vec3(0.0); } #endif float translucency = 1.0; #ifdef EYE_DISTANCE_TRANSLUCENCY translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); if (translucency == 0.0) { positionEC.xyz = vec3(0.0); } #endif #ifdef EYE_DISTANCE_PIXEL_OFFSET float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); pixelOffset *= pixelOffsetScale; #endif #ifdef DISTANCE_DISPLAY_CONDITION float nearSq = compressedAttribute3.x; float farSq = compressedAttribute3.y; if (lengthSq < nearSq || lengthSq > farSq) { positionEC.xyz = vec3(0.0); } #endif mat2 rotationMatrix; float mpp; #ifdef DISABLE_DEPTH_DISTANCE float disableDepthTestDistance = compressedAttribute3.z; #endif #ifdef VERTEX_DEPTH_CHECK if (lengthSq < disableDepthTestDistance) { float depthsilon = 10.0; vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy; vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); float globeDepth1 = getGlobeDepth(pEC1); if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1) { vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); float globeDepth2 = getGlobeDepth(pEC2); if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2) { vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); float globeDepth3 = getGlobeDepth(pEC3); if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3) { positionEC.xyz = vec3(0.0); } } } } #endif positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); gl_Position = czm_projection * positionEC; v_textureCoordinates = textureCoordinates; #ifdef LOG_DEPTH czm_vertexLogDepth(); #endif #ifdef DISABLE_DEPTH_DISTANCE if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) { disableDepthTestDistance = czm_minimumDisableDepthTestDistance; } if (disableDepthTestDistance != 0.0) { 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))) { gl_Position.z = -gl_Position.w; #ifdef LOG_DEPTH v_depthFromNearPlusOne = 1.0; #endif } } #endif #ifdef FRAGMENT_DEPTH_CHECK if (sizeInMeters) { translate /= mpp; dimensions /= mpp; imageSize /= mpp; } #if defined(ROTATION) || defined(ALIGNED_AXIS) v_rotationMatrix = rotationMatrix; #else v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); #endif float enableDepthCheck = 0.0; if (lengthSq < disableDepthTestDistance) { enableDepthCheck = 1.0; } float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12)); float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12)); float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12)); float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12)); v_compressed.x = eyeDepth; v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck; v_compressed.z = dw * SHIFT_LEFT12 + dh; v_compressed.w = iw * SHIFT_LEFT12 + ih; v_originTextureCoordinateAndTranslate.xy = depthOrigin; v_originTextureCoordinateAndTranslate.zw = translate; v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate; #endif #ifdef SDF vec4 outlineColor; float outlineWidth; temp = sdf.x; temp = temp * SHIFT_RIGHT8; outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; outlineColor.r = floor(temp); temp = sdf.y; temp = temp * SHIFT_RIGHT8; float temp3 = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8; outlineColor.a = floor(temp); outlineColor /= 255.0; v_outlineWidth = outlineWidth / 255.0; v_outlineColor = outlineColor; v_outlineColor.a *= translucency; #endif v_pickColor = pickColor; v_color = color; v_color.a *= translucency; v_splitDirection = splitDirection; } `;var NWe=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),ss=NWe;function x_(e){T.defined("billboardCollection",e),this._billboardCollection=e,this._id=void 0,this._loadState=ss.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(x_.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===ss.LOADED}},hasImage:{get:function(){return this._loadState!==ss.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});x_.prototype.unload=async function(){this._loadState!==ss.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=ss.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};x_.prototype.loadImage=async function(e,t){if(this._id===e)return;let n=this._billboardCollection,i=n.billboardTextureCache,o=i.get(e);if(c(o)&&t.loadState===ss.LOADING||t.loadState===ss.LOADED){x_.clone(o,this);return}c(o)||(o=new x_(n),i.set(e,o)),o._id=this._id=e,o._loadState=this._loadState=ss.LOADING,o._loadError=this._loadError=void 0;let r,s=this._billboardCollection.textureAtlas;try{r=await s.addImage(e,t)}catch(l){if(o._loadState=ss.ERROR,o._loadError=l,this._id!==e)return;this._loadState=ss.ERROR,this._loadError=l;return}if(!c(r)||r===-1){if(o._loadState=ss.FAILED,o._index=-1,this._id!==e)return;this._loadState=ss.FAILED,this._index=-1;return}o._index=r,o._loadState=ss.LOADED;let a=s.rectangles[r];o._width=a.width,o._height=a.height,this._id===e&&(this._index=r,this._loadState=ss.LOADED,this._width=a.width,this._height=a.height,this.dirty=!0)};x_.prototype.addImageSubRegion=async function(e,t){this._id=e,this._loadState=ss.LOADING,this._loadError=void 0,this._hasSubregion=!0;let n,i=this._billboardCollection.textureAtlas;try{n=await i.addImageSubRegion(e,t)}catch(o){this._loadState=ss.ERROR,this._loadError=o;return}if(!c(n)||n===-1){this._loadState=ss.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=n,this._loadState=ss.LOADED,this.dirty=!0};x_.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};x_.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 T_=x_;function mi(e,t){if(e=e??W.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new E("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new E("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Bt.clone(n)}if(c(i)){if(i.far<=i.near)throw new E("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Bt.clone(i)}if(c(o)){if(o.far<=o.near)throw new E("scaleByDistance.far must be greater than scaleByDistance.near.");o=Bt.clone(o)}if(c(r)){if(r.far<=r.near)throw new E("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");r=Mt.clone(r)}this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._pixelOffset=H.clone(e.pixelOffset??H.ZERO),this._translate=new H(0,0),this._eyeOffset=d.clone(e.eyeOffset??d.ZERO),this._heightReference=e.heightReference??We.NONE,this._verticalOrigin=e.verticalOrigin??Fn.CENTER,this._horizontalOrigin=e.horizontalOrigin??bi.CENTER,this._scale=e.scale??1,this._color=G.clone(e.color??G.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 T_(t),this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;c(s)&&(c(a)||(typeof s=="string"?a=s:c(s.src)?a=s.src:a=jn()),this._imageTexture.loadImage(a,s)),c(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(a,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=oe.SCENE3D,this._clusterShow=!0,this._outlineColor=G.clone(e.outlineColor??G.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Vr.NONE}var Ple=mi.SHOW_INDEX=0,Bz=mi.POSITION_INDEX=1,Lle=mi.PIXEL_OFFSET_INDEX=2,FWe=mi.EYE_OFFSET_INDEX=3,BWe=mi.HORIZONTAL_ORIGIN_INDEX=4,kWe=mi.VERTICAL_ORIGIN_INDEX=5,UWe=mi.SCALE_INDEX=6,Ile=mi.IMAGE_INDEX_INDEX=7,Ole=mi.COLOR_INDEX=8,VWe=mi.ROTATION_INDEX=9,zWe=mi.ALIGNED_AXIS_INDEX=10,HWe=mi.SCALE_BY_DISTANCE_INDEX=11,GWe=mi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,jWe=mi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,WWe=mi.DISTANCE_DISPLAY_CONDITION=14,qWe=mi.DISABLE_DEPTH_DISTANCE=15;mi.TEXTURE_COORDINATE_BOUNDS=16;var Rle=mi.SDF_INDEX=17,YWe=mi.SPLIT_DIRECTION_INDEX=18;mi.NUMBER_OF_PROPERTIES=19;function sr(e,t){let n=e._billboardCollection;c(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(mi.prototype,{show:{get:function(){return this._show},set:function(e){T.typeOf.bool("value",e),this._show!==e&&(this._show=e,sr(this,Ple))}},position:{get:function(){return this._position},set:function(e){T.typeOf.object("value",e);let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),this._updateClamping(),sr(this,Bz))}},heightReference:{get:function(){return this._heightReference},set:function(e){T.typeOf.number("value",e);let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),sr(this,Bz))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){T.typeOf.object("value",e);let t=this._pixelOffset;H.equals(t,e)||(H.clone(e,t),sr(this,Lle))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new E("far distance must be greater than near distance.");let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),sr(this,HWe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new E("far distance must be greater than near distance.");let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),sr(this,GWe))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new E("far distance must be greater than near distance.");let t=this._pixelOffsetScaleByDistance;Bt.equals(t,e)||(this._pixelOffsetScaleByDistance=Bt.clone(e,t),sr(this,jWe))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){T.typeOf.object("value",e);let t=this._eyeOffset;d.equals(t,e)||(d.clone(e,t),sr(this,FWe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){T.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,sr(this,BWe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){T.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,sr(this,kWe))}},scale:{get:function(){return this._scale},set:function(e){T.typeOf.number("value",e),this._scale!==e&&(this._scale=e,sr(this,UWe))}},color:{get:function(){return this._color},set:function(e){T.typeOf.object("value",e);let t=this._color;G.equals(t,e)||(G.clone(e,t),sr(this,Ole))}},rotation:{get:function(){return this._rotation},set:function(e){T.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,sr(this,VWe))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){T.typeOf.object("value",e);let t=this._alignedAxis;d.equals(t,e)||(d.clone(e,t),sr(this,zWe))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){c(e)&&T.typeOf.number("width",e),this._width!==e&&(this._width=e,sr(this,Ile))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){c(e)&&T.typeOf.number("height",e),this._height!==e&&(this._height=e,sr(this,Ile))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){T.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,sr(this,Ole))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Mt.equals(e,this._distanceDisplayCondition)){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new E("far distance must be greater than near distance.");this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),sr(this,WWe)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(c(e)&&(T.typeOf.number("value",e),e<0))throw new E("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,sr(this,qWe))}},id:{get:function(){return this._id},set:function(e){this._id=e,c(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,c(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!c(e)){this._imageTexture.unload();return}let t;typeof e=="string"?t=e:e instanceof we?t=e._url:c(e.src)?t=e.src:t=jn(),this._imageTexture.loadImage(t,e)}},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),sr(this,Bz)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,sr(this,Ple))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new E("value is required.");let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),sr(this,Rle))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,sr(this,Rle))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,sr(this,YWe))}}});mi.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};mi.prototype._updateClamping=function(){mi._updateClamping(this._billboardCollection,this)};var oL=new he;mi._updateClamping=function(e,t){if(!c(e)||!c(e._scene)){if(t._heightReference!==We.NONE)throw new E("Height reference is not supported without a scene.");return}let n=e._scene,i=n.ellipsoid??ie.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===We.NONE||r)&&c(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===We.NONE||!c(t._position))return;c(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!c(s)){t._actualClampedPosition=void 0;return}function a(u){let f=i.cartographicToCartesian(u,t._clampedPosition);if(gC(t._heightReference))t._mode===oe.SCENE3D?(u.height+=s.height,i.cartographicToCartesian(u,f)):f.x+=s.height;else if(t._heightReference===We.CLIP_TO_GROUND)if(t._mode===oe.SCENE3D){let h=i.cartesianToCartographic(u,oL);s.height>=h.height&&(h.height=s.height),i.cartographicToCartesian(h,u)}else s.height>=u.x&&(u.x=s.height);t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),he.clone(s,oL);let l=n.getHeight(s,t._heightReference);c(l)&&(oL.height=l),a(oL)};mi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};mi.prototype.setImage=function(e,t){T.typeOf.string("id",e),T.defined("image",t),this._imageTexture.loadImage(e,t)};mi.prototype.setImageTexture=function(e){T.defined("billboardTexture",e),T_.clone(e,this._imageTexture)};mi.prototype.setImageSubRegion=function(e,t){T.typeOf.string("id",e),T.defined("subRegion",t),this._imageTexture.addImageSubRegion(e,t)};mi.prototype._setTranslate=function(e){if(!c(e))throw new E("value is required.");let t=this._translate;H.equals(t,e)||(H.clone(e,t),sr(this,Lle))};mi.prototype._getActualPosition=function(){return c(this._clampedPosition)?this._clampedPosition:this._actualPosition};mi.prototype._setActualPosition=function(e){c(this._clampedPosition)||d.clone(e,this._actualPosition),sr(this,Bz)};var Mle=new se;mi._computeActualPosition=function(e,t,n,i){return c(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(B.multiplyByPoint(i,t,Mle),Gi.computeActualEllipsoidPosition(n,Mle))};var Nle=new d;mi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=B.multiplyByPoint(e,t,Nle),a=Gi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(c(a))return H.add(a,i,a),a};var Fz=new H(0,0);mi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;if(c(t)||(t=new H),!c(n))throw new E("Billboard must be in a collection. Was it removed?");if(!c(e))throw new E("scene is required.");H.clone(this._pixelOffset,Fz),H.add(Fz,this._translate,Fz);let i=n.modelMatrix,o=this._position;if(c(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==oe.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,l=s.unproject(o,oL);o=a.cartographicToCartesian(l,Nle),i=B.IDENTITY}return mi._computeScreenSpacePosition(i,o,this._eyeOffset,Fz,e,t)};mi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===bi.RIGHT?s-=i:e.horizontalOrigin===bi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Fn.BOTTOM||e.verticalOrigin===Fn.BASELINE?a-=o:e.verticalOrigin===Fn.CENTER&&(a-=o*.5),c(n)||(n=new Ke),n.x=s,n.y=a,n.width=i,n.height=o,n};mi.prototype.equals=function(e){return this===e||c(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&&G.equals(this._color,e._color)&&H.equals(this._pixelOffset,e._pixelOffset)&&H.equals(this._translate,e._translate)&&d.equals(this._eyeOffset,e._eyeOffset)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};mi.prototype._destroy=function(){c(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),c(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var lo=mi;var XWe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},wo=Object.freeze(XWe);var KWe={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Ks=Object.freeze(KWe);var $We=lo.SHOW_INDEX,rL=lo.POSITION_INDEX,Fle=lo.PIXEL_OFFSET_INDEX,Ble=lo.EYE_OFFSET_INDEX,ZWe=lo.HORIZONTAL_ORIGIN_INDEX,QWe=lo.VERTICAL_ORIGIN_INDEX,JWe=lo.SCALE_INDEX,Mx=lo.IMAGE_INDEX_INDEX,kle=lo.COLOR_INDEX,eqe=lo.ROTATION_INDEX,tqe=lo.ALIGNED_AXIS_INDEX,Ule=lo.SCALE_BY_DISTANCE_INDEX,Vle=lo.TRANSLUCENCY_BY_DISTANCE_INDEX,zle=lo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Hle=lo.DISTANCE_DISPLAY_CONDITION,nqe=lo.DISABLE_DEPTH_DISTANCE,iqe=lo.TEXTURE_COORDINATE_BOUNDS,Gle=lo.SDF_INDEX,jle=lo.SPLIT_DIRECTION_INDEX,IW=lo.NUMBER_OF_PROPERTIES,uo,oqe={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11,splitDirection:12},rqe={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 Hf(e){e=e??W.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;c(t)||(t=new vb),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(IW),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=B.clone(e.modelMatrix??B.IDENTITY),this._modelMatrix=B.clone(B.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??wo.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._buffersUsage=[Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW],this._highlightColor=G.clone(G.WHITE),this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor};let n=this._scene;c(n)&&c(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r0)&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let h,p;c(i._labelDimensions)?(p=i._labelDimensions.x,h=i._labelDimensions.y):(p=i.width??0,h=i.height??0);let g=Math.floor(O.clamp(p,0,wW)),m=Math.floor(O.clamp(h,0,wW)),y=g*wW+m;e._instanced?(o=i._index,r(o,s,a,u,y)):(o=i._index*4,r(o+0,s,a,u,y),r(o+1,s,a,u,y),r(o+2,s,a,u,y),r(o+3,s,a,u,y))}function iue(e,t,n,i){if(Df(i.heightReference)){let p=e._scene,g=t.context,m=t.globeTranslucencyState.translucent,y=c(p.globe)&&p.globe.depthTestAgainstTerrain;e._shaderClampToGround=g.depthTexture&&!m&&y}let o,r=n[uo.textureCoordinateBoundsOrLabelTranslate];if(ut.maximumVertexTextureImageUnits>0){let p=0,g=0;c(i._labelTranslate)&&(p=i._labelTranslate.x,g=i._labelTranslate.y),e._instanced?(o=i._index,r(o,p,g,0,0)):(o=i._index*4,r(o+0,p,g,0,0),r(o+1,p,g,0,0),r(o+2,p,g,0,0),r(o+3,p,g,0,0));return}let s=0,a=0,l=0,u=0;if(i.ready){let p=i.computeTextureCoordinates(RW);s=p.x,a=p.y,l=p.width,u=p.height}let f=s+l,h=a+u;e._instanced?(o=i._index,r(o,s,a,f,h)):(o=i._index*4,r(o+0,s,a,f,h),r(o+1,s,a,f,h),r(o+2,s,a,f,h),r(o+3,s,a,f,h))}function mqe(e,t,n,i){if(!c(e._batchTable))return;let o=n[uo.a_batchId],r=i._batchIndex,s;e._instanced?(s=i._index,o(s,r)):(s=i._index*4,o(s+0,r),o(s+1,r),o(s+2,r),o(s+3,r))}function oue(e,t,n,i){if(!e._sdf)return;let o,r=n[uo.sdf],s=i.outlineColor,a=i.outlineWidth,l=G.floatToByte(s.red),u=G.floatToByte(s.green),f=G.floatToByte(s.blue),h=l*TE+u*Pm+f,p=a/Ks.RADIUS,g=G.floatToByte(s.alpha)*TE+G.floatToByte(p)*Pm;e._instanced?(o=i._index,r(o,h,g)):(o=i._index*4,r(o+0,h+Xle,g),r(o+1,h+Kle,g),r(o+2,h+$le,g),r(o+3,h+Zle,g))}function rue(e,t,n,i){let o=n[uo.splitDirection],r=0,s=i.splitDirection;c(s)&&(r=s);let a;e._instanced?(a=i._index,o(a,r)):(a=i._index*4,o(a+0,r),o(a+1,r),o(a+2,r),o(a+3,r))}function pqe(e,t,n,i){qle(e,t,n,i),Qle(e,t,n,i),Jle(e,t,n,i),DW(e,t,n,i),PW(e,t,n,i),eue(e,t,n,i),tue(e,t,n,i),nue(e,t,n,i),iue(e,t,n,i),mqe(e,t,n,i),oue(e,t,n,i),rue(e,t,n,i)}function vW(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let l=0;l{if(!this.isDestroyed())return r.update(e.context)}),!c(r.texture))return;_qe(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,l=this._propertiesChanged,u=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let h,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let R=0;R0){this._vaf=lqe(t,i,this._buffersUsage,this._instanced,this._batchTable,this._sdf),h=this._vaf.writers;for(let R=0;R0){let R=bqe;R.length=0,(l[rL]||l[eqe]||l[JWe])&&R.push(qle),(l[Mx]||l[Fle]||l[ZWe]||l[QWe]||l[$We])&&(R.push(Qle),this._instanced&&R.push(PW)),(l[Mx]||l[tqe]||l[Vle])&&(R.push(Jle),R.push(DW)),(l[Mx]||l[kle])&&R.push(DW),(l[Mx]||l[Ble])&&R.push(PW),l[Ule]&&R.push(eue),l[zle]&&R.push(tue),(l[Hle]||l[nqe]||l[Mx]||l[rL])&&R.push(nue),(l[Mx]||l[rL])&&R.push(iue),l[Gle]&&R.push(oue),l[jle]&&R.push(rue);let L=R.length;if(h=this._vaf.writers,a/i>.1){for(let F=0;Fi*1.5&&(s.length=i),!c(this._vaf)||!c(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=B.IDENTITY;e.mode===oe.SCENE3D?(y=this.modelMatrix,m=le.clone(this._baseVolumeWC,this._boundingVolume)):m=le.clone(this._baseVolume2D,this._boundingVolume),gqe(this,e,m);let b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===wo.OPAQUE||this._blendOption===wo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!0}):this._rsOpaque=void 0;let R=this._blendOption===wo.TRANSLUCENT;this._blendOption===wo.TRANSLUCENT||this._blendOption===wo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:R?ne.LEQUAL:ne.LESS},depthMask:R,blending:ln.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let x,A,C,S,v,P=ut.maximumVertexTextureImageUnits>0;if(b||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){x=iL,A=nL,v=[],c(this._batchTable)&&(v.push("VECTOR_TILE"),x=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(x),A=this._batchTable.getFragmentShaderCallback(!1,void 0)(A)),C=new He({defines:v,sources:[x]}),this._instanced&&C.defines.push("INSTANCED"),this._shaderRotation&&C.defines.push("ROTATION"),this._shaderAlignedAxis&&C.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&C.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&C.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&C.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&C.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&C.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(P?C.defines.push("VERTEX_DEPTH_CHECK"):C.defines.push("FRAGMENT_DEPTH_CHECK"));let R=1-Ks.CUTOFF;this._sdf&&C.defines.push("SDF");let L=c(this._batchTable)?"VECTOR_TILE":"";this._blendOption===wo.OPAQUE_AND_TRANSLUCENT&&(S=new He({defines:["OPAQUE",L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=Jt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:C,fragmentShaderSource:S,attributeLocations:uo}),S=new He({defines:["TRANSLUCENT",L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=Jt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:C,fragmentShaderSource:S,attributeLocations:uo})),this._blendOption===wo.OPAQUE&&(S=new He({defines:[L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=Jt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:C,fragmentShaderSource:S,attributeLocations:uo})),this._blendOption===wo.TRANSLUCENT&&(S=new He({defines:[L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=Jt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:C,fragmentShaderSource:S,attributeLocations:uo})),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 M=e.commandList;if(p.render||p.pick){let R=this._colorCommands,L=this._blendOption===wo.OPAQUE,F=this._blendOption===wo.OPAQUE_AND_TRANSLUCENT,_=this._vaf.va,w=_.length,D=this._uniforms,I;c(this._batchTable)?(D=this._batchTable.getUniformMapCallback()(D),I=this._batchTable.getPickId()):I="v_pickColor",R.length=w;let N=F?w*2:w;for(let k=0;k0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){c(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=this._heightOffset??0,n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,Tqe);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=G.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&AE(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});ya.defaultColor=G.WHITE;ya.defaultPointOutlineColor=G.BLACK;ya.defaultPointOutlineWidth=0;ya.defaultPointSize=8;function AE(e){let t=e._billboard;if(c(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(c(e._billboardImage))return;let n=e._color??ya.defaultColor,i=e._pointOutlineColor??ya.defaultPointOutlineColor,o=e._pointOutlineWidth??ya.defaultPointOutlineWidth,r=e._pointSize??ya.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,l=e._billboardOutlineWidth,u=e._billboardSize;if(G.equals(n,s)&&G.equals(i,a)&&o===l&&r===u)return;e._billboardColor=G.clone(n,e._billboardColor),e._billboardOutlineColor=G.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,h=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([h,r,p,o]);t.setImage(g,Lx(f,h,p,o,r))}ya.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ya.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ya.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ya.prototype.getPropertyInherited=function(e){return Ws.getPropertyInherited(this._content,this._batchId,e)};ya.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ya.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ya.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ya.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var A_=ya;function Aqe(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),l=document.createElement("canvas"),u=100,f=r.width+u|0,h=3*a,p=h/2;l.width=f,l.height=h;let g=l.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,l.width+1,l.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,u/2,p)),o&&(g.fillStyle="black",g.fillText(t,u/2,p));let m=g.getImageData(0,0,f,h).data,y=m.length,b=f*4,x,A,C,S;for(x=0;x=0;--x)if(m[x]!==255){S=x/b|0;break}let v=-1;for(x=0;x]/,o=[],r="",s=ys.LTR,a="",l=e.length;for(let u=0;u";case">":return"<"}}var Rqe="\u05D0-\u05EA",Mqe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",due=new RegExp(`[${Rqe}${Mqe}]`);function Lqe(e){let t=e.split(` `),n="";for(let i=0;iu+1?s[u+1].Type===ys.RTL?(l=h+l,a=0):(l=lL(l,a,f.Word),a+=f.Word.length):l=lL(l,0,h)):f.Type===ys.RTL?l=lL(l,a,h):f.Type===ys.LTR?(l+=f.Word,a=l.length):(f.Type===ys.WEAK||f.Type===ys.BRACKETS)&&(u>0&&s[u-1].Type===ys.RTL?s.length>u+1?s[u+1].Type===ys.RTL?l=lL(l,a,h):(l+=f.Word,a=l.length):l+=f.Word:(l+=f.Word,a=l.length))}n+=l,i0,l=t._backgroundBillboard,u=e._backgroundBillboardCollection;a?(c(l)||(l=Uqe(u,e),t._backgroundBillboard=l),l.color=t._backgroundColor,l.show=t._show,l.position=t._position,l.eyeOffset=t._eyeOffset,l.pixelOffset=t._pixelOffset,l.horizontalOrigin=bi.LEFT,l.verticalOrigin=t._verticalOrigin,l.heightReference=t._heightReference,l.scale=t.totalScale,l.pickPrimitive=t,l.id=t._id,l.translucencyByDistance=t._translucencyByDistance,l.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,l.scaleByDistance=t._scaleByDistance,l.distanceDisplayCondition=t._distanceDisplayCondition,l.disableDepthTestDistance=t._disableDepthTestDistance,l.clusterShow=t.clusterShow):c(l)&&(u.remove(l),t._backgroundBillboard=l=void 0);let f=e._glyphBillboardCollection,h=f.billboardTextureCache,p=e._textDimensionsCache;for(let g=0;g0&&M.height>0&&!Hqe.test(m)){let R=(0,gue.default)(M,{cutoff:Ks.CUTOFF,radius:Ks.RADIUS}),L=M.getContext("2d"),F=M.width,_=M.height,w=L.getImageData(0,0,F,_);for(let D=0;D0?S=v.pop():(S=f.add({collection:e}),S._labelDimensions=new H,S._labelTranslate=new H),C.billboard=S),S.setImageTexture(A),S.show=t._show,S.position=t._position,S.eyeOffset=t._eyeOffset,S.pixelOffset=t._pixelOffset,S.horizontalOrigin=bi.LEFT,S.verticalOrigin=t._verticalOrigin,S.heightReference=t._heightReference,S.scale=t.totalScale,S.pickPrimitive=t,S.id=t._id,S.translucencyByDistance=t._translucencyByDistance,S.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,S.scaleByDistance=t._scaleByDistance,S.distanceDisplayCondition=t._distanceDisplayCondition,S.disableDepthTestDistance=t._disableDepthTestDistance,S._batchIndex=t._batchIndex,S.outlineColor=t.outlineColor,t.style===Yo.FILL_AND_OUTLINE?(S.color=t._fillColor,S.outlineWidth=t.outlineWidth):t.style===Yo.FILL?(S.color=t._fillColor,S.outlineWidth=0):t.style===Yo.OUTLINE&&(S.color=G.TRANSPARENT,S.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function _ue(e,t,n){return t===bi.CENTER?-e/2:t===bi.RIGHT?-(e+n.x):n.x}var _r=new H,jqe=new H;function Wqe(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,l=1,u=t.length,f=e._backgroundBillboard,h=H.clone(c(f)?e._backgroundPadding:H.ZERO,jqe);h.x/=e._relativeSize,h.y/=e._relativeSize;for(let L=0;L0&&(m===bi.CENTER?A=-o/2-h.x:m===bi.RIGHT?A=-(o+h.x*2):A=0,_r.x=A*g,y===Fn.TOP?_r.y=p-a-s:y===Fn.CENTER?_r.y=(p-a)/2-s:y===Fn.BASELINE?_r.y=-h.y-s:_r.y=0,_r.y=_r.y*g,f.width=v,f.height=P,f._setTranslate(_r),f._labelTranslate=H.clone(_r,f._labelTranslate)),Df(e.heightReference))for(let L=0;L0?wo.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)};Im.prototype.isDestroyed=function(){return!1};Im.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),de(this)};var Om=Im;var uL=`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 rl={};rl.numberOfPoints=function(e,t,n){let i=d.distance(e,t);return Math.ceil(i/n)};rl.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 qqe=new he;rl.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o0){t=t??B.IDENTITY;let o=B.inverseTransformation(t,Yqe),r=B.multiplyByPoint(o,d.ZERO,Xqe),s=d.normalize(B.multiplyByPointAsVector(o,d.UNIT_Y,xue),xue),a=sn.fromPointNormal(r,s,Kqe),l=d.normalize(B.multiplyByPointAsVector(o,d.UNIT_X,Tue),Tue),u=sn.fromPointNormal(r,l,$qe),f=1;n.push(d.clone(e[0]));let h=n[0],p=e.length;for(let g=1;g2&&(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;c(t)&&(i=B.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Fi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Sue),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 Eue=Mu.POSITION_INDEX=0,i7e=Mu.SHOW_INDEX=1,o7e=Mu.WIDTH_INDEX=2,r7e=Mu.MATERIAL_INDEX=3,dL=Mu.POSITION_SIZE_INDEX=4,s7e=Mu.DISTANCE_DISPLAY_CONDITION=5,Sue=Mu.NUMBER_OF_PROPERTIES=6;function E_(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;c(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Mu.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new E("value is required.");e!==this._show&&(this._show=e,E_(this,i7e))}},positions:{get:function(){return this._positions},set:function(e){if(!c(e))throw new E("value is required.");let t=xo(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)&&E_(this,dL),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),E_(this,Eue),this.update()}},material:{get:function(){return this._material},set:function(e){if(!c(e))throw new E("material is required.");this._material!==e&&(this._material=e,E_(this,r7e))}},width:{get:function(){return this._width},set:function(e){if(!c(e))throw new E("value is required.");let t=this._width;e!==t&&(this._width=e,E_(this,o7e))}},loop:{get:function(){return this._loop},set:function(e){if(!c(e))throw new E("value is required.");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,E_(this,dL)}}},id:{get:function(){return this._id},set:function(e){this._id=e,c(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!c(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new E("far distance must be greater than near distance.");Mt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),E_(this,s7e))}}});Mu.prototype.update=function(){let e=B.IDENTITY;c(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Eue]>0||this._propertiesChanged[dL]>0;if((!B.equals(e,this._modelMatrix)||i)&&(this._segments=Fi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=le.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=B.clone(e,this._modelMatrix),this._segments.positions.length!==t)E_(this,dL);else{let o=n.length;for(let r=0;r2){if(o[UW]||o[wue]){let m=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Hn.fromCartesian(m.center,Lue),b=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,Nue);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,b)}if(o[u7e]){let m=Fue;m.x=0,m.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;c(y)&&(m.x=y.near,m.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}l.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let l=0;l0){let j=L.isTranslucent();a>=s?(_=new Qe({owner:e}),n.push(_)):_=n[a],++a,w=xt(p(L._uniforms),e._uniformMap),_.boundingVolume=le.clone(hL,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=j?e._translucentRS:e._opaqueRS,_.pass=j?De.TRANSLUCENT:De.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=w,_.count=F,_.offset=S,S+=F,F=0,l=!0,r.push(_)}L=I._material,L.update(o),R=N}let k=I._locatorBuckets,z=k.length;for(let j=0;j0&&(a>=s?(_=new Qe({owner:e}),n.push(_)):_=n[a],++a,w=xt(p(L._uniforms),e._uniformMap),_.boundingVolume=le.clone(hL,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=L.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=L.isTranslucent()?De.TRANSLUCENT:De.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=w,_.count=F,_.offset=S,l=!0,r.push(_)),R=void 0}}n.length=a}fh.prototype.isDestroyed=function(){return!1};fh.prototype.destroy=function(){return Bue(this),zW(this),kue(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};function h7e(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[UW]?(i.bufferUsage!==Be.STREAM_DRAW&&(t=!0,i.bufferUsage=Be.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Be.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Be.STATIC_DRAW):i.frameCount--),t}var Due=[0,0,0];function Pue(e,t,n){e._createVertexArray=!1,zW(e),Bue(e),_7e(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],l=0,u=[[]],f=0,h=e._polylineBuckets,p,g;for(p in h)h.hasOwnProperty(p)&&(g=h[p],g.updateShader(t,r,s),f+=g.lengthOfPositions);if(f>0){let m=e._mode,y=new Float32Array(6*f*3),b=new Float32Array(f*4),x,A=0,C=0,S=0;for(p in h)if(h.hasOwnProperty(p)){g=h[p],g.write(y,b,A,C,S,r,t,n),m===oe.MORPHING&&(c(x)||(x=new Float32Array(6*f*3)),g.writeForMorph(x,A));let w=g.lengthOfPositions;A+=6*w*3,C+=w*4,S+=w*4,l=g.updateIndices(i,a,u,l)}let v=e._positionBufferUsage.bufferUsage,P=Be.STATIC_DRAW;e._positionBuffer=yt.createVertexBuffer({context:t,typedArray:y,usage:v});let M;c(x)&&(M=yt.createVertexBuffer({context:t,typedArray:x,usage:v})),e._texCoordExpandAndBatchIndexBuffer=yt.createVertexBuffer({context:t,typedArray:b,usage:P});let R=3*Float32Array.BYTES_PER_ELEMENT,L=4*Float32Array.BYTES_PER_ELEMENT,F=0,_=i.length;for(let w=0;w<_;++w)if(o=i[w],o.length>0){let D=new Uint16Array(o),I=yt.createIndexBuffer({context:t,typedArray:D,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});F+=a[w];let N=6*(w*(R*O.SIXTY_FOUR_KILOBYTES)-F*R),k=R+N,z=R+k,V=R+z,j=R+V,U=R+j,q=w*(L*O.SIXTY_FOUR_KILOBYTES)-F*L,Y=[{index:ql.position3DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:ql.position3DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:ql.position2DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:ql.position2DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:ql.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:z,strideInBytes:6*R},{index:ql.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:ql.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:z,strideInBytes:6*R},{index:ql.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:ql.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:ql.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:ql.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:ql.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:ql.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:$.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:q}],te,K,Z,ee;m===oe.SCENE3D?(K=e._positionBuffer,te="vertexBuffer",Z=Due,ee="value"):m===oe.SCENE2D||m===oe.COLUMBUS_VIEW?(K=Due,te="value",Z=e._positionBuffer,ee="vertexBuffer"):(K=M,te="vertexBuffer",Z=e._positionBuffer,ee="vertexBuffer"),Y[0][te]=K,Y[1][te]=K,Y[2][ee]=Z,Y[3][ee]=Z,Y[4][te]=K,Y[5][te]=K,Y[6][ee]=Z,Y[7][ee]=Z,Y[8][te]=K,Y[9][te]=K,Y[10][ee]=Z,Y[11][ee]=Z;let me=new ti({context:t,attributes:Y,indexBuffer:I});e._vertexArrays.push({va:me,buckets:u[w]})}}}function m7e(e,t){return t instanceof Rt?t.id:t}var zz=[];function p7e(e){let t=Xi._uniformList[e.type],n=t.length;zz.length=2*n;let i=0;for(let o=0;o1){a.update();let l=a.material,u=i[l.type];c(u)||(u=i[l.type]=new Rm(l,t,n)),u.addPolyline(a)}}}function g7e(e,t){let n=t.mode;(e._mode!==n||!B.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=B.clone(e.modelMatrix),e._createVertexArray=!0)}function VW(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s0,b=g._index,x=this.getSegments(g,a),A=x.positions,C=x.lengths,S=A.length,v=g.getPickId(s).color,P=0,M=0,R;for(let z=0;z0||Ds.x>0&&jf.x<0)&&d.clone(Ds,jf),(Ds.x<0&&Wf.x>0||Ds.x>0&&Wf.x<0)&&d.clone(Ds,Wf));let q=j?2:0,Y=U?2:4;for(let te=q;te2&&(r.setBatchedAttribute(b,2,D),r.setBatchedAttribute(b,3,I),r.setBatchedAttribute(b,4,N))}};var x7e=new d,T7e=new d,A7e=new d,Iue=new d;Rm.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r0&&(l=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let h=0;h0)g[0]=y;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let y=0;for(let b=0;bO.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:y}),y=0,t.push(4),a=[],e.push(a),l=0,r.count=s,s=0,i=0,r=new kW(0,0,this),n[++o]=[r]),a.push(l,l+2,l+1),a.push(l+1,l+2,l+3),y+=6,s+=6,i+=6,l+=4}p._locatorBuckets.push({locator:r,count:y}),l+4>O.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),l=0,r.count=s,i=0,s=0,r=new kW(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};Rm.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o0){e._boundingVolume2D=le.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new d(u.z,u.x,u.y)}return CE.positions=o,CE.lengths=e._segments.lengths,CE};var Rue;Rm.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*O.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=Rue,l=6*s*3;!c(a)||a.lengthl&&(a=new Float32Array(a.buffer,0,l));let u=this.getSegments(t,i),f=u.positions,h=u.lengths,p=0,g=0,m=0,y;s=f.length;for(let b=0;b0||Ds.x>0&&jf.x<0)&&d.clone(Ds,jf),(Ds.x<0&&Wf.x>0||Ds.x>0&&Wf.x<0)&&d.clone(Ds,Wf));let S=A?2:0,v=C?2:4;for(let P=S;P{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let l=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let h=e._batchIds,p=n.length/3;for(let g=0;g{e.isDestroyed()||(e._error=a)})}zy.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(g.packedBuffer),y=m[0];k7e(e,m),e._indices=Fe.getSizeInBytes(y)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),H7e(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function H7e(e){c(e._primitive)||(e._primitive=new rx({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)}S_.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};S_.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};S_.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};S_.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};S_.prototype.update=function(e){if(!this._ready){if(c(this._promise)||(this._promise=z7e(this)),c(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)};S_.prototype.isDestroyed=function(){return!1};S_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var gL=S_;var yL=`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 hh(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ie.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=G.clone(G.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(hh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function G7e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+ie.packedLength+d.packedLength,a=new Float64Array(s),l=0;return a[l++]=n,a[l++]=i,ce.pack(t,a,l),l+=ce.packedLength,ie.pack(o,a,l),l+=ie.packedLength,d.pack(r,a,l),a}var j7e=new yi("createVectorTilePolylines",5),EE={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function W7e(e,t){if(c(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;c(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=G7e(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],l={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=j7e.scheduleTask(l,a);if(c(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===Fe.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),q7e(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function q7e(e,t){if(!c(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,l=i.byteLength+n.byteLength+o.byteLength;l+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=l;let u=yt.createVertexBuffer({context:t,typedArray:i,usage:Be.STATIC_DRAW}),f=yt.createVertexBuffer({context:t,typedArray:n,usage:Be.STATIC_DRAW}),h=yt.createVertexBuffer({context:t,typedArray:o,usage:Be.STATIC_DRAW}),p=yt.createVertexBuffer({context:t,typedArray:r,usage:Be.STATIC_DRAW}),g=yt.createVertexBuffer({context:t,typedArray:s,usage:Be.STATIC_DRAW}),m=yt.createIndexBuffer({context:t,typedArray:a,usage:Be.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),y=[{index:EE.previousPosition,vertexBuffer:u,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:EE.currentPosition,vertexBuffer:f,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:EE.nextPosition,vertexBuffer:h,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:EE.expandAndWidth,vertexBuffer:p,componentDatatype:$.FLOAT,componentsPerAttribute:2},{index:EE.a_batchId,vertexBuffer:g,componentDatatype:$.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ti({context:t,attributes:y,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 bL=new B,Vue=new d;function Y7e(e,t){c(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return B.clone(n,bL),B.multiplyByPoint(bL,e._center,Vue),B.setTranslation(bL,Vue,bL),bL},u_highlightColor:function(){return e._highlightColor}})}function X7e(e){if(c(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ve.fromCache({blending:ln.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var K7e=`uniform vec4 u_highlightColor; void main() { out_FragColor = u_highlightColor; } `;function $7e(e,t){if(c(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(yL),o=n.getFragmentShaderCallback(!1,void 0,!1)(K7e),r=new He({defines:["VECTOR_TILE",Vt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[xu,i]}),s=new He({defines:["VECTOR_TILE"],sources:[o]});e._sp=Jt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:EE})}function Z7e(e,t){if(!c(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new Qe({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:De.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}hh.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!c(n)||!c(i))return;let r,s,a=n.length,l=0,u=0;for(r=0;r 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 w_(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ie.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 H(ui._defaultMinTerrainHeight,ui._defaultMaxTerrainHeight),this._boundingVolume=Dn.fromRectangle(e.rectangle,ui._defaultMinTerrainHeight,ui._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=G.clone(G.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(w_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function nYe(e,t,n){let i=ui.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,l=e._rectangle;Dn.fromRectangle(l,o,r,n,a)}function iYe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+ie.packedLength+d.packedLength,a=new Float64Array(s),l=0;return a[l++]=n,a[l++]=i,ce.pack(t,a,l),l+=ce.packedLength,ie.pack(o,a,l),l+=ie.packedLength,d.pack(r,a,l),a}var oYe=new yi("createVectorTileClampedPolylines"),Hy={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function rYe(e,t){if(c(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;c(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=iYe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],l={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=oYe.scheduleTask(l,a);if(c(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===Fe.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),sYe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function sYe(e,t){if(!c(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,l=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=s.byteLength+a.byteLength,f+=l.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let h=yt.createVertexBuffer({context:t,typedArray:n,usage:Be.STATIC_DRAW}),p=yt.createVertexBuffer({context:t,typedArray:i,usage:Be.STATIC_DRAW}),g=yt.createVertexBuffer({context:t,typedArray:o,usage:Be.STATIC_DRAW}),m=yt.createVertexBuffer({context:t,typedArray:r,usage:Be.STATIC_DRAW}),y=yt.createVertexBuffer({context:t,typedArray:s,usage:Be.STATIC_DRAW}),b=yt.createVertexBuffer({context:t,typedArray:a,usage:Be.STATIC_DRAW}),x=yt.createVertexBuffer({context:t,typedArray:l,usage:Be.STATIC_DRAW}),A=yt.createIndexBuffer({context:t,typedArray:u,usage:Be.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),C=[{index:Hy.startEllipsoidNormal,vertexBuffer:h,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:Hy.endEllipsoidNormal,vertexBuffer:p,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:Hy.startPositionAndHeight,vertexBuffer:g,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Hy.endPositionAndHeight,vertexBuffer:m,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Hy.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Hy.endFaceNormalAndHalfWidth,vertexBuffer:b,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Hy.a_batchId,vertexBuffer:x,componentDatatype:$.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ti({context:t,attributes:C,indexBuffer:A}),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 AL=new B,zue=new d;function aYe(e,t){c(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return B.clone(n,AL),B.multiplyByPoint(AL,e._center,zue),B.setTranslation(AL,zue,AL),AL},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Hue(e){return Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:ln.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function cYe(e){c(e._rs)||(e._rs=Hue(!1),e._rs3DTiles=Hue(!0))}function lYe(e,t){if(c(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(xL),o=n.getFragmentShaderCallback(!1,void 0,!0)(TL),r=new He({defines:["VECTOR_TILE",Vt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[xu,i]}),s=new He({defines:["VECTOR_TILE"],sources:[o]});e._sp=Jt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Hy})}function uYe(e,t){let n=e._command;if(!c(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new Qe({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:De.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=Qe.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=De.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Un.TERRAIN||i===Un.BOTH)&&t.commandList.push(n),(i===Un.CESIUM_3D_TILE||i===Un.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}w_.prototype.getPositions=function(e){return kx.getPolylinePositions(this,e)};w_.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o{e.isDestroyed()||(e._error=t)})}w_.prototype.update=function(e){let t=e.context;if(!this._ready){if(c(this._promise)||(this._promise=pYe(this).then(rYe(this,t))),c(this._error)){let i=this._error;throw this._error=void 0,i}return}aYe(this,t),lYe(this,t),cYe(this);let n=e.passes;(n.render||n.pick)&&uYe(this,e)};w_.prototype.isDestroyed=function(){return!1};w_.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),de(this)};var CL=w_;var GW=32767,_Ye=new he,gYe=new d;function yYe(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),l=e.subarray(2*r,3*r);Ln.zigZagDeltaDecode(s,a,l);let u=new Float64Array(e.length);for(let f=0;f0&&c(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&c(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(l>0&&c(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,l)}let u=c(n)||c(i)||c(o),f=s>0&&!c(n)||a>0&&!c(i)||l>0&&!c(o);if(u&&f)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!c(n)&&!c(i)&&!c(o)){let p=0;if(!c(n)&&s>0)for(n=new Uint16Array(s),r=0;r0)for(i=new Uint16Array(a),r=0;r0)for(o=new Uint16Array(l),r=0;r0&&(x=ir(i,n,u),n+=u,f>0&&(A=new Uint8Array(t,n,f),A=new Uint8Array(A),n+=f));let C=y.POLYGONS_LENGTH??0,S=y.POLYLINES_LENGTH??0,v=y.POINTS_LENGTH??0,P=C+S+v,M=new Kp(e,P,x,A,bYe(e));if(e._batchTable=M,P===0)return;let R=new sh(y,b),L=R.getGlobalProperty("REGION");if(!c(L))throw new ae("Feature table global property: REGION must be defined");let F=ce.unpack(L),_=L[4],w=L[5],D=e._tile.computedTransform,I=R.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(I)?(I=d.unpack(I),B.multiplyByPoint(D,I,I)):(I=ce.center(F),I.height=O.lerp(_,w,.5),I=ie.WGS84.cartographicToCartesian(I));let N=xYe(y,b);if(n+=(4-n%4)%4,C>0){R.featuresLength=C;let k=R.getPropertyArray("POLYGON_COUNTS",$.UNSIGNED_INT,1)??R.getPropertyArray("POLYGON_COUNT",$.UNSIGNED_INT,1);if(!c(k))throw new ae("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let z=R.getPropertyArray("POLYGON_INDEX_COUNTS",$.UNSIGNED_INT,1)??R.getPropertyArray("POLYGON_INDEX_COUNT",$.UNSIGNED_INT,1);if(!c(z))throw new ae("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=k.reduce(function(K,Z){return K+Z*2},0),j=z.reduce(function(K,Z){return K+Z},0),U=new Uint32Array(t,n,j);n+=h;let q=new Uint16Array(t,n,V);n+=p;let Y,te;c(y.POLYGON_MINIMUM_HEIGHTS)&&c(y.POLYGON_MAXIMUM_HEIGHTS)&&(Y=R.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",$.FLOAT,1),te=R.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",$.FLOAT,1)),e._polygons=new gL({positions:q,counts:k,indexCounts:z,indices:U,minimumHeight:_,maximumHeight:w,polygonMinimumHeights:Y,polygonMaximumHeights:te,center:I,rectangle:F,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:M,batchIds:N.polygons,modelMatrix:D})}if(S>0){R.featuresLength=S;let k=R.getPropertyArray("POLYLINE_COUNTS",$.UNSIGNED_INT,1)??R.getPropertyArray("POLYLINE_COUNT",$.UNSIGNED_INT,1);if(!c(k))throw new ae("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let z=R.getPropertyArray("POLYLINE_WIDTHS",$.UNSIGNED_SHORT,1);if(!c(z)){z=new Uint16Array(S);for(let te=0;te0){let k=new Uint16Array(t,n,v*3);n+=m,e._points=new _L({positions:k,batchIds:N.points,minimumHeight:_,maximumHeight:w,rectangle:F,batchTable:M})}}function jW(e){let t=e.featuresLength;if(!c(e._features)&&t>0){let n=new Array(t);c(e._polygons)&&e._polygons.createFeatures(e,n),c(e._polylines)&&e._polylines.createFeatures(e,n),c(e._points)&&e._points.createFeatures(e,n),e._features=n}}ph.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};ph.prototype.getFeature=function(e){let t=this.featuresLength;if(!c(e)||e<0||e>=t)throw new E(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return c(this._features)||jW(this),this._features[e]};ph.prototype.applyDebugSettings=function(e,t){c(this._polygons)&&this._polygons.applyDebugSettings(e,t),c(this._polylines)&&this._polylines.applyDebugSettings(e,t),c(this._points)&&this._points.applyDebugSettings(e,t)};ph.prototype.applyStyle=function(e){c(this._features)||jW(this),c(this._polygons)&&this._polygons.applyStyle(e,this._features),c(this._polylines)&&this._polylines.applyStyle(e,this._features),c(this._points)&&this._points.applyStyle(e,this._features)};ph.prototype.update=function(e,t){let n=!0;c(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),c(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),c(this._points)&&(this._points.update(t),n=n&&this._points.ready),c(this._batchTable)&&n&&(c(this._features)||jW(this),this._batchTable.update(e,t),this._ready=!0)};ph.prototype.pick=function(e,t,n){};ph.prototype.getPolylinePositions=function(e){let t=this._polylines;if(c(t))return t.getPositions(e)};ph.prototype.isDestroyed=function(){return!1};ph.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(),de(this)};function EYe(e,t,n,i,o,r){let s=t.length,a=0;for(let l=0;l=0?i[r]:void 0}var zx=vYe;function P_(e){e=e??W.EMPTY_OBJECT;let t=e.tile,n=e.class;T.typeOf.object("options.tile",t),T.typeOf.object("options.class",n),this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(P_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});P_.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};P_.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};P_.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};P_.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};P_.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};P_.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};P_.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var vL=P_;function qW(e,t){let n=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!c(n))return;if(!c(e.schema)){qW._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??W.EMPTY_OBJECT;if(c(n.class)){let o=i[n.class];return new vL({tile:n,class:o})}}qW._oneTimeWarning=dt;var DL=qW;function DYe(e){let t=new Uint8Array(e),n=Kd(t);if(n==="glTF"&&(n="glb"),Ps.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=PYe(t);if(c(i.root))return{contentType:Ps.EXTERNAL_TILESET,jsonPayload:i};if(c(i.asset))return{contentType:Ps.GLTF,jsonPayload:i};if(c(i.tileAvailability))return{contentType:Ps.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(c(i.type))return{contentType:Ps.GEOJSON,jsonPayload:i};if(c(i.voxelTable))return{contentType:Ps.VOXEL_JSON,jsonPayload:i};throw new ae("Invalid tile content.")}function PYe(e){let t;try{t=ir(e)}catch{throw new ae("Invalid tile content.")}return t}var I_=DYe;function Yf(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=c(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 s=0;sMYe(e,r,s)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(c),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function MYe(e,t,n){if(c(t))try{let i=I_(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===Ps.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ps.GEOMETRY||i.contentType===Ps.VECTOR;let a,l=Ux[i.contentType];c(i.binaryPayload)?a=await Promise.resolve(l(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(l(o,s,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let h=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=h.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=Vx(o,u));let f=zx(o,u);return c(f)&&(a.group=new tx({metadata:f})),a}catch(i){Wue(e,n,i)}}function Wue(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=c(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}`))}Yf.prototype.cancelRequests=function(){for(let e=0;ea?g=O.TWO_PI-l+a:g=a-l;let y=Math.ceil(g/t)+1,b=Math.ceil(m/t)+1,x=g/(y-1),A=m/(b-1),C=ce.northwest(e,r),S=ce.center(e,FYe);(n!==0||i!==0)&&(S.longitudeO.PI_OVER_TWO||f<-O.PI_OVER_TWO||f>O.PI_OVER_TWO)throw new E("Rotated rectangle is invalid. It crosses over either the north or south pole.");F.granYCos=_.granYCos,F.granYSin=_.granYSin,F.granXCos=_.granXCos,F.granXSin=_.granXSin,L.north=u,L.south=f,L.east=a,L.west=l}if(i!==0){n=n-i;let _=ce.northwest(L,s),w=Xue(_,n,x,A,S,y,b);F.stGranYCos=w.granYCos,F.stGranXCos=w.granXCos,F.stGranYSin=w.granYSin,F.stGranXSin=w.granXSin,F.stNwCorner=_,F.stWest=w.west,F.stSouth=w.south}return F};var Is=XW;var BYe=new le,kYe=new le,UYe=new d,VYe=new ce;function Kue(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,l=2,u=0,f=4;r&&(l-=1,a-=1,u+=1,f-=2),s&&(l-=1,a-=1,u+=1,f-=2),u+=l*o+2*a-f;let h=new Float64Array(u*3),p=0,g=0,m,y=UYe;if(r)Is.computePosition(t,n,!1,g,0,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;else for(m=0;m=0;m--)Is.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;for(m=0,g=i-2;g>0;g--)Is.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;let b=h.length/3*2,x=Fe.createTypedArray(h.length/3,b),A=0;for(let S=0;S0){Kf.longitude=(t.west+t.east)*.5,Kf.latitude=u;let y=n.cartographicToCartesian(Kf,DE.origin);d.clone(l,DE.direction);let b=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,efe);Zn.rayPlane(DE,b,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,jz)}else f=n.geodeticSurfaceNormalCartographic(ce.southeast(t),jz);let h=d.cross(f,a,Jue);d.normalize(h,e.southNormal);let p=t.north,g;if(p<0){Kf.longitude=(t.west+t.east)*.5,Kf.latitude=p;let y=n.cartographicToCartesian(Kf,DE.origin);d.negate(l,DE.direction);let b=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,efe);Zn.rayPlane(DE,b,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,jz)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),jz);let m=d.cross(a,g,Jue);d.normalize(m,e.northNormal)}var XYe=new d,KYe=new d,$Ye=new d(0,-1,0),ZYe=new d(0,0,-1),tfe=new d;function QYe(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,g=e.eastNormal,m=e.northNormal;t.mode!==oe.SCENE3D&&(u=t.mapProjection.project(ce.southwest(e.rectangle),XYe),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ce.northeast(e.rectangle),KYe),f.z=f.y,f.y=f.x,f.x=0,h=$Ye,g=d.UNIT_Y,p=ZYe,m=d.UNIT_Z);let y=d.subtract(i,u,tfe),b=d.dot(y,h),x=d.dot(y,p),A=d.subtract(i,f,tfe),C=d.dot(A,g),S=d.dot(A,m);b>0?r+=b*b:C>0&&(r+=C*C),x>0?r+=x*x:S>0&&(r+=S*S)}let s,a,l;if(t.mode===oe.SCENE3D?(s=o.height,a=e.minimumHeight,l=e.maximumHeight):(s=i.x,a=0,l=0),s>l){let u=s-l;r+=u*u}else if(s0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):sn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,sn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,l;if(n.length===1)return l=this._boundingPlanes[n[0]],a=oq(sn.projectPointOntoPlane(l,t,iq),i[0],l,o),d.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=cfe(t,p[0],p[1]),d.distance(a,t)}let f=Number.MAX_VALUE,h;for(r=0;r<2;r++)l=this._boundingPlanes[n[r]],a=oq(sn.projectPointOntoPlane(l,t,iq),i[r],l,this._edgeNormals[n[r]]),h=d.distanceSquared(a,t),h3)return a=oq(sn.projectPointOntoPlane(this._boundingPlanes[1],t,iq),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),d.distance(a,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 pXe=new d,_Xe=new d;function cfe(e,t,n){let i=d.subtract(n,t,pXe),o=d.subtract(e,t,_Xe),r=d.dot(i,o);if(r<=0)return t;let s=d.dot(i,i);return r>=s?n:(r=r/s,new d((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var gXe=new sn(d.UNIT_X,0);function oq(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let l=0;l0&&(m=!0,h+=u),s1||oi(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=c(n.transform)?B.unpack(n.transform):B.clone(B.IDENTITY);let a=c(i)?i.computedTransform:e.modelMatrix,l=B.multiply(a,this.transform,new B),u=c(i)?i._initialTransform:B.IDENTITY;this._initialTransform=B.multiply(u,this.transform,new B),this.computedTransform=l,this.metadata=DL(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,l),this._boundingVolume2D=void 0;let f;c(s)&&c(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,l)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let h;c(n.viewerRequestVolume)&&(h=this.createBoundingVolume(n.viewerRequestVolume,l)),this._viewerRequestVolume=h,this.geometricError=n.geometricError,this._geometricError=n.geometricError,c(this._geometricError)||(this._geometricError=c(i)?i._geometricError:e._geometricError,ar._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;c(n.refine)?((n.refine==="replace"||n.refine==="add")&&ar._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?qo.REPLACE:qo.ADD):c(i)?p=i.refine:p=qo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,b,x;if(t=we.createIfNeeded(t),r)y=Xo.UNLOADED,b=t.clone();else if(c(s)){let v=s.uri;c(s.url)&&(ar._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(ar._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new SE(e,this),m=!0,y=Xo.READY):(y=Xo.UNLOADED,b=t.getDerivedResource({url:v}),x=sc.getServerKey(b.getUrlComponent()))}else g=new SE(e,this),m=!0,y=Xo.READY;this._content=g,this._contentResource=b,this._contentState=y,this._expiredContent=void 0,this._serverKey=x,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let A=n.expire,C,S;c(A)&&(C=A.duration,c(A.date)&&(S=Q.fromIso8601(A.date))),this.expireDuration=C,this.expireDate=S,this.lastStyleTime=0,this._optimChildrenWithinParent=qf.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=G.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new Q,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}ar._deprecationWarning=ws;Object.defineProperties(ar.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 c(this._color)||(this._color=new G),G.clone(this._color)},set:function(e){this._color=G.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||c(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Xo.READY}},contentUnloaded:{get:function(){return this._contentState===Xo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Xo.EXPIRED}},contentFailed:{get:function(){return this._contentState===Xo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var jy=new d;function EXe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=d.multiplyByScalar(s.directionWC,e._centerZDepth,jy),l=d.add(s.positionWC,a,jy),u=d.subtract(l,r,jy);if(d.magnitude(u)>o){let S=d.normalize(u,jy),v=d.multiplyByScalar(S,o,jy),P=d.add(r,v,jy),M=d.subtract(P,s.positionWC,jy),R=d.normalize(M,jy);e._foveatedFactor=1-Math.abs(d.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===qo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Uo.PRELOAD_FLIGHT||n._pass===Uo.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*m;if(e._foveatedFactor<=y)return!1;let b=m-y,x=O.clamp((e._foveatedFactor-y)/b,0,1),A=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,x),C=e._screenSpaceError===0&&c(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-A<=C}var _fe=new Q;ar.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=c(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:l}=e,u=a.frustum,f=l.drawingBufferWidth,h=l.drawingBufferHeight*o,p;if(e.mode===oe.SCENE2D||u instanceof on){let g=u.offCenterFrustum;c(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,h);p=s/m}else{let g=Math.max(this._distanceToCamera,O.EPSILON7),m=u.sseDenominator;if(p=s*h/(g*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,b=i.dynamicScreenSpaceErrorFactor,x=O.fog(g,y)*b;p-=x}}return p/=e.pixelRatio,p};function SXe(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=c(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function wXe(e,t){let n=t.parent,o=c(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}ar.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=c(t)?t.computedTransform:n.modelMatrix,o=c(t)?t._visibilityPlaneMask:_s.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!==_s.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=wXe(n,this),this._priorityProgressiveResolution=SXe(n,this),this.priorityDeferred=EXe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};ar.prototype.updateExpiration=function(){if(c(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Q.now(_fe);Q.lessThan(this.expireDate,e)&&(this._contentState=Xo.EXPIRED,this._expiredContent=this._content)}};function vXe(e){if(!c(e.expireDuration))return;let t=Q.now(_fe);Q.addSeconds(t,e.expireDuration,t),c(e.expireDate)?Q.lessThan(e.expireDate,t)&&Q.clone(t,e.expireDate):e.expireDate=Q.clone(t)}function DXe(e){return function(){return e._priority}}ar.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?PXe(this):OXe(this)};function PXe(e){let t=e._content,n=e._tileset;if(!c(t)){let o=oi(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new PL(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(c(i))return e._contentState=Xo.LOADING,i.then(o=>{if(!e.isDestroyed()&&c(o))return e._contentState=Xo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Xo.FAILED,o})}async function IXe(e,t,n,i,o){let r=e._contentState;e._contentState=Xo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===$n.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Xo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===$n.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await RXe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Xo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Xo.FAILED,a}}function OXe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Qo({throttle:!0,throttleByServer:!0,type:ms.TILES3D,priorityFunction:DXe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!c(r)){++o.statistics.numberOfAttemptedRequests;return}return IXe(e,o,i,n,r)}async function RXe(e,t){let n=I_(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Ps.GEOMETRY||n.contentType===Ps.VECTOR,(n.contentType===Ps.IMPLICIT_SUBTREE||n.contentType===Ps.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===Ps.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=Ux[n.contentType];if(e.isDestroyed())return;c(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let l=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=l.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=Vx(i,s));let a=zx(i,s);return c(a)&&(o.group=new tx({metadata:a})),o}ar.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};ar.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Xo.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 gfe=new le;function aq(e,t){if(t.mode!==oe.SCENE3D&&!c(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,gfe);e._boundingVolume2D=new L_(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function MXe(e,t){if(t.mode!==oe.SCENE3D&&!c(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,gfe);e._contentBoundingVolume2D=new L_(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}ar.prototype.visibility=function(e,t){let n=e.cullingVolume,i=aq(this,e),o=this._tileset,r=o.clippingPlanes;if(c(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Wt.INSIDE,a===Wt.OUTSIDE)return _s.MASK_OUTSIDE}let s=o.clippingPolygons;if(c(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Wt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};ar.prototype.contentVisibility=function(e){if(!c(this._contentBoundingVolume))return Wt.INSIDE;if(this._visibilityPlaneMask===_s.MASK_INSIDE)return Wt.INSIDE;let t=e.cullingVolume,n=MXe(this,e),i=this._tileset,o=i.clippingPlanes;if(c(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Wt.INSIDE,s===Wt.OUTSIDE)return Wt.OUTSIDE}let r=i.clippingPolygons;if(c(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Wt.OUTSIDE,s===Wt.INSIDE)return Wt.OUTSIDE}return t.computeVisibility(n)};ar.prototype.distanceToTile=function(e){return aq(this,e).distanceToCamera(e)};var LXe=new d;ar.prototype.distanceToTileCenter=function(e){let n=aq(this,e).boundingVolume,i=d.subtract(n.center,e.camera.positionWC,LXe);return d.dot(e.camera.directionWC,i)};ar.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!c(t)||t.distanceToCamera(e)===0};var yfe=new J,bfe=new d,NXe=new J,cq=new d,xfe=new ce,Tfe=new Dn,sq=new B;function FXe(e,t,n){let i=d.fromElements(e[0],e[1],e[2],cq),o=J.fromArray(e,3,NXe);i=B.multiplyByPoint(t,i,i);let r=B.getMatrix3(t,yfe);return o=J.multiply(r,o,o),c(n)?(n.update(i,o),n):new Yl(i,o)}function dfe(e,t,n,i){let o=ce.unpack(e,0,xfe),r=e[4],s=e[5],a=Dn.fromRectangle(o,r,s,ie.WGS84,Tfe),l=a.center,u=a.halfAxes;t=B.multiplyTransformation(t,B.inverseTransformation(n,sq),sq),l=B.multiplyByPoint(t,l,l);let f=B.getMatrix3(t,yfe);return u=J.multiply(f,u,u),c(i)&&i instanceof Yl?(i.update(l,u),i):new Yl(l,u)}function BXe(e,t,n,i){if(!B.equalsEpsilon(t,n,O.EPSILON8))return i instanceof Yl?dfe(e,t,n,i):dfe(e,t,n,void 0);let o=ce.unpack(e,0,xfe);return i instanceof Lu?(i.rectangle=ce.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ie.WGS84),i):new Lu({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function kXe(e,t,n){let i=d.fromElements(e[0],e[1],e[2],cq),o=e[3];i=B.multiplyByPoint(t,i,i);let r=B.getScale(t,bfe),s=d.maximumComponent(r);return o*=s,c(n)?(n.update(i,o),n):new L_(i,o)}ar.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(c(i)&&(o=bx.parseBoundingVolumeSemantic("TILE",i)),c(o)&&(e=o),!c(e))throw new ae("boundingVolume must be defined");if(oi(e,"3DTILES_bounding_volume_S2"))return new ML(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(c(r)){let l=FXe(r,t,n);return this._verticalExaggeration!==1&&hfe(l,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l}if(c(s)){let l=BXe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(l instanceof Yl?hfe(l,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(l.minimumHeight=Dr.getHeight(l.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l.maximumHeight=Dr.getHeight(l.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l.computeBoundingVolumes(ie.WGS84))),l}if(c(a)){let l=kXe(a,t,n);if(this._verticalExaggeration!==1){let u=Dr.getPosition(l.center,ie.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,cq),f=l.radius*this._verticalExaggeration;l.update(u,f)}return l}throw new ae("boundingVolume must contain a sphere, region, or box")};var UXe=d.unpackArray(new Array(8*3).fill(0));function hfe(e,t,n){let i=e.boundingVolume.computeCorners(UXe).map(r=>Dr.getPosition(r,ie.WGS84,t,n,r)),o=Dn.fromPoints(i,Tfe);e.update(o.center,o.halfAxes)}ar.prototype.updateTransform=function(e,t){e=e??B.IDENTITY;let n=B.multiplyTransformation(e,this.transform,sq),i=!B.equals(n,this.computedTransform),o=c(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&B.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),c(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),c(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()};ar.prototype.updateGeometricErrorScale=function(){let e=B.getScale(this.computedTransform,bfe),t=d.maximumComponent(e);if(this.geometricError=this._geometricError*t,!c(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function VXe(e,t,n,i){if(!i.isRender)return;let o=c(e._contentHeader)&&c(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let l;e._finalResolution?e.hasRenderableContent?l=G.WHITE:l=G.DARKGRAY:l=G.YELLOW,c(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(l)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Gt.toValue(l,u.color)}else!r&&c(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(c(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(G.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&c(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&c(e._viewerRequestVolume)?(c(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(G.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&c(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||c(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=G.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function zXe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&c(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(c(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Xo.FAILED,o}}function HXe(e,t){let n=t.clippingPlanes,i=0;c(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function GXe(e,t){let n=t.clippingPolygons,i=0;c(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}ar.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;HXe(this,e),GXe(this,e),VXe(this,e,t,n),zXe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;se.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};$x.prototype.trim=function(){this._trimTiles=!0};var kL=$x;function Kz(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 uq(e,t){let n;return t==="_loadTimestamp"?n=Q.toDate(e).getTime():n=e,n}Kz.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=uq(e,n),this._referenceMaximum[n]=uq(t,n)};function qXe(e,t){let n=e.tilePropertyName;if(c(n)){let i=uq(t[n],n);return c(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var lq=[new G(.1,.1,.1,1),new G(.153,.278,.878,1),new G(.827,.231,.49,1),new G(.827,.188,.22,1),new G(1,.592,.259,1),new G(1,.843,0,1)];Kz.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!c(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=qXe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+O.EPSILON7,l=O.clamp(i-o,0,s)/s,u=lq.length-1,f=l*u,h=Math.floor(f),p=Math.ceil(f),g=f-h,m=lq[h],y=lq[p],b=G.clone(G.WHITE);b.red=O.lerp(m.red,y.red,g),b.green=O.lerp(m.green,y.green,g),b.blue=O.lerp(m.blue,y.blue,g),e._debugColor=b};Kz.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(c(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=c(t)&&c(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var UL=Kz;function FE(){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}FE.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};FE.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function dq(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}HL.encode2D=function(e,t){if(T.typeOf.number("x",e),T.typeOf.number("y",t),e<0||e>65535||t<0||t>65535)throw new E("inputs must be 16-bit unsigned integers");return(Sfe(e)|Sfe(t)<<1)>>>0};HL.decode2D=function(e,t){if(T.typeOf.number("mortonIndex",e),e<0||e>4294967295)throw new E("input must be a 32-bit unsigned integer");return c(t)||(t=new Array(2)),t[0]=wfe(e),t[1]=wfe(e>>1),t};HL.encode3D=function(e,t,n){if(T.typeOf.number("x",e),T.typeOf.number("y",t),T.typeOf.number("z",n),e<0||e>1023||t<0||t>1023||n<0||n>1023)throw new E("inputs must be 10-bit unsigned integers");return fq(e)|fq(t)<<1|fq(n)<<2};HL.decode3D=function(e,t){if(T.typeOf.number("mortonIndex",e),e<0||e>1073741823)throw new E("input must be a 30-bit unsigned integer");return c(t)||(t=new Array(3)),t[0]=dq(e),t[1]=dq(e>>1),t[2]=dq(e>>2),t};var Wy=HL;function Ko(e){if(T.typeOf.string("options.subdivisionScheme",e.subdivisionScheme),T.typeOf.number("options.subtreeLevels",e.subtreeLevels),T.typeOf.number("options.level",e.level),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),e.subdivisionScheme===or.OCTREE&&T.typeOf.number("options.z",e.z),e.level<0)throw new E("level must be non-negative");if(e.x<0)throw new E("x must be non-negative");if(e.y<0)throw new E("y must be non-negative");if(e.subdivisionScheme===or.OCTREE&&e.z<0)throw new E("z must be non-negative");let t=1<=t)throw new E("x is out of range");if(e.y>=t)throw new E("y is out of range");if(e.subdivisionScheme===or.OCTREE&&e.z>=t)throw new E("z is out of range");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===or.OCTREE&&(this.z=e.z)}Object.defineProperties(Ko.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===or.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===or.OCTREE?Wy.encode3D(this.x,this.y,this.z):Wy.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===or.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});function hq(e,t){if(e.subdivisionScheme!==t.subdivisionScheme)throw new E("coordinates must have same subdivisionScheme");if(e.subtreeLevels!==t.subtreeLevels)throw new E("coordinates must have same subtreeLevels")}Ko.prototype.getDescendantCoordinates=function(e){T.typeOf.object("offsetCoordinates",e),hq(this,e);let t=this.level+e.level,n=(this.x<this.level)throw new E("ancestor cannot be above the tileset root");let t=1<>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===or.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Ko.prototype.isEqual=function(e){return T.typeOf.object("otherCoordinates",e),this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===or.OCTREE?this.z===e.z:!0)};Ko.prototype.isImplicitTilesetRoot=function(){return this.level===0};Ko.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Ko.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Ko.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===or.OCTREE&&(e.z=this.z),e};var vfe=[0,0,0];Ko.fromMortonIndex=function(e,t,n,i){let o;return e===or.OCTREE?(o=Wy.decode3D(i,vfe),new Ko({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Wy.decode2D(i,vfe),new Ko({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Ko.fromTileIndex=function(e,t,n){let i,o,r;return e===or.OCTREE?(i=Math.floor(O.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(O.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Ko.fromMortonIndex(e,t,i,r)};var Qx=Ko;function B_(){}B_.selectTiles=function(e,t){E.throwInstantiationError()};B_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};B_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};B_.selectTile=function(e,t){if(e.contentVisibility(t)===Wt.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];Dfe(r,t),e._visible=r._visible;return}if(ZXe(e,t)){e._visible=!1;return}let i=e.refine===qo.REPLACE,o=e._optimChildrenWithinParent===qf.USE_OPTIMIZATION;if(i&&o&&n&&!QXe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function ZXe(e,t){let{parent:n,tileset:i}=e;return!c(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==qo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function QXe(e,t){let n=!1,i=e.children;for(let o=0;o0;){GL.stackMaximumLength=Math.max(GL.stackMaximumLength,s.length);let a=s.pop(),l=a.refine===qo.ADD,u=a.refine===qo.REPLACE,f=eKe(a);f&&tKe(a,s,t),(l||u&&!f)&&(nKe(e,a),o(a,t),iKe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return GL.stack.trim(GL.stackMaximumLength),n};function eKe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function tKe(e,t,n){let{children:i}=e;for(let o=0;o0;){WL.stackMaximumLength=Math.max(WL.stackMaximumLength,a.length);let l=a.pop(),u=l.parent,f=!c(u)||u._refines;l._refines=i(l)?oKe(l,a,t)&&f:!1;let h=!l._refines&&f;l.hasRenderableContent?l.refine===qo.ADD?(mq(l,t),o(l,t)):l.refine===qo.REPLACE&&(o(l,t),h&&mq(l,t)):(n._emptyTiles.push(l),o(l,t),h&&mq(l,t)),r(l,t),s(l,t)}}function sKe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Zs,s=!0,a=qL.stack;for(a.push(e);a.length>0;){qL.stackMaximumLength=Math.max(qL.stackMaximumLength,a.length);let l=a.pop(),u=l.children,f=u.length,h=!l.hasRenderableContent&&n(l);if(!h&&!l.contentAvailable&&(s=!1),i(l,t),l.isVisible||(o(l,t),r(l,t)),h)for(let p=0;p0;){KL.stackMaximumLength=Math.max(KL.stackMaximumLength,r.length);let a=r.pop().children;for(let l=0;ln._depth+e.skipLevels)}function fKe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Zs;for(let u=0;ut:e._screenSpaceError>t:!0}function hKe(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Zs,l=XL.stack;for(l.push(e);l.length>0;){XL.stackMaximumLength=Math.max(XL.stackMaximumLength,l.length);let u=l.pop();lKe(u,t);let f=u.parent,h=!c(f)||f._refines;u._refines=o(u)?fKe(u,l,t)&&h:!1;let p=!u._refines&&h;u.hasRenderableContent?u.refine===qo.ADD?($z(u,t),r(u,t)):u.refine===qo.REPLACE&&(dKe(u,i)?(r(u,t),p&&$z(u,t)):p?($z(u,t),r(u,t)):uKe(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&$z(u,t)),s(u,t),a(u,t)}}function mKe(e,t){let{selectTile:n,canTraverse:i}=Zs,{stack:o,ancestorStack:r}=k_,s;for(o.push(e);o.length>0||r.length>0;){if(k_.stackMaximumLength=Math.max(k_.stackMaximumLength,o.length),k_.ancestorStackMaximumLength=Math.max(k_.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=o.pop();if(!c(a))continue;let l=i(a);if(a._shouldSelect)if(a.refine===qo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!l){n(a,t);continue}r.push(a),a._stackLength=o.length}if(l){let u=a.children;for(let f=0;fui._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Ot.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=B.clone(s._initialClippingPlanesOriginMatrix),s};cr.loadJson=function(e){return we.createIfNeeded(e).fetchJson()};cr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};cr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!c(i))throw new ae("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new ae("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");c(t.extensionsRequired)&&cr.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;c(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=Rfe(this,e,t.root,n);c(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let l=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&l.refine===qo.ADD;let u=l._header.children;if(c(u))for(let f=0;fb.minimumRadius){let C=he.fromCartesian(A,b,_Ke);n=d.normalize(a.positionWC,Mfe),i=a.directionWC,o=a.positionCartographic.height,r=0,s=C.height*2}else{let C=B.multiplyByPoint(y,a.positionWC,bKe);if(n=d.UNIT_Z,i=B.multiplyByPointAsVector(y,a.directionWC,xKe),i=d.normalize(i,i),o=C.z,u instanceof Yl){let S=J.getColumn(x.halfAxes,2,TKe),v=d.magnitude(S);r=A.z-v,s=A.z+v}else if(u instanceof L_){let S=x.radius;r=A.z-S,s=A.z+S}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(s-r)*f,p=s,g=O.clamp((o-h)/(p-h),0,1),m=1-Math.abs(d.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function CKe(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();c(o)&&(o.then(r=>{!c(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{Ffe(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?BKe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function Nfe(e,t){return e._priority-t._priority}cr.prototype.postPassesUpdate=function(e){c(this._root)&&(EKe(this,e),UKe(this,e),this._cache.unloadTiles(this,kfe),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};cr.prototype.prePassesUpdate=function(e){if(!c(this._root))return;OKe(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,c(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;c(n)&&n.enabled&&n.update(e),c(this._loadTimestamp)||(this._loadTimestamp=Q.clone(e.time)),this._timeSinceLoad=Math.max(Q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&AKe(this,e),e.newFrame&&this._cache.reset()};function EKe(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o=1;if(r._contentState!==Xo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function SKe(e){let t=e._requestedTiles;t.sort(Nfe);for(let n=0;n0?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 wKe(e){let t=e._processingQueue,n=0;for(let i=0;i0&&(t[i-n]=o)}t.length-=n}var vKe=new he,DKe=new he,PKe=new d;function IKe(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=he.clone(r.positionCartographic,vKe),l=he.fromCartesian(o.center,s,DKe);c(l)&&(a.height=l.height);let u=he.toCartesian(a,s,PKe);d.distance(u,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{c(r.callback)&&r.callback(),r.invoked=!1}))}}function OKe(e,t){wKe(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let l=0;ls){a=!0;break}let u=n[l];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,Ffe(f,e,u)}}e.totalMemoryUsageInBytes0&&RKe(e)}function RKe(e){dt("increase-screenSpaceError",`The tiles needed to meet maximumScreenSpaceError would use more memory than allocated for this tileset. The tileset will be rendered with a larger screen space error (see memoryAdjustedScreenSpaceError). Consider using larger values for cacheBytes and maximumCacheOverflowBytes.`),e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n0&&(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: ${Lfe(e.content.texturesByteLength)}`,i+=` Geometry Memory: ${Lfe(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` Urls:`;let s=e.content.innerContentUrls;for(let a=0;a0;e._backfaceCommands.length=0,a&&(c(e._stencilClearCommand)||(e._stencilClearCommand=new ei({stencil:0,pass:De.CESIUM_3D_TILE,renderState:Ve.fromCache({stencilMask:kt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:l,tileVisible:u}=e,f=n.isRender,h=i.length;for(let m=0;m=0;--b)i[h+y+b]=i[h+b];for(let b=0;b0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(c(e._tileDebugLabels)||(e._tileDebugLabels=new Om),NKe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Bfe=[];function BKe(e,t){let n=t,i=Bfe;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r{t.push(Tt.clone(i))});let n=e.asset.extras;if(c(n)&&c(n.cesium)&&c(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;oi.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}cr.prototype.getTraversal=function(e){let{pass:t}=e;return t===Uo.MOST_DETAILED_PRELOAD||t===Uo.MOST_DETAILED_PICK?jL:this.isSkippingLevelOfDetail?$L:YL};cr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};cr.prototype.updateForPass=function(e,t){T.typeOf.object("frameState",e),T.typeOf.object("tilesetPassState",t);let n=t.pass;if(n===Uo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Uo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Uo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=Uo.getPassOptions(n),a=s.ignoreCommands,l=t.commandList??i,u=l.length;if(e.commandList=l,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let p=this._environmentMapManager;c(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;c(f)&&f.enabled&&f.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=HKe(this,e,h,s)),a&&(l.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};cr.prototype.hasExtension=function(e){return c(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};cr.prototype.isDestroyed=function(){return!1};cr.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(),c(this._root)){let e=Bfe;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a{let f=le.distanceSquaredTo(l.contentBoundingVolume.boundingSphere,e.origin),h=le.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-h});let a;for(let l=0;l-1;i--)gq(this,e[i],t,n);return de(this)};qy.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new E("entity is required.");if(!c(t))throw new E("result is required.");let n=this._tilesetHash[e.id];if(!c(n)||n.loadFail)return lt.FAILED;let i=n.tilesetPrimitive;return c(i)?i.show?(le.clone(i.boundingSphere,t),lt.DONE):lt.FAILED:lt.PENDING};qy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,l=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],c(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],c(r._tileset)?s.set(r.id,r):(gq(this,r,a,l),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],gq(this,r,a,l),s.remove(r.id)};function gq(e,t,n,i){let o=n[t.id];c(o)&&(c(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function KKe(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await bs.fromUrl(e);if(o.id=n,i.add(o),!c(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var ZL=qy;var $Ke=G.WHITE,ZKe=G.BLACK,QKe=new H(2,2);function BE(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(BE.prototype,{isConstant:{get:function(){return X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:fe("evenColor"),oddColor:fe("oddColor"),repeat:fe("repeat")});BE.prototype.getType=function(e){return"Checkerboard"};var JKe=new Q;BE.prototype.getValue=function(e,t){return c(e)||(e=Q.now(JKe)),c(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,$Ke,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,ZKe,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,QKe),t};BE.prototype.equals=function(e){return this===e||e instanceof BE&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var kE=BE;var Vfe={id:void 0};function QL(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function Cc(e){this._owner=e,this._entities=new Et,this._addedEntities=new Et,this._removedEntities=new Et,this._changedEntities=new Et,this._suspendCount=0,this._collectionChanged=new pe,this._id=jn(),this._show=!0,this._firing=!1,this._refire=!1}Cc.prototype.suspendEvents=function(){this._suspendCount++};Cc.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new E("resumeEvents can not be called before suspendEvents.");this._suspendCount--,QL(this)};Object.defineProperties(Cc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(!c(e))throw new E("value is required.");if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t-1;l--)s=a[l],Hfe(e,p,g,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(qr.prototype._onCollectionChanged,e),a=u.values,g=u.id,l=a.length-1;l>-1;l--){s=a[l],zfe(e,p,g,s);let y=h.getById(s.id);c(y)||(y=f.getById(s.id),c(y)?yq(y):(Qz.id=s.id,y=new nr(Qz)),h.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=h.values;for(r=0;rthis._collections.length)throw new E("index must be less than or equal to the number of collections.")}n?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),Yy(this)};qr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Yy(this),!0):!1};qr.prototype.removeAllCollections=function(){this._collections.length=0,Yy(this)};qr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};qr.prototype.contains=function(e){return this._composite.contains(e)};qr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};qr.prototype.getCollection=function(e){if(!c(e))throw new E("index is required.","index");return this._collections[e]};qr.prototype.getCollectionsLength=function(){return this._collections.length};function Jz(e,t){if(!c(t))throw new E("collection is required.");let n=e.indexOf(t);if(n===-1)throw new E("collection is not in this composite.");return n}function Gfe(e,t,n){let i=e._collections;if(t=O.clamp(t,0,i.length-1),n=O.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,Yy(e)}qr.prototype.raiseCollection=function(e){let t=Jz(this._collections,e);Gfe(this,t,t+1)};qr.prototype.lowerCollection=function(e){let t=Jz(this._collections,e);Gfe(this,t,t-1)};qr.prototype.raiseCollectionToTop=function(e){let t=Jz(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Yy(this))};qr.prototype.lowerCollectionToBottom=function(e){let t=Jz(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Yy(this))};qr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};qr.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new E("resumeEvents can not be called before suspendEvents.");this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Yy(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};qr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};qr.prototype.getById=function(e){return this._composite.getById(e)};qr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,l,u,f=n.length,h=this._eventHash,p=e.id;for(s=0;s=0;a--)l=i[a].getById(y),c(l)&&(c(u)||(u=r.getById(y),yq(u)),u.merge(l));c(u)||r.removeById(y),u=void 0}let g=t.length;for(s=0;s=0;a--)l=i[a].getById(y),c(l)&&(c(u)||(u=r.getById(y),c(u)?yq(u):(Qz.id=y,u=new nr(Qz),r.add(u))),u.merge(l));u=void 0}r.resumeEvents()};qr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,l=r.getById(a),u=l[t],f=!c(u),h=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(c(g)){let m=g[t];if(c(m)){if(h)if(h=!1,c(m.merge)&&c(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&l.propertyNames.indexOf(t)===-1&&l.addProperty(t),l[t]=u};var bq=qr;function xq(){this._removalFunctions=[]}xq.prototype.add=function(e,t,n){if(!c(e))throw new E("event is required");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)}};xq.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Yr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Yr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Yr.prototype.contains=function(e){return this.indexOf(e)>=0};var Tq=new En;Yr.prototype.indexOf=function(e){if(!c(e))throw new E("date is required");let t=this._intervals;Tq.start=e,Tq.stop=e;let n=Lo(t,Tq,Cq);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-10&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i0&&(o=Q.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((c(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(Q.greaterThan(e.stop,n[i-1].stop)?e=new En({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new En({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=Q.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new En({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 En({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(c(t)?t(n[i].data,e.data):n[i].data===e.data)e=new En({start:e.start,stop:Q.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:Q.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new En({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)};Yr.prototype.removeInterval=function(e){if(!c(e))throw new E("interval is required");if(e.isEmpty)return!1;let t=this._intervals,n=Lo(t,e,Cq);n<0&&(n=~n);let i=!1;for(n>0&&(Q.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(Q.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new En({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 En({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),JL[2]=Dd(u)?29:28;a>JL[l]||l>=13;)a>JL[l]&&(a-=JL[l],++l),l>=13&&(--l,u+=Math.floor(l/12),l=l%12,++l),JL[2]=Dd(u)?29:28;return Ec.millisecond=i,Ec.second=o,Ec.minute=r,Ec.hour=s,Ec.day=a,Ec.month=l,Ec.year=u,Q.fromGregorianDate(Ec,n)}var e$e=new Q,t$e=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function jfe(e,t){if(!c(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(t$e);if(!c(n))return!1;if(c(n[1])&&(t.year=Number(n[1].replace(",","."))),c(n[2])&&(t.month=Number(n[2].replace(",","."))),c(n[3])&&(t.day=Number(n[3].replace(",","."))*7),c(n[4])&&(t.day+=Number(n[4].replace(",","."))),c(n[5])&&(t.hour=Number(n[5].replace(",","."))),c(n[6])&&(t.minute=Number(n[6].replace(",","."))),c(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),Q.toGregorianDate(Q.fromIso8601(e,e$e),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var eN=new im;Yr.fromIso8601=function(e,t){if(!c(e))throw new E("options is required.");if(!c(e.iso8601))throw new E("options.iso8601 is required.");let n=e.iso8601.split("/"),i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=[];if(!jfe(n[2],eN))r.push(i,o);else{let s=Q.clone(i);for(r.push(s);Q.compare(s,o)<0;)s=Aq(s,eN),Q.compare(o,s)<=0&&Q.clone(o,s),r.push(s)}return Yr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Yr.fromIso8601DateArray=function(e,t){if(!c(e))throw new E("options is required.");if(!c(e.iso8601Dates))throw new E("options.iso8601Dates is required.");return Yr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return Q.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Yr.fromIso8601DurationArray=function(e,t){if(!c(e))throw new E("options is required.");if(!c(e.epoch))throw new E("options.epoch is required.");if(!c(e.iso8601Durations))throw new E("options.iso8601Durations is required.");let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,l=i.length;for(let u=0;u=0?-a:a}var y$e=new d(-1,0,0),eT=new B,b$e=new B,wq=new J,x$e=J.IDENTITY.clone(),T$e=new d,A$e=new se,Wfe=new d;function U_(e,t,n,i,o,r,s,a){let l=T$e,u=A$e;eT=Ot.eastNorthUpToFixedFrame(e,o,eT),l=B.multiplyByPointAsVector(eT,y$e,l),l=d.normalize(l,l);let f=g$e(l,t,e,o);wq=J.fromRotationZ(f,wq),Wfe.z=r,eT=B.multiplyTransformation(eT,B.fromRotationTranslation(wq,Wfe,b$e),eT);let h=x$e;h[0]=s;for(let p=0;p0){let y=u?2:1;for(let b=0;b=0};var S$e=new d,w$e=new d;tN.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=_$e(e,r),a=i._granularity,l=i._cornerType,u=o?E$e(t,n):qfe(t,n),f=o?qfe(t,n):void 0,h=n.height/2,p=n.width/2,g=e.length,m=[],y=o?[]:void 0,b=a$e,x=c$e,A=l$e,C=u$e,S=f$e,v=d$e,P=h$e,M=m$e,R=p$e,L=e[0],F=e[1];C=r.geodeticSurfaceNormal(L,C),b=d.subtract(F,L,b),b=d.normalize(b,b),M=d.cross(C,b,M),M=d.normalize(M,M);let _=s[0],w=s[1];o&&(y=U_(L,M,f,y,r,_+h,1,1)),R=d.clone(L,R),L=F,x=d.negate(b,x);let D,I;for(let z=1;zPe;p--)Ae=O.PI_OVER_TWO-p*ye,ee[ue++]=1-me*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae));for(p=Pe;p>0;p--)Ae=O.PI_OVER_TWO-ye*p,ee[ue++]=1-Te*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae));for(p=f-b;p>0;p--)ee[ue++]=p*Te,ee[ue++]=1;for(p=1;p0;p--)ee[ue++]=(p-1)*Te,ee[ue++]=1}l.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:ee})}return t.normal&&(l.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:P.normals})),t.tangent&&(l.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:P.tangents})),t.bitangent&&(l.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:P.bitangents})),{attributes:l,indices:V}}function U$e(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,l=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,h=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=ade,m=cde,y=o4,b=r4,x=k$e,A=lde,C=l;for(u=0;u-t?(o=q$e,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),Rq(e,o,i)};Nm.prototype.computeHorizonCullingPoint=function(e,t,n){return wde(this._ellipsoid,e,t,n)};var Ede=ie.clone(ie.UNIT_SPHERE);Nm.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=Sde(this._ellipsoid,n,Ede);return wde(o,e,t,i)};Nm.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return vde(this._ellipsoid,e,t,n,i,o)};Nm.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=Sde(this._ellipsoid,o,Ede);return vde(s,e,t,n,i,r)};var Y$e=[];Nm.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){T.typeOf.object("rectangle",e);let i=ce.subsample(e,t,0,Y$e),o=le.fromPoints(i);if(!(d.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var X$e=new d;function Sde(e,t,n){if(c(t)&&t<0&&e.minimumRadius>-t){let i=d.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,X$e);e=ie.fromCartesian3(i,n)}return e}function wde(e,t,n,i){T.typeOf.object("directionToPoint",t),T.defined("positions",n),c(i)||(i=new d);let o=Ide(e,t),r=0;for(let s=0,a=n.length;s0:s>o&&s*s/d.magnitudeSquared(r)>o)}var K$e=new d,$$e=new d;function Dde(e,t,n){let i=e.transformPositionToScaledSpace(t,K$e),o=d.magnitudeSquared(i),r=Math.sqrt(o),s=d.divideByScalar(i,r,$$e);o=Math.max(1,o),r=Math.max(1,r);let a=d.dot(s,n),l=d.magnitude(d.cross(s,n,s)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(a*u-l*f)}function Pde(e,t,n){if(!(t<=0||t===1/0||t!==t))return d.multiplyByScalar(e,t,n)}var Oq=new d;function Ide(e,t){return d.equals(t,d.ZERO)?t:(e.transformPositionToScaledSpace(t,Oq),d.normalize(Oq,Oq))}var H_=Nm;function Rr(e,t){if(e=e??W.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new E("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new E("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Bt.clone(n)}if(c(i)){if(i.far<=i.near)throw new E("scaleByDistance.far must be greater than scaleByDistance.near.");i=Bt.clone(i)}if(c(o)){if(o.far<=o.near)throw new E("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=Mt.clone(o)}this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._color=G.clone(e.color??G.WHITE),this._outlineColor=G.clone(e.outlineColor??G.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??Vr.NONE}var Ode=Rr.SHOW_INDEX=0,Lde=Rr.POSITION_INDEX=1,Z$e=Rr.COLOR_INDEX=2,Q$e=Rr.OUTLINE_COLOR_INDEX=3,J$e=Rr.OUTLINE_WIDTH_INDEX=4,eZe=Rr.PIXEL_SIZE_INDEX=5,tZe=Rr.SCALE_BY_DISTANCE_INDEX=6,nZe=Rr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,iZe=Rr.DISTANCE_DISPLAY_CONDITION_INDEX=8,oZe=Rr.DISABLE_DEPTH_DISTANCE_INDEX=9,rZe=Rr.SPLIT_DIRECTION_INDEX=10;Rr.NUMBER_OF_PROPERTIES=11;function Fu(e,t){let n=e._pointPrimitiveCollection;c(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Rr.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new E("value is required.");this._show!==e&&(this._show=e,Fu(this,Ode))}},position:{get:function(){return this._position},set:function(e){if(!c(e))throw new E("value is required.");let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),Fu(this,Lde))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new E("far distance must be greater than near distance.");let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),Fu(this,tZe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new E("far distance must be greater than near distance.");let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),Fu(this,nZe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){if(!c(e))throw new E("value is required.");this._pixelSize!==e&&(this._pixelSize=e,Fu(this,eZe))}},color:{get:function(){return this._color},set:function(e){if(!c(e))throw new E("value is required.");let t=this._color;G.equals(t,e)||(G.clone(e,t),Fu(this,Z$e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new E("value is required.");let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),Fu(this,Q$e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!c(e))throw new E("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,Fu(this,J$e))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new E("far must be greater than near");Mt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),Fu(this,iZe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(!c(e)||e<0)throw new E("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,Fu(this,oZe)}}},id:{get:function(){return this._id},set:function(e){this._id=e,c(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,Fu(this,Ode))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Fu(this,rZe))}}});Rr.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Rr.prototype._getActualPosition=function(){return this._actualPosition};Rr.prototype._setActualPosition=function(e){d.clone(e,this._actualPosition),Fu(this,Lde)};var Rde=new se;Rr._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(B.multiplyByPoint(n,e,Rde),Gi.computeActualEllipsoidPosition(t,Rde))};var Mde=new se;Rr._computeScreenSpacePosition=function(e,t,n,i){let o=B.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,Mde),Mde);return Gi.worldToWindowCoordinates(n,o,i)};Rr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;if(c(t)||(t=new H),!c(n))throw new E("PointPrimitive must be in a collection.");if(!c(e))throw new E("scene is required.");let i=n.modelMatrix,o=Rr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(c(o))return o.y=e.canvas.clientHeight-o.y,o};Rr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,l=i;return c(n)||(n=new Ke),n.x=r,n.y=s,n.width=a,n.height=l,n};Rr.prototype.equals=function(e){return this===e||c(e)&&this._id===e._id&&d.equals(this._position,e._position)&&G.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&G.equals(this._outlineColor,e._outlineColor)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Rr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Os=Rr;var Qy=`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; float distanceToCenter = length(gl_PointCoord - vec2(0.5)); 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; #if !defined(OPAQUE) && !defined(TRANSLUCENT) if (color.a < 0.005) { discard; } #else #ifdef OPAQUE if (color.a < 0.995) { discard; } #else if (color.a >= 0.995) { discard; } #endif #endif out_FragColor = czm_gammaCorrect(color); czm_writeLogDepth(); } `;var aN=`uniform float u_maxTotalPointSize; in vec4 positionHighAndSize; in vec4 positionLowAndOutline; in vec4 compressedAttribute0; in vec4 compressedAttribute1; in vec4 scaleByDistance; in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; 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() { vec3 positionHigh = positionHighAndSize.xyz; vec3 positionLow = positionLowAndOutline.xyz; float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; float totalSize = positionHighAndSize.w + outlineWidthBothSides; float outlinePercent = outlineWidthBothSides / totalSize; totalSize *= czm_pixelRatio; float temp = compressedAttribute1.x * SHIFT_RIGHT8; float show = floor(temp); #ifdef EYE_DISTANCE_TRANSLUCENCY vec4 translucencyByDistance; translucencyByDistance.x = compressedAttribute1.z; translucencyByDistance.z = compressedAttribute1.w; translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; temp = compressedAttribute1.y * SHIFT_RIGHT8; translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; #endif vec4 color; vec4 outlineColor; vec4 pickColor; temp = compressedAttribute0.z * SHIFT_RIGHT8; pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; pickColor.r = floor(temp); temp = compressedAttribute0.x * SHIFT_RIGHT8; color.b = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; color.g = (temp - floor(temp)) * SHIFT_LEFT8; color.r = floor(temp); temp = compressedAttribute0.y * SHIFT_RIGHT8; outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; outlineColor.r = floor(temp); temp = compressedAttribute0.w * SHIFT_RIGHT8; pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; pickColor = pickColor / 255.0; temp = floor(temp) * SHIFT_RIGHT8; outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; outlineColor /= 255.0; color.a = floor(temp); color /= 255.0; vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); vec4 positionEC = czm_modelViewRelativeToEye * p; #if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) float lengthSq; if (czm_sceneMode == czm_sceneMode2D) { 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) { totalSize += 3.0; } totalSize = min(totalSize, u_maxTotalPointSize); 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); 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) { 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) { 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))) { 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 sZe=Os.SHOW_INDEX,Nq=Os.POSITION_INDEX,Nde=Os.COLOR_INDEX,aZe=Os.OUTLINE_COLOR_INDEX,cZe=Os.OUTLINE_WIDTH_INDEX,lZe=Os.PIXEL_SIZE_INDEX,Fde=Os.SCALE_BY_DISTANCE_INDEX,Bde=Os.TRANSLUCENCY_BY_DISTANCE_INDEX,kde=Os.DISTANCE_DISPLAY_CONDITION_INDEX,uZe=Os.DISABLE_DEPTH_DISTANCE_INDEX,fZe=Os.SPLIT_DIRECTION_INDEX,Fq=Os.NUMBER_OF_PROPERTIES,wc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function ed(e){e=e??W.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(Fq),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=B.clone(e.modelMatrix??B.IDENTITY),this._modelMatrix=B.clone(B.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??wo.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(ed.prototype,{length:{get:function(){return Bq(this),this._pointPrimitives.length}}});function Ude(e){let t=e.length;for(let n=0;n0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,h=i.splitDirection;c(h)&&(f=h),r(o,s,a,u,f)}function hZe(e,t,n,i){Vde(e,t,n,i),zde(e,t,n,i),Hde(e,t,n,i),Gde(e,t,n,i),jde(e,t,n,i)}function Lq(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let l=0;l0){this._vaf=dZe(l,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v0){let v=_Ze;v.length=0,(r[Nq]||r[cZe]||r[lZe])&&v.push(Vde),(r[Nde]||r[aZe])&&v.push(zde),(r[sZe]||r[Bde])&&v.push(Hde),r[Fde]&&v.push(Gde),(r[kde]||r[uZe]||r[fZe])&&v.push(jde);let P=v.length;if(a=this._vaf.writers,o/n>.1){for(let M=0;Mn*1.5&&(i.length=n),!c(this._vaf)||!c(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,p=B.IDENTITY;e.mode===oe.SCENE3D?(p=this.modelMatrix,h=le.clone(this._baseVolumeWC,this._boundingVolume)):h=le.clone(this._baseVolume2D,this._boundingVolume),pZe(this,e,h);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===wo.OPAQUE||this._blendOption===wo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===wo.TRANSLUCENT||this._blendOption===wo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!1,blending:ln.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,y;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new He({sources:[aN]}),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===wo.OPAQUE_AND_TRANSLUCENT&&(y=new He({defines:["OPAQUE"],sources:[Qy]}),this._sp=Jt.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:wc}),y=new He({defines:["TRANSLUCENT"],sources:[Qy]}),this._spTranslucent=Jt.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:wc})),this._blendOption===wo.OPAQUE&&(y=new He({sources:[Qy]}),this._sp=Jt.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:wc})),this._blendOption===wo.TRANSLUCENT&&(y=new He({sources:[Qy]}),this._spTranslucent=Jt.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:wc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,x,A,C,S=e.commandList;if(u.render||f){let v=this._colorCommands,P=this._blendOption===wo.OPAQUE,M=this._blendOption===wo.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,x=b.length,v.length=x;let R=M?x*2:x;for(C=0;C>4;if(o!==kq)throw new Error(`Got v${o} data when expected v${kq}.`);let r=Wde[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=Wde.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,lN,t),this.coords=new this.ArrayType(this.data,lN+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(lN+s+a+l),this.ids=new this.IndexArrayType(this.data,lN,t),this.coords=new this.ArrayType(this.data,lN+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(kq<<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 Vq(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,l=[0,r.length-1,0],u=[];for(;l.length;){let f=l.pop()||0,h=l.pop()||0,p=l.pop()||0;if(h-p<=a){for(let b=p;b<=h;b++){let x=s[2*b],A=s[2*b+1];x>=t&&x<=i&&A>=n&&A<=o&&u.push(r[b])}continue}let g=p+h>>1,m=s[2*g],y=s[2*g+1];m>=t&&m<=i&&y>=n&&y<=o&&u.push(r[g]),(f===0?t<=m:n<=y)&&(l.push(p),l.push(g-1),l.push(1-f)),(f===0?i>=m:o>=y)&&(l.push(g+1),l.push(h),l.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:s}=this,a=[0,o.length-1,0],l=[],u=i*i;for(;a.length;){let f=a.pop()||0,h=a.pop()||0,p=a.pop()||0;if(h-p<=s){for(let b=p;b<=h;b++)qde(r[2*b],r[2*b+1],t,n)<=u&&l.push(o[b]);continue}let g=p+h>>1,m=r[2*g],y=r[2*g+1];qde(m,y,t,n)<=u&&l.push(o[g]),(f===0?t-i<=m:n-i<=y)&&(a.push(p),a.push(g-1),a.push(1-f)),(f===0?t+i>=m:n+i>=y)&&(a.push(g+1),a.push(h),a.push(1-f))}return l}};function Vq(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;Yde(e,t,s,i,o,r),Vq(e,t,n,i,s-1,1-r),Vq(e,t,n,s+1,o,1-r)}function Yde(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),g=.5*Math.sqrt(h*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),y=Math.min(o,Math.floor(n+(u-f)*p/u+g));Yde(e,t,n,m,y,r)}let s=t[2*n+r],a=i,l=o;for(uN(e,t,i,n),t[2*o+r]>s&&uN(e,t,i,o);as;)l--}t[2*i+r]===s?uN(e,t,i,l):(l++,uN(e,t,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function uN(e,t,n,i){Uq(e,n,i),Uq(t,2*n,2*i),Uq(t,2*n+1,2*i+1)}function Uq(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function qde(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function Th(e){e=e??W.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 pe,this.show=e.show??!0}function Xde(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var gZe=new Ke;function Kde(e,t,n,i,o){if(c(e._labelCollection)&&i._clusterLabels?o=Uy.getScreenSpaceBoundingBox(e,t,o):c(e._billboardCollection)&&i._clusterBillboards?o=lo.getScreenSpaceBoundingBox(e,t,o):c(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Os.getScreenSpaceBoundingBox(e,t,o)),Xde(o,n),i._clusterLabels&&!c(e._labelCollection)&&c(e.id)&&Zde(i,e.id.id)&&c(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Uy.getScreenSpaceBoundingBox(s,t,gZe);Xde(a,n),o=Ke.union(o,a,o)}return o}function yZe(e,t){if(e.clusterShow=!0,!c(e._labelCollection)&&c(e.id)&&Zde(t,e.id.id)&&c(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function $de(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 Zde(e,t){return c(e)&&c(e._collectionIndicesByEntity[t])&&c(e._collectionIndicesByEntity[t].labelIndex)}function zq(e,t,n,i,o){if(!c(e))return;let r=e.length;for(let s=0;s0){let N=new fN(A.length,64,Uint32Array);for(let k=0;k=f)for($de(k.position,w,_,e),p.push(k),S=0;S=f){let U=d.multiplyByScalar(j,1/w,j);for($de(U,w,_,e),p.push({position:U,width:V.width,height:V.height,minimumWidth:P.width,minimumHeight:P.height}),S=0;S0?(a=u.shift(),l=r.get(a)):(l=r.add(),a=r.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),l}}function jq(e,t){let n=e._collectionIndicesByEntity[t];!c(n.billboardIndex)&&!c(n.labelIndex)&&!c(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Th.prototype.getLabel=Gq("_labelCollection",Om,"_unusedLabelIndices","labelIndex");Th.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._labelCollection)||!c(t)||!c(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,jq(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};Th.prototype.getBillboard=Gq("_billboardCollection",Ru,"_unusedBillboardIndices","billboardIndex");Th.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._billboardCollection)||!c(t)||!c(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,jq(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};Th.prototype.getPoint=Gq("_pointCollection",WE,"_unusedPointIndices","pointIndex");Th.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._pointCollection)||!c(t)||!c(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,jq(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function Hq(e){if(!c(e))return;let t=e.length;for(let n=0;n0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;c(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,CZe(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=c(n)&&!n.ready||c(i)&&!i.ready),c(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),c(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),c(this._clusterPointCollection)&&this._clusterPointCollection.update(e),c(n)&&n.update(e),c(i)&&i.update(e),c(this._pointCollection)&&this._pointCollection.update(e)};Th.prototype.destroy=function(){c(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 Bu=Th;function Wq(e){this._name=e,this._clock=void 0,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._entityCollection=new Qs(this),this._entityCluster=new Bu}Object.defineProperties(Wq.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){Kr.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){if(!c(e))throw new E("value must be defined.");this._entityCluster=e}}});Wq.prototype.update=function(e){return!0};var dN=Wq;var Qde={};Qde.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,l=o?2*a:a,u=new Float64Array(l*3),f,h=0,p=0,g=o?a*3:0,m=o?(a+i)*3:i*3;for(f=0;f0){let y=Math.min(r,o);u=Math.round(o/y),l+=y}let f=Fe.createTypedArray(s,l*2),h=0,p;for(p=0;p0)for(p=0;p0){for(l=0;l=t;i--)e[i]=e[a--]}for(i=0;i=0||c(h)&&Q.compare(f,h)>=0));){for(e7[p++]=f,r=r+1,s=0;s0&&(t7.length=g,rhe(n,u,t7),e7.length=p,rhe(t,l,e7))}else{for(s=0;so)return;if(this._backwardExtrapolationType===cl.HOLD)return r.unpack(s,0,t);l=this._backwardExtrapolationType===cl.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let P=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===cl.NONE||o!==0&&Q.secondsDifference(e,P)>o)return;if(this._forwardExtrapolationType===cl.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t);l=this._forwardExtrapolationType===cl.LINEAR_EXTRAPOLATE}let h=this._xTable,p=this._yTable;var u,f;l?(u=Cesium.LinearApproximation,f=1):(u=this._interpolationAlgorithm,f=this._interpolationDegree),this._lastInterpolationAlgorithm!=u&&(this._lastInterpolationAlgorithm=u,this._updateTableLength=!0);let g=this._packedInterpolationLength,m=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let P=Math.min(u.getRequiredDataPoints(f,m),i);P!==this._numberOfPoints&&(this._numberOfPoints=P,h.length=P,p.length=P*g)}let y=this._numberOfPoints-1;if(y<1)return;let b=0,x=i-1;if(x-b+1>=y+1){let P=a-(y/2|0)-1;Px&&(M=x,P=M-y,P0){n=new Array(t);for(let i=0;i0&&(!c(n)||n.length!==i))throw new E("derivatives length must be equal to the number of derivatives.");this._property.addSample(e,t,n)};id.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};id.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};id.prototype.removeSample=function(e){return this._property.removeSample(e)};id.prototype.removeSamples=function(e){this._property.removeSamples(e)};id.prototype.equals=function(e){return this===e||e instanceof id&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var Ta=id;var lQe={HORIZONTAL:0,VERTICAL:1},Eh=Object.freeze(lQe);var uQe=Eh.HORIZONTAL,fQe=G.WHITE,dQe=G.BLACK,hQe=0,mQe=1;function rS(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(rS.prototype,{isConstant:{get:function(){return X.isConstant(this._orientation)&&X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._offset)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:fe("orientation"),evenColor:fe("evenColor"),oddColor:fe("oddColor"),offset:fe("offset"),repeat:fe("repeat")});rS.prototype.getType=function(e){return"Stripe"};var pQe=new Q;rS.prototype.getValue=function(e,t){return c(e)||(e=Q.now(pQe)),c(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,uQe)===Eh.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,fQe,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,dQe,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,hQe),t.repeat=X.getValueOrDefault(this._repeat,e,mQe),t};rS.prototype.equals=function(e){return this===e||e instanceof rS&&X.equals(this._orientation,e._orientation)&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._offset,e._offset)&&X.equals(this._repeat,e._repeat)};var sS=rS;function n0(e){this._definitionChanged=new pe,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(n0.prototype._intervalsChanged,this),this._referenceFrame=e??Hi.FIXED}Object.defineProperties(n0.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 _Qe=new Q;n0.prototype.getValue=function(e,t){return c(e)||(e=Q.now(_Qe)),this.getValueInReferenceFrame(e,Hi.FIXED,t)};n0.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new E("time is required.");if(!c(t))throw new E("referenceFrame is required.");let i=this._intervals.findDataForIntervalContainingDate(e);if(c(i))return zd.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};n0.prototype.equals=function(e){return this===e||e instanceof n0&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};n0.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var X_=n0;function sT(){this._definitionChanged=new pe,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(sT.prototype._intervalsChanged,this)}Object.defineProperties(sT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var gQe=new Q;sT.prototype.getValue=function(e,t){c(e)||(e=Q.now(gQe));let n=this._intervals.findDataForIntervalContainingDate(e);return c(n)&&typeof n.clone=="function"?n.clone(t):n};sT.prototype.equals=function(e){return this===e||e instanceof sT&&this._intervals.equals(e._intervals,X.equals)};sT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var K_=sT;function aS(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new pe,this._normalize=t??!0,this.position=e}Object.defineProperties(aS.prototype,{isConstant:{get:function(){return X.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(c(t)&&this._subscription(),this._position=e,c(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 yQe=new d,che=new d,lhe=new Q,bQe=new Q,n7=1/60;aS.prototype.getValue=function(e,t){return this._getValue(e,t)};aS.prototype._getValue=function(e,t,n){c(e)||(e=Q.now(bQe)),c(t)||(t=new d);let i=this._position;if(X.isConstant(i))return this._normalize?void 0:d.clone(d.ZERO,t);let o=i.getValue(e,yQe),r=i.getValue(Q.addSeconds(e,n7,lhe),che);if(!c(o)||!c(r)&&(r=o,o=i.getValue(Q.addSeconds(e,-n7,lhe),che),!c(o)))return;if(d.equals(o,r))return this._normalize?void 0:d.clone(d.ZERO,t);c(n)&&o.clone(n);let s=d.subtract(r,o,t);return this._normalize?d.normalize(s,t):d.divideByScalar(s,n7,t)};aS.prototype.equals=function(e){return this===e||e instanceof aS&&X.equals(this._position,e._position)};var $_=aS;function bN(e,t){this._velocityVectorProperty=new $_(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new pe,this.ellipsoid=t??ie.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(bN.prototype,{isConstant:{get:function(){return X.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 uhe=new d,xQe=new d,fhe=new J,TQe=new Q;bN.prototype.getValue=function(e,t){c(e)||(e=Q.now(TQe));let n=this._velocityVectorProperty._getValue(e,xQe,uhe);if(c(n))return Ot.rotationMatrixFromPositionVelocity(uhe,n,this._ellipsoid,fhe),Le.fromRotationMatrix(fhe,t)};bN.prototype.equals=function(e){return this===e||e instanceof bN&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var xN=bN;var Z_={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Z_.validate=function(e){return e===Z_.COMPLETE||e===Z_.BELOW_ELLIPSOID_HORIZON||e===Z_.ABOVE_ELLIPSOID_HORIZON};Z_.toString=function(e){switch(e){case Z_.COMPLETE:return"COMPLETE";case Z_.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Z_.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new E("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var cS=Z_;function i0(){}i0.packedLength=d.packedLength;i0.unpack=d.unpack;i0.pack=d.pack;var i7;function TN(e,t){return t[0]==="#"&&(t=i7+t),Y_.fromString(e,t)}function dhe(e,t,n){if(c(n.reference))return TN(t,n.reference);if(c(n.velocityReference)){let i=TN(t,n.velocityReference);switch(e){case d:case i0:return new $_(i,e===i0);case Le:return new xN(i)}}throw new ae(`${JSON.stringify(n)} is not valid CZML.`)}function AQe(e,t){return new Wd(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var qi=new d,ll=new yN,Dc=new he,aT=new En,f4=new Le;function CQe(e){let t=e.rgbaf;if(c(t))return t;let n=e.rgba;if(!c(n))return;let i=n.length;if(i===G.packedLength)return[G.byteToFloat(n[0]),G.byteToFloat(n[1]),G.byteToFloat(n[2]),G.byteToFloat(n[3])];t=new Array(i);for(let o=0;ol&&e!==Object}let m=typeof e.unpack=="function"&&e!==td;if(!g&&!p){h?t[n]=new Kn(m?e.unpack(u,0):u):t[n]=dhe(e,s,i);return}let y=t[n],b,x=i.epoch;if(c(x)&&(b=Q.fromIso8601(x)),g&&!p){y instanceof Vu||(t[n]=y=new Vu(e)),y.addSamplesPackedArray(u,b),d4(i,y);return}let A;if(!g&&p){a=a.clone(),h?a.data=m?e.unpack(u,0):u:a.data=dhe(e,s,i),c(y)||(t[n]=y=h?new K_:new Sc),h&&y instanceof K_?y.intervals.addInterval(a):y instanceof Sc?(h&&(a.data=new Kn(a.data)),y.intervals.addInterval(a)):(t[n]=y=yhe(y),h&&(a.data=new Kn(a.data)),y.intervals.addInterval(a));return}c(y)||(t[n]=y=new Sc),y instanceof Sc||(t[n]=y=yhe(y));let C=y.intervals;A=C.findInterval(a),(!c(A)||!(A.data instanceof Vu))&&(A=a.clone(),A.data=new Vu(e),C.addInterval(A)),A.data.addSamplesPackedArray(u,b),d4(i,A.data)}function Ihe(e,t){if(e instanceof Vu){e.removeSamples(t);return}else if(e instanceof K_){e.intervals.removeInterval(t);return}else if(e instanceof Sc){let n=e.intervals;for(let i=0;il),!m&&!p){h?e[t]=new qc(d.unpack(u),g):e[t]=TN(r,n.reference);return}let y=e[t],b,x=n.epoch;if(c(x)&&(b=Q.fromIso8601(x)),m&&!p){(!(y instanceof Ta)||c(g)&&y.referenceFrame!==g)&&(e[t]=y=new Ta(g,a)),y.addSamplesPackedArray(u,b),d4(n,y);return}let A;if(!m&&p){s=s.clone(),h?s.data=d.unpack(u):s.data=TN(r,n.reference),c(y)||(h?y=new X_(g):y=new ba(g),e[t]=y),h&&y instanceof X_&&c(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof ba?(h&&(s.data=new qc(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=bhe(y),h&&(s.data=new qc(s.data,g)),y.intervals.addInterval(s));return}c(y)?y instanceof ba||(e[t]=y=bhe(y)):e[t]=y=new ba(g);let C=y.intervals;A=C.findInterval(s),(!c(A)||!(A.data instanceof Ta)||c(g)&&A.data.referenceFrame!==g)&&(A=s.clone(),A.data=new Ta(g,a),C.addInterval(A)),A.data.addSamplesPackedArray(u,b),d4(n,A.data)}function Ohe(e,t){if(e instanceof Ta){e.removeSamples(t);return}else if(e instanceof X_){e.intervals.removeInterval(t);return}else if(e instanceof ba){let n=e.intervals;for(let i=0;i. version format.");let i=t._documentPacket;c(e.name)&&(i.name=e.name);let o=e.clock;if(c(o)){let r=i.clock;c(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 ZQe(e,t,n,i){let o=t.ellipse;if(!c(o))return;let r=yr(o.interval),s=e.ellipse;c(s)||(e.ellipse=s=new jb),be(Boolean,s,"show",o.show,r,i,n),be(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),be(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),be(Number,s,"height",o.height,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),be(We,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),be(td,s,"rotation",o.rotation,r,i,n),be(td,s,"stRotation",o.stRotation,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n)}function QQe(e,t,n,i){let o=t.ellipsoid;if(!c(o))return;let r=yr(o.interval),s=e.ellipsoid;c(s)||(e.ellipsoid=s=new Wb),be(Boolean,s,"show",o.show,r,i,n),be(d,s,"radii",o.radii,r,i,n),be(d,s,"innerRadii",o.innerRadii,r,i,n),be(Number,s,"minimumClock",o.minimumClock,r,i,n),be(Number,s,"maximumClock",o.maximumClock,r,i,n),be(Number,s,"minimumCone",o.minimumCone,r,i,n),be(Number,s,"maximumCone",o.maximumCone,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"stackPartitions",o.stackPartitions,r,i,n),be(Number,s,"slicePartitions",o.slicePartitions,r,i,n),be(Number,s,"subdivisions",o.subdivisions,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function JQe(e,t,n,i){let o=t.label;if(!c(o))return;let r=yr(o.interval),s=e.label;c(s)||(e.label=s=new Hd),be(Boolean,s,"show",o.show,r,i,n),be(String,s,"text",o.text,r,i,n),be(String,s,"font",o.font,r,i,n),be(Yo,s,"style",o.style,r,i,n),be(Number,s,"scale",o.scale,r,i,n),be(Boolean,s,"showBackground",o.showBackground,r,i,n),be(G,s,"backgroundColor",o.backgroundColor,r,i,n),be(H,s,"backgroundPadding",o.backgroundPadding,r,i,n),be(H,s,"pixelOffset",o.pixelOffset,r,i,n),be(d,s,"eyeOffset",o.eyeOffset,r,i,n),be(bi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),be(Fn,s,"verticalOrigin",o.verticalOrigin,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(G,s,"fillColor",o.fillColor,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),be(Bt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),be(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function eJe(e,t,n,i){let o=t.model;if(!c(o))return;let r=yr(o.interval),s=e.model;c(s)||(e.model=s=new Gp),be(Boolean,s,"show",o.show,r,i,n),be(CN.default,s,"uri",o.gltf,r,i,n),be(Number,s,"scale",o.scale,r,i,n),be(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),be(Number,s,"maximumScale",o.maximumScale,r,i,n),be(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),be(Boolean,s,"runAnimations",o.runAnimations,r,i,n),be(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(G,s,"silhouetteColor",o.silhouetteColor,r,i,n),be(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),be(G,s,"color",o.color,r,i,n),be(bc,s,"colorBlendMode",o.colorBlendMode,r,i,n),be(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,l,u=o.nodeTransformations;if(c(u))if(Array.isArray(u))for(a=0,l=u.length;a-1;l--)n[l](s,e,t,i)}i7=void 0}function uJe(e){let t,n=e._documentPacket.clock;if(!c(n)){if(!c(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Ge.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=Q.secondsDifference(s,r),l=Math.round(a/120);return t=new Ch,t.startTime=Q.clone(r),t.stopTime=Q.clone(s),t.clockRange=$r.LOOP_STOP,t.multiplier=l,t.currentTime=Q.clone(r),t.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}c(e._clock)?t=e._clock.clone():(t=new Ch,t.startTime=Ge.MINIMUM_VALUE.clone(),t.stopTime=Ge.MAXIMUM_VALUE.clone(),t.currentTime=Ge.MINIMUM_VALUE.clone(),t.clockRange=$r.LOOP_STOP,t.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=yr(n.interval);return c(i)&&(t.startTime=i.start,t.stopTime=i.stop),c(n.currentTime)&&(t.currentTime=Q.fromIso8601(n.currentTime)),c(n.range)&&(t.clockRange=$r[n.range]??$r.LOOP_STOP),c(n.step)&&(t.clockStep=mo[n.step]??mo.SYSTEM_CLOCK_MULTIPLIER),c(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Mhe(e,t,n,i){if(!c(t))throw new E("czml is required.");n=n??W.EMPTY_OBJECT;let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Tt(s)),e._credit=s,typeof t=="string"||t instanceof we){t=we.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let a=e._resourceCredits,l=t.credits;if(c(l)){let u=l.length;for(let f=0;fthis._primitives.length)throw new E("index must be less than or equal to the number of primitives.")}let i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._primitiveAdded.raiseEvent(e),e};Aa.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};Aa.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};Aa.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n1;--_){if(x=O.PI_OVER_TWO-(_-1)*b,v=uS(-x,r,m,g,l,f,u,h,p,v),P=uS(x+Math.PI,r,m,g,l,f,u,h,p,P),t){for(C[S++]=v.x,C[S++]=v.y,C[S++]=v.z,D=2*(_-1)+2,w=1;w1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;aO.PI&&(h.north=h.north>0?O.PI_OVER_TWO-O.EPSILON7:h.north,h.south=h.south<0?O.EPSILON7-O.PI_OVER_TWO:h.south,h.east=O.PI,h.west=-O.PI),h}function km(e){e=e??W.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ie.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??O.RADIANS_PER_DEGREE,s=e.vertexFormat??Ie.DEFAULT;if(T.defined("options.center",t),T.typeOf.number("options.semiMajorAxis",i),T.typeOf.number("options.semiMinorAxis",o),i0){let m=Math.min(u,l);g=Math.round(l/m);let y=Math.min(g*u,l);for(p=0;p0&&(S=!0,x+=l-1),s0&&f!==y-1&&h!==0&&h!==b-1&&(F[Y]=!0),Y++;p=0;let te,K;for(f=1;f=$e&&f<$e+b*2?un=d.UNIT_X:un=d.UNIT_Z,d.cross(un,Dt,jt),d.normalize(jt,jt),a.tangent&&(N[ye++]=jt.x,N[ye++]=jt.y,N[ye++]=jt.z),a.bitangent){let zt=d.cross(Dt,jt,DJe);d.normalize(zt,zt),k[Ae++]=zt.x,k[Ae++]=zt.y,k[Ae++]=zt.z}}}a.st&&(me.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:z})),a.normal&&(me.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(me.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:N})),a.bitangent&&(me.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:k}))}if(c(e._offsetAttribute)){let it=R.length,Dt=e._offsetAttribute===Zt.NONE?0:1,jt=new Uint8Array(it/3).fill(Dt);me.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:jt})}return new ct({attributes:me,indices:D,primitiveType:Me.TRIANGLES,boundingSphere:le.fromEllipsoid(ze),offsetAttribute:e._offsetAttribute})};var f7;J_.getUnitEllipsoid=function(){return c(f7)||(f7=J_.createGeometry(new J_({radii:new d(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),f7};var Js=J_;var OJe=new Ut(G.WHITE),d7=d.ZERO,h7=new d,RJe=new d,MJe=new d,m7=new G,LJe=new d(1,1,1);function NJe(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 Gu(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new NJe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}c(Object.create)&&(Gu.prototype=Object.create(ii.prototype),Gu.prototype.constructor=Gu);Object.defineProperties(Gu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Gu.prototype.createFillGeometryInstance=function(e,t,n){T.defined("time",e);let i=this._entity,o=i.isAvailable(e),r,s=new bn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),l=kn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:l,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let f;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,m7)),c(f)||(f=G.WHITE),r=Gt.fromColor(f),u.color=r}return c(this._options.offsetAttribute)&&(u.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,d7,h7))),new St({id:i,geometry:new Js(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};Gu.prototype.createOutlineGeometryInstance=function(e,t,n){T.defined("time",e);let i=this._entity,o=i.isAvailable(e),r=X.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,m7),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new bn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(r),distanceDisplayCondition:kn.fromDistanceDisplayCondition(s),offset:void 0};return c(this._options.offsetAttribute)&&(a.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,d7,h7))),new St({id:i,geometry:new Nu(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Gu.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Gu.prototype._isHidden=function(e,t){return!c(e.position)||!c(t.radii)||ii.prototype._isHidden.call(this,e,t)};Gu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.radii.isConstant||!X.isConstant(t.innerRadii)||!X.isConstant(t.stackPartitions)||!X.isConstant(t.slicePartitions)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.minimumClock)||!X.isConstant(t.maximumClock)||!X.isConstant(t.minimumCone)||!X.isConstant(t.maximumCone)||!X.isConstant(t.subdivisions)};Gu.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ge.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,Ge.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,Ge.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,Ge.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,Ge.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,Ge.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,Ge.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?Zt.ALL:void 0};Gu.prototype._onEntityPropertyChanged=qp;Gu.DynamicGeometryUpdater=PN;function PN(e,t,n){ni.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new B,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={}}c(Object.create)&&(PN.prototype=Object.create(ni.prototype),PN.prototype.constructor=PN);PN.prototype.update=function(e){T.defined("time",e);let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!X.getValueOrDefault(n.show,e,!0)){c(this._primitive)&&(this._primitive.show=!1),c(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=X.getValueOrUndefined(n.radii,e,RJe),o=c(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!c(o)||!c(i)){c(this._primitive)&&(this._primitive.show=!1),c(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=X.getValueOrDefault(n.fill,e,!0),s=X.getValueOrDefault(n.outline,e,!1),a=X.getValueOrClonedDefault(n.outlineColor,e,G.BLACK,m7),l=tr.getValue(e,n.material??OJe,this._material),u=X.getValueOrUndefined(n.innerRadii,e,MJe),f=X.getValueOrUndefined(n.minimumClock,e),h=X.getValueOrUndefined(n.maximumClock,e),p=X.getValueOrUndefined(n.minimumCone,e),g=X.getValueOrUndefined(n.maximumCone,e),m=X.getValueOrUndefined(n.stackPartitions,e),y=X.getValueOrUndefined(n.slicePartitions,e),b=X.getValueOrUndefined(n.subdivisions,e),x=X.getValueOrDefault(n.outlineWidth,e,1),A=X.getValueOrDefault(n.heightReference,e,We.NONE),C=A!==We.NONE?Zt.ALL:void 0,S=this._scene.mode,v=S===oe.SCENE3D&&A===We.NONE,P=this._options,M=this._geometryUpdater.shadowsProperty.getValue(e),L=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),F=X.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,d7,h7);if(!v||this._lastSceneMode!==S||!c(this._primitive)||P.stackPartitions!==m||P.slicePartitions!==y||c(u)&&!d.equals(P.innerRadii!==u)||P.minimumClock!==f||P.maximumClock!==h||P.minimumCone!==p||P.maximumCone!==g||P.subdivisions!==b||this._lastOutlineWidth!==x||P.offsetAttribute!==C){let w=this._primitives;w.removeAndDestroy(this._primitive),w.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=S,this._lastOutlineWidth=x,P.stackPartitions=m,P.slicePartitions=y,P.subdivisions=b,P.offsetAttribute=C,P.radii=d.clone(v?LJe:i,P.radii),c(u)?v?P.innerRadii=d.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,P.innerRadii):P.innerRadii=d.clone(u,P.innerRadii):P.innerRadii=void 0,P.minimumClock=f,P.maximumClock=h,P.minimumCone=p,P.maximumCone=g;let D=new ao({material:l,translucent:l.isTranslucent(),closed:!0});P.vertexFormat=D.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=w.add(new Pn({geometryInstances:I,appearance:D,asynchronous:!1,shadows:M}));let N=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=w.add(new Pn({geometryInstances:N,appearance:new rn({flat:!0,translucent:N.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(x)}}),asynchronous:!1,shadows:M})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=G.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=L,this._lastOffset=d.clone(F,this._lastOffset)}else if(this._primitive.ready){let w=this._primitive,D=this._outlinePrimitive;w.show=!0,D.show=!0,w.appearance.material=l;let I=this._attributes;c(I)||(I=w.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=bn.toValue(r,I.show),this._lastShow=r);let N=this._outlineAttributes;c(N)||(N=D.getGeometryInstanceAttributes(t),this._outlineAttributes=N),s!==this._lastOutlineShow&&(N.show=bn.toValue(s,N.show),this._lastOutlineShow=s),G.equals(a,this._lastOutlineColor)||(N.color=Gt.toValue(a,N.color),G.clone(a,this._lastOutlineColor)),Mt.equals(L,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=kn.toValue(L,I.distanceDisplayCondition),N.distanceDisplayCondition=kn.toValue(L,N.distanceDisplayCondition),Mt.clone(L,this._lastDistanceDisplayCondition)),d.equals(F,this._lastOffset)||(I.offset=eo.toValue(F,I.offset),N.offset=eo.toValue(F,I.offset),d.clone(F,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=B.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var IN=Gu;function mS(e){e=e??W.EMPTY_OBJECT;let t=e.vertexFormat??Ie.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}mS.packedLength=Ie.packedLength;mS.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,Ie.pack(e._vertexFormat,t,n),t};var hme=new Ie,FJe={vertexFormat:hme};mS.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=Ie.unpack(e,t,hme);return c(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n):new mS(FJe)};var C4=new d(-.5,-.5,0),E4=new d(.5,.5,0);mS.createGeometry=function(e){let t=e._vertexFormat,n=new fn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=C4.x,o[1]=C4.y,o[2]=0,o[3]=E4.x,o[4]=C4.y,o[5]=0,o[6]=E4.x,o[7]=E4.y,o[8]=0,o[9]=C4.x,o[10]=E4.y,o[11]=0,n.position=new ve({componentDatatype:$.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 ve({componentDatatype:$.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 ve({componentDatatype:$.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 ve({componentDatatype:$.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 ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new ct({attributes:n,indices:i,primitiveType:Me.TRIANGLES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var ON=mS;function pS(){this._workerName="createPlaneOutlineGeometry"}pS.packedLength=0;pS.pack=function(e,t){return T.defined("value",e),T.defined("array",t),t};pS.unpack=function(e,t,n){return T.defined("array",e),c(n)?n:new pS};var r0=new d(-.5,-.5,0),S4=new d(.5,.5,0);pS.createGeometry=function(){let e=new fn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=r0.x,n[1]=r0.y,n[2]=r0.z,n[3]=S4.x,n[4]=r0.y,n[5]=r0.z,n[6]=S4.x,n[7]=S4.y,n[8]=r0.z,n[9]=r0.x,n[10]=S4.y,n[11]=r0.z,e.position=new ve({componentDatatype:$.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 ct({attributes:e,indices:t,primitiveType:Me.LINES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var RN=pS;var BJe=new d,mme=new G;function kJe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function od(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new kJe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}c(Object.create)&&(od.prototype=Object.create(ii.prototype),od.prototype.constructor=od);od.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new E("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let g;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,mme)),c(g)||(g=G.WHITE),o=Gt.fromColor(g),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let l=t.plane,u=this._options,f=t.computeModelMatrix(e),h=X.getValueOrDefault(l.plane,e,u.plane),p=X.getValueOrUndefined(l.dimensions,e,u.dimensions);return u.plane=h,u.dimensions=p,f=p7(h,p,f,f),new St({id:t,geometry:new ON(this._options),modelMatrix:f,attributes:i})};od.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new E("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,mme),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),l=X.getValueOrDefault(r.plane,e,s.plane),u=X.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=l,s.dimensions=u,a=p7(l,u,a,a),new St({id:t,geometry:new RN,modelMatrix:a,attributes:{show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};od.prototype._isHidden=function(e,t){return!c(t.plane)||!c(t.dimensions)||!c(e.position)||ii.prototype._isHidden.call(this,e,t)};od.prototype._getIsClosed=function(e){return!1};od.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};od.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?rn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ge.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions)};od.DynamicGeometryUpdater=_S;function _S(e,t,n){ni.call(this,e,t,n)}c(Object.create)&&(_S.prototype=Object.create(ni.prototype),_S.prototype.constructor=_S);_S.prototype._isHidden=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(e.position,n,BJe);return!c(o)||!c(i.plane)||!c(i.dimensions)||ni.prototype._isHidden.call(this,e,t,n)};_S.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=X.getValueOrDefault(t.plane,n,i.plane),i.dimensions=X.getValueOrUndefined(t.dimensions,n,i.dimensions)};var UJe=new d,VJe=new d,zJe=new d,HJe=new d,GJe=new J,jJe=new J,WJe=new B;function p7(e,t,n,i){let o=e.normal,r=e.distance,s=d.multiplyByScalar(o,-r,zJe),a=d.clone(d.UNIT_Z,VJe);O.equalsEpsilon(Math.abs(d.dot(a,o)),1,O.EPSILON8)&&(a=d.clone(d.UNIT_Y,a));let l=d.cross(a,o,UJe);a=d.cross(o,l,a),d.normalize(l,l),d.normalize(a,a);let u=GJe;J.setColumn(u,0,l,u),J.setColumn(u,1,a,u),J.setColumn(u,2,o,u);let f=d.fromElements(t.x,t.y,1,HJe),h=J.multiplyByScale(u,f,jJe),p=B.fromRotationTranslation(h,s,WJe);return B.multiplyTransformation(n,p,i)}od.createPrimitiveMatrix=p7;var MN=od;var qJe=new d,YJe=new Ke,XJe=new H,KJe=new H,$Je=new d,ZJe=new d,QJe=new d,LN=new d,JJe=new d,eet=new d,pme=new Le,tet=new J,net=new J,iet=new d;function oet(e,t,n,i,o,r,s,a,l){let u=e.positions,f=si.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let h=Fe.createTypedArray(u.length,f.length);h.set(f);let p=tet;if(i!==0){let _=Le.fromAxisAngle(s,i,pme);if(p=J.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,pme);let w=J.fromQuaternion(_,net);a=d.normalize(J.multiplyByVector(w,a,a),a),t.bitangent&&(l=d.normalize(d.cross(s,a,l),l))}}else p=J.clone(J.IDENTITY,p);let g=KJe;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,y=m*3,b=new Float64Array(y),x=t.normal?new Float32Array(y):void 0,A=t.tangent?new Float32Array(y):void 0,C=t.bitangent?new Float32Array(y):void 0,S=t.st?new Float32Array(m*2):void 0,v=0,P=0,M=0,R=0,L=0;for(let _=0;_1||v>1))for(let w=0;w0;f-=u)Ae=f*3,q=bS(q,ee,Ae,p,b),ee+=6,o.st&&(K=xS(K,me,f*2,v),me+=4),n&&(Te+=3,Y[Te++]=P[Ae],Y[Te++]=P[Ae+1],Y[Te++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);if(D){let $e=ye;for(Ae=$e*3,f=0;f<2;f++)q=bS(q,ee,Ae,p,b),ee+=6,o.st&&(K=xS(K,me,$e*2,v),me+=4),n&&(Te+=3,Y[Te++]=P[Ae],Y[Te++]=P[Ae+1],Y[Te++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1)}else for(f=u-1;f>=0;f--)Ae=f*3,q=bS(q,ee,Ae,p,b),ee+=6,o.st&&(K=xS(K,me,f*2,v),me+=4),n&&(Te+=3,Y[Te++]=P[Ae],Y[Te++]=P[Ae+1],Y[Te++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);let Pe=wet(q,o,a);o.st&&(Pe.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:K})),n&&(Pe.attributes.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:Y})),R&&(Pe.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Ee=Fe.createTypedArray(U,z*6),ze,qe,it,Dt;g=q.length/3;let jt=0;for(f=0;f0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(yT.prototype._onEntityPropertyChanged,this)}yT.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r0){c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let l;c(this.depthFailAppearanceType)&&(c(this.depthFailMaterialProperty)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),l=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new Pn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:l,shadows:this.shadows}),o.add(i),t=!1}else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),c(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}CS.prototype.remove=function(e){Qme(this._solidItems,e)||Qme(this._translucentItems,e)};function Jme(e,t,n){let i=!1,o=t.length;for(let r=0;r0)for(r=0;r=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,l=a.length;for(let u=0;u0){c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=tr.getValue(e,this.materialProperty,this.material);let a;c(this.depthFailMaterialProperty)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new Pn({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=tr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,c(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};ES.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let l=0;l0)c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new jc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};SS.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o0)c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=tr.getValue(e,this.materialProperty,this.material),n=new jc({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=tr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};vS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let l=0;l0)c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Pn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new rn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r0)for(h=!0,t=0;t0)for(h=!0,t=0;t-1;a--)l=s[a],u=l.id,f=this._updaterSets.get(u),f.entity===l?f.forEach(function(y){h._removeUpdater(y),h._insertUpdaterIntoBatch(e,y)}):(o.push(l),n.push(l));for(a=o.length-1;a>-1;a--)l=o[a],u=l.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(a=n.length-1;a>-1;a--)l=n[a],u=l.id,f=new bT(l,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){h._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Zl._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,m=g.length;for(a=0;a-1;s--)l=n[s],a=l.id,i.remove(a)||(o.set(a,l),r.remove(a));for(s=t.length-1;s>-1;s--)l=t[s],a=l.id,o.remove(a)?r.set(a,l):i.set(a,l)};var QN=Zl;var Att=1,Ctt="30px sans-serif",Ett=Yo.FILL,Stt=G.WHITE,wtt=G.BLACK,vtt=1,Dtt=!1,Ptt=new G(.165,.165,.165,.8),Itt=new H(7,5),Ott=H.ZERO,Rtt=d.ZERO,Mtt=We.NONE,Ltt=bi.CENTER,Ntt=Fn.CENTER,Ftt=new d,Btt=new G,ktt=new G,Utt=new G,Vtt=new H,ztt=new d,Htt=new H,Gtt=new Bt,jtt=new Bt,Wtt=new Bt,qtt=new Mt;function ope(e){this.entity=e,this.label=void 0,this.index=void 0}function a0(e,t){if(!c(e))throw new E("entityCluster is required.");if(!c(t))throw new E("entityCollection is required.");t.collectionChanged.addEventListener(a0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}a0.prototype.update=function(e){if(!c(e))throw new E("time is required.");let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i-1;o--)r=t[o],c(r._label)&&c(r._position)&&s.set(r.id,new ope(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._label)&&c(r._position)?s.contains(r.id)||s.set(r.id,new ope(r)):(C7(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],C7(s.get(r.id),r,a),s.remove(r.id)};function C7(e,t,n){c(e)&&(e.label=void 0,n.removeLabel(t))}var JN=a0;var Ytt=1,Xtt=!0,Ktt=0,$tt=!0,Ztt=!0,Qtt=xn.ENABLED,Jtt=We.NONE,ent=G.RED,tnt=0,nnt=G.WHITE,int=bc.HIGHLIGHT,ont=.5,rnt=new H(1,1),rpe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},snt=new B,ant=new B,spe=new G,ape=new Array(4),cnt=new d;function c0(e,t){T.typeOf.object("scene",e),T.typeOf.object("entityCollection",t),t.collectionChanged.addEventListener(c0.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Et,this._onCollectionChanged(t,t.values,[],[])}async function lnt(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await lh.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!c(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(l=>{c(s[t.id])&&(console.log(l),l.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!c(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}c0.prototype.update=function(e){if(!c(e))throw new E("time is required.");let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o-1;i--)E7(this,e[i],t,n);return de(this)};var I4=new d,unt=new he;c0.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new E("entity is required.");if(!c(t))throw new E("result is required.");let n=this._modelHash[e.id];if(!c(n))return lt.FAILED;if(n.loadFailed)return lt.FAILED;let i=n.modelPrimitive;if(!c(i)||!i.show)return lt.PENDING;if(!i.ready||!n.modelUpdated)return lt.PENDING;let o=this._scene,r=o.ellipsoid??ie.default;if(i.heightReference!==We.NONE){let a=i.modelMatrix;I4.x=a[12],I4.y=a[13],I4.z=a[14];let l=r.cartesianToCartographic(I4,unt),u=o.getHeight(l,i.heightReference);return c(u)&&(Df(i.heightReference)?l.height=u:l.height+=u),le.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(l),lt.DONE}return le.clone(i.boundingSphere,t),lt.DONE};c0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,l=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],c(r._model)&&c(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],c(r._model)&&c(r._position)?(fnt(r,a),s.set(r.id,r)):(E7(this,r,a,l),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],E7(this,r,a,l),s.remove(r.id)};function E7(e,t,n,i){let o=n[t.id];c(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function fnt(e,t){let n=t[e.id];c(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var eF=c0;function l0(e){this._definitionChanged=new pe,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(l0.prototype,{isConstant:{get:function(){return X.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return c(this._value)?this._value.referenceFrame:Hi.FIXED}}});var dnt=new Q;l0.prototype.getValue=function(e,t){return c(e)||(e=Q.now(dnt)),this.getValueInReferenceFrame(e,Hi.FIXED,t)};l0.prototype.setValue=function(e){this._value!==e&&(this._value=e,c(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),c(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};l0.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new E("time is required.");if(!c(t))throw new E("referenceFrame is required.");if(c(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),c(n)?ie.default.scaleToGeodeticSurface(n,n):void 0};l0.prototype.equals=function(e){return this===e||e instanceof l0&&this._value===e._value};l0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var zm=l0;var hnt=60,mnt=1,lpe=new En,S7=new En,w7=new En;function cpe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function pnt(e,t,n,i,o,r,s,a,l){let u=a,f;f=e.getValueInReferenceFrame(t,r,l[u]),c(f)&&(l[u++]=f);let h=!c(o)||Q.lessThanOrEquals(o,t)||Q.greaterThanOrEquals(o,n),p=0,g=i.length,m=i[p],y=n,b=!1,x,A,C;for(;p0&&!b){let S=i[p+1],v=Q.secondsDifference(S,m);b=v>s,b&&(x=Math.ceil(v/s),A=0,C=v/Math.max(x,2),x=Math.max(x-1,1))}if(b&&A0){let g=h.pop();l=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,l=this._polylineCollection.add();l.id=n,t.polyline=l}let f=X.getValueOrDefault(i._resolution,e,hnt);l.show=!0,l.positions=fpe(o,r,s,e,this._referenceFrame,f,l.positions.slice()),l.material=tr.getValue(e,i._material,l.material),l.width=X.getValueOrDefault(i._width,e,mnt),l.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,l.distanceDisplayCondition)};tF.prototype.removeObject=function(e){let t=e.polyline;c(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};tF.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),de(this)};function u0(e,t){if(!c(e))throw new E("scene is required.");if(!c(t))throw new E("entityCollection is required.");t.collectionChanged.addEventListener(u0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}u0.prototype.update=function(e){if(!c(e))throw new E("time is required.");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&&c(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-1;o--)r=t[o],c(r._path)&&c(r._position)&&a.set(r.id,new cpe(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._path)&&c(r._position)?a.contains(r.id)||a.set(r.id,new cpe(r)):(s=a.get(r.id),c(s)&&(c(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),c(s)&&(c(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};u0._subSample=fpe;var nF=u0;var dpe=G.WHITE,hpe=G.BLACK,mpe=0,ppe=1,_pe=0,gpe=Vr.NONE,ype=new G,Ant=new d,bpe=new G,xpe=new Bt,Tpe=new Bt,Ape=new Mt;function Cpe(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 f0(e,t){if(!c(e))throw new E("entityCluster is required.");if(!c(t))throw new E("entityCollection is required.");t.collectionChanged.addEventListener(f0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}f0.prototype.update=function(e){if(!c(e))throw new E("time is required.");let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i0?(u.scale=1,g=g||x!==r.outlineWidth||A!==r.pixelSize||!G.equals(y,r.color)||!G.equals(b,r.outlineColor)):(u.scale=A/50,A=50,g=g||x!==r.outlineWidth||!G.equals(y,r.color)||!G.equals(b,r.outlineColor)),g){r.color=G.clone(y,r.color),r.outlineColor=G.clone(b,r.outlineColor),r.pixelSize=A,r.outlineWidth=x;let C=y.alpha,S=y.toCssColorString(),v=b.toCssColorString(),P=JSON.stringify([S,A,v,x]);u.setImage(P,Lx(C,S,v,x,A))}m&&u._updateClamping()}}return!0};f0.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new E("entity is required.");if(!c(t))throw new E("result is required.");let n=this._items.get(e.id);if(!c(n)||!(c(n.pointPrimitive)||c(n.billboard)))return lt.FAILED;if(c(n.pointPrimitive))t.center=d.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!c(i._clampedPosition))return lt.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,lt.DONE};f0.prototype.isDestroyed=function(){return!1};f0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(f0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t-1;o--)r=t[o],c(r._point)&&c(r._position)&&s.set(r.id,new Cpe(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._point)&&c(r._position)?s.contains(r.id)||s.set(r.id,new Cpe(r)):(iF(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],iF(s.get(r.id),r,a),s.remove(r.id)};function iF(e,t,n){if(c(e)){let i=e.pointPrimitive;if(c(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;c(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var oF=f0;var Dpe=[];function Cnt(e,t,n,i,o){let r=Dpe;r.length=o;let s,a=n.red,l=n.green,u=n.blue,f=n.alpha,h=i.red,p=i.green,g=i.blue,m=i.alpha;if(G.equals(n,i)){for(s=0;s0?new Array(o):void 0;for(i=0;i0){let N=0,k=h[0];i=i.filter(function(z,V){let j=!1;return o?j=V===k||V===0&&k===1:j=V+1===k,j?(N++,k=h[N],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===qt.GEODESIC||r===qt.RHUMB){let N,k;r===qt.GEODESIC?(N=O.chordLength(s,a.maximumRadius),k=Fi.numberOfPoints):(N=s,k=Fi.numberOfPointsRhumbLine);let z=Fi.extractHeights(p,a);if(c(i)){let V=1;for(l=0;l0)return le.fromPoints(t.positions,e),lt.DONE}return lt.FAILED};sF.prototype.isDestroyed=function(){return!1};sF.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=O4[t];c(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete O4[t])),c(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),de(this)};var aF=Ih;var Rnt=new G,Mnt=new Mt,Lnt=new Mt;function Oh(e,t,n,i,o){let r;n instanceof Ut?r=is:r=ha,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Oh.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et,this.zIndex=i,this._asynchronous=o}Oh.prototype.onMaterialChanged=function(){this.invalidated=!0};Oh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:c(t)&&t.equals(n)};Oh.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||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,l){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Oh.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 c(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Oh.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)c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new Vd({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===ha&&(this.material=tr.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===ha&&(this.material=tr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};OS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let l=0;l-1;a--)l=s[a],u=l.id,f=this._updaters.get(u),f.entity===l?(Mpe(this,f),Lpe(this,e,f)):(o.push(l),n.push(l));for(a=o.length-1;a>-1;a--)l=o[a],u=l.id,f=this._updaters.get(u),Mpe(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)l=n[a],u=l.id,f=new aF(l,this._scene),this._updaters.set(u,f),Lpe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(Hm._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let h=!0,p=this._batches,g=p.length;for(a=0;a-1;s--)l=n[s],a=l.id,i.remove(a)||(o.set(a,l),r.remove(a));for(s=t.length-1;s>-1;s--)l=t[s],a=l.id,o.remove(a)?r.set(a,l):i.set(a,l)};var lF=Hm;function Ql(e){T.typeOf.object("options",e),T.typeOf.object("options.scene",e.scene),T.typeOf.object("options.dataSourceCollection",e.dataSourceCollection),jc.initializeTerrainHeights(),Vd.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new gr,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??Ql.defaultVisualizersCallback;let i=!1,o=new fl,r=new fl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;unew o(e,i))]};Object.defineProperties(Ql.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}}});Ql.prototype.isDestroyed=function(){return!1};Ql.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;tjnt*u.maximumRadius?(m=kpe,d.normalize(h,m),d.negate(m,m),b=d.clone(d.UNIT_Z,D7),y=d.cross(b,m,R4),d.magnitude(y)>O.EPSILON7&&(d.normalize(m,m),d.normalize(y,y),b=d.cross(m,y,D7),d.normalize(b,b),p=!0)):d.equalsEpsilon(h,M,O.EPSILON7)||(b=kpe,d.normalize(_,b),d.normalize(w,w),y=d.cross(b,w,D7),g&&(y=d.multiplyByScalar(y,-1,y)),d.equalsEpsilon(y,d.ZERO,O.EPSILON7)||(m=d.cross(y,b,R4),J.multiplyByVector(F,m,m),J.multiplyByVector(F,y,y),J.multiplyByVector(F,b,b),d.normalize(m,m),d.normalize(y,y),d.normalize(b,b),p=!0))}}c(e.boundingSphere)&&(h=e.boundingSphere.center);let x,A,C;i&&(x=d.clone(t.position,P7),A=d.clone(t.direction,Upe),C=d.clone(t.up,Vpe));let S=Vnt,v;c(s)&&(v=s.getValue(l,znt));let P=r.getValue(l,Hnt);if(a===Bp.INERTIAL&&c(v))B.fromTranslationQuaternionRotationScale(h,v,d.ONE,S);else if(a===Bp.VELOCITY&&c(P)){let M=Ot.rotationMatrixFromPositionVelocity(h,P,u,Gnt);B.fromRotationTranslation(M,h,S)}else a===Bp.ENU||!p?Ot.eastNorthUpToFixedFrame(h,u,S):(S[0]=m.x,S[1]=m.y,S[2]=m.z,S[3]=0,S[4]=y.x,S[5]=y.y,S[6]=y.z,S[7]=0,S[8]=b.x,S[9]=b.y,S[10]=b.z,S[11]=0,S[12]=h.x,S[13]=h.y,S[14]=h.z,S[15]=0);t._setTransform(S),i&&(d.clone(x,t.position),d.clone(A,t.direction),d.clone(C,t.up),d.cross(A,C,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 fF(e,t,n){T.defined("entity",e),T.defined("scene",t),this.entity=e,this.scene=t,this.ellipsoid=n??ie.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new d,this._defaultOffset3D=void 0,this._velocityProperty=new $_(e.position,!0),this._offset3D=new d}Object.defineProperties(fF,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=d.clone(e,new d)}}});fF.defaultOffset3D=new d(-14e3,3500,3500);var M4=new cd,qnt=new d;fF.prototype.update=function(e,t){T.defined("time",e);let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===oe.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!c(a))return;let l=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,h=o!==this._mode,p=n.camera,g=f||h,m=!0;if(f){let y=r.viewFrom,b=c(y);if(!b&&c(t)){M4.pitch=-O.PI_OVER_FOUR,M4.range=0;let x=a.getValue(e,qnt);if(c(x)){let A=2-1/Math.max(1,d.magnitude(x)/i.maximumRadius);M4.pitch*=A}p.viewBoundingSphere(t,M4),this.boundingSphere=t,g=!1,m=!1}else(!b||!c(y.getValue(e,this._offset3D)))&&d.clone(fF._defaultOffset3D,this._offset3D)}else!h&&this._mode!==oe.SCENE2D&&d.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,Wnt(this,p,g,m,a,l,u,s,e,i)};var dF=fF;function V4(e){return z4(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function z4(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?z4(n):n),[])}var zpe=[0,1,2,3].concat(...V4([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function br(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,h,p,g,m,y,b=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,f=o.heap_max+1;f<573;f++)h=o.heap[f],g=r[r[h*2+1]*2+1]+1,g>u&&(g=u,b++),r[h*2+1]=g,!(h>e.max_code)&&(o.bl_count[g]++,m=0,h>=l&&(m=a[h-l]),y=r[h*2],o.opt_len+=y*(g+m),s&&(o.static_len+=y*(s[h*2+1]+m)));if(b!==0){do{for(g=u-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[u]--,b-=2}while(b>0);for(g=u;g!==0;g--)for(h=o.bl_count[g];h!==0;)p=o.heap[--f],!(p>e.max_code)&&(r[p*2+1]!=g&&(o.opt_len+=(g-r[p*2+1])*r[p*2],r[p*2+1]=g),h--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],l=0,u,f,h;for(u=1;u<=15;u++)a[u]=l=l+s[u-1]<<1;for(f=0;f<=r;f++)h=o[f*2+1],h!==0&&(o[f*2]=n(a[h]++,h))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,l,u,f=-1,h;for(o.heap_len=0,o.heap_max=573,l=0;l=1;l--)o.pqdownheap(r,l);h=a;do l=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),u=o.heap[1],o.heap[--o.heap_max]=l,o.heap[--o.heap_max]=u,r[h*2]=r[l*2]+r[u*2],o.depth[h]=Math.max(o.depth[l],o.depth[u])+1,r[l*2+1]=r[u*2+1]=h,o.heap[1]=h++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}br._length_code=[0,1,2,3,4,5,6,7].concat(...V4([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));br.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];br.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];br.d_code=function(e){return e<256?zpe[e]:zpe[256+(e>>>7)]};br.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];br.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];br.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];br.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Ha(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var Ynt=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],Xnt=V4([[144,8],[112,9],[24,7],[8,8]]);Ha.static_ltree=z4(Ynt.map((e,t)=>[e,Xnt[t]]));var Knt=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],$nt=V4([[30,5]]);Ha.static_dtree=z4(Knt.map((e,t)=>[e,$nt[t]]));Ha.static_l_desc=new Ha(Ha.static_ltree,br.extra_lbits,257,286,15);Ha.static_d_desc=new Ha(Ha.static_dtree,br.extra_dbits,0,30,15);Ha.static_bl_desc=new Ha(null,br.extra_blbits,0,19,7);var Znt=9,Qnt=8;function Gm(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var Gpe=0,k4=1,CT=2,Rh=[new Gm(0,0,0,0,Gpe),new Gm(4,4,8,4,k4),new Gm(4,5,16,8,k4),new Gm(4,6,32,32,k4),new Gm(4,4,16,16,CT),new Gm(8,16,32,32,CT),new Gm(8,16,128,128,CT),new Gm(8,32,128,256,CT),new Gm(32,128,258,1024,CT),new Gm(32,258,258,4096,CT)],L4=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],ld=0,N4=1,hF=2,F4=3,Jnt=32,I7=42,B4=113,mF=666,O7=8,eit=0,R7=1,tit=2,Mr=3,U4=258,Wu=U4+Mr+1;function Hpe(e,t,n,i){let o=e[t*2],r=e[n*2];return o=3&&z[br.bl_order[Ne]*2+1]===0;Ne--);return e.opt_len+=3*(Ne+1)+5+5+4,Ne}function Pe(Ne){e.pending_buf[e.pending++]=Ne}function Ee(Ne){Pe(Ne&255),Pe(Ne>>>8&255)}function ze(Ne){Pe(Ne>>8&255),Pe(Ne&255&255)}function qe(Ne,ot){let Xe,Ze=ot;ee>16-Ze?(Xe=Ne,Z|=Xe<>>16-ee,ee+=Ze-16):(Z|=Ne<=8&&(Pe(Z&255),Z>>>=8,ee-=8)}function un(){qe(R7<<1,3),it(256,Ha.static_ltree),$e(),1+K+10-ee<9&&(qe(R7<<1,3),it(256,Ha.static_ltree),$e()),K=7}function zt(Ne,ot){let Xe,Ze,pt;if(e.dist_buf[Y]=Ne,e.lc_buf[Y]=ot&255,Y++,Ne===0?N[ot*2]++:(te++,Ne--,N[(br._length_code[ot]+256+1)*2]++,k[br.d_code(Ne)*2]++),!(Y&8191)&&_>2){for(Xe=Y*8,Ze=v-x,pt=0;pt<30;pt++)Xe+=k[pt*2]*(5+br.extra_dbits[pt]);if(Xe>>>=3,te8?Ee(Z):ee>0&&Pe(Z&255),Z=0,ee=0}function an(Ne,ot,Xe){Ei(),K=8,Xe&&(Ee(ot),Ee(~ot)),e.pending_buf.set(l.subarray(Ne,Ne+ot),e.pending),e.pending+=ot}function _e(Ne,ot,Xe){qe((eit<<1)+(Xe?1:0),3),an(Ne,ot,!0)}function Ce(Ne,ot,Xe){let Ze,pt,Ht=0;_>0?(V.build_tree(e),j.build_tree(e),Ht=Ae(),Ze=e.opt_len+3+7>>>3,pt=e.static_len+3+7>>>3,pt<=Ze&&(Ze=pt)):Ze=pt=ot+5,ot+4<=Ze&&Ne!=-1?_e(Ne,ot,Xe):pt==Ze?(qe((R7<<1)+(Xe?1:0),3),Ct(Ha.static_ltree,Ha.static_dtree)):(qe((tit<<1)+(Xe?1:0),3),jt(V.max_code+1,j.max_code+1,Ht+1),Ct(N,k)),Te(),Xe&&Ei()}function pn(Ne){Ce(x>=0?x:-1,v-x,Ne),x=v,t.flush_pending()}function mt(){let Ne,ot,Xe,Ze;do{if(Ze=u-M-v,Ze===0&&v===0&&M===0)Ze=r;else if(Ze==-1)Ze--;else if(v>=r+r-Wu){l.set(l.subarray(r,r+r),0),P-=r,v-=r,x-=r,Ne=g,Xe=Ne;do ot=h[--Xe]&65535,h[Xe]=ot>=r?ot-r:0;while(--Ne!==0);Ne=r,Xe=Ne;do ot=f[--Xe]&65535,f[Xe]=ot>=r?ot-r:0;while(--Ne!==0);Ze+=r}if(t.avail_in===0)return;Ne=t.read_buf(l,v+M,Ze),M+=Ne,M>=Mr&&(p=l[v]&255,p=(p<i-5&&(ot=i-5);;){if(M<=1){if(mt(),M===0&&Ne==0)return ld;if(M===0)break}if(v+=M,M=0,Xe=x+ot,(v===0||v>=Xe)&&(M=v-Xe,v=Xe,pn(!1),t.avail_out===0)||v-x>=r-Wu&&(pn(!1),t.avail_out===0))return ld}return pn(Ne==4),t.avail_out===0?Ne==4?hF:ld:Ne==4?F4:N4}function Ro(Ne){let ot=L,Xe=v,Ze,pt,Ht=R,Cn=v>r-Wu?v-(r-Wu):0,Mo=I,Ao=a,Za=v+U4,Qa=l[Xe+Ht-1],Si=l[Xe+Ht];R>=D&&(ot>>=2),Mo>M&&(Mo=M);do if(Ze=Ne,!(l[Ze+Ht]!=Si||l[Ze+Ht-1]!=Qa||l[Ze]!=l[Xe]||l[++Ze]!=l[Xe+1])){Xe+=2,Ze++;do;while(l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&XeHt){if(P=Ne,Ht=pt,pt>=Mo)break;Qa=l[Xe+Ht-1],Si=l[Xe+Ht]}}while((Ne=f[Ne&Ao]&65535)>Cn&&--ot!==0);return Ht<=M?Ht:M}function aa(Ne){let ot=0,Xe;for(;;){if(M=Mr&&(p=(p<=Mr)if(Xe=zt(v-P,A-Mr),M-=A,A<=F&&M>=Mr){A--;do v++,p=(p<=Mr&&(p=(p<4096)&&(A=Mr-1)),R>=Mr&&A<=R){Ze=v+M-Mr,Xe=zt(v-1-C,R-Mr),M-=R-1,R-=2;do++v<=Ze&&(p=(p<Znt||Ze!=O7||Xe<9||Xe>15||ot<0||ot>9||Ht<0||Ht>2?-2:(Ne.dstate=e,s=Xe,r=1<9||Xe<0||Xe>2?-2:(Rh[_].func!=Rh[ot].func&&Ne.total_in!==0&&(Ze=Ne.deflate(1)),_!=ot&&(_=ot,F=Rh[_].max_lazy,D=Rh[_].good_length,I=Rh[_].nice_length,L=Rh[_].max_chain),w=Xe,Ze)},e.deflateSetDictionary=function(Ne,ot,Xe){let Ze=Xe,pt,Ht=0;if(!ot||n!=I7)return-2;if(Zer-Wu&&(Ze=r-Wu,Ht=Xe-Ze),l.set(ot.subarray(Ht,Ht+Ze),0),v=Ze,x=Ze,p=l[0]&255,p=(p<4||ot<0)return-2;if(!Ne.next_out||!Ne.next_in&&Ne.avail_in!==0||n==mF&&ot!=4)return Ne.msg=L4[4],-2;if(Ne.avail_out===0)return Ne.msg=L4[7],-5;if(t=Ne,Ht=o,o=ot,n==I7&&(Ze=O7+(s-8<<4)<<8,pt=(_-1&255)>>1,pt>3&&(pt=3),Ze|=pt<<6,v!==0&&(Ze|=Jnt),Ze+=31-Ze%31,n=B4,ze(Ze)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&ot<=Ht&&ot!=4)return t.msg=L4[7],-5;if(n==mF&&t.avail_in!==0)return Ne.msg=L4[7],-5;if(t.avail_in!==0||M!==0||ot!=0&&n!=mF){switch(Cn=-1,Rh[_].func){case Gpe:Cn=so(ot);break;case k4:Cn=aa(ot);break;case CT:Cn=Nr(ot);break;default:}if((Cn==hF||Cn==F4)&&(n=mF),Cn==ld||Cn==hF)return t.avail_out===0&&(o=-1),0;if(Cn==N4){if(ot==1)un();else if(_e(0,0,!1),ot==3)for(Xe=0;Xen&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function Wpe(e){let t=this,n=new jpe,i=iit(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,l){let u,f,h=0,p=0,g=0,m=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,u=n.deflate(o),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?m.push(new Uint8Array(r)):m.push(r.subarray(0,n.next_out_index))),g+=n.next_out_index,l&&n.next_in_index>0&&n.next_in_index!=h&&(l(n.next_in_index),h=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return m.length>1?(f=new Uint8Array(g),m.forEach(function(y){f.set(y,p),p+=y.length})):f=m[0]?new Uint8Array(m[0]):new Uint8Array,f}},t.flush=function(){let a,l,u=0,f=0,h=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&h.push(r.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),l=new Uint8Array(f),h.forEach(function(p){l.set(p,u),u+=p.length}),l}}function iit(e){return e+5*(Math.floor(e/16383)+1)}var qu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],f_e=1440,oit=0,rit=4,sit=9,ait=5,cit=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],lit=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],uit=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],fit=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],dit=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],hit=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],d0=15;function F7(){let e=this,t,n,i,o,r,s;function a(u,f,h,p,g,m,y,b,x,A,C){let S,v,P,M,R,L,F,_,w,D,I,N,k,z,V;D=0,R=h;do i[u[f+D]]++,D++,R--;while(R!==0);if(i[0]==h)return y[0]=-1,b[0]=0,0;for(_=b[0],L=1;L<=d0&&i[L]===0;L++);for(F=L,_R&&(_=R),b[0]=_,z=1<N+_;){if(M++,N+=_,V=P-N,V=V>_?_:V,(v=1<<(L=F-N))>S+1&&(v-=S+1,k=F,Lf_e)return-3;r[M]=I=A[0],A[0]+=V,M!==0?(s[M]=R,o[0]=L,o[1]=_,L=R>>>N-_,o[2]=I-r[M-1]-L,x.set(o,(r[M-1]+L)*3)):y[0]=I}for(o[1]=F-N,D>=h?o[0]=192:C[D]>>N;L>>=1)R^=L;for(R^=L,w=(1<257?(A==-3?x.msg="oversubscribed distance tree":A==-5?(x.msg="incomplete distance tree",A=-3):A!=-4&&(x.msg="empty distance tree with lengths",A=-3),A):0)}}F7.inflate_trees_fixed=function(e,t,n,i){return e[0]=sit,t[0]=ait,n[0]=cit,i[0]=lit,0};var H4=0,qpe=1,Ype=2,Xpe=3,Kpe=4,$pe=5,Zpe=6,M7=7,Qpe=8,G4=9;function mit(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,l=0,u=0,f=0,h,p=0,g,m=0;function y(b,x,A,C,S,v,P,M){let R,L,F,_,w,D,I,N,k,z,V,j,U,q,Y,te;I=M.next_in_index,N=M.avail_in,w=P.bitb,D=P.bitk,k=P.write,z=k>=L[te+1],D-=L[te+1],P.win[k++]=L[te+2],z--;continue}do{if(w>>=L[te+1],D-=L[te+1],_&16){for(_&=15,U=L[te+2]+(w&qu[_]),w>>=_,D-=_;D<15;)N--,w|=(M.read_byte(I++)&255)<>=L[te+1],D-=L[te+1],_&16){for(_&=15;D<_;)N--,w|=(M.read_byte(I++)&255)<>=_,D-=_,z-=U,k>=q)Y=k-q,k-Y>0&&2>k-Y?(P.win[k++]=P.win[Y++],P.win[k++]=P.win[Y++],U-=2):(P.win.set(P.win.subarray(Y,Y+2),k),k+=2,Y+=2,U-=2);else{Y=k-q;do Y+=P.end;while(Y<0);if(_=P.end-Y,U>_){if(U-=_,k-Y>0&&_>k-Y)do P.win[k++]=P.win[Y++];while(--_!==0);else P.win.set(P.win.subarray(Y,Y+_),k),k+=_,Y+=_,_=0;Y=0}}if(k-Y>0&&U>k-Y)do P.win[k++]=P.win[Y++];while(--U!==0);else P.win.set(P.win.subarray(Y,Y+U),k),k+=U,Y+=U,U=0;break}else if(!(_&64))R+=L[te+2],R+=w&qu[_],te=(F+R)*3,_=L[te];else return M.msg="invalid distance code",U=M.avail_in-N,U=D>>3>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,-3;while(!0);break}if(_&64)return _&32?(U=M.avail_in-N,U=D>>3>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,1):(M.msg="invalid literal/length code",U=M.avail_in-N,U=D>>3>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,-3);if(R+=L[te+2],R+=w&qu[_],te=(F+R)*3,(_=L[te])===0){w>>=L[te+1],D-=L[te+1],P.win[k++]=L[te+2],z--;break}}while(!0)}while(z>=258&&N>=10);return U=M.avail_in-N,U=D>>3>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,0}e.init=function(b,x,A,C,S,v){t=H4,u=b,f=x,h=A,p=C,g=S,m=v,i=null},e.proc=function(b,x,A){let C,S,v,P=0,M=0,R=0,L,F,_,w;for(R=x.next_in_index,L=x.avail_in,P=b.bitb,M=b.bitk,F=b.write,_=F=258&&L>=10&&(b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,A=y(u,f,h,p,g,m,b,x),R=x.next_in_index,L=x.avail_in,P=b.bitb,M=b.bitk,F=b.write,_=F>>=i[S+1],M-=i[S+1],v=i[S],v===0){s=i[S+2],t=Zpe;break}if(v&16){a=v&15,n=i[S+2],t=Ype;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}if(v&32){t=M7;break}return t=G4,x.msg="invalid literal/length code",A=-3,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A);case Ype:for(C=a;M>=C,M-=C,r=f,i=g,o=m,t=Xpe;case Xpe:for(C=r;M>=i[S+1],M-=i[S+1],v=i[S],v&16){a=v&15,l=i[S+2],t=Kpe;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}return t=G4,x.msg="invalid distance code",A=-3,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A);case Kpe:for(C=a;M>=C,M-=C,t=$pe;case $pe:for(w=F-l;w<0;)w+=b.end;for(;n!==0;){if(_===0&&(F==b.end&&b.read!==0&&(F=0,_=F7&&(M-=8,L++,R--),b.write=F,A=b.inflate_flush(x,A),F=b.write,_=Fy.avail_out&&(x=y.avail_out),x!==0&&b==-5&&(b=0),y.avail_out-=x,y.total_out+=x,y.next_out.set(n.win.subarray(C,C+x),A),A+=x,C+=x,C==n.end&&(C=0,n.write==n.end&&(n.write=0),x=n.write-C,x>y.avail_out&&(x=y.avail_out),x!==0&&b==-5&&(b=0),y.avail_out-=x,y.total_out+=x,y.next_out.set(n.win.subarray(C,C+x),A),A+=x,C+=x),y.next_out_index=A,n.read=C,b},n.proc=function(y,b){let x,A,C,S,v,P,M,R;for(S=y.next_in_index,v=y.avail_in,A=n.bitb,C=n.bitk,P=n.write,M=P>>1){case 0:A>>>=3,C-=3,x=C&7,A>>>=x,C-=x,i=L7;break;case 1:L=[],F=[],_=[[]],w=[[]],F7.inflate_trees_fixed(L,F,_,w),f.init(L[0],F[0],_[0],0,w[0],0),A>>>=3,C-=3,i=j4;break;case 2:A>>>=3,C-=3,i=t_e;break;case 3:return A>>>=3,C-=3,i=ET,y.msg="invalid block type",b=-3,n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b)}break;case L7:for(;C<32;){if(v!==0)b=0;else return n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<>>16&65535)!=(A&65535))return i=ET,y.msg="invalid stored block lengths",b=-3,n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);o=A&65535,A=C=0,i=o!==0?e_e:h!==0?W4:LS;break;case e_e:if(v===0||M===0&&(P==n.end&&n.read!==0&&(P=0,M=Pv&&(x=v),x>M&&(x=M),n.win.set(y.read_buf(S,x),P),S+=x,v-=x,P+=x,M-=x,(o-=x)!==0)break;i=h!==0?W4:LS;break;case t_e:for(;C<14;){if(v!==0)b=0;else return n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<29||(x>>5&31)>29)return i=ET,y.msg="too many length or distance symbols",b=-3,n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);if(x=258+(x&31)+(x>>5&31),!a||a.length>>=14,C-=14,s=0,i=n_e;case n_e:for(;s<4+(r>>>10);){for(;C<3;){if(v!==0)b=0;else return n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<>>=3,C-=3}for(;s<19;)a[Jpe[s++]]=0;if(l[0]=7,x=m.inflate_trees_bits(a,l,u,p,y),x!=0)return b=x,b==-3&&(a=null,i=ET),n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);s=0,i=i_e;case i_e:for(;x=r,!(s>=258+(x&31)+(x>>5&31));){let z,V;for(x=l[0];C>>=x,C-=x,a[s++]=V;else{for(R=V==18?7:V-14,z=V==18?11:3;C>>=x,C-=x,z+=A&qu[R],A>>>=R,C-=R,R=s,x=r,R+z>258+(x&31)+(x>>5&31)||V==16&&R<1)return a=null,i=ET,y.msg="invalid bit length repeat",b=-3,n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);V=V==16?a[R-1]:0;do a[R++]=V;while(--z!==0);s=R}}if(u[0]=-1,D=[],I=[],N=[],k=[],D[0]=9,I[0]=6,x=r,x=m.inflate_trees_dynamic(257+(x&31),1+(x>>5&31),a,D,I,N,k,p,y),x!=0)return x==-3&&(a=null,i=ET),b=x,n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);f.init(D[0],I[0],p,N[0],p,k[0]),i=j4;case j4:if(n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,(b=f.proc(n,y,b))!=1)return n.inflate_flush(y,b);if(b=0,f.free(y),S=y.next_in_index,v=y.avail_in,A=n.bitb,C=n.bitk,P=n.write,M=P15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new pit(n,1<>4)+8>s.wbits){s.mode=h0,n.msg="invalid win size",s.marker=5;break}s.mode=r_e;case r_e:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=h0,n.msg="incorrect header check",s.marker=5;break}if(!(r&_it)){s.mode=pF;break}s.mode=s_e;case s_e:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=a_e;case a_e:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=c_e;case c_e:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=l_e;case l_e:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=N7,2);case N7:return s.mode=h0,n.msg="need dictionary",s.marker=0,-2;case pF:if(o=s.blocks.proc(n,o),o==-3){s.mode=h0,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=u_e;case u_e:return n.avail_in=0,1;case h0:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=N7)return-2;let a=n.istate;return s>=1<0&&n.next_in_index!=p&&(l(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(h=new Uint8Array(m),u.forEach(function(y){h.set(y,g),g+=y.length})):h=u[0]?new Uint8Array(u[0]):new Uint8Array,h}},t.flush=function(){n.inflateEnd()}}var NS="/",B7=new Date(2107,11,31),k7=new Date(1980,0,1),Pi=void 0,Yu="undefined",ig="function";var _F=class{constructor(t){return class extends null{constructor(n,i){let o=new t(i);super({transform(r,s){s.enqueue(o.append(r))},flush(r){let s=o.flush();s&&r.enqueue(s)}})}}}};var Tit=64,m_e=2;try{typeof navigator!=Yu&&navigator.hardwareConcurrency&&(m_e=navigator.hardwareConcurrency)}catch{}var Ait={chunkSize:512*1024,maxWorkers:m_e,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Pi,CompressionStreamNative:typeof CompressionStream!=Yu&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Yu&&DecompressionStream},p0=Object.assign({},Ait);function gF(){return p0}function q4(e){return Math.max(e.chunkSize,Tit)}function FS(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:l,CompressionStream:u,DecompressionStream:f,workerScripts:h}=e;if(m0("baseURL",t),m0("chunkSize",n),m0("maxWorkers",i),m0("terminateWorkerTimeout",o),m0("useCompressionStream",r),m0("useWebWorkers",s),a&&(p0.CompressionStream=new _F(a)),l&&(p0.DecompressionStream=new _F(l)),m0("CompressionStream",u),m0("DecompressionStream",f),h!==Pi){let{deflate:p,inflate:g}=h;if((p||g)&&(p0.workerScripts||(p0.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");p0.workerScripts.deflate=p}if(g){if(!Array.isArray(g))throw new Error("workerScripts.inflate must be an array");p0.workerScripts.inflate=g}}}function m0(e,t){t!==Pi&&(p0[e]=t)}var p_e=[];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;p_e[e]=t}var og=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i>>8^p_e[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var yF=class extends null{constructor(){let t,n=new og;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 BS(e){if(typeof TextEncoder==Yu){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n0&&t&&(e[n-1]=hl.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=hl.getPartial(o);return i.push(hl.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},bF={bytes:{fromBits(e){let n=hl.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=hl.concat(t,[hl.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<>>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],s=n[2],a=n[3],l=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,s,a)+l+i[u]+t._key[Math.floor(u/20)]|0;l=a,a=s,s=t._S(30,r),r=o,o=f}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+l|0}};var U7={};U7.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,l=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let u=s[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^l<<24,l=l<<1^(l>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let f=s[u&3?r:r-4];r<=4||u<4?a[u]=f:a[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=[],s,a,l,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=r[s]||1){let h=s^s<<1^s<<2^s<<3^s<<4;h=h>>8^h&255^99,n[f]=h,i[h]=f,u=o[l=o[a=o[f]]];let p=u*16843009^l*65537^a*257^f*16843008,g=o[h]*257^h*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>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],s=r[0],a=r[1],l=r[2],u=r[3],f=r[4],h=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],y=4,b,x,A;for(let C=0;C>>24]^a[p>>16&255]^l[g>>8&255]^u[m&255]^n[y],x=s[p>>>24]^a[g>>16&255]^l[m>>8&255]^u[h&255]^n[y+1],A=s[g>>>24]^a[m>>16&255]^l[h>>8&255]^u[p&255]^n[y+2],m=s[m>>>24]^a[h>>16&255]^l[p>>8&255]^u[g&255]^n[y+3],y+=4,h=b,p=x,g=A;for(let C=0;C<4;C++)o[t?3&-C:C]=f[h>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[y++],b=h,h=p,p=g,g=m,m=b;return o}};var g_e={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>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=hl.bitLength(t);for(let r=0;r>5)+1<<2,r,s,a,l,u,f=new ArrayBuffer(o),h=new DataView(f),p=0,g=hl;for(t=bF.bytes.toBits(t),u=1;p<(o||1);u++){for(r=s=e.encrypt(g.concat(t,[u])),a=1;ao&&(e=new n().update(e).finalize());for(let r=0;rthis.resolveReady=s),password:E_e(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let l=this,{password:u,strength:f,resolveReady:h,ready:p}=l;u?(await Mit(l,f,u,ud(s,0,TF[f]+2)),s=ud(s,TF[f]+2),r?a.error(new Error(rg)):h()):await p;let g=new Uint8Array(s.length-y0-(s.length-y0)%kS);a.enqueue(A_e(l,s,g,0,y0,!0))},async flush(s){let{signed:a,ctr:l,hmac:u,pending:f,ready:h}=this;if(u&&l){await h;let p=ud(f,0,f.length-y0),g=ud(f,f.length-y0),m=new Uint8Array;if(p.length){let y=CF(jm,p);u.update(y);let b=l.update(y);m=AF(jm,b)}if(a){let y=ud(AF(jm,u.digest()),0,y0);for(let b=0;bthis.resolveReady=r),password:E_e(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:l,strength:u,resolveReady:f,ready:h}=a,p=new Uint8Array;l?(p=await Lit(a,u,l),f()):await h;let g=new Uint8Array(p.length+r.length-r.length%kS);g.set(p,0),s.enqueue(A_e(a,r,g,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:l,ready:u}=this;if(a&&s){await u;let f=new Uint8Array;if(l.length){let h=s.update(CF(jm,l));a.update(h),f=AF(jm,h)}o.signature=AF(jm,a.digest()).slice(0,y0),r.enqueue(H7(f,o.signature))}}}),o=this}};function A_e(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:l}=e,u=t.length-o;l.length&&(t=H7(l,t),n=Bit(n,u-u%kS));let f;for(f=0;f<=u-kS;f+=kS){let h=CF(jm,ud(t,f,f+kS));r&&a.update(h);let p=s.update(h);r||a.update(p),n.set(AF(jm,p),f+i)}return e.pending=ud(t,f),n}async function Mit(e,t,n,i){let o=await C_e(e,t,n,ud(i,0,TF[t])),r=ud(i,TF[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(g0)}async function Lit(e,t,n){let i=Y4(new Uint8Array(TF[t])),o=await C_e(e,t,n,i);return H7(i,o)}async function C_e(e,t,n,i){e.password=null;let o=await Nit(Eit,n,vit,!1,Dit),r=await Fit(Object.assign({salt:i},z7),o,8*(xF[t]*2+2)),s=new Uint8Array(r),a=CF(jm,ud(s,0,xF[t])),l=CF(jm,ud(s,xF[t],xF[t]*2)),u=ud(s,xF[t]*2);return Object.assign(e,{keys:{key:a,authentication:l,passwordVerification:u},ctr:new Oit(new Iit(a),Array.from(Pit)),hmac:new Rit(l)}),u}async function Nit(e,t,n,i,o){if(y_e)try{return await EF.importKey(e,t,n,i,o)}catch{return y_e=!1,_0.importKey(t)}else return _0.importKey(t)}async function Fit(e,t,n){if(b_e)try{return await EF.deriveBits(e,t,n)}catch{return b_e=!1,_0.pbkdf2(t,e.salt,z7.iterations,n)}else return _0.pbkdf2(t,e.salt,z7.iterations,n)}function E_e(e,t){return t===Pi?BS(e):t}function H7(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 Bit(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function ud(e,t,n){return e.subarray(t,n)}function AF(e,t){return e.fromBits(t)}function CF(e,t){return e.toBits(t)}var US=12,Z4=class extends null{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),D_e(this,t)},transform(o,r){let s=this;if(s.password){let a=S_e(s,o.subarray(0,US));if(s.password=null,a[US-1]!=s.passwordVerification)throw new Error(g0);o=o.subarray(US)}i?r.error(new Error(rg)):r.enqueue(S_e(s,o))}})}},Q4=class extends null{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),D_e(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let l=Y4(new Uint8Array(US));l[US-1]=r.passwordVerification,s=new Uint8Array(i.length+l.length),s.set(w_e(r,l),0),a=US}else s=new Uint8Array(i.length),a=0;s.set(w_e(r,i),a),o.enqueue(s)}})}};function S_e(e,t){let n=new Uint8Array(t.length);for(let i=0;i>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function P_e(e){let t=e.keys[2]|2;return I_e(Math.imul(t,t^1)>>>8)}function I_e(e){return e&255}function v_e(e){return e&4294967295}var O_e="deflate-raw",J4=class extends null{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:l,signed:u,level:f}=t,h=this,p,g,m=R_e(super.readable);(!s||l)&&u&&(p=new yF,m=Wm(m,p)),r&&(m=L_e(m,a,{level:f,chunkSize:n},o,i)),s&&(l?m=Wm(m,new Q4(t)):(g=new K4(t),m=Wm(m,g))),M_e(h,m,()=>{let y;s&&!l&&(y=g.signature),(!s||l)&&u&&(y=new DataView(p.value.buffer).getUint32(0)),h.signature=y})}},e8=class extends null{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:l,compressed:u,useCompressionStream:f}=t,h,p,g=R_e(super.readable);s&&(r?g=Wm(g,new Z4(t)):(p=new X4(t),g=Wm(g,p))),u&&(g=L_e(g,f,{chunkSize:n},o,i)),(!s||r)&&a&&(h=new yF,g=Wm(g,h)),M_e(this,g,()=>{if((!s||r)&&a){let m=new DataView(h.value.buffer);if(l!=m.getUint32(0,!1))throw new Error(ST)}})}};function R_e(e){return Wm(e,new null({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function M_e(e,t,n){t=Wm(t,new null({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function L_e(e,t,n,i,o){try{let r=t&&i?i:o;e=Wm(e,new r(O_e,n))}catch{if(t)try{e=Wm(e,new o(O_e,n))}catch{return e}else return e}return e}function Wm(e,t){return e.pipeThrough(t)}var N_e="message",F_e="start",B_e="pull",j7="data",k_e="ack",W7="close",i8="deflate",o8="inflate";var t8=class extends null{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(i8)?r=J4:o.startsWith(o8)&&(r=e8);let s=0,a=0,l=new r(t,n),u=super.readable,f=new null({transform(p,g){p&&p.length&&(a+=p.length,g.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),h=new null({transform(p,g){p&&p.length&&(s+=p.length,g.enqueue(p))},flush(){let{signature:p}=l;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return u.pipeThrough(f).pipeThrough(l).pipeThrough(h)}})}},n8=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 s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var z_e=typeof Worker!=Yu;var VS=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:l,scripts:u},f){let{signal:h}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new n8(r.chunkSize)).pipeThrough(new Y7(n,s),{signal:h}),writable:i,options:Object.assign({},o),scripts:u,transferStreams:l,terminate(){return new Promise(p=>{let{worker:g,busy:m}=t;g?(m?t.resolveTerminated=p:(g.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,f(t)}}),(a&&z_e?kit:H_e)(t,r)}},Y7=class extends null{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await q7(n,o)},async transform(a,l){s+=a.length,i&&await q7(i,s,o),l.enqueue(a)},async flush(){t.size=s,r&&await q7(r,s)}})}};async function q7(e,...t){try{await e(...t)}catch{}}function H_e(e,t){return{run:()=>Uit(e,t)}}function kit(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=Hit(e.scripts[0],n,e)}catch{return z_e=!1,H_e(e,t)}Object.assign(e,{worker:o,interface:{run:()=>Vit(e,{chunkSize:i})}})}return e.interface}async function Uit({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new t8(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:l}=r;return{signature:s,inputSize:a,outputSize:l}}finally{i()}}async function Vit(e,t){let n,i,o=new Promise((p,g)=>{n=p,i=g});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:l,closed:u}=zit(e.writable),f=r8({type:F_e,scripts:a.slice(1),options:s,config:t,readable:r,writable:l},e);f||Object.assign(e,{reader:r.getReader(),writer:l.getWriter()});let h=await o;return f||await l.getWriter().close(),await u,h}function zit(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 U_e=!0,V_e=!0;function Hit(e,t,n){let i={type:"module"},o,r;typeof e==ig&&(e=e());try{o=new URL(e,t)}catch{o=e}if(U_e)try{r=new Worker(o)}catch{U_e=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(N_e,s=>Git(s,n)),r}function r8(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,l=[];if(r&&(r.byteLength!x.busy);if(b)return j_e(b),new VS(b,e,t,y);if(wT.lengthX7.push({resolve:x,stream:e,workerOptions:t}))}function y(b){if(X7.length){let[{resolve:x,stream:A,workerOptions:C}]=X7.splice(0,1);x(new VS(b,A,C,y))}else b.worker?(j_e(b),jit(b,t)):wT=wT.filter(x=>x!=b)}}function jit(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{wT=wT.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function j_e(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var Wit="Writer iterator completed too soon",qit="text/plain";var Yit="Content-Type";var Xit=64*1024,Z7="writable",zS=class{constructor(){this.size=0}init(){this.initialized=!0}},a8=class extends zS{get readable(){let t=this,{chunkSize:n=Xit}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:l}=this;o.enqueue(await Ga(t,r+l,Math.min(n,s-l),a)),l+n>s?o.close():this.chunkOffset+=n}});return i}},K7=class extends zS{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,Z7,{get(){return n}})}writeUint8Array(){}};var c8=class extends K7{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;i2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},sg=class extends a8{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||on&&(s=s.slice(t,o)),new Uint8Array(s)}},SF=class extends zS{constructor(t){super();let n=this,i=new null,o=[];t&&o.push([Yit,t]),Object.defineProperty(n,Z7,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},l8=class extends sg{constructor(t){super(new Blob([t],{type:qit}))}},u8=class extends SF{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();if(i.text&&n)return i.text();{let o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(i,t)})}}};var $7=class extends a8{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(i,o)=>{await i.init(),o!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let o=this,{readers:r}=this,s,a=i;a==-1&&(a=r.length-1);let l=t;for(;l>=r[a].size;)l-=r[a].size,a++;let u=r[a],f=u.size;if(l+n<=f)s=await Ga(u,l,n);else{let h=f-l;s=new Uint8Array(n),s.set(await Ga(u,l,h)),s.set(await o.readUint8Array(t+h,n-h,i),h)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},f8=class extends zS{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(f){let{availableSize:h}=i;if(s)f.length>=h?(await l(f.slice(0,h)),await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(f.slice(h))):await l(f);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(Wit);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Ym(o),r=p.writable,s=r.getWriter(),await this.write(f)}},async close(){await s.ready,await u()}});Object.defineProperty(i,Z7,{get(){return a}});async function l(f){let h=f.length;h&&(await s.ready,await s.write(f),o.size+=h,i.size+=h,i.availableSize-=h)}async function u(){r.size=o.size,await s.close()}}};async function Ym(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function d8(e){return Array.isArray(e)&&(e=new $7(e)),e instanceof ReadableStream&&(e={readable:e}),e}function h8(e){e.writable===Pi&&typeof e.next==ig&&(e=new f8(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Pi&&(t.size=0),e instanceof f8||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Ga(e,t,n,i){return e.readUint8Array(t,n,i)}var W_e="\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(""),Kit=W_e.length==256;function q_e(e){if(Kit){let t="";for(let n=0;nthis[n]=t[n])}};var dY="File format is not recognized",eot="End of central directory not found",tot="End of Zip64 central directory locator not found",not="Central directory header not found",iot="Local file header not found",oot="Zip64 extra field not found",rot="File contains encrypted entry",sot="Encryption method not supported",K_e="Compression method not supported",$_e="Split zip file",Z_e="utf-8",Q_e="cp437",aot=[[nY,4294967295],[iY,4294967295],[oY,4294967295],[m8,65535]],cot={[65535]:{getValue:Ts,bytes:4},[4294967295]:{getValue:g8,bytes:8}},E8=class{constructor(t,n={}){Object.assign(this,{reader:d8(t),options:n,config:gF()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Ym(i),(i.size===Pi||!i.readUint8Array)&&(i=new sg(await new Response(i.readable).blob()),await Ym(i)),i.size<22)throw new Error(dY);i.chunkSize=q4(o);let r=await hot(i,101010256,i.size,22,65535*16);if(!r){let F=await Ga(i,0,4),_=Ea(F);throw Ts(_)==134695760?new Error($_e):new Error(eot)}let s=Ea(r),a=Ts(s,12),l=Ts(s,16),u=r.offset,f=Ca(s,20),h=u+22+f,p=Ca(s,4),g=i.lastDiskNumber||0,m=Ca(s,6),y=Ca(s,8),b=0,x=0;if(l==4294967295||a==4294967295||y==65535||m==65535){let F=await Ga(i,r.offset-20,20),_=Ea(F);if(Ts(_,0)==117853008){l=g8(_,8);let w=await Ga(i,l,56,-1),D=Ea(w),I=r.offset-20-56;if(Ts(D,0)!=101075792&&l!=I){let N=l;l=I,b=l-N,w=await Ga(i,l,56,-1),D=Ea(w)}if(Ts(D,0)!=101075792)throw new Error(tot);p==65535&&(p=Ts(D,16)),m==65535&&(m=Ts(D,20)),y==65535&&(y=g8(D,32)),a==4294967295&&(a=g8(D,40)),l-=a}}if(l>=i.size&&(b=i.size-l-a-22,l=i.size-a-22),g!=p)throw new Error($_e);if(l<0)throw new Error(dY);let A=0,C=await Ga(i,l,a,m),S=Ea(C);if(a){let F=r.offset-a;if(Ts(S,A)!=33639248&&l!=F){let _=l;l=F,b+=l-_,C=await Ga(i,l,a,m),S=Ea(C)}}let v=r.offset-l-(i.lastDiskOffset||0);if(a!=v&&v>=0&&(a=v,C=await Ga(i,l,a,m),S=Ea(C)),l<0||l>=i.size)throw new Error(dY);let P=ml(n,t,"filenameEncoding"),M=ml(n,t,"commentEncoding");for(let F=0;F_.getData(Ee,Ae,ze),A=U;let{onprogress:Pe}=t;if(Pe)try{await Pe(F+1,y,new b0(_))}catch{}yield Ae}let R=ml(n,t,"extractPrependedData"),L=ml(n,t,"extractAppendedData");return R&&(n.prependedData=x>0?await Ga(i,0,x):new Uint8Array),n.comment=f?await Ga(i,u+22,f):new Uint8Array,L&&(n.appendedData=h>>8&255:p>>>24&255),signature:p,compressed:u!=0&&!v,encrypted:o.encrypted&&!v,useWebWorkers:ml(o,i,"useWebWorkers"),useCompressionStream:ml(o,i,"useCompressionStream"),transferStreams:ml(o,i,"transferStreams"),checkPasswordOnly:w},config:f,streamOptions:{signal:_,size:L,onstart:I,onprogress:N,onend:k}},V=0;try{({outputSize:V}=await s8({readable:F,writable:D},z))}catch(j){if(!w||j.message!=rg)throw j}finally{let j=ml(o,i,"preventClose");D.size+=V,!j&&!D.locked&&await D.getWriter().close()}return w?Pi:t.getData?t.getData():D}};function ege(e,t,n){let i=e.rawBitFlag=Ca(t,n+2),o=(i&1)==1,r=Ts(t,n+6);Object.assign(e,{encrypted:o,version:Ca(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:mot(r),filenameLength:Ca(t,n+22),extraFieldLength:Ca(t,n+24)})}function tge(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=Ea(new Uint8Array(r)),l=0;try{for(;lt[o]==r);for(let o=0,r=0;o=5&&(r.push(HS),s.push(p8));let a=1;r.forEach((l,u)=>{if(e.data.length>=a+4){let f=Ts(i,a);t[l]=e[l]=new Date(f*1e3);let h=s[u];e[h]=f}a+=4})}async function hot(e,t,n,i,o){let r=new Uint8Array(4),s=Ea(r);pot(s,0,t);let a=i+o;return await l(i)||await l(Math.min(a,n));async function l(u){let f=n-u,h=await Ga(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 ml(e,t,n){return t[n]===Pi?e.options[n]:t[n]}function mot(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 hY(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function GS(e,t){return e.getUint8(t)}function Ca(e,t){return e.getUint16(t,!0)}function Ts(e,t){return e.getUint32(t,!0)}function g8(e,t){return Number(e.getBigUint64(t,!0))}function pot(e,t,n){e.setUint32(t,n,!0)}function Ea(e){return new DataView(e.buffer)}var bot="File already exists",xot="Zip file comment exceeds 64KB",Tot="File entry comment exceeds 64KB",Aot="File entry name exceeds 64KB",oge="Version exceeds 65535",Cot="The strength must equal 1, 2, or 3",Eot="Extra field type exceeds 65535",Sot="Extra field data exceeds 64KB",DY="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",wot="Undefined uncompressed size",rge=new Uint8Array([7,0,2,0,65,69,3,0,0]),wY=0,sge=[],v8=class{constructor(t,n={}){t=h8(t);let i=t.availableSize!==Pi&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Pi&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:gF(),files:new Map,filenames:new Set,offset:n.offset===Pi?t.writable.size:n.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;wYsge.push(l));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(bot);return o.filenames.add(t),a=vot(o,t,n,i),r.add(a),await a}catch(l){throw o.filenames.delete(t),l}finally{r.delete(a);let l=sge.shift();l?l():wY--}}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await Fot(this,t,n),po(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function vot(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(NS)?t+=NS:i.directory=t.endsWith(NS);let o=po(e,i,"encodeText",BS),r=o(t);if(r===Pi&&(r=BS(t)),Qi(r)>65535)throw new Error(Aot);let s=i.comment||"",a=o(s);if(a===Pi&&(a=BS(s)),Qi(a)>65535)throw new Error(Tot);let l=po(e,i,lY,20);if(l>65535)throw new Error(oge);let u=po(e,i,uY,20);if(u>65535)throw new Error(oge);let f=po(e,i,HS,new Date),h=po(e,i,vF),p=po(e,i,DF),g=po(e,i,aY,!0),m=po(e,i,rY,0),y=po(e,i,sY,0),b=po(e,i,"passThrough"),x,A;b||(x=po(e,i,"password"),A=po(e,i,"rawPassword"));let C=po(e,i,"encryptionStrength",3),S=po(e,i,fY),v=po(e,i,"extendedTimestamp",!0),P=po(e,i,"keepOrder",!0),M=po(e,i,"level"),R=po(e,i,"useWebWorkers"),L=po(e,i,"bufferedWrite"),F=po(e,i,"dataDescriptorSignature",!1),_=po(e,i,"signal"),w=po(e,i,"useUnicodeFileNames",!0),D=po(e,i,"useCompressionStream"),I=po(e,i,"compressionMethod"),N=po(e,i,"dataDescriptor",!0),k=po(e,i,_8);if(!S&&(x!==Pi||A!==Pi)&&!(C>=1&&C<=3))throw new Error(Cot);let z=new Uint8Array,{extraField:V}=i;if(V){let Dt=0,jt=0;V.forEach($e=>Dt+=4+Qi($e)),z=new Uint8Array(Dt),V.forEach(($e,un)=>{if(un>65535)throw new Error(Eot);if(Qi($e)>65535)throw new Error(Sot);Ms(z,new Uint16Array([un]),jt),Ms(z,new Uint16Array([Qi($e)]),jt+2),Ms(z,$e,jt+4),jt+=4+Qi($e)})}let j=0,U=0,q=0;if(b&&({uncompressedSize:q}=i,q===Pi))throw new Error(wot);let Y=k===!0;n&&(n=d8(n),await Ym(n),b?j=age(q):n.size===Pi?(N=!0,(k||k===Pi)&&(k=!0,q=j=4294967296)):(q=n.size,j=age(q)));let{diskOffset:te,diskNumber:K,maxSize:Z}=e.writer,ee=Y||q>4294967295,me=Y||j>4294967295,Te=Y||e.offset+e.pendingEntriesSize-te>4294967295,ye=po(e,i,"supportZip64SplitFile",!0)&&Y||K+Math.ceil(e.pendingEntriesSize/Z)>65535;if(Te||ee||me||ye){if(k===!1||!P)throw new Error(DY);k=!0}k=k||!1;let Ae=po(e,i,cY),{signature:Pe}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:l,versionMadeBy:u,lastModDate:f,lastAccessDate:h,creationDate:p,rawExtraField:z,zip64:k,zip64UncompressedSize:ee,zip64CompressedSize:me,zip64Offset:Te,zip64DiskNumberStart:ye,password:x,rawPassword:A,level:!D&&e.config.CompressionStream===Pi&&e.config.CompressionStreamNative===Pi?0:M,useWebWorkers:R,encryptionStrength:C,extendedTimestamp:v,zipCrypto:S,bufferedWrite:L,keepOrder:P,useUnicodeFileNames:w,dataDescriptor:N,dataDescriptorSignature:F,signal:_,msDosCompatible:g,internalFileAttribute:m,externalFileAttribute:y,useCompressionStream:D,passThrough:b,encrypted:!!(x&&Qi(x)||A&&Qi(A))||b&&Ae,signature:Pe,compressionMethod:I});let Ee=Iot(i),ze=Rot(i),qe=Qi(Ee.localHeaderArray,ze.dataDescriptorArray);U=qe+j,e.options.usdz&&(U+=U+64),e.pendingEntriesSize+=U;let it;try{it=await Dot(e,t,n,{headerInfo:Ee,dataDescriptorInfo:ze,metadataSize:qe},i)}finally{e.pendingEntriesSize-=U}return Object.assign(it,{name:t,comment:s,extraField:V}),new b0(it)}async function Dot(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:l,signal:u}=o,{headerInfo:f}=i,{usdz:h}=e.options,p=Array.from(r.values()).pop(),g={},m,y,b,x,A,C,S;r.set(t,g);try{let R;a&&(R=p&&p.lock,v()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!l)&&!h?(C=new null,S=new Response(C.readable).blob(),C.writable.size=0,m=!0,e.bufferedWrites++,await Ym(s)):(C=s,await P()),await Ym(C);let{writable:L}=s,{diskOffset:F}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let w=new Uint8Array(4),D=ja(w);Zi(D,0,134695760),await Xm(L,w),e.offset+=4}h&&Oot(i,e.offset-F),m||(await R,await M(L));let{diskNumber:_}=s;if(A=!0,g.diskNumberStart=_,g=await Pot(n,C,g,i,e.config,o),A=!1,r.set(t,g),g.filename=t,m){await C.writable.getWriter().close();let w=await S;await R,await P(),x=!0,l||(w=await Lot(g,w,L,o)),await M(L),g.diskNumberStart=s.diskNumber,F=s.diskOffset,await w.stream().pipeTo(L,{preventClose:!0,preventAbort:!0,signal:u}),L.size+=w.size,x=!1}if(g.offset=e.offset-F,g.zip64)Not(g,o);else if(g.offset>4294967295)throw new Error(DY);return e.offset+=g.size,g}catch(R){if(m&&x||!m&&A){if(e.hasCorruptedEntries=!0,R)try{R.corruptedEntry=!0}catch{}m?e.offset+=C.writable.size:e.offset=C.writable.size}throw r.delete(t),R}finally{m&&e.bufferedWrites--,b&&b(),y&&y()}function v(){g.lock=new Promise(R=>b=R)}async function P(){e.writerLocked=!0;let{lockWriter:R}=e;e.lockWriter=new Promise(L=>y=()=>{e.writerLocked=!1,L()}),await R}async function M(R){Qi(f.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Xm(R,new Uint8Array))}}async function Pot(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:l,metadataSize:u}=o,{localHeaderArray:f,headerArray:h,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:y,version:b,compressionMethod:x,rawExtraFieldExtendedTimestamp:A,extraFieldExtendedTimestampFlag:C,rawExtraFieldNTFS:S,rawExtraFieldAES:v}=a,{dataDescriptorArray:P}=l,{rawFilename:M,lastAccessDate:R,creationDate:L,password:F,rawPassword:_,level:w,zip64:D,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:k,zip64DiskNumberStart:z,zipCrypto:V,dataDescriptor:j,directory:U,versionMadeBy:q,rawComment:Y,rawExtraField:te,useWebWorkers:K,onstart:Z,onprogress:ee,onend:me,signal:Te,encryptionStrength:ue,extendedTimestamp:ye,msDosCompatible:Ae,internalFileAttribute:Pe,externalFileAttribute:Ee,useCompressionStream:ze,passThrough:qe}=s,it={lock:i,versionMadeBy:q,zip64:D,directory:!!U,filenameUTF8:!0,rawFilename:M,commentUTF8:!0,rawComment:Y,rawExtraFieldExtendedTimestamp:A,rawExtraFieldNTFS:S,rawExtraFieldAES:v,rawExtraField:te,extendedTimestamp:ye,msDosCompatible:Ae,internalFileAttribute:Pe,externalFileAttribute:Ee,diskNumberStart:n},{signature:Dt,uncompressedSize:jt}=s,$e=0;qe||(jt=0);let{writable:un}=t;if(e){e.chunkSize=q4(r),await Xm(un,f);let Ct=e.readable,Ei=Ct.size=e.size,an={options:{codecType:i8,level:w,rawPassword:_,password:F,encryptionStrength:ue,zipCrypto:m&&V,passwordVerification:m&&V&&g>>8&255,signed:!qe,compressed:y&&!qe,encrypted:m&&!qe,useWebWorkers:K,useCompressionStream:ze,transferStreams:!1},config:r,streamOptions:{signal:Te,size:Ei,onstart:Z,onprogress:ee,onend:me}},_e=await s8({readable:Ct,writable:un},an);$e=_e.outputSize,qe||(jt=_e.inputSize,Dt=_e.signature),un.size+=jt}else await Xm(un,f);let zt;if(D){let Ct=4;I&&(Ct+=8),N&&(Ct+=8),k&&(Ct+=8),z&&(Ct+=4),zt=new Uint8Array(Ct)}else zt=new Uint8Array;return Mot({signature:Dt,rawExtraFieldZip64:zt,compressedSize:$e,uncompressedSize:jt,headerInfo:a,dataDescriptorInfo:l},s),j&&await Xm(un,P),Object.assign(it,{uncompressedSize:jt,compressedSize:$e,lastModDate:p,rawLastModDate:g,creationDate:L,lastAccessDate:R,encrypted:m,zipCrypto:V,size:u+$e,compressionMethod:x,version:b,headerArray:h,signature:Dt,rawExtraFieldZip64:zt,extraFieldExtendedTimestampFlag:C,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:k,zip64DiskNumberStart:z}),it}function Iot(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:l,dataDescriptor:u,directory:f,rawExtraField:h,encryptionStrength:p,extendedTimestamp:g,encrypted:m}=e,{version:y,compressionMethod:b}=e,x=!f&&(r>0||r===Pi&&b!==0),A;if(m&&!a){A=new Uint8Array(Qi(rge)+2);let k=ja(A);oo(k,0,39169),Ms(A,rge,2),D8(k,8,p)}else A=new Uint8Array;let C,S,v;if(g){S=new Uint8Array(9+(i?4:0)+(o?4:0));let k=ja(S);oo(k,0,21589),oo(k,2,Qi(S)-4),v=1+(i?2:0)+(o?4:0),D8(k,4,v);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{C=new Uint8Array(36);let V=ja(C),j=vY(n);oo(V,0,10),oo(V,2,32),oo(V,8,1),oo(V,10,24),Jl(V,12,j),Jl(V,20,vY(i)||j),Jl(V,28,vY(o)||j)}catch{C=new Uint8Array}}else C=S=new Uint8Array;let P=0;l&&(P=P|2048),u&&(P=P|8),b===Pi&&(b=x?8:0),b==8&&(r>=1&&r<3&&(P=P|6),r>=3&&r<5&&(P=P|1),r===9&&(P=P|2)),s&&(y=y>45?y:45),m&&(P=P|1,a||(y=y>51?y:51,A[9]=b,b=99));let M=new Uint8Array(26),R=ja(M);oo(R,0,y),oo(R,2,P),oo(R,4,b);let L=new Uint32Array(1),F=ja(L),_;nB7?_=B7:_=n,oo(F,0,(_.getHours()<<6|_.getMinutes())<<5|_.getSeconds()/2),oo(F,2,(_.getFullYear()-1980<<4|_.getMonth()+1)<<5|_.getDate());let w=L[0];Zi(R,6,w),oo(R,22,Qi(t));let D=Qi(A,S,C,h);oo(R,24,D);let I=new Uint8Array(30+Qi(t)+D),N=ja(I);return Zi(N,0,67324752),Ms(I,M,4),Ms(I,t,30),Ms(I,A,30+Qi(t)),Ms(I,S,30+Qi(t,A)),Ms(I,C,30+Qi(t,A,S)),Ms(I,h,30+Qi(t,A,S,C)),{localHeaderArray:I,headerArray:M,headerView:R,lastModDate:n,rawLastModDate:w,encrypted:m,compressed:x,version:y,compressionMethod:b,extraFieldExtendedTimestampFlag:v,rawExtraFieldExtendedTimestamp:S,rawExtraFieldNTFS:C,rawExtraFieldAES:A,extraFieldLength:D}}function Oot(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=ja(i),s=64-(t+Qi(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),l=ja(a);oo(l,0,6534),oo(l,2,s-2);let u=i;n.localHeaderArray=i=new Uint8Array(Qi(u)+s),Ms(i,u),Ms(i,a,Qi(u)),r=ja(i),oo(r,28,o+s),e.metadataSize+=s}function Rot(e){let{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e,o=new Uint8Array,r,s=0;return n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=ja(o),i&&(s=4,Zi(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function Mot(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:l,encrypted:u}=s,{dataDescriptorView:f,dataDescriptorOffset:h}=a,{zip64:p,zip64UncompressedSize:g,zip64CompressedSize:m,zipCrypto:y,dataDescriptor:b}=t;if((!u||y)&&n!==Pi&&(Zi(l,10,n),b&&Zi(f,h,n)),p){let x=ja(i);oo(x,0,1),oo(x,2,Qi(i)-4);let A=4;g&&(Zi(l,18,4294967295),Jl(x,A,BigInt(r)),A+=8),m&&(Zi(l,14,4294967295),Jl(x,A,BigInt(o))),b&&(Jl(f,h+4,BigInt(o)),Jl(f,h+12,BigInt(r)))}else Zi(l,14,o),Zi(l,18,r),b&&(Zi(f,h+4,o),Zi(f,h+8,r))}async function Lot(e,t,n,{zipCrypto:i}){let o;o=await t.slice(0,26).arrayBuffer(),o.byteLength!=26&&(o=o.slice(0,26));let r=new DataView(o);return(!e.encrypted||i)&&Zi(r,14,e.signature),e.zip64?(Zi(r,18,4294967295),Zi(r,22,4294967295)):(Zi(r,18,e.compressedSize),Zi(r,22,e.uncompressedSize)),await Xm(n,new Uint8Array(o)),t.slice(o.byteLength)}function Not(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:l}=t,u=ja(n),f=4;r&&(f+=8),s&&(f+=8),a&&(Jl(u,f,BigInt(i)),f+=8),l&&Zi(u,f,o)}async function Fot(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,l=0,u=0,f=e.offset-r,h=i.size;for(let[,v]of i){let{rawFilename:P,rawExtraFieldZip64:M,rawExtraFieldAES:R,rawComment:L,rawExtraFieldNTFS:F,rawExtraField:_,extendedTimestamp:w,extraFieldExtendedTimestampFlag:D,lastModDate:I}=v,N;if(w){N=new Uint8Array(9);let k=ja(N);oo(k,0,21589),oo(k,2,5),D8(k,4,D),Zi(k,5,Math.floor(I.getTime()/1e3))}else N=new Uint8Array;v.rawExtraFieldCDExtendedTimestamp=N,u+=46+Qi(P,L,M,R,F,N,_)}let p=new Uint8Array(u),g=ja(p);await Ym(o);let m=0;for(let[v,P]of Array.from(i.values()).entries()){let{offset:M,rawFilename:R,rawExtraFieldZip64:L,rawExtraFieldAES:F,rawExtraFieldCDExtendedTimestamp:_,rawExtraFieldNTFS:w,rawExtraField:D,rawComment:I,versionMadeBy:N,headerArray:k,directory:z,zip64:V,zip64UncompressedSize:j,zip64CompressedSize:U,zip64DiskNumberStart:q,zip64Offset:Y,msDosCompatible:te,internalFileAttribute:K,externalFileAttribute:Z,diskNumberStart:ee,uncompressedSize:me,compressedSize:Te}=P,ue=Qi(L,F,_,w,D);Zi(g,l,33639248),oo(g,l+4,N);let ye=ja(k);j||Zi(ye,18,me),U||Zi(ye,14,Te),Ms(p,k,l+6),oo(g,l+30,ue),oo(g,l+32,Qi(I)),oo(g,l+34,V&&q?65535:ee),oo(g,l+36,K),Z?Zi(g,l+38,Z):z&&te&&D8(g,l+38,16),Zi(g,l+42,V&&Y?4294967295:M),Ms(p,R,l+46),Ms(p,L,l+46+Qi(R)),Ms(p,F,l+46+Qi(R,L)),Ms(p,_,l+46+Qi(R,L,F)),Ms(p,w,l+46+Qi(R,L,F,_)),Ms(p,D,l+46+Qi(R,L,F,_,w)),Ms(p,I,l+46+Qi(R)+ue);let Ae=46+Qi(R,I)+ue;if(l-m>o.availableSize&&(o.availableSize=0,await Xm(s,p.slice(m,l)),m=l),l+=Ae,n.onprogress)try{await n.onprogress(v+1,i.size,new b0(P))}catch{}}await Xm(s,m?p.slice(m):p);let y=o.diskNumber,{availableSize:b}=o;b<22&&y++;let x=po(e,n,_8);if(f>4294967295||u>4294967295||h>65535||y>65535){if(x===!1)throw new Error(DY);x=!0}let A=new Uint8Array(x?98:22),C=ja(A);l=0,x&&(Zi(C,0,101075792),Jl(C,4,BigInt(44)),oo(C,12,45),oo(C,14,45),Zi(C,16,y),Zi(C,20,a),Jl(C,24,BigInt(h)),Jl(C,32,BigInt(h)),Jl(C,40,BigInt(u)),Jl(C,48,BigInt(f)),Zi(C,56,117853008),Jl(C,64,BigInt(f)+BigInt(u)),Zi(C,72,y+1),po(e,n,"supportZip64SplitFile",!0)&&(y=65535,a=65535),h=65535,f=4294967295,u=4294967295,l+=76),Zi(C,l,101010256),oo(C,l+4,y),oo(C,l+6,a),oo(C,l+8,h),oo(C,l+10,h),Zi(C,l+12,u),Zi(C,l+16,f);let S=Qi(t);if(S)if(S<=65535)oo(C,l+20,S);else throw new Error(xot);await Xm(s,A),S&&await Xm(s,t)}async function Xm(e,t){let n=e.getWriter();try{await n.ready,e.size+=Qi(t),await n.write(t)}finally{n.releaseLock()}}function vY(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function po(e,t,n,i){let o=t[n]===Pi?e.options[n]:t[n];return o===Pi?i:o}function age(e){return e+5*(Math.floor(e/16383)+1)}function D8(e,t,n){e.setUint8(t,n)}function oo(e,t,n){e.setUint16(t,n,!0)}function Zi(e,t,n){e.setUint32(t,n,!0)}function Jl(e,t,n){e.setBigUint64(t,n,!0)}function Ms(e,t,n){e.set(t,n)}function ja(e){return new DataView(e.buffer)}function Qi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}FS({Deflate:Wpe,Inflate:h_e});var PY=32,Bot="http://www.opengis.net/kml/2.2",Lh="http://www.google.com/kml/ext/2.2",kot="http://www.w3.org/2000/xmlns/";function P8(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Uot=/^data:image\/([^,;]+)/;P8.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof we){if(e=we.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Uot);n=`texture_${++this._count}`,c(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 Vot(e,t){return function(n){e._files[t]=n}}P8.prototype.model=function(e,t){let n=this._modelCallback;if(!c(n))throw new ae("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(Vot(this,r))}return o};Object.defineProperties(P8.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function I8(e){this._time=e}I8.prototype.get=function(e,t,n){let i;return c(e)&&(i=c(e.getValue)?e.getValue(this._time,n):e),i??t};I8.prototype.getColor=function(e,t){let n=this.get(e,t);if(c(n))return DT(n)};I8.prototype.getMaterialType=function(e){if(c(e))return e.getType(this._time)};function IY(){this._ids={},this._styles={},this._count=0}IY.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(c(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};IY.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 fge(){this._ids={}}fge.prototype.get=function(e){if(!c(e))return this.get(jn());let t=this._ids;return c(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function OY(e){e=e??W.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1;if(!c(t))throw new E("entities is required.");let i=OY._createState(e),o=t.values.filter(function(u){return!c(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(kot,"xmlns:gx",Lh);let a=r.createElement("Document");s.appendChild(a),hge(i,a,o),i.styleCache.save(a);let l=i.externalFileHandler;return l.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?zot(f,l.files):{kml:f,externalFiles:l.files}})}function zot(e,t){let n=tn("ThirdParty/Workers/z-worker-pako.js");FS({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new SF,o=new v8(i);return o.add("doc.kml",new l8(e)).then(function(){let r=Object.keys(t);return dge(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function dge(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new sg(n[o])).then(function(){return dge(e,t,n,i+1)})}OY._createState=function(e){let t=e.entities,n=new IY,i=t.computeAvailability(),o=c(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===Ge.MINIMUM_VALUE?r.stop===Ge.MAXIMUM_VALUE?r=new En:Q.addSeconds(r.stop,-10*s,r.start):r.stop===Ge.MAXIMUM_VALUE&&Q.addSeconds(r.start,10*s,r.stop);let a=new P8(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Bot,"kml"),ellipsoid:e.ellipsoid??ie.default,idManager:new fge,styleCache:n,externalFileHandler:a,time:o,valueGetter:new I8(o),sampleDuration:s,defaultAvailability:new Xr([r])}};function hge(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,l,u,f;for(let h=0;h0){let x=i.createElement("Placemark");x.setAttribute("id",s.get(p.id));let A=p.name,C=p.label;if(c(C)){let v=i.createElement("LabelStyle"),P=r.get(C.text);A=c(P)&&P.length>0?P:A;let M=r.getColor(C.fillColor);c(M)&&(v.appendChild(dn(i,"color",M)),v.appendChild(dn(i,"colorMode","normal")));let R=r.get(C.scale);c(R)&&v.appendChild(dn(i,"scale",R)),f.push(v)}x.appendChild(dn(i,"name",A)),x.appendChild(dn(i,"visibility",p.show)),x.appendChild(dn(i,"description",p.description)),c(g)&&x.appendChild(g),t.appendChild(x);let S=f.length;if(S>0){let v=i.createElement("Style");for(let P=0;P1){let v=i.createElement("MultiGeometry");for(let P=0;P0){let x=i.createElement("Folder");x.setAttribute("id",s.get(p.id)),x.appendChild(dn(i,"name",p.name)),x.appendChild(dn(i,"visibility",p.show)),x.appendChild(dn(i,"description",p.description)),t.appendChild(x),hge(e,x,b)}}}var eu=new d,pl=new he,Mh=new Q;function Hot(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!c(a)&&!c(t.path))return;let l=t.position;if(!l.isConstant){mge(e,t,a,n,i);return}s.get(l,void 0,eu);let u=dn(o,"coordinates",vT(eu,r)),f=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(PT(e,a.heightReference)),f.appendChild(h),f.appendChild(u),n.push(f);let p=a instanceof fc?_ge(e,a):pge(e,a);i.push(p)}function mge(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,l,u=t.position,f=!0;u instanceof ba?(l=u.intervals,f=!1):l=t.availability??e.defaultAvailability;let h=n instanceof Gp,p,g,m,y=[];for(p=0;p1){let x=r.createElementNS(Lh,"MultiTrack");for(p=0;p0&&(r=n);let s=t.coordinates,a=o.get(s),l=[],u=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)u[g](a,pl),l.push(`${O.toDegrees(pl.longitude)},${O.toDegrees(pl.latitude)},${r}`);let f=dn(i,"coordinates",l.join(" ")),h=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),h.appendChild(p),[h]}function lge(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let f=0;f0&&(r=n);let a=[],l=t.hierarchy,u=o.get(l),f=Array.isArray(u)?u:u.positions,h=i.createElement("outerBoundaryIs");h.appendChild(lge(e,f,r,s)),a.push(h);let p=u.holes;if(c(p)){let g=p.length;for(let m=0;m0&&l.appendChild(dn(r,"extrude",!0));let f=a?jot(e,t,u):Wot(e,t,u),h=f.length;for(let b=0;b=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var MY=OY;function RF(){this._cache={}}RF.prototype.fromColor=function(e,t){if(!c(e))throw new E("color is required");if(!c(t))throw new E("size is required");return O8(void 0,void 0,e,t,this._cache)};RF.prototype.fromUrl=function(e,t,n){if(!c(e))throw new E("url is required");if(!c(t))throw new E("color is required");if(!c(n))throw new E("size is required");return O8(e,void 0,t,n,this._cache)};RF.prototype.fromMakiIconId=function(e,t,n){if(!c(e))throw new E("id is required");if(!c(t))throw new E("color is required");if(!c(n))throw new E("size is required");return O8(tn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};RF.prototype.fromText=function(e,t,n){if(!c(e))throw new E("text is required");if(!c(t))throw new E("color is required");if(!c(n))throw new E("size is required");return O8(void 0,e,t,n,this._cache)};var Xot=new G;function Kot(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Xot).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 yge(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width${i}${Ege(o)}`:n+=`${i}${o}`)}return n.length>0&&(n=`${n}
`),n}function Qot(e,t,n){let i;return function(o,r){return c(i)||(i=e(t,n)),i}}function Jot(e,t){return new Wd(Qot(Ege,e,t),!0)}function L8(e,t,n){let i=e.id;if(!c(i)||e.type!=="Feature")i=jn();else{let s=2,a=i;for(;c(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(c(r)){o.properties=r;let s,a=r.title;if(c(a))o.name=a,s="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,s=f;break}else u>2&&h==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}c(s)&&(o.name=r[s])}let l=r.description;l!==null&&(o.description=c(l)?new Kn(l):n(r,s))}return o}function HY(e,t){let n=new Array(e.length);for(let i=0;i2?u.perPositionHeight=new Kn(!0):o.clampToGround||(u.height=0);let p=L8(t,e._entityCollection,o.describe);p.polygon=u}function Fge(e,t,n,i,o){Nge(e,t,i,n.coordinates,o)}function Bge(e,t,n,i,o){let r=n.coordinates;for(let s=0;s{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function dX(e,t){let n=FF(e,"id");return n=c(n)?n:jn(),t.getOrCreateEntity(n)}function hX(e){let t=kye(e,"lon"),n=kye(e,"lat"),i=LF(e,"ele",Do.gpx);return d.fromDegrees(t,n,i)}function kye(e,t){if(!c(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function FF(e,t){if(!c(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function A0(e,t,n){if(!c(e))return;let i=e.childNodes,o=i.length;for(let r=0;r${h.text}: ${h.value}

`)}if(!c(i)||i==="")return;i=Qst.link(i),NF.innerHTML=i;let s=NF.querySelectorAll("a");for(n=0;n',u+=`${NF.innerHTML}`,NF.innerHTML="",u}function qye(e,t,n,i){let o=hX(t),r=dX(t,n);r.position=o;let s=c(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",G.RED,J8);r.billboard=jye(s);let a=tu(t,"name",Do.gpx);r.name=a,r.label=tat(),r.label.text=a,r.description=pX(t,r),i.clampToGround&&(r.billboard.heightReference=We.CLAMP_TO_GROUND,r.label.heightReference=We.CLAMP_TO_GROUND)}function nat(e,t,n,i){let o=dX(t,n);o.description=pX(t,o);let r=mX(t,"rtept",Do.gpx),s=new Array(r.length);for(let a=0;a0?(a=a.concat(l.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let h=c(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",G.RED,J8);o.billboard=jye(h),o.position=f,i.clampToGround&&(o.billboard.heightReference=We.CLAMP_TO_GROUND),o.availability=new Xr,o.availability.addInterval(new En({start:a[0],stop:a[a.length-1]}))}o.polyline=Wye(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function oat(e){let t={positions:[],times:[]},n=mX(e,"trkpt",Do.gpx),i;for(let o=0;o=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else c(n)&&n(!1)}function pat(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++,Kye.call(this,e,t,n)}}var VF=eH;var ki=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-ki.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?ki.Bounce.In(e*2)*.5:ki.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e1e4?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}}}}),zF=function(){return performance.now()},_at=function(){function e(){for(var t=[],n=0;n0;){this._tweensAddedDuringUpdate={};for(var o=0;o1?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=ZS.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=ZS.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[n1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,l=o*a;return(2*t-2*n+r+s)*l+(-3*t+3*n-2*r-s)*a+r*o+t}}},$ye=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),_X=new _at,Zye=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=ki.Linear.None,this._interpolationFunction=ZS.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=$ye.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=_X,_X.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=zF()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],l=Array.isArray(a),u=l?"array":typeof a,f=!l&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var h=i[s];if(h.length===0)continue;for(var p=[a],g=0,m=h.length;g"u"||r)&&(n[s]=a),l||(n[s]*=1),f?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=zF()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=zF()),!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;tl)return 1;var y=Math.trunc(s/a),b=s-y*a,x=Math.min(b/i._duration,1);return x===0&&s===i._duration?1:x},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||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,m=this._chainedTweens.length;gthis._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function xat(e){let t=e.slice(0,Math.min(4,e.size)),n=Dl(),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 Tat(e){let t=Dl(),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 l0e(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(c(n)||(n=e.substr(0,e.indexOf("",t),i,o,r;for(;t!==-1&&t0?(nu.maximumRed=r,nu.red=void 0):(nu.maximumRed=void 0,nu.red=0),o>0?(nu.maximumGreen=o,nu.green=void 0):(nu.maximumGreen=void 0,nu.green=0),i>0?(nu.maximumBlue=i,nu.blue=void 0):(nu.maximumBlue=void 0,nu.blue=0),nu.alpha=n,G.fromRandom(nu)):new G(r,o,i,n)}function BT(e,t,n){let i=On(e,t,n);if(c(i))return AX(i,On(e,"colorMode",n)==="random")}function Cat(e){let t=Ui(e,"TimeStamp",Re.kmlgx),n=On(t,"when",Re.kmlgx);if(!c(t)||!c(n)||n.length===0)return;let i=Q.fromIso8601(n),o=new Xr;return o.addInterval(new En({start:i,stop:Ge.MAXIMUM_VALUE})),o}function Eat(e){let t=Ui(e,"TimeSpan",Re.kmlgx);if(!c(t))return;let n,i=Ui(t,"begin",Re.kmlgx),o=c(i)?Q.fromIso8601(i.textContent):void 0,r=Ui(t,"end",Re.kmlgx),s=c(r)?Q.fromIso8601(r.textContent):void 0;if(c(o)&&c(s)){if(Q.lessThan(s,o)){let a=o;o=s,s=a}n=new Xr,n.addInterval(new En({start:o,stop:s}))}else c(o)?(n=new Xr,n.addInterval(new En({start:o,stop:Ge.MAXIMUM_VALUE}))):c(s)&&(n=new Xr,n.addInterval(new En({start:Ge.MINIMUM_VALUE,stop:s})));return n}function d0e(){let e=new fc;return e.width=C0,e.height=C0,e.scaleByDistance=new Bt(Qye,Jye,e0e,t0e),e.pixelOffsetScaleByDistance=new Bt(Qye,Jye,e0e,t0e),e}function vX(){let e=new Gd;return e.outline=!0,e.outlineColor=G.WHITE,e}function h0e(){let e=new Hd;return e.translucencyByDistance=new Bt(3e6,1,5e6,0),e.pixelOffset=new H(17,0),e.horizontalOrigin=bi.LEFT,e.font="16px sans-serif",e.style=Yo.FILL_AND_OUTLINE,e}function DX(e,t,n,i,o){let r=On(e,"href",Re.kml);if(!c(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),l=Jn(e,"x",Re.gx)??0,u=Jn(e,"y",Re.gx)??0;l=Math.min(l/32,7),u=7-Math.min(u/32,7);let f=8*u+l;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=wX(r,n,i);if(o){let a=On(e,"refreshMode",Re.kml),l=On(e,"viewRefreshMode",Re.kml);a==="onInterval"||a==="onExpire"?dt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(l==="onStop"||l==="onRegion")&&dt(`kml-refreshMode-${l}`,`KML - Unsupported Icon viewRefreshMode: ${l}`);let u=On(e,"viewBoundScale",Re.kml)??1,f=l==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=On(e,"viewFormat",Re.kml)??f,p=On(e,"httpQuery",Re.kml);c(h)&&s.setQueryParameters(hu(oH(h))),c(p)&&s.setQueryParameters(hu(oH(p)));let g=t._ellipsoid;return IX(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function Sat(e,t,n,i,o){let r=Jn(t,"scale",Re.kml),s=Jn(t,"heading",Re.kml),a=BT(t,"color",Re.kml),l=Ui(t,"Icon",Re.kml),u=DX(l,e,i,o,!1);c(l)&&!c(u)&&(u=!1);let f=Jn(l,"x",Re.gx),h=Jn(l,"y",Re.gx),p=Jn(l,"w",Re.gx),g=Jn(l,"h",Re.gx),m=Ui(t,"hotSpot",Re.kml),y=E0(m,"x"),b=E0(m,"y"),x=Ns(m,"xunits"),A=Ns(m,"yunits"),C=n.billboard;c(C)||(C=d0e(),n.billboard=C),C.image=u,C.scale=r,C.color=a,(c(f)||c(h)||c(p)||c(g))&&(C.imageSubRegion=new Ke(f,h,p,g)),c(s)&&s!==0&&(C.rotation=O.toRadians(-s),C.alignedAxis=d.UNIT_Z),r=r??1;let S,v;c(y)&&(x==="pixels"?S=-y*r:x==="insetPixels"?S=(y-C0)*r:x==="fraction"&&(S=-y*C0*r),S+=C0*.5*r),c(b)&&(A==="pixels"?v=b*r:A==="insetPixels"?v=(-b+C0)*r:A==="fraction"&&(v=b*C0*r),v-=C0*.5*r),(c(S)||c(v))&&(C.pixelOffset=new H(S,v))}function iH(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r:clampToSeaFloor is currently not supported, using :clampToGround."),We.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(dt("kml-gx:altitudeMode-relativeToSeaFloor","KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),We.RELATIVE_TO_GROUND):(c(e)?dt("kml-altitudeMode-unknown",`KML - Unknown :${e}, using :CLAMP_TO_GROUND.`):dt("kml-gx:altitudeMode-unknown",`KML - Unknown :${t}, using :CLAMP_TO_GROUND.`),We.CLAMP_TO_GROUND)}function Dat(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((c(t)&&t!=="clampToGround"||c(n)&&n!=="clampToSeaFloor")&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new zm(e))}function Pat(e,t,n,i){if(!c(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(c(t)&&t!=="clampToGround"||c(n)&&n!=="clampToSeaFloor")&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r0&&dt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),m=[],y=[];for(let x=0;x0&&i.availability.addInterval(new En({start:y[0],stop:y[y.length-1]})),h&&f&&PX(t,i,o),!0}function s0e(e,t,n,i,o,r,s,a,l){let u=e[0],f=e[e.length-1],h=new Ta;h.addSamples(e,t),n.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:l,isStopIncluded:l,data:Dat(h,s,a)})),i.addInterval(new En({start:u,stop:f,isStartIncluded:l,isStopIncluded:l})),o.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:l,isStopIncluded:l,data:r}))}function Mat(e,t,n,i,o){let r=Bh(n,"interpolate",Re.gx),s=Fh(n,"Track",Re.gx),a,l,u,f=!1,h=new K_,p=new Xr,g=new ba,m=e._ellipsoid;for(let y=0,b=s.length;y0)){for(m='',r=0;r`;m+="
${y.displayName??s}${y.value??""}
"}if(!c(m))return;m=yat.link(m),_o.innerHTML=m;let b=_o.querySelectorAll("a");for(r=0;r1&&(Xu(_o,"a","href",i),Xu(_o,"link","href",i),Xu(_o,"area","href",i),Xu(_o,"img","src",i),Xu(_o,"iframe","src",i),Xu(_o,"video","src",i),Xu(_o,"audio","src",i),Xu(_o,"source","src",i),Xu(_o,"track","src",i),Xu(_o,"input","src",i),Xu(_o,"embed","src",i),Xu(_o,"script","src",i),Xu(_o,"video","poster",i)),Ku(_o,"a","href",o),Ku(_o,"link","href",o),Ku(_o,"area","href",o),Ku(_o,"img","src",o),Ku(_o,"iframe","src",o),Ku(_o,"video","src",o),Ku(_o,"audio","src",o),Ku(_o,"source","src",o),Ku(_o,"track","src",o),Ku(_o,"input","src",o),Ku(_o,"embed","src",o),Ku(_o,"script","src",o),Ku(_o,"video","poster",o);let x='
',x+=`${_o.innerHTML}
`,_o.innerHTML="",t.description=x}function aH(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=f0e(t,i,n.context),l=a.kml,u=wat(e,t,n.styleCollection,r,s),f=On(t,"name",Re.kml);a.name=f,a.parent=o;let h=Eat(t);c(h)||(h=Cat(t)),a.availability=h,RX(a);function p(C){return C?C.show&&p(C.parent):!0}let g=Bh(t,"visibility",Re.kml);a.show=p(o)&&(g??!0);let m=Ui(t,"author",Re.atom),y=l.author;y.name=On(m,"name",Re.atom),y.uri=On(m,"uri",Re.atom),y.email=On(m,"email",Re.atom);let b=Ui(t,"link",Re.atom),x=l.link;x.href=Ns(b,"href"),x.hreflang=Ns(b,"hreflang"),x.rel=Ns(b,"rel"),x.type=Ns(b,"type"),x.title=Ns(b,"title"),x.length=Ns(b,"length"),l.address=On(t,"address",Re.kml),l.phoneNumber=On(t,"phoneNumber",Re.kml),l.snippet=On(t,"Snippet",Re.kml),Fat(t,a),Bat(t,a,u,s,r);let A=e._ellipsoid;return x0e(t,a,A),b0e(t,a,A),c(Ui(t,"Region",Re.kml))&&dt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function y0e(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function kat(e,t,n,i){let o=aH(e,t,n),r=je(n);r.parentEntity=o.entity,y0e(e,t,r,i)}function Uat(e,t,n,i){let o=aH(e,t,n),r=o.entity,s=o.styleEntity,a=!1,l=t.childNodes;for(let u=0,f=l.length;uO.PI_OVER_TWO?O.PI_OVER_TWO:u}function a(u){return u>O.PI?u-O.TWO_PI:u<-O.PI?u+O.TWO_PI:u}let l=cb(e.queryParameters);if(l=l.replace(/%5B/g,"[").replace(/%5D/g,"]"),c(t)&&t._mode!==oe.MORPHING){let u,f;if(o=o??qat,c(n)&&(xX.x=n.clientWidth*.5,xX.y=n.clientHeight*.5,u=t.pickEllipsoid(xX,r,Yat)),c(u)?f=r.cartesianToCartographic(u,QS):(f=ce.center(o,QS),u=r.cartographicToCartesian(f)),c(i)&&!O.equalsEpsilon(i,1,O.EPSILON9)){let x=o.width*i*.5,A=o.height*i*.5;o=new ce(a(f.longitude-x),s(f.latitude-A),a(f.longitude+x),s(f.latitude+A))}l=l.replace("[bboxWest]",O.toDegrees(o.west).toString()),l=l.replace("[bboxSouth]",O.toDegrees(o.south).toString()),l=l.replace("[bboxEast]",O.toDegrees(o.east).toString()),l=l.replace("[bboxNorth]",O.toDegrees(o.north).toString());let h=O.toDegrees(f.longitude).toString(),p=O.toDegrees(f.latitude).toString();l=l.replace("[lookatLon]",h),l=l.replace("[lookatLat]",p),l=l.replace("[lookatTilt]",O.toDegrees(t.pitch).toString()),l=l.replace("[lookatHeading]",O.toDegrees(t.heading).toString()),l=l.replace("[lookatRange]",d.distance(t.positionWC,u)),l=l.replace("[lookatTerrainLon]",h),l=l.replace("[lookatTerrainLat]",p),l=l.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,QS),l=l.replace("[cameraLon]",O.toDegrees(QS.longitude).toString()),l=l.replace("[cameraLat]",O.toDegrees(QS.latitude).toString()),l=l.replace("[cameraAlt]",O.toDegrees(QS.height).toString());let g=t.frustum,m=g.aspectRatio,y="",b="";if(c(m)){let x=O.toDegrees(g.fov);m>1?(y=x,b=x/m):(b=x,y=x*m)}l=l.replace("[horizFov]",y.toString()),l=l.replace("[vertFov]",b.toString())}else l=l.replace("[bboxWest]","-180"),l=l.replace("[bboxSouth]","-90"),l=l.replace("[bboxEast]","180"),l=l.replace("[bboxNorth]","90"),l=l.replace("[lookatLon]",""),l=l.replace("[lookatLat]",""),l=l.replace("[lookatRange]",""),l=l.replace("[lookatTilt]",""),l=l.replace("[lookatHeading]",""),l=l.replace("[lookatTerrainLon]",""),l=l.replace("[lookatTerrainLat]",""),l=l.replace("[lookatTerrainAlt]",""),l=l.replace("[cameraLon]",""),l=l.replace("[cameraLat]",""),l=l.replace("[cameraAlt]",""),l=l.replace("[horizFov]",""),l=l.replace("[vertFov]","");c(n)?(l=l.replace("[horizPixels]",n.clientWidth),l=l.replace("[vertPixels]",n.clientHeight)):(l=l.replace("[horizPixels]",""),l=l.replace("[vertPixels]","")),l=l.replace("[terrainEnabled]","1"),l=l.replace("[clientVersion]","1"),l=l.replace("[kmlVersion]","2.2"),l=l.replace("[clientName]","Cesium"),l=l.replace("[language]","English"),e.setQueryParameters(hu(l))}function Xat(e,t,n,i){let r=aH(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,l=Ui(t,"Link",Re.kml);if(c(l)||(l=Ui(t,"Url",Re.kml)),c(l)){let u=On(l,"href",Re.kml),f,h;if(c(u)){let p=u;if(u=wX(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=On(l,"viewRefreshMode",Re.kml),f==="onRegion"){dt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=On(l,"viewBoundScale",Re.kml)??1;let b=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",x=On(l,"viewFormat",Re.kml)??b,A=On(l,"httpQuery",Re.kml);c(x)&&u.setQueryParameters(hu(oH(x))),c(A)&&u.setQueryParameters(hu(oH(A)));let C=e._ellipsoid;IX(u,e.camera,e.canvas,h,e._lastCameraView.bbox,C)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},m=new Qs,y=OX(e,m,u,g).then(function(b){let x=e._entityCollection,A=m.values;x.suspendEvents();for(let v=0;v0||C==="onExpire"||f==="onStop"){let v=Ui(b,"NetworkLinkControl",Re.kml),P=c(v),M=Q.now(),R={id:jn(),href:u,cookie:{},lastUpdated:M,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:M},L=0;if(P&&(R.cookie=hu(On(v,"cookie",Re.kml)??""),L=Jn(v,"minRefreshPeriod",Re.kml)??0),C==="onInterval")P&&(S=Math.max(L,S)),R.refreshMode=S0.INTERVAL,R.time=S;else if(C==="onExpire"){let F;if(P&&(F=On(v,"expires",Re.kml)),c(F))try{let _=Q.fromIso8601(F),w=Q.secondsDifference(_,M);w>0&&w0;)this._screenOverlays.pop().remove()};function RX(e){let t=e.parent;if(c(t)){let n=t.availability;if(c(n)){let i=e.availability;c(i)?i.intersect(n):e.availability=n}}}function Zat(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Ui(r,"NetworkLinkControl",Re.kml),l=c(a),u=0;if(l){if(c(Ui(a,"Update",Re.kml))){dt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=hu(On(a,"cookie",Re.kml)??""),u=Jn(a,"minRefreshPeriod",Re.kml)??0}let f=Q.now(),h=t.refreshMode;if(h===S0.INTERVAL)c(a)&&(t.time=Math.max(u,t.time));else if(h===S0.EXPIRE){let M;if(c(a)&&(M=On(a,"expires",Re.kml)),c(M))try{let R=Q.fromIso8601(M),L=Q.secondsDifference(R,f);L>0&&Lf.time&&(p=!0):f.refreshMode===S0.EXPIRE?Q.greaterThan(n,f.time)&&(p=!0):f.refreshMode===S0.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&Q.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(h),f.updating=!0;let g=new Qs,m=f.href.clone();m.setQueryParameters(f.cookie);let y=i._ellipsoid??ie.default;IX(m,i.camera,i.canvas,f.viewBoundScale,s.bbox,y),OX(i,g,m,{context:h.id}).then(Zat(i,f,g,l,m)).catch(function(b){let x=`NetworkLink ${f.href} refresh failed: ${b}`;console.log(x),i._error.raiseEvent(i,x)}),u=!0}}l.set(f.id,f)}}),u&&(this._networkLinks=l,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}$u._DeferredLoading=Jm;$u._getTimestamp=Ti;var kT=$u;function qF(){E.throwInstantiationError()}qF.prototype.update=E.throwInstantiationError;qF.prototype.getBoundingSphere=E.throwInstantiationError;qF.prototype.isDestroyed=E.throwInstantiationError;qF.prototype.destroy=E.throwInstantiationError;var MX=qF;var JS=`#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 YF=`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; } 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; } 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 XF=`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; } 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); } 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; } 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; } 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)); } const float T0 = 0.6; const float k = 0.1; const float C0 = 0.8; const float FX0 = 0.6; const float FY0 = 0.6; 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; const float t = 0.4; const float s = 0.25; 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); float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); float It = T(cloudPoint); 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; float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); float TR = pow(ndDot, 3.0) - W; TR *= 1.3; float minusDot = 0.5 - ndDot; TR -= min(minusDot * W2, 0.0); TR -= 0.8 * (minusDot + 0.25) * W3; float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); shading = clamp(shading + 0.2, 0.3, 1.0); 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 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 KF=`#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() { 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 $F=`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)); } 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 ZF=`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 QF=`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 JF=`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 e2=`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); vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); 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 t2=`in vec4 position; out vec4 positionEC; void main() { positionEC = czm_modelView * position; gl_Position = czm_projection * positionEC; czm_vertexLogDepth(); } `;var ew=`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; vec3 normalEC = normalize(czm_normal * normalMC); 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() { 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; } 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; } vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); 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 tw=`in vec3 position; uniform vec3 u_radii; out vec3 v_positionEC; void main() { vec4 p = vec4(u_radii * position, 1.0); v_positionEC = (czm_modelView * p).xyz; gl_Position = czm_modelViewProjection * p; 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 n2=`#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( FxaaFloat2 pos, FxaaTex tex, FxaaFloat2 fxaaQualityRcpFrame, FxaaFloat fxaaQualitySubpix, FxaaFloat fxaaQualityEdgeThreshold, 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 i2=`uniform vec4 u_initialColor; #if TEXTURE_UNITS > 0 uniform sampler2D u_dayTextures[TEXTURE_UNITS]; uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS]; uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS]; #ifdef APPLY_ALPHA uniform float u_dayTextureAlpha[TEXTURE_UNITS]; #endif #ifdef APPLY_DAY_NIGHT_ALPHA uniform float u_dayTextureNightAlpha[TEXTURE_UNITS]; uniform float u_dayTextureDayAlpha[TEXTURE_UNITS]; #endif #ifdef APPLY_SPLIT uniform float u_dayTextureSplit[TEXTURE_UNITS]; #endif #ifdef APPLY_BRIGHTNESS uniform float u_dayTextureBrightness[TEXTURE_UNITS]; #endif #ifdef APPLY_CONTRAST uniform float u_dayTextureContrast[TEXTURE_UNITS]; #endif #ifdef APPLY_HUE uniform float u_dayTextureHue[TEXTURE_UNITS]; #endif #ifdef APPLY_SATURATION uniform float u_dayTextureSaturation[TEXTURE_UNITS]; #endif #ifdef APPLY_GAMMA uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; #endif #ifdef APPLY_IMAGERY_CUTOUT uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; #endif #ifdef APPLY_COLOR_TO_ALPHA uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; #endif uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; #endif #if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL)) uniform sampler2D u_waterMask; uniform vec4 u_waterMaskTranslationAndScale; uniform float u_zoomedOutOceanSpecularIntensity; #endif #ifdef SHOW_OCEAN_WAVES uniform sampler2D u_oceanNormalMap; #endif #if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) uniform vec2 u_lightingFadeDistance; #endif #ifdef TILE_LIMIT_RECTANGLE uniform vec4 u_cartographicLimitRectangle; #endif #ifdef GROUND_ATMOSPHERE uniform vec2 u_nightFadeDistance; #endif #ifdef ENABLE_CLIPPING_PLANES uniform highp sampler2D u_clippingPlanes; uniform mat4 u_clippingPlanesMatrix; uniform vec4 u_clippingPlanesEdgeStyle; #endif #ifdef ENABLE_CLIPPING_POLYGONS uniform highp sampler2D u_clippingDistance; in vec2 v_clippingPosition; flat in int v_regionIndex; #endif #if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) uniform float u_minimumBrightness; #endif #ifdef COLOR_CORRECT uniform vec3 u_hsbShift; #endif #ifdef HIGHLIGHT_FILL_TILE uniform vec4 u_fillHighlightColor; #endif #ifdef TRANSLUCENT uniform vec4 u_frontFaceAlphaByDistance; uniform vec4 u_backFaceAlphaByDistance; uniform vec4 u_translucencyRectangle; #endif #ifdef UNDERGROUND_COLOR uniform vec4 u_undergroundColor; uniform vec4 u_undergroundColorAlphaByDistance; #endif #ifdef ENABLE_VERTEX_LIGHTING uniform float u_lambertDiffuseMultiplier; uniform float u_vertexShadowDarkness; #endif in vec3 v_positionMC; in vec3 v_positionEC; in vec3 v_textureCoordinates; in vec3 v_normalMC; in vec3 v_normalEC; #ifdef APPLY_MATERIAL in float v_height; in float v_slope; in float v_aspect; #endif #if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) in float v_distance; #endif #if defined(GROUND_ATMOSPHERE) || defined(FOG) in vec3 v_atmosphereRayleighColor; in vec3 v_atmosphereMieColor; in float v_atmosphereOpacity; #endif #if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) float interpolateByDistance(vec4 nearFarScalar, float distance) { float startDistance = nearFarScalar.x; float startValue = nearFarScalar.y; float endDistance = nearFarScalar.z; float endValue = nearFarScalar.w; float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); return mix(startValue, endValue, t); } #endif #if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) { return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); } #endif #ifdef TRANSLUCENT bool inTranslucencyRectangle() { return v_textureCoordinates.x > u_translucencyRectangle.x && v_textureCoordinates.x < u_translucencyRectangle.z && v_textureCoordinates.y > u_translucencyRectangle.y && v_textureCoordinates.y < u_translucencyRectangle.w; } #endif vec4 sampleAndBlend( vec4 previousColor, sampler2D textureToSample, vec2 tileTextureCoordinates, vec4 textureCoordinateRectangle, vec4 textureCoordinateTranslationAndScale, float textureAlpha, float textureNightAlpha, float textureDayAlpha, float textureBrightness, float textureContrast, float textureHue, float textureSaturation, float textureOneOverGamma, float split, vec4 colorToAlpha, float nightBlend) { 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; if (split < 0.0 && gl_FragCoord.x > splitPosition) { alpha = 0.0; } else if (split > 0.0 && gl_FragCoord.x < splitPosition) { alpha = 0.0; } #endif #ifdef APPLY_BRIGHTNESS color = mix(vec3(0.0), color, textureBrightness); #endif #ifdef APPLY_CONTRAST color = mix(vec3(0.5), color, textureContrast); #endif #ifdef APPLY_HUE color = czm_hue(color, textureHue); #endif #ifdef APPLY_SATURATION color = czm_saturation(color, textureSaturation); #endif float sourceAlpha = alpha * textureAlpha; float outAlpha = mix(previousColor.a, 1.0, sourceAlpha); outAlpha += sign(outAlpha) - 1.0; vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha; return vec4(outColor, max(outAlpha, 0.0)); } vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend); vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade); const float fExposure = 2.0; vec3 computeEllipsoidPosition() { float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0); vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0); xy *= czm_viewport.zw * mpp * 0.5; vec3 direction; 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() { #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)); vec3 normalEC = czm_normal3D * normalMC; #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 vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend); #ifdef SHOW_TILE_BOUNDARIES if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) || v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0)) { color = vec4(1.0, 0.0, 0.0, 1.0); } #endif #if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) float cameraDist; if (czm_sceneMode == czm_sceneMode2D) { cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; } else if (czm_sceneMode == czm_sceneModeColumbusView) { cameraDist = -czm_view[3].z; } else { cameraDist = length(czm_view[3]); } float fadeOutDist = u_lightingFadeDistance.x; float fadeInDist = u_lightingFadeDistance.y; if (czm_sceneMode != czm_sceneMode3D) { vec3 radii = czm_ellipsoidRadii; float maxRadii = max(radii.x, max(radii.y, radii.z)); fadeOutDist -= maxRadii; fadeInDist -= maxRadii; } float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); #else float fade = 0.0; #endif #if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL)) vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy; vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw; vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation; waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y; float mask = texture(u_waterMask, waterMaskTextureCoordinates).r; #ifdef SHOW_REFLECTIVE_OCEAN if (mask > 0.0) { mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC); vec2 ellipsoidTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC); vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC.zyx); vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z)); color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade); } #endif #endif #ifdef APPLY_MATERIAL czm_materialInput materialInput; materialInput.st = v_textureCoordinates.st; materialInput.normalEC = normalize(v_normalEC); materialInput.positionToEyeEC = -v_positionEC; materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC)); materialInput.slope = v_slope; materialInput.height = v_height; materialInput.aspect = v_aspect; #ifdef HAS_WATER_MASK materialInput.waterMask = mask; #endif czm_material material = czm_getMaterial(materialInput); vec4 materialColor = vec4(material.diffuse, material.alpha); color = alphaBlend(materialColor, color); #endif #ifdef ENABLE_VERTEX_LIGHTING float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0); vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); #elif defined(ENABLE_DAYNIGHT_SHADING) float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0); diffuseIntensity = mix(1.0, diffuseIntensity, fade); vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); #else vec4 finalColor = color; #endif #ifdef ENABLE_CLIPPING_PLANES vec4 clippingPlanesEdgeColor = vec4(1.0); clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; if (clipDistance < clippingPlanesEdgeWidth) { finalColor = clippingPlanesEdgeColor; } #endif #ifdef ENABLE_CLIPPING_POLYGONS vec2 clippingPosition = v_clippingPosition; int regionIndex = v_regionIndex; clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); #endif #ifdef HIGHLIGHT_FILL_TILE finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); #endif #if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) vec3 atmosphereLightDirection = czm_sunDirectionWC; #else vec3 atmosphereLightDirection = czm_lightDirectionWC; #endif #if defined(GROUND_ATMOSPHERE) || defined(FOG) if (!czm_backFacing()) { bool dynamicLighting = false; #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) dynamicLighting = true; #endif vec3 rayleighColor; vec3 mieColor; float opacity; vec3 positionWC; vec3 lightDirection; #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); #ifdef FOG vec3 fogColor = groundAtmosphereColor.rgb; #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 const float transmittanceModifier = 0.5; float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0); vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance; #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) float fadeInDist = u_nightFadeDistance.x; float fadeOutDist = u_nightFadeDistance.y; float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0); float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0); vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken); finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity); #endif #ifndef HDR finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); #else finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); #endif finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); #endif } #endif #ifdef UNDERGROUND_COLOR if (czm_backFacing()) { float distanceFromEllipsoid = max(czm_eyeHeight, 0.0); float distance = max(v_distance - distanceFromEllipsoid, 0.0); float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance); vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount); finalColor = alphaBlend(undergroundColor, finalColor); } #endif #ifdef TRANSLUCENT if (inTranslucencyRectangle()) { vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); } #endif out_FragColor = finalColor; } #ifdef SHOW_REFLECTIVE_OCEAN float waveFade(float edge0, float edge1, float x) { float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); return pow(1.0 - y, 5.0); } float linearFade(float edge0, float edge1, float x) { return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); } const float oceanFrequencyLowAltitude = 825000.0; const float oceanAnimationSpeedLowAltitude = 0.004; const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; const float oceanSpecularIntensity = 0.5; 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); vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); #ifdef SHOW_OCEAN_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); time = czm_frameNumber * oceanAnimationSpeedLowAltitude; noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); 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); 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); float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); #ifdef SHOW_OCEAN_WAVES float tsPerturbationRatio = normalTangentSpace.z; vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); #else vec3 nonDiffuseHighlight = vec3(0.0); #endif 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 o2=`#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; 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 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) { 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) { vec3 position3DWC = position + u_center3D; float yPositionFraction = get2DYPositionFraction(textureCoordinates); vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime); return czm_modelViewProjection * morphPosition; } #ifdef QUANTIZATION_BITS12 uniform vec2 u_minMaxHeight; uniform mat4 u_scaleAndBias; #endif void main() { #ifdef QUANTIZATION_BITS12 vec2 xy = czm_decompressTextureCoordinates(compressed0.x); vec2 zh = czm_decompressTextureCoordinates(compressed0.y); vec3 position = vec3(xy, zh.x); float height = zh.y; vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z); height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x; position = (u_scaleAndBias * vec4(position, 1.0)).xyz; #if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL) float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; float encodedNormal = compressed1; #elif defined(INCLUDE_WEB_MERCATOR_Y) float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; float encodedNormal = 0.0; #elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) float webMercatorT = textureCoordinates.y; float encodedNormal = compressed0.w; #else float webMercatorT = textureCoordinates.y; float encodedNormal = 0.0; #endif #else 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; float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z); newHeight = max(newHeight, -minRadius); vec3 offset = ellipsoidNormal * (newHeight - height); position += offset; position3DWC += offset; height = newHeight; #endif gl_Position = getPosition(position, height, textureCoordinates); v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz; v_positionMC = position3DWC; 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 nw=`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 r2=`uniform sampler2D u_texture; in vec2 v_textureCoordinates; void main() { out_FragColor = texture(u_texture, v_textureCoordinates); } `;var s2=`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 iw=`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; 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); float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); underTranslucentGlobe = 0.0; #if defined(GLOBE_TRANSLUCENT) czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { 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); float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); 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); underTranslucentGlobe = 1.0; return; } #endif computeScattering( primaryRay, length(cameraToPositionWC), lightDirection, atmosphereInnerRadius, rayleighColor, mieColor, opacity ); float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; opacity *= pow(nightAlpha, 0.5); } `;var a2=`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 if (translucent == 0.0) { color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); } out_FragColor = color; } `;var c2=`in vec4 position; out vec3 v_outerPositionWC; #ifndef PER_FRAGMENT_ATMOSPHERE out vec3 v_mieColor; out vec3 v_rayleighColor; out float v_opacity; out float v_translucent; #endif void main(void) { vec4 positionWC = czm_model * position; float lightEnum = u_radiiAndDynamicAtmosphereColor.z; vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum); #ifndef PER_FRAGMENT_ATMOSPHERE computeAtmosphereScattering( positionWC.xyz, lightDirection, v_rayleighColor, v_mieColor, v_opacity, v_translucent ); #endif v_outerPositionWC = positionWC.xyz; gl_Position = czm_modelViewProjection * position; } `;var l2=`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 u2=`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 f2=`uniform sampler2D u_texture; in vec2 v_textureCoordinates; void main() { vec4 color = texture(u_texture, v_textureCoordinates); out_FragColor = czm_gammaCorrect(color); } `;var d2=`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); burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); } `;var h2=`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 m2=`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); } `;function Jat(e){let t,n=e.name,i=e.message;c(n)&&c(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return c(o)&&(t+=` ${o}`),t}var ep=Jat;async function ect(e,t,n,i){return c(i)||(i=!1),T.typeOf.object("terrainProvider",e),T.typeOf.number("level",t),T.typeOf.bool("rejectOnTileFail",i),T.defined("positions",n),ict(e,t,n,i)}function tct(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(C0e(i)):r=o.then(C0e(i)).catch(oct(i)),e.shift(),t.push(r),!0}function nct(e){return new Promise(function(t){setTimeout(t,e)})}function LX(e,t,n){return e.length?tct(e,t,n)?LX(e,t,n):nct(100).then(()=>LX(e,t,n)):Promise.resolve()}function ict(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r0&&await E0e(e,a,n),t}var UT=E0e;async function FX(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===oe.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!c(n))return r;let a=n.availability;if(!c(a)||t.mode===oe.SCENE2D)return r;let l=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],u=await FX._sampleTerrainMostDetailed(n,l),f=!1,h=u.reduce(function(g,m){return c(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=r;return f&&(p.height+=h),p}FX._sampleTerrainMostDetailed=UT;var VT=FX;var rct={NONE:0,LERC:1},fd=Object.freeze(rct);var sct={NONE:0,BITS12:1},ea=Object.freeze(sct);var zT=new d,act=new d,dd=new H,cH=new B,cct=new B,lct=Math.pow(2,12);function Ic(e,t,n,i,o,r,s,a,l,u){let f=ea.NONE,h,p;if(c(t)&&c(n)&&c(i)&&c(o)){let g=t.minimum,m=t.maximum,y=d.subtract(m,g,act),b=i-n;Math.max(d.maximumComponent(y),b)0,g=e.isGeographic??!0,m=e.ellipsoid??ie.default,y=1/m.maximumRadius,b=ce.clone(e.nativeRectangle),x=ce.clone(e.rectangle),A,C,S,v;c(x)?(A=x.west,C=x.south,S=x.east,v=x.north):g?(A=a(b.west),C=a(b.south),S=a(b.east),v=a(b.north)):(A=b.west*y,C=s-2*o(r(-b.south*y)),S=b.east*y,v=s-2*o(r(-b.north*y)));let P=e.relativeToCenter,M=c(P);P=M?P:d.ZERO;let R=e.includeWebMercatorT??!1,L=e.exaggeration??1,F=e.exaggerationRelativeHeight??0,w=L!==1,D=e.structure??tp.DEFAULT_STRUCTURE,I=D.heightScale??tp.DEFAULT_STRUCTURE.heightScale,N=D.heightOffset??tp.DEFAULT_STRUCTURE.heightOffset,k=D.elementsPerHeight??tp.DEFAULT_STRUCTURE.elementsPerHeight,z=D.stride??tp.DEFAULT_STRUCTURE.stride,V=D.elementMultiplier??tp.DEFAULT_STRUCTURE.elementMultiplier,j=D.isBigEndian??tp.DEFAULT_STRUCTURE.isBigEndian,U=ce.computeWidth(b),q=ce.computeHeight(b),Y=U/(u-1),te=q/(f-1);g||(U*=y,q*=y);let K=m.radiiSquared,Z=K.x,ee=K.y,me=K.z,Te=65536,ue=-65536,ye=Ot.eastNorthUpToFixedFrame(P,m),Ae=B.inverseTransformation(ye,fct),Pe,Ee;R&&(Pe=Mi.geodeticLatitudeToMercatorAngle(C),Ee=1/(Mi.geodeticLatitudeToMercatorAngle(v)-Pe));let ze=dct;ze.x=Number.POSITIVE_INFINITY,ze.y=Number.POSITIVE_INFINITY,ze.z=Number.POSITIVE_INFINITY;let qe=hct;qe.x=Number.NEGATIVE_INFINITY,qe.y=Number.NEGATIVE_INFINITY,qe.z=Number.NEGATIVE_INFINITY;let it=Number.POSITIVE_INFINITY,Dt=u*f,jt=h>0?u*2+f*2:0,$e=Dt+jt,un=new Array($e),zt=new Array($e),Ct=new Array($e),Ei=R?new Array($e):[],an=w?new Array($e):[],_e=0,Ce=f,pn=0,mt=u;p&&(--_e,++Ce,--pn,++mt);let so=1e-5;for(let Ze=_e;Ze=f&&(pt=f-1);let Ht=b.north-te*pt;g?Ht=a(Ht):Ht=s-2*o(r(-Ht*y));let Cn=(Ht-C)/(v-C);Cn=O.clamp(Cn,0,1);let Mo=Ze===_e,Ao=Ze===Ce-1;h>0&&(Mo?Ht+=so*q:Ao&&(Ht-=so*q));let Za=t(Ht),Qa=n(Ht),Si=me*Qa,_i;R&&(_i=(Mi.geodeticLatitudeToMercatorAngle(Ht)-Pe)*Ee);for(let ca=pn;ca=u&&(Jr=u-1);let El=pt*(u*z)+Jr*z,yo;if(k===1)yo=l[El];else{yo=0;let Vo;if(j)for(Vo=0;Vo=0;--Vo)yo=yo*V+l[El+Vo]}yo=yo*I+N,ue=Math.max(ue,yo),Te=Math.min(Te,yo);let Fr=b.west+Y*Jr;g?Fr=a(Fr):Fr=Fr*y;let xp=(Fr-A)/(S-A);xp=O.clamp(xp,0,1);let es=pt*u+Jr;if(h>0){let Vo=ca===pn,cn=ca===mt-1,Se=Mo||Ao||Vo||cn;if((Mo||Ao)&&(Vo||cn))continue;Se&&(yo-=h,Vo?(es=Dt+(f-pt-1),Fr-=so*U):Ao?es=Dt+f+(u-Jr-1):cn?(es=Dt+f+u+pt,Fr+=so*U):Mo&&(es=Dt+f+u+f+Jr))}let hf=Za*t(Fr),Ja=Za*n(Fr),tb=Z*hf,la=ee*Ja,ec=1/i(tb*hf+la*Ja+Si*Qa),hs=tb*ec,mf=la*ec,pf=Si*ec,_f=new d;_f.x=hs+hf*yo,_f.y=mf+Ja*yo,_f.z=pf+Qa*yo,B.multiplyByPoint(Ae,_f,BX),d.minimumByComponent(BX,ze,ze),d.maximumByComponent(BX,qe,qe),it=Math.min(it,yo),un[es]=_f,Ct[es]=new H(xp,Cn),zt[es]=yo,R&&(Ei[es]=_i),w&&(an[es]=m.geodeticSurfaceNormal(_f))}}let Ro=le.fromPoints(un),aa;c(x)&&(aa=Dn.fromRectangle(x,Te,ue,m));let Nr;M&&(Nr=new H_(m).computeHorizonCullingPointPossiblyUnderEllipsoid(P,un,Te));let Cs=new Qg(ze,qe,P),Ne=new Oc(P,Cs,it,ue,ye,!1,R,w,L,F),ot=new Float32Array($e*Ne.stride),Xe=0;for(let Ze=0;Ze<$e;++Ze)Xe=Ne.encode(ot,Xe,un[Ze],Ct[Ze],zt[Ze],void 0,Ei[Ze],an[Ze]);return{vertices:ot,maximumHeight:ue,minimumHeight:Te,encoding:Ne,boundingSphere3D:Ro,orientedBoundingBox:aa,occludeePointInScaledSpace:Nr}};var ow=tp;function w0(){E.throwInstantiationError()}Object.defineProperties(w0.prototype,{credits:{get:E.throwInstantiationError},waterMask:{get:E.throwInstantiationError}});w0.prototype.interpolateHeight=E.throwInstantiationError;w0.prototype.isChildAvailable=E.throwInstantiationError;w0.prototype.createMesh=E.throwInstantiationError;w0.prototype.upsample=E.throwInstantiationError;w0.prototype.wasCreatedByUpsampling=E.throwInstantiationError;w0.maximumAsynchronousTasks=5;var kh=w0;function mct(e,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y){this.center=e,this.vertices=t,this.stride=u??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=l,this.orientedBoundingBox=f,this.encoding=h,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=m,this.northIndicesWestToEast=y}var hd=mct;function gl(){E.throwInstantiationError()}Object.defineProperties(gl.prototype,{errorEvent:{get:E.throwInstantiationError},credit:{get:E.throwInstantiationError},tilingScheme:{get:E.throwInstantiationError},hasWaterMask:{get:E.throwInstantiationError},hasVertexNormals:{get:E.throwInstantiationError},availability:{get:E.throwInstantiationError}});var w0e=[];gl.getRegularGridIndices=function(e,t){if(e*t>=O.FOUR_GIGABYTES)throw new E("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=w0e[e];c(n)||(w0e[e]=n=[]);let i=n[t];return c(i)||(e*t=O.FOUR_GIGABYTES)throw new E("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=v0e[e];c(n)||(v0e[e]=n=[]);let i=n[t];if(!c(i)){let o=gl.getRegularGridIndices(e,t),r=P0e(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,l=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:l,northIndicesWestToEast:u}}return i};var D0e=[];gl.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){if(e*t>=O.FOUR_GIGABYTES)throw new E("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=D0e[e];c(n)||(D0e[e]=n=[]);let i=n[t];if(!c(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,l=o+s,u=r+a,f=P0e(e,t),h=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=Fe.createTypedArray(l,u);I0e(e,t,y,0),gl.addSkirtIndices(h,p,g,m,o,y,r),i=n[t]={indices:y,westIndicesSouthToNorth:h,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:r}}return i};gl.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=fH(e,a,r,s),a+=e.length,s=fH(t,a,r,s),a+=t.length,s=fH(n,a,r,s),a+=n.length,fH(i,a,r,s)};function P0e(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s0?C=cs.getRegularGridAndSkirtIndicesAndEdgeIndices(A.gridWidth,A.gridHeight):C=cs.getRegularGridIndicesAndEdgeIndices(A.gridWidth,A.gridHeight);let S=A.gridWidth*A.gridHeight;return x._mesh=new hd(h,new Float32Array(A.vertices),C.indices,C.indexCountWithoutSkirts,S,A.minimumHeight,A.maximumHeight,le.clone(A.boundingSphere3D),d.clone(A.occludeePointInScaledSpace),A.numberOfAttributes,Dn.clone(A.orientedBoundingBox),Oc.clone(A.encoding),C.westIndicesSouthToNorth,C.southIndicesEastToWest,C.eastIndicesNorthToSouth,C.northIndicesWestToEast),x._buffer=void 0,x._mesh})};ug.prototype._createMeshSync=function(e){T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,l=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=a.cartographicToCartesian(ce.center(u)),h=this._structure,g=cs.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<0?y=cs.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=cs.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let b=m.gridWidth*m.gridHeight;return this._mesh=new hd(f,m.vertices,y.indices,y.indexCountWithoutSkirts,b,m.minimumHeight,m.maximumHeight,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};ug.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,l=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,h=r.heightScale,p=c(this._mesh),g=this._encoding===fd.LERC;if(!p&&g)return;let y;if(p){let b=this._mesh.vertices,x=this._mesh.encoding;y=R0e(b,x,f,h,e,i,o,t,n)}else y=gct(this._buffer,a,l,s,u,e,i,o,t,n),y=y*h+f;return y};ug.prototype.upsample=function(e,t,n,i,o,r,s){if(!c(e))throw new E("tilingScheme is required.");if(!c(t))throw new E("thisX is required.");if(!c(n))throw new E("thisY is required.");if(!c(i))throw new E("thisLevel is required.");if(!c(o))throw new E("descendantX is required.");if(!c(r))throw new E("descendantY is required.");if(!c(s))throw new E("descendantLevel is required.");if(s-i>1)throw new E("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(l))return;let u=this._width,f=this._height,h=this._structure,p=h.stride,g=new this._bufferType(u*f*p),m=l.vertices,y=l.encoding,b=e.tileXYToRectangle(t,n,i),x=e.tileXYToRectangle(o,r,s),A=h.heightOffset,C=h.heightScale,S=h.elementsPerHeight,v=h.elementMultiplier,P=h.isBigEndian,M=Math.pow(v,S-1);for(let R=0;Rh.highestEncodedHeight?h.highestEncodedHeight:w,yct(g,S,v,M,p,P,R*u+F,w)}}return Promise.resolve(new ug({buffer:g,width:u,height:f,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};ug.prototype.isChildAvailable=function(e,t,n,i){if(!c(e))throw new E("thisX is required.");if(!c(t))throw new E("thisY is required.");if(!c(n))throw new E("childX is required.");if(!c(i))throw new E("childY is required.");let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<=s&&(g=s-1,p=s-2);let m=h|0,y=m+1;y>=a&&(y=a-1,m=a-2);let b=f-p,x=h-m;m=a-1-m,y=a-1-y;let A=dH(e,t,n,i,o,m*s+p),C=dH(e,t,n,i,o,m*s+g),S=dH(e,t,n,i,o,y*s+p),v=dH(e,t,n,i,o,y*s+g);return M0e(b,x,A,C,S,v)}function R0e(e,t,n,i,o,r,s,a,l){let u=(a-o.west)*(r-1)/(o.east-o.west),f=(l-o.south)*(s-1)/(o.north-o.south),h=u|0,p=h+1;p>=r&&(p=r-1,h=r-2);let g=f|0,m=g+1;m>=s&&(m=s-1,g=s-2);let y=u-h,b=f-g;g=s-1-g,m=s-1-m;let x=(t.decodeHeight(e,g*r+h)-n)/i,A=(t.decodeHeight(e,g*r+p)-n)/i,C=(t.decodeHeight(e,m*r+h)-n)/i,S=(t.decodeHeight(e,m*r+p)-n)/i;return M0e(y,b,x,A,C,S)}function M0e(e,t,n,i,o,r){return t=0;--a)s=s*n+e[r+a];return s}function yct(e,t,n,i,o,r,s,a){s*=o;let l;if(r)for(l=0;l0;--l)e[s+l]=a/i|0,a-=e[s+l]*i,i/=n;e[s+l]=a}var qa=ug;function rw(e){e=e??W.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,c(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??ie.default})),this._levelZeroMaximumGeometricError=cs.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new pe}Object.defineProperties(rw.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(){}}});rw.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new qa({buffer:new Uint8Array(16*16),width:16,height:16}))};rw.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<0&&(Ae=M?R.clippingPlanesState:0);let Pe=0;c(F)&&F.length>0&&(Pe=L?F.clippingPolygonsState:0);let Ee=n.surfaceShader;if(c(Ee)&&Ee.numberOfDayTextures===i&&Ee.flags===ye&&Ee.material===this.material&&Ee.clippingShaderState===Ae&&Ee.clippingPolygonShaderState===Pe)return Ee.shaderProgram;let ze=this._shadersByTexturesFlags[i];if(c(ze)||(ze=this._shadersByTexturesFlags[i]=[]),Ee=ze[ye],!c(Ee)||Ee.material!==this.material||Ee.clippingShaderState!==Ae||Ee.clippingPolygonShaderState!==Pe){let qe=this.baseVertexShaderSource.clone(),it=this.baseFragmentShaderSource.clone();Ae!==0&&it.sources.unshift(fg(R,t.context)),Pe!==0&&(it.sources.unshift(vct(t.context)),qe.sources.unshift(Dct(t.context))),qe.defines.push(q),it.defines.push(`TEXTURE_UNITS ${i}`,ee,Te),o&&it.defines.push("APPLY_BRIGHTNESS"),r&&it.defines.push("APPLY_CONTRAST"),s&&it.defines.push("APPLY_HUE"),a&&it.defines.push("APPLY_SATURATION"),l&&it.defines.push("APPLY_GAMMA"),u&&it.defines.push("APPLY_ALPHA"),f&&it.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&it.defines.push("HAS_WATER_MASK"),g&&(it.defines.push("SHOW_REFLECTIVE_OCEAN"),qe.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&it.defines.push("SHOW_OCEAN_WAVES"),N&&it.defines.push("APPLY_COLOR_TO_ALPHA"),V&&(qe.defines.push("UNDERGROUND_COLOR"),it.defines.push("UNDERGROUND_COLOR")),j&&(qe.defines.push("TRANSLUCENT"),it.defines.push("TRANSLUCENT")),y&&(S?(qe.defines.push("ENABLE_VERTEX_LIGHTING"),it.defines.push("ENABLE_VERTEX_LIGHTING")):(qe.defines.push("ENABLE_DAYNIGHT_SHADING"),it.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(qe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),it.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(qe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),it.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),A&&(qe.defines.push("GROUND_ATMOSPHERE"),it.defines.push("GROUND_ATMOSPHERE"),C&&(qe.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),it.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),qe.defines.push("INCLUDE_WEB_MERCATOR_Y"),it.defines.push("INCLUDE_WEB_MERCATOR_Y"),P&&(qe.defines.push("FOG"),it.defines.push("FOG")),h&&it.defines.push("APPLY_SPLIT"),M&&it.defines.push("ENABLE_CLIPPING_PLANES"),L&&(it.defines.push("ENABLE_CLIPPING_POLYGONS"),qe.defines.push("ENABLE_CLIPPING_POLYGONS"),F.inverse&&it.defines.push("CLIPPING_INVERSE"),it.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${F.extentsCount}`),qe.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${F.extentsCount}`)),D&&it.defines.push("COLOR_CORRECT"),I&&it.defines.push("HIGHLIGHT_FILL_TILE"),k&&qe.defines.push("GEODETIC_SURFACE_NORMALS"),z&&qe.defines.push("EXAGGERATION");let Dt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) { vec4 color = initialColor; `;w&&(Dt+=` vec4 cutoutAndColorResult; bool texelUnclipped; `);for(let $e=0;$e0?n.raiseEvent(l):c(t)&&console.log(`An error occurred in "${t.constructor.name}": ${ep(i)}`),l};hH.reportSuccess=function(e){c(e)&&(e.timesRetried=-1)};var Po=hH;var Oct={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ai=Object.freeze(Oct);var Rct={START:0,LOADING:1,DONE:2,FAILED:3},ta=Object.freeze(Rct);var Mct={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},fo=Object.freeze(Mct);function lr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new d,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=fo.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(lr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===fo.RECEIVING||e===fo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o=0&&(f=A)}return f!==Number.MAX_VALUE?mn.getPoint(e,f,o):void 0};lr.prototype.freeResources=function(){c(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=fo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t=fo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)qct(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);c(u)&&c(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function Vct(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=ta.FAILED;return}let l=a.data.terrainData,u=a.x,f=a.y,h=a.level;if(!c(l))return;let p=l.upsample(i.tilingScheme,u,f,h,o,r,s);c(p)&&(e.terrainState=fo.RECEIVING,Promise.resolve(p).then(function(g){c(g)&&(e.terrainData=g,e.terrainState=fo.RECEIVED)}).catch(function(){e.terrainState=fo.FAILED}))}function zct(e,t,n,i,o){function r(l){if(!c(l)){e.terrainState=fo.UNLOADED,e.request=void 0;return}e.terrainData=l,e.terrainState=fo.RECEIVED,e.request=void 0}function s(l){if(e.request.state===$n.CANCELLED){e.terrainData=void 0,e.terrainState=fo.UNLOADED,e.request=void 0;return}e.terrainState=fo.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${l}"`;t._requestError=Po.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let l=new Qo({throttle:!1,throttleByServer:!0,type:ms.TERRAIN});e.request=l;let u=t.requestTileGeometry(n,i,o,l);c(u)?(e.terrainState=fo.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){s(f)})):(e.terrainState=fo.UNLOADED,e.request=void 0)}a()}var Hct={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Gct(e,t,n,i,o,r){let s=n.tilingScheme,a=Hct;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);c(u)&&(e.terrainState=fo.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=fo.TRANSFORMED}).catch(function(){e.terrainState=fo.FAILED}))}lr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=yt.createVertexBuffer({context:e,typedArray:n,usage:Be.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!c(s)||s.isDestroyed()){let a=t.indices;s=yt.createIndexBuffer({context:e,typedArray:a,usage:Be.STATIC_DRAW,indexDatatype:Fe.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ti({context:e,attributes:o,indexBuffer:s})};lr._freeVertexArray=function(e){if(c(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),c(t)&&!t.isDestroyed()&&c(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function jct(e,t,n,i,o,r,s){e.vertexArray=lr._createVertexArrayForMesh(t,e.mesh),e.terrainState=fo.READY,e.fill=e.fill&&e.fill.destroy(s)}function Wct(e){let t=e.cache.tile_waterMaskData;if(!c(t)){let n=Rt.create({context:e,pixelFormat:ke.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:li.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function qct(e,t){let n=t.terrainData.waterMask,i=Wct(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Rt.create({context:e,pixelFormat:ke.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}lr.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;c(t)&&(!c(t.data)||!c(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};lr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,l=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=l*(o.south-i.south)/s,n.z=a,n.w=l,n};var md=lr;function v0(e){if(e=e??W.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??ie.default,this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1,this._projection=new Mi(this._ellipsoid),c(e.rectangleSouthwestInMeters)&&c(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new H(-i,-i),this._rectangleNortheastInMeters=new H(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(v0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});v0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=o&&(m=o-1);let y=g/u|0;return y>=r&&(y=r-1),c(n)?(n.x=m,n.y=y,n):new H(m,y)};var ls=v0;var VX,N0e="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmRwxo7rIWoXrG5RJkAAlrdL0n_Ha7z7WbgHT-DpRd_LxLSeba-Kg8HsK3kJVUF2iiOVOza8OZ-DIdJzjyBZ9IIc5W0JagV3wyuZ9CKE3RHRSADOw-9FbeeUyfJA8iS2mKcK8768q4g11vlHUzVYFhWoKctRWWeG3Amwm6ez2n3vMc1fTSqDdbFP2O6x5eslQDE.AT1_SOxgo20E",sw={};sw.defaultAccessToken=N0e;sw.defaultWorldImageryServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});sw.defaultWorldHillshadeServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});sw.defaultWorldOceanServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});sw.getDefaultTokenCredit=function(e){if(e===N0e){if(!c(VX)){let t=' This application is using a default ArcGIS access token. Please assign Cesium.ArcGisMapService.defaultAccessToken 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 https://developers.arcgis.com/.';VX=new Tt(t,!0)}return VX}};var Zu=sw;function zX(e){if(e=e??W.EMPTY_OBJECT,!c(e.missingImageUrl))throw new E("options.missingImageUrl is required.");if(!c(e.pixelsToCheck))throw new E("options.pixelsToCheck is required.");this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=we.createIfNeeded(e.missingImageUrl),n=this;function i(r){c(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Id(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,l=r.width,u=e.pixelsToCheck;for(let f=0,h=u.length;a&&f0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}zX.prototype.isReady=function(){return this._isReady};zX.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new E("shouldDiscardImage must not be called before the discard policy is ready.");let t=this._pixelsToCheck,n=this._missingImagePixels;if(!c(n)||c(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Id(e),o=e.width;for(let r=0,s=t.length;r1&&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)}c(n)&&(this.name=e[n])};HX.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];c(r)&&(typeof r=="object"?i+=``:i+=``)}return i+="
${o}${t(r)}
${o}${r}
",i}this.description=t(e)};var Uh=HX;function aw(){E.throwInstantiationError()}Object.defineProperties(aw.prototype,{rectangle:{get:E.throwInstantiationError},tileWidth:{get:E.throwInstantiationError},tileHeight:{get:E.throwInstantiationError},maximumLevel:{get:E.throwInstantiationError},minimumLevel:{get:E.throwInstantiationError},tilingScheme:{get:E.throwInstantiationError},tileDiscardPolicy:{get:E.throwInstantiationError},errorEvent:{get:E.throwInstantiationError},credit:{get:E.throwInstantiationError},proxy:{get:E.throwInstantiationError},hasAlphaChannel:{get:E.throwInstantiationError}});aw.prototype.getTileCredits=function(e,t,n){E.throwInstantiationError()};aw.prototype.requestImage=function(e,t,n,i){E.throwInstantiationError()};aw.prototype.pickFeatures=function(e,t,n,i,o){E.throwInstantiationError()};var Yct=/\.ktx2$/i;aw.loadImage=function(e,t){T.defined("url",t);let n=we.createIfNeeded(t);return Yct.test(n.url)?Il(n):c(e)&&c(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var yl=aw;var Xct={SATELLITE:1,OCEANS:2,HILLSHADE:3},Vh=Object.freeze(Xct);function F0e(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Ki({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Tt(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}F0e.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&&!c(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new g2({missingImageUrl:B0e(e,0,0,this.maximumLevel).url,pixelsToCheck:[new H(0,0),new H(200,20),new H(20,200),new H(80,110),new H(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Kct(e,t){let n=e.tileInfo;if(!c(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 ls({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Ki({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new ae(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,c(e.fullExtent)){if(c(e.fullExtent.spatialReference)&&c(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)),s=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,s.longitude,s.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 ae(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}c(e.copyrightText)&&e.copyrightText.length>0&&(c(t.credit)?t.tileCredits=[new Tt(e.copyrightText)]:t.credit=new Tt(e.copyrightText))}function $ct(e,t){let n=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(n+=`: ${t.message}`),new ae(n)}async function Zct(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Kct(i,t)}catch(i){$ct(e,i)}}function ip(e){e=e??W.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 Ki({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 Tt(t)),this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new pe}ip.fromBasemapType=async function(e,t){T.defined("style",e),t=t??W.EMPTY_OBJECT;let n,i,o;switch(e){case Vh.SATELLITE:{n=t.token??Zu.defaultAccessToken,i=we.createIfNeeded(Zu.defaultWorldImageryServer),i.appendForwardSlash();let r=Zu.getDefaultTokenCredit(n);c(r)&&(o=Tt.clone(r))}break;case Vh.OCEANS:{n=t.token??Zu.defaultAccessToken,i=we.createIfNeeded(Zu.defaultWorldOceanServer),i.appendForwardSlash();let r=Zu.getDefaultTokenCredit(n);c(r)&&(o=Tt.clone(r))}break;case Vh.HILLSHADE:{n=t.token??Zu.defaultAccessToken,i=we.createIfNeeded(Zu.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Zu.getDefaultTokenCredit(n);c(r)&&(o=Tt.clone(r))}break;default:throw new E(`Unsupported basemap type: ${e}`)}return ip.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function B0e(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),l={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Oi?(l.bboxSR=4326,l.imageSR=4326):(l.bboxSR=3857,l.imageSR=3857),e.layers&&(l.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:l})}return r}Object.defineProperties(ip.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}}});ip.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.createIfNeeded(e);n.appendForwardSlash(),c(t.token)&&n.setQueryParameters({token:t.token});let i=new ip(t);i._resource=n;let o=new F0e(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Zct(n,o),o.build(i),i};ip.prototype.getTileCredits=function(e,t,n){return this._tileCredits};ip.prototype.requestImage=function(e,t,n,i){return yl.loadImage(this,B0e(this,e,t,n,i))};ip.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,l;if(this._tilingScheme.projection instanceof Oi)s=O.toDegrees(i),a=O.toDegrees(o),l="4326";else{let p=this._tilingScheme.projection.project(new he(i,o,0));s=p.x,a=p.y,l="3857"}let u="visible";c(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:l,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!c(m))return g;for(let y=0;yo.coverageAreas?.some(r=>c(r.bbox)))),t.attributionList=i}function elt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(i+=`: ${t.message}`),Po.reportError(void 0,n,c(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ae(i)}async function tlt(e,t,n){let i=e.url,o=Fs._metadataCache[i];c(o)||(o=e.fetchJsonp("jsonp"),Fs._metadataCache[i]=o);try{let r=await o;return Jct(r,t)}catch(r){elt(e,r,n)}}function Fs(e){e=e??W.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??cw.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,c(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new lw),this._proxy=e.proxy,this._credit=new Tt(``),this._tilingScheme=new ls({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 pe}Object.defineProperties(Fs.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 c(this.mapLayer)}}});Fs.fromUrl=async function(e,t){t=t??W.EMPTY_OBJECT,T.defined("url",e),T.defined("options.key",t.key);let n=t.tileProtocol;c(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??cw.AERIAL,o=we.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};c(t.mapLayer)&&(r.mapLayer=t.mapLayer),c(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Fs(t);a._resource=o;let l=new k0e(t);return await tlt(s,l),l.build(a),a};var nlt=new ce;Fs.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,nlt);return rlt(this._attributionList,n,i)};Fs.prototype.requestImage=function(e,t,n,i){let o=yl.loadImage(this,ilt(this,e,t,n,i));if(c(o))return o.catch(function(r){return c(r.blob)&&r.blob.size===0?lw.EMPTY_IMAGE:Promise.reject(r)})};Fs.prototype.pickFeatures=function(e,t,n,i,o){};Fs.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<=0;--o){let r=1<=h.zoomMin&&t<=h.zoomMax){let p=ce.intersection(n,h.bbox,olt);c(p)&&(l=!0)}}l&&i.push(s.credit)}return i}Fs._metadataCache={};var b2=Fs;var U0e=/{[^}]+}/g,V0e={x:llt,y:flt,z:mlt,s:plt,reverseX:ult,reverseY:dlt,reverseZ:hlt,westDegrees:_lt,southDegrees:glt,eastDegrees:ylt,northDegrees:blt,westProjected:xlt,southProjected:Tlt,eastProjected:Alt,northProjected:Clt,width:Elt,height:Slt},slt=xt(V0e,{i:wlt,j:vlt,reverseI:Dlt,reverseJ:Plt,longitudeDegrees:Olt,latitudeDegrees:Rlt,longitudeProjected:Mlt,latitudeProjected:Llt,format:Flt});function x2(e){e=e??W.EMPTY_OBJECT,this._errorEvent=new pe,T.defined("options.url",e.url);let t=we.createIfNeeded(e.url),n=we.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():c(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 ls({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 Tt(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,s=xt(V0e,r),a=xt(slt,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=e.enablePickFeatures??!0}Object.defineProperties(x2.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}}});x2.prototype.getTileCredits=function(e,t,n){};x2.prototype.requestImage=function(e,t,n,i){return yl.loadImage(this,alt(this,e,t,n,i))};x2.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!c(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(u,f){return u.callback(f)}function l(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],f=clt(s,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(l):u.type==="xml"?f.fetchXML().then(u.callback).catch(l):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(l):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(l)}return l()};var pH=!1,Qu=new ce,_H=!1,T2=new ce;function alt(e,t,n,i,o){pH=!1,_H=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,l={},u=s.match(U0e);return c(u)&&u.forEach(function(f){let h=f.substring(1,f.length-1);c(a[h])&&(l[h]=a[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:l})}var GX=!1,fw=new H,jX=!1;function clt(e,t,n,i,o,r,s){pH=!1,_H=!1,GX=!1,jX=!1;let a=e._pickFeaturesResource,l=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},h=l.match(U0e);return c(h)&&h.forEach(function(p){let g=p.substring(1,p.length-1);c(u[g])&&(f[g]=u[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:f})}function dw(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 llt(e,t,n,i){return dw(e,"{x}",t)}function ult(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return dw(e,"{reverseX}",o)}function flt(e,t,n,i){return dw(e,"{y}",n)}function dlt(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return dw(e,"{reverseY}",o)}function hlt(e,t,n,i){let o=e.maximumLevel,r=c(o)&&it.rectangle.east&&(e.east=t.rectangle.east),e.southt.rectangle.north&&(e.north=t.rectangle.north),e}function H0e(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,s=/tileset/i,a=/tilesets/i,l=/boundingbox/i,u,f,h,p=[],g=e.childNodes[0].childNodes;for(let R=0;R`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new pe}Object.defineProperties(iu.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}}});iu.fromUrl=async function(e,t,n){T.defined("url",e),T.defined("channel",t),n=n??{};let i=n.path??"/default_map",o=we.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new G0e(n);s.channel=t,await Ult(r,s);let a=new iu(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};iu.prototype.getTileCredits=function(e,t,n){};iu.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 yl.loadImage(this,o)};iu.prototype.pickFeatures=function(e,t,n,i,o){};iu._logoUrl=void 0;Object.defineProperties(iu,{logoUrl:{get:function(){return c(iu._logoUrl)||(iu._logoUrl=tn("Assets/Images/google_earth_credit.png")),iu._logoUrl},set:function(e){T.defined("value",e),iu._logoUrl=e}}});var A2=iu;var Vlt=/\/$/,j0e=new Tt('© Mapbox © OpenStreetMap Improve this map');function hw(e){e=e??W.EMPTY_OBJECT;let t=e.mapId;if(!c(t))throw new E("options.mapId is required.");let n=e.accessToken;if(!c(n))throw new E("options.accessToken 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;let i=we.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();Vlt.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;c(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Tt(s))):s=j0e,this._resource=i,this._imageryProvider=new Ya({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(hw.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}}});hw.prototype.getTileCredits=function(e,t,n){};hw.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};hw.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};hw._defaultCredit=j0e;var C2=hw;function HT(e){e=e??W.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 Ki({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 pe;let i=e.credit;typeof i=="string"&&(i=new Tt(i)),this._credit=i,T.defined("options.url",e.url);let o=we.createIfNeeded(e.url);this._resource=o,T.typeOf.number("options.tileWidth",e.tileWidth),T.typeOf.number("options.tileHeight",e.tileHeight),this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(HT.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 zlt(e,t,n,i){let o=`Failed to load image ${e.url}`;c(t)&&c(t.message)&&(o+=`: ${t.message}`);let r=Po.reportError(i,n,c(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return qX(e,n,r);throw c(n)&&(n._hasError=!0),new ae(o)}async function qX(e,t,n){try{return await yl.loadImage(null,e)}catch(i){return zlt(e,i,t,n)}}HT.fromUrl=async function(e,t){T.defined("url",e);let n=we.createIfNeeded(e),i=await qX(n);t=t??W.EMPTY_OBJECT;let o=new HT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};HT.prototype.getTileCredits=function(e,t,n){};HT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!c(this._image)){let o=await qX(this._resource,this);return this._image=o,Po.reportSuccess(this._errorEvent),o}return this._image};HT.prototype.pickFeatures=function(e,t,n,i,o){};var E2=HT;function Hlt(e,t,n){if(!c(e))throw new E("type is required.");if(this.type=e,!c(t))if(e==="json")t="application/json";else if(e==="xml")t="text/xml";else if(e==="html")t="text/html";else if(e==="text")t="text/plain";else throw new E('format is required when type is not "json", "xml", "html", or "text".');if(this.format=t,!c(n))if(e==="json")n=Glt;else if(e==="xml")n=Ylt;else if(e==="html")n=W0e;else if(e==="text")n=W0e;else throw new E('callback is required when type is not "json", "xml", "html", or "text".');this.callback=n}function Glt(e){let t=[],n=e.features;for(let i=0;i0)for(let r=0;r\s*<\/body>/im,eut=//im,tut=/([\s\S]*)<\/title>/im;function W0e(e){if(Jlt.test(e)||eut.test(e))return;let t,n=tut.exec(e);n&&n.length>1&&(t=n[1]);let i=new Uh;return i.name=t,i.description=e,i.data=e,[i]}var GT=Hlt;function S2(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.clock",e.clock),T.typeOf.object("options.times",e.times),T.typeOf.func("options.requestImageFunction",e.requestImageFunction),T.typeOf.func("options.reloadFunction",e.reloadFunction),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(S2.prototype,{clock:{get:function(){return this._clock},set:function(e){if(!c(e))throw new E("value is required.");this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){if(!c(e))throw new E("value is required.");this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});S2.prototype.getFromCache=function(e,t,n,i){let o=q0e(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(c(s)&&c(s[o])){let a=s[o];r=a.promise.catch(function(l){throw i.state=a.request.state,l}),delete s[o]}return r};S2.prototype.checkApproachingInterval=function(e,t,n,i){let o=q0e(e,t,n),r=this._tilesRequestedForInterval,s=Y0e(this),a={key:o,priorityFunction:i.priorityFunction};(!c(s)||!X0e(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};S2.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=Y0e(this);if(c(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let l=s.pop();a=X0e(this,l,r),a||s.push(l)}}};function q0e(e,t,n){return`${e}-${t}-${n}`}function nut(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Y0e(e){let t=e._times;if(!c(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let l=t.get(a);return r>0?(s=Q.secondsDifference(l.stop,i),++a):(s=Q.secondsDifference(l.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function X0e(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];c(r)||(r=o[i]={});let s=t.key;if(c(r[s]))return!0;let a=nut(s),l=new Qo({throttle:!1,throttleByServer:!0,type:ms.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,l,n);return c(u)?(r[s]={promise:u,request:l},!0):!1}var jT=S2;var iut=[3034,3035,3042,3043,3044],out=[4471,4559];function zh(e){if(e=e??W.EMPTY_OBJECT,!c(e.url))throw new E("options.url is required.");if(!c(e.layers))throw new E("options.layers is required.");if(c(e.times)&&!c(e.clock))throw new E("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=we.createIfNeeded(e.url),n=we.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(zh.DefaultParameters,!0),n.setQueryParameters(zh.GetFeatureInfoDefaultParameters,!0),c(e.parameters)&&t.setQueryParameters(K0e(e.parameters)),c(e.getFeatureInfoParameters)&&n.setQueryParameters(K0e(e.getFeatureInfoParameters));let i=this;this._reload=void 0,c(e.times)&&(this._timeDynamicImagery=new jT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,l,u,f){return $0e(i,s,a,l,u,f)},reloadFunction:function(){c(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 s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!out.includes(a)||iut.includes(a))&&(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 Ya({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Ki({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??zh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function $0e(e,t,n,i,o,r){let s=c(r)?r.data:void 0,a=e._tileProvider;return c(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function rut(e,t,n,i,o,r,s){let a=c(s)?s.data:void 0,l=e._tileProvider;return c(a)&&l._pickFeaturesResource.setQueryParameters(a),l.pickFeatures(t,n,i,o,r)}Object.defineProperties(zh.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});zh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};zh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return c(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),c(o)||(o=$0e(this,e,t,n,i,s)),c(o)&&c(r)&&r.checkApproachingInterval(e,t,n,i),o};zh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=c(r)?r.currentInterval:void 0;return rut(this,e,t,n,i,o,s)};zh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});zh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});zh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new GT("json","application/json")),Object.freeze(new GT("xml","text/xml")),Object.freeze(new GT("text","text/html"))]);function K0e(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var w2=zh;var sut=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function v2(e){if(e=e??W.EMPTY_OBJECT,!c(e.url))throw new E("options.url is required.");if(!c(e.layer))throw new E("options.layer is required.");if(!c(e.style))throw new E("options.style is required.");if(!c(e.tileMatrixSetID))throw new E("options.tileMatrixSetID is required.");if(c(e.times)&&!c(e.clock))throw new E("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;let t=we.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!c(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(sut),this._useKvp=!0;else{let h={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(h),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=e.format??"image/jpeg",this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=c(e.tilingScheme)?e.tilingScheme:new ls({ellipsoid:e.ellipsoid}),this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._dimensions=e.dimensions;let s=this;this._reload=void 0,c(e.times)&&(this._timeDynamicImagery=new jT({clock:e.clock,times:e.times,requestImageFunction:function(h,p,g,m,y){return Z0e(s,h,p,g,m,y)},reloadFunction:function(){c(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(ce.southwest(this._rectangle),this._minimumLevel),l=this._tilingScheme.positionToTileXY(ce.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(l.x-a.x)+1)*(Math.abs(l.y-a.y)+1);if(u>4)throw new E(`The imagery provider's rectangle and minimumLevel indicate that there are ${u} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);this._errorEvent=new pe;let f=e.credit;this._credit=typeof f=="string"?new Tt(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():c(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function Z0e(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=c(s)?s[i]:i.toString(),l=e._subdomains,u=e._dimensions,f=c(r)?r.data:void 0,h,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:l[(t+n+i)%l.length]},h=e._resource.getDerivedResource({request:o}),h.setTemplateValues(p),c(u)&&h.setTemplateValues(u),c(f)&&h.setTemplateValues(f);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,c(u)&&(g=xt(g,u)),c(f)&&(g=xt(g,f)),p={s:l[(t+n+i)%l.length]},h=e._resource.getDerivedResource({queryParameters:g,request:o}),h.setTemplateValues(p)}return yl.loadImage(e,h)}Object.defineProperties(v2.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,c(this._reload)&&this._reload())}}});v2.prototype.getTileCredits=function(e,t,n){};v2.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return c(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),c(o)||(o=Z0e(this,e,t,n,i,s)),c(o)&&c(r)&&r.checkApproachingInterval(e,t,n,i),o};v2.prototype.pickFeatures=function(e,t,n,i,o){};var D2=v2;var aut={ARCGIS_MAPSERVER:dg.fromUrl,BING:async(e,t)=>b2.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,A2.fromUrl(e,n,t)},MAPBOX:(e,t)=>new C2({url:e,...t}),SINGLE_TILE:E2.fromUrl,TMS:D0.fromUrl,URL_TEMPLATE:(e,t)=>new Ya({url:e,...t}),WMS:(e,t)=>new w2({url:e,...t}),WMTS:(e,t)=>new D2({url:e,...t})};function op(e){e=e??W.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 pe}Object.defineProperties(op.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(){}}});op.fromAssetId=async function(e,t){T.typeOf.number("assetId",e),t=t??W.EMPTY_OBJECT;let n=Cu._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=op._endpointCache[i];c(o)||(o=n.fetchJson(),op._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new ae(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!c(a))s=await D0.fromUrl(new Cu(r,n));else{let u=aut[a];if(!c(u))throw new ae(`Unrecognized Cesium ion imagery type: ${a}`);let f={...r.options},h=f.url;delete f.url,s=await u(h,f)}let l=new op(t);return s.errorEvent.addEventListener(function(u){u.provider=l,l._errorEvent.raiseEvent(u)}),l._tileCredits=Cu.getCreditsFromEndpoint(r,n),l._imageryProvider=s,l};op.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return c(i)?this._tileCredits.concat(i):this._tileCredits};op.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};op.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};op._endpointCache={};var hg=op;var cut={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},mg=Object.freeze(cut);function lut(e){e=e??W.EMPTY_OBJECT;let t=e.style??mg.AERIAL;return hg.fromAssetId(t)}var pg=lut;function mw(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=ai.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!c(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}mw.createPlaceholder=function(e){let t=new mw(e,0,0,0);return t.addReference(),t.state=ai.PLACEHOLDER,t};mw.prototype.addReference=function(){++this.referenceCount};mw.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),c(this.parent)&&this.parent.releaseReference(),c(this.image)&&c(this.image.destroy)&&this.image.destroy(),c(this.texture)&&this.texture.destroy(),c(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),de(this),0):this.referenceCount};mw.prototype.processStateMachine=function(e,t,n){this.state===ai.UNLOADED&&!n&&(this.state=ai.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ai.RECEIVED&&(this.state=ai.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ai.READY&&t&&!this.texture;(this.state===ai.TEXTURE_LOADED||i)&&(this.state=ai.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var pw=mw;function KX(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}KX.prototype.freeResources=function(){c(this.readyImagery)&&this.readyImagery.releaseReference(),c(this.loadingImagery)&&this.loadingImagery.releaseReference()};KX.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ai.READY)return c(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;c(r)&&(r.state!==ai.READY||!this.useWebMercatorT&&!c(r.texture));)r.state!==ai.FAILED&&r.state!==ai.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(c(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,c(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ai.FAILED||i.state===ai.INVALID?c(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var _w=KX;function Ai(e,t){this._imageryProvider=e,this._readyEvent=new pe,this._errorEvent=new pe,t=t??W.EMPTY_OBJECT,e=e??W.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??Ai.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Ai.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Ai.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Ai.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Ai.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Ai.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Ai.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Ai.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 _w(pw.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??Ai.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Ai.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return c(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Ai.DEFAULT_BRIGHTNESS=1;Ai.DEFAULT_CONTRAST=1;Ai.DEFAULT_HUE=0;Ai.DEFAULT_SATURATION=1;Ai.DEFAULT_GAMMA=1;Ai.DEFAULT_SPLIT=Vr.NONE;Ai.DEFAULT_MINIFICATION_FILTER=Yt.LINEAR;Ai.DEFAULT_MAGNIFICATION_FILTER=li.LINEAR;Ai.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ai.fromProviderAsync=function(e,t){T.typeOf.object("imageryProviderPromise",e);let n=new Ai(void 0,t);return mut(n,Promise.resolve(e)),n};Ai.fromWorldImagery=function(e){return e=e??W.EMPTY_OBJECT,Ai.fromProviderAsync(pg({style:e.style}),e)};Ai.prototype.isBaseLayer=function(){return this._isBaseLayer};Ai.prototype.isDestroyed=function(){return!1};Ai.prototype.destroy=function(){return de(this)};var ebe=new ce,Q0e=new ce,$X=new ce,tbe=new ce;Ai.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};Ai.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!c(t)||c(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||c(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;c(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,s=ce.intersection(o.rectangle,this._rectangle,ebe),a=ce.intersection(e.rectangle,s,Q0e);if(!c(a)){if(!this.isBaseLayer())return!1;let D=s,I=e.rectangle;a=Q0e,I.south>=D.north?a.north=a.south=D.north:I.north<=D.south?a.north=a.south=D.south:(a.south=Math.max(I.south,D.south),a.north=Math.min(I.north,D.north)),I.west>=D.east?a.west=a.east=D.east:I.east<=D.west?a.west=a.east=D.west:(a.west=Math.max(I.west,D.west),a.east=Math.min(I.east,D.east))}let l=0;a.south>0?l=a.south:a.north<0&&(l=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),h=dut(this,f,l);h=Math.max(0,h);let p=o.maximumLevel;if(h>p&&(h=p),c(o.minimumLevel)){let D=o.minimumLevel;h<D&&(h=D)}let g=o.tilingScheme,m=g.positionToTileXY(ce.northwest(a),h),y=g.positionToTileXY(ce.southeast(a),h),b=e.rectangle.width/512,x=e.rectangle.height/512,A=g.tileXYToRectangle(m.x,m.y,h);Math.abs(A.south-e.rectangle.north)<x&&m.y<y.y&&++m.y,Math.abs(A.east-e.rectangle.west)<b&&m.x<y.x&&++m.x;let C=g.tileXYToRectangle(y.x,y.y,h);Math.abs(C.north-e.rectangle.south)<x&&y.y>m.y&&--y.y,Math.abs(C.west-e.rectangle.east)<b&&y.x>m.x&&--y.x;let S=ce.clone(e.rectangle,tbe),v=g.tileXYToRectangle(m.x,m.y,h),P=ce.intersection(v,s,$X),M;r?(g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(P,P),g.rectangleToNativeRectangle(s,s),M=g.tileXYToNativeRectangle.bind(g),b=S.width/512,x=S.height/512):M=g.tileXYToRectangle.bind(g);let R,L=0,F=1,_;!this.isBaseLayer()&&Math.abs(P.west-S.west)>=b&&(L=Math.min(1,(P.west-S.west)/S.width)),!this.isBaseLayer()&&Math.abs(P.north-S.north)>=x&&(F=Math.max(0,(P.north-S.south)/S.height));let w=F;for(let D=m.x;D<=y.x;D++)if(R=L,v=M(D,m.y,h),P=ce.simpleIntersection(v,s,$X),!!c(P)){L=Math.min(1,(P.east-S.west)/S.width),D===y.x&&(this.isBaseLayer()||Math.abs(P.east-S.east)<b)&&(L=1),F=w;for(let I=m.y;I<=y.y;I++){if(_=F,v=M(D,I,h),P=ce.simpleIntersection(v,s,$X),!c(P))continue;F=Math.max(0,(P.south-S.south)/S.height),I===y.y&&(this.isBaseLayer()||Math.abs(P.south-S.south)<x)&&(F=0);let N=new se(R,F,L,_),k=this.getImageryFromCache(D,I,h);i.imagery.splice(n,0,new _w(k,N,r)),++n}}return!0};Ai.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let l=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=l.rectangleToNativeRectangle(n,ebe),i=l.rectangleToNativeRectangle(i,tbe)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new se(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};Ai.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!c(s))return o();e.image=s,e.state=ai.RECEIVED,e.request=void 0,Po.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===$n.CANCELLED){e.state=ai.UNLOADED,e.request=void 0;return}e.state=ai.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Po.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Qo({throttle:!1,throttleByServer:!0,type:ms.IMAGERY});e.request=s,e.state=ai.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!c(a)){e.state=ai.UNLOADED,e.request=void 0;return}c(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(l){i(l)}).catch(function(l){o(l)})}r()};Ai.prototype._createTextureWebGL=function(e,t){let n=new Qt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return c(i.internalFormat)?new Rt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Rt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?ke.RGBA:ke.RGB,sampler:n})};Ai.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(c(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(c(r)){if(!r.isReady()){t.state=ai.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ai.INVALID;return}}}if(this.minificationFilter!==Yt.NEAREST&&this.minificationFilter!==Yt.LINEAR)throw new E("ImageryLayer minification filter must be NEAREST or LINEAR");let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Mi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ai.TEXTURE_LOADED};function J0e(e,t,n){return`${e}:${t}:${n}`}Ai.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Yt.LINEAR&&i===li.LINEAR&&!ke.isCompressedFormat(t.pixelFormat)&&O.isPowerOfTwo(t.width)&&O.isPowerOfTwo(t.height)){n=Yt.LINEAR_MIPMAP_LINEAR;let r=ut.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=J0e(n,i,s),l=e.cache.imageryLayerMipmapSamplers;c(l)||(l={},e.cache.imageryLayerMipmapSamplers=l);let u=l[a];c(u)||(u=l[a]=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Cf.NICEST),t.sampler=u}else{let r=J0e(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;c(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];c(a)||(a=s[r]=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Ai.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 Oi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new Uc({persists:!0,owner:this,preExecute:function(l){fut(l,r,i,t.rectangle)},postExecute:function(l){t.texture=l,s._finalizeReprojectTexture(r,l),t.state=ai.READY,t.releaseReference()},canceled:function(){t.state=ai.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ai.READY};Ai.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};Ai.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){c(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ai.prototype.getImageryFromCache=function(e,t,n,i){let o=nbe(e,t,n),r=this._imageryCache[o];return c(r)||(r=new pw(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Ai.prototype.removeImageryFromCache=function(e){let t=nbe(e.x,e.y,e.level);delete this._imageryCache[t]};function nbe(e,t,n){return JSON.stringify([e,t,n])}var TH={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new H,texture:void 0},uut=Vt.supportsTypedArrays()?new Float32Array(2*64):void 0;function fut(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!c(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){c(this.framebuffer)&&this.framebuffer.destroy(),c(this.vertexArray)&&this.vertexArray.destroy(),c(this.shaderProgram)&&this.shaderProgram.destroy()}};let b=new Float32Array(2*64*2),x=0;for(let P=0;P<64;++P){let M=P/63;b[x++]=0,b[x++]=M,b[x++]=1,b[x++]=M}let A={position:0,webMercatorT:1},C=cs.getRegularGridIndices(2,64),S=yt.createIndexBuffer({context:t,typedArray:C,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});o.vertexArray=new ti({context:t,attributes:[{index:A.position,vertexBuffer:yt.createVertexBuffer({context:t,typedArray:b,usage:Be.STATIC_DRAW}),componentsPerAttribute:2},{index:A.webMercatorT,vertexBuffer:yt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Be.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:S});let v=new He({sources:[s2]});o.shaderProgram=Jt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:r2,attributeLocations:A}),o.sampler=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:li.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;TH.textureDimensions.x=r,TH.textureDimensions.y=s,TH.texture=n;let a=Math.sin(i.south),l=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-l),h=new Rt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});O.isPowerOfTwo(r)&&O.isPowerOfTwo(s)&&h.generateMipmap(Cf.NICEST);let p=i.south,g=i.north,m=uut,y=0;for(let b=0;b<64;++b){let x=b/63,A=O.lerp(p,g,x);a=Math.sin(A);let S=(.5*Math.log((1+a)/(1-a))-l)*f;m[y++]=S,m[y++]=S}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=TH,e.vertexArray=o.vertexArray}function dut(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Oi?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function hut(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function mut(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){hut(e._errorEvent,i)}}var Xa=Ai;var put={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=put;var ibe={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>=ibe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Yn=ibe;function yw(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se}yw.prototype.update=function(e,t,n){this.changedThisFrame&&(ube(e,t,this.tile,n),this.changedThisFrame=!1)};yw.prototype.destroy=function(e){this._destroyVertexArray(e),c(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};yw.prototype._destroyVertexArray=function(e){c(this.vertexArray)&&(c(e)?e.push(this.vertexArray):md._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var _ut=new Cy;yw.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=_ut;a.clear();for(let u=0;u<t.length;++u){let f=t[u];c(f.data.vertexArray)&&a.enqueue(t[u])}let l=a.dequeue();for(;l!==void 0;){let u=l.findTileToWest(r),f=l.findTileToSouth(r),h=l.findTileToEast(r),p=l.findTileToNorth(r);Bs(e,n,l,u,s,yn.EAST,!1,a,i),Bs(e,n,l,f,s,yn.NORTH,!1,a,i),Bs(e,n,l,h,s,yn.WEST,!1,a,i),Bs(e,n,l,p,s,yn.SOUTH,!1,a,i);let g=u.findTileToNorth(r),m=u.findTileToSouth(r),y=h.findTileToNorth(r),b=h.findTileToSouth(r);Bs(e,n,l,g,s,yn.SOUTHEAST,!1,a,i),Bs(e,n,l,y,s,yn.SOUTHWEST,!1,a,i),Bs(e,n,l,m,s,yn.NORTHEAST,!1,a,i),Bs(e,n,l,b,s,yn.NORTHWEST,!1,a,i),l=a.dequeue()}};function Bs(e,t,n,i,o,r,s,a,l){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||Yn.wasKicked(u._lastSelectionResult)||Yn.originalResult(u._lastSelectionResult)===Yn.CULLED);){if(s)return;let f=u.parent;if(r>=yn.NORTHWEST&&f!==void 0)switch(r){case yn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case yn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case yn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case yn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===Yn.RENDERED){if(c(u.data.vertexArray))return;gut(e,t,n,u,r,o,a,l);return}if(Yn.originalResult(i._lastSelectionResult)!==Yn.CULLED)switch(r){case yn.WEST:Bs(e,t,n,i.northwestChild,o,r,!0,a,l),Bs(e,t,n,i.southwestChild,o,r,!0,a,l);break;case yn.EAST:Bs(e,t,n,i.southeastChild,o,r,!0,a,l),Bs(e,t,n,i.northeastChild,o,r,!0,a,l);break;case yn.SOUTH:Bs(e,t,n,i.southwestChild,o,r,!0,a,l),Bs(e,t,n,i.southeastChild,o,r,!0,a,l);break;case yn.NORTH:Bs(e,t,n,i.northeastChild,o,r,!0,a,l),Bs(e,t,n,i.northwestChild,o,r,!0,a,l);break;case yn.NORTHWEST:Bs(e,t,n,i.northwestChild,o,r,!0,a,l);break;case yn.NORTHEAST:Bs(e,t,n,i.northeastChild,o,r,!0,a,l);break;case yn.SOUTHWEST:Bs(e,t,n,i.southwestChild,o,r,!0,a,l);break;case yn.SOUTHEAST:Bs(e,t,n,i.southeastChild,o,r,!0,a,l);break;default:throw new E("Invalid edge")}}}function gut(e,t,n,i,o,r,s,a){let l=i.data;if(l.fill===void 0)l.fill=new yw(i);else if(l.fill.visitedFrame===r)return;l.fill.enqueuedFrame!==r&&(l.fill.enqueuedFrame=r,l.fill.changedThisFrame=!1,s.enqueue(i)),yut(e,t,n,i,o,a)}function yut(e,t,n,i,o,r){let s=i.data.fill,a,l=n.data.fill;c(l)?(l.visitedFrame=t.frameNumber,l.changedThisFrame&&(ube(e,t,n,r),l.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(o){case yn.WEST:u=s.westMeshes,f=s.westTiles;break;case yn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case yn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case yn.NORTH:u=s.northMeshes,f=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let h,p,g,m,y=n.rectangle,b,x=i.rectangle;switch(o){case yn.WEST:for(b=(x.north-x.south)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.greaterThan(y.north,m.south,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.greaterThanOrEquals(y.south,m.north,b));++p);break;case yn.SOUTH:for(b=(x.east-x.west)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.lessThan(y.west,m.east,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.lessThanOrEquals(y.east,m.west,b));++p);break;case yn.EAST:for(b=(x.north-x.south)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.lessThan(y.south,m.north,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.lessThanOrEquals(y.north,m.south,b));++p);break;case yn.NORTH:for(b=(x.east-x.west)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.greaterThan(y.east,m.west,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.greaterThanOrEquals(y.west,m.east,b));++p);break}p-h===1?(s.changedThisFrame=s.changedThisFrame||u[h]!==a,u[h]=a,f[h]=n):(s.changedThisFrame=!0,u.splice(h,p-h,a),f.splice(h,p-h,n))}var WT=new he,but=new he,gw=new d,eK=new d,ZX=new H,QX=new H,Ju=new H;function DH(){this.height=0,this.encodedNormal=new H}function AH(e,t,n,i,o,r,s,a,l){if(c(o))return o;let u;if(c(r)&&c(s))u=(r.height+s.height)*.5;else if(c(r))u=r.height;else if(c(s))u=s.height;else if(c(a))u=a.height;else{let h=e.tile.data.tileBoundingRegion,p=0,g=0;c(h)&&(p=h.minimumHeight,g=h.maximumHeight),u=(p+g)*.5}return fbe(e,t,n,i,u,l),l}var xut={minimumHeight:0,maximumHeight:0},Tut=new d,obe=new DH,rbe=new DH,sbe=new DH,abe=new DH,Aut=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,Cut={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function ube(e,t,n,i){md.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,l=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,h=EH(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,sbe),p=EH(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,obe),g=EH(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,rbe),m=EH(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,abe);h=AH(r,f,0,1,h,p,m,g,sbe),p=AH(r,f,0,0,p,h,g,m,obe),g=AH(r,f,1,1,g,p,m,h,rbe),m=AH(r,f,1,1,m,g,h,p,abe);let y=p.height,b=g.height,x=h.height,A=m.height,C=Math.min(y,b,x,A),S=Math.max(y,b,x,A),v=(C+S)*.5,P,M,R=e.getLevelMaximumGeometricError(n.level),L=f.maximumRadius-R,F=Math.acos(L/f.maximumRadius)*4;if(F*=1.5,s.width>F&&S-C<=R){let D=new qa({width:9,height:9,buffer:Aut,structure:{heightOffset:S}}),I=Cut;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=l,r.mesh=D._createMeshSync(I)}else{let D=u,I=ce.center(s,but);I.height=v;let N=f.cartographicToCartesian(I,Tut),k=new Oc(N,void 0,void 0,void 0,void 0,!0,!0,D,a,l),z=5,V;for(V=r.westMeshes,P=0,M=V.length;P<M;++P)z+=V[P].eastIndicesNorthToSouth.length;for(V=r.southMeshes,P=0,M=V.length;P<M;++P)z+=V[P].northIndicesWestToEast.length;for(V=r.eastMeshes,P=0,M=V.length;P<M;++P)z+=V[P].westIndicesSouthToNorth.length;for(V=r.northMeshes,P=0,M=V.length;P<M;++P)z+=V[P].southIndicesEastToWest.length;let j=xut;j.minimumHeight=C,j.maximumHeight=S;let U=k.stride,q=new Float32Array(z*U),Y=0,te=Y;Y=CH(f,s,k,q,Y,0,1,h.height,h.encodedNormal,1,j),Y=wH(r,f,k,q,Y,r.westTiles,r.westMeshes,yn.EAST,j);let K=Y;Y=CH(f,s,k,q,Y,0,0,p.height,p.encodedNormal,0,j),Y=wH(r,f,k,q,Y,r.southTiles,r.southMeshes,yn.NORTH,j);let Z=Y;Y=CH(f,s,k,q,Y,1,0,g.height,g.encodedNormal,0,j),Y=wH(r,f,k,q,Y,r.eastTiles,r.eastMeshes,yn.WEST,j);let ee=Y;Y=CH(f,s,k,q,Y,1,1,m.height,m.encodedNormal,1,j),Y=wH(r,f,k,q,Y,r.northTiles,r.northMeshes,yn.SOUTH,j),C=j.minimumHeight,S=j.maximumHeight;let me=Dn.fromRectangle(s,C,S,n.tilingScheme.ellipsoid),Te=Mi.geodeticLatitudeToMercatorAngle(s.south),ue=1/(Mi.geodeticLatitudeToMercatorAngle(s.north)-Te),ye=(Mi.geodeticLatitudeToMercatorAngle(I.latitude)-Te)*ue,Ae=f.geodeticSurfaceNormalCartographic(WT,eK),Pe=Ln.octEncode(Ae,ZX),Ee=Y;k.encode(q,Y*U,me.center,H.fromElements(.5,.5,Ju),v,Pe,ye,Ae),++Y;let ze=Y,qe=ze<256?1:2,it=(ze-1)*3,Dt=it*qe,jt=(q.length-ze*U)*Float32Array.BYTES_PER_ELEMENT,$e;if(jt>=Dt){let _e=ze*U*Float32Array.BYTES_PER_ELEMENT;$e=ze<256?new Uint8Array(q.buffer,_e,it):new Uint16Array(q.buffer,_e,it)}else $e=ze<256?new Uint8Array(it):new Uint16Array(it);q=new Float32Array(q.buffer,0,ze*U);let un=0;for(P=0;P<ze-2;++P)$e[un++]=Ee,$e[un++]=P,$e[un++]=P+1;$e[un++]=Ee,$e[un++]=P,$e[un++]=0;let zt=[];for(P=K;P>=te;--P)zt.push(P);let Ct=[];for(P=Z;P>=K;--P)Ct.push(P);let Ei=[];for(P=ee;P>=Z;--P)Ei.push(P);let an=[];for(an.push(0),P=Ee-1;P>=ee;--P)an.push(P);r.mesh=new hd(k.center,q,$e,it,ze,C,S,le.fromOrientedBoundingBox(me),Iut(e,me.center,s,C,S),k.stride,me,k,zt,Ct,Ei,an)}let _=t.context;r._destroyVertexArray(i),r.vertexArray=md._createVertexArrayForMesh(_,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let w=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let D=o._findAncestorTileWithTerrainData(n);c(D)&&c(D.data.waterMaskTexture)&&(r.waterMaskTexture=D.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,D,r.waterMaskTranslationAndScale))}c(w)&&(--w.referenceCount,w.referenceCount===0&&w.destroy())}function CH(e,t,n,i,o,r,s,a,l,u,f){let h=WT;h.longitude=O.lerp(t.west,t.east,r),h.latitude=O.lerp(t.south,t.north,s),h.height=a;let p=e.cartographicToCartesian(h,gw),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,eK));let m=QX;return m.x=r,m.y=s,n.encode(i,o*n.stride,p,m,a,l,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),o+1}var vH=new ce;function P2(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,vH),o.west-=O.TWO_PI,o.east-=O.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ce.clone(e.rectangle,vH),o.west+=O.TWO_PI,o.east+=O.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,l=(r.east-o.west)/s,u=o.north-o.south,f=(r.south-o.south)/u,h=(r.north-o.south)/u,p=(n.x-a)/(l-a),g=(n.y-f)/(h-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var Eut=new H;function JX(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var Sut=new H,wut=new d;function vut(e,t,n,i,o,r,s,a,l,u){let f=i.encoding,h=i.vertices,p=P2(t,n,f.decodeTextureCoordinates(h,o,Ju),Ju),g=P2(t,n,f.decodeTextureCoordinates(h,r,QX),QX),m;l?m=(s-p.x)/(g.x-p.x):m=(a-p.y)/(g.y-p.y);let y=f.decodeHeight(h,o),b=f.decodeHeight(h,r),x=n.rectangle;WT.longitude=O.lerp(x.west,x.east,s),WT.latitude=O.lerp(x.south,x.north,a),u.height=WT.height=O.lerp(y,b,m);let A;if(f.hasVertexNormals){let C=f.getOctEncodedNormal(h,o,Eut),S=f.getOctEncodedNormal(h,r,Sut),v=Ln.octDecode(C.x,C.y,gw),P=Ln.octDecode(S.x,S.y,wut);A=d.lerp(v,P,m,gw),d.normalize(A,A),Ln.octEncode(A,u.encodedNormal)}else A=e.geodeticSurfaceNormalCartographic(WT,gw),Ln.octEncode(A,u.encodedNormal)}function fbe(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(WT,gw);Ln.octEncode(s,r.encodedNormal)}function EH(e,t,n,i,o,r,s,a,l,u,f){if(lbe(e,t,a,s,!1,n,i,f)||lbe(e,t,u,l,!0,n,i,f))return f;let p;if(tK(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],JX(r,p,n,i,f),f;let g;if(n===0?i===0?g=SH(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):g=SH(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?g=SH(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):g=SH(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),c(g))return fbe(e,t,n,i,g,f),f}function SH(e,t,n,i,o,r,s,a){let l=cbe(e,t,!1,n,s,a),u=cbe(i,o,!0,r,s,a);return c(l)&&c(u)?(l+u)*.5:c(l)?l:u}function wH(e,t,n,i,o,r,s,a,l){for(let u=0;u<r.length;++u)o=Dut(e,t,n,i,o,r[u],s[u],a,l);return o}function Dut(e,t,n,i,o,r,s,a,l){let u=r.rectangle;a===yn.EAST&&e.tile.x===0?(u=ce.clone(r.rectangle,vH),u.west-=O.TWO_PI,u.east-=O.TWO_PI):a===yn.WEST&&r.x===0&&(u=ce.clone(r.rectangle,vH),u.west+=O.TWO_PI,u.east+=O.TWO_PI);let f=e.tile.rectangle,h,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Ju),h=Ju.x,p=Ju.y);let g,m;switch(a){case yn.WEST:g=s.westIndicesSouthToNorth,m=!1;break;case yn.NORTH:g=s.northIndicesWestToEast,m=!0;break;case yn.EAST:g=s.eastIndicesNorthToSouth,m=!1;break;case yn.SOUTH:g=s.southIndicesEastToWest,m=!0;break}let y=r,b=e.tile,x=s.encoding,A=s.vertices,C=n.stride,S,v;x.hasWebMercatorT&&(S=Mi.geodeticLatitudeToMercatorAngle(f.south),v=1/(Mi.geodeticLatitudeToMercatorAngle(f.north)-S));for(let P=0;P<g.length;++P){let M=g[P],R=x.decodeTextureCoordinates(A,M,Ju);P2(y,b,R,R);let L=R.x,F=R.y,_=m?L:F;if(_<0||_>1||Math.abs(L-h)<O.EPSILON5&&Math.abs(F-p)<O.EPSILON5)continue;let w=Math.abs(L)<O.EPSILON5||Math.abs(L-1)<O.EPSILON5,D=Math.abs(F)<O.EPSILON5||Math.abs(F-1)<O.EPSILON5;if(w&&D)continue;let I=x.decodePosition(A,M,gw),N=x.decodeHeight(A,M),k;x.hasVertexNormals?k=x.getOctEncodedNormal(A,M,ZX):(k=ZX,k.x=0,k.y=0);let z=F;if(x.hasWebMercatorT){let j=O.lerp(f.south,f.north,F);z=(Mi.geodeticLatitudeToMercatorAngle(j)-S)*v}let V;n.hasGeodeticSurfaceNormals&&(V=t.geodeticSurfaceNormal(I,eK)),n.encode(i,o*C,I,R,N,k,z,V),l.minimumHeight=Math.min(l.minimumHeight,N),l.maximumHeight=Math.max(l.maximumHeight,N),++o}return o}function cbe(e,t,n,i,o,r){let s,a,l;n?(s=0,a=e.length,l=1):(s=e.length-1,a=-1,l=-1);for(let u=s;u!==a;u+=l){let f=e[u],h=t[u];if(!tK(h,f))continue;let p;switch(i){case yn.WEST:p=f.westIndicesSouthToNorth;break;case yn.SOUTH:p=f.southIndicesEastToWest;break;case yn.EAST:p=f.eastIndicesNorthToSouth;break;case yn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(c(g))return f.encoding.decodeHeight(f.vertices,g)}}function tK(e,t){return c(t)&&(!c(e.data.fill)||!e.data.fill.changedThisFrame)}function lbe(e,t,n,i,o,r,s,a){let l,u,f,h,p,g=i[o?0:n.length-1],m=n[o?0:n.length-1];if(tK(g,m)&&(r===0?s===0?(l=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=o,f=o):(l=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!o,f=!1):s===0?(l=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!o,f=!0):(l=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=o,f=!o),l.length>0)){h=o?0:l.length-1,p=l[h],m.encoding.decodeTextureCoordinates(m.vertices,p,Ju);let y=P2(g,e.tile,Ju,Ju);if(y.x===r&&y.y===s)return JX(m,p,r,s,a),!0;if(h=Lo(l,u?r:s,function(b,x){m.encoding.decodeTextureCoordinates(m.vertices,b,Ju);let A=P2(g,e.tile,Ju,Ju);return f?u?A.x-r:A.y-s:u?r-A.x:s-A.y}),h<0){if(h=~h,h>0&&h<l.length)return vut(t,g,e.tile,m,l[h-1],l[h],r,s,u,a),!0}else return JX(m,l[h],r,s,a),!0}return!1}var Put=[new d,new d,new d,new d];function Iut(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,l=Put;return d.fromRadians(n.west,n.south,o,a,l[0]),d.fromRadians(n.east,n.south,o,a,l[1]),d.fromRadians(n.west,n.north,o,a,l[2]),d.fromRadians(n.east,n.north,o,a,l[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,i,r)}var bw=yw;function ur(e){if(!c(e))throw new E("options is required.");if(c(e.terrainProvider))if(c(e.imageryLayers)){if(!c(e.surfaceShaderSet))throw new E("options.surfaceShaderSet is required.")}else throw new E("options.imageryLayers is required.");else throw new E("options.terrainProvider is required.");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=xn.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 pe,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(ur.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(ur.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(ur.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(ur.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new pe,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 G(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}Object.defineProperties(ur.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){if(!c(e))throw new E("value is required.");this._baseColor=e,this._firstPassInitialColor=se.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){if(!c(e))throw new E("value is required.");this._quadtree=e}},tilingScheme:{get:function(){if(c(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,c(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){th.setOwner(e,this,"_clippingPolygons")}}});function Out(e,t){let n=e.loadingImagery;c(n)||(n=e.readyImagery);let i=t.loadingImagery;return c(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}ur.prototype.update=function(e){this._imageryLayers._update()};function Rut(e,t){let n=t.creditDisplay,i=e._terrainProvider;c(i)&&c(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&c(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}ur.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Out)})),Rut(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)md._freeVertexArray(t[i]);t.length=0};ur.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];c(s)&&(s.length=0)}let n=this._clippingPlanes;c(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;c(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};ur.prototype.endUpdate=function(e){if(!c(this._renderState)){this._renderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:dc.LESS}}),this._blendRenderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:dc.LESS_OR_EQUAL},blending:ln.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&&bw.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.verticalExaggeration,i=e.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==n||this._oldVerticalExaggerationRelativeHeight!==i;this._oldVerticalExaggeration=n,this._oldVerticalExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let l=r[s];if(c(l))for(let u=0,f=l.length;u<f;++u){let h=l[u],p=h.data.tileBoundingRegion;nft(this,h,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function _be(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)}ur.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)_be(t[n],e)};ur.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};ur.prototype.getLevelMaximumGeometricError=function(e){return c(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};ur.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;c(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Yn.CULLED_BUT_NEEDED,o=n.terrainState),md.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)!==xr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,md.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var Mut=new le,gbe=new ce,Lut=new ce,Nut=new he;function IH(e,t){if(t.west<t.east)return t;let n=ce.clone(t,Lut);return ce.center(e,Nut).longitude>0?n.east=O.PI:n.west=-O.PI,n}function ybe(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(c(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(c(i)&&i.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}ur.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=ybe(this,t);if(t.fog.enabled&&!o&&O.fog(i,t.fog.density)>=1)return xr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return xr.PARTIAL;let a=t.cullingVolume,l=s.boundingVolume;c(l)||(l=s.boundingSphere),r.clippedByBoundaries=!1;let u=IH(e.rectangle,this.cartographicLimitRectangle),f=ce.simpleIntersection(u,e.rectangle,gbe);if(!c(f))return xr.NONE;if(ce.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(l=Mut,le.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,l),d.fromElements(l.center.z,l.center.x,l.center.y,l.center),t.mode===oe.MORPHING&&c(r.renderedMesh)&&(l=le.union(s.boundingSphere,l,l))),!c(l))return xr.PARTIAL;let h=this._clippingPlanes;if(c(h)&&h.enabled){let b=h.computeIntersectionWithBoundingVolume(l);if(e.isClipped=b!==Wt.INSIDE,b===Wt.OUTSIDE)return xr.NONE}let p=this._clippingPolygons;if(c(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(s);e.isClipped=b!==Wt.OUTSIDE}let g,m=a.computeVisibility(l);if(m===Wt.OUTSIDE?g=xr.NONE:m===Wt.INTERSECTING?g=xr.PARTIAL:m===Wt.INSIDE&&(g=xr.FULL),g===xr.NONE)return g;let y=t.mode===oe.SCENE3D&&t.camera.frustum instanceof on;if(t.mode===oe.SCENE3D&&!y&&c(n)&&!o){let b=r.occludeePointInScaledSpace;return!c(b)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,s.minimumHeight)?g:xr.NONE}return g};ur.prototype.canRefine=function(e){return c(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var Fut=[],But=[];ur.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Fut;i.length=this._imageryLayers.length;let o=!1,r=!1,s;c(n)&&(o=n.terrainState===fo.READY,r=!0,s=n.imagery);let a,l;for(a=0,l=i.length;a<l;++a)i[a]=r;if(c(s))for(a=0,l=s.length;a<l;++a){let h=s[a],p=h.loadingImagery,g=!c(p)||p.state===ai.FAILED||p.state===ai.INVALID,m=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=But;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:Yn.NONE;if(p===Yn.RENDERED){let g=h.data;if(!c(g))continue;if(!o&&h.data.terrainState===fo.READY)return!1;let m=h.data.imagery;for(a=0,l=m.length;a<l;++a){let y=m[a],b=y.loadingImagery,x=!c(b)||b.state===ai.FAILED||b.state===ai.INVALID,A=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(x&&!i[A])return!1}}else p===Yn.REFINED&&f.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var kut=new d;ur.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=d.subtract(i.center,o,kut),a=d.magnitude(s);return a<O.EPSILON5?0:(d.divideByScalar(s,a,s),(1-d.dot(s,r))*e._distance)};var dbe=new B,PH=new B,Uut=new se,Vut=new se,zut=new se,Hut=new d,hbe=new d,Gut=new d,jut=new d;ur.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,l=i.length;a<l;++a){let u=i[a];c(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];c(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;c(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Wut=[new d,new d,new d,new d];function mbe(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,l=Wut;return d.fromRadians(n.west,n.south,o,a,l[0]),d.fromRadians(n.east,n.south,o,a,l[1]),d.fromRadians(n.west,n.north,o,a,l[2]),d.fromRadians(n.east,n.north,o,a,l[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,i,r)}ur.prototype.computeDistanceToTile=function(e,t){qut(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let l=t.camera.positionCartographic.height,u=Math.abs(l-r),f=Math.abs(l-s);u>f?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function qut(e,t,n){let i=e.data;i===void 0&&(i=e.data=new md);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Lu({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,l=!1,u=e,f=i.mesh,h=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight,l=!0;else if(h!==void 0&&h._minimumHeight!==void 0&&h._maximumHeight!==void 0)r.minimumHeight=h._minimumHeight,r.maximumHeight=h._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let m=g.mesh,y=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){r.minimumHeight=m.minimumHeight,r.maximumHeight=m.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){r.minimumHeight=y._minimumHeight,r.maximumHeight=y._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(l=!1,r.minimumHeight=Dr.getHeight(r.minimumHeight,p,g),r.maximumHeight=Dr.getHeight(r.maximumHeight,p,g)),l)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Dn.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=le.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=d.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),c(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=mbe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let y=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||y)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=mbe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=l}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}ur.prototype.isDestroyed=function(){return!1};ur.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(),de(this)};function Yut(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,l=a.length,u;for(u=0;u<l;++u)if(o=a[u],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(o=a[f],r=c(o)?o.readyImagery??o.loadingImagery:void 0,!c(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}ur.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(c(s._loadedCallbacks[e._layerIndex]))return;let a,l=s.data.imagery,u=l.length,f=-1,h=0;for(a=0;a<u;++a){let g=l[a];if((g.readyImagery??g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++h;else if(f!==-1)break}if(f===-1)return;let p=f+h;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Yut(h,e,n),s.state=ta.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=ta.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Yn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};ur.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let l=i[s],u=l.loadingImagery;if(c(u)||(u=l.readyImagery),u.imageryLayer===e)o===-1&&(o=s),l.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),c(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};ur.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};ur.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Xut=new B,Kut=new B;function pbe(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=B.multiplyByPoint(i,this.properties.rtc,hbe);return B.setTranslation(i,o,dbe),dbe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=B.multiplyByPoint(i,this.properties.rtc,hbe);return B.setTranslation(i,r,PH),B.multiply(o,PH,PH),PH},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 c(i)&&c(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=c(i)?B.multiply(e.context.uniformState.view,i.modelMatrix,Xut):B.IDENTITY;return B.inverseTranspose(o,Kut)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return c(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return c(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new G(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new H(65e5,9e6),nightFadeDistance:new H(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 B,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new H(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new H,southMercatorYAndOneOverHeight:new H,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new H,scaleAndBias:new B,clippingPlanesEdgeColor:G.clone(G.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:G.clone(G.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return c(t.materialUniformMap)?xt(n,t.materialUniformMap):n}function $ut(e,t,n){let i=n.data,o,r;if(c(i.vertexArray)?(o=i.mesh,r=i.vertexArray):c(i.fill)&&c(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!c(o)||!c(r))){if(c(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Zut(e,r,o),i.wireframeVertexArray.mesh=o}}function Zut(e,t,n){let o={indices:n.indices,primitiveType:Me.TRIANGLES};Nn.toWireframe(o);let r=o.indices,s=yt.createIndexBuffer({context:e,typedArray:r,usage:Be.STATIC_DRAW,indexDatatype:Fe.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ti({context:e,attributes:t._attributes,indexBuffer:s})}var bbe,xbe,OH;(function(){let e=new St({geometry:Ud.fromDimensions({dimensions:new d(2,2,2)})}),t=new St({geometry:new M_({radius:1})}),n=new B,i,o;function r(s){return new Pn({geometryInstances:s,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})}bbe=function(s,a){return s===i||(OH(),i=s,n=B.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Gt.fromColor(a),o=r(e)),o},xbe=function(s,a){return s===i||(OH(),i=s,n=B.fromTranslation(s.center,n),n=B.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Gt.fromColor(a),o=r(t)),o},OH=function(){c(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Qut=new se(0,0,0,0),Jut={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},eft=G.TRANSPARENT,tft=new Bt;function nft(e,t,n){let i=t.data;c(i.vertexArray)||(i.fill===void 0&&(i.fill=new bw(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(c(r)&&c(r.credits)){let _e=r.credits;for(let Ce=0,pn=_e.length;Ce<pn;++Ce)o.addCreditToNextFrame(_e[Ce])}let s=ut.maximumTextureImageUnits,a=i.waterMaskTexture,l=i.waterMaskTranslationAndScale;!c(a)&&c(i.fill)&&(a=i.fill.waterMaskTexture,l=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,h=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,y=e.undergroundColor??eft,b=e.undergroundColorAlphaByDistance??tft,x=ybe(e,n)&&n.mode===oe.SCENE3D&&y.alpha>0&&(b.nearValue>0||b.farValue>0),A=e.lambertDiffuseMultiplier,C=e.vertexShadowDarkness,S=e.hasWaterMask&&c(a),v=S&&e.showWaterEffect,P=e.oceanNormalMap,M=v&&c(P),R=e.terrainProvider,L=c(R)&&e.terrainProvider.hasVertexNormals,F=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,w=xn.castShadows(e.shadows)&&!h,D=xn.receiveShadows(e.shadows)&&!h,I=e.hueShift,N=e.saturationShift,k=e.brightnessShift,z=!(O.equalsEpsilon(I,0,O.EPSILON7)&&O.equalsEpsilon(N,0,O.EPSILON7)&&O.equalsEpsilon(k,0,O.EPSILON7)),V=!1;if(_){let _e=d.magnitude(n.camera.positionWC),Ce=e.nightFadeOutDistance;V=_e>Ce}S&&--s,M&&--s,c(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,c(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,c(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=f.numberOfTextureUniforms;let j=i.renderedMesh,U=j.center,q=j.encoding,Y=i.tileBoundingRegion,te=n.verticalExaggeration,K=n.verticalExaggerationRelativeHeight,Z=te!==1,ee=q.hasGeodeticSurfaceNormals,me=Uut,Te=0,ue=0,ye=0,Ae=0,Pe=!1;if(n.mode!==oe.SCENE3D){let _e=n.mapProjection,Ce=_e.project(ce.southwest(t.rectangle),Gut),pn=_e.project(ce.northeast(t.rectangle),jut);if(me.x=Ce.x,me.y=Ce.y,me.z=pn.x,me.w=pn.y,n.mode!==oe.MORPHING&&(U=Hut,U.x=0,U.y=(me.z+me.x)*.5,U.z=(me.w+me.y)*.5,me.x-=U.y,me.y-=U.z,me.z-=U.y,me.w-=U.z),n.mode===oe.SCENE2D&&q.quantization===ea.BITS12){let mt=1/(Math.pow(2,12)-1)*.5,so=(me.z-me.x)*mt,Ro=(me.w-me.y)*mt;me.x-=so,me.y-=Ro,me.z+=so,me.w+=Ro}_e instanceof Mi&&(Te=t.rectangle.south,ue=t.rectangle.north,ye=Mi.geodeticLatitudeToMercatorAngle(Te),Ae=1/(Mi.geodeticLatitudeToMercatorAngle(ue)-ye),Pe=!0)}let Ee=Jut;Ee.frameState=n,Ee.surfaceTile=i,Ee.hasWaterMask=S,Ee.showReflectiveOcean=v,Ee.showOceanWaves=M,Ee.enableLighting=e.enableLighting,Ee.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ee.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ee.showGroundAtmosphere=_,Ee.atmosphereLightIntensity=e.atmosphereLightIntensity,Ee.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ee.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ee.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ee.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ee.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ee.perFragmentGroundAtmosphere=V,Ee.hasVertexNormals=L,Ee.useWebMercatorProjection=Pe,Ee.clippedByBoundaries=i.clippedByBoundaries,Ee.hasGeodeticSurfaceNormals=ee,Ee.hasExaggeration=Z;let ze=i.imagery,qe=0,it=ze.length,Dt=e.showSkirts&&!u&&!h,jt=e.backFaceCulling&&!u&&!h,$e=jt?e._renderState:e._disableCullingRenderState,un=jt?e._blendRenderState:e._disableCullingBlendRenderState,zt=$e,Ct=e._firstPassInitialColor,Ei=n.context;if(c(e._debug.boundingSphereTile)||OH(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let _e=e._drawCommands.length;for(let Ce=0;Ce<_e;++Ce)e._uniformMaps[Ce]=pbe(n,e)}do{let _e=0,Ce,pn;if(e._drawCommands.length<=e._usedDrawCommands?(Ce=new Qe,Ce.owner=t,Ce.cull=!1,Ce.boundingVolume=new le,Ce.orientedBoundingBox=void 0,pn=pbe(n,e),e._drawCommands.push(Ce),e._uniformMaps.push(pn)):(Ce=e._drawCommands[e._usedDrawCommands],pn=e._uniformMaps[e._usedDrawCommands]),Ce.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let la=Y.boundingVolume,Sl=Y.boundingSphere;c(la)?bbe(la,G.RED).update(n):c(Sl)&&xbe(Sl,G.RED).update(n)}let mt=pn.properties;se.clone(Ct,mt.initialColor),mt.oceanNormalMap=P,mt.lightingFadeDistance.x=e.lightingFadeOutDistance,mt.lightingFadeDistance.y=e.lightingFadeInDistance,mt.nightFadeDistance.x=e.nightFadeOutDistance,mt.nightFadeDistance.y=e.nightFadeInDistance,mt.atmosphereLightIntensity=e.atmosphereLightIntensity,mt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,mt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,mt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,mt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,mt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,mt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let so=u?g:p,Ro=u?p:g;c(so)&&(se.fromElements(so.near,so.nearValue,so.far,so.farValue,mt.frontFaceAlphaByDistance),se.fromElements(Ro.near,Ro.nearValue,Ro.far,Ro.farValue,mt.backFaceAlphaByDistance)),se.fromElements(b.near,b.nearValue,b.far,b.farValue,mt.undergroundColorAlphaByDistance),G.clone(y,mt.undergroundColor),mt.lambertDiffuseMultiplier=A,mt.vertexShadowDarkness=C;let aa=!c(i.vertexArray)&&c(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;aa&&G.clone(e.fillHighlightColor,mt.fillHighlightColor),mt.verticalExaggerationAndRelativeHeight.x=te,mt.verticalExaggerationAndRelativeHeight.y=K,mt.center3D=j.center,d.clone(U,mt.rtc),se.clone(me,mt.tileRectangle),mt.southAndNorthLatitude.x=Te,mt.southAndNorthLatitude.y=ue,mt.southMercatorYAndOneOverHeight.x=ye,mt.southMercatorYAndOneOverHeight.y=Ae;let Nr=Vut,Cs=IH(t.rectangle,e.cartographicLimitRectangle),Ne=zut,ot=IH(t.rectangle,m);d.fromElements(I,N,k,mt.hsbShift);let Xe=t.rectangle,Ze=1/Xe.width,pt=1/Xe.height;Nr.x=(Cs.west-Xe.west)*Ze,Nr.y=(Cs.south-Xe.south)*pt,Nr.z=(Cs.east-Xe.west)*Ze,Nr.w=(Cs.north-Xe.south)*pt,se.clone(Nr,mt.localizedCartographicLimitRectangle),Ne.x=(ot.west-Xe.west)*Ze,Ne.y=(ot.south-Xe.south)*pt,Ne.z=(ot.east-Xe.west)*Ze,Ne.w=(ot.north-Xe.south)*pt,se.clone(Ne,mt.localizedTranslucencyRectangle);let Ht=F&&O.fog(t._distance,n.fog.density)>O.EPSILON3;z=z&&(Ht||_);let Cn=!1,Mo=!1,Ao=!1,Za=!1,Qa=!1,Si=!1,_i=!1,ca=!1,Jr=!1,El=!1;for(;_e<s&&qe<it;){let la=ze[qe],Sl=la.readyImagery;if(++qe,!c(Sl)||Sl.imageryLayer.alpha===0)continue;let ec=la.useWebMercatorT?Sl.textureWebMercator:Sl.texture;if(!c(ec))throw new E("readyImagery is not actually ready!");let hs=Sl.imageryLayer;c(la.textureTranslationAndScale)||(la.textureTranslationAndScale=hs._calculateTextureTranslationAndScale(t,la)),mt.dayTextures[_e]=ec,mt.dayTextureTranslationAndScale[_e]=la.textureTranslationAndScale,mt.dayTextureTexCoordsRectangle[_e]=la.textureCoordinateRectangle,mt.dayTextureUseWebMercatorT[_e]=la.useWebMercatorT,mt.dayTextureAlpha[_e]=hs.alpha,Si=Si||mt.dayTextureAlpha[_e]!==1,mt.dayTextureNightAlpha[_e]=hs.nightAlpha,_i=_i||mt.dayTextureNightAlpha[_e]!==1,mt.dayTextureDayAlpha[_e]=hs.dayAlpha,_i=_i||mt.dayTextureDayAlpha[_e]!==1,mt.dayTextureBrightness[_e]=hs.brightness,Cn=Cn||mt.dayTextureBrightness[_e]!==Xa.DEFAULT_BRIGHTNESS,mt.dayTextureContrast[_e]=hs.contrast,Mo=Mo||mt.dayTextureContrast[_e]!==Xa.DEFAULT_CONTRAST,mt.dayTextureHue[_e]=hs.hue,Ao=Ao||mt.dayTextureHue[_e]!==Xa.DEFAULT_HUE,mt.dayTextureSaturation[_e]=hs.saturation,Za=Za||mt.dayTextureSaturation[_e]!==Xa.DEFAULT_SATURATION,mt.dayTextureOneOverGamma[_e]=1/hs.gamma,Qa=Qa||mt.dayTextureOneOverGamma[_e]!==1/Xa.DEFAULT_GAMMA,mt.dayTextureSplit[_e]=hs.splitDirection,ca=ca||mt.dayTextureSplit[_e]!==0;let mf=mt.dayTextureCutoutRectangles[_e];if(c(mf)||(mf=mt.dayTextureCutoutRectangles[_e]=new se),se.clone(se.ZERO,mf),c(hs.cutoutRectangle)){let Vo=IH(Xe,hs.cutoutRectangle),cn=ce.simpleIntersection(Vo,Xe,gbe);Jr=c(cn)||Jr,mf.x=(Vo.west-Xe.west)*Ze,mf.y=(Vo.south-Xe.south)*pt,mf.z=(Vo.east-Xe.west)*Ze,mf.w=(Vo.north-Xe.south)*pt}let pf=mt.colorsToAlpha[_e];c(pf)||(pf=mt.colorsToAlpha[_e]=new se);let _f=c(hs.colorToAlpha)&&hs.colorToAlphaThreshold>0;if(El=El||_f,_f){let Vo=hs.colorToAlpha;pf.x=Vo.red,pf.y=Vo.green,pf.z=Vo.blue,pf.w=hs.colorToAlphaThreshold}else pf.w=-1;if(c(Sl.credits)){let Vo=Sl.credits;for(let cn=0,Se=Vo.length;cn<Se;++cn)o.addCreditToNextFrame(Vo[cn])}++_e}mt.dayTextures.length=_e,mt.waterMask=a,se.clone(l,mt.waterMaskTranslationAndScale),mt.minMaxHeight.x=q.minimumHeight,mt.minMaxHeight.y=q.maximumHeight,B.clone(q.matrix,mt.scaleAndBias);let yo=e._clippingPlanes,Fr=c(yo)&&yo.enabled&&t.isClipped;Fr&&(mt.clippingPlanesEdgeColor=G.clone(yo.edgeColor,mt.clippingPlanesEdgeColor),mt.clippingPlanesEdgeWidth=yo.edgeWidth);let xp=e._clippingPolygons,es=c(xp)&&xp.enabled&&t.isClipped;Ee.numberOfDayTextures=_e,Ee.applyBrightness=Cn,Ee.applyContrast=Mo,Ee.applyHue=Ao,Ee.applySaturation=Za,Ee.applyGamma=Qa,Ee.applyAlpha=Si,Ee.applyDayNightAlpha=_i,Ee.applySplit=ca,Ee.enableFog=Ht,Ee.enableClippingPlanes=Fr,Ee.clippingPlanes=yo,Ee.enableClippingPolygons=es,Ee.clippingPolygons=xp,Ee.hasImageryLayerCutout=Jr,Ee.colorCorrect=z,Ee.highlightFillTile=aa,Ee.colorToAlpha=El,Ee.showUndergroundColor=x,Ee.translucent=h;let hf=i.renderedMesh.indices.length;Dt||(hf=i.renderedMesh.indexCountWithoutSkirts),Ce.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ee),Ce.castShadows=w,Ce.receiveShadows=D,Ce.renderState=zt,Ce.primitiveType=Me.TRIANGLES,Ce.vertexArray=i.vertexArray||i.fill.vertexArray,Ce.count=hf,Ce.uniformMap=pn,Ce.pass=De.GLOBE,e._debug.wireframe&&($ut(Ei,e,t),c(i.wireframeVertexArray)&&(Ce.vertexArray=i.wireframeVertexArray,Ce.primitiveType=Me.LINES,Ce.count=hf*2));let Ja=Ce.boundingVolume,tb=Ce.orientedBoundingBox;n.mode!==oe.SCENE3D?(le.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,Y.minimumHeight,Y.maximumHeight,Ja),d.fromElements(Ja.center.z,Ja.center.x,Ja.center.y,Ja.center),n.mode===oe.MORPHING&&(Ja=le.union(Y.boundingSphere,Ja,Ja))):(Ce.boundingVolume=le.clone(Y.boundingSphere,Ja),Ce.orientedBoundingBox=Dn.clone(Y.boundingVolume,tb)),Ce.dirty=!0,h&&f.updateDerivedCommands(Ce,n),_be(Ce,n),zt=un,Ct=Qut}while(qe<it)}var I2=ur;function Tbe(){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(Tbe.prototype,{enabled:{get:function(){return this._enabled},set:function(e){T.typeOf.bool("enabled",e),this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){T.typeOf.number.greaterThanOrEquals("frontFaceAlpha",e,0),T.typeOf.number.lessThanOrEquals("frontFaceAlpha",e,1),this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new E("far distance must be greater than near distance.");this._frontFaceAlphaByDistance=Bt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){T.typeOf.number.greaterThanOrEquals("backFaceAlpha",e,0),T.typeOf.number.lessThanOrEquals("backFaceAlpha",e,1),this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new E("far distance must be greater than near distance.");this._backFaceAlphaByDistance=Bt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){c(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var O2=Tbe;function ks(){this._layers=[],this.layerAdded=new pe,this.layerRemoved=new pe,this.layerMoved=new pe,this.layerShownOrHidden=new pe}Object.defineProperties(ks.prototype,{length:{get:function(){return this._layers.length}}});ks.prototype.add=function(e,t){let n=c(t);if(!c(e))throw new E("layer is required.");if(n){if(t<0)throw new E("index must be greater than or equal to zero.");if(t>this._layers.length)throw new E("index must be less than or equal to the number of layers.")}n?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()})};ks.prototype.addImageryProvider=function(e,t){if(!c(e))throw new E("imageryProvider is required.");let n=new Xa(e);return this.add(n,t),n};ks.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};ks.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=[]};ks.prototype.contains=function(e){return this.indexOf(e)!==-1};ks.prototype.indexOf=function(e){return this._layers.indexOf(e)};ks.prototype.get=function(e){if(!c(e))throw new E("index is required.","index");return this._layers[e]};function RH(e,t){if(!c(t))throw new E("layer is required.");let n=e.indexOf(t);if(n===-1)throw new E("layer is not in this collection.");return n}function Abe(e,t,n){let i=e._layers;if(t=O.clamp(t,0,i.length-1),n=O.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)}ks.prototype.raise=function(e){let t=RH(this._layers,e);Abe(this,t,t+1)};ks.prototype.lower=function(e){let t=RH(this._layers,e);Abe(this,t,t-1)};ks.prototype.raiseToTop=function(e){let t=RH(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))};ks.prototype.lowerToBottom=function(e){let t=RH(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 ift=new ce;function Cbe(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!c(r)&&a<o.length;++a){let l=o[a];ce.contains(l.rectangle,t)&&(r=l)}if(!c(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let l=s[a],u=l.readyImagery;if(!c(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!c(f.pickFeatures)||!ce.contains(u.rectangle,t))continue;let h=ift,p=1/1024;h.west=O.lerp(r.rectangle.west,r.rectangle.east,l.textureCoordinateRectangle.x-p),h.east=O.lerp(r.rectangle.west,r.rectangle.east,l.textureCoordinateRectangle.z+p),h.south=O.lerp(r.rectangle.south,r.rectangle.north,l.textureCoordinateRectangle.y-p),h.north=O.lerp(r.rectangle.south,r.rectangle.north,l.textureCoordinateRectangle.w+p),ce.contains(h,t)&&i(u)}}ks.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!c(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(Cbe(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};ks.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!c(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(Cbe(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let l=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);c(l)&&(o.push(l),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let l=0;l<s.length;++l){let u=s[l],f=r[l];if(c(u)&&u.length>0)for(let h=0;h<u.length;++h){let p=u[h];p.imageryLayer=f,c(p.position)||(p.position=i),a.push(p)}}return a})};ks.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};ks.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};ks.prototype.isDestroyed=function(){return!1};ks.prototype.destroy=function(){return this.removeAll(!0),de(this)};ks.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&&(c(i._show)&&(c(n)||(n=[]),n.push(i)),i._show=i.show);if(c(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var R2=ks;function Ebe(e){this._ellipsoid=new H_(e.ellipsoid,d.ZERO)}Object.defineProperties(Ebe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var M2=Ebe;var nK=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()}},oft=1e3;function na(e){if(!c(e))throw new E("options is required.");if(c(e.x))if(c(e.y)){if(e.x<0||e.y<0)throw new E("options.x and options.y must be greater than or equal to zero.")}else throw new E("options.y is required.");else throw new E("options.x is required.");if(!c(e.level))throw new E("options.level is required and must be greater than or equal to zero.");if(!c(e.tilingScheme))throw new E("options.tilingScheme is required.");this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Yn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new nK(oft),this.state=ta.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}na.createLevelZeroTiles=function(e){if(!c(e))throw new E("tilingScheme is required.");let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new na({tilingScheme:e,x:s,y:r,level:0});return i};var rft=256;function sft(e,t,n,i){let o=n.width/rft*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}na.prototype._getCacheKey=function(e,t){return sft(e.longitude,e.latitude,this._rectangle,t)};na.prototype.getPositionCacheEntry=function(e,t){return this._positionCache.get(this._getCacheKey(e,t))};na.prototype.setPositionCacheEntry=function(e,t,n){this._positionCache.set(this._getCacheKey(e,t),n)};na.prototype.clearPositionCache=function(){this._positionCache.size>0&&this._positionCache.clear()};na.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(c(t)&&c(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(c(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let l=a.customData;for(o=0;o<l.length;++o)r=l[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(na.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 c(this._southwestChild)||(this._southwestChild=new na({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return c(this._southeastChild)||(this._southeastChild=new na({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 c(this._northwestChild)||(this._northwestChild=new na({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return c(this._northeastChild)||(this._northeastChild=new na({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<ta.DONE}},eligibleForUnloading:{get:function(){let e=!0;return c(this.data)&&(e=this.data.eligibleForUnloading,c(e)||(e=!0)),e}}});na.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]};na.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};na.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};na.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};na.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};na.prototype.freeResources=function(){this.clearPositionCache(),this.state=ta.START,this.renderable=!1,this.upsampledFromParent=!1,c(this.data)&&c(this.data.freeResources)&&this.data.freeResources(),MH(this._southwestChild),this._southwestChild=void 0,MH(this._southeastChild),this._southeastChild=void 0,MH(this._northwestChild),this._northwestChild=void 0,MH(this._northeastChild),this._northeastChild=void 0};function MH(e){c(e)&&e.freeResources()}var L2=na;function LH(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}LH.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};LH.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&c(this._lastBeforeStartOfFrame)&&this.count>e&&c(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),Sbe(this,t)),t=i}};function Sbe(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}LH.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!c(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(c(e.replacementPrevious)||c(e.replacementNext))&&Sbe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var N2=LH;function _d(e){if(!c(e)||!c(e.tileProvider))throw new E("options.tileProvider is required.");if(c(e.tileProvider.quadtree))throw new E("A QuadtreeTileProvider can only be used with a single QuadtreePrimitive");this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new N2,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new M2({ellipsoid:n}),this._tileLoadProgressEvent=new pe,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(_d.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});_d.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function aft(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,vbe(e);let n=e._levelZeroTiles;if(c(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let l=r[a];l.level=0,e._addHeightCallbacks.push(l)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}_d.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;c(t);)t.state!==ta.START&&e(t),t=t.replacementNext};_d.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};_d.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};_d.prototype.update=function(e){c(this._tileProvider.update)&&this._tileProvider.update(e)};function vbe(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}_d.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(aft(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),vbe(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};_d.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),fft(this,e),Tft(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function cft(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=pe.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))}_d.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(gft(this,e),xft(this,e),cft(this,e))};_d.prototype.isDestroyed=function(){return!1};_d.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var B2,wbe=new he;function lft(e,t){let n=ce.center(e.rectangle,wbe),i=n.longitude-B2.longitude,o=n.latitude-B2.latitude;n=ce.center(t.rectangle,wbe);let r=n.longitude-B2.longitude,s=n.latitude-B2.latitude;return i*i+o*o-(r*r+s*s)}var uft=new d,F2=[];function fft(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!c(e._levelZeroTiles)){let y=r.tilingScheme;if(c(y)){let b=r.tilingScheme;e._levelZeroTiles=L2.createLevelZeroTiles(b);let x=e._levelZeroTiles.length;if(F2.length<x)for(F2=new Array(x),o=0;o<x;++o)F2[o]===void 0&&(F2[o]=new k2)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,l=a.length>1?e._occluders:void 0;B2=t.camera.positionCartographic,a.sort(lft);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,h=t.frameNumber,p;if(u.length>0||f.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(h,u,f);u.length=0,f.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let m=B.getTranslation(g.transform,uft);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(m,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Ka(e,s,r,t,l,!1,F2[o]):(_g(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=h}function _g(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function k2(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Dbe(){this.southwest=new k2,this.southeast=new k2,this.northwest=new k2,this.northeast=new k2}Dbe.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 oK=new Array(31);for(let e=0;e<oK.length;++e)oK[e]=new Dbe;function dft(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=pft(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,l=n.southeastChild,u=n.northwestChild,f=n.northeastChild,h=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===h?n._lastSelectionResult:Yn.NONE,g=e.tileProvider;if(s||i){let m=Yn.originalResult(p)===Yn.RENDERED,y=Yn.originalResult(p)===Yn.CULLED||p===Yn.NONE,b=n.state===ta.DONE,x=m||y||b;if(x||c(g.canRenderWithoutLosingDetail)&&(x=g.canRenderWithoutLosingDetail(n)),x){s&&_g(e,e._tileLoadQueueMedium,n,t),NH(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&_g(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&l.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){NH(e,n),_g(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(l),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.REFINED;let y=e._tilesToRender.length,b=e._tileLoadQueueLow.length,x=e._tileLoadQueueMedium.length,A=e._tileLoadQueueHigh.length,C=e._tileToUpdateHeights.length;if(hft(e,a,l,u,f,t,i,o),y!==e._tilesToRender.length){let S=o.allAreRenderable,v=o.anyWereRenderedLastFrame,P=o.notYetRenderableCount,M=!1;if(!S&&!v){let R=e._tilesToRender;for(let F=y;F<R.length;++F){let _=R[F];for(;_!==void 0&&_._lastSelectionResult!==Yn.KICKED&&_!==n;)_._lastSelectionResult=Yn.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=C,NH(e,n),n._lastSelectionResult=Yn.RENDERED;let L=p===Yn.RENDERED;!L&&P>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=b,e._tileLoadQueueMedium.length=x,e._tileLoadQueueHigh.length=A,_g(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,M=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=L,L||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!M&&_g(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,NH(e,n),_g(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function hft(e,t,n,i,o,r,s,a){let l=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,h=oK[t.level],p=h.southwest,g=h.southeast,m=h.northwest,y=h.northeast;l.longitude<t.rectangle.east?l.latitude<t.rectangle.north?(Ka(e,t,u,r,f,s,p),Ka(e,n,u,r,f,s,g),Ka(e,i,u,r,f,s,m),Ka(e,o,u,r,f,s,y)):(Ka(e,i,u,r,f,s,m),Ka(e,t,u,r,f,s,p),Ka(e,o,u,r,f,s,y),Ka(e,n,u,r,f,s,g)):l.latitude<t.rectangle.north?(Ka(e,n,u,r,f,s,g),Ka(e,t,u,r,f,s,p),Ka(e,o,u,r,f,s,y),Ka(e,i,u,r,f,s,m)):(Ka(e,o,u,r,f,s,y),Ka(e,i,u,r,f,s,m),Ka(e,n,u,r,f,s,g),Ka(e,t,u,r,f,s,p)),h.combine(a)}function mft(e,t){let n=t.rectangle;return c(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||c(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function Ka(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==xr.NONE)return dft(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,mft(e,t)){(!c(t.data)||!c(t.data.vertexArray))&&_g(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,l=t._lastSelectionResultFrame===a?t._lastSelectionResult:Yn.NONE;l!==Yn.CULLED_BUT_NEEDED&&l!==Yn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Yn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(_g(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Yn.CULLED):t._lastSelectionResult=Yn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function pft(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof on||t.camera.frustum instanceof jo)return _ft(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=O.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function _ft(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;c(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,l=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,l),h=u/f;return t.fog.enabled&&t.mode!==oe.SCENE2D&&(h-=O.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function NH(e,t){e._tilesToRender.push(t)}function gft(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=Ti()+e._loadQueueTimeSlice,s=e._tileProvider,a=iK(e,t,s,r,n,!1);a=iK(e,t,s,r,i,a),iK(e,t,s,r,o,a)}function yft(e,t){return e._loadPriority-t._loadPriority}function iK(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(yft);for(let s=0,a=o.length;s<a&&(Ti()<i||!r);++s){let l=o[s];e._tileReplacementQueue.markTileRendered(l),n.loadTile(t,l),r=!0}return r}var xw=new mn,FH=new he,P0=new d,bft=[];function xft(e,t){if(!c(e.tileProvider.tilingScheme))return;let n=bft;n.length=0;let i=e._tileToUpdateHeights,o=Ti(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,l=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let h=i[0];if(!c(h.data)||!c(h.data.mesh)){let y=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:Yn.NONE;(y===Yn.RENDERED||y===Yn.CULLED_BUT_NEEDED)&&n.push(h),h.clearPositionCache(),i.shift(),e._lastTileIndex=0;continue}let p=h.customData,g=p.length,m=!1;for(f=e._lastTileIndex;f<g;++f){let y=p[f],b=h.data.terrainData,x=c(b)&&b.wasCreatedByUpsampling();if(h.level>y.level&&!x){let A,C=h.getPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError);if(c(C))A=C;else{if(c(y.positionOnEllipsoidSurface)||(y.positionOnEllipsoidSurface=d.fromRadians(y.positionCartographic.longitude,y.positionCartographic.latitude,0,u)),a===oe.SCENE3D){let S=u.geodeticSurfaceNormal(y.positionOnEllipsoidSurface,xw.direction),v=u.getSurfaceNormalIntersectionWithZAxis(y.positionOnEllipsoidSurface,11500,xw.origin);if(!c(v)){let P=0;c(h.data.tileBoundingRegion)&&(P=h.data.tileBoundingRegion.minimumHeight);let M=Math.min(P,-11500),R=d.multiplyByScalar(S,Math.abs(M)+1,P0);d.subtract(y.positionOnEllipsoidSurface,R,xw.origin)}}else he.clone(y.positionCartographic,FH),FH.height=-11500,l.project(FH,P0),d.fromElements(P0.z,P0.x,P0.y,P0),d.clone(P0,xw.origin),d.clone(d.UNIT_X,xw.direction);A=h.data.pick(xw,a,l,!1,P0),c(A)&&h.setPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError,A)}if(c(A)){if(c(y.callback)){let S=u.cartesianToCartographic(A,FH);y.callback(S)}y.level=h.level}}if(Ti()>=s){m=!0;break}}if(m){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function Tft(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var U2=_d;function Hh(e){e=e??ie.default;let t=new np({ellipsoid:e}),n=new R2;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new _2,this._material=void 0,this._surface=new U2({tileProvider:new I2({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new pe,this._undergroundColor=G.clone(G.BLACK),this._undergroundColorAlphaByDistance=new Bt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new O2,sK(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new we({url:tn("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=ie.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=O.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=O.PI*e.minimumRadius,this.nightFadeOutDistance=O.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*O.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=xn.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(Hh.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 c(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){c(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),c(this._material)&&sK(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,sK(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=G.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new E("far distance must be greater than near distance.");this._undergroundColorAlphaByDistance=Bt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function sK(e){let t=[],n=c(e._material)&&(c(e._material.shaderSource.match(/slope/))||c(e._material.shaderSource.match("normalEC"))),i=[nh,nw];c(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(i2),e._surfaceShaderSet.baseVertexShaderSource=new He({sources:[nh,nw,o2],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new He({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function Aft(e){return function(t,n){let i=le.distanceSquaredTo(t.pickBoundingSphere,e),o=le.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var Cft=[],Eft={start:0,stop:0};Hh.prototype.pickWorldCoordinates=function(e,t,n,i){if(!c(e))throw new E("ray is required");if(!c(t))throw new E("scene is required");n=n??!0;let o=t.mode,r=t.mapProjection,s=Cft;s.length=0;let a=this._surface._tilesToRender,l=a.length,u,f;for(f=0;f<l;++f){u=a[f];let p=u.data;if(!c(p))continue;let g=p.pickBoundingSphere;if(o!==oe.SCENE3D)p.pickBoundingSphere=g=le.fromRectangleWithHeights2D(u.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),d.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(c(p.renderedMesh))le.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let m=Zn.raySphere(e,g,Eft);c(m)&&s.push(p)}s.sort(Aft(e.origin));let h;for(l=s.length,f=0;f<l&&(h=s[f].pick(e,t.mode,t.mapProjection,n,i),!c(h));++f);return h};var Sft=new he;Hh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),c(n)&&t.mode!==oe.SCENE3D){n=d.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,Sft);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var wft=new d,Pbe=new d,vft=new he,Dft=new mn;function rK(e,t){return c(e)&&ce.contains(e.rectangle,t)?e:void 0}Hh.prototype.getHeight=function(e){if(!c(e))throw new E("cartographic is required");let t=this._surface._levelZeroTiles;if(!c(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(;c(n);)n=rK(n._southwestChild,e)||rK(n._southeastChild,e)||rK(n._northwestChild,e)||n._northeastChild,c(n)&&c(n.data)&&c(n.data.renderedMesh)&&(r=n);if(n=r,!c(n)||!c(n.data)||!c(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,l=d.fromRadians(e.longitude,e.latitude,0,a,wft),u=Dft,f=a.geodeticSurfaceNormal(l,u.direction),h=a.getSurfaceNormalIntersectionWithZAxis(l,11500,u.origin);if(!c(h)){let g;c(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(g??0,-11500),y=d.multiplyByScalar(f,Math.abs(m)+1,Pbe);d.subtract(l,y,u.origin)}let p=n.data.pick(u,void 0,s,!1,Pbe);if(c(p))return a.cartesianToCartographic(p,vft).height};Hh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Hh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=c(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,l=a.url;if(c(l)){let u=this;a.fetchImage().then(function(f){l===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Rt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===oe.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};Hh.prototype.render=function(e){this.show&&(c(this._material)&&this._material.update(e.context),this._surface.render(e))};Hh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Hh.prototype.isDestroyed=function(){return!1};Hh.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(),de(this)};var V2=Hh;function Pft(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var z2=Pft;var Gbe={},Ift=32.184,Oft=2451545,Ibe=-.0529921,Obe=-.1059842,Rbe=13.0120009,Mbe=13.3407154,Lbe=.9856003,Nbe=26.4057084,Fbe=13.064993,Bbe=.3287146,kbe=1.7484877,Ube=-.1589763,Vbe=.0036096,zbe=.1643573,Hbe=12.9590088,aK=new Q;Gbe.ComputeMoon=function(e,t){c(e)||(e=Q.now()),aK=Q.addSeconds(e,Ift,aK);let n=Q.totalDays(aK)-Oft,i=n/qn.DAYS_PER_JULIAN_CENTURY,o=(125.045+Ibe*n)*O.RADIANS_PER_DEGREE,r=(250.089+Obe*n)*O.RADIANS_PER_DEGREE,s=(260.008+Rbe*n)*O.RADIANS_PER_DEGREE,a=(176.625+Mbe*n)*O.RADIANS_PER_DEGREE,l=(357.529+Lbe*n)*O.RADIANS_PER_DEGREE,u=(311.589+Nbe*n)*O.RADIANS_PER_DEGREE,f=(134.963+Fbe*n)*O.RADIANS_PER_DEGREE,h=(276.617+Bbe*n)*O.RADIANS_PER_DEGREE,p=(34.226+kbe*n)*O.RADIANS_PER_DEGREE,g=(15.134+Ube*n)*O.RADIANS_PER_DEGREE,m=(119.743+Vbe*n)*O.RADIANS_PER_DEGREE,y=(239.961+zbe*n)*O.RADIANS_PER_DEGREE,b=(25.053+Hbe*n)*O.RADIANS_PER_DEGREE,x=Math.sin(o),A=Math.sin(r),C=Math.sin(s),S=Math.sin(a),v=Math.sin(l),P=Math.sin(u),M=Math.sin(f),R=Math.sin(h),L=Math.sin(p),F=Math.sin(g),_=Math.sin(m),w=Math.sin(y),D=Math.sin(b),I=Math.cos(o),N=Math.cos(r),k=Math.cos(s),z=Math.cos(a),V=Math.cos(l),j=Math.cos(u),U=Math.cos(f),q=Math.cos(h),Y=Math.cos(p),te=Math.cos(g),K=Math.cos(m),Z=Math.cos(y),ee=Math.cos(b),me=(269.9949+.0031*i-3.8787*x-.1204*A+.07*C-.0172*S+.0072*P-.0052*F+.0043*D)*O.RADIANS_PER_DEGREE,Te=(66.5392+.013*i+1.5419*I+.0239*N-.0278*k+.0068*z-.0029*j+9e-4*U+8e-4*te-9e-4*ee)*O.RADIANS_PER_DEGREE,ue=(38.3213+13.17635815*n-14e-13*n*n+3.561*x+.1208*A-.0642*C+.0158*S+.0252*v-.0066*P-.0047*M-.0046*R+.0028*L+.0052*F+.004*_+.0019*w-.0044*D)*O.RADIANS_PER_DEGREE,ye=(13.17635815-14e-13*(2*n)+3.561*I*Ibe+.1208*N*Obe-.0642*k*Rbe+.0158*z*Mbe+.0252*V*Lbe-.0066*j*Nbe-.0047*U*Fbe-.0046*q*Bbe+.0028*Y*kbe+.0052*te*Ube+.004*K*Vbe+.0019*Z*zbe-.0044*ee*Hbe)/86400*O.RADIANS_PER_DEGREE;return c(t)||(t=new z2),t.rightAscension=me,t.declination=Te,t.rotation=ue,t.rotationRate=ye,t};var H2=Gbe;function jbe(e){(!c(e)||typeof e!="function")&&(e=H2.ComputeMoon),this._computeFunction=e}var Rft=new d,Mft=new d,Lft=new d;function Nft(e,t,n){let i=Rft;i.x=Math.cos(e+O.PI_OVER_TWO),i.y=Math.sin(e+O.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=Lft;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=d.cross(r,i,Mft);return c(n)||(n=new J),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var Fft=new J,Bft=new Le;jbe.prototype.evaluate=function(e,t){c(e)||(e=Q.now());let n=this._computeFunction(e),i=Nft(n.rightAscension,n.declination,t),o=O.zeroToTwoPi(n.rotation),r=Le.fromAxisAngle(d.UNIT_Z,o,Bft),s=J.fromQuaternion(Le.conjugate(r,r),Fft);return J.multiply(s,i,i)};var G2=jbe;var cK={position:0};function BH(e){e=e??W.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=B.clone(e.modelMatrix??B.IDENTITY),this._modelMatrix=new B,this._computedModelMatrix=new B,this.show=e.show??!0,this.material=e.material??Xi.fromType(Xi.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 Qe({owner:e._owner??this}),this._pickCommand=new Qe({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 kft(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(c(t))return t;let n=La.createGeometry(La.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY}));return t=ti.fromGeometry({context:e,geometry:n,attributeLocations:cK,bufferUsage:Be.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}BH.prototype.update=function(e){if(!this.show||e.mode!==oe.SCENE3D||!c(this.center)||!c(this.radii))return;if(!c(this.material))throw new E("this.material must be defined.");let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!c(this._rs)||i)&&(this._translucent=n,this._rs=Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?ln.ALPHA_BLEND:void 0})),c(this._va)||(this._va=kft(t));let o=!1,r=this.radii;if(!d.equals(this._radii,r)){d.clone(r,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(r.x*r.x),y.y=1/(r.y*r.y),y.z=1/(r.z*r.z),o=!0}(!B.equals(this.modelMatrix,this._modelMatrix)||!d.equals(this.center,this._center))&&(B.clone(this.modelMatrix,this._modelMatrix),d.clone(this.center,this._center),B.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 s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let l=e.useLogDepth,u=this._useLogDepth!==l;this._useLogDepth=l;let f=this._colorCommand,h,p;(s||a||i||u)&&(h=new He({sources:[tw]}),p=new He({sources:[this.material.shaderSource,ew]}),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=Jt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:cK}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=xt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?De.TRANSLUCENT:De.OPAQUE,g.push(f)),m.pick){let y=this._pickCommand;(!c(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!c(this._pickSP)||u)&&(h=new He({sources:[tw]}),p=new He({sources:[this.material.shaderSource,ew],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=Jt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:cK}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=xt(xt(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?De.TRANSLUCENT:De.OPAQUE,g.push(y)}};BH.prototype.isDestroyed=function(){return!1};BH.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(),de(this)};var j2=BH;function W2(e){e=e??W.EMPTY_OBJECT;let t=e.textureUrl;c(t)||(t=tn("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ie.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new j2({radii:this.ellipsoid.radii,material:Xi.fromType(Xi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new G2}Object.defineProperties(W2.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var kH=new J,Uft=new J,Vft=new d,UH=[];W2.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;c(Ot.computeIcrfToFixedMatrix(n,kH))||Ot.computeTemeToPseudoFixedMatrix(n,kH);let i=this._axes.evaluate(n,Uft);J.transpose(i,i),J.multiply(kH,i,i);let o=Xg.computeMoonPositionInEarthInertialFrame(n,Vft);J.multiplyByVector(kH,o,o),B.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=UH,UH.length=0,t.update(e),e.commandList=r,UH.length===1?UH[0]:void 0};W2.prototype.isDestroyed=function(){return!1};W2.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),de(this)};var q2=W2;var lK=[],uK=[];function zft(e,t,n,i,o,r){let s=o-i+1,a=r-o,l=lK,u=uK,f,h;for(f=0;f<s;++f)l[f]=e[i+f];for(h=0;h<a;++h)u[h]=e[o+h+1];f=0,h=0;for(let p=i;p<=r;++p){let g=l[f],m=u[h];f<s&&(h>=a||t(g,m,n)<=0)?(e[p]=g,++f):h<a&&(e[p]=m,++h)}}function fK(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);fK(e,t,n,i,r),fK(e,t,n,r+1,o),zft(e,t,n,i,r,o)}function Hft(e,t,n){if(!c(e))throw new E("array is required.");if(!c(t))throw new E("comparator is required.");let i=e.length,o=Math.ceil(i*.5);lK.length=o,uK.length=o,fK(e,t,n,0,i-1),lK.length=0,uK.length=0}var gg=Hft;function Rc(e,t){if(!c(e))throw new E("occluderBoundingSphere is required.");if(!c(t))throw new E("camera position is required.");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 VH=new d;Object.defineProperties(Rc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){if(!c(e))throw new E("cameraPosition is required.");e=d.clone(e,this._cameraPosition);let t=d.subtract(this._occluderPosition,e,VH),n=d.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=d.multiplyByScalar(t,n,VH);let a=o*o*n;s=d.add(e,d.multiplyByScalar(r,a,VH),VH)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Rc.fromBoundingSphere=function(e,t,n){if(!c(e))throw new E("occluderBoundingSphere is required.");if(!c(t))throw new E("camera position is required.");return c(n)?(d.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Rc(e,t)};var qbe=new d;Rc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=d.subtract(e,this._occluderPosition,qbe),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 Gft=new d;Rc.prototype.isBoundingSphereVisible=function(e){let t=d.clone(e.center,Gft),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,qbe),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),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var jft=new d;Rc.prototype.computeVisibility=function(e){if(!c(e))throw new E("occludeeBS is required.");let t=d.clone(e.center),n=e.radius;if(n>this._occluderRadius)return xr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,jft),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 s=d.magnitudeSquared(i);return o*o+n*n<s?xr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?xr.FULL:xr.PARTIAL):(i=d.subtract(t,this._horizonPlanePosition,i),d.dot(i,this._horizonPlaneNormal)>-n?xr.PARTIAL:xr.FULL))}}return xr.NONE};var zH=new d;Rc.computeOccludeePoint=function(e,t,n){if(!c(e))throw new E("occluderBoundingSphere is required.");if(!c(n))throw new E("positions is required.");if(n.length===0)throw new E("positions must contain at least one element");let i=d.clone(t),o=d.clone(e.center),r=e.radius,s=n.length;if(d.equals(o,t))throw new E("occludeePosition must be different than occluderBoundingSphere.center");let a=d.normalize(d.subtract(i,o,zH),zH),l=-d.dot(a,o),u=Rc._anyRotationVector(o,a,l),f=Rc._horizonToPlaneNormalDotProduct(e,a,l,u,n[0]);if(!f)return;let h;for(let g=1;g<s;++g){if(h=Rc._horizonToPlaneNormalDotProduct(e,a,l,u,n[g]),!h)return;h<f&&(f=h)}if(f<.0017453283658983088)return;let p=r/f;return d.add(o,d.multiplyByScalar(a,p,zH),zH)};var Wft=[];Rc.computeOccludeePointFromRectangle=function(e,t){if(!c(e))throw new E("rectangle is required.");t=t??ie.default;let n=ce.subsample(e,t,0,Wft),i=le.fromPoints(n),o=d.ZERO;if(!d.equals(o,i.center))return Rc.computeOccludeePoint(new le(o,t.minimumRadius),i.center,n)};var qft=new d;Rc._anyRotationVector=function(e,t,n){let i=d.abs(t,qft),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,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=d.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=d.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=d.UNIT_Z);let a=(d.dot(t,i)+n)/-d.dot(t,s);return d.normalize(d.subtract(d.add(i,d.multiplyByScalar(s,a,r),i),e,i),i)};var Yft=new d;Rc._rotationVector=function(e,t,n,i,o){let r=d.subtract(i,e,Yft);if(r=d.normalize(r,r),d.dot(t,r)<.9999999847691291){let s=d.cross(t,r,r);if(d.magnitude(s)>O.EPSILON13)return d.normalize(s,new d)}return o};var dK=new d,Xft=new d,HH=new d,Wbe=new d;Rc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=d.clone(o,dK),s=d.clone(e.center,Xft),a=e.radius,l=d.subtract(s,r,HH),u=d.magnitudeSquared(l),f=a*a;if(u<f)return!1;let h=u-f,p=Math.sqrt(h),m=1/Math.sqrt(u),b=p*m*p;l=d.normalize(l,l);let x=d.add(r,d.multiplyByScalar(l,b,Wbe),Wbe),A=Math.sqrt(h-b*b),C=this._rotationVector(s,t,n,r,i),S=d.fromElements(C.x*C.x*l.x+(C.x*C.y-C.z)*l.y+(C.x*C.z+C.y)*l.z,(C.x*C.y+C.z)*l.x+C.y*C.y*l.y+(C.y*C.z-C.x)*l.z,(C.x*C.z-C.y)*l.x+(C.y*C.z+C.x)*l.y+C.z*C.z*l.z,dK);S=d.normalize(S,S);let v=d.multiplyByScalar(S,A,dK);C=d.normalize(d.subtract(d.add(x,v,HH),s,HH),HH);let P=d.dot(t,C);C=d.normalize(d.subtract(d.subtract(x,v,C),s,C),C);let M=d.dot(t,C);return P<M?P:M};var Y2=Rc;function rp(e){e=e??W.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 _s,this._perspectiveMatrix=new B,this._infinitePerspective=new B}function hK(e){if(!c(e.right)||!c(e.left)||!c(e.top)||!c(e.bottom)||!c(e.near)||!c(e.far))throw new E("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;if(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far){if(e.near<=0||e.near>e.far)throw new E("near must be greater than zero and less than far.");e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=B.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=B.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective)}}Object.defineProperties(rp.prototype,{projectionMatrix:{get:function(){return hK(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return hK(this),this._infinitePerspective}}});var Kft=new d,$ft=new d,Zft=new d,Qft=new d;rp.prototype.computeCullingVolume=function(e,t,n){if(!c(e))throw new E("position is required.");if(!c(t))throw new E("direction is required.");if(!c(n))throw new E("up is required.");let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,l=this.near,u=this.far,f=d.cross(t,n,Kft),h=$ft;d.multiplyByScalar(t,l,h),d.add(e,h,h);let p=Zft;d.multiplyByScalar(t,u,p),d.add(e,p,p);let g=Qft;d.multiplyByScalar(f,a,g),d.add(h,g,g),d.subtract(g,e,g),d.normalize(g,g),d.cross(g,n,g),d.normalize(g,g);let m=i[0];return c(m)||(m=i[0]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),d.multiplyByScalar(f,s,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(n,g,g),d.normalize(g,g),m=i[1],c(m)||(m=i[1]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),d.multiplyByScalar(n,r,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(f,g,g),d.normalize(g,g),m=i[2],c(m)||(m=i[2]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),d.multiplyByScalar(n,o,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(g,f,g),d.normalize(g,g),m=i[3],c(m)||(m=i[3]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),m=i[4],c(m)||(m=i[4]=new se),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-d.dot(t,h),d.negate(t,g),m=i[5],c(m)||(m=i[5]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,p),this._cullingVolume};rp.prototype.getPixelDimensions=function(e,t,n,i,o){if(hK(this),!c(e)||!c(t))throw new E("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new E("drawingBufferWidth must be greater than zero.");if(t<=0)throw new E("drawingBufferHeight must be greater than zero.");if(!c(n))throw new E("distance is required.");if(!c(i))throw new E("pixelRatio is required");if(i<=0)throw new E("pixelRatio must be greater than zero.");if(!c(o))throw new E("A result object is required.");let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let l=2*i*n*s/e;return o.x=l,o.y=a,o};rp.prototype.clone=function(e){return c(e)||(e=new rp),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};rp.prototype.equals=function(e){return c(e)&&e instanceof rp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};rp.prototype.equalsEpsilon=function(e,t,n){return e===this||c(e)&&e instanceof rp&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var bl=rp;function ou(e){e=e??W.EMPTY_OBJECT,this._offCenterFrustum=new bl,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}ou.packedLength=6;ou.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),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};ou.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new ou),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 Gh(e){if(!c(e.fov)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new E("fov, aspectRatio, near, or far parameters are not set.");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;if(T.typeOf.number.greaterThanOrEquals("fov",e.fov,0),T.typeOf.number.lessThan("fov",e.fov,Math.PI),T.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),T.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new E("near must be less than far.");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(ou.prototype,{projectionMatrix:{get:function(){return Gh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Gh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Gh(this),this._fovy}},sseDenominator:{get:function(){return Gh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Gh(this),this._offCenterFrustum}}});ou.prototype.computeCullingVolume=function(e,t,n){return Gh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};ou.prototype.getPixelDimensions=function(e,t,n,i,o){return Gh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};ou.prototype.clone=function(e){return c(e)||(e=new ou),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};ou.prototype.equals=function(e){return!c(e)||!(e instanceof ou)?!1:(Gh(this),Gh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};ou.prototype.equalsEpsilon=function(e,t,n){return!c(e)||!(e instanceof ou)?!1:(Gh(this),Gh(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Ci=ou;function X2(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(X2.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Jft(e,t,n){let i=t.createViewportQuadCommand(YF,{framebuffer:n,renderState:Ve.fromCache({viewport:new Ke(0,0,256,256)})});e._drawCommand=i}X2.prototype.update=function(e){if(!c(this._colorTexture)){let t=e.context,n=new Rt({context:t,width:256,height:256,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Qt.NEAREST});this._colorTexture=n;let i=new Ur({context:t,colorTextures:[n],destroyAttachments:!1});Jft(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};X2.prototype.isDestroyed=function(){return!1};X2.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),de(this)};var K2=X2;var $be={};function edt(e,t,n){let i,o,r;if(e instanceof Ci){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof bl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var tdt=new d,Ybe=new d;function Zbe(e,t,n,i){if(c(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,l=s-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/a;return O.lerp(e,-O.PI_OVER_TWO,p)}let h=(f-r)/l;return O.lerp(-O.PI_OVER_TWO,t,1-h)}}return function(o){return O.lerp(e,t,o)}}function pK(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!c(r)){let a=e.position,l=t,u=e.up,f=e.right,h=e.frustum,p=d.subtract(a,l,tdt),g=d.magnitude(d.multiplyByScalar(u,d.dot(p,u),Ybe)),m=d.magnitude(d.multiplyByScalar(f,d.dot(p,f),Ybe));r=Math.min(edt(h,g,m)*.2,1e9)}if(s<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(a){return O.lerp(n,i,a)}}function $2(e,t){return O.equalsEpsilon(e,O.TWO_PI,O.EPSILON11)&&(e=0),t>e+Math.PI?e+=O.TWO_PI:t<e-Math.PI&&(e-=O.TWO_PI),e}var Qbe=new d;function ndt(e,t,n,i,o,r,s,a){let l=e.camera,u=d.clone(l.position,Qbe),f=l.pitch,h=$2(l.heading,i),p=$2(l.roll,r),g=pK(l,n,u.z,n.z,s),m=Zbe(f,o,g,a);function y(b){let x=b.time/t;l.setView({orientation:{heading:O.lerp(h,i,x),pitch:m(x),roll:O.lerp(p,r,x)}}),H.lerp(u,n,x,l.position),l.position.z=g(x)}return y}function idt(e,t){e.longitude<t.longitude?e.longitude+=O.TWO_PI:t.longitude+=O.TWO_PI}function odt(e,t){let n=e.longitude-t.longitude;n<-O.PI?e.longitude+=O.TWO_PI:n>O.PI&&(t.longitude+=O.TWO_PI)}var rdt=new he,sdt=new he;function adt(e,t,n,i,o,r,s,a,l,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,rdt),m=f.pitch,y=$2(f.heading,i),b=$2(f.roll,r),x=p.cartesianToCartographic(n,sdt);g.longitude=O.zeroToTwoPi(g.longitude),x.longitude=O.zeroToTwoPi(x.longitude);let A=!1;if(c(a)){let P=O.zeroToTwoPi(a),M=Math.min(g.longitude,x.longitude),R=Math.max(g.longitude,x.longitude),L=P>=M&&P<=R;if(c(l)){let F=Math.abs(g.longitude-x.longitude),_=O.TWO_PI-F;(L?F:_)<(L?_:F)*l&&!L&&(A=!0)}else L||(A=!0)}A?idt(g,x):odt(g,x);let C=pK(f,n,g.height,x.height,s),S=Zbe(m,o,C,u);function v(){let P=g.longitude,M=x.longitude,R=g.latitude,L=x.latitude;return function(_){let w=_.time/t,D=d.fromRadians(O.lerp(P,M,w),O.lerp(R,L,w),C(w),p);f.setView({destination:D,orientation:{heading:O.lerp(y,i,w),pitch:S(w),roll:O.lerp(b,r,w)}})}}return v()}function cdt(e,t,n,i,o,r,s){let a=e.camera,l=d.clone(a.position,Qbe),u=$2(a.heading,i),f=a.frustum.right-a.frustum.left,h=pK(a,n,f,n.z,s);function p(g){let m=g.time/t;a.setView({orientation:{heading:O.lerp(u,i,m)}}),H.lerp(l,n,m,a.position);let y=h(m),b=a.frustum,x=b.top/b.right,A=(y-(b.right-b.left))*.5;b.right+=A,b.left-=A,b.top=x*b.right,b.bottom=-b.top}return p}var Xbe=new he,ldt=new d;function mK(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function Kbe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}$be.createTween=function(e,t){t=t??W.EMPTY_OBJECT;let n=t.destination;if(!c(e))throw new E("scene is required.");if(!c(n))throw new E("destination is required.");let i=e.mode;if(i===oe.MORPHING)return mK();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,l=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==oe.SCENE3D&&(s.cartesianToCartographic(n,Xbe),n=r.project(Xbe,ldt));let p=e.camera,g=t.endTransform;c(g)&&p._setTransform(g);let m=t.duration;c(m)||(m=Math.ceil(d.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let y=t.heading??0,b=t.pitch??-O.PI_OVER_TWO,x=t.roll??0,A=e.screenSpaceCameraController;A.enableInputs=!1;let C=Kbe(A,t.complete),S=Kbe(A,t.cancel),v=p.frustum,P=e.mode===oe.SCENE2D;if(P=P&&H.equalsEpsilon(p.position,n,O.EPSILON6),P=P&&O.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,O.EPSILON6),P=P||e.mode!==oe.SCENE2D&&d.equalsEpsilon(n,p.position,O.EPSILON10),P=P&&O.equalsEpsilon(O.negativePiToPi(y),O.negativePiToPi(p.heading),O.EPSILON10)&&O.equalsEpsilon(O.negativePiToPi(b),O.negativePiToPi(p.pitch),O.EPSILON10)&&O.equalsEpsilon(O.negativePiToPi(x),O.negativePiToPi(p.roll),O.EPSILON10),P)return mK(C,S);let M=new Array(4);if(M[oe.SCENE2D]=cdt,M[oe.SCENE3D]=adt,M[oe.COLUMBUS_VIEW]=ndt,m<=0)return mK(function(){M[i](e,1,n,y,b,x,a,l,u,f)({time:1}),typeof C=="function"&&C()},S);let R=M[i](e,m,n,y,b,x,a,l,u,f);if(!c(h)){let L=p.positionCartographic.height,F=i===oe.SCENE3D?s.cartesianToCartographic(n).height:n.z;L>F&&L>11500?h=Qr.CUBIC_OUT:h=Qr.QUINTIC_IN_OUT}return{duration:m,easingFunction:h,startObject:{time:0},stopObject:{time:m},update:R,complete:C,cancel:S}};var Z2=$be;var udt={ROTATE:0,INFINITE_SCROLL:1},ru=Object.freeze(udt);function en(e){if(!c(e))throw new E("scene is required.");this._scene=e,this._transform=B.clone(B.IDENTITY),this._invTransform=B.clone(B.IDENTITY),this._actualTransform=B.clone(B.IDENTITY),this._actualInvTransform=B.clone(B.IDENTITY),this._transformChanged=!1,this.position=new d,this._position=new d,this._positionWC=new d,this._positionCartographic=new he,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 Ci,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=O.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 pe,this._moveEnd=new pe,this._changed=new pe,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 B,this._invViewMatrix=new B,sxe(this),this._mode=oe.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,O.PI_OVER_TWO)),this._max2Dfrustum=void 0,yxe(this,en.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=d.magnitude(this.position);n+=n*en.DEFAULT_VIEW_FACTOR,d.normalize(this.position,this.position),d.multiplyByScalar(this.position,n,this.position)}en.TRANSFORM_2D=new B(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);en.TRANSFORM_2D_INVERSE=B.inverseTransformation(en.TRANSFORM_2D,new B);en.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);en.DEFAULT_VIEW_FACTOR=.5;en.DEFAULT_OFFSET=new cd(0,-O.PI_OVER_FOUR,0);function sxe(e){B.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),B.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),B.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function fdt(e){if(!c(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=Ti()):e.timeSinceMoved=Math.max(Ti()-e._lastMovedTimestamp,0)/1e3}}en.prototype.canPreloadFlight=function(){return c(this._currentFlight)&&this._mode!==oe.SCENE2D};en.prototype._updateCameraChanged=function(){let e=this;if(fdt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;c(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%O.TWO_PI;i=i>O.PI?O.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;c(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%O.TWO_PI;s=s>O.PI?O.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===oe.SCENE2D){if(!c(e._changedFrustum)){e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,m=e.frustum,y=e._changedFrustum,b=p.x+m.left,x=p.x+m.right,A=g.x+y.left,C=g.x+y.right,S=p.y+m.bottom,v=p.y+m.top,P=g.y+y.bottom,M=g.y+y.top,R=Math.max(b,A),L=Math.min(x,C),F=Math.max(S,P),_=Math.min(v,M),w;if(R>=L||F>=v)w=1;else{let D=y;b<A&&x>C&&S<P&&v>M&&(D=m),w=1-(L-R)*(_-F)/((D.right-D.left)*(D.top-D.bottom))}w>t&&(e._changed.raiseEvent(w),e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!c(e._changedDirection)){e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection);return}let l=O.acosClamped(d.dot(e.directionWC,e._changedDirection)),u;c(e.frustum.fovy)?u=l/(e.frustum.fovy*.5):u=l;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 ddt(e){Ot.basisTo2D(e._projection,e._transform,e._actualTransform)}var hdt=new he,mdt=new d,GH=new d,pdt=new se,_dt=new se,gdt=new se,ydt=new se,bdt=new se;function xdt(e){let t=e._projection,n=t.ellipsoid,i=B.getColumn(e._transform,3,pdt),o=n.cartesianToCartographic(i,hdt),r=t.project(o,mdt),s=_dt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=se.clone(se.UNIT_X,bdt),l=se.add(B.getColumn(e._transform,0,GH),i,GH);n.cartesianToCartographic(l,o),t.project(o,r);let u=gdt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,d.subtract(u,s,u),u.x=0;let f=ydt;if(d.magnitudeSquared(u)>O.EPSILON10)d.cross(a,u,f);else{let h=se.add(B.getColumn(e._transform,1,GH),i,GH);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,s,f),f.x=0,d.magnitudeSquared(f)<O.EPSILON10&&(se.clone(se.UNIT_Y,u),se.clone(se.UNIT_Z,f))}d.cross(f,a,u),d.normalize(u,u),d.cross(a,u,f),d.normalize(f,f),B.setColumn(e._actualTransform,0,u,e._actualTransform),B.setColumn(e._actualTransform,1,f,e._actualTransform),B.setColumn(e._actualTransform,2,a,e._actualTransform),B.setColumn(e._actualTransform,3,s,e._actualTransform)}var _K=new d;function Lc(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 s=e._direction,a=!d.equals(s,e.direction);a&&(d.normalize(e.direction,e.direction),s=d.clone(e.direction,e._direction));let l=e._up,u=!d.equals(l,e.up);u&&(d.normalize(e.up,e.up),l=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&&(B.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?B.equals(B.IDENTITY,e._transform)?B.clone(en.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?ddt(e):xdt(e):B.clone(e._transform,e._actualTransform),B.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=B.multiplyByPoint(g,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=_K;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(a||u||h){let m=d.dot(s,d.cross(l,f,_K));if(Math.abs(1-m)>O.EPSILON2){let y=1/d.magnitudeSquared(l),b=d.dot(l,s)*y,x=d.multiplyByScalar(s,b,_K);l=d.normalize(d.subtract(l,x,e._up),e._up),d.clone(l,e.up),f=d.cross(s,l,e._right),d.clone(f,e.right)}}(a||p)&&(e._directionWC=B.multiplyByPointAsVector(g,s,e._directionWC),d.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=B.multiplyByPointAsVector(g,l,e._upWC),d.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=B.multiplyByPointAsVector(g,f,e._rightWC),d.normalize(e._rightWC,e._rightWC)),(r||a||u||h||p)&&sxe(e)}function axe(e,t){let n;return O.equalsEpsilon(Math.abs(e.z),1,O.EPSILON3)?n=Math.atan2(t.y,t.x)-O.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-O.PI_OVER_TWO,O.TWO_PI-O.zeroToTwoPi(n)}function cxe(e){return O.PI_OVER_TWO-O.acosClamped(e.z)}function lxe(e,t,n){let i=0;return O.equalsEpsilon(Math.abs(e.z),1,O.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=O.zeroToTwoPi(i+O.TWO_PI)),i}var qH=new B,YH=new B;Object.defineProperties(en.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Lc(this),this._invTransform}},viewMatrix:{get:function(){return Lc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Lc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Lc(this),this._positionCartographic}},positionWC:{get:function(){return Lc(this),this._positionWC}},directionWC:{get:function(){return Lc(this),this._directionWC}},upWC:{get:function(){return Lc(this),this._upWC}},rightWC:{get:function(){return Lc(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=B.clone(this._transform,qH),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,YH);this._setTransform(n);let i=axe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=B.clone(this._transform,qH),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,YH);this._setTransform(n);let i=cxe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=B.clone(this._transform,qH),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,YH);this._setTransform(n);let i=lxe(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}}});en.prototype.update=function(e){if(!c(e))throw new E("mode is required.");if(e===oe.SCENE2D&&!(this.frustum instanceof jo))throw new E("An OrthographicOffCenterFrustum is required in 2D.");if((e===oe.SCENE3D||e===oe.COLUMBUS_VIEW)&&!(this.frustum instanceof Ci)&&!(this.frustum instanceof on))throw new E("A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view");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();if(!(n instanceof jo))throw new E("The camera frustum is expected to be orthographic for 2D camera control.");let 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&&hxe(this,this.position)};var Tdt=new d,Adt=new d,Cdt=new d;en.prototype._setTransform=function(e){let t=d.clone(this.positionWC,Tdt),n=d.clone(this.upWC,Adt),i=d.clone(this.directionWC,Cdt);B.clone(e,this._transform),this._transformChanged=!0,Lc(this);let o=this._actualInvTransform;B.multiplyByPoint(o,t,this.position),B.multiplyByPointAsVector(o,i,this.direction),B.multiplyByPointAsVector(o,n,this.up),d.cross(this.direction,this.up,this.right),Lc(this)};var Edt=new H,Sdt=new mn,wdt=new d,vdt=new d;function uxe(e){if(!B.equals(B.IDENTITY,e.transform))return d.magnitude(e.position);let t=e._scene,n=t.globe,i=Edt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(c(n)){let a=e.getPickRay(i,Sdt);o=n.pickWorldCoordinates(a,t,!0,wdt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,vdt));let s;if(c(o)||c(r)){let a=c(r)?d.distance(r,e.positionWC):Number.POSITIVE_INFINITY,l=c(o)?d.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,l)}else s=Math.max(e.positionCartographic.height,0);return s}en.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof on&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=uxe(this)))};var XH=new d,TK=new B,Ddt=new B,AK=new Le,CK=new J,fxe=new he;function Pdt(e,t,n){if(isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new E("position has a NaN component");let i=B.clone(e.transform,TK),o=Ot.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Ddt);e._setTransform(o),d.clone(d.ZERO,e.position),n.heading=n.heading-O.PI_OVER_TWO;let r=Le.fromHeadingPitchRoll(n,AK),s=J.fromQuaternion(r,CK);J.getColumn(s,0,e.direction),J.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Idt(e,t,n,i){let o=B.clone(e.transform,TK);if(e._setTransform(B.IDENTITY),!d.equals(t,e.positionWC)){if(i){let a=e._projection,l=a.ellipsoid.cartesianToCartographic(t,fxe);t=a.project(l,XH)}d.clone(t,e.position)}n.heading=n.heading-O.PI_OVER_TWO;let r=Le.fromHeadingPitchRoll(n,AK),s=J.fromQuaternion(r,CK);J.getColumn(s,0,e.direction),J.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Odt(e,t,n,i){let o=B.clone(e.transform,TK);if(e._setTransform(B.IDENTITY),!d.equals(t,e.positionWC)){if(i){let l=e._projection,u=l.ellipsoid.cartesianToCartographic(t,fxe);t=l.project(u,XH)}H.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let l=a.top/a.right;a.right=s,a.left=r,a.top=a.right*l,a.bottom=-a.top}}if(e._scene.mapMode2D===ru.ROTATE){n.heading=n.heading-O.PI_OVER_TWO,n.pitch=-O.PI_OVER_TWO,n.roll=0;let r=Le.fromHeadingPitchRoll(n,AK),s=J.fromQuaternion(r,CK);J.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Rdt=new d,Mdt=new d,Ldt=new d;function dxe(e,t,n,i){let o=d.clone(n.direction,Rdt),r=d.clone(n.up,Mdt);if(e._scene.mode===oe.SCENE3D){let a=e._projection.ellipsoid,l=Ot.eastNorthUpToFixedFrame(t,a,qH),u=B.inverseTransformation(l,YH);B.multiplyByPointAsVector(u,o,o),B.multiplyByPointAsVector(u,r,r)}let s=d.cross(o,r,Ldt);return i.heading=axe(o,r),i.pitch=cxe(o),i.roll=lxe(o,r,s),i}var xK={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},Tw=new Oa;en.prototype.setView=function(e){e=e??W.EMPTY_OBJECT;let t=e.orientation??W.EMPTY_OBJECT,n=this._mode;if(n===oe.MORPHING)return;c(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??d.clone(this.positionWC,XH);if(c(o)&&c(o.west)){if(o=this.getRectangleCameraCoordinates(o,XH),isNaN(o.x)||isNaN(o.y))throw new E("destination has a NaN component");i=!1}c(t.direction)&&(t=dxe(this,o,t,xK.orientation)),Tw.heading=t.heading??0,Tw.pitch=t.pitch??-O.PI_OVER_TWO,Tw.roll=t.roll??0,n===oe.SCENE3D?Pdt(this,o,Tw):n===oe.SCENE2D?Odt(this,o,Tw,i):Idt(this,o,Tw,i)};var Ndt=new d;en.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:en.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:B.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(en.DEFAULT_VIEW_RECTANGLE),i=d.magnitude(n);i+=i*en.DEFAULT_VIEW_FACTOR,d.normalize(n,n),d.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:B.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,Ndt).z),roll:0},endTransform:B.IDENTITY,convert:!1})}};en.prototype.worldToCameraCoordinates=function(e,t){if(!c(e))throw new E("cartesian is required.");return c(t)||(t=new se),Lc(this),B.multiplyByVector(this._actualInvTransform,e,t)};en.prototype.worldToCameraCoordinatesPoint=function(e,t){if(!c(e))throw new E("cartesian is required.");return c(t)||(t=new d),Lc(this),B.multiplyByPoint(this._actualInvTransform,e,t)};en.prototype.worldToCameraCoordinatesVector=function(e,t){if(!c(e))throw new E("cartesian is required.");return c(t)||(t=new d),Lc(this),B.multiplyByPointAsVector(this._actualInvTransform,e,t)};en.prototype.cameraToWorldCoordinates=function(e,t){if(!c(e))throw new E("cartesian is required.");return c(t)||(t=new se),Lc(this),B.multiplyByVector(this._actualTransform,e,t)};en.prototype.cameraToWorldCoordinatesPoint=function(e,t){if(!c(e))throw new E("cartesian is required.");return c(t)||(t=new d),Lc(this),B.multiplyByPoint(this._actualTransform,e,t)};en.prototype.cameraToWorldCoordinatesVector=function(e,t){if(!c(e))throw new E("cartesian is required.");return c(t)||(t=new d),Lc(this),B.multiplyByPointAsVector(this._actualTransform,e,t)};function hxe(e,t){let n=e._scene.mapMode2D===ru.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var Jbe=new d;en.prototype.move=function(e,t){if(!c(e))throw new E("direction is required.");let n=this.position;d.multiplyByScalar(e,t,Jbe),d.add(n,Jbe,n),this._mode===oe.SCENE2D&&hxe(this,n),this._adjustOrthographicFrustum(!0)};en.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?KH(this,e):this.move(this.direction,e)};en.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?KH(this,-e):this.move(this.direction,-e)};en.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};en.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};en.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};en.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};en.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,-e)};en.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,e)};en.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,-e)};en.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,e)};var Fdt=new Le,Bdt=new J;en.prototype.look=function(e,t){if(!c(e))throw new E("axis is required.");let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,Fdt),o=J.fromQuaternion(i,Bdt),r=this.direction,s=this.up,a=this.right;J.multiplyByVector(o,r,r),J.multiplyByVector(o,s,s),J.multiplyByVector(o,a,a)};en.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};en.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var kdt=new Le,Udt=new J;en.prototype.rotate=function(e,t){if(!c(e))throw new E("axis is required.");let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,kdt),o=J.fromQuaternion(i,Udt);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)};en.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,mxe(this,e)};en.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,mxe(this,-e)};var Vdt=new d,zdt=new d,Hdt=new d,exe=new d;function mxe(e,t){let n=e.position;if(c(e.constrainedAxis)&&!d.equalsEpsilon(e.position,d.ZERO,O.EPSILON2)){let i=d.normalize(n,Vdt),o=d.equalsEpsilon(i,e.constrainedAxis,O.EPSILON2),r=d.equalsEpsilon(i,d.negate(e.constrainedAxis,exe),O.EPSILON2);if(!o&&!r){let s=d.normalize(e.constrainedAxis,zdt),a=d.dot(i,s),l=O.acosClamped(a);t>0&&t>l&&(t=l-O.EPSILON4),a=d.dot(i,d.negate(s,exe)),l=O.acosClamped(a),t<0&&-t>l&&(t=-l+O.EPSILON4);let u=d.cross(s,i,Hdt);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}en.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,pxe(this,-e)};en.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,pxe(this,e)};function pxe(e,t){c(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function KH(e,t){let n=e.frustum;if(!(n instanceof jo)||!c(n.left)||!c(n.right)||!c(n.bottom)||!c(n.top))throw new E("The camera frustum is expected to be orthographic for 2D camera control.");let i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===ru.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===ru.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function _xe(e,t){e.move(e.direction,t)}en.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?KH(this,e):_xe(this,e)};en.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?KH(this,-e):_xe(this,-e)};en.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 Gdt=new B;en.prototype.lookAt=function(e,t){if(!c(e))throw new E("target is required");if(!c(t))throw new E("offset is required");if(this._mode===oe.MORPHING)throw new E("lookAt is not supported while morphing.");let i=this._scene.ellipsoid??ie.default,o=Ot.eastNorthUpToFixedFrame(e,i,Gdt);this.lookAtTransform(o,t)};var jdt=new d,Wdt=new Le,qdt=new Le,Ydt=new J;function gxe(e,t,n){t=O.clamp(t,-O.PI_OVER_TWO,O.PI_OVER_TWO),e=O.zeroToTwoPi(e)-O.PI_OVER_TWO;let i=Le.fromAxisAngle(d.UNIT_Y,-t,Wdt),o=Le.fromAxisAngle(d.UNIT_Z,-e,qdt),r=Le.multiply(o,i,o),s=J.fromQuaternion(r,Ydt),a=d.clone(d.UNIT_X,jdt);return J.multiplyByVector(s,a,a),d.negate(a,a),d.multiplyByScalar(a,n,a),a}en.prototype.lookAtTransform=function(e,t){if(!c(e))throw new E("transform is required");if(this._mode===oe.MORPHING)throw new E("lookAtTransform is not supported while morphing.");if(this._setTransform(e),!c(t))return;let n;if(c(t.heading)?n=gxe(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){H.clone(H.ZERO,this.position),d.negate(n,this.up),this.up.z=0,d.magnitudeSquared(this.up)<O.EPSILON10&&d.clone(d.UNIT_Y,this.up),d.normalize(this.up,this.up),this._setTransform(B.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)<O.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 Q2=new he,Xdt=new he,Kdt=new d,$dt=new d,Zdt=new d,Qdt=new d,Jdt=new d,eht=new d,tht=new d,gK=new d,nht={direction:new d,right:new d,up:new d},txe;function Mc(e,t,n,i){return Math.abs(d.dot(t,n))/i-d.dot(e,n)}function yxe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:nht,{north:s,south:a,west:l}=t,{east:u}=t;l>u&&(u+=O.TWO_PI);let f=(l+u)*.5,h;if(a<-O.PI_OVER_TWO+O.RADIANS_PER_DEGREE&&s>O.PI_OVER_TWO-O.RADIANS_PER_DEGREE)h=0;else{let L=Q2;L.longitude=f,L.latitude=s,L.height=0;let F=Xdt;F.longitude=f,F.latitude=a,F.height=0;let _=txe;(!c(_)||_.ellipsoid!==o)&&(txe=_=new kp(void 0,void 0,o)),_.setEndPoints(L,F),h=_.interpolateUsingFraction(.5,Q2).latitude}let p=Q2;p.longitude=f,p.latitude=h,p.height=0;let g=o.cartographicToCartesian(p,tht),m=Q2;m.longitude=u,m.latitude=s;let y=o.cartographicToCartesian(m,Kdt);m.longitude=l;let b=o.cartographicToCartesian(m,Zdt);m.longitude=f;let x=o.cartographicToCartesian(m,Jdt);m.latitude=a;let A=o.cartographicToCartesian(m,eht);m.longitude=u;let C=o.cartographicToCartesian(m,Qdt);m.longitude=l;let S=o.cartographicToCartesian(m,$dt);d.subtract(b,g,b),d.subtract(C,g,C),d.subtract(y,g,y),d.subtract(S,g,S),d.subtract(x,g,x),d.subtract(A,g,A);let v=o.geodeticSurfaceNormal(g,r.direction);d.negate(v,v);let P=d.cross(v,d.UNIT_Z,r.right);d.normalize(P,P);let M=d.cross(P,v,r.up),R;if(e.frustum instanceof on){let L=Math.max(d.distance(y,b),d.distance(C,S)),F=Math.max(d.distance(y,C),d.distance(b,S)),_,w,D=e.frustum._offCenterFrustum,I=D.right/D.top,N=F*I;L>N?(_=L,w=_/I):(w=F,_=N),R=Math.max(_,w)}else{let L=Math.tan(e.frustum.fovy*.5),F=e.frustum.aspectRatio*L;if(R=Math.max(Mc(v,M,b,L),Mc(v,M,C,L),Mc(v,M,y,L),Mc(v,M,S,L),Mc(v,M,x,L),Mc(v,M,A,L),Mc(v,P,b,F),Mc(v,P,C,F),Mc(v,P,y,F),Mc(v,P,S,F),Mc(v,P,x,F),Mc(v,P,A,F)),a<0&&s>0){let _=Q2;_.longitude=l,_.latitude=0,_.height=0;let w=o.cartographicToCartesian(_,gK);d.subtract(w,g,w),R=Math.max(R,Mc(v,M,w,L),Mc(v,P,w,F)),_.longitude=u,w=o.cartographicToCartesian(_,gK),d.subtract(w,g,w),R=Math.max(R,Mc(v,M,w,L),Mc(v,P,w,F))}}return d.add(g,d.multiplyByScalar(v,-R,gK),n)}var iht=new he,oht=new d,rht=new d;function sht(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=iht;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,oht);B.multiplyByPoint(o,a,a),B.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let l=i.project(s,rht);if(B.multiplyByPoint(o,l,l),B.multiplyByPoint(r,l,l),n.x=(a.x-l.x)*.5+l.x,n.y=(a.y-l.y)*.5+l.y,c(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-l.x)/f,(a.y-l.y)/u)*.5}else{let u=a.x-l.x,f=a.y-l.y;n.z=Math.max(u,f)}return n}var aht=new he,cht=new d,lht=new d;function uht(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===ru.INFINITE_SCROLL?o+=O.TWO_PI:(t=ce.MAX_VALUE,o=t.east));let r=aht;r.longitude=o,r.latitude=t.north;let s=i.project(r,cht);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,lht),l=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,h,p=e.frustum.right/e.frustum.top,g=u*p;return l>g?(f=l,h=f/p):(h=u,f=g),u=Math.max(2*f,2*h),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}en.prototype.getRectangleCameraCoordinates=function(e,t){if(!c(e))throw new E("rectangle is required");let n=this._mode;if(c(t)||(t=new d),n===oe.SCENE3D)return yxe(this,e,t);if(n===oe.COLUMBUS_VIEW)return sht(this,e,t);if(n===oe.SCENE2D)return uht(this,e,t)};var fht=new mn;function dht(e,t,n,i){n=n??ie.default;let o=e.getPickRay(t,fht),r=Zn.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return mn.getPoint(o,s,i)}var hht=new mn;function mht(e,t,n,i){let r=e.getPickRay(t,hht).origin;r=d.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-O.PI_OVER_TWO||s.latitude>O.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var pht=new mn;function _ht(e,t,n,i){let o=e.getPickRay(t,pht),r=-o.origin.x/o.direction.x;mn.getPoint(o,r,i);let s=n.unproject(new d(i.y,i.z,0));if(!(s.latitude<-O.PI_OVER_TWO||s.latitude>O.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}en.prototype.pickEllipsoid=function(e,t,n){if(!c(e))throw new E("windowPosition is required.");let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(c(n)||(n=new d),t=t??ie.default,this._mode===oe.SCENE3D)n=dht(this,e,t,n);else if(this._mode===oe.SCENE2D)n=mht(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=_ht(this,e,this._projection,n);else return;return n}};var ght=new d,yht=new d,bht=new d;function xht(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,l=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,l,ght);d.add(h,p,p);let g=d.multiplyByScalar(e.rightWC,u*l*a,yht),m=d.multiplyByScalar(e.upWC,f*l*s,bht),y=d.add(p,g,n.direction);return d.add(y,m,y),d.subtract(y,h,y),d.normalize(y,y),n}var jH=new d;function Tht(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;c(a)&&(s=a);let l=2/o*t.x-1;l*=(s.right-s.left)*.5;let u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return d.clone(e.positionWC,f),d.multiplyByScalar(e.rightWC,l,jH),d.add(jH,f,f),d.multiplyByScalar(e.upWC,u,jH),d.add(jH,f,f),d.clone(e.directionWC,n.direction),n}en.prototype.getPickRay=function(e,t){if(!c(e))throw new E("windowPosition is required.");c(t)||(t=new mn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return c(i.aspectRatio)&&c(i.fov)&&c(i.near)?xht(this,e,t):Tht(this,e,t)};var Aht=new d,Cht=new d;en.prototype.distanceToBoundingSphere=function(e){if(!c(e))throw new E("boundingSphere is required.");let t=d.subtract(this.positionWC,e.center,Aht),n=d.multiplyByScalar(this.directionWC,d.dot(t,this.directionWC),Cht);return Math.max(0,d.magnitude(n)-e.radius)};var Eht=new H;en.prototype.getPixelSize=function(e,t,n){if(!c(e))throw new E("boundingSphere is required.");if(!c(t))throw new E("drawingBufferWidth is required.");if(!c(n))throw new E("drawingBufferHeight is required.");let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Eht);return Math.max(o.x,o.y)};function Sht(e,t,n,i,o,r){let s=d.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(l){let u=d.lerp(t,s,l.time,new d);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Qr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var wht=new d,nxe=new d,vht=new d,Dht=new d;function Pht(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(d.UNIT_X,wht),r=-d.dot(o,n)/d.dot(o,i),s=d.add(n,d.multiplyByScalar(i,r,nxe),nxe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,vht);let a=Math.tan(e.frustum.fovy*.5),l=e.frustum.aspectRatio*a,u=d.magnitude(d.subtract(n,s,Dht)),f=l*u,h=a*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),y=Math.max(h-g,g);if(n.z<-m||n.z>m||n.y<-y||n.y>y){let b=s.y<-m||s.y>m,x=s.z<-y||s.z>y;if(b||x)return Sht(e,n,s,m,y,t)}}en.prototype.createCorrectPositionTween=function(e){if(!c(e))throw new E("duration is required.");if(this._mode===oe.COLUMBUS_VIEW)return Pht(this,e)};var Iht=new d,ia={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};en.prototype.cancelFlight=function(){c(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};en.prototype.completeFlight=function(){if(c(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=ia.destination,e.orientation.heading=ia.heading,e.orientation.pitch=ia.pitch,e.orientation.roll=ia.roll,this.setView(e),c(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};en.prototype.flyTo=function(e){e=e??W.EMPTY_OBJECT;let t=e.destination;if(!c(t))throw new E("destination is required.");if(this._mode===oe.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,Iht));let o=e.orientation??W.EMPTY_OBJECT;if(c(o.direction)&&(o=dxe(this,t,o,xK.orientation)),c(e.duration)&&e.duration<=0){let f=xK;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,s;ia.destination=t,ia.heading=o.heading,ia.pitch=o.pitch,ia.roll=o.roll,ia.duration=e.duration,ia.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),c(e.complete)&&e.complete()},ia.cancel=e.cancel,ia.endTransform=e.endTransform,ia.convert=i?!1:e.convert,ia.maximumHeight=e.maximumHeight,ia.pitchAdjustHeight=e.pitchAdjustHeight,ia.flyOverLongitude=e.flyOverLongitude,ia.flyOverLongitudeWeight=e.flyOverLongitudeWeight,ia.easingFunction=e.easingFunction;let a=this._scene,l=Z2.createTween(a,ia);if(l.duration===0){typeof l.complete=="function"&&l.complete();return}s=a.tweens.add(l),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==oe.SCENE2D&&(c(u)||(u=en.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Oht(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Rht(e,t){let n=e.frustum,i=n.offCenterFrustum;c(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var Mht=100;function bxe(e,t,n){n=cd.clone(c(n)?n:en.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!c(r)||r===0){let s=t.radius;s===0?n.range=Mht:e.frustum instanceof on||e._mode===oe.SCENE2D?n.range=Rht(e,s):n.range=Oht(e,s),n.range=O.clamp(n.range,i,o)}return n}en.prototype.viewBoundingSphere=function(e,t){if(!c(e))throw new E("boundingSphere is required.");if(this._mode===oe.MORPHING)throw new E("viewBoundingSphere is not supported while morphing.");t=bxe(this,e,t),this.lookAt(e.center,t)};var Lht=new B,Nht=new d,Fht=new d,Bht=new d,kht=new d,Uht=new se,Vht=new Le,zht=new J;en.prototype.flyToBoundingSphere=function(e,t){if(!c(e))throw new E("boundingSphere is required.");t=t??W.EMPTY_OBJECT;let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(B.IDENTITY);let i=bxe(this,e,t.offset),o;n?o=d.multiplyByScalar(d.UNIT_Z,i.range,Nht):o=gxe(i.heading,i.pitch,i.range);let s=this._scene.ellipsoid??ie.default,a=Ot.eastNorthUpToFixedFrame(e.center,s,Lht);B.multiplyByPoint(a,o,o);let l,u;if(!n){if(l=d.subtract(e.center,o,Fht),d.normalize(l,l),u=B.multiplyByPointAsVector(a,d.UNIT_Z,Bht),1-Math.abs(d.dot(l,u))<O.EPSILON6){let h=Le.fromAxisAngle(l,i.heading,Vht),p=J.fromQuaternion(h,zht);d.fromCartesian4(B.getColumn(a,1,Uht),u),J.multiplyByVector(p,u,u)}let f=d.cross(l,u,kht);d.cross(f,l,u),d.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:l,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var ixe=new d,oxe=new d,yK=new d,rxe=new d,J2=[new d,new d,new d,new d];function Hht(e,t){let n=t.radii,i=e.positionWC,o=d.multiplyComponents(t.oneOverRadii,i,ixe),r=d.magnitude(o),s=d.normalize(o,oxe),a,l;d.equalsEpsilon(s,d.UNIT_Z,O.EPSILON10)?(a=new d(0,1,0),l=new d(0,0,1)):(a=d.normalize(d.cross(d.UNIT_Z,s,yK),yK),l=d.normalize(d.cross(s,a,rxe),rxe));let u=Math.sqrt(d.magnitudeSquared(o)-1),f=d.multiplyByScalar(s,1/r,ixe),h=u/r,p=d.multiplyByScalar(a,h,oxe),g=d.multiplyByScalar(l,h,yK),m=d.add(f,g,J2[0]);d.subtract(m,p,m),d.multiplyComponents(n,m,m);let y=d.subtract(f,g,J2[1]);d.subtract(y,p,y),d.multiplyComponents(n,y,y);let b=d.subtract(f,g,J2[2]);d.add(b,p,b),d.multiplyComponents(n,b,b);let x=d.add(f,g,J2[3]);return d.add(x,p,x),d.multiplyComponents(n,x,x),J2}var bK=new H,Ght=new d,I0=[new he,new he,new he,new he];function WH(e,t,n,i,o,r){bK.x=e,bK.y=t;let s=i.pickEllipsoid(bK,o,Ght);return c(s)?(I0[n]=o.cartesianToCartographic(s,I0[n]),1):(I0[n]=o.cartesianToCartographic(r[n],I0[n]),0)}en.prototype.computeViewRectangle=function(e,t){e=e??ie.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new le(d.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Wt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,l=0,u=Hht(this,e);if(l+=WH(0,0,0,this,e,u),l+=WH(0,a,1,this,e,u),l+=WH(s,a,2,this,e,u),l+=WH(s,0,3,this,e,u),l<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(I0,t);let f=0,h=I0[3].longitude;for(let p=0;p<4;++p){let g=I0[p].longitude,m=Math.abs(g-h);m>O.PI?f+=O.TWO_PI-m:f+=m,h=g}return O.equalsEpsilon(Math.abs(f),O.TWO_PI,O.EPSILON9)&&(t.west=-O.PI,t.east=O.PI,I0[0].latitude>=0?t.north=O.PI_OVER_TWO:t.south=-O.PI_OVER_TWO),t};en.prototype.switchToPerspectiveFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof Ci)return;let e=this._scene;this.frustum=new Ci,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=O.toRadians(60)};en.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof on)return;let e=uxe(this),t=this._scene;this.frustum=new on,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};en.clone=function(e,t){return c(t)||(t=new en(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),B.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var ro=en;function jht(e){T.typeOf.object("options",e),T.typeOf.number("options.pass",e.pass),this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var gd=jht;var Exe=Zo(du(),1),xxe=576,Wht=100,eB="#ffffff",$H="#48b";function Sxe(e,t){this.credit=e,this.count=t??1}function qht(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Tt.equals(o,t))return!0}return!1}function Yht(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Tt.equals(n,t)||(c(t)&&e._cesiumCreditContainer.removeChild(t.element),c(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var wxe="cesium-credit-delimiter";function Txe(e){let t=document.createElement("span");return t.textContent=e,t.className=wxe,t}function Axe(e,t){if(c(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function Cxe(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(c(a)){if(r=s,c(n)&&(r*=2,s>0)){let u=r-1;if(o.length<=u)e.appendChild(Txe(n));else{let f=o[u];f.className!==wxe&&e.replaceChild(Txe(n),f)}}let l=a.element;if(o.length<=r)e.appendChild(Axe(l,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(Axe(l,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function Xht(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<xxe?(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>=xxe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function Kht(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: ${eB}; position: relative; min-height: ${Wht}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: ${eB}; } .cesium-credit-lightbox > ul > li a:hover { color: ${$H}; } .cesium-credit-lightbox.cesium-credit-lightbox-expanded { border: 1px solid #444; border-radius: 5px; max-width: 370px; } .cesium-credit-lightbox.cesium-credit-lightbox-mobile { height: 100%; width: 100%; } .cesium-credit-lightbox-title { padding: 20px 20px 0 20px; } .cesium-credit-lightbox-close { font-size: 18pt; cursor: pointer; position: absolute; top: 0; right: 6px; color: ${eB}; } .cesium-credit-lightbox-close:hover { color: ${$H}; } .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: ${eB}; } .cesium-credit-expand-link:hover { color: ${$H}; } .cesium-credit-text { color: ${eB}; } .cesium-credit-delimiter { padding: 0 5px; } .cesium-credit-textContainer *, .cesium-credit-logoContainer * { display: inline; } .cesium-credit-textContainer a:hover { color: ${$H} } .cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { padding-left: 5px; } `;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function Tr(e,t,n){T.defined("container",e);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 s(m){r.contains(m.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let l=document.createElement("a");l.onclick=this.hideLightbox.bind(this),l.innerHTML="×",l.className="cesium-credit-lightbox-close",r.appendChild(l);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),Kht(e);let g=Tt.clone(Tr.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=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Et,lightboxCredits:new Et},this._defaultCredit=void 0,this.viewport=n,this.container=e}function vxe(e,t,n,i){i=i??1;let o=t.get(n.id);if(c(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new Sxe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}Tr.prototype.addCreditToNextFrame=function(e){if(T.defined("credit",e),e.isIon()){c(this._defaultCredit)||(this._defaultCredit=Tt.clone(Dxe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,vxe(this,t,e)};Tr.prototype.addStaticCredit=function(e){T.defined("credit",e);let t=this._staticCredits;qht(t,e)||t.push(e)};Tr.prototype.removeStaticCredit=function(e){T.defined("credit",e);let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Tr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Tr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Tr.prototype.update=function(){this._expanded&&Xht(this)};Tr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&Tt.equals(Tr.cesiumCredit,this._cesiumCredit)||vxe(this,s,r,Number.MAX_VALUE)}Tt.equals(Tr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Tt.clone(Tr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Tr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;Cxe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",Cxe(this._creditList,t,void 0,"li"),Yht(this)};Tr.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),de(this)};Tr.prototype.isDestroyed=function(){return!1};Tr._cesiumCredit=void 0;Tr._cesiumCreditInitialized=!1;var ZH;function Dxe(){if(!c(ZH)){let e=tn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new Exe.default(e).path()),ZH=new Tt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Tr._cesiumCreditInitialized||(Tr._cesiumCredit=ZH,Tr._cesiumCreditInitialized=!0),ZH}Object.defineProperties(Tr,{cesiumCredit:{get:function(){return Dxe(),Tr._cesiumCredit},set:function(e){Tr._cesiumCredit=e,Tr._cesiumCreditInitialized=!0}}});Tr.CreditDisplayElement=Sxe;var tB=Tr;var QH=0,$ht=1;function qT(e){T.typeOf.object("options",e),T.typeOf.object("options.frustum",e.frustum),T.typeOf.object("options.origin",e.origin),T.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??Ie.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof Ci?(s=QH,a=Ci.packedLength):t instanceof on&&(s=$ht,a=on.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+d.packedLength+Le.packedLength+Ie.packedLength}qT.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t),n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===QH?(Ci.pack(o,t,n),n+=Ci.packedLength):(on.pack(o,t,n),n+=on.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._drawNearPlane?1:0,t};var Zht=new Ci,Qht=new on,Jht=new Le,emt=new d,tmt=new Ie;qT.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o;i===QH?(o=Ci.unpack(e,t,Zht),t+=Ci.packedLength):(o=on.unpack(e,t,Qht),t+=on.packedLength);let r=d.unpack(e,t,emt);t+=d.packedLength;let s=Le.unpack(e,t,Jht);t+=Le.packedLength;let a=Ie.unpack(e,t,tmt);t+=Ie.packedLength;let l=e[t]===1;if(!c(n))return new qT({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:l});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=Le.clone(s,n._orientation),n._vertexFormat=Ie.clone(a,n._vertexFormat),n._drawNearPlane=l,n};function Aw(e,t,n,i,o,r,s,a){let l=e/3*2;for(let u=0;u<4;++u)c(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),c(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),c(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[l]=0,o[l+1]=0,o[l+2]=1,o[l+3]=0,o[l+4]=1,o[l+5]=1,o[l+6]=0,o[l+7]=1}var nmt=new J,imt=new B,EK=new B,Pxe=new d,Ixe=new d,Oxe=new d,omt=new d,rmt=new d,smt=new d,O0=new Array(3),nB=new Array(4);nB[0]=new se(-1,-1,1,1);nB[1]=new se(1,-1,1,1);nB[2]=new se(1,1,1,1);nB[3]=new se(-1,1,1,1);var Rxe=new Array(4);for(let e=0;e<4;++e)Rxe[e]=new se;qT._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let l=J.fromQuaternion(t,nmt),u=r??Pxe,f=s??Ixe,h=a??Oxe;u=J.getColumn(l,0,u),f=J.getColumn(l,1,f),h=J.getColumn(l,2,h),d.normalize(u,u),d.normalize(f,f),d.normalize(h,h),d.negate(u,u);let p=B.computeView(e,h,f,u,imt),g,m,y=i.projectionMatrix;if(n===QH){let b=B.multiply(y,p,EK);m=B.inverse(b,EK)}else g=B.inverseTransformation(p,EK);c(m)?(O0[0]=i.near,O0[1]=i.far):(O0[0]=0,O0[1]=i.near,O0[2]=i.far);for(let b=0;b<2;++b)for(let x=0;x<4;++x){let A=se.clone(nB[x],Rxe[x]);if(c(m)){A=B.multiplyByVector(m,A,A);let C=1/A.w;d.multiplyByScalar(A,C,A),d.subtract(A,e,A),d.normalize(A,A);let S=d.dot(h,A);d.multiplyByScalar(A,O0[b]/S,A),d.add(A,e,A)}else{let C=i.offCenterFrustum;c(C)&&(i=C);let S=O0[b],v=O0[b+1];A.x=(A.x*(i.right-i.left)+i.left+i.right)*.5,A.y=(A.y*(i.top-i.bottom)+i.bottom+i.top)*.5,A.z=(A.z*(S-v)-S-v)*.5,A.w=1,B.multiplyByVector(g,A,A)}o[12*b+x*3]=A.x,o[12*b+x*3+1]=A.y,o[12*b+x*3+2]=A.z}};qT.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,l=new Float64Array(3*4*6);qT._computeNearFarPlanes(i,o,t,n,l);let u=3*4*2;l[u]=l[3*4],l[u+1]=l[3*4+1],l[u+2]=l[3*4+2],l[u+3]=l[0],l[u+4]=l[1],l[u+5]=l[2],l[u+6]=l[3*3],l[u+7]=l[3*3+1],l[u+8]=l[3*3+2],l[u+9]=l[3*7],l[u+10]=l[3*7+1],l[u+11]=l[3*7+2],u+=3*4,l[u]=l[3*5],l[u+1]=l[3*5+1],l[u+2]=l[3*5+2],l[u+3]=l[3],l[u+4]=l[4],l[u+5]=l[5],l[u+6]=l[0],l[u+7]=l[1],l[u+8]=l[2],l[u+9]=l[3*4],l[u+10]=l[3*4+1],l[u+11]=l[3*4+2],u+=3*4,l[u]=l[3],l[u+1]=l[4],l[u+2]=l[5],l[u+3]=l[3*5],l[u+4]=l[3*5+1],l[u+5]=l[3*5+2],l[u+6]=l[3*6],l[u+7]=l[3*6+1],l[u+8]=l[3*6+2],l[u+9]=l[3*2],l[u+10]=l[3*2+1],l[u+11]=l[3*2+2],u+=3*4,l[u]=l[3*2],l[u+1]=l[3*2+1],l[u+2]=l[3*2+2],l[u+3]=l[3*6],l[u+4]=l[3*6+1],l[u+5]=l[3*6+2],l[u+6]=l[3*7],l[u+7]=l[3*7+1],l[u+8]=l[3*7+2],l[u+9]=l[3*3],l[u+10]=l[3*3+1],l[u+11]=l[3*3+2],r||(l=l.subarray(3*4));let f=new fn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:l})});if(c(s.normal)||c(s.tangent)||c(s.bitangent)||c(s.st)){let p=c(s.normal)?new Float32Array(12*a):void 0,g=c(s.tangent)?new Float32Array(3*4*a):void 0,m=c(s.bitangent)?new Float32Array(3*4*a):void 0,y=c(s.st)?new Float32Array(2*4*a):void 0,b=Pxe,x=Ixe,A=Oxe,C=d.negate(b,omt),S=d.negate(x,rmt),v=d.negate(A,smt);u=0,r&&(Aw(u,p,g,m,y,v,b,x),u+=3*4),Aw(u,p,g,m,y,A,C,x),u+=3*4,Aw(u,p,g,m,y,C,v,x),u+=3*4,Aw(u,p,g,m,y,S,v,C),u+=3*4,Aw(u,p,g,m,y,b,A,x),u+=3*4,Aw(u,p,g,m,y,x,A,C),c(p)&&(f.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:p})),c(g)&&(f.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g})),c(m)&&(f.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m})),c(y)&&(f.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:y}))}let h=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,m=p*4;h[g]=m,h[g+1]=m+1,h[g+2]=m+2,h[g+3]=m,h[g+4]=m+2,h[g+5]=m+3}return new ct({attributes:f,indices:h,primitiveType:Me.TRIANGLES,boundingSphere:le.fromVertices(l)})};var YT=qT;var SK=0,amt=1;function iB(e){T.typeOf.object("options",e),T.typeOf.object("options.frustum",e.frustum),T.typeOf.object("options.origin",e.origin),T.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof Ci?(r=SK,s=Ci.packedLength):t instanceof on&&(r=amt,s=on.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+d.packedLength+Le.packedLength}iB.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t),n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===SK?(Ci.pack(o,t,n),n+=Ci.packedLength):(on.pack(o,t,n),n+=on.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,t[n]=e._drawNearPlane?1:0,t};var cmt=new Ci,lmt=new on,umt=new Le,fmt=new d;iB.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o;i===SK?(o=Ci.unpack(e,t,cmt),t+=Ci.packedLength):(o=on.unpack(e,t,lmt),t+=on.packedLength);let r=d.unpack(e,t,fmt);t+=d.packedLength;let s=Le.unpack(e,t,umt);t+=Le.packedLength;let a=e[t]===1;if(!c(n))return new iB({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let l=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(l),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Le.clone(s,n._orientation),n._drawNearPlane=a,n};iB.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);YT._computeNearFarPlanes(i,o,t,n,s);let a=new fn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s})}),l,u,f=r?2:1,h=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)l=r?p*8:0,u=p*4,h[l]=u,h[l+1]=u+1,h[l+2]=u+1,h[l+3]=u+2,h[l+4]=u+2,h[l+5]=u+3,h[l+6]=u+3,h[l+7]=u;for(p=0;p<2;++p)l=(f+p)*8,u=p*4,h[l]=u,h[l+1]=u+4,h[l+2]=u+1,h[l+3]=u+5,h[l+4]=u+2,h[l+5]=u+6,h[l+6]=u+3,h[l+7]=u+7;return new ct({attributes:a,indices:h,primitiveType:Me.LINES,boundingSphere:le.fromVertices(s)})};var oB=iB;function JH(e){if(e=e??W.EMPTY_OBJECT,!c(e.camera))throw new E("options.camera is required.");this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??G.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var dmt=new d,hmt=new J,mmt=new Le,pmt=new Ci,_mt=new bl,gmt=new on,ymt=new jo,bmt=new G,xmt=[1,1e5];JH.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Ci?a=pmt:s instanceof bl?a=_mt:s instanceof on?a=gmt:a=ymt,a=s.clone(a);let l,u=this._frustumSplits;!c(u)||u.length<=1?(u=xmt,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,l=1):l=u.length-1;let f=r.positionWC,h=r.directionWC,p=r.upWC,g=r.rightWC;g=d.negate(g,dmt);let m=hmt;J.setColumn(m,0,g,m),J.setColumn(m,1,p,m),J.setColumn(m,2,h,m);let y=Le.fromRotationMatrix(m,mmt);for(t.length=n.length=l,i=0;i<l;++i)a.near=u[i],a.far=u[i+1],t[i]=new Pn({geometryInstances:new St({geometry:new YT({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Gt.fromColor(G.fromAlpha(this._color,.1,bmt))},id:this.id,pickPrimitive:this}),appearance:new rn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Pn({geometryInstances:new St({geometry:new oB({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Gt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};JH.prototype.isDestroyed=function(){return!1};JH.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 de(this)};var sp=JH;function sB(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 rB=Vt.supportsTypedArrays()?new Float32Array(12):[],Mxe=new d,Lxe=new d,wK=new d,Nxe=new d,eG=new d;function Tmt(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof on)o=d.ZERO,r=i.rightWC,s=i.upWC;else{let h=i.positionWC,p=d.multiplyComponents(e.oneOverRadii,h,Mxe),g=d.normalize(p,Lxe),m=d.normalize(d.cross(d.UNIT_Z,p,wK),wK),y=d.normalize(d.cross(g,m,Nxe),Nxe),b=d.magnitude(p),x=Math.sqrt(b*b-1);o=d.multiplyByScalar(g,1/b,Mxe);let A=x/b;r=d.multiplyByScalar(m,A,Lxe),s=d.multiplyByScalar(y,A,wK)}let a=d.add(o,s,eG);d.subtract(a,r,a),d.multiplyComponents(n,a,a),d.pack(a,rB,0);let l=d.subtract(o,s,eG);d.subtract(l,r,l),d.multiplyComponents(n,l,l),d.pack(l,rB,3);let u=d.add(o,s,eG);d.add(u,r,u),d.multiplyComponents(n,u,u),d.pack(u,rB,6);let f=d.subtract(o,s,eG);return d.add(f,r,f),d.multiplyComponents(n,f,f),d.pack(f,rB,9),rB}sB.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 ie(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(c(this._command)||(this._rs=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new Qe({renderState:this._rs,boundingVolume:new le(d.ZERO,i.maximumRadius),pass:De.OPAQUE,owner:this})),!c(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new He({sources:[t2]}),a=new He({sources:[e2]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Jt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=Tmt(i,e);if(c(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new ct({attributes:{position:new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Me.TRIANGLES});this._va=ti.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Be.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};sB.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};sB.prototype.isDestroyed=function(){return!1};sB.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var aB=sB;function Ew(){}var Amt=/\bgl_FragDepth\b/,Cmt=/\bdiscard\b/;function Emt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(c(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(Amt.test(r[a])||Cmt.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main() { out_FragColor = vec4(1.0); } `;i=new He({sources:[a]})}else if(!o&&s){let a=`void main() { out_FragColor = vec4(1.0); czm_writeLogDepth(); } `;i=new He({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function Smt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(c(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}Ew.createDepthOnlyDerivedCommand=function(e,t,n,i){c(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=Qe.shallowClone(t,i.depthOnlyCommand),!c(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=Emt(n,t.shaderProgram),i.depthOnlyCommand.renderState=Smt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var wmt=/\s+czm_writeLogDepth\(/,vmt=/\s+czm_vertexLogDepth\(/;function Dmt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(c(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=c(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=c(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,l=r.sources;for(let f=0;f<l.length;++f)if(vmt.test(l[f])){a=!0;break}if(!a){for(let h=0;h<l.length;++h)l[h]=He.replaceMain(l[h],"czm_log_depth_main");l.push(` void main() { czm_log_depth_main(); czm_vertexLogDepth(); } `)}l=s.sources,a=!1;for(let f=0;f<l.length;++f)wmt.test(l[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<l.length;f++)l[f]=He.replaceMain(l[f],"czm_log_depth_main");u=` void main() { czm_log_depth_main(); czm_writeLogDepth(); } `}return l.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}Ew.createLogDepthCommand=function(e,t,n){c(n)||(n={});let i=n.command?.shaderProgram;return n.command=Qe.shallowClone(e,n.command),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Dmt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function Pmt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(c(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,l=r.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () { czm_non_pick_main(); if (${l}.a == 0.0) { discard; } ${l} = ${n}; } `,f=r.length,h=new Array(f+1);for(let g=0;g<f;++g)h[g]=He.replaceMain(r[g],"czm_non_pick_main");h[f]=u;let p=new He({sources:h,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function Fxe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(c(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}Ew.createPickDerivedCommand=function(e,t,n,i){c(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=Qe.shallowClone(t,i.pickCommand),!c(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=Pmt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Fxe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function Cw(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 Bxe(e){return e.isArray?e.arrayLength:at.getComponentCount(e.type)}function Imt(e){let t=Bxe(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function kxe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function Uxe(e,t){let n=Nt.getMaximum(t);return`(${e}) / float(${n})`}function Omt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=kxe(n,i,o)}return e.normalized||(n=Uxe(n,e.componentType)),n}function Rmt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=kxe(o,r,s)}return e.normalized||(o=Uxe(o,e.componentType)),o}function Mmt(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(c(a))return a;let l=n.metadataProperty,u=n.classProperty,f=Imt(u),h=["0.0","0.0","0.0","0.0"],p=Bxe(u);if(p===1)h[0]=Omt(u,l);else{let b=["x","y","z","w"];for(let x=0;x<p;x++)h[x]=Rmt(u,l,b[x])}let g=t.fragmentShaderSource.defines.slice();g.push(Pu.METADATA_PICKING_ENABLED),Cw(g,Pu.METADATA_PICKING_VALUE_TYPE,f),Cw(g,Pu.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),Cw(g,Pu.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),Cw(g,Pu.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),Cw(g,Pu.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),Cw(g,Pu.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let m=new He({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}Ew.createPickMetadataDerivedCommand=function(e,t,n,i){return c(i)||(i={}),i.pickMetadataCommand=Qe.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=Mmt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Fxe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function Lmt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(c(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=c(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=c(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}Ew.createHdrCommand=function(e,t,n){c(n)||(n={});let i=n.command?.shaderProgram;return n.command=Qe.shallowClone(e,n.command),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Lmt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var ap=Ew;function tG(e){if(!c(e))throw new E("scene is required.");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(!c(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=O.toRadians(o),t._beta=O.toRadians(i.beta),t._gamma=O.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var Nmt=new Le,Vxe=new Le,Fmt=new J;function Bmt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Le.fromAxisAngle(o,n,Vxe),l=Le.fromAxisAngle(r,i,Nmt),u=Le.multiply(l,a,l),f=Le.fromAxisAngle(s,t,Vxe);Le.multiply(f,u,u);let h=J.fromQuaternion(u,Fmt);J.multiplyByVector(h,r,r),J.multiplyByVector(h,s,s),J.multiplyByVector(h,o,o)}tG.prototype.update=function(){if(!c(this._alpha))return;c(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;Bmt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};tG.prototype.isDestroyed=function(){return!1};tG.prototype.destroy=function(){return this._removeListener(),de(this)};var cB=tG;function vK(){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(vK.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){if(c(e)&&e<0)throw new E("value must be positive.");this._heightFalloff=e}}});var kmt=new d;vK.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!c(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,O.EPSILON4),-Math.max(this._heightFalloff,0)),s=d.normalize(n.positionWC,kmt),a=Math.abs(d.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var lB=vK;function Umt(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=oe.SCENE3D,this.morphTime=oe.getMorphTime(oe.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,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}var uB=Umt;var Sa={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},XT=Sa.DERIVED_COMMANDS_MAXIMUM_LENGTH,$xe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function KT(){this._frontFaceAlphaByDistance=new Bt(0,1,0,1),this._backFaceAlphaByDistance=new Bt(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(XT),this._derivedBlendCommandTypes=new Array(XT),this._derivedPickCommandTypes=new Array(XT),this._derivedCommandTypesToUpdate=new Array(XT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(KT.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});KT.prototype.update=function(e){let t=e.globe;if(!c(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=zxe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=zxe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=Hxe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=Hxe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Gmt(this,e,t),this._sunVisibleThroughGlobe=Vmt(this,e),this._environmentVisible=zmt(this,e),this._useDepthPlane=Hmt(this,e),this._numberOfTextureUniforms=jmt(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),Wmt(this,e)};function zxe(e,t,n,i){return e?c(n)?(Bt.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 Hxe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function Vmt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function zmt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function Hmt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Gmt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function jmt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Wmt(e,t){e._derivedCommandsLength=DK(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=DK(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=DK(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<XT;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!c(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=spt())}function DK(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let l=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?Sa.PICK_FRONT_FACE:u?Sa.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:Sa.TRANSLUCENT_FRONT_FACE,h=i?Sa.PICK_BACK_FACE:u?Sa.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:Sa.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=Sa.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(a?(n||(o[r++]=Sa.DEPTH_ONLY_FRONT_AND_BACK_FACE),l?(o[r++]=f,o[r++]=h):(o[r++]=h,o[r++]=f)):l?(n||(o[r++]=Sa.DEPTH_ONLY_BACK_FACE),o[r++]=Sa.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=Sa.DEPTH_ONLY_FRONT_FACE),o[r++]=Sa.OPAQUE_BACK_FACE,o[r++]=f),r)}function yd(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Gxe(e,t){return e.indexOf(t)>-1}function qmt(e,t){yd(e.defines,"TRANSLUCENT"),yd(t.defines,"TRANSLUCENT")}function Ymt(e,t){yd(e.defines,"GROUND_ATMOSPHERE"),yd(t.defines,"GROUND_ATMOSPHERE"),yd(e.defines,"FOG"),yd(t.defines,"FOG"),yd(e.defines,"TRANSLUCENT"),yd(t.defines,"TRANSLUCENT")}function PK(e,t){if(Gxe(t.defines,"TILE_LIMIT_RECTANGLE")||Gxe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() { out_FragColor = vec4(1.0); } `;t.sources=[n]}function IK(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=He.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 Zxe(e,t){IK(e,t),yd(e.defines,"GROUND_ATMOSPHERE"),yd(t.defines,"GROUND_ATMOSPHERE"),yd(e.defines,"FOG"),yd(t.defines,"FOG")}function Xmt(e,t){IK(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Kmt(e,t){Zxe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function jxe(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 $mt(e,t,n,i,o,r){if(!c(o))return t;if(!i&&c(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!c(s)){let a=t._attributeLocations,l=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();l.defines=c(l.defines)?l.defines.slice(0):[],u.defines=c(u.defines)?u.defines.slice(0):[],o(l,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:a})}return s}function Zmt(e){e.cull.face=xi.BACK,e.cull.enabled=!0}function Qmt(e){e.cull.face=xi.FRONT,e.cull.enabled=!0}function Jmt(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function ept(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function tpt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Wxe(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=ln.ALPHA_BLEND}function qxe(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=ln.ALPHA_BLEND}function npt(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function ipt(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function opt(e,t,n,i,o){if(!c(i))return e;if(!n&&c(t))return t;let r=o[e.id];if(!c(r)){let s=Ve.getState(e);i(s),r=Ve.fromCache(s),o[e.id]=r}return r}function Sw(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function rpt(e,t,n,i,o){return c(o)?!i&&c(n)?n:xt(t,o(e),!1):t}function jh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function spt(){return[new jh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:qmt,getRenderStateFunction:Zmt,getUniformMapFunction:void 0}),new jh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:Ymt,getRenderStateFunction:Qmt,getUniformMapFunction:void 0}),new jh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:PK,getRenderStateFunction:Jmt,getUniformMapFunction:void 0}),new jh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:PK,getRenderStateFunction:ept,getUniformMapFunction:void 0}),new jh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:PK,getRenderStateFunction:tpt,getUniformMapFunction:void 0}),new jh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:IK,getRenderStateFunction:Wxe,getUniformMapFunction:Sw}),new jh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Zxe,getRenderStateFunction:qxe,getUniformMapFunction:Sw}),new jh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Xmt,getRenderStateFunction:Wxe,getUniformMapFunction:Sw}),new jh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Kmt,getRenderStateFunction:qxe,getUniformMapFunction:Sw}),new jh({pass:De.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:jxe,getRenderStateFunction:npt,getUniformMapFunction:Sw}),new jh({pass:De.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:jxe,getRenderStateFunction:ipt,getUniformMapFunction:Sw})]}var Yxe=new Array(XT),Xxe=new Array(XT);KT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)Xxe[o]=this._derivedCommandPacks[n[o]],Yxe[o]=$xe[n[o]];apt(this,e,i,n,Yxe,Xxe,t)}};function apt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,l=e._derivedCommandsDirty;if(t.dirty||!c(a)||l){t.dirty=!1,c(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=a.uniformMapDirtyFrame??0,h=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,g=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),y&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let b=0;b<n;++b){let x=r[b],A=i[b],C=o[b],S=a[C],v,P,M;c(S)?(v=S.uniformMap,P=S.shaderProgram,M=S.renderState):(v=void 0,P=void 0,M=void 0),S=Qe.shallowClone(t,S),a[C]=S;let R=S.derivedCommands.uniformMapDirtyFrame??0,L=S.derivedCommands.shaderProgramDirtyFrame??0,F=S.derivedCommands.renderStateDirtyFrame??0,_=g||R<f,w=m||L<h,D=y||F<p;_&&(S.derivedCommands.uniformMapDirtyFrame=u),w&&(S.derivedCommands.shaderProgramDirtyFrame=u),D&&(S.derivedCommands.renderStateDirtyFrame=u),S.derivedCommands.type=A,S.pass=x.pass,S.pickOnly=x.pickOnly,S.uniformMap=rpt(e,t.uniformMap,v,_,x.getUniformMapFunction),S.shaderProgram=$mt(s.context,t.shaderProgram,P,w,x.getShaderProgramFunction,C),S.renderState=opt(t.renderState,M,D,x.getRenderStateFunction,x.renderStateCache)}}}KT.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let l=$xe[o[a]];n.commandList.push(s[l])}};function Qxe(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],l=a.derivedCommands.type;(!c(r)||r.indexOf(l)>-1)&&n(a,i,o)}}function Kxe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var cpt=[Sa.OPAQUE_FRONT_FACE,Sa.OPAQUE_BACK_FACE],lpt=[Sa.DEPTH_ONLY_FRONT_FACE,Sa.DEPTH_ONLY_BACK_FACE,Sa.DEPTH_ONLY_FRONT_AND_BACK_FACE];KT.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[De.GLOBE],a=e.indices[De.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),Qxe(s,a,t,i,o,cpt))};KT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[De.GLOBE],l=e.indices[De.GLOBE],u=e.commands[De.TERRAIN_CLASSIFICATION],f=e.indices[De.TERRAIN_CLASSIFICATION];if(l===0||f===0)return;let h=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!h||!p)&&Kxe(u,f,t,i,o),!h&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,Qxe(a,l,t,i,o,lpt),r.depthTexture){let y=n.packDepth(r,o);s.globeDepthTexture=y}Kxe(u,f,t,i,o),s.globeDepthTexture=g,o.framebuffer=m};var fB=KT;var su=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { out_FragColor = texture(colorTexture, v_textureCoordinates); } `;function cp(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new hi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new hi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ei({color:new G(0,0,0,0),owner:this}),this._clearCommand=new ei({color:new G(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(cp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});cp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var upt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:ln.ALPHA_BLEND},fpt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:ln.ALPHA_BLEND},dpt={depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK,blending:ln.ALPHA_BLEND},hpt=`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; } `,mpt=`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 } `;cp.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,l=!c(i)||i.width!==s||i.height!==a;if((l||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),c(this._previousFramebuffer)||(this._depthStencilTexture=new Rt({context:e,width:s,height:a,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new _u({context:e,width:s,height:a,format:uc.DEPTH24_STENCIL8,numSamples:t})))),!c(this._fbo.framebuffer)||l||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;c(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),c(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),c(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(c(this._rsUnclassified)||(this._rsUnclassified=Ve.fromCache(upt),this._rsClassified=Ve.fromCache(fpt),this._rsDefault=Ve.fromCache(dpt)),!c(this._unclassifiedCommand)||o||r){c(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=c(this._previousFramebuffer)?mpt:hpt,f=new He({defines:["UNCLASSIFIED"],sources:[u]}),h=new He({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:c(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(h,{renderState:c(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),c(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),c(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(su,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};cp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};cp.prototype.clear=function(e,t){c(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};cp.prototype.executeClassified=function(e,t){if(!c(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)};cp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};cp.prototype.isDestroyed=function(){return!1};cp.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),c(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),de(this)};var ww=cp;function nG(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(nG.prototype,{total:{get:function(){return this._total}}});function R0(e){if(c(e)&&e.length!==pa.NUMBER_OF_JOB_TYPES)throw new E("A budget must be specified for each job type; budgets.length should equal JobType.NUMBER_OF_JOB_TYPES.");let t=new Array(pa.NUMBER_OF_JOB_TYPES);t[pa.TEXTURE]=new nG(c(e)?e[pa.TEXTURE]:10),t[pa.PROGRAM]=new nG(c(e)?e[pa.PROGRAM]:10),t[pa.BUFFER]=new nG(c(e)?e[pa.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}R0.getTimestamp=Ti;Object.defineProperties(R0.prototype,{totalBudget:{get:function(){return this._totalBudget}}});R0.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};R0.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};R0.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 l=n.length,u;for(u=0;u<l&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===l&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=R0.getTimestamp();e.execute();let a=R0.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var dB=R0;function iG(e){e=e??W.EMPTY_OBJECT;let t=In(e.container);if(!c(t))throw new E("container is required");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=Ti(),this._lastMsSampleTime=Ti(),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(iG.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});iG.prototype.update=function(e){let t=Ti(),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}};iG.prototype.destroy=function(){return de(this)};var yg=iG;var wa={};wa.decodeRawMetadataValue=function(e,t,n){switch(e){case Nt.INT8:return t.getInt8(n);case Nt.UINT8:return t.getUint8(n);case Nt.INT16:return t.getInt16(n,!0);case Nt.UINT16:return t.getUint16(n,!0);case Nt.INT32:return t.getInt32(n,!0);case Nt.UINT32:return t.getUint32(n,!0);case Nt.INT64:return t.getBigInt64(n,!0);case Nt.UINT64:return t.getBigUint64(n,!0);case Nt.FLOAT32:return t.getFloat32(n,!0);case Nt.FLOAT64:return t.getFloat64(n,!0)}throw new ae(`Invalid component type: ${e}`)};wa.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=wa.decodeRawMetadataValue(i,t,n);return e.normalized?Nt.normalize(o,i):o};wa.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Nt.getSizeInBytes(i),r=e.type,s=at.getComponentCount(r),a=o*s;if(s>1){let f=Array(s);for(let h=0;h<s;h++){let p=n*a+h*o,g=wa.decodeRawMetadataValueComponent(e,t,p);f[h]=g}return f}let l=n*a;return wa.decodeRawMetadataValueComponent(e,t,l)};wa.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 s=0;s<o;s++){let a=wa.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return wa.decodeRawMetadataValueElement(e,n,0)};wa.convertToObjectType=function(e,t){if(!c(t)||e===at.SCALAR||e===at.STRING||e===at.BOOLEAN||e===at.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case at.VEC2:return H.unpack(n,0,new H);case at.VEC3:return d.unpack(n,0,new d);case at.VEC4:return se.unpack(n,0,new se);case at.MAT2:return Ri.unpack(n,0,new Ri);case at.MAT3:return J.unpack(n,0,new J);case at.MAT4:return B.unpack(n,0,new B)}throw new ae(`Invalid metadata object type: ${e}`)};wa.convertFromObjectType=function(e,t){if(!c(t)||e===at.SCALAR||e===at.STRING||e===at.BOOLEAN||e===at.ENUM)return t;switch(e){case at.VEC2:return H.pack(t,Array(2));case at.VEC3:return d.pack(t,Array(3));case at.VEC4:return se.pack(t,Array(4));case at.MAT2:return Ri.pack(t,Array(4));case at.MAT3:return J.pack(t,Array(9));case at.MAT4:return B.pack(t,Array(16))}throw new ae(`Invalid metadata object type: ${e}`)};wa.decodeMetadataValues=function(e,t,n){let i=wa.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=wa.convertFromObjectType(e.type,t.offset),s=wa.convertFromObjectType(e.type,t.scale);i=Tm.valueTransformInPlace(i,r,s,Nt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let l=i[a],u=wa.convertToObjectType(e.type,l);s[a]=u}return s}return wa.convertToObjectType(e.type,i)};var hB=Object.freeze(wa);function $T(){this._framebuffer=new hi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties($T.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function ppt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function _pt(e,t,n){c(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}$T.prototype.update=function(e,t){ppt(this,e,t),_pt(this,e,t)};var gpt=new se,ypt=new se(1,1/255,1/65025,1/16581375);$T.prototype.getDepth=function(e,t,n){if(!c(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=se.unpack(i,0,gpt);return se.divideByScalar(o,255,o),se.dot(o,ypt)};$T.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};$T.prototype.isDestroyed=function(){return!1};$T.prototype.destroy=function(){return this._framebuffer.destroy(),c(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=c(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),de(this)};var mB=$T;function bpt(e,t){this.near=e??0,this.far=t??0;let n=De.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 pB=bpt;var M0=`uniform highp sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } `;function lp(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new hi,this._tempCopyDepthFramebuffer=new hi,this._updateDepthFramebuffer=new hi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(lp.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 Jxe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!Ke.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),a=!0),(!c(e._rs)||!Ke.equals(r,e._rs.viewport)||a)&&(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:ln.ALPHA_BLEND}),e._rsUpdate=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.NEVER,reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})),c(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(M0,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,c(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(su,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,c(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(M0,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,c(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(su,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,c(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ei({color:new G(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}lp.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,l=o?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,l),this._copyDepthFramebuffer.update(e,s,a),Jxe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};lp.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};lp.prototype.executeCopyDepth=function(e,t){c(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};lp.prototype.executeUpdateDepth=function(e,t,n){let i=c(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){c(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!c(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!c(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),Jxe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};lp.prototype.executeCopyColor=function(e,t){c(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};lp.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;c(i)&&(G.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};lp.prototype.isDestroyed=function(){return!1};lp.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),c(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),c(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),c(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),c(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),de(this)};var _B=lp;function ZT(){this._framebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new hi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Ke,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(ZT.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 xpt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Tpt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function Apt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Ke.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),s=!0),(!c(e._renderState)||!Ke.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),c(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(M0,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),c(e._clearCommand)||(e._clearCommand=new ei({color:new G(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}ZT.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Tpt(this,n,o,r,e),Apt(this,n,o,r,i),this._useHdr=e};ZT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};ZT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};ZT.prototype.isDestroyed=function(){return!1};ZT.prototype.destroy=function(){return xpt(this),de(this)};var gB=ZT;function bg(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new hi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new hi({createColorAttachments:!1}),this._opaqueClearCommand=new ei({color:new G(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ei({color:new G(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ei({color:new G(0,0,0,0),owner:this}),this._alphaClearCommand=new ei({color:new G(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function eTe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function OK(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function tTe(e){eTe(e),OK(e)}function Cpt(e,t,n,i){eTe(e),e._accumulationTexture=new Rt({context:t,width:n,height:i,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT}),e._revealageTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,width:n,height:i,flipY:!1})}function Ept(e,t){OK(e);let n=ne.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(OK(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,l=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!l||!u)&&(tTe(e),e._translucentMultipassSupport=!1,i=!1)}return i}bg.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,l=!c(a)||a.width!==r||a.height!==s||i!==this._useHDR,u=this._numSamples!==o;if((l||u)&&(this._numSamples=o,Cpt(this,e,r,s)),(!c(this._translucentFBO.framebuffer)||l||u)&&!Ept(this,e))return;this._useHDR=i;let f=this,h,p;c(this._compositeCommand)||(h=new He({sources:[JF]}),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})),c(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new He({defines:["MRT"],sources:[JS]}),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 He({sources:[JS]}),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=s;let g=!Ke.equals(this._viewport,t.viewport),m=g!==this._useScissorTest;this._useScissorTest=g,Ke.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Ke.clone(t.viewport,this._scissorRectangle),m=!0),(!c(this._rs)||!Ke.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ve.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),c(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),c(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var Spt={enabled:!0,color:new G(0,0,0,0),equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Eo.ONE,functionDestinationRgb:Eo.ONE,functionSourceAlpha:Eo.ZERO,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA},wpt={enabled:!0,color:new G(0,0,0,0),equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Eo.ONE,functionDestinationRgb:Eo.ONE,functionSourceAlpha:Eo.ONE,functionDestinationAlpha:Eo.ONE},vpt={enabled:!0,color:new G(0,0,0,0),equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Eo.ZERO,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Eo.ZERO,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA};function RK(e,t,n,i){let o=n[i.id];if(!c(o)){let r=Ve.getState(i);r.depthMask=!1,r.blending=t,o=Ve.fromCache(r),n[i.id]=o}return o}function Dpt(e,t,n){return RK(t,Spt,e._translucentRenderStateCache,n)}function Ppt(e,t,n){return RK(t,wpt,e._translucentRenderStateCache,n)}function Ipt(e,t,n){return RK(t,vpt,e._alphaRenderStateCache,n)}var Opt=` 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); `,Rpt=` 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; `,Mpt=` float ai = czm_out_FragColor.a; out_FragColor = vec4(ai); `;function MK(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(c(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return He.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")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; bool czm_discard = false; `);let l=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<l.length;f++){let h=l[f];u=`layout (location = ${h[1]}) out vec4 ${h[0]}; ${u}`}return a.sources.push(u),a.sources.push(`void main() { czm_translucent_main(); if (czm_discard) { discard; } ${i}} `),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function Lpt(e,t){return MK(e,t,"translucentMRT",Opt)}function Npt(e,t){return MK(e,t,"translucentMultipass",Rpt)}function Fpt(e,t){return MK(e,t,"alphaMultipass",Mpt)}bg.prototype.createDerivedCommands=function(e,t,n){if(c(n)||(n={}),this._translucentMRTSupport){let a,l;return c(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,l=n.translucentCommand.renderState),n.translucentCommand=Qe.shallowClone(e,n.translucentCommand),!c(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Lpt(t,e.shaderProgram),n.translucentCommand.renderState=Dpt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=l),n}let i,o,r,s;return c(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=Qe.shallowClone(e,n.translucentCommand),n.alphaCommand=Qe.shallowClone(e,n.alphaCommand),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Npt(t,e.shaderProgram),n.translucentCommand.renderState=Ppt(this,t,e.renderState),n.alphaCommand.shaderProgram=Fpt(t,e.shaderProgram),n.alphaCommand.renderState=Ipt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function Bpt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:l,shadowState:u}=a,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=l?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(b,t,i,g)}if(c(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=l?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(b,t,i,g)}if(c(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(y,t,i,g)}i.framebuffer=h}function kpt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:l,shadowState:u}=a,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=l?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(b,t,i,g)}if(c(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=h}bg.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){kpt(this,e,t,n,i,o);return}Bpt(this,e,t,n,i,o)};bg.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};bg.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,G.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};bg.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};bg.prototype.isDestroyed=function(){return!1};bg.prototype.destroy=function(){return tTe(this),c(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),c(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),c(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),de(this)};var yB=bg;function bB(){this._framebuffer=new hi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(bB.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Upt(e){e._framebuffer.destroy()}function Vpt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new lc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Ke},o.viewport=new Ke,e._passState=o}bB.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&Vpt(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};bB.prototype.isDestroyed=function(){return!1};bB.prototype.destroy=function(){return Upt(this),de(this)};var xB=bB;function vw(e){let t=new lc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Ke},t.viewport=new Ke,this._context=e,this._fb=new hi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}vw.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return Ke.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var TB=new G;vw.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),l=Math.floor(n*.5),u=0,f=0,h=0,p=-1;for(let g=0;g<s;++g){if(-a<=u&&u<=a&&-l<=f&&f<=l){let m=4*((l-f)*t+u+a);TB.red=G.byteToFloat(o[m]),TB.green=G.byteToFloat(o[m+1]),TB.blue=G.byteToFloat(o[m+2]),TB.alpha=G.byteToFloat(o[m+3]);let y=i.getObjectByPickColor(TB);if(c(y))return y}if(u===f||u<0&&-u===f||u>0&&u===1-f){let m=h;h=-p,p=m}u+=h,f+=p}};vw.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),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};vw.prototype.isDestroyed=function(){return!1};vw.prototype.destroy=function(){return this._fb.destroy(),de(this)};var AB=vw;function xg(){this._numSamples=1,this._colorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new G(0,0,0,0),this._clearCommand=new ei({color:new G(0,0,0,0),depth:1,owner:this})}function zpt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(xg.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});xg.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};xg.prototype.clear=function(e,t,n){G.clone(n,this._clearCommand.color),G.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};xg.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};xg.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};xg.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};xg.prototype.isDestroyed=function(){return!1};xg.prototype.destroy=function(){return zpt(this),de(this)};var QT=xg;function JT(){}JT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};JT.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=He.findPositionVarying(e),s=c(r);if(t&&!s){let a=o.length;for(let u=0;u<a;++u)o[u]=He.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 He({defines:i,sources:o})};JT.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=He.findPositionVarying(e),a=c(s);a||(s="v_positionEC");let l=r.length;for(let f=0;f<l;++f)r[f]=He.replaceMain(r[f],"czm_shadow_cast_main");let u="";return t&&(a||(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(${s}); 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 He({defines:o,sources:r})};JT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,l=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${l}${u}${f}${t}${n}${i}`};JT.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 He({defines:i,sources:o})};JT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=He.findNormalVarying(e),s=!i&&c(r)||i&&o,a=He.findPositionVarying(e),l=c(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,h=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,m=t.debugCascadeColors,y=t.softShadows,b=h?t._pointBias:i?t._terrainBias:t._primitiveBias,x=e.defines.slice(0),A=e.sources.slice(0),C=A.length;for(let P=0;P<C;++P)A[P]=He.replaceMain(A[P],"czm_shadow_receive_main");h?x.push("USE_CUBE_MAP_SHADOW"):u&&x.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!h&&x.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?x.push("ENABLE_VERTEX_LIGHTING"):x.push("ENABLE_DAYNIGHT_SHADING")),n&&b.normalShading&&s&&(x.push("USE_NORMAL_SHADING"),b.normalShadingSmooth>0&&x.push("USE_NORMAL_SHADING_SMOOTH"));let S="";h?S+=`uniform samplerCube shadowMap_textureCube; `:S+=`uniform sampler2D shadowMap_texture; `;let v;return l?v=` return vec4(${a}, 1.0); `:v=`#ifndef LOG_DEPTH return czm_windowToEyeCoordinates(gl_FragCoord); #else return vec4(v_logPositionEC, 1.0); #endif `,S+=`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() { ${v}} vec3 getNormalEC() { ${s?` return normalize(${r}); `:` return vec3(1.0); `}} void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) { ${b.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; float normalOffsetScale = 1.0 - nDotL; vec3 offset = normalOffset * normalOffsetScale * normalEC; positionEC.xyz += offset; `:""}} `,S+=`void main() { czm_shadow_receive_main(); vec4 positionEC = getPositionEC(); vec3 normalEC = getNormalEC(); float depth = -positionEC.z; `,S+=` czm_shadowParameters shadowParameters; shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; `,i?S+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); `:f||(S+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); `),h?S+=` 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?S+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); applyNormalOffset(positionEC, normalEC, nDotL); vec4 shadowPosition = shadowMap_matrix * positionEC; // Spot light uses a perspective projection, so perform the perspective divide shadowPosition /= shadowPosition.w; // Stop early if the fragment is not in the shadow bounds if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) { return; } shadowParameters.texCoords = shadowPosition.xy; shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `:g?S+=` 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); `:""}`:S+=` 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); `,S+=` out_FragColor.rgb *= visibility; } `,A.push(S),new He({defines:x,sources:A})};var up=JT;function fp(e){e=e??W.EMPTY_OBJECT;let t=e.context;if(!c(t))throw new E("context is required.");if(!c(e.lightCamera))throw new E("lightCamera is required.");if(c(e.numberOfCascades)&&e.numberOfCascades!==1&&e.numberOfCascades!==4)throw new E("Only one or four cascades are supported.");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;(Vt.isInternetExplorer()||Vt.isEdge()||(Vt.isChrome()||Vt.isFirefox())&&Vt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new B,this._shadowMapTexture=void 0,this._lightDirectionEC=new d,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new oG,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 H,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new jo:c(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new B,new B,new B,new B],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new Hpt(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,NK(this),this._clearCommand=new ei({depth:1,color:new G}),this._clearPassState=new lc(t),this._size=e.size??2048,this.size=this._size}fp.MAXIMUM_DISTANCE=2e4;function Hpt(e){this.camera=new oG,this.passState=new lc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function LK(e,t){return Ve.fromCache({cull:{enabled:!0,face:xi.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 NK(e){let t=!e._usesDepthTexture;e._primitiveRenderState=LK(t,e._primitiveBias),e._terrainRenderState=LK(t,e._terrainBias),e._pointRenderState=LK(t,e._pointBias)}fp.prototype.debugCreateRenderStates=function(){NK(this)};Object.defineProperties(fp.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){Xpt(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 FK(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;c(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Gpt(e,t){let n=new _u({context:t,width:e._textureSize.x,height:e._textureSize.y,format:uc.DEPTH_COMPONENT16}),i=new Rt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Qt.NEAREST}),o=new Ur({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function jpt(e,t){let n=new Rt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Qt.NEAREST}),i=new Ur({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function Wpt(e,t){let n=new _u({context:t,width:e._textureSize.x,height:e._textureSize.y,format:uc.DEPTH_COMPONENT16}),i=new Go({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Qt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Ur({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function oTe(e,t){e._isPointLight?Wpt(e,t):e._usesDepthTexture?jpt(e,t):Gpt(e,t)}function qpt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ne.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,NK(e),FK(e),oTe(e,t))}function Ypt(e,t){(!c(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(FK(e),oTe(e,t),qpt(e,t),rTe(e,t))}function rTe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Xpt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=ut.maximumCubeMapSize>=t?t:ut.maximumCubeMapSize,o.x=t,o.y=t;let r=new Ke(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=ut.maximumTextureSize>=t?t:ut.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Ke(0,0,t,t)):i===4&&(t=ut.maximumTextureSize>=t*2?t:ut.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new Ke(0,0,t,t),n[1].passState.viewport=new Ke(t,0,t,t),n[2].passState.viewport=new Ke(0,t,t,t),n[3].passState.viewport=new Ke(t,t,t,t));e._clearPassState.viewport=new Ke(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,l=a.x/o.x,u=a.y/o.y,f=a.width/o.x,h=a.height/o.y;s.textureOffsets=new B(f,0,0,l,0,h,0,u,0,0,1,0,0,0,0,1)}}var Kpt=new Ke;function $pt(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=De.OVERLAY,i}function Zpt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Kpt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;c(a)||(a=$pt(e,n),e._debugShadowViewCommand=a),(!c(a.renderState)||!Ke.equals(a.renderState.viewport,s))&&(a.renderState=Ve.fromCache({viewport:Ke.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var dp=new Array(8);dp[0]=new se(-1,-1,-1,1);dp[1]=new se(1,-1,-1,1);dp[2]=new se(1,1,-1,1);dp[3]=new se(-1,1,-1,1);dp[4]=new se(-1,-1,1,1);dp[5]=new se(1,-1,1,1);dp[6]=new se(1,1,1,1);dp[7]=new se(-1,1,1,1);var L0=new B,BK=new Array(8);for(let e=0;e<8;++e)BK[e]=new se;function Qpt(e,t){let n=new St({geometry:new Ud({minimum:new d(-.5,-.5,-.5),maximum:new d(.5,.5,.5)}),attributes:{color:Gt.fromColor(t)}}),i=new St({geometry:new M_({radius:.5}),attributes:{color:Gt.fromColor(t)}});return new Pn({geometryInstances:[n,i],appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Jpt=[G.RED,G.GREEN,G.BLUE,G.MAGENTA],e_t=new d;function t_t(e,t){Zpt(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 sp({camera:e._sceneCamera,color:G.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new sp({camera:e._shadowMapCamera,color:G.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 sp({camera:e._passes[i].camera,color:Jpt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!c(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Le.IDENTITY,r=e._pointLightRadius*2,s=d.fromElements(r,r,r,e_t),a=B.fromTranslationQuaternionRotationScale(i,o,s,L0);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Qpt(a,G.YELLOW)}e._debugLightFrustum.update(t)}else(!c(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new sp({camera:e._shadowMapCamera,color:G.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function oG(){this.viewMatrix=new B,this.inverseViewMatrix=new B,this.frustum=void 0,this.positionCartographic=new he,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 B}oG.prototype.clone=function(e){B.clone(e.viewMatrix,this.viewMatrix),B.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.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 n_t=new B(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);oG.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return B.multiply(t,e,this.viewProjectionMatrix),B.multiply(n_t,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var i_t=new Array(5),o_t=new Ci,r_t=new Array(4),sTe=new d,aTe=new d;function s_t(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,l=r-o,u=r/o,f=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,f=.9);let p=r_t,g=i_t;for(g[0]=o,g[s]=r,a=0;a<s;++a){let F=(a+1)/s,_=o*Math.pow(u,F),w=o+l*F,D=O.lerp(w,_,f);g[a+1]=D,p[a]=D-g[a]}if(h){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let F=g[0];for(a=0;a<s-1;++a)F+=p[a],g[a+1]=F}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let m=n.frustum,y=m.left,b=m.right,x=m.bottom,A=m.top,C=m.near,S=m.far,v=n.positionWC,P=n.directionWC,M=n.upWC,R=i.frustum.clone(o_t),L=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let F=B.multiply(R.projectionMatrix,i.viewMatrix,L0),_=B.inverse(F,L0),w=B.multiply(L,_,L0),D=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,sTe),I=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,aTe);for(let j=0;j<8;++j){let U=se.clone(dp[j],BK[j]);B.multiplyByVector(w,U,U),d.divideByScalar(U,U.w,U),d.minimumByComponent(U,D,D),d.maximumByComponent(U,I,I)}D.x=Math.max(D.x,0),D.y=Math.max(D.y,0),D.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let N=e._passes[a],k=N.camera;k.clone(n);let z=k.frustum;z.left=y+D.x*(b-y),z.right=y+I.x*(b-y),z.bottom=x+D.y*(A-x),z.top=x+I.y*(A-x),z.near=C+D.z*(S-C),z.far=C+I.z*(S-C),N.cullingVolume=k.frustum.computeCullingVolume(v,P,M);let V=e._cascadeMatrices[a];B.multiply(k.getViewProjection(),i.inverseViewMatrix,V),B.multiply(N.textureOffsets,V,V)}}var a_t=new B,c_t=new d,l_t=new d,nTe=new d;function u_t(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=B.multiply(i.frustum.projectionMatrix,i.viewMatrix,L0),r=B.inverse(o,L0),s=n.directionWC,a=i.directionWC;d.equalsEpsilon(s,a,O.EPSILON10)&&(a=i.upWC);let l=d.cross(s,a,c_t);a=d.cross(l,s,l_t),d.normalize(a,a),d.normalize(l,l);let u=d.fromElements(0,0,0,nTe),f=B.computeView(u,s,a,l,a_t),h=B.multiply(f,r,L0),p=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,sTe),g=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,aTe);for(let S=0;S<8;++S){let v=se.clone(dp[S],BK[S]);B.multiplyByVector(h,v,v),d.divideByScalar(v,v.w,v),d.minimumByComponent(v,p,p),d.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let m=nTe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=B.fromTranslation(m,L0);f=B.multiply(y,f,f);let b=.5*(g.x-p.x),x=.5*(g.y-p.y),A=g.z-p.z,C=n.frustum;C.left=-b,C.right=b,C.bottom=-x,C.top=x,C.near=.01,C.far=A,B.clone(f,n.viewMatrix),B.inverse(f,n.inverseViewMatrix),B.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),d.clone(s,n.directionWC),d.clone(a,n.upWC),d.clone(l,n.rightWC)}var f_t=[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)],d_t=[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)],h_t=[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 m_t(e,t){let n=new Ci;n.fov=O.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=f_t[i],o.upWC=d_t[i],o.rightWC=h_t[i],B.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),B.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var p_t=new d,__t=new d,cTe=new le,iTe=cTe.center;function g_t(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=cTe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,p_t),s=d.negate(i.directionWC,__t),a=d.dot(r,s);if(e.fadingEnabled){let l=O.clamp(a/.1,0,1);e._darkness=O.lerp(1,e.darkness,l)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===Wt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=d.add(i.positionWC,d.multiplyByScalar(i.directionWC,r,iTe),iTe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Wt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere)}}function y_t(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 s=e._lightDirectionEC;B.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),d.normalize(s,s),d.negate(s,s),B.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,l;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),l=Math.min(t.shadowState.farPlane,e.maximumDistance),l=Math.max(l,a+1)):(a=n.frustum.near,l=e.maximumDistance),e._sceneCamera=ro.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=l,e._distance=l-a,g_t(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}fp.prototype.update=function(e){if(y_t(this,e),this._needsUpdate)if(Ypt(this,e.context),this._isPointLight&&m_t(this,e),this._cascadesEnabled&&(u_t(this,e),this._numberOfCascades>1&&s_t(this,e)),this._isPointLight)this._shadowMapCullingVolume=_s.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;B.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&t_t(this,e)};fp.prototype.updatePass=function(e,t){rTe(this,e,t)};var b_t=new H;function lTe(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=b_t;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,se.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return xt(t,o,!1)}function x_t(e,t,n,i,o,r){let s,a,l;if(c(r)&&(s=r.shaderProgram,a=r.renderState,l=r.uniformMap),r=Qe.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!c(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===De.GLOBE,h=n.pass!==De.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=up.getShadowCastShaderKeyword(p,f,g,h);if(s=i.shaderCache.getDerivedShaderProgram(u,m),!c(s)){let b=u.vertexShaderSource,x=u.fragmentShaderSource,A=up.createShadowCastVertexShader(b,p,f),C=up.createShadowCastFragmentShader(x,p,g,h);s=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:A,fragmentShaderSource:C,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=je(a,!1),a.cull=je(a.cull,!1),a.cull.enabled=!1,a=Ve.fromCache(a)),l=lTe(e,n.uniformMap,f)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=l,r}fp.createReceiveDerivedCommand=function(e,t,n,i,o){c(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,l=s.fragmentShaderSource,u=t.pass===De.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,p;c(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=Qe.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,m=o.receiveShaderProgramId!==t.shaderProgram.id;if(!c(h)||m||n||g){let y=up.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(h=i.shaderCache.getDerivedShaderProgram(s,y),!c(h)){let b=up.createShadowReceiveVertexShader(a,u,f),x=up.createShadowReceiveFragmentShader(l,e[0],t.castShadows,u,f);h=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:s._attributeLocations})}p=lTe(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};fp.createCastDerivedCommand=function(e,t,n,i,o){if(c(o)||(o={}),t.castShadows){let r=o.castCommands;c(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let l=0;l<a;++l)r[l]=x_t(e[l],n,t,i,s,r[l]);o.castShaderProgramId=t.shaderProgram.id}return o};fp.prototype.isDestroyed=function(){return!1};fp.prototype.destroy=function(){FK(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 de(this)};var Tg=fp;var eA=`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 color.rgb /= color.a; #endif out_FragColor = color; #endif } `;var T_t=!1;function N0(e){this._drawClassificationFBO=new hi({createDepthAttachments:!1}),this._accumulationFBO=new hi({createDepthAttachments:!1}),this._packFBO=new hi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ei({color:new G(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ei({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Ke,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(N0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function uTe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function fTe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function A_t(e,t,n,i){uTe(e),e._translucentDepthStencilTexture=new Rt({context:t,width:n,height:i,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Qt.NEAREST})}function C_t(e,t,n,i){fTe(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 E_t(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)&&(A_t(e,t,o,r),C_t(e,t,o,r));let s,a;if(c(e._packDepthCommand)||(s=new He({sources:[QF]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!c(e._compositeCommand)){s=new He({sources:[eA]}),a={colorTexture:function(){return e._textureToComposite}},T_t&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,h=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new He({sources:s.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),g=Qe.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}c(e._copyCommand)||(s=new He({sources:[eA]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),c(e._accumulateCommand)||(s=new He({sources:[eA]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let l=!Ke.equals(e._viewport,n.viewport),u=l!==e._useScissorTest;e._useScissorTest=l,Ke.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Ke.clone(n.viewport,e._scissorRectangle),u=!0),(!c(e._rsDepth)||!Ke.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),c(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!c(e._rsAccumulate)||!Ke.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:Vn.EQUAL,reference:kt.CESIUM_3D_TILE_MASK}})),c(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!c(e._rsComp)||!Ke.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:ln.ALPHA_BLEND})),c(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}N0.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let l=0;l<i.length;++l){let u=i[l];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){E_t(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let l=0;l<i.length;++l){let u=i[l];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(s,n)),n.framebuffer=a}};N0.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=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(De.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let l=i.commands[De.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[De.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(l[f],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};N0.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),S_t(this,e,t)};function S_t(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}N0.prototype.isSupported=function(){return this._supported};N0.prototype.isDestroyed=function(){return!1};N0.prototype.destroy=function(){return uTe(this),fTe(this),c(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),c(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),de(this)};var CB=N0;function w_t(){this.command=void 0,this.near=void 0,this.far=void 0}function rG(e,t,n){let i=e.context,o;i.depthTexture&&(o=new _B);let r;e._useOIT&&i.depthTexture&&(r=new yB(i));let s=new lc(i);s.viewport=Ke.clone(n),this.camera=t,this._cameraClone=ro.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new AB(i),this.pickDepthFramebuffer=new xB,this.sceneFramebuffer=new QT,this.globeDepth=o,this.globeTranslucencyFramebuffer=new gB,this.oit=r,this.translucentTileClassification=new CB(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var kK=new d,UK=new d;function v_t(e,t,n){let i=Math.max(d.maximumComponent(d.abs(e.position,kK)),d.maximumComponent(d.abs(t.position,UK))),o=1/Math.max(1,i);return d.multiplyByScalar(e.position,o,kK),d.multiplyByScalar(t.position,o,UK),d.equalsEpsilon(kK,UK,n)&&d.equalsEpsilon(e.direction,t.direction,n)&&d.equalsEpsilon(e.up,t.up,n)&&d.equalsEpsilon(e.right,t.right,n)&&B.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}rG.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return v_t(t,n,O.EPSILON15)?(this._cameraStartFired&&Ti()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ti(),ro.clone(t,n),!0)};function D_t(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,l=t.mode===oe.SCENE2D,u=t.nearToFarDistance2D;i*=1+O.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let f;l?(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(a));let{frustumCommandsList:h}=e;h.length=f;for(let p=0;p<f;++p){let g,m;l?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*g));let y=h[p];c(y)?(y.near=g,y.far=m):y=h[p]=new pB(g,m)}}function P_t(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let l=s[a];if(o>l.far)continue;if(r<l.near)break;let u=i.pass,f=l.indices[u]++;if(l.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:l}=i,u=a.commandsInFrustums;u[l]=c(u[l])?u[l]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var dTe=new _s,I_t=new Ma;rG.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,l=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let L=0;L<f.length;++L)for(let F=0;F<De.NUMBER_OF_PASSES;++F)f[L].indices[F]=0;l.length=0,u.length=0;let h=this._commandExtents,p=h.length,g=0,m=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:b}=o,x=+Number.MAX_VALUE,A=-Number.MAX_VALUE,C=Number.MAX_VALUE,S=t.mode===oe.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,P=dTe.planes;for(let L=0;L<5;++L)P[L]=v.planes[L];v=dTe;for(let L=0;L<i.length;++L){let F=i[L],{pass:_,boundingVolume:w}=F;if(_===De.COMPUTE)l.push(F);else if(_===De.OVERLAY)u.push(F);else{let D,I;if(c(w)){if(!e.isVisible(v,F,S))continue;let k=w.computePlaneDistances(r,s,I_t);if(D=k.start,I=k.stop,m=Math.min(m,D),y=Math.max(y,I),b&&F.receiveShadows&&D<Tg.MAXIMUM_DISTANCE&&!(_===De.GLOBE&&D<-100&&I>100)){let z=I-D;_!==De.GLOBE&&D<100&&(C=Math.min(C,z)),x=Math.min(x,D),A=Math.max(A,I)}}else F instanceof ei?(D=a.near,I=a.far):(D=a.near,I=a.far,m=Math.min(m,D),y=Math.max(y,I));let N=h[g];c(N)||(N=h[g]=new w_t),N.command=F,N.near=D,N.far=I,g++}}b&&(x=Math.min(Math.max(x,a.near),a.far),A=Math.max(Math.min(A,a.far),x),o.nearPlane=x,o.farPlane=A,o.closestObjectSize=C),D_t(this,e,m,y);for(let L=0;L<g;L++)P_t(this,e,h[L]);if(g<p)for(let L=g;L<p;L++){let F=h[L];if(!c(F.command))break;F.command=void 0}let M=f.length,{frustumSplits:R}=t;R.length=M+1;for(let L=0;L<M;++L)R[L]=f[L].near,L===M-1&&(R[L+1]=f[L].far)};rG.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var tA=rG;var mTe=.1,O_t=new gd({pass:Uo.MOST_DETAILED_PRELOAD}),R_t=new gd({pass:Uo.MOST_DETAILED_PICK}),EB=new gd({pass:Uo.PICK});function oa(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Ke(0,0,1,1),n=new ro(e);n.frustum=new on({width:mTe,aspectRatio:1,near:.1}),this._pickOffscreenView=new tA(e,n,t)}oa.prototype.update=function(){this._pickPositionCacheDirty=!0};oa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return c(i)||(i=new mB,n[t]=i),i};var M_t=new jo,L_t=new d,sG=new d,N_t=new H,F_t=new B;function B_t(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;c(a)&&(s=a);let l=2*(t.x-o.x)/o.width-1;l*=(s.right-s.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let f=B.clone(r.transform,F_t);r._setTransform(B.IDENTITY);let h=d.clone(r.position,L_t);d.multiplyByScalar(r.right,l,sG),d.add(sG,h,h),d.multiplyByScalar(r.up,u,sG),d.add(sG,h,h),r._setTransform(f),e.mode===oe.SCENE2D&&d.fromElements(h.z,h.x,h.y,h);let p=s.getPixelDimensions(o.width,o.height,1,1,N_t),g=M_t;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(h,r.directionWC,r.upWC)}var k_t=new bl,U_t=new H;function V_t(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,l=Math.tan(s.fovy*.5),u=s.aspectRatio*l,f=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,p=f*a*u,g=h*a*l,m=s.getPixelDimensions(o.width,o.height,1,1,U_t),y=m.x*n*.5,b=m.y*i*.5,x=k_t;return x.top=g+b,x.bottom=g-b,x.right=p+y,x.left=p-y,x.near=a,x.far=s.far,x.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function aG(e,t,n,i,o){let r=e.camera.frustum;return r instanceof on||r instanceof jo?B_t(e,t,n,i,o):V_t(e,t,n,i,o)}var cG=new Ke(0,0,3,3),lG=new H,SB=new G(0,0,0,0);function VK(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}oa.prototype.pick=function(e,t,n,i){T.defined("windowPosition",t);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:l}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=Ke.clone(a,u.viewport);let f=Gi.transformWindowToDrawingBuffer(e,t,lG),h=VK(o.drawingBufferHeight,f,n,i,cG);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=aG(e,f,h.width,h.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=EB,o.uniformState.update(r),e.updateEnvironment(),u=l.begin(h,a),e.updateAndExecuteCommands(u,SB),e.resolveFramebuffers(u);let p=l.end(h);return o.endFrame(),p};oa.prototype.pickVoxelCoordinate=function(e,t,n,i){T.defined("windowPosition",t);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:l}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=Ke.clone(a,u.viewport);let f=Gi.transformWindowToDrawingBuffer(e,t,lG),h=VK(o.drawingBufferHeight,f,n,i,cG);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=aG(e,f,h.width,h.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=EB,o.uniformState.update(r),e.updateEnvironment(),u=l.begin(h,a),e.updateAndExecuteCommands(u,SB),e.resolveFramebuffers(u);let p=l.readCenterPixel(h);return o.endFrame(),p};oa.prototype.pickMetadata=function(e,t,n){T.typeOf.object("windowPosition",t),T.typeOf.object("pickedMetadataInfo",n);let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let l=r.passState;l.viewport=Ke.clone(s,l.viewport);let u=Gi.transformWindowToDrawingBuffer(e,t,lG),f=VK(i.drawingBufferHeight,u,1,1,cG);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=aG(e,u,f.width,f.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=EB,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),l=a.begin(f,s),e.updateAndExecuteCommands(l,SB);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(l),e._environmentState.useOIT=h;let p=a.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,hB.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function z_t(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let l=n.passState;l.viewport=Ke.clone(s,l.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=aG(e,t,1,1,s),o.tilesetPassState=EB,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,l=a.update(i,t,s),e.updateAndExecuteCommands(l,SB),e.resolveFramebuffers(l),i.endFrame()}var H_t=new Ci,G_t=new bl,j_t=new on,W_t=new jo;oa.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;if(T.defined("windowPosition",t),!e.context.depthTexture)throw new E("Picking from the depth buffer is not supported. Check pickPositionSupported.");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:s,defaultView:a}=e,{uniformState:l}=o;e.view=a;let u=Gi.transformWindowToDrawingBuffer(e,t,lG);e.pickTranslucentDepth?z_t(e,u):(e.updateFrameState(),l.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;c(s.frustum.fov)?f=s.frustum.clone(H_t):c(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(G_t):c(s.frustum.width)?f=s.frustum.clone(j_t):f=s.frustum.clone(W_t);let{frustumCommandsList:h}=a,p=h.length;for(let g=0;g<p;++g){let y=this.getPickDepth(e,g).getDepth(o,u.x,u.y);if(c(y)&&y>0&&y<1){let b=h[g],x;return e.mode===oe.SCENE2D?(x=s.position.z,s.position.z=x-b.near+1,f.far=Math.max(1,b.far-b.near),f.near=1,l.update(r),l.updateFrustum(f)):(f.near=b.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=b.far,l.updateFrustum(f)),n=Gi.drawingBufferToWorldCoordinates(e,u,y,n),e.mode===oe.SCENE2D&&(s.position.z=x,l.update(r)),this._pickPositionCache[i]=d.clone(n),n}}this._pickPositionCache[i]=void 0};var q_t=new he;oa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),c(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,q_t);o.cartographicToCartesian(r,n)}return n};function pTe(e,t){let n,i,o=[],r=[],s=[],a=[];c(e)||(e=Number.MAX_VALUE);let l=t();for(;c(l);){let u=l.object,f=l.position,h=l.exclude;if(c(f)&&!c(u)){o.push(l);break}if(!c(u)||!c(u.primitive)||!h&&(o.push(l),0>=--e))break;let p=u.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&c(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),c(i)&&c(i.show)&&(g=!0,i.show=bn.toValue(!1,i.show),s.push(i))),u instanceof Ws&&(g=!0,u.show=!1,a.push(u)),g||(p.show=!1,r.push(p)),l=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=bn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}oa.prototype.drillPick=function(e,t,n,i,o){let r=this;return pTe(n,function(){let l=r.pick(e,t,i,o);if(c(l))return{object:l,position:void 0,exclude:!1}}).map(function(l){return l.object})};var hTe=new d,Y_t=new d;function X_t(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 _Te(e,t,n,i){let o=t.direction,r=d.mostOrthogonalAxis(o,hTe),s=d.cross(o,r,hTe),a=d.cross(o,s,Y_t);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??mTe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function K_t(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,l=_Te(e,o,r,a),u=O_t;u.camera=a,u.cullingVolume=l;let f=!0,h=s.length;for(let p=0;p<h;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}oa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)K_t(this,e,t[n])&&t.splice(n--,1)};function gTe(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(c(o.isCesium3DTileset)?(!c(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof fl&&gTe(o,t,n))}}function uG(e,t,n,i,o,r){let s=[];if(gTe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new X_t(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function $_t(e,t){return!c(e)||!c(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function Z_t(e,t,n,i,o,r,s){let{context:a,frameState:l}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,_Te(e,n,o,f.camera);let h=Ke.clone(f.viewport,cG),p=f.pickFramebuffer.begin(h,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),l.invertClassification=!1,l.passes.pick=!0,l.passes.offscreen=!0,s?l.tilesetPassState=R_t:l.tilesetPassState=EB,u.update(l),t.updateEnvironment(),t.updateAndExecuteCommands(p,SB),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(h);if(t.context.depthTexture){let{frustumCommandsList:y}=f,b=y.length;for(let x=0;x<b;++x){let C=e.getPickDepth(t,x).getDepth(a,0,0);if(c(C)&&C>0&&C<1){let S=y[x],v=S.near*(x!==0?t.opaqueFrustumNearOffset:1),P=S.far,M=v+C*(P-v);g=mn.getPoint(n,M);break}}}if(t.view=t.defaultView,a.endFrame(),c(m)||c(g))return{object:m,position:g,exclude:!c(g)&&r||$_t(m,i)}}function yTe(e,t,n,i,o,r,s,a){return pTe(i,function(){return Z_t(e,t,n,o,r,s,a)})}function Dw(e,t,n,i,o,r,s){let a=yTe(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function bTe(e,t,n,i,o,r,s,a){return yTe(e,t,n,i,o,r,s,a)}function fG(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)})})}oa.prototype.pickFromRay=function(e,t,n,i){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new E("Ray intersections are only supported in 3D mode.");return Dw(this,e,t,n,i,!1,!1)};oa.prototype.drillPickFromRay=function(e,t,n,i,o){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new E("Ray intersections are only supported in 3D mode.");return bTe(this,e,t,n,i,o,!1,!1)};oa.prototype.pickFromRayMostDetailed=function(e,t,n,i){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new E("Ray intersections are only supported in 3D mode.");let o=this;return t=mn.clone(t),n=c(n)?n.slice():n,fG(e,uG(o,e,t,n,i,function(){return Dw(o,e,t,n,i,!1,!0)}))};oa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new E("Ray intersections are only supported in 3D mode.");let r=this;return t=mn.clone(t),i=c(i)?i.slice():i,fG(e,uG(r,e,t,i,o,function(){return bTe(r,e,t,n,i,o,!1,!0)}))};var Q_t=new d,J_t=new d,egt=new mn,xTe=new he;function zK(e,t){let n=e.ellipsoid,i=ui._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,J_t),r=he.toCartesian(t,n,Q_t),s=egt;s.origin=r,s.direction=o;let a=new mn;return mn.getPoint(s,i,a.origin),d.negate(o,a.direction),a}function TTe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,xTe);return zK(e,i)}function ATe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,xTe).height}function tgt(e,t,n,i,o){let r=zK(t,n);return uG(e,t,r,i,o,function(){let s=Dw(e,t,r,i,o,!0,!0);if(c(s))return ATe(t,s.position)})}function ngt(e,t,n,i,o,r){let s=TTe(t,n);return uG(e,t,s,i,o,function(){let a=Dw(e,t,s,i,o,!0,!0);if(c(a))return d.clone(a.position,r)})}oa.prototype.sampleHeight=function(e,t,n,i){if(T.defined("position",t),e.mode!==oe.SCENE3D)throw new E("sampleHeight is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new E("sampleHeight requires depth texture support. Check sampleHeightSupported.");let o=zK(e,t),r=Dw(this,e,o,n,i,!0,!1);if(c(r))return ATe(e,r.position)};oa.prototype.clampToHeight=function(e,t,n,i,o){if(T.defined("cartesian",t),e.mode!==oe.SCENE3D)throw new E("clampToHeight is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new E("clampToHeight requires depth texture support. Check clampToHeightSupported.");let r=TTe(e,t),s=Dw(this,e,r,n,i,!0,!1);if(c(s))return d.clone(s.position,o)};oa.prototype.sampleHeightMostDetailed=function(e,t,n,i){if(T.defined("positions",t),e.mode!==oe.SCENE3D)throw new E("sampleHeightMostDetailed is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new E("sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.");n=c(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=tgt(this,e,t[s],n,i);return fG(e,Promise.all(r).then(function(s){let a=s.length;for(let l=0;l<a;++l)t[l].height=s[l];return t}))};oa.prototype.clampToHeightMostDetailed=function(e,t,n,i){if(T.defined("cartesians",t),e.mode!==oe.SCENE3D)throw new E("clampToHeightMostDetailed is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new E("clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.");n=c(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=ngt(this,e,t[s],n,i,t[s]);return fG(e,Promise.all(r).then(function(s){let a=s.length;for(let l=0;l<a;++l)t[l]=s[l];return t}))};oa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var wB=oa;var vB=`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 DB=`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; if (depth >= 1.0) { posEC.z = czm_currentFrustum.y; } return posEC; } vec3 getNormalXEdge(vec3 positionEC) { 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; vec3 dx0 = positionEC - positionLeft; vec3 dx1 = positionRight - positionEC; vec3 dy0 = positionEC - positionDown; vec3 dy1 = positionUp - positionEC; 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); 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); float stepLength = 3.0 * gaussianVariance / (float(stepCount) + 1.0); float metersPerPixel = czm_metersPerPixel(positionEC, 1.0); 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); 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; #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 vec2 samplePixel = floor(gl_FragCoord.xy + float(j + 1) * radialStep) + vec2(0.5); if (clamp(samplePixel, vec2(0.0), czm_viewport.zw) != samplePixel) { break; } vec4 samplePositionEC = pixelToEye(samplePixel); vec3 stepVector = samplePositionEC.xyz - positionEC.xyz; 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); 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 PB=`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 IB=`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 OB=`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 RB=`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 MB=`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 LB=`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 NB=`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 FB=`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 BB=`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 float exposure = texture(autoExposure, vec2(0.5)).r; color /= exposure; #else color *= vec3(exposure); #endif const float A = 0.22; const float B = 0.30; const float C = 0.10; const float D = 0.20; const float E = 0.01; const float F = 0.30; const float white = 11.2; 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 kB=`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 UB=`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 F0=`#define SAMPLES 8 uniform float delta; uniform float sigma; uniform float direction; uniform sampler2D colorTexture; #ifdef USE_STEP_SIZE uniform float stepSize; #else uniform vec2 step; #endif in vec2 v_textureCoordinates; 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 VB=`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; #define DISTANCE_TO_SPACE 6500000.0 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); } 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)); } 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; 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(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) { 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); vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; vec3 direction = normalize(vec3(ghostVec, 0.0)); vec4 result = vec4(0.0); vec4 ghost = vec4(0.0); for (int i = 0; i < 4; ++i) { vec2 offset = fract(texcoord + ghostVec * float(i)); ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); } result += ghost; 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; 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); 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 zB=`uniform sampler2D colorTexture; uniform vec3 white; 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 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 HB=`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 GB=`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 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 jB=`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 nA(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new hi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new H,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(nA.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(c(e))return e[e.length-1].getColorTexture(0)}}});function CTe(e){let t=e._framebuffers;if(!c(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 igt(e,t){CTe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let l=0;l<r;++l)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[l]=new hi,s[l].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function ETe(e){let t=e._commands;if(!c(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function ogt(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 rgt(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 sgt(e,t){ETe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(rgt(r,i),{framebuffer:n[r].framebuffer,uniformMap:ogt(e,r)});e._commands=o}nA.prototype.clear=function(e){let t=this._framebuffers;if(!c(t))return;let n=this._clearCommand;c(n)||(n=this._clearCommand=new ei({color:new G(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};nA.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,igt(this,e),sgt(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};nA.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!c(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};nA.prototype.isDestroyed=function(){return!1};nA.prototype.destroy=function(){return CTe(this),ETe(this),de(this)};var WB=nA;var agt={NEAREST:0,LINEAR:1},ef=agt;function iA(e){e=e??W.EMPTY_OBJECT;let{name:t=jn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=ef.NEAREST,pixelFormat:a=ke.RGBA,pixelDatatype:l=Ue.UNSIGNED_BYTE,clearColor:u=G.BLACK,scissorRectangle:f}=e;if(T.typeOf.string("options.fragmentShader",n),T.typeOf.number.greaterThan("options.textureScale",o,0),T.typeOf.number.lessThanOrEquals("options.textureScale",o,1),!ke.isColorFormat(a))throw new E("options.pixelFormat must be a color format.");this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=l,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 lc;h.scissorTest={enabled:!0,rectangle:c(f)?Ke.clone(f):new Ke},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(iA.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(c(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(c(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 cgt=/uniform\s+sampler2D\s+depthTexture/g;iA.prototype._isSupported=function(e){return!cgt.test(this._fragmentShader)||e.depthTexture};function lgt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];c(a)&&a!==r&&a instanceof Rt&&!c(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Rt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function ugt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function fgt(e,t){return function(){let n=e[t]();if(c(n))return n.dimensions}}function dgt(e){if(c(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]=ugt(e,r),n[r]=lgt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Rt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=fgt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=xt(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 hgt(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 mgt(e,t){if(c(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(c(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=hgt(n,o)}let i=new He({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function pgt(e){let t=e._sampleMode,n,i;t===ef.LINEAR?(n=Yt.LINEAR,i=li.LINEAR):(n=Yt.NEAREST,i=li.NEAREST);let o=e._sampler;(!c(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function _gt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function ggt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function ygt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let l=n[a];l=l&&l.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:l,source:u}=i[a];e._actualUniforms[l]=new Rt({context:t,source:u})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!c(e._texturePromise)){e._ready=!0;return}if(o.length===0||c(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let l=o[a],u=r[l],f=e._textureCache.getStageByName(u);if(c(f))e._actualUniforms[l]=ggt(e,u);else if(typeof u=="string"){let h=new we({url:u});s.push(h.fetchImage().then(_gt(e,l)))}else e._texturesToCreate.push({name:l,source:u})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function STe(e){c(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(!c(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 Rt&&(c(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function bgt(e){let t=c(e._selected)?e._selected.length:0,n=c(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(c(e._selected)&&c(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):c(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&c(e._combinedSelected)){if(!c(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 xgt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!c(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];c(a.pickIds)?i+=a.pickIds.length:c(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:Qt.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(c(a.pickIds)){let l=a.pickIds,u=l.length;for(let f=0;f<u;++f){let h=l[f].color;r[o]=G.floatToByte(h.red),r[o+1]=G.floatToByte(h.green),r[o+2]=G.floatToByte(h.blue),r[o+3]=G.floatToByte(h.alpha),o+=4}}else if(c(a.pickId)){let l=a.pickId.color;r[o]=G.floatToByte(l.red),r[o+1]=G.floatToByte(l.green),r[o+2]=G.floatToByte(l.blue),r[o+3]=G.floatToByte(l.alpha),o+=4}}e._selectedIdTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:Qt.NEAREST})}iA.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&STe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=bgt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=c(this._selected)?this._selected.length:0,this._parentSelectedLength=c(this._parentSelected)?this._parentSelected.length:0,xgt(this,e),dgt(this),ygt(this,e),mgt(this,e),pgt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!c(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!c(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Ve.fromCache({viewport:new Ke(0,0,i.width,i.height)}))),this._command.renderState=o};iA.prototype.execute=function(e,t,n,i){if(!c(this._command)||!c(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,Qt.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;c(o)&&(o.context=e),this._command.execute(e,o)};iA.prototype.isDestroyed=function(){return!1};iA.prototype.destroy=function(){return STe(this),de(this)};var ho=iA;function oA(e){e=e??W.EMPTY_OBJECT,T.defined("options.stages",e.stages),T.typeOf.number.greaterThan("options.stages.length",e.stages.length,0),this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;c(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(oA.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}}});oA.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};oA.prototype.get=function(e){return T.typeOf.number.greaterThanOrEquals("index",e,0),T.typeOf.number.lessThan("index",e,this.length),this._stages[e]};function Tgt(e){let t=c(e._selected)?e._selected.length:0,n=c(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,c(e._selected)&&c(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):c(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&c(e._combinedSelected)){if(!c(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}oA.prototype.update=function(e,t){this._selectedDirty=Tgt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=c(this._selected)?this._selected.length:0,this._parentSelectedLength=c(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)}};oA.prototype.isDestroyed=function(){return!1};oA.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var au=oA;var Lr={};function HK(e){let o=`#define USE_STEP_SIZE ${F0}`,r=new ho({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:ef.LINEAR}),s=new ho({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:ef.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(l){let u=r.uniforms,f=s.uniforms;u.delta=f.delta=l}},sigma:{get:function(){return r.uniforms.sigma},set:function(l){let u=r.uniforms,f=s.uniforms;u.sigma=f.sigma=l}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(l){let u=r.uniforms,f=s.uniforms;u.stepSize=f.stepSize=l}}}),new au({name:e,stages:[r,s],uniforms:a})}Lr.createBlurStage=function(){return HK("czm_blur")};Lr.createDepthOfFieldStage=function(){let e=HK("czm_depth_of_field_blur"),t=new ho({name:"czm_depth_of_field_composite",fragmentShader:LB,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 au({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Lr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Lr.createEdgeDetectionStage=function(){let e=jn();return new ho({name:`czm_edge_detection_${e}`,fragmentShader:FB,uniforms:{length:.25,color:G.clone(G.BLACK)}})};Lr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function Agt(e){if(!c(e))return Lr.createEdgeDetectionStage();let t=new au({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; `,o+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); if (edge${a}.a > 0.0) { color = edge${a}; break; } `,n[`edgeTexture${a}`]=e[a].name;let r=`${i}in vec2 v_textureCoordinates; void main() { vec4 color = vec4(0.0); for (int i = 0; i < ${e.length}; i++) { ${o} } out_FragColor = color; } `,s=new ho({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new au({name:"czm_edge_detection_composite",stages:[t,s]})}Lr.createSilhouetteStage=function(e){let t=Agt(e),n=new ho({name:"czm_silhouette_color_edges",fragmentShader:jB,uniforms:{silhouetteTexture:t.name}});return new au({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Lr.isSilhouetteSupported=function(e){return e.context.depthTexture};Lr.createBloomStage=function(){let e=new ho({name:"czm_bloom_contrast_bias",fragmentShader:MB,uniforms:{contrast:128,brightness:-.3}}),t=HK("czm_bloom_blur"),n=new au({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new ho({name:"czm_bloom_generate_composite",fragmentShader:OB,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 au({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Lr.createAmbientOcclusionStage=function(){let e=new ho({name:"czm_ambient_occlusion_generate",fragmentShader:DB,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new ho({name:"czm_ambient_occlusion_composite",fragmentShader:PB,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 au({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Lr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var Cgt=`#define FXAA_QUALITY_PRESET 39 ${n2} ${UB}`;Lr.createFXAAStage=function(){return new ho({name:"czm_FXAA",fragmentShader:Cgt,sampleMode:ef.LINEAR})};Lr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE `:"";return t+=vB,new ho({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Lr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE `:"";return t+=BB,new ho({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Lr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE `:"";return t+=kB,new ho({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Lr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE `:"";return t+=GB,new ho({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Lr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE `:"";return t+=zB,new ho({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:G.WHITE,autoExposure:void 0,exposure:1}})};Lr.createAutoExposureStage=function(){return new WB};Lr.createBlackAndWhiteStage=function(){return new ho({name:"czm_black_and_white",fragmentShader:IB,uniforms:{gradations:5}})};Lr.createBrightnessStage=function(){return new ho({name:"czm_brightness",fragmentShader:RB,uniforms:{brightness:.5}})};Lr.createNightVisionStage=function(){return new ho({name:"czm_night_vision",fragmentShader:HB})};Lr.createDepthViewStage=function(){return new ho({name:"czm_depth_view",fragmentShader:NB})};Lr.createLensFlareStage=function(){return new ho({name:"czm_lens_flare",fragmentShader:VB,uniforms:{dirtTexture:tn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:tn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ie.WGS84.maximumRadius}})};var tf=Lr;function Ag(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function YB(e){for(;c(e.length);)e=e.get(e.length-1);return e.name}function GK(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(c(o)){let a=e.getStageByName(o);r[YB(a)]=!0}let s=i.uniforms;if(c(s)){let a=Object.getOwnPropertyNames(s),l=a.length;for(let u=0;u<l;++u){let f=s[a[u]];if(typeof f=="string"){let h=e.getStageByName(f);c(h)&&(r[YB(h)]=!0)}}}return i.name}function qB(e,t,n,i,o){if(c(i.enabled)&&!i.enabled||c(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!c(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,l=i.length;for(let h=0;h<l;++h){let p=i.get(h);c(p.length)?a=qB(e,t,n,p,o):a=GK(e,t,n,p,o),s&&(o=a)}let u,f;if(s)for(u=1;u<l;++u)f=YB(i.get(u)),c(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<l;++u){f=YB(i.get(u));let h=n[f];for(let p=0;p<u;++p)h[YB(i.get(p))]=!0}return a}function Egt(e,t){let n={};if(c(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=qB(e,t,n,i,void 0);a=qB(e,t,n,o,a),a=GK(e,t,n,r,a),a=qB(e,t,n,e,a),GK(e,t,n,s,a)}else qB(e,t,n,e,void 0);return n}function Sgt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,l=o._pixelDatatype,u=o._clearColor,f,h,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(h=p[f],r!==h.textureScale||s!==h.forcePowerOfTwo||a!==h.pixelFormat||l!==h.pixelDatatype||!G.equals(u,h.clearColor))continue;let m=h.stages,y=m.length,b=!1;for(let x=0;x<y;++x)if(n[m[x]]){b=!0;break}if(!b)break}return c(h)&&f<g?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:l,clearColor:u,stages:[t],buffer:new hi({pixelFormat:a,pixelDatatype:l}),clear:void 0},p.push(h),h)}function wgt(e,t){let n=Egt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=Sgt(e,i,n[i]))}function jK(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function vgt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],l=a.textureScale,u=Math.ceil(n*l),f=Math.ceil(i*l),h=Math.min(u,f);a.forcePowerOfTwo&&(O.isPowerOfTwo(h)||(h=O.nextPowerOfTwo(h)),u=h,f=h),a.buffer.update(t,u,f),a.clear=new ei({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}Ag.prototype.updateDependencies=function(){this._updateDependencies=!0};Ag.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=c(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=c(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=c(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=c(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!c(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(jK(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&wgt(this,e);let l=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==l||this._height!==u;!n&&!f||(this._width=l,this._height=u,this._updateDependencies=!1,jK(this),vgt(this,e))};Ag.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};Ag.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};Ag.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};Ag.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(c(t))return t.buffer.framebuffer};Ag.prototype.isDestroyed=function(){return!1};Ag.prototype.destroy=function(){return jK(this),de(this)};var rA=Ag;var Pw={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};function wTe(e){return e===Pw.REINHARD||e===Pw.MODIFIED_REINHARD||e===Pw.FILMIC||e===Pw.ACES||e===Pw.PBR_NEUTRAL}var Cg=Object.freeze(Pw);var WK=[];function xl(){let e=tf.createFXAAStage(),t=tf.createAmbientOcclusionStage(),n=tf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=tf.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=Cg.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new rA(this),r={},s=WK;for(s.push(e,t,n,i);s.length>0;){let l=s.pop();r[l.name]=l,l._textureCache=o;let u=l.length;if(c(u))for(let f=0;f<u;++f)s.push(l.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(xl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let l=t[a];e=e||l.ready&&l.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return qK(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(c(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!c(t))continue;if(c(t.selected))return!0;let n=t.length;if(c(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;if(!wTe(e))throw new E("tonemapper was set to an invalid value.");c(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case Cg.REINHARD:n=tf.createReinhardTonemappingStage(t);break;case Cg.MODIFIED_REINHARD:n=tf.createModifiedReinhardTonemappingStage(t);break;case Cg.FILMIC:n=tf.createFilmicTonemappingStage(t);break;case Cg.PBR_NEUTRAL:n=tf.createPbrNeutralTonemappingStage(t);break;default:n=tf.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,c(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 qK(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}xl.prototype.add=function(e){T.typeOf.object("stage",e);let t=this._stageNames,n=WK;for(n.push(e);n.length>0;){let o=n.pop();if(c(t[o.name]))throw new E(`${o.name} has already been added to the collection or does not have a unique name.`);t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(c(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};xl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=WK;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(c(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};xl.prototype.contains=function(e){return c(e)&&c(e._index)&&e._textureCache===this._textureCache};xl.prototype.get=function(e){qK(this);let t=this._stages,n=t.length;return T.typeOf.number.greaterThanOrEquals("stages length",n,0),T.typeOf.number.greaterThanOrEquals("index",e,0),T.typeOf.number.lessThan("index",e,n),t[e]};xl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};xl.prototype.getStageByName=function(e){return this._stageNames[e]};xl.prototype.update=function(e,t,n){qK(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let x=0;x<r.length;++x){let A=r[x];A.ready&&A.enabled&&A._isSupported(e)&&(o[s++]=A)}o.length=s;let a=s!==i.length;if(!a){for(let x=0;x<s;++x)if(o[x]!==i[x]){a=!0;break}}let l=this._ao,u=this._bloom,f=this._autoExposure,h=this._tonemapping,p=this._fxaa;h.enabled=n;let g=l.enabled&&l._isSupported(e),m=u.enabled&&u._isSupported(e),y=h.enabled&&h._isSupported(e),b=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||y!==this._tonemappingEnabled||b!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=y,this._fxaaEnabled=b,this._textureCacheDirty=!1),c(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!c(this._randomTexture)&&g){let A=new Uint8Array(196608);for(let C=0;C<196608;C+=3)A[C]=Math.floor(Math.random()*255);this._randomTexture=new Rt({context:e,pixelFormat:ke.RGB,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:A,width:256,height:256},sampler:new Qt({wrapS:gn.REPEAT,wrapT:gn.REPEAT,minificationFilter:Yt.NEAREST,magnificationFilter:li.NEAREST})})}this._textureCache.update(e),p.update(e,t),l.update(e,t),u.update(e,t),h.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let x=0;x<r.length;++x)r[x].update(e,t);s=0;for(let x=0;x<r.length;++x){let A=r[x];A.ready&&A.enabled&&A._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};xl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function sA(e){for(;c(e.length);)e=e.get(e.length-1);return e.outputTexture}xl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(c(t))return sA(t)};function hp(e,t,n,i,o){if(c(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){hp(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)hp(e.get(r),t,sA(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)hp(e.get(r),t,n,i,o)}xl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,l=this._bloom,u=this._autoExposure,f=this._tonemapping,h=a.enabled&&a._isSupported(e),p=l.enabled&&l._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!h&&!p&&!m&&r===0)return;let b=t;h&&a.ready&&(hp(a,e,b,n,i),b=sA(a)),p&&l.ready&&(hp(l,e,b,n,i),b=sA(l)),g&&u.ready&&hp(u,e,b,n,i),m&&f.ready&&(hp(f,e,b,n,i),b=sA(f));let x=b;if(r>0){hp(o[0],e,b,n,i);for(let A=1;A<r;++A)hp(o[A],e,sA(o[A-1]),n,i);x=sA(o[r-1])}y&&s.ready&&hp(s,e,x,n,i)};xl.prototype.copy=function(e,t){if(!c(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(su,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};xl.prototype.isDestroyed=function(){return!1};xl.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(),de(this)};var XB=xl;var Dgt={SHIFT:0,CTRL:1,ALT:2},ra=Object.freeze(Dgt);var Pgt={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},An=Object.freeze(Pgt);function B0(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function QK(e,t){let n=e;return c(t)&&(n+=`+${t}`),n}function aA(e){if(e.shiftKey)return ra.SHIFT;if(e.ctrlKey)return ra.CTRL;if(e.altKey)return ra.ALT}var Us={LEFT:0,MIDDLE:1,RIGHT:2};function nf(e,t,n,i){function o(r){i(e,r)}Vt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function Igt(e){let t=e._element,n=c(t.disableRootEvents)?t:document;Vt.supportsPointerEvents()?(nf(e,"pointerdown",t,Fgt),nf(e,"pointerup",t,FTe),nf(e,"pointermove",t,Bgt),nf(e,"pointercancel",t,FTe)):(nf(e,"mousedown",t,BTe),nf(e,"mouseup",n,kTe),nf(e,"mousemove",n,UTe),nf(e,"touchstart",t,Lgt),nf(e,"touchend",n,OTe),nf(e,"touchmove",n,Ngt),nf(e,"touchcancel",n,OTe)),nf(e,"dblclick",t,Rgt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",nf(e,i,t,Mgt)}function Ogt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var vTe={position:new H};function JK(e){e._lastSeenTouchEvent=Ti()}function e$(e){return Ti()-e._lastSeenTouchEvent>Wh.mouseEmulationIgnoreMilliseconds}function ZK(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function BTe(e,t){if(!e$(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Us.LEFT)i=An.LEFT_DOWN;else if(n===Us.MIDDLE)i=An.MIDDLE_DOWN;else if(n===Us.RIGHT)i=An.RIGHT_DOWN;else return;let o=B0(e,t,e._primaryPosition);H.clone(o,e._primaryStartPosition),H.clone(o,e._primaryPreviousPosition);let r=aA(t),s=e.getInputAction(i,r);c(s)&&(H.clone(o,vTe.position),s(vTe),t.preventDefault())}var DTe={position:new H},PTe={position:new H};function YK(e,t,n,i){let o=aA(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(c(r)||c(s)){let a=B0(e,i,e._primaryPosition);if(c(r)&&(H.clone(a,DTe.position),r(DTe)),c(s)){let l=e._primaryStartPosition;ZK(l,a,e._clickPixelTolerance)&&(H.clone(a,PTe.position),s(PTe))}}}function kTe(e,t){if(!e$(e))return;let n=t.button;n!==Us.LEFT&&n!==Us.MIDDLE&&n!==Us.RIGHT||(e._buttonDown[Us.LEFT]&&(YK(e,An.LEFT_UP,An.LEFT_CLICK,t),e._buttonDown[Us.LEFT]=!1),e._buttonDown[Us.MIDDLE]&&(YK(e,An.MIDDLE_UP,An.MIDDLE_CLICK,t),e._buttonDown[Us.MIDDLE]=!1),e._buttonDown[Us.RIGHT]&&(YK(e,An.RIGHT_UP,An.RIGHT_CLICK,t),e._buttonDown[Us.RIGHT]=!1))}var XK={startPosition:new H,endPosition:new H};function UTe(e,t){if(!e$(e))return;let n=aA(t),i=B0(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(An.MOUSE_MOVE,n);c(r)&&(H.clone(o,XK.startPosition),H.clone(i,XK.endPosition),r(XK)),H.clone(i,o),(e._buttonDown[Us.LEFT]||e._buttonDown[Us.MIDDLE]||e._buttonDown[Us.RIGHT])&&t.preventDefault()}var ITe={position:new H};function Rgt(e,t){let n=t.button,i;if(n===Us.LEFT)i=An.LEFT_DOUBLE_CLICK;else return;let o=aA(t),r=e.getInputAction(i,o);c(r)&&(B0(e,t,ITe.position),r(ITe))}function Mgt(e,t){let n;if(c(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(!c(n))return;let i=aA(t),o=e.getInputAction(An.WHEEL,i);c(o)&&(o(n),t.preventDefault())}function Lgt(e,t){JK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,B0(e,r,new H));dG(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,l.set(s,H.clone(a.get(s)))}function OTe(e,t){JK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);dG(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,l.remove(s)}var RTe={position:new H},KK={position1:new H,position2:new H},MTe={position:new H},LTe={position:new H},NTe={position:new H};function dG(e,t){let n=aA(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Us.LEFT]){if(e._buttonDown[Us.LEFT]=!1,c(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(An.LEFT_UP,n),c(r)&&(H.clone(e._primaryPosition,MTe.position),r(MTe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(An.LEFT_CLICK,n),c(s))){let l=e._primaryStartPosition,u=e._previousPositions.values[0];ZK(l,u,e._clickPixelTolerance)&&(H.clone(e._primaryPosition,LTe.position),s(LTe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(An.PINCH_END,n),c(r)&&r()),o===1&&!a){let l=i.values[0];H.clone(l,e._primaryPosition),H.clone(l,e._primaryStartPosition),H.clone(l,e._primaryPreviousPosition),e._buttonDown[Us.LEFT]=!0,r=e.getInputAction(An.LEFT_DOWN,n),c(r)&&(H.clone(l,RTe.position),r(RTe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(An.RIGHT_CLICK,n),c(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];ZK(u,f,e._holdPixelTolerance)&&(H.clone(e._primaryPosition,NTe.position),s(NTe))}},Wh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(An.PINCH_START,n),c(r)&&(H.clone(i.values[0],KK.position1),H.clone(i.values[1],KK.position2),r(KK),t.preventDefault()))}function Ngt(e,t){JK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let u=a.get(s);c(u)&&B0(e,r,u)}VTe(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,H.clone(a.get(s),l.get(s))}var $K={startPosition:new H,endPosition:new H},KB={distance:{startPosition:new H,endPosition:new H},angleAndHeight:{startPosition:new H,endPosition:new H}};function VTe(e,t){let n=aA(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Us.LEFT]){let a=i.values[0];H.clone(a,e._primaryPosition);let l=e._primaryPreviousPosition;s=e.getInputAction(An.MOUSE_MOVE,n),c(s)&&(H.clone(l,$K.startPosition),H.clone(a,$K.endPosition),s($K)),H.clone(a,l),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(An.PINCH_MOVE,n),c(s))){let a=i.values[0],l=i.values[1],u=o.values[0],f=o.values[1],h=l.x-a.x,p=l.y-a.y,g=Math.sqrt(h*h+p*p)*.25,m=f.x-u.x,y=f.y-u.y,b=Math.sqrt(m*m+y*y)*.25,x=(l.y+a.y)*.125,A=(f.y+u.y)*.125,C=Math.atan2(p,h),S=Math.atan2(y,m);H.fromElements(0,b,KB.distance.startPosition),H.fromElements(0,g,KB.distance.endPosition),H.fromElements(S,A,KB.angleAndHeight.startPosition),H.fromElements(C,x,KB.angleAndHeight.endPosition),s(KB)}}function Fgt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,B0(e,t,new H)),dG(e,t),e._previousPositions.set(i,H.clone(n.get(i)))}else BTe(e,t)}function FTe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),dG(e,t),e._previousPositions.remove(i)}else kTe(e,t)}function Bgt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!c(o))return;B0(e,t,o),VTe(e,t);let r=e._previousPositions;H.clone(n.get(i),r.get(i))}else UTe(e,t)}function Wh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Wh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new H,this._primaryPosition=new H,this._primaryPreviousPosition=new H,this._positions=new Et,this._previousPositions=new Et,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,Igt(this)}Wh.prototype.setInputAction=function(e,t,n){if(!c(e))throw new E("action is required.");if(!c(t))throw new E("type is required.");let i=QK(t,n);this._inputEvents[i]=e};Wh.prototype.getInputAction=function(e,t){if(!c(e))throw new E("type is required.");let n=QK(e,t);return this._inputEvents[n]};Wh.prototype.removeInputAction=function(e,t){if(!c(e))throw new E("type is required.");let n=QK(e,t);delete this._inputEvents[n]};Wh.prototype.isDestroyed=function(){return!1};Wh.prototype.destroy=function(){return Ogt(this),de(this)};Wh.mouseEmulationIgnoreMilliseconds=800;Wh.touchHoldDelayMilliseconds=1500;var of=Wh;function cA(e){T.typeOf.object("scene",e),this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}cA.prototype.completeMorph=function(){c(this._completeMorph)&&this._completeMorph()};cA.prototype.morphTo2D=function(e,t){c(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof on,!(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(B.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?_yt(this,e):Cyt(this,e,t),e===0&&c(this._completeMorph)&&this._completeMorph())};var kgt=new d,Ugt=new d,Vgt=new d,zgt=new d,Hgt=new d,Ggt=new d,jgt=new d,Wgt=new he,qgt=new B,Ygt=new Ci,Xgt=new on,Kgt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};cA.prototype.morphToColumbusView=function(e,t){c(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(B.IDENTITY);let i=kgt,o=Ugt,r=Vgt;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,jgt),h=Ot.eastNorthUpToFixedFrame(f,t,qgt);B.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,Wgt),i),B.multiplyByPointAsVector(h,o,o),B.multiplyByPointAsVector(h,r,r)}}let s;this._morphToOrthographic?(s=Xgt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Ygt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=O.toRadians(60));let a=Kgt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let l=Syt(a);$B(this,l),this._previousMode===oe.SCENE2D?Eyt(this,e,a,l):(a.position2D=B.multiplyByPoint(ro.TRANSFORM_2D,i,zgt),a.direction2D=B.multiplyByPointAsVector(ro.TRANSFORM_2D,o,Hgt),a.up2D=B.multiplyByPointAsVector(ro.TRANSFORM_2D,r,Ggt),n._mode=oe.MORPHING,ZTe(this,e,a,l)),e===0&&c(this._completeMorph)&&this._completeMorph()};var i$={position:new d,direction:new d,up:new d,frustum:void 0},HTe=new Ci;cA.prototype.morphTo3D=function(e,t){c(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(B.IDENTITY),this._previousMode===oe.SCENE2D)syt(this,e,t);else{let i;e>0?(i=i$,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=GTe(this,t);let o,r=n.camera;r.frustum instanceof on?o=r.frustum.clone():(o=HTe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=O.toRadians(60)),i.frustum=o;let s=JTe(i);$B(this,s),n$(this,e,i,s)}e===0&&c(this._completeMorph)&&this._completeMorph()}};cA.prototype.isDestroyed=function(){return!1};cA.prototype.destroy=function(){return hG(this),de(this)};function $B(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new of(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,An.LEFT_DOWN),e._morphHandler.setInputAction(n,An.MIDDLE_DOWN),e._morphHandler.setInputAction(n,An.RIGHT_DOWN),e._morphHandler.setInputAction(n,An.WHEEL)}}function hG(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 $gt=new he,Zgt=new d,Qgt=new B;function GTe(e,t){let n=e._scene,i=n.camera,o=i$,r=o.position,s=o.direction,a=o.up,l=n.mapProjection.unproject(i.position,$gt);t.cartographicToCartesian(l,r);let u=t.scaleToGeodeticSurface(r,Zgt),f=Ot.eastNorthUpToFixedFrame(u,t,Qgt);return B.multiplyByPointAsVector(f,i.direction,s),B.multiplyByPointAsVector(f,i.up,a),o}var Jgt=new d,eyt=new d,tyt=new d,nyt=new d,iyt=new d,oyt=new d;function n$(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(r.position,Jgt),a=d.clone(r.direction,eyt),l=d.clone(r.up,tyt),u=B.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,n.position,nyt),f=B.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.direction,iyt),h=B.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.up,oyt);function p(m){bd(s,u,m.time,r.position),bd(a,f,m.time,r.direction),bd(l,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){QTe(e,o,0,1,t,i)}});e._currentTweens.push(g)}var ryt=new on,jTe=new d,WTe=new d,qTe=new d,o$=new d,YTe=new d,XTe=new d;function syt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=i$,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=GTe(e,n));let s;e._morphToOrthographic?(s=ryt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=HTe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=O.toRadians(60)),r.frustum=s;let a=JTe(r);$B(e,a);let l;e._morphToOrthographic?l=function(){n$(e,t,r,a)}:l=function(){$Te(e,t,r,function(){n$(e,t,r,a)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:d.fromDegrees(0,0,5*n.maximumRadius,n,o$),complete:function(){i._mode=oe.MORPHING,l()}})):l()}function bd(e,t,n,i){return d.lerp(e,t,n,i)}function KTe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof on)return;let a=s.frustum.fov,l=O.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(l*.5)+1e7;function f(p){s.frustum.fov=O.lerp(a,l,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let h=r.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var ayt=new d,cyt=new d,lyt=new d,t$=new d,uyt=new d,fyt=new d,dyt=new jo,hyt=new mn,myt=new d,pyt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function _yt(e,t){t*=.5;let n=e._scene,i=n.camera,o=d.clone(i.position,ayt),r=d.clone(i.direction,cyt),s=d.clone(i.up,lyt),a=d.negate(d.UNIT_Z,uyt),l=d.clone(d.UNIT_Y,fyt),u=t$;if(t>0)d.clone(d.ZERO,t$),u.z=5*n.ellipsoid.maximumRadius;else{d.clone(o,t$);let b=hyt;B.multiplyByPoint(ro.TRANSFORM_2D,o,b.origin),B.multiplyByPointAsVector(ro.TRANSFORM_2D,r,b.direction);let x=n.globe;if(c(x)){let A=x.pickWorldCoordinates(b,n,!0,myt);c(A)&&(B.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,A,u),u.z+=d.distance(o,u))}}let f=dyt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let h=pyt;h.position=u,h.direction=a,h.up=l,h.frustum=f;let p=eAe(h);$B(e,p);function g(b){bd(o,u,b.time,i.position),bd(r,a,b.time,i.direction),bd(s,l,b.time,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(b,x){b.position.z=x}let y=n.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){KTe(e,t,h,m,p)}});e._currentTweens.push(y)}var zTe=new he,gyt={position:new d,direction:new d,up:new d,position2D:new d,direction2D:new d,up2D:new d,frustum:new jo},yyt={position:new d,direction:new d,up:new d,frustum:void 0},byt=new d,xyt=new mn,Tyt=new B,Ayt=new d;function Cyt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=gyt;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,zTe),i.mapProjection.project(zTe,r.position),d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);let h=xyt;d.clone(r.position2D,h.origin);let p=d.clone(o.directionWC,h.direction),g=n.scaleToGeodeticSurface(o.positionWC,Ayt),m=Ot.eastNorthUpToFixedFrame(g,n,Tyt);B.inverseTransformation(m,m),B.multiplyByPointAsVector(m,p,p),B.multiplyByPointAsVector(ro.TRANSFORM_2D,p,p);let y=i.globe;if(c(y)){let b=y.pickWorldCoordinates(h,i,!0,byt);if(c(b)){let x=d.distance(r.position2D,b);b.x+=x,d.clone(b,r.position2D)}}}function s(h,p){h.position.x=p}B.multiplyByPoint(ro.TRANSFORM_2D,r.position,r.position2D),B.multiplyByPointAsVector(ro.TRANSFORM_2D,r.direction,r.direction2D),B.multiplyByPointAsVector(ro.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let l=yyt;B.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,r.position2D,l.position),d.clone(r.direction,l.direction),d.clone(r.up,l.up),l.frustum=a;let u=eAe(l);$B(e,u);function f(){KTe(e,t,r,s,u)}ZTe(e,t,r,f)}function $Te(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,l=O.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(l*.5)+1e7,r.frustum.fov=l;function f(p){r.frustum.fov=O.lerp(l,a,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(h)}function Eyt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(n.position,o$),a=d.clone(n.direction,YTe),l=d.clone(n.up,XTe);o._mode=oe.MORPHING;function u(){r.frustum=n.frustum.clone();let f=d.clone(r.position,jTe),h=d.clone(r.direction,WTe),p=d.clone(r.up,qTe);f.z=s.z;function g(y){bd(f,s,y.time,r.position),bd(h,a,y.time,r.direction),bd(p,l,y.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:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():$Te(e,0,n,u)}function ZTe(e,t,n,i){let o=e._scene,r=o.camera,s=d.clone(r.position,jTe),a=d.clone(r.direction,WTe),l=d.clone(r.up,qTe),u=d.clone(n.position2D,o$),f=d.clone(n.direction2D,YTe),h=d.clone(n.up2D,XTe);function p(m){bd(s,u,m.time,r.position),bd(a,f,m.time,r.direction),bd(l,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){QTe(e,o,1,0,t,i)}});e._currentTweens.push(g)}function QTe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Qr.QUARTIC_OUT};c(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function JTe(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),hG(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=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE3D,r)}}function eAe(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),hG(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=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE2D,o)}}function Syt(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),hG(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=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.COLUMBUS_VIEW,r)}}var ZB=cA;var wyt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Vi=Object.freeze(wyt);function sa(e,t){let n=`${e}`;return c(t)&&(n+=`+${t}`),n}function vyt(e,t){H.clone(e.distance.startPosition,t.distance.startPosition),H.clone(e.distance.endPosition,t.distance.endPosition),H.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),H.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function tAe(e,t,n){let i=sa(Vi.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,l=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new H;let u=e._movement[i];c(u)||(u=e._movement[i]={}),u.distance={startPosition:new H,endPosition:new H},u.angleAndHeight={startPosition:new H,endPosition:new H},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,a[i]=new Date,H.lerp(f.position1,f.position2,.5,s[i])},An.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,l[i]=new Date},An.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?(vyt(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(H.clone(f.distance.endPosition,u.distance.endPosition),H.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let h=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;h>=p+Math.PI;)h-=g;for(;h<p-Math.PI;)h+=g;u.angleAndHeight.endPosition.x=-h*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},An.PINCH_MOVE,t)}function nAe(e,t){let n=sa(Vi.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];c(s)||(s=e._movement[n]={});let a=e._lastMovement[n];c(a)||(a=e._lastMovement[n]={startPosition:new H,endPosition:new H,valid:!1}),s.startPosition=new H,H.clone(H.ZERO,s.startPosition),s.endPosition=new H,e._eventHandler.setInputAction(function(l){let u=7.5*O.toRadians(l);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,H.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},An.WHEEL,t)}function Iw(e,t,n){let i=sa(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new H;let a=e._lastMovement[i];c(a)||(a=e._lastMovement[i]={startPosition:new H,endPosition:new H,valid:!1});let l,u;n===Vi.LEFT_DRAG?(l=An.LEFT_DOWN,u=An.LEFT_UP):n===Vi.RIGHT_DRAG?(l=An.RIGHT_DOWN,u=An.RIGHT_UP):n===Vi.MIDDLE_DRAG&&(l=An.MIDDLE_DOWN,u=An.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,H.clone(f.position,r[i])},l,t),e._eventHandler.setInputAction(function(){r$(sa(n,void 0),e);for(let f of Object.values(ra)){let h=sa(n,f);r$(h,e)}},u,t)}function r$(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 iAe(e,t){H.clone(e.startPosition,t.startPosition),H.clone(e.endPosition,t.endPosition)}function Dyt(e,t,n){let i=n._isDown,o=!1,r=sa(e,t);for(let[l,u]of Object.entries(i))l.startsWith(e)&&u&&l!==r&&(o=!0,r$(l,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];c(a)||(a=n._lastMovement[r]={startPosition:new H,endPosition:new H,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function oAe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Vi)if(Vi.hasOwnProperty(s)){let a=Vi[s];if(c(a)){let l=sa(a,t);n[l]=!0,c(e._lastMovement[l])||(e._lastMovement[l]={startPosition:new H,endPosition:new H,valid:!1}),c(e._movement[l])||(e._movement[l]={startPosition:new H,endPosition:new H})}}e._eventHandler.setInputAction(function(s){for(let a in Vi)if(Vi.hasOwnProperty(a)){let l=Vi[a];if(c(l)){let u=sa(l,t);Dyt(l,t,e),r[u]&&(n[u]?(iAe(i[u],o[u]),o[u].valid=!0,iAe(s,i[u]),n[u]=!1):H.clone(s.endPosition,i[u].endPosition))}}H.clone(s.endPosition,e._currentMousePosition)},An.MOUSE_MOVE,t)}function xd(e){if(!c(e))throw new E("canvas is required.");this._eventHandler=new of(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new H,nAe(this,void 0),tAe(this,void 0,e),Iw(this,void 0,Vi.LEFT_DRAG),Iw(this,void 0,Vi.RIGHT_DRAG),Iw(this,void 0,Vi.MIDDLE_DRAG),oAe(this,void 0);for(let t in ra)if(ra.hasOwnProperty(t)){let n=ra[t];c(n)&&(nAe(this,n),tAe(this,n,e),Iw(this,n,Vi.LEFT_DRAG),Iw(this,n,Vi.RIGHT_DRAG),Iw(this,n,Vi.MIDDLE_DRAG),oAe(this,n))}}Object.defineProperties(xd.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[sa(Vi.WHEEL)]||!this._update[sa(Vi.WHEEL,ra.SHIFT)]||!this._update[sa(Vi.WHEEL,ra.CTRL)]||!this._update[sa(Vi.WHEEL,ra.ALT)];return this._buttonsDown>0||e}}});xd.prototype.isMoving=function(e,t){if(!c(e))throw new E("type is required.");let n=sa(e,t);return!this._update[n]};xd.prototype.getMovement=function(e,t){if(!c(e))throw new E("type is required.");let n=sa(e,t);return this._movement[n]};xd.prototype.getLastMovement=function(e,t){if(!c(e))throw new E("type is required.");let n=sa(e,t),i=this._lastMovement[n];if(i.valid)return i};xd.prototype.isButtonDown=function(e,t){if(!c(e))throw new E("type is required.");let n=sa(e,t);return this._isDown[n]};xd.prototype.getStartMousePosition=function(e,t){if(!c(e))throw new E("type is required.");if(e===Vi.WHEEL)return this._currentMousePosition;let n=sa(e,t);return this._eventStartPosition[n]};xd.prototype.getButtonPressTime=function(e,t){if(!c(e))throw new E("type is required.");let n=sa(e,t);return this._pressTime[n]};xd.prototype.getButtonReleaseTime=function(e,t){if(!c(e))throw new E("type is required.");let n=sa(e,t);return this._releaseTime[n]};xd.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};xd.prototype.isDestroyed=function(){return!1};xd.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),de(this)};var QB=xd;function mG(e,t,n,i,o,r,s,a,l,u){this._tweens=e,this._tweenjs=t,this._startObject=je(n),this._stopObject=je(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=l,this.cancel=u,this.needsStart=!0}Object.defineProperties(mG.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}}});mG.prototype.cancelTween=function(){this._tweens.remove(this)};function qh(){this._tweens=[]}Object.defineProperties(qh.prototype,{length:{get:function(){return this._tweens.length}}});qh.prototype.add=function(e){if(e=e??W.EMPTY_OBJECT,!c(e.startObject)||!c(e.stopObject))throw new E("options.startObject and options.stopObject are required.");if(!c(e.duration)||e.duration<0)throw new E("options.duration is required and must be positive.");if(e.duration===0)return c(e.complete)&&e.complete(),new mG(this);let t=e.duration/qn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/qn.SECONDS_PER_MILLISECOND,o=e.easingFunction??Qr.LINEAR_NONE,r=e.startObject,s=new Zye(r);s.to(je(e.stopObject),t),s.delay(i),s.easing(o),c(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new mG(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};qh.prototype.addProperty=function(e){e=e??W.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;if(!c(t)||!c(e.property))throw new E("options.object and options.property are required.");if(!c(t[n]))throw new E("options.object must have the specified property.");if(!c(i)||!c(o))throw new E("options.startValue and options.stopValue are required.");function r(s){t[n]=s.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})};qh.prototype.addAlpha=function(e){e=e??W.EMPTY_OBJECT;let t=e.material;if(!c(t))throw new E("options.material is required.");let n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&c(t.uniforms[o])&&c(t.uniforms[o].alpha)&&n.push(o);if(n.length===0)throw new E("material has no properties with alpha components.");function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha: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})};qh.prototype.addOffsetIncrement=function(e){e=e??W.EMPTY_OBJECT;let t=e.material;if(!c(t))throw new E("material is required.");if(!c(t.uniforms.offset))throw new E("material.uniforms must have an offset property.");let n=t.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})};qh.prototype.remove=function(e){if(!c(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),c(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};qh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),c(n.cancel)&&n.cancel()}e.length=0};qh.prototype.contains=function(e){return c(e)&&this._tweens.indexOf(e)!==-1};qh.prototype.get=function(e){if(!c(e))throw new E("index is required.");return this._tweens[e]};qh.prototype.update=function(e){let t=this._tweens,n=0;for(e=c(e)?e/qn.SECONDS_PER_MILLISECOND:Ti();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var lA=qh;function e3(e){if(!c(e))throw new E("scene is required.");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=Vi.LEFT_DRAG,this.zoomEventTypes=[Vi.RIGHT_DRAG,Vi.WHEEL,Vi.PINCH],this.rotateEventTypes=Vi.LEFT_DRAG,this.tiltEventTypes=[Vi.MIDDLE_DRAG,Vi.PINCH,{eventType:Vi.LEFT_DRAG,modifier:ra.CTRL},{eventType:Vi.RIGHT_DRAG,modifier:ra.CTRL}],this.lookEventTypes={eventType:Vi.LEFT_DRAG,modifier:ra.SHIFT};let t=e.ellipsoid??ie.default;this.minimumPickingTerrainHeight=ie.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ie.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ie.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ie.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 QB(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 lA,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new H(-1,-1),this._tiltCenter=new d,this._rotateMousePosition=new H(-1,-1),this._rotateStartPosition=new d,this._strafeStartPosition=new d,this._strafeMousePosition=new H,this._strafeEndMousePosition=new H,this._zoomMouseStart=new H(-1,-1),this._zoomWorldPosition=new d,this._useZoomWorldPosition=!1,this._panLastMousePosition=new H,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 he(Math.PI,O.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 Pyt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Iyt(e){return H.equalsEpsilon(e.startPosition,e.endPosition,O.EPSILON14)}var Oyt=.4;function Ryt(e,t,n,i,o,r,s){let a=r[s];c(a)||(a=r[s]={startPosition:new H,endPosition:new H,motion:new H,inertiaEnabled:!0});let l=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=l&&u&&(u.getTime()-l.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(l&&u&&f<Oyt){let g=Pyt(p,i),m=e.getLastMovement(t,n);if(!c(m)||Iyt(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=H.clone(m.startPosition,a.startPosition),a.endPosition=H.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=H.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||H.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);o(r,y,a)}}}function Myt(e,t){if(c(t)){let n=e[t];c(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(c(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],c(n)&&(n.inertiaEnabled=!1)}}}var rAe=[];function Tl(e,t,n,i,o,r){if(!c(n))return;let s=e._aggregator;Array.isArray(n)||(rAe[0]=n,n=rAe);let a=n.length;for(let l=0;l<a;++l){let u=n[l],f=c(u.eventType)?u.eventType:u,h=u.modifier,p=s.isMoving(f,h)&&s.getMovement(f,h),g=s.getStartMousePosition(f,h);e.enableInputs&&t&&(p?(i(e,g,p),Myt(e,r)):o<1&&Ryt(s,f,h,o,i,e,r))}}var pG=new mn,Lyt=new d,Nyt=new H,Fyt=new d,Byt=new H,kyt=new d,Uyt=new d,Vyt=new d,zyt=new d,gAe=new d,Hyt=new d,Gyt=new d,jyt=new d,Wyt=new d,qyt=new d,Yyt=new d,Xyt=new d,Kyt=new d,$yt=new d,Zyt=new d,uA=new d,sAe=new d,aAe=new d,s$={orientation:new Oa};function m$(e,t,n,i,o,r){let s=1;c(r)&&(s=O.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,h=o-u,p=i*h;p=O.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!c(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 y=e._scene,b=y.camera,x=y.mode,A=s$.orientation;A.heading=b.heading,A.pitch=b.pitch,A.roll=b.roll;let C=n.inertiaEnabled??H.equals(t,e._zoomMouseStart),S=e._zoomingOnVector,v=e._rotatingZoom,P;if(C||(e._zoomMouseStart=H.clone(t,e._zoomMouseStart),c(e._globe)&&x===oe.SCENE2D?(P=b.getPickRay(t,pG).origin,P=d.fromElements(P.y,P.z,P.x)):c(e._globe)&&(P=Eg(e,t,Lyt)),c(P)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=d.clone(P,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,S=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){b.zoomIn(m);return}let M=x===oe.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(v=!0),!C||v){if(x===oe.SCENE2D){let R=e._zoomWorldPosition,L=b.position;if(!d.equals(R,L)&&b.positionCartographic.height<e._maxCoord.x*2){let F=b.position.x,_=d.subtract(R,L,Fyt);d.normalize(_,_);let w=d.distance(R,L)*m/(b.getMagnitude()*.5);b.move(_,w*.5),(b.position.x<0&&F>0||b.position.x>0&&F<0)&&(P=b.getPickRay(t,pG).origin,P=d.fromElements(P.y,P.z,P.x),e._zoomWorldPosition=d.clone(P,e._zoomWorldPosition))}}else if(x===oe.SCENE3D){let R=d.normalize(b.position,gAe);if(e._cameraUnderground||e._zoomingUnderground||b.positionCartographic.height<3e3&&Math.abs(d.dot(b.direction,R))<.6)M=!0;else{let L=y.canvas,F=Byt;F.x=L.clientWidth/2,F.y=L.clientHeight/2;let _=Eg(e,F,kyt);if(!c(_))M=!0;else if(b.positionCartographic.height<1e6)if(d.dot(b.direction,R)>=-.5)M=!0;else{let w=Gyt;d.clone(b.position,w);let D=e._zoomWorldPosition,I=Hyt;if(I=d.normalize(D,I),d.dot(I,R)<0)return;let N=Zyt,k=qyt;d.clone(b.direction,k),d.add(w,d.multiplyByScalar(k,1e3,uA),N);let z=Yyt,V=Xyt;d.subtract(D,w,z),d.normalize(z,V);let j=d.dot(R,V);if(j>=0){e._zoomMouseStart.x=-1;return}let U=Math.acos(-j),q=d.magnitude(w),Y=d.magnitude(D),te=q-m,K=d.magnitude(z),Z=Math.asin(O.clamp(K/Y*Math.sin(U),-1,1)),ee=Math.asin(O.clamp(te/Y*Math.sin(U),-1,1)),me=Z-ee+U,Te=jyt;d.normalize(w,Te);let ue=Wyt;ue=d.cross(V,Te,ue),ue=d.normalize(ue,ue),d.normalize(d.cross(Te,ue,uA),k),d.multiplyByScalar(d.normalize(N,uA),d.magnitude(N)-m,N),d.normalize(w,w),d.multiplyByScalar(w,te,w);let ye=Kyt;d.multiplyByScalar(d.add(d.multiplyByScalar(Te,Math.cos(me)-1,sAe),d.multiplyByScalar(k,Math.sin(me),aAe),uA),te,ye),d.add(w,ye,w),d.normalize(N,Te),d.normalize(d.cross(Te,ue,uA),k);let Ae=$yt;d.multiplyByScalar(d.add(d.multiplyByScalar(Te,Math.cos(me)-1,sAe),d.multiplyByScalar(k,Math.sin(me),aAe),uA),d.magnitude(N),Ae),d.add(N,Ae,N),d.clone(w,b.position),d.normalize(d.subtract(N,w,uA),b.direction),d.clone(b.direction,b.direction),d.cross(b.direction,b.up,b.right),d.cross(b.right,b.direction,b.up),b.setView(s$);return}else{let w=d.normalize(_,Uyt),D=d.normalize(e._zoomWorldPosition,Vyt),I=d.dot(D,w);if(I>0&&I<1){let N=O.acosClamped(I),k=d.cross(D,w,zyt),z=Math.abs(N)>O.toRadians(20)?b.positionCartographic.height*.75:b.positionCartographic.height-m,V=m/z;b.rotate(k,N*V)}}}}e._rotatingZoom=!M}if(!C&&M||S){let R,L=Gi.worldToWindowCoordinates(y,e._zoomWorldPosition,Nyt);x!==oe.COLUMBUS_VIEW&&H.equals(t,e._zoomMouseStart)&&c(L)?R=b.getPickRay(L,pG):R=b.getPickRay(t,pG);let F=R.direction;(x===oe.COLUMBUS_VIEW||x===oe.SCENE2D)&&d.fromElements(F.y,F.z,F.x,F),b.move(F,m),e._zoomingOnVector=!0}else b.zoomIn(m);e._cameraUnderground||b.setView(s$)}var Qyt=new mn,Jyt=new mn,e0t=new d;function t0t(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,Qyt).origin,s=o.getPickRay(n.endPosition,Jyt).origin;r=d.fromElements(r.y,r.z,r.x,r),s=d.fromElements(s.y,s.z,s.x,s);let a=d.subtract(r,s,e0t),l=d.magnitude(a);l>0&&(d.normalize(a,a),o.move(a,l))}function cAe(e,t,n){c(n.distance)&&(n=n.distance);let o=e._scene.camera;m$(e,t,n,e.zoomFactor,o.getMagnitude())}var n0t=new H,i0t=new H;function lAe(e,t,n){if(c(n.angleAndHeight)){o0t(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,l=n0t;l.x=2/s*n.startPosition.x-1,l.y=2/a*(a-n.startPosition.y)-1,l=H.normalize(l,l);let u=i0t;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=H.normalize(u,u);let f=O.acosClamped(l.x);l.y<0&&(f=O.TWO_PI-f);let h=O.acosClamped(u.x);u.y<0&&(h=O.TWO_PI-h);let p=h-f;o.twistRight(p)}function o0t(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let l=i*a*Math.PI*4;r.twistRight(l)}function r0t(e){let t=e._scene.mapMode2D===ru.ROTATE;B.equals(B.IDENTITY,e._scene.camera.transform)?(Tl(e,e.enableTranslate,e.translateEventTypes,t0t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Tl(e,e.enableZoom,e.zoomEventTypes,cAe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Tl(e,e.enableRotate,e.tiltEventTypes,lAe,e.inertiaSpin,"_lastInertiaTiltMovement")):(Tl(e,e.enableZoom,e.zoomEventTypes,cAe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Tl(e,e.enableRotate,e.translateEventTypes,lAe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var yAe=new mn,s0t=new d,a0t=new d;function Eg(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,s0t)),!c(o))return d.clone(s,n);let a=!e._cameraUnderground,l=r.getPickRay(t,yAe),u=o.pickWorldCoordinates(l,i,a,a0t),f=c(s)?d.distance(s,r.positionWC):Number.POSITIVE_INFINITY,h=c(u)?d.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<h?d.clone(s,n):d.clone(u,n)}var c0t=new he;function AG(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===oe.SCENE3D){let l=t.cartesianToCartographic(i.position,c0t);c(l)&&(r=l.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var l0t=new d;function bAe(e,t){let n=t.origin,i=t.direction,o=AG(e),r=d.normalize(n,l0t),s=Math.abs(d.dot(r,i));return s=Math.max(s,.5)*2,o*s}function xAe(e,t,n,i){let o=d.distance(t.origin,n),r=AG(e),s=O.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),mn.getPoint(t,o,i)}function TAe(e,t,n,i){let o;return c(n)?(o=d.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=AG(e))):o=AG(e),mn.getPoint(t,o,i)}var u0t=new H;function AAe(e,t){let n=t.endPosition,i=H.subtract(t.endPosition,t.startPosition,u0t),o=e._strafeEndMousePosition;H.add(o,i,o),t.endPosition=o,p$(e,t,e._strafeStartPosition),t.endPosition=n}var uAe=new mn,f0t=new mn,a$=new d,d0t=new d,h0t=new d,m0t=new d,p0t=new sn(d.UNIT_X,0),_0t=new H,g0t=new H;function y0t(e,t,n){if(d.equals(t,e._translateMousePosition)||(e._looking=!1),d.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){sf(e,t,n);return}if(e._strafing){AAe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=H.clone(n.startPosition,_0t),a=H.clone(n.endPosition,g0t),l=o.getPickRay(s,uAe),u=d.clone(d.ZERO,m0t),f=d.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=Eg(e,s,a$),c(h)&&(u.x=h.x)),r||u.x>o.position.z&&c(h)){let C=h;r&&(C=TAe(e,l,h,a$)),H.clone(t,e._strafeMousePosition),H.clone(t,e._strafeEndMousePosition),d.clone(C,e._strafeStartPosition),e._strafing=!0,p$(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,p0t);l=o.getPickRay(s,uAe);let g=Zn.rayPlane(l,p,a$),m=o.getPickRay(a,f0t),y=Zn.rayPlane(m,p,d0t);if(!c(g)||!c(y)){e._looking=!0,sf(e,t,n),H.clone(t,e._translateMousePosition);return}let b=d.subtract(g,y,h0t),x=b.x;b.x=b.y,b.y=b.z,b.z=x;let A=d.magnitude(b);A>O.EPSILON6&&(d.normalize(b,b),o.move(b,A))}var CAe=new H,yG=new mn,bG=new d,b0t=new d,EAe=new B,x0t=new B,T0t=new d,A0t=new sn(d.UNIT_X,0),c$=new d,f$=new he,SAe=new B,C0t=new Le,E0t=new J,xG=new d;function S0t(e,t,n){if(c(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){sf(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,w0t(e,t,n)):v0t(e,t,n)}function w0t(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=CAe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,yG),l=d.UNIT_X,u=a.origin,f=a.direction,h,p=d.dot(l,f);if(Math.abs(p)>O.EPSILON6&&(h=-d.dot(l,u)/p),!c(h)||h<=0){e._looking=!0,sf(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}let g=d.multiplyByScalar(f,h,bG);d.add(u,g,g);let m=i.mapProjection,y=m.ellipsoid;d.fromElements(g.y,g.z,g.x,g);let b=m.unproject(g,f$);y.cartographicToCartesian(b,g);let x=Ot.eastNorthUpToFixedFrame(g,y,EAe),A=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=B.clone(o.transform,SAe);o._setTransform(x),rf(e,t,n,d.UNIT_Z),o._setTransform(S),e._globe=A,e._ellipsoid=C;let v=C.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function v0t(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,l=d.UNIT_X;if(H.equals(t,e._tiltCenterMousePosition))s=d.clone(e._tiltCenter,bG);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=Eg(e,t,bG)),!c(s)){a=o.getPickRay(t,yG);let _=a.origin,w=a.direction,D,I=d.dot(l,w);if(Math.abs(I)>O.EPSILON6&&(D=-d.dot(l,_)/I),!c(D)||D<=0){e._looking=!0,sf(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}s=d.multiplyByScalar(w,D,bG),d.add(_,s,s)}r&&(c(a)||(a=o.getPickRay(t,yG)),xAe(e,a,s,s)),H.clone(t,e._tiltCenterMousePosition),d.clone(s,e._tiltCenter)}let u=i.canvas,f=CAe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=o.getPickRay(f,yG);let h=d.clone(d.ZERO,T0t);h.x=s.x;let p=sn.fromPointNormal(h,l,A0t),g=Zn.rayPlane(a,p,b0t),m=o._projection,y=m.ellipsoid;d.fromElements(s.y,s.z,s.x,s);let b=m.unproject(s,f$);y.cartographicToCartesian(b,s);let x=Ot.eastNorthUpToFixedFrame(s,y,EAe),A;c(g)?(d.fromElements(g.y,g.z,g.x,g),b=m.unproject(g,f$),y.cartographicToCartesian(b,g),A=Ot.eastNorthUpToFixedFrame(g,y,x0t)):A=x;let C=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=d.UNIT_Z,P=B.clone(o.transform,SAe);o._setTransform(x);let M=d.cross(d.UNIT_Z,d.normalize(o.position,c$),c$),R=d.dot(o.right,M);if(rf(e,t,n,v,!1,!0),o._setTransform(A),R<0){let _=n.startPosition.y-n.endPosition.y;(r&&_<0||!r&&_>0)&&(v=void 0);let w=o.constrainedAxis;o.constrainedAxis=void 0,rf(e,t,n,v,!0,!1),o.constrainedAxis=w}else rf(e,t,n,v,!0,!1);if(c(o.constrainedAxis)){let _=d.cross(o.direction,o.constrainedAxis,xG);d.equalsEpsilon(_,d.ZERO,O.EPSILON6)||(d.dot(_,o.right)<0&&d.negate(_,_),d.cross(_,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(P),e._globe=C,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let F=d.clone(o.positionWC,c$);if(e.enableCollisionDetection&&y$(e,!0),!d.equals(o.positionWC,F)){o._setTransform(A),o.worldToCameraCoordinatesPoint(F,F);let _=d.magnitudeSquared(F);d.magnitudeSquared(o.position)>_&&(d.normalize(o.position,o.position),d.multiplyByScalar(o.position,Math.sqrt(_),o.position));let w=d.angleBetween(F,o.position),D=d.cross(F,o.position,F);d.normalize(D,D);let I=Le.fromAxisAngle(D,w,C0t),N=J.fromQuaternion(I,E0t);J.multiplyByVector(N,o.direction,o.direction),J.multiplyByVector(N,o.up,o.up),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up),o._setTransform(P)}}var wAe=new H,vAe=new mn,DAe=new d;function D0t(e,t,n){c(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=wAe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let l=o.getPickRay(a,vAe),u=l.origin,f=l.direction,h=o.position.z,p;h<e._minimumPickingTerrainHeight&&(p=Eg(e,a,DAe));let g;if(c(p)&&(g=d.distance(u,p)),s){let m=bAe(e,l,h);c(g)?g=Math.min(g,m):g=m}if(!c(g)){let m=d.UNIT_X;g=-d.dot(m,u)/d.dot(m,f)}m$(e,t,n,e.zoomFactor,g)}function P0t(e){let n=e._scene.camera;if(!B.equals(B.IDENTITY,n.transform))Tl(e,e.enableRotate,e.rotateEventTypes,rf,e.inertiaSpin,"_lastInertiaSpinMovement"),Tl(e,e.enableZoom,e.zoomEventTypes,IAe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Tl(e,e.enableTilt,e.tiltEventTypes,S0t,e.inertiaSpin,"_lastInertiaTiltMovement"),Tl(e,e.enableTranslate,e.translateEventTypes,y0t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Tl(e,e.enableZoom,e.zoomEventTypes,D0t,e.inertiaZoom,"_lastInertiaZoomMovement"),Tl(e,e.enableLook,e.lookEventTypes,sf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);c(o)&&(e._tween=i.add(o))}i.update()}}var I0t=new mn,O0t=new sn(d.UNIT_X,0),R0t=new d,M0t=new d;function p$(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,I0t),s=d.clone(o.direction,M0t);i.mode===oe.COLUMBUS_VIEW&&d.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,O0t),l=Zn.rayPlane(r,a,R0t);c(l)&&(s=d.subtract(n,l,s),i.mode===oe.COLUMBUS_VIEW&&d.fromElements(s.y,s.z,s.x,s),d.add(o.position,s,o.position))}var fAe=new d,PAe=new he,d$=new d,h$=new ie,L0t=new d,N0t=new d,F0t=new d;function B0t(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!B.equals(o.transform,B.IDENTITY)){rf(e,t,n);return}let a,l,u=s.geodeticSurfaceNormal(o.position,L0t);if(H.equals(t,e._rotateMousePosition)){if(e._looking)sf(e,t,n,u);else if(e._rotating)rf(e,t,n);else if(e._strafing)AAe(e,n);else{if(d.magnitude(o.position)<d.magnitude(e._rotateStartPosition))return;a=d.magnitude(e._rotateStartPosition),l=d$,l.x=l.y=l.z=a,s=ie.fromCartesian3(l,h$),u$(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(o.positionWC,PAe).height,h=e._globe;if(c(h)&&f<e._minimumPickingTerrainHeight){let p=Eg(e,n.startPosition,F0t);if(c(p)){let g=!1,m=o.getPickRay(n.startPosition,yAe);if(r)g=!0,TAe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,N0t);Math.abs(d.dot(m.direction,y))<.05?g=!0:g=d.magnitude(o.position)<d.magnitude(p)}g?(H.clone(t,e._strafeEndMousePosition),d.clone(p,e._strafeStartPosition),e._strafing=!0,p$(e,n,e._strafeStartPosition)):(a=d.magnitude(p),l=d$,l.x=l.y=l.z=a,s=ie.fromCartesian3(l,h$),u$(e,t,n,s),d.clone(p,e._rotateStartPosition))}else e._looking=!0,sf(e,t,n,u)}else c(o.pickEllipsoid(n.startPosition,e._ellipsoid,fAe))?(u$(e,t,n,e._ellipsoid),d.clone(fAe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,rf(e,t,n)):(e._looking=!0,sf(e,t,n,u));H.clone(t,e._rotateMousePosition)}function rf(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,l=s.canvas,u=a.constrainedAxis;c(i)&&(a.constrainedAxis=i);let f=d.magnitude(a.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)/l.clientWidth,g=(n.startPosition.y-n.endPosition.y)/l.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let m=h*p*Math.PI*2,y=h*g*Math.PI;if(c(i)&&c(e.maximumTiltAngle)){let b=e.maximumTiltAngle,x=d.dot(a.direction,i),A=Math.PI-Math.acos(x)+y;A>b&&(y-=A-b)}o||a.rotateRight(m),r||a.rotateUp(y),a.constrainedAxis=u}var l$=se.clone(se.UNIT_W),dAe=se.clone(se.UNIT_W),_G=new d,Ow=new d,gG=new d,hAe=new d,k0t=new H,U0t=new H,V0t=new H,z0t=new H,H0t=new mn;function u$(e,t,n,i){let o=e._scene,r=o.camera,s=H.clone(n.startPosition,k0t),a=H.clone(n.endPosition,U0t),l=i.cartesianToCartographic(r.positionWC,PAe).height,u,f;if(!n.inertiaEnabled&&l<e._minimumPickingTerrainHeight&&(u=d.clone(e._panLastWorldPosition,l$),!c(e._globe)&&!H.equalsEpsilon(s,e._panLastMousePosition)&&(u=Eg(e,s,l$)),!c(e._globe)&&c(u))){let h=d.subtract(u,r.positionWC,Ow),p=d.multiplyByScalar(r.directionWC,d.dot(r.directionWC,h),Ow),g=d.magnitude(p),m=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,z0t),y=H.subtract(a,s,V0t),b=d.multiplyByScalar(r.rightWC,y.x*m.x,Ow),x=d.normalize(r.positionWC,gAe),A=r.getPickRay(a,H0t).direction,C=d.subtract(A,d.projectVector(A,r.rightWC,gG),gG),S=d.angleBetween(C,r.directionWC),v=1;c(r.frustum.fov)&&(v=Math.max(Math.tan(S),.1));let P=Math.abs(d.dot(r.directionWC,x)),M=-y.y*m.y*2/Math.sqrt(v)*(1-P),R=d.multiplyByScalar(A,M,gG);P=Math.abs(d.dot(r.upWC,x));let L=d.multiplyByScalar(r.upWC,-y.y*(1-P)*m.y,hAe);f=d.add(u,b,dAe),f=d.add(f,R,f),f=d.add(f,L,f),d.clone(f,e._panLastWorldPosition),H.clone(a,e._panLastMousePosition)}if((!c(u)||!c(f))&&(u=r.pickEllipsoid(s,i,l$),f=r.pickEllipsoid(a,i,dAe)),!c(u)||!c(f)){e._rotating=!0,rf(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),c(r.constrainedAxis)){let h=r.constrainedAxis,p=d.mostOrthogonalAxis(h,_G);d.cross(p,h,p),d.normalize(p,p);let g=d.cross(h,p,Ow),m=d.magnitude(u),y=d.dot(h,u),b=Math.acos(y/m),x=d.multiplyByScalar(h,y,gG);d.subtract(u,x,x),d.normalize(x,x);let A=d.magnitude(f),C=d.dot(h,f),S=Math.acos(C/A),v=d.multiplyByScalar(h,C,hAe);d.subtract(f,v,v),d.normalize(v,v);let P=Math.acos(d.dot(x,p));d.dot(x,g)<0&&(P=O.TWO_PI-P);let M=Math.acos(d.dot(v,p));d.dot(v,g)<0&&(M=O.TWO_PI-M);let R=P-M,L;d.equalsEpsilon(h,r.position,O.EPSILON2)?L=r.right:L=d.cross(h,r.position,_G);let F=d.cross(h,L,_G),_=d.dot(F,d.subtract(u,h,Ow)),w=d.dot(F,d.subtract(f,h,Ow)),D;_>0&&w>0?D=S-b:_>0&&w<=0?d.dot(r.position,h)>0?D=-b-S:D=b+S:D=b-S,r.rotateRight(R),r.rotateUp(D)}else{d.normalize(u,u),d.normalize(f,f);let h=d.dot(u,f),p=d.cross(u,f,_G);if(h<1&&!d.equalsEpsilon(p,d.ZERO,O.EPSILON14)){let g=Math.acos(h);r.rotate(p,g)}}}var G0t=new d,j0t=new he,mAe=0;function IAe(e,t,n){c(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,l=e._cameraUnderground,u;l?u=t:(u=wAe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,vAe),h,p=o.cartesianToCartographic(s.position,j0t).height,g=Math.abs(mAe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(h=Eg(e,u,DAe));let y;if(c(h)&&(y=d.distance(f.origin,h),mAe=y),l){let x=bAe(e,f,p);c(y)?y=Math.min(y,x):y=x}c(y)||(y=p);let b=d.normalize(s.position,G0t);m$(e,t,n,e.zoomFactor,y,d.dot(b,s.direction))}var OAe=new H,TG=new mn,JB=new d,W0t=new d,RAe=new B,q0t=new B,MAe=new B,Y0t=new Le,X0t=new J,_$=new he,g$=new d;function K0t(e,t,n){let o=e._scene.camera;if(!B.equals(o.transform,B.IDENTITY))return;if(c(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,g$);sf(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,_$);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Z0t(e,t,n)):Q0t(e,t,n)}var $0t=new he;function Z0t(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,$0t).height;if(a-s-1<O.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let l=o.canvas,u=OAe;u.x=l.clientWidth/2,u.y=l.clientHeight/2;let f=r.getPickRay(u,TG),h,p=Zn.rayEllipsoid(f,i);if(c(p))h=mn.getPoint(f,p.start,JB);else if(a>e._minimumTrackBallHeight){let A=Zn.grazingAltitudeLocation(f,i);if(!c(A))return;let C=i.cartesianToCartographic(A,_$);C.height=0,h=i.cartographicToCartesian(C,JB)}else{e._looking=!0;let A=e._ellipsoid.geodeticSurfaceNormal(r.position,g$);sf(e,t,n,A),H.clone(t,e._tiltCenterMousePosition);return}let g=Ot.eastNorthUpToFixedFrame(h,i,RAe),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let b=B.clone(r.transform,MAe);r._setTransform(g),rf(e,t,n,d.UNIT_Z),r._setTransform(b),e._globe=m,e._ellipsoid=y;let x=y.maximumRadius;e._rotateFactor=1/x,e._rotateRateRangeAdjustment=x}function Q0t(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,l,u;if(H.equals(t,e._tiltCenterMousePosition))a=d.clone(e._tiltCenter,JB);else{if(a=Eg(e,t,JB),!c(a)){if(l=r.getPickRay(t,TG),u=Zn.rayEllipsoid(l,i),!c(u)){if(i.cartesianToCartographic(r.position,_$).height<=e._minimumTrackBallHeight){e._looking=!0;let w=e._ellipsoid.geodeticSurfaceNormal(r.position,g$);sf(e,t,n,w),H.clone(t,e._tiltCenterMousePosition)}return}a=mn.getPoint(l,u.start,JB)}s&&(c(l)||(l=r.getPickRay(t,TG)),xAe(e,l,a,a)),H.clone(t,e._tiltCenterMousePosition),d.clone(a,e._tiltCenter)}let f=o.canvas,h=OAe;h.x=f.clientWidth/2,h.y=e._tiltCenterMousePosition.y,l=r.getPickRay(h,TG);let p=d.magnitude(a),g=d.fromElements(p,p,p,d$),m=ie.fromCartesian3(g,h$);if(u=Zn.rayEllipsoid(l,m),!c(u))return;let y=d.magnitude(l.origin)>p?u.start:u.stop,b=mn.getPoint(l,y,W0t),x=Ot.eastNorthUpToFixedFrame(a,i,RAe),A=Ot.eastNorthUpToFixedFrame(b,m,q0t),C=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=d.UNIT_Z,P=B.clone(r.transform,MAe);r._setTransform(A);let M=d.cross(b,r.positionWC,xG);if(d.dot(r.rightWC,M)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let w=r.constrainedAxis;r.constrainedAxis=void 0,rf(e,t,n,v,!0,!1),r.constrainedAxis=w}else rf(e,t,n,v,!0,!1);if(r._setTransform(x),rf(e,t,n,v,!1,!0),c(r.constrainedAxis)){let _=d.cross(r.direction,r.constrainedAxis,xG);d.equalsEpsilon(_,d.ZERO,O.EPSILON6)||(d.dot(_,r.right)<0&&d.negate(_,_),d.cross(_,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(P),e._globe=C,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let F=d.clone(r.positionWC,xG);if(e.enableCollisionDetection&&y$(e,!0),!d.equals(r.positionWC,F)){r._setTransform(A),r.worldToCameraCoordinatesPoint(F,F);let _=d.magnitudeSquared(F);d.magnitudeSquared(r.position)>_&&(d.normalize(r.position,r.position),d.multiplyByScalar(r.position,Math.sqrt(_),r.position));let w=d.angleBetween(F,r.position),D=d.cross(F,r.position,F);d.normalize(D,D);let I=Le.fromAxisAngle(D,w,Y0t),N=J.fromQuaternion(I,X0t);J.multiplyByVector(N,r.direction,r.direction),J.multiplyByVector(N,r.up,r.up),d.cross(r.direction,r.up,r.right),d.cross(r.right,r.direction,r.up),r._setTransform(P)}}var J0t=new H,ebt=new H,pAe=new mn,_Ae=new mn,tbt=new d,nbt=new d;function sf(e,t,n,i){let r=e._scene.camera,s=J0t;s.x=n.startPosition.x,s.y=0;let a=ebt;a.x=n.endPosition.x,a.y=0;let l=r.getPickRay(s,pAe),u=r.getPickRay(a,_Ae),f=0,h,p;r.frustum instanceof on?(h=l.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=l.direction,p=u.direction);let g=d.dot(h,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(c(i)?r.look(i,-f):c(m)?r.look(m,-f):r.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,l=r.getPickRay(s,pAe),u=r.getPickRay(a,_Ae),f=0,r.frustum instanceof on?(h=l.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=l.direction,p=u.direction),g=d.dot(h,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,c(i)){let y=r.direction,b=d.negate(i,tbt),x=d.equalsEpsilon(y,i,O.EPSILON2),A=d.equalsEpsilon(y,b,O.EPSILON2);if(!x&&!A){g=d.dot(y,i);let C=O.acosClamped(g);f>0&&f>C&&(f=C-O.EPSILON4),g=d.dot(y,b),C=O.acosClamped(g),f<0&&-f>C&&(f=-C+O.EPSILON4);let S=d.cross(i,y,nbt);r.look(S,f)}else(x&&f<0||A&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function ibt(e){Tl(e,e.enableRotate,e.rotateEventTypes,B0t,e.inertiaSpin,"_lastInertiaSpinMovement"),Tl(e,e.enableZoom,e.zoomEventTypes,IAe,e.inertiaZoom,"_lastInertiaZoomMovement"),Tl(e,e.enableTilt,e.tiltEventTypes,K0t,e.inertiaSpin,"_lastInertiaTiltMovement"),Tl(e,e.enableLook,e.lookEventTypes,sf)}var obt=new B,rbt=new he;function y$(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??ie.WGS84,s=n.mapProjection,a,l;B.equals(o.transform,B.IDENTITY)||(a=B.clone(o.transform,obt),l=d.magnitude(o.position),o._setTransform(B.IDENTITY));let u=rbt;i===oe.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(c(h)){let p=h+e.minimumZoomDistance,g=h-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===oe.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=g*.1}}c(a)&&(o._setTransform(a),f&&(d.normalize(o.position,o.position),d.negate(o.position,o.direction),d.multiplyByScalar(o.position,Math.max(l,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)))}e3.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 sbt=new d,abt=new d;e3.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;B.equals(t.transform,B.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ie.default):(this._globe=void 0,this._ellipsoid=ie.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Dr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Dr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Dr.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&c(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=d.clone(t.positionWC,sbt),l=d.clone(t.directionWC,abt);if(i===oe.SCENE2D?r0t(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=d.UNIT_Z,P0t(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,ibt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!d.equals(a,t.positionWC)||!d.equals(l,t.directionWC);y$(this,u)}this._aggregator.reset()};e3.prototype.isDestroyed=function(){return!1};e3.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),de(this)};var t3=e3;var n3=`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 i3=`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; } 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 Sg(){this._sceneFramebuffer=new QT;let e=.125,t=new Array(6);t[0]=new ho({fragmentShader:su,textureScale:e,forcePowerOfTwo:!0,sampleMode:ef.LINEAR});let n=t[1]=new ho({fragmentShader:i3,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new H,t[2]=new ho({fragmentShader:F0,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 ho({fragmentShader:F0,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 ho({fragmentShader:su,sampleMode:ef.LINEAR}),this._uCenter=new H,this._uRadius=void 0,t[5]=new ho({fragmentShader:n3,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new au({stages:t});let o=new rA(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}Sg.prototype.get=function(e){return this._stages.get(e)};Sg.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 cbt=new se,LAe=new H,lbt=new H,NAe=new B;function ubt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,l=B.computeViewportTransformation(n,0,1,NAe),u=B.multiplyByPoint(r,o,cbt),f=Ot.pointToGLWindowCoordinates(s,l,o,LAe);u.x+=O.SOLAR_RADIUS;let h=Ot.pointToGLWindowCoordinates(a,l,u,u),p=H.magnitude(H.subtract(h,f,h))*30*2,g=lbt;g.x=p,g.y=p,e._uCenter=H.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,b=e._stages,x=b.get(0),A=x.outputTexture.width,C=x.outputTexture.height,S=new Ke;S.width=A,S.height=C,l=B.computeViewportTransformation(S,0,1,NAe),f=Ot.pointToGLWindowCoordinates(s,l,o,LAe),g.x*=A/m,g.y*=C/y;let v=x.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,m),v.height=Math.min(g.y,y);for(let P=1;P<4;++P)Ke.clone(v,b.get(P).scissorRectangle)}Sg.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};Sg.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),ubt(this,t,n),o};Sg.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)};Sg.prototype.copy=function(e,t){if(!c(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(su,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Sg.prototype.isDestroyed=function(){return!1};Sg.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),de(this)};var o3=Sg;function FAe(){this._cachedShowFrustumsShaders={}}function fbt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function dbt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=He.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 s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; `,a+=`uniform vec3 debugShowFrustumsColor; `,a+=`void main() { czm_Debug_main(); `;let l;if(s>0)for(l=0;l<s;++l)a+=` out_FragData_${r[l]}.rgb *= debugShowCommandsColor; `,a+=` out_FragData_${r[l]}.rgb *= debugShowFrustumsColor; `;else a+=` out_FragColor.rgb *= debugShowCommandsColor; `,a+=` out_FragColor.rgb *= debugShowFrustumsColor; `;a+="}",o.sources.push(a);let u=fbt(i);return Jt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var r3=new G;function hbt(e,t){let n;return c(t.uniformMap)?n=t.uniformMap:n={},c(n.debugShowCommandsColor)||c(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(c(t._debugColor)||(t._debugColor=G.fromRandom()),t._debugColor):G.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(r3.red=t.debugOverlappingFrustums&1?1:0,r3.green=t.debugOverlappingFrustums&2?1:0,r3.blue=t.debugOverlappingFrustums&4?1:0,r3.alpha=1,r3):G.WHITE}),n}var mbt=new Qe;FAe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];c(o)||(o=dbt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=Qe.shallowClone(t,mbt);r.shaderProgram=o,r.uniformMap=hbt(e,t),r.execute(e.context,n)};var s3=FAe;function fA(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Dn}fA.fromKeyframeNode=function(e,t,n,i){T.typeOf.object("primitive",e),T.typeOf.number("tileIndex",t),T.typeOf.number("sampleIndex",n),T.typeOf.object("keyframeNode",i);let o=new fA(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=pbt(e,s,n),o._orientedBoundingBox=gbt(e,r,n,o._orientedBoundingBox),o};function pbt(e,t,n){if(!c(t)||!c(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,s={};for(let a=0;a<i.length;a++){let l=i[a],u=at.getComponentCount(o[a]),f=r[a].slice(n*u,(n+1)*u);s[l]=f}return s}var BAe=new d,_bt=new d;function gbt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,l=Math.floor(a/o.x),u=a-l*o.x,f=d.fromElements(u,l,s,BAe),h=d.divideComponents(d.subtract(f,e._paddingBefore,BAe),e.dimensions,_bt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(fA.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()}}});fA.prototype.hasProperty=function(e){return c(this._metadata[e])};fA.prototype.getNames=function(){return Object.keys(this._metadata)};fA.prototype.getProperty=function(e){return this._metadata[e]};var a3=fA;var c3=`struct Ray { vec3 pos; vec3 dir; vec3 rawDir; }; #if defined(JITTER) float hash(vec2 p) { vec3 p3 = fract(vec3(p.xyx) * 50.0); p3 += dot(p3, p3.yzx + 19.19); return fract((p3.x + p3.y) * p3.z); } #endif float minComponent(in vec3 v) { return min(min(v.x, v.y), v.z); } float maxComponent(in vec3 v) { return max(max(v.x, v.y), v.z); } struct PointJacobianT { vec3 point; mat3 jacobianT; }; `;var l3=`#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops #if defined(PICKING_VOXEL) #define ALPHA_ACCUM_MAX 0.1 #else #define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0 #endif uniform mat3 u_transformDirectionViewToLocal; uniform vec3 u_cameraPositionUv; uniform float u_stepSize; #if defined(PICKING) uniform vec4 u_pickColor; #endif vec3 getSampleSize(in int level) { vec3 sampleCount = exp2(float(level)) * vec3(u_dimensions); vec3 sampleSizeUv = 1.0 / sampleCount; return scaleShapeUvToShapeSpace(sampleSizeUv); } #define MINIMUM_STEP_SCALAR (0.02) #define SHIFT_FRACTION (0.001) 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 = 2.0 * viewRay.rawDir * jacobianT; vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient; RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay); vec3 voxelNormal = normalize(jacobianT * voxelIntersection.entry.xyz); 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) { 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) { vec3 maxCoordinate = vec3(u_inputDimensions) - vec3(0.5); vec3 inputCoordinate = clamp(sampleData.inputCoordinate, vec3(0.0), maxCoordinate); ivec3 sampleIndex = ivec3(floor(inputCoordinate)); return sampleIndex.x + u_inputDimensions.x * (sampleIndex.y + u_inputDimensions.y * sampleIndex.z); } void main() { vec4 fragCoord = gl_FragCoord; vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz); vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); vec3 viewPosUv = u_cameraPositionUv; #if defined(SHAPE_ELLIPSOID) vec3 rawDir = viewDirUv * u_ellipsoidRadiiUv; Ray viewRayUv = Ray(viewPosUv, viewDirUv, rawDir); #else Ray viewRayUv = Ray(viewPosUv, viewDirUv, viewDirUv); #endif Intersections ix; RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix); if (shapeIntersection.entry.w == NO_HIT) { discard; } float currentT = shapeIntersection.entry.w; float endT = shapeIntersection.exit.w; vec3 positionUv = viewPosUv + currentT * viewDirUv; PointJacobianT pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv); TraversalData traversalData; SampleData sampleDatas[SAMPLE_COUNT]; traverseOctreeFromBeginning(pointJacobian.point, traversalData, sampleDatas); vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT); #if defined(JITTER) float noise = hash(screenCoord); currentT += noise * step.w; positionUv += noise * step.w * viewDirUv; #endif FragmentInput fragmentInput; #if defined(STATISTICS) setStatistics(fragmentInput.metadata.statistics); #endif vec4 colorAccum = vec4(0.0); for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) { Properties properties = accumulatePropertiesFromMegatexture(sampleDatas); copyPropertiesToMetadata(properties, fragmentInput.metadata); fragmentInput.voxel.positionUv = positionUv; fragmentInput.voxel.positionShapeUv = pointJacobian.point; fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv; fragmentInput.voxel.viewDirUv = viewDirUv; fragmentInput.voxel.viewDirWorld = viewDirWorld; fragmentInput.voxel.surfaceNormal = step.xyz; fragmentInput.voxel.travelDistance = step.w; fragmentInput.voxel.stepCount = stepCount; fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex; fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0]); czm_modelMaterial materialOutput; fragmentMain(fragmentInput, materialOutput); vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha); color.rgb = max(color.rgb, vec3(0.0)); color.a = clamp(color.a, 0.0, 1.0); colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a); if (colorAccum.a > ALPHA_ACCUM_MAX) { colorAccum.a = ALPHA_ACCUM_MAX; break; } if (step.w == 0.0) { step.w == 0.00001; } currentT += step.w; positionUv = viewPosUv + currentT * viewDirUv; if (currentT > endT) { #if (INTERSECTION_COUNT == 1) break; #else shapeIntersection = nextIntersection(ix); if (shapeIntersection.entry.w == NO_HIT) { break; } else { currentT = shapeIntersection.entry.w; endT = shapeIntersection.exit.w; positionUv = viewPosUv + currentT * viewDirUv; } #endif } pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv); traverseOctreeFromExisting(pointJacobian.point, traversalData, sampleDatas); step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT); } colorAccum.a /= ALPHA_ACCUM_MAX; #if defined(PICKING) if (colorAccum.a == 0.0) { discard; } out_FragColor = u_pickColor; #elif defined(PICKING_VOXEL) 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 u3=`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 f3=`#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 { vec4 intersections[INTERSECTION_COUNT * 2]; #if (INTERSECTION_COUNT > 1) 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); } #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) { const int sortPasses = INTERSECTION_COUNT * 2 - 1; for (int n = sortPasses; n > 0; --n) { for (int i = 0; i < sortPasses; ++i) { 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; } } 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) { if (i < ix.index) { continue; } ix.index = i + 1; surfaceIntersection = ix.intersections[i]; int intersectionType = int(length(surfaceIntersection.xyz) - 0.5); bool currShapeIsPositive = intersectionType < 2; bool enter = intMod(intersectionType, 2) == 0; ix.surroundCount += enter ? +1 : -1; ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive; if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { shapeIntersection.entry = surfaceIntersection; } bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; if (exitPositive || enterNegativeFromPositive) { shapeIntersection.exit = surfaceIntersection; if (exitPositive) { ix.index = passCount; } break; } } return shapeIntersection; } #endif `;var d3=`uniform mat4 u_transformPositionViewToUv; void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); if (logDepthOrDepth != 0.0) { vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth); eyeCoordinateDepth /= eyeCoordinateDepth.w; vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth); float t = dot(depthPositionUv - ray.pos, ray.dir); setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT)); } else { setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); } } `;var h3=`uniform sampler2D u_clippingPlanesTexture; uniform mat4 u_clippingPlanesMatrix; vec4 intersectPlane(in Ray ray, in vec4 plane) { vec3 n = plane.xyz; float w = plane.w; float a = dot(ray.pos, n); float b = dot(ray.dir, n); float t = -(w + a) / b; return vec4(n, t); } void intersectClippingPlanes(in Ray ray, inout Intersections ix) { vec4 backSide = vec4(-ray.dir, -INF_HIT); vec4 farSide = vec4(ray.dir, +INF_HIT); RayShapeIntersection clippingVolume; #if (CLIPPING_PLANES_COUNT == 1) vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix); vec4 intersection = intersectPlane(ray, planeUv); bool reflects = dot(ray.dir, intersection.xyz) < 0.0; clippingVolume.entry = reflects ? backSide : intersection; clippingVolume.exit = reflects ? intersection : farSide; setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); #elif defined(CLIPPING_PLANES_UNION) vec4 firstTransmission = vec4(ray.dir, +INF_HIT); vec4 lastReflection = vec4(-ray.dir, -INF_HIT); for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); vec4 intersection = intersectPlane(ray, planeUv); if (dot(ray.dir, planeUv.xyz) > 0.0) { firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission; } else { lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection; } } clippingVolume.entry = backSide; clippingVolume.exit = lastReflection; setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume); clippingVolume.entry = firstTransmission; clippingVolume.exit = farSide; setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume); #else // intersection vec4 lastTransmission = vec4(ray.dir, -INF_HIT); vec4 firstReflection = vec4(-ray.dir, +INF_HIT); for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); vec4 intersection = intersectPlane(ray, planeUv); if (dot(ray.dir, planeUv.xyz) > 0.0) { lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission; } else { firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection; } } if (lastTransmission.w < firstReflection.w) { clippingVolume.entry = lastTransmission; clippingVolume.exit = firstReflection; } else { clippingVolume.entry = vec4(-ray.dir, NO_HIT); clippingVolume.exit = vec4(ray.dir, NO_HIT); } setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); #endif } `;var Rw=`vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) { float normalSign = positiveNormal ? 1.0 : -1.0; vec2 planeNormal = vec2(-sin(angle), cos(angle)) * normalSign; vec2 position = ray.pos.xy; vec2 direction = ray.dir.xy; float approachRate = dot(direction, planeNormal); float distance = -dot(position, planeNormal); float t = (approachRate == 0.0) ? NO_HIT : distance / approachRate; return vec4(planeNormal, 0.0, t); } RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal) { vec4 intersection = intersectLongitude(ray, angle, positiveNormal); vec4 farSide = vec4(normalize(ray.dir), INF_HIT); bool hitFront = (intersection.w > 0.0) == (dot(ray.pos.xy, intersection.xy) > 0.0); if (!hitFront) { return RayShapeIntersection(intersection, farSide); } else { return RayShapeIntersection(-1.0 * farSide, intersection); } } void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2]) { intersections[0] = intersectHalfSpace(ray, minMaxAngle.x, false); intersections[1] = intersectHalfSpace(ray, minMaxAngle.y, true); } bool hitPositiveHalfPlane(in Ray ray, in vec4 intersection, in bool positiveNormal) { float normalSign = positiveNormal ? 1.0 : -1.0; vec2 planeDirection = vec2(intersection.y, -intersection.x) * normalSign; vec2 hit = ray.pos.xy + intersection.w * ray.dir.xy; return dot(hit, planeDirection) > 0.0; } void intersectHalfPlane(in Ray ray, in float angle, out RayShapeIntersection intersections[2]) { vec4 intersection = intersectLongitude(ray, angle, true); vec4 farSide = vec4(normalize(ray.dir), INF_HIT); if (hitPositiveHalfPlane(ray, intersection, true)) { intersections[0].entry = -1.0 * farSide; intersections[0].exit = vec4(-1.0 * intersection.xy, 0.0, intersection.w); intersections[1].entry = intersection; intersections[1].exit = farSide; } else { vec4 miss = vec4(normalize(ray.dir), NO_HIT); intersections[0].entry = -1.0 * farSide; intersections[0].exit = farSide; intersections[1].entry = miss; intersections[1].exit = miss; } } RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle) { vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false); vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true); 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) { return RayShapeIntersection(first, last); } else if (!exitFromInside && enterFromOutside) { return RayShapeIntersection(-1.0 * farSide, first); } else if (exitFromInside && !enterFromOutside) { return RayShapeIntersection(last, farSide); } else { return RayShapeIntersection(miss, miss); } } `;var m3=`uniform vec3 u_renderMinBounds; uniform vec3 u_renderMaxBounds; RayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound) { vec3 t0 = (minBound - ray.pos) / ray.dir; vec3 t1 = (maxBound - ray.pos) / ray.dir; vec3 entries = min(t0, t1); vec3 exits = max(t0, t1); vec3 directions = sign(ray.dir); float lastEntry = maxComponent(entries); bvec3 isLastEntry = equal(entries, vec3(lastEntry)); vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions; vec4 entry = vec4(entryNormal, lastEntry); float firstExit = minComponent(exits); bvec3 isFirstExit = equal(exits, vec3(firstExit)); vec3 exitNormal = vec3(isLastEntry) * directions; vec4 exit = vec4(exitNormal, firstExit); if (entry.w > exit.w) { entry.w = NO_HIT; exit.w = NO_HIT; } return RayShapeIntersection(entry, exit); } void intersectShape(in Ray ray, inout Intersections ix) { RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds); setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); } `;var p3=`uniform vec2 u_cylinderRenderRadiusMinMax; uniform vec2 u_cylinderRenderHeightMinMax; #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) uniform vec2 u_cylinderRenderAngleMinMax; #endif RayShapeIntersection intersectHeightBounds(in Ray ray, in vec2 minMaxHeight, in bool convex) { float zPosition = ray.pos.z; float zDirection = ray.dir.z; float tmin = (minMaxHeight.x - zPosition) / zDirection; float tmax = (minMaxHeight.y - zPosition) / zDirection; float signFlip = convex ? 1.0 : -1.0; vec4 intersectMin = vec4(0.0, 0.0, -1.0 * signFlip, tmin); vec4 intersectMax = vec4(0.0, 0.0, 1.0 * signFlip, tmax); bool topEntry = zDirection < 0.0; vec4 entry = topEntry ? intersectMax : intersectMin; vec4 exit = topEntry ? intersectMin : intersectMax; return RayShapeIntersection(entry, exit); } RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex) { vec2 position = ray.pos.xy; vec2 direction = ray.dir.xy; float a = dot(direction, direction); float b = dot(position, direction); float c = dot(position, position) - radius * radius; float determinant = b * b - a * c; if (determinant < 0.0) { vec4 miss = vec4(normalize(ray.dir), NO_HIT); return RayShapeIntersection(miss, miss); } determinant = sqrt(determinant); float t1 = (-b - determinant) / a; float t2 = (-b + determinant) / a; float signFlip = convex ? 1.0 : -1.0; vec4 intersect1 = vec4(normalize(position + t1 * direction) * signFlip, 0.0, t1); vec4 intersect2 = vec4(normalize(position + t2 * direction) * signFlip, 0.0, t2); return RayShapeIntersection(intersect1, intersect2); } RayShapeIntersection intersectBoundedCylinder(in Ray ray, in float radius, in vec2 minMaxHeight) { RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true); RayShapeIntersection heightBoundsIntersection = intersectHeightBounds(ray, minMaxHeight, true); return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection); } void intersectShape(Ray ray, inout Intersections ix) { ray.pos = ray.pos * 2.0 - 1.0; ray.dir *= 2.0; RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, u_cylinderRenderRadiusMinMax.y, u_cylinderRenderHeightMinMax); setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect); if (outerIntersect.entry.w == NO_HIT) { return; } #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false); setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); #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 _3=`#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) uniform vec2 u_ellipsoidRenderLongitudeMinMax; #endif uniform float u_eccentricitySquared; uniform vec2 u_ellipsoidRenderLatitudeSinMinMax; uniform vec2 u_clipMinMaxHeight; RayShapeIntersection intersectZPlane(in Ray ray, in float z) { float t = -ray.pos.z / ray.dir.z; bool startsOutside = sign(ray.pos.z) == sign(z); bool entry = (t >= 0.0) != startsOutside; vec4 intersect = vec4(0.0, 0.0, z, t); vec4 farSide = vec4(normalize(ray.dir), INF_HIT); if (entry) { return RayShapeIntersection(intersect, farSide); } else { return RayShapeIntersection(-1.0 * farSide, intersect); } } RayShapeIntersection intersectHeight(in Ray ray, in float relativeHeight, in bool convex) { vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight); vec3 position = ray.pos * radiiCorrection; vec3 direction = ray.dir * radiiCorrection; float a = dot(direction, direction); float b = dot(direction, position); float c = dot(position, position) - 1.0; float determinant = b * b - a * c; if (determinant < 0.0) { vec4 miss = vec4(normalize(direction), NO_HIT); return RayShapeIntersection(miss, miss); } determinant = sqrt(determinant); float signB = b < 0.0 ? -1.0 : 1.0; float t1 = (-b - signB * determinant) / a; float t2 = c / (a * t1); float tmin = min(t1, t2); float tmax = max(t1, t2); float directionScale = convex ? 1.0 : -1.0; vec3 d1 = directionScale * normalize(position + tmin * direction); vec3 d2 = directionScale * normalize(position + tmax * direction); return RayShapeIntersection(vec4(d1, tmin), vec4(d2, tmax)); } 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; 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) { return (b == 0.0) ? vec2(NO_HIT) : vec2(-0.5 * c / b, NO_HIT); } determinant = sqrt(determinant); float signB = b < 0.0 ? -1.0 : 1.0; float t1 = (-b - signB * determinant) / a; float t2 = c / (a * t1); float tmin = min(t1, t2); float tmax = max(t1, t2); return vec2(tmin, tmax); } vec3 getConeNormal(in vec3 p, in bool convex) { vec2 radial = -abs(p.z) * normalize(p.xy); float zSign = (p.z < 0.0) ? -1.0 : 1.0; float z = length(p.xy) * zSign; float flip = (convex) ? -1.0 : 1.0; return normalize(vec3(radial, z) * flip); } float getLatitudeConeShift(in float sinLatitude) { float x2 = u_eccentricitySquared * sinLatitude * sinLatitude; float primeVerticalRadius = inversesqrt(1.0 - x2); return primeVerticalRadius * u_eccentricitySquared * sinLatitude; } void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) { ray.pos = ray.pos * u_ellipsoidRadiiUv; ray.dir = ray.dir * u_ellipsoidRadiiUv; 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); intersections[0].entry = -1.0 * farSide; intersections[0].exit = farSide; intersections[1].entry = miss; intersections[1].exit = miss; if (intersect.x == NO_HIT) { return; } 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) { } 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) { ray.pos = ray.pos * u_ellipsoidRadiiUv; ray.dir = ray.dir * u_ellipsoidRadiiUv; 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); } float tmin = intersect.x; float tmax = intersect.y; vec3 p0 = ray.pos + tmin * ray.dir; vec3 p1 = ray.pos + tmax * ray.dir; vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin); vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax); bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle); bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle); if (p0InShadowCone && p1InShadowCone) { return RayShapeIntersection(miss, miss); } else if (p0InShadowCone) { return RayShapeIntersection(intersect1, farSide); } else if (p1InShadowCone) { return RayShapeIntersection(-1.0 * farSide, intersect0); } else { return RayShapeIntersection(intersect0, intersect1); } } void intersectShape(in Ray ray, inout Intersections ix) { ray.pos = ray.pos * 2.0 - 1.0; ray.dir *= 2.0; RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true); setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); if (outerIntersect.entry.w == NO_HIT) { return; } RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false); if (innerIntersect.entry.w == NO_HIT) { setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); } else { 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); setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); } #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 #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 #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 dA=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) { intersectShape(ray, ix); RayShapeIntersection intersection = getFirstIntersection(ix); if (intersection.entry.w == NO_HIT) { return intersection; } #if defined(CLIPPING_PLANES) intersectClippingPlanes(ray, ix); #endif #if defined(DEPTH_TEST) intersectDepth(screenCoord, ray, ix); #endif #if (INTERSECTION_COUNT > 1) initializeIntersections(ix); for (int i = 0; i < INTERSECTION_COUNT; ++i) { intersection = nextIntersection(ix); if (intersection.exit.w > 0.0) { intersection.entry.w = max(intersection.entry.w, 0.0); break; } } #else intersection.entry.w = max(intersection.entry.w, 0.0); #endif return intersection; } `;var g3=`#if defined(BOX_HAS_SHAPE_BOUNDS) uniform vec3 u_boxUvToShapeUvScale; uniform vec3 u_boxUvToShapeUvTranslate; #endif PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) { return PointJacobianT(positionUv, mat3(0.5)); } vec3 convertShapeToShapeUvSpace(in vec3 positionShape) { #if defined(BOX_HAS_SHAPE_BOUNDS) return positionShape * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate; #else return positionShape; #endif } PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); return pointJacobian; } vec3 convertShapeUvToUvSpace(in vec3 shapeUv) { #if defined(BOX_HAS_SHAPE_BOUNDS) return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale; #else return shapeUv; #endif } vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { #if defined(BOX_HAS_SHAPE_BOUNDS) return shapeUv / u_boxUvToShapeUvScale; #else return shapeUv; #endif } `;var y3=`#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) uniform vec2 u_cylinderUvToShapeUvRadius; #endif #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) uniform vec2 u_cylinderUvToShapeUvHeight; #endif #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) uniform vec2 u_cylinderUvToShapeUvAngle; #endif #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) uniform vec2 u_cylinderShapeUvAngleMinMax; #endif #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) uniform float u_cylinderShapeUvAngleRangeZeroMid; #endif PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) { vec3 position = positionUv * 2.0 - 1.0; float radius = length(position.xy); vec3 radial = normalize(vec3(position.xy, 0.0)); float height = positionUv.z; vec3 z = vec3(0.0, 0.0, 1.0); float angle = atan(position.y, position.x); vec3 east = normalize(vec3(-position.y, position.x, 0.0)); vec3 point = vec3(radius, angle, height); mat3 jacobianT = mat3(radial, z, east / length(position.xy)); return PointJacobianT(point, jacobianT); } vec3 convertShapeToShapeUvSpace(in vec3 positionShape) { float radius = positionShape.x; #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y; #endif float angle = (positionShape.y + czm_pi) / czm_twoPi; #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid); #endif #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle; #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle; #endif angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; #endif float height = positionShape.z; #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; #endif return vec3(radius, angle, height); } PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); return pointJacobian; } vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { float radius = shapeUv.x; #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) radius /= u_cylinderUvToShapeUvRadius.x; #endif float angle = shapeUv.y * czm_twoPi; #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) angle /= u_cylinderUvToShapeUvAngle.x; #endif float height = shapeUv.z; #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) height /= u_cylinderUvToShapeUvHeight.x; #endif return vec3(radius, angle, height); } `;var b3=`uniform vec3 u_ellipsoidRadiiUv; uniform vec2 u_evoluteScale; uniform vec3 u_ellipsoidInverseRadiiSquaredUv; #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid; #endif #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) uniform vec2 u_ellipsoidUvToShapeUvLongitude; #endif #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) uniform vec2 u_ellipsoidUvToShapeUvLatitude; #endif uniform float u_ellipsoidInverseHeightDifferenceUv; vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) { vec2 p = abs(pos); vec2 inverseRadii = 1.0 / radii; vec2 tTrigs = vec2(0.7071067811865476); vec2 v = radii * tTrigs; vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; const int iterations = 3; for (int i = 0; i < iterations; ++i) { vec2 q = normalize(p - evolute) * length(v - evolute); tTrigs = (q + evolute) * inverseRadii; tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); v = radii * tTrigs; evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; } return vec3(v * sign(pos), length(v - evolute)); } PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) { vec3 position = positionUv * 2.0 - 1.0; position = position * u_ellipsoidRadiiUv; float longitude = atan(position.y, position.x); vec3 east = normalize(vec3(-position.y, position.x, 0.0)); float distanceFromZAxis = length(position.xy); vec2 posEllipse = vec2(distanceFromZAxis, position.z); vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadiiUv.xz); vec2 surfacePoint = surfacePointAndRadius.xy; vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquaredUv.xz); float latitude = atan(normal2d.y, normal2d.x); vec3 north = vec3(-normal2d.y * normalize(position.xy), abs(normal2d.x)); float heightSign = length(posEllipse) < length(surfacePoint) ? -1.0 : 1.0; float height = heightSign * length(posEllipse - surfacePoint); vec3 up = normalize(cross(east, north)); vec3 point = vec3(longitude, latitude, height); mat3 jacobianT = mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up); return PointJacobianT(point, jacobianT); } vec3 convertShapeToShapeUvSpace(in vec3 positionShape) { float longitude = (positionShape.x + czm_pi) / czm_twoPi; #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z); #endif #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude; #endif #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude; #endif #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y; #endif float latitude = (positionShape.y + czm_piOverTwo) / czm_pi; #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y; #endif float height = 1.0 + positionShape.z * u_ellipsoidInverseHeightDifferenceUv; return vec3(longitude, latitude, height); } PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); return pointJacobian; } vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { float longitude = shapeUv.x * czm_twoPi; #if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) longitude /= u_ellipsoidUvToShapeUvLongitude.x; #endif float latitude = shapeUv.y * czm_pi; #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) latitude /= u_ellipsoidUvToShapeUvLatitude.x; #endif float height = shapeUv.z / u_ellipsoidInverseHeightDifferenceUv; return vec3(longitude, latitude, height); } `;var x3=`#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; uniform ivec3 u_inputDimensions; #if defined(PADDING) uniform ivec3 u_paddingBefore; #endif struct OctreeNodeData { int data; int flag; }; struct TraversalData { ivec4 octreeCoords; int parentOctreeIndex; }; struct SampleData { int megatextureIndex; ivec4 tileCoords; vec3 tileUv; vec3 inputCoordinate; #if (SAMPLE_COUNT > 1) float weight; #endif }; int intMod(in int a, in int b) { return a - (b * (a / b)); } int normU8_toInt(in float value) { return int(value * 255.0); } int normU8x2_toInt(in vec2 value) { return int(value.x * 255.0) + 256 * int(value.y * 255.0); } float normU8x2_toFloat(in vec2 value) { return float(normU8x2_toInt(value)) / 65535.0; } OctreeNodeData getOctreeNodeData(in vec2 octreeUv) { vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv); OctreeNodeData data; data.data = normU8x2_toInt(texData.xy); data.flag = normU8x2_toInt(texData.zw); return data; } OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex; int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow; vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); return getOctreeNodeData(octreeUv); } int getOctreeParentIndex(in int octreeIndex) { int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9; int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow; vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv); int parentOctreeIndex = normU8x2_toInt(parentData.xy); return parentOctreeIndex; } vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { float dimAtLevel = exp2(float(octreeCoords.w)); return shapePosition * dimAtLevel - vec3(octreeCoords.xyz); } vec3 getClampedTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { vec3 tileUv = getTileUv(shapePosition, octreeCoords); return clamp(tileUv, vec3(0.0), vec3(1.0)); } void addSampleCoordinates(in vec3 shapePosition, inout SampleData sampleData) { vec3 tileUv = getClampedTileUv(shapePosition, 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 = float(u_inputDimensions.y) - inputCoordinate.z; inputCoordinate.z = inputY; #elif defined(SHAPE_CYLINDER) float angle = inputCoordinate.y; float height = inputCoordinate.z; #if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)) 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; float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; 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; 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; vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY); vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1); sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy); sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw); } #endif OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) { float sizeAtLevel = exp2(-1.0 * float(traversalData.octreeCoords.w)); vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel; vec3 end = start + vec3(sizeAtLevel); OctreeNodeData childData; for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { vec3 center = 0.5 * (start + end); vec3 childCoord = step(center, shapePosition); ivec4 octreeCoords = traversalData.octreeCoords; traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1); childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord)); if (childData.flag != OCTREE_FLAG_INTERNAL) { break; } start = mix(start, center, childCoord); end = mix(center, end, childCoord); traversalData.parentOctreeIndex = childData.data; } return childData; } void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) { traversalData.octreeCoords = ivec4(0); traversalData.parentOctreeIndex = 0; OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0)); if (nodeData.flag != OCTREE_FLAG_LEAF) { nodeData = traverseOctreeDownwards(shapePosition, traversalData); } #if (SAMPLE_COUNT == 1) getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); addSampleCoordinates(shapePosition, sampleDatas[0]); #else getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); addSampleCoordinates(shapePosition, sampleDatas[0]); addSampleCoordinates(shapePosition, sampleDatas[1]); #endif } bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) { return clamp(v, minVal, maxVal) == v; } bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) { vec3 tileUv = getTileUv(shapePosition, octreeCoords); bool inside = inRange(tileUv, vec3(0.0), vec3(1.0)); return inside || octreeCoords.w == 0; } void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) { if (insideTile(shapePosition, traversalData.octreeCoords)) { for (int i = 0; i < SAMPLE_COUNT; i++) { addSampleCoordinates(shapePosition, sampleDatas[i]); } return; } for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { traversalData.octreeCoords.xyz /= 2; traversalData.octreeCoords.w -= 1; if (insideTile(shapePosition, traversalData.octreeCoords)) { break; } traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); } OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData); #if (SAMPLE_COUNT == 1) getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); addSampleCoordinates(shapePosition, sampleDatas[0]); #else getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); addSampleCoordinates(shapePosition, sampleDatas[0]); addSampleCoordinates(shapePosition, sampleDatas[1]); #endif } `;var T3=`uniform ivec2 u_megatextureSliceDimensions; uniform ivec2 u_megatextureTileDimensions; uniform vec2 u_megatextureVoxelSizeUv; uniform vec2 u_megatextureSliceSizeUv; uniform vec2 u_megatextureTileSizeUv; int intMin(int a, int b) { return a <= b ? a : b; } int intMax(int a, int b) { return a >= b ? a : b; } int intClamp(int v, int minVal, int maxVal) { return intMin(intMax(v, minVal), maxVal); } vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale) { int indexX = intMod(index, dimensions.x); int indexY = index / dimensions.x; return vec2(indexX, indexY) * uvScale; } Properties getPropertiesFromMegatexture(in SampleData sampleData) { int tileIndex = sampleData.megatextureIndex; vec3 voxelCoord = sampleData.inputCoordinate; #if defined(NEAREST_SAMPLING) voxelCoord = floor(voxelCoord) + vec3(0.5); #endif vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv); float slice = voxelCoord.z - 0.5; int sliceIndex = int(floor(slice)); int sliceIndex0 = intClamp(sliceIndex, 0, u_inputDimensions.z - 1); vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(u_inputDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv; vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset; #if defined(NEAREST_SAMPLING) return getPropertiesFromMegatextureAtUv(uv0); #else float sliceLerp = fract(slice); int sliceIndex1 = intMin(sliceIndex + 1, u_inputDimensions.z - 1); vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset; Properties properties0 = getPropertiesFromMegatextureAtUv(uv0); Properties properties1 = getPropertiesFromMegatextureAtUv(uv1); return mixProperties(properties0, properties1, sliceLerp); #endif } Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { #if (SAMPLE_COUNT == 1) return getPropertiesFromMegatexture(sampleDatas[0]); #else Properties properties = clearProperties(); for (int i = 0; i < SAMPLE_COUNT; ++i) { float weight = sampleDatas[i].weight; if (weight > 0.0) { Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); tempProperties = scaleProperties(tempProperties, weight); properties = sumProperties(properties, tempProperties); } } return properties; #endif } `;var ybt={Z_UP:0,Y_UP:1},Td=Object.freeze(ybt);function bbt(e){let t=new wb;this.shaderBuilder=t;let n=e._customShader,i=xt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let g=o[p];t.addUniform(g.type,p,ge.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",ge.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=c(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([u3]),e.provider.metadataOrder===Td.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,ge.FRAGMENT);let a=e._provider.shape;a==="BOX"?t.addDefine("SHAPE_BOX",void 0,ge.FRAGMENT):a==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,ge.FRAGMENT):a==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,ge.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",x3,c3,f3,T3]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,ge.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,ge.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,ge.FRAGMENT),t.addFragmentLines([h3])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,ge.FRAGMENT),t.addFragmentLines([d3])),a==="BOX"?t.addFragmentLines([g3,m3,dA]):a==="CYLINDER"?t.addFragmentLines([y3,Rw,p3,dA]):a==="ELLIPSOID"&&t.addFragmentLines([b3,Rw,_3,dA]),t.addFragmentLines([l3]);let l=e._shape,u=l.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];c(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,ge.FRAGMENT))}let f=l.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,ge.FRAGMENT),s===1?f+=1:r.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,ge.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,ge.FRAGMENT),(!d.equals(e.paddingBefore,d.ZERO)||!d.equals(e.paddingAfter,d.ZERO))&&t.addDefine("PADDING",void 0,ge.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,ge.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,ge.FRAGMENT);let h=e._traversal;t.addDefine("SAMPLE_COUNT",`${h._sampleCount}`,ge.FRAGMENT)}var A3=bbt;function xbt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,l=o.length,u=c(s)&&c(a);n.addDefine("METADATA_COUNT",l,ge.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],F=o[R],_=`PropertyStatistics_${L}`,w=`PropertyStatistics_${L}`;n.addStruct(_,w,ge.FRAGMENT);let D=CG(F);n.addStructField(_,D,"min"),n.addStructField(_,D,"max")}let f="Statistics",h="Statistics",p="statistics";n.addStruct(f,h,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],F=`PropertyStatistics_${L}`,_=L;n.addStructField(f,F,_)}let g="Metadata",m="Metadata",y="metadata";n.addStruct(g,m,ge.FRAGMENT),n.addStructField(g,h,p);for(let R=0;R<l;R++){let L=i[R],F=o[R],_=CG(F);n.addStructField(g,_,L)}for(let R=0;R<l;R++){let L=i[R],F=o[R],_=Abt(F),w=`VoxelProperty_${L}`,D=`VoxelProperty_${L}`;n.addStruct(w,D,ge.FRAGMENT),n.addStructField(w,_,"partialDerivativeLocal"),n.addStructField(w,_,"partialDerivativeWorld"),n.addStructField(w,_,"partialDerivativeView"),n.addStructField(w,_,"partialDerivativeValid")}let b="Voxel",x="Voxel",A="voxel";n.addStruct(b,x,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],F=`VoxelProperty_${L}`;n.addStructField(b,F,L)}n.addStructField(b,"vec3","positionEC"),n.addStructField(b,"vec3","positionUv"),n.addStructField(b,"vec3","positionShapeUv"),n.addStructField(b,"vec3","positionUvLocal"),n.addStructField(b,"vec3","viewDirUv"),n.addStructField(b,"vec3","viewDirWorld"),n.addStructField(b,"vec3","surfaceNormal"),n.addStructField(b,"float","travelDistance"),n.addStructField(b,"int","stepCount"),n.addStructField(b,"int","tileIndex"),n.addStructField(b,"int","sampleIndex");let C="FragmentInput";n.addStruct(C,"FragmentInput",ge.FRAGMENT),n.addStructField(C,m,y),n.addStructField(C,x,A);let v="Properties",P="Properties",M="properties";n.addStruct(v,P,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],F=o[R],_=CG(F);n.addStructField(v,_,L)}{let R="clearProperties";n.addFunction(R,`${P} clearProperties()`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let F=i[L],_=o[L],w=r[L],D=CG(_,w);n.addFunctionLines(R,[`${M}.${F} = ${D}(0.0);`])}n.addFunctionLines(R,[`return ${M};`])}{let R="sumProperties";n.addFunction(R,`${P} sumProperties(${P} propertiesA, ${P} propertiesB)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let F=i[L];n.addFunctionLines(R,[`${M}.${F} = propertiesA.${F} + propertiesB.${F};`])}n.addFunctionLines(R,[`return ${M};`])}{let R="scaleProperties";n.addFunction(R,`${P} scaleProperties(${P} ${M}, float scale)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} scaledProperties = ${M};`]);for(let L=0;L<l;L++){let F=i[L];n.addFunctionLines(R,[`scaledProperties.${F} *= scale;`])}n.addFunctionLines(R,["return scaledProperties;"])}{let R="mixProperties";n.addFunction(R,`${P} mixProperties(${P} propertiesA, ${P} propertiesB, float mixFactor)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let F=i[L];n.addFunctionLines(R,[`${M}.${F} = mix(propertiesA.${F}, propertiesB.${F}, mixFactor);`])}n.addFunctionLines(R,[`return ${M};`])}{let R="copyPropertiesToMetadata";n.addFunction(R,`void copyPropertiesToMetadata(in ${P} ${M}, inout ${m} ${y})`,ge.FRAGMENT);for(let L=0;L<l;L++){let F=i[L];n.addFunctionLines(R,[`${y}.${F} = ${M}.${F};`])}}if(u){let R="setStatistics";n.addFunction(R,`void setStatistics(inout ${h} ${p})`,ge.FRAGMENT);for(let L=0;L<l;L++){let F=i[L],_=o[L],w=at.getComponentCount(_);for(let D=0;D<w;D++){let I=Cbt(_,D),N=s[L][D],k=a[L][D];!c(N)||!c(k)||n.addFunctionLines(R,[`${p}.${F}.min${I} = ${kAe(N)};`,`${p}.${F}.max${I} = ${kAe(k)};`])}}}{let R="getPropertiesFromMegatextureAtUv";n.addFunction(R,`${P} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let F=i[L],_=o[L],w=r[L],D=Tbt(_,w);n.addFunctionLines(R,[`properties.${F} = texture(u_megatextureTextures[${L}], texcoord)${D};`])}n.addFunctionLines(R,[`return ${M};`])}}function CG(e){if(e===at.SCALAR)return"float";if(e===at.VEC2)return"vec2";if(e===at.VEC3)return"vec3";if(e===at.VEC4)return"vec4"}function Tbt(e){if(e===at.SCALAR)return".r";if(e===at.VEC2)return".ra";if(e===at.VEC3)return".rgb";if(e===at.VEC4)return""}function Abt(e){if(e===at.SCALAR)return"vec3";if(e===at.VEC2)return"mat2";if(e===at.VEC3)return"mat3";if(e===at.VEC4)return"mat4"}function kAe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function Cbt(e,t){return e===at.SCALAR?"":`[${t}]`}var C3=xbt;function Ebt(e,t){let n=new A3(e);C3(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let x="getClippingPlane",A=fg(o,t),C=0,S=A.indexOf(")")+1,v=A.indexOf("{",S)+1,P=A.indexOf("}",v),M=A.slice(C,S),R=A.slice(v,P);i.addFunction(x,M,ge.FRAGMENT),i.addFunctionLines(x,[R])}let s=i.clone();s.addDefine("PICKING",void 0,ge.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,ge.FRAGMENT);let l=i.buildShaderProgram(t),u=s.buildShaderProgram(t),f=a.buildShaderProgram(t),h=Ve.fromCache({cull:{enabled:!0,face:xi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),g=e._depthTest,m=new Qe({vertexArray:p,primitiveType:Me.TRIANGLES,renderState:h,shaderProgram:l,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:De.VOXELS,executeInClosestFrustum:!0,owner:this,cull:g,occlude:g}),y=Qe.shallowClone(m,new Qe);y.shaderProgram=u,y.pickOnly=!0;let b=Qe.shallowClone(m,new Qe);if(b.shaderProgram=f,b.pickOnly=!0,c(e._drawCommand)){let x=e._drawCommand;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}if(c(e._drawCommandPick)){let x=e._drawCommandPick;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}if(c(e._drawCommandPickVoxel)){let x=e._drawCommandPickVoxel;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}e._drawCommand=m,e._drawCommandPick=y,e._drawCommandPickVoxel=b}var E3=Ebt;var Sbt={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"},hA=Object.freeze(Sbt);function wbt(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 S3=wbt;function Mw(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}Mw.prototype.getTexture=function(e){return this._textures[e]};function vbt(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];c(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}Mw.prototype.loadTexture2D=function(e,t){c(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):vbt(this,e,t)};function Dbt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?EG(o,r,n):Pbt(o,r,n),a=e._textures[i];c(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function EG(e,t,n){let{typedArray:i,sampler:o}=e,r=c(i)?VAe(e,n):new Rt({context:n,source:t,sampler:o});return UAe(o)&&r.generateMipmap(),r}function Pbt(e,t,n){let{typedArray:i,sampler:o}=e,r=UAe(o),s=o.wrapS===gn.REPEAT||o.wrapS===gn.MIRRORED_REPEAT||o.wrapT===gn.REPEAT||o.wrapT===gn.MIRRORED_REPEAT,{width:a,height:l}=c(i)?e:t,u=[a,l].every(O.isPowerOfTwo);if((r||s)&&!u)if(c(i)){if(e.pixelDatatype===Ue.UNSIGNED_BYTE){let h=S3(i,a,l),p=yy(h);return EG({sampler:o},p,n)}}else{let h=yy(t);return EG(e,h,n)}else return EG(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),VAe(e,n)}function UAe(e){return[Yt.NEAREST_MIPMAP_NEAREST,Yt.NEAREST_MIPMAP_LINEAR,Yt.LINEAR_MIPMAP_NEAREST,Yt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function VAe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Rt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}Mw.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];Dbt(this,o,t)}n.length=0};Mw.prototype.isDestroyed=function(){return!1};Mw.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 de(this)};var w3=Mw;function v3(e){e=e??W.EMPTY_OBJECT,this.mode=e.mode??y_.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??W.EMPTY_OBJECT,this.varyings=e.varyings??W.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??Ly.INHERIT,this._textureManager=new w3,this._defaultTexture=void 0,this.uniformMap=Ibt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},Mbt(this),Lbt(this)}function Ibt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i],r=o.type;if(r===hA.SAMPLER_CUBE)throw new E("CustomShader does not support samplerCube uniforms");r===hA.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=Obt(e,i)):n[i]=Rbt(e,i)}return n}function Obt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function Rbt(e,t){return function(){return e.uniforms[t].value}}function mA(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function Mbt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;c(r)&&(o=e.usedVariablesVertex.attributeSet,mA(r,t,o),o=e.usedVariablesVertex.featureIdSet,mA(r,n,o),o=e.usedVariablesVertex.metadataSet,mA(r,i,o));let s=e.fragmentShaderText;if(c(s)){o=e.usedVariablesFragment.attributeSet,mA(s,t,o),o=e.usedVariablesFragment.featureIdSet,mA(s,n,o),o=e.usedVariablesFragment.metadataSet,mA(s,i,o);let a=/material\.(\w+)/g,l=e.usedVariablesFragment.materialSet;mA(s,a,l)}}function zAe(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 Nc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${zAe(t)} is not available in the ${i} shader. Did you mean ${zAe(n)} instead?`;throw new E(o)}}function Lbt(e){let t=e.usedVariablesVertex.attributeSet;Nc(t,"position","positionMC","vertex"),Nc(t,"normal","normalMC","vertex"),Nc(t,"tangent","tangentMC","vertex"),Nc(t,"bitangent","bitangentMC","vertex"),Nc(t,"positionWC","positionMC","vertex"),Nc(t,"positionEC","positionMC","vertex"),Nc(t,"normalEC","normalMC","vertex"),Nc(t,"tangentEC","tangentMC","vertex"),Nc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Nc(n,"position","positionEC","fragment"),Nc(n,"normal","normalEC","fragment"),Nc(n,"tangent","tangentEC","fragment"),Nc(n,"bitangent","bitangentEC","fragment"),Nc(n,"normalMC","normalEC","fragment"),Nc(n,"tangentMC","tangentEC","fragment"),Nc(n,"bitangentMC","bitangentEC","fragment")}v3.prototype.setUniform=function(e,t){if(T.typeOf.string("uniformName",e),T.defined("value",t),!c(this.uniforms[e]))throw new E(`Uniform ${e} must be declared in the CustomShader constructor.`);let n=this.uniforms[e];n.type===hA.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):c(t.clone)?n.value=t.clone(n.value):n.value=t};v3.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};v3.prototype.isDestroyed=function(){return!1};v3.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),de(this)};var pA=v3;function wg(e){if(T.typeOf.object("options",e),!c(e.loader)){if(!c(e.metadata))throw new E("One of loader and metadata must be defined.");if(!Array.isArray(e.metadata))throw new E("metadata must be an array of TypedArrays.")}let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(wg.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});wg.fromMetadataArray=function(e){if(T.typeOf.object("metadata",e),!Array.isArray(e))throw new E("metadata must be an array of TypedArrays.");return new wg({metadata:e})};wg.fromGltf=async function(e){T.typeOf.object("resource",e);let t=new rh({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new wg({loader:t})};wg.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!c(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:o}=n.components,{attributes:r}=o.nodes[0].primitives[0];this._metadata=Nbt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function Nbt(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(f=>f.class.id===i),{properties:l}=a,u=new Array(o.length);for(let f=0;f<e.length;f++){let h=l[o[f]].attribute,p=e.find(b=>b.name===h);if(!c(p))continue;let g=Nt.toComponentDatatype(s[f]),m=at.getComponentCount(r[f]),y=p.count*m;u[f]=$.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return u}wg.prototype.isDestroyed=function(){return!1};wg.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),de(this)};var _A=wg;function mp(){this.orientedBoundingBox=new Dn,this.boundingSphere=new le,this.boundTransform=new B,this.shapeTransform=new B,this._minBounds=mp.DefaultMinBounds.clone(),this._maxBounds=mp.DefaultMaxBounds.clone(),this.shaderUniforms={renderMinBounds:new d,renderMaxBounds:new d,boxUvToShapeUvScale:new d,boxUvToShapeUvTranslate:new d},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var Fbt=new d,b$=new d,Bbt=new J,kbt=new d,Ubt=new d,Vbt=new d,zbt=new d,HAe=B.fromRotationTranslation(J.fromUniformScale(.5,new J),new d(.5,.5,.5),new B);mp.prototype.update=function(e,t,n,i,o){T.typeOf.object("modelMatrix",e),T.typeOf.object("minBounds",t),T.typeOf.object("maxBounds",n),i=i??t.clone(kbt),o=o??n.clone(Ubt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let r=d.clamp(t,i,o,Vbt),s=d.clamp(n,i,o,zbt),a=B.getScale(e,b$);if(r.x>s.x||r.y>s.y||r.z>s.z||(r.x===s.x)+(r.y===s.y)+(r.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;this.shapeTransform=B.clone(e,this.shapeTransform),this.orientedBoundingBox=T$(r,s,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=B.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:l,shaderDefines:u}=this;for(let g in u)u.hasOwnProperty(g)&&(u[g]=void 0);let f=0;u.BOX_INTERSECTION_INDEX=f,f+=1,l.renderMinBounds=B.multiplyByPoint(HAe,r,l.renderMinBounds),l.renderMaxBounds=B.multiplyByPoint(HAe,s,l.renderMaxBounds),u.BOX_HAS_SHAPE_BOUNDS=!0;let h=t,p=n;return l.boxUvToShapeUvScale=d.fromElements(2/(h.x===p.x?1:p.x-h.x),2/(h.y===p.y?1:p.y-h.y),2/(h.z===p.z?1:p.z-h.z),l.boxUvToShapeUvScale),l.boxUvToShapeUvTranslate=d.fromElements(-l.boxUvToShapeUvScale.x*(h.x*.5+.5),-l.boxUvToShapeUvScale.y*(h.y*.5+.5),-l.boxUvToShapeUvScale.z*(h.z*.5+.5),l.boxUvToShapeUvTranslate),this.shaderMaximumIntersectionsLength=f,!0};var SG=new d,x$=new d;mp.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){T.typeOf.number("tileLevel",e),T.typeOf.number("tileX",t),T.typeOf.number("tileY",n),T.typeOf.number("tileZ",i),T.typeOf.object("result",o);let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),l=d.fromElements(O.lerp(r.x,s.x,a*t),O.lerp(r.y,s.y,a*n),O.lerp(r.z,s.z,a*i),SG),u=d.fromElements(O.lerp(r.x,s.x,a*(t+1)),O.lerp(r.y,s.y,a*(n+1)),O.lerp(r.z,s.z,a*(i+1)),x$);return T$(l,u,this.shapeTransform,o)};var GAe=new d;mp.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){T.typeOf.object("spatialNode",e),T.typeOf.object("tileDimensions",t),T.typeOf.object("tileUv",n),T.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,GAe),s=d.multiplyByScalar(r,o,GAe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,SG),o,SG),l=d.add(a,s,x$),u=this._minBounds,f=this._maxBounds,h=d.fromElements(O.lerp(u.x,f.x,a.x),O.lerp(u.y,f.y,a.y),O.lerp(u.z,f.z,a.z),SG),p=d.fromElements(O.lerp(u.x,f.x,l.x),O.lerp(u.y,f.y,l.y),O.lerp(u.z,f.z,l.z),x$);return T$(h,p,this.shapeTransform,i)};mp.DefaultMinBounds=Object.freeze(new d(-1,-1,-1));mp.DefaultMaxBounds=Object.freeze(new d(1,1,1));function T$(e,t,n,i){let o=mp.DefaultMinBounds,r=mp.DefaultMaxBounds;if(d.equals(e,o)&&d.equals(t,r))i.center=B.getTranslation(n,i.center),i.halfAxes=B.getMatrix3(n,i.halfAxes);else{let a=B.getScale(n,b$),l=d.midpoint(e,t,Fbt);i.center=B.multiplyByPoint(n,l,i.center),a=d.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),b$);let u=B.getRotation(n,Bbt);i.halfAxes=J.setScale(u,a,i.halfAxes)}return i}var gA=mp;function vg(){this.orientedBoundingBox=new Dn,this.boundingSphere=new le,this.boundTransform=new B,this.shapeTransform=new B,this._minBounds=vg.DefaultMinBounds.clone(),this._maxBounds=vg.DefaultMaxBounds.clone(),this.shaderUniforms={cylinderRenderRadiusMinMax:new H,cylinderRenderAngleMinMax:new H,cylinderRenderHeightMinMax:new H,cylinderUvToShapeUvRadius:new H,cylinderUvToShapeUvAngle:new H,cylinderUvToShapeUvHeight:new H,cylinderShapeUvAngleMinMax:new H,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var qAe=new d,Hbt=new d,Gbt=new d,jbt=new d,Wbt=new d;vg.prototype.update=function(e,t,n,i,o){T.typeOf.object("modelMatrix",e),T.typeOf.object("minBounds",t),T.typeOf.object("maxBounds",n),i=i??t.clone(Hbt),o=o??n.clone(Gbt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=vg,a=s.y-r.y,l=.5*a,u=O.EPSILON10,f=O.EPSILON3,h=O.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=O.negativePiToPi(t.y),n.y=O.negativePiToPi(n.y),i.y=O.negativePiToPi(i.y),o.y=O.negativePiToPi(o.y);let p=d.maximumByComponent(t,i,jbt),g=d.minimumByComponent(n,o,Wbt),m=B.getScale(e,qAe);if(g.x===0||p.x>g.x||p.z>g.z||O.equalsEpsilon(m.x,0,void 0,u)||O.equalsEpsilon(m.y,0,void 0,u)||O.equalsEpsilon(m.z,0,void 0,u))return!1;this.shapeTransform=B.clone(e,this.shapeTransform),this.orientedBoundingBox=E$(p,g,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=B.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let y=t.x===r.x&&n.x===s.x,b=n.y<t.y,x=n.y-t.y+b*a,A=x>l+h&&x<a-h,C=x<l-h,S=x>=l-h&&x<=l+h,v=A||C||S,P=O.equalsEpsilon(t.y,r.y,void 0,f),M=O.equalsEpsilon(n.y,s.y,void 0,f),R=t.z===r.z&&n.z===s.z,L=p.x===r.x,F=g.y<p.y,_=g.y-p.y+F*a,w=_>=l-h&&_<a-h,D=_>h&&_<l-h,I=_<=h,N=w||D||I,{shaderUniforms:k,shaderDefines:z}=this;for(let j in z)z.hasOwnProperty(j)&&(z[j]=void 0);let V=0;if(z.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=V,V+=1,L||(z.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,z.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=V,V+=1),k.cylinderRenderRadiusMinMax=H.fromElements(p.x,g.x,k.cylinderRenderRadiusMinMax),p.x===g.x&&(z.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!y){z.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let j=n.x-t.x,U=0,q=1;j!==0&&(U=1/j,q=-t.x/j),k.cylinderUvToShapeUvRadius=H.fromElements(U,q,k.cylinderUvToShapeUvRadius)}if(!R){z.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let j=n.z-t.z,U=0,q=1;j!==0&&(U=2/j,q=-(t.z+1)/j),k.cylinderUvToShapeUvHeight=H.fromElements(U,q,k.cylinderUvToShapeUvHeight)}if(k.cylinderRenderHeightMinMax=H.fromElements(p.z,g.z,k.cylinderRenderHeightMinMax),b&&(z.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),N&&(z.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,z.CYLINDER_INTERSECTION_INDEX_ANGLE=V,w?(z.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,V+=1):D?(z.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,V+=2):I&&(z.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,V+=2),k.cylinderRenderAngleMinMax=H.fromElements(p.y,g.y,k.cylinderRenderAngleMinMax)),v){z.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,P&&(z.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),M&&(z.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let j=(t.y-r.y)/a,U=(n.y-r.y)/a,q=1-x/a;if(k.cylinderShapeUvAngleMinMax=H.fromElements(j,U,k.cylinderShapeUvAngleMinMax),k.cylinderShapeUvAngleRangeZeroMid=(U+.5*q)%1,x<=h)k.cylinderUvToShapeUvAngle=H.fromElements(0,1,k.cylinderUvToShapeUvAngle);else{let Y=a/x,te=-(t.y-r.y)/x;k.cylinderUvToShapeUvAngle=H.fromElements(Y,te,k.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=V,!0};var wG=new d,C$=new d;vg.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){T.typeOf.number("tileLevel",e),T.typeOf.number("tileX",t),T.typeOf.number("tileY",n),T.typeOf.number("tileZ",i),T.typeOf.object("result",o);let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),l=d.fromElements(O.lerp(r.x,s.x,t*a),O.lerp(r.y,s.y,n*a),O.lerp(r.z,s.z,i*a),wG),u=d.fromElements(O.lerp(r.x,s.x,(t+1)*a),O.lerp(r.y,s.y,(n+1)*a),O.lerp(r.z,s.z,(i+1)*a),C$);return E$(l,u,this.shapeTransform,o)};var jAe=new d;vg.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){T.typeOf.object("spatialNode",e),T.typeOf.object("tileDimensions",t),T.typeOf.object("tileUv",n),T.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,jAe),s=d.multiplyByScalar(r,o,jAe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,wG),o,wG),l=d.add(a,s,C$),u=this._minBounds,f=this._maxBounds,h=d.fromElements(O.lerp(u.x,f.x,a.x),O.lerp(u.y,f.y,a.y),O.lerp(u.z,f.z,a.z),wG),p=d.fromElements(O.lerp(u.x,f.x,l.x),O.lerp(u.y,f.y,l.y),O.lerp(u.z,f.z,l.z),C$);return E$(h,p,this.shapeTransform,i)};vg.DefaultMinBounds=Object.freeze(new d(0,-O.PI,-1));vg.DefaultMaxBounds=Object.freeze(new d(1,+O.PI,1));var qbt=5,Ybt=new Array(qbt),Xbt=new d,Kbt=new J,$bt=new B,Zbt=new B,Qbt=new B,A$=new B,Jbt=new d,ext=new d,txt=new d,YAe=new Array(8);for(let e=0;e<8;e++)YAe[e]=new d;function WAe(e,t,n){return Math.abs(se.dot(e,t))<n}function nxt(e){let t=B.getColumn(e,0,Jbt),n=B.getColumn(e,1,ext),i=B.getColumn(e,2,txt),o=O.EPSILON4;return WAe(t,n,o)&&WAe(n,i,o)}function ixt(e,t){let n=YAe;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)B.multiplyByPoint(e,n[i],n[i]);return Dn.fromPoints(n,t)}function E$(e,t,n,i){let o=e.x,r=t.x,s=e.y,a=t.y<s?t.y+O.TWO_PI:t.y,l=e.z,u=t.z,f=a-s,h=s+f*.5,p=Ybt,g=0;p[g++]=s,p[g++]=a,p[g++]=h,f>O.PI&&(p[g++]=h-O.PI_OVER_TWO,p[g++]=h+O.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(let k=0;k<g;++k){let z=p[k]-h,V=Math.cos(z),j=Math.sin(z),U=V*o,q=j*o,Y=V*r,te=j*r;m=Math.min(m,U,Y),y=Math.min(y,q,te),b=Math.max(b,U,Y),x=Math.max(x,q,te)}let A=b-m,C=x-y,S=u-l,v=(m+b)*.5,P=(y+x)*.5,M=(l+u)*.5,R=d.fromElements(v,P,M,Xbt),L=J.fromRotationZ(h,Kbt),F=d.fromElements(A,C,S,qAe),_=B.fromScale(F,Qbt),w=B.fromRotation(L,Zbt),D=B.fromTranslation(R,$bt),I=B.multiplyTransformation(w,B.multiplyTransformation(D,_,A$),A$),N=B.multiplyTransformation(n,I,A$);return nxt(N)?Dn.fromTransformation(N,i):ixt(N,i)}var yA=vg;function Dg(){this.orientedBoundingBox=new Dn,this.boundingSphere=new le,this.boundTransform=new B,this.shapeTransform=new B,this._rectangle=new ce,this._minimumHeight=Dg.DefaultMinBounds.z,this._maximumHeight=Dg.DefaultMaxBounds.z,this._ellipsoid=new ie,this._translation=new d,this._rotation=new J,this.shaderUniforms={ellipsoidRadiiUv:new d,eccentricitySquared:0,evoluteScale:new H,ellipsoidInverseRadiiSquaredUv:new d,ellipsoidRenderLongitudeMinMax:new H,ellipsoidShapeUvLongitudeMinMaxMid:new d,ellipsoidUvToShapeUvLongitude:new H,ellipsoidUvToShapeUvLatitude:new H,ellipsoidRenderLatitudeSinMinMax:new H,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new H},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var oxt=new d,rxt=new d,sxt=new d,axt=new d,cxt=new d,lxt=new d,uxt=new d,fxt=new d,dxt=new J,XAe=new d,KAe=new d,hxt=new ce;Dg.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=Dg;i=i??r,o=o??s,T.typeOf.object("modelMatrix",e),T.typeOf.object("minBounds",t),T.typeOf.object("maxBounds",n);let a=O.EPSILON10,l=O.EPSILON3,u=O.EPSILON10,f=O.EPSILON10,h=O.EPSILON3,p=B.getScale(e,fxt),g=d.clone(r,oxt);g.z=-d.minimumComponent(p);let m=d.clamp(t,g,s,rxt),y=d.clamp(n,g,s,sxt),b=d.clamp(i,g,s,axt),x=d.clamp(o,g,s,cxt),A=d.maximumByComponent(m,b,lxt),C=d.minimumByComponent(y,x,uxt),S=d.add(p,d.fromElements(y.z,y.z,y.z,XAe),XAe),v=d.maximumComponent(S),P=d.add(p,d.fromElements(C.z,C.z,C.z,KAe),KAe);if(A.y>C.y||A.y===s.y||C.y===r.y||A.z>C.z||O.equalsEpsilon(P,d.ZERO,void 0,a))return!1;this._rectangle=ce.fromRadians(m.x,m.y,y.x,y.y),this._translation=B.getTranslation(e,this._translation),this._rotation=B.getRotation(e,this._rotation),this._ellipsoid=ie.fromCartesian3(p,this._ellipsoid),this._minimumHeight=m.z,this._maximumHeight=y.z;let M=ce.fromRadians(A.x,A.y,C.x,C.y,hxt);this.orientedBoundingBox=S$(M,A.z,C.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=B.fromRotationTranslation(J.setScale(this._rotation,S,dxt),this._translation,this.shapeTransform),this.boundTransform=B.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let R=s.x-r.x,L=.5*R,F=C.x<A.x,_=C.x-A.x+F*R,w=_<=u,D=_>=L-u&&_<R-u,I=_>u&&_<L-u,N=w||D||I,k=y.x<m.x,z=y.x-m.x+k*R,V=z>L+u&&z<R-u,j=z>=L-u&&z<=L+u,U=z<L-u,q=V||j||U,Y=C.y<-h,te=C.y>=-h&&C.y<=+h,K=C.y>+h&&C.y<s.y-f,Z=Y||te||K,ee=A.y>r.y+f&&A.y<-h,me=A.y>=-h&&A.y<=+h,Te=A.y>+h,ue=ee||me||Te,ye=Z||ue,Ae=y.y-m.y,Pe=y.y<-h,Ee=y.y>=-h&&y.y<=+h,ze=y.y>+h&&y.y<s.y-f,qe=Pe||Ee||ze,it=m.y>r.y+f&&m.y<-h,Dt=m.y>=-h&&m.y<=+h,jt=m.y>+h,un=qe||(it||Dt||jt),{shaderUniforms:zt,shaderDefines:Ct}=this;for(let mt in Ct)Ct.hasOwnProperty(mt)&&(Ct[mt]=void 0);zt.ellipsoidRadiiUv=d.divideByScalar(S,v,zt.ellipsoidRadiiUv);let{x:Ei,z:an}=zt.ellipsoidRadiiUv,_e=an/Ei;zt.eccentricitySquared=1-_e*_e,zt.evoluteScale=H.fromElements((Ei*Ei-an*an)/Ei,(an*an-Ei*Ei)/an,zt.evoluteScale),zt.ellipsoidInverseRadiiSquaredUv=d.divideComponents(d.ONE,d.multiplyComponents(zt.ellipsoidRadiiUv,zt.ellipsoidRadiiUv,zt.ellipsoidInverseRadiiSquaredUv),zt.ellipsoidInverseRadiiSquaredUv);let Ce=0;Ct.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Ce,Ce+=1,Ct.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Ce,Ce+=1,zt.clipMinMaxHeight=H.fromElements((A.z-y.z)/v,(C.z-y.z)/v,zt.clipMinMaxHeight);let pn=(y.z-m.z)/v;if(zt.ellipsoidInverseHeightDifferenceUv=1/pn,m.z===y.z&&(zt.ellipsoidInverseHeightDifferenceUv=0),N&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Ce,D?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Ce+=1):I?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Ce+=2):w&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Ce+=2),zt.ellipsoidRenderLongitudeMinMax=H.fromElements(A.x,C.x,zt.ellipsoidRenderLongitudeMinMax)),q)if(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,y.x<m.x&&(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),z<=u)zt.ellipsoidUvToShapeUvLongitude=H.fromElements(0,1,zt.ellipsoidUvToShapeUvLongitude);else{let so=R/z,Ro=-(m.x-r.x)/z;zt.ellipsoidUvToShapeUvLongitude=H.fromElements(so,Ro,zt.ellipsoidUvToShapeUvLongitude)}if(N){let mt=O.equalsEpsilon(A.x,r.x,void 0,l),so=O.equalsEpsilon(C.x,s.x,void 0,l);mt&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),so&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Ro=(m.x-r.x)/R,aa=(y.x-r.x)/R,Nr=(C.x-r.x)/R,Cs=1-_/R,Ne=(Nr+.5*Cs)%1;zt.ellipsoidShapeUvLongitudeMinMaxMid=d.fromElements(Ro,aa,Ne,zt.ellipsoidShapeUvLongitudeMinMaxMid)}if(ye&&(ue&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Ce,ee?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Ce+=1):me?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Ce+=1):Te&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Ce+=2)),Z&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Ce,Y?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Ce+=2):te?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Ce+=1):K&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Ce+=1)),zt.ellipsoidRenderLatitudeSinMinMax=H.fromElements(Math.sin(A.y),Math.sin(C.y),zt.ellipsoidRenderLatitudeSinMinMax)),un)if(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Ae<f)zt.ellipsoidUvToShapeUvLatitude=H.fromElements(0,1,zt.ellipsoidUvToShapeUvLatitude);else{let so=(s.y-r.y)/Ae,Ro=(r.y-m.y)/Ae;zt.ellipsoidUvToShapeUvLatitude=H.fromElements(so,Ro,zt.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=Ce,!0};var QAe=new ce;Dg.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){T.typeOf.number("tileLevel",e),T.typeOf.number("tileX",t),T.typeOf.number("tileY",n),T.typeOf.number("tileZ",i),T.typeOf.object("result",o);let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,l=n*r,u=(n+1)*r,f=i*r,h=(i+1)*r,p=ce.subsection(this._rectangle,s,l,a,u,QAe),g=O.lerp(this._minimumHeight,this._maximumHeight,f),m=O.lerp(this._minimumHeight,this._maximumHeight,h);return S$(p,g,m,this._ellipsoid,this._translation,this._rotation,o)};var $Ae=new d,ZAe=new d,mxt=new d;Dg.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){T.typeOf.object("spatialNode",e),T.typeOf.object("tileDimensions",t),T.typeOf.object("tileUv",n),T.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,$Ae),s=d.multiplyByScalar(r,o,$Ae),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,ZAe),o,ZAe),l=d.add(a,s,mxt),u=ce.subsection(this._rectangle,a.x,a.y,l.x,l.y,QAe),f=O.lerp(this._minimumHeight,this._maximumHeight,a.z),h=O.lerp(this._minimumHeight,this._maximumHeight,l.z);return S$(u,f,h,this._ellipsoid,this._translation,this._rotation,i)};function S$(e,t,n,i,o,r,s){return s=Dn.fromRectangle(e,t,n,i,s),s.center=d.add(s.center,o,s.center),s.halfAxes=J.multiply(s.halfAxes,r,s.halfAxes),s}Dg.DefaultMinBounds=Object.freeze(new d(-O.PI,-O.PI_OVER_TWO,-ie.WGS84.minimumRadius));Dg.DefaultMaxBounds=Object.freeze(new d(O.PI,O.PI_OVER_TWO,10*ie.WGS84.maximumRadius));var bA=Dg;var af={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};af.getMinBounds=function(e){switch(e){case af.BOX:return gA.DefaultMinBounds;case af.ELLIPSOID:return bA.DefaultMinBounds;case af.CYLINDER:return yA.DefaultMinBounds;default:throw new E(`Invalid shape type ${e}`)}};af.getMaxBounds=function(e){switch(e){case af.BOX:return gA.DefaultMaxBounds;case af.ELLIPSOID:return bA.DefaultMaxBounds;case af.CYLINDER:return yA.DefaultMaxBounds;default:throw new E(`Invalid shape type ${e}`)}};af.getShapeConstructor=function(e){switch(e){case af.BOX:return gA;case af.ELLIPSOID:return bA;case af.CYLINDER:return yA;default:throw new E(`Invalid shape type ${e}`)}};var va=Object.freeze(af);function Yh(e){T.typeOf.object("options",e),T.defined("options.comparator",e.comparator),c(e.maximumLength)&&T.typeOf.number.greaterThanOrEquals("options.maximumLength",e.maximumLength,0),this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=c(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Yh.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(c(e)){for(T.typeOf.number.greaterThanOrEquals("maximumLength",e,0);this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Yh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Yh({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Yh.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(c(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Yh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)JAe(this,t)};Yh.prototype.insert=function(e){let t,n=this._maximumLength;if(c(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++,JAe(this,i),t};Yh.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],eCe(this,0)),this._array[e-1]=void 0,t};Yh.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=w$(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&eCe(this,n)}return this._array[e-1]=void 0,t};Yh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Yh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[w$(this,1,2)?1:2]};function vG(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function D3(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function w$(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function JAe(e,t){if(t===0)return;let n=Math.floor(O.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=D3(e,t,i);for(o!==n&&(vG(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(D3(e,t,r)!==o)break;vG(e,t,r),t=r}}function eCe(e,t){let n=e._length,i=Math.floor(O.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){D3(e,s,r)===i&&(r=s);let a=2*o+1,l=Math.max(Math.min(n-a,4),0);for(let u=0;u<l;u++){let f=a+u;D3(e,f,r)===i&&(r=f)}}if(D3(e,r,t)===i&&(vG(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);w$(e,r,a)===i&&vG(e,r,a)}t=r}}var xA=Yh;var v$=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function P3(e,t){this.spatialNode=e,this.keyframe=t,this.state=v$.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}P3.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=v$.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};P3.priorityComparator=function(e,t){return e.priority-t.priority};P3.searchComparator=function(e,t){return e.keyframe-t.keyframe};P3.LoadState=v$;var go=P3;function k0(e,t,n,i,o){if(o=Math.min(o??128*1024*1024,536870912),i===Nt.UNSIGNED_SHORT&&(i=Nt.FLOAT32),i===Nt.FLOAT32&&!e.floatingPointTexture)throw new ae("Floating point texture not supported");let s=pxt(i),a=_xt(n,e.webgl2),l=Nt.getSizeInBytes(i),u=gxt(o,n,l),f=Math.ceil(Math.sqrt(t.x)),h=Math.ceil(t.z/f),p=f*t.x,g=h*t.y,m=Math.floor(u/p),y=Math.floor(u/g);if(m===0||y===0)throw new ae("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=l*n*u**2,this.voxelCountPerTile=d.clone(t,new d),this.maximumTileCount=m*y,this.regionCountPerMegatexture=new H(m,y),this.voxelCountPerRegion=new H(p,g),this.sliceCountPerRegion=new H(f,h),this.voxelSizeUv=new H(1/u,1/u),this.sliceSizeUv=new H(t.x/u,t.y/u),this.regionSizeUv=new H(p/u,g/u),this.texture=new Rt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u,height:u,sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:li.LINEAR})});let b=Nt.toComponentDatatype(i);this.tileVoxelDataTemp=$.createTypedArray(b,p*g*n),this.nodes=new Array(this.maximumTileCount);for(let x=0;x<this.maximumTileCount;x++)this.nodes[x]=new yxt(x);for(let x=0;x<this.maximumTileCount;x++){let A=this.nodes[x];A.previousNode=x>0?this.nodes[x-1]:void 0,A.nextNode=x<this.maximumTileCount-1?this.nodes[x+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function pxt(e){if(e===Nt.FLOAT32||e===Nt.FLOAT64)return Ue.FLOAT;if(e===Nt.UINT8)return Ue.UNSIGNED_BYTE}function _xt(e,t){if(e===1)return t?ke.RED:ke.LUMINANCE;if(e===2)return t?ke.RG:ke.LUMINANCE_ALPHA;if(e===3)return ke.RGB;if(e===4)return ke.RGBA}function gxt(e,t,n){let i=Math.floor(e/(t*n));return Math.min(ut.maximumTextureSize,O.previousPowerOfTwo(Math.floor(Math.sqrt(i))))}function yxt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}k0.prototype.add=function(e){if(this.isFull())throw new E("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,c(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,c(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};k0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new E("Megatexture index out of bounds");let t=this.nodes[e];c(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),c(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,c(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};k0.prototype.isFull=function(){return this.emptyList===void 0};k0.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===Nt.UNSIGNED_SHORT&&(i=Nt.FLOAT32);let o=Nt.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),l=s*t.x,u=a*t.y,f=O.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(f/l),g=Math.floor(f/u);if(p*g>=e)break;f*=2}return f*f*n*o};k0.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,{tileVoxelDataTemp:i,voxelCountPerTile:o,sliceCountPerRegion:r,voxelCountPerRegion:s,channelCount:a,regionCountPerMegatexture:l}=this;for(let g=0;g<o.z;g++){let m=g%r.x*o.x,y=Math.floor(g/r.x)*o.y;for(let b=0;b<o.y;b++){let x=bxt(o,b,g),A=(y+b)*s.x+m;for(let C=0;C<o.x;C++){let S=x+C,v=A+C;for(let P=0;P<a;P++)i[v*a+P]=n[S*a+P]}}}let u=e%l.x*s.x,f=Math.floor(e/l.x)*s.y,p={source:{arrayBufferView:i,width:s.x,height:s.y},xOffset:u,yOffset:f};this.texture.copyFrom(p)};function bxt(e,t,n){let i=e.y*e.x,o=n,r=t;return o*i+r*e.x}k0.prototype.isDestroyed=function(){return!1};k0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),de(this)};var Lw=k0;function Ad(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=d.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Dn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var xxt=new d;Ad.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,xxt),n=2*d.maximumComponent(t);this.approximateVoxelSize=n/d.minimumComponent(this.dimensions)};Ad.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,l=s+1,u=r+1,f=a+1,h=t+1,p=[[h,r,s,a],[h,u,s,a],[h,r,l,a],[h,u,l,a],[h,r,s,f],[h,u,s,f],[h,r,l,f],[h,u,l,f]];this.children=p.map(([g,m,y,b])=>new Ad(g,m,y,b,this,e,this.dimensions))};Ad.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Ad.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,O.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var tCe={keyframe:0};function I3(e,t){return tCe.keyframe=e,Lo(t,tCe,go.searchComparator)}Ad.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,l=+Number.MAX_VALUE;for(;c(t);){let{renderableKeyframeNodes:h}=t;if(h.length>=1){let p=Txt(i,h),g=h[p],m=o===i||i<g.keyframe?p:Math.min(p+1,h.length-1),y=h[m],b=i-g.keyframe,x=nCe(n-t.level,b);x<a&&(a=x,r=g);let A=y.keyframe-o,C=nCe(n-t.level,A);if(C<l&&(l=C,s=y),b===0&&A===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!c(r)||!c(s))return;let u=r.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:O.clamp((e-u)/(f-u),0,1)};function Txt(e,t){let n=I3(e,t);return n<0?O.clamp(~n-1,0,t.length-1):n}function nCe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Ad.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Ad.prototype.createKeyframeNode=function(e){let t=I3(e,this.keyframeNodes);if(t<0){t=~t;let n=new go(this,e);this.keyframeNodes.splice(t,0,n)}};Ad.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=I3(n,this.keyframeNodes);if(i<0)throw new E("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=I3(n,this.renderableKeyframeNodes);if(o<0)throw new E("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};Ad.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new E("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let r=0;r<t.length;r++){let s=t[r];e.megatextureIndex=s.add(n[r])}let i=this.renderableKeyframeNodes,o=I3(e.keyframe,i);if(o>=0)throw new E("Keyframe already renderable");o=~o,i.splice(o,0,e)};Ad.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return c(t)&&c(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var O3=Ad;function U0(e,t,n,i){let{provider:o,dimensions:r,paddingBefore:s,paddingAfter:a}=e,{types:l,componentTypes:u,metadataOrder:f}=o,h=d.add(r,s,new d);if(d.add(h,a,h),f===Td.Y_UP){let C=h.y;h.y=h.z,h.z=C}!c(i)&&c(o.maximumTileCount)&&(i=Lxt(o.maximumTileCount,h,l,u)),this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(l.length);for(let C=0;C<l.length;C++){let S=l[C],v=at.getComponentCount(S),P=u[C];this.megatextures[C]=new Lw(t,h,v,P,i),this.textureMemoryByteLength+=this.megatextures[C].textureMemoryByteLength}let p=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let g=e._shape;this.rootNode=new O3(0,0,0,0,void 0,g,r),this._priorityQueue=new xA({maximumLength:p,comparator:go.priorityComparator}),this._highPriorityKeyframeNodes=new Array(p),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(p),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let m=this._binaryTreeKeyframeWeighting;m[0]=0,m[n-1]=0,D$(m,1,n-2,0);let y=9,b=2048,x=Math.floor(b/y),A=Math.ceil(p/x);this.internalNodeTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:b,height:A,sampler:new Qt({minificationFilter:Yt.NEAREST,magnificationFilter:li.NEAREST})}),this.internalNodeTilesPerRow=x,this.internalNodeTexelSizeUv=new H(1/b,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new H}U0.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function D$(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,D$(e,t,o-1,i+1),D$(e,o+1,n,i+1)}U0.simultaneousRequestCountMaximum=50;U0.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,l=o._levelBlendFactor,u=l>0,f=a>1,h=(u?2:1)*(f?2:1);this._sampleCount=h;let p=h>=2;if(p&&!c(this.leafNodeTexture)){let C=Math.floor(512),S=Math.ceil(s/C);this.leafNodeTexture=new Rt({context:r,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:1024,height:S,sampler:new Qt({minificationFilter:Yt.NEAREST,magnificationFilter:li.NEAREST})}),this.leafNodeTexelSizeUv=H.fromElements(1/1024,1/S,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=C}else!p&&c(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=O.clamp(t,0,a-1),n&&iCe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=Ti();Ext(this,e),Sxt(this,e);let m=Ti();Ixt(this,h,l);let y=Ti(),b=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||b){let x=m-g,A=y-m,C=y-g;Pxt(this,e,x,A,C)}};U0.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};U0.prototype.isDestroyed=function(){return!1};U0.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(),de(this)};function iCe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),c(t.children))for(let n=0;n<8;n++){let i=t.children[n];iCe(e,i)}}function Axt(e,t){if(e._simultaneousRequestCount>=U0.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(c(i.availableLevels)&&r.level>=i.availableLevels)return;function s(f){e._simultaneousRequestCount--,t.content=f,t.state=c(f)?go.LoadState.PROCESSING:go.LoadState.UNAVAILABLE}function a(f){e._simultaneousRequestCount--,t.state=go.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let l={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},u=i.requestData(l);c(u)&&(e._simultaneousRequestCount++,t.state=go.LoadState.RECEIVING,u.then(s).catch(a))}function Cxt(e){return e/(1+e)}function Ext(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),oCe(e.rootNode,_s.MASK_INDETERMINATE,e,t);let o=e._highPriorityKeyframeNodes,r=0,s;for(;i.length>0;)s=i.removeMaximum(),s.highPriorityFrameNumber=n,o[r]=s,r++;e._highPriorityKeyframeNodeCount=r}function Sxt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(wxt);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,l=0;for(let u=0;u<s;u++){let f=r[u];if(!(f.state===go.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===go.LoadState.UNLOADED&&Axt(e,f),f.state===go.LoadState.PROCESSING)){let{content:h}=f;if(h.update(e._primitive,t),!h.ready)continue;if(!vxt(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-a,a++;let g=o[p];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else p=i+l,l++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=go.LoadState.LOADED,o[p]=f,e._primitive.tileLoad.raiseEvent()}}}function wxt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function vxt(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:s}=i[o],{x:a,y:l,z:u}=r,f=a*l*u,h=e[o],p=f*s;if(h.length!==p)return!1}return!0}function oCe(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:l,frustum:u}=o,h=r.drawingBufferHeight/s/u.sseDenominator;if(e.computeScreenSpaceError(l,h),t=e.visibility(i,t),t===_s.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,g=p._shape,m=p.screenSpaceError,y=n._priorityQueue,b=n._keyframeCount,x=O.clamp(Math.floor(n._keyframeLocation),0,b-2),A=x+1;if(b===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==b)for(let M=0;M<b;M++)e.createKeyframeNode(M);let{screenSpaceError:C,keyframeNodes:S}=e,v=Cxt(C),P=!1;for(let M=0;M<S.length;M++){let R=S[M];R.priority=10*v+Dxt(x,R.keyframe,A,n),R.state!==go.LoadState.UNAVAILABLE&&R.state!==go.LoadState.FAILED&&R.priority!==-Number.MAX_VALUE&&y.insert(R),R.state===go.LoadState.LOADED&&(P=!0)}if(C<m||!P){e.children=void 0;return}c(e.children)||e.constructChildNodes(g);for(let M=0;M<8;M++){let R=e.children[M];oCe(R,t,n,i)}}function Dxt(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return O.lerp(a,s,.15+.85*s)}function Pxt(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(go.LoadState).length,l=new Array(a),u=new Array(a),f=0;for(let P=0;P<a;P++){let M=new Array(r).fill(0);l[P]=M,u[P]=0}function h(P){let M=P.keyframeNodes;for(let R=0;R<M.length;R++){let L=M[R],F=L.keyframe,_=L.state;l[_][F]+=1,u[_]+=1,f++}if(c(P.children))for(let R=0;R<8;R++){let L=P.children[R];h(L)}}h(s),e._primitive.statistics.numberOfTilesWithContentReady=u[go.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[go.LoadState.RECEIVING],g=u[go.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,m&&(p===0&&g===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 b=`KEYFRAMES: ${l[go.LoadState.LOADED]}`,x=`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}`,A=Math.round(n*100)/100,C=Math.round(i*100)/100,S=Math.round(o*100)/100,v=`LOAD: ${A} | OCT: ${C} | ALL: ${S}`;console.log(`${b} || ${x} || ${v}`)}var DG={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function Ixt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,l=0,u=[],f=[];function h(g,m,y,b,x){let A=!1;if(c(g.children))for(let C=0;C<8;C++){let S=g.children[C];S.computeSurroundingRenderableKeyframeNodes(o),S.isRenderable(r)&&(A=!0)}if(A){u[x]=DG.INTERNAL<<16|m,u[y]=b,a++,b=m,x=b*9+1;for(let C=0;C<8;C++){let S=g.children[C];m=a,y=m*9+0,h(S,m,y,b,x+C)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let C=l*5,S=g.renderableKeyframeNodePrevious,v=g.level-S.spatialNode.level,P=S.spatialNode.parent,M=c(P)?P.renderableKeyframeNodePrevious:S,R=Oxt(g,i,n),L=v,F=1,_=S.megatextureIndex,w=M.megatextureIndex;f[C+0]=R,f[C+1]=L,f[C+2]=F,f[C+3]=_,f[C+4]=w,u[x]=DG.LEAF<<16|l}else{let C=g.renderableKeyframeNodePrevious,v=g.level-C.spatialNode.level===0?DG.LEAF:DG.PACKED_LEAF_FROM_PARENT;u[x]=v<<16|C.megatextureIndex}l++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&h(p,0,0,0,0),Rxt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&Mxt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function Oxt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return O.clamp(s,0,1)}function Rxt(e,t,n,i){let o=ke.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),l=new Uint8Array(s*a*o);for(let h=0;h<e.length;h++){let p=e[h],g=h*o;for(let m=0;m<o;m++)l[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:l,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function Mxt(e,t,n,i){let o=ke.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),l=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*l*o);for(let p=0;p<s;p++){let g=e[p*r+0],m=e[p*r+1],y=e[p*r+2],b=e[p*r+3],x=e[p*r+4],A=O.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=A>>>0&255,u[p*8+1]=A>>>8&255,u[p*8+2]=m&255,u[p*8+3]=y&255,u[p*8+4]=b>>>0&255,u[p*8+5]=b>>>8&255,u[p*8+6]=x>>>0&255,u[p*8+7]=x>>>8&255}let h={source:{arrayBufferView:u,width:a,height:l},xOffset:0,yOffset:0};i.copyFrom(h)}function Lxt(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],l=i[s],u=at.getComponentCount(a);o+=Lw.getApproximateTextureMemoryByteLength(e,t,u,l)}return o}var R3=U0;function pp(e){e=e??W.EMPTY_OBJECT,this._ready=!1,this._provider=e.provider??pp.DefaultProvider,this._traversal=void 0,this._statistics=new gh,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._minBounds=new d,this._minBoundsOld=new d,this._maxBounds=new d,this._maxBoundsOld=new d,this._exaggeratedMinBounds=new d,this._exaggeratedMinBoundsOld=new d,this._exaggeratedMaxBounds=new d,this._exaggeratedMaxBoundsOld=new d,this._minClippingBounds=new d,this._minClippingBoundsOld=new d,this._maxClippingBounds=new d,this._maxClippingBoundsOld=new d,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this._exaggeratedModelMatrix=B.clone(this._modelMatrix),this._compoundModelMatrix=new B,this._compoundModelMatrixOld=new B,this._customShader=e.customShader??pp.DefaultCustomShader,this._customShaderCompilationEvent=new pe,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new B,this._transformPositionUvToWorld=new B,this._transformDirectionWorldToLocal=new J,this._transformNormalLocalToWorld=new J,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new dh,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new H,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new H,megatextureTextures:[],megatextureSliceDimensions:new H,megatextureTileDimensions:new H,megatextureVoxelSizeUv:new H,megatextureSliceSizeUv:new H,megatextureTileSizeUv:new H,dimensions:new d,inputDimensions:new d,paddingBefore:new d,paddingAfter:new d,transformPositionViewToUv:new B,transformPositionUvToView:new B,transformDirectionViewToLocal:new J,transformNormalLocalToWorld:new J,cameraPositionUv:new d,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new B,stepSize:0,pickColor:new G},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 pe,this.tileVisible=new pe,this.tileFailed=new pe,this.tileUnload=new pe,this.loadProgress=new pe,this.allTilesLoaded=new pe,this.initialTilesLoaded=new pe;let i=this._provider;Nxt(this,i)}function Nxt(e,t){let{shape:n,minBounds:i=va.getMinBounds(n),maxBounds:o=va.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=i.clone(),e.maxClippingBounds=o.clone(),e._exaggeratedMinBounds=d.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=d.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=B.clone(e._modelMatrix,e._exaggeratedModelMatrix),sCe(e,t);let r=va.getShapeConstructor(n);e._shape=new r,e._shapeVisible=aCe(e,e._shape,t)}Object.defineProperties(pp.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){T.typeOf.object("modelMatrix",e),this._modelMatrix=B.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){T.typeOf.bool("show",e),this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){T.typeOf.bool("disableUpdate",e),this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){T.typeOf.bool("debugDraw",e),this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){T.typeOf.bool("depthTest",e),this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){T.typeOf.bool("nearestSampling",e),this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){T.typeOf.number("levelBlendFactor",e),this._levelBlendFactor=O.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){T.typeOf.number("screenSpaceError",e),this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){T.typeOf.number("stepSize",e),this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){T.defined("minBounds",e),this._minBounds=d.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){T.defined("maxBounds",e),this._maxBounds=d.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){T.defined("minClippingBounds",e),this._minClippingBounds=d.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){T.defined("maxClippingBounds",e),this._maxClippingBounds=d.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.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];c(e)?this._customShader=e:this._customShader=pp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var Fxt=new se,Bxt=new se,kxt=new d,Uxt=new d,Vxt=new J,zxt=new J,Hxt=new B,Gxt=new B,jxt=new B,Wxt=B.fromRotationTranslation(J.fromUniformScale(.5,new J),new d(.5,.5,.5),new B),qxt=B.fromRotationTranslation(J.fromUniformScale(2,new J),new d(-1,-1,-1),new B);pp.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){Qxt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}$xt(this,e);let i=sCe(this,t),o=this._shape;if(i&&(this._shapeVisible=aCe(this,o,t),eTt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=tTt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&lTt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),nTt(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;c(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=H.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(E3(this,n),this._shaderDirty=!1);let h=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=rTt(p,h,Bxt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=se.clone(g,f.ndcSpaceAxisAlignedBoundingBox);let y=n.uniformState.inverseView;f.transformPositionViewToUv=B.multiplyTransformation(this._transformPositionWorldToUv,y,f.transformPositionViewToUv);let b=n.uniformState.view;f.transformPositionUvToView=B.multiplyTransformation(b,this._transformPositionUvToWorld,f.transformPositionUvToView);let x=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=J.multiply(this._transformDirectionWorldToLocal,x,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=J.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let A=e.camera.positionWC;f.cameraPositionUv=B.multiplyByPoint(this._transformPositionWorldToUv,A,f.cameraPositionUv),f.stepSize=this._stepSizeMultiplier;let C=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;C.boundingVolume=o.boundingSphere,e.commandList.push(C)};var Yxt=new d,P$=new d,Xxt=new he,Kxt=new d;function $xt(e,t){if(e._exaggeratedMinBounds=d.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=d.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===va.ELLIPSOID){let n=t.verticalExaggerationRelativeHeight,i=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-n)*i+n,e._exaggeratedMaxBounds.z=(e._maxBounds.z-n)*i+n}else{let n=d.fromElements(1,1,t.verticalExaggeration,Yxt);e._exaggeratedModelMatrix=B.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=B.multiplyByTranslation(e._exaggeratedModelMatrix,Zxt(e,t),e._exaggeratedModelMatrix)}}function Zxt(e,t){let{shapeTransform:n=B.IDENTITY,globalTransform:i=B.IDENTITY}=e._provider,o=B.getTranslation(n,P$),r=B.multiplyByPoint(e._modelMatrix,o,P$),s=B.multiplyByPoint(i,r,P$),l=ie.WGS84.cartesianToCartographic(s,Xxt),u=0;c(l)&&(u=l.height);let f=Dr.getHeight(u,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return d.fromElements(0,0,(f-u)/t.verticalExaggeration,Kxt)}function Qxt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=G.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=je(o,!0);let s=e._uniformMap;for(let l in r)if(r.hasOwnProperty(l)){let u=`u_${l}`;c(s[u])&&dt(`VoxelPrimitive: Uniform name "${u}" is already defined`),s[u]=function(){return r[l]}}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===Td.Y_UP){let l=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=l}i.inputDimensions=d.clone(e._inputDimensions,i.inputDimensions);let a=t.keyframeCount??1;e._traversal=new R3(e,n,a),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,Jxt(e._traversal,i)}function sCe(e,t){let n=t.shapeTransform??B.IDENTITY,i=t.globalTransform??B.IDENTITY;return B.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),B.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),TA(e,"_compoundModelMatrix","_compoundModelMatrixOld")+TA(e,"_minBounds","_minBoundsOld")+TA(e,"_maxBounds","_maxBoundsOld")+TA(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+TA(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+TA(e,"_minClippingBounds","_minClippingBoundsOld")+TA(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function TA(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function aCe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=B.inverse(o,Hxt),s=B.getRotation(o,Vxt),a=B.getScale(o,kxt),l=d.maximumComponent(a),u=d.divideByScalar(a,l,Uxt),f=J.multiplyByScale(s,u,zxt);return e._transformPositionWorldToUv=B.multiplyTransformation(Wxt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=B.multiplyTransformation(o,qxt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=B.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=J.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function Jxt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=H.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=H.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=H.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=H.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=H.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=H.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function eTt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=je(n,!0)),i}function tTt(e,t){if(!c(e)||!c(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=Q.secondsDifference(i.stop,i.start),a=Q.secondsDifference(n,i.start)/r;return o+a}function nTt(e,t){let n=e.clippingPlanes;if(!c(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=B.transpose(B.multiplyTransformation(B.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}pp.prototype.isDestroyed=function(){return!1};pp.prototype.destroy=function(){let e=this._drawCommand;c(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return c(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(),de(this)};var rCe=new Array(new se(-1,-1,-1,1),new se(1,-1,-1,1),new se(-1,1,-1,1),new se(1,1,-1,1),new se(-1,-1,1,1),new se(1,-1,1,1),new se(-1,1,1,1),new se(1,1,1,1)),iTt=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),oTt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function rTt(e,t,n){let i=B.fromRotationTranslation(e.halfAxes,e.center,Gxt),o=B.multiply(t,i,jxt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,l=-Number.MAX_VALUE,u,f=oTt,h=rCe.length;for(u=0;u<h;u++)B.multiplyByVector(o,rCe[u],f[u]);for(u=0;u<h;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,m),l=Math.max(l,m)}else for(let g=0;g<3;g++){let m=iTt[u*3+g],y=f[m];if(y.z>=-y.w){let b=p.z+p.w,x=y.z+y.w,A=b/(b-x),C=se.lerp(p,y,A,Fxt),S=C.x/C.w,v=C.y/C.w;r=Math.min(r,S),s=Math.max(s,S),a=Math.min(a,v),l=Math.max(l,v)}}}return r=O.clamp(r,-1,1),a=O.clamp(a,-1,1),s=O.clamp(s,-1,1),l=O.clamp(l,-1,1),n=se.fromElements(r,a,s,l,n),n}var I$=3e7,sTt=new d(I$,0,0),aTt=new d(0,I$,0),cTt=new d(0,0,I$);function lTt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(l,u,f,h){i.add({positions:[l,u],width:h,material:Xi.fromType("Color",{color:f})})}function r(l,u,f){let h=l.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 s(l){if(!n.isRenderable(l))return;let u=l.level,h=Math.max(1,5/Math.pow(2,u)),g=[G.RED,G.LIME,G.BLUE][u%3];if(r(l.orientedBoundingBox,g,h),c(l.children))for(let m=0;m<8;m++)s(l.children[m])}r(e._shape.orientedBoundingBox,G.WHITE,5),s(n.rootNode);let a=10;o(d.ZERO,sTt,G.RED,a),o(d.ZERO,aTt,G.LIME,a),o(d.ZERO,cTt,G.BLUE,a),i.update(t)}pp.DefaultCustomShader=new pA({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { material.diffuse = vec3(1.0); material.alpha = 1.0; }`});function cCe(){this.ready=!0,this.shape=va.BOX,this.dimensions=new d(1,1,1),this.names=["data"],this.types=[at.SCALAR],this.componentTypes=[Nt.FLOAT32],this.maximumTileCount=1}cCe.prototype.requestData=function(e){if((c(e)?e.tileLevel??0:0)>=1)return;let n=new _A({metadata:[new Float32Array(1)]});return Promise.resolve(n)};pp.DefaultProvider=new cCe;var V0=pp;function uTt(e,t,n,i){if(!c(e)||c(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!c(r))return;let a=(r.properties||{})[i];if(c(a))return a}var M3=uTt;function fTt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var L3=fTt;function dTt(e,t,n){if(!c(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(c(a))return a}}var N3=dTt;var IG=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function ci(e){e=e??W.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=je(e.contextOptions);if(!c(t))throw new E("options and options.canvas are required.");let r=c(n),s=new AI(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),c(i)||(i=t.parentNode),this._id=jn(),this._jobScheduler=new dB,this._frameState=new uB(s,new tB(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new Pv(s),this._ellipsoid=e.ellipsoid??ie.default,this._globe=void 0,this._globeTranslucencyState=new fB,this._primitives=new fl,this._groundPrimitives=new fl,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=ci.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new lA,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new aB(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ei({color:new G,stencil:0,owner:this}),this._depthClearCommand=new ei({depth:1,owner:this}),this._stencilClearCommand=new ei({stencil:0}),this._classificationStencilClearCommand=new ei({stencil:0,renderState:Ve.fromCache({stencilMask:kt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new ZB(this),this._preUpdate=new pe,this._postUpdate=new pe,this._renderError=new pe,this._preRender=new pe,this._postRender=new pe,this._minimumDisableDepthTestDistance=0,this._debugInspector=new s3,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new pe,this.morphComplete=new pe,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=G.clone(G.BLACK),this._mode=oe.SCENE3D,this._mapProjection=c(e.mapProjection)?e.mapProjection:new Oi(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 Ex,this.fog=new lB,this.fog.enabled=ie.WGS84.equals(this._ellipsoid),ie.WGS84.equals(this._ellipsoid)||(ro.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new ro(this),this.shadowMap=new Tg({context:s,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=G.clone(G.WHITE),this._actualInvertClassificationColor=G.clone(this._invertClassificationColor),this._invertClassification=new ww,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new XB,this._brdfLutGenerator=new K2,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new t3(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??ru.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=sc.requestCompletedEvent.addEventListener(IG(this)),this._removeTaskProcessorListenerCallback=yi.taskCompletedEvent.addEventListener(IG(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Ke(0,0,s.drawingBufferWidth,s.drawingBufferHeight),l=new ro(this);this._logDepthBuffer&&(l.frustum.near=.1,l.frustum.far=1e10),this.preloadFlightCamera=new ro(this),this.preloadFlightCullingVolume=void 0,this._picking=new wB(this),this._defaultView=new tA(this,l,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new Rp,hCe(this,0,Q.now()),this.updateFrameState(),this.initializeFrame()}ci.defaultLogDepthBuffer=!0;function hTt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];c(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(IG(e))),n.push(t.terrainProviderChanged.addEventListener(IG(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 ut.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return ut.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 Yd.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,hTt(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(c(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(c(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),c(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(c(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){if(this.scene3DOnly&&e!==oe.SCENE3D)throw new E("Only SceneMode.SCENE3D is valid when scene3DOnly is true.");if(e===oe.SCENE2D)this.morphTo2D(0);else if(e===oe.SCENE3D)this.morphTo3D(0);else if(e===oe.COLUMBUS_VIEW)this.morphToColumbusView(0);else throw new E("value must be a valid SceneMode enumeration.");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){if(this.camera.frustum instanceof on)throw new E("VR is unsupported with an orthographic projection.");this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new ro(this),c(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new cB(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){if(!c(e)||e<0)throw new E("minimumDisableDepthTestDistance must be greater than or equal to 0.0.");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,ut.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 mTt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function lCe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,l=t.derivedCommands;c(t.pickId)&&(l.picking=ap.createPickDerivedCommand(e,t,o,l.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,c(t.pickedMetadataInfo)&&(l.pickingMetadata=ap.createPickMetadataDerivedCommand(e,t,o,l.pickingMetadata))),t.pickOnly||(l.depth=ap.createDepthOnlyDerivedCommand(e,t,o,l.depth)),l.originalCommand=t,e._hdr&&(l.hdr=ap.createHdrCommand(t,o,l.hdr),t=l.hdr.command,l=t.derivedCommands),a&&t.receiveShadows&&(l.shadows=Tg.createReceiveDerivedCommand(s,t,n,o,l.shadows)),t.pass===De.TRANSLUCENT&&c(r)&&r.isSupported()&&(a&&t.receiveShadows?(l.oit=c(l.oit)?l.oit:{},l.oit.shadows=r.createDerivedCommands(l.shadows.receiveCommand,o,l.oit.shadows)):l.oit=r.createDerivedCommands(t,o,l.oit))}ci.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!c(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let l=this._hdr,u=c(t.logDepth),f=c(t.hdr),h=c(t.originalCommand),p=o&&!u,g=l&&!f,m=(!o||!l)&&!h,y=n.pickingMetadata&&mTt(e,n);if(e.dirty=e.dirty||p||g||m||y,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:x}=i;b&&e.castShadows&&(t.shadows=Tg.createCastDerivedCommand(x,e,s,r,t.shadows)),(u||p)&&(t.logDepth=ap.createLogDepthCommand(e,r,t.logDepth),lCe(this,t.logDepth.command,s)),(h||m)&&lCe(this,e,s)};var pTt=new gd({pass:Uo.RENDER}),O$=new gd({pass:Uo.PRELOAD}),R$=new gd({pass:Uo.PRELOAD_FLIGHT}),_Tt=new gd({pass:Uo.REQUEST_RENDER_MODE_DEFER_CHECK}),uCe=new le,M$;function gTt(e){if(!(e._mode!==oe.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return uCe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,M$=Y2.fromBoundingSphere(uCe,e.camera.positionWC,M$),M$}ci.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function hCe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Q.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=gTt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof on||this.camera.frustum instanceof jo),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;c(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,c(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=G.clone(this.invertClassificationColor,this._actualInvertClassificationColor),ww.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,c(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(!c(t))return!1;let{boundingVolume:i}=t;return!c(i)||!t.cull?!0:e.computeVisibility(i)===Wt.OUTSIDE?!1:!c(n)||!t.occlude||!i.isOccluded(n)};var PG=new B(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);PG=B.inverseTransformation(PG,PG);function yTt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;c(t._debugVolume)&&t._debugVolume.destroy();let a=d.clone(s.center);if(o.mode!==oe.SCENE3D){a=B.multiplyByPoint(PG,a,a);let m=o.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let l,u,{radius:f}=s;c(f)?(l=Js.createGeometry(new Js({radii:new d(f,f,f),vertexFormat:rn.FLAT_VERTEX_FORMAT})),u=B.fromTranslation(a)):(l=La.createGeometry(La.fromDimensions({dimensions:new d(2,2,2),vertexFormat:rn.FLAT_VERTEX_FORMAT})),u=B.fromRotationTranslation(s.halfAxes,a,new B)),t._debugVolume=new Pn({geometryInstances:new St({geometry:Nn.toWireframe(l),modelMatrix:u,attributes:{color:new Gt(1,0,0,1)}}),appearance:new rn({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=ap.createLogDepthCommand(e,r).command);let g;c(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(r,n),c(g)&&(n.framebuffer=g),o.commandList=h}function _p(e,t,n,i){let o=t._frameState,r=t._context;if(c(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ei){e.execute(r,n);return}e.debugShowBoundingVolume&&c(e.boundingVolume)&&yTt(e,t,n,i),o.useLogDepth&&c(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&c(e.derivedCommands)&&c(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&c(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&c(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(c(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&&c(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function fCe(e,t,n){let{derivedCommands:i}=e;if(!c(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&c(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:l}=e.derivedCommands;c(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),c(s)?(e=s.pickCommand,e.execute(r,n)):c(l)&&(e=l.depthOnlyCommand,e.execute(r,n))}function mCe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function bTt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+O.EPSILON12}function xTt(e,t,n,i,o){gg(i,mCe,e.camera.positionWC),c(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function TTt(e,t,n,i,o){gg(i,bTt,e.camera.positionWC),c(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function ATt(e,t,n){e.context.uniformState.updatePass(De.VOXELS);let i=n.commands[De.VOXELS];i.length=n.indices[De.VOXELS],gg(i,mCe,e.camera.positionWC);for(let o=0;o<i.length;++o)_p(i[o],e,t)}var CTt=new Ci,ETt=new bl,STt=new on,wTt=new jo;function vTt(e){let{frustum:t}=e;return c(t.fov)?t.clone(CTt):c(t.infiniteProjectionMatrix)?t.clone(ETt):c(t.width)?t.clone(STt):t.clone(wTt)}function DTt(e){if(e._environmentState.useOIT){if(!c(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?xTt:TTt}function PTt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,l;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(l=e._invertClassification);let u=DTt(e);o.uniformState.updatePass(De.TRANSLUCENT);let f=n.commands[De.TRANSLUCENT];f.length=n.indices[De.TRANSLUCENT],u(e,_p,t,f,l)}function ITt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[De.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[De.TRANSLUCENT];i.executeTranslucentCommands(e,_p,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,_p,t,n)}function N$(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=vTt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,l=a.pick||a.pickVoxel;l||OTt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:h,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:b,sceneFramebuffer:x,frustumCommandsList:A}=e._view,C=A.length,S=e._globeTranslucencyState,v=e._depthClearCommand,P=e._stencilClearCommand,M=e._classificationStencilClearCommand,R=e._depthPlane,L=n.position.z;function F(w,D){r.updatePass(D);let I=w.commands[D],N=w.indices[D];for(let k=0;k<N;++k)_p(I[k],e,t);return N}function _(w,D){r.updatePass(D);let I=w.commands[D],N=w.indices[D];for(let k=0;k<N;++k)fCe(I[k],e,t)}for(let w=0;w<C;++w){let D=C-w-1,I=A[D];e.mode===oe.SCENE2D?(n.position.z=L-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=D!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&P.execute(i,t),S.translucent?(r.updatePass(De.GLOBE),S.executeGlobeCommands(I,_p,b,e,t)):F(I,De.GLOBE),p&&y.executeCopyDepth(i,t),f||(S.translucent?(r.updatePass(De.TERRAIN_CLASSIFICATION),S.executeGlobeClassificationCommands(I,_p,b,e,t)):F(I,De.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),h&&R.execute(i,t));let N;if(!g||l||f)N=F(I,De.CESIUM_3D_TILE),N>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(N=F(I,De.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let z=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,N=F(I,De.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),N=F(I,De.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=z,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&M.execute(i,t),N=F(I,De.CESIUM_3D_TILE_CLASSIFICATION)}if(N>0&&i.stencilBuffer&&P.execute(i,t),ATt(e,t,I),F(I,De.OPAQUE),D!==0&&e.mode!==oe.SCENE2D&&(s.near=I.near,r.updateFrustum(s)),PTt(e,t,I),ITt(e,t,I),i.depthTexture&&e.useDepthPicking&&(p||f)){let z=e._picking.getPickDepth(e,D);z.update(i,y.depthStencilTexture),z.executeCopyDepth(i,t)}if(l||!m)continue;let k=t.framebuffer;t.framebuffer=x.getIdFramebuffer(),s.near=D!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),S.translucent?(r.updatePass(De.GLOBE),S.executeGlobeCommands(I,fCe,b,e,t)):_(I,De.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&h&&R.execute(i,t),_(I,De.CESIUM_3D_TILE),_(I,De.OPAQUE),_(I,De.TRANSLUCENT),t.framebuffer=k}}function OTt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(De.ENVIRONMENT),c(i.skyBoxCommand)&&_p(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&_p(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let r;i.useGlobeDepthFramebuffer?r=o.globeDepth.framebuffer:i.usePostProcess?r=o.sceneFramebuffer.framebuffer:r=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,r),t.framebuffer=r}i.isMoonVisible&&i.moonCommand.execute(n,t)}function pCe(e){e.context.uniformState.updatePass(De.COMPUTE);let t=e._environmentState.sunComputeCommand;c(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function RTt(e,t){e.context.uniformState.updatePass(De.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function MTt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[De.GLOBE,De.CESIUM_3D_TILE,De.OPAQUE,De.TRANSLUCENT];for(let l=0;l<t.length;++l){let u=t[l];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<s;++f)r[f].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let f=!1;for(let h=s-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 _Ce(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let l=o[a];if(l.outOfView)continue;let{passes:u}=l;for(let f=0;f<u.length;++f)u[f].commandList.length=0;MTt(e,n,l);for(let f=0;f<u.length;++f){let h=l.passes[f],{camera:p,commandList:g}=h;s.updateCamera(p),l.updatePass(r,f);for(let m=0;m<g.length;++m){let y=g[m];s.updatePass(y.pass);let b=y.derivedCommands.shadows.castCommands[a];_p(b,e,h.passState)}}}}var LTt=new d;ci.prototype.updateAndExecuteCommands=function(e,t){YTt(this,e,t),this._environmentState.useWebVR?NTt(this,e,t):this._frameState.mode!==oe.SCENE2D||this._mapMode2D===ru.ROTATE?z0(!0,this,e):jTt(this,e)};function NTt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;gCe(e),n.createPotentiallyVisibleSet(e),pCe(e),r||_Ce(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=ro.clone(i,e._cameraVR);a.frustum=i.frustum;let l=i.frustum.near,u=l*(e.focalLength??5),f=e.eyeSeparation??u/30,h=d.multiplyByScalar(a.right,f*.5,LTt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*l/u;d.add(a.position,h,i.position),i.frustum.xOffset=p,N$(e,t),s.x=s.width,d.subtract(a.position,h,i.position),i.frustum.xOffset=-p,N$(e,t),ro.clone(a,i)}var FTt=new he(Math.PI,O.PI_OVER_TWO),BTt=new d,kTt=new d,UTt=new B,VTt=new B,zTt=new d,HTt=new d,GTt=new Ke;function jTt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=Ke.clone(r,GTt);t.viewport=s;let a=FTt,l=BTt;e.mapProjection.project(a,l);let f=d.clone(i.position,kTt),h=B.clone(i.transform,VTt),p=i.frustum.clone();i._setTransform(B.IDENTITY);let g=B.computeViewportTransformation(s,0,1,UTt),m=i.frustum.projectionMatrix,y=i.positionWC.y,b=d.fromElements(O.sign(y)*l.x-y,0,-i.positionWC.x,zTt),x=Ot.pointToGLWindowCoordinates(m,g,b,HTt);x.x=Math.floor(x.x);let A=s.x,C=s.width;if(y===0||x.x<=A||x.x>=A+C)z0(!0,e,t);else if(Math.abs(A+C*.5-x.x)<1)s.width=x.x-s.x,i.position.x*=O.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),z0(!0,e,t),s.x=x.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),z0(!1,e,t);else if(x.x>A+C*.5){s.width=x.x-A;let S=i.frustum.right;i.frustum.right=l.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),z0(!0,e,t),s.x=x.x,s.width=A+C-x.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=S-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),z0(!1,e,t)}else{s.x=x.x,s.width=A+C-x.x;let S=i.frustum.left;i.frustum.left=-l.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),z0(!0,e,t),s.x=A,s.width=x.x-A,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=S-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),z0(!1,e,t)}i._setTransform(h),d.clone(f,i.position),i.frustum=p.clone(),t.viewport=r}function z0(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),gCe(t),i.createPotentiallyVisibleSet(t),e&&(pCe(t),o||_Ce(t)),N$(t,n)}var dCe=new _s;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,s=this.skyAtmosphere,a=this.globe,l=this._globeTranslucencyState;if(!i||this._mode!==oe.SCENE2D&&t.camera.frustum instanceof on||!l.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(c(s)){if(c(a))s.setDynamicLighting(a_.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let x=r.dynamicLighting;s.setDynamicLighting(x),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),c(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=c(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let b=c(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=c(b)?b.drawCommand:void 0,n.sunComputeCommand=c(b)?b.computeCommand:void 0,n.moonCommand=c(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=c(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===oe.SCENE2D);(n.useDepthPlane=u&&this.mode===oe.SCENE3D&&l.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==oe.SCENE2D&&!o;let h=e.mode===oe.SCENE3D&&!l.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=dCe.planes;for(let b=0;b<5;++b)g[b]=p.planes[b];p=dCe,n.isSkyAtmosphereVisible=c(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(p,n.moonCommand,h);let m=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;c(m)&&y?.url!==m?(y=y&&y.destroy(),this._specularEnvironmentCubeMap=new Yd(m)):!c(m)&&c(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),c(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function WTt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new sp({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),c(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function qTt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===oe.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let l=o[a];l.update(t),i.shadowMaps.push(l),l.fromLightSource&&(i.lightShadowMaps.push(l),i.lightShadowsEnabled=!0),l.dirty&&(++i.lastDirtyTime,l.dirty=!1)}}}function gCe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),WTt(e),qTt(e),e._globe&&e._globe.render(t)}function YTt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,l=a.pick||a.pickVoxel;c(s.globeDepth)&&(s.globeDepth.picking=l);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,c(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new o3:c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!c(e.sun)&&c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;G.clone(n,f.color),f.execute(i,t);let h=r.useGlobeDepthFramebuffer=c(s.globeDepth);h&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=r.useOIT=!l&&c(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let m=e.postProcessStages,y=r.usePostProcess=!l&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);if(r.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,o.useLogDepth,e._hdr),m.clear(i),y=r.usePostProcess=m.ready,r.usePostProcessSelected=y&&m.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),c(t.framebuffer)&&f.execute(i,t),r.useInvertClassification=!l&&c(t.framebuffer)&&e.invertClassification){let x;if(o.invertClassificationColor.alpha===1&&h&&(x=s.globeDepth.framebuffer),c(x)||i.depthTexture){if(e._invertClassification.previousFramebuffer=x,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let A=e._invertClassification.unclassifiedCommand,C=A.derivedCommands;C.oit=p.createDerivedCommands(A,i,C.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}ci.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;c(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:l,originalFramebuffer:u}=n,f=a?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=l?h.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),l){i.sceneFramebuffer.prepareColorTextures(t);let g=h;a&&!s&&(g=f);let m=this.postProcessStages,y=g.getColorTexture(0),b=p.getColorTexture(0),x=(f??h).getDepthStencilTexture();m.execute(t,y,x,b),m.copy(t,u)}!s&&!l&&a&&(e.framebuffer=u,o.executeCopyColor(t,e))};function XTt(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function KTt(e){if(e.mode===oe.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function yCe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof fl){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=yCe(s,t,n);c(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(c(o)&&o>i)return o}return i}ci.prototype.getHeight=function(e,t){if(!c(e))return;let n=t===We.CLAMP_TO_TERRAIN||t===We.RELATIVE_TO_TERRAIN,i=t===We.CLAMP_TO_3D_TILE||t===We.RELATIVE_TO_3D_TILE;if(!c(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=yCe(this.primitives,e,this);c(s)&&s>o&&(o=s)}let r=this._globe;if(!i&&c(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var L$=new he;ci.prototype.updateHeight=function(e,t,n){T.typeOf.func("callback",t);let i=this._ellipsoid,o=g=>{he.clone(e,L$);let m;c(g)&&(m=g.height),c(m)||(m=this.getHeight(e,n)),c(m)&&(L$.height=m,t(L$))},r=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,s=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE,a;!s&&c(this.globe)&&(a=this.globe._surface.updateHeight(e,o));let l={},u=g=>{if(r||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,o,i);l[g.id]=m};if(!r){let g=this.primitives.length;for(let m=0;m<g;++m){let y=this.primitives.get(m);u(y)}}let f=this.primitives.primitiveAdded.addEventListener(u),h=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(c(l[g.id])&&l[g.id](),delete l[g.id])});return()=>{a=a&&a(),Object.values(l).forEach(g=>g()),l={},f(),h()}};function $Tt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!c(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 c(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){c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=KTt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=$Tt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),c(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function ZTt(e,t){if(e.debugShowFramesPerSecond){if(!c(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new yg({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else c(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function QTt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),c(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function JTt(e){e.primitives.postPassesUpdate(e._frameState),sc.update()}var eAt=new G;function tAt(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=pTt;let r=e.backgroundColor??G.BLACK;e._hdr&&(r=G.clone(r,eAt),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;c(s)&&s.enabled&&(!c(e.light)||e.light instanceof Rp?d.negate(i.sunDirectionWC,e._shadowMapCamera.direction):d.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let l=o.passState;l.framebuffer=void 0,l.blendingEnabled=void 0,l.scissorTest=void 0,l.viewport=Ke.clone(a,l.viewport),c(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(l,r),e.resolveFramebuffers(l),l.framebuffer=void 0,RTt(e,l),c(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function AA(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function nAt(e){return e._picking.updateMostDetailedRayPicks(e)}ci.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,c(e)||(e=Q.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===oe.MORPHING;if(!i&&c(this.maximumRenderTimeChange)&&c(this._lastRenderTime)){let o=Math.abs(Q.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=Q.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=O.incrementWrap(t.frameNumber,15e6,1);hCe(this,o,e),t.newFrame=!0}AA(this,QTt),this.primitives.show&&(AA(this,nAt),AA(this,iAt),AA(this,oAt),i||AA(this,rAt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),AA(this,tAt)),ZTt(this,i),AA(this,JTt),XTt(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(ut.minimumAliasedLineWidth,Math.min(e,ut.maximumAliasedLineWidth))};ci.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};ci.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!c(i))return;let o=i.primitive;if(!(o instanceof V0))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!c(a))return;let l=255*r[2]+r[3];return a3.fromKeyframeNode(o,s,l,a)};ci.prototype.pickMetadata=function(e,t,n,i){T.typeOf.object("windowPosition",e),T.typeOf.string("className",n),T.typeOf.string("propertyName",i);let o=this.pick(e);if(!c(o))return;let r=o.detail?.model?.structuralMetadata;if(!c(r))return;let s=r.schema,a=M3(s,t,n,i);if(!c(a))return;let l=N3(r,n,i);if(!c(l))return;let u=new L3(t,n,i,a,l);return this._picking.pickMetadata(this,e,u)};ci.prototype.pickMetadataSchema=function(e){T.typeOf.object("windowPosition",e);let t=this.pick(e);return c(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 iAt(e){let t=e._frameState;O$.camera=t.camera,O$.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,O$)}function oAt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;R$.camera=e.preloadFlightCamera,R$.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,R$)}function rAt(e){e.primitives.updateForPass(e._frameState,_Tt)}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 Gi.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 sAt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){c(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{c(e)&&c(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}ci.prototype.setTerrain=function(e){return T.typeOf.object("terrain",e),sAt(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(),c(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,c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),de(this)};var F3=ci;function Nw(e){e=e??ie.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=d.multiplyByScalar(e.radii,t,new d);this._scaleMatrix=B.fromScale(n),this._modelMatrix=new B,this._command=new Qe({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(Nw.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Nw.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var F$=new B;Nw.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=B.fromRotationTranslation(e.context.uniformState.inverseViewRotation,d.ZERO,F$),o=B.multiplyTransformation(i,Fo.Y_UP_TO_Z_UP,F$),r=B.multiply(this._scaleMatrix,o,F$);B.clone(r,this._modelMatrix);let s=e.context,a=aAt(this),l=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||l||!c(t)||!t.show,f=this._command;if(!c(f.vertexArray)){let p=Js.createGeometry(new Js({radii:new d(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Ie.POSITION_ONLY}));f.vertexArray=ti.fromGeometry({context:s,geometry:p,attributeLocations:Nn.createAttributeLocations(p),bufferUsage:Be.STATIC_DRAW}),f.renderState=Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:ln.ALPHA_BLEND,depthMask:!1})}let h=a|u<<2|l<<3;if(h!==this._flags){this._flags=h;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),l&&p.push("GLOBE_TRANSLUCENT");let g=new He({defines:p,sources:[nh,iw,c2]}),m=new He({defines:p,sources:[nh,iw,a2]});this._spSkyAtmosphere=Jt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function aAt(e){return!(O.equalsEpsilon(e.hueShift,0,O.EPSILON7)&&O.equalsEpsilon(e.saturationShift,0,O.EPSILON7)&&O.equalsEpsilon(e.brightnessShift,0,O.EPSILON7))}Nw.prototype.isDestroyed=function(){return!1};Nw.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),de(this)};var B3=Nw;function Bw(e){this.sources=e.sources,this._sources=void 0,this.show=e.show??!0,this._command=new Qe({modelMatrix:B.clone(B.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}Bw.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==oe.SCENE3D&&i!==oe.MORPHING||!o.render)return;if(this._hasError){let a=this._error;throw this._hasError=!1,this._error=void 0,a}if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;if(T.defined("this.sources",a),Object.values(Go.FaceName).some(u=>!c(a[u])))throw new E("this.sources must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");let l=typeof a.positiveX;if(Object.values(Go.FaceName).some(u=>typeof a[u]!==l))throw new E("this.sources properties must all be the same type.");typeof a.positiveX=="string"?SI(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 Go({context:r,source:a}))}let s=this._command;if(!c(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=La.createGeometry(La.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY})),l=this._attributeLocations=Nn.createAttributeLocations(a);s.vertexArray=ti.fromGeometry({context:r,geometry:a,attributeLocations:l,bufferUsage:Be.STATIC_DRAW}),s.renderState=Ve.fromCache({blending:ln.ALPHA_BLEND})}if(!c(s.shaderProgram)||this._useHdr!==t){let a=new He({defines:[t?"HDR":""],sources:[l2]});s.shaderProgram=Jt.fromCache({context:r,vertexShaderSource:u2,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(c(this._cubeMap))return s};Bw.prototype.isDestroyed=function(){return!1};Bw.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(),de(this)};function Fw(e){return tn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}Bw.createEarthSkyBox=function(){return new Bw({sources:{positiveX:Fw("px"),negativeX:Fw("mx"),positiveY:Fw("py"),negativeY:Fw("my"),positiveZ:Fw("pz"),negativeZ:Fw("mz")}})};var k3=Bw;function V3(){this.show=!0,this._drawCommand=new Qe({primitiveType:Me.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(V3.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var cAt=new H,lAt=new H,uAt=new se,U3=new se;V3.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===oe.SCENE2D||i===oe.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!c(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let S=Math.max(r,s);S=Math.pow(2,Math.ceil(Math.log(S)/Math.log(2))-2),S=Math.max(1,S);let v=n?o.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._texture=new Rt({context:o,width:S,height:S,pixelFormat:ke.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let P=this,M={u_radiusTS:function(){return P._radiusTS}};this._commands.computeCommand=new Uc({fragmentShaderSource:d2,outputTexture:this._texture,uniformMap:M,persists:!1,owner:this,postExecute:function(){P._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!c(a.vertexArray)){let S={direction:0},v=new Uint8Array(4*2);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let P=yt.createVertexBuffer({context:o,typedArray:v,usage:Be.STATIC_DRAW}),M=[{index:S.direction,vertexBuffer:P,componentsPerAttribute:2,normalize:!0,componentDatatype:$.UNSIGNED_BYTE}],R=yt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});a.vertexArray=new ti({context:o,attributes:M,indexBuffer:R}),a.shaderProgram=Jt.fromCache({context:o,vertexShaderSource:h2,fragmentShaderSource:f2,attributeLocations:S}),a.renderState=Ve.fromCache({blending:ln.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let l=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,h=this._boundingVolume2D;d.clone(l,f.center),h.center.x=u.z,h.center.y=u.x,h.center.z=u.y,f.radius=O.SOLAR_RADIUS+O.SOLAR_RADIUS*this._glowLengthTS,h.radius=f.radius,i===oe.SCENE3D?le.clone(f,a.boundingVolume):i===oe.COLUMBUS_VIEW&&le.clone(h,a.boundingVolume);let p=Gi.computeActualEllipsoidPosition(e,l,U3),g=d.magnitude(d.subtract(p,e.camera.position,U3)),m=o.uniformState.projection,y=uAt;y.x=0,y.y=0,y.z=-g,y.w=1;let b=B.multiplyByVector(m,y,U3),x=Gi.clipToGLWindowCoordinates(t.viewport,b,cAt);y.x=O.SOLAR_RADIUS;let A=B.multiplyByVector(m,y,U3),C=Gi.clipToGLWindowCoordinates(t.viewport,A,lAt);return this._size=H.magnitude(H.subtract(C,x,U3)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};V3.prototype.isDestroyed=function(){return!1};V3.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(),de(this)};var z3=V3;var TCe=Zo(AU(),1);function fAt(e,t,n){return T.typeOf.string("samplerUniformName",e),T.typeOf.string("matrixUniformName",t),T.typeOf.string("styleUniformName",n),` 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 H3=fAt;var dAt={modifyFragmentShader:function(t){return t=He.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}}},kw=dAt;var CA={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function G3(e){T.typeOf.object("options",e),T.typeOf.object("options.arrayBuffer",e.arrayBuffer),this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=G.clone(G.DARKGRAY),this._highlightColor=G.clone(G.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=CA.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??De.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=B.clone(B.IDENTITY),this._modelMatrix=B.clone(B.IDENTITY),this.time=0,this.shadows=xn.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??Vr.NONE,this._splittingEnabled=!1,this._error=void 0,hAt(this,e)}Object.defineProperties(G3.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return G.clone(this._highlightColor)},set:function(e){this._highlightColor=G.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(c(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=le.clone(e,this._boundingSphere)}}});function hAt(e,t){let n=Rx.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&&c(n.batchTableBinary)&&(n.styleableProperties=Kp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),c(n.draco)){let a=n.draco;e._decodingState=CA.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;c(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;c(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;c(r)&&(c(r.constantColor)&&(e._constantColor=G.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;c(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var mAt=new d,pAt=new d,_At=new d,bCe,OG;function gAt(e){if(!c(OG)){bCe=new TCe.default(0),OG=new Array(e);for(let t=0;t<e;++t)OG[t]=bCe.random()}return OG}function yAt(e){let n=e.length/3,i=Math.min(n,20),o=gAt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=d.fromElements(r,r,r,mAt),l=d.fromElements(s,s,s,pAt);for(let f=0;f<i;++f){let h=Math.floor(o[f]*n),p=d.unpack(e,h*3,_At);d.minimumByComponent(a,p,a),d.maximumByComponent(l,p,l)}let u=le.fromCornerPoints(a,l);return u.radius+=O.EPSILON2,u}function xCe(e,t){let n=$.fromTypedArray(e);return n===$.INT||n===$.UNSIGNED_INT||n===$.DOUBLE?(dt("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 bAt=new se,xAt=new se,TAt=new G,ACe=0,RG=1,z$=2,CCe=3,AAt=4,B$=new B,CAt=new B;function EAt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,l=i.batchIds,u=i.styleableProperties,f=c(u),h=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,y=e._quantizedRange,b=e._octEncodedRange,x=e._isRGB565,A=e._isTranslucent,C=e._hasColors,S=e._hasNormals,v=e._hasBatchIds,P,M,R=[],L={};if(e._styleableShaderAttributes=L,f){let V=AAt;for(let j in u)if(u.hasOwnProperty(j)){let U=u[j],q=xCe(U.typedArray,j);P=U.componentCount,M=$.fromTypedArray(q);let Y=yt.createVertexBuffer({context:n,typedArray:q,usage:Be.STATIC_DRAW});e._geometryByteLength+=Y.sizeInBytes;let te={index:V,vertexBuffer:Y,componentsPerAttribute:P,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(te),L[j]={location:V,componentCount:P},++V}}let F=yt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Be.STATIC_DRAW});e._geometryByteLength+=F.sizeInBytes;let _;C&&(_=yt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Be.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let w;S&&(w=yt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Be.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let D;v&&(l.typedArray=xCe(l.typedArray,"batchIds"),D=yt.createVertexBuffer({context:n,typedArray:l.typedArray,usage:Be.STATIC_DRAW}),e._geometryByteLength+=D.sizeInBytes);let I=[];if(h?M=$.UNSIGNED_SHORT:p?M=y<=255?$.UNSIGNED_BYTE:$.UNSIGNED_SHORT:M=$.FLOAT,I.push({index:ACe,vertexBuffer:F,componentsPerAttribute:3,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||p?e._boundingSphere=le.fromCornerPoints(d.ZERO,e._quantizedVolumeScale):e._boundingSphere=yAt(r.typedArray)),C)if(x)I.push({index:RG,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:$.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let V=A?4:3;I.push({index:RG,vertexBuffer:_,componentsPerAttribute:V,componentDatatype:$.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}S&&(g?(P=2,M=$.UNSIGNED_BYTE):m?(P=2,M=b<=255?$.UNSIGNED_BYTE:$.UNSIGNED_SHORT):(P=3,M=$.FLOAT),I.push({index:z$,vertexBuffer:w,componentsPerAttribute:P,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&I.push({index:CCe,vertexBuffer:D,componentsPerAttribute:1,componentDatatype:$.fromTypedArray(l.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(R));let N=new ti({context:n,attributes:I}),k={depthTest:{enabled:!0}},z={depthTest:{enabled:!0},depthMask:!1,blending:ln.ALPHA_BLEND};e._opaquePass===De.CESIUM_3D_TILE&&(k.stencilTest=kt.setCesium3DTileBit(),k.stencilMask=kt.CESIUM_3D_TILE_MASK,z.stencilTest=kt.setCesium3DTileBit(),z.stencilMask=kt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ve.fromCache(k),e._translucentRenderState=Ve.fromCache(z),e._drawCommand=new Qe({boundingVolume:new le,cull:e._cull,modelMatrix:new B,primitiveType:Me.POINTS,vertexArray:N,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:A?e._translucentRenderState:e._opaqueRenderState,pass:A?De.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function SAt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=bAt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let l=t.camera.frustum,u;t.mode===oe.SCENE2D||l instanceof on?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!c(a))return G.TRANSPARENT;let l=G.clone(a.edgeColor,TAt);return l.alpha=a.edgeWidth,l},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!c(a))return B.IDENTITY;let l=e.clippingPlanesOriginMatrix??e._modelMatrix;B.multiply(n.uniformState.view3D,l,B$);let u=B.multiply(B$,a.modelMatrix,B$);return B.inverseTranspose(u,CAt)}};kw.addUniforms(e,s),(i||o||r)&&(s=xt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=xAt;if(c(e._quantizedVolumeScale)){let l=d.clone(e._quantizedVolumeScale,a);d.divideByScalar(l,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),c(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function k$(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 U$(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 V$(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 wAt={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 vAt(e,t,n){let i,o,r,s=t.context,a=c(n),l=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,y=e._hasNormals,b=e._hasBatchIds,x=e._backFaceCulling,A=e._normalShading,C=e._drawCommand.vertexArray,S=e.clippingPlanes,v=e._attenuation,P,M,R,L=g,F=je(wAt),_={},w=e._styleableShaderAttributes;for(o in w)w.hasOwnProperty(o)&&(r=w[o],F[o]=`czm_3dtiles_property_${r.location}`,_[r.location]=r);if(a){let ue={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)";P=n.getColorShaderFunction(`getColorFromStyle${ye}`,F,ue),M=n.getShowShaderFunction(`getShowFromStyle${ye}`,F,ue),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ye}`,F,ue),c(P)&&ue.translucent&&(L=!0)}e._styleTranslucent=L;let D=c(P),I=c(M),N=c(R),k=e.isClipped,z=[],V=[];D&&(k$(P,z),U$(P,V)),I&&(k$(M,z),U$(M,V)),N&&(k$(R,z),U$(R,V));let j=V.indexOf("COLOR")>=0,U=V.indexOf("NORMAL")>=0;if(U&&!y)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");for(o in w)if(w.hasOwnProperty(o)){r=w[o];let ue=z.indexOf(r.location)>=0,ye=V$(C,r.location);ye.enabled=ue}let q=m&&(!D||j);if(m){let ue=V$(C,RG);ue.enabled=q}let Y=y&&(A||x||U);if(y){let ue=V$(C,z$);ue.enabled=Y}let te={a_position:ACe};q&&(te.a_color=RG),Y&&(te.a_normal=z$),b&&(te.a_batchId=CCe);let K="",Z=z.length;for(i=0;i<Z;++i){let ue=z[i];r=_[ue];let ye=r.componentCount,Ae=`czm_3dtiles_property_${ue}`,Pe;ye===1?Pe="float":Pe=`vec${ye}`,K+=`in ${Pe} ${Ae}; `,te[Ae]=r.location}SAt(e,t);let ee=`in vec3 a_position; out vec4 v_color; uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; uniform vec4 u_constantColor; uniform vec4 u_highlightColor; `;ee+=`float u_pointSize; float tiles3d_tileset_time; `,v&&(ee+=`float u_geometricError; float u_depthMultiplier; `),ee+=K,q&&(g?ee+=`in vec4 a_color; `:p?ee+=`in float a_color; const float SHIFT_RIGHT_11 = 1.0 / 2048.0; const float SHIFT_RIGHT_5 = 1.0 / 32.0; const float SHIFT_LEFT_11 = 2048.0; const float SHIFT_LEFT_5 = 32.0; const float NORMALIZE_6 = 1.0 / 64.0; const float NORMALIZE_5 = 1.0 / 32.0; `:ee+=`in vec3 a_color; `),Y&&(f||h?ee+=`in vec2 a_normal; `:ee+=`in vec3 a_normal; `),b&&(ee+=`in float a_batchId; `),(l||u||h)&&(ee+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; `),D&&(ee+=P),I&&(ee+=M),N&&(ee+=R),ee+=`void main() { u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; `,v&&(ee+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; `),q?g?ee+=` vec4 color = a_color; `:p?ee+=` float compressed = a_color; float r = floor(compressed * SHIFT_RIGHT_11); compressed -= r * SHIFT_LEFT_11; float g = floor(compressed * SHIFT_RIGHT_5); compressed -= g * SHIFT_LEFT_5; float b = compressed; vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); vec4 color = vec4(rgb, 1.0); `:ee+=` vec4 color = vec4(a_color, 1.0); `:ee+=` vec4 color = u_constantColor; `,l||u?ee+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; `:ee+=` vec3 position = a_position; `,ee+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); `,Y?(f?ee+=` vec3 normal = czm_octDecode(a_normal); `:h?ee+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; `:ee+=` vec3 normal = a_normal; `,ee+=` vec3 normalEC = czm_normal * normal; `):ee+=` vec3 normal = vec3(1.0); `,D&&(ee+=` color = getColorFromStyle(position, position_absolute, color, normal); `),I&&(ee+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); `),N?ee+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; `:v?ee+=` vec4 positionEC = czm_modelView * vec4(position, 1.0); float depth = -positionEC.z; gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); `:ee+=` gl_PointSize = u_pointSize; `,ee+=` color = color * u_highlightColor; `,Y&&A&&(ee+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); diffuseStrength = max(diffuseStrength, 0.4); color.xyz *= diffuseStrength * czm_lightColor; `),ee+=` v_color = color; gl_Position = czm_modelViewProjection * vec4(position, 1.0); `,Y&&x&&(ee+=` float visible = step(-normalEC.z, 0.0); gl_Position *= visible; gl_PointSize *= visible; `),I&&(ee+=` gl_Position.w *= float(show); gl_PointSize *= float(show); `),ee+=`} `;let me=`in vec4 v_color; `;k&&(me+=`uniform highp sampler2D u_clippingPlanes; uniform mat4 u_clippingPlanesMatrix; uniform vec4 u_clippingPlanesEdgeStyle; `,me+=` `,me+=fg(S,s),me+=` `),me+=`void main() { out_FragColor = czm_gammaCorrect(v_color); `,k&&(me+=H3("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),me+=`} `,e.splitDirection!==Vr.NONE&&(me=kw.modifyFragmentShader(me)),c(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),c(e._fragmentShaderLoaded)&&(me=e._fragmentShaderLoaded(me));let Te=e._drawCommand;c(Te.shaderProgram)&&Te.shaderProgram.destroy(),Te.shaderProgram=Jt.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:me,attributeLocations:te});try{Te.shaderProgram._bind()}catch{throw new ae("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function DAt(e,t){if(e._decodingState===CA.READY)return!1;if(e._decodingState===CA.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=n_.decodePointCloud(i,t);c(o)&&(e._decodingState=CA.DECODING,o.then(function(r){e._decodingState=CA.READY;let s=c(r.POSITION)?r.POSITION.array:void 0,a=c(r.RGB)?r.RGB.array:void 0,l=c(r.RGBA)?r.RGBA.array:void 0,u=c(r.NORMAL)?r.NORMAL.array:void 0,f=c(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=c(s)&&c(r.POSITION.data.quantization),p=c(u)&&c(r.NORMAL.data.quantization);if(h){let b=r.POSITION.data.quantization,x=b.range;e._quantizedVolumeScale=d.fromElements(x,x,x),e._quantizedVolumeOffset=d.unpack(b.minValues),e._quantizedRange=(1<<b.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let b in m)if(m.hasOwnProperty(b)){let x=r[b];c(g)||(g={}),g[b]={typedArray:x.array,componentCount:x.data.componentsPerAttribute}}c(s)&&(n.positions={typedArray:s});let y=l??a;c(y)&&(n.colors={typedArray:y}),c(u)&&(n.normals={typedArray:u}),c(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(r){e._decodingState=CA.FAILED,e._error=r}))}return!0}var PAt=new se,IAt=new d;G3.prototype.update=function(e){let t=e.context;if(c(this._error)){let u=this._error;throw this._error=void 0,u}if(DAt(this,t))return;let i=!1,o=!B.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),c(this._drawCommand)||(EAt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){B.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(B.clone(this._modelMatrix,u),c(this._rtcCenter)&&B.multiplyByTranslation(u,this._rtcCenter,u),c(this._quantizedVolumeOffset)&&B.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==oe.SCENE3D){let h=e.mapProjection,p=B.getColumn(u,3,PAt);se.equals(p,se.UNIT_W)||Ot.basisTo2D(h,u,u)}let f=this._drawCommand.boundingVolume;if(le.clone(this._boundingSphere,f),this._cull){let h=f.center;B.multiplyByPoint(u,h,h);let p=B.getScale(u,IAt);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!==Vr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&vAt(this,e,this._style),this._drawCommand.castShadows=xn.castShadows(this.shadows),this._drawCommand.receiveShadows=xn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?De.TRANSLUCENT:this._opaquePass;let a=e.commandList,l=e.passes;(l.render||l.pick)&&a.push(this._drawCommand)};G3.prototype.isDestroyed=function(){return!1};G3.prototype.destroy=function(){let e=this._drawCommand;return c(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),de(this)};var j3=G3;function SA(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.clock",e.clock),T.typeOf.object("options.intervals",e.intervals),this.show=e.show??!0,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this.shadows=e.shadows??xn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new vm(e.shading),this.style=e.style,this.frameFailed=new pe,this.frameChanged=new pe,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new f_,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(SA.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(c(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function OAt(e){return`uniform vec4 czm_pickColor; ${e}`}function RAt(e){return function(t){return xt(t,{czm_pickColor:function(){return e._pickId.color}})}}function MAt(){return"czm_pickColor"}SA.prototype.makeStyleDirty=function(){this._styleDirty=!0};SA.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var LAt=new Q;function G$(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function EA(e,t){return e._intervals.indexOf(t.start)}function NAt(e,t){let n=e._intervals,i=e._clock,o=G$(e);if(o===0)return;let r=e._getAverageLoadTime(),s=Q.addSeconds(i.currentTime,r*o,LAt),a=n.indexOf(s),l=EA(e,t);return a===l&&(o>=0?++a:--a),n.get(a)}function FAt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function BAt(e,t,n){let i=G$(e),o=EA(e,t),r=EA(e,n);return i>=0?o>=r:o<=r}function SCe(e,t){return function(n){let i=c(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 kAt(e,t,n){let i=EA(e,t),o=e._frames,r=o[i];if(!c(r)){let s=t.data.transform,a=c(s)?B.fromArray(s):void 0,l=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Ti(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:l},o[i]=r,we.fetchArrayBuffer({url:l}).then(function(u){r.pointCloud=new j3({arrayBuffer:u,cull:!0,fragmentShaderLoaded:OAt,uniformMapLoaded:RAt(e),pickIdLoaded:MAt})}).catch(SCe(e,l))}return r}function UAt(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 VAt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(c(o)&&!t.ready){let r=i.commandList,s=r.length;if(wCe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Ti()-t.timestamp)/1e3;UAt(e,a)}}t.touchedFrameNumber=i.frameNumber}var zAt=new B;function HAt(e,t){let n=e.shading;return c(n)&&c(n.baseResolution)?n.baseResolution:c(t.boundingSphere)?O.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function GAt(e){let t=e.shading;return c(t)&&c(t.maximumAttenuation)?t.maximumAttenuation:10}var jAt=new vm;function wCe(e,t,n,i){let o=e.shading??jAt,r=t.pointCloud,s=t.transform??B.IDENTITY;r.modelMatrix=B.multiplyTransformation(e.modelMatrix,s,zAt),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=HAt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=GAt(e);try{r.update(i)}catch(a){SCe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function H$(e,t,n,i){let o=kAt(e,t,i);VAt(e,o,n,i)}function WAt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function vCe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(c(r)&&(!c(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),c(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function qAt(e,t){let n=EA(e,t),i=e._frames[n];if(c(i)&&i.ready)return i}function ECe(e,t,n,i,o){return c(n)?n.ready?!0:(H$(e,t,i,o),n.ready):!1}function YAt(e,t,n,i,o){let r,s,a,l=e._intervals,u=e._frames,f=EA(e,n),h=EA(e,t);if(f>=h){for(r=f;r>=h;--r)if(s=l.get(r),a=u[r],ECe(e,s,a,i,o))return s}else for(r=f;r<=h;++r)if(s=l.get(r),a=u[r],ECe(e,s,a,i,o))return s;return t}function XAt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];c(s)&&c(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var Uw={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};SA.prototype.update=function(e){if(e.mode===oe.MORPHING||!this.show)return;c(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),c(this._loadTimestamp)||(this._loadTimestamp=Q.clone(e.time));let t=Math.max(Q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=c(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&XAt(this,o,s),Uw.timeSinceLoad=t,Uw.isClipped=r;let a=this.shading,l=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,h=this._previousInterval,p=this._nextInterval,g=FAt(this);if(!c(g))return;let m=!1,y=G$(this),b=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!c(h)||b)&&(h=g),(!c(p)||m||BAt(this,g,p))&&(p=NAt(this,g)),h=YAt(this,h,g,Uw,e);let x=qAt(this,h);c(x)||(H$(this,h,Uw,e),x=this._lastRenderedFrame),c(x)&&wCe(this,x,Uw,e),c(p)&&H$(this,p,Uw,e);let A=this;c(x)&&!c(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),c(x)&&x!==this._lastRenderedFrame&&A.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return A.frameChanged.raiseEvent(A),!0}),this._previousInterval=h,this._nextInterval=p,this._lastRenderedFrame=x;let C=this._totalMemoryUsageInBytes,S=this.maximumMemoryUsage*1024*1024;C>S&&vCe(this,WAt(e));let P=u.length-f;c(a)&&a.attenuation&&a.eyeDomeLighting&&P>0&&l.update(e,f,a,this.boundingSphere)};SA.prototype.isDestroyed=function(){return!1};SA.prototype.destroy=function(){return vCe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),de(this)};var Vw=SA;function ICe(e,t){if(c(t)){let n=t.clock;c(n)&&n.getValue(e)}}function KAt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!c(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function OCe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,c(e._scene)&&(e._scene.pixelRatio=t),t}function RCe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=OCe(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 MCe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;c(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Io(e,t){if(!c(e))throw new E("container is required.");e=In(e),t=t??W.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Vt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Vt.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 a=document.createElement("div");a.className="cesium-widget-credits";let l=c(t.creditContainer)?In(t.creditContainer):n;l.appendChild(a);let u=c(t.creditViewport)?In(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=l,this._innerCreditContainer=a,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 pe,this._allowDataSourcesToSuspendAnimation=!0,this._clock=c(t.clock)?t.clock:new Ah,c(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),RCe(this);try{let p=t.ellipsoid??ie.default,g=new F3({canvas:i,contextOptions:t.contextOptions,creditContainer:a,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=g,g.camera.constrainedAxis=d.UNIT_Z,OCe(this),MCe(this);let m=t.globe;c(m)||(m=new V2(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??xn.RECEIVE_ONLY);let y=t.skyBox;!c(y)&&ie.WGS84.equals(p)&&(y=k3.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new z3,ie.WGS84.equals(p)&&(g.moon=new q2));let b=t.skyAtmosphere;!c(b)&&ie.WGS84.equals(p)&&(b=new B3(p),b.show=t.globe!==!1&&m.show),b!==!1&&(g.skyAtmosphere=b);let x=t.baseLayer;if(t.globe!==!1&&x!==!1&&(c(x)||(x=Xa.fromWorldImagery()),g.imageryLayers.add(x)),c(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),c(t.terrain)&&t.globe!==!1){if(c(t.terrainProvider))throw new E("Specify either options.terrainProvider or options.terrain.");g.setTerrain(t.terrain)}this._screenSpaceEventHandler=new of(i),c(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 A=this;this._onRenderError=function(R,L){A._useDefaultRenderLoop=!1,A._renderLoopRunning=!1,A._showRenderLoopErrors&&A.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,L)},g.renderError.addEventListener(this._onRenderError);let C=t.dataSources,S=!1;c(C)||(C=new wN,S=!0);let v=new uF({scene:g,dataSourceCollection:C}),P=new gr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=C,this._destroyDataSourceCollection=S,this._dataSourceDisplay=v,this._eventHelper=P,this._canAnimateUpdateCallback=this._updateCanAnimate,P.add(this._clock.onTick,Io.prototype._onTick,this),P.add(g.morphStart,Io.prototype._clearTrackedObject,this),P.add(C.dataSourceAdded,Io.prototype._onDataSourceAdded,this),P.add(C.dataSourceRemoved,Io.prototype._onDataSourceRemoved,this),P.add(g.postRender,Io.prototype._postRender,this);let M=C.length;for(let R=0;R<M;R++)this._dataSourceAdded(C,C.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),P.add(C.dataSourceAdded,Io.prototype._dataSourceAdded,this),P.add(C.dataSourceRemoved,Io.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(Io.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){if(e<=0)throw new E("targetFrameRate must be greater than 0, or undefined.");this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&KAt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){if(e<=0)throw new E("resolutionScale must be greater than 0.");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,j$(this);let t=this.scene,n=t.mode;!c(e)||!c(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(B.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,ICe(this.clock,e))}}});Io.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function l(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}l(),c(window.addEventListener)&&window.addEventListener("resize",l,!1);let u=c(t),f=c(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let m=ep(n);u||(typeof n=="string"&&(n=new Error(n)),t=ep({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} ${t} ${m}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let b=document.createElement("span");b.className="cesium-widget-errorPanel-more-details",b.appendChild(document.createTextNode("See more...")),y.appendChild(b),y.onclick=function(x){y.removeChild(b),y.appendChild(document.createTextNode(m)),y.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}g.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(){c(l)&&c(window.removeEventListener)&&window.removeEventListener("resize",l,!1),i.removeChild(o)},h.appendChild(p),i.appendChild(o)};Io.prototype.isDestroyed=function(){return!1};Io.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(),c(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()),de(this)};Io.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,RCe(this),MCe(this),this._scene.requestRender())};Io.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Io.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Io.prototype._onEntityCollectionChanged,this)};Io.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Io.prototype._onEntityCollectionChanged,this),c(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Io.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var $At=new le;Io.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(c(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!1,i.boundingSphere??$At)===lt.DONE&&i.update(t)}};Io.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)}};Io.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Io.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&ICe(this.clock,e)};Io.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Io.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Io.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}};Io.prototype.zoomTo=function(e,t){return LCe(this,e,{offset:t},!1)};Io.prototype.flyTo=function(e,t){return LCe(this,e,t,!0)};function LCe(e,t,n,i){if(!c(t))throw new E("zoomTarget is required.");j$(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof Xa){let s;c(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let l=r.readyEvent.addEventListener(()=>{l(),a(r.getImageryRectangle())})}),s.then(function(a){return VT(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof bs||r instanceof Vw||r instanceof V0){e._zoomTarget=r;return}if(r.isLoading&&c(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,c(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function W3(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function j$(e){let t=e._zoomPromise;c(t)&&(W3(e),e._completeZoom(!1))}Io.prototype._postRender=function(){ZAt(this),QAt(this)};var DCe=new le;function ZAt(e){let t=e._zoomTarget;if(!c(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(f){c(o.offset)||(o.offset=new cd(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(t.boundingSphere,r):(i.viewBoundingSphere(f,o.offset),i.lookAtTransform(B.IDENTITY),e._completeZoom(!0)),W3(e)}if(t instanceof Vw){if(c(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(h){s(h.boundingSphere),f()});return}if(t instanceof bs||t instanceof V0){s(t.boundingSphere);return}if(t instanceof he){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),W3(e);return}let a=t,l=[];for(let f=0,h=a.length;f<h;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,DCe);if(p===lt.PENDING)return;p!==lt.FAILED&&l.push(le.clone(DCe))}if(l.length===0){j$(e);return}e.trackedEntity=void 0;let u=le.fromBoundingSpheres(l);e._zoomIsFlight?(W3(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(B.IDENTITY),W3(e),e._completeZoom(!0))}var PCe=new le;function QAt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=X.getValueOrUndefined(t.position,n);if(!c(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,PCe);if(r===lt.PENDING)return;let s=o.mode;(s===oe.COLUMBUS_VIEW||s===oe.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===oe.COLUMBUS_VIEW||s===oe.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==lt.FAILED?PCe:void 0;e._entityView=new dF(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var q3=Io;function Gw(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var wA=new ce;function JAt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}Gw.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let g=t;g<=i;++g)JAt(e,g,p,s)||s.push(new zw(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,wA);let a=wA.west,l=wA.north;r.tileXYToRectangle(i,o,e,wA);let u=wA.east,f=wA.south,h=new oCt(e,a,f,u,l);for(let p=0;p<s.length;++p){let g=s[p];W$(g.extent,h)&&rCt(this._maximumLevel,g,h)}};Gw.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(Hw(i.extent,e)){t=i;break}}return c(t)?Y3(void 0,t,e):-1};var eCt=[],tCt=[],nCt=new ce,iCt=new ce;Gw.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=eCt;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,nCt)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,iCt))):t.push(e);let n=tCt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)X3(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(c(n[i])&&n[i].length===0)return i;return 0};var NCe=new he;Gw.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,wA);return ce.center(i,NCe),this.computeMaximumLevelAtPosition(NCe)>=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 zw(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(zw.prototype,{nw:{get:function(){return this._nw||(this._nw=new zw(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new zw(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new zw(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new zw(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function oCt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function W$(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 rCt(e,t,n){for(;t.level<e;)if(MG(t.nw.extent,n))t=t.nw;else if(MG(t.ne.extent,n))t=t.ne;else if(MG(t.sw.extent,n))t=t.sw;else if(MG(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=Lo(t.rectangles,n.level,sCt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function sCt(e,t){return e.level-t}function MG(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function Hw(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function Y3(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&Hw(t._nw.extent,n),s=t._ne&&Hw(t._ne.extent,n),a=t._sw&&Hw(t._sw.extent,n),l=t._se&&Hw(t._se.extent,n);if(r+s+a+l>1){r&&(i=Math.max(i,Y3(t,t._nw,n))),s&&(i=Math.max(i,Y3(t,t._ne,n))),a&&(i=Math.max(i,Y3(t,t._sw,n))),l&&(i=Math.max(i,Y3(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:l?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];Hw(a,n)&&(i=a.level)}t=t.parent}return i}function X3(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||W$(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=aCt(e[s.level],s)}X3(e,t._nw,n),X3(e,t._ne,n),X3(e,t._sw,n),X3(e,t._se,n)}function aCt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];W$(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 Xh=Gw;var cCt=15;function FCe(e){this.ellipsoid=e.ellipsoid??ie.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}FCe.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 lCt(e,t){let n=t.copyrightText;c(n)&&(e.credit=new Tt(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=ce.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Ki(s);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),s.rectangleSouthwestInMeters=new H(r.xmin,r.ymin),s.rectangleNortheastInMeters=new H(r.xmax,r.ymax),e.tilingScheme=new ls(s)}else throw new ae("Invalid spatial reference");let a=t.tileInfo;if(!c(a))throw new ae("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?fd.LERC:fd.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Xh(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Xh(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=cs.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."),c(t.minValues)&&c(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function uCt(e,t,n){try{let i=await t.fetchJson();lCt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Po.reportError(void 0,n,c(n)?n._errorEvent:void 0,o),i}}function H0(e){e=e??W.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 pe}Object.defineProperties(H0.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}}});H0.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT,e=await Promise.resolve(e);let n=we.createIfNeeded(e);n.appendForwardSlash(),c(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new FCe(t);await uCt(o,i);let r=new H0(t);return o.build(r),r._resource=n,r};H0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!c(q$(this,n+1,e*2,t*2))){let h=BCe(this,n+1,e*2,t*2);s=h.promise,a=h.request}let l=o.fetchArrayBuffer();if(!c(l)||!c(s))return;let u=this,f=this._tilesAvailable;return Promise.all([l,s]).then(function(h){return new qa({buffer:h[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):cCt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(h){if(c(a)&&a.state===$n.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=$n.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function q$(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}H0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};H0.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=q$(this,n,e,t);if(c(i))return i;BCe(this,n,e,t)};H0.prototype.loadTileDataAvailability=function(e,t,n){};function fCt(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],l={startX:e.x,startY:e.y,endX:0,endY:0},u=new H(e.x+1,e.y+1),f=!1,h=!1;for(;!(f&&h);){let p=u.x,g=h?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new H(u.x,e.y)),--u.x,--p,l.endX=u.x):u.x===o?(l.endX=u.x,f=!0):++u.x}if(!h){let m=u.y*t;for(let y=e.x;y<=p;++y)if(i[m+y]!==s){h=!0;break}h?(a.push(new H(e.x,u.y)),--u.y,l.endY=u.y):u.y===r?(l.endY=u.y,h=!0):++u.y}}return{endingIndices:a,range:l,value:s}}function dCt(e,t,n,i,o){let r=[];if(o.every(function(l){return l===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new H(0,0)];for(;a.length>0;){let l=a.pop(),u=fCt(l,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&&(a=a.concat(f))}return r}function BCe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,l=e._availableCache;if(c(l[a]))return l[a];let u=new Qo({throttle:!1,throttleByServer:!0,type:ms.TERRAIN}),h=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return c(h)?(h=h.then(function(p){let g=dCt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let m=e._tilesAvailable;for(let y=0;y<g.length;++y){let b=g[y];m.addAvailableTileRange(t,b.startX,b.startY,b.endX,b.endY)}return q$(e,t,n,i)}),l[a]={promise:h,request:u},h=h.finally(function(p){return delete l[a],p}),{promise:h,request:u}):{}}var Y$=H0;var kCe="https://dev.virtualearth.net/REST/v1/Locations";function X$(e){e=e??W.EMPTY_OBJECT;let t=e.key;if(!c(t))throw new E("options.key is required.");this._key=t;let n={key:t};c(e.culture)&&(n.culture=e.culture),this._resource=new we({url:kCe,queryParameters:n}),this._credit=new Tt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(X$.prototype,{url:{get:function(){return kCe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});X$.prototype.geocode=async function(e){return T.typeOf.string("query",e),this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],l=r[2],u=r[3];return{displayName:o.name,destination:ce.fromDegrees(a,s,u,l)}})})};var K$=X$;function $$(){}Object.defineProperties($$.prototype,{credit:{get:function(){}}});$$.prototype.geocode=function(e){T.typeOf.string("query",e);let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:d.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var Z$=$$;var hCt=new se,UCe=new d,jw=new d;function mCt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,l){c(l)||(l=new d);let u=(a-i)*o;return d.lerp(r,s,u,l)}}return function(i,o){c(o)||(o=new d);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=hCt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let l,u,f,h,p;return r===0?(l=t[0],u=t[1],f=e.firstTangent,h=d.subtract(t[2],l,UCe),d.multiplyByScalar(h,.5,h),p=B.multiplyByVector(Iy.hermiteCoefficientMatrix,a,a)):r===t.length-2?(l=t[r],u=t[r+1],h=e.lastTangent,f=d.subtract(u,t[r-1],UCe),d.multiplyByScalar(f,.5,f),p=B.multiplyByVector(Iy.hermiteCoefficientMatrix,a,a)):(l=t[r-1],u=t[r],f=t[r+1],h=t[r+2],p=B.multiplyByVector(G0.catmullRomCoefficientMatrix,a,a)),o=d.multiplyByScalar(l,p.x,o),d.multiplyByScalar(u,p.y,jw),d.add(o,jw,o),d.multiplyByScalar(f,p.z,jw),d.add(o,jw,o),d.multiplyByScalar(h,p.w,jw),d.add(o,jw,o)}}var pCt=new d,_Ct=new d;function G0(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(T.defined("points",t),T.defined("times",n),T.typeOf.number.greaterThanOrEquals("points.length",t.length,2),T.typeOf.number.equals("times.length","points.length",n.length,t.length),t.length>2&&(c(i)||(i=pCt,d.multiplyByScalar(t[1],2,i),d.subtract(i,t[2],i),d.subtract(i,t[0],i),d.multiplyByScalar(i,.5,i)),!c(o))){let r=t.length-1;o=_Ct,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=mCt(this),this._lastTimeIndex=0}Object.defineProperties(G0.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}}});G0.catmullRomCoefficientMatrix=new B(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);G0.prototype.findTimeInterval=Ni.prototype.findTimeInterval;G0.prototype.wrapTime=Ni.prototype.wrapTime;G0.prototype.clampTime=Ni.prototype.clampTime;G0.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Q$=G0;var LG={};LG.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){if(!c(e))throw new E("threshold is required.");if(!c(t))throw new E("keepAbove is required.");if(!c(n))throw new E("u0 is required.");if(!c(i))throw new E("u1 is required.");if(!c(o))throw new E("u2 is required.");c(r)?r.length=0:r=[];let s,a,l;t?(s=n<e,a=i<e,l=o<e):(s=n>e,a=i>e,l=o>e);let u=s+a+l,f,h,p,g,m,y;return u===1?s?(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))):a?(p=(e-i)/(o-i),g=(e-i)/(n-i),r.push(2),r.push(0),g!==1&&(r.push(-1),r.push(1),r.push(0),r.push(g)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):l&&(m=(e-o)/(n-o),y=(e-o)/(i-o),r.push(0),r.push(1),y!==1&&(r.push(-1),r.push(2),r.push(1),r.push(y)),m!==1&&(r.push(-1),r.push(2),r.push(0),r.push(m))):u===2?!s&&n!==e?(g=(e-i)/(n-i),m=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(g),r.push(-1),r.push(2),r.push(0),r.push(m)):!a&&i!==e?(y=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(y),r.push(-1),r.push(0),r.push(1),r.push(f)):!l&&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};LG.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,l){if(!c(e))throw new E("x is required.");if(!c(t))throw new E("y is required.");if(!c(n))throw new E("x1 is required.");if(!c(i))throw new E("y1 is required.");if(!c(o))throw new E("x2 is required.");if(!c(r))throw new E("y2 is required.");if(!c(s))throw new E("x3 is required.");if(!c(a))throw new E("y3 is required.");let u=n-s,f=s-o,h=r-a,p=i-a,g=1/(h*u+f*p),m=t-a,y=e-s,b=(h*y+f*m)*g,x=(-p*y+u*m)*g,A=1-b-x;return c(l)?(l.x=b,l.y=x,l.z=A,l):new d(b,x,A)};LG.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,l){T.typeOf.number("x00",e),T.typeOf.number("y00",t),T.typeOf.number("x01",n),T.typeOf.number("y01",i),T.typeOf.number("x10",o),T.typeOf.number("y10",r),T.typeOf.number("x11",s),T.typeOf.number("y11",a);let u=(s-o)*(t-r)-(a-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),h=(a-r)*(n-e)-(s-o)*(i-t);if(h===0)return;let p=u/h,g=f/h;if(p>=0&&p<=1&&g>=0&&g<=1)return c(l)||(l=new H),l.x=e+p*(n-e),l.y=t+p*(i-t),l};var Pg=LG;function j0(e){if(!c(e)||!c(e.quantizedVertices))throw new E("options.quantizedVertices is required.");if(!c(e.indices))throw new E("options.indices is required.");if(!c(e.minimumHeight))throw new E("options.minimumHeight is required.");if(!c(e.maximumHeight))throw new E("options.maximumHeight is required.");if(!c(e.maximumHeight))throw new E("options.maximumHeight is required.");if(!c(e.boundingSphere))throw new E("options.boundingSphere is required.");if(!c(e.horizonOcclusionPoint))throw new E("options.horizonOcclusionPoint is required.");if(!c(e.westIndices))throw new E("options.westIndices is required.");if(!c(e.southIndices))throw new E("options.southIndices is required.");if(!c(e.eastIndices))throw new E("options.eastIndices is required.");if(!c(e.northIndices))throw new E("options.northIndices is required.");if(!c(e.westSkirtHeight))throw new E("options.westSkirtHeight is required.");if(!c(e.southSkirtHeight))throw new E("options.southSkirtHeight is required.");if(!c(e.eastSkirtHeight))throw new E("options.eastSkirtHeight is required.");if(!c(e.northSkirtHeight))throw new E("options.northSkirtHeight is required.");this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=FG(e.westIndices,o,t),this._southIndices=FG(e.southIndices,r,t),this._eastIndices=FG(e.eastIndices,o,t),this._northIndices=FG(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(j0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return c(this._mesh)}}});var NG=[];function FG(e,t,n){NG.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)NG[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(NG.sort(t),Fe.createTypedArray(n,NG)):e}var VCe="createVerticesFromQuantizedTerrainMesh",gCt=new yi(VCe),yCt=new yi(VCe,kh.maximumAsynchronousTasks);j0.prototype.createMesh=function(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),h=(a?yCt:gCt).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:l,exaggeration:r,exaggerationRelativeHeight:s});if(!c(h))return;let p=this;return Promise.resolve(h).then(function(g){let m=p._quantizedVertices.length/3,y=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,b=Fe.createTypedArray(y,g.indices),x=new Float32Array(g.vertices),A=g.center,C=g.minimumHeight,S=g.maximumHeight,v=p._boundingSphere,P=p._orientedBoundingBox,M=d.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,R=g.vertexStride,L=Oc.clone(g.encoding);return p._mesh=new hd(A,x,b,g.indexCountWithoutSkirts,m,C,S,v,M,R,P,L,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var bCt=new yi("upsampleQuantizedTerrainMesh",kh.maximumAsynchronousTasks);j0.prototype.upsample=function(e,t,n,i,o,r,s){if(!c(e))throw new E("tilingScheme is required.");if(!c(t))throw new E("thisX is required.");if(!c(n))throw new E("thisY is required.");if(!c(i))throw new E("thisLevel is required.");if(!c(o))throw new E("descendantX is required.");if(!c(r))throw new E("descendantY is required.");if(!c(s))throw new E("descendantLevel is required.");if(s-i>1)throw new E("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(this._mesh))return;let u=t*2!==o,f=n*2===r,h=e.ellipsoid,p=e.tileXYToRectangle(o,r,s),g=bCt.scheduleTask({vertices:l.vertices,vertexCountWithoutSkirts:l.vertexCountWithoutSkirts,indices:l.indices,indexCountWithoutSkirts:l.indexCountWithoutSkirts,encoding:l.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:u,isNorthChild:f,childRectangle:p,ellipsoid:h});if(!c(g))return;let m=Math.min(this._westSkirtHeight,this._eastSkirtHeight);m=Math.min(m,this._southSkirtHeight),m=Math.min(m,this._northSkirtHeight);let y=u?m*.5:this._westSkirtHeight,b=f?m*.5:this._southSkirtHeight,x=u?this._eastSkirtHeight:m*.5,A=f?this._northSkirtHeight:m*.5,C=this._credits;return Promise.resolve(g).then(function(S){let v=new Uint16Array(S.vertices),P=Fe.createTypedArray(v.length/3,S.indices),M;return c(S.encodedNormals)&&(M=new Uint8Array(S.encodedNormals)),new j0({quantizedVertices:v,indices:P,encodedNormals:M,minimumHeight:S.minimumHeight,maximumHeight:S.maximumHeight,boundingSphere:le.clone(S.boundingSphere),orientedBoundingBox:Dn.clone(S.orientedBoundingBox),horizonOcclusionPoint:d.clone(S.horizonOcclusionPoint),westIndices:S.westIndices,southIndices:S.southIndices,eastIndices:S.eastIndices,northIndices:S.northIndices,westSkirtHeight:y,southSkirtHeight:b,eastSkirtHeight:x,northSkirtHeight:A,childTileMask:0,credits:C,createdByUpsampling:!0})})};var J$=32767,zCe=new d;j0.prototype.interpolateHeight=function(e,t,n){let i=O.clamp((t-e.west)/e.width,0,1);i*=J$;let o=O.clamp((n-e.south)/e.height,0,1);return o*=J$,c(this._mesh)?CCt(this,i,o):ECt(this,i,o)};function HCe(e,t,n,i,o,r,s,a){let l=Math.min(n,o,s),u=Math.max(n,o,s),f=Math.min(i,r,a),h=Math.max(i,r,a);return e>=l&&e<=u&&t>=f&&t<=h}var xCt=new H,TCt=new H,ACt=new H;function CCt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,l=s.length;a<l;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,u,xCt),g=r.decodeTextureCoordinates(o,f,TCt),m=r.decodeTextureCoordinates(o,h,ACt);if(HCe(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=Pg.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,zCe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let b=r.decodeHeight(o,u),x=r.decodeHeight(o,f),A=r.decodeHeight(o,h);return y.x*b+y.y*x+y.z*A}}}}function ECt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,l=s.length;a<l;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=i[u],g=i[f],m=i[h],y=o[u],b=o[f],x=o[h];if(HCe(t,n,p,y,g,b,m,x)){let A=Pg.computeBarycentricCoordinates(t,n,p,y,g,b,m,x,zCe);if(A.x>=-1e-15&&A.y>=-1e-15&&A.z>=-1e-15){let C=A.x*r[u]+A.y*r[f]+A.z*r[h];return O.lerp(e._minimumHeight,e._maximumHeight,C/J$)}}}}j0.prototype.isChildAvailable=function(e,t,n,i){if(!c(e))throw new E("thisX is required.");if(!c(t))throw new E("thisY is required.");if(!c(n))throw new E("childX is required.");if(!c(i))throw new E("childY is required.");let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};j0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var vA=j0;function SCt(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 jCe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ie.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=[]}jCe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=c(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 WCe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=Po.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=Po.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,c(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 y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Po.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}let l=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new ls({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Po.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}if(e.levelZeroMaximumGeometricError=cs.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Po.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}let f;c(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:c(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),c(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),c(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let h=t.metadataAvailability,p=t.available,g;if(c(p)&&!c(h)){g=new Xh(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let b=p[y],x=e.tilingScheme.getNumberOfYTilesAtLevel(y);c(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let A=0;A<b.length;++A){let C=b[A],S=x-C.endY-1,v=x-C.startY-1;e.overallAvailability[y].push([C.startX,S,C.endX,v]),g.addAvailableTileRange(y,C.startX,S,C.endX,v)}}}else c(h)&&(f=new Xh(e.tilingScheme,u),g=new Xh(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,c(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new SCt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:l,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return c(m)?c(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await nZ(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function wCt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(c(t)&&(i+=` ${t.message}`),e.previousError=Po.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,i),e.previousError.retry)return nZ(e,n);throw new ae(i)}async function vCt(e,t,n){await WCe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Xh(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let l=s[a];o.addAvailableTileRange(r,l[0],l[1],l[2],l[3])}}}if(e.attribution.length>0){let o=new Tt(e.attribution);e.tileCredits.push(o)}return!0}async function nZ(e,t){try{let n=await e.layerJsonResource.fetchJson();return vCt(e,n,t)}catch(n){return c(n)&&n.statusCode===404?(await WCe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):wCt(e,n,t)}}function Kh(e){e=e??W.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 pe;let t=e.credit;typeof t=="string"&&(t=new Tt(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 eZ={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function GCe(e){return!c(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 DCt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new qa({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 PCt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,l=3,u=l+1,f=Float64Array.BYTES_PER_ELEMENT*l,h=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,y=Uint16Array.BYTES_PER_ELEMENT,b=y*m,x=new DataView(t),A=new d(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0));a+=f;let C=x.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=x.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new le(new d(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0)),x.getFloat64(a+f,!0));a+=h;let P=new d(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0));a+=f;let M=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,M*3);a+=M*g,M>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,b=y*m);let L=R.subarray(0,M),F=R.subarray(M,2*M),_=R.subarray(M*2,3*M);Ln.zigZagDeltaDecode(L,F,_),a%y!==0&&(a+=y-a%y);let w=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let D=Fe.createTypedArrayFromArrayBuffer(M,t,a,w*m);a+=w*b;let I=0,N=D.length;for(let ue=0;ue<N;++ue){let ye=D[ue];D[ue]=I-ye,ye===0&&++I}let k=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let z=Fe.createTypedArrayFromArrayBuffer(M,t,a,k);a+=k*y;let V=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let j=Fe.createTypedArrayFromArrayBuffer(M,t,a,V);a+=V*y;let U=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let q=Fe.createTypedArrayFromArrayBuffer(M,t,a,U);a+=U*y;let Y=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let te=Fe.createTypedArrayFromArrayBuffer(M,t,a,Y);a+=Y*y;let K,Z;for(;a<x.byteLength;){let ue=x.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let ye=x.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,ue===eZ.OCT_VERTEX_NORMALS&&e._requestVertexNormals)K=new Uint8Array(t,a,M*2);else if(ue===eZ.WATER_MASK&&e._requestWaterMask)Z=new Uint8Array(t,a,ye);else if(ue===eZ.METADATA&&e._requestMetadata){let Ae=x.getUint32(a,!0);if(Ae>0){let Ee=ir(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Ae).available;if(c(Ee))for(let ze=0;ze<Ee.length;++ze){let qe=n+ze+1,it=Ee[ze],Dt=e._tilingScheme.getNumberOfYTilesAtLevel(qe);for(let jt=0;jt<it.length;++jt){let $e=it[jt],un=Dt-$e.endY-1,zt=Dt-$e.startY-1;e.availability.addAvailableTileRange(qe,$e.startX,un,$e.endX,zt),r.availability.addAvailableTileRange(qe,$e.startX,un,$e.endX,zt)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=ye}let ee=e.getLevelMaximumGeometricError(n)*5,me=e._tilingScheme.tileXYToRectangle(i,o,n),Te=Dn.fromRectangle(me,C,S,e._tilingScheme.ellipsoid);return new vA({center:A,minimumHeight:C,maximumHeight:S,boundingSphere:v,orientedBoundingBox:Te,horizonOcclusionPoint:P,quantizedVertices:R,encodedNormals:K,indices:D,westIndices:z,southIndices:j,eastIndices:q,northIndices:te,westSkirtHeight:ee,southSkirtHeight:ee,eastSkirtHeight:ee,northSkirtHeight:ee,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:Z,credits:e._tileCredits})}Kh.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,l=Promise.resolve();if(s===1)r=o[0];else for(let u=0;u<s;++u){let f=o[u];if(!c(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let h=iZ(this,e,t,n,f,u===0);h.result&&(a=!0,l=l.then(()=>h.promise))}return!c(r)&&a?l.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):qCe(this,e,t,n,r,i)};function qCe(e,t,n,i,o,r){if(!c(o))return Promise.reject(new ae("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let l=[];e._requestVertexNormals&&o.hasVertexNormals&&l.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&l.push("watermask"),e._requestMetadata&&o.hasMetadata&&l.push("metadata");let u,f,h=s[(t+a+i)%s.length],p=o.resource;c(p._ionEndpoint)&&!c(p._ionEndpoint.externalType)?(l.length!==0&&(f={extensions:l.join("-")}),u=GCe(void 0)):u=GCe(l);let g=p.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(c(g))return g.then(function(m){return c(m)?c(e._heightmapStructure)?DCt(e,m,i,t,n):PCt(e,m,i,t,n,o):Promise.reject(new ae("Mesh buffer doesn't exist."))})}Object.defineProperties(Kh.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}}});Kh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Kh.fromIonAssetId=async function(e,t){T.defined("assetId",e);let n=await Cu.fromAssetId(e);return Kh.fromUrl(n,t)};Kh.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT,e=await Promise.resolve(e);let n=we.createIfNeeded(e);n.appendForwardSlash();let i=new jCe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await nZ(i);let o=new Kh(t);return i.build(o),o};Kh.prototype.getTileDataAvailable=function(e,t,n){if(!c(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(iZ(this,e,t,n,i[r],r===0).result)return;return!1};Kh.prototype.loadTileDataAvailability=function(e,t,n){if(!c(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=iZ(this,e,t,n,i[r],r===0);if(c(s.promise))return s.promise}};function tZ(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,l=n/s|0;return{level:r,x:a,y:l}}function iZ(e,t,n,i,o,r){if(!c(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},l=o.availabilityTilesLoaded,u=o.availability,f=tZ(o,t,n,i);for(;c(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!l.isTileAvailable(f.level,f.x,f.y)){let h;if(!r&&(s=`${f.level}-${f.x}-${f.y}`,h=o.availabilityPromiseCache[s],!c(h))){let p=new Qo({throttle:!1,throttleByServer:!0,type:ms.TERRAIN});h=qCe(e,f.x,f.y,f.level,o,p),c(h)&&(o.availabilityPromiseCache[s]=h,h.then(a))}return{result:!0,promise:h}}f=tZ(o,f.x,f.y,f.level)}return{result:!1}}Kh._getAvailabilityTile=tZ;var DA=Kh;function Ig(e){e=e??W.EMPTY_OBJECT;let t=e.radius;T.typeOf.number("radius",t);let 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 dl(n),this._workerName="createCircleGeometry"}Ig.packedLength=dl.packedLength;Ig.pack=function(e,t,n){return T.typeOf.object("value",e),dl.pack(e._ellipseGeometry,t,n)};var YCe=new dl({center:new d,semiMajorAxis:1,semiMinorAxis:1}),$a={center:new d,radius:void 0,ellipsoid:ie.clone(ie.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Ie,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};Ig.unpack=function(e,t,n){let i=dl.unpack(e,t,YCe);return $a.center=d.clone(i._center,$a.center),$a.ellipsoid=ie.clone(i._ellipsoid,$a.ellipsoid),$a.ellipsoid=ie.clone(i._ellipsoid,YCe._ellipsoid),$a.height=i._height,$a.extrudedHeight=i._extrudedHeight,$a.granularity=i._granularity,$a.vertexFormat=Ie.clone(i._vertexFormat,$a.vertexFormat),$a.stRotation=i._stRotation,$a.shadowVolume=i._shadowVolume,c(n)?($a.semiMajorAxis=i._semiMajorAxis,$a.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new dl($a),n):($a.radius=i._semiMajorAxis,new Ig($a))};Ig.createGeometry=function(e){return dl.createGeometry(e._ellipseGeometry)};Ig.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new Ig({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Ig.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var oZ=Ig;function Ww(e){e=e??W.EMPTY_OBJECT;let t=e.radius;T.typeOf.number("radius",t);let 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 Hu(n),this._workerName="createCircleOutlineGeometry"}Ww.packedLength=Hu.packedLength;Ww.pack=function(e,t,n){return T.typeOf.object("value",e),Hu.pack(e._ellipseGeometry,t,n)};var ICt=new Hu({center:new d,semiMajorAxis:1,semiMinorAxis:1}),cf={center:new d,radius:void 0,ellipsoid:ie.clone(ie.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=Hu.unpack(e,t,ICt);return cf.center=d.clone(i._center,cf.center),cf.ellipsoid=ie.clone(i._ellipsoid,cf.ellipsoid),cf.height=i._height,cf.extrudedHeight=i._extrudedHeight,cf.granularity=i._granularity,cf.numberOfVerticalLines=i._numberOfVerticalLines,c(n)?(cf.semiMajorAxis=i._semiMajorAxis,cf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Hu(cf),n):(cf.radius=i._semiMajorAxis,new Ww(cf))};Ww.createGeometry=function(e){return Hu.createGeometry(e._ellipseGeometry)};var rZ=Ww;function OCt(e){return e=e??W.EMPTY_OBJECT,DA.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var K3=OCt;function RCt(e){return e=e??W.EMPTY_OBJECT,DA.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ie.WGS84})}var PA=RCt;function qw(e){e=e??W.EMPTY_OBJECT,T.defined("options.callback",e.callback),T.defined("options.width",e.width),T.defined("options.height",e.height),this._callback=e.callback,this._tilingScheme=e.tilingScheme,c(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??ie.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=cs.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new pe;let n=e.credit;typeof n=="string"&&(n=new Tt(n)),this._credit=n}Object.defineProperties(qw.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}}});qw.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!c(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let l=a;return Array.isArray(l)&&(l=new Float64Array(l)),new qa({buffer:l,width:r,height:s})})};qw.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};qw.prototype.getTileDataAvailable=function(e,t,n){};qw.prototype.loadTileDataAvailability=function(e,t,n){};var sZ=qw;var MCt=1953029805,LCt=2917034100;function aZ(e,t){if(aZ.passThroughDataForTesting)return t;T.typeOf.object("key",e),T.typeOf.object("data",t);let n=e.byteLength;if(n===0||n%4!==0)throw new ae("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===MCt||o===LCt)return t;let r=new DataView(e),s=0,a=t.byteLength,l=a-a%8,u=n,f,h=8;for(;s<l;)for(h=(h+8)%24,f=h;s<l&&f<u;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(h=(h+8)%24,f=h);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(f)),s++,f++}aZ.passThroughDataForTesting=!1;var $3=aZ;function XCe(e){this.proxy=e}XCe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var cZ=XCe;function KCe(e,t){return ws("defaultValue","defaultValue has been deprecated and will be removed in Cesium 1.134. Use the nullish coalescing operator instead: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing"),e??t}Object.defineProperty(KCe,"EMPTY_OBJECT",{get:function(){return ws("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),W.EMPTY_OBJECT}});var lZ=KCe;function BG(){E.throwInstantiationError()}Object.defineProperties(BG.prototype,{credit:{get:E.throwInstantiationError}});BG.getCreditsFromResult=function(e){if(c(e.attributions))return e.attributions.map(Tt.getIonCredit)};BG.prototype.geocode=E.throwInstantiationError;var Yw=BG;var NCt={SEARCH:0,AUTOCOMPLETE:1},W0=Object.freeze(NCt);function $Ce(){E.throwInstantiationError()}$Ce.createGeometry=function(e){E.throwInstantiationError()};var uZ=$Ce;var zCt=Zo(fZ(),1);function FCt(e,t){return(e&t)!==0}var Fc=FCt;var BCt=[1,2,4,8],ZCe=15,kCt=16,UCt=64,VCt=128;function gp(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}gp.clone=function(e,t){return c(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 gp(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};gp.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};gp.prototype.hasSubtree=function(){return Fc(this._bits,kCt)};gp.prototype.hasImagery=function(){return Fc(this._bits,UCt)};gp.prototype.hasTerrain=function(){return Fc(this._bits,VCt)};gp.prototype.hasChildren=function(){return Fc(this._bits,ZCe)};gp.prototype.hasChild=function(e){return Fc(this._bits,BCt[e])};gp.prototype.getChildBitmask=function(){return this._bits&ZCe};var Z3=gp;function HCt(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 GCt=HCt(`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 lf(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=O.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(lf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});lf.fromUrl=async function(e){T.defined("resourceOrUrl",e);let t=e;typeof t!="string"&&!(t instanceof we)&&(T.typeOf.string("resourceOrUrl.url",e.url),t=e.url);let n=we.createIfNeeded(t);n.appendForwardSlash();let i=new lf;i._resource=n;try{await jCt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${JCe(i,"",1).url}: ${o}`;throw new ae(r)}return i};lf.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Fc(t,r)?Fc(e,r)&&(s|=1):(s|=2,Fc(e,r)||(s|=1)),i+=s}return i};lf.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];Fc(s,2)?Fc(s,1)||(t|=r):(n|=r,Fc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};lf.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(c(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),c(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var QCe=new yi("decodeGoogleEarthEnterprisePacket");lf.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=JCe(this,e,t,n).fetchArrayBuffer();if(!c(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return QCe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).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,y){return m.length-y.length});let g=p.length;for(let m=0;m<g;++m){let y=p[m];if(u[y]!==null){let x=Z3.clone(u[y]),A=y.length;if(A===h)x.setParent(f);else if(A>1){let C=r[y.substring(0,y.length-1)];x.setParent(C)}r[y]=x}else r[y]=null}})})};lf.prototype.populateSubtree=function(e,t,n,i){let o=lf.tileXYToQuadKey(e,t,n);return mZ(this,o,i)};function mZ(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(c(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,l=a[o];if(c(l))return l.then(function(){return s=new Qo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),mZ(e,t,s)});if(!c(r)||!r.hasSubtree())return Promise.reject(new ae(`Couldn't load metadata for tile ${t}`));if(l=e.getQuadTreePacket(o,r.cnodeVersion,n),!!c(l))return a[o]=l,l.then(function(){return s=new Qo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),mZ(e,t,s)}).finally(function(){delete a[o]})}lf.prototype.getTileInformation=function(e,t,n){let i=lf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};lf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function JCe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var dZ,hZ;function jCt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!c(hZ)){let n=tn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;hZ=ab(n).then(function(){dZ=window.cesiumGoogleEarthDbRootParser(zCt),c(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return hZ.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=dZ.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let l=o.buffer.slice(r,s);return QCe.scheduleTask({buffer:l,type:"DbRoot",key:a},[l])}).then(function(n){let i=dZ.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,c(i.endSnippet)&&c(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}c(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],s=r.length;for(let a=0;a<s;++a){let l=r[a],u=l.copyrightString;c(u)&&(o[l.providerId]=new Tt(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=GCt})}var Og=lf;function IA(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.buffer",e.buffer),T.typeOf.number("options.negativeAltitudeExponentBias",e.negativeAltitudeExponentBias),T.typeOf.number("options.negativeElevationThreshold",e.negativeElevationThreshold),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(IA.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var nEe="createVerticesFromGoogleEarthEnterpriseBuffer",WCt=new yi(nEe),qCt=new yi(nEe,kh.maximumAsynchronousTasks),eEe=new ce,pZ=new ce;IA.prototype.createMesh=function(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,eEe),t.tileXYToRectangle(n,i,o,pZ);let u=l.cartographicToCartesian(ce.center(pZ)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let g=(a?qCt:WCt).scheduleTask({buffer:this._buffer,nativeRectangle:eEe,rectangle:pZ,relativeToCenter:u,ellipsoid:l,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!c(g))return;let m=this;return g.then(function(y){return m._mesh=new hd(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,le.clone(y.boundingSphere3D),d.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,Dn.clone(y.orientedBoundingBox),Oc.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),m._minimumHeight=y.minimumHeight,m._maximumHeight=y.maximumHeight,m._buffer=void 0,m._mesh})};IA.prototype.interpolateHeight=function(e,t,n){let i=O.clamp((t-e.west)/e.width,0,1),o=O.clamp((n-e.south)/e.height,0,1);return c(this._mesh)?ZCt(this,i,o):eEt(this,i,o,e)};var YCt=new yi("upsampleQuantizedTerrainMesh",kh.maximumAsynchronousTasks);IA.prototype.upsample=function(e,t,n,i,o,r,s){if(T.typeOf.object("tilingScheme",e),T.typeOf.number("thisX",t),T.typeOf.number("thisY",n),T.typeOf.number("thisLevel",i),T.typeOf.number("descendantX",o),T.typeOf.number("descendantY",r),T.typeOf.number("descendantLevel",s),s-i>1)throw new E("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(this._mesh))return;let u=t*2!==o,f=n*2===r,h=e.ellipsoid,p=e.tileXYToRectangle(o,r,s),g=YCt.scheduleTask({vertices:l.vertices,indices:l.indices,indexCountWithoutSkirts:l.indexCountWithoutSkirts,vertexCountWithoutSkirts:l.vertexCountWithoutSkirts,encoding:l.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:u,isNorthChild:f,childRectangle:p,ellipsoid:h});if(!c(g))return;let m=this;return g.then(function(y){let b=new Uint16Array(y.vertices),x=Fe.createTypedArray(b.length/3,y.indices),A=m._skirtHeight;return new vA({quantizedVertices:b,indices:x,minimumHeight:y.minimumHeight,maximumHeight:y.maximumHeight,boundingSphere:le.clone(y.boundingSphere),orientedBoundingBox:Dn.clone(y.orientedBoundingBox),horizonOcclusionPoint:d.clone(y.horizonOcclusionPoint),westIndices:y.westIndices,southIndices:y.southIndices,eastIndices:y.eastIndices,northIndices:y.northIndices,westSkirtHeight:A,southSkirtHeight:A,eastSkirtHeight:A,northSkirtHeight:A,childTileMask:0,createdByUpsampling:!0,credits:m._credits})})};IA.prototype.isChildAvailable=function(e,t,n,i){T.typeOf.number("thisX",e),T.typeOf.number("thisY",t),T.typeOf.number("childX",n),T.typeOf.number("childY",i);let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};IA.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var XCt=new H,KCt=new H,$Ct=new H,iEe=new d;function ZCt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,l=s.length;a<l;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,u,XCt),g=r.decodeTextureCoordinates(o,f,KCt),m=r.decodeTextureCoordinates(o,h,$Ct),y=Pg.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,iEe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let b=r.decodeHeight(o,u),x=r.decodeHeight(o,f),A=r.decodeHeight(o,h);return y.x*b+y.y*x+y.z*A}}}var QCt=Uint16Array.BYTES_PER_ELEMENT,tEe=Uint32Array.BYTES_PER_ELEMENT,_Z=Int32Array.BYTES_PER_ELEMENT,JCt=Float32Array.BYTES_PER_ELEMENT,gZ=Float64Array.BYTES_PER_ELEMENT;function eEt(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let l=new DataView(o),u=0;for(let v=0;v<r;++v)u+=l.getUint32(u,!0),u+=tEe;u+=tEe,u+=2*gZ;let f=O.toRadians(l.getFloat64(u,!0)*180);u+=gZ;let h=O.toRadians(l.getFloat64(u,!0)*180);u+=gZ;let p=i.width/f/2,g=i.height/h/2,m=l.getInt32(u,!0);u+=_Z;let y=l.getInt32(u,!0)*3;u+=_Z,u+=_Z;let b=new Array(m),x=new Array(m),A=new Array(m),C;for(C=0;C<m;++C)b[C]=s+l.getUint8(u++)*p,x[C]=a+l.getUint8(u++)*g,A[C]=l.getFloat32(u,!0)*6371010,u+=JCt;let S=new Array(y);for(C=0;C<y;++C)S[C]=l.getUint16(u,!0),u+=QCt;for(C=0;C<y;C+=3){let v=S[C],P=S[C+1],M=S[C+2],R=b[v],L=b[P],F=b[M],_=x[v],w=x[P],D=x[M],I=Pg.computeBarycentricCoordinates(t,n,R,_,L,w,F,D,iEe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*A[v]+I.y*A[P]+I.z*A[M]}}var Xw=IA;var Cd={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},kG=new Q;function UG(){this._terrainCache={},this._lastTidy=Q.now()}UG.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Q.now()}};UG.prototype.get=function(e){let n=this._terrainCache[e];if(c(n))return delete this._terrainCache[e],n.buffer};UG.prototype.tidy=function(){if(Q.now(kG),Q.secondsDifference(kG,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];Q.secondsDifference(kG,r.timestamp)>10&&delete e[o]}Q.clone(kG,this._lastTidy)}};function q0(e){e=e??W.EMPTY_OBJECT,this._tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-O.PI,-O.PI,O.PI,O.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Tt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new UG,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new pe}Object.defineProperties(q0.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(){}}});q0.fromMetadata=function(e,t){if(T.defined("metadata",e),!e.terrainPresent)throw new ae(`The server ${e.url} doesn't have terrain`);let n=new q0(t);return n._metadata=e,n};var tEt=new yi("decodeGoogleEarthEnterprisePacket");function oEe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Cd.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());c(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}q0.prototype.requestTileGeometry=function(e,t,n,i){let o=Og.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!c(a))return Promise.reject(new ae("Terrain tile doesn't exist"));let l=a.terrainState;c(l)||(l=a.terrainState=Cd.UNKNOWN);let u=r.get(o);if(c(u)){let x=s.providers[a.terrainProvider];return Promise.resolve(new Xw({buffer:u,childTileMask:oEe(o,a,s),credits:c(x)?[x]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(l===Cd.NONE)return Promise.reject(new ae("Terrain tile doesn't exist"))}else return Promise.resolve(new qa({buffer:new Uint8Array(16*16),width:16,height:16}));let f,h=o,p=-1;switch(l){case Cd.SELF:p=a.terrainVersion;break;case Cd.PARENT:h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),p=f.terrainVersion;break;case Cd.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),c(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new ae("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,y,b;if(c(g[h]))y=g[h],b=m[h];else{b=i;let x=nEt(this,h,p,b).fetchArrayBuffer();if(!c(x))return;y=x.then(function(A){return c(A)?tEt.scheduleTask({buffer:A,type:"Terrain",key:s.key},[A]).then(function(C){let S=s.getTileInformationFromQuadKey(h);S.terrainState=Cd.SELF,r.add(h,C[0]);let v=S.terrainProvider,P=C.length-1;for(let M=0;M<P;++M){let R=h+M.toString(),L=s.getTileInformationFromQuadKey(R);c(L)&&(r.add(R,C[M+1]),L.terrainState=Cd.PARENT,L.terrainProvider===0&&(L.terrainProvider=v))}}):Promise.reject(new ae("Failed to load terrain."))}),g[h]=y,m[h]=b,y=y.finally(function(){delete g[h],delete m[h]})}return y.then(function(){let x=r.get(o);if(c(x)){let A=s.providers[a.terrainProvider];return new Xw({buffer:x,childTileMask:oEe(o,a,s),credits:c(A)?[A]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new ae("Failed to load terrain."))}).catch(function(x){return b.state===$n.CANCELLED?(i.state=b.state,Promise.reject(x)):(a.terrainState=Cd.NONE,Promise.reject(x))})};q0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};q0.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=Og.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(c(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===Cd.NONE)return!1;if((!c(s)||s===Cd.UNKNOWN)&&(r.terrainState=Cd.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!c(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Qo({throttle:!1,throttleByServer:!0,type:ms.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};q0.prototype.loadTileDataAvailability=function(e,t,n){};function nEt(e,t,n,i){return n=c(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var yZ=q0;var iEt="https://maps.googleapis.com/maps/api/geocode/json",rEe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function bZ(e){e=e??W.EMPTY_OBJECT;let t=e.key;if(!c(t))throw new E("options.key is required.");this._resource=new we({url:iEt,queryParameters:{key:t}}),this._credit=new Tt(rEe,!0)}Object.defineProperties(bZ.prototype,{credit:{get:function(){return this._credit}}});bZ.prototype.geocode=async function(e){T.typeOf.string("query",e);let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new ae(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:ce.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:rEe,collapsible:!1}}})};var xZ=bZ;var VG={};VG.defaultApiKey=void 0;VG.mapTilesApiEndpoint=new we({url:"https://tile.googleapis.com/v1/"});VG.getDefaultCredit=function(){return new Tt('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var OA=VG;var Q3={};Q3.type=void 0;Q3.getRequiredDataPoints=E.throwInstantiationError;Q3.interpolateOrderZero=E.throwInstantiationError;Q3.interpolate=E.throwInstantiationError;var TZ=Q3;var oEt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},Rg=Object.freeze(oEt);function AZ(e){T.defined("url",e),this._url=we.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(AZ.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});AZ.prototype.geocode=async function(e,t){return T.typeOf.string("query",e),this._url.getDerivedResource({url:t===W0.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(c(s))r=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],l=o.geometry.coordinates[1];r=d.fromDegrees(a,l)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var J3=AZ;function sEe(e){if(!Object.values(Rg).some(t=>t===e))throw new E(`Invalid geocodeProviderType: "${e}"`)}var aEe=Object.freeze({[Rg.GOOGLE]:"google",[Rg.BING]:"bing",[Rg.DEFAULT]:void 0});function rEt(e){return aEe[e]}function sEt(e){return Object.entries(aEe).find(t=>t[1]===e)[0]}function CZ(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.scene",e.scene);let t=e.geocodeProviderType??Rg.DEFAULT;sEe(t);let n=e.accessToken??Xd.defaultAccessToken,i=we.createIfNeeded(e.server??Xd.defaultServer);i.appendForwardSlash();let o=Xd.getDefaultTokenCredit(n);c(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Tt.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});c(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new J3(r),this.geocodeProviderType=t}Object.defineProperties(CZ.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return sEt(this._pelias.url.queryParameters.geocoder)},set:function(e){sEe(e);let t={...this._pelias.url.queryParameters,geocoder:rEt(e)};c(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});CZ.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var RA=CZ;var Oo={};Oo.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Oo.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Oo.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Oo.defaultAccessToken=void 0;Oo.defaultShareKey=void 0;Oo._getAuthorizationHeader=function(){if(!c(Oo.defaultAccessToken)&&!c(Oo.defaultShareKey))throw new E("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");return c(Oo.defaultShareKey)?`Basic ${Oo.defaultShareKey}`:`Bearer ${Oo.defaultAccessToken}`};Oo.apiEndpoint=new we({url:"https://api.bentley.com"});Oo.getExports=async function(e){if(T.typeOf.string("iModelId",e),!c(Oo.defaultAccessToken)&&!c(Oo.defaultShareKey))throw new E("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let t=new we({url:`${Oo.apiEndpoint}mesh-export`,headers:{Authorization:Oo._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Oo.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&t.appendQueryParameters({clientVersion:CESIUM_VERSION});try{return await t.fetchJson()}catch(n){let i=JSON.parse(n.response);if(n.statusCode===401){let o=i.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(n.statusCode===403)throw console.error(i.error.code,i.error.message),new ae("Not allowed, forbidden");if(n.statusCode===422)throw new ae(`Unprocessable Entity:${i.error.code} ${i.error.message}`);if(n.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${n.statusCode}`)}};Oo.getRealityDataMetadata=async function(e,t){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),!c(Oo.defaultAccessToken)&&!c(Oo.defaultShareKey))throw new E("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let n=new we({url:`${Oo.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:Oo._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 ae(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ae("Not allowed, forbidden");if(i.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new ae(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${i.statusCode}`)}};Oo.getRealityDataURL=async function(e,t,n){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),T.typeOf.string("rootDocument",n),!c(Oo.defaultAccessToken)&&!c(Oo.defaultShareKey))throw new E("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let i=new we({url:`${Oo.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:Oo._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);if(o.statusCode===401){let s=r.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new ae("Not allowed, forbidden");if(o.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new ae(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${o.statusCode}`)}};var us=Oo;function zG(){E.throwInstantiationError()}Object.defineProperties(zG.prototype,{ellipsoid:{get:E.throwInstantiationError}});zG.prototype.project=E.throwInstantiationError;zG.prototype.unproject=E.throwInstantiationError;var EZ=zG;function Kw(e){e=e??W.EMPTY_OBJECT;let t=e.weights,n=e.times;if(T.defined("weights",t),T.defined("times",n),T.typeOf.number.greaterThanOrEquals("weights.length",t.length,3),t.length%n.length!==0)throw new E("times.length must be a factor of weights.length.");this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(Kw.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});Kw.prototype.findTimeInterval=Ni.prototype.findTimeInterval;Kw.prototype.wrapTime=Ni.prototype.wrapTime;Kw.prototype.clampTime=Ni.prototype.clampTime;Kw.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]);c(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var SZ=Kw;function wZ(e,t,n){T.defined("url",e),T.defined("apiKey",t),c(n)&&T.typeOf.object("params",n),e=we.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new Tt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(wZ.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});wZ.prototype.geocode=async function(e){return T.typeOf.string("query",e),this._url.getDerivedResource({url:"json",queryParameters:xt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(c(r))o=ce.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=d.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var vZ=wZ;var aEt={packedLength:void 0,pack:E.throwInstantiationError,unpack:E.throwInstantiationError},DZ=aEt;var cEt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:E.throwInstantiationError,unpackInterpolationResult:E.throwInstantiationError},PZ=cEt;var lEt=new d;function uEt(e,t,n,i){let o=_b(e,t,n,i,lEt);return c(o)?o.x>0&&o.y>0&&o.z>0:!1}var IZ=uEt;function cEe(){E.throwInstantiationError()}cEe.prototype.getURL=E.throwInstantiationError;var OZ=cEe;function fEt(e,t,n,i,o,r,s){let a=Fi.numberOfPoints(e,t,o),l,u=n.red,f=n.green,h=n.blue,p=n.alpha,g=i.red,m=i.green,y=i.blue,b=i.alpha;if(G.equals(n,i)){for(l=0;l<a;l++)r[s++]=G.floatToByte(u),r[s++]=G.floatToByte(f),r[s++]=G.floatToByte(h),r[s++]=G.floatToByte(p);return s}let x=(g-u)/a,A=(m-f)/a,C=(y-h)/a,S=(b-p)/a,v=s;for(l=0;l<a;l++)r[v++]=G.floatToByte(u+l*x),r[v++]=G.floatToByte(f+l*A),r[v++]=G.floatToByte(h+l*C),r[v++]=G.floatToByte(p+l*S);return v}function ek(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;if(!c(t)||t.length<2)throw new E("At least two positions are required.");if(c(n)&&(i&&n.length<t.length||!i&&n.length<t.length-1))throw new E("colors has an invalid length.");this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??qt.GEODESIC,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ie.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*d.packedLength;o+=c(n)?1+n.length*G.packedLength:1,this.packedLength=o+ie.packedLength+3}ek.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");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 s=e._colors;for(r=c(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=G.packedLength)G.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};ek.unpack=function(e,t,n){if(!c(e))throw new E("array is required");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 s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=G.packedLength)s[i]=G.unpack(e,t);let a=ie.unpack(e,t);t+=ie.packedLength;let l=e[t++]===1,u=e[t++],f=e[t];return c(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=l,n._arcType=u,n._granularity=f,n):new ek({positions:r,colors:s,ellipsoid:a,colorsPerVertex:l,arcType:u,granularity:f})};var HG=new Array(2),GG=new Array(2),dEt={positions:HG,height:GG,ellipsoid:void 0,minDistance:void 0,granularity:void 0};ek.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=O.chordLength(r,s.maximumRadius),l=c(n)&&!i,u,f=t.length,h,p,g,m,y=0;if(o===qt.GEODESIC||o===qt.RHUMB){let S,v,P;o===qt.GEODESIC?(S=O.chordLength(r,s.maximumRadius),v=Fi.numberOfPoints,P=Fi.generateArc):(S=r,v=Fi.numberOfPointsRhumbLine,P=Fi.generateRhumbArc);let M=Fi.extractHeights(t,s),R=dEt;if(o===qt.GEODESIC?R.minDistance=a:R.granularity=r,R.ellipsoid=s,l){let L=0;for(u=0;u<f-1;u++)L+=v(t[u],t[u+1],S)+1;h=new Float64Array(L*3),g=new Uint8Array(L*4),R.positions=HG,R.height=GG;let F=0;for(u=0;u<f-1;++u){HG[0]=t[u],HG[1]=t[u+1],GG[0]=M[u],GG[1]=M[u+1];let _=P(R);if(c(n)){let w=_.length/3;m=n[u];for(let D=0;D<w;++D)g[F++]=G.floatToByte(m.red),g[F++]=G.floatToByte(m.green),g[F++]=G.floatToByte(m.blue),g[F++]=G.floatToByte(m.alpha)}h.set(_,y),y+=_.length}}else if(R.positions=t,R.height=M,h=new Float64Array(P(R)),c(n)){for(g=new Uint8Array(h.length/3*4),u=0;u<f-1;++u){let F=t[u],_=t[u+1],w=n[u],D=n[u+1];y=fEt(F,_,w,D,a,g,y)}let L=n[f-1];g[y++]=G.floatToByte(L.red),g[y++]=G.floatToByte(L.green),g[y++]=G.floatToByte(L.blue),g[y++]=G.floatToByte(L.alpha)}}else{p=l?f*2-2:f,h=new Float64Array(p*3),g=c(n)?new Uint8Array(p*4):void 0;let S=0,v=0;for(u=0;u<f;++u){let P=t[u];if(l&&u>0&&(d.pack(P,h,S),S+=3,m=n[u-1],g[v++]=G.floatToByte(m.red),g[v++]=G.floatToByte(m.green),g[v++]=G.floatToByte(m.blue),g[v++]=G.floatToByte(m.alpha)),l&&u===f-1)break;d.pack(P,h,S),S+=3,c(n)&&(m=n[u],g[v++]=G.floatToByte(m.red),g[v++]=G.floatToByte(m.green),g[v++]=G.floatToByte(m.blue),g[v++]=G.floatToByte(m.alpha))}}let b=new fn;b.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:h}),c(n)&&(b.color=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=h.length/3;let x=(p-1)*2,A=Fe.createTypedArray(p,x),C=0;for(u=0;u<p-1;++u)A[C++]=u,A[C++]=u+1;return new ct({attributes:b,indices:A,primitiveType:Me.LINES,boundingSphere:le.fromPoints(t)})};var RZ=ek;function $w(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 Js(i),this._workerName="createSphereGeometry"}$w.packedLength=Js.packedLength;$w.pack=function(e,t,n){return T.typeOf.object("value",e),Js.pack(e._ellipsoidGeometry,t,n)};var hEt=new Js,Y0={radius:void 0,radii:new d,vertexFormat:new Ie,stackPartitions:void 0,slicePartitions:void 0};$w.unpack=function(e,t,n){let i=Js.unpack(e,t,hEt);return Y0.vertexFormat=Ie.clone(i._vertexFormat,Y0.vertexFormat),Y0.stackPartitions=i._stackPartitions,Y0.slicePartitions=i._slicePartitions,c(n)?(d.clone(i._radii,Y0.radii),n._ellipsoidGeometry=new Js(Y0),n):(Y0.radius=i._radii.x,new $w(Y0))};$w.createGeometry=function(e){return Js.createGeometry(e._ellipsoidGeometry)};var MZ=$w;function mEt(e){return T.defined("value",e),e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var MA=mEt;function X0(e){throw new E("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")}Object.defineProperties(X0.prototype,{ellipsoid:{get:E.throwInstantiationError},rectangle:{get:E.throwInstantiationError},projection:{get:E.throwInstantiationError}});X0.prototype.getNumberOfXTilesAtLevel=E.throwInstantiationError;X0.prototype.getNumberOfYTilesAtLevel=E.throwInstantiationError;X0.prototype.rectangleToNativeRectangle=E.throwInstantiationError;X0.prototype.tileXYToNativeRectangle=E.throwInstantiationError;X0.prototype.tileXYToRectangle=E.throwInstantiationError;X0.prototype.positionToTileXY=E.throwInstantiationError;var LZ=X0;function LA(e){e=e??W.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??Ge.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(LA.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(c(t)&&(this._clockSubscription(),this._clockSubscription=void 0),c(e)&&(this._clockSubscription=e.onTick.addEventListener(LA.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(c(t)&&t.removeEventListener("seeked",this._seekFunction,!1),c(e)&&(this._seeking=!1,this._seekFunction=pEt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});LA.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,de(this)};LA.prototype.isDestroyed=function(){return!1};LA.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};LA.prototype._onTick=function(e){let t=this._element;if(!c(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??Ge.MINIMUM_VALUE,s=Q.secondsDifference(o,r),a=t.duration,l,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),l=s):s>a?l=a:s<0?l=0:l=s;let f=i?this.tolerance??1:.001;Math.abs(l-u)>f&&(this._seeking=!0,t.currentTime=l)};function pEt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var NZ=LA;function _Et(e,t){this.rectangle=e,this.maxLevel=t}function lEe(e){this.ellipsoid=e.ellipsoid??ie.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}lEe.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 gEt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Ki({ellipsoid:e.ellipsoid});else throw new ae(`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=cs.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=O.toRadians(parseFloat(s.getAttribute("minx"))),l=O.toRadians(parseFloat(s.getAttribute("miny"))),u=O.toRadians(parseFloat(s.getAttribute("maxx"))),f=O.toRadians(parseFloat(s.getAttribute("maxy"))),h=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new _Et(new ce(a,l,u,f),h))}}function yEt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(i=`${i}: ${t.message}`),Po.reportError(void 0,n,c(n)?n._errorEvent:void 0,i),new ae(i)}async function bEt(e,t,n){try{let i=await t.fetchXML();gEt(e,i)}catch(i){yEt(t,i,n)}}function K0(e){e=e??W.EMPTY_OBJECT,this._errorEvent=new pe,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 Tt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(K0.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(){}}});K0.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=new lEe(t),i=we.createIfNeeded(e);await bEt(n,i);let o=new K0(t);return n.build(o),o._resource=i,o};K0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!c(s))return;let a=this;return Promise.resolve(s).then(function(l){return new qa({buffer:Id(l),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:xEt(a,e,t,n),structure:a._terrainDataStructure})})};K0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var uEe=new ce;function xEt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let l=0;l<r.length&&a!==15;++l){let u=r[l];if(u.maxLevel<=i)continue;let f=u.rectangle,h=ce.intersection(f,s,uEe);c(h)&&(jG(o,f,t*2,n*2,i+1)&&(a|=4),jG(o,f,t*2+1,n*2,i+1)&&(a|=8),jG(o,f,t*2,n*2+1,i+1)&&(a|=1),jG(o,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function jG(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return c(ce.intersection(r,t,uEe))}K0.prototype.getTileDataAvailable=function(e,t,n){};K0.prototype.loadTileDataAvailability=function(e,t,n){};var FZ=K0;var TEt={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},BZ=Object.freeze(TEt);function AEt(e){switch(e){case ne.FLOAT:return"float";case ne.FLOAT_VEC2:return"vec2";case ne.FLOAT_VEC3:return"vec3";case ne.FLOAT_VEC4:return"vec4";case ne.FLOAT_MAT2:return"mat2";case ne.FLOAT_MAT3:return"mat3";case ne.FLOAT_MAT4:return"mat4";case ne.SAMPLER_2D:return"sampler2D";case ne.BOOL:return"bool"}}var kZ=AEt;function CEt(e,t,n){if(typeof t!="function")throw new E("oldFunction is required to be a function.");if(typeof n!="function")throw new E("oldFunction is required to be a function.");return function(){n.apply(e,arguments),t.apply(e,arguments)}}var tk=CEt;var EEt=new d(1,1,1);function UZ(e){e=e??EEt,T.defined("dimensions",e),T.typeOf.number.greaterThanOrEquals("dimensions.x",e.x,0),T.typeOf.number.greaterThanOrEquals("dimensions.y",e.y,0),T.typeOf.number.greaterThanOrEquals("dimensions.z",e.z,0),this._dimensions=d.clone(e)}Object.defineProperties(UZ.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){T.defined("value",e),T.typeOf.number.greaterThanOrEquals("value.x",e.x,0),T.typeOf.number.greaterThanOrEquals("value.y",e.y,0),T.typeOf.number.greaterThanOrEquals("value.z",e.z,0),d.clone(e,this._dimensions)}}});var SEt=new d;UZ.prototype.emit=function(e){let t=this._dimensions,n=d.multiplyByScalar(t,.5,SEt),i=O.randomBetween(-n.x,n.x),o=O.randomBetween(-n.y,n.y),r=O.randomBetween(-n.z,n.z);e.position=d.fromElements(i,o,r,e.position),e.velocity=d.normalize(e.position,e.velocity)};var VZ=UZ;function yp(){this.featurePropertiesDirty=!1}Object.defineProperties(yp.prototype,{featuresLength:{get:function(){E.throwInstantiationError()}},pointsLength:{get:function(){E.throwInstantiationError()}},trianglesLength:{get:function(){E.throwInstantiationError()}},geometryByteLength:{get:function(){E.throwInstantiationError()}},texturesByteLength:{get:function(){E.throwInstantiationError()}},batchTableByteLength:{get:function(){E.throwInstantiationError()}},innerContents:{get:function(){E.throwInstantiationError()}},ready:{get:function(){E.throwInstantiationError()}},tileset:{get:function(){E.throwInstantiationError()}},tile:{get:function(){E.throwInstantiationError()}},url:{get:function(){E.throwInstantiationError()}},batchTable:{get:function(){E.throwInstantiationError()}},metadata:{get:function(){E.throwInstantiationError()},set:function(e){E.throwInstantiationError()}},group:{get:function(){E.throwInstantiationError()},set:function(e){E.throwInstantiationError()}}});yp.prototype.hasProperty=function(e,t){E.throwInstantiationError()};yp.prototype.getFeature=function(e){E.throwInstantiationError()};yp.prototype.applyDebugSettings=function(e,t){E.throwInstantiationError()};yp.prototype.applyStyle=function(e){E.throwInstantiationError()};yp.prototype.update=function(e,t){E.throwInstantiationError()};yp.prototype.pick=function(e,t,n){E.throwInstantiationError()};yp.prototype.isDestroyed=function(){E.throwInstantiationError()};yp.prototype.destroy=function(){E.throwInstantiationError()};var zZ=yp;function Zw(e,t){this._conditionsExpression=je(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,vEt(this,t)}Object.defineProperties(Zw.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function wEt(e,t){this.condition=e,this.expression=t}function vEt(e,t){let n=[],i=e._conditions;if(!c(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),l=String(s[1]);n.push(new wEt(new Lf(a,t),new Lf(l,t)))}e._runtimeConditions=n}Zw.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!c(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)}};Zw.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!c(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)}};Zw.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!c(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let l=o[a],u=l.condition.getShaderExpression(t,n),f=l.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u}) { return ${f}; } `}return r=`${i} ${e} { ${r} return ${i}(1.0); } `,r};Zw.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!c(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var nk=Zw;function $0(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,DEt(this,e)}function DEt(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;let n={};if(c(t.meta)){let i=t.defines,o=t.meta??W.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Lf(o[r],i))}e._meta=n,e._ready=!0}function fr(e,t){let n=(e._style??W.EMPTY_OBJECT).defines;if(c(t)){if(typeof t=="boolean"||typeof t=="number")return new Lf(String(t));if(typeof t=="string")return new Lf(t,n);if(c(t.conditions))return new nk(t,n)}else return;return t}function dr(e){if(c(e)){if(c(e.expression))return e.expression;if(c(e.conditionsExpression))return je(e.conditionsExpression,!0)}else return;return e}Object.defineProperties($0.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=fr(this,e),this._style.show=dr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=fr(this,e),this._style.color=dr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=fr(this,e),this._style.pointSize=dr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=fr(this,e),this._style.pointOutlineColor=dr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=fr(this,e),this._style.pointOutlineWidth=dr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=fr(this,e),this._style.labelColor=dr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=fr(this,e),this._style.labelOutlineColor=dr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=fr(this,e),this._style.labelOutlineWidth=dr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=fr(this,e),this._style.font=dr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=fr(this,e),this._style.labelStyle=dr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=fr(this,e),this._style.labelText=dr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=fr(this,e),this._style.backgroundColor=dr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=fr(this,e),this._style.backgroundPadding=dr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=fr(this,e),this._style.backgroundEnabled=dr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=fr(this,e),this._style.scaleByDistance=dr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=fr(this,e),this._style.translucencyByDistance=dr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=fr(this,e),this._style.distanceDisplayCondition=dr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=fr(this,e),this._style.heightOffset=dr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=fr(this,e),this._style.anchorLineEnabled=dr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=fr(this,e),this._style.anchorLineColor=dr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=fr(this,e),this._style.image=dr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=fr(this,e),this._style.disableDepthTestDistance=dr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=fr(this,e),this._style.horizontalOrigin=dr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=fr(this,e),this._style.verticalOrigin=dr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=fr(this,e),this._style.labelHorizontalOrigin=dr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=fr(this,e),this._style.labelVerticalOrigin=dr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});$0.fromUrl=function(e){if(!c(e))throw new E("url is required");return we.createIfNeeded(e).fetchJson(e).then(function(n){return new $0(n)})};$0.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,c(this.color)&&c(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};$0.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,c(this.show)&&c(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};$0.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,c(this.pointSize)&&c(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};$0.prototype.getVariables=function(){let e=[];return c(this.color)&&c(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),c(this.show)&&c(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),c(this.pointSize)&&c(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var NA=$0;function ik(e){e=e??W.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new xA({comparator:ik.comparator})}ik.prototype.addSubtree=function(e){let t=new PEt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates();if(this.find(i)===void 0)throw new E("parent node needs to exist")}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};ik.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};ik.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 PEt(e,t){this.subtree=e,this.stamp=t}var ok=ik;function rk(e){e=e??W.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=d.ZERO.clone(),paddingAfter:l=d.ZERO.clone(),globalTransform:u=B.IDENTITY.clone(),shapeTransform:f=B.IDENTITY.clone(),minBounds:h,maxBounds:p,minimumValues:g,maximumValues:m,maximumTileCount:y}=e;T.typeOf.string("className",t),T.typeOf.object("names",n),T.typeOf.object("types",i),T.typeOf.object("componentTypes",o),T.typeOf.string("shape",r),T.typeOf.object("dimensions",s),this._shapeTransform=f,this._globalTransform=u,this._shape=r,this._minBounds=h,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=l,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===va.ELLIPSOID?Td.Z_UP:Td.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new ok}Object.defineProperties(rk.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}}});rk.fromUrl=async function(e){T.defined("url",e);let t=we.createIfNeeded(e),n=await t.fetchJson();OEt(n);let i=kEt(n,t);await i.load();let{root:o}=n,r=oi(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new Kx({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],l=a.class,u=UEt(s,l);Object.assign(u,REt(o)),c(o.transform)?u.globalTransform=B.unpack(o.transform):u.globalTransform=B.clone(B.IDENTITY),u.dimensions=d.unpack(a.dimensions),u.maximumTileCount=IEt(s),c(a.padding)&&(u.paddingBefore=d.unpack(a.padding.before),u.paddingAfter=d.unpack(a.padding.after));let f=new rk(u),h=new Zx(t,o,i.schema);return f._implicitTileset=h,f._availableLevels=h.availableLevels,vi.unload(i),f};function IEt(e){if(c(e.tileset))return e.tileset.getPropertyBySemantic(yx.TILESET_TILE_COUNT)}function OEt(e){let t=e.root;if(!c(t.content))throw new ae("Root must have content");if(!oi(t.content,"3DTILES_content_voxels"))throw new ae("Root tile content must have 3DTILES_content_voxels extension");if(!oi(t,"3DTILES_implicit_tiling")&&!c(t.implicitTiling))throw new ae("Root tile must have implicit tiling");if(!c(e.schema)&&!c(e.schemaUri)&&!oi(e,"3DTILES_metadata"))throw new ae("Tileset must have a metadata schema")}function REt(e){let t=e.boundingVolume;if(c(t.box))return FEt(t.box);if(c(t.region))return MEt(t.region);if(oi(t,"3DTILES_bounding_volume_cylinder"))return BEt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new ae("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function MEt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=B.fromScale(ie.WGS84.radii),l=new d(t,n,r),u=new d(i,o,s);return{shape:va.ELLIPSOID,minBounds:l,maxBounds:u,shapeTransform:a}}var LEt=new d,NEt=new J;function FEt(e){let t=Dn.unpack(e),n=J.getScale(t.halfAxes,LEt),i=J.getRotation(t.halfAxes,NEt);return{shape:va.BOX,minBounds:d.negate(n,new d),maxBounds:d.clone(n),shapeTransform:B.fromRotationTranslation(i,t.center)}}function BEt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-O.PI,maxAngle:r=O.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e;T.typeOf.number("minRadius",t),T.typeOf.number("maxRadius",n),T.typeOf.number("height",i),T.typeOf.number("minAngle",o),T.typeOf.number("maxAngle",r),T.typeOf.object("translation",s),T.typeOf.object("rotation",a);let l=-.5*i+s[2],u=.5*i+s[2],f=B.fromTranslationQuaternionRotationScale(d.unpack(s),Le.unpack(a),d.ONE);return{shape:va.CYLINDER,minBounds:d.fromElements(t,o,l),maxBounds:d.fromElements(n,r,u),shapeTransform:f}}function kEt(e,t){let{schemaUri:n,schema:i}=e;return c(n)?vi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):vi.getSchemaLoader({schema:i})}function UEt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([g,m])=>{let{type:y,componentType:b}=m,x=o?.properties[g].min,A=o?.properties[g].max,C=at.getComponentCount(y),S=fEe(x,C),v=fEe(A,C);return{id:g,type:y,componentType:b,minValue:S,maxValue:v}}),a=s.map(g=>g.id),l=s.map(g=>g.type),u=s.map(g=>g.componentType),f=s.map(g=>g.minValue),h=s.map(g=>g.maxValue),p=f.some(c);return{className:t,names:a,types:l,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?h:void 0}}function fEe(e,t){if(!c(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function VEt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(c(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),c(o))return o;let l=I_(a);return o=await gx.fromSubtreeJson(s,l.jsonPayload,l.binaryPayload,n,t),i.addSubtree(o),o}rk.prototype.requestData=async function(e){e=e??W.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 s=this._implicitTileset,a=new Qx({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),l=a.isSubtreeRoot()&&a.level>0,u=l?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),h=await VEt(this,u);if(!(l?h.childSubtreeIsAvailableAtCoordinates:h.tileIsAvailableAtCoordinates).call(h,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:m,baseResource:y}=s,b=m[0].getDerivedResource({templateValues:a.getTemplateValues()}),x=y.getDerivedResource({url:b.url});return _A.fromGltf(x)};var HZ=rk;function GZ(e){e=e??1,T.typeOf.number.greaterThan("radius",e,0),this._radius=e??1}Object.defineProperties(GZ.prototype,{radius:{get:function(){return this._radius},set:function(e){T.typeOf.number.greaterThan("value",e,0),this._radius=e}}});GZ.prototype.emit=function(e){let t=O.randomBetween(0,O.TWO_PI),n=O.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 sk=GZ;var jZ={CUMULUS:0};jZ.validate=function(e){return e===jZ.CUMULUS};var FA=Object.freeze(jZ);function $h(e,t){if(e=e??W.EMPTY_OBJECT,this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),!c(e.scale)&&c(e.maximumSize))this._maximumSize=d.clone(e.maximumSize),this._scale=new H(this._maximumSize.x,this._maximumSize.y);else{this._scale=H.clone(e.scale??new H(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=G.clone(e.color??G.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var zEt=$h.SHOW_INDEX=0,HEt=$h.POSITION_INDEX=1,GEt=$h.SCALE_INDEX=2,jEt=$h.MAXIMUM_SIZE_INDEX=3,WEt=$h.SLICE_INDEX=4,qEt=$h.BRIGHTNESS_INDEX=5,YEt=$h.COLOR_INDEX=6;$h.NUMBER_OF_PROPERTIES=7;function BA(e,t){let n=e._cloudCollection;c(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties($h.prototype,{show:{get:function(){return this._show},set:function(e){T.typeOf.bool("value",e),this._show!==e&&(this._show=e,BA(this,zEt))}},position:{get:function(){return this._position},set:function(e){T.typeOf.object("value",e);let t=this._position;d.equals(t,e)||(d.clone(e,t),BA(this,HEt))}},scale:{get:function(){return this._scale},set:function(e){T.typeOf.object("value",e);let t=this._scale;H.equals(t,e)||(H.clone(e,t),BA(this,GEt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){T.typeOf.object("value",e);let t=this._maximumSize;d.equals(t,e)||(d.clone(e,t),BA(this,jEt))}},color:{get:function(){return this._color},set:function(e){T.typeOf.object("value",e);let t=this._color;G.equals(t,e)||(G.clone(e,t),BA(this,YEt))}},slice:{get:function(){return this._slice},set:function(e){T.typeOf.number("value",e),this._slice!==e&&(this._slice=e,BA(this,WEt))}},brightness:{get:function(){return this._brightness},set:function(e){T.typeOf.number("value",e),this._brightness!==e&&(this._brightness=e,BA(this,qEt))}}});$h.prototype._destroy=function(){this._cloudCollection=void 0};var uf=$h;var ff,WG=new d,XEt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},KEt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},$Et=uf.SHOW_INDEX,ZEt=uf.POSITION_INDEX,QEt=uf.SCALE_INDEX,JEt=uf.MAXIMUM_SIZE_INDEX,eSt=uf.SLICE_INDEX,tSt=uf.BRIGHTNESS_INDEX,nSt=uf.NUMBER_OF_PROPERTIES,iSt=uf.COLOR_INDEX;function Zh(e){e=e??W.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(nSt),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:dEe(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 dEe(e){return function(){return WG.x=e._textureSliceWidth,WG.y=e._noiseTextureRows,WG.z=1/e._noiseTextureRows,WG}}Object.defineProperties(Zh.prototype,{length:{get:function(){return qZ(this),this._clouds.length}}});function hEe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Zh.prototype.add=function(e){e=e??W.EMPTY_OBJECT;let t=e.cloudType??FA.CUMULUS;if(!FA.validate(t))throw new E("invalid cloud type");let n;return t===FA.CUMULUS&&(n=new uf(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Zh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Zh.prototype.removeAll=function(){hEe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function qZ(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];c(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Zh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Zh.prototype.contains=function(e){return c(e)&&e._cloudCollection===this};Zh.prototype.get=function(e){return T.typeOf.number("index",e),qZ(this),this._clouds[e]};var oSt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),rSt=new Uint16Array([0,1,2,0,2,3]);function sSt(e){let t=yt.createVertexBuffer({context:e,typedArray:oSt,usage:Be.STATIC_DRAW}),n=yt.createIndexBuffer({context:e,typedArray:rSt,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:$.FLOAT}];return new ti({context:e,attributes:i,indexBuffer:n})}var YZ;function aSt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(c(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=yt.createIndexBuffer({context:e,typedArray:o,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function cSt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return c(t)||(t=yt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function lSt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return c(t)||(t=yt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Be.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function uSt(e,t,n){let i=[{index:ff.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ff.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ff.packedAttribute0,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ff.packedAttribute1,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ff.color,componentsPerAttribute:4,componentDatatype:$.UNSIGNED_BYTE,normalize:!0,usage:Be.STATIC_DRAW}];n&&i.push({index:ff.direction,componentsPerAttribute:2,componentDatatype:$.FLOAT,vertexBuffer:lSt(e)});let o=n?t:4*t;return new Mp(e,i,o,n)}var WZ=new Hn;function mEe(e,t,n,i){let o,r=n[ff.positionHighAndScaleX],s=n[ff.positionLowAndScaleY],a=i.position;Hn.fromCartesian(a,WZ);let l=i.scale,u=WZ.high,f=WZ.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,l.x),s(o,f.x,f.y,f.z,l.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,l.x),r(o+1,u.x,u.y,u.z,l.x),r(o+2,u.x,u.y,u.z,l.x),r(o+3,u.x,u.y,u.z,l.x),s(o+0,f.x,f.y,f.z,l.y),s(o+1,f.x,f.y,f.z,l.y),s(o+2,f.x,f.y,f.z,l.y),s(o+3,f.x,f.y,f.z,l.y))}function pEe(e,t,n,i){let o,r=n[ff.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function _Ee(e,t,n,i){let o,r=n[ff.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function gEe(e,t,n,i){let o,r=n[ff.color],s=i.color,a=G.floatToByte(s.red),l=G.floatToByte(s.green),u=G.floatToByte(s.blue),f=G.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,l,u,f)):(o=i._index*4,r(o+0,a,l,u,f),r(o+1,a,l,u,f),r(o+2,a,l,u,f),r(o+3,a,l,u,f))}function fSt(e,t,n,i){mEe(e,t,n,i),pEe(e,t,n,i),_Ee(e,t,n,i),gEe(e,t,n,i)}function dSt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows;if(r/s<1||r%s!==0)throw new E("noiseTextureRows must evenly divide textureSliceWidth");let a=t.context;o._vaNoise=sSt(a),o._spNoise=Jt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let l=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new Rt({context:a,width:r*r/s,height:r*s,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA,sampler:new Qt({wrapS:gn.REPEAT,wrapT:gn.REPEAT,minificationFilter:Yt.NEAREST,magnificationFilter:li.NEAREST})});let f=new Uc({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:dEe(o),u_noiseDetail:function(){return l},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 hSt(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=uSt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let l=o[a];fSt(e,t,s,l)}n._vaf.commit(YZ(i))}}var mSt=[];function pSt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,l=i._propertiesChanged,u=mSt;u.length=0,(l[ZEt]||l[QEt])&&u.push(mEe),(l[$Et]||l[tSt])&&u.push(pEe),(l[JEt]||l[eSt])&&u.push(_Ee),l[iSt]&&u.push(gEe);let f=u.length,h=i._vaf.writers,p,g,m;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,h,g);i._vaf.commit(YZ(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,h,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function _St(e,t,n,i){let o=t.context,r=e,s=new He({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new He({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=Jt.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:ff}),r._rs=Ve.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!1,blending:ln.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function gSt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,l=a.length;s.length=l;for(let u=0;u<l;u++){let f=s[u];c(f)||(f=s[u]=new Qe),f.pass=De.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}Zh.prototype.update=function(e){if(qZ(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:c(this._noiseTexture),!this._ready&&!this._loading&&!t&&dSt(this,e,ZF,$F),this._instanced=e.context.instancedArrays,ff=this._instanced?KEt:XEt,YZ=this._instanced?cSt:aSt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?hSt(this,e):r>0&&pSt(this,e),r>i*1.5&&(o.length=i),!(!c(this._vaf)||!c(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&_St(this,e,KF,XF),gSt(this,e))};Zh.prototype.isDestroyed=function(){return!1};Zh.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(),hEe(this._clouds),de(this)};var XZ=Zh;var ySt=O.toRadians(30);function KZ(e){this._angle=e??ySt}Object.defineProperties(KZ.prototype,{angle:{get:function(){return this._angle},set:function(e){T.typeOf.number("value",e),this._angle=e}}});KZ.prototype.emit=function(e){let t=Math.tan(this._angle),n=O.randomBetween(0,O.TWO_PI),i=O.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=d.fromElements(o,r,s,e.velocity),d.normalize(e.velocity,e.velocity),e.position=d.clone(d.ZERO,e.position)};var $Z=KZ;var bSt=new G,xSt=new G,TSt=new G,ASt=new G,yEe=new se,ak=new Uint8Array(4);function bEe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return G.lerp(t.color,n.color,o,i)}function qG(e,t){return{height:e,color:G.clone(t)}}function xEe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?G.equals(t.color,i[n-1].color):!1,a=r?G.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?G.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function CSt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length;if(!Array.isArray(s)||a===0)throw new E("entries must be an array with size > 0.");let l=[];for(n=0;n<a;n++){let g=s[n];if(!c(g.height))throw new E("entry requires a height.");if(!c(g.color))throw new E("entry requires a color.");let m=O.clamp(g.height,cu._minimumHeight,cu._maximumHeight),y=G.clone(g.color,bSt);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,l.push(qG(m,y))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=l[n+0],m=l[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?l=l.reverse():u||gg(l,function(g,m){return O.sign(g.height-m.height)});let h=r.extendDownwards??!1,p=r.extendUpwards??!1;l.length===1&&!h&&!p&&(h=!0,p=!0),h&&l.splice(0,0,qG(cu._minimumHeight,l[0].color)),p&&l.splice(l.length,0,qG(cu._maximumHeight,l[l.length-1].color)),l=xEe(l),i.push(l)}return i}function ESt(e){let t=CSt(e),n=[],i=[],o;function r(u,f){n.push(qG(u,f))}function s(u,f,h){let p=G.multiplyByScalar(h,1-f.alpha,ASt);p=G.add(p,f,p),r(u,p)}let a=t.length;for(o=0;o<a;o++){let u=t[o],f=0,h=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||h<g;){let m=f<p?u[f]:void 0,y=f>0?u[f-1]:void 0,b=f<p-1?u[f+1]:void 0,x=h<g?i[h]:void 0,A=h>0?i[h-1]:void 0,C=h<g-1?i[h+1]:void 0;if(c(m)&&c(x)&&m.height===x.height){let S=c(C)&&x.height===C.height,v=!c(A),P=!c(C),M=c(b)&&m.height===b.height,R=!c(y),L=!c(b);S?M?(s(m.height,m.color,x.color),s(m.height,b.color,C.color)):R?(r(m.height,x.color),s(m.height,m.color,C.color)):L?(s(m.height,m.color,x.color),r(m.height,C.color)):(s(m.height,m.color,x.color),s(m.height,m.color,C.color)):v?M?(r(m.height,m.color),s(m.height,b.color,x.color)):L?(r(m.height,m.color),r(m.height,x.color)):(R||r(m.height,m.color),s(m.height,m.color,x.color)):P?M?(s(m.height,m.color,x.color),r(m.height,b.color)):R?(r(m.height,x.color),r(m.height,m.color)):L?s(m.height,m.color,x.color):(s(m.height,m.color,x.color),r(m.height,m.color)):M?(s(m.height,m.color,x.color),s(m.height,b.color,x.color)):R?(r(m.height,x.color),s(m.height,m.color,x.color)):L?(s(m.height,m.color,x.color),r(m.height,x.color)):s(m.height,m.color,x.color),f+=M?2:1,h+=S?2:1}else if(c(m)&&c(x)&&c(A)&&m.height<x.height){let S=bEe(m.height,A,x,TSt);c(y)?c(b)?s(m.height,m.color,S):(s(m.height,m.color,S),r(m.height,S)):(r(m.height,S),s(m.height,m.color,S)),f++}else if(c(x)&&c(m)&&c(y)&&x.height<m.height){let S=bEe(x.height,y,m,xSt);c(A)?c(C)?s(x.height,S,x.color):(s(x.height,S,x.color),r(x.height,S)):(r(x.height,S),s(x.height,S,x.color)),h++}else c(m)&&(!c(x)||m.height<x.height)?(c(x)&&!c(A)&&!c(b)?(r(m.height,m.color),r(m.height,cu._emptyColor),r(x.height,cu._emptyColor)):(!c(x)&&c(A)&&!c(y)&&(r(A.height,cu._emptyColor),r(m.height,cu._emptyColor)),r(m.height,m.color)),f++):c(x)&&(!c(m)||x.height<m.height)&&(r(x.height,x.color),h++)}}return xEe(n)}function cu(e){let{scene:t,layers:n}=e??W.EMPTY_OBJECT;T.typeOf.object("options.scene",t),T.defined("options.layers",n),T.typeOf.number.greaterThan("options.layers.length",n.length,0);let{context:i}=t,o=ESt(n),r=o.length,s,a,l;if(!cu._useFloatTexture(i)){a=Ue.UNSIGNED_BYTE,l=ke.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)se.packFloat(o[g].height,yEe),se.pack(yEe,s,g*4)}else{a=Ue.FLOAT,l=i.webgl2?ke.RED:ke.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let f=Rt.create({context:i,pixelFormat:l,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.NEAREST,magnificationFilter:li.NEAREST})}),h=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(ak),h[g*4+0]=ak[0],h[g*4+1]=ak[1],h[g*4+2]=ak[2],h[g*4+3]=ak[3];let p=Rt.create({context:i,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:li.LINEAR})});return Xi.fromType("ElevationBand",{heights:f,colors:p})}cu._useFloatTexture=function(e){return e.floatingPointTexture};cu._maximumHeight=5906376425472;cu._minimumHeight=-5906376425472;cu._emptyColor=new G(0,0,0,0);var ZZ=cu;async function SSt(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??W.EMPTY_OBJECT,T.typeOf.object("apiOptions",e),e.onlyUsingWithGoogleGeocoder||dt("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??OA.defaultApiKey;if(!c(n))return wSt(t);let i,o=OA.getDefaultCredit();c(o)&&(i=[o]);let r=new we({url:`${OA.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return bs.fromUrl(r,t)}var TEe={};async function wSt(e){let i=TEe[2275207];c(i)||(i=Cu.fromAssetId(2275207),TEe[2275207]=i);let o=await i;return bs.fromUrl(o,e)}var QZ=SSt;async function vSt(e){let t=await bs.fromIonAssetId(96188,e);e=e??W.EMPTY_OBJECT;let n=e.style;if(!c(n)){let i=(e.defaultColor??G.WHITE).toCssColorString();n=new NA({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var JZ=vSt;function DSt(e){e=e??W.EMPTY_OBJECT;let t=[],n=e.geometry;if(!c(n))throw new E("options.geometry is required.");(!c(n.attributes)||!c(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=B.clone(e.modelMatrix??B.IDENTITY),r=e.length??1e4;if(c(i.normal)&&t.push(new St({geometry:Nn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Gt(1,0,0,1)},modelMatrix:o})),c(i.tangent)&&t.push(new St({geometry:Nn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Gt(0,1,0,1)},modelMatrix:o})),c(i.bitangent)&&t.push(new St({geometry:Nn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Gt(0,0,1,1)},modelMatrix:o})),t.length>0)return new Pn({asynchronous:!1,geometryInstances:t,appearance:new rn({flat:!0,translucent:!1})})}var eQ=DSt;function ck(e){e=e??W.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;if(!c(t))throw new E("options.attributeName is required.");c(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;default:throw new E("options.glslDatatype must be float, vec2, vec3, or vec4.")}let s=`in vec3 position3DHigh; in vec3 position3DLow; in float batchId; ${n?"":`in ${i} ${t}; `}out ${i} ${o}; void main() { vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); ${n?`${o} = czm_batchTable_${t}(batchId); `:`${o} = ${t}; `}gl_Position = czm_modelViewProjectionRelativeToEye * p; }`,a=`in ${i} ${o}; ${r} void main() { out_FragColor = getColor(); }`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=io.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(ck.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}}});ck.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;ck.prototype.isTranslucent=io.prototype.isTranslucent;ck.prototype.getRenderState=io.prototype.getRenderState;var tQ=ck;function YG(e){e=e??W.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=B.clone(e.modelMatrix??B.IDENTITY),this._modelMatrix=new B,this.id=e.id,this._id=void 0,this._primitive=void 0}YG.prototype.update=function(e){if(this.show){if(!c(this._primitive)||!B.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=B.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,c(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new St({geometry:new ng({positions:[d.ZERO,d.UNIT_X],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[G.RED,G.RED],arcType:qt.NONE}),modelMatrix:B.multiplyByUniformScale(this.modelMatrix,this.length,new B),id:this.id,pickPrimitive:this}),n=new St({geometry:new ng({positions:[d.ZERO,d.UNIT_Y],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[G.GREEN,G.GREEN],arcType:qt.NONE}),modelMatrix:B.multiplyByUniformScale(this.modelMatrix,this.length,new B),id:this.id,pickPrimitive:this}),i=new St({geometry:new ng({positions:[d.ZERO,d.UNIT_Z],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[G.BLUE,G.BLUE],arcType:qt.NONE}),modelMatrix:B.multiplyByUniformScale(this.modelMatrix,this.length,new B),id:this.id,pickPrimitive:this});this._primitive=new Pn({geometryInstances:[t,n,i],appearance:new is,asynchronous:!1})}this._primitive.update(e)}};YG.prototype.isDestroyed=function(){return!1};YG.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var lk=YG;function PSt(e){if(T.typeOf.object("options",e),T.typeOf.object("options.direction",e.direction),d.equals(e.direction,d.ZERO))throw new E("options.direction cannot be zero-length");this.direction=d.clone(e.direction),this.color=G.clone(e.color??G.WHITE),this.intensity=e.intensity??1}var nQ=PSt;var uk=`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); materialInput.normalEC = normalEC; materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC); 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 fk=`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; v_positionEC = (czm_modelViewRelativeToEye * p).xyz; v_st = st; gl_Position = czm_modelViewProjectionRelativeToEye * p; } `;function kA(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=c(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??fk,this._fragmentShaderSource=e.fragmentShaderSource??uk,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(kA.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 kA.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});kA.VERTEX_FORMAT=Ie.POSITION_AND_ST;kA.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;kA.prototype.isTranslucent=io.prototype.isTranslucent;kA.prototype.getRenderState=io.prototype.getRenderState;var iQ=kA;function lu(e){if(!c(e)||!c(e.scene))throw new E("options.scene is required.");this._scene=e.scene,this.samplingWindow=e.samplingWindow??lu.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??lu.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??lu.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??lu.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??lu.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new pe,this._nominalFrameRate=new pe,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){ISt(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(){OSt(t)}this._visibilityChangeRemoveListener=void 0,c(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}lu.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};lu.fromScene=function(e){if(!c(e))throw new E("scene is required.");return(!c(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new lu({scene:e})),e._frameRateMonitor};Object.defineProperties(lu.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}}});lu.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};lu.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};lu.prototype.isDestroyed=function(){return!1};lu.prototype.destroy=function(){return this._preUpdateRemoveListener(),c(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),de(this)};function ISt(e,t){if(e._pauseCount>0)return;let n=Ti();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/qn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/qn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/qn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function OSt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var dk=lu;var AEe=Zo(fZ(),1);function oQ(){this._image=new Image}oQ.prototype.isReady=function(){return!0};oQ.prototype.shouldDiscardImage=function(e){return e===this._image};function UA(e){e=e??W.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 Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-O.PI,-O.PI,O.PI,O.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Tt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,c(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new oQ),this._errorEvent=new pe}Object.defineProperties(UA.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}}});UA.fromMetadata=function(e,t){if(T.defined("metadata",e),!e.imageryPresent)throw new ae(`The server ${e.url} doesn't have imagery`);let n=new UA(t);return n._metadata=e,n};UA.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(c(o)){let r=i.providers[o.imageryProvider];if(c(r))return[r]}};UA.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=Og.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!c(a)){if(r.isValid(s)){let u=new Qo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let l=RSt(this,a,e,t,n,i).fetchArrayBuffer();if(c(l))return l.then(function(u){$3(r.key,u);let f=new Uint8Array(u),h,p=r.protoImagery;if((!c(p)||!p)&&(h=MSt(f)),!c(h)&&(!c(p)||p)){let g=LSt(f);h=g.imageType,f=g.imageData}return!c(h)||!c(f)?o:ux({uint8Array:f,format:h,flipY:!0})})};UA.prototype.pickFeatures=function(e,t,n,i,o){};function RSt(e,t,n,i,o,r){let s=Og.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=c(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function MSt(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 LSt(e){let t=AEe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,c(a)||(a=i.copyrightIds=[]),(s&7)===2){let l=t.uint32()+t.pos;for(;t.pos<l;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(c(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new ae("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return c(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var rQ=UA;var NSt=new G(1,1,1,.4),FSt=new G(0,1,0,.05),BSt=new G(0,.5,0,.2);function VA(e){e=e??W.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=c(e.tilingScheme)?e.tilingScheme:new Ki({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??NSt,this._glowColor=e.glowColor??FSt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??BSt,this._errorEvent=new pe,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(VA.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}}});VA.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()};VA.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};VA.prototype.getTileCredits=function(e,t,n){};VA.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};VA.prototype.pickFeatures=function(e,t,n,i,o){};var sQ=VA;function Qh(){}Qh._maxDecodingConcurrency=Math.max(Vt.hardwareConcurrency-1,1);Qh._decodeTaskProcessor=new yi("decodeI3S",Qh._maxDecodingConcurrency);Qh._promise=void 0;async function kSt(){if(await Qh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Qh._decodeTaskProcessor;throw new ae("I3S decoder could not be initialized.")}Qh.decode=async function(e,t,n,i,o){return T.typeOf.string("url",e),T.defined("defaultGeometrySchema",t),T.defined("geometryData",n),c(Qh._promise)||(Qh._promise=kSt()),Qh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,l=0,u=0,f=0;c(s.obb)?(l=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):c(s.mbs)&&(l=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let h=J.fromRotationX(-O.PI_OVER_TWO),p=new J;J.multiply(h,a,p);let g=he.fromDegrees(l,u,f),m=ie.WGS84.cartographicToCartesian(g),y={binaryData:n._data,featureData:c(i)&&c(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ie.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(y)})};var hk=Qh;function aQ(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,c(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(aQ.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});aQ.prototype.load=async function(){return this._data=await Jh.loadJson(this._resource),this._data};var mk=aQ;function Mg(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;c(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(Mg.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(c(this._values)){if(c(this._values.attributeValues))return this._values.attributeValues;if(c(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function XG(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 USt(e){return e==="String"?1:XG(e)}async function VSt(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)}Mg.prototype.load=function(){return c(this._loadPromise)?this._loadPromise:(this._loadPromise=VSt(this).catch(function(e){console.error(e)}),this._loadPromise)};Mg.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}};Mg.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};Mg.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(c(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],l="";for(let u=0;u<a;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(l+=f.value),t=f.offset}this._values[o].push(l)}}}};Mg.prototype._getBodyOffset=function(e){let t=0;return c(this._storageInfo.attributeValues)?t=XG(this._storageInfo.attributeValues.valueType):c(this._storageInfo.objectIds)&&(t=XG(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};Mg.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=USt(i.valueType)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};Mg.prototype._validateBody=function(e,t){if(!c(this._header.count))throw new ae(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(c(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=XG(s.valueType);t+=a*this._header.count}else{if(!c(n))throw new ae(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let l=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=l.value,n=l.offset}}else throw new ae(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var pk=Mg;function _k(e,t){let n=e._dataProvider,i=e._layer,o;c(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(_k.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});_k.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var zSt=new d,HSt=new d,GSt=new d,jSt=new d,WSt=new d;function cQ(e,t,n,i){let o=d.subtract(i,n,zSt),r=d.cross(o,d.subtract(e,n,HSt),jSt),s=d.cross(o,d.subtract(t,n,GSt),WSt);return d.dot(r,s)>=0}var qSt=new d,YSt=new d,XSt=new d,KSt=new d,$St=new d,ZSt=new d,QSt=new d,JSt=new d,ewt=new d,twt=new d;_k.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(c(this._customAttributes)&&c(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,s,a,l,u=this._customAttributes.positions,f=this._customAttributes.indices,h;c(f)?h=f.length:h=u.length/3;for(let p=0;p<h;p++){let g,m,y;c(f)?(g=f[p],m=f[p+1],y=f[p+2]):(g=p*3,m=p*3+1,y=p*3+2);let b=d.fromElements(u[g*3],u[g*3+1],u[g*3+2],qSt),x=d.fromElements(u[m*3],u[m*3+1],u[m*3+2],YSt),A=new d(u[y*3],u[y*3+1],u[y*3+2],XSt);if(!cQ(i,b,x,A)||!cQ(i,x,b,A)||!cQ(i,A,b,x))continue;let C=d.subtract(x,b,KSt),S=d.subtract(A,b,$St),v=d.cross(C,S,ZSt);if(d.magnitude(v)===0)continue;let P=d.normalize(v,QSt),M=d.subtract(i,b,JSt),R=Math.abs(d.dot(M,P));if(R<o){o=R,r=p;let L=d.magnitudeSquared(d.subtract(i,b,M)),F=d.magnitudeSquared(d.subtract(i,x,ewt)),_=d.magnitudeSquared(d.subtract(i,A,twt));L<F&&L<_?(a=g,l=b,s=L):F<_?(a=m,l=x,s=F):(a=y,l=A,s=_)}}if(c(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:d.clone(l)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function CEe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(MA(e[i])):t.push(e[i]);return t}_k.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let l={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,h="";if(c(this._parent._data.mesh)&&c(this._layer._data.materialDefinitions)){let C=this._parent._data.mesh.material.definition;if(C>=0&&C<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[C],l=f,c(l.pbrMetallicRoughness)&&c(l.pbrMetallicRoughness.baseColorTexture)){u=!0,l.pbrMetallicRoughness.baseColorTexture.index=0;let S="0";if(c(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let P=this._layer._data.textureSetDefinitions[v];for(let M=0;M<P.formats.length;M++){let R=P.formats[M];if(R.format==="jpg"){S=R.name;break}}}c(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/${S}`}).url)}c(l.pbrMetallicRoughness)&&c(l.pbrMetallicRoughness.baseColorFactor)&&(l.pbrMetallicRoughness.baseColorFactor=CEe(l.pbrMetallicRoughness.baseColorFactor)),c(l.emissiveFactor)&&(l.emissiveFactor=CEe(l.emissiveFactor))}}else c(this._parent._data.textureData)&&(u=!0,h=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,l.pbrMetallicRoughness.baseColorTexture={index:0});c(l.alphaMode)&&(l.alphaMode=l.alphaMode.toUpperCase());let p=[],g=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:h}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],b=n.length;for(let A=0;A<b;A++){let C=n[A].primitives,S=C.length;for(let v=0;v<S;v++){let P=C[v];if(c(P.material)){for(;P.material>=y.length;){let R=je(l,!0);y.push(R)}let M=y[P.material];c(P.extra)&&P.extra.isTransparent?c(M.alphaMode)||(M.alphaMode="BLEND"):M.alphaMode==="BLEND"&&(M.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:y,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var Qw=_k;function Bc(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(Bc.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}}});Bc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Zf(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!c(this._nodeIndex)){let o=await Jh.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/":c(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),c(i)&&c(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function EEe(e,t){let n=new pk(e,t);return e._fields[t.name]=n,n.load()}Bc.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(c(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];c(o)?t.push(o.load()):t.push(EEe(this,i))}return Promise.all(t)};Bc.prototype.loadField=function(e){T.defined("name",e);let t=this._fields[e];if(c(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(c(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return EEe(this,o)}return Promise.resolve()};Bc.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!c(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)};Bc.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};Bc.prototype._loadChildren=function(){let e=this;if(c(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(c(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new Bc(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};Bc.prototype._loadGeometryData=function(){let e=[];if(c(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new Qw(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(c(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new Qw(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Bc.prototype._loadFeatureData=function(){let e=[];if(c(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new mk(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Bc.prototype._clearGeometryData=function(){this._geometryData=[]};Bc.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!c(e)&&!c(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(c(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),c(this._dataProvider._geoidDataList)&&c(n))for(let x=0;x<this._dataProvider._geoidDataList.length;x++){let A=this._dataProvider._geoidDataList[x],C=A.projection.project(n);if(C.x>A.nativeExtent.west&&C.x<A.nativeExtent.east&&C.y>A.nativeExtent.south&&C.y<A.nativeExtent.north){n.height+=rwt(C.x,C.y,A);break}}let i={},o,r=0;c(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=ie.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ie.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(c(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let x=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/x}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let x=this._data.lodThreshold;s=r/x}else console.error("Invalid lodSelectionMetricType in Layer");else if(c(this._data.lodSelection))for(let x=0;x<this._data.lodSelection.length;x++)this._data.lodSelection[x].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[x].maxError);s===1/0&&(s=1e5);let a=s*16,l=new Oa(0,0,0),u=Ot.headingPitchRollQuaternion(o,l);c(this._data.obb)&&(u=new Le(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 B(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),g=B.inverse(p,new B),m=B.clone(p);c(this._parent._globalTransform)&&B.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=h;let y=[];for(let x=0;x<this._children.length;x++)y.push(this._children[x]._create3DTileDefinition());return{children:y,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:c(this._resource)?this._resource.url:void 0},geometricError:a}};Bc.prototype._loadSymbology=async function(){!c(this._symbologyData)&&c(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Bc.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),c(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await hk.decode(o,r,s,this._featureData[0],this._symbologyData);if(!c(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function nwt(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 iwt(e,t,n){if(!c(n.values)||n.values.length===0)return!1;let i=c(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function SEe(e,t){let n=e._tile.content.batchTable;if(c(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await nwt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!iwt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}Bc.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(c(this._geometryData)&&this._geometryData.length>0&&c(t)&&t.ready){t.show=!1;let n=SEe(this,t);e.push(n)}return Promise.all(e)};Zf.prototype._hookedRequestContent=Zf.prototype.requestContent;Zf.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(!c(t)){e._isLoading=!1;return}return e._contentResource=new we({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return c(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&c(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{SEe(e._i3sNode,n)})),e._isLoading=!1,t})}};function owt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function KG(e,t,n,i){let o=e+t*n;return i[o]}function rwt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let l=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=KG(s,a,n.width,n.buffer),h=KG(l,a,n.width,n.buffer),p=KG(s,u,n.width,n.buffer),g=KG(l,u,n.width,n.buffer),m=owt(o,r,f,h,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(Zf.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var Jw=Bc;function $G(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties($G.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function lQ(e,t){let n=[];for(let i=0;i<e.length;i++){let o=G.byteToFloat(e[i]);i<3?n.push(MA(o)):n.push(o)}return n.length===3&&(c(t)?n.push(1-t/100):n.push(1)),n}function ev(e,t){let n={edges:void 0,material:void 0};if(c(e)&&c(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(c(r)?(n.edges={},c(r.color)&&(n.edges.color=lQ(r.color,r.transparency))):c(s)&&(n.edges={},c(s.color)&&(n.edges.color=lQ(s.color,s.transparency))),!t){let a=o.material;c(a)&&(n.material={colorMixMode:a.colorMixMode},c(a.color)&&(n.material.color=lQ(a.color,a.transparency)))}break}}return n}function swt(e,t){if(c(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(c(o))for(let r=0;r<o.length;r++){let s=ev(o[r].symbol,t),a=o[r].values;for(let l=0;l<a.length;l++){let u=a[l],f=n;for(let h=0;h<u.length;h++){let p=u[h];h===u.length-1?f[p]=s:(c(f[p])||(f[p]={}),f=f[p])}}}}return n}if(c(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=ev(o.symbol,t)}return n}}function awt(e,t){if(c(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=o.classMaxValue??o.classMinValue,a=r.classMaxValue??r.classMinValue;return s-a});let i={ranges:[],symbols:[]};c(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];c(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),c(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(ev(r.symbol,t)))}return i.symbols.push(void 0),i}}$G.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(c(e)&&c(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=c(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=ev(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=ev(i.defaultSymbol,n),this._valueFields.push(i.field1),c(i.field2)&&this._valueFields.push(i.field2),c(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=swt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=ev(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=awt(i,n))}};function wEe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return c(s)&&++n<t.length?wEe(s,t,n,i):s}}function cwt(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 lwt(e,t,n){let i=t[n],o=cwt(e.ranges,i);return e.symbols[o]}$G.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(c(this._uniqueValueHash)?o=r=>wEe(this._uniqueValueHash,i,0,r):c(this._classBreaksHash)&&(o=r=>lwt(this._classBreaksHash,i[0],r)),c(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);c(a)&&(t[s]=a)}}}return t};var gk=$G;function uu(e,t,n){this._dataProvider=e,this._parent=n,!c(t.href)&&c(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 we({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(uu.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(c(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});uu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new ae(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new gk(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()};uu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],c(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(c(r.compressedAttributes)&&e){a=!0;let l=r.compressedAttributes.attributes;for(let u=0;u<l.length;u++)s.push(l[u])}else for(let l in r)l!=="offset"&&s.push(l);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};uu.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(c(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(c(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};uu.prototype._loadRootNode=function(e){if(c(this._data.nodePages)){let t=0;c(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new Jw(this,t,!0)}else this._rootNode=new Jw(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};uu.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]})};uu._fetchJson=function(e){return e.fetchJson()};uu.prototype._loadNodePage=function(e){let t=this;if(!c(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=uu._fetchJson(n).then(function(o){return c(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};uu.prototype._computeExtent=function(){c(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):c(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]))};uu.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;c(o)&&!c(e?.outlineColor)&&(e=c(e)?je(e):{},e.outlineColor=G.fromCartesian4(se.fromArray(o))),this._tileset=await bs.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){c(r._i3sNode)&&r._i3sNode._loadChildren()})};uu.prototype._updateVisibility=function(){c(this._tileset)&&(this._tileset.show=this._parent.show)};uu.prototype.filterByAttributes=function(e){this._filters=c(e)?je(e,!0):[];let t=this._rootNode;return c(t)?t._filterFeatures():Promise.resolve()};var zA=uu;function ZG(e,t){this._dataProvider=e,this._resource=new we({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(ZG.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(c(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});ZG.prototype.load=async function(){return this._data=await Jh.loadJson(this._resource),this._data};ZG.prototype._getValues=function(e){let t=this._data.summary;if(c(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return c(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var yk=ZG;function bk(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(bk.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(T.defined("value",e),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}}});bk._fromData=async function(e,t,n,i){let o=new bk(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(c(r)){let s=[];for(let l=0;l<r.length;l++){let u=bk._fromData(e,t,r[l],o);s.push(u)}let a=await Promise.all(s);for(let l=0;l<a.length;l++){let u=a[l];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new we({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Jh.loadJson(o._resource),l=new zA(e,a,o);o._i3sLayers.push(l)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var xk=bk;var PEe=Zo(vEe(),1);function As(e){e=e??W.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??W.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(T.defined("value",e),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++)c(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return de(this)};As.prototype.isDestroyed=function(){return!1};As.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};As.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};As.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)c(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++)c(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function uwt(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 DEe(e,t,n){if(t.layerType==="Building"){c(n.showFeatures)||(e._showFeatures=!0),c(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),c(n.applySymbology)||(e._applySymbology=!0),c(n.calculateNormals)||(e._calculateNormals=!0);let i=uwt(e,t.id);if(c(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=xk._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(c(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new yk(e,o);await r.load(),e._attributeStatistics.push(r)}if(c(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"){!c(n.calculateNormals)&&!c(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new zA(e,t,e);e._layers.push(i),c(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.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await As.loadJson(n),o=new As(t);if(o._resource=n,o._data=i,c(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let l=DEe(o,i.layers[a],t);s.push(l)}await Promise.all(s)}else await DEe(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};As._fetchJson=function(e){return e.fetchJson()};As.loadJson=async function(e){let t=await As._fetchJson(e);if(c(t.error)){if(console.error("Failed to fetch I3S ",e.url),c(t.error.message)&&console.error(t.error.message),c(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new ae(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 ae(`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 fwt=new H;function dwt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),l=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let h=l.x;h<=u.x;h++)for(let p=l.y;p<=u.y;p++){let g=H.fromElements(h,p,fwt),m=g.toString();if(!o.hasOwnProperty(m)){let y={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[m]=y,i.push(y)}}let f=[];for(let h=0;h<i.length;++h){let p=i[h],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(h){let p=[];for(let g=0;g<h.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},y=h[g],b="Geographic";n._projection instanceof Mi&&(b="WebMercator");let x={projectionType:b,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===fd.LERC){let A=PEe.default.decode(y._buffer);x.buffer=A.pixels[0]}else x.buffer=y._buffer;p.push(x)}return p})}async function hwt(e){let t=e._geoidTiledTerrainProvider;if(c(t))try{let n=await dwt(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 c(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=hwt(this),this._geoidDataPromise)};As.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];c(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){T.defined("name",e);for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(c(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 Jh=As;var Tk={};Tk.createTilesetFromIModelId=async function(e,t){let{exports:n}=await us.getExports(e);if(n.length>0&&n.every(a=>a.status===us.ExportStatus.Invalid))throw new ae(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===us.ExportStatus.Complete);if(!c(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new we({url:r});return bs.fromUrl(s,t)};Tk.createTilesetForRealityDataId=async function(e,t,n,i){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),c(n)&&T.typeOf.string("type",n),c(i)&&T.typeOf.string("rootDocument",i),!c(n)||!c(i)){let s=await us.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![us.RealityDataType.Cesium3DTiles,us.RealityDataType.PNTS,us.RealityDataType.RealityMesh3DTiles,us.RealityDataType.Terrain3DTiles].includes(n))throw new ae(`Reality data type is not a mesh type: ${n}`);let r=await us.getRealityDataURL(e,t,i);return bs.fromUrl(r,{maximumScreenSpaceError:4})};Tk.createDataSourceForRealityDataId=async function(e,t,n,i){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),c(n)&&T.typeOf.string("type",n),c(i)&&T.typeOf.string("rootDocument",i),!c(n)||!c(i)){let s=await us.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![us.RealityDataType.KML,us.RealityDataType.GeoJSON].includes(n))throw new ae(`Reality data type is not a data source type: ${n}`);let r=await us.getRealityDataURL(e,t,i);return n===us.RealityDataType.GeoJSON?T0.load(r):kT.load(r)};Tk.loadGeospatialFeatures=async function(e,t,n){if(T.typeOf.string("iTwinId",e),T.typeOf.string("collectionId",t),c(n)&&(T.typeOf.number("limit",n),T.typeOf.number.lessThanOrEquals("limit",n,1e4),T.typeOf.number.greaterThanOrEquals("limit",n,1)),!c(us.defaultAccessToken)&&!c(us.defaultShareKey))throw new E("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let i=n??1e4,o=`${us.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new we({url:o,headers:{Authorization:us._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return T0.load(r)};var uQ=Tk;function IEe(){}Object.defineProperties(IEe.prototype,{color:{get:E.throwInstantiationError},intensity:{get:E.throwInstantiationError}});var fQ=IEe;var mwt=/\/$/,OEe=new Tt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function tv(e){e=e??W.EMPTY_OBJECT;let t=e.styleId;if(!c(t))throw new E("options.styleId is required.");let n=e.accessToken;if(!c(n))throw new E("options.accessToken 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;let i=we.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 s=c(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();mwt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let l;c(e.credit)?(l=e.credit,typeof l=="string"&&(l=new Tt(l))):l=OEe,this._resource=i,this._imageryProvider=new Ya({url:i,credit:l,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(tv.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}}});tv.prototype.getTileCredits=function(e,t,n){};tv.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};tv.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};tv._defaultCredit=OEe;var dQ=tv;function hQ(e){}hQ.prototype.isReady=function(){return!0};hQ.prototype.shouldDiscardImage=function(e){return!1};var mQ=hQ;var pwt=new Tt("MapQuest, Open Street Map and contributors, CC-BY-SA");function JG(e){e=e??W.EMPTY_OBJECT;let t=we.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new ls({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,l=n.positionToTileXY(ce.southwest(a),r),u=n.positionToTileXY(ce.northeast(a),r),f=(Math.abs(u.x-l.x)+1)*(Math.abs(u.y-l.y)+1);if(f>4)throw new E(`The rectangle and minimumLevel indicate that there are ${f} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);let h=e.credit??pwt;typeof h=="string"&&(h=new Tt(h)),Ya.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}c(Object.create)&&(JG.prototype=Object.create(Ya.prototype),JG.prototype.constructor=JG);var Lg=JG;var _wt=new H(1,1);function pQ(e){e=e??W.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=G.clone(e.startColor??G.WHITE),this.endColor=G.clone(e.endColor??G.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=H.clone(e.imageSize??_wt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(pQ.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var REe=new d;pQ.prototype.update=function(e,t){return d.multiplyByScalar(this.velocity,e,REe),d.add(this.position,REe,this.position),c(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 nv=pQ;function MEe(e){e=e??W.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(MEe.prototype,{complete:{get:function(){return this._complete}}});var _Q=MEe;function LEe(e){throw new E("This type should not be instantiated directly. Instead, use BoxEmitter, CircleEmitter, ConeEmitter or SphereEmitter.")}LEe.prototype.emit=function(e){E.throwInstantiationError()};var gQ=LEe;var NEe=new H(1,1);function Ak(e){e=e??W.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;c(t)||(t=new sk(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this._emitterModelMatrix=B.clone(e.emitterModelMatrix??B.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new B,this._startColor=G.clone(e.color??e.startColor??G.WHITE),this._endColor=G.clone(e.color??e.endColor??G.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=H.clone(e.imageSize??e.minimumImageSize??NEe),this._maximumImageSize=H.clone(e.imageSize??e.maximumImageSize??NEe),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 pe,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(Ak.prototype,{emitter:{get:function(){return this._emitter},set:function(e){T.defined("value",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){T.defined("value",e),this._matrixDirty=this._matrixDirty||!B.equals(this._modelMatrix,e),B.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){T.defined("value",e),this._matrixDirty=this._matrixDirty||!B.equals(this._emitterModelMatrix,e),B.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){T.defined("value",e),G.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){T.defined("value",e),G.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){T.typeOf.object("value",e),T.typeOf.number.greaterThanOrEquals("value.x",e.x,0),T.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){T.typeOf.object("value",e),T.typeOf.number.greaterThanOrEquals("value.x",e.x,0),T.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){T.typeOf.bool("value",e),this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function gwt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(c(o)){let h=o.length;for(let p=0;p<h;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),l=e._particles,u=e._particlePool,f=Math.max(a-l.length-u.length,0);for(let h=0;h<f;++h){let p=new nv;p._billboard=r.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function ywt(e){let t=e._particlePool.pop();return c(t)||(t=new nv),t}function bwt(e,t){e._particlePool.push(t)}function xwt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let l=a;l<r;++l){let u=n[l];i.remove(u._billboard)}n.length=a}function Twt(e){c(e._billboard)&&(e._billboard.show=!1)}function FEe(e,t){let n=t._billboard;c(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=O.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=O.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=O.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=O.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new G(i,o,r,s),n.scale=O.lerp(t.startScale,t.endScale,t.normalizedAge)}function Awt(e,t){t.startColor=G.clone(e._startColor,t.startColor),t.endColor=G.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=O.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=O.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=O.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=O.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=O.randomBetween(e._minimumSpeed,e._maximumSpeed);d.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function Cwt(e,t){if(e._isComplete)return 0;t=O.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),c(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;c(s)&&!s._complete&&a>s.time&&(i+=O.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var e5=new d;Ak.prototype.update=function(e){if(!this.show)return;c(this._billboardCollection)||(this._billboardCollection=new Ru),this._updateParticlePool&&(gwt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=Q.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?FEe(this,s):(Twt(s),bwt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let l=Cwt(this,t);if(l>0&&c(i)){this._matrixDirty&&(this._combinedMatrix=B.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<l;r++)s=ywt(this),this._emitter.emit(s),d.add(s.position,s.velocity,e5),B.multiplyByPoint(u,e5,e5),s.position=B.multiplyByPoint(u,s.position,s.position),d.subtract(e5,s.position,s.velocity),d.normalize(s.velocity,s.velocity),Awt(this,s),FEe(this,s)}if(this._billboardCollection.update(e),this._previousTime=Q.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=O.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&&xwt(this)};Ak.prototype.isDestroyed=function(){return!1};Ak.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),de(this)};var yQ=Ak;function df(){E.throwInstantiationError()}df.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(df.prototype,{quadtree:{get:E.throwInstantiationError,set:E.throwInstantiationError},tilingScheme:{get:E.throwInstantiationError},errorEvent:{get:E.throwInstantiationError}});df.prototype.update=E.throwInstantiationError;df.prototype.beginUpdate=E.throwInstantiationError;df.prototype.endUpdate=E.throwInstantiationError;df.prototype.getLevelMaximumGeometricError=E.throwInstantiationError;df.prototype.loadTile=E.throwInstantiationError;df.prototype.computeTileVisibility=E.throwInstantiationError;df.prototype.showTileThisFrame=E.throwInstantiationError;df.prototype.computeDistanceToTile=E.throwInstantiationError;df.prototype.isDestroyed=E.throwInstantiationError;df.prototype.destroy=E.throwInstantiationError;var bQ=df;function xQ(e){e=e??1,T.typeOf.number.greaterThan("radius",e,0),this._radius=e??1}Object.defineProperties(xQ.prototype,{radius:{get:function(){return this._radius},set:function(e){T.typeOf.number.greaterThan("value",e,0),this._radius=e}}});xQ.prototype.emit=function(e){let t=O.randomBetween(0,O.TWO_PI),n=O.randomBetween(0,O.PI),i=O.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=d.fromElements(o,r,s,e.position),e.velocity=d.normalize(e.position,e.velocity)};var TQ=xQ;function Ck(){}Ck.prototype.evaluate=function(e,t){E.throwInstantiationError()};Ck.prototype.evaluateColor=function(e,t){E.throwInstantiationError()};Ck.prototype.getShaderFunction=function(e,t,n,i){E.throwInstantiationError()};Ck.prototype.getVariables=function(){E.throwInstantiationError()};var AQ=Ck;function iv(e){T.typeOf.object("terrainProviderPromise",e),this._ready=!1,this._provider=void 0,this._errorEvent=new pe,this._readyEvent=new pe,Swt(this,e)}Object.defineProperties(iv.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}}});iv.fromWorldTerrain=function(e){return new iv(PA(e))};iv.fromWorldBathymetry=function(e){return new iv(K3(e))};function Ewt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Swt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){Ewt(e._errorEvent,i)}}var Ek=iv;function ov(){}ov.prototype.boundingVolume=void 0;ov.prototype.boundingSphere=void 0;ov.prototype.distanceToCamera=function(e){E.throwInstantiationError()};ov.prototype.intersectPlane=function(e){E.throwInstantiationError()};ov.prototype.createDebugVolume=function(e){E.throwInstantiationError()};var CQ=ov;function Sk(e){e=e??W.EMPTY_OBJECT,this._tilingScheme=c(e.tilingScheme)?e.tilingScheme:new Ki({ellipsoid:e.ellipsoid}),this._color=e.color??G.YELLOW,this._errorEvent=new pe,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(Sk.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}}});Sk.prototype.getTileCredits=function(e,t,n){};Sk.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};Sk.prototype.pickFeatures=function(e,t,n,i,o){};var wk=Sk;function EQ(e){E.throwInstantiationError()}EQ.prototype.isReady=E.throwInstantiationError;EQ.prototype.shouldDiscardImage=E.throwInstantiationError;var SQ=EQ;var wwt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},wQ=Object.freeze(wwt);function t5(e,t){this.show=!0,c(e)||(e=new Ke),this.rectangle=Ke.clone(e),c(t)||(t=Xi.fromType(Xi.ColorType,{color:new G(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}t5.prototype.update=function(e){if(!this.show)return;if(!c(this.material))throw new E("this.material must be defined.");if(!c(this.rectangle))throw new E("this.rectangle must be defined.");let t=this._rs;if((!c(t)||!Ke.equals(t.viewport,this.rectangle))&&(this._rs=Ve.fromCache({blending:ln.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!c(this._overlayCommand)){this._material=this.material,c(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new He({sources:[this._material.shaderSource,m2]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=De.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};t5.prototype.isDestroyed=function(){return!1};t5.prototype.destroy=function(){return c(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),de(this)};var vQ=t5;function DQ(){E.throwInstantiationError()}Object.defineProperties(DQ.prototype,{globalTransform:{get:E.throwInstantiationError},shapeTransform:{get:E.throwInstantiationError},shape:{get:E.throwInstantiationError},minBounds:{get:E.throwInstantiationError},maxBounds:{get:E.throwInstantiationError},dimensions:{get:E.throwInstantiationError},paddingBefore:{get:E.throwInstantiationError},paddingAfter:{get:E.throwInstantiationError},names:{get:E.throwInstantiationError},types:{get:E.throwInstantiationError},componentTypes:{get:E.throwInstantiationError},minimumValues:{get:E.throwInstantiationError},maximumValues:{get:E.throwInstantiationError},maximumTileCount:{get:E.throwInstantiationError},availableLevels:{get:E.throwInstantiationError},keyframeCount:{get:E.throwInstantiationError},timeIntervalCollection:{get:E.throwInstantiationError}});DQ.prototype.requestData=function(e){E.throwInstantiationError()};var PQ=DQ;function HA(){E.throwInstantiationError()}Object.defineProperties(HA.prototype,{orientedBoundingBox:{get:E.throwInstantiationError},boundingSphere:{get:E.throwInstantiationError},boundTransform:{get:E.throwInstantiationError},shapeTransform:{get:E.throwInstantiationError},shaderUniforms:{get:E.throwInstantiationError},shaderDefines:{get:E.throwInstantiationError},shaderMaximumIntersectionsLength:{get:E.throwInstantiationError}});HA.prototype.update=E.throwInstantiationError;HA.prototype.computeOrientedBoundingBoxForTile=E.throwInstantiationError;HA.prototype.computeOrientedBoundingBoxForSample=E.throwInstantiationError;HA.DefaultMinBounds=E.throwInstantiationError;HA.DefaultMaxBounds=E.throwInstantiationError;var IQ=HA;var OQ=`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 vwt(e){e=e??W.EMPTY_OBJECT;let t=c(e.typedArray),n=c(e.url);if(t===n)throw new E("exactly one of options.typedArray, options.url must be defined");if(t&&(!c(e.width)||!c(e.height)))throw new E("options.width and options.height are required when options.typedArray is defined");this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??ke.RGBA,this.pixelDatatype=e.pixelDatatype??Ue.UNSIGNED_BYTE;let i=e.url;typeof i=="string"&&(i=we.createIfNeeded(i)),this.resource=i;let r=e.repeat??!0?gn.REPEAT:gn.CLAMP_TO_EDGE;this.sampler=new Qt({wrapS:r,wrapT:r,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var RQ=vwt;var Dwt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"},MQ=Object.freeze(Dwt);var Pwt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},LQ=Object.freeze(Pwt);function Iwt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${ep(s)} with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var NQ=Iwt;globalThis.CESIUM_VERSION="1.129";var vk;typeof ko<"u"&&(vk=ko);(function(){/*! * Knockout JavaScript library v3.5.1 * (c) The Knockout.js team - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function l(_,w){return _===null||typeof _ in y?_===w:!1}function u(_,w){var D;return function(){D||(D=m.a.setTimeout(function(){D=e,_()},w))}}function f(_,w){var D;return function(){clearTimeout(D),D=m.a.setTimeout(_,w)}}function h(_,w){w&&w!=="change"?w==="beforeChange"?this.pc(_):this.gb(_,w):this.qc(_)}function p(_,w){w!==null&&w.s&&w.s()}function g(_,w){var D=this.qd,I=D[S];I.ra||(this.Qb&&this.mb[w]?(D.uc(w,_,this.mb[w]),this.mb[w]=null,--this.Qb):I.I[w]||D.uc(w,_,I.J?{da:_}:D.$c(_)),_.Ja&&_.gd())}var m=typeof s<"u"?s:{};m.b=function(_,w){for(var D=_.split("."),I=m,N=0;N<D.length-1;N++)I=I[D[N]];I[D[D.length-1]]=w},m.L=function(_,w,D){_[w]=D},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=function(){function _(K,Z){for(var ee in K)N.call(K,ee)&&Z(ee,K[ee])}function w(K,Z){if(Z)for(var ee in Z)N.call(Z,ee)&&(K[ee]=Z[ee]);return K}function D(K,Z){return K.__proto__=Z,K}function I(K,Z,ee,me){var Te=K[Z].match(Y)||[];m.a.D(ee.match(Y),function(ue){m.a.Na(Te,ue,me)}),K[Z]=Te.join(" ")}var N=Object.prototype.hasOwnProperty,k={__proto__:[]}instanceof Array,z=typeof Symbol=="function",V={},j={};V[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],V.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(V,function(K,Z){if(Z.length)for(var ee=0,me=Z.length;ee<me;ee++)j[Z[ee]]=K});var U={propertychange:!0},q=n&&function(){for(var K=3,Z=n.createElement("div"),ee=Z.getElementsByTagName("i");Z.innerHTML="<!--[if gt IE "+ ++K+"]><i></i><![endif]-->",ee[0];);return 4<K?K:e}(),Y=/\S+/g,te;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(K,Z,ee){for(var me=0,Te=K.length;me<Te;me++)Z.call(ee,K[me],me,K)},A:typeof Array.prototype.indexOf=="function"?function(K,Z){return Array.prototype.indexOf.call(K,Z)}:function(K,Z){for(var ee=0,me=K.length;ee<me;ee++)if(K[ee]===Z)return ee;return-1},Lb:function(K,Z,ee){for(var me=0,Te=K.length;me<Te;me++)if(Z.call(ee,K[me],me,K))return K[me];return e},Pa:function(K,Z){var ee=m.a.A(K,Z);0<ee?K.splice(ee,1):ee===0&&K.shift()},wc:function(K){var Z=[];return K&&m.a.D(K,function(ee){0>m.a.A(Z,ee)&&Z.push(ee)}),Z},Mb:function(K,Z,ee){var me=[];if(K)for(var Te=0,ue=K.length;Te<ue;Te++)me.push(Z.call(ee,K[Te],Te));return me},jb:function(K,Z,ee){var me=[];if(K)for(var Te=0,ue=K.length;Te<ue;Te++)Z.call(ee,K[Te],Te)&&me.push(K[Te]);return me},Nb:function(K,Z){if(Z instanceof Array)K.push.apply(K,Z);else for(var ee=0,me=Z.length;ee<me;ee++)K.push(Z[ee]);return K},Na:function(K,Z,ee){var me=m.a.A(m.a.bc(K),Z);0>me?ee&&K.push(Z):ee||K.splice(me,1)},Ba:k,extend:w,setPrototypeOf:D,Ab:k?D:w,P:_,Ga:function(K,Z,ee){if(!K)return K;var me={},Te;for(Te in K)N.call(K,Te)&&(me[Te]=Z.call(ee,K[Te],Te,K));return me},Tb:function(K){for(;K.firstChild;)m.removeNode(K.firstChild)},Yb:function(K){K=m.a.la(K);for(var Z=(K[0]&&K[0].ownerDocument||n).createElement("div"),ee=0,me=K.length;ee<me;ee++)Z.appendChild(m.oa(K[ee]));return Z},Ca:function(K,Z){for(var ee=0,me=K.length,Te=[];ee<me;ee++){var ue=K[ee].cloneNode(!0);Te.push(Z?m.oa(ue):ue)}return Te},va:function(K,Z){if(m.a.Tb(K),Z)for(var ee=0,me=Z.length;ee<me;ee++)K.appendChild(Z[ee])},Xc:function(K,Z){var ee=K.nodeType?[K]:K;if(0<ee.length){for(var me=ee[0],Te=me.parentNode,ue=0,ye=Z.length;ue<ye;ue++)Te.insertBefore(Z[ue],me);for(ue=0,ye=ee.length;ue<ye;ue++)m.removeNode(ee[ue])}},Ua:function(K,Z){if(K.length){for(Z=Z.nodeType===8&&Z.parentNode||Z;K.length&&K[0].parentNode!==Z;)K.splice(0,1);for(;1<K.length&&K[K.length-1].parentNode!==Z;)K.length--;if(1<K.length){var ee=K[0],me=K[K.length-1];for(K.length=0;ee!==me;)K.push(ee),ee=ee.nextSibling;K.push(me)}}return K},Zc:function(K,Z){7>q?K.setAttribute("selected",Z):K.selected=Z},Db:function(K){return K===null||K===e?"":K.trim?K.trim():K.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(K,Z){return K=K||"",Z.length>K.length?!1:K.substring(0,Z.length)===Z},vd:function(K,Z){if(K===Z)return!0;if(K.nodeType===11)return!1;if(Z.contains)return Z.contains(K.nodeType!==1?K.parentNode:K);if(Z.compareDocumentPosition)return(Z.compareDocumentPosition(K)&16)==16;for(;K&&K!=Z;)K=K.parentNode;return!!K},Sb:function(K){return m.a.vd(K,K.ownerDocument.documentElement)},kd:function(K){return!!m.a.Lb(K,m.a.Sb)},R:function(K){return K&&K.tagName&&K.tagName.toLowerCase()},Ac:function(K){return m.onError?function(){try{return K.apply(this,arguments)}catch(Z){throw m.onError&&m.onError(Z),Z}}:K},setTimeout:function(K,Z){return setTimeout(m.a.Ac(K),Z)},Gc:function(K){setTimeout(function(){throw m.onError&&m.onError(K),K},0)},B:function(K,Z,ee){var me=m.a.Ac(ee);if(ee=U[Z],m.options.useOnlyNativeEvents||ee||!o)if(ee||typeof K.addEventListener!="function")if(typeof K.attachEvent<"u"){var Te=function(ye){me.call(K,ye)},ue="on"+Z;K.attachEvent(ue,Te),m.a.K.za(K,function(){K.detachEvent(ue,Te)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else K.addEventListener(Z,me,!1);else te||(te=typeof o(K).on=="function"?"on":"bind"),o(K)[te](Z,me)},Fb:function(K,Z){if(!K||!K.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ee;if(m.a.R(K)==="input"&&K.type&&Z.toLowerCase()=="click"?(ee=K.type,ee=ee=="checkbox"||ee=="radio"):ee=!1,m.options.useOnlyNativeEvents||!o||ee)if(typeof n.createEvent=="function")if(typeof K.dispatchEvent=="function")ee=n.createEvent(j[Z]||"HTMLEvents"),ee.initEvent(Z,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,K),K.dispatchEvent(ee);else throw Error("The supplied element doesn't support dispatchEvent");else if(ee&&K.click)K.click();else if(typeof K.fireEvent<"u")K.fireEvent("on"+Z);else throw Error("Browser doesn't support triggering events");else o(K).trigger(Z)},f:function(K){return m.O(K)?K():K},bc:function(K){return m.O(K)?K.v():K},Eb:function(K,Z,ee){var me;Z&&(typeof K.classList=="object"?(me=K.classList[ee?"add":"remove"],m.a.D(Z.match(Y),function(Te){me.call(K.classList,Te)})):typeof K.className.baseVal=="string"?I(K.className,"baseVal",Z,ee):I(K,"className",Z,ee))},Bb:function(K,Z){var ee=m.a.f(Z);(ee===null||ee===e)&&(ee="");var me=m.h.firstChild(K);!me||me.nodeType!=3||m.h.nextSibling(me)?m.h.va(K,[K.ownerDocument.createTextNode(ee)]):me.data=ee,m.a.Ad(K)},Yc:function(K,Z){if(K.name=Z,7>=q)try{var ee=K.name.replace(/[&<>'"]/g,function(me){return"&#"+me.charCodeAt(0)+";"});K.mergeAttributes(n.createElement("<input name='"+ee+"'/>"),!1)}catch{}},Ad:function(K){9<=q&&(K=K.nodeType==1?K:K.parentNode,K.style&&(K.style.zoom=K.style.zoom))},wd:function(K){if(q){var Z=K.style.width;K.style.width=0,K.style.width=Z}},Pd:function(K,Z){K=m.a.f(K),Z=m.a.f(Z);for(var ee=[],me=K;me<=Z;me++)ee.push(me);return ee},la:function(K){for(var Z=[],ee=0,me=K.length;ee<me;ee++)Z.push(K[ee]);return Z},Da:function(K){return z?Symbol(K):K},Zd:q===6,$d:q===7,W:q,Lc:function(K,Z){for(var ee=m.a.la(K.getElementsByTagName("input")).concat(m.a.la(K.getElementsByTagName("textarea"))),me=typeof Z=="string"?function(ye){return ye.name===Z}:function(ye){return Z.test(ye.name)},Te=[],ue=ee.length-1;0<=ue;ue--)me(ee[ue])&&Te.push(ee[ue]);return Te},Nd:function(K){return typeof K=="string"&&(K=m.a.Db(K))?r&&r.parse?r.parse(K):new Function("return "+K)():null},hc:function(K,Z,ee){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(m.a.f(K),Z,ee)},Od:function(K,Z,ee){ee=ee||{};var me=ee.params||{},Te=ee.includeFields||this.Jc,ue=K;if(typeof K=="object"&&m.a.R(K)==="form")for(var ue=K.action,ye=Te.length-1;0<=ye;ye--)for(var Ae=m.a.Lc(K,Te[ye]),Pe=Ae.length-1;0<=Pe;Pe--)me[Ae[Pe].name]=Ae[Pe].value;Z=m.a.f(Z);var Ee=n.createElement("form");Ee.style.display="none",Ee.action=ue,Ee.method="post";for(var ze in Z)K=n.createElement("input"),K.type="hidden",K.name=ze,K.value=m.a.hc(m.a.f(Z[ze])),Ee.appendChild(K);_(me,function(qe,it){var Dt=n.createElement("input");Dt.type="hidden",Dt.name=qe,Dt.value=it,Ee.appendChild(Dt)}),n.body.appendChild(Ee),ee.submitter?ee.submitter(Ee):Ee.submit(),setTimeout(function(){Ee.parentNode.removeChild(Ee)},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(_){var w=this;if(arguments.length===1)return function(){return w.apply(_,arguments)};var D=Array.prototype.slice.call(arguments,1);return function(){var I=D.slice(0);return I.push.apply(I,arguments),w.apply(_,I)}}),m.a.g=new function(){var _=0,w="__ko__"+new Date().getTime(),D={},I,N;return m.a.W?(I=function(k,z){var V=k[w];if(!V||V==="null"||!D[V]){if(!z)return e;V=k[w]="ko"+_++,D[V]={}}return D[V]},N=function(k){var z=k[w];return z?(delete D[z],k[w]=null,!0):!1}):(I=function(k,z){var V=k[w];return!V&&z&&(V=k[w]={}),V},N=function(k){return k[w]?(delete k[w],!0):!1}),{get:function(k,z){var V=I(k,!1);return V&&V[z]},set:function(k,z,V){(k=I(k,V!==e))&&(k[z]=V)},Ub:function(k,z,V){return k=I(k,!0),k[z]||(k[z]=V)},clear:N,Z:function(){return _+++w}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function _(z,V){var j=m.a.g.get(z,I);return j===e&&V&&(j=[],m.a.g.set(z,I,j)),j}function w(z){var V=_(z,!1);if(V)for(var V=V.slice(0),j=0;j<V.length;j++)V[j](z);m.a.g.clear(z),m.a.K.cleanExternalData(z),k[z.nodeType]&&D(z.childNodes,!0)}function D(z,V){for(var j=[],U,q=0;q<z.length;q++)if((!V||z[q].nodeType===8)&&(w(j[j.length]=U=z[q]),z[q]!==U))for(;q--&&m.a.A(j,z[q])==-1;);}var I=m.a.g.Z(),N={1:!0,8:!0,9:!0},k={1:!0,9:!0};return{za:function(z,V){if(typeof V!="function")throw Error("Callback must be a function");_(z,!0).push(V)},yb:function(z,V){var j=_(z,!1);j&&(m.a.Pa(j,V),j.length==0&&m.a.g.set(z,I,e))},oa:function(z){return m.u.G(function(){N[z.nodeType]&&(w(z),k[z.nodeType]&&D(z.getElementsByTagName("*")))}),z},removeNode:function(z){m.oa(z),z.parentNode&&z.parentNode.removeChild(z)},cleanExternalData:function(z){o&&typeof o.cleanData=="function"&&o.cleanData([z])}}},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 _=[0,"",""],w=[1,"<table>","</table>"],D=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],N={thead:w,tbody:w,tfoot:w,tr:[2,"<table><tbody>","</tbody></table>"],td:D,th:D,option:I,optgroup:I},k=8>=m.a.W;m.a.ua=function(z,V){var j;if(o){if(o.parseHTML)j=o.parseHTML(z,V)||[];else if((j=o.clean([z],V))&&j[0]){for(var U=j[0];U.parentNode&&U.parentNode.nodeType!==11;)U=U.parentNode;U.parentNode&&U.parentNode.removeChild(U)}}else{(j=V)||(j=n);var U=j.parentWindow||j.defaultView||t,q=m.a.Db(z).toLowerCase(),Y=j.createElement("div"),te;for(te=(q=q.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&N[q[1]]||_,q=te[0],te="ignored<div>"+te[1]+z+te[2]+"</div>",typeof U.innerShiv=="function"?Y.appendChild(U.innerShiv(te)):(k&&j.body.appendChild(Y),Y.innerHTML=te,k&&Y.parentNode.removeChild(Y));q--;)Y=Y.lastChild;j=m.a.la(Y.lastChild.childNodes)}return j},m.a.Md=function(z,V){var j=m.a.ua(z,V);return j.length&&j[0].parentElement||m.a.Yb(j)},m.a.fc=function(z,V){if(m.a.Tb(z),V=m.a.f(V),V!==null&&V!==e)if(typeof V!="string"&&(V=V.toString()),o)o(z).html(V);else for(var j=m.a.ua(V,z.ownerDocument),U=0;U<j.length;U++)z.appendChild(j[U])}}(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=function(){function _(D,I){if(D){if(D.nodeType==8){var N=m.aa.Uc(D.nodeValue);N!=null&&I.push({ud:D,Kd:N})}else if(D.nodeType==1)for(var N=0,k=D.childNodes,z=k.length;N<z;N++)_(k[N],I)}}var w={};return{Xb:function(D){if(typeof D!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return w[I]=D,"<!--[ko_memo:"+I+"]-->"},bd:function(D,I){var N=w[D];if(N===e)throw Error("Couldn't find any memo with ID "+D+". Perhaps it's already been unmemoized.");try{return N.apply(null,I||[]),!0}finally{delete w[D]}},cd:function(D,I){var N=[];_(D,N);for(var k=0,z=N.length;k<z;k++){var V=N[k].ud,j=[V];I&&m.a.Nb(j,I),m.aa.bd(N[k].Kd,j),V.nodeValue="",V.parentNode&&V.parentNode.removeChild(V)}},Uc:function(D){return(D=D.match(/^\[ko_memo\:(.*?)\]$/))?D[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 _(){if(N){for(var V=N,j=0,U;z<N;)if(U=I[z++]){if(z>V){if(5e3<=++j){z=N,m.a.Gc(Error("'Too much recursion' after processing "+j+" task groups."));break}V=N}try{U()}catch(q){m.a.Gc(q)}}}}function w(){_(),z=N=I.length=0}var D,I=[],N=0,k=1,z=0;return t.MutationObserver?D=function(V){var j=n.createElement("div");return new MutationObserver(V).observe(j,{attributes:!0}),function(){j.classList.toggle("foo")}}(w):D=n&&"onreadystatechange"in n.createElement("script")?function(V){var j=n.createElement("script");j.onreadystatechange=function(){j.onreadystatechange=null,n.documentElement.removeChild(j),j=null,V()},n.documentElement.appendChild(j)}:function(V){setTimeout(V,0)},{scheduler:D,zb:function(V){return N||m.na.scheduler(w),I[N++]=V,k++},cancel:function(V){V=V-(k-N),V>=z&&V<N&&(I[V]=null)},resetForTesting:function(){var V=N-z;return z=N=I.length=0,V},Sd:_}}(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(_,w){_.throttleEvaluation=w;var D=null;return m.$({read:_,write:function(I){clearTimeout(D),D=m.a.setTimeout(function(){_(I)},w)}})},rateLimit:function(_,w){var D,I,N;typeof w=="number"?D=w:(D=w.timeout,I=w.method),_.Hb=!1,N=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,_.ub(function(k){return N(k,D,w)})},deferred:function(_,w){if(w!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(D){var I,N=!1;return function(){if(!N){m.na.cancel(I),I=m.na.zb(D);try{N=!0,_.notifySubscribers(e,"dirty")}finally{N=!1}}}}))},notify:function(_,w){_.equalityComparer=w=="always"?null:l}};var y={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(_,w,D){this.da=_,this.lc=w,this.mc=D,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(_){this.Jb=_,m.a.K.za(_,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,b),b.qb(this)};var b={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,w,D){var I=this;D=D||"change";var N=new m.ic(I,w?_.bind(w):_,function(){m.a.Pa(I.U[D],N),I.hb&&I.hb(D)});return I.Qa&&I.Qa(D),I.U[D]||(I.U[D]=[]),I.U[D].push(N),N},notifySubscribers:function(_,w){if(w=w||"change",w==="change"&&this.Gb(),this.Wa(w)){var D=w==="change"&&this.ed||this.U[w].slice(0);try{m.u.xc();for(var I=0,N;N=D[I];++I)N.Ib||N.lc(_)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var w=this,D=m.O(w),I,N,k,z,V;w.gb||(w.gb=w.notifySubscribers,w.notifySubscribers=h);var j=_(function(){w.Ja=!1,D&&z===w&&(z=w.nc?w.nc():w());var U=N||V&&w.sb(k,z);V=N=I=!1,U&&w.gb(k=z)});w.qc=function(U,q){q&&w.Ja||(V=!q),w.ed=w.U.change.slice(0),w.Ja=I=!0,z=U,j()},w.pc=function(U){I||(k=U,w.gb(U,"beforeChange"))},w.rc=function(){V=!0},w.gd=function(){w.sb(k,w.v(!0))&&(N=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var w=0;return m.a.P(this.U,function(D,I){D!=="dirty"&&(w+=I.length)}),w},sb:function(_,w){return!this.equalityComparer||!this.equalityComparer(_,w)},toString:function(){return"[object Object]"},extend:function(_){var w=this;return _&&m.a.P(_,function(D,I){var N=m.Ta[D];typeof N=="function"&&(w=N(w,I)||w)}),w}};m.L(b,"init",b.qb),m.L(b,"subscribe",b.subscribe),m.L(b,"extend",b.extend),m.L(b,"getSubscriptionsCount",b.Bd),m.a.Ba&&m.a.setPrototypeOf(b,Function.prototype),m.T.fn=b,m.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=function(){function _(k){D.push(I),I=k}function w(){I=D.pop()}var D=[],I,N=0;return{xc:_,end:w,cc:function(k){if(I){if(!m.Qc(k))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,k,k.fd||(k.fd=++N))}},G:function(k,z,V){try{return _(),k.apply(z,V||[])}finally{w()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}}(),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 x=m.a.Da("_latestValue");m.ta=function(_){function w(){return 0<arguments.length?(w.sb(w[x],arguments[0])&&(w.ya(),w[x]=arguments[0],w.xa()),this):(m.u.cc(w),w[x])}return w[x]=_,m.a.Ba||m.a.extend(w,m.T.fn),m.T.fn.qb(w),m.a.Ab(w,A),m.options.deferUpdates&&m.Ta.deferred(w,!0),w};var A={equalityComparer:l,v:function(){return this[x]},xa:function(){this.notifySubscribers(this[x],"spectate"),this.notifySubscribers(this[x])},ya:function(){this.notifySubscribers(this[x],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(A,m.T.fn);var C=m.ta.Ma="__ko_proto__";A[C]=m.ta,m.O=function(_){if((_=typeof _=="function"&&_[C])&&_!==A[C]&&_!==m.o.fn[C])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},m.Za=function(_){return typeof _=="function"&&(_[C]===A[C]||_[C]===m.o.fn[C]&&_.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",A),m.L(A,"peek",A.v),m.L(A,"valueHasMutated",A.xa),m.L(A,"valueWillMutate",A.ya),m.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=m.ta(_),m.a.Ab(_,m.Ha.fn),_.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(_){for(var w=this.v(),D=[],I=typeof _!="function"||m.O(_)?function(z){return z===_}:_,N=0;N<w.length;N++){var k=w[N];if(I(k)){if(D.length===0&&this.ya(),w[N]!==k)throw Error("Array modified during remove; cannot remove item");D.push(k),w.splice(N,1),N--}}return D.length&&this.xa(),D},removeAll:function(_){if(_===e){var w=this.v(),D=w.slice(0);return this.ya(),w.splice(0,w.length),this.xa(),D}return _?this.remove(function(I){return 0<=m.a.A(_,I)}):[]},destroy:function(_){var w=this.v(),D=typeof _!="function"||m.O(_)?function(k){return k===_}:_;this.ya();for(var I=w.length-1;0<=I;I--){var N=w[I];D(N)&&(N._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(w){return 0<=m.a.A(_,w)}):[]},indexOf:function(_){var w=this();return m.a.A(w,_)},replace:function(_,w){var D=this.indexOf(_);0<=D&&(this.ya(),this.v()[D]=w,this.xa())},sorted:function(_){var w=this().slice(0);return _?w.sort(_):w.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(_){m.Ha.fn[_]=function(){var w=this.v();this.ya(),this.zc(w,_,arguments);var D=w[_].apply(w,arguments);return this.xa(),D===w?this:D}}),m.a.D(["slice"],function(_){m.Ha.fn[_]=function(){var w=this();return w[_].apply(w,arguments)}}),m.Pc=function(_){return m.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(_,w){function D(){function Y(){if(V){var te=[].concat(_.v()||[]),K;_.Wa("arrayChange")&&((!N||1<V)&&(N=m.a.Pb(j,te,_.Ob)),K=N),j=te,N=null,V=0,K&&K.length&&_.notifySubscribers(K,"arrayChange")}}I?Y():(I=!0,z=_.subscribe(function(){++V},null,"spectate"),j=[].concat(_.v()||[]),N=null,k=_.subscribe(Y))}if(_.Ob={},w&&typeof w=="object"&&m.a.extend(_.Ob,w),_.Ob.sparse=!0,!_.zc){var I=!1,N=null,k,z,V=0,j,U=_.Qa,q=_.hb;_.Qa=function(Y){U&&U.call(_,Y),Y==="arrayChange"&&D()},_.hb=function(Y){q&&q.call(_,Y),Y!=="arrayChange"||_.Wa("arrayChange")||(k&&k.s(),z&&z.s(),z=k=null,I=!1,j=e)},_.zc=function(Y,te,K){function Z(Ee,ze,qe){return ee[ee.length]={status:Ee,value:ze,index:qe}}if(I&&!V){var ee=[],me=Y.length,Te=K.length,ue=0;switch(te){case"push":ue=me;case"unshift":for(te=0;te<Te;te++)Z("added",K[te],ue+te);break;case"pop":ue=me-1;case"shift":me&&Z("deleted",Y[ue],ue);break;case"splice":te=Math.min(Math.max(0,0>K[0]?me+K[0]:K[0]),me);for(var me=Te===1?me:Math.min(te+(K[1]||0),me),Te=te+Te-2,ue=Math.max(me,Te),ye=[],Ae=[],Pe=2;te<ue;++te,++Pe)te<me&&Ae.push(Z("deleted",Y[te],te)),te<Te&&ye.push(Z("added",K[Pe],te));m.a.Kc(Ae,ye);break;default:return}N=ee}}}};var S=m.a.Da("_state");m.o=m.$=function(_,w,D){function I(){if(0<arguments.length){if(typeof N=="function")N.apply(k.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 k.ra||m.u.cc(I),(k.ka||k.J&&I.Xa())&&I.ha(),k.X}if(typeof _=="object"?D=_:(D=D||{},_&&(D.read=_)),typeof D.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var N=D.write,k={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:D.read,nb:w||D.owner,l:D.disposeWhenNodeIsRemoved||D.l||null,Sa:D.disposeWhen||D.Sa,Rb:null,I:{},V:0,Ic:null};return I[S]=k,I.Nc=typeof N=="function",m.a.Ba||m.a.extend(I,m.T.fn),m.T.fn.qb(I),m.a.Ab(I,v),D.pure?(k.wb=!0,k.J=!0,m.a.extend(I,P)):D.deferEvaluation&&m.a.extend(I,M),m.options.deferUpdates&&m.Ta.deferred(I,!0),k.l&&(k.jc=!0,k.l.nodeType||(k.l=null)),k.J||D.deferEvaluation||I.ha(),k.l&&I.ja()&&m.a.K.za(k.l,k.Rb=function(){I.s()}),I};var v={equalityComparer:l,qa:function(){return this[S].V},Va:function(){var _=[];return m.a.P(this[S].I,function(w,D){_[D.Ka]=D.da}),_},Vb:function(_){if(!this[S].V)return!1;var w=this.Va();return m.a.A(w,_)!==-1?!0:!!m.a.Lb(w,function(D){return D.Vb&&D.Vb(_)})},uc:function(_,w,D){if(this[S].wb&&w===this)throw Error("A 'pure' computed must not be called recursively");this[S].I[_]=D,D.Ka=this[S].V++,D.La=w.ob()},Xa:function(){var _,w,D=this[S].I;for(_ in D)if(Object.prototype.hasOwnProperty.call(D,_)&&(w=D[_],this.Ia&&w.da.Ja||w.da.Dd(w.La)))return!0},Jd:function(){this.Ia&&!this[S].rb&&this.Ia(!1)},ja:function(){var _=this[S];return _.ka||0<_.V},Rd:function(){this.Ja?this[S].ka&&(this[S].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var w=_.subscribe(this.Jd,this,"dirty"),D=_.subscribe(this.Rd,this);return{da:_,s:function(){w.s(),D.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,w=_.throttleEvaluation;w&&0<=w?(clearTimeout(this[S].Ic),this[S].Ic=m.a.setTimeout(function(){_.ha(!0)},w)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var w=this[S],D=w.Sa,I=!1;if(!w.rb&&!w.ra){if(w.l&&!m.a.Sb(w.l)||D&&D()){if(!w.jc){this.s();return}}else w.jc=!1;w.rb=!0;try{I=this.zd(_)}finally{w.rb=!1}return I}},zd:function(_){var w=this[S],I=!1,D=w.wb?e:!w.V,I={qd:this,mb:w.I,Qb:w.V};m.u.xc({pd:I,od:g,o:this,Ya:D}),w.I={},w.V=0;var N=this.yd(w,I);return w.V?I=this.sb(w.X,N):(this.s(),I=!0),I&&(w.J?this.Gb():this.notifySubscribers(w.X,"beforeChange"),w.X=N,this.notifySubscribers(w.X,"spectate"),!w.J&&_&&this.notifySubscribers(w.X),this.rc&&this.rc()),D&&this.notifySubscribers(w.X,"awake"),I},yd:function(_,w){try{var D=_.Wc;return _.nb?D.call(_.nb):D()}finally{m.u.end(),w.Qb&&!_.J&&m.a.P(w.mb,p),_.sa=_.ka=!1}},v:function(_){var w=this[S];return(w.ka&&(_||!w.V)||w.J&&this.Xa())&&this.ha(),w.X},ub:function(_){m.T.fn.ub.call(this,_),this.nc=function(){return this[S].J||(this[S].sa?this.ha():this[S].ka=!1),this[S].X},this.Ia=function(w){this.pc(this[S].X),this[S].ka=!0,w&&(this[S].sa=!0),this.qc(this,!w)}},s:function(){var _=this[S];!_.J&&_.I&&m.a.P(_.I,function(w,D){D.s&&D.s()}),_.l&&_.Rb&&m.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},P={Qa:function(_){var w=this,D=w[S];if(!D.ra&&D.J&&_=="change"){if(D.J=!1,D.sa||w.Xa())D.I=null,D.V=0,w.ha()&&w.Gb();else{var I=[];m.a.P(D.I,function(N,k){I[k.Ka]=N}),m.a.D(I,function(N,k){var z=D.I[N],V=w.$c(z.da);V.Ka=k,V.La=z.La,D.I[N]=V}),w.Xa()&&w.ha()&&w.Gb()}D.ra||w.notifySubscribers(D.X,"awake")}},hb:function(_){var w=this[S];w.ra||_!="change"||this.Wa("change")||(m.a.P(w.I,function(D,I){I.s&&(w.I[D]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),w.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[S];return _.J&&(_.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},M={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(v,m.T.fn);var R=m.ta.Ma;v[R]=m.o,m.Oc=function(_){return typeof _=="function"&&_[R]===v[R]},m.Fd=function(_){return m.Oc(_)&&_[S]&&_[S].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",v),m.L(v,"peek",v.v),m.L(v,"dispose",v.s),m.L(v,"isActive",v.ja),m.L(v,"getDependenciesCount",v.qa),m.L(v,"getDependencies",v.Va),m.xb=function(_,w){return typeof _=="function"?m.o(_,w,{pure:!0}):(_=m.a.extend({},_),_.pure=!0,m.o(_,w))},m.b("pureComputed",m.xb),function(){function _(I,N,k){if(k=k||new D,I=N(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var z=I instanceof Array?[]:{};return k.save(I,z),w(I,function(V){var j=N(I[V]);switch(typeof j){case"boolean":case"number":case"string":case"function":z[V]=j;break;case"object":case"undefined":var U=k.get(j);z[V]=U!==e?U:_(j,N,k)}}),z}function w(I,N){if(I instanceof Array){for(var k=0;k<I.length;k++)N(k);typeof I.toJSON=="function"&&N("toJSON")}else for(k in I)N(k)}function D(){this.keys=[],this.values=[]}m.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(I,function(N){for(var k=0;m.O(N)&&10>k;k++)N=N();return N})},m.toJSON=function(I,N,k){return I=m.ad(I),m.a.hc(I,N,k)},D.prototype={constructor:D,save:function(I,N){var k=m.a.A(this.keys,I);0<=k?this.values[k]=N:(this.keys.push(I),this.values.push(N))},get:function(I){return I=m.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(_,w,D){function I(N){var k=m.xb(_,D).extend({ma:"always"}),z=k.subscribe(function(V){V&&(z.s(),N(V))});return k.notifySubscribers(k.v()),z}return typeof Promise!="function"||w?I(w.bind(D)):new Promise(I)},m.b("when",m.Wd),function(){m.w={M:function(_){switch(m.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?m.a.g.get(_,m.c.options.$b):7>=m.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,w,D){switch(m.a.R(_)){case"option":typeof w=="string"?(m.a.g.set(_,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=w):(m.a.g.set(_,m.c.options.$b,w),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof w=="number"?w:"");break;case"select":(w===""||w===null)&&(w=e);for(var I=-1,N=0,k=_.options.length,z;N<k;++N)if(z=m.w.M(_.options[N]),z==w||z===""&&w===e){I=N;break}(D||0<=I||w===e&&1<_.size)&&(_.selectedIndex=I,m.a.W===6&&m.a.setTimeout(function(){_.selectedIndex=I},0));break;default:(w===null||w===e)&&(w=""),_.value=w}}}}(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=function(){function _(V){V=m.a.Db(V),V.charCodeAt(0)===123&&(V=V.slice(1,-1)),V+=` ,`;var j=[],U=V.match(I),q,Y=[],te=0;if(1<U.length){for(var K=0,Z;Z=U[K];++K){var ee=Z.charCodeAt(0);if(ee===44){if(0>=te){j.push(q&&Y.length?{key:q,value:Y.join("")}:{unknown:q||Y.join("")}),q=te=0,Y=[];continue}}else if(ee===58){if(!te&&!q&&Y.length===1){q=Y.pop();continue}}else{if(ee===47&&1<Z.length&&(Z.charCodeAt(1)===47||Z.charCodeAt(1)===42))continue;ee===47&&K&&1<Z.length?(ee=U[K-1].match(N))&&!k[ee[0]]&&(V=V.substr(V.indexOf(Z)+1),U=V.match(I),K=-1,Z="/"):ee===40||ee===123||ee===91?++te:ee===41||ee===125||ee===93?--te:q||Y.length||ee!==34&&ee!==39||(Z=Z.slice(1,-1))}Y.push(Z)}if(0<te)throw Error("Unbalanced parentheses, braces, or brackets")}return j}var w=["true","false","null","undefined"],D=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* |/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),N=/[\])"'A-Za-z0-9_$]+$/,k={in:1,return:1,typeof:1},z={};return{Ra:[],wa:z,ac:_,vb:function(V,j){function U(ee,me){var Te;if(!K){var ue=m.getBindingHandler(ee);if(ue&&ue.preprocess&&!(me=ue.preprocess(me,ee,U)))return;(ue=z[ee])&&(Te=me,0<=m.a.A(w,Te)?Te=!1:(ue=Te.match(D),Te=ue===null?!1:ue[1]?"Object("+ue[1]+")"+ue[2]:Te),ue=Te),ue&&Y.push("'"+(typeof z[ee]=="string"?z[ee]:ee)+"':function(_z){"+Te+"=_z}")}te&&(me="function(){return "+me+" }"),q.push("'"+ee+"':"+me)}j=j||{};var q=[],Y=[],te=j.valueAccessors,K=j.bindingParams,Z=typeof V=="string"?_(V):V;return m.a.D(Z,function(ee){U(ee.key||ee.unknown,ee.value)}),Y.length&&U("_ko_property_writers","{"+Y.join(",")+" }"),q.join(",")},Id:function(V,j){for(var U=0;U<V.length;U++)if(V[U].key==j)return!0;return!1},eb:function(V,j,U,q,Y){V&&m.O(V)?!m.Za(V)||Y&&V.v()===q||V(q):(V=j.get("_ko_property_writers"))&&V[U]&&V[U](q)}}}(),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 _(U){return U.nodeType==8&&k.test(N?U.text:U.nodeValue)}function w(U){return U.nodeType==8&&z.test(N?U.text:U.nodeValue)}function D(U,q){for(var Y=U,te=1,K=[];Y=Y.nextSibling;){if(w(Y)&&(m.a.g.set(Y,j,!0),te--,te===0))return K;K.push(Y),_(Y)&&te++}if(!q)throw Error("Cannot find closing comment tag to match: "+U.nodeValue);return null}function I(U,q){var Y=D(U,q);return Y?0<Y.length?Y[Y.length-1].nextSibling:U.nextSibling:null}var N=n&&n.createComment("test").text==="<!--test-->",k=N?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,z=N?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,V={ul:!0,ol:!0},j="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(U){return _(U)?D(U):U.childNodes},Ea:function(U){if(_(U)){U=m.h.childNodes(U);for(var q=0,Y=U.length;q<Y;q++)m.removeNode(U[q])}else m.a.Tb(U)},va:function(U,q){if(_(U)){m.h.Ea(U);for(var Y=U.nextSibling,te=0,K=q.length;te<K;te++)Y.parentNode.insertBefore(q[te],Y)}else m.a.va(U,q)},Vc:function(U,q){var Y;_(U)?(Y=U.nextSibling,U=U.parentNode):Y=U.firstChild,Y?q!==Y&&U.insertBefore(q,Y):U.appendChild(q)},Wb:function(U,q,Y){Y?(Y=Y.nextSibling,_(U)&&(U=U.parentNode),Y?q!==Y&&U.insertBefore(q,Y):U.appendChild(q)):m.h.Vc(U,q)},firstChild:function(U){if(_(U))return!U.nextSibling||w(U.nextSibling)?null:U.nextSibling;if(U.firstChild&&w(U.firstChild))throw Error("Found invalid end comment, as the first child of "+U);return U.firstChild},nextSibling:function(U){if(_(U)&&(U=I(U)),U.nextSibling&&w(U.nextSibling)){var q=U.nextSibling;if(w(q)&&!m.a.g.get(q,j))throw Error("Found end comment without a matching opening comment, as child of "+U);return null}return U.nextSibling},Cd:_,Vd:function(U){return(U=(N?U.text:U.nodeValue).match(k))?U[1]:null},Sc:function(U){if(V[m.a.R(U)]){var q=U.firstChild;if(q)do if(q.nodeType===1){var Y;Y=q.firstChild;var te=null;if(Y)do if(te)te.push(Y);else if(_(Y)){var K=I(Y,!0);K?Y=K:te=[Y]}else w(Y)&&(te=[Y]);while(Y=Y.nextSibling);if(Y=te)for(te=q.nextSibling,K=0;K<Y.length;K++)te?U.insertBefore(Y[K],te):U.appendChild(Y[K])}while(q=q.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(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(_);case 8:return m.h.Cd(_);default:return!1}},getBindings:function(_,w){var D=this.getBindingsString(_,w),D=D?this.parseBindingsString(D,w,_):null;return m.j.tc(D,_,w,!1)},getBindingAccessors:function(_,w){var D=this.getBindingsString(_,w),D=D?this.parseBindingsString(D,w,_,{valueAccessors:!0}):null;return m.j.tc(D,_,w,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return m.h.Vd(_);default:return null}},parseBindingsString:function(_,w,D,I){try{var N=this.nd,k=_+(I&&I.valueAccessors||""),z;if(!(z=N[k])){var V,j="with($context){with($data||{}){return{"+m.m.vb(_,I)+"}}}";V=new Function("$context","$element",j),z=N[k]=V}return z(w,D)}catch(U){throw U.message=`Unable to parse bindings. Bindings value: `+_+` Message: `+U.message,U}}}),m.ga.instance=new m.ga}(),m.b("bindingProvider",m.ga),function(){function _(ue){var ye=(ue=m.a.g.get(ue,Te))&&ue.N;ye&&(ue.N=null,ye.Tc())}function w(ue,ye,Ae){this.node=ue,this.yc=ye,this.kb=[],this.H=!1,ye.N||m.a.K.za(ue,_),Ae&&Ae.N&&(Ae.N.kb.push(ue),this.Kb=Ae)}function D(ue){return function(){return ue}}function I(ue){return ue()}function N(ue){return m.a.Ga(m.u.G(ue),function(ye,Ae){return function(){return ue()[Ae]}})}function k(ue,ye,Ae){return typeof ue=="function"?N(ue.bind(null,ye,Ae)):m.a.Ga(ue,D)}function z(ue,ye){return N(this.getBindings.bind(this,ue,ye))}function V(ue,ye){var Ae=m.h.firstChild(ye);if(Ae){var Pe,Ee=m.ga.instance,ze=Ee.preprocessNode;if(ze){for(;Pe=Ae;)Ae=m.h.nextSibling(Pe),ze.call(Ee,Pe);Ae=m.h.firstChild(ye)}for(;Pe=Ae;)Ae=m.h.nextSibling(Pe),j(ue,Pe)}m.i.ma(ye,m.i.H)}function j(ue,ye){var Ae=ue,Pe=ye.nodeType===1;Pe&&m.h.Sc(ye),(Pe||m.ga.instance.nodeHasBindings(ye))&&(Ae=q(ye,null,ue).bindingContextForDescendants),Ae&&!ee[m.a.R(ye)]&&V(Ae,ye)}function U(ue){var ye=[],Ae={},Pe=[];return m.a.P(ue,function Ee(ze){if(!Ae[ze]){var qe=m.getBindingHandler(ze);qe&&(qe.after&&(Pe.push(ze),m.a.D(qe.after,function(it){if(ue[it]){if(m.a.A(Pe,it)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Pe.join(", "));Ee(it)}}),Pe.length--),ye.push({key:ze,Mc:qe})),Ae[ze]=!0}}),ye}function q(ue,ye,Ae){var Pe=m.a.g.Ub(ue,Te,{}),Ee=Pe.hd;if(!ye){if(Ee)throw Error("You cannot apply bindings multiple times to the same element.");Pe.hd=!0}Ee||(Pe.context=Ae),Pe.Zb||(Pe.Zb={});var ze;if(ye&&typeof ye!="function")ze=ye;else{var qe=m.ga.instance,it=qe.getBindingAccessors||z,Dt=m.$(function(){return(ze=ye?ye(Ae,ue):it.call(qe,ue,Ae))&&(Ae[te]&&Ae[te](),Ae[Z]&&Ae[Z]()),ze},null,{l:ue});ze&&Dt.ja()||(Dt=null)}var jt=Ae,$e;if(ze){var un=function(){return m.a.Ga(Dt?Dt():ze,I)},zt=Dt?function(Ct){return function(){return I(Dt()[Ct])}}:function(Ct){return ze[Ct]};un.get=function(Ct){return ze[Ct]&&I(zt(Ct))},un.has=function(Ct){return Ct in ze},m.i.H in ze&&m.i.subscribe(ue,m.i.H,function(){var Ct=(0,ze[m.i.H])();if(Ct){var Ei=m.h.childNodes(ue);Ei.length&&Ct(Ei,m.Ec(Ei[0]))}}),m.i.pa in ze&&(jt=m.i.Cb(ue,Ae),m.i.subscribe(ue,m.i.pa,function(){var Ct=(0,ze[m.i.pa])();Ct&&m.h.firstChild(ue)&&Ct(ue)})),Pe=U(ze),m.a.D(Pe,function(Ct){var Ei=Ct.Mc.init,an=Ct.Mc.update,_e=Ct.key;if(ue.nodeType===8&&!m.h.ea[_e])throw Error("The binding '"+_e+"' cannot be used with virtual elements");try{typeof Ei=="function"&&m.u.G(function(){var Ce=Ei(ue,zt(_e),un,jt.$data,jt);if(Ce&&Ce.controlsDescendantBindings){if($e!==e)throw Error("Multiple bindings ("+$e+" and "+_e+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");$e=_e}}),typeof an=="function"&&m.$(function(){an(ue,zt(_e),un,jt.$data,jt)},null,{l:ue})}catch(Ce){throw Ce.message='Unable to process binding "'+_e+": "+ze[_e]+`" Message: `+Ce.message,Ce}})}return Pe=$e===e,{shouldBindDescendants:Pe,bindingContextForDescendants:Pe&&jt}}function Y(ue,ye){return ue&&ue instanceof m.fa?ue:new m.fa(ue,e,e,ye)}var te=m.a.Da("_subscribable"),K=m.a.Da("_ancestorBindingInfo"),Z=m.a.Da("_dataDependency");m.c={};var ee={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(ue){return m.c[ue]};var me={};m.fa=function(ue,ye,Ae,Pe,Ee){function ze(){var zt=jt?Dt():Dt,Ct=m.a.f(zt);return ye?(m.a.extend(qe,ye),K in ye&&(qe[K]=ye[K])):(qe.$parents=[],qe.$root=Ct,qe.ko=m),qe[te]=$e,it?Ct=qe.$data:(qe.$rawData=zt,qe.$data=Ct),Ae&&(qe[Ae]=Ct),Pe&&Pe(qe,ye,Ct),ye&&ye[te]&&!m.S.o().Vb(ye[te])&&ye[te](),un&&(qe[Z]=un),qe.$data}var qe=this,it=ue===me,Dt=it?e:ue,jt=typeof Dt=="function"&&!m.O(Dt),$e,un=Ee&&Ee.dataDependency;Ee&&Ee.exportDependencies?ze():($e=m.xb(ze),$e.v(),$e.ja()?$e.equalityComparer=null:qe[te]=e)},m.fa.prototype.createChildContext=function(ue,ye,Ae,Pe){if(!Pe&&ye&&typeof ye=="object"&&(Pe=ye,ye=Pe.as,Ae=Pe.extend),ye&&Pe&&Pe.noChildContext){var Ee=typeof ue=="function"&&!m.O(ue);return new m.fa(me,this,null,function(ze){Ae&&Ae(ze),ze[ye]=Ee?ue():ue},Pe)}return new m.fa(ue,this,ye,function(ze,qe){ze.$parentContext=qe,ze.$parent=qe.$data,ze.$parents=(qe.$parents||[]).slice(0),ze.$parents.unshift(ze.$parent),Ae&&Ae(ze)},Pe)},m.fa.prototype.extend=function(ue,ye){return new m.fa(me,this,null,function(Ae){m.a.extend(Ae,typeof ue=="function"?ue(Ae):ue)},ye)};var Te=m.a.g.Z();w.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},w.prototype.sd=function(ue){m.a.Pa(this.kb,ue),!this.kb.length&&this.H&&this.Cc()},w.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ue,ye,Ae,Pe,Ee){var ze=m.a.g.Ub(ue,Te,{});return ze.Fa||(ze.Fa=new m.T),Ee&&Ee.notifyImmediately&&ze.Zb[ye]&&m.u.G(Ae,Pe,[ue]),ze.Fa.subscribe(Ae,Pe,ye)},ma:function(ue,ye){var Ae=m.a.g.get(ue,Te);if(Ae&&(Ae.Zb[ye]=!0,Ae.Fa&&Ae.Fa.notifySubscribers(ue,ye),ye==m.i.H)){if(Ae.N)Ae.N.Cc();else if(Ae.N===e&&Ae.Fa&&Ae.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ue,ye){var Ae=m.a.g.Ub(ue,Te,{});return Ae.N||(Ae.N=new w(ue,Ae,ye[K])),ye[K]==Ae?ye:ye.extend(function(Pe){Pe[K]=Ae})}},m.Td=function(ue){return(ue=m.a.g.get(ue,Te))&&ue.context},m.ib=function(ue,ye,Ae){return ue.nodeType===1&&m.h.Sc(ue),q(ue,ye,Y(Ae))},m.ld=function(ue,ye,Ae){return Ae=Y(Ae),m.ib(ue,k(ye,Ae,ue),Ae)},m.Oa=function(ue,ye){ye.nodeType!==1&&ye.nodeType!==8||V(Y(ue),ye)},m.vc=function(ue,ye,Ae){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");j(Y(ue,Ae),ye)},m.Dc=function(ue){return!ue||ue.nodeType!==1&&ue.nodeType!==8?e:m.Td(ue)},m.Ec=function(ue){return(ue=m.Dc(ue))?ue.$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(_){function w(z,V){var j=Object.prototype.hasOwnProperty.call(N,z)?N[z]:_,U;j?j.subscribe(V):(j=N[z]=new m.T,j.subscribe(V),D(z,function(q,Y){var te=!(!Y||!Y.synchronous);k[z]={definition:q,Gd:te},delete N[z],U||te?j.notifySubscribers(q):m.na.zb(function(){j.notifySubscribers(q)})}),U=!0)}function D(z,V){I("getConfig",[z],function(j){j?I("loadComponent",[z,j],function(U){V(U,j)}):V(null,null)})}function I(z,V,j,U){U||(U=m.j.loaders.slice(0));var q=U.shift();if(q){var Y=q[z];if(Y){var te=!1;if(Y.apply(q,V.concat(function(K){te?j(null):K!==null?j(K):I(z,V,j,U)}))!==_&&(te=!0,!q.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(z,V,j,U)}else j(null)}var N={},k={};m.j={get:function(z,V){var j=Object.prototype.hasOwnProperty.call(k,z)?k[z]:_;j?j.Gd?m.u.G(function(){V(j.definition)}):m.na.zb(function(){V(j.definition)}):w(z,V)},Bc:function(z){delete k[z]},oc:I},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)}(),function(){function _(j,U,q,Y){function te(){--Z===0&&Y(K)}var K={},Z=2,ee=q.template;q=q.viewModel,ee?N(U,ee,function(me){m.j.oc("loadTemplate",[j,me],function(Te){K.template=Te,te()})}):te(),q?N(U,q,function(me){m.j.oc("loadViewModel",[j,me],function(Te){K[V]=Te,te()})}):te()}function w(j,U,q){if(typeof U=="function")q(function(te){return new U(te)});else if(typeof U[V]=="function")q(U[V]);else if("instance"in U){var Y=U.instance;q(function(){return Y})}else"viewModel"in U?w(j,U.viewModel,q):j("Unknown viewModel value: "+U)}function D(j){switch(m.a.R(j)){case"script":return m.a.ua(j.text);case"textarea":return m.a.ua(j.value);case"template":if(I(j.content))return m.a.Ca(j.content.childNodes)}return m.a.Ca(j.childNodes)}function I(j){return t.DocumentFragment?j instanceof DocumentFragment:j&&j.nodeType===11}function N(j,U,q){typeof U.require=="string"?a||t.require?(a||t.require)([U.require],function(Y){Y&&typeof Y=="object"&&Y.Xd&&Y.default&&(Y=Y.default),q(Y)}):j("Uses require, but no AMD loader is present"):q(U)}function k(j){return function(U){throw Error("Component '"+j+"': "+U)}}var z={};m.j.register=function(j,U){if(!U)throw Error("Invalid configuration for "+j);if(m.j.tb(j))throw Error("Component "+j+" is already registered");z[j]=U},m.j.tb=function(j){return Object.prototype.hasOwnProperty.call(z,j)},m.j.unregister=function(j){delete z[j],m.j.Bc(j)},m.j.Fc={getConfig:function(j,U){U(m.j.tb(j)?z[j]:null)},loadComponent:function(j,U,q){var Y=k(j);N(Y,U,function(te){_(j,Y,te,q)})},loadTemplate:function(j,U,q){if(j=k(j),typeof U=="string")q(m.a.ua(U));else if(U instanceof Array)q(U);else if(I(U))q(m.a.la(U.childNodes));else if(U.element)if(U=U.element,t.HTMLElement?U instanceof HTMLElement:U&&U.tagName&&U.nodeType===1)q(D(U));else if(typeof U=="string"){var Y=n.getElementById(U);Y?q(D(Y)):j("Cannot find element with ID "+U)}else j("Unknown element type: "+U);else j("Unknown template value: "+U)},loadViewModel:function(j,U,q){w(k(j),U,q)}};var V="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=z}(),function(){function _(D,I){var N=D.getAttribute("params");if(N){var N=w.parseBindingsString(N,I,D,{valueAccessors:!0,bindingParams:!0}),N=m.a.Ga(N,function(V){return m.o(V,null,{l:D})}),k=m.a.Ga(N,function(V){var j=V.v();return V.ja()?m.o({read:function(){return m.a.f(V())},write:m.Za(j)&&function(U){V()(U)},l:D}):j});return Object.prototype.hasOwnProperty.call(k,"$raw")||(k.$raw=N),k}return{$raw:{}}}m.j.getComponentNameForNode=function(D){var I=m.a.R(D);if(m.j.tb(I)&&(I.indexOf("-")!=-1||""+D=="[object HTMLUnknownElement]"||8>=m.a.W&&D.tagName===I))return I},m.j.tc=function(D,I,N,k){if(I.nodeType===1){var z=m.j.getComponentNameForNode(I);if(z){if(D=D||{},D.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var V={name:z,params:_(I,N)};D.component=k?function(){return V}:V}}return D};var w=new m.ga;9>m.a.W&&(m.j.register=function(D){return function(I){return D.apply(this,arguments)}}(m.j.register),n.createDocumentFragment=function(D){return function(){var I=D(),N=m.j.dd,k;for(k in N);return I}}(n.createDocumentFragment))}(),function(){function _(I,N,k){if(N=N.template,!N)throw Error("Component '"+I+"' has no template");I=m.a.Ca(N),m.h.va(k,I)}function w(I,N,k){var z=I.createViewModel;return z?z.call(I,N,k):N}var D=0;m.c.component={init:function(I,N,k,z,V){function j(){var K=U&&U.dispose;typeof K=="function"&&K.call(U),Y&&Y.s(),q=U=Y=null}var U,q,Y,te=m.a.la(m.h.childNodes(I));return m.h.Ea(I),m.a.K.za(I,j),m.o(function(){var K=m.a.f(N()),Z,ee;if(typeof K=="string"?Z=K:(Z=m.a.f(K.name),ee=m.a.f(K.params)),!Z)throw Error("No component name specified");var me=m.i.Cb(I,V),Te=q=++D;m.j.get(Z,function(ue){if(q===Te){if(j(),!ue)throw Error("Unknown component '"+Z+"'");_(Z,ue,I);var ye=w(ue,ee,{element:I,templateNodes:te});ue=me.createChildContext(ye,{extend:function(Ae){Ae.$component=ye,Ae.$componentTemplateNodes=te}}),ye&&ye.koDescendantsComplete&&(Y=m.i.subscribe(I,m.i.pa,ye.koDescendantsComplete,ye)),U=ye,m.Oa(ue,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0}();var L={class:"className",for:"htmlFor"};m.c.attr={update:function(_,w){var D=m.a.f(w())||{};m.a.P(D,function(I,N){N=m.a.f(N);var k=I.indexOf(":"),k="lookupNamespaceURI"in _&&0<k&&_.lookupNamespaceURI(I.substr(0,k)),z=N===!1||N===null||N===e;z?k?_.removeAttributeNS(k,I):_.removeAttribute(I):N=N.toString(),8>=m.a.W&&I in L?(I=L[I],z?_.removeAttribute(I):_[I]=N):z||(k?_.setAttributeNS(k,I,N):_.setAttribute(I,N)),I==="name"&&m.a.Yc(_,z?"":N)})}},function(){m.c.checked={after:["value","attr"],init:function(_,w,D){function I(){var K=_.checked,Z=k();if(!m.S.Ya()&&(K||!V&&!m.S.qa())){var ee=m.u.G(w);if(U){var me=q?ee.v():ee,Te=te;te=Z,Te!==Z?K&&(m.a.Na(me,Z,!0),m.a.Na(me,Te,!1)):m.a.Na(me,Z,K),q&&m.Za(ee)&&ee(me)}else z&&(Z===e?Z=K:K||(Z=e)),m.m.eb(ee,D,"checked",Z,!0)}}function N(){var K=m.a.f(w()),Z=k();U?(_.checked=0<=m.a.A(K,Z),te=Z):_.checked=z&&Z===e?!!K:k()===K}var k=m.xb(function(){if(D.has("checkedValue"))return m.a.f(D.get("checkedValue"));if(Y)return D.has("value")?m.a.f(D.get("value")):_.value}),z=_.type=="checkbox",V=_.type=="radio";if(z||V){var j=w(),U=z&&m.a.f(j)instanceof Array,q=!(U&&j.push&&j.splice),Y=V||U,te=U?k():e;V&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(I,null,{l:_}),m.a.B(_,"click",I),m.o(N,null,{l:_}),j=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,w){_.value=m.a.f(w())}}}(),m.c.class={update:function(_,w){var D=m.a.Db(m.a.f(w()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=D,m.a.Eb(_,D,!0)}},m.c.css={update:function(_,w){var D=m.a.f(w());D!==null&&typeof D=="object"?m.a.P(D,function(I,N){N=m.a.f(N),m.a.Eb(_,I,N)}):m.c.class.update(_,w)}},m.c.enable={update:function(_,w){var D=m.a.f(w());D&&_.disabled?_.removeAttribute("disabled"):D||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,w){m.c.enable.update(_,function(){return!m.a.f(w())})}},m.c.event={init:function(_,w,D,I,N){var k=w()||{};m.a.P(k,function(z){typeof z=="string"&&m.a.B(_,z,function(V){var j,U=w()[z];if(U){try{var q=m.a.la(arguments);I=N.$data,q.unshift(I),j=U.apply(I,q)}finally{j!==!0&&(V.preventDefault?V.preventDefault():V.returnValue=!1)}D.get(z+"Bubble")===!1&&(V.cancelBubble=!0,V.stopPropagation&&V.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var w=_(),D=m.a.bc(w);return!D||typeof D.length=="number"?{foreach:w,templateEngine:m.ba.Ma}:(m.a.f(w),{foreach:D.data,as:D.as,noChildContext:D.noChildContext,includeDestroyed:D.includeDestroyed,afterAdd:D.afterAdd,beforeRemove:D.beforeRemove,afterRender:D.afterRender,beforeMove:D.beforeMove,afterMove:D.afterMove,templateEngine:m.ba.Ma})}},init:function(_,w){return m.c.template.init(_,m.c.foreach.Rc(w))},update:function(_,w,D,I,N){return m.c.template.update(_,m.c.foreach.Rc(w),D,I,N)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,w,D){function I(z){_.__ko_hasfocusUpdating=!0;var V=_.ownerDocument;if("activeElement"in V){var j;try{j=V.activeElement}catch{j=V.body}z=j===_}V=w(),m.m.eb(V,D,"hasfocus",z,!0),_.__ko_hasfocusLastValue=z,_.__ko_hasfocusUpdating=!1}var N=I.bind(null,!0),k=I.bind(null,!1);m.a.B(_,"focus",N),m.a.B(_,"focusin",N),m.a.B(_,"blur",k),m.a.B(_,"focusout",k),_.__ko_hasfocusLastValue=!1},update:function(_,w){var D=!!m.a.f(w());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===D||(D?_.focus():_.blur(),!D&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,D?"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(_,w){m.a.fc(_,w())}},function(){function _(w,D,I){m.c[w]={init:function(N,k,z,V,j){var U,q,Y={},te,K,Z;if(D){V=z.get("as");var ee=z.get("noChildContext");Z=!(V&&ee),Y={as:V,noChildContext:ee,exportDependencies:Z}}return K=(te=z.get("completeOn")=="render")||z.has(m.i.pa),m.o(function(){var me=m.a.f(k()),Te=!I!=!me,ue=!q,ye;(Z||Te!==U)&&(K&&(j=m.i.Cb(N,j)),Te&&((!D||Z)&&(Y.dataDependency=m.S.o()),ye=D?j.createChildContext(typeof me=="function"?me:k,Y):m.S.qa()?j.extend(null,Y):j),ue&&m.S.qa()&&(q=m.a.Ca(m.h.childNodes(N),!0)),Te?(ue||m.h.va(N,m.a.Ca(q)),m.Oa(ye,N)):(m.h.Ea(N),te||m.i.ma(N,m.i.H)),U=Te)},null,{l:N}),{controlsDescendantBindings:!0}}},m.m.Ra[w]=!1,m.h.ea[w]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)}(),m.c.let={init:function(_,w,D,I,N){return w=N.extend(w),m.Oa(w,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var F={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,w,D){function I(){return m.a.jb(_.options,function(ee){return ee.selected})}function N(ee,me,Te){var ue=typeof me;return ue=="function"?me(ee):ue=="string"?ee[me]:Te}function k(ee,me){if(K&&U)m.i.ma(_,m.i.H);else if(te.length){var Te=0<=m.a.A(te,m.w.M(me[0]));m.a.Zc(me[0],Te),K&&!Te&&m.u.G(m.a.Fb,null,[_,"change"])}}var z=_.multiple,V=_.length!=0&&z?_.scrollTop:null,j=m.a.f(w()),U=D.get("valueAllowUnset")&&D.has("value"),q=D.get("optionsIncludeDestroyed");w={};var Y,te=[];U||(z?te=m.a.Mb(I(),m.w.M):0<=_.selectedIndex&&te.push(m.w.M(_.options[_.selectedIndex]))),j&&(typeof j.length>"u"&&(j=[j]),Y=m.a.jb(j,function(ee){return q||ee===e||ee===null||!m.a.f(ee._destroy)}),D.has("optionsCaption")&&(j=m.a.f(D.get("optionsCaption")),j!==null&&j!==e&&Y.unshift(F)));var K=!1;if(w.beforeRemove=function(ee){_.removeChild(ee)},j=k,D.has("optionsAfterRender")&&typeof D.get("optionsAfterRender")=="function"&&(j=function(ee,me){k(0,me),m.u.G(D.get("optionsAfterRender"),null,[me[0],ee!==F?ee:e])}),m.a.ec(_,Y,function(ee,me,Te){return Te.length&&(te=!U&&Te[0].selected?[m.w.M(Te[0])]:[],K=!0),me=_.ownerDocument.createElement("option"),ee===F?(m.a.Bb(me,D.get("optionsCaption")),m.w.cb(me,e)):(Te=N(ee,D.get("optionsValue"),ee),m.w.cb(me,m.a.f(Te)),ee=N(ee,D.get("optionsText"),Te),m.a.Bb(me,ee)),[me]},w,j),!U){var Z;z?Z=te.length&&I().length<te.length:Z=te.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==te[0]:te.length||0<=_.selectedIndex,Z&&m.u.G(m.a.Fb,null,[_,"change"])}(U||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),V&&20<Math.abs(V-_.scrollTop)&&(_.scrollTop=V)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,w,D){function I(){var z=w(),V=[];m.a.D(_.getElementsByTagName("option"),function(j){j.selected&&V.push(m.w.M(j))}),m.m.eb(z,D,"selectedOptions",V)}function N(){var z=m.a.f(w()),V=_.scrollTop;z&&typeof z.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(j){var U=0<=m.a.A(z,m.w.M(j));j.selected!=U&&m.a.Zc(j,U)}),_.scrollTop=V}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var k;m.i.subscribe(_,m.i.H,function(){k?I():(m.a.B(_,"change",I),k=m.o(N,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,w){var D=m.a.f(w()||{});m.a.P(D,function(I,N){if(N=m.a.f(N),(N===null||N===e||N===!1)&&(N=""),o)o(_).css(I,N);else if(/^--/.test(I))_.style.setProperty(I,N);else{I=I.replace(/-(\w)/g,function(z,V){return V.toUpperCase()});var k=_.style[I];_.style[I]=N,N===k||_.style[I]!=k||isNaN(N)||(_.style[I]=N+"px")}})}},m.c.submit={init:function(_,w,D,I,N){if(typeof w()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(k){var z,V=w();try{z=V.call(N.$data,_)}finally{z!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,w){m.a.Bb(_,w())}},m.h.ea.text=!0,function(){if(t&&t.navigator){var _=function(Y){if(Y)return parseFloat(Y[1])},w=t.navigator.userAgent,D,I,N,k,z;(D=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(z=_(w.match(/Edge\/([^ ]+)$/)))||_(w.match(/Chrome\/([^ ]+)/))||(I=_(w.match(/Version\/([^ ]+) Safari/)))||(N=_(w.match(/Firefox\/([^ ]+)/)))||(k=m.a.W||_(w.match(/MSIE ([^ ]+)/)))||(k=_(w.match(/rv:([^ )]+)/)))}if(8<=k&&10>k)var V=m.a.g.Z(),j=m.a.g.Z(),U=function(Y){var te=this.activeElement;(te=te&&m.a.g.get(te,j))&&te(Y)},q=function(Y,te){var K=Y.ownerDocument;m.a.g.get(K,V)||(m.a.g.set(K,V,!0),m.a.B(K,"selectionchange",U)),m.a.g.set(Y,j,te)};m.c.textInput={init:function(Y,te,K){function Z(ze,qe){m.a.B(Y,ze,qe)}function ee(){var ze=m.a.f(te());(ze===null||ze===e)&&(ze=""),Ae!==e&&ze===Ae?m.a.setTimeout(ee,4):Y.value!==ze&&(Ee=!0,Y.value=ze,Ee=!1,ue=Y.value)}function me(){ye||(Ae=Y.value,ye=m.a.setTimeout(Te,4))}function Te(){clearTimeout(ye),Ae=ye=e;var ze=Y.value;ue!==ze&&(ue=ze,m.m.eb(te(),K,"textInput",ze))}var ue=Y.value,ye,Ae,Pe=m.a.W==9?me:Te,Ee=!1;k&&Z("keypress",Te),11>k&&Z("propertychange",function(ze){Ee||ze.propertyName!=="value"||Pe(ze)}),k==8&&(Z("keyup",Te),Z("keydown",Te)),q&&(q(Y,Pe),Z("dragend",me)),(!k||9<=k)&&Z("input",Pe),5>I&&m.a.R(Y)==="textarea"?(Z("keydown",me),Z("paste",me),Z("cut",me)):11>D?Z("keydown",me):4>N?(Z("DOMAutoComplete",Te),Z("dragdrop",Te),Z("drop",Te)):z&&Y.type==="number"&&Z("keydown",me),Z("change",Te),Z("blur",Te),m.o(ee,null,{l:Y})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(Y,te,K){K("textInput",Y)}}}(),m.c.uniqueName={init:function(_,w){if(w()){var D="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,D)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,w,D,I,N){var k;return D.has("as")&&(k={as:D.get("as"),noChildContext:D.get("noChildContext")}),w=N.createChildContext(w,k),m.Oa(w,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,w,D){var I=m.a.R(_),N=I=="input";if(!N||_.type!="checkbox"&&_.type!="radio"){var k=[],z=D.get("valueUpdate"),V=!1,j=null;z&&(typeof z=="string"?k=[z]:k=m.a.wc(z),m.a.Pa(k,"change"));var U=function(){j=null,V=!1;var te=w(),K=m.w.M(_);m.m.eb(te,D,"value",K)};!m.a.W||!N||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(k,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){V=!0}),m.a.B(_,"focus",function(){V=!1}),m.a.B(_,"blur",function(){V&&U()})),m.a.D(k,function(te){var K=U;m.a.Ud(te,"after")&&(K=function(){j=m.w.M(_),m.a.setTimeout(U,0)},te=te.substring(5)),m.a.B(_,te,K)});var q;if(q=N&&_.type=="file"?function(){var te=m.a.f(w());te===null||te===e||te===""?_.value="":m.u.G(U)}:function(){var te=m.a.f(w()),K=m.w.M(_);j!==null&&te===j?m.a.setTimeout(q,0):(te!==K||K===e)&&(I==="select"?(K=D.get("valueAllowUnset"),m.w.cb(_,te,K),K||te===m.w.M(_)||m.u.G(U)):m.w.cb(_,te))},I==="select"){var Y;m.i.subscribe(_,m.i.H,function(){Y?D.get("valueAllowUnset")?q():U():(m.a.B(_,"change",U),Y=m.o(q,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",U),m.o(q,null,{l:_})}else m.ib(_,{checkedValue:w})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,w){var D=m.a.f(w()),I=_.style.display!="none";D&&!I?_.style.display="":!D&&I&&(_.style.display="none")}},m.c.hidden={update:function(_,w){m.c.visible.update(_,function(){return!m.a.f(w())})}},function(_){m.c[_]={init:function(w,D,I,N,k){return m.c.event.init.call(this,w,function(){var z={};return z[_]=D(),z},I,N,k)}}}("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(_,w){if(typeof _=="string"){w=w||n;var D=w.getElementById(_);if(!D)throw Error("Cannot find template with ID "+_);return new m.C.F(D)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,w,D,I){return _=this.makeTemplateSource(_,I),this.renderTemplateSource(_,w,D,I)},m.ca.prototype.isTemplateRewritten=function(_,w){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,w).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,w,D){_=this.makeTemplateSource(_,D),w=w(_.text()),_.text(w),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=function(){function _(I,N,k,z){I=m.m.ac(I);for(var V=m.m.Ra,j=0;j<I.length;j++){var U=I[j].key;if(Object.prototype.hasOwnProperty.call(V,U)){var q=V[U];if(typeof q=="function"){if(U=q(I[j].value))throw Error(U)}else if(!q)throw Error("This template engine does not support the '"+U+"' binding within its templates")}}return k="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(I,{valueAccessors:!0})+" } })()},'"+k.toLowerCase()+"')",z.createJavaScriptEvaluatorBlock(k)+N}var w=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,D=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,N,k){N.isTemplateRewritten(I,k)||N.rewriteTemplate(I,function(z){return m.kc.Ld(z,N)},k)},Ld:function(I,N){return I.replace(w,function(k,z,V,j,U){return _(U,z,V,N)}).replace(D,function(k,z){return _(z,"<!-- ko -->","#comment",N)})},md:function(I,N){return m.aa.Xb(function(k,z){var V=k.nextSibling;V&&V.nodeName.toLowerCase()===N&&m.ib(V,I,z)})}}}(),m.b("__tr_ambtns",m.kc.md),function(){m.C={},m.C.F=function(D){if(this.F=D){var I=m.a.R(D);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&D.content&&D.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var D=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[D];var I=arguments[0];D==="innerHTML"?m.a.fc(this.F,I):this.F[D]=I};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(D){if(arguments.length===1)return m.a.g.get(this.F,_+D);m.a.g.set(this.F,_+D,arguments[1])};var w=m.a.g.Z();m.C.F.prototype.nodes=function(){var D=this.F;if(arguments.length==0){var I=m.a.g.get(D,w)||{},N=I.lb||(this.ab===3?D.content:this.ab===4?D:e);if(!N||I.jd){var k=this.text();k&&k!==I.bb&&(N=m.a.Md(k,D.ownerDocument),m.a.g.set(D,w,{lb:N,bb:k,jd:!0}))}return N}I=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(D,w,{lb:I})},m.C.ia=function(D){this.F=D},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 D=m.a.g.get(this.F,w)||{};return D.bb===e&&D.lb&&(D.bb=D.lb.innerHTML),D.bb}m.a.g.set(this.F,w,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)}(),function(){function _(j,U,q){var Y;for(U=m.h.nextSibling(U);j&&(Y=j)!==U;)j=m.h.nextSibling(Y),q(Y,j)}function w(j,U){if(j.length){var q=j[0],Y=j[j.length-1],te=q.parentNode,K=m.ga.instance,Z=K.preprocessNode;if(Z){if(_(q,Y,function(ee,me){var Te=ee.previousSibling,ue=Z.call(K,ee);ue&&(ee===q&&(q=ue[0]||me),ee===Y&&(Y=ue[ue.length-1]||Te))}),j.length=0,!q)return;q===Y?j.push(q):(j.push(q,Y),m.a.Ua(j,te))}_(q,Y,function(ee){ee.nodeType!==1&&ee.nodeType!==8||m.vc(U,ee)}),_(q,Y,function(ee){ee.nodeType!==1&&ee.nodeType!==8||m.aa.cd(ee,[U])}),m.a.Ua(j,te)}}function D(j){return j.nodeType?j:0<j.length?j[0]:null}function I(j,U,q,Y,te){te=te||{};var K=(j&&D(j)||q||{}).ownerDocument,Z=te.templateEngine||k;if(m.kc.xd(q,Z,K),q=Z.renderTemplate(q,Y,te,K),typeof q.length!="number"||0<q.length&&typeof q[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(K=!1,U){case"replaceChildren":m.h.va(j,q),K=!0;break;case"replaceNode":m.a.Xc(j,q),K=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+U)}return K&&(w(q,Y),te.afterRender&&m.u.G(te.afterRender,null,[q,Y[te.as||"$data"]]),U=="replaceChildren"&&m.i.ma(j,m.i.H)),q}function N(j,U,q){return m.O(j)?j():typeof j=="function"?j(U,q):j}var k;m.gc=function(j){if(j!=e&&!(j instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");k=j},m.dc=function(j,U,q,Y,te){if(q=q||{},(q.templateEngine||k)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",Y){var K=D(Y);return m.$(function(){var ee=U&&U instanceof m.fa?U:new m.fa(U,null,null,null,{exportDependencies:!0}),Z=N(j,ee.$data,ee),ee=I(Y,te,Z,ee,q);te=="replaceNode"&&(Y=ee,K=D(Y))},null,{Sa:function(){return!K||!m.a.Sb(K)},l:K&&te=="replaceNode"?K.parentNode:K})}return m.aa.Xb(function(Z){m.dc(j,U,q,Z,"replaceNode")})},m.Qd=function(j,U,q,Y,te){function K(Ae,Pe){m.u.G(m.a.ec,null,[Y,Ae,ee,q,Z,Pe]),m.i.ma(Y,m.i.H)}function Z(Ae,Pe){w(Pe,me),q.afterRender&&q.afterRender(Pe,Ae),me=null}function ee(Ae,Pe){me=te.createChildContext(Ae,{as:Te,noChildContext:q.noChildContext,extend:function(ze){ze.$index=Pe,Te&&(ze[Te+"Index"]=Pe)}});var Ee=N(j,Ae,me);return I(Y,"ignoreTargetNode",Ee,me,q)}var me,Te=q.as,ue=q.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!q.includeDestroyed;if(ue||q.beforeRemove||!m.Pc(U))return m.$(function(){var Ae=m.a.f(U)||[];typeof Ae.length>"u"&&(Ae=[Ae]),ue&&(Ae=m.a.jb(Ae,function(Pe){return Pe===e||Pe===null||!m.a.f(Pe._destroy)})),K(Ae)},null,{l:Y});K(U.v());var ye=U.subscribe(function(Ae){K(U(),Ae)},null,"arrayChange");return ye.l(Y),ye};var z=m.a.g.Z(),V=m.a.g.Z();m.c.template={init:function(j,U){var q=m.a.f(U());if(typeof q=="string"||"name"in q)m.h.Ea(j);else if("nodes"in q){if(q=q.nodes||[],m.O(q))throw Error('The "nodes" option must be a plain, non-observable array.');var Y=q[0]&&q[0].parentNode;Y&&m.a.g.get(Y,V)||(Y=m.a.Yb(q),m.a.g.set(Y,V,!0)),new m.C.ia(j).nodes(Y)}else if(q=m.h.childNodes(j),0<q.length)Y=m.a.Yb(q),new m.C.ia(j).nodes(Y);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(j,U,q,Y,te){var K=U();U=m.a.f(K),q=!0,Y=null,typeof U=="string"?U={}:(K="name"in U?U.name:j,"if"in U&&(q=m.a.f(U.if)),q&&"ifnot"in U&&(q=!m.a.f(U.ifnot)),q&&!K&&(q=!1)),"foreach"in U?Y=m.Qd(K,q&&U.foreach||[],U,j,te):q?(q=te,"data"in U&&(q=te.createChildContext(U.data,{as:U.as,noChildContext:U.noChildContext,exportDependencies:!0})),Y=m.dc(K,q,U,j)):m.h.Ea(j),te=Y,(U=m.a.g.get(j,z))&&typeof U.s=="function"&&U.s(),m.a.g.set(j,z,!te||te.ja&&!te.ja()?e:te)}},m.m.Ra.template=function(j){return j=m.m.ac(j),j.length==1&&j[0].unknown||m.m.Id(j,"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(_,w,D){if(_.length&&w.length){var I,N,k,z,V;for(I=N=0;(!D||I<D)&&(z=_[N]);++N){for(k=0;V=w[k];++k)if(z.value===V.value){z.moved=V.index,V.moved=z.index,w.splice(k,1),I=k=0;break}I+=k}}},m.a.Pb=function(){function _(w,D,I,N,k){var z=Math.min,V=Math.max,j=[],U,q=w.length,Y,te=D.length,K=te-q||1,Z=q+te+1,ee,me,Te;for(U=0;U<=q;U++)for(me=ee,j.push(ee=[]),Te=z(te,U+K),Y=V(0,U-1);Y<=Te;Y++)ee[Y]=Y?U?w[U-1]===D[Y-1]?me[Y-1]:z(me[Y]||Z,ee[Y-1]||Z)+1:Y+1:U+1;for(z=[],V=[],K=[],U=q,Y=te;U||Y;)te=j[U][Y]-1,Y&&te===j[U][Y-1]?V.push(z[z.length]={status:I,value:D[--Y],index:Y}):U&&te===j[U-1][Y]?K.push(z[z.length]={status:N,value:w[--U],index:U}):(--Y,--U,k.sparse||z.push({status:"retained",value:D[Y]}));return m.a.Kc(K,V,!k.dontLimitMoves&&10*q),z.reverse()}return function(w,D,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},w=w||[],D=D||[],w.length<D.length?_(w,D,"added","deleted",I):_(D,w,"deleted","added",I)}}(),m.b("utils.compareArrays",m.a.Pb),function(){function _(I,N,k,z,V){var j=[],U=m.$(function(){var q=N(k,V,m.a.Ua(j,I))||[];0<j.length&&(m.a.Xc(j,q),z&&m.u.G(z,null,[k,q,V])),j.length=0,m.a.Nb(j,q)},null,{l:I,Sa:function(){return!m.a.kd(j)}});return{Y:j,$:U.ja()?U:e}}var w=m.a.g.Z(),D=m.a.g.Z();m.a.ec=function(I,N,k,z,V,j){function U(Ct){Ee={Aa:Ct,pb:m.ta(me++)},Z.push(Ee),K||Pe.push(Ee)}function q(Ct){Ee=te[Ct],me!==Ee.pb.v()&&Ae.push(Ee),Ee.pb(me++),m.a.Ua(Ee.Y,I),Z.push(Ee)}function Y(Ct,Ei){if(Ct)for(var an=0,_e=Ei.length;an<_e;an++)m.a.D(Ei[an].Y,function(Ce){Ct(Ce,an,Ei[an].Aa)})}N=N||[],typeof N.length>"u"&&(N=[N]),z=z||{};var te=m.a.g.get(I,w),K=!te,Z=[],ee=0,me=0,Te=[],ue=[],ye=[],Ae=[],Pe=[],Ee,ze=0;if(K)m.a.D(N,U);else{if(!j||te&&te._countWaitingForRemove){var qe=m.a.Mb(te,function(Ct){return Ct.Aa});j=m.a.Pb(qe,N,{dontLimitMoves:z.dontLimitMoves,sparse:!0})}for(var qe=0,it,Dt,jt;it=j[qe];qe++)switch(Dt=it.moved,jt=it.index,it.status){case"deleted":for(;ee<jt;)q(ee++);Dt===e&&(Ee=te[ee],Ee.$&&(Ee.$.s(),Ee.$=e),m.a.Ua(Ee.Y,I).length&&(z.beforeRemove&&(Z.push(Ee),ze++,Ee.Aa===D?Ee=null:ye.push(Ee)),Ee&&Te.push.apply(Te,Ee.Y))),ee++;break;case"added":for(;me<jt;)q(ee++);Dt!==e?(ue.push(Z.length),q(Dt)):U(it.value)}for(;me<N.length;)q(ee++);Z._countWaitingForRemove=ze}m.a.g.set(I,w,Z),Y(z.beforeMove,Ae),m.a.D(Te,z.beforeRemove?m.oa:m.removeNode);var $e,un,zt;try{zt=I.ownerDocument.activeElement}catch{}if(ue.length)for(;(qe=ue.shift())!=e;){for(Ee=Z[qe],$e=e;qe;)if((un=Z[--qe].Y)&&un.length){$e=un[un.length-1];break}for(N=0;ee=Ee.Y[N];$e=ee,N++)m.h.Wb(I,ee,$e)}for(qe=0;Ee=Z[qe];qe++){for(Ee.Y||m.a.extend(Ee,_(I,k,Ee.Aa,V,Ee.pb)),N=0;ee=Ee.Y[N];$e=ee,N++)m.h.Wb(I,ee,$e);!Ee.Ed&&V&&(V(Ee.Aa,Ee.Y,Ee.pb),Ee.Ed=!0,$e=Ee.Y[Ee.Y.length-1])}for(zt&&I.ownerDocument.activeElement!=zt&&zt.focus(),Y(z.beforeRemove,ye),qe=0;qe<ye.length;++qe)ye[qe].Aa=D;Y(z.afterMove,Ae),Y(z.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(_,w,D,I){return(w=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(w.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,I))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),function(){m.$a=function(){var w=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(D,I,N,k){if(k=k||n,N=N||{},2>w)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var z=D.data("precompiled");return z||(z=D.text()||"",z=o.template(null,"{{ko_with $item.koBindingContext}}"+z+"{{/ko_with}}"),D.data("precompiled",z)),D=[I.$data],I=o.extend({koBindingContext:I},N.templateOptions),I=o.tmpl(z,D,I),I.appendTo(k.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(D){return"{{ko_code ((function() { return "+D+" })()) }}"},this.addTemplate=function(D,I){n.write("<script type='text/html' id='"+D+"'>"+I+"</script>")},0<w&&(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 _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)}()})})()})()})();var Owt=ko;typeof window<"u"?(ko=window.ko,typeof vk<"u"?window.ko=vk:delete window.ko):(ko=global.ko,typeof vk<"u"?global.ko=vk:delete global.ko);var GA=Owt;/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license */var FQ="__knockoutObservables",BQ="__knockoutSubscribable";function BEe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=kEe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===FQ||o===BQ)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&Mwt(n,a)}}),e}function kEe(e,t){var n=e[FQ];return!n&&t&&(n={},Object.defineProperty(e,FQ,{value:n})),n}function Rwt(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),BEe.call(i,e,[t]),e}function Mwt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=Lwt(e,t,i))})}function Lwt(e,t,n){var i=Nwt(e,n);return i.subscribe(t)}function Nwt(e,t){var n=t[BQ];if(!n){n=new e.subscribable,Object.defineProperty(t,BQ,{value:n});var i={};Fwt(t,n,i),Bwt(e,t,n,i)}return n}function Fwt(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 Bwt(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 UEe(e,t){if(!e)return null;var n=kEe(e,!1);return n&&n[t]||null}function kwt(e,t){var n=UEe(e,t);n&&n.valueHasMutated()}function Uwt(e){e.track=BEe,e.getObservable=UEe,e.valueHasMutated=kwt,e.defineProperty=Rwt}var Dk={attachToKo:Uwt};var VEe="http://www.w3.org/2000/svg",zEe="cesium-svgPath-svg",Vwt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(VEe,"svg:svg");i.setAttribute("class",zEe);let o=document.createElementNS(VEe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${zEe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},Pk=Vwt;Dk.attachToKo(GA);Pk.register(GA);var xe=GA;function Ik(e){c(e)||(e=new Ah),this._clock=e,this._eventHelper=new gr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=xe.observable(Q.now()),this.systemTime.equalityComparer=Q.equals,this.startTime=xe.observable(e.startTime),this.startTime.equalityComparer=Q.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=xe.observable(e.stopTime),this.stopTime.equalityComparer=Q.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=xe.observable(e.currentTime),this.currentTime.equalityComparer=Q.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(Ik.prototype,{clock:{get:function(){return this._clock}}});Ik.prototype.synchronize=function(){let e=this._clock;this.systemTime=Q.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};Ik.prototype.isDestroyed=function(){return!1};Ik.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var Ok=Ik;function zwt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,E.throwInstantiationError()}var kQ=zwt;function Hwt(e,t){if(!c(e))throw new E("func is required.");t=t??!0;let n=new pe,i=new pe;function o(){if(!o.canExecute)throw new E("Cannot execute command, canExecute is false.");let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,xe.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Sn=Hwt;var rv={};rv.createCheckbox=function(e,t,n){T.typeOf.string("labelText",e),T.typeOf.string("checkedBinding",t);let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return c(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};rv.createSection=function(e,t,n,i){T.defined("panel",e),T.typeOf.string("headerText",t),T.typeOf.string("sectionVisibleBinding",n),T.typeOf.string("toggleSectionVisibilityBinding",i);let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};rv.createRangeInput=function(e,t,n,i,o,r){T.typeOf.string("rangeText",e),T.typeOf.string("sliderValueBinding",t),T.typeOf.number("min",n),T.typeOf.number("max",i),r=r??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=o??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let l=document.createElement("div");l.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(l),u};rv.createRangeInputWithDynamicMinMax=function(e,t,n,i){T.typeOf.string("rangeText",e),T.typeOf.string("sliderValueBinding",t),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 s=document.createElement("div");s.appendChild(r);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(o),a.appendChild(s),a};rv.createButton=function(e,t,n){T.typeOf.string("buttonText",e),T.typeOf.string("clickedBinding",t);let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return c(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var fu=rv;function Gwt(e,t,n,i,o){return n.call(i,e[t]),xe.getObservable(e,t).subscribe(n,i,o)}var Da=Gwt;function HEe(e,t){if(!c(e))throw new E("command is required.");this._command=e,t=t??W.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",xe.track(this,["toggled","tooltip"])}Object.defineProperties(HEe.prototype,{command:{get:function(){return this._command}}});var Z0=HEe;var jA="http://www.w3.org/2000/svg",WEe="http://www.w3.org/1999/xlink",n5,Rk=G.fromCssColorString("rgba(247,250,255,0.384)"),i5=G.fromCssColorString("rgba(143,191,255,0.216)"),UQ=G.fromCssColorString("rgba(153,197,255,0.098)"),o5=G.fromCssColorString("rgba(255,255,255,0.086)"),jwt=G.fromCssColorString("rgba(255,255,255,0.267)"),Wwt=G.fromCssColorString("rgba(255,255,255,0)"),GEe=G.fromCssColorString("rgba(66,67,68,0.3)"),jEe=G.fromCssColorString("rgba(0,0,0,0.5)");function Q0(e){return G.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var Mk={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 em(e){let t=document.createElementNS(jA,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(em(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(WEe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function VQ(e,t,n){let i=document.createElementNS(jA,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(jA,"tspan");return o.textContent=n,i.appendChild(o),i}function qwt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var r5=new G;function fs(e,t){let n=t.alpha,i=1-n;return r5.red=e.red*i+t.red*n,r5.green=e.green*i+t.green*n,r5.blue=e.blue*i+t.blue*n,r5.toCssColorString()}function zQ(e,t,n){let i=Mk[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 em(o)}function Ywt(e,t,n){let i=Mk[n],o=Mk.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 em(r)}function Xwt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&n5!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),l,u;if(t.type==="touchstart"||t.type==="touchmove"?(l=t.touches[0].clientX,u=t.touches[0].clientY):(l=t.clientX,u=t.clientY),!i&&(l>a.right||l<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),h=l-o-a.left,p=u-r-a.top,g=Math.atan2(p,h)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||l<f.right&&l>f.left&&u>f.top&&u<f.bottom?(n5=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===n5&&(n5=void 0),n.shuttleRingDragging=!1}function Ng(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=[Da(t,"toggled",this.setToggled,this),Da(t,"tooltip",this.setTooltip,this),Da(t.command,"canExecute",this.setEnabled,this)]}Ng.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();de(this)};Ng.prototype.isDestroyed=function(){return!1};Ng.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")}};Ng.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")))};Ng.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function sv(e,t){if(!c(e))throw new E("container is required.");if(!c(t))throw new E("viewModel is required.");e=In(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(jA,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",WEe);let s=document.createElementNS(jA,"g");this._topG=s,this._realtimeSVG=new Ng(Ywt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Ng(zQ(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Ng(zQ(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Ng(zQ(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(jA,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let l=em({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=l;let u=Mk.animation_pathSwooshFX,f=Mk.animation_pathPointer,h=em({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=em({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=em({tagName:"g",transform:"translate(100,100)"});this._knobOuter=em({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=em({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=VQ(0,-24,""),this._knobTime=VQ(0,-7,""),this._knobStatus=VQ(0,-41,"");let y=em({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),b=document.createElementNS(jA,"g");b.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(b),s.appendChild(p),s.appendChild(a),b.appendChild(l),b.appendChild(h),b.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(y),r.appendChild(s),e.appendChild(r);let x=this;function A(M){Xwt(x,M)}this._mouseCallback=A,l.addEventListener("mousedown",A,!0),l.addEventListener("touchstart",A,!0),h.addEventListener("mousedown",A,!0),h.addEventListener("touchstart",A,!0),n.addEventListener("mousemove",A,!0),n.addEventListener("touchmove",A,!0),n.addEventListener("mouseup",A,!0),n.addEventListener("touchend",A,!0),n.addEventListener("touchcancel",A,!0),this._shuttleRingPointer.addEventListener("mousedown",A,!0),this._shuttleRingPointer.addEventListener("touchstart",A,!0),this._knobOuter.addEventListener("mousedown",A,!0),this._knobOuter.addEventListener("touchstart",A,!0);let C=this._knobTime.childNodes[0],S=this._knobDate.childNodes[0],v=this._knobStatus.childNodes[0],P;this._subscriptions=[Da(t.pauseViewModel,"toggled",function(M){P!==M&&(P=M,P?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Da(t,"shuttleRingAngle",function(M){qwt(x._shuttleRingPointer,x._knobOuter,M)}),Da(t,"dateLabel",function(M){S.textContent!==M&&(S.textContent=M)}),Da(t,"timeLabel",function(M){C.textContent!==M&&(C.textContent=M)}),Da(t,"multiplierLabel",function(M){v.textContent!==M&&(v.textContent=M)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(sv.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});sv.prototype.isDestroyed=function(){return!1};sv.prototype.destroy=function(){c(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 de(this)};sv.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,l=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${l})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t};sv.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(c(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=Q0(this._themeNormal),n=Q0(this._themeHover),i=Q0(this._themeSelect),o=Q0(this._themeDisabled),r=Q0(this._themeKnob),s=Q0(this._themePointer),a=Q0(this._themeSwoosh),l=Q0(this._themeSwooshHover),u=em({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":fs(t,Rk)},{tagName:"stop",offset:"12%","stop-color":fs(t,i5)},{tagName:"stop",offset:"46%","stop-color":fs(t,UQ)},{tagName:"stop",offset:"81%","stop-color":fs(t,o5)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":fs(n,Rk)},{tagName:"stop",offset:"12%","stop-color":fs(n,i5)},{tagName:"stop",offset:"46%","stop-color":fs(n,UQ)},{tagName:"stop",offset:"81%","stop-color":fs(n,o5)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":fs(i,Rk)},{tagName:"stop",offset:"12%","stop-color":fs(i,i5)},{tagName:"stop",offset:"46%","stop-color":fs(i,UQ)},{tagName:"stop",offset:"81%","stop-color":fs(i,o5)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":fs(o,jwt)},{tagName:"stop",offset:"75%","stop-color":fs(o,Wwt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":l.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":fs(s,jEe)},{tagName:"stop",offset:"100%","stop-color":fs(s,jEe)}]},{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":fs(r,Rk)},{tagName:"stop",offset:"60%","stop-color":fs(r,GEe)},{tagName:"stop",offset:"85%","stop-color":fs(r,i5)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":fs(r,GEe)},{tagName:"stop",offset:"60%","stop-color":fs(r,Rk)},{tagName:"stop",offset:"85%","stop-color":fs(r,o5)}]}]});c(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var Lk=sv;var Kwt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],J0=15,av=105;function qEe(e,t){return e-t}function HQ(e,t){let n=Lo(t,e,qEe);return n<0?~n:n}function $wt(e,t){if(Math.abs(e)<=J0)return e/J0;let n=J0,i=av,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function Zwt(e,t,n){if(n.clockStep===mo.SYSTEM_CLOCK)return J0;if(Math.abs(e)<=1)return e*J0;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=J0,r=av,s,a=0,l;return e>0?(s=Math.log(i),l=(s-a)/(r-o),(Math.log(e)-a)/l+o):(s=Math.log(-t[0]),l=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/l+o))}function Ed(e){if(!c(e))throw new E("clockViewModel is required.");let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Ed.defaultDateFormatter,this._timeFormatter=Ed.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,xe.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Ed.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 s=t._clockViewModel;if(s.clockStep===mo.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,xe.defineProperty(this,"shuttleRingAngle",{get:function(){return Zwt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,av),-av);let a=t._allShuttleRingTicks,l=t._clockViewModel;if(l.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===av){l.multiplier=s>0?a[a.length-1]:a[0];return}let u=$wt(s,a);if(t.snapToTicks)u=a[HQ(u,a)];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>J0?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}l.multiplier=u}}),this._canAnimate=void 0,xe.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===$r.UNBOUNDED)return!0;let l=s.multiplier,u=s.currentTime,f=s.startTime,h=!1;if(a===$r.LOOP_STOP)h=Q.greaterThan(u,f)||u.equals(f)&&l>0;else{let p=s.stopTime;h=Q.greaterThan(u,f)&&Q.lessThan(u,p)||u.equals(f)&&l>0||u.equals(p)&&l<0}return h||(s.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,xe.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===$r.UNBOUNDED)return!0;let l=s.systemTime;return Q.greaterThanOrEquals(l,s.startTime)&&Q.lessThanOrEquals(l,s.stopTime)}),this._isAnimating=void 0,xe.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Sn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Z0(n,{toggled:xe.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Sn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Z0(i,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Sn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Z0(o,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==mo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Sn(function(){t._clockViewModel.clockStep=mo.SYSTEM_CLOCK},xe.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Z0(r,{toggled:xe.computed(function(){return e.clockStep===mo.SYSTEM_CLOCK}),tooltip:xe.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Sn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,l=s.multiplier,u=HQ(l,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=Sn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,l=s.multiplier,u=HQ(l,a)+1;u<a.length&&(s.multiplier=a[u])})}Ed.defaultDateFormatter=function(e,t){let n=Q.toGregorianDate(e);return`${Kwt[n.month-1]} ${n.day} ${n.year}`};Ed.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];Ed.defaultTimeFormatter=function(e,t){let n=Q.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};Ed.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Ed.prototype.setShuttleRingTicks=function(e){if(!c(e))throw new E("positiveTicks is required.");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(qEe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(Ed.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){if(typeof e!="function")throw new E("dateFormatter must be a function");this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){if(typeof e!="function")throw new E("timeFormatter must be a function");this._timeFormatter=e}}});Ed._maxShuttleRingAngle=av;Ed._realtimeShuttleRingAngle=J0;var Nk=Ed;function YEe(e){e=e??W.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??W.EMPTY_ARRAY,i=e.terrainProviderViewModels??W.EMPTY_ARRAY;if(!c(t))throw new E("globe is required");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={},g;for(g=0;g<h.length;g++){let b=h[g],x=b.category;c(p[x])?p[x].push(b):p[x]=[b]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let b=m[g];y.push({name:b,providers:p[b]})}return y});this._imageryProviders=r;let s=xe.getObservable(this,"terrainProviderViewModels"),a=xe.pureComputed(function(){let h=s(),p={},g;for(g=0;g<h.length;g++){let b=h[g],x=b.category;c(p[x])?p[x].push(b):p[x]=[b]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let b=m[g];y.push({name:b,providers:p[b]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,xe.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,p=this.selectedTerrain,g=c(h)?h.name:void 0,m=c(p)?p.name:void 0;return c(g)&&c(m)?`${g} ${m}`:c(g)?g:m}),this.buttonImageUrl=void 0,xe.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(c(h))return h.iconUrl}),this.selectedImagery=void 0;let l=xe.observable();this._currentImageryLayers=[],xe.defineProperty(this,"selectedImagery",{get:function(){return l()},set:function(h){if(l()===h){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,y=this._globe.imageryLayers,b=!1;for(p=0;p<m;p++){let x=y.length;for(let A=0;A<x;A++){let C=y.get(A);if(C===g[p]){y.remove(C),b=!0;break}}}if(c(h)){let x=h.creationCommand();if(Array.isArray(x)){let A=x.length;for(this._currentImageryLayers=[],p=A-1;p>=0;p--){let C=Xa.fromProviderAsync(x[p]);y.add(C,0),this._currentImageryLayers.push(C)}}else{this._currentImageryLayers=[];let A=Xa.fromProviderAsync(x);if(A.name=h.name,b)y.add(A,0);else{let C=y.get(0);c(C)&&y.remove(C),y.add(A,0)}this._currentImageryLayers.push(A)}}l(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=xe.observable();xe.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(h){if(u()===h){this.dropDownVisible=!1;return}let p;if(c(h)&&(p=h.creationCommand()),c(p)&&!c(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof np),this._globe.terrainProvider=p;else if(c(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),b=new Ek(p).readyEvent.addEventListener(x=>{g||(this._globe.depthTestAgainstTerrain=!(x instanceof np),this._globe.terrainProvider=x,b())})}u(h),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Sn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(YEe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var Fk=YEe;function s5(e,t){if(!c(e))throw new E("container is required.");e=In(e);let n=new Fk(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let l=document.createElement("div");l.className="cesium-baseLayerPicker-category",a.appendChild(l);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),l.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),l.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 g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),h.appendChild(g);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 y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(y);let b=document.createElement("div");b.className="cesium-baseLayerPicker-category",y.appendChild(b);let x=document.createElement("div");x.className="cesium-baseLayerPicker-categoryTitle",x.setAttribute("data-bind","text: name"),b.appendChild(x);let A=document.createElement("div");A.className="cesium-baseLayerPicker-choices",A.setAttribute("data-bind","foreach: providers"),b.appendChild(A);let C=document.createElement("div");C.className="cesium-baseLayerPicker-item",C.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),A.appendChild(C);let S=document.createElement("img");S.className="cesium-baseLayerPicker-itemIcon",S.setAttribute("data-bind","attr: { src: iconUrl }"),S.setAttribute("draggable","false"),C.appendChild(S);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),C.appendChild(v),xe.applyBindings(n,i),xe.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(P){i.contains(P.target)||r.contains(P.target)||(n.dropDownVisible=!1)},Vt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(s5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});s5.prototype.isDestroyed=function(){return!1};s5.prototype.destroy=function(){return Vt.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),de(this)};var Bk=s5;function XEe(e){if(!c(e.name))throw new E("options.name is required.");if(!c(e.tooltip))throw new E("options.tooltip is required.");if(!c(e.iconUrl))throw new E("options.iconUrl is required.");if(typeof e.creationFunction!="function")throw new E("options.creationFunction is required.");let t=e.creationFunction;c(t.canExecute)||(t=Sn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",xe.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(XEe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var ds=XEe;function Qwt(){let e=[],t=devicePixelRatio>=2;return e.push(new ds({name:"Bing Maps Aerial",iconUrl:tn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return pg({style:mg.AERIAL})}})),e.push(new ds({name:"Bing Maps Aerial with Labels",iconUrl:tn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return pg({style:mg.AERIAL_WITH_LABELS})}})),e.push(new ds({name:"Bing Maps Roads",iconUrl:tn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return pg({style:mg.ROAD})}})),e.push(new ds({name:"ArcGIS World Imagery",iconUrl:tn("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 dg.fromBasemapType(Vh.SATELLITE,{enablePickFeatures:!1})}})),e.push(new ds({name:"ArcGIS World Hillshade",iconUrl:tn("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 dg.fromBasemapType(Vh.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new ds({name:"Esri World Ocean",iconUrl:tn("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 dg.fromBasemapType(Vh.OCEANS,{enablePickFeatures:!1})}})),e.push(new ds({name:"Open\xADStreet\xADMap",iconUrl:tn("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 Lg({url:"https://tile.openstreetmap.org/"})}})),e.push(new ds({name:"Stadia x Stamen Watercolor",iconUrl:tn("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 Lg({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Stadia x Stamen Toner",iconUrl:tn("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 Lg({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Stadia Alidade Smooth",iconUrl:tn("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 Lg({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Stadia Alidade Smooth Dark",iconUrl:tn("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 Lg({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Sentinel-2",iconUrl:tn("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 hg.fromAssetId(3954)}})),e.push(new ds({name:"Blue Marble",iconUrl:tn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return hg.fromAssetId(3845)}})),e.push(new ds({name:"Earth at night",iconUrl:tn("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 hg.fromAssetId(3812)}})),e.push(new ds({name:"Natural Earth\xA0II",iconUrl:tn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return D0.fromUrl(tn("Assets/Textures/NaturalEarthII"))}})),e}var kk=Qwt;function Jwt(){let e=[];return e.push(new ds({name:"WGS84 Ellipsoid",iconUrl:tn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new np({ellipsoid:ie.WGS84})}})),e.push(new ds({name:"Cesium World Terrain",iconUrl:tn("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 PA({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var Uk=Jwt;function evt(e){return function(t){let n=e._scene.pick(t.position);c(n)&&n.primitive instanceof bs&&(e.tileset=n.primitive),e.pickActive=!1}}function $Ee(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);c(i)&&i.primitive instanceof bs&&(e.tileset=i.primitive)},An.MOUSE_MOVE):(e._eventHandler.removeInputAction(An.MOUSE_MOVE),e.picking=e.picking)}var tvt={maximumFractionDigits:3};function Vk(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,tvt):Math.round(t).toLocaleString()}function zk(e,t){if(!c(e))return"";let n=t?e._statisticsPerPass[Uo.PICK]:e._statisticsPerPass[Uo.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>${Vk(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${Vk(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${Vk(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function ZEe(){let e=vi.statistics;return` <ul class="cesium-cesiumInspector-statistics"> <li><strong>Geometry Memory (MB): </strong>${Vk(e.geometryByteLength)}</li> <li><strong>Texture Memory (MB): </strong>${Vk(e.texturesByteLength)}</li> </ul> `}var nvt=[{text:"Highlight",value:Bl.HIGHLIGHT},{text:"Replace",value:Bl.REPLACE},{text:"Mix",value:Bl.MIX}],KEe=new G(1,1,0,.4),ivt=new G,a5=new G;function Pa(e,t){T.typeOf.object("scene",e),T.typeOf.object("performanceContainer",t);let n=this,i=e.canvas;this._eventHandler=new of(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new yg({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 U=[],q=n._properties();for(let Y in q)q.hasOwnProperty(Y)&&U.push(Y);return U});let o=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(U){o(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceError=U)}}),this.dynamicScreenSpaceError=!1;let r=xe.observable();xe.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(U){r(U),c(n._tileset)&&(n._tileset.colorBlendMode=U,n._scene.requestRender())}}),this.colorBlendMode=Bl.HIGHLIGHT;let s=xe.observable(),a=xe.observable();xe.defineProperty(this,"picking",{get:function(){return a()},set:function(U){a(U),U?n._eventHandler.setInputAction(function(q){let Y=e.pick(q.endPosition);if(Y instanceof Ws?(n.feature=Y,n.tile=Y.content.tile):c(Y)&&c(Y.content)?(n.feature=void 0,n.tile=Y.content.tile):(n.feature=void 0,n.tile=void 0),!!c(n._tileset)){if(s&&c(Y)&&c(Y.content)){let te;e.pickPositionSupported&&(te=e.pickPosition(q.endPosition),c(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=Y.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},An.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(An.MOUSE_MOVE))}}),this.picking=!0;let l=xe.observable();xe.defineProperty(this,"colorize",{get:function(){return l()},set:function(U){l(U),c(n._tileset)&&(n._tileset.debugColorizeTiles=U,n._scene.requestRender())}}),this.colorize=!1;let u=xe.observable();xe.defineProperty(this,"wireframe",{get:function(){return u()},set:function(U){u(U),c(n._tileset)&&(n._tileset.debugWireframe=U,n._scene.requestRender())}}),this.wireframe=!1;let f=xe.observable();xe.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(U){f(U),c(n._tileset)&&(n._tileset.debugShowBoundingVolume=U,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=xe.observable();xe.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(U){h(U),c(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=U,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=xe.observable();xe.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(U){p(U),c(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=U,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=xe.observable();xe.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(U){g(U),c(n._tileset)&&(n._tileset.debugFreezeFrame=U,n._scene.debugShowFrustumPlanes=U,n._scene.requestRender())}}),this.freezeFrame=!1,xe.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(U){s(U),c(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=U,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=xe.observable();xe.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(U){m(U),c(n._tileset)&&(n._tileset.debugShowGeometricError=U,n._scene.requestRender())}}),this.showGeometricError=!1;let y=xe.observable();xe.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(U){y(U),c(n._tileset)&&(n._tileset.debugShowRenderingStatistics=U,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let b=xe.observable();xe.defineProperty(this,"showMemoryUsage",{get:function(){return b()},set:function(U){b(U),c(n._tileset)&&(n._tileset.debugShowMemoryUsage=U,n._scene.requestRender())}}),this.showMemoryUsage=!1;let x=xe.observable();xe.defineProperty(this,"showUrl",{get:function(){return x()},set:function(U){x(U),c(n._tileset)&&(n._tileset.debugShowUrl=U,n._scene.requestRender())}}),this.showUrl=!1;let A=xe.observable();xe.defineProperty(this,"maximumScreenSpaceError",{get:function(){return A()},set:function(U){U=Number(U),isNaN(U)||(A(U),c(n._tileset)&&(n._tileset.maximumScreenSpaceError=U))}}),this.maximumScreenSpaceError=16;let C=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return C()},set:function(U){U=Number(U),isNaN(U)||(C(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=U))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,xe.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(C(),1/6)},set:function(U){let q=Math.pow(U,6);C(q),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=q)}});let S=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return S()},set:function(U){U=Number(U),isNaN(U)||(S(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=U))}}),this.dynamicScreenSpaceErrorFactor=24;let v=evt(this),P=xe.observable();xe.defineProperty(this,"pickActive",{get:function(){return P()},set:function(U){P(U),U?n._eventHandler.setInputAction(v,An.LEFT_CLICK):n._eventHandler.removeInputAction(An.LEFT_CLICK)}});let M=xe.observable();xe.defineProperty(this,"pointCloudShading",{get:function(){return M()},set:function(U){M(U),c(n._tileset)&&(n._tileset.pointCloudShading.attenuation=U)}}),this.pointCloudShading=!1;let R=xe.observable();xe.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(U){U=Number(U),isNaN(U)||(R(U),c(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=U))}}),this.geometricErrorScale=1;let L=xe.observable();xe.defineProperty(this,"maximumAttenuation",{get:function(){return L()},set:function(U){U=Number(U),isNaN(U)||(L(U),c(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=U===0?void 0:U))}}),this.maximumAttenuation=0;let F=xe.observable();xe.defineProperty(this,"baseResolution",{get:function(){return F()},set:function(U){U=Number(U),isNaN(U)||(F(U),c(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=U===0?void 0:U))}}),this.baseResolution=0;let _=xe.observable();xe.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(U){_(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=U)}}),this.eyeDomeLighting=!1;let w=xe.observable();xe.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return w()},set:function(U){U=Number(U),isNaN(U)||(w(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=U))}}),this.eyeDomeLightingStrength=1;let D=xe.observable();xe.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return D()},set:function(U){U=Number(U),isNaN(U)||(D(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=U))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=xe.observable();xe.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(U){I(U),c(n._tileset)&&(n._tileset.skipLevelOfDetail=U)}}),this.skipLevelOfDetail=!0;let N=xe.observable();xe.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return N()},set:function(U){U=Number(U),isNaN(U)||(N(U),c(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=U))}}),this.skipScreenSpaceErrorFactor=16;let k=xe.observable();xe.defineProperty(this,"baseScreenSpaceError",{get:function(){return k()},set:function(U){U=Number(U),isNaN(U)||(k(U),c(n._tileset)&&(n._tileset.baseScreenSpaceError=U))}}),this.baseScreenSpaceError=1024;let z=xe.observable();xe.defineProperty(this,"skipLevels",{get:function(){return z()},set:function(U){U=Number(U),isNaN(U)||(z(U),c(n._tileset)&&(n._tileset.skipLevels=U))}}),this.skipLevels=1;let V=xe.observable();xe.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return V()},set:function(U){V(U),c(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=U)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let j=xe.observable();xe.defineProperty(this,"loadSiblings",{get:function(){return j()},set:function(U){j(U),c(n._tileset)&&(n._tileset.loadSiblings=U)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),c(this._tileset)||$Ee(this,!0)}Object.defineProperties(Pa.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 nvt}},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,c(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=zk(e,!1),this._pickStatisticsText=zk(e,!0),this._resourceCacheStatisticsText=ZEe(),$Ee(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;c(t)&&!t.content.isDestroyed()&&(!this.colorize&&c(this._style)?t.color=c(this._style.color)?this._style.color.evaluateColor(t,ivt):G.WHITE:t.color=a5,this._scene.requestRender()),c(e)&&(G.clone(e.color,a5),e.color=KEe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;c(t)&&!t.isDestroyed()&&!GQ(t.content)&&(t.color=a5,this._scene.requestRender()),c(e)&&!GQ(e.content)&&(G.clone(e.color,a5),e.color=KEe,this._scene.requestRender()),this._tile=e}}});function GQ(e){if(!c(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i<n;++i)if(!GQ(t[i]))return!1;return!0}return!1}Pa.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Pa.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Pa.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Pa.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Pa.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Pa.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Pa.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Pa.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Pa.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Pa.prototype.trimTilesCache=function(){c(this._tileset)&&this._tileset.trimLoadedTiles()};Pa.prototype.compileStyle=function(){let e=this._tileset;if(!(!c(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new NA(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Pa.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` `),l=a.length,u;if(t.shiftKey)for(u=0;u<l;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<l;++u)a[u]=` ${a[u]}`,r+=2;let f=a.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};Pa.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),c(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=zk(e,!1),this._pickStatisticsText=zk(e,!0),this._resourceCacheStatisticsText=ZEe())};Pa.prototype.isDestroyed=function(){return!1};Pa.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){xe.getObservable(e,t).dispose()}),de(this)};Pa.getStatistics=zk;var Hk=Pa;function c5(e,t){T.defined("container",e),T.typeOf.object("scene",t),e=In(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new Hk(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=fu.createSection,l=fu.createCheckbox,u=fu.createRangeInput,f=fu.createButton,h=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),b=a(s,"Style","styleVisible","toggleStyle"),x=a(s,"Optimization","optimizationVisible","toggleOptimization"),A=document.createElement("div");A.className="field-group";let C=document.createElement("label");C.className="field-label",C.appendChild(document.createTextNode("Properties: "));let S=document.createElement("div");S.setAttribute("data-bind","text: properties"),A.appendChild(C),A.appendChild(S),h.appendChild(A),h.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(f("Trim Tiles Cache","trimTilesCache")),h.appendChild(l("Enable Picking","picking")),p.appendChild(l("Colorize","colorize"));let v=p.appendChild(l("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),P=document.createElement("p");P.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),P.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),P.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(P),p.appendChild(l("Bounding Volumes","showBoundingVolumes")),p.appendChild(l("Content Volumes","showContentBoundingVolumes")),p.appendChild(l("Request Volumes","showRequestVolumes")),p.appendChild(l("Point Cloud Shading","pointCloudShading"));let M=document.createElement("div");M.setAttribute("data-bind","visible: pointCloudShading"),M.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),M.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),M.appendChild(u("Base Resolution","baseResolution",0,1,.01)),M.appendChild(l("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(M);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),M.appendChild(R),g.appendChild(l("Freeze Frame","freezeFrame")),g.appendChild(l("Dynamic Screen Space Error","dynamicScreenSpaceError"));let L=document.createElement("div");L.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(L);let F=document.createElement("div");F.setAttribute("data-bind","visible: dynamicScreenSpaceError"),F.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),F.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(F),m.appendChild(l("Performance","performance")),m.appendChild(i),m.appendChild(l("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(l("Pick Statistics","showPickStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(w),m.appendChild(l("Resource Cache Statistics","showResourceCacheStatistics"));let D=document.createElement("div");D.className="cesium-3dTilesInspector-statistics",D.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(D);let I=document.createElement("div");b.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let N=document.createElement("select");N.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(N);let k=document.createElement("textarea");k.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(k);let z=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(z);let V=document.createElement("div");V.className="cesium-cesiumInspector-error",V.setAttribute("data-bind","text: editorError"),I.appendChild(V),y.appendChild(l("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(l("Geometric Error","showGeometricError")),y.appendChild(l("Rendering Statistics","showRenderingStatistics")),y.appendChild(l("Memory Usage (MB)","showMemoryUsage")),y.appendChild(l("Url","showUrl")),x.appendChild(l("Skip Tile LODs","skipLevelOfDetail"));let j=document.createElement("div");j.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),x.appendChild(j);let U=document.createElement("div");U.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),x.appendChild(U);let q=document.createElement("div");q.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),x.appendChild(q),x.appendChild(l("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),x.appendChild(l("Load siblings of visible tiles","loadSiblings")),xe.applyBindings(o,n)}Object.defineProperties(c5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});c5.prototype.isDestroyed=function(){return!1};c5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};var Gk=c5;function ovt(e){let t;if(c(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let l=Math.pow(2,a);o>=l&&(s.push(a+1),o-=l)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function jQ(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var rvt=new mn,svt=new d;function jk(e,t){if(!c(e))throw new E("scene is required");if(!c(t))throw new E("performanceContainer is required");let n=this,i=e.canvas,o=new of(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=Sn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Sn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Sn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Sn(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 yg({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Sn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=xe.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Sn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new lk({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else c(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=Sn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return c(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:c(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=Sn(function(){let u=n.depthFrustum+1;return n.depthFrustum=jQ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Sn(function(){let u=n.depthFrustum-1;return n.depthFrustum=jQ(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 s;this._showTileCoordinates=Sn(function(){return n.tileCoordinates&&!c(s)?s=e.imageryLayers.addImageryProvider(new wk({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&c(s)&&(e.imageryLayers.remove(s),s=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=Sn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Sn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],c(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 a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});c(f)&&(n.primitive=c(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Sn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=xe.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,An.LEFT_CLICK):o.removeInputAction(An.LEFT_CLICK)});function l(u){let f,h=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,rvt),g=r.pick(p,n._scene,svt);if(c(g)){let m=h.cartesianToCartographic(g),y=r._surface.tileProvider._tilesToRenderByTextureCount;for(let b=0;!f&&b<y.length;++b){let x=y[b];if(c(x))for(let A=0;!f&&A<x.length;++A){let C=x[A];ce.contains(C.rectangle,m)&&(f=C)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Sn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=xe.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(l,An.LEFT_CLICK):o.removeInputAction(An.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(jk.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 Sn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,c(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,c(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(c(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;c(n)&&c(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}}});jk.prototype._update=function(){this.frustums&&(this.frustumStatisticText=ovt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=jQ(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}`};jk.prototype.isDestroyed=function(){return!1};jk.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(),de(this)};var Wk=jk;function l5(e,t){if(!c(e))throw new E("container is required.");if(!c(t))throw new E("scene is required.");e=In(e);let n=document.createElement("div"),i=new Wk(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=fu.createSection,l=fu.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=l("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(l("Show Frustum Planes","frustumPlanes")),u.appendChild(l("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 g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(m);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(y);let b=document.createElement("input");b.type="button",b.value="-",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(b);let x=document.createElement("input");x.type="button",x.value="+",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(x);let A=a(s,"Primitives","primitivesVisible","togglePrimitives"),C=document.createElement("div");C.className="cesium-cesiumInspector-pickSection",A.appendChild(C);let S=document.createElement("input");S.type="button",S.value="Pick a primitive",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(S),C.appendChild(v),C.appendChild(l("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),C.appendChild(l("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=l("Show only selected","filterPrimitive","hasPickedPrimitive"),C.appendChild(this._primitiveOnly);let P=a(s,"Terrain","terrainVisible","toggleTerrain"),M=document.createElement("div");M.className="cesium-cesiumInspector-pickSection",P.appendChild(M);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",M.appendChild(v);let L=document.createElement("div");M.appendChild(L);let F=document.createElement("input");F.type="button",F.value="Parent",F.className="cesium-cesiumInspector-pickButton",F.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let w=document.createElement("input");w.type="button",w.value="NE",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectNE");let D=document.createElement("input");D.type="button",D.value="SW",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let N=document.createElement("div");N.className="cesium-cesiumInspector-tileText",L.className="cesium-cesiumInspector-frustumStatistics",L.appendChild(N),L.setAttribute("data-bind","visible: hasPickedTile"),N.setAttribute("data-bind","html: tileText");let k=document.createElement("div");k.className="cesium-cesiumInspector-relativeText",k.textContent="Select relative:",L.appendChild(k);let z=document.createElement("table"),V=document.createElement("tr"),j=document.createElement("tr"),U=document.createElement("td");U.appendChild(F);let q=document.createElement("td");q.appendChild(_);let Y=document.createElement("td");Y.appendChild(w),V.appendChild(U),V.appendChild(q),V.appendChild(Y);let te=document.createElement("td"),K=document.createElement("td");K.appendChild(D);let Z=document.createElement("td");Z.appendChild(I),j.appendChild(te),j.appendChild(K),j.appendChild(Z),z.appendChild(V),z.appendChild(j),L.appendChild(z),M.appendChild(l("Show bounding volume","tileBoundingSphere","hasPickedTile")),M.appendChild(l("Show only selected","filterTile","hasPickedTile")),P.appendChild(l("Wireframe","wireframe")),P.appendChild(l("Suspend LOD update","suspendUpdates")),P.appendChild(l("Show tile coordinates","tileCoordinates")),xe.applyBindings(i,this._element)}Object.defineProperties(l5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});l5.prototype.isDestroyed=function(){return!1};l5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};var qk=l5;function u5(e,t){c(t)||(t=document.body),t=In(t);let n=this,i=xe.observable(Cr.fullscreen),o=xe.observable(Cr.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(s){o(s&&Cr.enabled)}}),this.tooltip=void 0,xe.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Sn(function(){Cr.fullscreen?Cr.exitFullscreen():Cr.requestFullscreen(n._fullscreenElement)},xe.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=In(e)??r.body,this._callback=function(){i(Cr.fullscreen)},r.addEventListener(Cr.changeEventName,this._callback)}Object.defineProperties(u5.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){if(!(e instanceof Element))throw new E("value must be a valid Element.");this._fullscreenElement=e}},command:{get:function(){return this._command}}});u5.prototype.isDestroyed=function(){return!1};u5.prototype.destroy=function(){document.removeEventListener(Cr.changeEventName,this._callback),de(this)};var Yk=u5;var avt="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",cvt="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 f5(e,t){if(!c(e))throw new E("container is required.");e=In(e);let n=new Yk(t,e);n._exitFullScreenPath=cvt,n._enterFullScreenPath=avt;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(f5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});f5.prototype.isDestroyed=function(){return!1};f5.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var Xk=f5;function QEe(e,t){if(!c(e))throw new E("scene is required.");this._scene=e,this._duration=t;let n=this;this._command=Sn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",xe.track(this,["tooltip"])}Object.defineProperties(QEe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){if(c(e)&&e<0)throw new E("value must be positive.");this._duration=e}}});var Kk=QEe;function d5(e,t,n){if(!c(e))throw new E("container is required.");e=In(e);let i=new Kk(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(d5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});d5.prototype.isDestroyed=function(){return!1};d5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var $k=d5;var JEe=1e3;function Sd(e){if(!c(e)||!c(e.scene))throw new E("options.scene is required.");c(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new RA({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 pe,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=tSe,this._handleArrowUp=eSe;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=Sn(function(i){if(i=i??W0.SEARCH,t._focusTextbox=!1,c(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)mvt(t);else return dvt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?eSe(t):r?tSe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;oSe(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??Sd.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(){Sd._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){if(typeof i!="string")throw new E("value must be a valid string.");this._searchText=i}}),this.flightDuration=void 0,xe.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){if(c(i)&&i<0)throw new E("value must be positive.");this._flightDuration=i}})}Object.defineProperties(Sd.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}}});Sd.prototype.destroy=function(){this._suggestionSubscription.dispose()};function eSe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],Sd._adjustSuggestionsScroll(e,n)}function tSe(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],Sd._adjustSuggestionsScroll(e,i)}function lvt(e,t){let n=c(t)?t.availability:void 0;return c(n)?UT(t,[e]).then(function(i){return e=i[0],e.height+=JEe,e}):(e.height+=JEe,Promise.resolve(e))}function uvt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof ce?O.equalsEpsilon(t.south,t.north,O.EPSILON7)&&O.equalsEpsilon(t.east,t.west,O.EPSILON7)?t=ce.center(t):a=VT(t,n):t=i.cartesianToCartographic(t),c(a)||(a=lvt(t,r)),a.then(function(l){s=i.cartographicToCartesian(l)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:B.IDENTITY})})}async function fvt(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 dvt(e,t,n){let i=e._searchText;if(iSe(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 fvt(t[o],i,n),c(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,qQ(e);let s=r.value;if(r.state==="fulfilled"&&c(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=nSe(e,Yw.getCreditsFromResult(s[0]));c(a)||WQ(e,t[o].credit);return}e._searchText=`${i} (not found)`}function WQ(e,t){c(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function nSe(e,t){return c(t)&&t.forEach(n=>WQ(e,n)),t}function qQ(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function hvt(e,t){let n=In(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function mvt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function iSe(e){return/^\s*$/.test(e)}function oSe(e){xe.getObservable(e,"_suggestions").removeAll()}async function pvt(e){if(!e.autoComplete)return;let t=e._searchText;if(oSe(e),qQ(e),!iSe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,W0.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=Yw.getCreditsFromResult(r);o=o&&!c(s),nSe(e,s)}),o&&WQ(e,n.credit)}if(e._suggestions.length>=5)return}}Sd.flyToDestination=uvt;Sd._updateSearchSuggestions=pvt;Sd._adjustSuggestionsScroll=hvt;Sd.prototype.isDestroyed=function(){return!1};Sd.prototype.destroy=function(){return qQ(this),de(this)};var Zk=Sd;var _vt="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",gvt="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 h5(e){if(!c(e)||!c(e.container))throw new E("options.container is required.");if(!c(e.scene))throw new E("options.scene is required.");let t=In(e.container),n=new Zk(e);n._startSearchPath=_vt,n._stopSearchPath=gvt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let l=document.createElement("li");a.appendChild(l),l.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),xe.applyBindings(n,i),xe.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,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()},Vt.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(h5.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});h5.prototype.isDestroyed=function(){return!1};h5.prototype.destroy=function(){let e=this._container;return Vt.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),de(this)};var Qk=h5;function yvt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function sSe(e,t){xe.track(e);for(let n=0;n<e.sublayers.length;n++)sSe(e.sublayers[n],t)}function m5(e){return e.modelName==="FullModel"}function aSe(e){return e.modelName==="Overview"}function cSe(e){return aSe(e)||m5(e)}function rSe(e,t){if(cSe(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 bvt(e,t){if(cSe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");m5(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function xvt(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 Tvt(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:yvt,setOptionDisable:function(i,o){xe.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){bvt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){sSe(n[i],this.viewModel);let o=rSe(n[i],this.viewModel);c(o)&&(aSe(o)||!c(this.viewModel.defaultLayer)&&m5(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=rSe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=m5(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return xvt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var Jk=Tvt;function Avt(e,t){let n=document.getElementById(e);T.defined("container",n),T.defined("i3sProvider",t);let 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 Jk(t);xe.track(o),xe.applyBindings(o,n),c(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var YQ=Avt;var Cvt="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",Evt="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 XQ(){this._cameraClicked=new pe,this._closeClicked=new pe,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?Evt:Cvt}}),xe.defineProperty(this,"_bodyless",{get:function(){return!c(this.description)||this.description.length===0}})}XQ.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(XQ.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var eU=XQ;function p5(e){T.defined("container",e),e=In(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="×",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new eU;xe.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let l=r.contentDocument,u=l.createElement("link");u.href=tn("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=l.createElement("div");f.className="cesium-infoBox-description",l.head.appendChild(u),l.body.appendChild(f),a._descriptionSubscription=Da(s,"description",function(h){r.style.height="5px",f.innerHTML=h;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let y=window.getComputedStyle(g);if(y!==null){let b=y["background-color"],x=G.fromCssColorString(b);c(x)&&x.alpha!==0&&(p=y["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;r.style.height=`${m}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(p5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});p5.prototype.isDestroyed=function(){return!1};p5.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),c(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),de(this)};var tU=p5;function _5(e){if(!c(e))throw new E("scene is required.");this._scene=e,this._orthographic=e.camera.frustum instanceof on,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=Sn(function(){t.sceneMode===oe.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new gr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===oe.SCENE2D||t._scene.camera.frustum instanceof on}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=c(e.camera._currentFlight)}),this._switchToPerspective=Sn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Sn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(_5.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}}});_5.prototype.isDestroyed=function(){return!1};_5.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var nU=_5;var Svt="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",wvt="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 g5(e,t){if(!c(e))throw new E("container is required.");if(!c(t))throw new E("scene is required.");e=In(e);let n=new nU(t);n._perspectivePath=Svt,n._orthographicPath=wvt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),xe.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Vt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(g5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});g5.prototype.isDestroyed=function(){return!1};g5.prototype.destroy=function(){return this._viewModel.destroy(),Vt.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),de(this)};var iU=g5;function KQ(e){if(!c(e)||!c(e.scene))throw new E("options.scene is required.");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=Sn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=dk.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(KQ.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});KQ.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),de(this)};var oU=KQ;function y5(e){if(!c(e)||!c(e.container))throw new E("options.container is required.");if(!c(e.scene))throw new E("options.scene is required.");let t=In(e.container),n=new oU(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="×",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(y5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});y5.prototype.isDestroyed=function(){return!1};y5.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var rU=y5;function lSe(){this.showInstructions=!1;let e=this;this._command=Sn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Sn(function(){e._touch=!1}),this._showTouch=Sn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",xe.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(lSe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var sU=lSe;function b5(e){if(!c(e)||!c(e.container))throw new E("options.container is required.");let t=In(e.container),n=new sU,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 s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let l=document.createElement("img");l.src=tn("Widgets/Images/NavigationHelp/Mouse.svg"),l.className="cesium-navigation-button-icon",l.style.width="25px",l.style.height="25px",a.appendChild(l),a.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=tn("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")),s.appendChild(a),s.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="${tn("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="${tn("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="${tn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(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="${tn("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="${tn("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="${tn("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="${tn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),xe.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},Vt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(b5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});b5.prototype.isDestroyed=function(){return!1};b5.prototype.destroy=function(){return Vt.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),de(this)};var aU=b5;var vvt=new H,x5="-1000px";function cU(e,t,n){if(!c(e))throw new E("scene is required.");if(!c(t))throw new E("selectionIndicatorElement is required.");if(!c(n))throw new E("container is required.");this._scene=e,this._screenPositionX=x5,this._screenPositionY=x5,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&&c(this.position)}}),xe.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Gi.worldToWindowCoordinates(e,i,o)}}cU.prototype.update=function(){if(this.showSelection&&c(this.position)){let e=this.computeScreenSpacePosition(this.position,vvt);if(!c(e))this._screenPositionX=x5,this._screenPositionY=x5;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`}}};cU.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Qr.EXPONENTIAL_OUT})};cU.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Qr.EXPONENTIAL_OUT})};Object.defineProperties(cU.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var lU=cU;function T5(e,t){if(!c(e))throw new E("container is required.");e=In(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let l=new lU(t,this._element,this._container);this._viewModel=l,xe.applyBindings(this._viewModel,this._element)}Object.defineProperties(T5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});T5.prototype.isDestroyed=function(){return!1};T5.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),de(this)};var uU=T5;function A5(e,t){if(!c(e))throw new E("scene is required.");this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new gr,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=Sn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Sn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Sn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Sn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(A5.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){if(e<0)throw new E("duration value must be positive.");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}}});A5.prototype.isDestroyed=function(){return!1};A5.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var fU=A5;var Dvt="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",Pvt="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",Ivt="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 C5(e,t,n){if(!c(e))throw new E("container is required.");if(!c(t))throw new E("scene is required.");e=In(e);let i=new fU(t,n);i._globePath=Dvt,i._flatMapPath=Pvt,i._columbusViewPath=Ivt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let l=document.createElement("button");l.type="button",l.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",l.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(l),xe.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},Vt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(C5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});C5.prototype.isDestroyed=function(){return!1};C5.prototype.destroy=function(){return this._viewModel.destroy(),Vt.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),de(this)};var dU=C5;function WA(e,t,n){this._color=e,this._height=t,this._base=n??0}WA.prototype.getHeight=function(){return this._height};WA.prototype.getBase=function(){return this._base};WA.prototype.getStartTime=function(){return this._start};WA.prototype.getStopTime=function(){return this._stop};WA.prototype.setRange=function(e,t){this._start=e,this._stop=t};WA.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=Q.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=Q.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var hU=WA;function uSe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new G(.5,.5,.5,1),this.backgroundColor=i||new G(0,0,0,0)}uSe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=Q.addSeconds(t.startJulian,t.duration,new Q);if(Q.lessThan(n,o)&&Q.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(Q.lessThanOrEquals(n,r)&&Q.greaterThanOrEquals(i,o)){let s,a,l;for(s=0;s<t.timeBarWidth;++s){let u=Q.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new Q);!c(a)&&Q.greaterThanOrEquals(u,n)?a=s:!c(l)&&Q.greaterThanOrEquals(u,i)&&(l=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),c(a)&&(c(l)||(l=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(l-a,1),this.height))}};var mU=uSe;var $Q=1e12,wd={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Al={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},eb=[.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],Ovt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Cl(e,t){if(!c(e))throw new E("container is required.");if(!c(t))throw new E("clock is required.");e=In(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=wd.none,this._touchMode=Al.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=Rvt(this),this._onMouseUp=Mvt(this),this._onMouseMove=Lvt(this),this._onMouseWheel=Nvt(this),this._onTouchStart=Fvt(this),this._onTouchMove=kvt(this),this._onTouchEnd=Bvt(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()}Cl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Cl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Cl.prototype.isDestroyed=function(){return!1};Cl.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),de(this)};Cl.prototype.addHighlightRange=function(e,t,n){let i=new hU(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Cl.prototype.addTrack=function(e,t,n,i){let o=new mU(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Cl.prototype.zoomTo=function(e,t){if(!c(e))throw new E("startTime is required.");if(!c(t))throw new E("stopTime is required");if(Q.lessThanOrEquals(t,e))throw new E("Start time must come before end time.");if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=Q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==$r.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=Q.secondsDifference(o,i),s=Q.secondsDifference(i,this._startJulian),a=Q.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=Q.addSeconds(this._endJulian,s,new Q),this._startJulian=i,this._timeBarSecondsSpan=Q.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=Q.addSeconds(this._startJulian,a,new Q),this._endJulian=o,this._timeBarSecondsSpan=Q.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};Cl.prototype.zoomFrom=function(e){let t=Q.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(Q.addSeconds(this._startJulian,t-t*e,new Q),Q.addSeconds(this._endJulian,n*e-n,new Q))};function ZQ(e){return e<10?`0${e.toString()}`:e.toString()}Cl.prototype.makeLabel=function(e){let t=Q.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${Ovt[t.month-1]} ${t.day} ${t.year} ${ZQ(t.hour)}:${ZQ(t.minute)}:${ZQ(t.second)}${i}`};Cl.prototype.smallestTicInPixels=7;Cl.prototype._makeTics=function(){let e=this._timeBarEle,t=Q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,l=31536e6,u=1e-10,f=0,h=this._timeBarSecondsSpan;h<a?(h=a,this._timeBarSecondsSpan=a,this._endJulian=Q.addSeconds(this._startJulian,a,new Q)):h>l&&(h=l,this._timeBarSecondsSpan=l,this._endJulian=Q.addSeconds(this._startJulian,l,new Q));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(h/p*1e-5,.4),y,b=Q.toGregorianDate(g);h>31536e4?y=Q.fromDate(new Date(Date.UTC(Math.floor(b.year/100)*100,0))):h>31536e3?y=Q.fromDate(new Date(Date.UTC(Math.floor(b.year/10)*10,0))):h>86400?y=Q.fromDate(new Date(Date.UTC(b.year,0))):y=Q.fromDate(new Date(Date.UTC(b.year,b.month,b.day)));let x=Q.secondsDifference(this._startJulian,Q.addSeconds(y,m,new Q)),A=x+h;this._epochJulian=y;function C(U){return Math.floor(x/U)*U}function S(U,q){return Math.ceil(U/q+.5)*q}function v(U){return(U-x)/h}function P(U,q){return U-q*Math.round(U/q)}this._rulerEle.innerHTML=this.makeLabel(Q.addSeconds(this._endJulian,-a,new Q));let M=this._rulerEle.offsetWidth+20;M<30&&(M=180);let R=f;f-=u;let L={startTime:x,startJulian:g,epochJulian:y,duration:h,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(U){s+=U.render(L)});let F=0,_=0,w=0,D=M/p;D>1&&(D=1),D*=this._timeBarSecondsSpan;let I=-1,N=-1,k=eb.length,z;for(z=0;z<k;++z){let U=eb[z];if(++I,F=U,U>D&&U>f)break;N<0&&p*(U/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=I)}if(I>0){for(;I>0;)if(--I,Math.abs(P(F,eb[I]))<1e-5){eb[I]>=f&&(_=eb[I]);break}if(N>=0)for(;N<I;){if(Math.abs(P(_,eb[N]))<1e-5&&eb[N]>=f){w=eb[N];break}++N}}f=R,f>u&&w<1e-5&&Math.abs(f-F)>u&&(w=f,f<=F+u&&(_=0));let V=-999999,j;if(p*(w/this._timeBarSecondsSpan)>=3)for(o=C(w);o<=A;o=S(o,w))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(o=C(_);o<=A;o=S(o,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(F/this._timeBarSecondsSpan)>=2){this._mainTicSpan=F,A+=F,o=C(F);let U=Q.computeTaiMinusUtc(y);for(;o<=A;){let q=Q.addSeconds(g,o-x,new Q);if(F>2.1){let Z=Q.computeTaiMinusUtc(q);Math.abs(Z-U)>.1&&(o+=Z-U,q=Q.addSeconds(g,o-x,new Q))}let Y=Math.round(p*v(o)),te=this.makeLabel(q);this._rulerEle.innerHTML=te,j=this._rulerEle.offsetWidth,j<10&&(j=M);let K=Y-(j/2-1);K>V?(V=K+j+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${Y.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${K.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${Y.toString()}px;"></span>`,o=S(o,F)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),L.y=0,this._trackList.forEach(function(U){U.render(r._context,L),L.y+=U.height})};Cl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(c(this._scrubElement)){let t=Q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}c(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(Q.addSeconds(this._startJulian,this._timelineDrag,new Q),Q.addSeconds(this._endJulian,this._timelineDrag,new Q)))};Cl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=Q.addSeconds(this._startJulian,t,new Q),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function Rvt(e){return function(t){e._mouseMode!==wd.touchOnly&&(t.button===0?(e._mouseMode=wd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=wd.zoom:e._mouseMode=wd.slide)),t.preventDefault()}}function Mvt(e){return function(t){e._mouseMode=wd.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function Lvt(e){return function(t){let n;if(e._mouseMode===wd.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===wd.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(Q.addSeconds(e._startJulian,i,new Q),Q.addSeconds(e._endJulian,i,new Q))}}else e._mouseMode===wd.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function Nvt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;$Q=Math.max(Math.min(Math.abs(n),$Q),1),n/=$Q,e.zoomFrom(Math.pow(1.05,-n))}}function Fvt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=wd.touchOnly,n===1?(i=Q.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=Al.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Al.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=Al.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=Al.ignore}}function Bvt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Al.singleTap?(e._touchMode=Al.scrub,e._onTouchMove(t)):e._touchMode===Al.scrub&&e._onTouchMove(t),e._mouseMode=wd.touchOnly,n!==1?e._touchMode=n>0?Al.ignore:Al.none:e._touchMode===Al.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function kvt(e){return function(t){let n,i,o,r,s,a,l=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Al.singleTap&&(e._touchMode=Al.slideZoom),e._mouseMode=wd.touchOnly,e._touchMode===Al.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===Al.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,s=0),c(r)&&(s>0&&e._touchState.spanX>0?(l=e._touchState.spanX/s,a=Q.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*l)/e._topDiv.clientWidth,new Q)):(n=e._touchState.centerX-r,a=Q.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new Q)),e.zoomTo(a,Q.addSeconds(a,e._timeBarSecondsSpan*l,new Q)),e._touchState.centerX=r,e._touchState.spanX=s))}}Cl.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 pU=Cl;function fSe(e){let t=e.split(` `),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let l=t[a];l.match(o)[0].length>=s&&(l=l.slice(s)),i+=`${l} `}return i}function vd(e){T.typeOf.object("scene",e),this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[r]=f});let l=o.getPrimitiveFunction;l===!0&&(l=function(){t[r]=t._voxelPrimitive[r]}),c(l)&&t._getPrimitiveFunctions.push(l);let u=xe.observable();return xe.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),c(a)&&c(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[r]=s,u}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=fSe(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===va.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===va.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===va.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:-O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:O.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:-O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:O.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:-O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:O.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:-O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:O.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:-O.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:O.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:-O.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:O.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&&bp(t)},getPrimitiveFunction:function(){t.translationX=B.getTranslation(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)},getPrimitiveFunction:function(){t.translationY=B.getTranslation(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)},getPrimitiveFunction:function(){t.translationZ=B.getTranslation(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)},getPrimitiveFunction:function(){t.scaleX=B.getScale(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)},getPrimitiveFunction:function(){t.scaleY=B.getScale(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)},getPrimitiveFunction:function(){t.scaleZ=B.getScale(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)}})}var Uvt=new d,Vvt=new d,zvt=new Oa,Hvt=new J;function bp(e){let t=d.fromElements(e.translationX,e.translationY,e.translationZ,Uvt),n=d.fromElements(e.scaleX,e.scaleY,e.scaleZ,Vvt),i=zvt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=J.fromHeadingPitchRoll(i,Hvt),r=J.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=B.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(vd.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(c(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!c(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=fSe(i),c(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,bp(t)}}});vd.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};vd.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};vd.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};vd.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};vd.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};vd.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};vd.prototype.compileShader=function(){c(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new pA({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};vd.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` `),l=a.length,u;if(t.shiftKey)for(u=0;u<l;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<l;++u)a[u]=` ${a[u]}`,r+=2;let f=a.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};vd.prototype.isDestroyed=function(){return!1};vd.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){xe.getObservable(e,t).dispose()}),de(this)};var _U=vd;function E5(e,t){T.defined("container",e),T.typeOf.object("scene",t),e=In(e);let n=document.createElement("div"),i=new _U(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:s,createCheckbox:a,createRangeInput:l,createButton:u}=fu,f=s(r,"Display","displayVisible","toggleDisplay"),h=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Clipping","clippingVisible","toggleClipping"),g=s(r,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(l("Screen Space Error","screenSpaceError",0,128)),f.appendChild(l("Step Size","stepSize",0,2));let m=10,y=10,b=O.PI;h.appendChild(l("Translation X","translationX",-m,+m)),h.appendChild(l("Translation Y","translationY",-m,+m)),h.appendChild(l("Translation Z","translationZ",-m,+m)),h.appendChild(l("Scale X","scaleX",0,+y)),h.appendChild(l("Scale Y","scaleY",0,+y)),h.appendChild(l("Scale Z","scaleZ",0,+y)),h.appendChild(l("Heading","angleX",-b,+b)),h.appendChild(l("Pitch","angleY",-b,+b)),h.appendChild(l("Roll","angleZ",-b,+b)),QQ("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),QQ("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),QQ("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let x=document.createElement("div");g.appendChild(x);let A=document.createElement("textarea");A.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),x.className="cesium-cesiumInspector-styleEditor",x.appendChild(A);let C=u("Compile (Ctrl+Enter)","compileShader");x.appendChild(C);let S=document.createElement("label");S.style.display="block",S.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),x.appendChild(S),xe.applyBindings(i,n)}Object.defineProperties(E5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});E5.prototype.isDestroyed=function(){return!1};E5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};function QQ(e,t,n,i,o,r,s,a,l,u,f,h,p,g){let m=fu.createRangeInputWithDynamicMinMax,y=g.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(m(e,s)),y.appendChild(m(t,a)),y.appendChild(m(n,l)),y.appendChild(m(i,u)),y.appendChild(m(o,f)),y.appendChild(m(r,h))}var gU=E5;var hSe=Zo(dSe(),1);function Gvt(e){let t=!1,n=window.screen;return c(n)&&(c(n.lockOrientation)?t=n.lockOrientation(e):c(n.mozLockOrientation)?t=n.mozLockOrientation(e):c(n.msLockOrientation)?t=n.msLockOrientation(e):c(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function mSe(){let e=window.screen;c(e)&&(c(e.unlockOrientation)?e.unlockOrientation():c(e.mozUnlockOrientation)?e.mozUnlockOrientation():c(e.msUnlockOrientation)?e.msUnlockOrientation():c(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function jvt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(mSe(),e._locked=!1),e._noSleep.disable(),Cr.exitFullscreen(),n(!1)):(Cr.fullscreen||Cr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=Gvt("landscape")),t.useWebVR=!0,n(!0)))}function S5(e,t){if(!c(e))throw new E("scene is required.");let n=this,i=xe.observable(Cr.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(s){i(s&&Cr.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 gr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof on)}),this._locked=!1,this._noSleep=new hSe.default,this._command=Sn(function(){jvt(n,e,o,r)},xe.getObservable(this,"isVREnabled")),this._vrElement=In(t)??document.body,this._callback=function(){!Cr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(mSe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(Cr.changeEventName,this._callback)}Object.defineProperties(S5.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){if(!(e instanceof Element))throw new E("value must be a valid Element.");this._vrElement=e}},command:{get:function(){return this._command}}});S5.prototype.isDestroyed=function(){return!1};S5.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Cr.changeEventName,this._callback),de(this)};var bU=S5;var Wvt="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",qvt="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 w5(e,t,n){if(!c(e))throw new E("container is required.");if(!c(t))throw new E("scene is required.");e=In(e);let i=new bU(t,n);i._exitVRPath=qvt,i._enterVRPath=Wvt;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(w5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});w5.prototype.isDestroyed=function(){return!1};w5.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var xU=w5;var pSe=new le;function ySe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function Yvt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);c(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 Xvt(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(c(r)&&r!=="")return r}return"Unnamed Feature"}function _Se(e,t){let n=e.scene.pick(t.position);if(c(n)){let i=n.id??n.primitive.id;if(i instanceof nr)return i;if(n instanceof Ws)return new nr({name:Xvt(n),description:Yvt(n),feature:n})}if(c(e.scene.globe))return Zvt(e,t.position)}var Kvt=new Q;function eJ(e,t){if(c(t)){let n=t.clock;if(c(n)&&c(e)){let i=n.startTime,o=n.stopTime;Q.equals(i,o)&&(o=Q.addSeconds(i,O.EPSILON2,Kvt)),e.updateFromClock(),e.zoomTo(i,o)}}}var $vt=new d;function Zvt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!c(o))return;let r=new nr({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!c(s)||s.length===0){e.selectedEntity=gSe();return}let a=s[0],l=new nr({id:a.name,description:a.description});if(c(a.position)){let u=e.scene.ellipsoid.cartographicToCartesian(a.position,$vt);l.position=new qc(u)}e.selectedEntity=l},function(){e.selectedEntity===r&&(e.selectedEntity=gSe())}),r}function gSe(){return new nr({id:"None",description:"No features found."})}function Qvt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,l=e._timeline,u=e._fullscreenButton,f=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(c(n)&&(n.container.style.visibility=p),c(i)&&(i.container.style.visibility=p),c(o)&&(o.container.style.visibility=p),c(r)&&(r.container.style.visibility=p),c(s)&&(s.container.style.visibility=p),c(a)&&(a.container.style.visibility=p),c(l)&&(l.container.style.visibility=p),c(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),c(f)&&(f.container.style.visibility=p),c(h)&&(h.container.style.visibility=p),e._container){let g=t||!c(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function Ji(e,t){if(!c(e))throw new E("container is required.");if(e=In(e),t=t??W.EMPTY_OBJECT,t.globe===!1&&c(t.baseLayer)&&t.baseLayer!==!1)throw new E("Cannot use baseLayer when globe is disabled.");let n=(!c(t.globe)||t.globe!==!1)&&(!c(t.baseLayerPicker)||t.baseLayerPicker!==!1);if(!n&&c(t.selectedImageryProviderViewModel))throw new E("options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.baseLayer instead or set options.baseLayerPicker to true.");if(!n&&c(t.selectedTerrainProviderViewModel))throw new E("options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.terrainProvider instead or set options.baseLayerPicker to true.");let i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=t.scene3DOnly??!1,l,u,f=!1;c(t.clockViewModel)?(u=t.clockViewModel,l=u.clock):(l=new Ah,u=new Ok(l),f=!0);let h=new q3(r,{baseLayer:n&&c(t.selectedImageryProviderViewModel)||c(t.baseLayer)||c(t.imageryProvider)?!1:void 0,clock:l,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:c(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=h.scene,g=new gr;g.add(l.onTick,Ji.prototype._onTick,this);let m;if(!c(t.selectionIndicator)||t.selectionIndicator!==!1){let q=document.createElement("div");q.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(q),m=new uU(q,p)}let y;if(!c(t.infoBox)||t.infoBox!==!1){let q=document.createElement("div");q.className="cesium-viewer-infoBoxContainer",o.appendChild(q),y=new tU(q);let Y=y.viewModel;g.add(Y.cameraClicked,Ji.prototype._onInfoBoxCameraClicked,this),g.add(Y.closeClicked,Ji.prototype._onInfoBoxClockClicked,this)}let b=document.createElement("div");b.className="cesium-viewer-toolbar",o.appendChild(b);let x;if(!c(t.geocoder)||t.geocoder!==!1){let q=document.createElement("div");q.className="cesium-viewer-geocoderContainer",b.appendChild(q);let Y;typeof t.geocoder=="string"?Y=[new RA({scene:p,geocodeProviderType:t.geocoder})]:c(t.geocoder)&&typeof t.geocoder!="boolean"&&(Y=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),x=new Qk({container:q,geocoderServices:Y,scene:p}),g.add(x.viewModel.search.beforeExecute,Ji.prototype._clearObjects,this)}let A;if((!c(t.homeButton)||t.homeButton!==!1)&&(A=new $k(b,p),c(x)&&g.add(A.viewModel.command.afterExecute,function(){let q=x.viewModel;q.searchText="",q.isSearchInProgress&&q.search()}),g.add(A.viewModel.command.beforeExecute,Ji.prototype._clearTrackedObject,this)),t.sceneModePicker===!0&&a)throw new E("options.sceneModePicker is not available when options.scene3DOnly is set to true.");let C;!a&&(!c(t.sceneModePicker)||t.sceneModePicker!==!1)&&(C=new dU(b,p));let S;t.projectionPicker&&(S=new iU(b,p));let v,P;if(n){let q=t.imageryProviderViewModels??kk(),Y=t.terrainProviderViewModels??Uk();v=new Bk(b,{globe:p.globe,imageryProviderViewModels:q,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:Y,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),P=b.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}if(c(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),c(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),c(t.terrain)){if(c(t.terrainProvider))throw new E("Specify either options.terrainProvider or options.terrain.");n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain)}let M;if(!c(t.navigationHelpButton)||t.navigationHelpButton!==!1){let q=!0;try{if(c(window.localStorage)){let Y=window.localStorage.getItem("cesium-hasSeenNavHelp");c(Y)&&Y?q=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}M=new aU({container:b,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??q})}let R;if(!c(t.animation)||t.animation!==!1){let q=document.createElement("div");q.className="cesium-viewer-animationContainer",o.appendChild(q),R=new Lk(q,new Nk(u))}let L;if(!c(t.timeline)||t.timeline!==!1){let q=document.createElement("div");q.className="cesium-viewer-timelineContainer",o.appendChild(q),L=new pU(q,l),L.addEventListener("settime",ySe,!1),L.zoomTo(l.startTime,l.stopTime)}let F,_,w;(!c(t.fullscreenButton)||t.fullscreenButton!==!1)&&(w=document.createElement("div"),w.className="cesium-viewer-fullscreenContainer",o.appendChild(w),F=new Xk(w,t.fullscreenElement),_=Da(F.viewModel,"isFullscreenEnabled",function(q){w.style.display=q?"block":"none",c(L)&&(L.container.style.right=`${w.clientWidth}px`,L.resize())}));let D,I,N;if(t.vrButton){let q=document.createElement("div");q.className="cesium-viewer-vrContainer",o.appendChild(q),D=new xU(q,p,t.fullScreenElement),I=Da(D.viewModel,"isVREnabled",function(Y){q.style.display=Y?"block":"none",c(F)&&(q.style.right=`${w.clientWidth}px`),c(L)&&(L.container.style.right=`${q.clientWidth}px`,L.resize())}),N=Da(D.viewModel,"isVRMode",function(Y){Qvt(i,Y)})}this._baseLayerPickerDropDown=P,this._fullscreenSubscription=_,this._vrSubscription=I,this._vrModeSubscription=N,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=h,this._selectionIndicator=m,this._infoBox=y,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=b,this._homeButton=A,this._sceneModePicker=C,this._projectionPicker=S,this._baseLayerPicker=v,this._navigationHelpButton=M,this._animation=R,this._timeline=L,this._fullscreenButton=F,this._vrButton=D,this._geocoder=x,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=c(y)||c(m),this._selectedEntity=void 0,this._selectedEntityChanged=new pe;let k=this._cesiumWidget.dataSources,z=this._cesiumWidget.dataSourceDisplay;g.add(k.dataSourceAdded,Ji.prototype._onDataSourceAdded,this),g.add(k.dataSourceRemoved,Ji.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,Ji.prototype.resize,this);let V=k.length;for(let q=0;q<V;q++)this._dataSourceAdded(k,k.get(q));this._dataSourceAdded(void 0,z.defaultDataSource),g.add(k.dataSourceAdded,Ji.prototype._dataSourceAdded,this),g.add(k.dataSourceRemoved,Ji.prototype._dataSourceRemoved,this);function j(q){let Y=_Se(i,q);c(Y)?X.getValueOrUndefined(Y.position,i.clock.currentTime)?i.trackedEntity=Y:i.zoomTo(Y):c(i.trackedEntity)&&(i.trackedEntity=void 0)}function U(q){i.selectedEntity=_Se(i,q)}h.screenSpaceEventHandler.setInputAction(U,An.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(j,An.LEFT_DOUBLE_CLICK),h._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(Ji.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=c(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;c(e)?c(t)&&t.animateAppear():c(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,eJ(this._timeline,e))}}});Ji.prototype.extend=function(e,t){if(!c(e))throw new E("mixin is required.");e(this,t)};Ji.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=c(this._animation),r=c(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(c(a)&&(a.style.maxHeight=`${s}px`),c(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}c(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let l=this._timeline,u,f=0,h=5,p=3,g=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,y=this._vrButton,b=l.container,x=b.style;p=b.clientHeight+3,x.left=`${f}px`;let A=0;c(m)&&(A+=m.container.clientWidth),c(y)&&(A+=y.container.clientWidth),x.right=`${A}px`,l.resize()}!r&&c(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${h}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};Ji.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Ji.prototype.render=function(){this._cesiumWidget.render()};Ji.prototype.isDestroyed=function(){return!1};Ji.prototype.destroy=function(){return c(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(An.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(An.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),c(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),c(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),c(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),c(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),c(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),c(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),c(this._timeline)&&(this._timeline.removeEventListener("settime",ySe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),c(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),c(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),c(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),c(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(),de(this)};Ji.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Ji.prototype._onEntityCollectionChanged,this)};Ji.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Ji.prototype._onEntityCollectionChanged,this),c(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Ji.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};Ji.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=c(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,pSe)!==lt.FAILED?n=pSe.center:c(o.position)&&(n=o.position.getValue(t,n)),i=c(n));let s=c(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;c(s)&&(s.position=d.clone(n,s.position),s.showSelection=r&&i,s.update());let a=c(this._infoBox)?this._infoBox.viewModel:void 0;c(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=o.name??o.id,a.description=X.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};Ji.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)}};Ji.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;c(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};Ji.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Ji.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Ji.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Ji.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&eJ(this.timeline,e)};Ji.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&eJ(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Ji.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Ji.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};Ji.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};Ji.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var tJ=Ji;function Jvt(e){T.typeOf.object("viewer",e);let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new Gk(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var nJ=Jvt;function eDt(e){if(!c(e))throw new E("viewer is required.");let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new qk(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var iJ=eDt;function tDt(e,t){if(!c(e))throw new E("viewer is required.");if(e.hasOwnProperty("dropTarget"))throw new E("dropTarget is already defined by another mixin.");if(e.hasOwnProperty("dropEnabled"))throw new E("dropEnabled is already defined by another mixin.");if(e.hasOwnProperty("dropError"))throw new E("dropError is already defined by another mixin.");if(e.hasOwnProperty("clearOnDrop"))throw new E("clearOnDrop is already defined by another mixin.");if(e.hasOwnProperty("flyToOnDrop"))throw new E("flyToOnDrop is already defined by another mixin.");t=t??W.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new pe,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,l=t.proxy;s=In(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){if(!c(f))throw new E("value is required.");bSe(s,u),s=f,oJ(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?oJ(s,u):bSe(s,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 l},set:function(f){l=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){qA(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=f.dataTransfer.files,p=h.length;for(let g=0;g<p;g++){let m=h[g],y=new FileReader;y.onload=nDt(e,m,l,a),y.onerror=iDt(e,m),y.readAsText(m)}}oJ(s,u),e.destroy=tk(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function qA(e){e.stopPropagation(),e.preventDefault()}function bSe(e,t){let n=e;c(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",qA,!1),n.removeEventListener("dragover",qA,!1),n.removeEventListener("dragexit",qA,!1))}function oJ(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",qA,!1),e.addEventListener("dragover",qA,!1),e.addEventListener("dragexit",qA,!1)}function nDt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=SN.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=T0.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=kT.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=BF.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}c(a)&&e.dataSources.add(a).then(function(l){e.flyToOnDrop&&e.flyTo(l)}).catch(function(l){e.dropError.raiseEvent(e,s,l)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function iDt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var rJ=tDt;function oDt(e,t){if(!c(e))throw new E("viewer is required.");t=t??W.EMPTY_OBJECT;let n=new rU({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var sJ=oDt;function rDt(e){T.typeOf.object("viewer",e);let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new gU(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var aJ=rDt;globalThis.CESIUM_VERSION="1.129";var sDt="1.129";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,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,BufferUsage,CPUStylingPipelineStage,CallbackPositionProperty,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,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,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,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,Event,EventHelper,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,Frozen,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,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,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GoogleGeocoderService,GoogleMaps,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,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,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,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,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,ModelLightingOptions,ModelMatrixUpdateStage,ModelNode,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,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,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,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,TaskProcessor,Terrain,TerrainData,TerrainEncoding,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainProvider,TerrainQuantization,TerrainState,Texture,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,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalExaggeration,VerticalExaggerationPipelineStage,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,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,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersComputeIrradianceFS,_shadersComputeRadianceMapFS,_shadersContrastBias,_shadersConvolveSpecularMapFS,_shadersConvolveSpecularMapVS,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_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,_shadersIntersectClippingPlanes,_shadersIntersectCylinder,_shadersIntersectDepth,_shadersIntersectEllipsoid,_shadersIntersectLongitude,_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,_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,_shadersconvertUvToBox,_shadersconvertUvToCylinder,_shadersconvertUvToEllipsoid,_shaderscosineAndSine,_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,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_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,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,barycentricCoordinates,binarySearch,buildModuleUrl,buildVoxelDrawCommands,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGooglePhotorealistic3DTileset,createGuid,createMaterialPropertyDescriptor,createOsmBuildingsAsync,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createWorldBathymetryAsync,createWorldImageryAsync,createWorldTerrainAsync,decodeGoogleEarthEnterpriseData,decodeVectorPolylinePositions,defaultValue,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,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,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,srgbToLinear,subdivideArray,subscribeAndEvaluate,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,viewerVoxelInspectorMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas}); //# sourceMappingURL=index.cjs.map