diff --git a/index.html b/index.html index c256b89..f98ff35 100644 --- a/index.html +++ b/index.html @@ -5,9 +5,9 @@
=55296&&Y<=56319&&U65535&&(G-=65536,U+=S(G>>>10&1023|55296),G=56320|G&1023),U+=S(G),U}).join("")}function _(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:s}function b(V,G){return V+22+75*(V<26)-((G!=0)<<5)}function w(V,G,U){var q=0;for(V=U?E(V/f):V>>1,V+=E(V/G);V>T*c>>1;q+=s)V=E(V/T);return E(q+(T+1)*V/(V+u))}function I(V){var G=[],U=V.length,q,Y=0,Q=p,W=d,K,J,_e,xe,se,Ae,me,Se,Ie;for(K=V.lastIndexOf(g),K<0&&(K=0),J=0;J=128&&D("not-basic"),G.push(V.charCodeAt(J));for(_e=K>0?K+1:0;_e=U&&D("invalid-input"),me=_(V.charCodeAt(_e++)),(me>=s||me>E((r-Y)/se))&&D("overflow"),Y+=me*se,Se=Ae<=W?a:Ae>=W+c?c:Ae-W,!(me E(r/Ie)&&D("overflow"),se*=Ie;q=G.length+1,W=w(Y-xe,q,xe==0),E(Y/q)>r-Q&&D("overflow"),Q+=E(Y/q),Y%=q,G.splice(Y++,0,Q)}return N(G)}function R(V){var G,U,q,Y,Q,W,K,J,_e,xe,se,Ae=[],me,Se,Ie,Ve;for(V=L(V),me=V.length,G=p,U=0,Q=d,W=0;W =G&&se E((r-U)/Se)&&D("overflow"),U+=(K-G)*Se,G=K,W=0;W r&&D("overflow"),se==G){for(J=U,_e=s;xe=_e<=Q?a:_e>=Q+c?c:_e-Q,!(J {/*! + * 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 b3=="object"&&b3.exports?b3.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(tZ,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u1);p++)f.splice(0,1);s[d]=f.join("")}var g=-1,h=0,A=0,x=-1,C=!1;for(d=0;d h&&(g=x,h=A)):s[d]==="0"&&(C=!0,x=d,A=1);A>h&&(g=x,h=A),h>1&&s.splice(g,h,""),a=s.length;var T="";for(s[0]===""&&(T=":"),d=0;d{/*! + * 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 S3=="object"&&S3.exports?S3.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(iZ,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 Vl=Zc((rZ,w3)=>{/*! + * 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 w3=="object"&&w3.exports?w3.exports=t(eZ(),nZ(),oZ()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(rZ,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(b,w){var I=arguments.length>=1,R=arguments.length>=2;if(!(this instanceof r))return I?R?new r(b,w):new r(b):new r;if(b===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?b=location.href+"":b=""}if(b===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(b),w!==void 0?this.absoluteTo(w):this}function s(b){return/^[0-9]+$/.test(b)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function u(b){return b.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(b){return b===void 0?"Undefined":String(Object.prototype.toString.call(b)).slice(8,-1)}function d(b){return f(b)==="Array"}function p(b,w){var I={},R,F;if(f(w)==="RegExp")I=null;else if(d(w))for(R=0,F=w.length;R ]+|\(([^\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(b){if(!(!b||!b.nodeName)){var w=b.nodeName.toLowerCase();if(!(w==="input"&&b.type!=="image"))return r.domAttributes[w]}};function x(b){return escape(b)}function C(b){return encodeURIComponent(b).replace(/[!'()*]/g,x).replace(/\*/g,"%2A")}r.encode=C,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=C,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(b,w){var I=r.encode(b+"");return w===void 0&&(w=r.escapeQuerySpace),w?I.replace(/%20/g,"+"):I},r.decodeQuery=function(b,w){b+="",w===void 0&&(w=r.escapeQuerySpace);try{return r.decode(w?b.replace(/\+/g,"%20"):b)}catch{return b}};var T={encode:"encode",decode:"decode"},E,S=function(b,w){return function(I){try{return r[w](I+"").replace(r.characters[b][w].expression,function(R){return r.characters[b][w].map[R]})}catch{return I}}};for(E in T)r[E+"PathSegment"]=S("pathname",T[E]),r[E+"UrnPathSegment"]=S("urnpath",T[E]);var v=function(b,w,I){return function(R){var F;I?F=function(U){return r[w](r[I](U))}:F=r[w];for(var k=(R+"").split(b),V=0,G=k.length;V -1&&(w.fragment=b.substring(I+1)||null,b=b.substring(0,I)),I=b.indexOf("?"),I>-1&&(w.query=b.substring(I+1)||null,b=b.substring(0,I)),b=b.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),b=b.replace(/^[/\\]{2,}/i,"//"),b.substring(0,2)==="//"?(w.protocol=null,b=b.substring(2),b=r.parseAuthority(b,w)):(I=b.indexOf(":"),I>-1&&(w.protocol=b.substring(0,I)||null,w.protocol&&!w.protocol.match(r.protocol_expression)?w.protocol=void 0:b.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(b=b.substring(I+3),b=r.parseAuthority(b,w)):(b=b.substring(I+1),w.urn=!0))),w.path=b,w},r.parseHost=function(b,w){b||(b=""),b=b.replace(/\\/g,"/");var I=b.indexOf("/"),R,F;if(I===-1&&(I=b.length),b.charAt(0)==="[")R=b.indexOf("]"),w.hostname=b.substring(1,R)||null,w.port=b.substring(R+2,I)||null,w.port==="/"&&(w.port=null);else{var k=b.indexOf(":"),V=b.indexOf("/"),G=b.indexOf(":",k+1);G!==-1&&(V===-1||G -1?F:b.length-1),V;return k>-1&&(F===-1||k -1?W=W.slice(0,K)+W.slice(K).replace(k,""):W=W.replace(k,""),!(W.length<=U[0].length)&&!(I.ignore&&I.ignore.test(W))){Q=q+W.length;var xe=w(W,q,Q,b);if(xe===void 0){R.lastIndex=Q;continue}xe=String(xe),b=b.slice(0,q)+xe+b.slice(Q),R.lastIndex=q+xe.length}}return R.lastIndex=0,b},r.ensureValidHostname=function(b,w){var I=!!b,R=!!w,F=!1;if(R&&(F=g(r.hostProtocols,w)),F&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(b&&b.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(b).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(b){if(b){var w=Number(b);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+b+'" is not a valid port')}},r.noConflict=function(b){if(b){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=o);return this},a.build=function(b){return b===!0?this._deferred_build=!0:(b===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 D(b){return function(w,I){return w===void 0?this._parts[b]||"":(this._parts[b]=w||null,this.build(!I),this)}}function O(b,w){return function(I,R){return I===void 0?this._parts[b]||"":(I!==null&&(I=I+"",I.charAt(0)===w&&(I=I.substring(1))),this._parts[b]=I,this.build(!R),this)}}a.protocol=D("protocol"),a.username=D("username"),a.password=D("password"),a.hostname=D("hostname"),a.port=D("port"),a.query=O("query","?"),a.fragment=O("fragment","#"),a.search=function(b,w){var I=this.query(b,w);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(b,w){var I=this.fragment(b,w);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(b,w){if(b===void 0||b===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return b?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=b?r.recodeUrnPath(b):"":this._parts.path=b?r.recodePath(b):"/",this.build(!w),this},a.path=a.pathname,a.href=function(b,w){var I;if(b===void 0)return this.toString();this._string="",this._parts=r._parts();var R=b instanceof r,F=typeof b=="object"&&(b.hostname||b.path||b.pathname);if(b.nodeName){var k=r.getDomAttribute(b);b=b[k]||"",F=!1}if(!R&&F&&b.pathname!==void 0&&(b=b.toString()),typeof b=="string"||b instanceof String)this._parts=r.parse(String(b),this._parts);else if(R||F){var V=R?b._parts:b;for(I in V)I!=="query"&&c.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(!w),this},a.is=function(b){var w=!1,I=!1,R=!1,F=!1,k=!1,V=!1,G=!1,U=!this._parts.urn;switch(this._parts.hostname&&(U=!1,I=r.ip4_expression.test(this._parts.hostname),R=r.ip6_expression.test(this._parts.hostname),w=I||R,F=!w,k=F&&n&&n.has(this._parts.hostname),V=F&&r.idn_expression.test(this._parts.hostname),G=F&&r.punycode_expression.test(this._parts.hostname)),b.toLowerCase()){case"relative":return U;case"absolute":return!U;case"domain":case"name":return F;case"sld":return k;case"ip":return w;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return R;case"idn":return V;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return G}return null};var M=a.protocol,L=a.port,N=a.hostname;a.protocol=function(b,w){if(b&&(b=b.replace(/:(\/\/)?$/,""),!b.match(r.protocol_expression)))throw new TypeError('Protocol "'+b+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return M.call(this,b,w)},a.scheme=a.protocol,a.port=function(b,w){return this._parts.urn?b===void 0?"":this:(b!==void 0&&(b===0&&(b=null),b&&(b+="",b.charAt(0)===":"&&(b=b.substring(1)),r.ensureValidPort(b))),L.call(this,b,w))},a.hostname=function(b,w){if(this._parts.urn)return b===void 0?"":this;if(b!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},R=r.parseHost(b,I);if(R!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');b=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(b,this._parts.protocol)}return N.call(this,b,w)},a.origin=function(b,w){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){var I=this.protocol(),R=this.authority();return R?(I?I+"://":"")+this.authority():""}else{var F=r(b);return this.protocol(F.protocol()).authority(F.authority()).build(!w),this}},a.host=function(b,w){if(this._parts.urn)return b===void 0?"":this;if(b===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(b,this._parts);if(I!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(b,w){if(this._parts.urn)return b===void 0?"":this;if(b===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(b,this._parts);if(I!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(b,w){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return b[b.length-1]!=="@"&&(b+="@"),r.parseUserinfo(b,this._parts),this.build(!w),this},a.resource=function(b,w){var I;return b===void 0?this.path()+this.search()+this.hash():(I=r.parse(b),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!w),this)},a.subdomain=function(b,w){if(this._parts.urn)return b===void 0?"":this;if(b===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 R=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,R),k=new RegExp("^"+u(F));if(b&&b.charAt(b.length-1)!=="."&&(b+="."),b.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return b&&r.ensureValidHostname(b,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(k,b),this.build(!w),this}},a.domain=function(b,w){if(this._parts.urn)return b===void 0?"":this;if(typeof b=="boolean"&&(w=b,b=void 0),b===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 R=this._parts.hostname.length-this.tld(w).length-1;return R=this._parts.hostname.lastIndexOf(".",R-1)+1,this._parts.hostname.substring(R)||""}else{if(!b)throw new TypeError("cannot set domain empty");if(b.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(b,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=b;else{var F=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,b)}return this.build(!w),this}},a.tld=function(b,w){if(this._parts.urn)return b===void 0?"":this;if(typeof b=="boolean"&&(w=b,b=void 0),b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),R=this._parts.hostname.substring(I+1);return w!==!0&&n&&n.list[R.toLowerCase()]&&n.get(this._parts.hostname)||R}else{var F;if(b)if(b.match(/[^a-zA-Z0-9-]/))if(n&&n.is(b))F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,b);else throw new TypeError('TLD "'+b+'" 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");F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,b)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(b,w){if(this._parts.urn)return b===void 0?"":this;if(b===void 0||b===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,R=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return b?r.decodePath(R):R}else{var F=this._parts.path.length-this.filename().length,k=this._parts.path.substring(0,F),V=new RegExp("^"+u(k));return this.is("relative")||(b||(b="/"),b.charAt(0)!=="/"&&(b="/"+b)),b&&b.charAt(b.length-1)!=="/"&&(b+="/"),b=r.recodePath(b),this._parts.path=this._parts.path.replace(V,b),this.build(!w),this}},a.filename=function(b,w){if(this._parts.urn)return b===void 0?"":this;if(typeof b!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),R=this._parts.path.substring(I+1);return b?r.decodePathSegment(R):R}else{var F=!1;b.charAt(0)==="/"&&(b=b.substring(1)),b.match(/\.?\//)&&(F=!0);var k=new RegExp(u(this.filename())+"$");return b=r.recodePath(b),this._parts.path=this._parts.path.replace(k,b),F?this.normalizePath(w):this.build(!w),this}},a.suffix=function(b,w){if(this._parts.urn)return b===void 0?"":this;if(b===void 0||b===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),R=I.lastIndexOf("."),F,k;return R===-1?"":(F=I.substring(R+1),k=/^[a-z0-9%]+$/i.test(F)?F:"",b?r.decodePathSegment(k):k)}else{b.charAt(0)==="."&&(b=b.substring(1));var V=this.suffix(),G;if(V)b?G=new RegExp(u(V)+"$"):G=new RegExp(u("."+V)+"$");else{if(!b)return this;this._parts.path+="."+r.recodePath(b)}return G&&(b=r.recodePath(b),this._parts.path=this._parts.path.replace(G,b)),this.build(!w),this}},a.segment=function(b,w,I){var R=this._parts.urn?":":"/",F=this.path(),k=F.substring(0,1)==="/",V=F.split(R);if(b!==void 0&&typeof b!="number"&&(I=w,w=b,b=void 0),b!==void 0&&typeof b!="number")throw new Error('Bad segment "'+b+'", must be 0-based integer');if(k&&V.shift(),b<0&&(b=Math.max(V.length+b,0)),w===void 0)return b===void 0?V:V[b];if(b===null||V[b]===void 0)if(d(w)){V=[];for(var G=0,U=w.length;G{/*! @license DOMPurify 3.0.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.2/LICENSE */(function(e,t){typeof K8=="object"&&typeof J8<"u"?J8.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t())})(K8,function(){"use strict";let{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:i,getOwnPropertyDescriptor:o}=Object,{freeze:r,seal:s,create:a}=Object,{apply:c,construct:u}=typeof Reflect<"u"&&Reflect;c||(c=function(ke,dt,pt){return ke.apply(dt,pt)}),r||(r=function(ke){return ke}),s||(s=function(ke){return ke}),u||(u=function(ke,dt){return new ke(...dt)});let f=v(Array.prototype.forEach),d=v(Array.prototype.pop),p=v(Array.prototype.push),g=v(String.prototype.toLowerCase),h=v(String.prototype.toString),A=v(String.prototype.match),x=v(String.prototype.replace),C=v(String.prototype.indexOf),T=v(String.prototype.trim),E=v(RegExp.prototype.test),S=D(TypeError);function v(Re){return function(ke){for(var dt=arguments.length,pt=new Array(dt>1?dt-1:0),rt=1;rt /gm),Q=s(/\${[\w\W]*}/gm),W=s(/^data-[\-\w.\u00B7-\uFFFF]/),K=s(/^aria-[\-\w]+$/),J=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_e=s(/^(?:\w+script|data):/i),xe=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),se=s(/^html$/i);var Ae=Object.freeze({__proto__:null,MUSTACHE_EXPR:q,ERB_EXPR:Y,TMPLIT_EXPR:Q,DATA_ATTR:W,ARIA_ATTR:K,IS_ALLOWED_URI:J,IS_SCRIPT_OR_DATA:_e,ATTR_WHITESPACE:xe,DOCTYPE_NAME:se});let me=()=>typeof window>"u"?null:window,Se=function(ke,dt){if(typeof ke!="object"||typeof ke.createPolicy!="function")return null;let pt=null,rt="data-tt-policy-suffix";dt.currentScript&&dt.currentScript.hasAttribute(rt)&&(pt=dt.currentScript.getAttribute(rt));let fn="dompurify"+(pt?"#"+pt:"");try{return ke.createPolicy(fn,{createHTML(Bn){return Bn},createScriptURL(Bn){return Bn}})}catch{return console.warn("TrustedTypes policy "+fn+" could not be created."),null}};function Ie(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:me(),ke=bn=>Ie(bn);if(ke.version="3.0.2",ke.removed=[],!Re||!Re.document||Re.document.nodeType!==9)return ke.isSupported=!1,ke;let dt=Re.document,{document:pt}=Re,{DocumentFragment:rt,HTMLTemplateElement:fn,Node:Bn,Element:jt,NodeFilter:Ze,NamedNodeMap:pe=Re.NamedNodeMap||Re.MozNamedAttrMap,HTMLFormElement:Ee,DOMParser:je,trustedTypes:fi}=Re,Ai=jt.prototype,er=L(Ai,"cloneNode"),Fs=L(Ai,"nextSibling"),Us=L(Ai,"childNodes"),Br=L(Ai,"parentNode");if(typeof fn=="function"){let bn=pt.createElement("template");bn.content&&bn.content.ownerDocument&&(pt=bn.content.ownerDocument)}let Mo=Se(fi,dt),Be=Mo?Mo.createHTML(""):"",{implementation:st,createNodeIterator:Qe,createDocumentFragment:$e,getElementsByTagName:yt}=pt,{importNode:zt}=dt,an={};ke.isSupported=typeof e=="function"&&typeof Br=="function"&&st&&typeof st.createHTMLDocument<"u";let{MUSTACHE_EXPR:Ji,ERB_EXPR:go,TMPLIT_EXPR:$r,DATA_ATTR:es,ARIA_ATTR:ar,IS_SCRIPT_OR_DATA:Wi,ATTR_WHITESPACE:Wr}=Ae,{IS_ALLOWED_URI:Un}=Ae,ln=null,Xn=O({},[...N,..._,...b,...I,...F]),gn=null,Ia=O({},[...k,...V,...G,...U]),Kn=Object.seal(Object.create(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}})),Lr=null,Xf=null,cr=!0,Pa=!0,Kf=!1,Nh=!0,jr=!1,pc=!1,h0=!1,Am=!1,ps=!1,W_=!1,UC=!1,IH=!0,yK=!1,cxe="user-content-",PH=!0,KS=!1,VC={},kC=null,AK=O({},["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"]),xK=null,CK=O({},["audio","video","img","source","image","track"]),OH=null,TK=O({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Y2="http://www.w3.org/1998/Math/MathML",q2="http://www.w3.org/2000/svg",Fh="http://www.w3.org/1999/xhtml",zC=Fh,MH=!1,RH=null,lxe=O({},[Y2,q2,Fh],h),p0,uxe=["application/xhtml+xml","text/html"],fxe="text/html",Vs,HC=null,dxe=pt.createElement("form"),EK=function(De){return De instanceof RegExp||De instanceof Function},BH=function(De){HC&&HC===De||((!De||typeof De!="object")&&(De={}),De=M(De),p0=uxe.indexOf(De.PARSER_MEDIA_TYPE)===-1?p0=fxe:p0=De.PARSER_MEDIA_TYPE,Vs=p0==="application/xhtml+xml"?h:g,ln="ALLOWED_TAGS"in De?O({},De.ALLOWED_TAGS,Vs):Xn,gn="ALLOWED_ATTR"in De?O({},De.ALLOWED_ATTR,Vs):Ia,RH="ALLOWED_NAMESPACES"in De?O({},De.ALLOWED_NAMESPACES,h):lxe,OH="ADD_URI_SAFE_ATTR"in De?O(M(TK),De.ADD_URI_SAFE_ATTR,Vs):TK,xK="ADD_DATA_URI_TAGS"in De?O(M(CK),De.ADD_DATA_URI_TAGS,Vs):CK,kC="FORBID_CONTENTS"in De?O({},De.FORBID_CONTENTS,Vs):AK,Lr="FORBID_TAGS"in De?O({},De.FORBID_TAGS,Vs):{},Xf="FORBID_ATTR"in De?O({},De.FORBID_ATTR,Vs):{},VC="USE_PROFILES"in De?De.USE_PROFILES:!1,cr=De.ALLOW_ARIA_ATTR!==!1,Pa=De.ALLOW_DATA_ATTR!==!1,Kf=De.ALLOW_UNKNOWN_PROTOCOLS||!1,Nh=De.ALLOW_SELF_CLOSE_IN_ATTR!==!1,jr=De.SAFE_FOR_TEMPLATES||!1,pc=De.WHOLE_DOCUMENT||!1,ps=De.RETURN_DOM||!1,W_=De.RETURN_DOM_FRAGMENT||!1,UC=De.RETURN_TRUSTED_TYPE||!1,Am=De.FORCE_BODY||!1,IH=De.SANITIZE_DOM!==!1,yK=De.SANITIZE_NAMED_PROPS||!1,PH=De.KEEP_CONTENT!==!1,KS=De.IN_PLACE||!1,Un=De.ALLOWED_URI_REGEXP||J,zC=De.NAMESPACE||Fh,Kn=De.CUSTOM_ELEMENT_HANDLING||{},De.CUSTOM_ELEMENT_HANDLING&&EK(De.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Kn.tagNameCheck=De.CUSTOM_ELEMENT_HANDLING.tagNameCheck),De.CUSTOM_ELEMENT_HANDLING&&EK(De.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Kn.attributeNameCheck=De.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),De.CUSTOM_ELEMENT_HANDLING&&typeof De.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Kn.allowCustomizedBuiltInElements=De.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),jr&&(Pa=!1),W_&&(ps=!0),VC&&(ln=O({},[...F]),gn=[],VC.html===!0&&(O(ln,N),O(gn,k)),VC.svg===!0&&(O(ln,_),O(gn,V),O(gn,U)),VC.svgFilters===!0&&(O(ln,b),O(gn,V),O(gn,U)),VC.mathMl===!0&&(O(ln,I),O(gn,G),O(gn,U))),De.ADD_TAGS&&(ln===Xn&&(ln=M(ln)),O(ln,De.ADD_TAGS,Vs)),De.ADD_ATTR&&(gn===Ia&&(gn=M(gn)),O(gn,De.ADD_ATTR,Vs)),De.ADD_URI_SAFE_ATTR&&O(OH,De.ADD_URI_SAFE_ATTR,Vs),De.FORBID_CONTENTS&&(kC===AK&&(kC=M(kC)),O(kC,De.FORBID_CONTENTS,Vs)),PH&&(ln["#text"]=!0),pc&&O(ln,["html","head","body"]),ln.table&&(O(ln,["tbody"]),delete Lr.tbody),r&&r(De),HC=De)},bK=O({},["mi","mo","mn","ms","mtext"]),SK=O({},["foreignobject","desc","title","annotation-xml"]),mxe=O({},["title","style","font","a","script"]),X2=O({},_);O(X2,b),O(X2,w);let LH=O({},I);O(LH,R);let hxe=function(De){let Ct=Br(De);(!Ct||!Ct.tagName)&&(Ct={namespaceURI:zC,tagName:"template"});let Xt=g(De.tagName),bo=g(Ct.tagName);return RH[De.namespaceURI]?De.namespaceURI===q2?Ct.namespaceURI===Fh?Xt==="svg":Ct.namespaceURI===Y2?Xt==="svg"&&(bo==="annotation-xml"||bK[bo]):!!X2[Xt]:De.namespaceURI===Y2?Ct.namespaceURI===Fh?Xt==="math":Ct.namespaceURI===q2?Xt==="math"&&SK[bo]:!!LH[Xt]:De.namespaceURI===Fh?Ct.namespaceURI===q2&&!SK[bo]||Ct.namespaceURI===Y2&&!bK[bo]?!1:!LH[Xt]&&(mxe[Xt]||!X2[Xt]):!!(p0==="application/xhtml+xml"&&RH[De.namespaceURI]):!1},_0=function(De){p(ke.removed,{element:De});try{De.parentNode.removeChild(De)}catch{De.remove()}},NH=function(De,Ct){try{p(ke.removed,{attribute:Ct.getAttributeNode(De),from:Ct})}catch{p(ke.removed,{attribute:null,from:Ct})}if(Ct.removeAttribute(De),De==="is"&&!gn[De])if(ps||W_)try{_0(Ct)}catch{}else try{Ct.setAttribute(De,"")}catch{}},wK=function(De){let Ct,Xt;if(Am)De=" "+De;else{let Uu=A(De,/^[\r\n\t ]+/);Xt=Uu&&Uu[0]}p0==="application/xhtml+xml"&&zC===Fh&&(De=''+De+"");let bo=Mo?Mo.createHTML(De):De;if(zC===Fh)try{Ct=new je().parseFromString(bo,p0)}catch{}if(!Ct||!Ct.documentElement){Ct=st.createDocument(zC,"template",null);try{Ct.documentElement.innerHTML=MH?Be:bo}catch{}}let ks=Ct.body||Ct.documentElement;return De&&Xt&&ks.insertBefore(pt.createTextNode(Xt),ks.childNodes[0]||null),zC===Fh?yt.call(Ct,pc?"html":"body")[0]:pc?Ct.documentElement:ks},vK=function(De){return Qe.call(De.ownerDocument||De,De,Ze.SHOW_ELEMENT|Ze.SHOW_COMMENT|Ze.SHOW_TEXT,null,!1)},pxe=function(De){return De instanceof Ee&&(typeof De.nodeName!="string"||typeof De.textContent!="string"||typeof De.removeChild!="function"||!(De.attributes instanceof pe)||typeof De.removeAttribute!="function"||typeof De.setAttribute!="function"||typeof De.namespaceURI!="string"||typeof De.insertBefore!="function"||typeof De.hasChildNodes!="function")},K2=function(De){return typeof Bn=="object"?De instanceof Bn:De&&typeof De=="object"&&typeof De.nodeType=="number"&&typeof De.nodeName=="string"},Uh=function(De,Ct,Xt){an[De]&&f(an[De],bo=>{bo.call(ke,Ct,Xt,HC)})},DK=function(De){let Ct;if(Uh("beforeSanitizeElements",De,null),pxe(De))return _0(De),!0;let Xt=Vs(De.nodeName);if(Uh("uponSanitizeElement",De,{tagName:Xt,allowedTags:ln}),De.hasChildNodes()&&!K2(De.firstElementChild)&&(!K2(De.content)||!K2(De.content.firstElementChild))&&E(/<[/\w]/g,De.innerHTML)&&E(/<[/\w]/g,De.textContent))return _0(De),!0;if(!ln[Xt]||Lr[Xt]){if(!Lr[Xt]&&PK(Xt)&&(Kn.tagNameCheck instanceof RegExp&&E(Kn.tagNameCheck,Xt)||Kn.tagNameCheck instanceof Function&&Kn.tagNameCheck(Xt)))return!1;if(PH&&!kC[Xt]){let bo=Br(De)||De.parentNode,ks=Us(De)||De.childNodes;if(ks&&bo){let Uu=ks.length;for(let gr=Uu-1;gr>=0;--gr)bo.insertBefore(er(ks[gr],!0),Fs(De))}}return _0(De),!0}return De instanceof jt&&!hxe(De)||(Xt==="noscript"||Xt==="noembed")&&E(/<\/no(script|embed)/i,De.innerHTML)?(_0(De),!0):(jr&&De.nodeType===3&&(Ct=De.textContent,Ct=x(Ct,Ji," "),Ct=x(Ct,go," "),Ct=x(Ct,$r," "),De.textContent!==Ct&&(p(ke.removed,{element:De.cloneNode()}),De.textContent=Ct)),Uh("afterSanitizeElements",De,null),!1)},IK=function(De,Ct,Xt){if(IH&&(Ct==="id"||Ct==="name")&&(Xt in pt||Xt in dxe))return!1;if(!(Pa&&!Xf[Ct]&&E(es,Ct))){if(!(cr&&E(ar,Ct))){if(!gn[Ct]||Xf[Ct]){if(!(PK(De)&&(Kn.tagNameCheck instanceof RegExp&&E(Kn.tagNameCheck,De)||Kn.tagNameCheck instanceof Function&&Kn.tagNameCheck(De))&&(Kn.attributeNameCheck instanceof RegExp&&E(Kn.attributeNameCheck,Ct)||Kn.attributeNameCheck instanceof Function&&Kn.attributeNameCheck(Ct))||Ct==="is"&&Kn.allowCustomizedBuiltInElements&&(Kn.tagNameCheck instanceof RegExp&&E(Kn.tagNameCheck,Xt)||Kn.tagNameCheck instanceof Function&&Kn.tagNameCheck(Xt))))return!1}else if(!OH[Ct]){if(!E(Un,x(Xt,Wr,""))){if(!((Ct==="src"||Ct==="xlink:href"||Ct==="href")&&De!=="script"&&C(Xt,"data:")===0&&xK[De])){if(!(Kf&&!E(Wi,x(Xt,Wr,"")))){if(Xt)return!1}}}}}}return!0},PK=function(De){return De.indexOf("-")>0},OK=function(De){let Ct,Xt,bo,ks;Uh("beforeSanitizeAttributes",De,null);let{attributes:Uu}=De;if(!Uu)return;let gr={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:gn};for(ks=Uu.length;ks--;){Ct=Uu[ks];let{name:xm,namespaceURI:FH}=Ct;if(Xt=xm==="value"?Ct.value:T(Ct.value),bo=Vs(xm),gr.attrName=bo,gr.attrValue=Xt,gr.keepAttr=!0,gr.forceKeepAttr=void 0,Uh("uponSanitizeAttribute",De,gr),Xt=gr.attrValue,gr.forceKeepAttr||(NH(xm,De),!gr.keepAttr))continue;if(!Nh&&E(/\/>/i,Xt)){NH(xm,De);continue}jr&&(Xt=x(Xt,Ji," "),Xt=x(Xt,go," "),Xt=x(Xt,$r," "));let MK=Vs(De.nodeName);if(IK(MK,bo,Xt)){if(yK&&(bo==="id"||bo==="name")&&(NH(xm,De),Xt=cxe+Xt),Mo&&typeof fi=="object"&&typeof fi.getAttributeType=="function"&&!FH)switch(fi.getAttributeType(MK,bo)){case"TrustedHTML":Xt=Mo.createHTML(Xt);break;case"TrustedScriptURL":Xt=Mo.createScriptURL(Xt);break}try{FH?De.setAttributeNS(FH,xm,Xt):De.setAttribute(xm,Xt),d(ke.removed)}catch{}}}Uh("afterSanitizeAttributes",De,null)},_xe=function bn(De){let Ct,Xt=vK(De);for(Uh("beforeSanitizeShadowDOM",De,null);Ct=Xt.nextNode();)Uh("uponSanitizeShadowNode",Ct,null),!DK(Ct)&&(Ct.content instanceof rt&&bn(Ct.content),OK(Ct));Uh("afterSanitizeShadowDOM",De,null)};return ke.sanitize=function(bn){let De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ct,Xt,bo,ks;if(MH=!bn,MH&&(bn=""),typeof bn!="string"&&!K2(bn)){if(typeof bn.toString!="function")throw S("toString is not a function");if(bn=bn.toString(),typeof bn!="string")throw S("dirty is not a string, aborting")}if(!ke.isSupported)return bn;if(h0||BH(De),ke.removed=[],typeof bn=="string"&&(KS=!1),KS){if(bn.nodeName){let xm=Vs(bn.nodeName);if(!ln[xm]||Lr[xm])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(bn instanceof Bn)Ct=wK(""),Xt=Ct.ownerDocument.importNode(bn,!0),Xt.nodeType===1&&Xt.nodeName==="BODY"||Xt.nodeName==="HTML"?Ct=Xt:Ct.appendChild(Xt);else{if(!ps&&!jr&&!pc&&bn.indexOf("<")===-1)return Mo&&UC?Mo.createHTML(bn):bn;if(Ct=wK(bn),!Ct)return ps?null:UC?Be:""}Ct&&Am&&_0(Ct.firstChild);let Uu=vK(KS?bn:Ct);for(;bo=Uu.nextNode();)DK(bo)||(bo.content instanceof rt&&_xe(bo.content),OK(bo));if(KS)return bn;if(ps){if(W_)for(ks=$e.call(Ct.ownerDocument);Ct.firstChild;)ks.appendChild(Ct.firstChild);else ks=Ct;return(gn.shadowroot||gn.shadowrootmod)&&(ks=zt.call(dt,ks,!0)),ks}let gr=pc?Ct.outerHTML:Ct.innerHTML;return pc&&ln["!doctype"]&&Ct.ownerDocument&&Ct.ownerDocument.doctype&&Ct.ownerDocument.doctype.name&&E(se,Ct.ownerDocument.doctype.name)&&(gr=" +`+gr),jr&&(gr=x(gr,Ji," "),gr=x(gr,go," "),gr=x(gr,$r," ")),Mo&&UC?Mo.createHTML(gr):gr},ke.setConfig=function(bn){BH(bn),h0=!0},ke.clearConfig=function(){HC=null,h0=!1},ke.isValidAttribute=function(bn,De,Ct){HC||BH({});let Xt=Vs(bn),bo=Vs(De);return IK(Xt,bo,Ct)},ke.addHook=function(bn,De){typeof De=="function"&&(an[bn]=an[bn]||[],p(an[bn],De))},ke.removeHook=function(bn){if(an[bn])return d(an[bn])},ke.removeHooks=function(bn){an[bn]&&(an[bn]=[])},ke.removeAllHooks=function(){an={}},ke}var Ve=Ie();return Ve})});var pre=Zc((Uhn,hre)=>{"use strict";hre.exports=yHe;var tM=1e20;function yHe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,u,f,d,p,g,h,A;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),r=p.width,s=p.height,g=d.getImageData(0,0,r,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,r=p.width,s=p.height,g=d.getImageData(0,0,r,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*s),h=0,A=Math.floor(u.length/f);h{function IHe(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,h=14,A=15,x=16,C=17,T=0,E=1,S=2,v=3,D=4;function O(_,b){return 55296<=_.charCodeAt(b)&&_.charCodeAt(b)<=56319&&56320<=_.charCodeAt(b+1)&&_.charCodeAt(b+1)<=57343}function M(_,b){b===void 0&&(b=0);var w=_.charCodeAt(b);if(55296<=w&&w<=56319&&b<_.length-1){var I=w,R=_.charCodeAt(b+1);return 56320<=R&&R<=57343?(I-55296)*1024+(R-56320)+65536:I}if(56320<=w&&w<=57343&&b>=1){var I=_.charCodeAt(b-1),R=w;return 55296<=I&&I<=56319?(I-55296)*1024+(R-56320)+65536:R}return w}function L(_,b,w){var I=[_].concat(b).concat([w]),R=I[I.length-2],F=w,k=I.lastIndexOf(h);if(k>1&&I.slice(1,k).every(function(U){return U==i})&&[i,g,C].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(R)==-1)return I.filter(function(U){return U==o}).length%2==1?v:D;if(R==e&&F==t)return T;if(R==n||R==e||R==t)return F==h&&b.every(function(U){return U==i})?S:E;if(F==n||F==e||F==t)return E;if(R==s&&(F==s||F==a||F==u||F==f))return T;if((R==u||R==a)&&(F==a||F==c))return T;if((R==f||R==c)&&F==c)return T;if(F==i||F==A)return T;if(F==r)return T;if(R==p)return T;var G=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,C].indexOf(I[G])!=-1&&I.slice(G+1,-1).every(function(U){return U==i})&&F==h||R==A&&[x,C].indexOf(F)!=-1?T:b.indexOf(o)!=-1?S:R==o&&F==o?T:E}this.nextBreak=function(_,b){if(b===void 0&&(b=0),b<0)return 0;if(b>=_.length-1)return _.length;for(var w=N(M(_,b)),I=[],R=b+1;R<_.length;R++)if(!O(_,R-1)){var F=N(M(_,R));if(L(w,I,F))return R;I.push(F)}return _.length},this.splitGraphemes=function(_){for(var b=[],w=0,I;(I=this.nextBreak(_,w))<_.length;)b.push(_.slice(w,I)),w=I;return w<_.length&&b.push(_.slice(w)),b},this.iterateGraphemes=function(_){var b=0,w={next:function(){var I,R;return(R=this.nextBreak(_,b))<_.length?(I=_.slice(b,R),b=R,{value:I,done:!1}):b<_.length?(I=_.slice(b),b=_.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(_){for(var b=0,w=0,I;(I=this.nextBreak(_,w))<_.length;)w=I,b++;return w<_.length&&b++,b};function N(_){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?c:_==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?h:_==8205?A:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?x:128102<=_&&_<=128105?C:d}return this}typeof tV<"u"&&tV.exports&&(tV.exports=IHe)});var nse=Zc((G0n,B6)=>{"use strict";B6.exports=cV;B6.exports.default=cV;function cV(e,t,n){n=n||2;var i=t&&t.length,o=i?t[0]*n:e.length,r=$re(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;var a,c,u,f,d,p,g;if(i&&(r=R8e(e,t,r,n)),e.length>80*n){a=u=e[0],c=f=e[1];for(var h=n;h u&&(u=d),p>f&&(f=p);g=Math.max(u-a,f-c),g=g!==0?32767/g:0}return SM(r,s,n,a,c,g,0),s}function $re(e,t,n,i,o){var r,s;if(o===R6(e,t,n,i)>0)for(r=t;r =t;r-=i)s=Qre(r,e[r],e[r+1],s);return s&&lV(s,s.next)&&(vM(s),s=s.next),s}function JA(e,t){if(!e)return e;t||(t=e);var n=e,i;do if(i=!1,!n.steiner&&(lV(n,n.next)||Er(n.prev,n,n.next)===0)){if(vM(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function SM(e,t,n,i,o,r,s){if(e){!s&&r&&U8e(e,i,o,r);for(var a=e,c,u;e.prev!==e.next;){if(c=e.prev,u=e.next,r?P8e(e,i,o,r):I8e(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),vM(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=O8e(JA(e),t,n),SM(e,t,n,i,o,r,2)):s===2&&M8e(e,t,n,i,o,r):SM(JA(e),t,n,i,o,r,1);break}}}}function I8e(e){var t=e.prev,n=e,i=e.next;if(Er(t,n,i)>=0)return!1;for(var o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=o r?o>s?o:s:r>s?r:s,g=a>c?a>u?a:u:c>u?c:u,h=i.next;h!==t;){if(h.x>=f&&h.x<=p&&h.y>=d&&h.y<=g&&dE(o,a,r,c,s,u,h.x,h.y)&&Er(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function P8e(e,t,n,i){var o=e.prev,r=e,s=e.next;if(Er(o,r,s)>=0)return!1;for(var a=o.x,c=r.x,u=s.x,f=o.y,d=r.y,p=s.y,g=a c?a>u?a:u:c>u?c:u,x=f>d?f>p?f:p:d>p?d:p,C=O6(g,h,t,n,i),T=O6(A,x,t,n,i),E=e.prevZ,S=e.nextZ;E&&E.z>=C&&S&&S.z<=T;){if(E.x>=g&&E.x<=A&&E.y>=h&&E.y<=x&&E!==o&&E!==s&&dE(a,f,c,d,u,p,E.x,E.y)&&Er(E.prev,E,E.next)>=0||(E=E.prevZ,S.x>=g&&S.x<=A&&S.y>=h&&S.y<=x&&S!==o&&S!==s&&dE(a,f,c,d,u,p,S.x,S.y)&&Er(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;E&&E.z>=C;){if(E.x>=g&&E.x<=A&&E.y>=h&&E.y<=x&&E!==o&&E!==s&&dE(a,f,c,d,u,p,E.x,E.y)&&Er(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;S&&S.z<=T;){if(S.x>=g&&S.x<=A&&S.y>=h&&S.y<=x&&S!==o&&S!==s&&dE(a,f,c,d,u,p,S.x,S.y)&&Er(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function O8e(e,t,n){var i=e;do{var o=i.prev,r=i.next.next;!lV(o,r)&&ese(o,i,i.next,r)&&wM(o,r)&&wM(r,o)&&(t.push(o.i/n|0),t.push(i.i/n|0),t.push(r.i/n|0),vM(i),vM(i.next),i=e=r),i=i.next}while(i!==e);return JA(i)}function M8e(e,t,n,i,o,r){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&z8e(s,a)){var c=tse(s,a);s=JA(s,s.next),c=JA(c,c.next),SM(s,t,n,i,o,r,0),SM(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function R8e(e,t,n,i){var o=[],r,s,a,c,u;for(r=0,s=t.length;r =n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>r&&(r=a,s=n.x=n.x&&n.x>=u&&i!==n.x&&dE(o s.x||n.x===s.x&&F8e(s,n)))&&(s=n,d=p)),n=n.next;while(n!==c);return s}function F8e(e,t){return Er(e.prev,e,t.prev)<0&&Er(t.next,e,e.next)<0}function U8e(e,t,n,i){var o=e;do o.z===0&&(o.z=O6(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,V8e(o)}function V8e(e){var t,n,i,o,r,s,a,c,u=1;do{for(n=e,e=null,r=null,s=0;n;){for(s++,i=n,a=0,t=0;t0||c>0&&i;)a!==0&&(c===0||!i||n.z<=i.z)?(o=n,n=n.nextZ,a--):(o=i,i=i.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;n=i}r.nextZ=null,u*=2}while(s>1);return e}function O6(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 k8e(e){var 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 z8e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!H8e(e,t)&&(wM(e,t)&&wM(t,e)&&G8e(e,t)&&(Er(e.prev,e,t.prev)||Er(e,t.prev,t))||lV(e,t)&&Er(e.prev,e,e.next)>0&&Er(t.prev,t,t.next)>0)}function Er(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function lV(e,t){return e.x===t.x&&e.y===t.y}function ese(e,t,n,i){var o=aV(Er(e,t,n)),r=aV(Er(e,t,i)),s=aV(Er(n,i,e)),a=aV(Er(n,i,t));return!!(o!==r&&s!==a||o===0&&sV(e,n,t)||r===0&&sV(e,i,t)||s===0&&sV(n,e,i)||a===0&&sV(n,t,i))}function sV(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 aV(e){return e>0?1:e<0?-1:0}function H8e(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&ese(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function wM(e,t){return Er(e.prev,e,e.next)<0?Er(e,t,e.next)>=0&&Er(e,e.prev,t)>=0:Er(e,t,e.prev)<0||Er(e,e.next,t)<0}function G8e(e,t){var n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function tse(e,t){var n=new M6(e.i,e.x,e.y),i=new M6(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 Qre(e,t,n,i){var o=new M6(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 vM(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 M6(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}cV.deviation=function(e,t,n,i){var o=t&&t.length,r=o?t[0]*n:e.length,s=Math.abs(R6(e,0,r,n));if(o)for(var a=0,c=t.length;a 0&&(i+=e[o-1].length,n.holes.push(i))}return n}});var Cue=Zc((uW,fW)=>{(function(e,t){typeof uW=="object"&&typeof fW<"u"?fW.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(uW,function(){"use strict";function e(x,C,T,E,S){(function v(D,O,M,L,N){for(;L>M;){if(L-M>600){var _=L-M+1,b=O-M+1,w=Math.log(_),I=.5*Math.exp(2*w/3),R=.5*Math.sqrt(w*I*(_-I)/_)*(b-_/2<0?-1:1),F=Math.max(M,Math.floor(O-b*I/_+R)),k=Math.min(L,Math.floor(O+(_-b)*I/_+R));v(D,O,F,k,N)}var V=D[O],G=M,U=L;for(t(D,M,O),N(D[L],V)>0&&t(D,M,L);G0;)U--}N(D[M],V)===0?t(D,M,U):t(D,++U,L),U<=O&&(M=U+1),O<=U&&(L=U-1)}})(x,C,T||0,E||x.length-1,S||n)}function t(x,C,T){var E=x[C];x[C]=x[T],x[T]=E}function n(x,C){return x C?1:0}var i=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(x,C,T){if(!T)return C.indexOf(x);for(var E=0;E =x.minX&&C.maxY>=x.minY}function h(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(x,C,T,E,S){for(var v=[C,T];v.length;)if(!((T=v.pop())-(C=v.pop())<=E)){var D=C+Math.ceil((T-C)/E/2)*E;e(x,D,C,T,S),v.push(C,D,D,T)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(x){var C=this.data,T=[];if(!g(x,C))return T;for(var E=this.toBBox,S=[];C;){for(var v=0;v =0&&S[C].children.length>this._maxEntries;)this._split(S,C),C--;this._adjustParentBBoxes(E,S,C)},i.prototype._split=function(x,C){var T=x[C],E=T.children.length,S=this._minEntries;this._chooseSplitAxis(T,S,E);var v=this._chooseSplitIndex(T,S,E),D=h(T.children.splice(v,T.children.length-v));D.height=T.height,D.leaf=T.leaf,r(T,this.toBBox),r(D,this.toBBox),C?x[C-1].children.push(D):this._splitRoot(T,D)},i.prototype._splitRoot=function(x,C){this.data=h([x,C]),this.data.height=x.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(x,C,T){for(var E,S,v,D,O,M,L,N=1/0,_=1/0,b=C;b<=T-C;b++){var w=s(x,0,b,this.toBBox),I=s(x,b,T,this.toBBox),R=(S=w,v=I,D=void 0,O=void 0,M=void 0,L=void 0,D=Math.max(S.minX,v.minX),O=Math.max(S.minY,v.minY),M=Math.min(S.maxX,v.maxX),L=Math.min(S.maxY,v.maxY),Math.max(0,M-D)*Math.max(0,L-O)),F=f(w)+f(I);R =C;N--){var _=x.children[N];a(D,x.leaf?S(_):_),O+=d(D)}return O},i.prototype._adjustParentBBoxes=function(x,C,T){for(var E=T;E>=0;E--)a(C[E],x)},i.prototype._condense=function(x){for(var C=x.length-1,T=void 0;C>=0;C--)x[C].children.length===0?C>0?(T=x[C-1].children).splice(T.indexOf(x[C]),1):this.clear():r(x[C],this.toBBox)},i})});var fq=Zc((exports,module)=>{/*! + * protobuf.js v7.2.3 (c) 2016, daniel wirtz + * compiled mon, 27 mar 2023 18:08:22 utc + * licensed under the bsd-3-clause license + * see: https://github.com/dcodeio/protobuf.js for details + */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,u=!0;c 1&&u.charAt(f)==="=";)++d;return Math.ceil(u.length*3)/4-d};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,d){for(var p=null,g=[],h=0,A=0,x;f >2],x=(C&3)<<4,A=1;break;case 1:g[h++]=o[x|C>>4],x=(C&15)<<2,A=2;break;case 2:g[h++]=o[x|C>>6],g[h++]=o[C&63],A=0;break}h>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),h=0)}return A&&(g[h++]=o[x],g[h++]=61,A===1&&(g[h++]=61)),p?(h&&p.push(String.fromCharCode.apply(String,g.slice(0,h))),p.join("")):String.fromCharCode.apply(String,g.slice(0,h))};var a="invalid encoding";i.decode=function(u,f,d){for(var p=d,g=0,h,A=0;A 1)break;if((x=r[x])===undefined)throw Error(a);switch(g){case 0:h=x,g=1;break;case 1:f[d++]=h<<2|(x&48)>>4,h=x,g=2;break;case 2:f[d++]=(h&15)<<4|(x&60)>>2,h=x,g=3;break;case 3:f[d++]=(h&3)<<6|x,g=0;break}}if(g===1)throw Error(a);return d-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],c=0;c 0?0:2147483648,g,h);else if(isNaN(p))d(2143289344,g,h);else if(p>34028234663852886e22)d((A<<31|2139095040)>>>0,g,h);else if(p<11754943508222875e-54)d((A<<31|Math.round(p/1401298464324817e-60))>>>0,g,h);else{var x=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-x)*8388608)&8388607;d((A<<31|x+127<<23|C)>>>0,g,h)}}c.writeFloatLE=u.bind(null,o),c.writeFloatBE=u.bind(null,r);function f(d,p,g){var h=d(p,g),A=(h>>31)*2+1,x=h>>>23&255,C=h&8388607;return x===255?C?NaN:A*(1/0):x===0?A*1401298464324817e-60*C:A*Math.pow(2,x-150)*(C+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),d=f[7]===128;function p(x,C,T){u[0]=x,C[T]=f[0],C[T+1]=f[1],C[T+2]=f[2],C[T+3]=f[3],C[T+4]=f[4],C[T+5]=f[5],C[T+6]=f[6],C[T+7]=f[7]}function g(x,C,T){u[0]=x,C[T]=f[7],C[T+1]=f[6],C[T+2]=f[5],C[T+3]=f[4],C[T+4]=f[3],C[T+5]=f[2],C[T+6]=f[1],C[T+7]=f[0]}c.writeDoubleLE=d?p:g,c.writeDoubleBE=d?g:p;function h(x,C){return f[0]=x[C],f[1]=x[C+1],f[2]=x[C+2],f[3]=x[C+3],f[4]=x[C+4],f[5]=x[C+5],f[6]=x[C+6],f[7]=x[C+7],u[0]}function A(x,C){return f[7]=x[C],f[6]=x[C+1],f[5]=x[C+2],f[4]=x[C+3],f[3]=x[C+4],f[2]=x[C+5],f[1]=x[C+6],f[0]=x[C+7],u[0]}c.readDoubleLE=d?h:A,c.readDoubleBE=d?A:h}():function(){function u(d,p,g,h,A,x){var C=h<0?1:0;if(C&&(h=-h),h===0)d(0,A,x+p),d(1/h>0?0:2147483648,A,x+g);else if(isNaN(h))d(0,A,x+p),d(2146959360,A,x+g);else if(h>17976931348623157e292)d(0,A,x+p),d((C<<31|2146435072)>>>0,A,x+g);else{var T;if(h<22250738585072014e-324)T=h/5e-324,d(T>>>0,A,x+p),d((C<<31|T/4294967296)>>>0,A,x+g);else{var E=Math.floor(Math.log(h)/Math.LN2);E===1024&&(E=1023),T=h*Math.pow(2,-E),d(T*4503599627370496>>>0,A,x+p),d((C<<31|E+1023<<20|T*1048576&1048575)>>>0,A,x+g)}}}c.writeDoubleLE=u.bind(null,o,0,4),c.writeDoubleBE=u.bind(null,r,4,0);function f(d,p,g,h,A){var x=d(h,A+p),C=d(h,A+g),T=(C>>31)*2+1,E=C>>>20&2047,S=4294967296*(C&1048575)+x;return E===2047?S?NaN:T*(1/0):E===0?T*5e-324*S:T*Math.pow(2,E-1075)*(S+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function o(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function r(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,u=null,f=a;return function(p){if(p<1||p>c)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,c=0;c 191&&p<224?f[d++]=(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[d++]=55296+(p>>10),f[d++]=56320+(p&1023)):f[d++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,d>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),d=0);return u?(d&&u.push(String.fromCharCode.apply(String,f.slice(0,d))),u.join("")):String.fromCharCode.apply(String,f.slice(0,d))},i.write=function(r,s,a){for(var c=a,u,f,d=0;d >6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(d+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++d,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-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(h,A){return RangeError("index out of range: "+h.pos+" + "+(A||1)+" > "+h.len)}function c(h){this.buf=h,this.pos=0,this.len=h.length}var u=typeof Uint8Array<"u"?function(A){if(A instanceof Uint8Array||Array.isArray(A))return new c(A);throw Error("illegal buffer")}:function(A){if(Array.isArray(A))return new c(A);throw Error("illegal buffer")},f=function(){return i.Buffer?function(x){return(c.create=function(T){return i.Buffer.isBuffer(T)?new o(T):u(T)})(x)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var A=4294967295;return function(){if(A=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(A=(A|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(A=(A|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(A=(A|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(A=(A|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return A;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return A}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var A=this.uint32();return A>>>1^-(A&1)|0};function d(){var h=new r(0,0),A=0;if(this.len-this.pos>4){for(;A<4;++A)if(h.lo=(h.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h;if(h.lo=(h.lo|(this.buf[this.pos]&127)<<28)>>>0,h.hi=(h.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return h;A=0}else{for(;A<3;++A){if(this.pos>=this.len)throw a(this);if(h.lo=(h.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}return h.lo=(h.lo|(this.buf[this.pos++]&127)<>>0,h}if(this.len-this.pos>4){for(;A<5;++A)if(h.hi=(h.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}else for(;A<5;++A){if(this.pos>=this.len)throw a(this);if(h.hi=(h.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(h,A){return(h[A-4]|h[A-3]<<8|h[A-2]<<16|h[A-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var A=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,A},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var A=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,A},c.prototype.bytes=function(){var A=this.uint32(),x=this.pos,C=this.pos+A;if(C>this.len)throw a(this,A);return this.pos+=A,Array.isArray(this.buf)?this.buf.slice(x,C):x===C?new this.buf.constructor(0):this._slice.call(this.buf,x,C)},c.prototype.string=function(){var A=this.bytes();return s.read(A,0,A.length)},c.prototype.skip=function(A){if(typeof A=="number"){if(this.pos+A>this.len)throw a(this,A);this.pos+=A}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(h){switch(h){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(h=this.uint32()&7)!==4;)this.skipType(h);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+h+" at offset "+this.pos)}return this},c._configure=function(h){o=h,c.create=f(),o._configure();var A=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[A](!1)},uint64:function(){return d.call(this)[A](!0)},sint64:function(){return d.call(this).zzDecode()[A](!1)},fixed64:function(){return g.call(this)[A](!0)},sfixed64:function(){return g.call(this)[A](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,u,f){if(!u)throw TypeError("request must be specified");var d=this;if(!f)return i.asPromise(r,d,s,a,c,u);if(!d.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return d.rpcImpl(s,a[d.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,h){if(g)return d.emit("error",g,s),f(g);if(h===null)return d.end(!0),undefined;if(!(h instanceof c))try{h=c[d.responseDelimited?"decodeDelimited":"decode"](h)}catch(A){return d.emit("error",A,s),f(A)}return d.emit("data",h,s),f(null,h)})}catch(p){return d.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(c,u){this.lo=c>>>0,this.hi=u>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var 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 d=u>>>0,p=(u-d)/4294967296>>>0;return f&&(p=~p>>>0,d=~d>>>0,++d>4294967295&&(d=0,++p>4294967295&&(p=0))),new o(d,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,d=~this.hi>>>0;return f||(d=d+1>>>0),-(f+d*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,d=this.hi>>>24;return d===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:d<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?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,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function o(s,a,c){for(var u=Object.keys(a),f=0;f -1;--d)if(c[f[d]]===1&&this[f[d]]!==undefined&&this[f[d]]!==null)return f[d]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u 127;)S[v++]=E&127|128,E>>>=7;S[v]=E}function A(E,S){this.len=E,this.next=undefined,this.val=S}A.prototype=Object.create(c.prototype),A.prototype.fn=h,d.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new A((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},d.prototype.int32=function(S){return S<0?this._push(x,10,r.fromNumber(S)):this.uint32(S)},d.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function x(E,S,v){for(;E.hi;)S[v++]=E.lo&127|128,E.lo=(E.lo>>>7|E.hi<<25)>>>0,E.hi>>>=7;for(;E.lo>127;)S[v++]=E.lo&127|128,E.lo=E.lo>>>7;S[v++]=E.lo}d.prototype.uint64=function(S){var v=r.from(S);return this._push(x,v.length(),v)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(S){var v=r.from(S).zzEncode();return this._push(x,v.length(),v)},d.prototype.bool=function(S){return this._push(g,1,S?1:0)};function C(E,S,v){S[v]=E&255,S[v+1]=E>>>8&255,S[v+2]=E>>>16&255,S[v+3]=E>>>24}d.prototype.fixed32=function(S){return this._push(C,4,S>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(S){var v=r.from(S);return this._push(C,4,v.lo)._push(C,4,v.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},d.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var T=i.Array.prototype.set?function(S,v,D){v.set(S,D)}:function(S,v,D){for(var O=0;O >>0;if(!v)return this._push(g,1,0);if(i.isString(S)){var D=d.alloc(v=s.length(S));s.decode(S,D,0),S=D}return this.uint32(v)._push(T,v,S)},d.prototype.string=function(S){var v=a.length(S);return v?this.uint32(v)._push(a.write,v,S):this._push(g,1,0)},d.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var S=this.head,v=this.tail,D=this.len;return this.reset().uint32(D),D&&(this.tail.next=S.next,this.tail=v,this.len+=D),this},d.prototype.finish=function(){for(var S=this.head.next,v=this.constructor.alloc(this.len),D=0;S;)S.fn(S.val,v,D),D+=S.len,S=S.next;return v},d._configure=function(E){o=E,d.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var d=0;d >>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?o.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}r.prototype.string=function(c){var u=o.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var b0e=Zc((Cxi,Bz)=>{/* 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,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),h=d.noDataValue!==null?d.noDataValue:o.defaultNoDataValue,A=r(g,d.pixelType||Float32Array,d.encodedMaskData,h,d.returnMask),x={width:g.width,height:g.height,pixelData:A.resultPixels,minValue:A.minValue,maxValue:g.pixels.maxValue,noDataValue:h};return A.resultMask&&(x.maskData=A.resultMask),d.returnEncodedMask&&g.mask&&(x.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(x.fileInfo=s(g),d.computeUsedBitDepths&&(x.fileInfo.bitDepths=a(g))),x};var r=function(f,d,p,g,h){var A=0,x=f.pixels.numBlocksX,C=f.pixels.numBlocksY,T=Math.floor(f.width/x),E=Math.floor(f.height/C),S=2*f.maxZError,v=Number.MAX_VALUE,D;p=p||(f.mask?f.mask.bitset:null);var O,M;O=new d(f.width*f.height),h&&p&&(M=new Uint8Array(f.width*f.height));for(var L=new Float32Array(T*E),N,_,b=0;b<=C;b++){var w=b!==C?E:f.height%C;if(w!==0)for(var I=0;I<=x;I++){var R=I!==x?T:f.width%x;if(R!==0){var F=b*f.width*E+I*T,k=f.width-R,V=f.pixels.blocks[A],G,U,q;V.encoding<2?(V.encoding===0?G=V.rawData:(u(V.stuffedData,V.bitsPerPixel,V.numValidPixels,V.offset,S,L,f.pixels.maxValue),G=L),U=0):V.encoding===2?q=0:q=V.offset;var Y;if(p)for(_=0;_ >3],Y<<=F&7),N=0;N >3]),Y&128?(M&&(M[F]=1),D=V.encoding<2?G[U++]:q,v=v>D?D:v,O[F++]=D):(M&&(M[F]=0),O[F++]=g),Y<<=1;F+=k}else if(V.encoding<2)for(_=0;_ D?D:v,O[F++]=D;F+=k}else for(v=v>q?q:v,_=0;_ 0){var x=new Uint8Array(Math.ceil(g.width*g.height/8));A=new DataView(f,d,g.mask.numBytes);var C=A.getInt16(0,!0),T=2,E=0;do{if(C>0)for(;C--;)x[E++]=A.getUint8(T++);else{var S=A.getUint8(T++);for(C=-C;C--;)x[E++]=S}C=A.getInt16(T,!0),T+=2}while(T 0?1:0),M=D+(g.height%D>0?1:0);g.pixels.blocks=new Array(O*M);for(var L=0,N=0;N 3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){d++;continue}if(R!==0&&R!==2){if(R>>=6,I.offsetType=R,R===2)I.offset=A.getInt8(1),b++;else if(R===1)I.offset=A.getInt16(1,!0),b+=2;else if(R===0)I.offset=A.getFloat32(1,!0),b+=4;else throw"Invalid block offset type";if(I.encoding===1)if(R=A.getUint8(b),b++,I.bitsPerPixel=R&63,R>>=6,I.numValidPixelsType=R,R===2)I.numValidPixels=A.getUint8(b),b++;else if(R===1)I.numValidPixels=A.getUint16(b,!0),b+=2;else if(R===0)I.numValidPixels=A.getUint32(b,!0),b+=4;else throw"Invalid valid pixel count type"}if(d+=b,I.encoding!==3){var F,k;if(I.encoding===0){var V=(g.pixels.numBytes-1)/4;if(V!==Math.floor(V))throw"uncompressed block has invalid length";F=new ArrayBuffer(V*4),k=new Uint8Array(F),k.set(new Uint8Array(f,d,V*4));var G=new Float32Array(F);I.rawData=G,d+=V*4}else if(I.encoding===1){var U=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),q=Math.ceil(U/4);F=new ArrayBuffer(q*4),k=new Uint8Array(F),k.set(new Uint8Array(f,d,U)),I.stuffedData=new Uint32Array(F),d+=U}}}return g.eofOffset=d,g},u=function(f,d,p,g,h,A,x){var C=(1< =d)v=D>>>S-d&C,S-=d;else{var L=d-S;v=(D&C)< >>S}A[E]=v =f?(S=v>>>E-f&x,E-=f):(D=f-E,S=(v&x)< >>E),u[T]=p[S];else for(O=Math.ceil((A-g)/h),T=0;T =f?(S=v>>>E-f&x,E-=f):(D=f-E,S=(v&x)< >>E),u[T]=S =u?(E=S>>>T-u&h,T-=u):(C=u-T,E=(S&h)< >>T),v[x]=E =f?(v=D>>>S&x,E-=f,S+=f):(O=f-E,v=D>>>S&x,D=c[C++],E=32-O,v|=(D&(1< =f?(v=D>>>S&x,E-=f,S+=f):(O=f-E,v=D>>>S&x,D=c[C++],E=32-O,v|=(D&(1< =u?(E=v>>>S&h,T-=u,S+=u):(C=u-T,E=v>>>S&h,v=c[A++],T=32-C,E|=(v&(1< =f?(x=C>>>A-f&p,A-=f):(T=f-A,x=(C&p)< >>A),u[h]=x;return u},originalUnstuff2:function(c,u,f,d){var p=(1< =f?(C=T>>>x&p,A-=f,x+=f):(E=f-A,C=T>>>x&p,T=c[g++],A=32-E,C|=(T&(1< =359?359:p;p-=h;do u+=c[g++]<<8,f+=u+=c[g++];while(--h);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),h=g.getInt32(0,!0);p.fileVersion=h,f+=4,h>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,h>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,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 A,x;if(h>=3&&(x=h>=4?52:48,A=this.computeChecksumFletcher32(new Uint8Array(c,f-x,p.blobSize-14)),A!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),h=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var A,x=!0;for(A=0;A 0){x=new Uint8Array(Math.ceil(p/8)),h=new DataView(c,f,A.numBytes);var T=h.getInt16(0,!0),E=2,S=0,v=0;do{if(T>0)for(;T--;)x[S++]=h.getUint8(E++);else for(v=h.getUint8(E++),T=-T;T--;)x[S++]=v;T=h.getInt16(E,!0),E+=2}while(E >3],D<<=O&7):D=x[O>>3],D&128&&(C[O]=1);u.pixels.resultMask=C,A.bitset=x,f+=A.numBytes}return u.ptr=f,u.mask=A,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,h=p.width*p.height,A=p.imageType,x=p.numValidPixel*r.getDataTypeSize(A)*g,C,T=u.pixels.resultMask;if(f===Uint8Array)C=new Uint8Array(c,d,x);else{var E=new ArrayBuffer(x),S=new Uint8Array(E);S.set(new Uint8Array(c,d,x)),C=new f(E)}if(C.length===h*g)u.pixels.resultPixels=C;else{u.pixels.resultPixels=new f(h*g);var v=0,D=0,O=0,M=0;if(g>1)for(O=0;O =A)return!1;var x=new Uint32Array(A-h);r.decodeBits(c,u,x);var C=[],T,E,S,v;for(T=h;T0&&(C[E].second=b<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,w++,b=N[w])):(_+=v-32,w++,b=N[w],C[E].second|=b>>>32-_));var I=0,R=0,F=new s;for(T=0;T =f?R=f:R=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var k=[],V,G,U,q,Y,Q;for(T=h;T0)if(V=[v,E],v<=R)for(G=C[E].second< =0;q--)Y=G>>>q&1,Y?(Q.right||(Q.right=new s),Q=Q.right):(Q.left||(Q.left=new s),Q=Q.left),q===0&&!Q.val&&(Q.val=V[1]);return{decodeLut:k,numBitsLUTQick:R,numBitsLUT:I,tree:F,stuffedData:N,srcPtr:w,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,h=u.headerInfo.width,A=h*g,x=this.readHuffmanTree(c,u),C=x.decodeLut,T=x.tree,E=x.stuffedData,S=x.srcPtr,v=x.bitPos,D=x.numBitsLUTQick,O=x.numBitsLUT,M=u.headerInfo.imageType===0?128:0,L,N,_,b=u.pixels.resultMask,w,I,R,F,k,V,G,U=0;v>0&&(S++,v=0);var q=E[S],Y=u.encodeMode===1,Q=new f(A*p),W=Q,K;for(K=0;K 1&&(W=new f(Q.buffer,A*K,A),U=0),u.headerInfo.numValidPixel===h*g)for(V=0,F=0;F >>32-D,I=w,32-v >>64-v-D,I=w),C[I])N=C[I][1],v+=C[I][0];else for(w=q< >>32-O,I=w,32-v >>64-v-O,I=w),L=T,G=0;G >>O-G-1&1,L=R?L.right:L.left,!(L.left||L.right)){N=L.val,v=v+G+1;break}v>=32&&(v-=32,S++,q=E[S]),_=N-M,Y?(k>0?_+=U:F>0?_+=W[V-h]:_+=U,_&=255,W[V]=_,U=_):W[V]=_}else for(V=0,F=0;F >>32-D,I=w,32-v >>64-v-D,I=w),C[I])N=C[I][1],v+=C[I][0];else for(w=q< >>32-O,I=w,32-v >>64-v-O,I=w),L=T,G=0;G >>O-G-1&1,L=R?L.right:L.left,!(L.left||L.right)){N=L.val,v=v+G+1;break}v>=32&&(v-=32,S++,q=E[S]),_=N-M,Y?(k>0&&b[V-1]?_+=U:F>0&&b[V-h]?_+=W[V-h]:_+=U,_&=255,W[V]=_,U=_):W[V]=_}u.ptr=u.ptr+(S+1)*4+(v>0?4:0)}u.pixels.resultPixels=Q},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,h=g.fileVersion,A=0,x=new DataView(c,u.ptr,5),C=x.getUint8(0);A++;var T=C>>6,E=T===0?4:3-T,S=(C&32)>0,v=C&31,D=0;if(E===1)D=x.getUint8(A),A++;else if(E===2)D=x.getUint16(A,!0),A+=2;else if(E===4)D=x.getUint32(A,!0),A+=4;else throw"Invalid valid pixel count type";var O=2*g.maxZError,M,L,N,_,b,w,I,R,F,k,V=g.numDims>1?g.maxValues[p]:g.zMax;if(S){for(u.counter.lut++,R=x.getUint8(A),F=v,A++,_=Math.ceil((R-1)*v/8),b=Math.ceil(_/4),L=new ArrayBuffer(b*4),N=new Uint8Array(L),u.ptr+=A,N.set(new Uint8Array(c,u.ptr,_)),I=new Uint32Array(L),u.ptr+=_,k=0;R-1>>>k;)k++;_=Math.ceil(D*k/8),b=Math.ceil(_/4),L=new ArrayBuffer(b*4),N=new Uint8Array(L),N.set(new Uint8Array(c,u.ptr,_)),M=new Uint32Array(L),u.ptr+=_,h>=3?w=o.unstuffLUT2(I,v,R-1,d,O,V):w=o.unstuffLUT(I,v,R-1,d,O,V),h>=3?o.unstuff2(M,f,k,D,w):o.unstuff(M,f,k,D,w)}else u.counter.bitstuffer++,k=v,u.ptr+=A,k>0&&(_=Math.ceil(D*k/8),b=Math.ceil(_/4),L=new ArrayBuffer(b*4),N=new Uint8Array(L),N.set(new Uint8Array(c,u.ptr,_)),M=new Uint32Array(L),u.ptr+=_,h>=3?d==null?o.originalUnstuff2(M,f,k,D):o.unstuff2(M,f,k,D,!1,d,O,V):d==null?o.originalUnstuff(M,f,k,D):o.unstuff(M,f,k,D,!1,d,O,V))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,h=d.microBlockSize,A=d.imageType,x=r.getDataTypeSize(A),C=Math.ceil(p/h),T=Math.ceil(g/h);u.pixels.numBlocksY=T,u.pixels.numBlocksX=C,u.pixels.ptr=0;var E=0,S=0,v=0,D=0,O=0,M=0,L=0,N=0,_=0,b=0,w=0,I=0,R=0,F=0,k=0,V=0,G,U,q,Y,Q,W,K=new f(h*h),J=g%h||h,_e=p%h||h,xe,se,Ae=d.numDims,me,Se=u.pixels.resultMask,Ie=u.pixels.resultPixels;for(v=0;v 1&&(Ie=new f(u.pixels.resultPixels.buffer,p*g*me*x,p*g)),L=c.byteLength-u.ptr,G=new DataView(c,u.ptr,Math.min(10,L)),U={},V=0,N=G.getUint8(0),V++,_=N>>6&255,b=N>>2&15,b!==(D*h>>3&15))throw"integrity issue";if(W=N&3,W>3)throw u.ptr+=V,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=V;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=V,R=O*M*x,F=c.byteLength-u.ptr,R=R 1)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(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var g=p.headerInfo,h=g.fileVersion,A=r.getDataTypeArray(g.imageType);r.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var x=g.width*g.height;if(p.pixels.resultPixels=new A(x*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(p);else if(h>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),T=C.getUint8(0);if(p.ptr++,T)r.readDataOneSweep(c,p,A);else if(h>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var E=C.getUint8(1);if(p.ptr++,p.encodeMode=E,E>2||h<4&&E>1)throw"Invalid Huffman flag "+E;E?r.readHuffman(c,p,A):r.readTiles(c,p,A)}else r.readTiles(c,p,A)}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 D=p.pixels.resultMask;for(d=0;d 1&&T.fileInfo.mask&&T.fileInfo.mask.numBytes>0&&h.push(T.maskData),d++,C.pixels.push(T.pixelData),C.statistics.push({minValue:T.minValue,maxValue:T.maxValue,noDataValue:T.noDataValue,dimStats:T.dimStats})}var E,S,v;if(f>1&&h.length>1){for(v=C.width*C.height,C.bandMasks=h,x=new Uint8Array(v),x.set(h[0]),E=1;E {KAe.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 QAe=Zc((YYi,ZAe)=>{var{webm:Cyt,mp4:Tyt}=JAe(),cK=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,lK=()=>"wakeLock"in navigator,uK=class{constructor(){if(this.enabled=!1,lK()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else cK()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",Cyt),this._addSourceToVideo(this.noSleepVideo,"mp4",Tyt),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return lK()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):cK()?(this.disable(),console.warn(` + NoSleep enabled for older iOS devices. This can interrupt + active or long-running network requests from completing successfully. + See https://github.com/richtr/NoSleep.js/issues/15 for more details. + `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){lK()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):cK()?this.noSleepTimer&&(console.warn(` + NoSleep now disabled for older iOS devices. + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};ZAe.exports=uK});var qyt={};Txe(qyt,{AlphaMode:()=>km,AlphaPipelineStage:()=>Z1,Animation:()=>a2,AnimationViewModel:()=>c2,Appearance:()=>eo,ApproximateTerrainHeights:()=>ri,ArcGISTiledElevationTerrainProvider:()=>lX,ArcGisBaseMapType:()=>rm,ArcGisMapServerImageryProvider:()=>Ah,ArcGisMapService:()=>Tu,ArcType:()=>Jt,ArticulationStageType:()=>Ka,AssociativeArray:()=>Et,AttributeCompression:()=>jn,AttributeType:()=>sn,AutoExposure:()=>hN,AutomaticUniforms:()=>kh,Axis:()=>ao,AxisAlignedBoundingBox:()=>sg,B3dmLoader:()=>p1,B3dmParser:()=>d1,BaseLayerPicker:()=>u2,BaseLayerPickerViewModel:()=>l2,BatchTable:()=>z0,BatchTableHierarchy:()=>hA,BatchTexture:()=>Oc,BatchTexturePipelineStage:()=>Q1,Billboard:()=>uo,BillboardCollection:()=>eu,BillboardGraphics:()=>ka,BillboardVisualizer:()=>oI,BingMapsGeocoderService:()=>fX,BingMapsImageryProvider:()=>Gb,BingMapsStyle:()=>zb,BlendEquation:()=>ma,BlendFunction:()=>Co,BlendOption:()=>To,BlendingState:()=>mn,BoundingRectangle:()=>Ke,BoundingSphere:()=>ae,BoundingSphereState:()=>ut,BoxEmitter:()=>YY,BoxGeometry:()=>ol,BoxGeometryUpdater:()=>CP,BoxGraphics:()=>eA,BoxOutlineGeometry:()=>id,BrdfLutGenerator:()=>hL,Buffer:()=>mt,BufferLoader:()=>xA,BufferUsage:()=>Fe,CPUStylingPipelineStage:()=>nO,CallbackProperty:()=>fd,Camera:()=>so,CameraEventAggregator:()=>TN,CameraEventType:()=>Oi,CameraFlightPath:()=>_L,Cartesian2:()=>H,Cartesian3:()=>m,Cartesian4:()=>re,Cartographic:()=>he,CartographicGeocoderService:()=>qF,CatmullRomSpline:()=>mX,Cesium3DContentGroup:()=>mA,Cesium3DTile:()=>pf,Cesium3DTileBatchTable:()=>_p,Cesium3DTileColorBlendMode:()=>ul,Cesium3DTileContent:()=>qY,Cesium3DTileContentFactory:()=>qA,Cesium3DTileContentState:()=>Uo,Cesium3DTileContentType:()=>ss,Cesium3DTileFeature:()=>xs,Cesium3DTileFeatureTable:()=>Ed,Cesium3DTileOptimizationHint:()=>lf,Cesium3DTileOptimizations:()=>MM,Cesium3DTilePass:()=>Po,Cesium3DTilePassState:()=>Nf,Cesium3DTilePointFeature:()=>Vp,Cesium3DTileRefine:()=>Lo,Cesium3DTileStyle:()=>k_,Cesium3DTileStyleEngine:()=>UM,Cesium3DTilesInspector:()=>_2,Cesium3DTilesInspectorViewModel:()=>p2,Cesium3DTilesVoxelProvider:()=>QY,Cesium3DTileset:()=>Ca,Cesium3DTilesetBaseTraversal:()=>WM,Cesium3DTilesetCache:()=>LM,Cesium3DTilesetGraphics:()=>aA,Cesium3DTilesetHeatmap:()=>NM,Cesium3DTilesetMetadata:()=>ty,Cesium3DTilesetMostDetailedTraversal:()=>zM,Cesium3DTilesetSkipTraversal:()=>qM,Cesium3DTilesetStatistics:()=>t_,Cesium3DTilesetTraversal:()=>ws,Cesium3DTilesetVisualizer:()=>XM,CesiumInspector:()=>A2,CesiumInspectorViewModel:()=>y2,CesiumTerrainProvider:()=>e0,CesiumWidget:()=>jN,Check:()=>Qc,CheckerboardMaterialProperty:()=>wE,CircleEmitter:()=>iF,CircleGeometry:()=>hX,CircleOutlineGeometry:()=>pX,ClassificationModelDrawCommand:()=>O1,ClassificationPipelineStage:()=>$1,ClassificationPrimitive:()=>yT,ClassificationType:()=>zn,ClearCommand:()=>ii,ClippingPlane:()=>OA,ClippingPlaneCollection:()=>os,Clock:()=>Ud,ClockRange:()=>Pr,ClockStep:()=>fo,ClockViewModel:()=>i2,CloudCollection:()=>oq,CloudType:()=>xS,Color:()=>z,ColorBlendMode:()=>Xa,ColorGeometryInstanceAttribute:()=>Vt,ColorMaterialProperty:()=>Ut,Command:()=>KX,ComponentDatatype:()=>X,Composite3DTileContent:()=>DP,CompositeEntityCollection:()=>c9,CompositeMaterialProperty:()=>DE,CompositePositionProperty:()=>Qs,CompositeProperty:()=>ec,CompressedTextureBuffer:()=>gw,ComputeCommand:()=>zu,ComputeEngine:()=>iw,ConditionsExpression:()=>ZN,ConeEmitter:()=>sq,ConstantPositionProperty:()=>wc,ConstantProperty:()=>$n,ConstantSpline:()=>A1,ContentMetadata:()=>CM,Context:()=>ZD,ContextLimits:()=>kt,CoplanarPolygonGeometry:()=>OR,CoplanarPolygonGeometryLibrary:()=>Kp,CoplanarPolygonOutlineGeometry:()=>mf,CornerType:()=>Ii,CorridorGeometry:()=>lx,CorridorGeometryLibrary:()=>Ni,CorridorGeometryUpdater:()=>iR,CorridorGraphics:()=>nA,CorridorOutlineGeometry:()=>nR,Credit:()=>It,CreditDisplay:()=>xL,CubeMap:()=>Ua,CubeMapFace:()=>Dm,CubicRealPolynomial:()=>V0,CullFace:()=>_i,CullingVolume:()=>Kr,CumulusCloud:()=>Mu,CustomDataSource:()=>cR,CustomHeightmapTerrainProvider:()=>_X,CustomShader:()=>IC,CustomShaderMode:()=>Fp,CustomShaderPipelineStage:()=>lO,CustomShaderTranslucencyMode:()=>Vg,CylinderGeometry:()=>lR,CylinderGeometryLibrary:()=>fx,CylinderGeometryUpdater:()=>fR,CylinderGraphics:()=>iA,CylinderOutlineGeometry:()=>uR,CzmlDataSource:()=>CR,DataSource:()=>Dr,DataSourceClock:()=>Vd,DataSourceCollection:()=>TR,DataSourceDisplay:()=>cB,DebugAppearance:()=>aq,DebugCameraPrimitive:()=>Th,DebugInspector:()=>PN,DebugModelMatrixPrimitive:()=>rF,DefaultProxy:()=>gX,DepthFunction:()=>za,DepthPlane:()=>DL,DequantizationPipelineStage:()=>fO,DerivedCommand:()=>M_,DeveloperError:()=>fe,DeviceOrientationCameraController:()=>PL,DirectionalLight:()=>cq,DiscardEmptyTileImagePolicy:()=>Hb,DiscardMissingTileImagePolicy:()=>kB,DistanceDisplayCondition:()=>Dt,DistanceDisplayConditionGeometryInstanceAttribute:()=>kn,DoubleEndedPriorityQueue:()=>mC,DoublyLinkedList:()=>BM,DracoLoader:()=>bp,DrawCommand:()=>it,DynamicGeometryBatch:()=>Ax,DynamicGeometryUpdater:()=>si,EarthOrientationParameters:()=>pw,EarthOrientationParametersSample:()=>X_,EasingFunction:()=>Or,EllipseGeometry:()=>Vc,EllipseGeometryLibrary:()=>El,EllipseGeometryUpdater:()=>bR,EllipseGraphics:()=>oA,EllipseOutlineGeometry:()=>lu,Ellipsoid:()=>oe,EllipsoidGeodesic:()=>Ku,EllipsoidGeometry:()=>Is,EllipsoidGeometryUpdater:()=>wR,EllipsoidGraphics:()=>rA,EllipsoidOutlineGeometry:()=>nu,EllipsoidPrimitive:()=>cL,EllipsoidRhumbLine:()=>pa,EllipsoidSurfaceAppearance:()=>lq,EllipsoidTangentPlane:()=>ha,EllipsoidTerrainProvider:()=>S_,EllipsoidalOccluder:()=>a_,Empty3DTileContent:()=>fE,EncodedCartesian3:()=>Wn,Entity:()=>Yo,EntityCluster:()=>iu,EntityCollection:()=>vs,EntityView:()=>uB,Event:()=>ge,EventHelper:()=>Sr,Expression:()=>Zu,ExpressionNodeType:()=>gt,ExtrapolationType:()=>ru,FeatureDetection:()=>Ht,FeatureIdPipelineStage:()=>Ug,Fog:()=>OL,ForEach:()=>Oe,FrameRateMonitor:()=>cF,FrameState:()=>ML,Framebuffer:()=>Hs,FramebufferManager:()=>di,FrustumCommands:()=>NL,FrustumGeometry:()=>qx,FrustumOutlineGeometry:()=>EL,Fullscreen:()=>lr,FullscreenButton:()=>C2,FullscreenButtonViewModel:()=>x2,GeoJsonDataSource:()=>mB,GeoJsonLoader:()=>_1,GeocodeType:()=>o0,Geocoder:()=>S2,GeocoderService:()=>zS,GeocoderViewModel:()=>b2,GeographicProjection:()=>Si,GeographicTilingScheme:()=>zi,Geometry:()=>ft,Geometry3DTileContent:()=>PP,GeometryAttribute:()=>ve,GeometryAttributes:()=>hn,GeometryFactory:()=>yX,GeometryInstance:()=>Tt,GeometryInstanceAttribute:()=>Ha,GeometryOffsetAttribute:()=>on,GeometryPipeline:()=>Nn,GeometryPipelineStage:()=>pO,GeometryType:()=>Hu,GeometryUpdater:()=>ai,GeometryVisualizer:()=>KR,GetFeatureInfoFormat:()=>Gx,Globe:()=>oL,GlobeDepth:()=>FL,GlobeSurfaceShaderSet:()=>VB,GlobeSurfaceTile:()=>Rf,GlobeSurfaceTileProvider:()=>XB,GlobeTranslucency:()=>KB,GlobeTranslucencyFramebuffer:()=>UL,GlobeTranslucencyState:()=>RL,GltfBufferViewLoader:()=>OT,GltfDracoLoader:()=>MT,GltfImageLoader:()=>RT,GltfIndexBufferLoader:()=>BT,GltfJsonLoader:()=>NT,GltfLoader:()=>zm,GltfLoaderUtil:()=>ml,GltfStructuralMetadataLoader:()=>c1,GltfTextureLoader:()=>FT,GltfVertexBufferLoader:()=>UT,GoogleEarthEnterpriseImageryProvider:()=>gq,GoogleEarthEnterpriseMapsProvider:()=>qb,GoogleEarthEnterpriseMetadata:()=>_m,GoogleEarthEnterpriseTerrainData:()=>HS,GoogleEarthEnterpriseTerrainProvider:()=>TX,GoogleEarthEnterpriseTileInformation:()=>uF,GpxDataSource:()=>gB,GregorianDate:()=>jh,GridImageryProvider:()=>yq,GridMaterialProperty:()=>UE,GroundGeometryUpdater:()=>qn,GroundPolylineGeometry:()=>J0,GroundPolylinePrimitive:()=>ad,GroundPrimitive:()=>bc,GroupMetadata:()=>EE,HeadingPitchRange:()=>du,HeadingPitchRoll:()=>Fa,Heap:()=>fw,HeightReference:()=>qe,HeightmapEncoding:()=>Pf,HeightmapTerrainData:()=>ba,HeightmapTessellator:()=>Nb,HermitePolynomialApproximation:()=>dR,HermiteSpline:()=>Lg,HilbertOrder:()=>vT,HomeButton:()=>E2,HomeButtonViewModel:()=>T2,HorizontalOrigin:()=>pi,I3SDataProvider:()=>AC,I3SFeature:()=>fF,I3SField:()=>dF,I3SGeometry:()=>TS,I3SLayer:()=>Zy,I3SNode:()=>ES,I3dmLoader:()=>y1,I3dmParser:()=>g1,Iau2000Orientation:()=>sL,Iau2006XysData:()=>_w,Iau2006XysSample:()=>O0,IauOrientationAxes:()=>aL,IauOrientationParameters:()=>rL,ImageBasedLighting:()=>dA,ImageBasedLightingPipelineStage:()=>N1,ImageMaterialProperty:()=>fg,Imagery:()=>eS,ImageryLayer:()=>Ls,ImageryLayerCollection:()=>JB,ImageryLayerFeatureInfo:()=>om,ImageryProvider:()=>Gc,ImageryState:()=>ui,Implicit3DTileContent:()=>kT,ImplicitAvailabilityBitstream:()=>IT,ImplicitMetadataView:()=>PT,ImplicitSubdivisionScheme:()=>Vr,ImplicitSubtree:()=>IA,ImplicitSubtreeCache:()=>eF,ImplicitSubtreeMetadata:()=>OP,ImplicitTileCoordinates:()=>sx,ImplicitTileset:()=>ny,IndexDatatype:()=>Ue,InfoBox:()=>v2,InfoBoxViewModel:()=>w2,InspectorShared:()=>Da,InstanceAttributeSemantic:()=>kr,InstancingPipelineStage:()=>q1,InterpolationAlgorithm:()=>EX,InterpolationType:()=>Cd,Intersect:()=>$t,IntersectionTests:()=>qi,Intersections2D:()=>z_,Interval:()=>Ac,InvertClassification:()=>fS,Ion:()=>md,IonGeocoderService:()=>JF,IonImageryProvider:()=>Bf,IonResource:()=>qs,IonWorldImageryStyle:()=>am,Iso8601:()=>Ge,JobScheduler:()=>BL,JobType:()=>ga,JsonMetadataTable:()=>vp,JulianDate:()=>ee,KTX2Transcoder:()=>yw,KeyboardEventModifier:()=>aa,KeyframeNode:()=>Ki,KmlCamera:()=>yB,KmlDataSource:()=>LB,KmlLookAt:()=>vB,KmlTour:()=>DB,KmlTourFlyTo:()=>OB,KmlTourWait:()=>MB,Label:()=>jg,LabelCollection:()=>Xm,LabelGraphics:()=>cd,LabelStyle:()=>Fo,LabelVisualizer:()=>JR,LagrangePolynomialApproximation:()=>mR,LeapSecond:()=>Vi,Light:()=>Cq,LightingModel:()=>Gm,LightingPipelineStage:()=>gO,LinearApproximation:()=>mx,LinearSpline:()=>Bg,ManagedArray:()=>Pc,MapMode2D:()=>Ml,MapProjection:()=>wX,MapboxImageryProvider:()=>Kb,MapboxStyleImageryProvider:()=>Tq,Material:()=>ki,MaterialAppearance:()=>ro,MaterialPipelineStage:()=>AO,MaterialProperty:()=>jo,Math:()=>P,Matrix2:()=>Qi,Matrix3:()=>Z,Matrix4:()=>B,Megatexture:()=>SS,MetadataClass:()=>yd,MetadataClassProperty:()=>xg,MetadataComponentType:()=>nn,MetadataEntity:()=>Fn,MetadataEnum:()=>XP,MetadataEnumValue:()=>qP,MetadataPipelineStage:()=>ef,MetadataSchema:()=>Ad,MetadataSchemaLoader:()=>VT,MetadataSemantic:()=>PA,MetadataTable:()=>fl,MetadataTableProperty:()=>RP,MetadataType:()=>Wt,MipmapHint:()=>Im,Model:()=>wd,Model3DTileContent:()=>jm,ModelAlphaOptions:()=>LO,ModelAnimation:()=>E1,ModelAnimationChannel:()=>T1,ModelAnimationCollection:()=>b1,ModelAnimationLoop:()=>_l,ModelAnimationState:()=>bd,ModelArticulation:()=>U1,ModelArticulationStage:()=>F1,ModelClippingPlanesPipelineStage:()=>z1,ModelColorPipelineStage:()=>Fg,ModelComponents:()=>Nt,ModelDrawCommand:()=>M1,ModelFeature:()=>S1,ModelFeatureTable:()=>v1,ModelGraphics:()=>lp,ModelLightingOptions:()=>GO,ModelMatrixUpdateStage:()=>X1,ModelNode:()=>H1,ModelRenderResources:()=>NO,ModelRuntimeNode:()=>J1,ModelRuntimePrimitive:()=>RO,ModelSceneGraph:()=>jO,ModelSilhouettePipelineStage:()=>VO,ModelSkin:()=>BO,ModelSplitterPipelineStage:()=>zO,ModelStatistics:()=>YO,ModelType:()=>Bo,ModelUtility:()=>Zt,ModelVisualizer:()=>QR,Moon:()=>uL,MorphTargetsPipelineStage:()=>CO,MorphWeightSpline:()=>vX,MortonOrder:()=>iy,Multiple3DTileContent:()=>bM,MultisampleFramebuffer:()=>QD,NavigationHelpButton:()=>I2,NavigationHelpButtonViewModel:()=>D2,NearFarScalar:()=>Lt,NeverTileDiscardPolicy:()=>bq,NodeRenderResources:()=>HO,NodeStatisticsPipelineStage:()=>K1,NodeTransformationProperty:()=>sA,OIT:()=>kL,Occluder:()=>fL,OctahedralProjectedCubeMap:()=>dd,OffsetGeometryInstanceAttribute:()=>Yi,OpenCageGeocoderService:()=>IX,OpenStreetMapImageryProvider:()=>xC,OrderedGroundPrimitiveCollection:()=>ER,OrientedBoundingBox:()=>Mn,OrthographicFrustum:()=>tn,OrthographicOffCenterFrustum:()=>xr,Packable:()=>PX,PackableForInterpolation:()=>OX,Particle:()=>wS,ParticleBurst:()=>wq,ParticleEmitter:()=>vq,ParticleSystem:()=>Dq,Pass:()=>be,PassState:()=>Va,PathGraphics:()=>up,PathVisualizer:()=>eB,PeliasGeocoderService:()=>KF,PerInstanceColorAppearance:()=>rn,PerformanceDisplay:()=>R_,PerformanceWatchdog:()=>O2,PerformanceWatchdogViewModel:()=>P2,PerspectiveFrustum:()=>bi,PerspectiveOffCenterFrustum:()=>jc,PickDepth:()=>LL,PickDepthFramebuffer:()=>HL,PickFramebuffer:()=>jL,Picking:()=>KL,PickingPipelineStage:()=>TO,PinBuilder:()=>C_,PixelDatatype:()=>Je,PixelFormat:()=>ct,Plane:()=>un,PlaneGeometry:()=>vR,PlaneGeometryUpdater:()=>IR,PlaneGraphics:()=>hP,PlaneOutlineGeometry:()=>DR,PntsLoader:()=>rE,PntsParser:()=>zA,PointCloud:()=>gF,PointCloudEyeDomeLighting:()=>Ip,PointCloudShading:()=>Hm,PointCloudStylingPipelineStage:()=>bO,PointGraphics:()=>cA,PointPrimitive:()=>Ds,PointPrimitiveCollection:()=>RE,PointVisualizer:()=>nB,PolygonGeometry:()=>Ex,PolygonGeometryLibrary:()=>Yn,PolygonGeometryUpdater:()=>RR,PolygonGraphics:()=>ld,PolygonHierarchy:()=>vc,PolygonOutlineGeometry:()=>MR,PolygonPipeline:()=>li,Polyline:()=>sf,PolylineArrowMaterialProperty:()=>kE,PolylineCollection:()=>Id,PolylineColorAppearance:()=>Fr,PolylineDashMaterialProperty:()=>HE,PolylineGeometry:()=>x_,PolylineGeometryUpdater:()=>rB,PolylineGlowMaterialProperty:()=>WE,PolylineGraphics:()=>Ga,PolylineMaterialAppearance:()=>js,PolylineOutlineMaterialProperty:()=>fy,PolylinePipeline:()=>Di,PolylineVisualizer:()=>aB,PolylineVolumeGeometry:()=>NR,PolylineVolumeGeometryLibrary:()=>Bd,PolylineVolumeGeometryUpdater:()=>kR,PolylineVolumeGraphics:()=>lA,PolylineVolumeOutlineGeometry:()=>VR,PositionProperty:()=>ap,PositionPropertyArray:()=>f_,PostProcessStage:()=>_o,PostProcessStageCollection:()=>yN,PostProcessStageComposite:()=>Yc,PostProcessStageLibrary:()=>Uf,PostProcessStageSampleMode:()=>wu,PostProcessStageTextureCache:()=>rC,Primitive:()=>wn,PrimitiveCollection:()=>Tl,PrimitiveLoadPlan:()=>LA,PrimitiveOutlineGenerator:()=>BA,PrimitiveOutlinePipelineStage:()=>vO,PrimitivePipeline:()=>q0,PrimitiveRenderResources:()=>WO,PrimitiveState:()=>dr,PrimitiveStatisticsPipelineStage:()=>DO,PrimitiveType:()=>Le,ProjectionPicker:()=>R2,ProjectionPickerViewModel:()=>M2,Property:()=>j,PropertyArray:()=>YE,PropertyAttribute:()=>RA,PropertyAttributeProperty:()=>o1,PropertyBag:()=>cl,PropertyTable:()=>Mc,PropertyTexture:()=>MA,PropertyTextureProperty:()=>i1,ProviderViewModel:()=>hs,Proxy:()=>MX,QuadraticRealPolynomial:()=>Cc,QuadtreeOccluders:()=>ZB,QuadtreePrimitive:()=>iL,QuadtreeTile:()=>QB,QuadtreeTileLoadState:()=>Rs,QuadtreeTileProvider:()=>Bq,QuantizedMeshTerrainData:()=>TC,QuarticRealPolynomial:()=>UI,Quaternion:()=>Ne,QuaternionSpline:()=>C1,Queue:()=>Zg,Ray:()=>Dn,Rectangle:()=>le,RectangleCollisionChecker:()=>vx,RectangleGeometry:()=>Sx,RectangleGeometryLibrary:()=>as,RectangleGeometryUpdater:()=>zR,RectangleGraphics:()=>ud,RectangleOutlineGeometry:()=>ZA,ReferenceFrame:()=>no,ReferenceProperty:()=>d_,RenderState:()=>ze,Renderbuffer:()=>Gl,RenderbufferFormat:()=>gc,Request:()=>Ho,RequestErrorEvent:()=>Sm,RequestScheduler:()=>La,RequestState:()=>ei,RequestType:()=>Xr,Resource:()=>we,ResourceCache:()=>Bi,ResourceCacheKey:()=>hl,ResourceCacheStatistics:()=>QP,ResourceLoader:()=>io,ResourceLoaderState:()=>vt,Rotation:()=>xf,RuntimeError:()=>de,S2Cell:()=>xp,SDFSettings:()=>bs,SampledPositionProperty:()=>ea,SampledProperty:()=>au,Sampler:()=>dn,ScaledPositionProperty:()=>ah,Scene:()=>MN,SceneFramebuffer:()=>Qx,SceneMode:()=>ne,SceneMode2DPipelineStage:()=>IO,SceneModePicker:()=>L2,SceneModePickerViewModel:()=>B2,SceneTransforms:()=>Xi,SceneTransitioner:()=>CN,ScreenSpaceCameraController:()=>SN,ScreenSpaceEventHandler:()=>Du,ScreenSpaceEventType:()=>Cn,SelectedFeatureIdPipelineStage:()=>kg,SelectionIndicator:()=>U2,SelectionIndicatorViewModel:()=>F2,ShaderBuilder:()=>L0,ShaderCache:()=>jD,ShaderDestination:()=>Te,ShaderFunction:()=>tI,ShaderProgram:()=>Kt,ShaderSource:()=>He,ShaderStruct:()=>eI,ShadowMap:()=>N_,ShadowMapShader:()=>wh,ShadowMode:()=>xn,ShadowVolumeAppearance:()=>ql,ShowGeometryInstanceAttribute:()=>An,Simon1994PlanetaryPositions:()=>ng,SimplePolylineGeometry:()=>RX,SingleTileImageryProvider:()=>Jb,SkinningPipelineStage:()=>OO,SkyAtmosphere:()=>LN,SkyBox:()=>UN,SpatialNode:()=>AF,SphereEmitter:()=>Nq,SphereGeometry:()=>BX,SphereOutlineGeometry:()=>Zp,Spherical:()=>hR,Spline:()=>oo,SplitDirection:()=>Rc,Splitter:()=>vS,StaticGeometryColorBatch:()=>Ef,StaticGeometryPerMaterialBatch:()=>bf,StaticGroundGeometryColorBatch:()=>hb,StaticGroundGeometryPerMaterialBatch:()=>HR,StaticGroundPolylinePerMaterialBatch:()=>sB,StaticOutlineGeometryBatch:()=>gb,StencilConstants:()=>Ft,StencilFunction:()=>Hn,StencilOperation:()=>ht,SteppedSpline:()=>x1,StripeMaterialProperty:()=>XE,StripeOrientation:()=>zd,StructuralMetadata:()=>ya,StyleCommandsNeeded:()=>Sd,StyleExpression:()=>Fq,Sun:()=>WN,SunLight:()=>Qh,SunPostProcess:()=>DN,SupportedImageFormats:()=>l1,SvgPathBindingHandler:()=>t2,TaskProcessor:()=>hi,Terrain:()=>EF,TerrainData:()=>im,TerrainEncoding:()=>sc,TerrainExaggeration:()=>Tc,TerrainFillMesh:()=>oS,TerrainMesh:()=>Mf,TerrainOffsetProperty:()=>uA,TerrainProvider:()=>zr,TerrainQuantization:()=>Ms,TerrainState:()=>po,Texture:()=>Bt,TextureAtlas:()=>Wg,TextureCache:()=>YD,TextureMagnificationFilter:()=>xi,TextureManager:()=>GF,TextureMinificationFilter:()=>cn,TextureUniform:()=>WX,TextureWrap:()=>vn,TileAvailability:()=>gm,TileBoundingRegion:()=>df,TileBoundingS2Cell:()=>PM,TileBoundingSphere:()=>Qp,TileBoundingVolume:()=>Gq,TileCoordinatesImageryProvider:()=>SF,TileDiscardPolicy:()=>jq,TileEdge:()=>yn,TileImagery:()=>tS,TileMapServiceImageryProvider:()=>xh,TileMetadata:()=>TM,TileOrientedBoundingBox:()=>hf,TileProviderError:()=>yi,TileReplacementQueue:()=>$B,TileSelectionResult:()=>Qn,TileState:()=>Yq,Tileset3DTileContent:()=>KO,TilesetMetadata:()=>OM,TilesetPipelineStage:()=>B1,TilingScheme:()=>LX,TimeConstants:()=>Zn,TimeDynamicImagery:()=>Wx,TimeDynamicPointCloud:()=>RS,TimeInterval:()=>Tn,TimeIntervalCollection:()=>vr,TimeIntervalCollectionPositionProperty:()=>m_,TimeIntervalCollectionProperty:()=>h_,TimeStandard:()=>Jn,Timeline:()=>z2,TimelineHighlightRange:()=>V2,TimelineTrack:()=>k2,Tipsify:()=>GI,ToggleButtonViewModel:()=>l0,Tonemapper:()=>Yy,Transforms:()=>Rt,TranslationRotationScale:()=>dg,TranslucentTileClassification:()=>qL,TridiagonalSystemSolver:()=>XT,TrustedServers:()=>eT,TweenCollection:()=>lC,UniformState:()=>JD,UniformType:()=>LS,UrlTemplateImageryProvider:()=>Bs,VERSION:()=>Yyt,VRButton:()=>G2,VRButtonViewModel:()=>H2,VRTheWorldTerrainProvider:()=>FX,VaryingType:()=>jX,Vector3DTileBatch:()=>Fm,Vector3DTileClampedPolylines:()=>yM,Vector3DTileContent:()=>xM,Vector3DTileGeometry:()=>yp,Vector3DTilePoints:()=>fM,Vector3DTilePolygons:()=>dM,Vector3DTilePolylines:()=>YA,Vector3DTilePrimitive:()=>gA,VelocityOrientationProperty:()=>_R,VelocityVectorProperty:()=>gx,VertexArray:()=>oi,VertexArrayFacade:()=>ep,VertexAttributeSemantic:()=>bt,VertexFormat:()=>Pe,VerticalOrigin:()=>On,VideoSynchronizer:()=>UX,View:()=>tC,Viewer:()=>fK,ViewportQuad:()=>Kq,Visibility:()=>sr,Visualizer:()=>J7,VoxelBoxShape:()=>Oh,VoxelContent:()=>tF,VoxelCylinderShape:()=>Mh,VoxelEllipsoidShape:()=>hC,VoxelInspector:()=>j2,VoxelInspectorViewModel:()=>W2,VoxelPrimitive:()=>FS,VoxelProvider:()=>$q,VoxelRenderResources:()=>VF,VoxelShape:()=>eX,VoxelShapeType:()=>Gi,VoxelTraversal:()=>BS,VulkanConstants:()=>VX,WallGeometry:()=>WR,WallGeometryLibrary:()=>Dx,WallGeometryUpdater:()=>qR,WallGraphics:()=>fp,WallOutlineGeometry:()=>YR,WebGLConstants:()=>te,WebMapServiceImageryProvider:()=>Zb,WebMapTileServiceImageryProvider:()=>Qb,WebMercatorProjection:()=>vi,WebMercatorTilingScheme:()=>Mr,WindingOrder:()=>qr,WireframeIndexGenerator:()=>iE,WireframePipelineStage:()=>MO,_shadersAcesTonemappingStage:()=>JL,_shadersAdditiveBlend:()=>wN,_shadersAdjustTranslucentFS:()=>dS,_shadersAllMaterialAppearanceFS:()=>aI,_shadersAllMaterialAppearanceVS:()=>cI,_shadersAmbientOcclusionGenerate:()=>ZL,_shadersAmbientOcclusionModulate:()=>QL,_shadersAspectRampMaterial:()=>mI,_shadersAtmosphereCommon:()=>w_,_shadersBasicMaterialAppearanceFS:()=>lI,_shadersBasicMaterialAppearanceVS:()=>uI,_shadersBillboardCollectionFS:()=>JO,_shadersBillboardCollectionVS:()=>ZO,_shadersBlackAndWhite:()=>$L,_shadersBloomComposite:()=>eN,_shadersBrdfLutGeneratorFS:()=>dL,_shadersBrightPass:()=>vN,_shadersBrightness:()=>tN,_shadersBumpMapMaterial:()=>hI,_shadersCPUStylingStageFS:()=>tO,_shadersCPUStylingStageVS:()=>eO,_shadersCheckerboardMaterial:()=>pI,_shadersCloudCollectionFS:()=>YN,_shadersCloudCollectionVS:()=>qN,_shadersCloudNoiseFS:()=>XN,_shadersCloudNoiseVS:()=>KN,_shadersCompareAndPackTranslucentDepth:()=>YL,_shadersCompositeOITFS:()=>VL,_shadersCompositeTranslucentClassification:()=>eC,_shadersContrastBias:()=>nN,_shadersCustomShaderStageFS:()=>oO,_shadersCustomShaderStageVS:()=>iO,_shadersCzmBuiltins:()=>M0,_shadersDepthOfField:()=>iN,_shadersDepthPlaneFS:()=>bL,_shadersDepthPlaneVS:()=>SL,_shadersDepthView:()=>oN,_shadersDepthViewPacked:()=>GX,_shadersDotMaterial:()=>_I,_shadersEdgeDetection:()=>rN,_shadersElevationBandMaterial:()=>gI,_shadersElevationContourMaterial:()=>yI,_shadersElevationRampMaterial:()=>AI,_shadersEllipsoidFS:()=>sS,_shadersEllipsoidSurfaceAppearanceFS:()=>sF,_shadersEllipsoidSurfaceAppearanceVS:()=>aF,_shadersEllipsoidVS:()=>aS,_shadersFXAA:()=>aN,_shadersFXAA3_11:()=>mN,_shadersFadeMaterial:()=>xI,_shadersFeatureIdStageFS:()=>rO,_shadersFeatureIdStageVS:()=>sO,_shadersFilmicTonemapping:()=>sN,_shadersGaussianBlur1D:()=>jy,_shadersGeometryStageFS:()=>dO,_shadersGeometryStageVS:()=>mO,_shadersGlobeFS:()=>FB,_shadersGlobeVS:()=>UB,_shadersGridMaterial:()=>CI,_shadersGroundAtmosphere:()=>Ub,_shadersHSBToRGB:()=>hv,_shadersHSLToRGB:()=>pv,_shadersImageBasedLightingStageFS:()=>L1,_shadersInstancingStageCommon:()=>G1,_shadersInstancingStageVS:()=>W1,_shadersIntersectBox:()=>OF,_shadersIntersectClippingPlanes:()=>PF,_shadersIntersectCylinder:()=>MF,_shadersIntersectDepth:()=>IF,_shadersIntersectEllipsoid:()=>RF,_shadersIntersection:()=>vC,_shadersIntersectionUtils:()=>DF,_shadersLegacyInstancingStageVS:()=>j1,_shadersLensFlare:()=>cN,_shadersLightingStageFS:()=>_O,_shadersMaterialStageFS:()=>yO,_shadersMegatexture:()=>UF,_shadersMetadataStageFS:()=>aO,_shadersMetadataStageVS:()=>cO,_shadersModelClippingPlanesStageFS:()=>k1,_shadersModelColorStageFS:()=>V1,_shadersModelFS:()=>D1,_shadersModelSilhouetteStageFS:()=>FO,_shadersModelSilhouetteStageVS:()=>UO,_shadersModelSplitterStageFS:()=>kO,_shadersModelVS:()=>I1,_shadersModifiedReinhardTonemapping:()=>lN,_shadersMorphTargetsStageVS:()=>xO,_shadersNightVision:()=>uN,_shadersNormalMapMaterial:()=>TI,_shadersOctahedralProjectionAtlasFS:()=>TP,_shadersOctahedralProjectionFS:()=>EP,_shadersOctahedralProjectionVS:()=>bP,_shadersOctree:()=>FF,_shadersPassThrough:()=>Rl,_shadersPassThroughDepth:()=>Hy,_shadersPerInstanceColorAppearanceFS:()=>MI,_shadersPerInstanceColorAppearanceVS:()=>RI,_shadersPerInstanceFlatColorAppearanceFS:()=>U0,_shadersPerInstanceFlatColorAppearanceVS:()=>BI,_shadersPointCloudEyeDomeLighting:()=>u1,_shadersPointCloudStylingStageVS:()=>EO,_shadersPointPrimitiveCollectionFS:()=>uy,_shadersPointPrimitiveCollectionVS:()=>oR,_shadersPolylineArrowMaterial:()=>EI,_shadersPolylineColorAppearanceVS:()=>tP,_shadersPolylineCommon:()=>Xl,_shadersPolylineDashMaterial:()=>bI,_shadersPolylineFS:()=>Q0,_shadersPolylineGlowMaterial:()=>SI,_shadersPolylineMaterialAppearanceVS:()=>nP,_shadersPolylineOutlineMaterial:()=>wI,_shadersPolylineShadowVolumeFS:()=>ZI,_shadersPolylineShadowVolumeMorphFS:()=>QI,_shadersPolylineShadowVolumeMorphVS:()=>$I,_shadersPolylineShadowVolumeVS:()=>eP,_shadersPolylineVS:()=>rM,_shadersPrimitiveOutlineStageFS:()=>wO,_shadersPrimitiveOutlineStageVS:()=>SO,_shadersRGBToHSB:()=>_v,_shadersRGBToHSL:()=>gv,_shadersRGBToXYZ:()=>yv,_shadersReinhardTonemapping:()=>fN,_shadersReprojectWebMercatorFS:()=>jB,_shadersReprojectWebMercatorVS:()=>YB,_shadersRimLightingMaterial:()=>vI,_shadersSelectedFeatureIdStageCommon:()=>nE,_shadersShadowVolumeAppearanceFS:()=>_T,_shadersShadowVolumeAppearanceVS:()=>VI,_shadersShadowVolumeFS:()=>ag,_shadersSilhouette:()=>dN,_shadersSkinningStageVS:()=>PO,_shadersSkyAtmosphereCommon:()=>_S,_shadersSkyAtmosphereFS:()=>RN,_shadersSkyAtmosphereVS:()=>BN,_shadersSkyBoxFS:()=>NN,_shadersSkyBoxVS:()=>FN,_shadersSlopeRampMaterial:()=>DI,_shadersStripeMaterial:()=>II,_shadersSunFS:()=>VN,_shadersSunTextureFS:()=>kN,_shadersSunVS:()=>zN,_shadersTexturedMaterialAppearanceFS:()=>fI,_shadersTexturedMaterialAppearanceVS:()=>dI,_shadersVector3DTileClampedPolylinesFS:()=>_M,_shadersVector3DTileClampedPolylinesVS:()=>pM,_shadersVector3DTilePolylinesVS:()=>mM,_shadersVectorTileVS:()=>wT,_shadersViewportQuadFS:()=>JN,_shadersViewportQuadVS:()=>x0,_shadersVoxelFS:()=>wF,_shadersVoxelVS:()=>vF,_shadersWater:()=>PI,_shadersXYZToRGB:()=>Av,_shadersacesTonemapping:()=>xv,_shadersalphaWeight:()=>Cv,_shadersantialias:()=>Tv,_shadersapproximateSphericalCoordinates:()=>Ev,_shadersbackFacing:()=>bv,_shadersbranchFreeTernary:()=>Sv,_shaderscascadeColor:()=>wv,_shaderscascadeDistance:()=>vv,_shaderscascadeMatrix:()=>Dv,_shaderscascadeWeights:()=>Iv,_shaderscolumbusViewMorph:()=>Pv,_shaderscomputePosition:()=>Ov,_shadersconvertUvToBox:()=>BF,_shadersconvertUvToCylinder:()=>LF,_shadersconvertUvToEllipsoid:()=>NF,_shaderscosineAndSine:()=>Mv,_shadersdecompressTextureCoordinates:()=>Rv,_shadersdefaultPbrMaterial:()=>Bv,_shadersdegreesPerRadian:()=>Cw,_shadersdepthClamp:()=>Lv,_shadersdepthRange:()=>Tw,_shadersdepthRangeStruct:()=>rv,_shaderseastNorthUpToEyeCoordinates:()=>Nv,_shadersellipsoidContainsPoint:()=>Fv,_shadersellipsoidWgs84TextureCoordinates:()=>Uv,_shadersepsilon1:()=>Ew,_shadersepsilon2:()=>bw,_shadersepsilon3:()=>Sw,_shadersepsilon4:()=>ww,_shadersepsilon5:()=>vw,_shadersepsilon6:()=>Dw,_shadersepsilon7:()=>Iw,_shadersequalsEpsilon:()=>Vv,_shaderseyeOffset:()=>kv,_shaderseyeToWindowCoordinates:()=>zv,_shadersfastApproximateAtan:()=>Hv,_shadersfog:()=>Gv,_shadersgammaCorrect:()=>Wv,_shadersgeodeticSurfaceNormal:()=>jv,_shadersgetDefaultMaterial:()=>Yv,_shadersgetLambertDiffuse:()=>qv,_shadersgetSpecular:()=>Xv,_shadersgetWaterNoise:()=>Kv,_shadershue:()=>Jv,_shadersinfinity:()=>Pw,_shadersinverseGamma:()=>Zv,_shadersisEmpty:()=>Qv,_shadersisFull:()=>$v,_shaderslatitudeToWebMercatorFraction:()=>eD,_shaderslineDistance:()=>tD,_shaderslinearToSrgb:()=>nD,_shadersluminance:()=>iD,_shadersmaterial:()=>sv,_shadersmaterialInput:()=>av,_shadersmetersPerPixel:()=>oD,_shadersmodelMaterial:()=>cv,_shadersmodelToWindowCoordinates:()=>rD,_shadersmodelVertexOutput:()=>lv,_shadersmultiplyWithColorBalance:()=>sD,_shadersnearFarScalar:()=>aD,_shadersoctDecode:()=>cD,_shadersoneOverPi:()=>Ow,_shadersoneOverTwoPi:()=>Mw,_shaderspackDepth:()=>lD,_shaderspassCesium3DTile:()=>Rw,_shaderspassCesium3DTileClassification:()=>Bw,_shaderspassCesium3DTileClassificationIgnoreShow:()=>Lw,_shaderspassClassification:()=>Nw,_shaderspassCompute:()=>Fw,_shaderspassEnvironment:()=>Uw,_shaderspassGlobe:()=>Vw,_shaderspassOpaque:()=>kw,_shaderspassOverlay:()=>zw,_shaderspassTerrainClassification:()=>Hw,_shaderspassTranslucent:()=>Gw,_shaderspassVoxels:()=>Ww,_shaderspbrLighting:()=>uD,_shaderspbrMetallicRoughnessMaterial:()=>fD,_shaderspbrParameters:()=>uv,_shaderspbrSpecularGlossinessMaterial:()=>dD,_shadersphong:()=>mD,_shaderspi:()=>jw,_shaderspiOverFour:()=>Yw,_shaderspiOverSix:()=>qw,_shaderspiOverThree:()=>Xw,_shaderspiOverTwo:()=>Kw,_shadersplaneDistance:()=>hD,_shaderspointAlongRay:()=>pD,_shadersradiansPerDegree:()=>Jw,_shadersray:()=>fv,_shadersrayEllipsoidIntersectionInterval:()=>_D,_shadersraySegment:()=>dv,_shadersraySphereIntersectionInterval:()=>gD,_shadersreadDepth:()=>yD,_shadersreadNonPerspective:()=>AD,_shadersreverseLogDepth:()=>xD,_shadersround:()=>CD,_shaderssampleOctahedralProjection:()=>TD,_shaderssaturation:()=>ED,_shaderssceneMode2D:()=>Zw,_shaderssceneMode3D:()=>Qw,_shaderssceneModeColumbusView:()=>$w,_shaderssceneModeMorphing:()=>ev,_shadersshadowDepthCompare:()=>bD,_shadersshadowParameters:()=>mv,_shadersshadowVisibility:()=>SD,_shaderssignNotZero:()=>wD,_shaderssolarRadius:()=>tv,_shaderssphericalHarmonics:()=>vD,_shaderssrgbToLinear:()=>DD,_shaderstangentToEyeSpaceMatrix:()=>ID,_shaderstextureCube:()=>PD,_shadersthreePiOver2:()=>nv,_shaderstransformPlane:()=>OD,_shaderstranslateRelativeToEye:()=>MD,_shaderstranslucentPhong:()=>RD,_shaderstranspose:()=>BD,_shaderstwoPi:()=>iv,_shadersunpackDepth:()=>LD,_shadersunpackFloat:()=>ND,_shadersunpackUint:()=>FD,_shadersvalueTransform:()=>UD,_shadersvertexLogDepth:()=>VD,_shaderswebMercatorMaxLatitude:()=>ov,_shaderswindowToEyeCoordinates:()=>kD,_shaderswriteDepthClamp:()=>zD,_shaderswriteLogDepth:()=>HD,_shaderswriteNonPerspective:()=>GD,addBuffer:()=>HP,addDefaults:()=>BP,addExtensionsRequired:()=>VP,addExtensionsUsed:()=>Qu,addPipelineExtras:()=>bg,addToArray:()=>is,appendForwardSlash:()=>aw,arrayRemoveDuplicates:()=>Ao,barycentricCoordinates:()=>H0,binarySearch:()=>wo,buildDrawCommand:()=>R1,buildModuleUrl:()=>en,buildVoxelDrawCommands:()=>zF,clone:()=>Ye,combine:()=>_t,computeFlyToLocationForRectangle:()=>OC,createBillboardPointCallback:()=>HA,createCommand:()=>En,createDefaultImageryProviderViewModels:()=>f2,createDefaultTerrainProviderViewModels:()=>d2,createElevationBandMaterial:()=>nX,createGuid:()=>Gn,createMaterialPropertyDescriptor:()=>vo,createOsmBuildings:()=>iX,createOsmBuildingsAsync:()=>oX,createPropertyDescriptor:()=>ce,createRawPropertyDescriptor:()=>al,createTangentSpaceDebugPrimitive:()=>rX,createTaskProcessorWorker:()=>YX,createUniform:()=>ew,createUniformArray:()=>tw,createWorldImagery:()=>sX,createWorldImageryAsync:()=>I_,createWorldTerrain:()=>kX,createWorldTerrainAsync:()=>bC,decodeGoogleEarthEnterpriseData:()=>lF,decodeVectorPolylinePositions:()=>AM,defaultValue:()=>y,defer:()=>Gs,defined:()=>l,demodernizeShader:()=>WD,deprecationWarning:()=>$,destroyObject:()=>ue,exportKml:()=>tj,findAccessorMinMax:()=>SA,findContentMetadata:()=>XA,findGroupMetadata:()=>KA,findTileMetadata:()=>EM,forEachTextureInMaterial:()=>LT,formatError:()=>_h,freezeRenderState:()=>nG,getAbsoluteUri:()=>qh,getAccessorByteStride:()=>dl,getBaseUri:()=>cw,getBinaryAccessor:()=>Jl,getClipAndStyleCode:()=>pF,getClippingFunction:()=>v_,getComponentReader:()=>wp,getElement:()=>In,getExtensionFromUri:()=>T0,getFilenameFromUri:()=>l_,getImageFromTypedArray:()=>HF,getImagePixels:()=>$f,getJsonFromTypedArray:()=>Do,getMagic:()=>hd,getStringFromTypedArray:()=>ll,getTimestamp:()=>gi,hasExtension:()=>ti,heightReferenceOnEntityPropertyChanged:()=>dp,isBitSet:()=>dc,isBlobUri:()=>E0,isCrossOriginUrl:()=>b0,isDataUri:()=>Xh,isLeapYear:()=>Yh,knockout:()=>Ce,knockout_3_5_1:()=>BC,knockout_es5:()=>e2,loadAndExecuteScript:()=>S0,loadCubeMap:()=>nI,loadImageFromTypedArray:()=>TA,loadKTX2:()=>tl,mergeSort:()=>O_,moveTechniqueRenderStates:()=>UP,moveTechniquesToExtension:()=>kP,numberOfComponentsForType:()=>Ql,objectToQuery:()=>w0,oneTimeWarning:()=>Mt,parseBatchTable:()=>Mp,parseBoundingVolumeSemantics:()=>$P,parseFeatureMetadataLegacy:()=>a1,parseGlb:()=>NP,parseResponseHeaders:()=>lw,parseStructuralMetadata:()=>s1,pointInsideTriangle:()=>zX,preprocess3DTileContent:()=>Zm,processVoxelProperties:()=>kF,queryToObject:()=>kl,readAccessorPacked:()=>GP,removeExtension:()=>wA,removeExtensionsRequired:()=>LP,removeExtensionsUsed:()=>bA,removePipelineExtras:()=>FP,removeUnusedElements:()=>zP,resizeImageToNextPowerOfTwo:()=>vg,sampleTerrain:()=>ZR,sampleTerrainMostDetailed:()=>A_,scaleToGeodeticSurface:()=>A0,subdivideArray:()=>kI,subscribeAndEvaluate:()=>ca,updateAccessorComponentTypes:()=>WP,updateVersion:()=>jP,usesExtension:()=>hr,viewerCesium3DTilesInspectorMixin:()=>dK,viewerCesiumInspectorMixin:()=>mK,viewerDragDropMixin:()=>pK,viewerPerformanceWatchdogMixin:()=>_K,viewerVoxelInspectorMixin:()=>gK,webGLConstantToGlslType:()=>HX,wrapFunction:()=>QF,writeTextToCanvas:()=>WA});function bxe(e){return e!=null}var l=bxe;function g0(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(g0.prototype=Object.create(Error.prototype),g0.prototype.constructor=g0);g0.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};g0.throwInstantiationError=function(){throw new g0("This function defines an interface and should not be called directly.")};var fe=g0;var ts={};ts.typeOf={};function Sxe(e){return`${e} is required, actual value was undefined`}function GC(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ts.defined=function(e,t){if(!l(t))throw new fe(Sxe(e))};ts.typeOf.func=function(e,t){if(typeof t!="function")throw new fe(GC(typeof t,"function",e))};ts.typeOf.string=function(e,t){if(typeof t!="string")throw new fe(GC(typeof t,"string",e))};ts.typeOf.number=function(e,t){if(typeof t!="number")throw new fe(GC(typeof t,"number",e))};ts.typeOf.number.lessThan=function(e,t,n){if(ts.typeOf.number(e,t),t>=n)throw new fe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ts.typeOf.number.lessThanOrEquals=function(e,t,n){if(ts.typeOf.number(e,t),t>n)throw new fe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ts.typeOf.number.greaterThan=function(e,t,n){if(ts.typeOf.number(e,t),t<=n)throw new fe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ts.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ts.typeOf.number(e,t),t 0?1:-1});lt.signNotZero=function(e){return e<0?-1:1};lt.toSNorm=function(e,t){return t=y(t,255),Math.round((lt.clamp(e,-1,1)*.5+.5)*t)};lt.fromSNorm=function(e,t){return t=y(t,255),lt.clamp(e,0,t)/t*2-1};lt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:lt.clamp((e-t)/n,0,1)};lt.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});lt.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});lt.lerp=function(e,t,n){return(1-n)*e+n*t};lt.PI=Math.PI;lt.ONE_OVER_PI=1/Math.PI;lt.PI_OVER_TWO=Math.PI/2;lt.PI_OVER_THREE=Math.PI/3;lt.PI_OVER_FOUR=Math.PI/4;lt.PI_OVER_SIX=Math.PI/6;lt.THREE_PI_OVER_TWO=3*Math.PI/2;lt.TWO_PI=2*Math.PI;lt.ONE_OVER_TWO_PI=1/(2*Math.PI);lt.RADIANS_PER_DEGREE=Math.PI/180;lt.DEGREES_PER_RADIAN=180/Math.PI;lt.RADIANS_PER_ARCSECOND=lt.RADIANS_PER_DEGREE/3600;lt.toRadians=function(e){return e*lt.RADIANS_PER_DEGREE};lt.toDegrees=function(e){return e*lt.DEGREES_PER_RADIAN};lt.convertLongitudeRange=function(e){let t=lt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};lt.clampToLatitudeRange=function(e){return lt.clamp(e,-1*lt.PI_OVER_TWO,lt.PI_OVER_TWO)};lt.negativePiToPi=function(e){return e>=-lt.PI&&e<=lt.PI?e:lt.zeroToTwoPi(e+lt.PI)-lt.PI};lt.zeroToTwoPi=function(e){if(e>=0&&e<=lt.TWO_PI)return e;let t=lt.mod(e,lt.TWO_PI);return Math.abs(t) lt.EPSILON14?lt.TWO_PI:t};lt.mod=function(e,t){return lt.sign(e)===lt.sign(t)&&Math.abs(e) n};lt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var Q2=[1];lt.factorial=function(e){let t=Q2.length;if(e>=t){let n=Q2[t-1];for(let i=t;i<=e;i++){let o=n*i;Q2.push(o),n=o}}return Q2[e]};lt.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};lt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};lt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};lt.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};lt.clamp=function(e,t,n){return e n?n:e};var NK=new UH.default;lt.setRandomNumberSeed=function(e){NK=new UH.default(e)};lt.nextRandomNumber=function(){return NK.random()};lt.randomBetween=function(e,t){return lt.nextRandomNumber()*(t-e)+e};lt.acosClamped=function(e){return Math.acos(lt.clamp(e,-1,1))};lt.asinClamped=function(e){return Math.asin(lt.clamp(e,-1,1))};lt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};lt.logBase=function(e,t){return Math.log(e)/Math.log(t)};lt.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});lt.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});lt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};lt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};lt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=lt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?lt.PI_OVER_TWO-i:i,i=e<0?lt.PI-i:i,i=t<0?-i:i,i};var P=lt;function tt(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}tt.fromSpherical=function(e,t){l(t)||(t=new tt);let n=e.clock,i=e.cone,o=y(e.magnitude,1),r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};tt.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new tt(e,t,n)};tt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new tt(e.x,e.y,e.z)};tt.fromCartesian4=tt.clone;tt.packedLength=3;tt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};tt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new tt),n.x=e[t++],n.y=e[t++],n.z=e[t],n};tt.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o i&&(o=u,i=f)}let r=1,s=0,a=HH[o],c=GH[o];if(Math.abs(e[nt.getElementIndex(c,a)])>n){let u=e[nt.getElementIndex(c,c)],f=e[nt.getElementIndex(a,a)],d=e[nt.getElementIndex(c,a)],p=(u-f)/2/d,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=nt.clone(nt.IDENTITY,t),t[nt.getElementIndex(a,a)]=t[nt.getElementIndex(c,c)]=r,t[nt.getElementIndex(c,a)]=s,t[nt.getElementIndex(a,c)]=-s,t}var n3=new nt,zK=new nt;nt.computeEigenDecomposition=function(e,t){let n=P.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=nt.clone(nt.IDENTITY,t.unitary),a=t.diagonal=nt.clone(e,t.diagonal),c=n*Lxe(a);for(;rc;)Fxe(a,n3),nt.transpose(n3,zK),nt.multiply(a,n3,a),nt.multiply(zK,a,a),nt.multiply(s,n3,s),++o>2&&(++r,o=0);return t};nt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};nt.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(r*u-c*s)+o*(c*i-n*u)+a*(n*s-r*i)};nt.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],u=e[7],f=e[8],d=nt.determinant(e);t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=c*a-r*f,t[4]=n*f-c*o,t[5]=r*o-n*a,t[6]=r*u-c*s,t[7]=c*i-n*u,t[8]=n*s-r*i;let p=1/d;return nt.multiplyByScalar(t,p,t)};var Uxe=new nt;nt.inverseTranspose=function(e,t){return nt.inverse(nt.transpose(e,Uxe),t)};nt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};nt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};nt.IDENTITY=Object.freeze(new nt(1,0,0,0,1,0,0,0,1));nt.ZERO=Object.freeze(new nt(0,0,0,0,0,0,0,0,0));nt.COLUMN0ROW0=0;nt.COLUMN0ROW1=1;nt.COLUMN0ROW2=2;nt.COLUMN1ROW0=3;nt.COLUMN1ROW1=4;nt.COLUMN1ROW2=5;nt.COLUMN2ROW0=6;nt.COLUMN2ROW1=7;nt.COLUMN2ROW2=8;Object.defineProperties(nt.prototype,{length:{get:function(){return nt.packedLength}}});nt.prototype.clone=function(e){return nt.clone(this,e)};nt.prototype.equals=function(e){return nt.equals(this,e)};nt.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]};nt.prototype.equalsEpsilon=function(e,t){return nt.equalsEpsilon(this,e,t)};nt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) +(${this[1]}, ${this[4]}, ${this[7]}) +(${this[2]}, ${this[5]}, ${this[8]})`};var Z=nt;function JS(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(JS.prototype=Object.create(Error.prototype),JS.prototype.constructor=JS);JS.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};var de=JS;function et(e,t,n,i,o,r,s,a,c,u,f,d,p,g,h,A){this[0]=y(e,0),this[1]=y(o,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(r,0),this[6]=y(u,0),this[7]=y(g,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(f,0),this[11]=y(h,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(d,0),this[15]=y(A,0)}et.packedLength=16;et.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};et.unpack=function(e,t,n){return t=y(t,0),l(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){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o =P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};_s.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};_s.fromTypedArray=function(e){if(e instanceof Uint8Array)return _s.UNSIGNED_BYTE;if(e instanceof Uint16Array)return _s.UNSIGNED_SHORT;if(e instanceof Uint32Array)return _s.UNSIGNED_INT};var Ue=Object.freeze(_s);var i3={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,validate:function(e){return e===i3.STREAM_DRAW||e===i3.STATIC_DRAW||e===i3.DYNAMIC_DRAW}},Fe=Object.freeze(i3);function ku(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Gn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}ku.createVertexBuffer=function(e){return new ku({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};ku.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ue.getSizeInBytes(n),o=new ku({context:t,bufferTarget:te.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(ku.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});ku.prototype._getBuffer=function(){return this._buffer};ku.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};ku.prototype.copyFromBuffer=function(e,t,n,i){let o=te.COPY_READ_BUFFER,r=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};ku.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let o=this._gl,r=te.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};ku.prototype.isDestroyed=function(){return!1};ku.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var mt=ku;var Y_,yr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},$c={};Object.defineProperties($c,{element:{get:function(){if($c.supportsFullscreen())return document[yr.fullscreenElement]}},changeEventName:{get:function(){if($c.supportsFullscreen())return yr.fullscreenchange}},errorEventName:{get:function(){if($c.supportsFullscreen())return yr.fullscreenerror}},enabled:{get:function(){if($c.supportsFullscreen())return document[yr.fullscreenEnabled]}},fullscreen:{get:function(){if($c.supportsFullscreen())return $c.element!==null}}});$c.supportsFullscreen=function(){if(l(Y_))return Y_;Y_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return yr.requestFullscreen="requestFullscreen",yr.exitFullscreen="exitFullscreen",yr.fullscreenEnabled="fullscreenEnabled",yr.fullscreenElement="fullscreenElement",yr.fullscreenchange="fullscreenchange",yr.fullscreenerror="fullscreenerror",Y_=!0,Y_;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i {let t=new Image;t.onload=function(){_c._result=t.width>0&&t.height>0,e(_c._result)},t.onerror=function(){_c._result=!1,e(_c._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),_c._promise};Object.defineProperties(_c,{initialized:{get:function(){return l(_c._result)}}});var qC=[];typeof ArrayBuffer<"u"&&(qC.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&qC.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&qC.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&qC.push(BigInt64Array),typeof BigUint64Array<"u"&&qC.push(BigUint64Array));var Jf={isChrome:JH,chromeVersion:eCe,isSafari:jK,safariVersion:tCe,isWebkit:YK,webkitVersion:nCe,isInternetExplorer:qK,internetExplorerVersion:iCe,isEdge:u3,edgeVersion:oCe,isFirefox:ZH,firefoxVersion:aCe,isWindows:rCe,isIPadOrIOS:sCe,hardwareConcurrency:y(Ma.hardwareConcurrency,3),supportsPointerEvents:cCe,supportsImageRenderingPixelated:ZK,supportsWebP:_c,imageRenderingValue:lCe,typedArrayTypes:qC};Jf.supportsBasis=function(e){return Jf.supportsWebAssembly()&&e.context.supportsBasis};Jf.supportsFullscreen=function(){return lr.supportsFullscreen()};Jf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Jf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Jf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Jf.supportsBigInt=function(){return typeof BigInt<"u"};Jf.supportsWebWorkers=function(){return typeof Worker<"u"};Jf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Jf.supportsWebgl2=function(e){return e.context.webgl2};var Ht=Jf;function QH(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 ie(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}ie.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new ie(e.x,e.y,e.z,e.w)};ie.fromBytes=function(e,t,n,i,o){return e=ie.byteToFloat(y(e,255)),t=ie.byteToFloat(y(t,255)),n=ie.byteToFloat(y(n,255)),i=ie.byteToFloat(y(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new ie(e,t,n,i)};ie.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new ie(e.red,e.green,e.blue,t)};var $H,eG,zh;Ht.supportsTypedArrays()&&($H=new ArrayBuffer(4),eG=new Uint32Array($H),zh=new Uint8Array($H));ie.fromRgba=function(e,t){return eG[0]=e,ie.fromBytes(zh[0],zh[1],zh[2],zh[3],t)};ie.fromHsl=function(e,t,n,i,o){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;r=QH(u,c,e+1/3),s=QH(u,c,e),a=QH(u,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new ie(r,s,a,i)};ie.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+P.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+P.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);o=s+P.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);r=s+P.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new ie(n,i,o,r)};var uCe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,fCe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,dCe=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,mCe=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;ie.fromCssColorString=function(e,t){l(t)||(t=new ie),e=e.replace(/\s/g,"");let n=ie[e.toUpperCase()];if(l(n))return ie.clone(n,t),t;let i=uCe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=fCe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=dCe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=mCe.exec(e),i!==null?ie.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};ie.packedLength=4;ie.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};ie.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ie),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ie.byteToFloat=function(e){return e/255};ie.floatToByte=function(e){return e===1?255:e*256|0};ie.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new ie(e.red,e.green,e.blue,e.alpha)};ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};ie.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]};ie.prototype.clone=function(e){return ie.clone(this,e)};ie.prototype.equals=function(e){return ie.equals(this,e)};ie.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};ie.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ie.prototype.toCssColorString=function(){let e=ie.floatToByte(this.red),t=ie.floatToByte(this.green),n=ie.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ie.prototype.toCssHexString=function(){let e=ie.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ie.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ie.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ie.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ie.prototype.toBytes=function(e){let t=ie.floatToByte(this.red),n=ie.floatToByte(this.green),i=ie.floatToByte(this.blue),o=ie.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};ie.prototype.toRgba=function(){return zh[0]=ie.floatToByte(this.red),zh[1]=ie.floatToByte(this.green),zh[2]=ie.floatToByte(this.blue),zh[3]=ie.floatToByte(this.alpha),eG[0]};ie.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};ie.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ie.prototype.withAlpha=function(e,t){return ie.fromAlpha(this,e,t)};ie.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};ie.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};ie.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};ie.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};ie.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};ie.lerp=function(e,t,n,i){return i.red=P.lerp(e.red,t.red,n),i.green=P.lerp(e.green,t.green,n),i.blue=P.lerp(e.blue,t.blue,n),i.alpha=P.lerp(e.alpha,t.alpha,n),i};ie.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};ie.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};ie.ALICEBLUE=Object.freeze(ie.fromCssColorString("#F0F8FF"));ie.ANTIQUEWHITE=Object.freeze(ie.fromCssColorString("#FAEBD7"));ie.AQUA=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.AQUAMARINE=Object.freeze(ie.fromCssColorString("#7FFFD4"));ie.AZURE=Object.freeze(ie.fromCssColorString("#F0FFFF"));ie.BEIGE=Object.freeze(ie.fromCssColorString("#F5F5DC"));ie.BISQUE=Object.freeze(ie.fromCssColorString("#FFE4C4"));ie.BLACK=Object.freeze(ie.fromCssColorString("#000000"));ie.BLANCHEDALMOND=Object.freeze(ie.fromCssColorString("#FFEBCD"));ie.BLUE=Object.freeze(ie.fromCssColorString("#0000FF"));ie.BLUEVIOLET=Object.freeze(ie.fromCssColorString("#8A2BE2"));ie.BROWN=Object.freeze(ie.fromCssColorString("#A52A2A"));ie.BURLYWOOD=Object.freeze(ie.fromCssColorString("#DEB887"));ie.CADETBLUE=Object.freeze(ie.fromCssColorString("#5F9EA0"));ie.CHARTREUSE=Object.freeze(ie.fromCssColorString("#7FFF00"));ie.CHOCOLATE=Object.freeze(ie.fromCssColorString("#D2691E"));ie.CORAL=Object.freeze(ie.fromCssColorString("#FF7F50"));ie.CORNFLOWERBLUE=Object.freeze(ie.fromCssColorString("#6495ED"));ie.CORNSILK=Object.freeze(ie.fromCssColorString("#FFF8DC"));ie.CRIMSON=Object.freeze(ie.fromCssColorString("#DC143C"));ie.CYAN=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.DARKBLUE=Object.freeze(ie.fromCssColorString("#00008B"));ie.DARKCYAN=Object.freeze(ie.fromCssColorString("#008B8B"));ie.DARKGOLDENROD=Object.freeze(ie.fromCssColorString("#B8860B"));ie.DARKGRAY=Object.freeze(ie.fromCssColorString("#A9A9A9"));ie.DARKGREEN=Object.freeze(ie.fromCssColorString("#006400"));ie.DARKGREY=ie.DARKGRAY;ie.DARKKHAKI=Object.freeze(ie.fromCssColorString("#BDB76B"));ie.DARKMAGENTA=Object.freeze(ie.fromCssColorString("#8B008B"));ie.DARKOLIVEGREEN=Object.freeze(ie.fromCssColorString("#556B2F"));ie.DARKORANGE=Object.freeze(ie.fromCssColorString("#FF8C00"));ie.DARKORCHID=Object.freeze(ie.fromCssColorString("#9932CC"));ie.DARKRED=Object.freeze(ie.fromCssColorString("#8B0000"));ie.DARKSALMON=Object.freeze(ie.fromCssColorString("#E9967A"));ie.DARKSEAGREEN=Object.freeze(ie.fromCssColorString("#8FBC8F"));ie.DARKSLATEBLUE=Object.freeze(ie.fromCssColorString("#483D8B"));ie.DARKSLATEGRAY=Object.freeze(ie.fromCssColorString("#2F4F4F"));ie.DARKSLATEGREY=ie.DARKSLATEGRAY;ie.DARKTURQUOISE=Object.freeze(ie.fromCssColorString("#00CED1"));ie.DARKVIOLET=Object.freeze(ie.fromCssColorString("#9400D3"));ie.DEEPPINK=Object.freeze(ie.fromCssColorString("#FF1493"));ie.DEEPSKYBLUE=Object.freeze(ie.fromCssColorString("#00BFFF"));ie.DIMGRAY=Object.freeze(ie.fromCssColorString("#696969"));ie.DIMGREY=ie.DIMGRAY;ie.DODGERBLUE=Object.freeze(ie.fromCssColorString("#1E90FF"));ie.FIREBRICK=Object.freeze(ie.fromCssColorString("#B22222"));ie.FLORALWHITE=Object.freeze(ie.fromCssColorString("#FFFAF0"));ie.FORESTGREEN=Object.freeze(ie.fromCssColorString("#228B22"));ie.FUCHSIA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.GAINSBORO=Object.freeze(ie.fromCssColorString("#DCDCDC"));ie.GHOSTWHITE=Object.freeze(ie.fromCssColorString("#F8F8FF"));ie.GOLD=Object.freeze(ie.fromCssColorString("#FFD700"));ie.GOLDENROD=Object.freeze(ie.fromCssColorString("#DAA520"));ie.GRAY=Object.freeze(ie.fromCssColorString("#808080"));ie.GREEN=Object.freeze(ie.fromCssColorString("#008000"));ie.GREENYELLOW=Object.freeze(ie.fromCssColorString("#ADFF2F"));ie.GREY=ie.GRAY;ie.HONEYDEW=Object.freeze(ie.fromCssColorString("#F0FFF0"));ie.HOTPINK=Object.freeze(ie.fromCssColorString("#FF69B4"));ie.INDIANRED=Object.freeze(ie.fromCssColorString("#CD5C5C"));ie.INDIGO=Object.freeze(ie.fromCssColorString("#4B0082"));ie.IVORY=Object.freeze(ie.fromCssColorString("#FFFFF0"));ie.KHAKI=Object.freeze(ie.fromCssColorString("#F0E68C"));ie.LAVENDER=Object.freeze(ie.fromCssColorString("#E6E6FA"));ie.LAVENDAR_BLUSH=Object.freeze(ie.fromCssColorString("#FFF0F5"));ie.LAWNGREEN=Object.freeze(ie.fromCssColorString("#7CFC00"));ie.LEMONCHIFFON=Object.freeze(ie.fromCssColorString("#FFFACD"));ie.LIGHTBLUE=Object.freeze(ie.fromCssColorString("#ADD8E6"));ie.LIGHTCORAL=Object.freeze(ie.fromCssColorString("#F08080"));ie.LIGHTCYAN=Object.freeze(ie.fromCssColorString("#E0FFFF"));ie.LIGHTGOLDENRODYELLOW=Object.freeze(ie.fromCssColorString("#FAFAD2"));ie.LIGHTGRAY=Object.freeze(ie.fromCssColorString("#D3D3D3"));ie.LIGHTGREEN=Object.freeze(ie.fromCssColorString("#90EE90"));ie.LIGHTGREY=ie.LIGHTGRAY;ie.LIGHTPINK=Object.freeze(ie.fromCssColorString("#FFB6C1"));ie.LIGHTSEAGREEN=Object.freeze(ie.fromCssColorString("#20B2AA"));ie.LIGHTSKYBLUE=Object.freeze(ie.fromCssColorString("#87CEFA"));ie.LIGHTSLATEGRAY=Object.freeze(ie.fromCssColorString("#778899"));ie.LIGHTSLATEGREY=ie.LIGHTSLATEGRAY;ie.LIGHTSTEELBLUE=Object.freeze(ie.fromCssColorString("#B0C4DE"));ie.LIGHTYELLOW=Object.freeze(ie.fromCssColorString("#FFFFE0"));ie.LIME=Object.freeze(ie.fromCssColorString("#00FF00"));ie.LIMEGREEN=Object.freeze(ie.fromCssColorString("#32CD32"));ie.LINEN=Object.freeze(ie.fromCssColorString("#FAF0E6"));ie.MAGENTA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.MAROON=Object.freeze(ie.fromCssColorString("#800000"));ie.MEDIUMAQUAMARINE=Object.freeze(ie.fromCssColorString("#66CDAA"));ie.MEDIUMBLUE=Object.freeze(ie.fromCssColorString("#0000CD"));ie.MEDIUMORCHID=Object.freeze(ie.fromCssColorString("#BA55D3"));ie.MEDIUMPURPLE=Object.freeze(ie.fromCssColorString("#9370DB"));ie.MEDIUMSEAGREEN=Object.freeze(ie.fromCssColorString("#3CB371"));ie.MEDIUMSLATEBLUE=Object.freeze(ie.fromCssColorString("#7B68EE"));ie.MEDIUMSPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FA9A"));ie.MEDIUMTURQUOISE=Object.freeze(ie.fromCssColorString("#48D1CC"));ie.MEDIUMVIOLETRED=Object.freeze(ie.fromCssColorString("#C71585"));ie.MIDNIGHTBLUE=Object.freeze(ie.fromCssColorString("#191970"));ie.MINTCREAM=Object.freeze(ie.fromCssColorString("#F5FFFA"));ie.MISTYROSE=Object.freeze(ie.fromCssColorString("#FFE4E1"));ie.MOCCASIN=Object.freeze(ie.fromCssColorString("#FFE4B5"));ie.NAVAJOWHITE=Object.freeze(ie.fromCssColorString("#FFDEAD"));ie.NAVY=Object.freeze(ie.fromCssColorString("#000080"));ie.OLDLACE=Object.freeze(ie.fromCssColorString("#FDF5E6"));ie.OLIVE=Object.freeze(ie.fromCssColorString("#808000"));ie.OLIVEDRAB=Object.freeze(ie.fromCssColorString("#6B8E23"));ie.ORANGE=Object.freeze(ie.fromCssColorString("#FFA500"));ie.ORANGERED=Object.freeze(ie.fromCssColorString("#FF4500"));ie.ORCHID=Object.freeze(ie.fromCssColorString("#DA70D6"));ie.PALEGOLDENROD=Object.freeze(ie.fromCssColorString("#EEE8AA"));ie.PALEGREEN=Object.freeze(ie.fromCssColorString("#98FB98"));ie.PALETURQUOISE=Object.freeze(ie.fromCssColorString("#AFEEEE"));ie.PALEVIOLETRED=Object.freeze(ie.fromCssColorString("#DB7093"));ie.PAPAYAWHIP=Object.freeze(ie.fromCssColorString("#FFEFD5"));ie.PEACHPUFF=Object.freeze(ie.fromCssColorString("#FFDAB9"));ie.PERU=Object.freeze(ie.fromCssColorString("#CD853F"));ie.PINK=Object.freeze(ie.fromCssColorString("#FFC0CB"));ie.PLUM=Object.freeze(ie.fromCssColorString("#DDA0DD"));ie.POWDERBLUE=Object.freeze(ie.fromCssColorString("#B0E0E6"));ie.PURPLE=Object.freeze(ie.fromCssColorString("#800080"));ie.RED=Object.freeze(ie.fromCssColorString("#FF0000"));ie.ROSYBROWN=Object.freeze(ie.fromCssColorString("#BC8F8F"));ie.ROYALBLUE=Object.freeze(ie.fromCssColorString("#4169E1"));ie.SADDLEBROWN=Object.freeze(ie.fromCssColorString("#8B4513"));ie.SALMON=Object.freeze(ie.fromCssColorString("#FA8072"));ie.SANDYBROWN=Object.freeze(ie.fromCssColorString("#F4A460"));ie.SEAGREEN=Object.freeze(ie.fromCssColorString("#2E8B57"));ie.SEASHELL=Object.freeze(ie.fromCssColorString("#FFF5EE"));ie.SIENNA=Object.freeze(ie.fromCssColorString("#A0522D"));ie.SILVER=Object.freeze(ie.fromCssColorString("#C0C0C0"));ie.SKYBLUE=Object.freeze(ie.fromCssColorString("#87CEEB"));ie.SLATEBLUE=Object.freeze(ie.fromCssColorString("#6A5ACD"));ie.SLATEGRAY=Object.freeze(ie.fromCssColorString("#708090"));ie.SLATEGREY=ie.SLATEGRAY;ie.SNOW=Object.freeze(ie.fromCssColorString("#FFFAFA"));ie.SPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FF7F"));ie.STEELBLUE=Object.freeze(ie.fromCssColorString("#4682B4"));ie.TAN=Object.freeze(ie.fromCssColorString("#D2B48C"));ie.TEAL=Object.freeze(ie.fromCssColorString("#008080"));ie.THISTLE=Object.freeze(ie.fromCssColorString("#D8BFD8"));ie.TOMATO=Object.freeze(ie.fromCssColorString("#FF6347"));ie.TURQUOISE=Object.freeze(ie.fromCssColorString("#40E0D0"));ie.VIOLET=Object.freeze(ie.fromCssColorString("#EE82EE"));ie.WHEAT=Object.freeze(ie.fromCssColorString("#F5DEB3"));ie.WHITE=Object.freeze(ie.fromCssColorString("#FFFFFF"));ie.WHITESMOKE=Object.freeze(ie.fromCssColorString("#F5F5F5"));ie.YELLOW=Object.freeze(ie.fromCssColorString("#FFFF00"));ie.YELLOWGREEN=Object.freeze(ie.fromCssColorString("#9ACD32"));ie.TRANSPARENT=Object.freeze(new ie(0,0,0,0));var z=ie;function f3(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}f3.ALL=Object.freeze(new f3({color:new z(0,0,0,0),depth:1,stencil:0}));f3.prototype.execute=function(e,t){e.clear(this,t)};var ii=f3;var hCe={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},be=Object.freeze(hCe);function QK(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=be.COMPUTE,this.owner=e.owner}QK.prototype.execute=function(e){e.execute(this)};var zu=QK;function Ot(e,t){this.x=y(e,0),this.y=y(t,0)}Ot.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Ot(e,t)};Ot.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Ot(e.x,e.y)};Ot.fromCartesian3=Ot.clone;Ot.fromCartesian4=Ot.clone;Ot.packedLength=2;Ot.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Ot.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ot),n.x=e[t++],n.y=e[t],n};Ot.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o P.EPSILON12);return l(o)?(o.x=r*L,o.y=s*N,o.z=a*_,o):new m(r*L,s*N,a*_)}var A0=yCe;function Yr(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}Yr.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Yr(e,t,n)};Yr.fromDegrees=function(e,t,n,i){return e=P.toRadians(e),t=P.toRadians(t),Yr.fromRadians(e,t,n,i)};var ACe=new m,xCe=new m,CCe=new m,TCe=new m(1/6378137,1/6378137,1/6356752314245179e-9),ECe=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),bCe=P.EPSILON1;Yr.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:TCe,o=l(t)?t.oneOverRadiiSquared:ECe,r=l(t)?t._centerToleranceSquared:bCe,s=A0(e,i,o,r,xCe);if(!l(s))return;let a=m.multiplyComponents(s,o,ACe);a=m.normalize(a,a);let c=m.subtract(e,s,CCe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),d=P.sign(m.dot(c,e))*m.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=d,n):new Yr(u,f,d)};Yr.toCartesian=function(e,t,n){return m.fromRadians(e.longitude,e.latitude,e.height,t,n)};Yr.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Yr(e.longitude,e.latitude,e.height)};Yr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Yr.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Yr.ZERO=Object.freeze(new Yr(0,0,0));Yr.prototype.clone=function(e){return Yr.clone(this,e)};Yr.prototype.equals=function(e){return Yr.equals(this,e)};Yr.prototype.equalsEpsilon=function(e,t){return Yr.equalsEpsilon(this,e,t)};Yr.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=Yr;function iJ(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new m(t,n,i),e._radiiSquared=new m(t*t,n*n,i*i),e._radiiToTheFourth=new m(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new m(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new m(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=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Zi(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,iJ(this,e,t,n)}Object.defineProperties(Zi.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}}});Zi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(m.clone(n,t._radii),m.clone(e._radiiSquared,t._radiiSquared),m.clone(e._radiiToTheFourth,t._radiiToTheFourth),m.clone(e._oneOverRadii,t._oneOverRadii),m.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Zi(n.x,n.y,n.z)};Zi.fromCartesian3=function(e,t){return l(t)||(t=new Zi),l(e)&&iJ(t,e.x,e.y,e.z),t};Zi.WGS84=Object.freeze(new Zi(6378137,6378137,6356752314245179e-9));Zi.UNIT_SPHERE=Object.freeze(new Zi(1,1,1));Zi.MOON=Object.freeze(new Zi(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));Zi.prototype.clone=function(e){return Zi.clone(this,e)};Zi.packedLength=m.packedLength;Zi.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),t};Zi.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t);return Zi.fromCartesian3(i,n)};Zi.prototype.geocentricSurfaceNormal=m.normalize;Zi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new m),t.x=r,t.y=s,t.z=a,m.normalize(t,t)};Zi.prototype.geodeticSurfaceNormal=function(e,t){if(!m.equalsEpsilon(e,m.ZERO,P.EPSILON14))return l(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var SCe=new m,wCe=new m;Zi.prototype.cartographicToCartesian=function(e,t){let n=SCe,i=wCe;this.geodeticSurfaceNormalCartographic(e,n),m.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(m.dot(n,i));return m.divideByScalar(i,o,i),m.multiplyByScalar(n,e.height,n),l(t)||(t=new m),m.add(i,n,t)};Zi.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i =this._radii.z-t))return n};var PCe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],OCe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function nJ(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*PCe[s];r+=OCe[s]*(n(i+a)+n(i-a))}return r*=o,r}Zi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n =0?f.longitude:f.longitude+P.TWO_PI;o=Math.min(o,d),r=Math.max(r,d)}return i-n>r-o&&(n=o,i=r,i>P.PI&&(i=i-P.TWO_PI),n>P.PI&&(n=n-P.TWO_PI)),l(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=y(t,oe.WGS84);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u =0?d.longitude:d.longitude+P.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>P.PI&&(o=o-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new Vn(i,a,o,c)};Vn.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Vn(e.west,e.south,e.east,e.north)};Vn.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};Vn.prototype.clone=function(e){return Vn.clone(this,e)};Vn.prototype.equals=function(e){return Vn.equals(this,e)};Vn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};Vn.prototype.equalsEpsilon=function(e,t){return Vn.equalsEpsilon(this,e,t)};Vn.validate=function(e){};Vn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new he(e.west,e.south)};Vn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new he(e.west,e.north)};Vn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new he(e.east,e.north)};Vn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new he(e.east,e.south)};Vn.center=function(e,t){let n=e.east,i=e.west;n0?i+=P.TWO_PI:r 0&&(r+=P.TWO_PI),i=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new Vn(a,u,c,f)};Vn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new Vn(i,o,r,s)};Vn.union=function(e,t,n){l(n)||(n=new Vn);let i=e.east,o=e.west,r=t.east,s=t.west;i 0?i+=P.TWO_PI:r 0&&(r+=P.TWO_PI),io||P.equalsEpsilon(n,o,P.EPSILON14))&&(n =e.south&&i<=e.north};var RCe=new he;Vn.subsample=function(e,t,n,i){t=y(t,oe.WGS84),n=y(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,u=RCe;u.height=n,u.longitude=c,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=c,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*P.PI_OVER_TWO,Vn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};Vn.subsection=function(e,t,n,i,o,r){if(l(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=P.TWO_PI+e.east-e.west;r.west=P.negativePiToPi(e.west+t*a),r.east=P.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,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var le=Vn;function Ar(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Ar.packedLength=4;Ar.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Ar.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ar),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Ar.fromPoints=function(e,t){if(l(t)||(t=new Ar),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a n.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};Ar.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width r+t.height?$t.OUTSIDE:$t.INTERSECTING};Ar.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Ar.prototype.clone=function(e){return Ar.clone(this,e)};Ar.prototype.intersect=function(e){return Ar.intersect(this,e)};Ar.prototype.equals=function(e){return Ar.equals(this,e)};var Ke=Ar;var ua={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};ua.isLines=function(e){return e===ua.LINES||e===ua.LINE_LOOP||e===ua.LINE_STRIP};ua.isTriangles=function(e){return e===ua.TRIANGLES||e===ua.TRIANGLE_STRIP||e===ua.TRIANGLE_FAN};ua.validate=function(e){return e===ua.POINTS||e===ua.LINES||e===ua.LINE_LOOP||e===ua.LINE_STRIP||e===ua.TRIANGLES||e===ua.TRIANGLE_STRIP||e===ua.TRIANGLE_FAN};var Le=Object.freeze(ua);var x0=`in vec4 position; +in vec2 textureCoordinates; + +out vec2 v_textureCoordinates; + +void main() +{ + gl_Position = position; + v_textureCoordinates = textureCoordinates; +} +`;var ur={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 $S(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Le.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Ra(e,t){return(e._flags&t)===t}function q_(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties($S.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 Ra(this,ur.CULL)},set:function(e){Ra(this,ur.CULL)!==e&&(q_(this,ur.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Ra(this,ur.OCCLUDE)},set:function(e){Ra(this,ur.OCCLUDE)!==e&&(q_(this,ur.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 Ra(this,ur.CAST_SHADOWS)},set:function(e){Ra(this,ur.CAST_SHADOWS)!==e&&(q_(this,ur.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Ra(this,ur.RECEIVE_SHADOWS)},set:function(e){Ra(this,ur.RECEIVE_SHADOWS)!==e&&(q_(this,ur.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 Ra(this,ur.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Ra(this,ur.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(q_(this,ur.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 Ra(this,ur.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Ra(this,ur.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(q_(this,ur.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickOnly:{get:function(){return Ra(this,ur.PICK_ONLY)},set:function(e){Ra(this,ur.PICK_ONLY)!==e&&(q_(this,ur.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Ra(this,ur.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Ra(this,ur.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(q_(this,ur.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});$S.shallowClone=function(e,t){if(l(e))return l(t)||(t=new $S),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};$S.prototype.execute=function(e,t){e.draw(this,t)};var it=$S;var wi={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};wi.toWebGLConstant=function(e,t){switch(e){case wi.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case wi.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case wi.UNSIGNED_INT:return te.UNSIGNED_INT;case wi.FLOAT:return te.FLOAT;case wi.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case wi.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case wi.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case wi.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case wi.UNSIGNED_SHORT_5_6_5:return wi.UNSIGNED_SHORT_5_6_5}};wi.isPacked=function(e){return e===wi.UNSIGNED_INT_24_8||e===wi.UNSIGNED_SHORT_4_4_4_4||e===wi.UNSIGNED_SHORT_5_5_5_1||e===wi.UNSIGNED_SHORT_5_6_5};wi.sizeInBytes=function(e){switch(e){case wi.UNSIGNED_BYTE:return 1;case wi.UNSIGNED_SHORT:case wi.UNSIGNED_SHORT_4_4_4_4:case wi.UNSIGNED_SHORT_5_5_5_1:case wi.UNSIGNED_SHORT_5_6_5:case wi.HALF_FLOAT:return 2;case wi.UNSIGNED_INT:case wi.FLOAT:case wi.UNSIGNED_INT_24_8:return 4}};wi.validate=function(e){return e===wi.UNSIGNED_BYTE||e===wi.UNSIGNED_SHORT||e===wi.UNSIGNED_INT||e===wi.FLOAT||e===wi.HALF_FLOAT||e===wi.UNSIGNED_INT_24_8||e===wi.UNSIGNED_SHORT_4_4_4_4||e===wi.UNSIGNED_SHORT_5_5_5_1||e===wi.UNSIGNED_SHORT_5_6_5};var Je=Object.freeze(wi);var at={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};at.componentsLength=function(e){switch(e){case at.RGB:return 3;case at.RGBA:return 4;case at.LUMINANCE_ALPHA:case at.RG:return 2;case at.ALPHA:case at.RED:case at.LUMINANCE:return 1;default:return 1}};at.validate=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL||e===at.ALPHA||e===at.RED||e===at.RG||e===at.RGB||e===at.RGBA||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA||e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isColorFormat=function(e){return e===at.ALPHA||e===at.RGB||e===at.RGBA||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA};at.isDepthFormat=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL};at.isCompressedFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isDXTFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5};at.isPVRTCFormat=function(e){return e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1};at.isASTCFormat=function(e){return e===at.RGBA_ASTC};at.isETC1Format=function(e){return e===at.RGB_ETC1};at.isETC2Format=function(e){return e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC};at.isBC7Format=function(e){return e===at.RGBA_BC7};at.compressedTextureSizeInBytes=function(e,t,n){switch(e){case at.RGB_DXT1:case at.RGBA_DXT1:case at.RGB_ETC1:case at.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case at.RGBA_DXT3:case at.RGBA_DXT5:case at.RGBA_ASTC:case at.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case at.RGB_PVRTC_4BPPV1:case at.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case at.RGB_PVRTC_2BPPV1:case at.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case at.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};at.textureSizeInBytes=function(e,t,n,i){let o=at.componentsLength(e);return Je.isPacked(t)&&(o=1),o*Je.sizeInBytes(t)*n*i};at.alignmentInBytes=function(e,t,n){let i=at.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};at.createTypedArray=function(e,t,n,i){let o,r=Je.sizeInBytes(t);r===Uint8Array.BYTES_PER_ELEMENT?o=Uint8Array:r===Uint16Array.BYTES_PER_ELEMENT?o=Uint16Array:r===Float32Array.BYTES_PER_ELEMENT&&t===Je.FLOAT?o=Float32Array:o=Uint32Array;let s=at.componentsLength(e)*n*i;return new o(s)};at.flipY=function(e,t,n,i,o){if(o===1)return e;let r=at.createTypedArray(t,n,i,o),s=at.componentsLength(t),a=i*s;for(let c=0;c 0&&console.log(`${Em}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Em}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Em}Shader program link log: ${c}`)),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)?(c=e.getProgramInfoLog(s),console.error(`${Em}Shader program link log: ${c}`),d(o,"vertex"),d(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Em}Vertex shader compile log: ${c}`),console.error(`${Em} Vertex shader source: +${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Em}Fragment shader compile log: ${c}`),console.error(`${Em} Fragment shader source: +${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new de(u);function d(p,g){if(!l(f))return;let h=f.getTranslatedShaderSource(p);if(h===""){console.error(`${Em}${g} shader translation failed.`);return}console.error(`${Em}Translated ${g} shaderSource: +${h}`)}}function $Ce(e,t,n){let i={};for(let o=0;o =0){if(f=n[u.slice(0,h)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let A=0;A 0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[Z.COLUMN1ROW2]-e[Z.COLUMN2ROW1])*n,o=(e[Z.COLUMN2ROW0]-e[Z.COLUMN0ROW2])*n,r=(e[Z.COLUMN0ROW1]-e[Z.COLUMN1ROW0])*n;else{let d=uTe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],h=d[g];n=Math.sqrt(e[Z.getElementIndex(p,p)]-e[Z.getElementIndex(g,g)]-e[Z.getElementIndex(h,h)]+1);let A=fTe;A[p]=.5*n,n=.5/n,s=(e[Z.getElementIndex(h,g)]-e[Z.getElementIndex(g,h)])*n,A[g]=(e[Z.getElementIndex(g,p)]+e[Z.getElementIndex(p,g)])*n,A[h]=(e[Z.getElementIndex(h,p)]+e[Z.getElementIndex(p,h)])*n,i=-A[0],o=-A[1],r=-A[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new ot(i,o,r,s)};var YJ=new ot,qJ=new ot,rG=new ot,XJ=new ot;ot.fromHeadingPitchRoll=function(e,t){return XJ=ot.fromAxisAngle(m.UNIT_X,e.roll,YJ),rG=ot.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=ot.multiply(rG,XJ,rG),qJ=ot.fromAxisAngle(m.UNIT_Z,-e.heading,YJ),ot.multiply(qJ,t,t)};var y3=new m,sG=new m,Qf=new ot,KJ=new ot,A3=new ot;ot.packedLength=4;ot.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};ot.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ot),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};ot.packedInterpolationLength=3;ot.convertPackedArrayForInterpolation=function(e,t,n,i){ot.unpack(e,n*4,A3),ot.conjugate(A3,A3);for(let o=0,r=n-t+1;o =0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)Gh[g]=(x3[g]*c-C3[g])*s,Wh[g]=(x3[g]*u-C3[g])*s;let f=r*n*(1+Gh[0]*(1+Gh[1]*(1+Gh[2]*(1+Gh[3]*(1+Gh[4]*(1+Gh[5]*(1+Gh[6]*(1+Gh[7])))))))),d=a*(1+Wh[0]*(1+Wh[1]*(1+Wh[2]*(1+Wh[3]*(1+Wh[4]*(1+Wh[5]*(1+Wh[6]*(1+Wh[7])))))))),p=ot.multiplyByScalar(e,d,hTe);return ot.multiplyByScalar(t,f,i),ot.add(p,i,i)};ot.fastSquad=function(e,t,n,i,o,r){let s=ot.fastSlerp(e,t,o,sw),a=ot.fastSlerp(n,i,o,XC);return ot.fastSlerp(s,a,2*o*(1-o),r)};ot.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};ot.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};ot.ZERO=Object.freeze(new ot(0,0,0,0));ot.IDENTITY=Object.freeze(new ot(0,0,0,1));ot.prototype.clone=function(e){return ot.clone(this,e)};ot.prototype.equals=function(e){return ot.equals(this,e)};ot.prototype.equalsEpsilon=function(e,t){return ot.equalsEpsilon(this,e,t)};ot.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Ne=ot;function pTe(e,t,n){let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var wo=pTe;function _Te(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var X_=_Te;function gTe(e,t,n,i,o,r,s,a){this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a}var jh=gTe;function yTe(e){return e%4===0&&e%100!==0||e%400===0}var Yh=yTe;function ATe(e,t){this.julianDate=e,this.offset=t}var Vi=ATe;var xTe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},Zn=Object.freeze(xTe);var CTe={UTC:0,TAI:1},Jn=Object.freeze(CTe);var $J=new jh,uG=[31,28,31,30,31,30,31,31,30,31,30,31],fG=29;function dG(e,t){return wt.compare(e.julianDate,t.julianDate)}var KC=new Vi;function E3(e){KC.julianDate=e;let t=wt.leapSeconds,n=wo(t,KC,dG);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&wt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),wt.addSeconds(e,i,e)}function QJ(e,t){KC.julianDate=e;let n=wt.leapSeconds,i=wo(n,KC,dG);if(i<0&&(i=~i),i===0)return wt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return wt.addSeconds(e,-n[i-1].offset,t);let o=wt.secondsDifference(n[i].julianDate,e);if(o===0)return wt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return wt.addSeconds(e,-n[--i].offset,t)}function K_(e,t,n){let i=t/Zn.SECONDS_PER_DAY|0;return e+=i,t-=Zn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Zn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function mG(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*Zn.SECONDS_PER_HOUR+o*Zn.SECONDS_PER_MINUTE+s*Zn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var TTe=/^(\d{4})$/,ETe=/^(\d{4})-(\d{2})$/,bTe=/^(\d{4})-?(\d{3})$/,STe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,wTe=/^(\d{4})-?(\d{2})-?(\d{2})$/,hG=/([Z+\-])?(\d{2})?:?(\d{2})?$/,vTe=/^(\d{2})(\.\d+)?/.source+hG.source,DTe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+hG.source,ITe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+hG.source;function wt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Jn.UTC);let i=e|0;t=t+(e-i)*Zn.SECONDS_PER_DAY,K_(i,t,this),n===Jn.UTC&&E3(this)}wt.fromGregorianDate=function(e,t){let n=mG(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(K_(n[0],n[1],t),E3(t),t):new wt(n[0],n[1],Jn.UTC)};wt.fromDate=function(e,t){let n=mG(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(K_(n[0],n[1],t),E3(t),t):new wt(n[0],n[1],Jn.UTC)};wt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,u=0,f=n[0],d=n[1],p,g;if(n=f.match(wTe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=f.match(ETe),n!==null)i=+n[1],o=+n[2];else if(n=f.match(TTe),n!==null)i=+n[1];else{let C;if(n=f.match(bTe),n!==null)i=+n[1],C=+n[2],g=Yh(i);else if(n=f.match(STe),n!==null){i=+n[1];let T=+n[2],E=+n[3]||0,S=new Date(Date.UTC(i,0,4));C=T*7+E-S.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),o=p.getUTCMonth()+1,r=p.getUTCDate()}g=Yh(i);let h;if(l(d)){n=d.match(ITe),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,h=5):(n=d.match(DTe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,h=4):(n=d.match(vTe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,h=3)));let C=n[h],T=+n[h+1],E=+(n[h+2]||0);switch(C){case"+":s=s-T,a=a-E;break;case"-":s=s+T,a=a+E;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let A=c===60;for(A&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?fG:uG[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?fG:uG[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?fG:uG[o-1],r+=p;let x=mG(i,o,r,s,a,c,u);return l(t)?(K_(x[0],x[1],t),E3(t)):t=new wt(x[0],x[1],Jn.UTC),A&&wt.addSeconds(t,1,t),t};wt.now=function(e){return wt.fromDate(new Date,e)};var T3=new wt(0,0,Jn.TAI);wt.toGregorianDate=function(e,t){let n=!1,i=QJ(e,T3);l(i)||(wt.addSeconds(e,-1,T3),i=QJ(T3,T3),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let d=u+2-12*s|0,p=100*(a-49)+c+s|0,g=r/Zn.SECONDS_PER_HOUR|0,h=r-g*Zn.SECONDS_PER_HOUR,A=h/Zn.SECONDS_PER_MINUTE|0;h=h-A*Zn.SECONDS_PER_MINUTE;let x=h|0,C=(h-x)/Zn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(x+=1),l(t)?(t.year=p,t.month=d,t.day=f,t.hour=g,t.minute=A,t.second=x,t.millisecond=C,t.isLeapSecond=n,t):new jh(p,d,f,g,A,x,C,n)};wt.toDate=function(e){let t=wt.toGregorianDate(e,$J),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))};wt.toIso8601=function(e,t){let n=wt.toGregorianDate(e,$J),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;return!l(t)&&u!==0?(f=(u*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(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")}:${c.toString().padStart(2,"0")}.${f}Z`)};wt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new wt(e.dayNumber,e.secondsOfDay,Jn.TAI)};wt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};wt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};wt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(wt.secondsDifference(e,t))<=n};wt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Zn.SECONDS_PER_DAY};wt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Zn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};wt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Zn.SECONDS_PER_DAY;return n+i};wt.computeTaiMinusUtc=function(e){KC.julianDate=e;let t=wt.leapSeconds,n=wo(t,KC,dG);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};wt.addSeconds=function(e,t,n){return K_(e.dayNumber,e.secondsOfDay+t,n)};wt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Zn.SECONDS_PER_MINUTE;return K_(e.dayNumber,i,n)};wt.addHours=function(e,t,n){let i=e.secondsOfDay+t*Zn.SECONDS_PER_HOUR;return K_(e.dayNumber,i,n)};wt.addDays=function(e,t,n){let i=e.dayNumber+t;return K_(i,e.secondsOfDay,n)};wt.lessThan=function(e,t){return wt.compare(e,t)<0};wt.lessThanOrEquals=function(e,t){return wt.compare(e,t)<=0};wt.greaterThan=function(e,t){return wt.compare(e,t)>0};wt.greaterThanOrEquals=function(e,t){return wt.compare(e,t)>=0};wt.prototype.clone=function(e){return wt.clone(this,e)};wt.prototype.equals=function(e){return wt.equals(this,e)};wt.prototype.equalsEpsilon=function(e,t){return wt.equalsEpsilon(this,e,t)};wt.prototype.toString=function(){return wt.toIso8601(this)};wt.leapSeconds=[new Vi(new wt(2441317,43210,Jn.TAI),10),new Vi(new wt(2441499,43211,Jn.TAI),11),new Vi(new wt(2441683,43212,Jn.TAI),12),new Vi(new wt(2442048,43213,Jn.TAI),13),new Vi(new wt(2442413,43214,Jn.TAI),14),new Vi(new wt(2442778,43215,Jn.TAI),15),new Vi(new wt(2443144,43216,Jn.TAI),16),new Vi(new wt(2443509,43217,Jn.TAI),17),new Vi(new wt(2443874,43218,Jn.TAI),18),new Vi(new wt(2444239,43219,Jn.TAI),19),new Vi(new wt(2444786,43220,Jn.TAI),20),new Vi(new wt(2445151,43221,Jn.TAI),21),new Vi(new wt(2445516,43222,Jn.TAI),22),new Vi(new wt(2446247,43223,Jn.TAI),23),new Vi(new wt(2447161,43224,Jn.TAI),24),new Vi(new wt(2447892,43225,Jn.TAI),25),new Vi(new wt(2448257,43226,Jn.TAI),26),new Vi(new wt(2448804,43227,Jn.TAI),27),new Vi(new wt(2449169,43228,Jn.TAI),28),new Vi(new wt(2449534,43229,Jn.TAI),29),new Vi(new wt(2450083,43230,Jn.TAI),30),new Vi(new wt(2450630,43231,Jn.TAI),31),new Vi(new wt(2451179,43232,Jn.TAI),32),new Vi(new wt(2453736,43233,Jn.TAI),33),new Vi(new wt(2454832,43234,Jn.TAI),34),new Vi(new wt(2456109,43235,Jn.TAI),35),new Vi(new wt(2457204,43236,Jn.TAI),36),new Vi(new wt(2457754,43237,Jn.TAI),37)];var ee=wt;var AZ=So(Vl(),1);function PTe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var aw=PTe;function sZ(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=sZ(o,t)),n[i]=o}return n}var Ye=sZ;function aZ(e,t,n){n=y(n,!1);let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=aZ(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var _t=aZ;function OTe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Gs=OTe;var cZ=So(Vl(),1);function pG(e,t){let n;return typeof document<"u"&&(n=document),pG._implementation(e,t,n)}pG._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new cZ.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var qh=pG;var lZ=So(Vl(),1);function MTe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new lZ.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var cw=MTe;var uZ=So(Vl(),1);function RTe(e){let t=new uZ.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 T0=RTe;var fZ={};function BTe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=fZ[t];l(i)||(i={},fZ[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var $f=BTe;var LTe=/^blob:/i;function NTe(e){return LTe.test(e)}var E0=NTe;var bm;function FTe(e){l(bm)||(bm=document.createElement("a")),bm.href=window.location.href;let t=bm.host,n=bm.protocol;return bm.href=e,bm.href=bm.href,n!==bm.protocol||t!==bm.host}var b0=FTe;var UTe=/^data:/i;function VTe(e){return UTe.test(e)}var Xh=VTe;function kTe(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 S0=kTe;function zTe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r 0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var lw=jTe;function dZ(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=lw(this.responseHeaders))}dZ.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Sm=dZ;var D3=So(Vl(),1);function uw(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(uw.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});uw.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};uw.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r0){for(o.sort(YTe),e=0;e=0;--t)this.heapify(t)};v0.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o i&&(r=t[i],this._length=i),r};v0.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return _G(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var fw=v0;function qTe(e,t){return e.priority-t.priority}var $i={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},QC=20,Ba=new fw({comparator:qTe});Ba.maximumLength=QC;Ba.reserve(QC);var wm=[],Kh={},XTe=typeof document<"u"?new D3.default(document.location.href):new D3.default,I3=new ge;function Go(){}Go.maximumRequests=50;Go.maximumRequestsPerServer=6;Go.requestsByServer={"api.cesium.com:443":18,"assets.ion.cesium.com:443":18,"ibasemaps-api.arcgis.com:443":18};Go.throttleRequests=!0;Go.debugShowStatistics=!1;Go.requestCompletedEvent=I3;Object.defineProperties(Go,{statistics:{get:function(){return $i}},priorityHeapLength:{get:function(){return QC},set:function(e){if(e e;){let t=Ba.pop();D0(t)}QC=e,Ba.maximumLength=e,Ba.reserve(e)}}});function mZ(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Go.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(Go.requestsByServer[e],Go.maximumRequestsPerServer);return Kh[e]+t<=n};Go.heapHasOpenSlots=function(e){return Ba.length+e<=QC};function hZ(e){return e.state===ei.UNISSUED&&(e.state=ei.ISSUED,e.deferred=Gs()),e.deferred.promise}function KTe(e){return function(t){if(e.state===ei.CANCELLED)return;let n=e.deferred;--$i.numberOfActiveRequests,--Kh[e.serverKey],I3.raiseEvent(),e.state=ei.RECEIVED,e.deferred=void 0,n.resolve(t)}}function JTe(e){return function(t){e.state!==ei.CANCELLED&&(++$i.numberOfFailedRequests,--$i.numberOfActiveRequests,--Kh[e.serverKey],I3.raiseEvent(t),e.state=ei.FAILED,e.deferred.reject(t))}}function pZ(e){let t=hZ(e);return e.state=ei.ACTIVE,wm.push(e),++$i.numberOfActiveRequests,++$i.numberOfActiveRequestsEver,++Kh[e.serverKey],e.requestFunction().then(KTe(e)).catch(JTe(e)),t}function D0(e){let t=e.state===ei.ACTIVE;if(e.state=ei.CANCELLED,++$i.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--$i.numberOfActiveRequests,--Kh[e.serverKey],++$i.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Go.update=function(){let e,t,n=0,i=wm.length;for(e=0;e0&&(wm[e-n]=t)}wm.length-=n;let o=Ba.internalArray,r=Ba.length;for(e=0;e 0;){if(t=Ba.pop(),t.cancelled){D0(t);continue}if(t.throttleByServer&&!Go.serverHasOpenSlots(t.serverKey)){D0(t);continue}pZ(t),++a}ZTe()};Go.getServerKey=function(e){let t=new D3.default(e);t.scheme()===""&&(t=t.absoluteTo(XTe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Kh[n];return l(i)||(Kh[n]=0),n};Go.request=function(e){if(Xh(e.url)||E0(e.url))return I3.raiseEvent(),e.state=ei.RECEIVED,e.requestFunction();if(++$i.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Go.getServerKey(e.url)),Go.throttleRequests&&e.throttleByServer&&!Go.serverHasOpenSlots(e.serverKey))return;if(!Go.throttleRequests||!e.throttle)return pZ(e);if(wm.length>=Go.maximumRequests)return;mZ(e);let t=Ba.insert(e);if(l(t)){if(t===e)return;D0(t)}return hZ(e)};function ZTe(){Go.debugShowStatistics&&($i.numberOfActiveRequests===0&&$i.lastNumberOfActiveRequests>0&&($i.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${$i.numberOfAttemptedRequests}`),$i.numberOfAttemptedRequests=0),$i.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${$i.numberOfCancelledRequests}`),$i.numberOfCancelledRequests=0),$i.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${$i.numberOfCancelledActiveRequests}`),$i.numberOfCancelledActiveRequests=0),$i.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${$i.numberOfFailedRequests}`),$i.numberOfFailedRequests=0)),$i.lastNumberOfActiveRequests=$i.numberOfActiveRequests)}Go.clearForSpecs=function(){for(;Ba.length>0;){let t=Ba.pop();D0(t)}let e=wm.length;for(let t=0;t 0}}});St.prototype.toString=function(){return this.getUrlComponent(!0,!0)};St.prototype.parseUrl=function(e,t,n,i){let o=new AZ.default(e),r=$Te(o.query());this._queryParameters=t?O3(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(qh(i))),this._url=o.toString()};function $Te(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:kl(e)}function O3(e,t,n){if(!n)return _t(e,t);let i=Ye(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}St.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${eEe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function eEe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${w0(e)}`}St.prototype.setQueryParameters=function(e,t){t?this._queryParameters=O3(this._queryParameters,e,!1):this._queryParameters=O3(e,this._queryParameters,!1)};St.prototype.appendQueryParameters=function(e){this._queryParameters=O3(e,this._queryParameters,!0)};St.prototype.setTemplateValues=function(e,t){t?this._templateValues=_t(this._templateValues,e):this._templateValues=_t(e,this._templateValues)};St.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=_t(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=_t(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=_t(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};St.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})};St.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ye(this._queryParameters),e._templateValues=Ye(this._templateValues),e.headers=Ye(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new St({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})};St.prototype.getBaseUri=function(e){return cw(this.getUrlComponent(e),e)};St.prototype.appendForwardSlash=function(){this._url=aw(this._url)};St.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};St.fetchArrayBuffer=function(e){return new St(e).fetchArrayBuffer()};St.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};St.fetchBlob=function(e){return new St(e).fetchBlob()};St.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1);if(yG(this.request),!xZ||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return gG({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,u;return St.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!l(f))return;if(u=f,a)return St.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let d=window.URL.createObjectURL(f);return c=new St({url:d}),gG({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};function gG(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=Gs();return St._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=La.request(r);if(l(s))return s.catch(function(a){return r.state!==ei.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=ei.UNISSUED,r.deferred=void 0,gG({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}St.fetchImage=function(e){return new St(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};St.prototype.fetchText=function(){return this.fetch({responseType:"text"})};St.fetchText=function(e){return new St(e).fetchText()};St.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};St.fetchJson=function(e){return new St(e).fetchJson()};St.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};St.fetchXML=function(e){return new St(e).fetchXML()};St.prototype.fetchJsonp=function(e){e=y(e,"callback"),yG(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return CZ(this,e,t)};function CZ(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=Gs();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},St._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=La.request(o);if(l(s))return s.catch(function(a){return o.state!==ei.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=ei.UNISSUED,o.deferred=void 0,CZ(e,t,n)):Promise.reject(a)})})}St.fetchJsonp=function(e){return new St(e).fetchJsonp(e.callbackParameterName)};St.prototype._makeRequest=function(e){let t=this;yG(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=_t(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=Gs(),d=St._Implementations.loadWithXhr(i,r,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let o=La.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ei.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ei.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function yG(e){if(e.state===ei.ISSUED||e.state===ei.ACTIVE)throw new de("The Resource is already being fetched.");e.state=ei.UNISSUED,e.deferred=void 0}var tEe=/^data:(.*?)(;base64)?,(.*)$/;function P3(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function gZ(e,t){let n=P3(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r (a=u.parse(e),c=f,a.protocol==="https:"?import("https"):import("http"))).then(u=>{let f={protocol:a.protocol,hostname:a.hostname,port:a.port,path:a.path,query:a.query,method:n,headers:o};u.request(f).on("response",function(d){if(d.statusCode<200||d.statusCode>=300){r.reject(new Sm(d.statusCode,d,d.headers));return}let p=[];d.on("data",function(g){p.push(g)}),d.on("end",function(){let g=Buffer.concat(p);d.headers["content-encoding"]==="gzip"?c.gunzip(g,function(h,A){h?r.reject(new de("Error decompressing response.")):r.resolve(yZ(A,t))}):r.resolve(yZ(g,t))})}).on("error",function(d){r.reject(new Sm)}).end()})}var oEe=typeof XMLHttpRequest>"u";St._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=tEe.exec(e);if(a!==null){r.resolve(nEe(a,t));return}if(oEe){iEe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(eT.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let f in o)o.hasOwnProperty(f)&&c.setRequestHeader(f,o[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new Sm(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),h={};g.forEach(function(A){let x=A.split(": "),C=x.shift();h[C]=x.join(": ")}),r.resolve(h);return}if(c.status===204)r.resolve();else if(l(f)&&(!l(t)||d===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new de("Invalid XMLHttpRequest response type."))},c.onerror=function(f){r.reject(new Sm)},c.send(i),c};St._Implementations.loadAndExecuteScript=function(e,t,n){return S0(e,t).catch(function(i){n.reject(i)})};St._DefaultImplementations={};St._DefaultImplementations.createImage=St._Implementations.createImage;St._DefaultImplementations.loadWithXhr=St._Implementations.loadWithXhr;St._DefaultImplementations.loadAndExecuteScript=St._Implementations.loadAndExecuteScript;St.DEFAULT=Object.freeze(new St({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var we=St;function hw(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data)?TZ(this,e.data):TZ(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}hw.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=we.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new de(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new hw({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};hw.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new X_(0,0,0,0,0),t}});hw.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new X_(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],u=ee.lessThanOrEquals(a,e),f=!l(c),d=f||ee.greaterThanOrEquals(c,e);if(u&&d)return o=i,!f&&c.equals(e)&&++o,r=o+1,bZ(this,n,this._samples,e,o,r,t),t}let s=wo(n,e,ee.compare,this._dateColumn);return s>=0?(s t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],u=t[r];if(c.equals(u)||i.equals(c))return EZ(e,n,o,a,s),s;if(i.equals(u))return EZ(e,n,r,a,s),s;let f=ee.secondsDifference(i,c)/ee.secondsDifference(u,c),d=o*a,p=r*a,g=n[d+e._ut1MinusUtcSecondsColumn],h=n[p+e._ut1MinusUtcSecondsColumn],A=h-g;if(A>.5||A<-.5){let x=n[d+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];x!==C&&(u.equals(i)?g=h:h-=C-x)}return s.xPoleWander=mw(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=mw(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=mw(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=mw(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=mw(f,g,h),s}var pw=hw;function Na(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}Na.fromQuaternion=function(e,t){l(t)||(t=new Na);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=-P.asinClamped(n),t};Na.fromDegrees=function(e,t,n,i){return l(i)||(i=new Na),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};Na.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Na(e.heading,e.pitch,e.roll)};Na.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Na.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};Na.prototype.clone=function(e){return Na.clone(this,e)};Na.prototype.equals=function(e){return Na.equals(this,e)};Na.prototype.equalsEpsilon=function(e,t,n){return Na.equalsEpsilon(this,e,t,n)};Na.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Fa=Na;var SZ=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function sEe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t "u"?e:(l(nT)||(nT=document.createElement("a")),nT.href=e,nT.href=nT.href,nT.href)}var I0;function vZ(){if(l(I0))return I0;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(j_.toUrl)?e=qh("..",P0("Core/buildModuleUrl.js")):e=sEe(),I0=new we({url:wZ(e)}),I0.appendForwardSlash(),I0}function aEe(e){return wZ(j_.toUrl(`../${e}`))}function DZ(e){return vZ().getDerivedResource({url:e}).url}var M3;function P0(e){return l(M3)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(j_.toUrl)?M3=aEe:M3=DZ),M3(e)}P0._cesiumScriptRegex=SZ;P0._buildModuleUrlFromBaseUrl=DZ;P0._clearBaseResource=function(){I0=void 0};P0.setBaseUrl=function(e){I0=we.DEFAULT.getDerivedResource({url:e})};P0.getCesiumBaseUrl=vZ;var en=P0;function cEe(e,t,n){this.x=e,this.y=t,this.s=n}var O0=cEe;function CG(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=we.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new ee(this._sampleZeroJulianEphemerisDate,0,Jn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var lEe=new ee(0,0,Jn.TAI);function AG(e,t,n){let i=lEe;return i.dayNumber=t,i.secondsOfDay=n,ee.daysDifference(i,e._sampleZeroDateTT)}CG.prototype.preload=function(e,t,n,i){let o=AG(this,e,t),r=AG(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(xG(this,d));return Promise.all(f)};CG.prototype.computeXysRadians=function(e,t,n){let i=AG(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(xG(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(xG(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new O0(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,h=this._xTable,A,x;for(A=0;A<=r;++A)d[A]=f-h[A];for(A=0;A<=r;++A){for(g[A]=1,x=0;x<=r;++x)x!==A&&(g[A]*=d[x]);g[A]*=p[A];let C=(s+A)*3;n.x+=g[A]*u[C++],n.y+=g[A]*u[C++],n.s+=g[A]*u[C]}return n};function xG(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new we({url:en(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u =43200?o=(r+.5)/Zn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/Zn.DAYS_PER_JULIAN_CENTURY;let a=(xEe+o*(CEe+o*(TEe+o*EEe)))*wEe%P.TWO_PI,c=SEe+bEe*(n-24515455e-1),u=(i+Zn.SECONDS_PER_DAY*.5)%Zn.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Z(d,p,0,-p,d,0,0,0,1)};ji.iau2006XysData=new _w;ji.earthOrientationParameters=pw.NONE;var wG=32.184,vEe=2451545;ji.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+wG,i=e.stop.dayNumber,o=e.stop.secondsOfDay+wG;return ji.iau2006XysData.preload(t,n,i,o)};ji.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new Z);let n=ji.computeFixedToIcrfMatrix(e,t);if(l(n))return Z.transpose(n,t)};var DEe=new O0(0,0,0),IEe=new X_(0,0,0,0,0,0),bG=new Z,SG=new Z;ji.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new Z);let n=ji.earthOrientationParameters.compute(e,IEe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+wG,r=ji.iau2006XysData.computeXysRadians(i,o,DEe);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=bG;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=Z.fromRotationZ(-r.s,SG),d=Z.multiply(u,f,bG),p=e.dayNumber,g=e.secondsOfDay-ee.computeTaiMinusUtc(e)+n.ut1MinusUtc,h=p-2451545,A=g/Zn.SECONDS_PER_DAY,x=.779057273264+A+.00273781191135448*(h+A);x=x%1*P.TWO_PI;let C=Z.fromRotationZ(x,SG),T=Z.multiply(d,C,bG),E=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),D=Math.sin(n.yPoleWander),O=i-vEe+o/Zn.SECONDS_PER_DAY;O/=36525;let M=-47e-6*O*P.RADIANS_PER_DEGREE/3600,L=Math.cos(M),N=Math.sin(M),_=SG;return _[0]=E*L,_[1]=E*N,_[2]=v,_[3]=-S*N+D*v*L,_[4]=S*L+D*v*N,_[5]=-D*E,_[6]=-D*N-S*v*L,_[7]=D*L-S*v*N,_[8]=S*E,Z.multiply(T,_,t)};var PEe=new re;ji.pointToWindowCoordinates=function(e,t,n,i){return i=ji.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};ji.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new H);let o=PEe;return B.multiplyByVector(e,re.fromElements(n.x,n.y,n.z,1,o),o),re.multiplyByScalar(o,1/o.w,o),B.multiplyByVector(t,o,o),H.fromCartesian4(o,i)};var OEe=new m,MEe=new m,REe=new m;ji.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=y(n,oe.WGS84).geodeticSurfaceNormal(e,OEe),r=m.cross(t,o,MEe);m.equalsEpsilon(r,m.ZERO,P.EPSILON6)&&(r=m.clone(m.UNIT_X,r));let s=m.cross(r,t,REe);return m.normalize(s,s),m.cross(t,s,r),m.negate(r,r),m.normalize(r,r),l(i)||(i=new Z),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 PZ=new B(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),OZ=new he,MZ=new m,BEe=new m,LEe=new Z,vG=new B,RZ=new B;ji.basisTo2D=function(e,t,n){let i=B.getTranslation(t,BEe),o=e.ellipsoid,r=o.cartesianToCartographic(i,OZ),s=e.project(r,MZ);m.fromElements(s.z,s.x,s.y,s);let a=ji.eastNorthUpToFixedFrame(i,o,vG),c=B.inverseTransformation(a,RZ),u=B.getMatrix3(t,LEe),f=B.multiplyByMatrix3(c,u,n);return B.multiply(PZ,f,n),B.setTranslation(n,s,n),n};ji.wgs84To2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=ji.eastNorthUpToFixedFrame(t,i,vG),r=B.inverseTransformation(o,RZ),s=i.cartesianToCartographic(t,OZ),a=e.project(s,MZ);m.fromElements(a.z,a.x,a.y,a);let c=B.fromTranslation(a,vG);return B.multiply(PZ,r,n),B.multiply(c,n,n),n};var Rt=ji;function DG(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Le.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,Hu.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}DG.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var NEe=new he,FEe=new m,BZ=new B,UEe=[new he,new he,new he],VEe=[new H,new H,new H],kEe=[new H,new H,new H],zEe=new m,HEe=new Ne,GEe=new B,WEe=new Qi;DG._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=le.center(i,NEe),s=he.toCartesian(r,n,FEe),a=Rt.eastNorthUpToFixedFrame(s,n,BZ),c=B.inverse(a,BZ),u=VEe,f=UEe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=zEe;for(o=0;o<3;o++)he.toCartesian(f[o],n,d),d=B.multiplyByPointAsVector(c,d,d),u[o].x=d.x,u[o].y=d.y;let p=Ne.fromAxisAngle(m.UNIT_Z,-t,HEe),g=Z.fromQuaternion(p,GEe),h=e.length,A=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(o=0;o =this._maximumActiveTasks)return;++this._activeTasks;let n=this;return Promise.resolve(NZ()).then(function(i){l(t)?i||(t.length=0):t=XEe;let o=n._nextID++,r=Gs();return n._deferreds[o]=r,n._worker.postMessage({id:o,parameters:e,canTransferArrayBuffer:i},t),r.promise})};fa.prototype.initWebAssemblyModule=function(e){l(this._worker)||(this._worker=VZ(this));let t=Gs(),n=this,i=this._worker;return qEe(this,e).then(function(o){return Promise.resolve(NZ()).then(function(r){let s,a=o.wasmBinary;l(a)&&r&&(s=[a]),i.onmessage=function(c){i.onmessage=function(u){FZ(n,u.data)},t.resolve(c.data)},i.postMessage({webAssemblyConfig:o},s)})}),t.promise};fa.prototype.isDestroyed=function(){return!1};fa.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};fa.taskCompletedEvent=PG;fa._defaultWorkerModulePrefix="Workers/";fa._workerModulePrefix=fa._defaultWorkerModulePrefix;fa._canTransferArrayBuffer=void 0;var hi=fa;function Jh(){}Jh._transcodeTaskProcessor=new hi("transcodeKTX2",Number.POSITIVE_INFINITY);Jh._readyPromise=void 0;function KEe(){let e=Jh._transcodeTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/Workers/basis_transcoder.js",wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(){return Jh._transcodeTaskProcessor});Jh._readyPromise=e}Jh.transcode=function(e,t){return l(Jh._readyPromise)||KEe(),Jh._readyPromise.then(function(n){let i;if(e instanceof ArrayBuffer){let o=new Uint8Array(e);return i={supportedTargetFormats:t,ktx2Buffer:o},n.scheduleTask(i,[e])}return i={supportedTargetFormats:t,ktx2Buffer:e},n.scheduleTask(i,[e.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]),r=o.length,s;for(s=0;s1/pi. + * + * @alias czm_oneOverPi + * @glslConstant + * + * @see CesiumMath.ONE_OVER_PI + * + * @example + * // GLSL declaration + * const float czm_oneOverPi = ...; + * + * // Example + * float pi = 1.0 / czm_oneOverPi; + */ +const float czm_oneOverPi = 0.3183098861837907; +`;var Mw=`/** + * A built-in GLSL floating-point constant for 1/2pi. + * + * @alias czm_oneOverTwoPi + * @glslConstant + * + * @see CesiumMath.ONE_OVER_TWO_PI + * + * @example + * // GLSL declaration + * const float czm_oneOverTwoPi = ...; + * + * // Example + * float pi = 2.0 * czm_oneOverTwoPi; + */ +const float czm_oneOverTwoPi = 0.15915494309189535; +`;var Rw=`/** + * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE} + * + * @name czm_passCesium3DTile + * @glslConstant + * + * @see czm_pass + */ +const float czm_passCesium3DTile = 4.0; +`;var Bw=`/** + * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION} + * + * @name czm_passCesium3DTileClassification + * @glslConstant + * + * @see czm_pass + */ +const float czm_passCesium3DTileClassification = 5.0; +`;var Lw=`/** + * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW} + * + * @name czm_passCesium3DTileClassificationIgnoreShow + * @glslConstant + * + * @see czm_pass + */ +const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; +`;var Nw=`/** + * The automatic GLSL constant for {@link Pass#CLASSIFICATION} + * + * @name czm_passClassification + * @glslConstant + * + * @see czm_pass + */ +const float czm_passClassification = 7.0; +`;var Fw=`/** + * The automatic GLSL constant for {@link Pass#COMPUTE} + * + * @name czm_passCompute + * @glslConstant + * + * @see czm_pass + */ +const float czm_passCompute = 1.0; +`;var Uw=`/** + * The automatic GLSL constant for {@link Pass#ENVIRONMENT} + * + * @name czm_passEnvironment + * @glslConstant + * + * @see czm_pass + */ +const float czm_passEnvironment = 0.0; +`;var Vw=`/** + * The automatic GLSL constant for {@link Pass#GLOBE} + * + * @name czm_passGlobe + * @glslConstant + * + * @see czm_pass + */ +const float czm_passGlobe = 2.0; +`;var kw=`/** + * The automatic GLSL constant for {@link Pass#OPAQUE} + * + * @name czm_passOpaque + * @glslConstant + * + * @see czm_pass + */ +const float czm_passOpaque = 7.0; +`;var zw=`/** + * The automatic GLSL constant for {@link Pass#OVERLAY} + * + * @name czm_passOverlay + * @glslConstant + * + * @see czm_pass + */ +const float czm_passOverlay = 10.0; +`;var Hw=`/** + * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION} + * + * @name czm_passTerrainClassification + * @glslConstant + * + * @see czm_pass + */ +const float czm_passTerrainClassification = 3.0; +`;var Gw=`/** + * The automatic GLSL constant for {@link Pass#TRANSLUCENT} + * + * @name czm_passTranslucent + * @glslConstant + * + * @see czm_pass + */ +const float czm_passTranslucent = 8.0; +`;var Ww=`/** + * The automatic GLSL constant for {@link Pass#VOXELS} + * + * @name czm_passVoxels + * @glslConstant + * + * @see czm_pass + */ +const float czm_passVoxels = 9.0; +`;var jw=`/** + * A built-in GLSL floating-point constant forMath.PI. + * + * @alias czm_pi + * @glslConstant + * + * @see CesiumMath.PI + * + * @example + * // GLSL declaration + * const float czm_pi = ...; + * + * // Example + * float twoPi = 2.0 * czm_pi; + */ +const float czm_pi = 3.141592653589793; +`;var Yw=`/** + * A built-in GLSL floating-point constant forpi/4. + * + * @alias czm_piOverFour + * @glslConstant + * + * @see CesiumMath.PI_OVER_FOUR + * + * @example + * // GLSL declaration + * const float czm_piOverFour = ...; + * + * // Example + * float pi = 4.0 * czm_piOverFour; + */ +const float czm_piOverFour = 0.7853981633974483; +`;var qw=`/** + * A built-in GLSL floating-point constant forpi/6. + * + * @alias czm_piOverSix + * @glslConstant + * + * @see CesiumMath.PI_OVER_SIX + * + * @example + * // GLSL declaration + * const float czm_piOverSix = ...; + * + * // Example + * float pi = 6.0 * czm_piOverSix; + */ +const float czm_piOverSix = 0.5235987755982988; +`;var Xw=`/** + * A built-in GLSL floating-point constant forpi/3. + * + * @alias czm_piOverThree + * @glslConstant + * + * @see CesiumMath.PI_OVER_THREE + * + * @example + * // GLSL declaration + * const float czm_piOverThree = ...; + * + * // Example + * float pi = 3.0 * czm_piOverThree; + */ +const float czm_piOverThree = 1.0471975511965976; +`;var Kw=`/** + * A built-in GLSL floating-point constant forpi/2. + * + * @alias czm_piOverTwo + * @glslConstant + * + * @see CesiumMath.PI_OVER_TWO + * + * @example + * // GLSL declaration + * const float czm_piOverTwo = ...; + * + * // Example + * float pi = 2.0 * czm_piOverTwo; + */ +const float czm_piOverTwo = 1.5707963267948966; +`;var Jw=`/** + * A built-in GLSL floating-point constant for converting degrees to radians. + * + * @alias czm_radiansPerDegree + * @glslConstant + * + * @see CesiumMath.RADIANS_PER_DEGREE + * + * @example + * // GLSL declaration + * const float czm_radiansPerDegree = ...; + * + * // Example + * float rad = czm_radiansPerDegree * deg; + */ +const float czm_radiansPerDegree = 0.017453292519943295; +`;var Zw=`/** + * The constant identifier for the 2D {@link SceneMode} + * + * @name czm_sceneMode2D + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneModeColumbusView + * @see czm_sceneMode3D + * @see czm_sceneModeMorphing + */ +const float czm_sceneMode2D = 2.0; +`;var Qw=`/** + * The constant identifier for the 3D {@link SceneMode} + * + * @name czm_sceneMode3D + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneMode2D + * @see czm_sceneModeColumbusView + * @see czm_sceneModeMorphing + */ +const float czm_sceneMode3D = 3.0; +`;var $w=`/** + * The constant identifier for the Columbus View {@link SceneMode} + * + * @name czm_sceneModeColumbusView + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneMode2D + * @see czm_sceneMode3D + * @see czm_sceneModeMorphing + */ +const float czm_sceneModeColumbusView = 1.0; +`;var ev=`/** + * The constant identifier for the Morphing {@link SceneMode} + * + * @name czm_sceneModeMorphing + * @glslConstant + * @see czm_sceneMode + * @see czm_sceneMode2D + * @see czm_sceneModeColumbusView + * @see czm_sceneMode3D + */ +const float czm_sceneModeMorphing = 0.0; +`;var tv=`/** + * A built-in GLSL floating-point constant for one solar radius. + * + * @alias czm_solarRadius + * @glslConstant + * + * @see CesiumMath.SOLAR_RADIUS + * + * @example + * // GLSL declaration + * const float czm_solarRadius = ...; + */ +const float czm_solarRadius = 695500000.0; +`;var nv=`/** + * A built-in GLSL floating-point constant for3pi/2. + * + * @alias czm_threePiOver2 + * @glslConstant + * + * @see CesiumMath.THREE_PI_OVER_TWO + * + * @example + * // GLSL declaration + * const float czm_threePiOver2 = ...; + * + * // Example + * float pi = (2.0 / 3.0) * czm_threePiOver2; + */ +const float czm_threePiOver2 = 4.71238898038469; +`;var iv=`/** + * A built-in GLSL floating-point constant for2pi. + * + * @alias czm_twoPi + * @glslConstant + * + * @see CesiumMath.TWO_PI + * + * @example + * // GLSL declaration + * const float czm_twoPi = ...; + * + * // Example + * float pi = czm_twoPi / 2.0; + */ +const float czm_twoPi = 6.283185307179586; +`;var ov=`/** + * The maximum latitude, in radians, both North and South, supported by a Web Mercator + * (EPSG:3857) projection. Technically, the Mercator projection is defined + * for any latitude up to (but not including) 90 degrees, but it makes sense + * to cut it off sooner because it grows exponentially with increasing latitude. + * The logic behind this particular cutoff value, which is the one used by + * Google Maps, Bing Maps, and Esri, is that it makes the projection + * square. That is, the rectangle is equal in the X and Y directions. + * + * The constant value is computed as follows: + * czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi))) + * + * @name czm_webMercatorMaxLatitude + * @glslConstant + */ +const float czm_webMercatorMaxLatitude = 1.4844222297453324; +`;var rv=`/** + * @name czm_depthRangeStruct + * @glslStruct + */ +struct czm_depthRangeStruct +{ + float near; + float far; +}; +`;var sv=`/** + * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions. + * + * @name czm_material + * @glslStruct + * + * @property {vec3} diffuse Incoming light that scatters evenly in all directions. + * @property {float} specular Intensity of incoming light reflecting in a single direction. + * @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. + * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. + * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. + * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. + */ +struct czm_material +{ + vec3 diffuse; + float specular; + float shininess; + vec3 normal; + vec3 emission; + float alpha; +}; +`;var av=`/** + * Used as input to every material's czm_getMaterial function. + * + * @name czm_materialInput + * @glslStruct + * + * @property {float} s 1D texture coordinates. + * @property {vec2} st 2D texture coordinates. + * @property {vec3} str 3D texture coordinates. + * @property {vec3} normalEC Unperturbed surface normal in eye coordinates. + * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space. + * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye. + * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid. Only available for globe materials. + * @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials. + * @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials. + */ +struct czm_materialInput +{ + float s; + vec2 st; + vec3 str; + vec3 normalEC; + mat3 tangentToEyeMatrix; + vec3 positionToEyeEC; + float height; + float slope; + float aspect; +}; +`;var cv=`/** + * Struct for representing a material for a {@link Model}. The model + * rendering pipeline will pass this struct between material, custom shaders, + * and lighting stages. This is not to be confused with {@link czm_material} + * which is used by the older Fabric materials system, although they are similar. + *+ * All color values (diffuse, specular, emissive) are in linear color space. + *
+ * + * @name czm_modelMaterial + * @glslStruct + * + * @property {vec3} diffuse Incoming light that scatters evenly in all directions. + * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. + * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature. + * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces. + * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. + * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded. + * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. + */ +struct czm_modelMaterial { + vec3 diffuse; + float alpha; + vec3 specular; + float roughness; + vec3 normalEC; + float occlusion; + vec3 emissive; +}; +`;var lv=`/** + * Struct for representing the output of a custom vertex shader. + * + * @name czm_modelVertexOutput + * @glslStruct + * + * @see {@link CustomShader} + * @see {@link Model} + * + * @property {vec3} positionMC The position of the vertex in model coordinates + * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. + */ +struct czm_modelVertexOutput { + vec3 positionMC; + float pointSize; +}; +`;var uv=`/** + * Parameters for {@link czm_pbrLighting} + * + * @name czm_material + * @glslStruct + * + * @property {vec3} diffuseColor the diffuse color of the material for the lambert term of the rendering equation + * @property {float} roughness a value from 0.0 to 1.0 that indicates how rough the surface of the material is. + * @property {vec3} f0 The reflectance of the material at normal incidence + */ +struct czm_pbrParameters +{ + vec3 diffuseColor; + float roughness; + vec3 f0; +}; +`;var fv=`/** + * DOC_TBA + * + * @name czm_ray + * @glslStruct + */ +struct czm_ray +{ + vec3 origin; + vec3 direction; +}; +`;var dv=`/** + * DOC_TBA + * + * @name czm_raySegment + * @glslStruct + */ +struct czm_raySegment +{ + float start; + float stop; +}; + +/** + * DOC_TBA + * + * @name czm_emptyRaySegment + * @glslConstant + */ +const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity); + +/** + * DOC_TBA + * + * @name czm_fullRaySegment + * @glslConstant + */ +const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); +`;var mv=`struct czm_shadowParameters +{ +#ifdef USE_CUBE_MAP_SHADOW + vec3 texCoords; +#else + vec2 texCoords; +#endif + + float depthBias; + float depth; + float nDotL; + vec2 texelStepSize; + float normalShadingSmooth; + float darkness; +}; +`;var hv=`/** + * Converts an HSB color (hue, saturation, brightness) to RGB + * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} + * + * @name czm_HSBToRGB + * @glslFunction + * + * @param {vec3} hsb The color in HSB. + * + * @returns {vec3} The color in RGB. + * + * @example + * vec3 hsb = czm_RGBToHSB(rgb); + * hsb.z *= 0.1; + * rgb = czm_HSBToRGB(hsb); + */ + +const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + +vec3 czm_HSBToRGB(vec3 hsb) +{ + vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www); + return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y); +} +`;var pv=`/** + * Converts an HSL color (hue, saturation, lightness) to RGB + * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} + * + * @name czm_HSLToRGB + * @glslFunction + * + * @param {vec3} rgb The color in HSL. + * + * @returns {vec3} The color in RGB. + * + * @example + * vec3 hsl = czm_RGBToHSL(rgb); + * hsl.z *= 0.1; + * rgb = czm_HSLToRGB(hsl); + */ + +vec3 hueToRGB(float hue) +{ + float r = abs(hue * 6.0 - 3.0) - 1.0; + float g = 2.0 - abs(hue * 6.0 - 2.0); + float b = 2.0 - abs(hue * 6.0 - 4.0); + return clamp(vec3(r, g, b), 0.0, 1.0); +} + +vec3 czm_HSLToRGB(vec3 hsl) +{ + vec3 rgb = hueToRGB(hsl.x); + float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y; + return (rgb - 0.5) * c + hsl.z; +} +`;var _v=`/** + * Converts an RGB color to HSB (hue, saturation, brightness) + * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} + * + * @name czm_RGBToHSB + * @glslFunction + * + * @param {vec3} rgb The color in RGB. + * + * @returns {vec3} The color in HSB. + * + * @example + * vec3 hsb = czm_RGBToHSB(rgb); + * hsb.z *= 0.1; + * rgb = czm_HSBToRGB(hsb); + */ + +const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); + +vec3 czm_RGBToHSB(vec3 rgb) +{ + vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g)); + vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r)); + + float d = q.x - min(q.w, q.y); + return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x); +} +`;var gv=`/** + * Converts an RGB color to HSL (hue, saturation, lightness) + * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} + * + * @name czm_RGBToHSL + * @glslFunction + * + * @param {vec3} rgb The color in RGB. + * + * @returns {vec3} The color in HSL. + * + * @example + * vec3 hsl = czm_RGBToHSL(rgb); + * hsl.z *= 0.1; + * rgb = czm_HSLToRGB(hsl); + */ + +vec3 RGBtoHCV(vec3 rgb) +{ + // Based on work by Sam Hocevar and Emil Persson + vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0); + vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx); + float c = q.x - min(q.w, q.y); + float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z); + return vec3(h, c, q.x); +} + +vec3 czm_RGBToHSL(vec3 rgb) +{ + vec3 hcv = RGBtoHCV(rgb); + float l = hcv.z - hcv.y * 0.5; + float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7); + return vec3(hcv.x, s, l); +} +`;var yv=`/** + * Converts an RGB color to CIE Yxy. + *The conversion is described in + * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} + *
+ * + * @name czm_RGBToXYZ + * @glslFunction + * + * @param {vec3} rgb The color in RGB. + * + * @returns {vec3} The color in CIE Yxy. + * + * @example + * vec3 xyz = czm_RGBToXYZ(rgb); + * xyz.x = max(xyz.x - luminanceThreshold, 0.0); + * rgb = czm_XYZToRGB(xyz); + */ +vec3 czm_RGBToXYZ(vec3 rgb) +{ + const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193, + 0.3576, 0.7152, 0.1192, + 0.1805, 0.0722, 0.9505); + vec3 xyz = RGB2XYZ * rgb; + vec3 Yxy; + Yxy.r = xyz.g; + float temp = dot(vec3(1.0), xyz); + Yxy.gb = xyz.rg / temp; + return Yxy; +} +`;var Av=`/** + * Converts a CIE Yxy color to RGB. + *The conversion is described in + * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} + *
+ * + * @name czm_XYZToRGB + * @glslFunction + * + * @param {vec3} Yxy The color in CIE Yxy. + * + * @returns {vec3} The color in RGB. + * + * @example + * vec3 xyz = czm_RGBToXYZ(rgb); + * xyz.x = max(xyz.x - luminanceThreshold, 0.0); + * rgb = czm_XYZToRGB(xyz); + */ +vec3 czm_XYZToRGB(vec3 Yxy) +{ + const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556, + -1.5371, 1.8760, -0.2040, + -0.4985, 0.0416, 1.0572); + vec3 xyz; + xyz.r = Yxy.r * Yxy.g / Yxy.b; + xyz.g = Yxy.r; + xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; + + return XYZ2RGB * xyz; +} +`;var xv=`// See: +// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/ + +vec3 czm_acesTonemapping(vec3 color) { + float g = 0.985; + float a = 0.065; + float b = 0.0001; + float c = 0.433; + float d = 0.238; + + color = (color * (color + a) - b) / (color * (g * color + c) + d); + + color = clamp(color, 0.0, 1.0); + + return color; +} +`;var Cv=`/** + * @private + */ +float czm_alphaWeight(float a) +{ + float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; + + // See Weighted Blended Order-Independent Transparency for examples of different weighting functions: + // http://jcgt.org/published/0002/02/09/ + return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0)))); +} +`;var Tv=`/** + * Procedural anti-aliasing by blurring two colors that meet at a sharp edge. + * + * @name czm_antialias + * @glslFunction + * + * @param {vec4} color1 The color on one side of the edge. + * @param {vec4} color2 The color on the other side of the edge. + * @param {vec4} currentcolor The current color, eithercolor1orcolor2. + * @param {float} dist The distance to the edge in texture coordinates. + * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors. + * @returns {vec4} The anti-aliased color. + * + * @example + * // GLSL declarations + * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor); + * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist); + * + * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space + * float dist = abs(textureCoordinates.t - 0.5); + * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t)); + * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1); + */ +vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) +{ + float val1 = clamp(dist / fuzzFactor, 0.0, 1.0); + float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0); + val1 = val1 * (1.0 - val2); + val1 = val1 * val1 * (3.0 - (2.0 * val1)); + val1 = pow(val1, 0.5); //makes the transition nicer + + vec4 midColor = (color1 + color2) * 0.5; + return mix(midColor, currentColor, val1); +} + +vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) +{ + return czm_antialias(color1, color2, currentColor, dist, 0.1); +} +`;var Ev=`/** + * Approximately computes spherical coordinates given a normal. + * Uses approximate inverse trigonometry for speed and consistency, + * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU. + * + * @name czm_approximateSphericalCoordinates + * @glslFunction + * + * @param {vec3} normal arbitrary-length normal. + * + * @returns {vec2} Approximate latitude and longitude spherical coordinates. + */ +vec2 czm_approximateSphericalCoordinates(vec3 normal) { + // Project into plane with vertical for latitude + float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z); + float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y); + return vec2(latitudeApproximation, longitudeApproximation); +} +`;var bv=`/** + * Determines if the fragment is back facing + * + * @name czm_backFacing + * @glslFunction + * + * @returns {bool}trueif the fragment is back facing; otherwise,false. + */ +bool czm_backFacing() +{ + // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494. + return gl_FrontFacing == false; +} +`;var Sv=`/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a float expression. + * + * @name czm_branchFreeTernary + * @glslFunction + * + * @param {bool} comparison A comparison statement + * @param {float} a Value to return if the comparison is true. + * @param {float} b Value to return if the comparison is false. + * + * @returns {float} equivalent of comparison ? a : b + */ +float czm_branchFreeTernary(bool comparison, float a, float b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); +} + +/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a vec2 expression. + * + * @name czm_branchFreeTernary + * @glslFunction + * + * @param {bool} comparison A comparison statement + * @param {vec2} a Value to return if the comparison is true. + * @param {vec2} b Value to return if the comparison is false. + * + * @returns {vec2} equivalent of comparison ? a : b + */ +vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); +} + +/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a vec3 expression. + * + * @name czm_branchFreeTernary + * @glslFunction + * + * @param {bool} comparison A comparison statement + * @param {vec3} a Value to return if the comparison is true. + * @param {vec3} b Value to return if the comparison is false. + * + * @returns {vec3} equivalent of comparison ? a : b + */ +vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); +} + +/** + * Branchless ternary operator to be used when it's inexpensive to explicitly + * evaluate both possibilities for a vec4 expression. + * + * @name czm_branchFreeTernary + * @glslFunction + * + * @param {bool} comparison A comparison statement + * @param {vec3} a Value to return if the comparison is true. + * @param {vec3} b Value to return if the comparison is false. + * + * @returns {vec3} equivalent of comparison ? a : b + */ +vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { + float useA = float(comparison); + return a * useA + b * (1.0 - useA); +} +`;var wv=` +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 vv=` +uniform vec4 shadowMap_cascadeDistances; + +float czm_cascadeDistance(vec4 weights) +{ + return dot(shadowMap_cascadeDistances, weights); +} +`;var Dv=` +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 Iv=` +uniform vec4 shadowMap_cascadeSplits[2]; + +vec4 czm_cascadeWeights(float depthEye) +{ + // One component is set to 1.0 and all others set to 0.0. + vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); + vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); + return near * far; +} +`;var Pv=`/** + * DOC_TBA + * + * @name czm_columbusViewMorph + * @glslFunction + */ +vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) +{ + // Just linear for now. + vec3 p = mix(position2D.xyz, position3D.xyz, time); + return vec4(p, 1.0); +} +`;var Ov=`/** + * Returns a position in model coordinates relative to eye taking into + * account the current scene mode: 3D, 2D, or Columbus view. + *+ * This uses standard position attributes,
+ * + * @name czm_computePosition + * @glslFunction + * + * @returns {vec4} The position relative to eye. + * + * @example + * vec4 p = czm_computePosition(); + * v_positionEC = (czm_modelViewRelativeToEye * p).xyz; + * gl_Position = czm_modelViewProjectionRelativeToEye * p; + * + * @see czm_translateRelativeToEye + */ +vec4 czm_computePosition(); +`;var Mv=`/** + * @private + */ +vec2 cordic(float angle) +{ +// Scale the vector by the appropriate factor for the 24 iterations to follow. + vec2 vector = vec2(6.0725293500888267e-1, 0.0); +// Iteration 1 + float sense = (angle < 0.0) ? -1.0 : 1.0; + // float factor = sense * 1.0; // 2^-0 + mat2 rotation = mat2(1.0, sense, -sense, 1.0); + vector = rotation * vector; + angle -= sense * 7.8539816339744828e-1; // atan(2^-0) +// Iteration 2 + sense = (angle < 0.0) ? -1.0 : 1.0; + float factor = sense * 5.0e-1; // 2^-1 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 4.6364760900080609e-1; // atan(2^-1) +// Iteration 3 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 2.5e-1; // 2^-2 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 2.4497866312686414e-1; // atan(2^-2) +// Iteration 4 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.25e-1; // 2^-3 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.2435499454676144e-1; // atan(2^-3) +// Iteration 5 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 6.25e-2; // 2^-4 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 6.2418809995957350e-2; // atan(2^-4) +// Iteration 6 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.125e-2; // 2^-5 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.1239833430268277e-2; // atan(2^-5) +// Iteration 7 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.5625e-2; // 2^-6 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.5623728620476831e-2; // atan(2^-6) +// Iteration 8 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 7.8125e-3; // 2^-7 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 7.8123410601011111e-3; // atan(2^-7) +// Iteration 9 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.90625e-3; // 2^-8 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.9062301319669718e-3; // atan(2^-8) +// Iteration 10 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.953125e-3; // 2^-9 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.9531225164788188e-3; // atan(2^-9) +// Iteration 11 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 9.765625e-4; // 2^-10 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 9.7656218955931946e-4; // atan(2^-10) +// Iteration 12 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 4.8828125e-4; // 2^-11 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 4.8828121119489829e-4; // atan(2^-11) +// Iteration 13 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 2.44140625e-4; // 2^-12 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 2.4414062014936177e-4; // atan(2^-12) +// Iteration 14 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.220703125e-4; // 2^-13 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.2207031189367021e-4; // atan(2^-13) +// Iteration 15 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 6.103515625e-5; // 2^-14 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 6.1035156174208773e-5; // atan(2^-14) +// Iteration 16 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.0517578125e-5; // 2^-15 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.0517578115526096e-5; // atan(2^-15) +// Iteration 17 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.52587890625e-5; // 2^-16 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.5258789061315762e-5; // atan(2^-16) +// Iteration 18 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 7.62939453125e-6; // 2^-17 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 7.6293945311019700e-6; // atan(2^-17) +// Iteration 19 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 3.814697265625e-6; // 2^-18 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 3.8146972656064961e-6; // atan(2^-18) +// Iteration 20 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.9073486328125e-6; // 2^-19 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 1.9073486328101870e-6; // atan(2^-19) +// Iteration 21 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 9.5367431640625e-7; // 2^-20 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 9.5367431640596084e-7; // atan(2^-20) +// Iteration 22 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 4.76837158203125e-7; // 2^-21 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 4.7683715820308884e-7; // atan(2^-21) +// Iteration 23 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 2.384185791015625e-7; // 2^-22 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; + angle -= sense * 2.3841857910155797e-7; // atan(2^-22) +// Iteration 24 + sense = (angle < 0.0) ? -1.0 : 1.0; + factor = sense * 1.1920928955078125e-7; // 2^-23 + rotation[0][1] = factor; + rotation[1][0] = -factor; + vector = rotation * vector; +// angle -= sense * 1.1920928955078068e-7; // atan(2^-23) + + return vector; +} + +/** + * Computes the cosine and sine of the provided angle using the CORDIC algorithm. + * + * @name czm_cosineAndSine + * @glslFunction + * + * @param {float} angle The angle in radians. + * + * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate). + * + * @example + * vec2 v = czm_cosineAndSine(czm_piOverSix); + * float cosine = v.x; + * float sine = v.y; + */ +vec2 czm_cosineAndSine(float angle) +{ + if (angle < -czm_piOverTwo || angle > czm_piOverTwo) + { + if (angle < 0.0) + { + return -cordic(angle + czm_pi); + } + else + { + return -cordic(angle - czm_pi); + } + } + else + { + return cordic(angle); + } +} +`;var Rv=`/** + * Decompresses texture coordinates that were packed into a single float. + * + * @name czm_decompressTextureCoordinates + * @glslFunction + * + * @param {float} encoded The compressed texture coordinates. + * @returns {vec2} The decompressed texture coordinates. + */ + vec2 czm_decompressTextureCoordinates(float encoded) + { + float temp = encoded / 4096.0; + float xZeroTo4095 = floor(temp); + float stx = xZeroTo4095 / 4095.0; + float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; + return vec2(stx, sty); + } +`;var Bv=`/** + * Get default parameters for physically based rendering. These defaults + * describe a rough dielectric (non-metal) surface (e.g. rough plastic). + * + * @return {czm_pbrParameters} Default parameters for {@link czm_pbrLighting} + */ +czm_pbrParameters czm_defaultPbrMaterial() +{ + czm_pbrParameters results; + results.diffuseColor = vec3(1.0); + results.roughness = 1.0; + + const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); + results.f0 = REFLECTANCE_DIELECTRIC; + return results; +} +`;var Lv=`// emulated noperspective +#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) +out float v_WindowZ; +#endif + +/** + * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2. + * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, + * capping the shadow volume. More information here: + * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt. + * + * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring + * no geometry gets clipped by setting the clip space z value to 0.0 and then + * sending the unaltered screen space z value (using emulated noperspective + * interpolation) to the frag shader where it is clamped to [0,1] and then + * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on: + * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv. + * + * When GL_EXT_frag_depth is not available, which is the case on some mobile + * devices, we must attempt to fix this only in the vertex shader. + * The approach is to clamp the z value to the far plane, which closes the + * shadow volume but also distorts the geometry, so there can still be artifacts + * on frustum seams. + * + * @name czm_depthClamp + * @glslFunction + * + * @param {vec4} coords The vertex in clip coordinates. + * @returns {vec4} The modified vertex. + * + * @example + * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0)); + * + * @see czm_writeDepthClamp + */ +vec4 czm_depthClamp(vec4 coords) +{ +#ifndef LOG_DEPTH +#if __VERSION__ == 300 || defined(GL_EXT_frag_depth) + v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w; + coords.z = 0.0; +#else + coords.z = min(coords.z, coords.w); +#endif +#endif + return coords; +} +`;var Nv=`/** + * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system + * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the + * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping. + *position3DHigh, + *position3DLow,position2DHigh, andposition2DLow, + * and should be used when writing a vertex shader for an {@link Appearance}. + *
+ * The ellipsoid is assumed to be centered at the model coordinate's origin. + * + * @name czm_eastNorthUpToEyeCoordinates + * @glslFunction + * + * @param {vec3} positionMC The position on the ellipsoid in model coordinates. + * @param {vec3} normalEC The normalized ellipsoid surface normal, atpositionMC, in eye coordinates. + * + * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates. + * + * @example + * // Transform a vector defined in the east-north-up coordinate + * // system, (0, 0, 1) which is the surface normal, to eye + * // coordinates. + * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); + * vec3 normalEC = m * vec3(0.0, 0.0, 1.0); + */ +mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) +{ + vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates + vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordiantes + vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates + + return mat3( + tangentEC.x, tangentEC.y, tangentEC.z, + bitangentEC.x, bitangentEC.y, bitangentEC.z, + normalEC.x, normalEC.y, normalEC.z); +} +`;var Fv=`/** + * DOC_TBA + * + * @name czm_ellipsoidContainsPoint + * @glslFunction + * + */ +bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) +{ + vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz; + return (dot(scaled, scaled) <= 1.0); +} +`;var Uv=`/** + * DOC_TBA + * + * @name czm_ellipsoidWgs84TextureCoordinates + * @glslFunction + */ +vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal) +{ + return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); +} +`;var Vv=`/** + * Comparesleftandrightcomponentwise. Returnstrue+ * if they are withinepsilonandfalseotherwise. The inputs + *leftandrightcan befloats,vec2s, + *vec3s, orvec4s. + * + * @name czm_equalsEpsilon + * @glslFunction + * + * @param {} left The first vector. + * @param {} right The second vector. + * @param {float} epsilon The epsilon to use for equality testing. + * @returns {bool}trueif the components are withinepsilonandfalseotherwise. + * + * @example + * // GLSL declarations + * bool czm_equalsEpsilon(float left, float right, float epsilon); + * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon); + * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon); + * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon); + */ +bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) { + return all(lessThanEqual(abs(left - right), vec4(epsilon))); +} + +bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) { + return all(lessThanEqual(abs(left - right), vec3(epsilon))); +} + +bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) { + return all(lessThanEqual(abs(left - right), vec2(epsilon))); +} + +bool czm_equalsEpsilon(float left, float right, float epsilon) { + return (abs(left - right) <= epsilon); +} +`;var kv=`/** + * DOC_TBA + * + * @name czm_eyeOffset + * @glslFunction + * + * @param {vec4} positionEC DOC_TBA. + * @param {vec3} eyeOffset DOC_TBA. + * + * @returns {vec4} DOC_TBA. + */ +vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) +{ + // This equation is approximate in x and y. + vec4 p = positionEC; + vec4 zEyeOffset = normalize(p) * eyeOffset.z; + p.xy += eyeOffset.xy + zEyeOffset.xy; + p.z += zEyeOffset.z; + return p; +} +`;var zv=`/** + * Transforms a position from eye to window coordinates. The transformation + * from eye to clip coordinates is done using {@link czm_projection}. + * The transform from normalized device coordinates to window coordinates is + * done using {@link czm_viewportTransformation}, which assumes a depth range + * ofnear = 0andfar = 1. + *
+ * This transform is useful when there is a need to manipulate window coordinates + * in a vertex shader as done by {@link BillboardCollection}. + * + * @name czm_eyeToWindowCoordinates + * @glslFunction + * + * @param {vec4} position The position in eye coordinates to transform. + * + * @returns {vec4} The transformed position in window coordinates. + * + * @see czm_modelToWindowCoordinates + * @see czm_projection + * @see czm_viewportTransformation + * @see BillboardCollection + * + * @example + * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); + */ +vec4 czm_eyeToWindowCoordinates(vec4 positionEC) +{ + vec4 q = czm_projection * positionEC; // clip coordinates + q.xyz /= q.w; // normalized device coordinates + q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates + return q; +} +`;var Hv=`/** + * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input. + * + * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on + * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006. + * Adapted from ShaderFastLibs under MIT License. + * + * Chosen for the following characteristics over range [0, 1]: + * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan) + * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator) + * + * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301); + * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2. + * + * @name czm_fastApproximateAtan + * @glslFunction + * + * @param {float} x Value between 0 and 1 inclusive. + * + * @returns {float} Approximation of atan(x) + */ +float czm_fastApproximateAtan(float x) { + return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); +} + +/** + * Approximation of atan2. + * + * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html + * However, we replaced their atan curve with Michael Drobot's (see above). + * + * @name czm_fastApproximateAtan + * @glslFunction + * + * @param {float} x Value between -1 and 1 inclusive. + * @param {float} y Value between -1 and 1 inclusive. + * + * @returns {float} Approximation of atan2(x, y) + */ +float czm_fastApproximateAtan(float x, float y) { + // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications. + // So range-reduce using abs and by flipping whether x or y is on top. + float t = abs(x); // t used as swap and atan result. + float opposite = abs(y); + float adjacent = max(t, opposite); + opposite = min(t, opposite); + + t = czm_fastApproximateAtan(opposite / adjacent); + + // Undo range reduction + t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t); + t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t); + t = czm_branchFreeTernary(y < 0.0, -t, t); + return t; +} +`;var Gv=`/** + * Gets the color with fog at a distance from the camera. + * + * @name czm_fog + * @glslFunction + * + * @param {float} distanceToCamera The distance to the camera in meters. + * @param {vec3} color The original color. + * @param {vec3} fogColor The color of the fog. + * + * @returns {vec3} The color adjusted for fog at the distance from the camera. + */ +vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) +{ + float scalar = distanceToCamera * czm_fogDensity; + float fog = 1.0 - exp(-(scalar * scalar)); + return mix(color, fogColor, fog); +} + +/** + * Gets the color with fog at a distance from the camera. + * + * @name czm_fog + * @glslFunction + * + * @param {float} distanceToCamera The distance to the camera in meters. + * @param {vec3} color The original color. + * @param {vec3} fogColor The color of the fog. + * @param {float} fogModifierConstant A constant to modify the appearance of fog. + * + * @returns {vec3} The color adjusted for fog at the distance from the camera. + */ +vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant) +{ + float scalar = distanceToCamera * czm_fogDensity; + float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); + return mix(color, fogColor, fog); +} +`;var Wv=`/** + * Converts a color from RGB space to linear space. + * + * @name czm_gammaCorrect + * @glslFunction + * + * @param {vec3} color The color in RGB space. + * @returns {vec3} The color in linear space. + */ +vec3 czm_gammaCorrect(vec3 color) { +#ifdef HDR + color = pow(color, vec3(czm_gamma)); +#endif + return color; +} + +vec4 czm_gammaCorrect(vec4 color) { +#ifdef HDR + color.rgb = pow(color.rgb, vec3(czm_gamma)); +#endif + return color; +} +`;var jv=`/** + * DOC_TBA + * + * @name czm_geodeticSurfaceNormal + * @glslFunction + * + * @param {vec3} positionOnEllipsoid DOC_TBA + * @param {vec3} ellipsoidCenter DOC_TBA + * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA + * + * @returns {vec3} DOC_TBA. + */ +vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) +{ + return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); +} +`;var Yv=`/** + * An czm_material with default values. Every material's czm_getMaterial + * should use this default material as a base for the material it returns. + * The default normal value is given by materialInput.normalEC. + * + * @name czm_getDefaultMaterial + * @glslFunction + * + * @param {czm_materialInput} input The input used to construct the default material. + * + * @returns {czm_material} The default material. + * + * @see czm_materialInput + * @see czm_material + * @see czm_getMaterial + */ +czm_material czm_getDefaultMaterial(czm_materialInput materialInput) +{ + czm_material material; + material.diffuse = vec3(0.0); + material.specular = 0.0; + material.shininess = 1.0; + material.normal = materialInput.normalEC; + material.emission = vec3(0.0); + material.alpha = 1.0; + return material; +} +`;var qv=`/** + * Calculates the intensity of diffusely reflected light. + * + * @name czm_getLambertDiffuse + * @glslFunction + * + * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. + * @param {vec3} normalEC The surface normal in eye coordinates. + * + * @returns {float} The intensity of the diffuse reflection. + * + * @see czm_phong + * + * @example + * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); + * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); + * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); + */ +float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) +{ + return max(dot(lightDirectionEC, normalEC), 0.0); +} +`;var Xv=`/** + * Calculates the specular intensity of reflected light. + * + * @name czm_getSpecular + * @glslFunction + * + * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. + * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates. + * @param {vec3} normalEC The surface normal in eye coordinates. + * @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. + * + * @returns {float} The intensity of the specular highlight. + * + * @see czm_phong + * + * @example + * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); + * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); + * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); + */ +float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) +{ + vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); + float specular = max(dot(toReflectedLight, toEyeEC), 0.0); + + // pow has undefined behavior if both parameters <= 0. + // Prevent this by making sure shininess is at least czm_epsilon2. + return pow(specular, max(shininess, czm_epsilon2)); +} +`;var Kv=`/** + * @private + */ +vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) +{ + float cosAngle = cos(angleInRadians); + float sinAngle = sin(angleInRadians); + + // time dependent sampling directions + vec2 s0 = vec2(1.0/17.0, 0.0); + vec2 s1 = vec2(-1.0/29.0, 0.0); + vec2 s2 = vec2(1.0/101.0, 1.0/59.0); + vec2 s3 = vec2(-1.0/109.0, -1.0/57.0); + + // rotate sampling direction by specified angle + s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y)); + s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y)); + s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y)); + s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y)); + + vec2 uv0 = (uv/103.0) + (time * s0); + vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23); + vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51); + vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71); + + uv0 = fract(uv0); + uv1 = fract(uv1); + uv2 = fract(uv2); + uv3 = fract(uv3); + vec4 noise = (texture(normalMap, uv0)) + + (texture(normalMap, uv1)) + + (texture(normalMap, uv2)) + + (texture(normalMap, uv3)); + + // average and scale to between -1 and 1 + return ((noise / 4.0) - 0.5) * 2.0; +} +`;var Jv=`/** + * Adjusts the hue of a color. + * + * @name czm_hue + * @glslFunction + * + * @param {vec3} rgb The color. + * @param {float} adjustment The amount to adjust the hue of the color in radians. + * + * @returns {float} The color with the hue adjusted. + * + * @example + * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi) + */ +vec3 czm_hue(vec3 rgb, float adjustment) +{ + const mat3 toYIQ = mat3(0.299, 0.587, 0.114, + 0.595716, -0.274453, -0.321263, + 0.211456, -0.522591, 0.311135); + const mat3 toRGB = mat3(1.0, 0.9563, 0.6210, + 1.0, -0.2721, -0.6474, + 1.0, -1.107, 1.7046); + + vec3 yiq = toYIQ * rgb; + float hue = atan(yiq.z, yiq.y) + adjustment; + float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y); + + vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); + return toRGB * color; +} +`;var Zv=`/** + * Converts a color in linear space to RGB space. + * + * @name czm_inverseGamma + * @glslFunction + * + * @param {vec3} color The color in linear space. + * @returns {vec3} The color in RGB space. + */ +vec3 czm_inverseGamma(vec3 color) { + return pow(color, vec3(1.0 / czm_gamma)); +} +`;var Qv=`/** + * Determines if a time interval is empty. + * + * @name czm_isEmpty + * @glslFunction + * + * @param {czm_raySegment} interval The interval to test. + * + * @returns {bool}trueif the time interval is empty; otherwise,false. + * + * @example + * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true + * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false + * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. + */ +bool czm_isEmpty(czm_raySegment interval) +{ + return (interval.stop < 0.0); +} +`;var $v=`/** + * Determines if a time interval is empty. + * + * @name czm_isFull + * @glslFunction + * + * @param {czm_raySegment} interval The interval to test. + * + * @returns {bool}trueif the time interval is empty; otherwise,false. + * + * @example + * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true + * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false + * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. + */ +bool czm_isFull(czm_raySegment interval) +{ + return (interval.start == 0.0 && interval.stop == czm_infinity); +} +`;var eD=`/** + * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located. + * + * @name czm_latitudeToWebMercatorFraction + * @glslFunction + * + * @param {float} latitude The geodetic latitude, in radians. + * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle. + * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates. + * + * @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern + * boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return + * value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection. + */ +float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight) +{ + float sinLatitude = sin(latitude); + float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude)); + + return (mercatorY - southMercatorY) * oneOverMercatorHeight; +} +`;var tD=`/** + * Computes distance from an point in 2D to a line in 2D. + * + * @name czm_lineDistance + * @glslFunction + * + * param {vec2} point1 A point along the line. + * param {vec2} point2 A point along the line. + * param {vec2} point A point that may or may not be on the line. + * returns {float} The distance from the point to the line. + */ +float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) { + return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1); +} +`;var nD=`/** + * Converts a linear RGB color to an sRGB color. + * + * @param {vec3|vec4} linearIn The color in linear color space. + * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input. + */ +vec3 czm_linearToSrgb(vec3 linearIn) +{ + return pow(linearIn, vec3(1.0/2.2)); +} + +vec4 czm_linearToSrgb(vec4 linearIn) +{ + vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); + return vec4(srgbOut, linearIn.a); +} +`;var iD=`/** + * Computes the luminance of a color. + * + * @name czm_luminance + * @glslFunction + * + * @param {vec3} rgb The color. + * + * @returns {float} The luminance. + * + * @example + * float light = czm_luminance(vec3(0.0)); // 0.0 + * float dark = czm_luminance(vec3(1.0)); // ~1.0 + */ +float czm_luminance(vec3 rgb) +{ + // Algorithm from Chapter 10 of Graphics Shaders. + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + return dot(rgb, W); +} +`;var oD=`/** + * Computes the size of a pixel in meters at a distance from the eye. + *+ * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel. + *
+ * @name czm_metersPerPixel + * @glslFunction + * + * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. + * @param {float} pixelRatio The scaling factor from pixel space to coordinate space + * + * @returns {float} The meters per pixel at positionEC. + */ +float czm_metersPerPixel(vec4 positionEC, float pixelRatio) +{ + float width = czm_viewport.z; + float height = czm_viewport.w; + float pixelWidth; + float pixelHeight; + + float top = czm_frustumPlanes.x; + float bottom = czm_frustumPlanes.y; + float left = czm_frustumPlanes.z; + float right = czm_frustumPlanes.w; + + if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0) + { + float frustumWidth = right - left; + float frustumHeight = top - bottom; + pixelWidth = frustumWidth / width; + pixelHeight = frustumHeight / height; + } + else + { + float distanceToPixel = -positionEC.z; + float inverseNear = 1.0 / czm_currentFrustum.x; + float tanTheta = top * inverseNear; + pixelHeight = 2.0 * distanceToPixel * tanTheta / height; + tanTheta = right * inverseNear; + pixelWidth = 2.0 * distanceToPixel * tanTheta / width; + } + + return max(pixelWidth, pixelHeight) * pixelRatio; +} + +/** + * Computes the size of a pixel in meters at a distance from the eye. + *+ * Use this version when scaling by pixel ratio. + *
+ * @name czm_metersPerPixel + * @glslFunction + * + * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. + * + * @returns {float} The meters per pixel at positionEC. + */ +float czm_metersPerPixel(vec4 positionEC) +{ + return czm_metersPerPixel(positionEC, czm_pixelRatio); +} +`;var rD=`/** + * Transforms a position from model to window coordinates. The transformation + * from model to clip coordinates is done using {@link czm_modelViewProjection}. + * The transform from normalized device coordinates to window coordinates is + * done using {@link czm_viewportTransformation}, which assumes a depth range + * ofnear = 0andfar = 1. + *
+ * This transform is useful when there is a need to manipulate window coordinates + * in a vertex shader as done by {@link BillboardCollection}. + *
+ * This function should not be confused with {@link czm_viewportOrthographic}, + * which is an orthographic projection matrix that transforms from window + * coordinates to clip coordinates. + * + * @name czm_modelToWindowCoordinates + * @glslFunction + * + * @param {vec4} position The position in model coordinates to transform. + * + * @returns {vec4} The transformed position in window coordinates. + * + * @see czm_eyeToWindowCoordinates + * @see czm_modelViewProjection + * @see czm_viewportTransformation + * @see czm_viewportOrthographic + * @see BillboardCollection + * + * @example + * vec4 positionWC = czm_modelToWindowCoordinates(positionMC); + */ +vec4 czm_modelToWindowCoordinates(vec4 position) +{ + vec4 q = czm_modelViewProjection * position; // clip coordinates + q.xyz /= q.w; // normalized device coordinates + q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates + return q; +} +`;var sD=`/** + * DOC_TBA + * + * @name czm_multiplyWithColorBalance + * @glslFunction + */ +vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) +{ + // Algorithm from Chapter 10 of Graphics Shaders. + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + + vec3 target = left * right; + float leftLuminance = dot(left, W); + float rightLuminance = dot(right, W); + float targetLuminance = dot(target, W); + + return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; +} +`;var aD=`/** + * Computes a value that scales with distance. The scaling is clamped at the near and + * far distances, and does not extrapolate. This function works with the + * {@link NearFarScalar} JavaScript class. + * + * @name czm_nearFarScalar + * @glslFunction + * + * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w). + * @param {float} cameraDistSq The square of the current distance from the camera. + * + * @returns {float} The value at this distance. + */ +float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) +{ + float valueAtMin = nearFarScalar.y; + float valueAtMax = nearFarScalar.w; + float nearDistanceSq = nearFarScalar.x * nearFarScalar.x; + float farDistanceSq = nearFarScalar.z * nearFarScalar.z; + + float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq); + + t = pow(clamp(t, 0.0, 1.0), 0.2); + + return mix(valueAtMin, valueAtMax, t); +} +`;var cD=` /** + * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {vec2} encoded The oct-encoded, unit-length vector + * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits. + * @returns {vec3} The decoded and normalized vector + */ + vec3 czm_octDecode(vec2 encoded, float range) + { + if (encoded.x == 0.0 && encoded.y == 0.0) { + return vec3(0.0, 0.0, 0.0); + } + + encoded = encoded / range * 2.0 - 1.0; + vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y)); + if (v.z < 0.0) + { + v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy); + } + + return normalize(v); + } + +/** + * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {vec2} encoded The oct-encoded, unit-length vector + * @returns {vec3} The decoded and normalized vector + */ + vec3 czm_octDecode(vec2 encoded) + { + return czm_octDecode(encoded, 255.0); + } + + /** + * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {float} encoded The oct-encoded, unit-length vector + * @returns {vec3} The decoded and normalized vector + */ + vec3 czm_octDecode(float encoded) + { + float temp = encoded / 256.0; + float x = floor(temp); + float y = (temp - x) * 256.0; + return czm_octDecode(vec2(x, y)); + } + +/** + * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors. + * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", + * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ + * + * @name czm_octDecode + * @param {vec2} encoded The packed oct-encoded, unit-length vectors. + * @param {vec3} vector1 One decoded and normalized vector. + * @param {vec3} vector2 One decoded and normalized vector. + * @param {vec3} vector3 One decoded and normalized vector. + */ + void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3) + { + float temp = encoded.x / 65536.0; + float x = floor(temp); + float encodedFloat1 = (temp - x) * 65536.0; + + temp = encoded.y / 65536.0; + float y = floor(temp); + float encodedFloat2 = (temp - y) * 65536.0; + + vector1 = czm_octDecode(encodedFloat1); + vector2 = czm_octDecode(encodedFloat2); + vector3 = czm_octDecode(vec2(x, y)); + } + +`;var lD=`/** + * Packs a depth value into a vec3 that can be represented by unsigned bytes. + * + * @name czm_packDepth + * @glslFunction + * + * @param {float} depth The floating-point depth. + * @returns {vec3} The packed depth. + */ +vec4 czm_packDepth(float depth) +{ + // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA + // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ + vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth; + enc = fract(enc); + enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); + return enc; +} +`;var uD=`vec3 lambertianDiffuse(vec3 diffuseColor) +{ + return diffuseColor / czm_pi; +} + +vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) +{ + return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0); +} + +float smithVisibilityG1(float NdotV, float roughness) +{ + // this is the k value for direct lighting. + // for image based lighting it will be roughness^2 / 2 + float k = (roughness + 1.0) * (roughness + 1.0) / 8.0; + return NdotV / (NdotV * (1.0 - k) + k); +} + +float smithVisibilityGGX(float roughness, float NdotL, float NdotV) +{ + return ( + smithVisibilityG1(NdotL, roughness) * + smithVisibilityG1(NdotV, roughness) + ); +} + +float GGX(float roughness, float NdotH) +{ + float roughnessSquared = roughness * roughness; + float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0; + return roughnessSquared / (czm_pi * f * f); +} + +/** + * Compute the diffuse and specular contributions using physically based + * rendering. This function only handles direct lighting. + *+ * This function only handles the lighting calculations. Metallic/roughness + * and specular/glossy must be handled separately. See {@czm_pbrMetallicRoughnessMaterial}, {@czm_pbrSpecularGlossinessMaterial} and {@czm_defaultPbrMaterial} + *
+ * + * @name czm_pbrlighting + * @glslFunction + * + * @param {vec3} positionEC The position of the fragment in eye coordinates + * @param {vec3} normalEC The surface normal in eye coordinates + * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. + * @param {vec3} lightColorHdr radiance of the light source. This is a HDR value. + * @param {czm_pbrParameters} The computed PBR parameters. + * @return {vec3} The computed HDR color + * + * @example + * czm_pbrParameters pbrParameters = czm_pbrMetallicRoughnessMaterial( + * baseColor, + * metallic, + * roughness + * ); + * vec3 color = czm_pbrlighting( + * positionEC, + * normalEC, + * lightDirectionEC, + * lightColorHdr, + * pbrParameters); + */ +vec3 czm_pbrLighting( + vec3 positionEC, + vec3 normalEC, + vec3 lightDirectionEC, + vec3 lightColorHdr, + czm_pbrParameters pbrParameters +) +{ + vec3 v = -normalize(positionEC); + vec3 l = normalize(lightDirectionEC); + vec3 h = normalize(v + l); + vec3 n = normalEC; + float NdotL = clamp(dot(n, l), 0.001, 1.0); + float NdotV = abs(dot(n, v)) + 0.001; + float NdotH = clamp(dot(n, h), 0.0, 1.0); + float LdotH = clamp(dot(l, h), 0.0, 1.0); + float VdotH = clamp(dot(v, h), 0.0, 1.0); + + vec3 f0 = pbrParameters.f0; + float reflectance = max(max(f0.r, f0.g), f0.b); + vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); + vec3 F = fresnelSchlick2(f0, f90, VdotH); + + float alpha = pbrParameters.roughness; + float G = smithVisibilityGGX(alpha, NdotL, NdotV); + float D = GGX(alpha, NdotH); + vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV); + + vec3 diffuseColor = pbrParameters.diffuseColor; + // F here represents the specular contribution + vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); + + // Lo = (diffuse + specular) * Li * NdotL + return (diffuseContribution + specularContribution) * NdotL * lightColorHdr; +} +`;var fD=`/** + * Compute parameters for physically based rendering using the + * metallic/roughness workflow. All inputs are linear; sRGB texture values must + * be decoded beforehand + * + * @name czm_pbrMetallicRoughnessMaterial + * @glslFunction + * + * @param {vec3} baseColor For dielectrics, this is the base color. For metals, this is the f0 value (reflectance at normal incidence) + * @param {float} metallic 0.0 indicates dielectric. 1.0 indicates metal. Values in between are allowed (e.g. to model rust or dirt); + * @param {float} roughness A value between 0.0 and 1.0 + * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + */ +czm_pbrParameters czm_pbrMetallicRoughnessMaterial( + vec3 baseColor, + float metallic, + float roughness +) +{ + czm_pbrParameters results; + + // roughness is authored as perceptual roughness + // square it to get material roughness + roughness = clamp(roughness, 0.0, 1.0); + results.roughness = roughness * roughness; + + // dielectrics use f0 = 0.04, metals use albedo as f0 + metallic = clamp(metallic, 0.0, 1.0); + const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); + vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic); + results.f0 = f0; + + // diffuse only applies to dielectrics. + results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic); + + return results; +} +`;var dD=`/** + * Compute parameters for physically based rendering using the + * specular/glossy workflow. All inputs are linear; sRGB texture values must + * be decoded beforehand + * + * @name czm_pbrSpecularGlossinessMaterial + * @glslFunction + * + * @param {vec3} diffuse The diffuse color for dielectrics (non-metals) + * @param {vec3} specular The reflectance at normal incidence (f0) + * @param {float} glossiness A number from 0.0 to 1.0 indicating how smooth the surface is. + * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} + */ +czm_pbrParameters czm_pbrSpecularGlossinessMaterial( + vec3 diffuse, + vec3 specular, + float glossiness +) +{ + czm_pbrParameters results; + + // glossiness is the opposite of roughness, but easier for artists to use. + float roughness = 1.0 - glossiness; + results.roughness = roughness * roughness; + + results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b)); + results.f0 = specular; + + return results; +} +`;var mD=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) +{ + return czm_getLambertDiffuse(lightDirectionEC, material.normal); +} + +float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material) +{ + return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess); +} + +/** + * Computes a color using the Phong lighting model. + * + * @name czm_phong + * @glslFunction + * + * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates. + * @param {czm_material} material The fragment's material. + * + * @returns {vec4} The computed color. + * + * @example + * vec3 positionToEyeEC = // ... + * czm_material material = // ... + * vec3 lightDirectionEC = // ... + * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC); + * + * @see czm_getMaterial + */ +vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +{ + // Diffuse from directional light sources at eye (for top-down) + float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material); + if (czm_sceneMode == czm_sceneMode3D) { + // (and horizon views in 3D) + diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material); + } + + float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); + + // Temporary workaround for adding ambient. + vec3 materialDiffuse = material.diffuse * 0.5; + + vec3 ambient = materialDiffuse; + vec3 color = ambient + material.emission; + color += materialDiffuse * diffuse * czm_lightColor; + color += material.specular * specular * czm_lightColor; + + return vec4(color, material.alpha); +} + +vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +{ + float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material); + float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); + + vec3 ambient = vec3(0.0); + vec3 color = ambient + material.emission; + color += material.diffuse * diffuse * czm_lightColor; + color += material.specular * specular * czm_lightColor; + + return vec4(color, material.alpha); +} +`;var hD=`/** + * Computes distance from a point to a plane. + * + * @name czm_planeDistance + * @glslFunction + * + * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js + * param {vec3} point A point in the same space as the plane. + * returns {float} The distance from the point to the plane. + */ +float czm_planeDistance(vec4 plane, vec3 point) { + return (dot(plane.xyz, point) + plane.w); +} + +/** + * Computes distance from a point to a plane. + * + * @name czm_planeDistance + * @glslFunction + * + * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js + * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js + * param {vec3} point A point in the same space as the plane. + * returns {float} The distance from the point to the plane. + */ +float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { + return (dot(planeNormal, point) + planeDistance); +} +`;var pD=`/** + * Computes the point along a ray at the given time.timecan be positive, negative, or zero. + * + * @name czm_pointAlongRay + * @glslFunction + * + * @param {czm_ray} ray The ray to compute the point along. + * @param {float} time The time along the ray. + * + * @returns {vec3} The point along the ray at the given time. + * + * @example + * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction + * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0) + */ +vec3 czm_pointAlongRay(czm_ray ray, float time) +{ + return ray.origin + (time * ray.direction); +} +`;var _D=`/** + * DOC_TBA + * + * @name czm_rayEllipsoidIntersectionInterval + * @glslFunction + */ +czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) +{ + // ray and ellipsoid center in eye coordinates. radii in model coordinates. + vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; + vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; + + q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz; + + float q2 = dot(q, q); + float qw = dot(q, w); + + if (q2 > 1.0) // Outside ellipsoid. + { + if (qw >= 0.0) // Looking outward or tangent (0 intersections). + { + return czm_emptyRaySegment; + } + else // qw < 0.0. + { + float qw2 = qw * qw; + float difference = q2 - 1.0; // Positively valued. + float w2 = dot(w, w); + float product = w2 * difference; + + if (qw2 < product) // Imaginary roots (0 intersections). + { + return czm_emptyRaySegment; + } + else if (qw2 > product) // Distinct roots (2 intersections). + { + float discriminant = qw * qw - product; + float temp = -qw + sqrt(discriminant); // Avoid cancellation. + float root0 = temp / w2; + float root1 = difference / temp; + if (root0 < root1) + { + czm_raySegment i = czm_raySegment(root0, root1); + return i; + } + else + { + czm_raySegment i = czm_raySegment(root1, root0); + return i; + } + } + else // qw2 == product. Repeated roots (2 intersections). + { + float root = sqrt(difference / w2); + czm_raySegment i = czm_raySegment(root, root); + return i; + } + } + } + else if (q2 < 1.0) // Inside ellipsoid (2 intersections). + { + float difference = q2 - 1.0; // Negatively valued. + float w2 = dot(w, w); + float product = w2 * difference; // Negatively valued. + float discriminant = qw * qw - product; + float temp = -qw + sqrt(discriminant); // Positively valued. + czm_raySegment i = czm_raySegment(0.0, temp / w2); + return i; + } + else // q2 == 1.0. On ellipsoid. + { + if (qw < 0.0) // Looking inward. + { + float w2 = dot(w, w); + czm_raySegment i = czm_raySegment(0.0, -qw / w2); + return i; + } + else // qw >= 0.0. Looking outward or tangent. + { + return czm_emptyRaySegment; + } + } +} +`;var gD=`/** + * Compute the intersection interval of a ray with a sphere. + * + * @name czm_raySphereIntersectionInterval + * @glslFunction + * + * @param {czm_ray} ray The ray. + * @param {vec3} center The center of the sphere. + * @param {float} radius The radius of the sphere. + * @return {czm_raySegment} The intersection interval of the ray with the sphere. + */ +czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) +{ + vec3 o = ray.origin; + vec3 d = ray.direction; + + vec3 oc = o - center; + + float a = dot(d, d); + float b = 2.0 * dot(d, oc); + float c = dot(oc, oc) - (radius * radius); + + float det = (b * b) - (4.0 * a * c); + + if (det < 0.0) { + return czm_emptyRaySegment; + } + + float sqrtDet = sqrt(det); + + float t0 = (-b - sqrtDet) / (2.0 * a); + float t1 = (-b + sqrtDet) / (2.0 * a); + + czm_raySegment result = czm_raySegment(t0, t1); + return result; +} +`;var yD=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) +{ + return czm_reverseLogDepth(texture(depthTexture, texCoords).r); +} +`;var AD=`/** + * Reads a value previously transformed with {@link czm_writeNonPerspective} + * by dividing it by \`w\`, the value used in the perspective divide. + * This function is intended to be called in a fragment shader to access a + * \`varying\` that should not be subject to perspective interpolation. + * For example, screen-space texture coordinates. The value should have been + * previously written in the vertex shader with a call to + * {@link czm_writeNonPerspective}. + * + * @name czm_readNonPerspective + * @glslFunction + * + * @param {float|vec2|vec3|vec4} value The non-perspective value to be read. + * @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`. + * @returns {float|vec2|vec3|vec4} The usable value. + */ +float czm_readNonPerspective(float value, float oneOverW) { + return value * oneOverW; +} + +vec2 czm_readNonPerspective(vec2 value, float oneOverW) { + return value * oneOverW; +} + +vec3 czm_readNonPerspective(vec3 value, float oneOverW) { + return value * oneOverW; +} + +vec4 czm_readNonPerspective(vec4 value, float oneOverW) { + return value * oneOverW; +} +`;var xD=`float czm_reverseLogDepth(float logZ) +{ +#ifdef LOG_DEPTH + float near = czm_currentFrustum.x; + float far = czm_currentFrustum.y; + float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne; + float depthFromNear = pow(2.0, log2Depth) - 1.0; + return far * (1.0 - near / (depthFromNear + near)) / (far - near); +#endif + return logZ; +} +`;var CD=`/** + * Round a floating point value. This function exists because round() doesn't + * exist in GLSL 1.00. + * + * @param {float|vec2|vec3|vec4} value The value to round + * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input. + */ +float czm_round(float value) { + return floor(value + 0.5); +} + +vec2 czm_round(vec2 value) { + return floor(value + 0.5); +} + +vec3 czm_round(vec3 value) { + return floor(value + 0.5); +} + +vec4 czm_round(vec4 value) { + return floor(value + 0.5); +} +`;var TD=`/** + * Samples the 4 neighboring pixels and return the weighted average. + * + * @private + */ +vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod) +{ + direction /= dot(vec3(1.0), abs(direction)); + vec2 rev = abs(direction.zx) - vec2(1.0); + vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x, + direction.z < 0.0 ? rev.y : -rev.y); + vec2 uv = direction.y < 0.0 ? neg : direction.xz; + vec2 coord = 0.5 * uv + vec2(0.5); + vec2 pixel = 1.0 / textureSize; + + if (lod > 0.0) + { + // Each subseqeuent mip level is half the size + float scale = 1.0 / pow(2.0, lod); + float offset = ((textureSize.y + 1.0) / textureSize.x); + + coord.x *= offset; + coord *= scale; + + coord.x += offset + pixel.x; + coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0; + } + else + { + coord.x *= (textureSize.y / textureSize.x); + } + + // Do bilinear filtering + #ifndef OES_texture_float_linear + vec3 color1 = texture(projectedMap, coord + vec2(0.0, pixel.y)).rgb; + vec3 color2 = texture(projectedMap, coord + vec2(pixel.x, 0.0)).rgb; + vec3 color3 = texture(projectedMap, coord + pixel).rgb; + vec3 color4 = texture(projectedMap, coord).rgb; + + vec2 texturePosition = coord * textureSize; + + float fu = fract(texturePosition.x); + float fv = fract(texturePosition.y); + + vec3 average1 = mix(color4, color2, fu); + vec3 average2 = mix(color1, color3, fu); + + vec3 color = mix(average1, average2, fv); + #else + vec3 color = texture(projectedMap, coord).rgb; + #endif + + return color; +} + + +/** + * Samples from a cube map that has been projected using an octahedral projection from the given direction. + * + * @name czm_sampleOctahedralProjection + * @glslFunction + * + * @param {sampler2D} projectedMap The texture with the octahedral projected cube map. + * @param {vec2} textureSize The width and height dimensions in pixels of the projected map. + * @param {vec3} direction The normalized direction used to sample the cube map. + * @param {float} lod The level of detail to sample. + * @param {float} maxLod The maximum level of detail. + * @returns {vec3} The color of the cube map at the direction. + */ +vec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) { + float currentLod = floor(lod + 0.5); + float nextLod = min(currentLod + 1.0, maxLod); + + vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod); + vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod); + + return mix(colorNextLod, colorCurrentLod, nextLod - lod); +} +`;var ED=`/** + * Adjusts the saturation of a color. + * + * @name czm_saturation + * @glslFunction + * + * @param {vec3} rgb The color. + * @param {float} adjustment The amount to adjust the saturation of the color. + * + * @returns {float} The color with the saturation adjusted. + * + * @example + * vec3 greyScale = czm_saturation(color, 0.0); + * vec3 doubleSaturation = czm_saturation(color, 2.0); + */ +vec3 czm_saturation(vec3 rgb, float adjustment) +{ + // Algorithm from Chapter 16 of OpenGL Shading Language + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + vec3 intensity = vec3(dot(rgb, W)); + return mix(intensity, rgb, adjustment); +} +`;var bD=` +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 SD=` +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 wD=`/** + * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL + * built-in functionsignexcept that returns 1.0 instead of 0.0 when the input value is 0.0. + * + * @name czm_signNotZero + * @glslFunction + * + * @param {} value The value for which to determine the sign. + * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative. + */ +float czm_signNotZero(float value) +{ + return value >= 0.0 ? 1.0 : -1.0; +} + +vec2 czm_signNotZero(vec2 value) +{ + return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y)); +} + +vec3 czm_signNotZero(vec3 value) +{ + return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z)); +} + +vec4 czm_signNotZero(vec4 value) +{ + return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); +} +`;var vD=`/** + * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector. + *+ * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22]. + *
+ * + * @name czm_sphericalHarmonics + * @glslFunction + * + * @param {vec3} normal The normalized direction. + * @param {vec3[9]} coefficients The third order spherical harmonic coefficients. + * @returns {vec3} The color at the direction. + * + * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf + */ +vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) +{ + vec3 L00 = coefficients[0]; + vec3 L1_1 = coefficients[1]; + vec3 L10 = coefficients[2]; + vec3 L11 = coefficients[3]; + vec3 L2_2 = coefficients[4]; + vec3 L2_1 = coefficients[5]; + vec3 L20 = coefficients[6]; + vec3 L21 = coefficients[7]; + vec3 L22 = coefficients[8]; + + float x = normal.x; + float y = normal.y; + float z = normal.z; + + return + L00 + + L1_1 * y + + L10 * z + + L11 * x + + L2_2 * (y * x) + + L2_1 * (y * z) + + L20 * (3.0 * z * z - 1.0) + + L21 * (z * x) + + L22 * (x * x - y * y); +} +`;var DD=`/** + * Converts an sRGB color to a linear RGB color. + * + * @param {vec3|vec4} srgbIn The color in sRGB space + * @returns {vec3|vec4} The color in linear color space. The vector type matches the input. + */ +vec3 czm_srgbToLinear(vec3 srgbIn) +{ + return pow(srgbIn, vec3(2.2)); +} + +vec4 czm_srgbToLinear(vec4 srgbIn) +{ + vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); + return vec4(linearOut, srgbIn.a); +} +`;var ID=`/** + * Creates a matrix that transforms vectors from tangent space to eye space. + * + * @name czm_tangentToEyeSpaceMatrix + * @glslFunction + * + * @param {vec3} normalEC The normal vector in eye coordinates. + * @param {vec3} tangentEC The tangent vector in eye coordinates. + * @param {vec3} bitangentEC The bitangent vector in eye coordinates. + * + * @returns {mat3} The matrix that transforms from tangent space to eye space. + * + * @example + * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC); + * vec3 normal = tangentToEye * texture(normalMap, st).xyz; + */ +mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) +{ + vec3 normal = normalize(normalEC); + vec3 tangent = normalize(tangentEC); + vec3 bitangent = normalize(bitangentEC); + return mat3(tangent.x , tangent.y , tangent.z, + bitangent.x, bitangent.y, bitangent.z, + normal.x , normal.y , normal.z); +} +`;var PD=`/** + * A wrapper around the texture (WebGL2) / textureCube (WebGL1) + * function to allow for WebGL 1 support. + * + * @name czm_textureCube + * @glslFunction + * + * @param {samplerCube} sampler The sampler. + * @param {vec3} p The coordinates to sample the texture at. + */ +vec4 czm_textureCube(samplerCube sampler, vec3 p) { +#if __VERSION__ == 300 + return texture(sampler, p); +#else + return textureCube(sampler, p); +#endif +}`;var OD=`/** + * Transforms a plane. + * + * @name czm_transformPlane + * @glslFunction + * + * @param {vec4} plane The plane in Hessian Normal Form. + * @param {mat4} transform The inverse-transpose of a transformation matrix. + */ +vec4 czm_transformPlane(vec4 plane, mat4 transform) { + vec4 transformedPlane = transform * plane; + // Convert the transformed plane to Hessian Normal Form + float normalMagnitude = length(transformedPlane.xyz); + return transformedPlane / normalMagnitude; +} +`;var MD=`/** + * Translates a position (or anyvec3) that was encoded with {@link EncodedCartesian3}, + * and then provided to the shader as separatehighandlowbits to + * be relative to the eye. As shown in the example, the position can then be transformed in eye + * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye}, + * respectively. + *+ * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as + * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. + *
+ * + * @name czm_translateRelativeToEye + * @glslFunction + * + * @param {vec3} high The position's high bits. + * @param {vec3} low The position's low bits. + * @returns {vec3} The position translated to be relative to the camera's position. + * + * @example + * in vec3 positionHigh; + * in vec3 positionLow; + * + * void main() + * { + * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + * gl_Position = czm_modelViewProjectionRelativeToEye * p; + * } + * + * @see czm_modelViewRelativeToEye + * @see czm_modelViewProjectionRelativeToEye + * @see czm_computePosition + * @see EncodedCartesian3 + */ +vec4 czm_translateRelativeToEye(vec3 high, vec3 low) +{ + vec3 highDifference = high - czm_encodedCameraPositionMCHigh; + vec3 lowDifference = low - czm_encodedCameraPositionMCLow; + + return vec4(highDifference + lowDifference, 1.0); +} +`;var RD=`/** + * @private + */ +vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +{ + // Diffuse from directional light sources at eye (for top-down and horizon views) + float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); + + if (czm_sceneMode == czm_sceneMode3D) { + // (and horizon views in 3D) + diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal); + } + + diffuse = clamp(diffuse, 0.0, 1.0); + + float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess); + + // Temporary workaround for adding ambient. + vec3 materialDiffuse = material.diffuse * 0.5; + + vec3 ambient = materialDiffuse; + vec3 color = ambient + material.emission; + color += materialDiffuse * diffuse * czm_lightColor; + color += material.specular * specular * czm_lightColor; + + return vec4(color, material.alpha); +} +`;var BD=`/** + * Returns the transpose of the matrix. The inputmatrixcan be + * amat2,mat3, ormat4. + * + * @name czm_transpose + * @glslFunction + * + * @param {} matrix The matrix to transpose. + * + * @returns {} The transposed matrix. + * + * @example + * // GLSL declarations + * mat2 czm_transpose(mat2 matrix); + * mat3 czm_transpose(mat3 matrix); + * mat4 czm_transpose(mat4 matrix); + * + * // Transpose a 3x3 rotation matrix to find its inverse. + * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates( + * positionMC, normalEC); + * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye); + */ +mat2 czm_transpose(mat2 matrix) +{ + return mat2( + matrix[0][0], matrix[1][0], + matrix[0][1], matrix[1][1]); +} + +mat3 czm_transpose(mat3 matrix) +{ + return mat3( + matrix[0][0], matrix[1][0], matrix[2][0], + matrix[0][1], matrix[1][1], matrix[2][1], + matrix[0][2], matrix[1][2], matrix[2][2]); +} + +mat4 czm_transpose(mat4 matrix) +{ + return mat4( + matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0], + matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1], + matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2], + matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]); +} +`;var LD=`/** + * Unpacks a vec4 depth value to a float in [0, 1) range. + * + * @name czm_unpackDepth + * @glslFunction + * + * @param {vec4} packedDepth The packed depth. + * + * @returns {float} The floating-point depth in [0, 1) range. + */ + float czm_unpackDepth(vec4 packedDepth) + { + // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA + // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ + return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); + } +`;var ND=`/** + * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4. + * + * @name czm_unpackFloat + * @glslFunction + * + * @param {vec4} packedFloat The packed float. + * + * @returns {float} The floating-point depth in arbitrary range. + */ +float czm_unpackFloat(vec4 packedFloat) +{ + // Convert to [0.0, 255.0] and round to integer + packedFloat = floor(packedFloat * 255.0 + 0.5); + float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0; + float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0; + if (exponent == -127.0) + { + return 0.0; + } + float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000); + float result = sign * exp2(exponent - 23.0) * mantissa; + return result; +} +`;var FD=`/** + * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type, + * so the return value is an int. + *+ * There are also precision limitations in WebGL 1. highp int is still limited + * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur. + *
+ * + * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order. + * + * @return {int} The unpacked value. + */ + int czm_unpackUint(float packedValue) { + float rounded = czm_round(packedValue * 255.0); + return int(rounded); + } + + int czm_unpackUint(vec2 packedValue) { + vec2 rounded = czm_round(packedValue * 255.0); + return int(dot(rounded, vec2(1.0, 256.0))); + } + + int czm_unpackUint(vec3 packedValue) { + vec3 rounded = czm_round(packedValue * 255.0); + return int(dot(rounded, vec3(1.0, 256.0, 65536.0))); + } + + int czm_unpackUint(vec4 packedValue) { + vec4 rounded = czm_round(packedValue * 255.0); + return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0))); + } +`;var UD=`/** + * Transform metadata values following the EXT_structural_metadata spec + * by multiplying by scale and adding the offset. Operations are always + * performed component-wise, even for matrices. + * + * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add + * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply + * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value. + * + * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input. + */ +float czm_valueTransform(float offset, float scale, float value) { + return scale * value + offset; +} + +vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) { + return scale * value + offset; +} + +vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) { + return scale * value + offset; +} + +vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) { + return scale * value + offset; +} + +mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) { + return matrixCompMult(scale, value) + offset; +} + +mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { + return matrixCompMult(scale, value) + offset; +} + +mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { + return matrixCompMult(scale, value) + offset; +} +`;var VD=`#ifdef LOG_DEPTH +// 1.0 at the near plane, increasing linearly from there. +out float v_depthFromNearPlusOne; +#ifdef SHADOW_MAP +out vec3 v_logPositionEC; +#endif +#endif + +vec4 czm_updatePositionDepth(vec4 coords) { +#if defined(LOG_DEPTH) + +#ifdef SHADOW_MAP + vec3 logPositionEC = (czm_inverseProjection * coords).xyz; + v_logPositionEC = logPositionEC; +#endif + + // With the very high far/near ratios used with the logarithmic depth + // buffer, floating point rounding errors can cause linear depth values + // to end up on the wrong side of the far plane, even for vertices that + // are really nowhere near it. Since we always write a correct logarithmic + // depth value in the fragment shader anyway, we just need to make sure + // such errors don't cause the primitive to be clipped entirely before + // we even get to the fragment shader. + coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w; +#endif + + return coords; +} + +/** + * Writes the logarithmic depth to gl_Position using the already computed gl_Position. + * + * @name czm_vertexLogDepth + * @glslFunction + */ +void czm_vertexLogDepth() +{ +#ifdef LOG_DEPTH + v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0; + gl_Position = czm_updatePositionDepth(gl_Position); +#endif +} + +/** + * Writes the logarithmic depth to gl_Position using the provided clip coordinates. + *+ * An example use case for this function would be moving the vertex in window coordinates + * before converting back to clip coordinates. Use the original vertex clip coordinates. + *
+ * @name czm_vertexLogDepth + * @glslFunction + * + * @param {vec4} clipCoords The vertex in clip coordinates. + * + * @example + * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0)); + */ +void czm_vertexLogDepth(vec4 clipCoords) +{ +#ifdef LOG_DEPTH + v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; + czm_updatePositionDepth(clipCoords); +#endif +} +`;var kD=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +{ + // Reconstruct NDC coordinates + float x = 2.0 * screenCoordinate.x - 1.0; + float y = 2.0 * screenCoordinate.y - 1.0; + float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; + vec4 q = vec4(x, y, z, 1.0); + + // Reverse the perspective division to obtain clip coordinates. + q /= screenCoordinate.w; + + // Reverse the projection transformation to obtain eye coordinates. + if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s + { + q = czm_inverseProjection * q; + } + else + { + float top = czm_frustumPlanes.x; + float bottom = czm_frustumPlanes.y; + float left = czm_frustumPlanes.z; + float right = czm_frustumPlanes.w; + + float near = czm_currentFrustum.x; + float far = czm_currentFrustum.y; + + q.x = (q.x * (right - left) + left + right) * 0.5; + q.y = (q.y * (top - bottom) + bottom + top) * 0.5; + q.z = (q.z * (near - far) - near - far) * 0.5; + q.w = 1.0; + } + + return q; +} + +/** + * Transforms a position from window to eye coordinates. + * The transform from window to normalized device coordinates is done using components + * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating + * the inverse ofczm_viewportTransformation. The transformation from + * normalized device coordinates to clip coordinates is done usingfragmentCoordinate.w, + * which is expected to be the scalar used in the perspective divide. The transformation + * from clip to eye coordinates is done using {@link czm_inverseProjection}. + * + * @name czm_windowToEyeCoordinates + * @glslFunction + * + * @param {vec4} fragmentCoordinate The position in window coordinates to transform. + * + * @returns {vec4} The transformed position in eye coordinates. + * + * @see czm_modelToWindowCoordinates + * @see czm_eyeToWindowCoordinates + * @see czm_inverseProjection + * @see czm_viewport + * @see czm_viewportTransformation + * + * @example + * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord); + */ +vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate) +{ + vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw; + return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw)); +} + +vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth) +{ + // See reverseLogDepth.glsl. This is separate to re-use the pow. +#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY) + float near = czm_currentFrustum.x; + float far = czm_currentFrustum.y; + float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne; + float depthFromNear = pow(2.0, log2Depth) - 1.0; + float depthFromCamera = depthFromNear + near; + vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0); + vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); + eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision + return eyeCoordinate; +#else + vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); + vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); +#endif + return eyeCoordinate; +} + +/** + * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates. + * This function produces more accurate results for window positions with log depth than + * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version + * of czm_windowToEyeCoordinates. + * + * @name czm_windowToEyeCoordinates + * @glslFunction + * + * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform. + * @param {float} depthOrLogDepth A depth or log depth for the fragment. + * + * @see czm_modelToWindowCoordinates + * @see czm_eyeToWindowCoordinates + * @see czm_inverseProjection + * @see czm_viewport + * @see czm_viewportTransformation + * + * @returns {vec4} The transformed position in eye coordinates. + */ +vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) +{ + vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; + return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); +} +`;var zD=`// emulated noperspective +#if !defined(LOG_DEPTH) +in float v_WindowZ; +#endif + +/** + * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane + * by writing the fragment's depth. See czm_depthClamp for more details. + * + * @name czm_writeDepthClamp + * @glslFunction + * + * @example + * out_FragColor = color; + * czm_writeDepthClamp(); + * + * @see czm_depthClamp + */ +void czm_writeDepthClamp() +{ +#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) + gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); +#endif +} +`;var HD=`#ifdef LOG_DEPTH +in float v_depthFromNearPlusOne; + +#ifdef POLYGON_OFFSET +uniform vec2 u_polygonOffset; +#ifdef GL_OES_standard_derivatives +#extension GL_OES_standard_derivatives : enable +#endif +#endif + +#endif + +/** + * Writes the fragment depth to the logarithmic depth buffer. + *+ * Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when + * ray-casting geometry using a full screen quad. + *
+ * @name czm_writeLogDepth + * @glslFunction + * + * @param {float} depth The depth coordinate, where 1.0 is on the near plane and + * depth increases in eye-space units from there + * + * @example + * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0); + */ +void czm_writeLogDepth(float depth) +{ +#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) + // Discard the vertex if it's not between the near and far planes. + // We allow a bit of epsilon on the near plane comparison because a 1.0 + // from the vertex shader (indicating the vertex should be _on_ the near + // plane) will not necessarily come here as exactly 1.0. + if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { + discard; + } + +#ifdef POLYGON_OFFSET + // Polygon offset: m * factor + r * units + float factor = u_polygonOffset[0]; + float units = u_polygonOffset[1]; + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + // This factor doesn't work in IE 10 + if (factor != 0.0) { + // m = sqrt(dZdX^2 + dZdY^2); + float x = dFdx(depth); + float y = dFdy(depth); + float m = sqrt(x * x + y * y); + + // Apply the factor before computing the log depth. + depth += m * factor; + } +#endif + +#endif + + gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne; + +#ifdef POLYGON_OFFSET + // Apply the units after the log depth. + gl_FragDepth += czm_epsilon7 * units; +#endif + +#endif +} + +/** + * Writes the fragment depth to the logarithmic depth buffer. + *+ * Use this when the vertex shader calls {@link czm_vertexlogDepth}. + *
+ * + * @name czm_writeLogDepth + * @glslFunction + */ +void czm_writeLogDepth() { +#ifdef LOG_DEPTH + czm_writeLogDepth(v_depthFromNearPlusOne); +#endif +} +`;var GD=`/** + * Transforms a value for non-perspective interpolation by multiplying + * it by w, the value used in the perspective divide. This function is + * intended to be called in a vertex shader to compute the value of a + * \`varying\` that should not be subject to perspective interpolation. + * For example, screen-space texture coordinates. The fragment shader + * must call {@link czm_readNonPerspective} to retrieve the final + * non-perspective value. + * + * @name czm_writeNonPerspective + * @glslFunction + * + * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective. + * @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`. + * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the + * fragment shader with {@link czm_readNonPerspective}. + */ +float czm_writeNonPerspective(float value, float w) { + return value * w; +} + +vec2 czm_writeNonPerspective(vec2 value, float w) { + return value * w; +} + +vec3 czm_writeNonPerspective(vec3 value, float w) { + return value * w; +} + +vec4 czm_writeNonPerspective(vec4 value, float w) { + return value * w; +} +`;var M0={czm_degreesPerRadian:Cw,czm_depthRange:Tw,czm_epsilon1:Ew,czm_epsilon2:bw,czm_epsilon3:Sw,czm_epsilon4:ww,czm_epsilon5:vw,czm_epsilon6:Dw,czm_epsilon7:Iw,czm_infinity:Pw,czm_oneOverPi:Ow,czm_oneOverTwoPi:Mw,czm_passCesium3DTile:Rw,czm_passCesium3DTileClassification:Bw,czm_passCesium3DTileClassificationIgnoreShow:Lw,czm_passClassification:Nw,czm_passCompute:Fw,czm_passEnvironment:Uw,czm_passGlobe:Vw,czm_passOpaque:kw,czm_passOverlay:zw,czm_passTerrainClassification:Hw,czm_passTranslucent:Gw,czm_passVoxels:Ww,czm_pi:jw,czm_piOverFour:Yw,czm_piOverSix:qw,czm_piOverThree:Xw,czm_piOverTwo:Kw,czm_radiansPerDegree:Jw,czm_sceneMode2D:Zw,czm_sceneMode3D:Qw,czm_sceneModeColumbusView:$w,czm_sceneModeMorphing:ev,czm_solarRadius:tv,czm_threePiOver2:nv,czm_twoPi:iv,czm_webMercatorMaxLatitude:ov,czm_depthRangeStruct:rv,czm_material:sv,czm_materialInput:av,czm_modelMaterial:cv,czm_modelVertexOutput:lv,czm_pbrParameters:uv,czm_ray:fv,czm_raySegment:dv,czm_shadowParameters:mv,czm_HSBToRGB:hv,czm_HSLToRGB:pv,czm_RGBToHSB:_v,czm_RGBToHSL:gv,czm_RGBToXYZ:yv,czm_XYZToRGB:Av,czm_acesTonemapping:xv,czm_alphaWeight:Cv,czm_antialias:Tv,czm_approximateSphericalCoordinates:Ev,czm_backFacing:bv,czm_branchFreeTernary:Sv,czm_cascadeColor:wv,czm_cascadeDistance:vv,czm_cascadeMatrix:Dv,czm_cascadeWeights:Iv,czm_columbusViewMorph:Pv,czm_computePosition:Ov,czm_cosineAndSine:Mv,czm_decompressTextureCoordinates:Rv,czm_defaultPbrMaterial:Bv,czm_depthClamp:Lv,czm_eastNorthUpToEyeCoordinates:Nv,czm_ellipsoidContainsPoint:Fv,czm_ellipsoidWgs84TextureCoordinates:Uv,czm_equalsEpsilon:Vv,czm_eyeOffset:kv,czm_eyeToWindowCoordinates:zv,czm_fastApproximateAtan:Hv,czm_fog:Gv,czm_gammaCorrect:Wv,czm_geodeticSurfaceNormal:jv,czm_getDefaultMaterial:Yv,czm_getLambertDiffuse:qv,czm_getSpecular:Xv,czm_getWaterNoise:Kv,czm_hue:Jv,czm_inverseGamma:Zv,czm_isEmpty:Qv,czm_isFull:$v,czm_latitudeToWebMercatorFraction:eD,czm_lineDistance:tD,czm_linearToSrgb:nD,czm_luminance:iD,czm_metersPerPixel:oD,czm_modelToWindowCoordinates:rD,czm_multiplyWithColorBalance:sD,czm_nearFarScalar:aD,czm_octDecode:cD,czm_packDepth:lD,czm_pbrLighting:uD,czm_pbrMetallicRoughnessMaterial:fD,czm_pbrSpecularGlossinessMaterial:dD,czm_phong:mD,czm_planeDistance:hD,czm_pointAlongRay:pD,czm_rayEllipsoidIntersectionInterval:_D,czm_raySphereIntersectionInterval:gD,czm_readDepth:yD,czm_readNonPerspective:AD,czm_reverseLogDepth:xD,czm_round:CD,czm_sampleOctahedralProjection:TD,czm_saturation:ED,czm_shadowDepthCompare:bD,czm_shadowVisibility:SD,czm_signNotZero:wD,czm_sphericalHarmonics:vD,czm_srgbToLinear:DD,czm_tangentToEyeSpaceMatrix:ID,czm_textureCube:PD,czm_transformPlane:OD,czm_translateRelativeToEye:MD,czm_translucentPhong:RD,czm_transpose:BD,czm_unpackDepth:LD,czm_unpackFloat:ND,czm_unpackUint:FD,czm_valueTransform:UD,czm_vertexLogDepth:VD,czm_windowToEyeCoordinates:kD,czm_writeDepthClamp:zD,czm_writeLogDepth:HD,czm_writeNonPerspective:GD};function ZEe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"varying $2"),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable +${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable +${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT"))):(n=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 WD=ZEe;function HZ(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 jZ(e,t,n){let i,o,r="",s=e.sources;if(l(s))for(i=0,o=s.length;i -1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};ed.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};ed.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 c=this._context,u=r.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Kt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[o]=p,d};function OG(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o=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 Zh={high:0,low:0};Pm.fromCartesian=function(e,t){l(t)||(t=new Pm);let n=t.high,i=t.low;return Pm.encode(e.x,Zh),n.x=Zh.high,i.x=Zh.low,Pm.encode(e.y,Zh),n.y=Zh.high,i.y=Zh.low,Pm.encode(e.z,Zh),n.z=Zh.high,i.z=Zh.low,t};var MG=new Pm;Pm.writeElements=function(e,t,n){Pm.fromCartesian(e,MG);let i=MG.high,o=MG.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 Wn=Pm;function ys(e,t){this.normal=m.clone(e),this.distance=t}ys.fromPointNormal=function(e,t,n){let i=-m.dot(t,e);return l(n)?(m.clone(t,n.normal),n.distance=i,n):new ys(t,i)};var obe=new m;ys.fromCartesian4=function(e,t){let n=m.fromCartesian4(e,obe),i=e.w;return l(t)?(m.clone(n,t.normal),t.distance=i,t):new ys(n,i)};ys.getPointDistance=function(e,t){return m.dot(e.normal,t)+e.distance};var rbe=new m;ys.projectPointOntoPlane=function(e,t,n){l(n)||(n=new m);let i=ys.getPointDistance(e,t),o=m.multiplyByScalar(e.normal,i,rbe);return m.subtract(t,o,n)};var sbe=new B,abe=new re,cbe=new m;ys.transform=function(e,t,n){let i=e.normal,o=e.distance,r=B.inverseTranspose(t,sbe),s=re.fromElements(i.x,i.y,i.z,o,abe);s=B.multiplyByVector(r,s,s);let a=m.fromCartesian4(s,cbe);return s=re.divideByScalar(s,m.magnitude(a),s),ys.fromCartesian4(s,n)};ys.clone=function(e,t){return l(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new ys(e.normal,e.distance)};ys.equals=function(e,t){return e.distance===t.distance&&m.equals(e.normal,t.normal)};ys.ORIGIN_XY_PLANE=Object.freeze(new ys(m.UNIT_Z,0));ys.ORIGIN_YZ_PLANE=Object.freeze(new ys(m.UNIT_X,0));ys.ORIGIN_ZX_PLANE=Object.freeze(new ys(m.UNIT_Y,0));var un=ys;function Gu(e){this.planes=y(e,[])}var qD=[new m,new m,new m];m.clone(m.UNIT_X,qD[0]);m.clone(m.UNIT_Y,qD[1]);m.clone(m.UNIT_Z,qD[2]);var eg=new m,lbe=new m,XZ=new un(new m(1,0,0),0);Gu.fromBoundingSphere=function(e,t){l(t)||(t=new Gu);let n=qD.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a xbe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*P.TWO_PI,o}function Tbe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=P.zeroToTwoPi(r),e<0&&(r-=P.TWO_PI),r+=n*P.TWO_PI,r}function Ebe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*s,i[1]=u*o+c*r*s,i[2]=r*a,i[3]=-c*r-u*o*s,i[4]=-u*r+c*o*s,i[5]=o*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new Z(c*o-u*r*s,-c*r-u*o*s,u*a,u*o+c*r*s,-u*r+c*o*s,-c*a,r*a,o*a,s),i}var bbe=1.0000010178*da,Sbe=100.46645683*Wu,wbe=129597742283429e-5*zl,ZZ=16002,QZ=21863,$Z=32004,eQ=10931,tQ=14529,nQ=16368,iQ=15318,oQ=32794,vbe=64*1e-7*da,Dbe=-152*1e-7*da,Ibe=62*1e-7*da,Pbe=-8*1e-7*da,Obe=32*1e-7*da,Mbe=-41*1e-7*da,Rbe=19*1e-7*da,Bbe=-11*1e-7*da,Lbe=-150*1e-7*da,Nbe=-46*1e-7*da,Fbe=68*1e-7*da,Ube=54*1e-7*da,Vbe=14*1e-7*da,kbe=24*1e-7*da,zbe=-28*1e-7*da,Hbe=22*1e-7*da,rQ=10,sQ=16002,aQ=21863,cQ=10931,lQ=1473,uQ=32004,fQ=4387,dQ=73,Gbe=-325*1e-7,Wbe=-322*1e-7,jbe=-79*1e-7,Ybe=232*1e-7,qbe=-52*1e-7,Xbe=97*1e-7,Kbe=55*1e-7,Jbe=-41*1e-7,Zbe=-105*1e-7,Qbe=-137*1e-7,$be=258*1e-7,eSe=35*1e-7,tSe=-116*1e-7,nSe=-88*1e-7,iSe=-112*1e-7,oSe=-80*1e-7,rT=new ee(0,0,Jn.TAI);function rSe(e,t){hQ(e,rT);let i=(rT.dayNumber-U3.dayNumber+(rT.secondsOfDay-U3.secondsOfDay)/Zn.SECONDS_PER_DAY)/(Zn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=bbe+vbe*Math.cos(ZZ*o)+Lbe*Math.sin(ZZ*o)+Dbe*Math.cos(QZ*o)+Nbe*Math.sin(QZ*o)+Ibe*Math.cos($Z*o)+Fbe*Math.sin($Z*o)+Pbe*Math.cos(eQ*o)+Ube*Math.sin(eQ*o)+Obe*Math.cos(tQ*o)+Vbe*Math.sin(tQ*o)+Mbe*Math.cos(nQ*o)+kbe*Math.sin(nQ*o)+Rbe*Math.cos(iQ*o)+zbe*Math.sin(iQ*o)+Bbe*Math.cos(oQ*o)+Hbe*Math.sin(oQ*o),s=Sbe+wbe*i+Gbe*Math.cos(rQ*o)+Zbe*Math.sin(rQ*o)+Wbe*Math.cos(sQ*o)+Qbe*Math.sin(sQ*o)+jbe*Math.cos(aQ*o)+$be*Math.sin(aQ*o)+Ybe*Math.cos(cQ*o)+eSe*Math.sin(cQ*o)+qbe*Math.cos(lQ*o)+tSe*Math.sin(lQ*o)+Xbe*Math.cos(uQ*o)+nSe*Math.sin(uQ*o)+Kbe*Math.cos(fQ*o)+iSe*Math.sin(fQ*o)+Jbe*Math.cos(dQ*o)+oSe*Math.sin(dQ*o),a=.0167086342-.0004203654*i,c=102.93734808*Wu+11612.3529*zl*i,u=469.97289*zl*i,f=174.87317577*Wu-8679.27034*zl*i;return pQ(r,a,u,c,f,s,t)}function _Q(e,t){hQ(e,rT);let i=(rT.dayNumber-U3.dayNumber+(rT.secondsOfDay-U3.secondsOfDay)/Zn.SECONDS_PER_DAY)/Zn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Wu,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,d=83.35324312*Wu,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*Wu,h=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,A=218.31664563*Wu,x=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,C=297.85019547*Wu+zl*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),T=93.27209062*Wu+zl*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),E=134.96340251*Wu+zl*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),S=357.52910918*Wu+zl*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),v=310.17137918*Wu-zl*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),D=2*C,O=4*C,M=6*C,L=2*E,N=3*E,_=4*E,b=2*T;a+=3400.4*Math.cos(D)-635.6*Math.cos(D-E)-235.6*Math.cos(E)+218.1*Math.cos(D-S)+181*Math.cos(D+E),c+=.014216*Math.cos(D-E)+.008551*Math.cos(D-L)-.001383*Math.cos(E)+.001356*Math.cos(D+E)-.001147*Math.cos(O-N)-914e-6*Math.cos(O-L)+869e-6*Math.cos(D-S-E)-627e-6*Math.cos(D)-394e-6*Math.cos(O-_)+282e-6*Math.cos(D-S-L)-279e-6*Math.cos(C-E)-236e-6*Math.cos(L)+231e-6*Math.cos(O)+229e-6*Math.cos(M-_)-201e-6*Math.cos(L-b),f+=486.26*Math.cos(D-b)-40.13*Math.cos(D)+37.51*Math.cos(b)+25.73*Math.cos(L-b)+19.97*Math.cos(D-S-b),p+=-55609*Math.sin(D-E)-34711*Math.sin(D-L)-9792*Math.sin(E)+9385*Math.sin(O-N)+7505*Math.sin(O-L)+5318*Math.sin(D+E)+3484*Math.sin(O-_)-3417*Math.sin(D-S-E)-2530*Math.sin(M-_)-2376*Math.sin(D)-2075*Math.sin(D-N)-1883*Math.sin(L)-1736*Math.sin(M-5*E)+1626*Math.sin(S)-1370*Math.sin(M-N),h+=-5392*Math.sin(D-b)-540*Math.sin(S)-441*Math.sin(D)+423*Math.sin(b)-288*Math.sin(L-b),x+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-E)-662.5*Math.sin(S)+396.3*Math.sin(E)-218*Math.sin(D-S);let w=2*v,I=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(D-b+v)*i+.614*Math.cos(D-b-v)*i-.0297*Math.cos(w)*o-.0335*Math.cos(v)*o+.0012*Math.cos(D-b+w)*o-16e-5*Math.cos(v)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(w)*r;let R=2.116*Math.sin(v)*i-.111*Math.sin(D-b-v)*i-.0015*Math.sin(v)*o;p+=R,x+=R,h+=-520.77*Math.sin(v)*i+13.66*Math.sin(D-b+v)*i+1.12*Math.sin(D-v)*i-1.06*Math.sin(b-v)*i+.66*Math.sin(w)*o+.371*Math.sin(v)*o-.035*Math.sin(D-b+w)*o-.015*Math.sin(D-b+v)*o+.0014*Math.sin(v)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(w)*r,a*=_be;let F=u+f*zl,k=d+p*zl,V=A+x*zl,G=g+h*zl;return pQ(a,c,F,k,G,V,t)}var mQ=.012300034,sSe=mQ/(mQ+1)*-1;function aSe(e,t){return t=_Q(e,t),m.multiplyByScalar(t,sSe,t)}var gQ=new Z(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),XD=new m;BG.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),l(t)||(t=new m),XD=rSe(e,XD),t=m.negate(XD,t),aSe(e,XD),m.subtract(t,XD,t),Z.multiplyByVector(gQ,t,t),t};BG.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ee.now()),t=_Q(e,t),Z.multiplyByVector(gQ,t,t),t};var ng=BG;var V3={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};V3.getMorphTime=function(e){return e===V3.SCENE3D?1:e===V3.MORPHING?void 0:0};var ne=Object.freeze(V3);function cSe(e){e=y(e,y.EMPTY_OBJECT),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,2)}var Qh=cSe;function sT(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Ke,this._viewportCartesian4=new re,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 re,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=Z.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 Z,this._viewRotation=new Z,this._inverseViewRotation=new Z,this._viewRotation3D=new Z,this._inverseViewRotation3D=new Z,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 Z,this._normal3DDirty=!0,this._normal3D=new Z,this._inverseNormalDirty=!0,this._inverseNormal=new Z,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new Z,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Wn,this._cameraPosition=new m,this._sunPositionWC=new m,this._sunPositionColumbusView=new m,this._sunDirectionWC=new m,this._sunDirectionEC=new m,this._moonDirectionEC=new m,this._lightDirectionWC=new m,this._lightDirectionEC=new m,this._lightColor=new m,this._lightColorHdr=new m,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new m,this._cameraRight=new m,this._cameraUp=new m,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new H,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new H,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(sT.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 yQ(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return yQ(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),Z.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return LG(this),this._view3D}},viewRotation:{get:function(){return LG(this),this._viewRotation}},viewRotation3D:{get:function(){return LG(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return CQ(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return CQ(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return ySe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return ASe(this),this._modelView}},modelView3D:{get:function(){return xSe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return wSe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return CSe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return TSe(this),this._inverseModelView3D}},viewProjection:{get:function(){return ESe(this),this._viewProjection}},inverseViewProjection:{get:function(){return bSe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return SSe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return vSe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return DSe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return ISe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return PSe(this),this._normal}},normal3D:{get:function(){return OSe(this),this._normal3D}},inverseNormal:{get:function(){return MSe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return RSe(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}},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 xQ(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return xQ(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,oe.WGS84)}}});function lSe(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 uSe(e,t){B.clone(t,e._inverseView),B.getMatrix3(t,e._inverseViewRotation)}function fSe(e,t){B.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function dSe(e,t){B.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function mSe(e,t){m.clone(t.positionWC,e._cameraPosition),m.clone(t.directionWC,e._cameraDirection),m.clone(t.rightWC,e._cameraRight),m.clone(t.upWC,e._cameraUp);let n=t.positionCartographic;l(n)?e._eyeHeight=n.height:e._eyeHeight=-e._ellipsoid.maximumRadius,e._encodedCameraPositionMCDirty=!0}var KD=new Z,hSe=new he;function pSe(e,t){l(Rt.computeIcrfToFixedMatrix(t.time,KD))||(KD=Rt.computeTemeToPseudoFixedMatrix(t.time,KD));let n=ng.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);Z.multiplyByVector(KD,n,n),m.normalize(n,e._sunDirectionWC),n=Z.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),m.normalize(n,n),n=ng.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),Z.multiplyByVector(KD,n,n),Z.multiplyByVector(e.viewRotation3D,n,n),m.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,hSe);i.project(r,e._sunPositionColumbusView)}sT.prototype.updateCamera=function(e){lSe(this,e.viewMatrix),uSe(this,e.inverseViewMatrix),mSe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ne.SCENE2D&&e.frustum instanceof tn};sT.prototype.updateFrustum=function(e){fSe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&dSe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=P.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};sT.prototype.updatePass=function(e){this._pass=e};var _Se=[],gSe=new Qh;sT.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===ne.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),pSe(this,e);let n=y(e.light,gSe);n instanceof Qh?(this._lightDirectionWC=m.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=m.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=m.normalize(m.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=Z.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=m.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=m.multiplyByScalar(o,n.intensity,o);let r=m.maximumComponent(o);r>1?m.divideByScalar(o,r,this._lightColor):m.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,_Se),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,l(this._specularEnvironmentMaps)&&H.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Rt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let c=t.frustum.fov,u=this._viewport,f;l(c)?u.height>u.width?f=Math.tan(.5*c)*2/u.height:f=Math.tan(.5*c)*2/u.width:f=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=f*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function yQ(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 ySe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ne.SCENE2D&&e._mode!==ne.MORPHING&&!e._orthographicIn3D?B.inverse(e._projection,e._inverseProjection):B.clone(B.ZERO,e._inverseProjection))}function ASe(e){e._modelViewDirty&&(e._modelViewDirty=!1,B.multiplyTransformation(e._view,e._model,e._modelView))}function xSe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,B.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function CSe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,B.inverse(e.modelView,e._inverseModelView))}function TSe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,B.inverse(e.modelView3D,e._inverseModelView3D))}function ESe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,B.multiply(e._projection,e._view,e._viewProjection))}function bSe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,B.inverse(e.viewProjection,e._inverseViewProjection))}function SSe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,B.multiply(e._projection,e.modelView,e._modelViewProjection))}function wSe(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 vSe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,B.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function DSe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,B.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function ISe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,B.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function PSe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;B.getMatrix3(e.inverseModelView,t),Z.getRotation(t,t),Z.transpose(t,t)}}function OSe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;B.getMatrix3(e.inverseModelView3D,t),Z.getRotation(t,t),Z.transpose(t,t)}}function MSe(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,B.getMatrix3(e.inverseModelView,e._inverseNormal),Z.getRotation(e._inverseNormal,e._inverseNormal))}function RSe(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,B.getMatrix3(e.inverseModelView3D,e._inverseNormal3D),Z.getRotation(e._inverseNormal3D,e._inverseNormal3D))}var AQ=new m;function xQ(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,B.multiplyByPoint(e.inverseModel,e._cameraPosition,AQ),Wn.fromCartesian(AQ,e._encodedCameraPositionMC))}var BSe=new m,LSe=new m,NSe=new m,FSe=new m,USe=new he,VSe=new m,kSe=new B;function zSe(e,t,n,i,o,r,s,a){let c=BSe;c.x=e.y,c.y=e.z,c.z=e.x;let u=LSe;u.x=n.y,u.y=n.z,u.z=n.x;let f=NSe;f.x=i.y,f.y=i.z,f.z=i.x;let d=FSe;d.x=t.y,d.y=t.z,d.z=t.x,r===ne.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,USe);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let g=s.ellipsoid,h=g.cartographicToCartesian(p,VSe),A=Rt.eastNorthUpToFixedFrame(h,g,kSe);return B.multiplyByPointAsVector(A,u,u),B.multiplyByPointAsVector(A,f,f),B.multiplyByPointAsVector(A,d,d),l(a)||(a=new B),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-m.dot(u,h),a[13]=-m.dot(f,h),a[14]=m.dot(d,h),a[15]=1,a}function LG(e){e._view3DDirty&&(e._mode===ne.SCENE3D?B.clone(e._view,e._view3D):zSe(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 CQ(e){e._inverseView3DDirty&&(B.inverseTransformation(e.view3D,e._inverseView3D),B.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var JD=sT;function HSe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,X.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function EQ(e,t,n){for(let i=0;i 0&&(c=!0),l(s[r].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),EQ(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=o}function TQ(e){return e.values.length/e.componentsPerAttribute}function GSe(e){return X.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function WSe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===X.DOUBLE&&(e[n].componentDatatype=X.FLOAT,e[n].values=X.createTypedArray(X.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=TQ(e[o[0]]),t=1;t 0){let u=X.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=r*a,p=new ArrayBuffer(d),g={};for(t=0;t=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=mt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ue.UNSIGNED_INT}):p=mt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ue.UNSIGNED_SHORT})),new $h({context:t,attributes:f,indexBuffer:p})};Object.defineProperties($h.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});$h.prototype.getAttribute=function(e){return this._attributes[e]};function jSe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=kt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function YSe(e,t){let n=e._attributes,i=n.length;for(let o=0;o"u")throw new de("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new de("The browser supports WebGL, but initialization failed.");return r}function XSe(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 KSe(e,t,n,i){let o=`${XSe(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}},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=QSe(this._originalGLContext,e?JSe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Bt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Bt({context:this,pixelFormat:ct.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 Bt({context:this,pixelFormat:ct.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 Ua({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 $Se}}});function bQ(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,ze.partialApply(e._gl,o,t,r,n,i)}var NG;typeof WebGLRenderingContext<"u"&&(NG=[te.BACK]);function FG(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=NG;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var ewe=new ii;Hl.prototype.clear=function(e,t){e=y(e,ewe),t=y(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(z.equals(this._clearColor,o)||(z.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);bQ(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);FG(this,c),n.clear(i)};function twe(e,t,n,i,o){FG(e,t),bQ(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function nwe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,B.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(s=s*u.bytesPerIndex,a=y(a,u.numberOfIndices),c===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,c)):(a=y(a,r.numberOfVertices),c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}Hl.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let o=y(e._framebuffer,t.framebuffer),r=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),twe(this,o,t,n,r),nwe(this,e,n,i)};Hl.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=NG;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i 0&&(a=s.getColorTexture(0).pixelDatatype);let c=ct.createTypedArray(ct.RGBA,a,o,r);return FG(this,s),t.readPixels(n,i,o,r,ct.RGBA,Je.toWebGLConstant(a,this),c),c};var SQ={position:0,textureCoordinates:1};Hl.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new ft({attributes:{position:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Le.TRIANGLES});e=oi.fromGeometry({context:this,geometry:t,attributeLocations:SQ,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Hl.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new it({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Le.TRIANGLES,renderState:t.renderState,shaderProgram:Kt.fromCache({context:this,vertexShaderSource:x0,fragmentShaderSource:e,attributeLocations:SQ}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Hl.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function UG(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(UG.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});UG.prototype.destroy=function(){delete this._pickObjects[this.key]};Hl.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new de("Out of unique Pick IDs.");return this._pickObjects[t]=e,new UG(this._pickObjects,t,z.fromRgba(t))};Hl.prototype.isDestroyed=function(){return!1};Hl.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};Hl._deprecationWarning=$;var ZD=Hl;function aT(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height;this._width=n,this._height=i;let o=e.colorRenderbuffers,r=e.colorTextures;if(l(o)!==l(r))throw new fe("Both color renderbuffer and texture attachments must be provided.");let s=e.depthStencilRenderbuffer,a=e.depthStencilTexture;if(l(s)!==l(a))throw new fe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Hs({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:e.destroyAttachments}),this._colorFramebuffer=new Hs({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:e.destroyAttachments})}aT.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};aT.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};aT.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};aT.prototype.isDestroyed=function(){return!1};aT.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var QD=aT;var il={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===il.RGBA4||e===il.RGBA8||e===il.RGBA16F||e===il.RGBA32F||e===il.RGB5_A1||e===il.RGB565||e===il.DEPTH_COMPONENT16||e===il.STENCIL_INDEX8||e===il.DEPTH_STENCIL||e===il.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?il.RGBA32F:e===te.HALF_FLOAT_OES?il.RGBA16F:il.RGBA8}},gc=Object.freeze(il);function $D(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=kt.maximumRenderbufferSize,o=y(e.format,gc.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties($D.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});$D.prototype._getRenderbuffer=function(){return this._renderbuffer};$D.prototype.isDestroyed=function(){return!1};$D.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var Gl=$D;function ns(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(ns.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}}});ns.prototype.isDirty=function(e,t,n,i,o){n=y(n,1);let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};ns.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?y(i,1):1,o=y(o,this._color?y(this._pixelDatatype,Je.UNSIGNED_BYTE):void 0),r=y(r,this._color?y(this._pixelFormat,ct.RGBA):void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s 1){let a=gc.getColorFormat(o);this._colorRenderbuffers[s]=new Gl({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Bt({context:e,width:t,height:n,pixelFormat:ct.DEPTH_STENCIL,pixelDatatype:Je.UNSIGNED_INT_24_8,sampler:dn.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Gl({context:e,width:t,height:n,format:gc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Gl({context:e,width:t,height:n,format:gc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Bt({context:e,width:t,height:n,pixelFormat:ct.DEPTH_COMPONENT,pixelDatatype:Je.UNSIGNED_INT,sampler:dn.NEAREST}):this._depthRenderbuffer=new Gl({context:e,width:t,height:n,format:gc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new QD({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 Hs({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};ns.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};ns.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};ns.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};ns.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};ns.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};ns.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};ns.prototype.getDepthTexture=function(){return this._depthTexture};ns.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};ns.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};ns.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};ns.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};ns.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};ns.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};ns.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};ns.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};ns.prototype.destroy=function(){if(this._color){let e,t=this._colorTextures.length;for(e=0;e 0?X.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};As._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r 0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}As.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t 0&&(this._hash={},e.length=0)};var Et=N0;function Wl(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(Wl.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}}});Wl.packedLength=2;Wl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};Wl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Wl),n.near=e[t++],n.far=e[t],n};Wl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Wl.clone=function(e,t){if(l(e))return l(t)||(t=new Wl),t.near=e.near,t.far=e.far,t};Wl.prototype.clone=function(e){return Wl.clone(this,e)};Wl.prototype.equals=function(e){return Wl.equals(this,e)};var Dt=Wl;function ju(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}ju.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new ju(e.near,e.nearValue,e.far,e.farValue)};ju.packedLength=4;ju.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};ju.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ju),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};ju.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};ju.prototype.clone=function(e){return ju.clone(this,e)};ju.prototype.equals=function(e){return ju.equals(this,e)};var Lt=ju;var mwe={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},qe=Object.freeze(mwe);var hwe={CENTER:0,LEFT:1,RIGHT:-1},pi=Object.freeze(hwe);var pwe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},On=Object.freeze(pwe);var _we={DONE:0,PENDING:1,FAILED:2},ut=Object.freeze(_we);function nd(){fe.throwInstantiationError()}Object.defineProperties(nd.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});nd.prototype.getValue=fe.throwInstantiationError;nd.prototype.equals=fe.throwInstantiationError;nd.equals=function(e,t){return e===t||l(e)&&e.equals(t)};nd.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i -1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new wQ(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new wQ(r)):(HG(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],HG(s.get(r.id),r,a),s.remove(r.id)};function HG(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var oI=og;function Nwe(e,t){this.start=y(e,0),this.stop=y(t,0)}var Ac=Nwe;function _n(e,t){this.center=m.clone(y(e,m.ZERO)),this.radius=y(t,0)}var jG=new m,YG=new m,qG=new m,XG=new m,KG=new m,JG=new m,ZG=new m,Ws=new m,QG=new m,$G=new m,e8=new m,t8=new m,Fwe=4/3*P.PI;_n.fromPoints=function(e,t){if(l(t)||(t=new _n),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=m.clone(e[0],ZG),i=m.clone(n,jG),o=m.clone(n,YG),r=m.clone(n,qG),s=m.clone(n,XG),a=m.clone(n,KG),c=m.clone(n,JG),u=e.length,f;for(f=1;fs.x&&m.clone(n,s),L a.y&&m.clone(n,a),N c.z&&m.clone(n,c)}let d=m.magnitudeSquared(m.subtract(s,i,Ws)),p=m.magnitudeSquared(m.subtract(a,o,Ws)),g=m.magnitudeSquared(m.subtract(c,r,Ws)),h=i,A=s,x=d;p>x&&(x=p,h=o,A=a),g>x&&(x=g,h=r,A=c);let C=QG;C.x=(h.x+A.x)*.5,C.y=(h.y+A.y)*.5,C.z=(h.z+A.z)*.5;let T=m.magnitudeSquared(m.subtract(A,C,Ws)),E=Math.sqrt(T),S=$G;S.x=i.x,S.y=o.y,S.z=r.z;let v=e8;v.x=s.x,v.y=a.y,v.z=c.z;let D=m.midpoint(S,v,t8),O=0;for(f=0;fO&&(O=M);let L=m.magnitudeSquared(m.subtract(n,C,Ws));if(L>T){let N=Math.sqrt(L);E=(E+N)*.5,T=E*E;let _=N-E;C.x=(E*C.x+_*n.x)/N,C.y=(E*C.y+_*n.y)/N,C.z=(E*C.z+_*n.z)/N}}return E c.x&&m.clone(o,c),_ u.y&&m.clone(o,u),b f.z&&m.clone(o,f)}let g=m.magnitudeSquared(m.subtract(c,r,Ws)),h=m.magnitudeSquared(m.subtract(u,s,Ws)),A=m.magnitudeSquared(m.subtract(f,a,Ws)),x=r,C=c,T=g;h>T&&(T=h,x=s,C=u),A>T&&(T=A,x=a,C=f);let E=QG;E.x=(x.x+C.x)*.5,E.y=(x.y+C.y)*.5,E.z=(x.z+C.z)*.5;let S=m.magnitudeSquared(m.subtract(C,E,Ws)),v=Math.sqrt(S),D=$G;D.x=r.x,D.y=s.y,D.z=a.z;let O=e8;O.x=c.x,O.y=u.y,O.z=f.z;let M=m.midpoint(D,O,t8),L=0;for(p=0;p L&&(L=N);let _=m.magnitudeSquared(m.subtract(o,E,Ws));if(_>S){let b=Math.sqrt(_);v=(v+b)*.5,S=v*v;let w=b-v;E.x=(v*E.x+w*o.x)/b,E.y=(v*E.y+w*o.y)/b,E.z=(v*E.z+w*o.z)/b}}return v a.x&&m.clone(i,a),N c.y&&m.clone(i,c),_ u.z&&m.clone(i,u)}let p=m.magnitudeSquared(m.subtract(a,o,Ws)),g=m.magnitudeSquared(m.subtract(c,r,Ws)),h=m.magnitudeSquared(m.subtract(u,s,Ws)),A=o,x=a,C=p;g>C&&(C=g,A=r,x=c),h>C&&(C=h,A=s,x=u);let T=QG;T.x=(A.x+x.x)*.5,T.y=(A.y+x.y)*.5,T.z=(A.z+x.z)*.5;let E=m.magnitudeSquared(m.subtract(x,T,Ws)),S=Math.sqrt(E),v=$G;v.x=o.x,v.y=r.y,v.z=s.z;let D=e8;D.x=a.x,D.y=c.y,D.z=u.z;let O=m.midpoint(v,D,t8),M=0;for(d=0;d M&&(M=L);let N=m.magnitudeSquared(m.subtract(i,T,Ws));if(N>E){let _=Math.sqrt(N);S=(S+_)*.5,E=S*S;let b=_-S;T.x=(S*T.x+b*i.x)/_,T.y=(S*T.y+b*i.y)/_,T.z=(S*T.z+b*i.z)/_}}return S =c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let u=(o+c+s)*.5,f=m.multiplyByScalar(a,(-o+u)/c,Kwe);return m.add(f,i,f),m.clone(f,n.center),n.radius=u,n};var Jwe=new m;_n.expand=function(e,t,n){n=_n.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,Jwe));return i>n.radius&&(n.radius=i),n};_n.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=m.dot(o,n)+t.distance;return r<-i?$t.OUTSIDE:r maxHeight) { + material.diffuse = vec3(0.0); + material.alpha = 0.0; + return material; + } + + // Binary search to find heights above and below. + int idxBelow = 0; + int idxAbove = heightsDimensions.x; + float heightBelow = minHeight; + float heightAbove = maxHeight; + + // while loop not allowed, so use for loop with max iterations. + // maxIterations of 16 supports a texture size up to 65536 (2^16). + const int maxIterations = 16; + for (int i = 0; i < maxIterations; i++) { + if (idxBelow >= idxAbove - 1) { + break; + } + + int idxMid = (idxBelow + idxAbove) / 2; + float heightTex = getHeight(idxMid, invTexSize); + + if (height > heightTex) { + idxBelow = idxMid; + heightBelow = heightTex; + } else { + idxAbove = idxMid; + heightAbove = heightTex; + } + } + + float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); + vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); + vec4 color = texture(colors, colorUv); + + // undo preumultiplied alpha + if (color.a > 0.0) + { + color.rgb /= color.a; + } + + color.rgb = czm_gammaCorrect(color.rgb); + + material.diffuse = color.rgb; + material.alpha = color.a; + return material; +} +`;var yI=`#ifdef GL_OES_standard_derivatives + #extension GL_OES_standard_derivatives : enable +#endif + +uniform vec4 color; +uniform float spacing; +uniform float width; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + float distanceToContour = mod(materialInput.height, spacing); + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float dxc = abs(dFdx(materialInput.height)); + float dyc = abs(dFdy(materialInput.height)); + float dF = max(dxc, dyc) * czm_pixelRatio * width; + float alpha = (distanceToContour < dF) ? 1.0 : 0.0; +#else + // If no derivatives available (IE 10?), use pixel ratio + float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; +#endif + + vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; +} +`;var AI=`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 xI=`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 CI=`#ifdef GL_OES_standard_derivatives + #extension GL_OES_standard_derivatives : enable +#endif + +uniform vec4 color; +uniform float cellAlpha; +uniform vec2 lineCount; +uniform vec2 lineThickness; +uniform vec2 lineOffset; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); + scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); + float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); + scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); + + float value; + + // Fuzz Factor - Controls blurriness of lines +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + const float fuzz = 1.2; + vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; + + // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. + vec2 dx = abs(dFdx(st)); + vec2 dy = abs(dFdy(st)); + vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; + value = min( + smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), + smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); +#else + // If no derivatives available (IE 10?), revert to view-dependent fuzz + const float fuzz = 0.05; + + vec2 range = 0.5 - (lineThickness * 0.05); + value = min( + 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), + 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); +#endif + + // Edges taken from RimLightingMaterial.glsl + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); + float sRim = smoothstep(0.8, 1.0, dRim); + value *= (1.0 - sRim); + + vec4 halfColor; + halfColor.rgb = color.rgb * 0.5; + halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); + halfColor = czm_gammaCorrect(halfColor); + material.diffuse = halfColor.rgb; + material.emission = halfColor.rgb; + material.alpha = halfColor.a; + + return material; +} +`;var TI=`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 EI=`#ifdef GL_OES_standard_derivatives +#extension GL_OES_standard_derivatives : enable +#endif + +uniform vec4 color; + +float getPointOnLine(vec2 p0, vec2 p1, float x) +{ + float slope = (p0.y - p1.y) / (p0.x - p1.x); + return slope * (x - p0.x) + p0.y; +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; +#else + // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head + float base = 0.975; +#endif + + vec2 center = vec2(1.0, 0.5); + float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); + float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); + + float halfWidth = 0.15; + float s = step(0.5 - halfWidth, st.t); + s *= 1.0 - step(0.5 + halfWidth, st.t); + s *= 1.0 - step(base, st.s); + + float t = step(base, materialInput.st.s); + t *= 1.0 - step(ptOnUpperLine, st.t); + t *= step(ptOnLowerLine, st.t); + + // Find the distance from the closest separator (region between two colors) + float dist; + if (st.s < base) + { + float d1 = abs(st.t - (0.5 - halfWidth)); + float d2 = abs(st.t - (0.5 + halfWidth)); + dist = min(d1, d2); + } + else + { + float d1 = czm_infinity; + if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) + { + d1 = abs(st.s - base); + } + float d2 = abs(st.t - ptOnUpperLine); + float d3 = abs(st.t - ptOnLowerLine); + dist = min(min(d1, d2), d3); + } + + vec4 outsideColor = vec4(0.0); + vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); + vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); + + outColor = czm_gammaCorrect(outColor); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + return material; +} +`;var bI=`uniform vec4 color; +uniform vec4 gapColor; +uniform float dashLength; +uniform float dashPattern; +in float v_polylineAngle; + +const float maskLength = 16.0; + +mat2 rotate(float rad) { + float c = cos(rad); + float s = sin(rad); + return mat2( + c, s, + -s, c + ); +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; + + // Get the relative position within the dash from 0 to 1 + float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); + // Figure out the mask index. + float maskIndex = floor(dashPosition * maskLength); + // Test the bit mask. + float maskTest = floor(dashPattern / pow(2.0, maskIndex)); + vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; + if (fragColor.a < 0.005) { // matches 0/255 and 1/255 + discard; + } + + fragColor = czm_gammaCorrect(fragColor); + material.emission = fragColor.rgb; + material.alpha = fragColor.a; + return material; +} +`;var SI=`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 wI=`uniform vec4 color; +uniform vec4 outlineColor; +uniform float outlineWidth; + +in float v_width; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; + float b = step(0.5 - halfInteriorWidth, st.t); + b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); + + // Find the distance from the closest separator (region between two colors) + float d1 = abs(st.t - (0.5 - halfInteriorWidth)); + float d2 = abs(st.t - (0.5 + halfInteriorWidth)); + float dist = min(d1, d2); + + vec4 currentColor = mix(outlineColor, color, b); + vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); + outColor = czm_gammaCorrect(outColor); + + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; +} +`;var vI=`uniform vec4 color; +uniform vec4 rimColor; +uniform float width; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); + float s = smoothstep(1.0 - width, 1.0, d); + + vec4 outColor = czm_gammaCorrect(color); + vec4 outRimColor = czm_gammaCorrect(rimColor); + + material.diffuse = outColor.rgb; + material.emission = outRimColor.rgb * s; + material.alpha = mix(outColor.a, outRimColor.a, s); + + return material; +} +`;var DI=`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 II=`uniform vec4 evenColor; +uniform vec4 oddColor; +uniform float offset; +uniform float repeat; +uniform bool horizontal; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) + float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); + float value = fract((coord - offset) * (repeat * 0.5)); + float dist = min(value, min(abs(value - 0.5), 1.0 - value)); + + vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); + vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); + color = czm_gammaCorrect(color); + + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; +} +`;var PI=`// Thanks for the contribution Jonas +// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog + +uniform sampler2D specularMap; +uniform sampler2D normalMap; +uniform vec4 baseWaterColor; +uniform vec4 blendColor; +uniform float frequency; +uniform float animationSpeed; +uniform float amplitude; +uniform float specularIntensity; +uniform float fadeFactor; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + float time = czm_frameNumber * animationSpeed; + + // fade is a function of the distance from the fragment and the frequency of the waves + float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); + + float specularMapValue = texture(specularMap, materialInput.st).r; + + // note: not using directional motion at this time, just set the angle to 0.0; + vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); + vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); + + // fade out the normal perturbation as we move further from the water surface + normalTangentSpace.xy /= fade; + + // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) + normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); + + normalTangentSpace = normalize(normalTangentSpace); + + // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane + float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); + + // fade out water effect as specular map value decreases + material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; + + // base color is a blend of the water and non-water color based on the value from the specular map + // may need a uniform blend factor to better control this + material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); + + // diffuse highlights are based on how perturbed the normal is + material.diffuse += (0.1 * tsPerturbationRatio); + + material.diffuse = material.diffuse; + + material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); + + material.specular = specularIntensity; + material.shininess = 10.0; + + return material; +} +`;function Xe(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,cn.LINEAR),this._magnificationFilter=y(e.magnificationFilter,xi.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,_ve(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(Xe._uniformList[this.type])||(Xe._uniformList[this.type]=Object.keys(this._uniforms))}Xe._uniformList={};Xe.fromType=function(e,t){let n=new Xe({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Xe.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i -1)return!0;return!1}function Tve(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} +`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) +{ +`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); +`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&Cve(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 VQ={mat2:Qi,mat3:Z,mat4:B},Eve=/\.ktx2$/i;function bve(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===Xe.DefaultImageId;t=r;let c=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new dn({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Bt({context:i,source:r,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Bt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(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&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=c._width,f.y=c._height)),a)return;let d=r instanceof we;if(!l(n._texturePaths[e])||d&&r.url!==n._texturePaths[e].url||!d&&r!==n._texturePaths[e]){if(typeof r=="string"||d){let p=d?r:we.createIfNeeded(r),g;Eve.test(p.url)?g=tl(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(h){n._loadedImages.push({id:e,image:h})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function Sve(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Ua){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Xe.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 wve(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&kQ(e,n)}function kQ(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=vve(o),s;if(r==="channels")s=OI(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;Ive(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},kQ(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=OI(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(bve(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Sve(t));else if(r.indexOf("mat")!==-1){let u=new VQ[r];e._uniforms[c]=function(){return VQ[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function vve(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof we||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Xe.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 Dve(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new Xe({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=_t(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;OI(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=OI(e,i,a)}}function OI(e,t,n,i){i=y(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(o+=1,n)}),o}function Ive(e,t,n){return OI(e,t,t,n)}Xe._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Xe.DefaultImageId="czm_defaultImage";Xe.DefaultCubeMapId="czm_defaultCubeMap";Xe.ColorType="Color";Xe._materialCache.addMaterial(Xe.ColorType,{fabric:{type:Xe.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Xe.ImageType="Image";Xe._materialCache.addMaterial(Xe.ImageType,{fabric:{type:Xe.ImageType,uniforms:{image:Xe.DefaultImageId,repeat:new H(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Xe.DiffuseMapType="DiffuseMap";Xe._materialCache.addMaterial(Xe.DiffuseMapType,{fabric:{type:Xe.DiffuseMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Xe.AlphaMapType="AlphaMap";Xe._materialCache.addMaterial(Xe.AlphaMapType,{fabric:{type:Xe.AlphaMapType,uniforms:{image:Xe.DefaultImageId,channel:"a",repeat:new H(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Xe.SpecularMapType="SpecularMap";Xe._materialCache.addMaterial(Xe.SpecularMapType,{fabric:{type:Xe.SpecularMapType,uniforms:{image:Xe.DefaultImageId,channel:"r",repeat:new H(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Xe.EmissionMapType="EmissionMap";Xe._materialCache.addMaterial(Xe.EmissionMapType,{fabric:{type:Xe.EmissionMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Xe.BumpMapType="BumpMap";Xe._materialCache.addMaterial(Xe.BumpMapType,{fabric:{type:Xe.BumpMapType,uniforms:{image:Xe.DefaultImageId,channel:"r",strength:.8,repeat:new H(1,1)},source:hI},translucent:!1});Xe.NormalMapType="NormalMap";Xe._materialCache.addMaterial(Xe.NormalMapType,{fabric:{type:Xe.NormalMapType,uniforms:{image:Xe.DefaultImageId,channels:"rgb",strength:.8,repeat:new H(1,1)},source:TI},translucent:!1});Xe.GridType="Grid";Xe._materialCache.addMaterial(Xe.GridType,{fabric:{type:Xe.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new H(8,8),lineThickness:new H(1,1),lineOffset:new H(0,0)},source:CI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Xe.StripeType="Stripe";Xe._materialCache.addMaterial(Xe.StripeType,{fabric:{type:Xe.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:II},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Xe.CheckerboardType="Checkerboard";Xe._materialCache.addMaterial(Xe.CheckerboardType,{fabric:{type:Xe.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new H(5,5)},source:pI},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Xe.DotType="Dot";Xe._materialCache.addMaterial(Xe.DotType,{fabric:{type:Xe.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new H(5,5)},source:_I},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Xe.WaterType="Water";Xe._materialCache.addMaterial(Xe.WaterType,{fabric:{type:Xe.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:Xe.DefaultImageId,normalMap:Xe.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:PI},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Xe.RimLightingType="RimLighting";Xe._materialCache.addMaterial(Xe.RimLightingType,{fabric:{type:Xe.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:vI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Xe.FadeType="Fade";Xe._materialCache.addMaterial(Xe.FadeType,{fabric:{type:Xe.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new H(.5,.5)},source:xI},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Xe.PolylineArrowType="PolylineArrow";Xe._materialCache.addMaterial(Xe.PolylineArrowType,{fabric:{type:Xe.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:EI},translucent:!0});Xe.PolylineDashType="PolylineDash";Xe._materialCache.addMaterial(Xe.PolylineDashType,{fabric:{type:Xe.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:bI},translucent:!0});Xe.PolylineGlowType="PolylineGlow";Xe._materialCache.addMaterial(Xe.PolylineGlowType,{fabric:{type:Xe.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:SI},translucent:!0});Xe.PolylineOutlineType="PolylineOutline";Xe._materialCache.addMaterial(Xe.PolylineOutlineType,{fabric:{type:Xe.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:wI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Xe.ElevationContourType="ElevationContour";Xe._materialCache.addMaterial(Xe.ElevationContourType,{fabric:{type:Xe.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:yI},translucent:!1});Xe.ElevationRampType="ElevationRamp";Xe._materialCache.addMaterial(Xe.ElevationRampType,{fabric:{type:Xe.ElevationRampType,uniforms:{image:Xe.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:AI},translucent:!1});Xe.SlopeRampMaterialType="SlopeRamp";Xe._materialCache.addMaterial(Xe.SlopeRampMaterialType,{fabric:{type:Xe.SlopeRampMaterialType,uniforms:{image:Xe.DefaultImageId},source:DI},translucent:!1});Xe.AspectRampMaterialType="AspectRamp";Xe._materialCache.addMaterial(Xe.AspectRampMaterialType,{fabric:{type:Xe.AspectRampMaterialType,uniforms:{image:Xe.DefaultImageId},source:mI},translucent:!1});Xe.ElevationBandType="ElevationBand";Xe._materialCache.addMaterial(Xe.ElevationBandType,{fabric:{type:Xe.ElevationBandType,uniforms:{heights:Xe.DefaultImageId,colors:Xe.DefaultImageId},source:gI},translucent:!0});var ki=Xe;function F0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,F0.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:ki.fromType(ki.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=eo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(F0.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}}});F0.prototype.getFragmentShaderSource=eo.prototype.getFragmentShaderSource;F0.prototype.isTranslucent=eo.prototype.isTranslucent;F0.prototype.getRenderState=eo.prototype.getRenderState;F0.MaterialSupport={BASIC:Object.freeze({vertexFormat:Pe.POSITION_AND_NORMAL,vertexShaderSource:uI,fragmentShaderSource:lI}),TEXTURED:Object.freeze({vertexFormat:Pe.POSITION_NORMAL_AND_ST,vertexShaderSource:dI,fragmentShaderSource:fI}),ALL:Object.freeze({vertexFormat:Pe.ALL,vertexShaderSource:cI,fragmentShaderSource:aI})};var ro=F0;var MI=`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 RI=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec4 color; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec4 v_color; + +void main() +{ + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_color = color; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var U0=`in vec4 v_color; + +void main() +{ + out_FragColor = czm_gammaCorrect(v_color); +} +`;var BI=`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 tp(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),o=i?BI:RI,r=i?U0:MI,s=i?tp.FLAT_VERTEX_FORMAT:tp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,o),this._fragmentShaderSource=y(e.fragmentShaderSource,r),this._renderState=eo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(tp.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}}});tp.VERTEX_FORMAT=Pe.POSITION_AND_NORMAL;tp.FLAT_VERTEX_FORMAT=Pe.POSITION_ONLY;tp.prototype.getFragmentShaderSource=eo.prototype.getFragmentShaderSource;tp.prototype.isTranslucent=eo.prototype.isTranslucent;tp.prototype.getRenderState=eo.prototype.getRenderState;var rn=tp;function fT(e){this._definitionChanged=new ge,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(fT.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ce("color")});fT.prototype.getType=function(e){return"Color"};fT.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};fT.prototype.equals=function(e){return this===e||e instanceof fT&&j.equals(this._color,e._color)};var Ut=fT;function rg(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,oe.WGS84),this._rectangle=y(e.rectangle,le.MAX_VALUE),this._projection=new Si(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(rg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});rg.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),l(n)?(n.x=u,n.y=f,n):new H(u,f)};var zi=rg;var zQ=new m,HQ=new m,GQ=new he,o8=new m,Pve=new m,WQ=new ae,Ove=new zi,LI=[new he,new he,new he,new he],NI=new H,Nr={};Nr.initialize=function(){let e=Nr._initPromise;return l(e)||(e=we.fetchJson(en("Assets/approximateTerrainHeights.json")).then(function(t){Nr._terrainHeights=t}),Nr._initPromise=e),e};Nr.getMinimumMaximumHeights=function(e,t){t=y(t,oe.WGS84);let n=jQ(e),i=Nr._defaultMinTerrainHeight,o=Nr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Nr._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(le.northeast(e,GQ),zQ),t.cartographicToCartesian(le.southwest(e,GQ),HQ),m.midpoint(HQ,zQ,o8);let a=t.scaleToGeodeticSurface(o8,Pve);if(l(a)){let c=m.distance(o8,a);i=Math.min(i,-c)}else i=Nr._defaultMinTerrainHeight}return i=Math.max(Nr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Nr.getBoundingSphere=function(e,t){t=y(t,oe.WGS84);let n=jQ(e),i=Nr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Nr._terrainHeights[r];l(s)&&(i=s[1])}let o=ae.fromRectangle3D(e,t,0);return ae.fromRectangle3D(e,t,i,WQ),ae.union(o,WQ,o)};function jQ(e){he.fromRadians(e.east,e.north,0,LI[0]),he.fromRadians(e.west,e.north,0,LI[1]),he.fromRadians(e.east,e.south,0,LI[2]),he.fromRadians(e.west,e.south,0,LI[3]);let t=0,n=0,i=0,o=0,r=Nr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let u=LI[c];if(Ove.positionToTileXY(u,s,NI),c===0)i=NI.x,o=NI.y;else if(i!==NI.x||o!==NI.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}}Nr._terrainHeightsMaxLevel=6;Nr._defaultMaxTerrainHeight=9e3;Nr._defaultMinTerrainHeight=-1e5;Nr._terrainHeights=void 0;Nr._initPromise=void 0;Object.defineProperties(Nr,{initialized:{get:function(){return l(Nr._terrainHeights)}}});var ri=Nr;function xc(e,t,n){this.minimum=m.clone(y(e,m.ZERO)),this.maximum=m.clone(y(t,m.ZERO)),l(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}xc.fromCorners=function(e,t,n){return l(n)||(n=new xc),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};xc.fromPoints=function(e,t){if(l(t)||(t=new xc),!l(e)||e.length===0)return t.minimum=m.clone(m.ZERO,t.minimum),t.maximum=m.clone(m.ZERO,t.maximum),t.center=m.clone(m.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d 0?$t.INSIDE:r+o<0?$t.OUTSIDE:$t.INTERSECTING};xc.prototype.clone=function(e){return xc.clone(this,e)};xc.prototype.intersectPlane=function(e){return xc.intersectPlane(this,e)};xc.prototype.equals=function(e){return xc.equals(this,e)};var sg=xc;var r8={};r8.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function YQ(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t))) u&&u/c 0?[a/e,n/a]:[n/a,a/e]};var Cc=r8;var a8={};a8.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function s8(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,u=r*a,f=r*r,d=s*s,p=o*s-f,g=o*a-r*s,h=r*a-d,A=4*p*h-g*g,x,C;if(A<0){let q,Y,Q;f*u>=c*d?(q=o,Y=p,Q=-2*r*p+o*g):(q=a,Y=h,Q=-a*g+2*s*h);let K=-(Q<0?-1:1)*Math.abs(q)*Math.sqrt(-A);C=-Q+K;let J=C/2,_e=J<0?-Math.pow(-J,1/3):Math.pow(J,1/3),xe=C===K?-_e:-Y/_e;return x=Y<=0?_e+xe:-Q/(_e*_e+xe*xe+Y),f*u>=c*d?[(x-r)/o]:[-a/(x+s)]}let T=p,E=-2*r*p+o*g,S=h,v=-a*g+2*s*h,D=Math.sqrt(A),O=Math.sqrt(3)/2,M=Math.abs(Math.atan2(o*D,-E)/3);x=2*Math.sqrt(-T);let L=Math.cos(M);C=x*L;let N=x*(-L/2-O*Math.sin(M)),_=C+N>2*r?C-r:N-r,b=o,w=_/b;M=Math.abs(Math.atan2(a*D,-v)/3),x=2*Math.sqrt(-S),L=Math.cos(M),C=x*L,N=x*(-L/2-O*Math.sin(M));let I=-a,R=C+N<2*s?C+s:N+s,F=I/R,k=b*R,V=-_*R-b*I,G=_*I,U=(s*V-r*G)/(-r*V+s*k);return w<=U?w<=F?U<=F?[w,U,F]:[w,F,U]:[F,w,U]:w<=F?[U,w,F]:U<=F?[U,F,w]:[F,U,w]}a8.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Cc.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=Cc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return s8(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):s8(e,t,0,i);if(i===0)return o=Cc.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 s8(e,t,n,i)};var V0=a8;var c8={};c8.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=o*o,h=g*o;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*r*d*d+256*s*h+o*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*r*n*d)+g*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function od(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=V0.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f) =0&&g>=0){let A=Math.sqrt(p),x=Math.sqrt(g);return[u-x,u-A,u+A,u+x]}else{if(p>=0&&g<0)return h=Math.sqrt(p),[u-h,u+h];if(p<0&&g>=0)return h=Math.sqrt(g),[u-h,u+h]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(r+f-s/d)/2,g=(r+f+s/d)/2,h=Cc.computeRealRoots(1,d,p),A=Cc.computeRealRoots(1,-d,g);return h.length!==0?(h[0]+=u,h[1]+=u,A.length!==0?(A[0]+=u,A[1]+=u,h[1]<=A[0]?[h[0],h[1],A[0],A[1]]:A[1]<=h[0]?[A[0],A[1],h[0],h[1]]:h[0]>=A[0]&&h[1]<=A[1]?[A[0],h[0],h[1],A[1]]:A[0]>=h[0]&&A[1]<=h[1]?[h[0],A[0],A[1],h[1]]:h[0]>A[0]&&h[0]0){let d=f[0],p=t-d,g=p*p,h=e/2,A=p/2,x=g-4*i,C=g+4*Math.abs(i),T=s-4*d,E=s+4*Math.abs(d),S,v;if(d<0||x*E =_[0]&&N[1]<=_[1]?[_[0],N[0],N[1],_[1]]:_[0]>=N[0]&&_[1]<=N[1]?[N[0],_[0],_[1],N[1]]:N[0]>_[0]&&N[0]<_[1]?[_[0],N[0],_[1],N[1]]:[N[0],_[0],N[1],_[1]]:N;if(_.length!==0)return _}return[]}c8.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e) f)||(p=m.cross(d,a,XQ),h=m.dot(s,p),h<0||g+h>f))return;A=m.dot(c,p)/f}else{if(Math.abs(f) 1||(p=m.cross(d,a,XQ),h=m.dot(s,p)*x,h<0||g+h>1))return;A=m.dot(c,p)*x}return A};tr.rayTriangle=function(e,t,n,i,o,r){let s=tr.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new m),m.multiplyByScalar(e.direction,s,r),m.add(e.origin,r,r)};var Bve=new Dn;tr.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=Bve;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let c=tr.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>m.distance(e,t)))return l(s)||(s=new m),m.multiplyByScalar(a.direction,c,s),m.add(a.origin,s,s)};function Lve(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,u=(-t-a)*s;return cs))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var Uve=new m,Vve=new m;tr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,Uve),o=m.multiplyComponents(n,e.direction,Vve),r=m.magnitudeSquared(i),s=m.dot(i,o),a,c,u,f,d;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=m.magnitudeSquared(o),u=c*a,pu){f=s*s-u,d=-s+Math.sqrt(f);let h=d/c,A=a/d;return h0?g.push(new m(i,o*L,o*-b)):b!==0?(g.push(new m(i,o*L,o*-b)),g.push(new m(i,o*L,o*b)),++M):g.push(new m(i,o*L,o*b))}return g}var l8=new m,KQ=new m,JQ=new m,G3=new m,zve=new m,Hve=new Z,Gve=new Z,Wve=new Z,jve=new Z,Yve=new Z,ZQ=new Z,QQ=new Z,$Q=new m,qve=new m,Xve=new he;tr.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let D=t.geodeticSurfaceNormal(n,l8);if(m.dot(i,D)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,l8),s=m.normalize(r,r),a=m.mostOrthogonalAxis(r,G3),c=m.normalize(m.cross(a,s,KQ),KQ),u=m.normalize(m.cross(s,c,JQ),JQ),f=Hve;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=Z.transpose(f,Gve),p=Z.fromScale(t.radii,Wve),g=Z.fromScale(t.oneOverRadii,jve),h=Yve;h[0]=0,h[1]=-i.z,h[2]=i.y,h[3]=i.z,h[4]=0,h[5]=-i.x,h[6]=-i.y,h[7]=i.x,h[8]=0;let A=Z.multiply(Z.multiply(d,g,ZQ),h,ZQ),x=Z.multiply(Z.multiply(A,p,QQ),f,QQ),C=Z.multiplyByVector(A,n,zve),T=kve(x,m.negate(C,l8),0,0,1),E,S,v=T.length;if(v>0){let D=m.clone(m.ZERO,qve),O=Number.NEGATIVE_INFINITY;for(let L=0;L O&&(O=_,D=m.clone(E,D))}let M=t.cartesianToCartographic(D,Xve);return O=P.clamp(O,0,1),S=m.magnitude(m.subtract(D,n,G3))*Math.sqrt(1-O*O),S=o?-S:S,M.height=S,t.cartographicToCartesian(M,new m)}};var Kve=new m;tr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new m);let o=m.subtract(t,e,Kve),r=n.normal,s=m.dot(r,o);if(Math.abs(s) 1))return m.multiplyByScalar(o,c,i),m.add(e,i,i),i};tr.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=m.dot(o,e)+r<0,a=m.dot(o,t)+r<0,c=m.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new m,d=new m),u===1){if(s)return tr.lineSegmentPlane(e,t,i,f),tr.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return tr.lineSegmentPlane(t,n,i,f),tr.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return tr.lineSegmentPlane(n,e,i,f),tr.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return tr.lineSegmentPlane(e,n,i,f),tr.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return tr.lineSegmentPlane(n,t,i,f),tr.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return tr.lineSegmentPlane(t,e,i,f),tr.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var qi=tr;var u8=new re;function Rm(e,t){t=y(t,oe.WGS84),e=t.scaleToGeodeticSurface(e);let n=Rt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(B.getColumn(n,0,u8)),this._yAxis=m.fromCartesian4(B.getColumn(n,1,u8));let i=m.fromCartesian4(B.getColumn(n,2,u8));this._plane=un.fromPointNormal(e,i)}Object.defineProperties(Rm.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 Jve=new sg;Rm.fromPoints=function(e,t){let n=sg.fromPoints(e,Jve);return new Rm(n.center,t)};var n$=new Dn,W3=new m;Rm.prototype.projectPointOntoPlane=function(e,t){let n=n$;n.origin=e,m.normalize(e,n.direction);let i=qi.rayPlane(n,this._plane,W3);if(l(i)||(m.negate(n.direction,n.direction),i=qi.rayPlane(n,this._plane,W3)),l(i)){let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new H(r,s)}};Rm.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o0?0:O.latitude,b=he.fromRadians(N,e.north,n,cDe),w=he.fromRadians(e.west,e.north,n,lDe),I=he.fromRadians(e.west,_,n,uDe),R=he.fromRadians(e.west,e.south,n,fDe),F=he.fromRadians(N,e.south,n,dDe),k=i.cartographicToCartesian(b,mDe),V=i.cartographicToCartesian(w,r$),G=i.cartographicToCartesian(I,hDe),U=i.cartographicToCartesian(R,s$),q=i.cartographicToCartesian(F,pDe),Y=L.projectPointToNearestOnPlane(k,_De),Q=L.projectPointToNearestOnPlane(V,gDe),W=L.projectPointToNearestOnPlane(G,yDe),K=L.projectPointToNearestOnPlane(U,ADe),J=L.projectPointToNearestOnPlane(q,xDe);return r=Math.min(Q.x,W.x,K.x),s=-r,c=Math.max(Q.y,Y.y),a=Math.min(K.y,J.y),w.height=R.height=t,V=i.cartographicToCartesian(w,r$),U=i.cartographicToCartesian(R,s$),u=Math.min(un.getPointDistance(d,V),un.getPointDistance(d,U)),f=n,i$(L.origin,L.xAxis,L.yAxis,L.zAxis,r,s,a,c,u,f,o)}let p=e.south>0,g=e.north<0,h=p?e.south:g?e.north:0,A=le.center(e,o$).longitude,x=m.fromRadians(A,h,n,i,CDe);x.z=0;let T=Math.abs(x.x) =c?$t.INSIDE:$t.INTERSECTING};var l$=new m,u$=new m,f$=new m,PDe=new m,a$=new m,ODe=new m;Ri.distanceSquaredTo=function(e,t){let n=m.subtract(t,e.center,c$),i=e.halfAxes,o=Z.getColumn(i,0,l$),r=Z.getColumn(i,1,u$),s=Z.getColumn(i,2,f$),a=m.magnitude(o),c=m.magnitude(r),u=m.magnitude(s),f=!0,d=!0,p=!0;a>0?m.divideByScalar(o,a,o):f=!1,c>0?m.divideByScalar(r,c,r):d=!1,u>0?m.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,h,A,x;if(g===1){let S=o;h=r,A=s,d?p||(S=s,A=o):(S=r,h=o),x=m.cross(h,A,a$),S===o?o=x:S===r?r=x:S===s&&(s=x)}else if(g===2){h=o,d?h=r:p&&(h=s);let S=m.UNIT_Y;S.equalsEpsilon(h,P.EPSILON3)&&(S=m.UNIT_X),A=m.cross(h,S,PDe),m.normalize(A,A),x=m.cross(h,A,a$),m.normalize(x,x),h===o?(r=A,s=x):h===r?(s=A,o=x):h===s&&(o=A,r=x)}else g===3&&(o=m.UNIT_X,r=m.UNIT_Y,s=m.UNIT_Z);let C=ODe;C.x=m.dot(n,o),C.y=m.dot(n,r),C.z=m.dot(n,s);let T=0,E;return C.x<-a?(E=C.x+a,T+=E*E):C.x>a&&(E=C.x-a,T+=E*E),C.y<-c?(E=C.y+c,T+=E*E):C.y>c&&(E=C.y-c,T+=E*E),C.z<-u?(E=C.z+u,T+=E*E):C.z>u&&(E=C.z-u,T+=E*E),T};var MDe=new m,RDe=new m;Ri.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Ac);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=Z.getColumn(a,0,l$),u=Z.getColumn(a,1,u$),f=Z.getColumn(a,2,f$),d=m.add(c,u,MDe);m.add(d,f,d),m.add(d,s,d);let p=m.subtract(d,t,RDe),g=m.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,d),m.add(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,d),m.subtract(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,d),m.subtract(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,d),m.add(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,d),m.add(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,d),m.subtract(d,u,d),m.add(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,d),m.subtract(d,u,d),m.subtract(d,f,d),m.subtract(d,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var BDe=new m,LDe=new m,NDe=new m;Ri.computeCorners=function(e,t){l(t)||(t=[new m,new m,new m,new m,new m,new m,new m,new m]);let n=e.center,i=e.halfAxes,o=Z.getColumn(i,0,BDe),r=Z.getColumn(i,1,LDe),s=Z.getColumn(i,2,NDe);return m.clone(n,t[0]),m.subtract(t[0],o,t[0]),m.subtract(t[0],r,t[0]),m.subtract(t[0],s,t[0]),m.clone(n,t[1]),m.subtract(t[1],o,t[1]),m.subtract(t[1],r,t[1]),m.add(t[1],s,t[1]),m.clone(n,t[2]),m.subtract(t[2],o,t[2]),m.add(t[2],r,t[2]),m.subtract(t[2],s,t[2]),m.clone(n,t[3]),m.subtract(t[3],o,t[3]),m.add(t[3],r,t[3]),m.add(t[3],s,t[3]),m.clone(n,t[4]),m.add(t[4],o,t[4]),m.subtract(t[4],r,t[4]),m.subtract(t[4],s,t[4]),m.clone(n,t[5]),m.add(t[5],o,t[5]),m.subtract(t[5],r,t[5]),m.add(t[5],s,t[5]),m.clone(n,t[6]),m.add(t[6],o,t[6]),m.add(t[6],r,t[6]),m.subtract(t[6],s,t[6]),m.clone(n,t[7]),m.add(t[7],o,t[7]),m.add(t[7],r,t[7]),m.add(t[7],s,t[7]),t};var FDe=new Z;Ri.computeTransformation=function(e,t){l(t)||(t=new B);let n=e.center,i=Z.multiplyByUniformScale(e.halfAxes,2,FDe);return B.fromRotationTranslation(i,n,t)};var UDe=new ae;Ri.isOccluded=function(e,t){let n=ae.fromOrientedBoundingBox(e,UDe);return!t.isBoundingSphereVisible(n)};Ri.prototype.intersectPlane=function(e){return Ri.intersectPlane(this,e)};Ri.prototype.distanceSquaredTo=function(e){return Ri.distanceSquaredTo(this,e)};Ri.prototype.computePlaneDistances=function(e,t,n){return Ri.computePlaneDistances(this,e,t,n)};Ri.prototype.computeCorners=function(e){return Ri.computeCorners(this,e)};Ri.prototype.computeTransformation=function(e){return Ri.computeTransformation(this,e)};Ri.prototype.isOccluded=function(e){return Ri.isOccluded(this,e)};Ri.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&Z.equals(e.halfAxes,t.halfAxes)};Ri.prototype.clone=function(e){return Ri.clone(this,e)};Ri.prototype.equals=function(e){return Ri.equals(this,e)};var Mn=Ri;var j3={};j3.getHeight=function(e,t,n){return(e-n)*t+n};var VDe=new m;j3.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,VDe),s=j3.getHeight(r.height,n,i);return m.fromRadians(r.longitude,r.latitude,s,t,o)};var Tc=j3;var VI=`in vec3 position3DHigh; +in vec3 position3DLow; +in float batchId; + +#ifdef EXTRUDED_GEOMETRY +in vec3 extrudeDirection; + +uniform float u_globeMinimumAltitude; +#endif // EXTRUDED_GEOMETRY + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif // PER_INSTANCE_COLOR + +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +out vec4 v_sphericalExtents; +#else // SPHERICAL +out vec2 v_inversePlaneExtents; +out vec4 v_westPlane; +out vec4 v_southPlane; +#endif // SPHERICAL +out vec3 v_uvMinAndSphericalLongitudeRotation; +out vec3 v_uMaxAndInverseDistance; +out vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES + +void main() +{ + vec4 position = czm_computePosition(); + +#ifdef EXTRUDED_GEOMETRY + float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); + delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; + + //extrudeDirection is zero for the top layer + position = position + vec4(extrudeDirection * delta, 0.0); +#endif + +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL + v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); + v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); +#else // SPHERICAL +#ifdef COLUMBUS_VIEW_2D + vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); + vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); + + // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w): + // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) + // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) + // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) + vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); + bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; + planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); + planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); + + // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) + // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) + // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) + idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; + idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); + planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); + planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); + + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; + vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; + vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; +#else // COLUMBUS_VIEW_2D + // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; + vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; + vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; +#endif // COLUMBUS_VIEW_2D + + vec3 eastWard = southEastCorner - southWestCorner; + float eastExtent = length(eastWard); + eastWard /= eastExtent; + + vec3 northWard = northWestCorner - southWestCorner; + float northExtent = length(northWard); + northWard /= northExtent; + + v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); + v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); + v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); +#endif // SPHERICAL + vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); + vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); + + v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); + v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); + v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; +#endif // TEXTURE_COORDINATES + +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#endif + + gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); +} +`;var ag=`#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 d$={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};d$.NUMBER_OF_CLASSIFICATION_TYPES=3;var zn=Object.freeze(d$);var kDe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},za=Object.freeze(kDe);function zDe(e,t){let n=[],i=e.length,o=0;for(;o>1^-(e&1)}yo.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a>11,f=c>>5&o,d=c&i,p=3*a;t[p]=u*r,t[p+1]=f*s,t[p+2]=d*r}return t};var jn=yo;var y$=new m,A$=new m,x$=new m;function tIe(e,t,n,i,o){l(o)||(o=new m);let r,s,a,c,u,f,d,p;if(l(t.z)){if(m.equalsEpsilon(e,t,P.EPSILON14))return m.clone(m.UNIT_X,o);if(m.equalsEpsilon(e,n,P.EPSILON14))return m.clone(m.UNIT_Y,o);if(m.equalsEpsilon(e,i,P.EPSILON14))return m.clone(m.UNIT_Z,o);r=m.subtract(n,t,y$),s=m.subtract(i,t,A$),a=m.subtract(e,t,x$),c=m.dot(r,r),u=m.dot(r,s),f=m.dot(r,a),d=m.dot(s,s),p=m.dot(s,a)}else{if(H.equalsEpsilon(e,t,P.EPSILON14))return m.clone(m.UNIT_X,o);if(H.equalsEpsilon(e,n,P.EPSILON14))return m.clone(m.UNIT_Y,o);if(H.equalsEpsilon(e,i,P.EPSILON14))return m.clone(m.UNIT_Z,o);r=H.subtract(n,t,y$),s=H.subtract(i,t,A$),a=H.subtract(e,t,x$),c=H.dot(r,r),u=H.dot(r,s),f=H.dot(r,a),d=H.dot(s,s),p=H.dot(s,a)}o.y=d*f-u*p,o.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var H0=tIe;var m8={};m8.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a n&&(n=c),++a,c=t[a]}let r=[];for(let a=0;a i&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};m8.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o;function r(_,b,w,I){for(;b.length>=1;){let R=b[b.length-1];if(b.splice(b.length-1,1),_[R].numLiveTriangles>0)return R}for(;o0)return++o,o-1;++o}return-1}function s(_,b,w,I,R,F,k){let V=-1,G,U=-1,q=0;for(;q U||U===-1)&&(U=G,V=Y)),++q}return V===-1?r(I,F,_,k):V}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g i&&(E.timeStamp=x,++x),++u}A=s(t,i,C,p,x,T,c)}return D};var GI=m8;var Ec={};function $3(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function nIe(e){let t=e.length,n=t/3*6,i=Ue.createTypedArray(t,n),o=0;for(let r=0;r =3){let n=(t-2)*6,i=Ue.createTypedArray(t,n);$3(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r 0){let t=e.length-1,n=(t-1)*6,i=Ue.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s o&&(o=n[r]);e.indices=GI.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function C$(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new ve({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function rIe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r =P.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=C$(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Le.TRIANGLES?u=3:e.primitiveType===Le.LINES?u=2:e.primitiveType===Le.POINTS&&(u=1);for(let f=0;f =P.SIXTY_FOUR_KILOBYTES&&(t.push(new ft({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=C$(e.attributes))}o.length!==0&&t.push(new ft({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var T$=new m,sIe=new he;Ec.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Si;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),u=0;for(let f=0;f x&&(x=T)}return new ft({attributes:f,indices:h,primitiveType:u,boundingSphere:l(A)?new ae(A,x):void 0})}Ec.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r0&&o.push(g8(t,"geometry")),n.length>0&&(o.push(g8(n,"westHemisphereGeometry")),o.push(g8(n,"eastHemisphereGeometry"))),o};var Yu=new m,WI=new m,dT=new m,mT=new m;Ec.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),u;for(u=0;u 0){for(f=0;f 3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o o?i>r?s=P.sign(e.y):s=P.sign(n.y):o>r?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;cg(e,a),cg(t,a),cg(n,a)}var w$=new m;function qu(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,w$),e.y/(e.y-t.y),w$),n),m.clone(n,i),cg(n,!0),cg(i,!1)}var G0=new m,W0=new m,j0=new m,Y0=new m,y8={positions:new Array(7),indices:new Array(3*3)};function AIe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;yIe(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=y8.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(qu(e,t,G0,j0),qu(e,n,W0,Y0),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(qu(t,n,G0,j0),qu(t,e,W0,Y0),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(qu(n,e,G0,j0),qu(n,t,W0,Y0),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||(qu(n,e,G0,j0),qu(n,t,W0,Y0),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(qu(t,n,G0,j0),qu(t,e,W0,Y0),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(qu(e,t,G0,j0),qu(e,n,W0,Y0),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=y8.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=G0,c[4]=W0,c[5]=j0,c[6]=Y0,c.length=7),y8}function v$(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=X.createTypedArray(r.componentDatatype,r.values)}let i=ft.computeNumberOfVertices(e);return e.indices=Ue.createTypedArray(i,e.indices),t&&(e.boundingSphere=ae.fromVertices(n.position.values)),e}function pT(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new ve({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new ft({attributes:n,indices:[],primitiveType:e.primitiveType})}function T8(e,t,n){let i=l(e.geometry.boundingSphere);t=v$(t,i),n=v$(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function E8(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,u,f,d,p){let g=e.fromArray(u,r*t,n),h=e.fromArray(u,s*t,i),A=e.fromArray(u,a*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(h,c.y,h),e.multiplyByScalar(A,c.z,A);let x=e.add(g,h,g);e.add(x,A,x),p&&e.normalize(x,x),e.pack(x,f,d*t)}}var xIe=E8(re,4),Q3=E8(m,3),R$=E8(H,2),CIe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[s]=a+c+u>P.EPSILON6?1:0},YI=new m,A8=new m,x8=new m,TIe=new m;function J3(e,t,n,i,o,r,s,a,c,u,f,d,p,g,h,A){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let x=m.fromArray(o,e*3,YI),C=m.fromArray(o,t*3,A8),T=m.fromArray(o,n*3,x8),E=H0(i,x,C,T,TIe);if(l(E)){if(l(r)&&Q3(e,t,n,E,r,d.normal.values,A,!0),l(u)){let S=m.fromArray(u,e*3,YI),v=m.fromArray(u,t*3,A8),D=m.fromArray(u,n*3,x8);m.multiplyByScalar(S,E.x,S),m.multiplyByScalar(v,E.y,v),m.multiplyByScalar(D,E.z,D);let O;!m.equals(S,m.ZERO)||!m.equals(v,m.ZERO)||!m.equals(D,m.ZERO)?(O=m.add(S,v,S),m.add(O,D,O),m.normalize(O,O)):(O=YI,O.x=0,O.y=0,O.z=0),m.pack(O,d.extrudeDirection.values,A*3)}if(l(f)&&CIe(e,t,n,E,f,d.applyOffset.values,A),l(s)&&Q3(e,t,n,E,s,d.tangent.values,A,!0),l(a)&&Q3(e,t,n,E,a,d.bitangent.values,A,!0),l(c)&&R$(e,t,n,E,c,d.st.values,A),g>0)for(let S=0;S 3){let I=w.positions,R=w.indices,F=R.length;for(let k=0;k 0)continue;let c=m.unpack(i,s,N$);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):m.pack(a,i,s));let u=m.unpack(o,s,C8);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3 0||ae.intersectPlane(n,un.ORIGIN_ZX_PLANE)!==$t.INTERSECTING))return e;if(t.geometryType!==Hu.NONE)switch(t.geometryType){case Hu.POLYLINES:MIe(e);break;case Hu.TRIANGLES:D$(e);break;case Hu.LINES:I$(e);break}else gIe(t),t.primitiveType===Le.TRIANGLES?D$(e):t.primitiveType===Le.LINES&&I$(e);return e};var Nn=Ec;function rl(e){this._ellipsoid=y(e,oe.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(rl.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});rl.mercatorAngleToGeodeticLatitude=function(e){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};rl.geodeticLatitudeToMercatorAngle=function(e){e>rl.MaximumLatitude?e=rl.MaximumLatitude:e<-rl.MaximumLatitude&&(e=-rl.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};rl.MaximumLatitude=rl.mercatorAngleToGeodeticLatitude(Math.PI);rl.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=rl.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};rl.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=rl.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var vi=rl;function RIe(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 c=e.length;for(let u=0;u r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function NIe(e,t){let n=[];return S8(e,"geometry",t,n),S8(e,"westHemisphereGeometry",t,n),S8(e,"eastHemisphereGeometry",t,n),n}var ip={};ip.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=LIe(e),t.length>0&&(n=Nn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=NIe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),u=new Array(o);for(let f=0;f 0&&(n.set(c.indices,s),s+=h)}return t.push(n.buffer),{stringTable:i,packedData:n}};ip.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s 0){let v=x.length/C;for(S=Ue.createTypedArray(v,A),i=0;i{t._completeLoad=(o,r,s)=>{this._error=s,this._state=r,o.afterRender.push(function(){if(t._ready=t._state===dr.COMPLETE||t._state===dr.FAILED,!l(s))return n(t),!0;i(s)})}}),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(mr.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Primitive.readyPromise","Primitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Primitive.ready to return true instead."),this._readyPromise}}});function GIe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],s=!0;for(let a=1;a = nearSq && distanceSq <= farSq) ? 1.0 : 0.0; + gl_Position *= show; +}`,`${i} +${o}`};function z$(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; +`;let h=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${h}); +`}n&&o&&r?(f+=`vec3 normal; +vec3 tangent; +vec3 bitangent; +`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); +`):(n&&(f+=`vec3 normal; +`,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); +`),o&&(f+=`vec3 tangent; +`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`),r&&(f+=`vec3 bitangent; +`,d+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=He.replaceMain(p,"czm_non_compressed_main");let g=`void main() +{ +${d} czm_non_compressed_main(); +}`;return[u,f,p,g].join(` +`)}function ZIe(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 QIe(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 H$(e,t){let n=e.vertexAttributes}function $Ie(e,t){return function(){return e[t]}}var w8=Math.max(Ht.hardwareConcurrency-1,1),eU,ePe=new hi("combineGeometry");function tPe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===dr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o0){let A=new Float64Array(d);for(h=[A.buffer],r=0;r 0?(e._recomputeBoundingSpheres=!0,e._state=dr.COMBINED):XI(e,t,dr.FAILED,void 0)}).catch(function(d){XI(e,t,dr.FAILED,d)})}}function nPe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a0?(e._recomputeBoundingSpheres=!0,e._state=dr.COMBINED):XI(e,t,dr.FAILED,void 0)}function iPe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i 0||ae.intersectPlane(A,un.ORIGIN_ZX_PLANE)!==$t.INTERSECTING?c.push(A):(u.push(A),f.push(A))}let d=c[0],p=f[0],g=u[0];for(i=1;i0){if(kt.maximumVertexTextureImageUnits===0)throw new de("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!==dr.COMPLETE&&this._state!==dr.COMBINED&&(this.asynchronous?tPe(this,e):nPe(this,e)),this._state===dr.COMBINED&&(oPe(this,e),W$(this,e),sPe(this,e)),!this.show||this._state!==dr.COMPLETE)return;this._batchTableOffsetsUpdated||W$(this,e),this._recomputeBoundingSpheres&&iPe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;o&&y(this._createRenderStatesFunction,aPe)(this,t,n,u),r&&y(this._createShaderProgramFunction,cPe)(this,e,n),(o||r)&&y(this._createCommandsFunction,lPe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,uPe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var fPe=new ae,dPe=new ae;function Q$(e,t,n){if(n===on.TOP){let i=ae.clone(e,fPe),o=ae.clone(e,dPe);o.center=m.add(o.center,t,o.center),e=ae.union(i,o,e)}else n===on.ALL&&(e.center=m.add(e.center,t,e.center));return e}function mPe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=X.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function hPe(e,t,n,i,o){return function(r){let s=X$(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var pPe=new m;function _Pe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&Q$(i,m.fromArray(r.get(),0,pPe),e._offsetInstanceExtend[n]),l(o)&&(i=ae.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function gPe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}mr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); + float useDownOrLeft = float(useUpOrRight == 0.0); + vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); + vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); + return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; +} +#endif // NORMAL_EC + +void main(void) +{ +#ifdef REQUIRES_EC + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +#endif + +#ifdef REQUIRES_WC + vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; + vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; +#endif + +#ifdef TEXTURE_COORDINATES + vec2 uv; +#ifdef SPHERICAL + // Treat world coords as a sphere normal for spherical coordinates + vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); + sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; + sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); + uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; + uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; +#else // SPHERICAL + // Unpack planes and transform to eye space + uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; + uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; +#endif // SPHERICAL +#endif // TEXTURE_COORDINATES + +#ifdef PICK +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + // Check for logDepthOrDepth != 0.0 to make sure this should be classified. + if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { + out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource + czm_writeDepthClamp(); + } +#else // CULL_FRAGMENTS + out_FragColor.a = 1.0; +#endif // CULL_FRAGMENTS +#else // PICK + +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { + discard; + } +#endif + +#ifdef NORMAL_EC + // Compute normal by sampling adjacent pixels in 2x2 block in screen space + vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); + vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); + vec3 normalEC = normalize(cross(leftRight, downUp)); +#endif + + +#ifdef PER_INSTANCE_COLOR + + vec4 color = czm_gammaCorrect(v_color); +#ifdef FLAT + out_FragColor = color; +#else // FLAT + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = -eyeCoordinate.xyz; + czm_material material = czm_getDefaultMaterial(materialInput); + material.diffuse = color.rgb; + material.alpha = color.a; + + out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT + + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; + +#else // PER_INSTANCE_COLOR + + // Material support. + // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or + // dependencies for culling but might not actually be used by the material. + + czm_materialInput materialInput; + +#ifdef USES_NORMAL_EC + materialInput.normalEC = normalEC; +#endif + +#ifdef USES_POSITION_TO_EYE_EC + materialInput.positionToEyeEC = -eyeCoordinate.xyz; +#endif + +#ifdef USES_TANGENT_TO_EYE + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); +#endif + +#ifdef USES_ST + // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired + // texture coordinate system, which typically forms a tight oriented bounding box around the geometry. + // Shader is provided a set of reference points for remapping. + materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; + materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; +#endif + + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else // FLAT + out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT + + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; + +#endif // PER_INSTANCE_COLOR + czm_writeDepthClamp(); +#endif // PICK +} +`;function Xu(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new D8;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new D8;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}Xu.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof 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,_T]})};Xu.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new He({defines:n,sources:[_T],pickColorQualifier:"in"})};Xu.prototype.createVertexShader=function(e,t,n,i){return see(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Xu.prototype.createPickVertexShader=function(e,t,n,i){return see(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var $$=new m,eee=new he,tee={high:0,low:0};function see(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=eee;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,$$),d=Wn.encode(f.x,tee);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=eee;p.longitude=-P.PI,p.latitude=0,p.height=0;let g=s.project(p,$$);d=Wn.encode(g.x,tee),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof rn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new He({defines:c,sources:[o]})}function D8(){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(D8.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 nee(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 APe=[new H,new H,new H,new H];function aee(e,t){let n=APe,i=H.unpack(t,0,n[0]),o=H.unpack(t,2,n[1]),r=H.unpack(t,4,n[2]);e.uMaxVmax=new Ha({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/nee(i,o,r),a=1/nee(i,r,o);e.uvMinAndExtents=new Ha({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var cee=new he,lee=new m,xPe=new m,CPe=new m,tU={high:0,low:0};function uee(e,t,n){let i=cee;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,lee);i.latitude=e.north;let r=t.project(i,xPe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,CPe),a=[0,0,0,0],c=[0,0,0,0],u=Wn.encode(o.x,tU);a[0]=u.high,c[0]=u.low,u=Wn.encode(o.y,tU),a[1]=u.high,c[1]=u.low,u=Wn.encode(r.y,tU),a[2]=u.high,c[2]=u.low,u=Wn.encode(s.x,tU),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Ha({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Ha({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var TPe=new B,EPe=new B,iee=new m,bPe=new he,SPe=[new he,new he,new he,new he,new he,new he,new he,new he];function wPe(e,t,n,i,o,r){let s=le.center(e,bPe);s.height=n;let a=he.toCartesian(s,t,iee),c=Rt.eastNorthUpToFixedFrame(a,t,TPe),u=B.inverse(c,EPe),f=e.west,d=e.east,p=e.north,g=e.south,h=SPe;h[0].latitude=g,h[0].longitude=f,h[1].latitude=p,h[1].longitude=f,h[2].latitude=p,h[2].longitude=d,h[3].latitude=g,h[3].longitude=d;let A=(f+d)*.5,x=(p+g)*.5;h[4].latitude=g,h[4].longitude=A,h[5].latitude=p,h[5].longitude=A,h[6].latitude=x,h[6].longitude=f,h[7].latitude=x,h[7].longitude=d;let C=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let M=0;M<8;M++){h[M].height=n;let L=he.toCartesian(h[M],t,iee);B.multiplyByPoint(u,L,L),L.z=0,C=Math.min(C,L.x),T=Math.max(T,L.x),E=Math.min(E,L.y),S=Math.max(S,L.y)}let v=i;v.x=C,v.y=E,v.z=0,B.multiplyByPoint(c,v,v);let D=o;D.x=T,D.y=E,D.z=0,B.multiplyByPoint(c,D,D),m.subtract(D,v,o);let O=r;O.x=C,O.y=S,O.z=0,B.multiplyByPoint(c,O,O),m.subtract(O,v,r)}var vPe=new m,DPe=new m,IPe=new Wn;Xu.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=lee,s=vPe,a=DPe;wPe(e,n,y(o,0),r,s,a);let c={};aee(c,t);let u=Wn.fromCartesian(r,IPe);return c.southWest_HIGH=new Ha({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(u.high,[0,0,0])}),c.southWest_LOW=new Ha({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(u.low,[0,0,0])}),c.eastward=new Ha({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(s,[0,0,0])}),c.northward=new Ha({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(a,[0,0,0])}),uee(e,i,c),c};var PPe=new m;function oee(e,t,n,i){let o=cee;o.latitude=e,o.longitude=t,o.height=0;let r=he.toCartesian(o,n,PPe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=P.fastApproximateAtan2(s,r.z),c=P.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var ree=new H;Xu.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=oee(e.south,e.west,n,ree),r=o.x,s=o.y,a=oee(e.north,e.east,n,ree),c=a.x,u=a.y,f=0;s>u&&(f=P.PI-s,s=-P.PI,u+=f),r-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,u+=P.EPSILON5;let d=1/(u-s),p=1/(c-r),g={sphericalExtents:new Ha({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,d]}),longitudeRotation:new Ha({componentDatatype:X.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return aee(g,t),uee(e,i,g),g};Xu.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Xu.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function OPe(e){return Math.max(e.width,e.height)>Xu.MAX_WIDTH_FOR_PLANAR_EXTENTS}Xu.shouldUseSphericalCoordinates=function(e){return OPe(e)};Xu.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var ql=Xu;var MPe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},Hn=Object.freeze(MPe);var RPe={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP},ht=Object.freeze(RPe);var nU={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};nU.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Hn.ALWAYS,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},backFunction:Hn.ALWAYS,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},reference:nU.CESIUM_3D_TILE_MASK,mask:nU.CESIUM_3D_TILE_MASK}};var Ft=Object.freeze(nU);function X0(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,zn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1;let n=this;this._readyPromise=new Promise((i,o)=>{n._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let r=this._error;l(r)?o(r):i(this)}}),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(X0.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("ClassificationPrimitive.readyPromise","ClassificationPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for ClassificationPrimitive.ready to return true instead."),this._readyPromise}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});X0.isSupported=function(e){return e.context.stencilBuffer};function gT(e,t){let n=t?Hn.EQUAL:Hn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:n,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:za.LESS_OR_EQUAL},depthMask:!1}}function P8(e){return{stencilTest:{enabled:e,frontFunction:Hn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Hn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND}}var BPe={stencilTest:{enabled:!0,frontFunction:Hn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Hn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function LPe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ze.fromCache(gT(o,!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(gT(o,!0)),e._rsColorPass=ze.fromCache(P8(o,!1)),e._rsPickPass=ze.fromCache(BPe)}function NPe(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 FPe(e,t){let n=t.context,i=e._primitive,o=VI;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=wn._appendDistanceDisplayConditionToShader(i,o),o=wn._modifyShaderPosition(e,o,t.scene3DOnly),o=wn._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=NPe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new He({defines:[a],sources:[o]}),u=new He({sources:[ag]}),f=e._primitive._attributeLocations,d=new ql(s,r,e.appearance);if(e._spStencil=Kt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let h=He.createPickVertexShaderSource(o);h=wn._appendShowToShader(i,h),h=wn._updatePickColorAttribute(h);let A=d.createPickFragmentShader(!1),x=d.createPickVertexShader([a],h,!1,t.mapProjection);if(e._spPick=Kt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:x,fragmentShaderSource:A,attributeLocations:f}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let T=d.createPickFragmentShader(!0),E=d.createPickVertexShader([a],h,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:E,fragmentShaderSource:T,attributeLocations:f})}e._spPick2D=C}}else e._spPick=Kt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});o=wn._appendShowToShader(i,o),c=new He({defines:[a],sources:[o]}),e._sp=Kt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=Kt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let h=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(h)){let A=d.createFragmentShader(!0),x=d.createVertexShader([a],o,!0,t.mapProjection);h=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:x,fragmentShaderSource:A,attributeLocations:f})}e._spColor2D=h}}function UPe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o0&&(c=o[0].attributes,p=ql.hasAttributesForSphericalExtents(c),g=ql.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s {l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};X0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};X0.prototype.isDestroyed=function(){return!1};X0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var yT=X0;var HPe={u_globeMinimumAltitude:function(){return 55e3}};function sl(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let r=Array.isArray(n)?n:[n],s=r.length;for(let a=0;a {i._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let a=this._error;l(a)?s(a):r(this)}}),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=ri._defaultMaxTerrainHeight,this._minTerrainHeight=ri._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let o=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:o,_extruded:!0,_uniformMap:HPe}}Object.defineProperties(sl.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("GroundPrimitive.readyPromise","GroundPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPrimitive.ready to return true instead."),this._readyPromise}}});sl.isSupported=yT.isSupported;function mee(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function hee(e){return function(t,n){return e._minHeight}}var GPe=new m,WPe=new m,jPe=new m,YPe=new he,qPe=new le;function iU(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d{!this._ready&&l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};sl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};sl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};sl.prototype.isDestroyed=function(){return!1};sl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};sl._supportsMaterials=function(e){return e.depthTexture};sl.supportsMaterials=function(e){return sl._supportsMaterials(e.frameState.context)};var bc=sl;function AT(){fe.throwInstantiationError()}Object.defineProperties(AT.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});AT.prototype.getType=fe.throwInstantiationError;AT.prototype.getValue=fe.throwInstantiationError;AT.prototype.equals=fe.throwInstantiationError;AT.getValue=function(e,t,n){let i;return l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=ki.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==ki.ColorType)&&(n=ki.fromType(ki.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var jo=AT;function K0(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}K0.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!j.getValueOrDefault(t.show,n,!0)};K0.prototype._setOptions=fe.throwInstantiationError;K0.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Ut,d,p=t._getIsClosed(c);if(f)d=new rn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=jo.getValue(e,u,this._material);this._material=g,d=new ro({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=rn.VERTEX_FORMAT,this._primitive=o.add(new bc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),j.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new wn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=j.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new wn({geometryInstances:u,appearance:new rn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};K0.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),ut.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),ut.DONE):l(n)&&!n.ready||l(i)&&!i.ready?ut.PENDING:ut.FAILED};K0.prototype.isDestroyed=function(){return!1};K0.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var si=K0;var ZPe={NONE:0,GEODESIC:1,RHUMB:2},Jt=Object.freeze(ZPe);var _ee=P.EPSILON10;function QPe(e,t,n,i){if(!l(e))return;n=y(n,!1);let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s P.EPSILON12);let b=N*(t*t-n*n)/(n*n),w=1+b*(4096+b*(b*(320-175*b)-768))/16384,I=b*(256+b*(b*(74-47*b)-128))/1024,R=_*_,F=I*L*(_+I*(M*(2*R-1)-I*_*(4*L*L-3)*(4*R-3)/6)/4),k=n*w*(O-F),V=Math.atan2(g*D,x-T*v),G=Math.atan2(d*D,x*v-T);e._distance=k,e._startHeading=V,e._endHeading=G,e._uSquared=b}var n1e=new m,R8=new m;function yee(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,R8),n1e),r=m.normalize(i.cartographicToCartesian(n,R8),R8);t1e(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,$Pe(e)}function KI(e,t,n){let i=y(n,oe.WGS84);this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&yee(this,e,t,i)}Object.defineProperties(KI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});KI.prototype.setEndPoints=function(e,t){yee(this,e,t,this._ellipsoid)};KI.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};KI.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,h=n.u2Over4,A=n.u6Over64,x=n.u4Over16,C=2*p*g*o/3+i*(1-h+7*x/4-15*A/4+579*g/64-(x-15*A/4+187*g/16)*o-(5*A/4-115*g/16)*r-29*g*s/16)+(h/2-x+71*A/32-85*g/16)*a+(5*x/16-5*A/4+383*g/96)*c-d*((A-11*g/2)*a+5*g*c/2)+(29*A/96-29*g/16)*u+539*g*f/1536,T=Math.asin(Math.sin(C)*n.cosineAlpha),E=Math.atan(n.a/n.b*Math.tan(T));C=C-n.sigma;let S=Math.cos(2*n.sigma+C),v=Math.sin(C),D=Math.cos(C),O=n.cosineU*D,M=n.sineU*v,N=Math.atan2(v*n.sineHeading,O-M*n.cosineHeading)-gee(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,v,D,S);return l(t)?(t.longitude=this._start.longitude+N,t.latitude=E,t.height=0,t):new he(this._start.longitude+N,E,0)};var Ku=KI;function L8(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),h=Math.sin(10*u),A=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*h+1001*c/8388608*A)}function i1e(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,h=Math.sin(2*i),A=Math.cos(2*i),x=Math.sin(4*i),C=Math.cos(4*i),T=Math.sin(6*i),E=Math.cos(6*i),S=Math.sin(8*i),v=Math.cos(8*i),D=Math.sin(10*i),O=Math.cos(10*i),M=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*d/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*A+(21*i*f/256+483*i*d/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*C+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*E+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*O+(3*c/8+3*u/16+213*f/2048-3*o*f/64+255*d/4096-33*o*d/512+20861*p/524288-33*o*p/512+s*p/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*h+(21*u/256+21*f/256+533*d/8192-21*o*d/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*x+(151*f/6144+151*d/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*T+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*S+(8011*p/2621440+8011*g/1048576)*D+293393*g/251658240*M}function xT(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function o1e(e,t,n,i,o){let r=xT(e._ellipticity,n),s=xT(e._ellipticity,o);return Math.atan2(P.negativePiToPi(i-t),s-r)}function r1e(e,t,n,i,o,r,s){let a=e._heading,c=r-i,u=0;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)u=t*Math.cos(o)*P.negativePiToPi(c);else{let f=Math.sin(o);u=t*Math.cos(o)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=L8(e._ellipticity,t,o);u=(L8(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var s1e=new m,B8=new m;function Aee(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,B8),s1e),r=m.normalize(i.cartographicToCartesian(n,B8),B8),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=o1e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=r1e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function xee(e,t,n,i,o,r){if(n===0)return he.clone(e,r);let s=o*o,a,c,u;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=L8(o,i,e.latitude),d=n*Math.cos(t),p=f+d;c=i1e(p,o,i);let g=xT(o,e.latitude),h=xT(o,c);u=Math.tan(t)*(h-g),a=P.negativePiToPi(e.longitude+u)}else{c=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=P.negativePiToPi(e.longitude+u):a=P.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new he(a,c,0)}function op(e,t,n){let i=y(n,oe.WGS84);this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Aee(this,e,t,i)}Object.defineProperties(op.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});op.fromStartHeadingDistance=function(e,t,n,i,o){let r=y(i,oe.WGS84),s=r.maximumRadius,a=r.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=P.negativePiToPi(t);let d=xee(e,t,n,r.maximumRadius,f);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new op(e,d,r):(o.setEndPoints(e,d),o)};op.prototype.setEndPoints=function(e,t){Aee(this,e,t,this._ellipsoid)};op.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};op.prototype.interpolateUsingSurfaceDistance=function(e,t){return xee(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};op.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(r.longitude)*Math.PI),l(t)||(t=new he),Math.abs(P.PI_OVER_TWO-o)<=P.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-o),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,r.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,d,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};op.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let r=xT(n,o.latitude),s=xT(n,e),a=Math.tan(i)*(s-r),c=P.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var pa=op;var G8=[Si,vi],a1e=G8.length,kee=Math.cos(P.toRadians(30)),Cee=Math.cos(P.toRadians(150)),zee=0,Hee=1e3;function ug(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,Jt.GEODESIC),this._ellipsoid=oe.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(ug.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+oe.packedLength+1+1}}});ug.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i kee||r P.PI_OVER_TWO&&(a=!0,s=m.subtract(r,n,Iee),u=c.cartesianToCartographic(s,Dee)),u.height=0;let f=e.project(u,o);return o=m.subtract(f,i,o),o.z=0,o=m.normalize(o,o),a&&m.negate(o,o),o}var v1e=new m,Pee=new m;function Oee(e,t,n,i,o,r){let s=m.subtract(t,e,v1e);m.normalize(s,s);let a=n-zee,c=m.multiplyByScalar(s,a,Pee);m.add(e,c,o);let u=i-Hee;c=m.multiplyByScalar(s,u,Pee),m.add(t,c,r)}var D1e=new m;function sU(e,t){let n=un.getPointDistance(aU,e),i=un.getPointDistance(aU,t),o=D1e;P.equalsEpsilon(n,0,P.EPSILON2)?(o=rp(t,e,o),m.multiplyByScalar(o,P.EPSILON2,o),m.add(e,o,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(o=rp(e,t,o),m.multiplyByScalar(o,P.EPSILON2,o),m.add(t,o,t))}function I1e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let o=P.sign(t.longitude);return e.longitude=o*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let o=P.sign(e.longitude);return t.longitude=o*(i-P.EPSILON11),2}return 0}var Wee=new he,jee=new he,Mee=new m,V8=new m,Ree=new m,Bee=new m,P1e=new m,Lee=new m,O1e=[Wee,jee],M1e=new le,R1e=new m,B1e=new m,L1e=new m,N1e=new m,F1e=new m,U1e=new m,k8=new m,z8=new m,V1e=new m,k1e=new m,z1e=new m,Nee=new m,H1e=new m,G1e=new m,W1e=new Wn,j1e=new Wn,Fee=new m,Y1e=new m,Uee=new m,q1e=[new ae,new ae],Yee=[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],Vee=Yee.length;function X1e(e,t,n,i,o,r,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,h=d>65535?new Uint32Array(g):new Uint16Array(g),A=new Float64Array(d*3),x=new Float32Array(p),C=new Float32Array(p),T=new Float32Array(p),E=new Float32Array(p),S=new Float32Array(p),v,D,O,M;s&&(v=new Float32Array(p),D=new Float32Array(p),O=new Float32Array(p),M=new Float32Array(d*2));let L=r.length/2,N=0,_=Wee;_.height=0;let b=jee;b.height=0;let w=Mee,I=V8;if(s)for(c=0,a=1;a kee?(pt=JI(t,_,Re,ke,k8),rt=JI(t,b,K,dt,z8)):Wi===1?(rt=JI(t,b,K,dt,z8),pt.x=0,pt.y=P.sign(_.longitude-Math.abs(b.longitude)),pt.z=0):(pt=JI(t,_,Re,ke,k8),rt.x=0,rt.y=P.sign(_.longitude-b.longitude),rt.z=0)}let fn=m.distance(Ve,W),Bn=Wn.fromCartesian(Ie,W1e),jt=m.subtract(Q,Ie,V1e),Ze=m.normalize(jt,Nee),pe=m.subtract(Ve,Ie,k1e);pe=m.normalize(pe,pe);let Ee=m.cross(Ze,pe,Nee);Ee=m.normalize(Ee,Ee);let je=m.cross(pe,Re,H1e);je=m.normalize(je,je);let fi=m.subtract(W,Q,z1e);fi=m.normalize(fi,fi);let Ai=m.cross(K,fi,G1e);Ai=m.normalize(Ai,Ai);let er=fn/F,Fs=J/F,Us=0,Br,Mo,Be,st=0,Qe=0;if(s){Us=m.distance(ke,dt),Br=Wn.fromCartesian(ke,j1e),Mo=m.subtract(dt,ke,Fee),Be=m.normalize(Mo,Y1e);let Wi=Be.x;Be.x=Be.y,Be.y=-Wi,st=Us/N,Qe=_e/N}for(k=0;k<8;k++){let Wi=q+k*4,Wr=G+k*2,Un=Wi+3,ln=k<4?1:-1,Xn=k===2||k===3||k===6||k===7?1:-1;m.pack(Bn.high,x,Wi),x[Un]=jt.x,m.pack(Bn.low,C,Wi),C[Un]=jt.y,m.pack(je,T,Wi),T[Un]=jt.z,m.pack(Ai,E,Wi),E[Un]=er*ln,m.pack(Ee,S,Wi);let gn=Fs*Xn;gn===0&&Xn<0&&(gn=9),S[Un]=gn,s&&(v[Wi]=Br.high.x,v[Wi+1]=Br.high.y,v[Wi+2]=Br.low.x,v[Wi+3]=Br.low.y,O[Wi]=-pt.y,O[Wi+1]=pt.x,O[Wi+2]=rt.y,O[Wi+3]=-rt.x,D[Wi]=Mo.x,D[Wi+1]=Mo.y,D[Wi+2]=Be.x,D[Wi+3]=Be.y,M[Wr]=st*ln,gn=Qe*Xn,gn===0&&Xn<0&&(gn=9),M[Wr+1]=gn)}let $e=L1e,yt=N1e,zt=R1e,an=B1e,Ji=le.fromCartographicArray(O1e,M1e),go=ri.getMinimumMaximumHeights(Ji,u),$r=go.minimumTerrainHeight,es=go.maximumTerrainHeight;xe+=$r,xe+=es,Oee(Ie,Ve,$r,es,$e,zt),Oee(Q,W,$r,es,yt,an);let ar=m.multiplyByScalar(Ee,P.EPSILON5,Uee);m.add($e,ar,$e),m.add(yt,ar,yt),m.add(zt,ar,zt),m.add(an,ar,an),sU($e,yt),sU(zt,an),m.pack($e,A,U),m.pack(yt,A,U+3),m.pack(an,A,U+6),m.pack(zt,A,U+9),ar=m.multiplyByScalar(Ee,-2*P.EPSILON5,Uee),m.add($e,ar,$e),m.add(yt,ar,yt),m.add(zt,ar,zt),m.add(an,ar,an),sU($e,yt),sU(zt,an),m.pack($e,A,U+12),m.pack(yt,A,U+15),m.pack(an,A,U+18),m.pack(zt,A,U+21),V+=2,c+=3,G+=16,U+=24,q+=32,J+=fn,_e+=Us}c=0;let se=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 + } + + // Check distance of the eye coordinate against start and end planes with normals in the right plane. + // For computing unskewed lengthwise texture coordinate. + // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking. + + // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward" + vec3 alignedPlaneNormal; + + // start aligned plane + alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); + alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); + distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); + + // end aligned plane + alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); + alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); + distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); + +#ifdef PER_INSTANCE_COLOR + out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR + // Clamp - distance to aligned planes may be negative due to mitering, + // so fragment texture coordinate might be out-of-bounds. + float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); + s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; + float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); + + czm_materialInput materialInput; + + materialInput.s = s; + materialInput.st = vec2(s, t); + materialInput.str = vec3(s, t, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR + + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; + + czm_writeDepthClamp(); +} +`;var QI=`in vec3 v_forwardDirectionEC; +in vec3 v_texcoordNormalizationAndHalfWidth; +in float v_batchId; + +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#else +in vec2 v_alignedPlaneDistances; +in float v_texcoordT; +#endif + +float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { + // We don't expect the ray to ever be parallel to the plane + return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); +} + +void main(void) +{ + vec4 eyeCoordinate = gl_FragCoord; + eyeCoordinate /= eyeCoordinate.w; + +#ifdef PER_INSTANCE_COLOR + out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR + // Use distances for planes aligned with segment to prevent skew in dashing + float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); + float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); + + // Clamp - distance to aligned planes may be negative due to mitering + distanceFromStart = max(0.0, distanceFromStart); + distanceFromEnd = max(0.0, distanceFromEnd); + + float s = distanceFromStart / (distanceFromStart + distanceFromEnd); + s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; + + czm_materialInput materialInput; + + materialInput.s = s; + materialInput.st = vec2(s, v_texcoordT); + materialInput.str = vec3(s, v_texcoordT, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR +} +`;var $I=`in vec3 position3DHigh; +in vec3 position3DLow; + +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; + +in float batchId; + +out vec3 v_forwardDirectionEC; +out vec3 v_texcoordNormalizationAndHalfWidth; +out float v_batchId; + +// For materials +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#else +out vec2 v_alignedPlaneDistances; +out float v_texcoordT; +#endif + +// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume. +// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient. +void main() +{ + v_batchId = batchId; + + // Start position + vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); + vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); + vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); + vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; + vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; + vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; + + // Start plane + vec4 startPlane2D; + vec4 startPlane3D; + startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); + startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; + startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); + startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); + + // Right plane + vec4 rightPlane2D; + vec4 rightPlane3D; + rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); + rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; + rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); + rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); + + // End position + posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); + posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); + posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); + posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; + posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; + vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; + vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); + vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); + + // End plane + vec4 endPlane2D; + vec4 endPlane3D; + endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); + endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; + endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); + endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); + + // Forward direction + v_forwardDirectionEC = normalize(endEC - startEC); + + vec2 cleanTexcoordNormalization2D; + cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); + cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); + vec2 cleanTexcoordNormalization3D; + cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); + cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; + cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); + + v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); + +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#else // PER_INSTANCE_COLOR + // For computing texture coordinates + + v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); + v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); +#endif // PER_INSTANCE_COLOR + +#ifdef WIDTH_VARYING + float width = czm_batchTable_width(batchId); + float halfWidth = width * 0.5; + v_width = width; + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#else + float halfWidth = 0.5 * czm_batchTable_width(batchId); + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#endif + + // Compute a normal along which to "push" the position out, extending the miter depending on view distance. + // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. + // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. + // Since this is morphing, compute both 3D and 2D positions and then blend. + + // ****** 3D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition + float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); + float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); + vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); + vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + + // Nudge the top vertex upwards to prevent flickering + vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); + geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc3D.xyz += geodeticSurfaceNormal; + + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); + + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) + + // ****** 2D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition + absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); + absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); + planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); + upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + + // Nudge the top vertex upwards to prevent flickering + geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); + geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc2D.xyz += geodeticSurfaceNormal; + + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(texcoordNormalization2D.x); +#ifndef PER_INSTANCE_COLOR + // Use vertex's sidedness to compute its texture coordinate. + v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); +#endif + + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) + + // Blend for actual position + gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); + +#ifdef ANGLE_VARYING + // Approximate relative screen space direction of the line. + vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); + approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); + v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif +} +`;var eP=`in vec3 position3DHigh; +in vec3 position3DLow; + +// In 2D and in 3D, texture coordinate normalization component signs encodes: +// * X sign - sidedness relative to right plane +// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume +#ifndef COLUMBUS_VIEW_2D +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +#else +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; +#endif + +in float batchId; + +out vec4 v_startPlaneNormalEcAndHalfWidth; +out vec4 v_endPlaneNormalEcAndBatchId; +out vec4 v_rightPlaneEC; +out vec4 v_endEcAndStartEcX; +out vec4 v_texcoordNormalizationAndStartEcYZ; + +// For materials +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif + +void main() +{ +#ifdef COLUMBUS_VIEW_2D + vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; + + vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); + vec3 ecEnd = forwardDirectionEC + ecStart; + forwardDirectionEC = normalize(forwardDirectionEC); + + // Right plane + v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); + v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); + + // start plane + vec4 startPlaneEC; + startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); + startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); + + // end plane + vec4 endPlaneEC; + endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); + endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); + + v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); + v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; + +#else // COLUMBUS_VIEW_2D + vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; + vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); + vec3 ecEnd = ecStart + offset; + + vec3 forwardDirectionEC = normalize(offset); + + // start plane + vec4 startPlaneEC; + startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; + startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); + + // end plane + vec4 endPlaneEC; + endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; + endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); + + // Right plane + v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; + v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); + + v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); + v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; + +#endif // COLUMBUS_VIEW_2D + + v_endEcAndStartEcX.xyz = ecEnd; + v_endEcAndStartEcX.w = ecStart.x; + v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; + +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#endif // PER_INSTANCE_COLOR + + // Compute a normal along which to "push" the position out, extending the miter depending on view distance. + // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. + // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. + vec4 positionRelativeToEye = czm_computePosition(); + + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition + float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); + float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); + vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); + vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + + // Extrude bottom vertices downward for far view distances, like for GroundPrimitives + upOrDown = cross(forwardDirectionEC, normalEC); + upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; + upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; + upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; + positionEC.xyz += upOrDown; + + v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); + + // Determine distance along normalEC to push for a volume of appropriate width. + // Make volumes about double pixel width for a conservative fit - in practice the + // extra cost here is minimal compared to the loose volume heights. + // + // N = normalEC (guaranteed "right-facing") + // R = rightEC + // p = angle between N and R + // w = distance to push along R if R == N + // d = distance to push along N + // + // N R + // { p| } * cos(p) = dot(N, R) = w / d + // d | |w * d = w / dot(N, R) + // { | } + // o---------- polyline segment ----> + // + float width = czm_batchTable_width(batchId); +#ifdef WIDTH_VARYING + v_width = width; +#endif + + v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; + v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; + + v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; + v_endPlaneNormalEcAndBatchId.w = batchId; + + width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R + width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N + + // Determine if this vertex is on the "left" or "right" +#ifdef COLUMBUS_VIEW_2D + normalEC *= sign(texcoordNormalization2D.x); +#else + normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +#endif + + positionEC.xyz += width * normalEC; + gl_Position = czm_depthClamp(czm_projection * positionEC); + +#ifdef ANGLE_VARYING + // Approximate relative screen space direction of the line. + vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); + approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); + v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif +} +`;var tP=`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 Xl=`void clipLineSegmentToNearPlane( + vec3 p0, + vec3 p1, + out vec4 positionWC, + out bool clipped, + out bool culledByNearPlane, + out vec4 clippedPositionEC) +{ + culledByNearPlane = false; + clipped = false; + + vec3 p0ToP1 = p1 - p0; + float magnitude = length(p0ToP1); + vec3 direction = normalize(p0ToP1); + + // Distance that p0 is behind the near plane. Negative means p0 is + // in front of the near plane. + float endPoint0Distance = czm_currentFrustum.x + p0.z; + + // Camera looks down -Z. + // When moving a point along +Z: LESS VISIBLE + // * Points in front of the camera move closer to the camera. + // * Points behind the camrea move farther away from the camera. + // When moving a point along -Z: MORE VISIBLE + // * Points in front of the camera move farther away from the camera. + // * Points behind the camera move closer to the camera. + + // Positive denominator: -Z, becoming more visible + // Negative denominator: +Z, becoming less visible + // Nearly zero: parallel to near plane + float denominator = -direction.z; + + if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) + { + // p0 is behind the near plane and the line to p1 is nearly parallel to + // the near plane, so cull the segment completely. + culledByNearPlane = true; + } + else if (endPoint0Distance > 0.0) + { + // p0 is behind the near plane, and the line to p1 is moving distinctly + // toward or away from it. + + // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) + float t = endPoint0Distance / denominator; + if (t < 0.0 || t > magnitude) + { + // Near plane intersection is not between the two points. + // We already confirmed p0 is behind the naer plane, so now + // we know the entire segment is behind it. + culledByNearPlane = true; + } + else + { + // Segment crosses the near plane, update p0 to lie exactly on it. + p0 = p0 + t * direction; + + // Numerical noise might put us a bit on the wrong side of the near plane. + // Don't let that happen. + p0.z = min(p0.z, -czm_currentFrustum.x); + + clipped = true; + } + } + + clippedPositionEC = vec4(p0, 1.0); + positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); +} + +vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) +{ + // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. + +#ifdef POLYLINE_DASH + // Compute the window coordinates of the points. + vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); + vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); + vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); + + // Determine the relative screen space direction of the line. + vec2 lineDir; + if (usePrevious) { + lineDir = normalize(positionWindow.xy - previousWindow.xy); + } + else { + lineDir = normalize(nextWindow.xy - positionWindow.xy); + } + angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) + + // Quantize the angle so it doesn't change rapidly between segments. + angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; +#endif + + vec4 clippedPrevWC, clippedPrevEC; + bool prevSegmentClipped, prevSegmentCulled; + clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); + + vec4 clippedNextWC, clippedNextEC; + bool nextSegmentClipped, nextSegmentCulled; + clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); + + bool segmentClipped, segmentCulled; + vec4 clippedPositionWC, clippedPositionEC; + clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); + + if (segmentCulled) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } + + vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); + vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); + + // If a segment was culled, we can't use the corresponding direction + // computed above. We should never see both of these be true without + // \`segmentCulled\` above also being true. + if (prevSegmentCulled) + { + directionToPrevWC = -directionToNextWC; + } + else if (nextSegmentCulled) + { + directionToNextWC = -directionToPrevWC; + } + + vec2 thisSegmentForwardWC, otherSegmentForwardWC; + if (usePrevious) + { + thisSegmentForwardWC = -directionToPrevWC; + otherSegmentForwardWC = directionToNextWC; + } + else + { + thisSegmentForwardWC = directionToNextWC; + otherSegmentForwardWC = -directionToPrevWC; + } + + vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); + + vec2 leftWC = thisSegmentLeftWC; + float expandWidth = width * 0.5; + + // When lines are split at the anti-meridian, the position may be at the + // same location as the next or previous position, and we need to handle + // that to avoid producing NaNs. + if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) + { + vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); + + vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; + float leftSumLength = length(leftSumWC); + leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); + + // The sine of the angle between the two vectors is given by the formula + // |a x b| = |a||b|sin(theta) + // which is + // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); + // Because the z components of both vectors are zero, the x and y coordinate will be zero. + // Therefore, the sine of the angle is just the z component of the cross product. + vec2 u = -thisSegmentForwardWC; + vec2 v = leftWC; + float sinAngle = abs(u.x * v.y - u.y * v.x); + expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); + } + + vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; + return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; +} + +vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) +{ + vec4 positionEC = czm_modelViewRelativeToEye * position; + vec4 prevEC = czm_modelViewRelativeToEye * previous; + vec4 nextEC = czm_modelViewRelativeToEye * next; + return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); +} +`;var W8=`${Xl} +${tP}`,K1e=U0;Ht.isInternetExplorer()||(W8=`#define CLIP_POLYLINE +${W8}`);function Z0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Z0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,W8),this._fragmentShaderSource=y(e.fragmentShaderSource,K1e),this._renderState=eo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Z0.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}}});Z0.VERTEX_FORMAT=Pe.POSITION_ONLY;Z0.prototype.getFragmentShaderSource=eo.prototype.getFragmentShaderSource;Z0.prototype.isTranslucent=eo.prototype.isTranslucent;Z0.prototype.getRenderState=eo.prototype.getRenderState;var Fr=Z0;var nP=`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 Q0=`#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 j8=`${Xl} +${nP}`,J1e=Q0;Ht.isInternetExplorer()||(j8=`#define CLIP_POLYLINE +${j8}`);function $0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=$0.VERTEX_FORMAT;this.material=l(e.material)?e.material:ki.fromType(ki.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,j8),this._fragmentShaderSource=y(e.fragmentShaderSource,J1e),this._renderState=eo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties($0.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}}});$0.VERTEX_FORMAT=Pe.POSITION_AND_ST;$0.prototype.getFragmentShaderSource=eo.prototype.getFragmentShaderSource;$0.prototype.isTranslucent=eo.prototype.isTranslucent;$0.prototype.getRenderState=eo.prototype.getRenderState;var js=$0;function sp(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new js),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,zn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;let n=this;this._readyPromise=new Promise((i,o)=>{n._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let r=this._error;l(r)?o(r):i(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=qee(!1),this._renderState3DTiles=qee(!0),this._renderStateMorph=ze.fromCache({cull:{enabled:!0,face:_i.FRONT},depthTest:{enabled:!0},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(sp.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});sp.initializeTerrainHeights=function(){return ri.initialize()};function Z1e(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(eP);s=wn._appendShowToShader(o,s),s=wn._appendDistanceDisplayConditionToShader(o,s),s=wn._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()($I);a=wn._appendShowToShader(o,a),a=wn._appendDistanceDisplayConditionToShader(o,a),a=wn._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(ZI),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.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]}),h=new He({defines:p,sources:[d,c]});e._sp=Kt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:h,attributeLocations:r});let A=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(A)){let C=new He({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:h,attributeLocations:r})}e._sp2D=A;let x=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(x)){let C=new He({defines:u.concat([`MAX_TERRAIN_HEIGHT ${ri._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(QI);let T=new He({defines:p,sources:[d,c]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:T,attributeLocations:r})}e._spMorph=x}function qee(e){return ze.fromCache({cull:{enabled:!0},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Hn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Hn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK}})}function Q1e(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof Fr?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d{!this._ready&&l(this._primitive)&&this._primitive.ready&&this._completeLoad()})};sp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};sp.isSupported=function(e){return e.frameState.context.depthTexture};sp.prototype.isDestroyed=function(){return!1};sp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var ad=sp;var eOe=new H(1,1),tOe=!1,nOe=z.WHITE;function CT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new ge,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(CT.prototype,{isConstant:{get:function(){return j.isConstant(this._image)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:ce("image"),repeat:ce("repeat"),color:ce("color"),transparent:ce("transparent")});CT.prototype.getType=function(e){return"Image"};CT.prototype.getValue=function(e,t){return l(t)||(t={}),t.image=j.getValueOrUndefined(this._image,e),t.repeat=j.getValueOrClonedDefault(this._repeat,e,eOe,t.repeat),t.color=j.getValueOrClonedDefault(this._color,e,nOe,t.color),j.getValueOrDefault(this._transparent,e,tOe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};CT.prototype.equals=function(e){return this===e||e instanceof CT&&j.equals(this._image,e._image)&&j.equals(this._repeat,e._repeat)&&j.equals(this._color,e._color)&&j.equals(this._transparent,e._transparent)};var fg=CT;function iOe(e){if(e instanceof z)return new Ut(e);if(typeof e=="string"||e instanceof we||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new fg;return t.image=e,t}}function oOe(e,t){return ce(e,t,iOe)}var vo=oOe;function iP(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(iP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ce("show"),dimensions:ce("dimensions"),heightReference:ce("heightReference"),fill:ce("fill"),material:vo("material"),outline:ce("outline"),outlineColor:ce("outlineColor"),outlineWidth:ce("outlineWidth"),shadows:ce("shadows"),distanceDisplayCondition:ce("distanceDisplayCondition")});iP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new iP(this)};iP.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var eA=iP;var rOe={FIXED:0,INERTIAL:1},no=Object.freeze(rOe);function TT(){fe.throwInstantiationError()}Object.defineProperties(TT.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError},referenceFrame:{get:fe.throwInstantiationError}});TT.prototype.getValue=fe.throwInstantiationError;TT.prototype.getValueInReferenceFrame=fe.throwInstantiationError;TT.prototype.equals=fe.throwInstantiationError;var Y8=new Z;TT.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new m),n===i)return m.clone(t,o);let r=Rt.computeIcrfToFixedMatrix(e,Y8);if(l(r)||(r=Rt.computeTemeToPseudoFixedMatrix(e,Y8)),n===no.INERTIAL)return Z.multiplyByVector(r,t,o);if(n===no.FIXED)return Z.multiplyByVector(Z.transpose(r,Y8),t,o)};var ap=TT;function tA(e,t){this._definitionChanged=new ge,this._value=m.clone(e),this._referenceFrame=y(t,no.FIXED)}Object.defineProperties(tA.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===no.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});tA.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,no.FIXED,t)};tA.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};tA.prototype.getValueInReferenceFrame=function(e,t,n){return ap.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};tA.prototype.equals=function(e){return this===e||e instanceof tA&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var wc=tA;function oP(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(oP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ce("show"),positions:ce("positions"),width:ce("width"),height:ce("height"),heightReference:ce("heightReference"),extrudedHeight:ce("extrudedHeight"),extrudedHeightReference:ce("extrudedHeightReference"),cornerType:ce("cornerType"),granularity:ce("granularity"),fill:ce("fill"),material:vo("material"),outline:ce("outline"),outlineColor:ce("outlineColor"),outlineWidth:ce("outlineWidth"),shadows:ce("shadows"),distanceDisplayCondition:ce("distanceDisplayCondition"),classificationType:ce("classificationType"),zIndex:ce("zIndex")});oP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new oP(this)};oP.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var nA=oP;function sOe(e){return e}function aOe(e,t){return ce(e,t,sOe)}var al=aOe;function rP(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(rP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ce("show"),length:ce("length"),topRadius:ce("topRadius"),bottomRadius:ce("bottomRadius"),heightReference:ce("heightReference"),fill:ce("fill"),material:vo("material"),outline:ce("outline"),outlineColor:ce("outlineColor"),outlineWidth:ce("outlineWidth"),numberOfVerticalLines:ce("numberOfVerticalLines"),slices:ce("slices"),shadows:ce("shadows"),distanceDisplayCondition:ce("distanceDisplayCondition")});rP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new rP(this)};rP.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var iA=rP;function sP(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(sP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ce("show"),semiMajorAxis:ce("semiMajorAxis"),semiMinorAxis:ce("semiMinorAxis"),height:ce("height"),heightReference:ce("heightReference"),extrudedHeight:ce("extrudedHeight"),extrudedHeightReference:ce("extrudedHeightReference"),rotation:ce("rotation"),stRotation:ce("stRotation"),granularity:ce("granularity"),fill:ce("fill"),material:vo("material"),outline:ce("outline"),outlineColor:ce("outlineColor"),outlineWidth:ce("outlineWidth"),numberOfVerticalLines:ce("numberOfVerticalLines"),shadows:ce("shadows"),distanceDisplayCondition:ce("distanceDisplayCondition"),classificationType:ce("classificationType"),zIndex:ce("zIndex")});sP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new sP(this)};sP.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var oA=sP;function aP(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(aP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ce("show"),radii:ce("radii"),innerRadii:ce("innerRadii"),minimumClock:ce("minimumClock"),maximumClock:ce("maximumClock"),minimumCone:ce("minimumCone"),maximumCone:ce("maximumCone"),heightReference:ce("heightReference"),fill:ce("fill"),material:vo("material"),outline:ce("outline"),outlineColor:ce("outlineColor"),outlineWidth:ce("outlineWidth"),stackPartitions:ce("stackPartitions"),slicePartitions:ce("slicePartitions"),subdivisions:ce("subdivisions"),shadows:ce("shadows"),distanceDisplayCondition:ce("distanceDisplayCondition")});aP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new aP(this)};aP.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var rA=aP;function cP(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(cP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ce("show"),text:ce("text"),font:ce("font"),style:ce("style"),scale:ce("scale"),showBackground:ce("showBackground"),backgroundColor:ce("backgroundColor"),backgroundPadding:ce("backgroundPadding"),pixelOffset:ce("pixelOffset"),eyeOffset:ce("eyeOffset"),horizontalOrigin:ce("horizontalOrigin"),verticalOrigin:ce("verticalOrigin"),heightReference:ce("heightReference"),fillColor:ce("fillColor"),outlineColor:ce("outlineColor"),outlineWidth:ce("outlineWidth"),translucencyByDistance:ce("translucencyByDistance"),pixelOffsetScaleByDistance:ce("pixelOffsetScaleByDistance"),scaleByDistance:ce("scaleByDistance"),distanceDisplayCondition:ce("distanceDisplayCondition"),disableDepthTestDistance:ce("disableDepthTestDistance")});cP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new cP(this)};cP.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var cd=cP;var cOe=new m(1,1,1),lOe=m.ZERO,uOe=Ne.IDENTITY;function Kee(e,t,n){this.translation=m.clone(y(e,lOe)),this.rotation=Ne.clone(y(t,uOe)),this.scale=m.clone(y(n,cOe))}Kee.prototype.equals=function(e){return this===e||l(e)&&m.equals(this.translation,e.translation)&&Ne.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var dg=Kee;var q8=new dg;function lP(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new ge,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(lP.prototype,{isConstant:{get:function(){return j.isConstant(this._translation)&&j.isConstant(this._rotation)&&j.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:ce("translation"),rotation:ce("rotation"),scale:ce("scale")});lP.prototype.getValue=function(e,t){return l(t)||(t=new dg),t.translation=j.getValueOrClonedDefault(this._translation,e,q8.translation,t.translation),t.rotation=j.getValueOrClonedDefault(this._rotation,e,q8.rotation,t.rotation),t.scale=j.getValueOrClonedDefault(this._scale,e,q8.scale,t.scale),t};lP.prototype.equals=function(e){return this===e||e instanceof lP&&j.equals(this._translation,e._translation)&&j.equals(this._rotation,e._rotation)&&j.equals(this._scale,e._scale)};var sA=lP;function cp(e,t){this._propertyNames=[],this._definitionChanged=new ge,l(e)&&this.merge(e,t)}Object.defineProperties(cp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t (textureSize.y / textureSize.x)) + { + mipLevel = 1.0; + if (uv.y - pixel.y > yMipLevel1) + { + mipLevel = 2.0; + if (uv.y - pixel.y * 3.0 > yMipLevel2) + { + mipLevel = 3.0; + if (uv.y - pixel.y * 5.0 > yMipLevel3) + { + mipLevel = 4.0; + if (uv.y - pixel.y * 7.0 > yMipLevel4) + { + mipLevel = 5.0; + } + } + } + } + } + + if (mipLevel > 0.0) + { + float scale = pow(2.0, mipLevel); + + uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0); + uv.x *= ((textureSize.x - 2.0) / textureSize.y); + + uv.x -= 1.0 + pixel.x; + uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0))); + uv *= scale; + } + else + { + uv.x *= (textureSize.x / textureSize.y); + } + + if(mipLevel == 0.0) + { + out_FragColor = texture(texture0, uv); + } + else if(mipLevel == 1.0) + { + out_FragColor = texture(texture1, uv); + } + else if(mipLevel == 2.0) + { + out_FragColor = texture(texture2, uv); + } + else if(mipLevel == 3.0) + { + out_FragColor = texture(texture3, uv); + } + else if(mipLevel == 4.0) + { + out_FragColor = texture(texture4, uv); + } + else if(mipLevel == 5.0) + { + out_FragColor = texture(texture5, uv); + } + else + { + out_FragColor = vec4(0.0); + } +} +`;var EP=`in vec3 v_cubeMapCoordinates; +uniform samplerCube cubeMap; + +void main() +{ + vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates); + #ifdef RGBA_NORMALIZED + out_FragColor = vec4(rgba.rgb, 1.0); + #else + float m = rgba.a * 16.0; + vec3 r = rgba.rgb * m; + out_FragColor = vec4(r * r, 1.0); + #endif +} +`;var bP=`in vec4 position; +in vec3 cubeMapCoordinates; + +out vec3 v_cubeMapCoordinates; + +void main() +{ + gl_Position = position; + v_cubeMapCoordinates = cubeMapCoordinates; +} +`;function fA(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new ge}Object.defineProperties(fA.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});fA.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};var ROe=new m(1,0,0),BOe=new m(0,0,1),LOe=new m(-1,0,0),NOe=new m(0,0,-1),cU=new m(0,1,0),FOe=new m(0,-1,0),cte=[cU,LOe,BOe,FOe,ROe,cU,NOe,cU,cU],lte=cte.length,ute=new Float32Array(lte*3),ste=0;for(let e=0;e 0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return l(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function zOe(e,t){if(dd.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),l(e._specularEnvironmentMaps)){let n=new dd(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}SP.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._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._luminanceAtZenith)!==l(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentMapAtlasDirty&&(zOe(this,t),this._specularEnvironmentMapAtlasDirty=!1),l(this._specularEnvironmentMapAtlas)&&(this._specularEnvironmentMapAtlas.update(e),this._specularEnvironmentMapAtlas.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};SP.prototype.isDestroyed=function(){return!1};SP.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var dA=SP;var e5=So(Vl(),1);var $8,fte="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwZWQ3OWFlZC1kOTg3LTRlZjctYTAyYy0xNjFmODE1MWE2NGUiLCJpZCI6MjU5LCJpYXQiOjE2ODI5NDYzODh9.DEH4GpqliH-xsDE7h-ZCICtHgnGu32wdSjt4hFqw7lU",lU={};lU.defaultAccessToken=fte;lU.defaultServer=new we({url:"https://api.cesium.com/"});lU.getDefaultTokenCredit=function(e){if(e===fte){if(!l($8)){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.`;$8=new It(t,!0)}return $8}};var md=lU;function Ic(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:HOe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new de("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");we.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new e5.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}l(Object.create)&&(Ic.prototype=Object.create(we.prototype),Ic.prototype.constructor=Ic);Ic.fromAssetId=function(e,t){let n=Ic._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Ic(i,n)})};Object.defineProperties(Ic.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Ic.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Ic.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(It.getIonCredit),i=md.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(It.clone(i)),n};Ic.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new Ic(t._ionEndpoint,t._ionEndpointResource)),e=we.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Ic.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return we.prototype.fetchImage.call(this,e)};Ic.prototype._makeRequest=function(e){return this._isExternal||new e5.default(this.url).authority()!==this._ionEndpointDomain?we.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),we.prototype._makeRequest.call(this,e))};Ic._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,md.defaultServer),i=y(t.accessToken,md.defaultAccessToken);n=we.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function HOe(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var qs=Ic;function Nm(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(Nm.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});Nm.prototype.get=function(e){return this._array[e]};Nm.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Nm.prototype.peek=function(){return this._array[this._length-1]};Nm.prototype.push=function(e){let t=this.length++;this._array[t]=e};Nm.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Nm.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Nm.prototype.resize=function(e){this.length=e};Nm.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var Pc=Nm;var hp={X:0,Y:1,Z:2};hp.Y_UP_TO_Z_UP=B.fromRotationTranslation(Z.fromRotationX(P.PI_OVER_TWO));hp.Z_UP_TO_Y_UP=B.fromRotationTranslation(Z.fromRotationX(-P.PI_OVER_TWO));hp.X_UP_TO_Z_UP=B.fromRotationTranslation(Z.fromRotationY(-P.PI_OVER_TWO));hp.Z_UP_TO_X_UP=B.fromRotationTranslation(Z.fromRotationY(P.PI_OVER_TWO));hp.X_UP_TO_Y_UP=B.fromRotationTranslation(Z.fromRotationZ(P.PI_OVER_TWO));hp.Y_UP_TO_X_UP=B.fromRotationTranslation(Z.fromRotationZ(-P.PI_OVER_TWO));hp.fromName=function(e){return hp[e]};var ao=Object.freeze(hp);function dte(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(dte.prototype,{metadata:{get:function(){return this._metadata}}});var mA=dte;function mg(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),mg.decode(e)}mg.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};mg.decodeWithFromCharCode=function(e){let t="",n=GOe(e),i=n.length;for(let o=0;o>10)+55296,(r&1023)+56320))}return t};function wP(e,t,n){return t<=e&&e<=n}function GOe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c{this._resolveContent=o})}Object.defineProperties(pd.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n 0){let o=Math.min(t,kt.maximumTextureSize),r=Math.ceil(t/kt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,u=c*.5;n=new H(o,r),i=new re(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Wa.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});Wa.DEFAULT_COLOR_VALUE=z.WHITE;Wa.DEFAULT_SHOW_VALUE=!0;function mte(e){let t=e._textureDimensions;return t.x*t.y*4}function hte(e){if(!l(e._batchValues)){let t=mte(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function pte(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Wa.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=pte(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=hte(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Wa.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n 0){let i=e._pickIds,o=mte(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c 0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=o[t],g=s[t];for(let h=0;h 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} +${pMe(i)}${s}`}};function gte(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 _Me(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u
0?(i+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_color(tile_featureColor); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; +`),i+=`uniform sampler2D tile_pickTexture; +uniform sampler2D tile_batchTexture; +in vec2 tile_featureSt; +void main() +{ + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } +`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + discard; + } + } + else + { + if (isStyleTranslucent) + { + discard; + } + } +`),i+=` tile_color(featureProperties); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+=`} +`),i}};co.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=He.replaceMain(e,"tile_main"),kt.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_main(); + out_FragColor = tile_featureColor; + out_FragColor.rgb *= out_FragColor.a; +}`:e+=`uniform sampler2D tile_batchTexture; +uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +void main() +{ + tile_main(); + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } + out_FragColor = featureProperties; + out_FragColor.rgb *= out_FragColor.a; +} +`,e}};function gMe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===ul.HIGHLIGHT)return 0;if(n===ul.REPLACE)return 1;if(n===ul.MIX)return P.clamp(i,P.EPSILON4,1)}co.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return _t(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return gMe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};co.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var hg={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};co.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=yMe(this);for(let u=t;u>>Ft.SKIP_LOD_BIT_SHIFT}function wMe(e){let t=Ye(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=mn.ALPHA_BLEND,t.stencilTest=Ft.setCesium3DTileBit(),t.stencilMask=Ft.CESIUM_3D_TILE_MASK,ze.fromCache(t)}function vMe(e){let t=Ye(e,!0);return t.stencilTest=Ft.setCesium3DTileBit(),t.stencilMask=Ft.CESIUM_3D_TILE_MASK,ze.fromCache(t)}co.prototype.update=function(e,t){this._batchTexture.update(e,t)};co.prototype.isDestroyed=function(){return!1};co.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var _p=co;function DMe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Fm=DMe;var wT=`in vec3 position; +in float a_batchId; + +uniform mat4 u_modifiedModelViewProjection; + +void main() +{ + gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); +} +`;function Ju(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Ju.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});Ju.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Ju.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Ju.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Ju.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};Ju.prototype.getPropertyInherited=function(e){return Ju.getPropertyInherited(this._content,this._batchId,e)};Ju.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Ju.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Ju.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Ju.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var xs=Ju;var i5=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)})}},o5=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)})}},We=class{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+We.version}static addUnaryOp(t){return We.max_unop_len=Math.max(t.length,We.max_unop_len),We.unary_ops[t]=1,We}static addBinaryOp(t,n,i){return We.max_binop_len=Math.max(t.length,We.max_binop_len),We.binary_ops[t]=n,i?We.right_associative.add(t):We.right_associative.delete(t),We}static addIdentifierChar(t){return We.additional_identifier_chars.add(t),We}static addLiteral(t,n){return We.literals[t]=n,We}static removeUnaryOp(t){return delete We.unary_ops[t],t.length===We.max_unop_len&&(We.max_unop_len=We.getMaxKeyLen(We.unary_ops)),We}static removeAllUnaryOps(){return We.unary_ops={},We.max_unop_len=0,We}static removeIdentifierChar(t){return We.additional_identifier_chars.delete(t),We}static removeBinaryOp(t){return delete We.binary_ops[t],t.length===We.max_binop_len&&(We.max_binop_len=We.getMaxKeyLen(We.binary_ops)),We.right_associative.delete(t),We}static removeAllBinaryOps(){return We.binary_ops={},We.max_binop_len=0,We}static removeLiteral(t){return delete We.literals[t],We}static removeAllLiterals(){return We.literals={},We}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 We(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 We.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!We.binary_ops[String.fromCharCode(t)]||We.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return We.isIdentifierStart(t)||We.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(We.hooks[t]){let i={context:this,node:n};return We.hooks.run(t,i),i.node}return n}searchHook(t){if(We.hooks[t]){let n={context:this};return We.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===We.SPACE_CODE||t===We.TAB_CODE||t===We.LF_CODE||t===We.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:We.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index 0;){if(We.binary_ops.hasOwnProperty(t)&&(!We.isIdentifierStart(this.code)||this.index+t.length r.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;o.length>2&&f(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:We.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(c=o.length-1,t=o[c];c>1;)t={type:We.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,We.isDecimalDigit(t)||t===We.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===We.SQUOTE_CODE||t===We.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===We.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,We.max_unop_len),i=n.length;i>0;){if(We.unary_ops.hasOwnProperty(n)&&(!We.isIdentifierStart(this.code)||this.index+n.length =n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===We.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===We.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===We.CBRACK_CODE)for(let s=n.length;s ":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});We.max_unop_len=We.getMaxKeyLen(We.unary_ops);We.max_binop_len=We.getMaxKeyLen(We.binary_ops);var pg=e=>new We(e).parse(),PMe=Object.getOwnPropertyNames(We);PMe.forEach(e=>{pg[e]===void 0&&e!=="prototype"&&(pg[e]=We[e])});pg.Jsep=We;var OMe="ConditionalExpression",MMe={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:OMe,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 :")}})}};pg.plugins.register(MMe);var RMe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},gt=Object.freeze(RMe);function _d(e,t){this._expression=e,e=YMe(e,t),e=XMe(qMe(e)),pg.addBinaryOp("=~",0),pg.addBinaryOp("!~",0);let n;try{n=pg(e)}catch(i){throw new de(i)}this._runtimeAst=Ci(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 m],cartesian4Array:[new re],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 m),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new re),this.cartesian4Array[this.cartesian4Index++]}};_d.prototype.evaluate=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof re?z.fromCartesian4(n,t):n instanceof H||n instanceof m||n instanceof re?n.clone(t):n};_d.prototype.evaluateColor=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return z.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 BMe=["!","-","+"],xte=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],dU=/\${(.*?)}/g,LMe=/\\/g,NMe="@#%",FMe=/@#%/g,mU=new z,hU={abs:Cs(Math.abs),sqrt:Cs(Math.sqrt),cos:Cs(Math.cos),sin:Cs(Math.sin),tan:Cs(Math.tan),acos:Cs(Math.acos),asin:Cs(Math.asin),atan:Cs(Math.atan),radians:Cs(P.toRadians),degrees:Cs(P.toDegrees),sign:Cs(P.sign),floor:Cs(Math.floor),ceil:Cs(Math.ceil),round:Cs(Math.round),exp:Cs(Math.exp),exp2:Cs(VMe),log:Cs(Math.log),log2:Cs(kMe),fract:Cs(UMe),length:zMe,normalize:HMe},pU={atan2:uU(Math.atan2,!1),pow:uU(Math.pow,!1),min:uU(Math.min,!0),max:uU(Math.max,!0),distance:GMe,dot:WMe,cross:jMe},a5={clamp:Cte(P.clamp,!0),mix:Cte(P.lerp,!0)};function UMe(e){return e-Math.floor(e)}function VMe(e){return Math.pow(2,e)}function kMe(e){return P.log2(e)}function Cs(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 m)return m.fromElements(e(n.x),e(n.y),e(n.z),Rn.getCartesian3());if(n instanceof re)return re.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Rn.getCartesian4());throw new de(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function uU(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 m)return m.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Rn.getCartesian3());if(i instanceof re)return re.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 m&&o instanceof m)return m.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),Rn.getCartesian3());if(i instanceof re&&o instanceof re)return re.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 de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Cte(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 m&&o instanceof m)return m.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),Rn.getCartesian3());if(i instanceof re&&o instanceof re)return re.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 m&&o instanceof m&&r instanceof m)return m.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 re&&o instanceof re&&r instanceof re)return re.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 de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function zMe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof H)return H.magnitude(t);if(t instanceof m)return m.magnitude(t);if(t instanceof re)return re.magnitude(t);throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function HMe(e,t){if(typeof t=="number")return 1;if(t instanceof H)return H.normalize(t,Rn.getCartesian2());if(t instanceof m)return m.normalize(t,Rn.getCartesian3());if(t instanceof re)return re.normalize(t,Rn.getCartesian4());throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function GMe(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 m&&n instanceof m)return m.distance(t,n);if(t instanceof re&&n instanceof re)return re.distance(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function WMe(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 m&&n instanceof m)return m.dot(t,n);if(t instanceof re&&n instanceof re)return re.dot(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function jMe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,Rn.getCartesian3());throw new de(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function xt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,oRe(this)}function YMe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function qMe(e){return e.replace(LMe,NMe)}function s5(e){return e.replace(FMe,"\\")}function XMe(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 xt(gt.VARIABLE_IN_STRING,e.value):new xt(gt.LITERAL_STRING,s5(e.value))}function JMe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new de(`${o} is not a function.`);return i===0?o==="test"?new xt(gt.LITERAL_BOOLEAN,!1):new xt(gt.LITERAL_NULL,null):(s=Ci(e,c),a=Ci(e,n[0]),new xt(gt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Ci(e,c),new xt(gt.FUNCTION_CALL,o,r);throw new de(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new xt(gt.LITERAL_COLOR,o);if(r=Ci(e,n[0]),l(n[1])){let c=Ci(e,n[1]);return new xt(gt.LITERAL_COLOR,o,[r,c])}return new xt(gt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new de(`${o} requires three arguments.`);return r=[Ci(e,n[0]),Ci(e,n[1]),Ci(e,n[2])],new xt(gt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new de(`${o} requires four arguments.`);return r=[Ci(e,n[0]),Ci(e,n[1]),Ci(e,n[2]),Ci(e,n[3])],new xt(gt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c1)throw new de(`${o} requires exactly one argument.`);return r=Ci(e,n[0]),new xt(gt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new de(`${o} does not take any argument.`);return new xt(gt.UNARY,o)}else if(l(hU[o])){if(i!==1)throw new de(`${o} requires exactly one argument.`);return r=Ci(e,n[0]),new xt(gt.UNARY,o,r)}else if(l(pU[o])){if(i!==2)throw new de(`${o} requires exactly two arguments.`);return s=Ci(e,n[0]),a=Ci(e,n[1]),new xt(gt.BINARY,o,s,a)}else if(l(a5[o])){if(i!==3)throw new de(`${o} requires exactly three arguments.`);s=Ci(e,n[0]),a=Ci(e,n[1]);let c=Ci(e,n[2]);return new xt(gt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new xt(gt.LITERAL_BOOLEAN,!1):(r=Ci(e,n[0]),new xt(gt.UNARY,o,r));if(o==="Number")return i===0?new xt(gt.LITERAL_NUMBER,0):(r=Ci(e,n[0]),new xt(gt.UNARY,o,r));if(o==="String")return i===0?new xt(gt.LITERAL_STRING,""):(r=Ci(e,n[0]),new xt(gt.UNARY,o,r));if(o==="regExp")return ZMe(e,t)}}throw new de(`Unexpected function call "${o}".`)}function ZMe(e,t){let n=t.arguments;if(n.length===0)return new xt(gt.LITERAL_REGEX,new RegExp);let i=Ci(e,n[0]),o;if(n.length>1){let r=Ci(e,n[1]);if(r5(i)&&r5(r)){try{o=new RegExp(s5(String(i._value)),r._value)}catch(s){throw new de(s)}return new xt(gt.LITERAL_REGEX,o)}return new xt(gt.REGEX,i,r)}if(r5(i)){try{o=new RegExp(s5(String(i._value)))}catch(r){throw new de(r)}return new xt(gt.LITERAL_REGEX,o)}return new xt(gt.REGEX,i)}function QMe(e){if(nRe(e.name)){let t=iRe(e.name);return t.substr(0,8)==="tiles3d_"?new xt(gt.BUILTIN_VARIABLE,t):new xt(gt.VARIABLE,t)}else{if(e.name==="NaN")return new xt(gt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new xt(gt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new xt(gt.LITERAL_UNDEFINED,void 0)}throw new de(`${e.name} is not defined.`)}function $Me(e){let t=e.property.name;if(t==="PI")return new xt(gt.LITERAL_NUMBER,Math.PI);if(t==="E")return new xt(gt.LITERAL_NUMBER,Math.E)}function eRe(e){if(e.property.name==="POSITIVE_INFINITY")return new xt(gt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function tRe(e,t){if(t.object.name==="Math")return $Me(t);if(t.object.name==="Number")return eRe(t);let n,i=Ci(e,t.object);return t.computed?(n=Ci(e,t.property),new xt(gt.MEMBER,"brackets",i,n)):(n=new xt(gt.LITERAL_STRING,t.property.name),new xt(gt.MEMBER,"dot",i,n))}function r5(e){return e._type>=gt.LITERAL_NULL}function nRe(e){return e.substr(0,4)==="czm_"}function iRe(e){return e.substr(4)}function Ci(e,t){let n,i,o,r;if(t.type==="Literal")n=KMe(t);else if(t.type==="CallExpression")n=JMe(e,t);else if(t.type==="Identifier")n=QMe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ci(e,t.argument);if(BMe.indexOf(i)>-1)n=new xt(gt.UNARY,i,s);else throw new de(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Ci(e,t.left),r=Ci(e,t.right),xte.indexOf(i)>-1)n=new xt(gt.BINARY,i,o,r);else throw new de(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Ci(e,t.left),r=Ci(e,t.right),xte.indexOf(i)>-1&&(n=new xt(gt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Ci(e,t.test);o=Ci(e,t.consequent),r=Ci(e,t.alternate),n=new xt(gt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=tRe(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:l(pU[e._value])&&(e.evaluate=aRe(e._value)):e._type===gt.TERNARY?e.evaluate=cRe(e._value):e._type===gt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===gt.ARRAY?e.evaluate=e._evaluateArray:e._type===gt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===gt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===gt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===gt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===gt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===gt.REGEX?e.evaluate=e._evaluateRegExp:e._type===gt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=rRe):e.evaluate=e._evaluateLiteral}function rRe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function sRe(e){let t=hU[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function aRe(e){let t=pU[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function cRe(e){let t=a5[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 _U(e,t){if(l(e))return e.getPropertyInherited(t)}xt.prototype._evaluateLiteral=function(){return this._value};xt.prototype._evaluateLiteralColor=function(e){let t=mU,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return re.fromColor(t,Rn.getCartesian4())};xt.prototype._evaluateLiteralVector=function(e){let t=Rn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a 1)throw new de(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new de(`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 m.fromArray(t,0,Rn.getCartesian3());if(n==="vec4")return re.fromArray(t,0,Rn.getCartesian4())};xt.prototype._evaluateLiteralString=function(){return this._value};xt.prototype._evaluateVariableString=function(e){let t=this._value,n=dU.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=_U(e,o);l(r)||(r=""),t=t.replace(i,r),n=dU.exec(t)}return t};xt.prototype._evaluateVariable=function(e){return _U(e,this._value)};function pA(e){return e._value==="feature"}xt.prototype._evaluateMemberDot=function(e){if(pA(this._left))return _U(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof re){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};xt.prototype._evaluateMemberBrackets=function(e){if(pA(this._left))return _U(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof m||t instanceof re){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};xt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n " requires number arguments. Arguments are ${t} and ${n}.`);return t>n};xt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};xt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};xt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};xt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.add(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,Rn.getCartesian3());if(n instanceof re&&t instanceof re)return re.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 de(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.subtract(t,n,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,Rn.getCartesian3());if(n instanceof re&&t instanceof re)return re.subtract(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new de(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof 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 m&&t instanceof m)return m.multiplyComponents(t,n,Rn.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,Rn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,Rn.getCartesian3());if(n instanceof re&&t instanceof re)return re.multiplyComponents(t,n,Rn.getCartesian4());if(n instanceof re&&typeof t=="number")return re.multiplyByScalar(n,t,Rn.getCartesian4());if(t instanceof re&&typeof n=="number")return re.multiplyByScalar(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new de(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof 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 m&&t instanceof m)return m.divideComponents(t,n,Rn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,Rn.getCartesian3());if(n instanceof re&&t instanceof re)return re.divideComponents(t,n,Rn.getCartesian4());if(t instanceof re&&typeof n=="number")return re.divideByScalar(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new de(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.fromElements(t.x%n.x,t.y%n.y,Rn.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Rn.getCartesian3());if(n instanceof re&&t instanceof re)return re.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 de(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof re&&t instanceof re?t.equals(n):t===n};xt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof m&&t instanceof m||n instanceof re&&t instanceof re?!t.equals(n):t!==n};xt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new de(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};xt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};xt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};xt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};xt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};xt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};xt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};xt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};xt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};xt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new de(o)}return i};xt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};xt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new de(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new de(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};xt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof H||t instanceof m||t instanceof re)return String(t);throw new de(`Unexpected function call "${this._value}".`)};function Tte(e){let t=e._left,n=t.length;for(let a=0;a 1){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(c==="rgb")return i=Ete(this),l(i)?fU(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=Ete(this),l(i)?fU(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=Tte(this),l(i)?fU(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=Tte(this),l(i)?(i.alpha!==1&&(t.translucent=!0),fU(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case gt.LITERAL_VECTOR:f=o.length,d=`${c}(`;for(let p=0;p 0;){let f=t.pop();if(z.equals(f.color,a.color))u=c5(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=c5(n,s,u,i,o,f.batchIds,r),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function l5(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let u=0;u 0;){let d=t.pop();if(z.equals(d.color,r.color))u=l5(a,c,u,n,i,d.batchIds,o),r.batchIds=r.batchIds.concat(d.batchIds),r.count=u-r.offset;else{let p=u;u=l5(a,c,u,n,i,d.batchIds,o),d.offset=p,d.count=u-p,s.push(d),r=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function ARe(e,t){return t.color.toRgba()-e.color.toRgba()}function xRe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s=A&&s{e.isDestroyed()||(e._error=h)}):void 0}}function NRe(e){l(e._primitive)||(e._primitive=new gA({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}Zl.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Zl.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Zl.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Zl.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Zl.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=LRe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Zl.prototype.isDestroyed=function(){return!1};Zl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var yp=Zl;function Ap(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,this._resolveContent=void 0,this._readyPromise=new Promise(r=>{this._resolveContent=r}),VRe(this,i,o)}Object.defineProperties(Ap.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return $("Geometry3DTileContent.readyPromise","Geometry3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Geometry3DTileContent.ready to return true instead."),this._readyPromise}},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 FRe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function URe(e,t){let n,i,o,r,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),u=y(e.ELLIPSOIDS_LENGTH,0),f=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let h=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,h,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let h=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,h,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let h=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,h,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let h=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,h,f)}let d=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||f>0&&!l(r);if(d&&p)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let h=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s0)for(i=new Uint16Array(c),s=0;s 0)for(o=new Uint16Array(u),s=0;s0)for(r=new Uint16Array(f),s=0;s 0&&(g=Do(i,n,u),n+=u,f>0&&(h=new Uint8Array(t,n,f),h=new Uint8Array(h)));let A=y(d.BOXES_LENGTH,0),x=y(d.CYLINDERS_LENGTH,0),C=y(d.ELLIPSOIDS_LENGTH,0),T=y(d.SPHERES_LENGTH,0),E=A+x+C+T,S=new _p(e,E,g,h,FRe(e));if(e._batchTable=S,E===0)return;let v=e.tile.computedTransform,D;l(d.RTC_CENTER)&&(D=m.unpack(d.RTC_CENTER),B.multiplyByPoint(v,D,D));let O=URe(d,p);if(A>0||x>0||C>0||T>0){let M,L,N,_;if(A>0){let b=p.byteOffset+d.BOXES.byteOffset;M=new Float32Array(p.buffer,b,yp.packedBoxLength*A)}if(x>0){let b=p.byteOffset+d.CYLINDERS.byteOffset;L=new Float32Array(p.buffer,b,yp.packedCylinderLength*x)}if(C>0){let b=p.byteOffset+d.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,b,yp.packedEllipsoidLength*C)}if(T>0){let b=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,b,yp.packedSphereLength*T)}return e._geometries=new yp({boxes:M,boxBatchIds:O.boxes,cylinders:L,cylinderBatchIds:O.cylinders,ellipsoids:N,ellipsoidBatchIds:O.ellipsoids,spheres:_,sphereBatchIds:O.spheres,center:D,modelMatrix:v,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function Ite(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}Ap.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Ap.prototype.getFeature=function(e){return Ite(this),this._features[e]};Ap.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};Ap.prototype.applyStyle=function(e){Ite(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};Ap.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0,this._resolveContent(this))};Ap.prototype.isDestroyed=function(){return!1};Ap.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var PP=Ap;var u5={};u5.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),Pte(i,o,r,s);return c};u5.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s >>0,f5=2*AA+1,gg=4,Rte=[],Bte=[],HRe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],yg=1,DT=2,gU=[yg,0,0,yg|DT];function Ur(e){if(!Ht.supportsBigInt())throw new de("S2 required BigInt support");this._cellId=e,this._level=Ur.getLevel(e)}Ur.fromToken=function(e){return new Ur(Ur.getIdFromToken(e))};Ur.isValidId=function(e){return!(e<=0||e>>BigInt(f5)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Ur.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Ur.isValidId(Ur.getIdFromToken(e)):!1};Ur.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Ur.getTokenFromId=function(e){let t=Math.floor(QRe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Ur.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return AA-(t>>1)};Ur.prototype.getChild=function(e){let t=Fte(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Ur(n)};Ur.prototype.getParent=function(){let e=Fte(this._cellId)< >1&1;return Nte(i[0],o[0][r^n&1],o[1][r])}function jRe(e,t){let n=Lte(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(o<<1)+c,f=(r<<1)+c;return[i,u,f]}function Lte(e){Rte.length===0&&KRe();let t=Number(e>>BigInt(f5)),n=t&yg,i=(1< =0;s--){let c=(1<<2*(s===7?AA-7*gg:gg))-1;n+=Number(e>>BigInt(s*2*gg+1)&BigInt(c))<<2,n=Bte[n];let u=s*gg;o+=n>>gg+2<>2&i)<