@deck.gl/geo-layers 9.0.8 → 9.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.dev.js +4 -7
- package/dist/index.cjs +4 -7
- package/dist/index.cjs.map +2 -2
- package/dist/tile-layer/tile-layer.d.ts +3 -1
- package/dist/tile-layer/tile-layer.d.ts.map +1 -1
- package/dist/tile-layer/tile-layer.js +5 -7
- package/dist.min.js +1 -1
- package/package.json +4 -4
- package/src/tile-layer/tile-layer.ts +8 -8
package/dist.min.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
`);let t=new kr("!xml"),r=t,n="",s="";for(let o=0;o<e.length;o++)if(e[o]==="<")if(e[o+1]==="/"){let a=Fe(e,">",o,"Closing Tag is not closed."),c=e.substring(o+2,a).trim();if(this.options.removeNSPrefix){let f=c.indexOf(":");f!==-1&&(c=c.substr(f+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),r&&(n=this.saveTextToParentTag(n,r,s));let l=s.substring(s.lastIndexOf(".")+1);if(c&&this.options.unpairedTags.indexOf(c)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${c}>`);let u=0;l&&this.options.unpairedTags.indexOf(l)!==-1?(u=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):u=s.lastIndexOf("."),s=s.substring(0,u),r=this.tagsNodeStack.pop(),n="",o=a}else if(e[o+1]==="?"){let a=ci(e,o,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,r,s),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){let c=new kr(a.tagName);c.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(c[":@"]=this.buildAttributesMap(a.tagExp,s,a.tagName)),this.addChild(r,c,s)}o=a.closeIndex+1}else if(e.substr(o+1,3)==="!--"){let a=Fe(e,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){let c=e.substring(o+4,a-2);n=this.saveTextToParentTag(n,r,s),r.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}o=a}else if(e.substr(o+1,2)==="!D"){let a=Vg(e,o);this.docTypeEntities=a.entities,o=a.i}else if(e.substr(o+1,2)==="!["){let a=Fe(e,"]]>",o,"CDATA is not closed.")-2,c=e.substring(o+9,a);n=this.saveTextToParentTag(n,r,s);let l=this.parseTextData(c,r.tagname,s,!0,!1,!0,!0);l==null&&(l=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]):r.add(this.options.textNodeName,l),o=a+2}else{let a=ci(e,o,this.options.removeNSPrefix),c=a.tagName,l=a.rawTagName,u=a.tagExp,f=a.attrExpPresent,h=a.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),r&&n&&r.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,r,s,!1));let d=r;if(d&&this.options.unpairedTags.indexOf(d.tagname)!==-1&&(r=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),c!==t.tagname&&(s+=s?"."+c:c),this.isItStopNode(this.options.stopNodes,s,c)){let p="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)o=a.closeIndex;else if(this.options.unpairedTags.indexOf(c)!==-1)o=a.closeIndex;else{let g=this.readStopNodeData(e,l,h+1);if(!g)throw new Error(`Unexpected end of ${l}`);o=g.i,p=g.tagContent}let A=new kr(c);c!==u&&f&&(A[":@"]=this.buildAttributesMap(u,s,c)),p&&(p=this.parseTextData(p,c,s,!0,f,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),A.add(this.options.textNodeName,p),this.addChild(r,A,s)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){c[c.length-1]==="/"?(c=c.substr(0,c.length-1),s=s.substr(0,s.length-1),u=c):u=u.substr(0,u.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));let p=new kr(c);c!==u&&f&&(p[":@"]=this.buildAttributesMap(u,s,c)),this.addChild(r,p,s),s=s.substr(0,s.lastIndexOf("."))}else{let p=new kr(c);this.tagsNodeStack.push(r),c!==u&&f&&(p[":@"]=this.buildAttributesMap(u,s,c)),this.addChild(r,p,s),r=p}n="",o=h}}else n+=e[o];return t.child};function Wg(e,t,r){let n=this.options.updateTag(t.tagname,r,t[":@"]);n===!1||(typeof n=="string"&&(t.tagname=n),e.addChild(t))}var Yg=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){let r=this.docTypeEntities[t];e=e.replace(r.regx,r.val)}for(let t in this.lastEntities){let r=this.lastEntities[t];e=e.replace(r.regex,r.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){let r=this.htmlEntities[t];e=e.replace(r.regex,r.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function Kg(e,t,r,n){return e&&(n===void 0&&(n=Object.keys(t.child).length===0),e=this.parseTextData(e,t.tagname,r,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,n),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function Qg(e,t,r){let n="*."+r;for(let s in e){let o=e[s];if(n===o||t===o)return!0}return!1}function Zg(e,t,r=">"){let n,s="";for(let o=t;o<e.length;o++){let i=e[o];if(n)i===n&&(n="");else if(i==='"'||i==="'")n=i;else if(i===r[0])if(r[1]){if(e[o+1]===r[1])return{data:s,index:o}}else return{data:s,index:o};else i===" "&&(i=" ");s+=i}}function Fe(e,t,r,n){let s=e.indexOf(t,r);if(s===-1)throw new Error(n);return s+t.length-1}function ci(e,t,r,n=">"){let s=Zg(e,t+1,n);if(!s)return;let o=s.data,i=s.index,a=o.search(/\s/),c=o,l=!0;a!==-1&&(c=o.substring(0,a),o=o.substring(a+1).trimStart());let u=c;if(r){let f=c.indexOf(":");f!==-1&&(c=c.substr(f+1),l=c!==s.data.substr(f+1))}return{tagName:c,tagExp:o,closeIndex:i,attrExpPresent:l,rawTagName:u}}function $g(e,t,r){let n=r,s=1;for(;r<e.length;r++)if(e[r]==="<")if(e[r+1]==="/"){let o=Fe(e,">",r,`${t} is not closed`);if(e.substring(r+2,o).trim()===t&&(s--,s===0))return{tagContent:e.substring(n,r),i:o};r=o}else if(e[r+1]==="?")r=Fe(e,"?>",r+1,"StopNode is not closed.");else if(e.substr(r+1,3)==="!--")r=Fe(e,"-->",r+3,"StopNode is not closed.");else if(e.substr(r+1,2)==="![")r=Fe(e,"]]>",r,"StopNode is not closed.")-2;else{let o=ci(e,r,">");o&&((o&&o.tagName)===t&&o.tagExp[o.tagExp.length-1]!=="/"&&s++,r=o.closeIndex)}}function li(e,t,r){if(t&&typeof e=="string"){let n=e.trim();return n==="true"?!0:n==="false"?!1:Hg(e,r)}else return Ul.isExist(e)?e:""}Gl.exports=ai});var kl=tt(zl=>{"use strict";function t0(e,t){return Hl(e,t)}function Hl(e,t,r){let n,s={};for(let o=0;o<e.length;o++){let i=e[o],a=e0(i),c="";if(r===void 0?c=a:c=r+"."+a,a===t.textNodeName)n===void 0?n=i[a]:n+=""+i[a];else{if(a===void 0)continue;if(i[a]){let l=Hl(i[a],t,c),u=n0(l,t);i[":@"]?r0(l,i[":@"],c,t):Object.keys(l).length===1&&l[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?l=l[t.textNodeName]:Object.keys(l).length===0&&(t.alwaysCreateTextNode?l[t.textNodeName]="":l=""),s[a]!==void 0&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(l)):t.isArray(a,c,u)?s[a]=[l]:s[a]=l}}}return typeof n=="string"?n.length>0&&(s[t.textNodeName]=n):n!==void 0&&(s[t.textNodeName]=n),s}function e0(e){let t=Object.keys(e);for(let r=0;r<t.length;r++){let n=t[r];if(n!==":@")return n}}function r0(e,t,r,n){if(t){let s=Object.keys(t),o=s.length;for(let i=0;i<o;i++){let a=s[i];n.isArray(a,r+"."+a,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function n0(e,t){let{textNodeName:r}=t,n=Object.keys(e).length;return!!(n===0||n===1&&(e[r]||typeof e[r]=="boolean"||e[r]===0))}zl.prettify=t0});var ql=tt((db,Jl)=>{var{buildOptions:s0}=Ll(),o0=Vl(),{prettify:i0}=kl(),a0=si(),ui=class{constructor(t){this.externalEntities={},this.options=s0(t)}parse(t,r){if(typeof t!="string")if(t.toString)t=t.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(r){r===!0&&(r={});let o=a0.validate(t,r);if(o!==!0)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}let n=new o0(this.options);n.addExternalEntities(this.externalEntities);let s=n.parseXml(t);return this.options.preserveOrder||s===void 0?s:i0(s,this.options)}addEntity(t,r){if(r.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(r==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=r}};Jl.exports=ui});var Kl=tt((pb,Yl)=>{var c0=`
|
|
11
11
|
`;function l0(e,t){let r="";return t.format&&t.indentBy.length>0&&(r=c0),Xl(e,t,"",r)}function Xl(e,t,r,n){let s="",o=!1;for(let i=0;i<e.length;i++){let a=e[i],c=u0(a);if(c===void 0)continue;let l="";if(r.length===0?l=c:l=`${r}.${c}`,c===t.textNodeName){let p=a[c];f0(l,t)||(p=t.tagValueProcessor(c,p),p=Wl(p,t)),o&&(s+=n),s+=p,o=!1;continue}else if(c===t.cdataPropName){o&&(s+=n),s+=`<![CDATA[${a[c][0][t.textNodeName]}]]>`,o=!1;continue}else if(c===t.commentPropName){s+=n+`<!--${a[c][0][t.textNodeName]}-->`,o=!0;continue}else if(c[0]==="?"){let p=jl(a[":@"],t),A=c==="?xml"?"":n,g=a[c][0][t.textNodeName];g=g.length!==0?" "+g:"",s+=A+`<${c}${g}${p}?>`,o=!0;continue}let u=n;u!==""&&(u+=t.indentBy);let f=jl(a[":@"],t),h=n+`<${c}${f}`,d=Xl(a[c],t,l,u);t.unpairedTags.indexOf(c)!==-1?t.suppressUnpairedNode?s+=h+">":s+=h+"/>":(!d||d.length===0)&&t.suppressEmptyNode?s+=h+"/>":d&&d.endsWith(">")?s+=h+`>${d}${n}</${c}>`:(s+=h+">",d&&n!==""&&(d.includes("/>")||d.includes("</"))?s+=n+t.indentBy+d+n:s+=d,s+=`</${c}>`),o=!0}return s}function u0(e){let t=Object.keys(e);for(let r=0;r<t.length;r++){let n=t[r];if(e.hasOwnProperty(n)&&n!==":@")return n}}function jl(e,t){let r="";if(e&&!t.ignoreAttributes)for(let n in e){if(!e.hasOwnProperty(n))continue;let s=t.attributeValueProcessor(n,e[n]);s=Wl(s,t),s===!0&&t.suppressBooleanAttributes?r+=` ${n.substr(t.attributeNamePrefix.length)}`:r+=` ${n.substr(t.attributeNamePrefix.length)}="${s}"`}return r}function f0(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);let r=e.substr(e.lastIndexOf(".")+1);for(let n in t.stopNodes)if(t.stopNodes[n]===e||t.stopNodes[n]==="*."+r)return!0;return!1}function Wl(e,t){if(e&&e.length>0&&t.processEntities)for(let r=0;r<t.entities.length;r++){let n=t.entities[r];e=e.replace(n.regex,n.val)}return e}Yl.exports=l0});var Zl=tt((mb,Ql)=>{"use strict";var h0=Kl(),d0={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function he(e){this.options=Object.assign({},d0,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=g0),this.processTextOrObjNode=p0,this.options.format?(this.indentate=m0,this.tagEndChar=`>
|
|
12
12
|
`,this.newLine=`
|
|
13
|
-
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}he.prototype.build=function(e){return this.options.preserveOrder?h0(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)};he.prototype.j2x=function(e,t){let r="",n="";for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(typeof e[s]>"u")this.isAttribute(s)&&(n+="");else if(e[s]===null)this.isAttribute(s)?n+="":s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(e[s]instanceof Date)n+=this.buildTextValNode(e[s],s,"",t);else if(typeof e[s]!="object"){let o=this.isAttribute(s);if(o)r+=this.buildAttrPairStr(o,""+e[s]);else if(s===this.options.textNodeName){let i=this.options.tagValueProcessor(s,""+e[s]);n+=this.replaceEntitiesValue(i)}else n+=this.buildTextValNode(e[s],s,"",t)}else if(Array.isArray(e[s])){let o=e[s].length,i="";for(let a=0;a<o;a++){let c=e[s][a];typeof c>"u"||(c===null?s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar:typeof c=="object"?this.options.oneListGroup?i+=this.j2x(c,t+1).val:i+=this.processTextOrObjNode(c,s,t):i+=this.buildTextValNode(c,s,"",t))}this.options.oneListGroup&&(i=this.buildObjectNode(i,s,"",t)),n+=i}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){let o=Object.keys(e[s]),i=o.length;for(let a=0;a<i;a++)r+=this.buildAttrPairStr(o[a],""+e[s][o[a]])}else n+=this.processTextOrObjNode(e[s],s,t);return{attrStr:r,val:n}};he.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'};function p0(e,t,r){let n=this.j2x(e,r+1);return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,r):this.buildObjectNode(n.val,t,n.attrStr,r)}he.prototype.buildObjectNode=function(e,t,r,n){if(e==="")return t[0]==="?"?this.indentate(n)+"<"+t+r+"?"+this.tagEndChar:this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar;{let s="</"+t+this.tagEndChar,o="";return t[0]==="?"&&(o="?",s=""),(r||r==="")&&e.indexOf("<")===-1?this.indentate(n)+"<"+t+r+o+">"+e+s:this.options.commentPropName!==!1&&t===this.options.commentPropName&&o.length===0?this.indentate(n)+`<!--${e}-->`+this.newLine:this.indentate(n)+"<"+t+r+o+this.tagEndChar+e+this.indentate(n)+s}};he.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${e}`,t};he.prototype.buildTextValNode=function(e,t,r,n){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(n)+`<!--${e}-->`+this.newLine;if(t[0]==="?")return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(t,e);return s=this.replaceEntitiesValue(s),s===""?this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+r+">"+s+"</"+t+this.tagEndChar}};he.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let r=this.options.entities[t];e=e.replace(r.regex,r.val)}return e};function m0(e){return this.options.indentBy.repeat(e)}function g0(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}Ql.exports=he});var tu=tt((gb,$l)=>{"use strict";var A0=si(),x0=ql(),y0=Zl();$l.exports={XMLParser:x0,XMLValidator:A0,XMLBuilder:y0}});var ga=tt((jf,fn)=>{(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof yl=="function"&&typeof fn=="object"&&fn&&fn.exports?fn.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(jf,function(){"use strict";function e(T,m,M){this.low=T|0,this.high=m|0,this.unsigned=!!M}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function t(T){return(T&&T.__isLong__)===!0}e.isLong=t;var r={},n={};function s(T,m){var M,L,R;return m?(T>>>=0,(R=0<=T&&T<256)&&(L=n[T],L)?L:(M=i(T,(T|0)<0?-1:0,!0),R&&(n[T]=M),M)):(T|=0,(R=-128<=T&&T<128)&&(L=r[T],L)?L:(M=i(T,T<0?-1:0,!1),R&&(r[T]=M),M))}e.fromInt=s;function o(T,m){if(isNaN(T)||!isFinite(T))return m?y:g;if(m){if(T<0)return y;if(T>=d)return b}else{if(T<=-p)return w;if(T+1>=p)return S}return T<0?o(-T,m).neg():i(T%h|0,T/h|0,m)}e.fromNumber=o;function i(T,m,M){return new e(T,m,M)}e.fromBits=i;var a=Math.pow;function c(T,m,M){if(T.length===0)throw Error("empty string");if(T==="NaN"||T==="Infinity"||T==="+Infinity"||T==="-Infinity")return g;if(typeof m=="number"?(M=m,m=!1):m=!!m,M=M||10,M<2||36<M)throw RangeError("radix");var L;if((L=T.indexOf("-"))>0)throw Error("interior hyphen");if(L===0)return c(T.substring(1),m,M).neg();for(var R=o(a(M,8)),F=g,D=0;D<T.length;D+=8){var X=Math.min(8,T.length-D),H=parseInt(T.substring(D,D+X),M);if(X<8){var Q=o(a(M,X));F=F.mul(Q).add(o(H))}else F=F.mul(R),F=F.add(o(H))}return F.unsigned=m,F}e.fromString=c;function l(T){return T instanceof e?T:typeof T=="number"?o(T):typeof T=="string"?c(T):i(T.low,T.high,T.unsigned)}e.fromValue=l;var u=1<<16,f=1<<24,h=u*u,d=h*h,p=d/2,A=s(f),g=s(0);e.ZERO=g;var y=s(0,!0);e.UZERO=y;var E=s(1);e.ONE=E;var _=s(1,!0);e.UONE=_;var B=s(-1);e.NEG_ONE=B;var S=i(-1,2147483647,!1);e.MAX_VALUE=S;var b=i(-1,-1,!0);e.MAX_UNSIGNED_VALUE=b;var w=i(0,-2147483648,!1);e.MIN_VALUE=w;var C=e.prototype;return C.toInt=function(){return this.unsigned?this.low>>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},C.toString=function(m){if(m=m||10,m<2||36<m)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(w)){var M=o(m),L=this.div(M),R=L.mul(M).sub(this);return L.toString(m)+R.toInt().toString(m)}else return"-"+this.neg().toString(m);for(var F=o(a(m,6),this.unsigned),D=this,X="";;){var H=D.div(F),Q=D.sub(H.mul(F)).toInt()>>>0,j=Q.toString(m);if(D=H,D.isZero())return j+X;for(;j.length<6;)j="0"+j;X=""+j+X}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var m=this.high!=0?this.high:this.low,M=31;M>0&&!(m&1<<M);M--);return this.high!=0?M+33:M+1},C.isZero=function(){return this.high===0&&this.low===0},C.isNegative=function(){return!this.unsigned&&this.high<0},C.isPositive=function(){return this.unsigned||this.high>=0},C.isOdd=function(){return(this.low&1)===1},C.isEven=function(){return(this.low&1)===0},C.equals=function(m){return t(m)||(m=l(m)),this.unsigned!==m.unsigned&&this.high>>>31===1&&m.high>>>31===1?!1:this.high===m.high&&this.low===m.low},C.eq=C.equals,C.notEquals=function(m){return!this.eq(m)},C.neq=C.notEquals,C.lessThan=function(m){return this.comp(m)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(m){return this.comp(m)<=0},C.lte=C.lessThanOrEqual,C.greaterThan=function(m){return this.comp(m)>0},C.gt=C.greaterThan,C.greaterThanOrEqual=function(m){return this.comp(m)>=0},C.gte=C.greaterThanOrEqual,C.compare=function(m){if(t(m)||(m=l(m)),this.eq(m))return 0;var M=this.isNegative(),L=m.isNegative();return M&&!L?-1:!M&&L?1:this.unsigned?m.high>>>0>this.high>>>0||m.high===this.high&&m.low>>>0>this.low>>>0?-1:1:this.sub(m).isNegative()?-1:1},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(E)},C.neg=C.negate,C.add=function(m){t(m)||(m=l(m));var M=this.high>>>16,L=this.high&65535,R=this.low>>>16,F=this.low&65535,D=m.high>>>16,X=m.high&65535,H=m.low>>>16,Q=m.low&65535,j=0,W=0,$=0,At=0;return At+=F+Q,$+=At>>>16,At&=65535,$+=R+H,W+=$>>>16,$&=65535,W+=L+X,j+=W>>>16,W&=65535,j+=M+D,j&=65535,i($<<16|At,j<<16|W,this.unsigned)},C.subtract=function(m){return t(m)||(m=l(m)),this.add(m.neg())},C.sub=C.subtract,C.multiply=function(m){if(this.isZero()||(t(m)||(m=l(m)),m.isZero()))return g;if(this.eq(w))return m.isOdd()?w:g;if(m.eq(w))return this.isOdd()?w:g;if(this.isNegative())return m.isNegative()?this.neg().mul(m.neg()):this.neg().mul(m).neg();if(m.isNegative())return this.mul(m.neg()).neg();if(this.lt(A)&&m.lt(A))return o(this.toNumber()*m.toNumber(),this.unsigned);var M=this.high>>>16,L=this.high&65535,R=this.low>>>16,F=this.low&65535,D=m.high>>>16,X=m.high&65535,H=m.low>>>16,Q=m.low&65535,j=0,W=0,$=0,At=0;return At+=F*Q,$+=At>>>16,At&=65535,$+=R*Q,W+=$>>>16,$&=65535,$+=F*H,W+=$>>>16,$&=65535,W+=L*Q,j+=W>>>16,W&=65535,W+=R*H,j+=W>>>16,W&=65535,W+=F*X,j+=W>>>16,W&=65535,j+=M*Q+L*H+R*X+F*D,j&=65535,i($<<16|At,j<<16|W,this.unsigned)},C.mul=C.multiply,C.divide=function(m){if(t(m)||(m=l(m)),m.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?y:g;var M,L,R;if(this.unsigned){if(m.unsigned||(m=m.toUnsigned()),m.gt(this))return y;if(m.gt(this.shru(1)))return _;R=y}else{if(this.eq(w)){if(m.eq(E)||m.eq(B))return w;if(m.eq(w))return E;var F=this.shr(1);return M=F.div(m).shl(1),M.eq(g)?m.isNegative()?E:B:(L=this.sub(m.mul(M)),R=M.add(L.div(m)),R)}else if(m.eq(w))return this.unsigned?y:g;if(this.isNegative())return m.isNegative()?this.neg().div(m.neg()):this.neg().div(m).neg();if(m.isNegative())return this.div(m.neg()).neg();R=g}for(L=this;L.gte(m);){M=Math.max(1,Math.floor(L.toNumber()/m.toNumber()));for(var D=Math.ceil(Math.log(M)/Math.LN2),X=D<=48?1:a(2,D-48),H=o(M),Q=H.mul(m);Q.isNegative()||Q.gt(L);)M-=X,H=o(M,this.unsigned),Q=H.mul(m);H.isZero()&&(H=E),R=R.add(H),L=L.sub(Q)}return R},C.div=C.divide,C.modulo=function(m){return t(m)||(m=l(m)),this.sub(this.div(m).mul(m))},C.mod=C.modulo,C.not=function(){return i(~this.low,~this.high,this.unsigned)},C.and=function(m){return t(m)||(m=l(m)),i(this.low&m.low,this.high&m.high,this.unsigned)},C.or=function(m){return t(m)||(m=l(m)),i(this.low|m.low,this.high|m.high,this.unsigned)},C.xor=function(m){return t(m)||(m=l(m)),i(this.low^m.low,this.high^m.high,this.unsigned)},C.shiftLeft=function(m){return t(m)&&(m=m.toInt()),(m&=63)===0?this:m<32?i(this.low<<m,this.high<<m|this.low>>>32-m,this.unsigned):i(0,this.low<<m-32,this.unsigned)},C.shl=C.shiftLeft,C.shiftRight=function(m){return t(m)&&(m=m.toInt()),(m&=63)===0?this:m<32?i(this.low>>>m|this.high<<32-m,this.high>>m,this.unsigned):i(this.high>>m-32,this.high>=0?0:-1,this.unsigned)},C.shr=C.shiftRight,C.shiftRightUnsigned=function(m){if(t(m)&&(m=m.toInt()),m&=63,m===0)return this;var M=this.high;if(m<32){var L=this.low;return i(L>>>m|M<<32-m,M>>>m,this.unsigned)}else return m===32?i(M,0,this.unsigned):i(M>>>m-32,0,this.unsigned)},C.shru=C.shiftRightUnsigned,C.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},C.toBytes=function(T){return T?this.toBytesLE():this.toBytesBE()},C.toBytesLE=function(){var T=this.high,m=this.low;return[m&255,m>>>8&255,m>>>16&255,m>>>24&255,T&255,T>>>8&255,T>>>16&255,T>>>24&255]},C.toBytesBE=function(){var T=this.high,m=this.low;return[T>>>24&255,T>>>16&255,T>>>8&255,T&255,m>>>24&255,m>>>16&255,m>>>8&255,m&255]},e})});var Us=tt((XR,Bh)=>{Bh.exports=globalThis.h3||{}});var wa=tt((rP,Ih)=>{Ih.exports=globalThis.luma});var zs=tt((nP,wh)=>{wh.exports=globalThis.deck});var Lh=tt((sP,Fh)=>{Fh.exports=globalThis.luma});var yr=tt((WP,nd)=>{nd.exports=globalThis.loaders});var Tm=tt((YG,ym)=>{ym.exports=globalThis.deck});var Fm=tt(il=>{il.read=function(e,t,r,n,s){var o,i,a=s*8-n-1,c=(1<<a)-1,l=c>>1,u=-7,f=r?s-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-u)-1,d>>=-u,u+=a;u>0;o=o*256+e[t+f],f+=h,u-=8);for(i=o&(1<<-u)-1,o>>=-u,u+=n;u>0;i=i*256+e[t+f],f+=h,u-=8);if(o===0)o=1-l;else{if(o===c)return i?NaN:(d?-1:1)*(1/0);i=i+Math.pow(2,n),o=o-l}return(d?-1:1)*i*Math.pow(2,o-n)};il.write=function(e,t,r,n,s,o){var i,a,c,l=o*8-s-1,u=(1<<l)-1,f=u>>1,h=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,A=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-i))<1&&(i--,c*=2),i+f>=1?t+=h/c:t+=h*Math.pow(2,1-f),t*c>=2&&(i++,c/=2),i+f>=u?(a=0,i=u):i+f>=1?(a=(t*c-1)*Math.pow(2,s),i=i+f):(a=t*Math.pow(2,f-1)*Math.pow(2,s),i=0));s>=8;e[r+d]=a&255,d+=p,a/=256,s-=8);for(i=i<<s|a,l+=s;l>0;e[r+d]=i&255,d+=p,i/=256,l-=8);e[r+d-p]|=A*128}});var Dm=tt((D4,Nm)=>{"use strict";Nm.exports=k;var qo=Fm();function k(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}k.Varint=0;k.Fixed64=1;k.Bytes=2;k.Fixed32=5;var al=(1<<16)*(1<<16),Lm=1/al,sS=12,Om=typeof TextDecoder>"u"?null:new TextDecoder("utf8");k.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),s=n>>3,o=this.pos;this.type=n&7,e(s,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=jo(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Pm(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=jo(this.buf,this.pos)+jo(this.buf,this.pos+4)*al;return this.pos+=8,e},readSFixed64:function(){var e=jo(this.buf,this.pos)+Pm(this.buf,this.pos+4)*al;return this.pos+=8,e},readFloat:function(){var e=qo.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=qo.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,r,n;return n=t[this.pos++],r=n&127,n<128||(n=t[this.pos++],r|=(n&127)<<7,n<128)||(n=t[this.pos++],r|=(n&127)<<14,n<128)||(n=t[this.pos++],r|=(n&127)<<21,n<128)?r:(n=t[this.pos],r|=(n&15)<<28,oS(r,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=sS&&Om?yS(this.buf,t,e):xS(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==k.Bytes)return e.push(this.readVarint(t));var r=ue(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==k.Bytes)return e.push(this.readSVarint());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==k.Bytes)return e.push(this.readBoolean());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==k.Bytes)return e.push(this.readFloat());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==k.Bytes)return e.push(this.readDouble());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==k.Bytes)return e.push(this.readFixed32());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==k.Bytes)return e.push(this.readSFixed32());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==k.Bytes)return e.push(this.readFixed64());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==k.Bytes)return e.push(this.readSFixed64());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=e&7;if(t===k.Varint)for(;this.buf[this.pos++]>127;);else if(t===k.Bytes)this.pos=this.readVarint()+this.pos;else if(t===k.Fixed32)this.pos+=4;else if(t===k.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Gr(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Gr(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Gr(this.buf,e&-1,this.pos),Gr(this.buf,Math.floor(e*Lm),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Gr(this.buf,e&-1,this.pos),Gr(this.buf,Math.floor(e*Lm),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){iS(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var t=this.pos;this.pos=TS(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Rm(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),qo.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),qo.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&Rm(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,k.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,lS,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,uS,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,dS,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,fS,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,hS,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,pS,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,mS,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,gS,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,AS,t)},writeBytesField:function(e,t){this.writeTag(e,k.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,k.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,k.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,k.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,k.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,k.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,k.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,k.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,k.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,k.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};function oS(e,t,r){var n=r.buf,s,o;if(o=n[r.pos++],s=(o&112)>>4,o<128||(o=n[r.pos++],s|=(o&127)<<3,o<128)||(o=n[r.pos++],s|=(o&127)<<10,o<128)||(o=n[r.pos++],s|=(o&127)<<17,o<128)||(o=n[r.pos++],s|=(o&127)<<24,o<128)||(o=n[r.pos++],s|=(o&1)<<31,o<128))return Ur(e,s,t);throw new Error("Expected varint not more than 10 bytes")}function ue(e){return e.type===k.Bytes?e.readVarint()+e.pos:e.pos+1}function Ur(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function iS(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),aS(r,n,t),cS(n,t)}function aS(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function cS(e,t){var r=(e&7)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function Rm(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(n);for(var s=r.pos-1;s>=e;s--)r.buf[s+n]=r.buf[s]}function lS(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function uS(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function fS(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function hS(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function dS(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function pS(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function mS(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function gS(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function AS(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function jo(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function Gr(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Pm(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function xS(e,t,r){for(var n="",s=t;s<r;){var o=e[s],i=null,a=o>239?4:o>223?3:o>191?2:1;if(s+a>r)break;var c,l,u;a===1?o<128&&(i=o):a===2?(c=e[s+1],(c&192)===128&&(i=(o&31)<<6|c&63,i<=127&&(i=null))):a===3?(c=e[s+1],l=e[s+2],(c&192)===128&&(l&192)===128&&(i=(o&15)<<12|(c&63)<<6|l&63,(i<=2047||i>=55296&&i<=57343)&&(i=null))):a===4&&(c=e[s+1],l=e[s+2],u=e[s+3],(c&192)===128&&(l&192)===128&&(u&192)===128&&(i=(o&15)<<18|(c&63)<<12|(l&63)<<6|u&63,(i<=65535||i>=1114112)&&(i=null))),i===null?(i=65533,a=1):i>65535&&(i-=65536,n+=String.fromCharCode(i>>>10&1023|55296),i=56320|i&1023),n+=String.fromCharCode(i),s+=a}return n}function yS(e,t,r){return Om.decode(e.subarray(t,r))}function TS(e,t,r){for(var n=0,s,o;n<t.length;n++){if(s=t.charCodeAt(n),s>55295&&s<57344)if(o)if(s<56320){e[r++]=239,e[r++]=191,e[r++]=189,o=s;continue}else s=o-55296<<10|s-56320|65536,o=null;else{s>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):o=s;continue}else o&&(e[r++]=239,e[r++]=191,e[r++]=189,o=null);s<128?e[r++]=s:(s<2048?e[r++]=s>>6|192:(s<65536?e[r++]=s>>12|224:(e[r++]=s>>18|240,e[r++]=s>>12&63|128),e[r++]=s>>6&63|128),e[r++]=s&63|128)}return r}});var Xn={};ut(Xn,{GeohashLayer:()=>jn,GreatCircleLayer:()=>un,H3ClusterLayer:()=>_n,H3HexagonLayer:()=>qe,MVTLayer:()=>qn,QuadkeyLayer:()=>dn,S2Layer:()=>hn,TerrainLayer:()=>Un,Tile3DLayer:()=>On,TileLayer:()=>Zt,TripsLayer:()=>xn,_GeoCellLayer:()=>St,_Tile2DHeader:()=>ke,_Tileset2D:()=>Je,_WMSLayer:()=>Es,_getURLFromTemplate:()=>Qt});var Jt={},_l=N(Nt(),1);fe(Jt,N(Nt(),1));if(!_l.GeoJsonLayer)throw new Error("@deck.gl/layers is not found");fe(Xn,Jt);var ze=N(Dt(),1),kf=N(Nt(),1);function fg(e){return typeof e=="string"?e.charAt(0).toLowerCase()+e.slice(1):e}function Yn(e){if(Array.isArray(e))return e.map(t=>Yn(t));if(e&&typeof e=="object"){let t={};for(let[r,n]of Object.entries(e))t[fg(r)]=Yn(n);return t}return e}var eu=N(tu(),1);function fi(e,t){if(t?._parser&&t._parser!=="fast-xml-parser")throw new Error(t?._parser);let r={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:t?.removeNSPrefix,textNodeName:t?.textNodeName,isArray:(s,o,i,a)=>Boolean(t?.arrayPaths?.some(l=>o===l)),...t?._fastXML},n=T0(e,r);return t?.uncapitalizeKeys?Yn(n):n}function T0(e,t){return new eu.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...t}).parse(e)}var _0="4.2.0-beta.2",vt={dataType:null,batchType:null,name:"XML",id:"xml",module:"xml",version:_0,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:E0,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(e,t)=>fi(new TextDecoder().decode(e),{...vt.options.xml,...t?.xml}),parseTextSync:(e,t)=>fi(e,{...vt.options.xml,...t?.xml})};function E0(e){return e.startsWith("<?xml")}async function Et(e,t,r,n){return n._parse(e,t,r,n)}function G(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var qt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},B0=qt.self||qt.window||qt.global||{},C0=qt.window||qt.self||qt.global||{},S0=qt.global||qt.self||qt.window||{},b0=qt.document||{};var Jr=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var ru=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),M0=ru&&parseFloat(ru[1])||0;var Qn=globalThis,I0=globalThis.document||{},Zn=globalThis.process||{},w0=globalThis.console,Cb=globalThis.navigator||{};function nu(e){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let t=typeof navigator<"u"&&navigator.userAgent,r=e||t;return Boolean(r&&r.indexOf("Electron")>=0)}function Le(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||nu()}var hi="4.0.7";function L0(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var $n=class{constructor(t,r,n="sessionStorage"){this.storage=L0(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function su(e){let t;return e<10?t=`${e.toFixed(2)}ms`:e<100?t=`${e.toFixed(1)}ms`:e<1e3?t=`${e.toFixed(0)}ms`:t=`${(e/1e3).toFixed(2)}s`,t}function ou(e,t=8){let r=Math.max(t-e.length,0);return`${" ".repeat(r)}${e}`}var ts;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(ts||(ts={}));var R0=10;function iu(e){return typeof e!="string"?e:(e=e.toUpperCase(),ts[e]||ts.WHITE)}function au(e,t,r){return!Le&&typeof e=="string"&&(t&&(e=`\x1B[${iu(t)}m${e}\x1B[39m`),r&&(e=`\x1B[${iu(r)+R0}m${e}\x1B[49m`)),e}function cu(e,t=["constructor"]){let r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),s=e;for(let o of n){let i=s[o];typeof i=="function"&&(t.find(a=>o===a)||(s[o]=i.bind(e)))}}function qr(e,t){if(!e)throw new Error(t||"Assertion failed")}function Re(){let e;if(Le()&&Qn.performance)e=Qn?.performance?.now?.();else if("hrtime"in Zn){let t=Zn?.hrtime?.();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var cr={debug:Le()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},P0={enabled:!0,level:0};function lr(){}var lu={},uu={once:!0},jr=class{constructor({id:t}={id:""}){this.VERSION=hi,this._startTs=Re(),this._deltaTs=Re(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new $n(`__probe-${this.id}__`,P0),this.timeStamp(`${this.id} started`),cu(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Re()-this._startTs).toPrecision(10))}getDelta(){return Number((Re()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){if(!t)throw new Error(r||"Assertion failed")}warn(t){return this._getLogFunction(0,t,cr.warn,arguments,uu)}error(t){return this._getLogFunction(0,t,cr.error,arguments)}deprecated(t,r){return this.warn(`\`${t}\` is deprecated and will be removed in a later version. Use \`${r}\` instead`)}removed(t,r){return this.error(`\`${t}\` has been removed. Use \`${r}\` instead`)}probe(t,r){return this._getLogFunction(t,r,cr.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,cr.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,cr.debug||cr.info,arguments,uu)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||lr,n&&[n],{tag:N0(r)}):lr}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||lr)}group(t,r,n={collapsed:!1}){let s=fu({logLevel:t,message:r,opts:n}),{collapsed:o}=n;return s.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(s)}groupCollapsed(t,r,n={}){return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||lr)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=hu(t)}_getLogFunction(t,r,n,s,o){if(this._shouldLog(t)){o=fu({logLevel:t,message:r,args:s,opts:o}),n=n||o.method,qr(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Re();let i=o.tag||o.message;if(o.once&&i)if(!lu[i])lu[i]=Re();else return lr;return r=O0(this.id,o.message,o),n.bind(console,r,...o.args)}return lr}};jr.VERSION=hi;function hu(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return qr(Number.isFinite(t)&&t>=0),t}function fu(e){let{logLevel:t,message:r}=e;e.logLevel=hu(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let s=typeof e.message;return qr(s==="string"||s==="object"),Object.assign(e,{args:n},e.opts)}function O0(e,t,r){if(typeof t=="string"){let n=r.time?ou(su(r.total)):"";t=r.time?`${e}: ${n} ${t}`:`${e}: ${t}`,t=au(t,r.color,r.background)}return t}function N0(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}globalThis.probe={};var di=new jr({id:"@probe.gl/log"});function pi(e,t){return du(e||{},t)}function du(e,t,r=0){if(r>3)return t;let n={...e};for(let[s,o]of Object.entries(t))o&&typeof o=="object"&&!Array.isArray(o)?n[s]=du(n[s]||{},t[s],r+1):n[s]=t[s];return n}function mi(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function gi(e){return globalThis.loaders?.modules?.[e]||null}function D0(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.0-beta.2"),globalThis._loadersgl_.version}var pu=D0();function mu(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var jt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},eM=jt.self||jt.window||jt.global||{},rM=jt.window||jt.self||jt.global||{},nM=jt.global||jt.self||jt.window||{},sM=jt.document||{};var ur=typeof process!="object"||String(process)!=="[object process]"||process.browser,es=typeof importScripts=="function",oM=typeof window<"u"&&typeof window.orientation<"u",gu=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),iM=gu&&parseFloat(gu[1])||0;var Ai={};async function Xt(e,t=null,r={},n=null){return t&&(e=Au(e,t,r,n)),Ai[e]=Ai[e]||v0(e),await Ai[e]}function Au(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let s=r.modules||{};return s[n]?s[n]:ur?r.CDN?(mu(r.CDN.startsWith("http")),`${r.CDN}/${t}@${pu}/dist/libs/${n}`):es?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function v0(e){if(e.endsWith("wasm"))return await G0(e);if(!ur)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(e)}catch(r){return console.error(r),null}if(es)return importScripts(e);let t=await V0(e);return U0(t,e)}function U0(e,t){if(!ur){let{requireFromString:n}=globalThis.loaders||{};return n?.(e,t)}if(es)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function G0(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};return ur||!t||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await t(e)}async function V0(e){let{readFileAsText:t}=globalThis.loaders||{};return ur||!t||e.startsWith("http")?await(await fetch(e)).text():await t(e)}function yu(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?xu(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?xu(e,0,t):""}function xu(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),s="";for(let o=0;o<r;o++)s+=String.fromCharCode(n.getUint8(t+o));return s}function xi(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${yu(e)}"`)}}function Xr(...e){let t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let n=t.reduce((i,a)=>i+a.length,0),s=new r(n),o=0;for(let i of t)s.set(i,o),o+=i.length;return s}function Pe(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function de(e,t){return G(e>=0),G(t>0),e+(t-1)&~(t-1)}function yi(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let s=e.byteOffset,o=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,s,o)}return t.set(n,r),r+de(n.byteLength,4)}function Wr(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Oe=class{constructor(t,r){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Wr(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Wr()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var pe=class{constructor(t){this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t,r="count"){return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(t=[]){t.forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,s=this.stats[r];return s||(t instanceof Oe?s=t:s=new Oe(r,n),this.stats[r]=s),s}};var H0="Queued Requests",z0="Active Requests",k0="Cancelled Requests",J0="Queued Requests Ever",q0="Active Requests Ever",j0={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0},me=class{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(t={}){this.props={...j0,...t},this.stats=new pe({id:this.props.id}),this.stats.get(H0),this.stats.get(z0),this.stats.get(k0),this.stats.get(J0),this.stats.get(q0)}scheduleRequest(t,r=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);let n={handle:t,priority:0,getPriority:r},s=new Promise(o=>(n.resolve=o,n));return this.requestQueue.push(n),this.requestMap.set(t,s),this._issueNewRequests(),s}_issueRequest(t){let{handle:r,resolve:n}=t,s=!1,o=()=>{s||(s=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:o}):Promise.resolve({done:o})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(let r=0;r<t;++r){let n=this.requestQueue.shift();n&&this._issueRequest(n)}}}_updateAllRequests(){let t=this.requestQueue;for(let r=0;r<t.length;++r){let n=t[r];this._updateRequest(n)||(t.splice(r,1),this.requestMap.delete(n.handle),r--)}t.sort((r,n)=>r.priority-n.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}};var ge={};ut(ge,{dirname:()=>W0,filename:()=>X0,join:()=>Y0,resolve:()=>K0});function Tu(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function X0(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function W0(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function Y0(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function K0(...e){let t=[];for(let o=0;o<e.length;o++)t[o]=e[o];let r="",n=!1,s;for(let o=t.length-1;o>=-1&&!n;o--){let i;o>=0?i=t[o]:(s===void 0&&(s=Tu()),i=s),i.length!==0&&(r=`${i}/${r}`,n=i.charCodeAt(0)===Yr)}return r=Q0(r,!n),n?`/${r}`:r.length>0?r:"."}var Yr=47,Ti=46;function Q0(e,t){let r="",n=-1,s=0,o,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)o=e.charCodeAt(a);else{if(o===Yr)break;o=Yr}if(o===Yr){if(!(n===a-1||s===1))if(n!==a-1&&s===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==Ti||r.charCodeAt(r.length-2)!==Ti){if(r.length>2){let c=r.length-1,l=c;for(;l>=0&&r.charCodeAt(l)!==Yr;--l);if(l!==c){r=l===-1?"":r.slice(0,l),n=a,s=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,s=0,i=!1;continue}}t&&(r.length>0?r+="/..":r="..",i=!0)}else{let c=e.slice(n+1,a);r.length>0?r+=`/${c}`:r=c,i=!1}n=a,s=0}else o===Ti&&s!==-1?++s:s=-1}return r}var rs=class{fetch;loadOptions;_needsRefresh=!0;props;constructor(t){this.props={...t},this.loadOptions={...t.loadOptions},this.fetch=Z0(this.loadOptions)}setProps(t){this.props=Object.assign(this.props,t),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(t=!0){let r=this._needsRefresh;return t&&(this._needsRefresh=!1),r}};function Z0(e){let t=e?.fetch;if(t&&typeof t=="function")return(n,s)=>t(n,s);let r=e?.fetch;return r&&typeof r!="function"?n=>fetch(n,r):n=>fetch(n)}var Mt=class extends rs{};ar(Mt,"type","template"),ar(Mt,"testURL",t=>!1);function _u(e,t){let r=vt.parseTextSync?.(e,t),n=r?.ServiceExceptionReport?.ServiceException||r?.["ogc:ServiceExceptionReport"]?.["ogc:ServiceException"];return typeof n=="string"?n:n.value||n.code||"Unknown error"}var $0="4.2.0-beta.2",Kr={dataType:null,batchType:null,id:"wms-error",name:"WMS Error",module:"wms",version:$0,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:tA,options:{wms:{throwOnError:!1}},parse:async(e,t)=>_i(new TextDecoder().decode(e),t),parseSync:(e,t)=>_i(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>_i(e,t)};function tA(e){return e.startsWith("<?xml")}function _i(e,t){let r={...Kr.options.wms,...t?.wms},n=_u(e,r),s=r.minimalErrors?n:`WMS Service error: ${n}`;if(r.throwOnError)throw new Error(s);return s}function Ne(e){return Array.isArray(e)?e:e?[e]:[]}function Qr(e){let t=Ne(e);return t.length>0&&t.every(r=>typeof r=="string")?t:[]}function Zr(e,t=void 0){switch(typeof e){case"number":return e;case"string":return parseFloat(e);default:return}}function ns(e,t=void 0){switch(typeof e){case"number":return e;case"string":return parseInt(e,10);default:return}}function De(e){switch(e){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function Ei(e,t){let r=vt.parseTextSync?.(e,t),n=r.WMT_MS_Capabilities||r.WMS_Capabilities||r,s=eA(n);if(t?.inheritedLayerProps)for(let o of s.layers)Bu(o,null);return t?.includeRawJSON&&(s.json=n),t?.includeXMLText&&(s.xml=e),s}function eA(e){let t={version:String(e.version||""),name:String(e.Service?.Name||"unnamed"),title:e.Service?.Title?String(e.Service?.Title):void 0,abstract:e.Service?.Abstract?String(e.Service?.Abstract):void 0,keywords:Qr(e.Service?.KeywordList?.Keyword),fees:e.Service?.Fees?JSON.stringify(e.Service?.Fees):void 0,accessConstraints:e.Service?.AccessConstraints?JSON.stringify(e.Service?.AccessConstraints):void 0,layerLimit:ns(e.Service?.LayerLimit),maxWidth:ns(e.Service?.maxWidth),maxHeight:ns(e.Service?.maxHeight),layers:[],requests:rA(e.Capability?.Request),exceptions:nA(e.Exception)},r=Ne(e.Capability?.Layer);for(let n of r)t.layers.push(Eu(n));for(let[n,s]of Object.entries(t))s===void 0&&delete t[n];return t}function rA(e){let t={};for(let[r,n]of Object.entries(e||{})){let s=Qr(n?.Format);t[r]={mimeTypes:s}}return t}function nA(e){if(Ne(e?.Format).length>0)return{mimeTypes:Qr(e)}}function Eu(e){let t={title:String(e?.Title||""),name:e?.Name&&String(e?.Name),abstract:e?.Name&&String(e?.Abstract),keywords:Qr(e.KeywordList?.Keyword)},r=e?.CRS||e?.SRS;r&&Array.isArray(r)&&r.every(l=>typeof l=="string")&&(t.crs=r);let n=e?.EX_GeographicBoundingBox&&sA(e?.EX_GeographicBoundingBox);n&&(t.geographicBoundingBox=n),n=e?.LatLonBoundingBox&&oA(e?.LatLonBoundingBox),n&&(t.geographicBoundingBox=n);let s=e?.BoundingBox&&iA(e?.BoundingBox);s&&s.length>0&&(t.boundingBoxes=s);let i=Ne(e?.Dimension).map(l=>cA(l));i.length&&(t.dimensions=i),e?.opaque&&(t.opaque=De(e?.opaque)),e?.cascaded&&(t.cascaded=De(e?.cascaded)),e?.queryable&&(t.queryable=De(e?.queryable));let a=Ne(e?.Layer),c=[];for(let l of a)c.push(Eu(l));c.length>0&&(t.layers=c);for(let[l,u]of Object.entries(t))u===void 0&&delete t[l];return t}function sA(e){let{westBoundLongitude:t,northBoundLatitude:r,eastBoundLongitude:n,southBoundLatitude:s}=e;return[[t,s],[n,r]]}function oA(e){let{minx:t,miny:r,maxx:n,maxy:s}=e;return[[t,r],[n,s]]}function iA(e){return Ne(e).map(r=>aA(r))}function aA(e){let{CRS:t,SRS:r,minx:n,miny:s,maxx:o,maxy:i,resx:a,resy:c}=e,l={crs:t||r,boundingBox:[[Zr(n),Zr(s)],[Zr(o),Zr(i)]]};return a&&(l.xResolution=a),c&&(l.yResolution=c),l}function cA(e){let{name:t,units:r,value:n}=e,s={name:t,units:r,extent:n};return e.unitSymbol&&(s.unitSymbol=e.unitSymbol),e.default&&(s.defaultValue=e.default),e.multipleValues&&(s.multipleValues=De(e.multipleValues)),e.nearestValue&&(s.nearestValue=De(e.nearestValue)),e.current&&(s.current=De(e.current)),s}function Bu(e,t){t?.geographicBoundingBox&&!e.geographicBoundingBox&&(e.geographicBoundingBox=[...t.geographicBoundingBox]),t?.crs&&!e.crs&&(e.crs=[...t.crs]),t?.boundingBoxes&&!e.boundingBoxes&&(e.boundingBoxes=[...t.boundingBoxes]),t?.dimensions&&!e.dimensions&&(e.dimensions=[...t.dimensions]);for(let r of e.layers||[])Bu(r,e)}var lA="4.2.0-beta.2",fr={dataType:null,batchType:null,id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:lA,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:uA,options:{wms:{}},parse:async(e,t)=>Ei(new TextDecoder().decode(e),t?.wms),parseTextSync:(e,t)=>Ei(e,t?.wms)};function uA(e){return e.startsWith("<?xml")}function Bi(e,t){let n=(vt.parseTextSync?.(e,t)).FeatureInfoResponse?.FIELDS||[];return{features:(Array.isArray(n)?n:[n]).map(o=>fA(o))}}function fA(e){return{attributes:e||{},type:"",bounds:{bottom:0,top:0,left:0,right:0}}}var Cu={...fr,dataType:null,id:"wms-feature-info",name:"WMS FeatureInfo",parse:async(e,t)=>Bi(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>Bi(e,t)};function Ci(e,t){return vt.parseTextSync?.(e,t)}var Su={...fr,dataType:null,id:"wms-layer-description",name:"WMS DescribeLayer",parse:async(e,t)=>Ci(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>Ci(e,t)};function bu(e,t){let{type:r="auto"}=e,n=r==="auto"?dA(e.url,t):hA(r,t);if(!n)throw new Error("Not a valid image source type");return n.create(e)}function hA(e,t){for(let r of t)if(r.type===e)return r;return null}function dA(e,t){for(let r of t)if(r.testURL&&r.testURL(e))return r;return null}var Mu="4.2.0-beta.2";var pA=globalThis.loaders?.parseImageNode,Si=typeof Image<"u",bi=typeof ImageBitmap<"u",mA=Boolean(pA),Mi=Jr?!0:mA;function Iu(e){switch(e){case"auto":return bi||Si||Mi;case"imagebitmap":return bi;case"image":return Si;case"data":return Mi;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function wu(){if(bi)return"imagebitmap";if(Si)return"image";if(Mi)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Fu(e){let t=gA(e);if(!t)throw new Error("Not an image");return t}function $r(e){switch(Fu(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function gA(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var AA=/^data:image\/svg\+xml/,xA=/\.svg((\?|#).*)?$/;function ss(e){return e&&(AA.test(e)||xA.test(e))}function Lu(e,t){if(ss(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Ii(e,t)}function Ii(e,t){if(ss(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function os(e,t,r){let n=Lu(e,r),s=self.URL||self.webkitURL,o=typeof n!="string"&&s.createObjectURL(n);try{return await yA(o||n,t)}finally{o&&s.revokeObjectURL(o)}}async function yA(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,s)=>{try{r.onload=()=>n(r),r.onerror=o=>{let i=o instanceof Error?o.message:"error";s(new Error(i))}}catch(o){s(o)}})}var TA={},Ru=!0;async function Pu(e,t,r){let n;ss(r)?n=await os(e,t,r):n=Ii(e,r);let s=t&&t.imagebitmap;return await _A(n,s)}async function _A(e,t=null){if((EA(t)||!Ru)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),Ru=!1}return await createImageBitmap(e)}function EA(e){for(let t in e||TA)return!1;return!0}function Ou(e){return!bA(e,"ftyp",4)||!(e[8]&96)?null:BA(e)}function BA(e){switch(CA(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function CA(e,t,r){return String.fromCharCode(...e.slice(t,r))}function SA(e){return[...e].map(t=>t.charCodeAt(0))}function bA(e,t,r=0){let n=SA(t);for(let s=0;s<n.length;++s)if(n[s]!==e[s+r])return!1;return!0}var Wt=!1,tn=!0;function ve(e){let t=en(e);return IA(t)||LA(t)||wA(t)||FA(t)||MA(t)}function MA(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=Ou(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function IA(e){let t=en(e);return t.byteLength>=24&&t.getUint32(0,Wt)===2303741511?{mimeType:"image/png",width:t.getUint32(16,Wt),height:t.getUint32(20,Wt)}:null}function wA(e){let t=en(e);return t.byteLength>=10&&t.getUint32(0,Wt)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,tn),height:t.getUint16(8,tn)}:null}function FA(e){let t=en(e);return t.byteLength>=14&&t.getUint16(0,Wt)===16973&&t.getUint32(2,tn)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,tn),height:t.getUint32(22,tn)}:null}function LA(e){let t=en(e);if(!(t.byteLength>=3&&t.getUint16(0,Wt)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=RA(),o=2;for(;o+9<t.byteLength;){let i=t.getUint16(o,Wt);if(s.has(i))return{mimeType:"image/jpeg",height:t.getUint16(o+5,Wt),width:t.getUint16(o+7,Wt)};if(!n.has(i))return null;o+=2,o+=t.getUint16(o,Wt)}return null}function RA(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function en(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function Nu(e,t){let{mimeType:r}=ve(e)||{},n=globalThis.loaders?.parseImageNode;return G(n),await n(e,r)}async function Du(e,t,r){t=t||{};let s=(t.image||{}).type||"auto",{url:o}=r||{},i=PA(s),a;switch(i){case"imagebitmap":a=await Pu(e,t,o);break;case"image":a=await os(e,t,o);break;case"data":a=await Nu(e,t);break;default:G(!1)}return s==="data"&&(a=$r(a)),a}function PA(e){switch(e){case"auto":case"data":return wu();default:return Iu(e),e}}var OA=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],NA=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],DA={image:{type:"auto",decode:!0}},Ae={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Mu,mimeTypes:NA,extensions:OA,parse:Du,tests:[e=>Boolean(ve(new DataView(e)))],options:DA};var wi={};function Fi(e){if(wi[e]===void 0){let t=Jr?UA(e):vA(e);wi[e]=t}return wi[e]}function vA(e){let t=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||t,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(e)}function UA(e){switch(e){case"image/avif":case"image/webp":return GA(e);default:return!0}}function GA(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}var vu={type:"wms",testURL:e=>e.toLowerCase().includes("wms"),create:e=>new Li(e)},Li=class extends Mt{url;data;substituteCRS84;flipCRS;wmsParameters;vendorParameters;capabilities=null;constructor(t){super(t),this.url=t.url,this.data=t.url,this.substituteCRS84=t.substituteCRS84??!1,this.flipCRS=["EPSG:4326"],this.wmsParameters={layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0,...t.wmsParameters},this.vendorParameters=t.vendorParameters||{}}async getMetadata(){let t=await this.getCapabilities();return this.normalizeMetadata(t)}async getImage(t){let{boundingBox:r,bbox:n,...s}=t,o={bbox:r?[...r[0],...r[1]]:n,...s};return await this.getMap(o)}normalizeMetadata(t){return t}async getCapabilities(t,r){let n=this.getCapabilitiesURL(t,r),s=await this.fetch(n),o=await s.arrayBuffer();this._checkResponse(s,o);let i=await fr.parse(o,this.loadOptions);return this.capabilities=i,i}async getMap(t,r){let n=this.getMapURL(t,r),s=await this.fetch(n),o=await s.arrayBuffer();this._checkResponse(s,o);try{return await Ae.parse(o,this.loadOptions)}catch{throw this._parseError(o)}}async getFeatureInfo(t,r){let n=this.getFeatureInfoURL(t,r),s=await this.fetch(n),o=await s.arrayBuffer();return this._checkResponse(s,o),await Cu.parse(o,this.loadOptions)}async getFeatureInfoText(t,r){let n=this.getFeatureInfoURL(t,r),s=await this.fetch(n),o=await s.arrayBuffer();return this._checkResponse(s,o),new TextDecoder().decode(o)}async describeLayer(t,r){let n=this.describeLayerURL(t,r),s=await this.fetch(n),o=await s.arrayBuffer();return this._checkResponse(s,o),await Su.parse(o,this.loadOptions)}async getLegendGraphic(t,r){let n=this.getLegendGraphicURL(t,r),s=await this.fetch(n),o=await s.arrayBuffer();this._checkResponse(s,o);try{return await Ae.parse(o,this.loadOptions)}catch{throw this._parseError(o)}}getCapabilitiesURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetCapabilities",n,r)}getMapURL(t,r){t=this._getWMS130Parameters(t);let n={version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetMap",n,r)}getFeatureInfoURL(t,r){t=this._getWMS130Parameters(t);let{boundingBox:n,bbox:s}=t;t.bbox=n?[...n[0],...n[1]]:s;let o={version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetFeatureInfo",o,r)}describeLayerURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("DescribeLayer",n,r)}getLegendGraphicURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetLegendGraphic",n,r)}_parseWMSUrl(t){let[r,n]=t.split("?"),s=n.split("&"),o={};for(let i of s){let[a,c]=i.split("=");o[a]=c}return{url:r,parameters:o}}_getWMSUrl(t,r,n){let s=this.url,o=!0,i={service:"WMS",version:r.version,request:t,...r,...this.vendorParameters,...n},a=["transparent","time","elevation"];for(let[c,l]of Object.entries(i))(!a.includes(c)||l)&&(s+=o?"?":"&",o=!1,s+=this._getURLParameter(c,l,r));return encodeURI(s)}_getWMS130Parameters(t){let r={...t};return r.srs&&(r.crs=r.crs||r.srs,delete r.srs),r}_getURLParameter(t,r,n){switch(t){case"crs":n.version!=="1.3.0"?t="srs":this.substituteCRS84&&r==="EPSG:4326"&&(r="CRS:84");break;case"srs":n.version==="1.3.0"&&(t="crs");break;case"bbox":let s=this._flipBoundingBox(r,n);s&&(r=s);break;case"x":n.version==="1.3.0"&&(t="i");break;case"y":n.version==="1.3.0"&&(t="j");break;default:}return t=t.toUpperCase(),Array.isArray(r)?`${t}=${r.join(",")}`:`${t}=${r?String(r):""}`}_flipBoundingBox(t,r){if(!Array.isArray(t)||t.length!==4)return null;let n=r.version==="1.3.0"&&this.flipCRS.includes(r.crs||"")&&!(this.substituteCRS84&&r.crs==="EPSG:4326"),s=t;return n?[s[1],s[0],s[3],s[2]]:s}async _fetchArrayBuffer(t){let r=await this.fetch(t),n=await r.arrayBuffer();return this._checkResponse(r,n),n}_checkResponse(t,r){let n=t.headers["content-type"];if(!t.ok||Kr.mimeTypes.includes(n)){let s=pi(this.loadOptions,{wms:{throwOnError:!0}}),o=Kr.parseSync?.(r,s);throw new Error(o)}}_parseError(t){let r=Kr.parseSync?.(t,this.loadOptions);return new Error(r)}};var hr=class extends Mt{constructor(t){super(t)}async getMetadata(){throw new Error("ImageSource.getMetadata not implemented")}async getImage(t){let r=this.getGranularParameters(t),n=this.getURLFromTemplate(r),o=await(await this.fetch(n)).arrayBuffer();return await Ae.parse(o)}getGranularParameters(t){let[[r,n],[s,o]]=t.boundingBox;return{...t,east:r,north:n,south:o,west:s}}getURLFromTemplate(t){let r=this.props.url;for(let[n,s]of Object.entries(t))r=r.replace(`\${${n}}`,String(s)),r=r.replace(`{${n}}`,String(s));return r}};ar(hr,"type","template"),ar(hr,"testURL",t=>t.toLowerCase().includes("{"));var Ri=class extends hr{data;constructor(t){super(t),this.data=t.url}async getMetadata(){return await this.metadata()}async getImage(t){throw new Error("not implemented")}async metadata(){throw new Error("not implemented")}exportImage(t){throw new Error("not implemented")}metadataURL(t){return`${this.props.url}?f=pjson`}exportImageURL(t){let r=`bbox=${t.bbox[0]},${t.bbox[1]},${t.bbox[2]},${t.bbox[3]}`,n=`size=${t.width},${t.height}`,s={...t,bbox:r,size:n};return delete s.width,delete s.height,this.getUrl("exportImage",s)}getUrl(t,r,n){let s=`${this.props.url}/${t}`,o=!0;for(let[i,a]of Object.entries(r))s+=o?"?":"&",o=!1,Array.isArray(a)?s+=`${i.toUpperCase()}=${a.join(",")}`:s+=`${i.toUpperCase()}=${a?String(a):""}`;return s}async checkResponse(t){if(!t.ok)throw new Error("error")}},Uu={type:"arcgis-image-server",testURL:e=>e.toLowerCase().includes("ImageServer"),create:e=>new Ri(e)};var VA=[vu,Uu];function Pi(e){return bu(e,VA)}var HA=1/Math.PI*180,zA=1/180*Math.PI,kA={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...kA}};var Y=globalThis.mathgl.config;function Oi(e,{precision:t=Y.precision}={}){return e=JA(e),`${parseFloat(e.toPrecision(t))}`}function Bt(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ni(e){return Gu(e)}function Di(e){return Ct(e)}function Gu(e,t){return vi(e,r=>r*zA,t)}function Ct(e,t){return vi(e,r=>r*HA,t)}function is(e,t,r){return vi(e,n=>Math.max(t,Math.min(r,n)))}function xe(e,t,r){return Bt(e)?e.map((n,s)=>xe(n,t[s],r)):r*t+(1-r)*e}function mt(e,t,r){let n=Y.EPSILON;r&&(Y.EPSILON=r);try{if(e===t)return!0;if(Bt(e)&&Bt(t)){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!mt(e[s],t[s]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=Y.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{Y.EPSILON=n}}function JA(e){return Math.round(e/Y.EPSILON)*Y.EPSILON}function qA(e){return e.clone?e.clone():new Array(e.length)}function vi(e,t,r){if(Bt(e)){let n=e;r=r||qA(n);for(let s=0;s<r.length&&s<n.length;++s){let o=typeof e=="number"?e:e[s];r[s]=t(o,s,r)}return r}return t(e)}var ye=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:Bt(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Y)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Oi(this[n],t);return`${t.printTypes?this.constructor.name:""}[${r}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!mt(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let s=0;s<this.ELEMENTS;++s){let o=t[s],i=typeof r=="number"?r:r[s];this[s]=o+n*(i-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(Y.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function jA(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function U(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function Te(e,t,r=""){if(Y.debug&&!jA(e,t))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return e}function at(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}var _e=class extends ye{get x(){return this[0]}set x(t){this[0]=U(t)}get y(){return this[1]}set y(t){this[1]=U(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-t[n];r+=s*s}return U(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return U(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return at(t>=0&&t<this.ELEMENTS,"index is out of range"),U(this[t])}setComponent(t,r){return at(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var Z=typeof Float32Array<"u"?Float32Array:Array,rn=Math.random;function dr(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var V2=Math.PI/180;function XA(){let e=new Z(2);return Z!=Float32Array&&(e[0]=0,e[1]=0),e}function Vu(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e}function Hu(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s+r[4],e[1]=r[1]*n+r[3]*s+r[5],e}function as(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[3]*s+r[6],e[1]=r[1]*n+r[4]*s+r[7],e}function cs(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[4]*s+r[12],e[1]=r[1]*n+r[5]*s+r[13],e}var H2=function(){let e=XA();return function(t,r,n,s,o,i){let a,c;for(r||(r=2),n||(n=0),s?c=Math.min(s*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function ls(e,t,r){let n=t[0],s=t[1],o=r[3]*n+r[7]*s||1;return e[0]=(r[0]*n+r[4]*s)/o,e[1]=(r[1]*n+r[5]*s)/o,e}function us(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o||1;return e[0]=(r[0]*n+r[4]*s+r[8]*o)/i,e[1]=(r[1]*n+r[5]*s+r[9]*o)/i,e[2]=(r[2]*n+r[6]*s+r[10]*o)/i,e}function zu(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e}function ku(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e[3]=t[3],e}function fs(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=r[0]*n+r[3]*s+r[6]*o,e[1]=r[1]*n+r[4]*s+r[7]*o,e[2]=r[2]*n+r[5]*s+r[8]*o,e[3]=t[3],e}var Ue=class extends _e{constructor(t=0,r=0){super(2),Bt(t)&&arguments.length===1?this.copy(t):(Y.debug&&(U(t),U(r)),this[0]=t,this[1]=r)}set(t,r){return this[0]=t,this[1]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return Y.debug&&(U(t.x),U(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return cs(this,this,t),this.check()}transformAsVector(t){return ls(this,this,t),this.check()}transformByMatrix3(t){return as(this,this,t),this.check()}transformByMatrix2x3(t){return Hu(this,this,t),this.check()}transformByMatrix2(t){return Vu(this,this,t),this.check()}};var He={};ut(He,{add:()=>QA,angle:()=>zi,bezier:()=>u1,ceil:()=>ZA,clone:()=>WA,copy:()=>YA,create:()=>hs,cross:()=>Ge,dist:()=>y1,distance:()=>Wu,div:()=>x1,divide:()=>Xu,dot:()=>nn,equals:()=>m1,exactEquals:()=>p1,floor:()=>$A,forEach:()=>E1,fromValues:()=>ds,hermite:()=>l1,inverse:()=>i1,len:()=>ki,length:()=>Ju,lerp:()=>a1,max:()=>e1,min:()=>t1,mul:()=>A1,multiply:()=>ju,negate:()=>o1,normalize:()=>Ui,random:()=>f1,rotateX:()=>Gi,rotateY:()=>Vi,rotateZ:()=>Hi,round:()=>r1,scale:()=>n1,scaleAndAdd:()=>s1,set:()=>KA,slerp:()=>c1,sqrDist:()=>T1,sqrLen:()=>_1,squaredDistance:()=>Yu,squaredLength:()=>Ku,str:()=>d1,sub:()=>g1,subtract:()=>qu,transformMat3:()=>sn,transformMat4:()=>Ve,transformQuat:()=>on,zero:()=>h1});function hs(){let e=new Z(3);return Z!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function WA(e){let t=new Z(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ju(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function ds(e,t,r){let n=new Z(3);return n[0]=e,n[1]=t,n[2]=r,n}function YA(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function KA(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function QA(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function qu(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function ju(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function Xu(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function ZA(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function $A(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function t1(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function e1(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function r1(e,t){return e[0]=dr(t[0]),e[1]=dr(t[1]),e[2]=dr(t[2]),e}function n1(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function s1(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function Wu(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return Math.sqrt(r*r+n*n+s*s)}function Yu(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return r*r+n*n+s*s}function Ku(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function o1(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function i1(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function Ui(e,t){let r=t[0],n=t[1],s=t[2],o=r*r+n*n+s*s;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function nn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ge(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],c=r[2];return e[0]=s*c-o*a,e[1]=o*i-n*c,e[2]=n*a-s*i,e}function a1(e,t,r,n){let s=t[0],o=t[1],i=t[2];return e[0]=s+n*(r[0]-s),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e}function c1(e,t,r,n){let s=Math.acos(Math.min(Math.max(nn(t,r),-1),1)),o=Math.sin(s),i=Math.sin((1-n)*s)/o,a=Math.sin(n*s)/o;return e[0]=i*t[0]+a*r[0],e[1]=i*t[1]+a*r[1],e[2]=i*t[2]+a*r[2],e}function l1(e,t,r,n,s,o){let i=o*o,a=i*(2*o-3)+1,c=i*(o-2)+o,l=i*(o-1),u=i*(3-2*o);return e[0]=t[0]*a+r[0]*c+n[0]*l+s[0]*u,e[1]=t[1]*a+r[1]*c+n[1]*l+s[1]*u,e[2]=t[2]*a+r[2]*c+n[2]*l+s[2]*u,e}function u1(e,t,r,n,s,o){let i=1-o,a=i*i,c=o*o,l=a*i,u=3*o*a,f=3*c*i,h=c*o;return e[0]=t[0]*l+r[0]*u+n[0]*f+s[0]*h,e[1]=t[1]*l+r[1]*u+n[1]*f+s[1]*h,e[2]=t[2]*l+r[2]*u+n[2]*f+s[2]*h,e}function f1(e,t){t=t===void 0?1:t;let r=rn()*2*Math.PI,n=rn()*2-1,s=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*s,e[1]=Math.sin(r)*s,e[2]=n*t,e}function Ve(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*s+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*s+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*s+r[10]*o+r[14])/i,e}function sn(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=n*r[0]+s*r[3]+o*r[6],e[1]=n*r[1]+s*r[4]+o*r[7],e[2]=n*r[2]+s*r[5]+o*r[8],e}function on(e,t,r){let n=r[0],s=r[1],o=r[2],i=r[3],a=t[0],c=t[1],l=t[2],u=s*l-o*c,f=o*a-n*l,h=n*c-s*a,d=s*h-o*f,p=o*u-n*h,A=n*f-s*u,g=i*2;return u*=g,f*=g,h*=g,d*=2,p*=2,A*=2,e[0]=a+u+d,e[1]=c+f+p,e[2]=l+h+A,e}function Gi(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0],o[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),o[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Vi(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),o[1]=s[1],o[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Hi(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),o[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),o[2]=s[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function zi(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2],c=Math.sqrt((r*r+n*n+s*s)*(o*o+i*i+a*a)),l=c&&nn(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}function h1(e){return e[0]=0,e[1]=0,e[2]=0,e}function d1(e){return`vec3(${e[0]}, ${e[1]}, ${e[2]})`}function p1(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function m1(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2];return Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}var g1=qu,A1=ju,x1=Xu,y1=Wu,T1=Yu,ki=Ju,_1=Ku,E1=function(){let e=hs();return function(t,r,n,s,o,i){let a,c;for(r||(r=3),n||(n=0),s?c=Math.min(s*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var Ji=[0,0,0],ps,x=class extends _e{static get ZERO(){return ps||(ps=new x(0,0,0),Object.freeze(ps)),ps}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Bt(t)?this.copy(t):(Y.debug&&(U(t),U(r),U(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return Y.debug&&(U(t.x),U(t.y),U(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=U(t)}angle(t){return zi(this,t)}cross(t){return Ge(this,this,t),this.check()}rotateX({radians:t,origin:r=Ji}){return Gi(this,this,r,t),this.check()}rotateY({radians:t,origin:r=Ji}){return Vi(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=Ji}){return Hi(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Ve(this,this,t),this.check()}transformAsVector(t){return us(this,this,t),this.check()}transformByMatrix3(t){return sn(this,this,t),this.check()}transformByMatrix2(t){return zu(this,this,t),this.check()}transformByQuaternion(t){return on(this,this,t),this.check()}};var ms,mr=class extends _e{static get ZERO(){return ms||(ms=new mr(0,0,0,0),Object.freeze(ms)),ms}constructor(t=0,r=0,n=0,s=0){super(-0,-0,-0,-0),Bt(t)&&arguments.length===1?this.copy(t):(Y.debug&&(U(t),U(r),U(n),U(s)),this[0]=t,this[1]=r,this[2]=n,this[3]=s)}set(t,r,n,s){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return Y.debug&&(U(t.x),U(t.y),U(t.z),U(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=U(t)}get w(){return this[3]}set w(t){this[3]=U(t)}transform(t){return Ve(this,this,t),this.check()}transformByMatrix3(t){return fs(this,this,t),this.check()}transformByMatrix2(t){return ku(this,this,t),this.check()}transformByQuaternion(t){return on(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var gr=class extends ye{toString(){let t="[";if(Y.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+r]}`}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=` ${this[r]}`}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=U(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)r[s]=this[n+s];return r}setColumn(t,r){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=r[s];return this}};function Qu(){let e=new Z(9);return Z!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Zu(e,t){if(e===t){let r=t[1],n=t[2],s=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=s}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function $u(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],c=t[6],l=t[7],u=t[8],f=u*i-a*l,h=-u*o+a*c,d=l*o-i*c,p=r*f+n*h+s*d;return p?(p=1/p,e[0]=f*p,e[1]=(-u*n+s*l)*p,e[2]=(a*n-s*i)*p,e[3]=h*p,e[4]=(u*r-s*c)*p,e[5]=(-a*r+s*o)*p,e[6]=d*p,e[7]=(-l*r+n*c)*p,e[8]=(i*r-n*o)*p,e):null}function tf(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],c=e[7],l=e[8];return t*(l*o-i*c)+r*(-l*s+i*a)+n*(c*s-o*a)}function qi(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],l=t[6],u=t[7],f=t[8],h=r[0],d=r[1],p=r[2],A=r[3],g=r[4],y=r[5],E=r[6],_=r[7],B=r[8];return e[0]=h*n+d*i+p*l,e[1]=h*s+d*a+p*u,e[2]=h*o+d*c+p*f,e[3]=A*n+g*i+y*l,e[4]=A*s+g*a+y*u,e[5]=A*o+g*c+y*f,e[6]=E*n+_*i+B*l,e[7]=E*s+_*a+B*u,e[8]=E*o+_*c+B*f,e}function ef(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],l=t[6],u=t[7],f=t[8],h=r[0],d=r[1];return e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=a,e[5]=c,e[6]=h*n+d*i+l,e[7]=h*s+d*a+u,e[8]=h*o+d*c+f,e}function rf(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],l=t[6],u=t[7],f=t[8],h=Math.sin(r),d=Math.cos(r);return e[0]=d*n+h*i,e[1]=d*s+h*a,e[2]=d*o+h*c,e[3]=d*i-h*n,e[4]=d*a-h*s,e[5]=d*c-h*o,e[6]=l,e[7]=u,e[8]=f,e}function ji(e,t,r){let n=r[0],s=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=s*t[3],e[4]=s*t[4],e[5]=s*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function nf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,c=s+s,l=r*i,u=n*i,f=n*a,h=s*i,d=s*a,p=s*c,A=o*i,g=o*a,y=o*c;return e[0]=1-f-p,e[3]=u-y,e[6]=h+g,e[1]=u+y,e[4]=1-l-p,e[7]=d-A,e[2]=h-g,e[5]=d+A,e[8]=1-l-f,e}var Xi;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(Xi||(Xi={}));var C1=Object.freeze([1,0,0,0,1,0,0,0,1]),z=class extends gr{static get IDENTITY(){return b1()}static get ZERO(){return S1()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return Xi}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(C1)}fromObject(t){return this.check()}fromQuaternion(t){return nf(this,t),this.check()}set(t,r,n,s,o,i,a,c,l){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=c,this[8]=l,this.check()}setRowMajor(t,r,n,s,o,i,a,c,l){return this[0]=t,this[1]=s,this[2]=a,this[3]=r,this[4]=o,this[5]=c,this[6]=n,this[7]=i,this[8]=l,this.check()}determinant(){return tf(this)}transpose(){return Zu(this,this),this.check()}invert(){return $u(this,this),this.check()}multiplyLeft(t){return qi(this,t,this),this.check()}multiplyRight(t){return qi(this,this,t),this.check()}rotate(t){return rf(this,this,t),this.check()}scale(t){return Array.isArray(t)?ji(this,this,t):ji(this,this,[t,t]),this.check()}translate(t){return ef(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=as(r||[-0,-0],t,this);break;case 3:n=sn(r||[-0,-0,-0],t,this);break;case 4:n=fs(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Te(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},gs,As=null;function S1(){return gs||(gs=new z([0,0,0,0,0,0,0,0,0]),Object.freeze(gs)),gs}function b1(){return As||(As=new z,Object.freeze(As)),As}var cn={};ut(cn,{add:()=>Q1,adjoint:()=>R1,clone:()=>I1,copy:()=>w1,create:()=>M1,decompose:()=>z1,determinant:()=>Ki,equals:()=>ex,exactEquals:()=>tx,frob:()=>K1,fromQuat:()=>na,fromQuat2:()=>G1,fromRotation:()=>N1,fromRotationTranslation:()=>of,fromRotationTranslationScale:()=>k1,fromRotationTranslationScaleOrigin:()=>J1,fromScaling:()=>O1,fromTranslation:()=>P1,fromValues:()=>F1,fromXRotation:()=>D1,fromYRotation:()=>v1,fromZRotation:()=>U1,frustum:()=>sa,getRotation:()=>H1,getScaling:()=>af,getTranslation:()=>V1,identity:()=>sf,invert:()=>Yi,lookAt:()=>aa,mul:()=>rx,multiply:()=>an,multiplyScalar:()=>Z1,multiplyScalarAndAdd:()=>$1,ortho:()=>ia,orthoNO:()=>lf,orthoZO:()=>X1,perspective:()=>oa,perspectiveFromFieldOfView:()=>j1,perspectiveNO:()=>cf,perspectiveZO:()=>q1,rotate:()=>$i,rotateX:()=>ta,rotateY:()=>ea,rotateZ:()=>ra,scale:()=>Zi,set:()=>L1,str:()=>Y1,sub:()=>nx,subtract:()=>uf,targetTo:()=>W1,translate:()=>Qi,transpose:()=>Wi});function M1(){let e=new Z(16);return Z!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function I1(e){let t=new Z(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function w1(e,t){return 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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function F1(e,t,r,n,s,o,i,a,c,l,u,f,h,d,p,A){let g=new Z(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=n,g[4]=s,g[5]=o,g[6]=i,g[7]=a,g[8]=c,g[9]=l,g[10]=u,g[11]=f,g[12]=h,g[13]=d,g[14]=p,g[15]=A,g}function L1(e,t,r,n,s,o,i,a,c,l,u,f,h,d,p,A,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=s,e[4]=o,e[5]=i,e[6]=a,e[7]=c,e[8]=l,e[9]=u,e[10]=f,e[11]=h,e[12]=d,e[13]=p,e[14]=A,e[15]=g,e}function sf(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Wi(e,t){if(e===t){let r=t[1],n=t[2],s=t[3],o=t[6],i=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=s,e[13]=i,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function Yi(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],A=t[13],g=t[14],y=t[15],E=r*a-n*i,_=r*c-s*i,B=r*l-o*i,S=n*c-s*a,b=n*l-o*a,w=s*l-o*c,C=u*A-f*p,T=u*g-h*p,m=u*y-d*p,M=f*g-h*A,L=f*y-d*A,R=h*y-d*g,F=E*R-_*L+B*M+S*m-b*T+w*C;return F?(F=1/F,e[0]=(a*R-c*L+l*M)*F,e[1]=(s*L-n*R-o*M)*F,e[2]=(A*w-g*b+y*S)*F,e[3]=(h*b-f*w-d*S)*F,e[4]=(c*m-i*R-l*T)*F,e[5]=(r*R-s*m+o*T)*F,e[6]=(g*B-p*w-y*_)*F,e[7]=(u*w-h*B+d*_)*F,e[8]=(i*L-a*m+l*C)*F,e[9]=(n*m-r*L-o*C)*F,e[10]=(p*b-A*B+y*E)*F,e[11]=(f*B-u*b-d*E)*F,e[12]=(a*T-i*M-c*C)*F,e[13]=(r*M-n*T+s*C)*F,e[14]=(A*_-p*S-g*E)*F,e[15]=(u*S-f*_+h*E)*F,e):null}function R1(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],A=t[13],g=t[14],y=t[15],E=r*a-n*i,_=r*c-s*i,B=r*l-o*i,S=n*c-s*a,b=n*l-o*a,w=s*l-o*c,C=u*A-f*p,T=u*g-h*p,m=u*y-d*p,M=f*g-h*A,L=f*y-d*A,R=h*y-d*g;return e[0]=a*R-c*L+l*M,e[1]=s*L-n*R-o*M,e[2]=A*w-g*b+y*S,e[3]=h*b-f*w-d*S,e[4]=c*m-i*R-l*T,e[5]=r*R-s*m+o*T,e[6]=g*B-p*w-y*_,e[7]=u*w-h*B+d*_,e[8]=i*L-a*m+l*C,e[9]=n*m-r*L-o*C,e[10]=p*b-A*B+y*E,e[11]=f*B-u*b-d*E,e[12]=a*T-i*M-c*C,e[13]=r*M-n*T+s*C,e[14]=A*_-p*S-g*E,e[15]=u*S-f*_+h*E,e}function Ki(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=e[11],d=e[12],p=e[13],A=e[14],g=e[15],y=t*i-r*o,E=t*a-n*o,_=r*a-n*i,B=l*p-u*d,S=l*A-f*d,b=u*A-f*p,w=t*b-r*S+n*B,C=o*b-i*S+a*B,T=l*_-u*E+f*y,m=d*_-p*E+A*y;return c*w-s*C+g*T-h*m}function an(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],l=t[6],u=t[7],f=t[8],h=t[9],d=t[10],p=t[11],A=t[12],g=t[13],y=t[14],E=t[15],_=r[0],B=r[1],S=r[2],b=r[3];return e[0]=_*n+B*a+S*f+b*A,e[1]=_*s+B*c+S*h+b*g,e[2]=_*o+B*l+S*d+b*y,e[3]=_*i+B*u+S*p+b*E,_=r[4],B=r[5],S=r[6],b=r[7],e[4]=_*n+B*a+S*f+b*A,e[5]=_*s+B*c+S*h+b*g,e[6]=_*o+B*l+S*d+b*y,e[7]=_*i+B*u+S*p+b*E,_=r[8],B=r[9],S=r[10],b=r[11],e[8]=_*n+B*a+S*f+b*A,e[9]=_*s+B*c+S*h+b*g,e[10]=_*o+B*l+S*d+b*y,e[11]=_*i+B*u+S*p+b*E,_=r[12],B=r[13],S=r[14],b=r[15],e[12]=_*n+B*a+S*f+b*A,e[13]=_*s+B*c+S*h+b*g,e[14]=_*o+B*l+S*d+b*y,e[15]=_*i+B*u+S*p+b*E,e}function Qi(e,t,r){let n=r[0],s=r[1],o=r[2],i,a,c,l,u,f,h,d,p,A,g,y;return t===e?(e[12]=t[0]*n+t[4]*s+t[8]*o+t[12],e[13]=t[1]*n+t[5]*s+t[9]*o+t[13],e[14]=t[2]*n+t[6]*s+t[10]*o+t[14],e[15]=t[3]*n+t[7]*s+t[11]*o+t[15]):(i=t[0],a=t[1],c=t[2],l=t[3],u=t[4],f=t[5],h=t[6],d=t[7],p=t[8],A=t[9],g=t[10],y=t[11],e[0]=i,e[1]=a,e[2]=c,e[3]=l,e[4]=u,e[5]=f,e[6]=h,e[7]=d,e[8]=p,e[9]=A,e[10]=g,e[11]=y,e[12]=i*n+u*s+p*o+t[12],e[13]=a*n+f*s+A*o+t[13],e[14]=c*n+h*s+g*o+t[14],e[15]=l*n+d*s+y*o+t[15]),e}function Zi(e,t,r){let n=r[0],s=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function $i(e,t,r,n){let s=n[0],o=n[1],i=n[2],a=Math.sqrt(s*s+o*o+i*i),c,l,u,f,h,d,p,A,g,y,E,_,B,S,b,w,C,T,m,M,L,R,F,D;return a<1e-6?null:(a=1/a,s*=a,o*=a,i*=a,l=Math.sin(r),c=Math.cos(r),u=1-c,f=t[0],h=t[1],d=t[2],p=t[3],A=t[4],g=t[5],y=t[6],E=t[7],_=t[8],B=t[9],S=t[10],b=t[11],w=s*s*u+c,C=o*s*u+i*l,T=i*s*u-o*l,m=s*o*u-i*l,M=o*o*u+c,L=i*o*u+s*l,R=s*i*u+o*l,F=o*i*u-s*l,D=i*i*u+c,e[0]=f*w+A*C+_*T,e[1]=h*w+g*C+B*T,e[2]=d*w+y*C+S*T,e[3]=p*w+E*C+b*T,e[4]=f*m+A*M+_*L,e[5]=h*m+g*M+B*L,e[6]=d*m+y*M+S*L,e[7]=p*m+E*M+b*L,e[8]=f*R+A*F+_*D,e[9]=h*R+g*F+B*D,e[10]=d*R+y*F+S*D,e[11]=p*R+E*F+b*D,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function ta(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[4],i=t[5],a=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*s+l*n,e[5]=i*s+u*n,e[6]=a*s+f*n,e[7]=c*s+h*n,e[8]=l*s-o*n,e[9]=u*s-i*n,e[10]=f*s-a*n,e[11]=h*s-c*n,e}function ea(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[0],i=t[1],a=t[2],c=t[3],l=t[8],u=t[9],f=t[10],h=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*s-l*n,e[1]=i*s-u*n,e[2]=a*s-f*n,e[3]=c*s-h*n,e[8]=o*n+l*s,e[9]=i*n+u*s,e[10]=a*n+f*s,e[11]=c*n+h*s,e}function ra(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[0],i=t[1],a=t[2],c=t[3],l=t[4],u=t[5],f=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*s+l*n,e[1]=i*s+u*n,e[2]=a*s+f*n,e[3]=c*s+h*n,e[4]=l*s-o*n,e[5]=u*s-i*n,e[6]=f*s-a*n,e[7]=h*s-c*n,e}function P1(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function O1(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function N1(e,t,r){let n=r[0],s=r[1],o=r[2],i=Math.sqrt(n*n+s*s+o*o),a,c,l;return i<1e-6?null:(i=1/i,n*=i,s*=i,o*=i,c=Math.sin(t),a=Math.cos(t),l=1-a,e[0]=n*n*l+a,e[1]=s*n*l+o*c,e[2]=o*n*l-s*c,e[3]=0,e[4]=n*s*l-o*c,e[5]=s*s*l+a,e[6]=o*s*l+n*c,e[7]=0,e[8]=n*o*l+s*c,e[9]=s*o*l-n*c,e[10]=o*o*l+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function D1(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function v1(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function U1(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function of(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=n+n,c=s+s,l=o+o,u=n*a,f=n*c,h=n*l,d=s*c,p=s*l,A=o*l,g=i*a,y=i*c,E=i*l;return e[0]=1-(d+A),e[1]=f+E,e[2]=h-y,e[3]=0,e[4]=f-E,e[5]=1-(u+A),e[6]=p+g,e[7]=0,e[8]=h+y,e[9]=p-g,e[10]=1-(u+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function G1(e,t){let r=new Z(3),n=-t[0],s=-t[1],o=-t[2],i=t[3],a=t[4],c=t[5],l=t[6],u=t[7],f=n*n+s*s+o*o+i*i;return f>0?(r[0]=(a*i+u*n+c*o-l*s)*2/f,r[1]=(c*i+u*s+l*n-a*o)*2/f,r[2]=(l*i+u*o+a*s-c*n)*2/f):(r[0]=(a*i+u*n+c*o-l*s)*2,r[1]=(c*i+u*s+l*n-a*o)*2,r[2]=(l*i+u*o+a*s-c*n)*2),of(e,t,r),e}function V1(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function af(e,t){let r=t[0],n=t[1],s=t[2],o=t[4],i=t[5],a=t[6],c=t[8],l=t[9],u=t[10];return e[0]=Math.sqrt(r*r+n*n+s*s),e[1]=Math.sqrt(o*o+i*i+a*a),e[2]=Math.sqrt(c*c+l*l+u*u),e}function H1(e,t){let r=new Z(3);af(r,t);let n=1/r[0],s=1/r[1],o=1/r[2],i=t[0]*n,a=t[1]*s,c=t[2]*o,l=t[4]*n,u=t[5]*s,f=t[6]*o,h=t[8]*n,d=t[9]*s,p=t[10]*o,A=i+u+p,g=0;return A>0?(g=Math.sqrt(A+1)*2,e[3]=.25*g,e[0]=(f-d)/g,e[1]=(h-c)/g,e[2]=(a-l)/g):i>u&&i>p?(g=Math.sqrt(1+i-u-p)*2,e[3]=(f-d)/g,e[0]=.25*g,e[1]=(a+l)/g,e[2]=(h+c)/g):u>p?(g=Math.sqrt(1+u-i-p)*2,e[3]=(h-c)/g,e[0]=(a+l)/g,e[1]=.25*g,e[2]=(f+d)/g):(g=Math.sqrt(1+p-i-u)*2,e[3]=(a-l)/g,e[0]=(h+c)/g,e[1]=(f+d)/g,e[2]=.25*g),e}function z1(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let s=n[0],o=n[1],i=n[2],a=n[4],c=n[5],l=n[6],u=n[8],f=n[9],h=n[10];r[0]=Math.sqrt(s*s+o*o+i*i),r[1]=Math.sqrt(a*a+c*c+l*l),r[2]=Math.sqrt(u*u+f*f+h*h);let d=1/r[0],p=1/r[1],A=1/r[2],g=s*d,y=o*p,E=i*A,_=a*d,B=c*p,S=l*A,b=u*d,w=f*p,C=h*A,T=g+B+C,m=0;return T>0?(m=Math.sqrt(T+1)*2,e[3]=.25*m,e[0]=(S-w)/m,e[1]=(b-E)/m,e[2]=(y-_)/m):g>B&&g>C?(m=Math.sqrt(1+g-B-C)*2,e[3]=(S-w)/m,e[0]=.25*m,e[1]=(y+_)/m,e[2]=(b+E)/m):B>C?(m=Math.sqrt(1+B-g-C)*2,e[3]=(b-E)/m,e[0]=(y+_)/m,e[1]=.25*m,e[2]=(S+w)/m):(m=Math.sqrt(1+C-g-B)*2,e[3]=(y-_)/m,e[0]=(b+E)/m,e[1]=(S+w)/m,e[2]=.25*m),e}function k1(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3],c=s+s,l=o+o,u=i+i,f=s*c,h=s*l,d=s*u,p=o*l,A=o*u,g=i*u,y=a*c,E=a*l,_=a*u,B=n[0],S=n[1],b=n[2];return e[0]=(1-(p+g))*B,e[1]=(h+_)*B,e[2]=(d-E)*B,e[3]=0,e[4]=(h-_)*S,e[5]=(1-(f+g))*S,e[6]=(A+y)*S,e[7]=0,e[8]=(d+E)*b,e[9]=(A-y)*b,e[10]=(1-(f+p))*b,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function J1(e,t,r,n,s){let o=t[0],i=t[1],a=t[2],c=t[3],l=o+o,u=i+i,f=a+a,h=o*l,d=o*u,p=o*f,A=i*u,g=i*f,y=a*f,E=c*l,_=c*u,B=c*f,S=n[0],b=n[1],w=n[2],C=s[0],T=s[1],m=s[2],M=(1-(A+y))*S,L=(d+B)*S,R=(p-_)*S,F=(d-B)*b,D=(1-(h+y))*b,X=(g+E)*b,H=(p+_)*w,Q=(g-E)*w,j=(1-(h+A))*w;return e[0]=M,e[1]=L,e[2]=R,e[3]=0,e[4]=F,e[5]=D,e[6]=X,e[7]=0,e[8]=H,e[9]=Q,e[10]=j,e[11]=0,e[12]=r[0]+C-(M*C+F*T+H*m),e[13]=r[1]+T-(L*C+D*T+Q*m),e[14]=r[2]+m-(R*C+X*T+j*m),e[15]=1,e}function na(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,c=s+s,l=r*i,u=n*i,f=n*a,h=s*i,d=s*a,p=s*c,A=o*i,g=o*a,y=o*c;return e[0]=1-f-p,e[1]=u+y,e[2]=h-g,e[3]=0,e[4]=u-y,e[5]=1-l-p,e[6]=d+A,e[7]=0,e[8]=h+g,e[9]=d-A,e[10]=1-l-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function sa(e,t,r,n,s,o,i){let a=1/(r-t),c=1/(s-n),l=1/(o-i);return e[0]=o*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*c,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(s+n)*c,e[10]=(i+o)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*o*2*l,e[15]=0,e}function cf(e,t,r,n,s){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0){let i=1/(n-s);e[10]=(s+n)*i,e[14]=2*s*n*i}else e[10]=-1,e[14]=-2*n;return e}var oa=cf;function q1(e,t,r,n,s){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0){let i=1/(n-s);e[10]=s*i,e[14]=s*n*i}else e[10]=-1,e[14]=-n;return e}function j1(e,t,r,n){let s=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),c=2/(i+a),l=2/(s+o);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=l,e[6]=0,e[7]=0,e[8]=-((i-a)*c*.5),e[9]=(s-o)*l*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function lf(e,t,r,n,s,o,i){let a=1/(t-r),c=1/(n-s),l=1/(o-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+r)*a,e[13]=(s+n)*c,e[14]=(i+o)*l,e[15]=1,e}var ia=lf;function X1(e,t,r,n,s,o,i){let a=1/(t-r),c=1/(n-s),l=1/(o-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=l,e[11]=0,e[12]=(t+r)*a,e[13]=(s+n)*c,e[14]=o*l,e[15]=1,e}function aa(e,t,r,n){let s,o,i,a,c,l,u,f,h,d,p=t[0],A=t[1],g=t[2],y=n[0],E=n[1],_=n[2],B=r[0],S=r[1],b=r[2];return Math.abs(p-B)<1e-6&&Math.abs(A-S)<1e-6&&Math.abs(g-b)<1e-6?sf(e):(f=p-B,h=A-S,d=g-b,s=1/Math.sqrt(f*f+h*h+d*d),f*=s,h*=s,d*=s,o=E*d-_*h,i=_*f-y*d,a=y*h-E*f,s=Math.sqrt(o*o+i*i+a*a),s?(s=1/s,o*=s,i*=s,a*=s):(o=0,i=0,a=0),c=h*a-d*i,l=d*o-f*a,u=f*i-h*o,s=Math.sqrt(c*c+l*l+u*u),s?(s=1/s,c*=s,l*=s,u*=s):(c=0,l=0,u=0),e[0]=o,e[1]=c,e[2]=f,e[3]=0,e[4]=i,e[5]=l,e[6]=h,e[7]=0,e[8]=a,e[9]=u,e[10]=d,e[11]=0,e[12]=-(o*p+i*A+a*g),e[13]=-(c*p+l*A+u*g),e[14]=-(f*p+h*A+d*g),e[15]=1,e)}function W1(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=n[0],c=n[1],l=n[2],u=s-r[0],f=o-r[1],h=i-r[2],d=u*u+f*f+h*h;d>0&&(d=1/Math.sqrt(d),u*=d,f*=d,h*=d);let p=c*h-l*f,A=l*u-a*h,g=a*f-c*u;return d=p*p+A*A+g*g,d>0&&(d=1/Math.sqrt(d),p*=d,A*=d,g*=d),e[0]=p,e[1]=A,e[2]=g,e[3]=0,e[4]=f*g-h*A,e[5]=h*p-u*g,e[6]=u*A-f*p,e[7]=0,e[8]=u,e[9]=f,e[10]=h,e[11]=0,e[12]=s,e[13]=o,e[14]=i,e[15]=1,e}function Y1(e){return`mat4(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]}, ${e[4]}, ${e[5]}, ${e[6]}, ${e[7]}, ${e[8]}, ${e[9]}, ${e[10]}, ${e[11]}, ${e[12]}, ${e[13]}, ${e[14]}, ${e[15]})`}function K1(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function Q1(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function uf(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function Z1(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function $1(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function tx(e,t){return 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]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function ex(e,t){let r=e[0],n=e[1],s=e[2],o=e[3],i=e[4],a=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],A=e[13],g=e[14],y=e[15],E=t[0],_=t[1],B=t[2],S=t[3],b=t[4],w=t[5],C=t[6],T=t[7],m=t[8],M=t[9],L=t[10],R=t[11],F=t[12],D=t[13],X=t[14],H=t[15];return Math.abs(r-E)<=1e-6*Math.max(1,Math.abs(r),Math.abs(E))&&Math.abs(n-_)<=1e-6*Math.max(1,Math.abs(n),Math.abs(_))&&Math.abs(s-B)<=1e-6*Math.max(1,Math.abs(s),Math.abs(B))&&Math.abs(o-S)<=1e-6*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(c-C)<=1e-6*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(l-T)<=1e-6*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(u-m)<=1e-6*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(f-M)<=1e-6*Math.max(1,Math.abs(f),Math.abs(M))&&Math.abs(h-L)<=1e-6*Math.max(1,Math.abs(h),Math.abs(L))&&Math.abs(d-R)<=1e-6*Math.max(1,Math.abs(d),Math.abs(R))&&Math.abs(p-F)<=1e-6*Math.max(1,Math.abs(p),Math.abs(F))&&Math.abs(A-D)<=1e-6*Math.max(1,Math.abs(A),Math.abs(D))&&Math.abs(g-X)<=1e-6*Math.max(1,Math.abs(g),Math.abs(X))&&Math.abs(y-H)<=1e-6*Math.max(1,Math.abs(y),Math.abs(H))}var rx=an,nx=uf;function sx(){let e=new Z(4);return Z!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function ff(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function hf(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function df(e){let t=e[0],r=e[1],n=e[2],s=e[3];return Math.sqrt(t*t+r*r+n*n+s*s)}function pf(e){let t=e[0],r=e[1],n=e[2],s=e[3];return t*t+r*r+n*n+s*s}function mf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r*r+n*n+s*s+o*o;return i>0&&(i=1/Math.sqrt(i)),e[0]=r*i,e[1]=n*i,e[2]=s*i,e[3]=o*i,e}function gf(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Af(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3];return e[0]=s+n*(r[0]-s),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e[3]=a+n*(r[3]-a),e}function xf(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3];return e[0]=r[0]*n+r[4]*s+r[8]*o+r[12]*i,e[1]=r[1]*n+r[5]*s+r[9]*o+r[13]*i,e[2]=r[2]*n+r[6]*s+r[10]*o+r[14]*i,e[3]=r[3]*n+r[7]*s+r[11]*o+r[15]*i,e}function yf(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],c=r[2],l=r[3],u=l*n+a*o-c*s,f=l*s+c*n-i*o,h=l*o+i*s-a*n,d=-i*n-a*s-c*o;return e[0]=u*l+d*-i+f*-c-h*-a,e[1]=f*l+d*-a+h*-i-u*-c,e[2]=h*l+d*-c+u*-a-f*-i,e[3]=t[3],e}var yw=function(){let e=sx();return function(t,r,n,s,o,i){let a,c;for(r||(r=4),n||(n=0),s?c=Math.min(s*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}();var ua;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(ua||(ua={}));var ix=45*Math.PI/180,ax=1,ca=.1,la=500,cx=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),P=class extends gr{static get IDENTITY(){return ux()}static get ZERO(){return lx()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return ua}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,s,o,i,a,c,l,u,f,h,d,p,A,g){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=c,this[8]=l,this[9]=u,this[10]=f,this[11]=h,this[12]=d,this[13]=p,this[14]=A,this[15]=g,this.check()}setRowMajor(t,r,n,s,o,i,a,c,l,u,f,h,d,p,A,g){return this[0]=t,this[1]=o,this[2]=l,this[3]=d,this[4]=r,this[5]=i,this[6]=u,this[7]=p,this[8]=n,this[9]=a,this[10]=f,this[11]=A,this[12]=s,this[13]=c,this[14]=h,this[15]=g,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(cx)}fromObject(t){return this.check()}fromQuaternion(t){return na(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:s,top:o,near:i=ca,far:a=la}=t;return a===1/0?fx(this,r,n,s,o,i):sa(this,r,n,s,o,i,a),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:s=[0,1,0]}=t;return aa(this,r,n,s),this.check()}ortho(t){let{left:r,right:n,bottom:s,top:o,near:i=ca,far:a=la}=t;return ia(this,r,n,s,o,i,a),this.check()}orthographic(t){let{fovy:r=ix,aspect:n=ax,focalDistance:s=1,near:o=ca,far:i=la}=t;Tf(r);let a=r/2,c=s*Math.tan(a),l=c*n;return this.ortho({left:-l,right:l,bottom:-c,top:c,near:o,far:i})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:s=.1,far:o=500}=t;return Tf(r),oa(this,r,n,s,o),this.check()}determinant(){return Ki(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),s=1/n[0],o=1/n[1],i=1/n[2];return t[0]=this[0]*s,t[1]=this[1]*o,t[2]=this[2]*i,t[3]=0,t[4]=this[4]*s,t[5]=this[5]*o,t[6]=this[6]*i,t[7]=0,t[8]=this[8]*s,t[9]=this[9]*o,t[10]=this[10]*i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),s=1/n[0],o=1/n[1],i=1/n[2];return t[0]=this[0]*s,t[1]=this[1]*o,t[2]=this[2]*i,t[3]=this[4]*s,t[4]=this[5]*o,t[5]=this[6]*i,t[6]=this[8]*s,t[7]=this[9]*o,t[8]=this[10]*i,t}transpose(){return Wi(this,this),this.check()}invert(){return Yi(this,this),this.check()}multiplyLeft(t){return an(this,t,this),this.check()}multiplyRight(t){return an(this,this,t),this.check()}rotateX(t){return ta(this,this,t),this.check()}rotateY(t){return ea(this,this,t),this.check()}rotateZ(t){return ra(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return $i(this,this,t,r),this.check()}scale(t){return Zi(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return Qi(this,this,t),this.check()}transform(t,r){return t.length===4?(r=xf(r||[-0,-0,-0,-0],t,this),Te(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,s;switch(n){case 2:s=cs(r||[-0,-0],t,this);break;case 3:s=Ve(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Te(s,t.length),s}transformAsVector(t,r){let n;switch(t.length){case 2:n=ls(r||[-0,-0],t,this);break;case 3:n=us(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Te(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},xs,ys;function lx(){return xs||(xs=new P([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(xs)),xs}function ux(){return ys||(ys=new P,Object.freeze(ys)),ys}function Tf(e){if(e>Math.PI*2)throw Error("expected radians")}function fx(e,t,r,n,s,o){let i=2*o/(r-t),a=2*o/(s-n),c=(r+t)/(r-t),l=(s+n)/(s-n),u=-1,f=-1,h=-2*o;return e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=c,e[9]=l,e[10]=u,e[11]=f,e[12]=0,e[13]=0,e[14]=h,e[15]=0,e}function _f(){let e=new Z(4);return Z!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Ef(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function fa(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function ha(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=r[0],c=r[1],l=r[2],u=r[3];return e[0]=n*u+i*a+s*l-o*c,e[1]=s*u+i*c+o*a-n*l,e[2]=o*u+i*l+n*c-s*a,e[3]=i*u-n*a-s*c-o*l,e}function Bf(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+i*a,e[1]=s*c+o*a,e[2]=o*c-s*a,e[3]=i*c-n*a,e}function Cf(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c-o*a,e[1]=s*c+i*a,e[2]=o*c+n*a,e[3]=i*c-s*a,e}function Sf(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+s*a,e[1]=s*c-n*a,e[2]=o*c+i*a,e[3]=i*c-o*a,e}function bf(e,t){let r=t[0],n=t[1],s=t[2];return e[0]=r,e[1]=n,e[2]=s,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-s*s)),e}function ln(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3],c=r[0],l=r[1],u=r[2],f=r[3],h,d,p,A,g;return h=s*c+o*l+i*u+a*f,h<0&&(h=-h,c=-c,l=-l,u=-u,f=-f),1-h>1e-6?(d=Math.acos(h),g=Math.sin(d),p=Math.sin((1-n)*d)/g,A=Math.sin(n*d)/g):(p=1-n,A=n),e[0]=p*s+A*c,e[1]=p*o+A*l,e[2]=p*i+A*u,e[3]=p*a+A*f,e}function Mf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r*r+n*n+s*s+o*o,a=i?1/i:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-s*a,e[3]=o*a,e}function If(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function da(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[s*3+s]&&(s=2);let o=(s+1)%3,i=(s+2)%3;n=Math.sqrt(t[s*3+s]-t[o*3+o]-t[i*3+i]+1),e[s]=.5*n,n=.5/n,e[3]=(t[o*3+i]-t[i*3+o])*n,e[o]=(t[o*3+s]+t[s*3+o])*n,e[i]=(t[i*3+s]+t[s*3+i])*n}return e}var wf=ff;var Ff=hf,Lf=gf,Rf=Af,Pf=df;var Of=pf;var Nf=mf;var Df=function(){let e=hs(),t=ds(1,0,0),r=ds(0,1,0);return function(n,s,o){let i=nn(s,o);return i<-.999999?(Ge(e,t,s),ki(e)<1e-6&&Ge(e,r,s),Ui(e,e),fa(n,e,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Ge(e,s,o),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+i,Nf(n,n))}}(),Pw=function(){let e=_f(),t=_f();return function(r,n,s,o,i,a){return ln(e,n,i,a),ln(t,s,o,a),ln(r,e,t,2*a*(1-a)),r}}(),Ow=function(){let e=Qu();return function(t,r,n,s){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=s[0],e[4]=s[1],e[7]=s[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],Nf(t,da(t,e))}}();var hx=[0,0,0,1],Yt=class extends ye{constructor(t=0,r=0,n=0,s=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,s)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,s){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return da(this,t),this.check()}fromAxisRotation(t,r){return fa(this,t,r),this.check()}identity(){return Ef(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=U(t)}get y(){return this[1]}set y(t){this[1]=U(t)}get z(){return this[2]}set z(t){this[2]=U(t)}get w(){return this[3]}set w(t){this[3]=U(t)}len(){return Pf(this)}lengthSquared(){return Of(this)}dot(t){return Lf(this,t)}rotationTo(t,r){return Df(this,t,r),this.check()}add(t){return wf(this,this,t),this.check()}calculateW(){return bf(this,this),this.check()}conjugate(){return If(this,this),this.check()}invert(){return Mf(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(Rf(this,t,r,n),this.check())}multiplyRight(t){return ha(this,this,t),this.check()}multiplyLeft(t){return ha(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return Bf(this,this,t),this.check()}rotateY(t){return Cf(this,this,t),this.check()}rotateZ(t){return Sf(this,this,t),this.check()}scale(t){return Ff(this,this,t),this.check()}slerp(t,r,n){let s,o,i;switch(arguments.length){case 1:({start:s=hx,target:o,ratio:i}=t);break;case 2:s=this,o=t,i=r;break;default:s=t,o=r,i=n}return ln(this,s,o,i),this.check()}transformVector4(t,r=new mr){return yf(r,t,this),Te(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var It={};ut(It,{EPSILON1:()=>dx,EPSILON10:()=>Ex,EPSILON11:()=>Bx,EPSILON12:()=>Cx,EPSILON13:()=>Sx,EPSILON14:()=>bx,EPSILON15:()=>Mx,EPSILON16:()=>Ix,EPSILON17:()=>wx,EPSILON18:()=>Fx,EPSILON19:()=>Lx,EPSILON2:()=>px,EPSILON20:()=>Rx,EPSILON3:()=>mx,EPSILON4:()=>gx,EPSILON5:()=>Ax,EPSILON6:()=>xx,EPSILON7:()=>yx,EPSILON8:()=>Tx,EPSILON9:()=>_x,PI_OVER_FOUR:()=>Ox,PI_OVER_SIX:()=>Nx,PI_OVER_TWO:()=>Px,TWO_PI:()=>Dx});var dx=.1,px=.01,mx=.001,gx=1e-4,Ax=1e-5,xx=1e-6,yx=1e-7,Tx=1e-8,_x=1e-9,Ex=1e-10,Bx=1e-11,Cx=1e-12,Sx=1e-13,bx=1e-14,Mx=1e-15,Ix=1e-16,wx=1e-17,Fx=1e-18,Lx=1e-19,Rx=1e-20,Px=Math.PI/2,Ox=Math.PI/4,Nx=Math.PI/6,Dx=Math.PI*2;function Ts(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var Ut=Math.PI,Vf=Ut/4,vf=Ut/180,Uf=180/Ut,_s=512;function re(e){let[t,r]=e;Ts(Number.isFinite(t)),Ts(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");let n=t*vf,s=r*vf,o=_s*(n+Ut)/(2*Ut),i=_s*(Ut+Math.log(Math.tan(Vf+s*.5)))/(2*Ut);return[o,i]}function ne(e){let[t,r]=e,n=t/_s*(2*Ut)-Ut,s=2*(Math.atan(Math.exp(r/_s*(2*Ut)-Ut))-Vf);return[n*Uf,s*Uf]}var AF=Math.PI/180;var zf=6378137*Math.PI;function pa(e){let t=re(e);return t[0]=(t[0]/256-1)*zf,t[1]=(t[1]/256-1)*zf,t}var Zx={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:()=>{}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:()=>{}},onImageLoad:{type:"function",value:()=>{}},onImageLoadError:{type:"function",compare:!1,value:(e,t)=>console.error(t,e)}},Bs=class extends ze.CompositeLayer{get isLoaded(){return this.state?.loadCounter===0&&super.isLoaded}shouldUpdateState(){return!0}initializeState(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}updateState({changeFlags:t,props:r,oldProps:n}){let{viewport:s}=this.context;t.dataChanged||r.serviceType!==n.serviceType?(this.state.imageSource=this._createImageSource(r),this._loadMetadata(),this.debounce(()=>this.loadImage(s,"image source changed"),0)):(0,ze._deepEqual)(r.layers,n.layers,1)?t.viewportChanged&&this.debounce(()=>this.loadImage(s,"viewport changed")):this.debounce(()=>this.loadImage(s,"layers changed"),0)}finalizeState(){}renderLayers(){let{bounds:t,image:r,lastRequestParameters:n}=this.state;return r&&new kf.BitmapLayer({...this.getSubLayerProps({id:"bitmap"}),_imageCoordinateSystem:n.srs==="EPSG:4326"?ze.COORDINATE_SYSTEM.LNGLAT:ze.COORDINATE_SYSTEM.CARTESIAN,bounds:t,image:r})}async getFeatureInfoText(t,r){let{lastRequestParameters:n}=this.state;return n?await this.state.imageSource.getFeatureInfoText?.({...n,query_layers:n.layers,x:t,y:r,info_format:"application/vnd.ogc.gml"}):""}_createImageSource(t){if(t.data instanceof Mt)return t.data;if(typeof t.data=="string")return Pi({url:t.data,loadOptions:t.loadOptions,type:t.serviceType});throw new Error("invalid image source in props.data")}async _loadMetadata(){let{imageSource:t}=this.state;try{this.state.loadCounter++;let r=await t.getMetadata();this.state.imageSource===t&&this.getCurrentLayer()?.props.onMetadataLoad(r)}catch(r){this.getCurrentLayer()?.props.onMetadataLoadError(r)}finally{this.state.loadCounter--}}async loadImage(t,r){let{layers:n,serviceType:s}=this.props;if(s==="wms"&&n.length===0)return;let o=t.getBounds(),{width:i,height:a}=t,c=this.getRequestId(),{srs:l}=this.props;l==="auto"&&(l=t.resolution?"EPSG:4326":"EPSG:3857");let u={width:i,height:a,boundingBox:[[o[0],o[1]],[o[2],o[3]]],layers:n,crs:l};if(l==="EPSG:3857"){let f=pa([o[0],o[1]]),h=pa([o[2],o[3]]);u.boundingBox=[f,h]}try{this.state.loadCounter++,this.props.onImageLoadStart(c);let f=await this.state.imageSource.getImage(u);this.state.lastRequestId<c&&(this.getCurrentLayer()?.props.onImageLoad(c),this.setState({image:f,bounds:o,lastRequestParameters:u,lastRequestId:c}))}catch(f){this.raiseError(f,"Load image"),this.getCurrentLayer()?.props.onImageLoadError(c,f)}finally{this.state.loadCounter--}}getRequestId(){return this.state._nextRequestId++}debounce(t,r=500){clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(()=>t(),r)}},Es=Bs;(()=>{Bs.layerName="WMSLayer"})(),(()=>{Bs.defaultProps=Zx})();var Jf=N(Nt(),1),$x={getHeight:{type:"accessor",value:0},greatCircle:!0},Cs=class extends Jf.ArcLayer{},un=Cs;(()=>{Cs.layerName="GreatCircleLayer"})(),(()=>{Cs.defaultProps=$x})();var qf=N(Dt(),1),ma=N(Nt(),1),ty={...ma.PolygonLayer.defaultProps},Ss=class extends qf.CompositeLayer{indexToBounds(){return null}renderLayers(){let{elevationScale:t,extruded:r,wireframe:n,filled:s,stroked:o,lineWidthUnits:i,lineWidthScale:a,lineWidthMinPixels:c,lineWidthMaxPixels:l,lineJointRounded:u,lineMiterLimit:f,lineDashJustified:h,getElevation:d,getFillColor:p,getLineColor:A,getLineWidth:g}=this.props,{updateTriggers:y,material:E,transitions:_}=this.props,B=this.getSubLayerClass("cell",ma.PolygonLayer),{updateTriggers:S,...b}=this.indexToBounds()||{};return new B({filled:s,wireframe:n,extruded:r,elevationScale:t,stroked:o,lineWidthUnits:i,lineWidthScale:a,lineWidthMinPixels:c,lineWidthMaxPixels:l,lineJointRounded:u,lineMiterLimit:f,lineDashJustified:h,material:E,transitions:_,getElevation:d,getFillColor:p,getLineColor:A,getLineWidth:g},this.getSubLayerProps({id:"cell",updateTriggers:y&&{...S,getElevation:y.getElevation,getFillColor:y.getFillColor,getLineColor:y.getLineColor,getLineWidth:y.getLineWidth}}),b)}},St=Ss;(()=>{Ss.layerName="GeoCellLayer"})(),(()=>{Ss.defaultProps=ty})();var bs=N(ga(),1),ey=3,ry=30,ny=2*ry+1,Xf=180/Math.PI;function Yf(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function Wf(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Kf(e){return[Wf(e[0]),Wf(e[1])]}function Qf(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function Zf([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*Xf,n*Xf]}function $f(e){let t=bs.default.fromString(e,!0,10).toString(2);for(;t.length<ey+ny;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),s=t.substring(3,r),o=s.length/2,i=bs.default.fromString(n,!0,2).toString(10),a=bs.default.fromString(s,!0,2).toString(4);for(;a.length<o;)a="0"+a;return`${i}/${a}`}function sy(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let s=t[0];t[0]=t[1],t[1]=s}}function th(e){let t=e.split("/"),r=parseInt(t[0],10),n=t[1],s=n.length,o=[0,0],i;for(let a=s-1;a>=0;a--){i=s-a;let c=n[a],l=0,u=0;c==="1"?u=1:c==="2"?(l=1,u=1):c==="3"&&(l=1);let f=Math.pow(2,i-1);sy(f,o,l,u),o[0]+=f*l,o[1]+=f*u}if(r%2===1){let a=o[0];o[0]=o[1],o[1]=a}return{face:r,ij:o,level:i}}var eh=N(ga(),1);function oy(e){let t=e.padEnd(16,"0");return eh.default.fromString(t,16)}var iy=100;function ay({face:e,ij:t,level:r}){let n=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil(iy*Math.pow(2,-r))),o=new Float64Array(4*s*2+2),i=0,a=0;for(let c=0;c<4;c++){let l=n[c].slice(0),u=n[c+1],f=(u[0]-l[0])/s,h=(u[1]-l[1])/s;for(let d=0;d<s;d++){l[0]+=f,l[1]+=h;let p=Yf(t,r,l),A=Kf(p),g=Qf(e,A),y=Zf(g);Math.abs(y[1])>89.999&&(y[0]=a);let E=y[0]-a;y[0]+=E>180?-360:E<-180?360:0,o[i++]=y[0],o[i++]=y[1],a=y[0]}}return o[i++]=o[0],o[i++]=o[1],o}function cy(e){if(typeof e=="string"){if(e.indexOf("/")>0)return e;e=oy(e)}return $f(e.toString())}function rh(e){let t=cy(e),r=th(t);return ay(r)}var ly={getS2Token:{type:"accessor",value:e=>e.token}},Ms=class extends St{indexToBounds(){let{data:t,getS2Token:r}=this.props;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(n,s)=>rh(r(n,s))}}},hn=Ms;(()=>{Ms.layerName="S2Layer"})(),(()=>{Ms.defaultProps=ly})();var Aa=512;function uy(e,t){let r=0,n=0,s=1<<e.length,o=s/Aa;for(let i=0;i<e.length;i++){s>>=1;let a=parseInt(e[i]);a%2&&(r|=s),a>1&&(n|=s)}return[[r/o,Aa-n/o],[(r+t)/o,Aa-(n+t)/o]]}function nh(e,t=1){let[r,n]=uy(e,t),[s,o]=ne(r),[i,a]=ne(n);return[i,o,i,a,s,a,s,o,i,o]}var fy={getQuadkey:{type:"accessor",value:e=>e.quadkey}},Is=class extends St{indexToBounds(){let{data:t,extruded:r,getQuadkey:n}=this.props,s=r?.99:1;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(o,i)=>nh(n(o,i),s),updateTriggers:{getPolygon:s}}}},dn=Is;(()=>{Is.layerName="QuadkeyLayer"})(),(()=>{Is.defaultProps=fy})();var Ds=N(Dt(),1),_h=N(Nt(),1);var ke=class{constructor(t){this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get bbox(){return this._bbox}set bbox(t){this._bbox||(this._bbox=t,"west"in t?this.boundingBox=[[t.west,t.south],[t.east,t.north]]:this.boundingBox=[[t.left,t.top],[t.right,t.bottom]])}get data(){return this.isLoading&&this._loader?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return Boolean(this._loader)&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){let t=this.content?this.content.byteLength:0;return Number.isFinite(t)||console.error("byteLength not defined in tile data"),t}async _loadData({getData:t,requestScheduler:r,onLoad:n,onError:s}){let{index:o,id:i,bbox:a,userData:c,zoom:l}=this,u=this._loaderId;this._abortController=new AbortController;let{signal:f}=this._abortController,h=await r.scheduleRequest(this,A=>A.isSelected?1:-1);if(!h){this._isCancelled=!0;return}if(this._isCancelled){h.done();return}let d=null,p;try{d=await t({index:o,id:i,bbox:a,userData:c,zoom:l,signal:f})}catch(A){p=A||!0}finally{h.done()}if(u===this._loaderId){if(this._loader=void 0,this.content=d,this._isCancelled&&!d){this._isLoaded=!1;return}this._isLoaded=!0,this._isCancelled=!1,p?s(p,this):n(this)}}loadData(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController?.abort())}};var gn=N(Dt(),1);var rt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var sh=new x,hy=new x,Ee=class{constructor(t=[0,0,0],r=[0,0,0],n){n=n||sh.copy(t).add(r).scale(.5),this.center=new x(n),this.halfDiagonal=new x(r).subtract(this.center),this.minimum=new x(t),this.maximum=new x(r)}clone(){return new Ee(this.minimum,this.maximum,this.center)}equals(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}transform(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}intersectPlane(t){let{halfDiagonal:r}=this,n=hy.from(t.normal),s=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),o=this.center.dot(n)+t.distance;return o-s>0?rt.INSIDE:o+s<0?rt.OUTSIDE:rt.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=sh.from(t).subtract(this.center),{halfDiagonal:n}=this,s=0,o;return o=Math.abs(r.x)-n.x,o>0&&(s+=o*o),o=Math.abs(r.y)-n.y,o>0&&(s+=o*o),o=Math.abs(r.z)-n.z,o>0&&(s+=o*o),s}};var pn=new x,oh=new x,wt=class{constructor(t=[0,0,0],r=0){this.radius=-0,this.center=new x,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=pn.from(r),this.center=new x().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new wt(this.center,this.radius)}union(t){let r=this.center,n=this.radius,s=t.center,o=t.radius,i=pn.copy(s).subtract(r),a=i.magnitude();if(n>=a+o)return this.clone();if(o>=a+n)return t.clone();let c=(n+a+o)*.5;return oh.copy(i).scale((-n+c)/a).add(r),this.center.copy(oh),this.radius=c,this}expand(t){let n=pn.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=cn.getScaling(pn,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=pn.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,o=t.normal.dot(r)+t.distance;return o<-n?rt.OUTSIDE:o<n?rt.INTERSECTING:rt.INSIDE}};var dy=new x,py=new x,ws=new x,Fs=new x,Ls=new x,my=new x,gy=new x,se={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},Gt=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new x().from(t),this.halfAxes=new z(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new x(t).len(),new x(r).len(),new x(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),s=new x(t).normalize(),o=new x(r).normalize(),i=new x(n).normalize();return new Yt().fromMatrix3(new z([...s,...o,...i]))}fromCenterHalfSizeQuaternion(t,r,n){let s=new Yt(n),o=new z().fromQuaternion(s);return o[0]=o[0]*r[0],o[1]=o[1]*r[0],o[2]=o[2]*r[0],o[3]=o[3]*r[1],o[4]=o[4]*r[1],o[5]=o[5]*r[1],o[6]=o[6]*r[2],o[7]=o[7]*r[2],o[8]=o[8]*r[2],this.center=new x().from(t),this.halfAxes=o,this}clone(){return new Gt(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new wt){let r=this.halfAxes,n=r.getColumn(0,ws),s=r.getColumn(1,Fs),o=r.getColumn(2,Ls),i=dy.copy(n).add(s).add(o);return t.center.copy(this.center),t.radius=i.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,s=this.halfAxes,o=n.x,i=n.y,a=n.z,c=Math.abs(o*s[se.COLUMN0ROW0]+i*s[se.COLUMN0ROW1]+a*s[se.COLUMN0ROW2])+Math.abs(o*s[se.COLUMN1ROW0]+i*s[se.COLUMN1ROW1]+a*s[se.COLUMN1ROW2])+Math.abs(o*s[se.COLUMN2ROW0]+i*s[se.COLUMN2ROW1]+a*s[se.COLUMN2ROW2]),l=n.dot(r)+t.distance;return l<=-c?rt.OUTSIDE:l>=c?rt.INSIDE:rt.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=py.from(t).subtract(this.center),n=this.halfAxes,s=n.getColumn(0,ws),o=n.getColumn(1,Fs),i=n.getColumn(2,Ls),a=s.magnitude(),c=o.magnitude(),l=i.magnitude();s.normalize(),o.normalize(),i.normalize();let u=0,f;return f=Math.abs(r.dot(s))-a,f>0&&(u+=f*f),f=Math.abs(r.dot(o))-c,f>0&&(u+=f*f),f=Math.abs(r.dot(i))-l,f>0&&(u+=f*f),u}computePlaneDistances(t,r,n=[-0,-0]){let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,c=a.getColumn(0,ws),l=a.getColumn(1,Fs),u=a.getColumn(2,Ls),f=my.copy(c).add(l).add(u).add(i),h=gy.copy(f).subtract(t),d=r.dot(h);return s=Math.min(d,s),o=Math.max(d,o),f.copy(i).add(c).add(l).subtract(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),f.copy(i).add(c).subtract(l).add(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),f.copy(i).add(c).subtract(l).subtract(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),i.copy(f).subtract(c).add(l).add(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),i.copy(f).subtract(c).add(l).subtract(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),i.copy(f).subtract(c).subtract(l).add(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),i.copy(f).subtract(c).subtract(l).subtract(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),n[0]=s,n[1]=o,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,ws);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,Fs);n.transformAsPoint(t);let s=this.halfAxes.getColumn(2,Ls);return s.transformAsPoint(t),this.halfAxes=new z([...r,...n,...s]),this}getTransform(){throw new Error("not implemented")}};var ih=new x,ah=new x,ct=class{constructor(t=[0,0,1],r=0){this.normal=new x,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return at(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=ih.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,s){return this.normal.set(t,r,n),at(mt(this.normal.len(),1)),this.distance=s,this}clone(){return new ct(this.normal,this.distance)}equals(t){return mt(this.distance,t.distance)&&mt(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=ah.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=ih.from(t),s=this.getPointDistance(n),o=ah.copy(this.normal).scale(s);return n.subtract(o).to(r)}};var ch=[new x([1,0,0]),new x([0,1,0]),new x([0,0,1])],lh=new x,Ay=new x,ot=class{constructor(t=[]){this.planes=t}fromBoundingSphere(t){this.planes.length=2*ch.length;let r=t.center,n=t.radius,s=0;for(let o of ch){let i=this.planes[s],a=this.planes[s+1];i||(i=this.planes[s]=new ct),a||(a=this.planes[s+1]=new ct);let c=lh.copy(o).scale(-n).add(r);i.fromPointNormal(c,o);let l=lh.copy(o).scale(n).add(r),u=Ay.copy(o).negate();a.fromPointNormal(l,u),s+=2}return this}computeVisibility(t){let r=rt.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case rt.OUTSIDE:return rt.OUTSIDE;case rt.INTERSECTING:r=rt.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(at(Number.isFinite(r),"parentPlaneMask is required."),r===ot.MASK_OUTSIDE||r===ot.MASK_INSIDE)return r;let n=ot.MASK_INSIDE,s=this.planes;for(let o=0;o<this.planes.length;++o){let i=o<31?1<<o:0;if(o<31&&!(r&i))continue;let a=s[o],c=t.intersectPlane(a);if(c===rt.OUTSIDE)return ot.MASK_OUTSIDE;c===rt.INTERSECTING&&(n|=i)}return n}};ot.MASK_OUTSIDE=4294967295;ot.MASK_INSIDE=0;ot.MASK_INDETERMINATE=2147483647;var OL=new x,NL=new x,DL=new x,vL=new x,UL=new x;var qL=new x,jL=new x,XL=new x,WL=new x,YL=new x,KL=new x,QL=new x,ZL=new x,$L=new x,tR=new x,eR=new x,rR=new x;var Kt=new z,yy=new z,Ty=new z,Rs=new z,uh=new z;function Ta(e,t={}){let r=It.EPSILON20,n=10,s=0,o=0,i=yy,a=Ty;i.identity(),a.copy(e);let c=r*_y(a);for(;o<n&&Ey(a)>c;)By(a,Rs),uh.copy(Rs).transpose(),a.multiplyRight(Rs),a.multiplyLeft(uh),i.multiplyRight(Rs),++s>2&&(++o,s=0);return t.unitary=i.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}function _y(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var xa=[1,0,0],ya=[2,2,1];function Ey(e){let t=0;for(let r=0;r<3;++r){let n=e[Kt.getElementIndex(ya[r],xa[r])];t+=2*n*n}return Math.sqrt(t)}function By(e,t){let r=It.EPSILON15,n=0,s=1;for(let l=0;l<3;++l){let u=Math.abs(e[Kt.getElementIndex(ya[l],xa[l])]);u>n&&(s=l,n=u)}let o=xa[s],i=ya[s],a=1,c=0;if(Math.abs(e[Kt.getElementIndex(i,o)])>r){let l=e[Kt.getElementIndex(i,i)],u=e[Kt.getElementIndex(o,o)],f=e[Kt.getElementIndex(i,o)],h=(l-u)/2/f,d;h<0?d=-1/(-h+Math.sqrt(1+h*h)):d=1/(h+Math.sqrt(1+h*h)),a=1/Math.sqrt(1+d*d),c=d*a}return z.IDENTITY.to(t),t[Kt.getElementIndex(o,o)]=t[Kt.getElementIndex(i,i)]=a,t[Kt.getElementIndex(i,o)]=c,t[Kt.getElementIndex(o,i)]=-c,t}var Be=new x,Cy=new x,Sy=new x,by=new x,My=new x,Iy=new z,wy={diagonal:new z,unitary:new z};function mn(e,t=new Gt){if(!e||e.length===0)return t.halfAxes=new z([0,0,0,0,0,0,0,0,0]),t.center=new x,t;let r=e.length,n=new x(0,0,0);for(let T of e)n.add(T);let s=1/r;n.multiplyByScalar(s);let o=0,i=0,a=0,c=0,l=0,u=0;for(let T of e){let m=Be.copy(T).subtract(n);o+=m.x*m.x,i+=m.x*m.y,a+=m.x*m.z,c+=m.y*m.y,l+=m.y*m.z,u+=m.z*m.z}o*=s,i*=s,a*=s,c*=s,l*=s,u*=s;let f=Iy;f[0]=o,f[1]=i,f[2]=a,f[3]=i,f[4]=c,f[5]=l,f[6]=a,f[7]=l,f[8]=u;let{unitary:h}=Ta(f,wy),d=t.halfAxes.copy(h),p=d.getColumn(0,Sy),A=d.getColumn(1,by),g=d.getColumn(2,My),y=-Number.MAX_VALUE,E=-Number.MAX_VALUE,_=-Number.MAX_VALUE,B=Number.MAX_VALUE,S=Number.MAX_VALUE,b=Number.MAX_VALUE;for(let T of e)Be.copy(T),y=Math.max(Be.dot(p),y),E=Math.max(Be.dot(A),E),_=Math.max(Be.dot(g),_),B=Math.min(Be.dot(p),B),S=Math.min(Be.dot(A),S),b=Math.min(Be.dot(g),b);p=p.multiplyByScalar(.5*(B+y)),A=A.multiplyByScalar(.5*(S+E)),g=g.multiplyByScalar(.5*(b+_)),t.center.copy(p).add(A).add(g);let w=Cy.set(y-B,E-S,_-b).multiplyByScalar(.5),C=new z([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(C),t}var Ar=512,fh=3,hh=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],dh=hh.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Fy=dh.concat([[.25,.5],[.75,.5]]),Ce=class{constructor(t,r,n){this.x=t,this.y=r,this.z=n}get children(){if(!this._children){let t=this.x*2,r=this.y*2,n=this.z+1;this._children=[new Ce(t,r,n),new Ce(t,r+1,n),new Ce(t+1,r,n),new Ce(t+1,r+1,n)]}return this._children}update(t){let{viewport:r,cullingVolume:n,elevationBounds:s,minZ:o,maxZ:i,bounds:a,offset:c,project:l}=t,u=this.getBoundingVolume(s,c,l);if(a&&!this.insideBounds(a)||n.computeVisibility(u)<0)return!1;if(!this.childVisible){let{z:h}=this;if(h<i&&h>=o){let d=u.distanceTo(r.cameraPosition)*r.scale/r.height;h+=Math.floor(Math.log2(d))}if(h>=i)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(let h of this.children)h.update(t);return!0}getSelected(t=[]){if(this.selected&&t.push(this),this._children)for(let r of this._children)r.getSelected(t);return t}insideBounds([t,r,n,s]){let o=Math.pow(2,this.z),i=Ar/o;return this.x*i<n&&this.y*i<s&&(this.x+1)*i>t&&(this.y+1)*i>r}getBoundingVolume(t,r,n){if(n){let c=this.z<1?Fy:this.z<2?dh:hh,l=[];for(let u of c){let f=Ps(this.x+u[0],this.y+u[1],this.z);f[2]=t[0],l.push(n(f)),t[0]!==t[1]&&(f[2]=t[1],l.push(n(f)))}return mn(l)}let s=Math.pow(2,this.z),o=Ar/s,i=this.x*o+r*Ar,a=Ar-(this.y+1)*o;return new Ee([i,a,t[0]],[i+o,a+o,t[1]])}};function ph(e,t,r,n){let s=e instanceof gn._GlobeViewport&&e.resolution?e.projectPosition:null,o=Object.values(e.getFrustumPlanes()).map(({normal:d,distance:p})=>new ct(d.clone().negate(),p)),i=new ot(o),a=e.distanceScales.unitsPerMeter[2],c=r&&r[0]*a||0,l=r&&r[1]*a||0,u=e instanceof gn.WebMercatorViewport&&e.pitch<=60?t:0;if(n){let[d,p,A,g]=n,y=re([d,g]),E=re([A,p]);n=[y[0],Ar-y[1],E[0],Ar-E[1]]}let f=new Ce(0,0,0),h={viewport:e,project:s,cullingVolume:i,elevationBounds:[c,l],minZ:u,maxZ:t,bounds:n,offset:0};if(f.update(h),e instanceof gn.WebMercatorViewport&&e.subViewports&&e.subViewports.length>1){for(h.offset=-1;f.update(h)&&!(--h.offset<-fh););for(h.offset=1;f.update(h)&&!(++h.offset>fh););}return f.getSelected()}var oe=512,Ly=[-1/0,-1/0,1/0,1/0],Se={type:"object",value:null,validate:(e,t)=>t.optional&&e===null||typeof e=="string"||Array.isArray(e)&&e.every(r=>typeof r=="string"),equal:(e,t)=>{if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;let r=e.length;if(r!==t.length)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}};function gh(e,t){let r=[t.transformAsPoint([e[0],e[1]]),t.transformAsPoint([e[2],e[1]]),t.transformAsPoint([e[0],e[3]]),t.transformAsPoint([e[2],e[3]])];return[Math.min(...r.map(s=>s[0])),Math.min(...r.map(s=>s[1])),Math.max(...r.map(s=>s[0])),Math.max(...r.map(s=>s[1]))]}function Ry(e){return Math.abs(e.split("").reduce((t,r)=>(t<<5)-t+r.charCodeAt(0)|0,0))}function Qt(e,t){if(!e||!e.length)return null;let{index:r,id:n}=t;if(Array.isArray(e)){let o=Ry(n)%e.length;e=e[o]}let s=e;for(let o of Object.keys(r)){let i=new RegExp(`{${o}}`,"g");s=s.replace(i,String(r[o]))}return Number.isInteger(r.y)&&Number.isInteger(r.z)&&(s=s.replace(/\{-y\}/g,String(Math.pow(2,r.z)-r.y-1))),s}function Py(e,t,r){let n;if(t&&t.length===2){let[s,o]=t,i=e.getBounds({z:s}),a=e.getBounds({z:o});n=[Math.min(i[0],a[0]),Math.min(i[1],a[1]),Math.max(i[2],a[2]),Math.max(i[3],a[3])]}else n=e.getBounds();return e.isGeospatial?[Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.min(n[2],r[2]),Math.min(n[3],r[3])]:[Math.max(Math.min(n[0],r[2]),r[0]),Math.max(Math.min(n[1],r[3]),r[1]),Math.min(Math.max(n[2],r[0]),r[2]),Math.min(Math.max(n[3],r[1]),r[3])]}function Ah({viewport:e,z:t,cullRect:r}){return(e.subViewports||[e]).map(s=>_a(s,t||0,r))}function _a(e,t,r){if(!Array.isArray(t)){let o=r.x-e.x,i=r.y-e.y,{width:a,height:c}=r,l={targetZ:t},u=e.unproject([o,i],l),f=e.unproject([o+a,i],l),h=e.unproject([o,i+c],l),d=e.unproject([o+a,i+c],l);return[Math.min(u[0],f[0],h[0],d[0]),Math.min(u[1],f[1],h[1],d[1]),Math.max(u[0],f[0],h[0],d[0]),Math.max(u[1],f[1],h[1],d[1])]}let n=_a(e,t[0],r),s=_a(e,t[1],r);return[Math.min(n[0],s[0]),Math.min(n[1],s[1]),Math.max(n[2],s[2]),Math.max(n[3],s[3])]}function Oy(e,t,r){return r?gh(e,r).map(s=>s*t/oe):e.map(n=>n*t/oe)}function Ea(e,t){return Math.pow(2,e)*oe/t}function Ps(e,t,r){let n=Ea(r,oe),s=e/n*360-180,o=Math.PI-2*Math.PI*t/n,i=180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)));return[s,i]}function mh(e,t,r,n){let s=Ea(r,n);return[e/s*oe,t/s*oe]}function Ba(e,t,r,n,s=oe){if(e.isGeospatial){let[l,u]=Ps(t,r,n),[f,h]=Ps(t+1,r+1,n);return{west:l,north:u,east:f,south:h}}let[o,i]=mh(t,r,n,s),[a,c]=mh(t+1,r+1,n,s);return{left:o,top:i,right:a,bottom:c}}function Ny(e,t,r,n,s){let o=Py(e,null,n),i=Ea(t,r),[a,c,l,u]=Oy(o,i,s),f=[];for(let h=Math.floor(a);h<l;h++)for(let d=Math.floor(c);d<u;d++)f.push({x:h,y:d,z:t});return f}function Ca({viewport:e,maxZoom:t,minZoom:r,zRange:n,extent:s,tileSize:o=oe,modelMatrix:i,modelMatrixInverse:a,zoomOffset:c=0}){let l=e.isGeospatial?Math.round(e.zoom+Math.log2(oe/o))+c:Math.ceil(e.zoom)+c;if(typeof r=="number"&&Number.isFinite(r)&&l<r){if(!s)return[];l=r}typeof t=="number"&&Number.isFinite(t)&&l>t&&(l=t);let u=s;return i&&a&&s&&!e.isGeospatial&&(u=gh(s,i)),e.isGeospatial?ph(e,l,n,s):Ny(e,l,o,u||Ly,a)}function Sa(e){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}function ba(e){return Number.isFinite(e.west)&&Number.isFinite(e.north)&&Number.isFinite(e.east)&&Number.isFinite(e.south)}function xh(e){let t={},r;return n=>{for(let s in n)if(!Dy(n[s],t[s])){r=e(n),t=n;break}return r}}function Dy(e,t){if(e===t)return!0;if(Array.isArray(e)){let r=e.length;if(!t||t.length!==r)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}return!1}var yh=1,Os=2,vy="never",Uy="no-overlap",An="best-available",Gy=5,Vy={[An]:zy,[Uy]:ky,[vy]:()=>{}},Hy={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{}},Je=class{constructor(t){this._getCullBounds=xh(Ah),this.opts={...Hy,...t},this.setOptions(this.opts),this.onTileLoad=r=>{this.opts.onTileLoad?.(r),this.opts.maxCacheByteSize&&(this._cacheByteSize+=r.byteLength,this._resizeCache())},this._requestScheduler=new me({throttleRequests:this.opts.maxRequests>0||this.opts.debounceTime>0,maxRequests:this.opts.maxRequests,debounceTime:this.opts.debounceTime}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._zRange=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new P,this._modelMatrixInverse=new P}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles!==null&&this._selectedTiles.every(t=>t.isLoaded)}get needsReload(){return this._selectedTiles!==null&&this._selectedTiles.some(t=>t.needsReload)}setOptions(t){Object.assign(this.opts,t),Number.isFinite(t.maxZoom)&&(this._maxZoom=Math.floor(t.maxZoom)),Number.isFinite(t.minZoom)&&(this._minZoom=Math.ceil(t.minZoom))}finalize(){for(let t of this._cache.values())t.isLoading&&t.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(let t of this._cache.keys()){let r=this._cache.get(t);!this._selectedTiles||!this._selectedTiles.includes(r)?this._cache.delete(t):r.setNeedsReload()}}update(t,{zRange:r,modelMatrix:n}={zRange:null,modelMatrix:null}){let s=n?new P(n):new P,o=!s.equals(this._modelMatrix);if(!this._viewport||!t.equals(this._viewport)||!mt(this._zRange,r)||o){o&&(this._modelMatrixInverse=s.clone().invert(),this._modelMatrix=s),this._viewport=t,this._zRange=r;let a=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:r,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=a.map(c=>this._getTile(c,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(a=>this._getTile(a.index,!0)));let i=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),i&&this._frameNumber++,this._frameNumber}isTileVisible(t,r){if(!t.isVisible)return!1;if(r&&this._viewport){let n=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:r}),{bbox:s}=t;for(let[o,i,a,c]of n){let l;if("west"in s)l=s.west<a&&s.east>o&&s.south<c&&s.north>i;else{let u=Math.min(s.top,s.bottom),f=Math.max(s.top,s.bottom);l=s.left<a&&s.right>o&&u<c&&f>i}if(l)return!0}return!1}return!0}getTileIndices({viewport:t,maxZoom:r,minZoom:n,zRange:s,modelMatrix:o,modelMatrixInverse:i}){let{tileSize:a,extent:c,zoomOffset:l}=this.opts;return Ca({viewport:t,maxZoom:r,minZoom:n,zRange:s,tileSize:a,extent:c,modelMatrix:o,modelMatrixInverse:i,zoomOffset:l})}getTileId(t){return`${t.x}-${t.y}-${t.z}`}getTileZoom(t){return t.z}getTileMetadata(t){let{tileSize:r}=this.opts;return{bbox:Ba(this._viewport,t.x,t.y,t.z,r)}}getParentIndex(t){let r=Math.floor(t.x/2),n=Math.floor(t.y/2),s=t.z-1;return{x:r,y:n,z:s}}updateTileStates(){let t=this.opts.refinementStrategy||An,r=new Array(this._cache.size),n=0;for(let s of this._cache.values())r[n++]=s.isVisible,s.isSelected=!1,s.isVisible=!1;for(let s of this._selectedTiles)s.isSelected=!0,s.isVisible=!0;(typeof t=="function"?t:Vy[t])(Array.from(this._cache.values())),n=0;for(let s of this._cache.values())if(r[n++]!==s.isVisible)return!0;return!1}_pruneRequests(){let{maxRequests:t=0}=this.opts,r=[],n=0;for(let s of this._cache.values())s.isLoading&&(n++,!s.isSelected&&!s.isVisible&&r.push(s));for(;t>0&&n>t&&r.length>0;)r.shift().abort(),n--}_rebuildTree(){let{_cache:t}=this;for(let r of t.values())r.parent=null,r.children&&(r.children.length=0);for(let r of t.values()){let n=this._getNearestAncestor(r);r.parent=n,n?.children&&n.children.push(r)}}_resizeCache(){let{_cache:t,opts:r}=this,n=r.maxCacheSize||(r.maxCacheByteSize?1/0:Gy*this.selectedTiles.length),s=r.maxCacheByteSize||1/0;if(t.size>n||this._cacheByteSize>s){for(let[i,a]of t)if(!a.isVisible&&!a.isSelected&&(this._cacheByteSize-=r.maxCacheByteSize?a.byteLength:0,t.delete(i),this.opts.onTileUnload?.(a)),t.size<=n&&this._cacheByteSize<=s)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((i,a)=>i.zoom-a.zoom),this._dirty=!1)}_getTile(t,r){let n=this.getTileId(t),s=this._cache.get(n),o=!1;return!s&&r?(s=new ke(t),Object.assign(s,this.getTileMetadata(s.index)),Object.assign(s,{id:n,zoom:this.getTileZoom(s.index)}),o=!0,this._cache.set(n,s),this._dirty=!0):s&&s.needsReload&&(o=!0),s&&o&&s.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),s}_getNearestAncestor(t){let{_minZoom:r=0}=this,n=t.index;for(;this.getTileZoom(n)>r;){n=this.getParentIndex(n);let s=this._getTile(n);if(s)return s}return null}};function zy(e){for(let t of e)t.state=0;for(let t of e)t.isSelected&&!Th(t)&&Ma(t);for(let t of e)t.isVisible=Boolean(t.state&Os)}function ky(e){for(let r of e)r.state=0;for(let r of e)r.isSelected&&Th(r);let t=Array.from(e).sort((r,n)=>r.zoom-n.zoom);for(let r of t)if(r.isVisible=Boolean(r.state&Os),r.children&&(r.isVisible||r.state&yh))for(let n of r.children)n.state=yh;else r.isSelected&&Ma(r)}function Th(e){let t=e;for(;t;){if(t.isLoaded||t.content)return t.state|=Os,!0;t=t.parent}return!1}function Ma(e){for(let t of e.children)t.isLoaded||t.content?t.state|=Os:Ma(t)}var Jy={TilesetClass:Je,data:{type:"data",value:[]},dataComparator:Se.equal,renderSubLayers:{type:"function",value:e=>new _h.GeoJsonLayer(e)},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:e=>{}},onTileUnload:{type:"function",value:e=>{}},onTileError:{type:"function",value:e=>console.error(e)},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:An,zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0},Ns=class extends Ds.CompositeLayer{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){this.state?.tileset?.finalize()}get isLoaded(){return Boolean(this.state?.tileset?.selectedTiles?.every(t=>t.isLoaded&&t.layers&&t.layers.every(r=>r.isLoaded)))}shouldUpdateState({changeFlags:t}){return t.somethingChanged}updateState({changeFlags:t}){let{tileset:r}=this.state,n=t.propsOrDataChanged||t.updateTriggersChanged,s=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);r?n&&(r.setOptions(this._getTilesetOptions()),s?r.reloadAll():r.tiles.forEach(o=>{o.layers=null})):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}_getTilesetOptions(){let{tileSize:t,maxCacheSize:r,maxCacheByteSize:n,refinementStrategy:s,extent:o,maxZoom:i,minZoom:a,maxRequests:c,debounceTime:l,zoomOffset:u}=this.props;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:i,minZoom:a,tileSize:t,refinementStrategy:s,extent:o,maxRequests:c,debounceTime:l,zoomOffset:u,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){let t=this.state.tileset,{zRange:r,modelMatrix:n}=this.props,s=t.update(this.context.viewport,{zRange:r,modelMatrix:n}),{isLoaded:o}=t,i=this.state.isLoaded!==o,a=this.state.frameNumber!==s;o&&(i||a)&&this._onViewportLoad(),a&&this.setState({frameNumber:s}),this.state.isLoaded=o}_onViewportLoad(){let{tileset:t}=this.state,{onViewportLoad:r}=this.props;r&&r(t.selectedTiles)}_onTileLoad(t){this.props.onTileLoad(t),t.layers=null,this.setNeedsUpdate()}_onTileError(t,r){this.props.onTileError(t),r.layers=null,this.setNeedsUpdate()}_onTileUnload(t){this.props.onTileUnload(t)}getTileData(t){let{data:r,getTileData:n,fetch:s}=this.props,{signal:o}=t;return t.url=typeof r=="string"||Array.isArray(r)?Qt(r,t):null,n?n(t):s&&t.url?s(t.url,{propName:"data",layer:this,signal:o}):null}renderSubLayers(t){return this.props.renderSubLayers(t)}getSubLayerPropsByTile(t){return null}getPickingInfo(t){let r=t.sourceLayer.props.tile,n=t.info;return n.picked&&(n.tile=r),n.sourceTile=r,n}_updateAutoHighlight(t){let r=t.sourceTile;if(r&&r.layers)for(let n of r.layers)n.updateAutoHighlight(t)}renderLayers(){return this.state.tileset.tiles.map(t=>{let r=this.getSubLayerPropsByTile(t);if(!(!t.isLoaded&&!t.content))if(t.layers)r&&t.layers[0]&&Object.keys(r).some(n=>t.layers[0].props[n]!==r[n])&&(t.layers=t.layers.map(n=>n.clone(r)));else{let n=this.renderSubLayers({...this.props,...this.getSubLayerProps({id:t.id,updateTriggers:this.props.updateTriggers}),data:t.content,_offset:0,tile:t});t.layers=(0,Ds._flatten)(n,Boolean).map(s=>s.clone({tile:t,...r}))}return t.layers})}filterSubLayer({layer:t,cullRect:r}){let{tile:n}=t.props;return this.state.tileset.isTileVisible(n,r)}},Zt=Ns;(()=>{Ns.defaultProps=Jy})(),(()=>{Ns.layerName="TileLayer"})();var Eh=N(Nt(),1),qy={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:e=>e.timestamps}},vs=class extends Eh.PathLayer{getShaders(){let t=super.getShaders();return t.inject={"vs:#decl":`uniform float trailLength;
|
|
13
|
+
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}he.prototype.build=function(e){return this.options.preserveOrder?h0(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)};he.prototype.j2x=function(e,t){let r="",n="";for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(typeof e[s]>"u")this.isAttribute(s)&&(n+="");else if(e[s]===null)this.isAttribute(s)?n+="":s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(e[s]instanceof Date)n+=this.buildTextValNode(e[s],s,"",t);else if(typeof e[s]!="object"){let o=this.isAttribute(s);if(o)r+=this.buildAttrPairStr(o,""+e[s]);else if(s===this.options.textNodeName){let i=this.options.tagValueProcessor(s,""+e[s]);n+=this.replaceEntitiesValue(i)}else n+=this.buildTextValNode(e[s],s,"",t)}else if(Array.isArray(e[s])){let o=e[s].length,i="";for(let a=0;a<o;a++){let c=e[s][a];typeof c>"u"||(c===null?s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar:typeof c=="object"?this.options.oneListGroup?i+=this.j2x(c,t+1).val:i+=this.processTextOrObjNode(c,s,t):i+=this.buildTextValNode(c,s,"",t))}this.options.oneListGroup&&(i=this.buildObjectNode(i,s,"",t)),n+=i}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){let o=Object.keys(e[s]),i=o.length;for(let a=0;a<i;a++)r+=this.buildAttrPairStr(o[a],""+e[s][o[a]])}else n+=this.processTextOrObjNode(e[s],s,t);return{attrStr:r,val:n}};he.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'};function p0(e,t,r){let n=this.j2x(e,r+1);return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,r):this.buildObjectNode(n.val,t,n.attrStr,r)}he.prototype.buildObjectNode=function(e,t,r,n){if(e==="")return t[0]==="?"?this.indentate(n)+"<"+t+r+"?"+this.tagEndChar:this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar;{let s="</"+t+this.tagEndChar,o="";return t[0]==="?"&&(o="?",s=""),(r||r==="")&&e.indexOf("<")===-1?this.indentate(n)+"<"+t+r+o+">"+e+s:this.options.commentPropName!==!1&&t===this.options.commentPropName&&o.length===0?this.indentate(n)+`<!--${e}-->`+this.newLine:this.indentate(n)+"<"+t+r+o+this.tagEndChar+e+this.indentate(n)+s}};he.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${e}`,t};he.prototype.buildTextValNode=function(e,t,r,n){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(n)+`<!--${e}-->`+this.newLine;if(t[0]==="?")return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(t,e);return s=this.replaceEntitiesValue(s),s===""?this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+r+">"+s+"</"+t+this.tagEndChar}};he.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let r=this.options.entities[t];e=e.replace(r.regex,r.val)}return e};function m0(e){return this.options.indentBy.repeat(e)}function g0(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}Ql.exports=he});var tu=tt((gb,$l)=>{"use strict";var A0=si(),x0=ql(),y0=Zl();$l.exports={XMLParser:x0,XMLValidator:A0,XMLBuilder:y0}});var ga=tt((jf,fn)=>{(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof yl=="function"&&typeof fn=="object"&&fn&&fn.exports?fn.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(jf,function(){"use strict";function e(T,m,M){this.low=T|0,this.high=m|0,this.unsigned=!!M}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function t(T){return(T&&T.__isLong__)===!0}e.isLong=t;var r={},n={};function s(T,m){var M,L,R;return m?(T>>>=0,(R=0<=T&&T<256)&&(L=n[T],L)?L:(M=i(T,(T|0)<0?-1:0,!0),R&&(n[T]=M),M)):(T|=0,(R=-128<=T&&T<128)&&(L=r[T],L)?L:(M=i(T,T<0?-1:0,!1),R&&(r[T]=M),M))}e.fromInt=s;function o(T,m){if(isNaN(T)||!isFinite(T))return m?y:g;if(m){if(T<0)return y;if(T>=d)return b}else{if(T<=-p)return w;if(T+1>=p)return S}return T<0?o(-T,m).neg():i(T%h|0,T/h|0,m)}e.fromNumber=o;function i(T,m,M){return new e(T,m,M)}e.fromBits=i;var a=Math.pow;function c(T,m,M){if(T.length===0)throw Error("empty string");if(T==="NaN"||T==="Infinity"||T==="+Infinity"||T==="-Infinity")return g;if(typeof m=="number"?(M=m,m=!1):m=!!m,M=M||10,M<2||36<M)throw RangeError("radix");var L;if((L=T.indexOf("-"))>0)throw Error("interior hyphen");if(L===0)return c(T.substring(1),m,M).neg();for(var R=o(a(M,8)),F=g,D=0;D<T.length;D+=8){var X=Math.min(8,T.length-D),H=parseInt(T.substring(D,D+X),M);if(X<8){var Q=o(a(M,X));F=F.mul(Q).add(o(H))}else F=F.mul(R),F=F.add(o(H))}return F.unsigned=m,F}e.fromString=c;function l(T){return T instanceof e?T:typeof T=="number"?o(T):typeof T=="string"?c(T):i(T.low,T.high,T.unsigned)}e.fromValue=l;var u=1<<16,f=1<<24,h=u*u,d=h*h,p=d/2,A=s(f),g=s(0);e.ZERO=g;var y=s(0,!0);e.UZERO=y;var E=s(1);e.ONE=E;var _=s(1,!0);e.UONE=_;var B=s(-1);e.NEG_ONE=B;var S=i(-1,2147483647,!1);e.MAX_VALUE=S;var b=i(-1,-1,!0);e.MAX_UNSIGNED_VALUE=b;var w=i(0,-2147483648,!1);e.MIN_VALUE=w;var C=e.prototype;return C.toInt=function(){return this.unsigned?this.low>>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},C.toString=function(m){if(m=m||10,m<2||36<m)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(w)){var M=o(m),L=this.div(M),R=L.mul(M).sub(this);return L.toString(m)+R.toInt().toString(m)}else return"-"+this.neg().toString(m);for(var F=o(a(m,6),this.unsigned),D=this,X="";;){var H=D.div(F),Q=D.sub(H.mul(F)).toInt()>>>0,j=Q.toString(m);if(D=H,D.isZero())return j+X;for(;j.length<6;)j="0"+j;X=""+j+X}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var m=this.high!=0?this.high:this.low,M=31;M>0&&!(m&1<<M);M--);return this.high!=0?M+33:M+1},C.isZero=function(){return this.high===0&&this.low===0},C.isNegative=function(){return!this.unsigned&&this.high<0},C.isPositive=function(){return this.unsigned||this.high>=0},C.isOdd=function(){return(this.low&1)===1},C.isEven=function(){return(this.low&1)===0},C.equals=function(m){return t(m)||(m=l(m)),this.unsigned!==m.unsigned&&this.high>>>31===1&&m.high>>>31===1?!1:this.high===m.high&&this.low===m.low},C.eq=C.equals,C.notEquals=function(m){return!this.eq(m)},C.neq=C.notEquals,C.lessThan=function(m){return this.comp(m)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(m){return this.comp(m)<=0},C.lte=C.lessThanOrEqual,C.greaterThan=function(m){return this.comp(m)>0},C.gt=C.greaterThan,C.greaterThanOrEqual=function(m){return this.comp(m)>=0},C.gte=C.greaterThanOrEqual,C.compare=function(m){if(t(m)||(m=l(m)),this.eq(m))return 0;var M=this.isNegative(),L=m.isNegative();return M&&!L?-1:!M&&L?1:this.unsigned?m.high>>>0>this.high>>>0||m.high===this.high&&m.low>>>0>this.low>>>0?-1:1:this.sub(m).isNegative()?-1:1},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(E)},C.neg=C.negate,C.add=function(m){t(m)||(m=l(m));var M=this.high>>>16,L=this.high&65535,R=this.low>>>16,F=this.low&65535,D=m.high>>>16,X=m.high&65535,H=m.low>>>16,Q=m.low&65535,j=0,W=0,$=0,At=0;return At+=F+Q,$+=At>>>16,At&=65535,$+=R+H,W+=$>>>16,$&=65535,W+=L+X,j+=W>>>16,W&=65535,j+=M+D,j&=65535,i($<<16|At,j<<16|W,this.unsigned)},C.subtract=function(m){return t(m)||(m=l(m)),this.add(m.neg())},C.sub=C.subtract,C.multiply=function(m){if(this.isZero()||(t(m)||(m=l(m)),m.isZero()))return g;if(this.eq(w))return m.isOdd()?w:g;if(m.eq(w))return this.isOdd()?w:g;if(this.isNegative())return m.isNegative()?this.neg().mul(m.neg()):this.neg().mul(m).neg();if(m.isNegative())return this.mul(m.neg()).neg();if(this.lt(A)&&m.lt(A))return o(this.toNumber()*m.toNumber(),this.unsigned);var M=this.high>>>16,L=this.high&65535,R=this.low>>>16,F=this.low&65535,D=m.high>>>16,X=m.high&65535,H=m.low>>>16,Q=m.low&65535,j=0,W=0,$=0,At=0;return At+=F*Q,$+=At>>>16,At&=65535,$+=R*Q,W+=$>>>16,$&=65535,$+=F*H,W+=$>>>16,$&=65535,W+=L*Q,j+=W>>>16,W&=65535,W+=R*H,j+=W>>>16,W&=65535,W+=F*X,j+=W>>>16,W&=65535,j+=M*Q+L*H+R*X+F*D,j&=65535,i($<<16|At,j<<16|W,this.unsigned)},C.mul=C.multiply,C.divide=function(m){if(t(m)||(m=l(m)),m.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?y:g;var M,L,R;if(this.unsigned){if(m.unsigned||(m=m.toUnsigned()),m.gt(this))return y;if(m.gt(this.shru(1)))return _;R=y}else{if(this.eq(w)){if(m.eq(E)||m.eq(B))return w;if(m.eq(w))return E;var F=this.shr(1);return M=F.div(m).shl(1),M.eq(g)?m.isNegative()?E:B:(L=this.sub(m.mul(M)),R=M.add(L.div(m)),R)}else if(m.eq(w))return this.unsigned?y:g;if(this.isNegative())return m.isNegative()?this.neg().div(m.neg()):this.neg().div(m).neg();if(m.isNegative())return this.div(m.neg()).neg();R=g}for(L=this;L.gte(m);){M=Math.max(1,Math.floor(L.toNumber()/m.toNumber()));for(var D=Math.ceil(Math.log(M)/Math.LN2),X=D<=48?1:a(2,D-48),H=o(M),Q=H.mul(m);Q.isNegative()||Q.gt(L);)M-=X,H=o(M,this.unsigned),Q=H.mul(m);H.isZero()&&(H=E),R=R.add(H),L=L.sub(Q)}return R},C.div=C.divide,C.modulo=function(m){return t(m)||(m=l(m)),this.sub(this.div(m).mul(m))},C.mod=C.modulo,C.not=function(){return i(~this.low,~this.high,this.unsigned)},C.and=function(m){return t(m)||(m=l(m)),i(this.low&m.low,this.high&m.high,this.unsigned)},C.or=function(m){return t(m)||(m=l(m)),i(this.low|m.low,this.high|m.high,this.unsigned)},C.xor=function(m){return t(m)||(m=l(m)),i(this.low^m.low,this.high^m.high,this.unsigned)},C.shiftLeft=function(m){return t(m)&&(m=m.toInt()),(m&=63)===0?this:m<32?i(this.low<<m,this.high<<m|this.low>>>32-m,this.unsigned):i(0,this.low<<m-32,this.unsigned)},C.shl=C.shiftLeft,C.shiftRight=function(m){return t(m)&&(m=m.toInt()),(m&=63)===0?this:m<32?i(this.low>>>m|this.high<<32-m,this.high>>m,this.unsigned):i(this.high>>m-32,this.high>=0?0:-1,this.unsigned)},C.shr=C.shiftRight,C.shiftRightUnsigned=function(m){if(t(m)&&(m=m.toInt()),m&=63,m===0)return this;var M=this.high;if(m<32){var L=this.low;return i(L>>>m|M<<32-m,M>>>m,this.unsigned)}else return m===32?i(M,0,this.unsigned):i(M>>>m-32,0,this.unsigned)},C.shru=C.shiftRightUnsigned,C.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},C.toBytes=function(T){return T?this.toBytesLE():this.toBytesBE()},C.toBytesLE=function(){var T=this.high,m=this.low;return[m&255,m>>>8&255,m>>>16&255,m>>>24&255,T&255,T>>>8&255,T>>>16&255,T>>>24&255]},C.toBytesBE=function(){var T=this.high,m=this.low;return[T>>>24&255,T>>>16&255,T>>>8&255,T&255,m>>>24&255,m>>>16&255,m>>>8&255,m&255]},e})});var Us=tt((XR,Bh)=>{Bh.exports=globalThis.h3||{}});var wa=tt((rP,Ih)=>{Ih.exports=globalThis.luma});var zs=tt((nP,wh)=>{wh.exports=globalThis.deck});var Lh=tt((sP,Fh)=>{Fh.exports=globalThis.luma});var yr=tt((WP,nd)=>{nd.exports=globalThis.loaders});var Tm=tt((YG,ym)=>{ym.exports=globalThis.deck});var Fm=tt(il=>{il.read=function(e,t,r,n,s){var o,i,a=s*8-n-1,c=(1<<a)-1,l=c>>1,u=-7,f=r?s-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-u)-1,d>>=-u,u+=a;u>0;o=o*256+e[t+f],f+=h,u-=8);for(i=o&(1<<-u)-1,o>>=-u,u+=n;u>0;i=i*256+e[t+f],f+=h,u-=8);if(o===0)o=1-l;else{if(o===c)return i?NaN:(d?-1:1)*(1/0);i=i+Math.pow(2,n),o=o-l}return(d?-1:1)*i*Math.pow(2,o-n)};il.write=function(e,t,r,n,s,o){var i,a,c,l=o*8-s-1,u=(1<<l)-1,f=u>>1,h=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,A=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-i))<1&&(i--,c*=2),i+f>=1?t+=h/c:t+=h*Math.pow(2,1-f),t*c>=2&&(i++,c/=2),i+f>=u?(a=0,i=u):i+f>=1?(a=(t*c-1)*Math.pow(2,s),i=i+f):(a=t*Math.pow(2,f-1)*Math.pow(2,s),i=0));s>=8;e[r+d]=a&255,d+=p,a/=256,s-=8);for(i=i<<s|a,l+=s;l>0;e[r+d]=i&255,d+=p,i/=256,l-=8);e[r+d-p]|=A*128}});var Dm=tt((D4,Nm)=>{"use strict";Nm.exports=k;var qo=Fm();function k(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}k.Varint=0;k.Fixed64=1;k.Bytes=2;k.Fixed32=5;var al=(1<<16)*(1<<16),Lm=1/al,sS=12,Om=typeof TextDecoder>"u"?null:new TextDecoder("utf8");k.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),s=n>>3,o=this.pos;this.type=n&7,e(s,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=jo(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Pm(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=jo(this.buf,this.pos)+jo(this.buf,this.pos+4)*al;return this.pos+=8,e},readSFixed64:function(){var e=jo(this.buf,this.pos)+Pm(this.buf,this.pos+4)*al;return this.pos+=8,e},readFloat:function(){var e=qo.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=qo.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,r,n;return n=t[this.pos++],r=n&127,n<128||(n=t[this.pos++],r|=(n&127)<<7,n<128)||(n=t[this.pos++],r|=(n&127)<<14,n<128)||(n=t[this.pos++],r|=(n&127)<<21,n<128)?r:(n=t[this.pos],r|=(n&15)<<28,oS(r,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=sS&&Om?yS(this.buf,t,e):xS(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==k.Bytes)return e.push(this.readVarint(t));var r=ue(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==k.Bytes)return e.push(this.readSVarint());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==k.Bytes)return e.push(this.readBoolean());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==k.Bytes)return e.push(this.readFloat());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==k.Bytes)return e.push(this.readDouble());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==k.Bytes)return e.push(this.readFixed32());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==k.Bytes)return e.push(this.readSFixed32());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==k.Bytes)return e.push(this.readFixed64());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==k.Bytes)return e.push(this.readSFixed64());var t=ue(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=e&7;if(t===k.Varint)for(;this.buf[this.pos++]>127;);else if(t===k.Bytes)this.pos=this.readVarint()+this.pos;else if(t===k.Fixed32)this.pos+=4;else if(t===k.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Gr(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Gr(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Gr(this.buf,e&-1,this.pos),Gr(this.buf,Math.floor(e*Lm),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Gr(this.buf,e&-1,this.pos),Gr(this.buf,Math.floor(e*Lm),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){iS(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var t=this.pos;this.pos=TS(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Rm(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),qo.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),qo.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&Rm(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,k.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,lS,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,uS,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,dS,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,fS,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,hS,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,pS,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,mS,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,gS,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,AS,t)},writeBytesField:function(e,t){this.writeTag(e,k.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,k.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,k.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,k.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,k.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,k.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,k.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,k.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,k.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,k.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};function oS(e,t,r){var n=r.buf,s,o;if(o=n[r.pos++],s=(o&112)>>4,o<128||(o=n[r.pos++],s|=(o&127)<<3,o<128)||(o=n[r.pos++],s|=(o&127)<<10,o<128)||(o=n[r.pos++],s|=(o&127)<<17,o<128)||(o=n[r.pos++],s|=(o&127)<<24,o<128)||(o=n[r.pos++],s|=(o&1)<<31,o<128))return Ur(e,s,t);throw new Error("Expected varint not more than 10 bytes")}function ue(e){return e.type===k.Bytes?e.readVarint()+e.pos:e.pos+1}function Ur(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function iS(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),aS(r,n,t),cS(n,t)}function aS(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function cS(e,t){var r=(e&7)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function Rm(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(n);for(var s=r.pos-1;s>=e;s--)r.buf[s+n]=r.buf[s]}function lS(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function uS(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function fS(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function hS(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function dS(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function pS(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function mS(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function gS(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function AS(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function jo(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function Gr(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Pm(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function xS(e,t,r){for(var n="",s=t;s<r;){var o=e[s],i=null,a=o>239?4:o>223?3:o>191?2:1;if(s+a>r)break;var c,l,u;a===1?o<128&&(i=o):a===2?(c=e[s+1],(c&192)===128&&(i=(o&31)<<6|c&63,i<=127&&(i=null))):a===3?(c=e[s+1],l=e[s+2],(c&192)===128&&(l&192)===128&&(i=(o&15)<<12|(c&63)<<6|l&63,(i<=2047||i>=55296&&i<=57343)&&(i=null))):a===4&&(c=e[s+1],l=e[s+2],u=e[s+3],(c&192)===128&&(l&192)===128&&(u&192)===128&&(i=(o&15)<<18|(c&63)<<12|(l&63)<<6|u&63,(i<=65535||i>=1114112)&&(i=null))),i===null?(i=65533,a=1):i>65535&&(i-=65536,n+=String.fromCharCode(i>>>10&1023|55296),i=56320|i&1023),n+=String.fromCharCode(i),s+=a}return n}function yS(e,t,r){return Om.decode(e.subarray(t,r))}function TS(e,t,r){for(var n=0,s,o;n<t.length;n++){if(s=t.charCodeAt(n),s>55295&&s<57344)if(o)if(s<56320){e[r++]=239,e[r++]=191,e[r++]=189,o=s;continue}else s=o-55296<<10|s-56320|65536,o=null;else{s>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):o=s;continue}else o&&(e[r++]=239,e[r++]=191,e[r++]=189,o=null);s<128?e[r++]=s:(s<2048?e[r++]=s>>6|192:(s<65536?e[r++]=s>>12|224:(e[r++]=s>>18|240,e[r++]=s>>12&63|128),e[r++]=s>>6&63|128),e[r++]=s&63|128)}return r}});var Xn={};ut(Xn,{GeohashLayer:()=>jn,GreatCircleLayer:()=>un,H3ClusterLayer:()=>_n,H3HexagonLayer:()=>qe,MVTLayer:()=>qn,QuadkeyLayer:()=>dn,S2Layer:()=>hn,TerrainLayer:()=>Un,Tile3DLayer:()=>On,TileLayer:()=>Zt,TripsLayer:()=>xn,_GeoCellLayer:()=>St,_Tile2DHeader:()=>ke,_Tileset2D:()=>Je,_WMSLayer:()=>Es,_getURLFromTemplate:()=>Qt});var Jt={},_l=N(Nt(),1);fe(Jt,N(Nt(),1));if(!_l.GeoJsonLayer)throw new Error("@deck.gl/layers is not found");fe(Xn,Jt);var ze=N(Dt(),1),kf=N(Nt(),1);function fg(e){return typeof e=="string"?e.charAt(0).toLowerCase()+e.slice(1):e}function Yn(e){if(Array.isArray(e))return e.map(t=>Yn(t));if(e&&typeof e=="object"){let t={};for(let[r,n]of Object.entries(e))t[fg(r)]=Yn(n);return t}return e}var eu=N(tu(),1);function fi(e,t){if(t?._parser&&t._parser!=="fast-xml-parser")throw new Error(t?._parser);let r={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:t?.removeNSPrefix,textNodeName:t?.textNodeName,isArray:(s,o,i,a)=>Boolean(t?.arrayPaths?.some(l=>o===l)),...t?._fastXML},n=T0(e,r);return t?.uncapitalizeKeys?Yn(n):n}function T0(e,t){return new eu.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...t}).parse(e)}var _0="4.2.0-beta.2",vt={dataType:null,batchType:null,name:"XML",id:"xml",module:"xml",version:_0,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:E0,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(e,t)=>fi(new TextDecoder().decode(e),{...vt.options.xml,...t?.xml}),parseTextSync:(e,t)=>fi(e,{...vt.options.xml,...t?.xml})};function E0(e){return e.startsWith("<?xml")}async function Et(e,t,r,n){return n._parse(e,t,r,n)}function G(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var qt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},B0=qt.self||qt.window||qt.global||{},C0=qt.window||qt.self||qt.global||{},S0=qt.global||qt.self||qt.window||{},b0=qt.document||{};var Jr=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var ru=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),M0=ru&&parseFloat(ru[1])||0;var Qn=globalThis,I0=globalThis.document||{},Zn=globalThis.process||{},w0=globalThis.console,Cb=globalThis.navigator||{};function nu(e){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let t=typeof navigator<"u"&&navigator.userAgent,r=e||t;return Boolean(r&&r.indexOf("Electron")>=0)}function Le(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||nu()}var hi="4.0.7";function L0(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var $n=class{constructor(t,r,n="sessionStorage"){this.storage=L0(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function su(e){let t;return e<10?t=`${e.toFixed(2)}ms`:e<100?t=`${e.toFixed(1)}ms`:e<1e3?t=`${e.toFixed(0)}ms`:t=`${(e/1e3).toFixed(2)}s`,t}function ou(e,t=8){let r=Math.max(t-e.length,0);return`${" ".repeat(r)}${e}`}var ts;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(ts||(ts={}));var R0=10;function iu(e){return typeof e!="string"?e:(e=e.toUpperCase(),ts[e]||ts.WHITE)}function au(e,t,r){return!Le&&typeof e=="string"&&(t&&(e=`\x1B[${iu(t)}m${e}\x1B[39m`),r&&(e=`\x1B[${iu(r)+R0}m${e}\x1B[49m`)),e}function cu(e,t=["constructor"]){let r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),s=e;for(let o of n){let i=s[o];typeof i=="function"&&(t.find(a=>o===a)||(s[o]=i.bind(e)))}}function qr(e,t){if(!e)throw new Error(t||"Assertion failed")}function Re(){let e;if(Le()&&Qn.performance)e=Qn?.performance?.now?.();else if("hrtime"in Zn){let t=Zn?.hrtime?.();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var cr={debug:Le()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},P0={enabled:!0,level:0};function lr(){}var lu={},uu={once:!0},jr=class{constructor({id:t}={id:""}){this.VERSION=hi,this._startTs=Re(),this._deltaTs=Re(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new $n(`__probe-${this.id}__`,P0),this.timeStamp(`${this.id} started`),cu(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Re()-this._startTs).toPrecision(10))}getDelta(){return Number((Re()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){if(!t)throw new Error(r||"Assertion failed")}warn(t){return this._getLogFunction(0,t,cr.warn,arguments,uu)}error(t){return this._getLogFunction(0,t,cr.error,arguments)}deprecated(t,r){return this.warn(`\`${t}\` is deprecated and will be removed in a later version. Use \`${r}\` instead`)}removed(t,r){return this.error(`\`${t}\` has been removed. Use \`${r}\` instead`)}probe(t,r){return this._getLogFunction(t,r,cr.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,cr.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,cr.debug||cr.info,arguments,uu)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||lr,n&&[n],{tag:N0(r)}):lr}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||lr)}group(t,r,n={collapsed:!1}){let s=fu({logLevel:t,message:r,opts:n}),{collapsed:o}=n;return s.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(s)}groupCollapsed(t,r,n={}){return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||lr)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=hu(t)}_getLogFunction(t,r,n,s,o){if(this._shouldLog(t)){o=fu({logLevel:t,message:r,args:s,opts:o}),n=n||o.method,qr(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Re();let i=o.tag||o.message;if(o.once&&i)if(!lu[i])lu[i]=Re();else return lr;return r=O0(this.id,o.message,o),n.bind(console,r,...o.args)}return lr}};jr.VERSION=hi;function hu(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return qr(Number.isFinite(t)&&t>=0),t}function fu(e){let{logLevel:t,message:r}=e;e.logLevel=hu(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let s=typeof e.message;return qr(s==="string"||s==="object"),Object.assign(e,{args:n},e.opts)}function O0(e,t,r){if(typeof t=="string"){let n=r.time?ou(su(r.total)):"";t=r.time?`${e}: ${n} ${t}`:`${e}: ${t}`,t=au(t,r.color,r.background)}return t}function N0(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}globalThis.probe={};var di=new jr({id:"@probe.gl/log"});function pi(e,t){return du(e||{},t)}function du(e,t,r=0){if(r>3)return t;let n={...e};for(let[s,o]of Object.entries(t))o&&typeof o=="object"&&!Array.isArray(o)?n[s]=du(n[s]||{},t[s],r+1):n[s]=t[s];return n}function mi(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function gi(e){return globalThis.loaders?.modules?.[e]||null}function D0(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.0-beta.2"),globalThis._loadersgl_.version}var pu=D0();function mu(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var jt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},eM=jt.self||jt.window||jt.global||{},rM=jt.window||jt.self||jt.global||{},nM=jt.global||jt.self||jt.window||{},sM=jt.document||{};var ur=typeof process!="object"||String(process)!=="[object process]"||process.browser,es=typeof importScripts=="function",oM=typeof window<"u"&&typeof window.orientation<"u",gu=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),iM=gu&&parseFloat(gu[1])||0;var Ai={};async function Xt(e,t=null,r={},n=null){return t&&(e=Au(e,t,r,n)),Ai[e]=Ai[e]||v0(e),await Ai[e]}function Au(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let s=r.modules||{};return s[n]?s[n]:ur?r.CDN?(mu(r.CDN.startsWith("http")),`${r.CDN}/${t}@${pu}/dist/libs/${n}`):es?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function v0(e){if(e.endsWith("wasm"))return await G0(e);if(!ur)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(e)}catch(r){return console.error(r),null}if(es)return importScripts(e);let t=await V0(e);return U0(t,e)}function U0(e,t){if(!ur){let{requireFromString:n}=globalThis.loaders||{};return n?.(e,t)}if(es)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function G0(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};return ur||!t||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await t(e)}async function V0(e){let{readFileAsText:t}=globalThis.loaders||{};return ur||!t||e.startsWith("http")?await(await fetch(e)).text():await t(e)}function yu(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?xu(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?xu(e,0,t):""}function xu(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),s="";for(let o=0;o<r;o++)s+=String.fromCharCode(n.getUint8(t+o));return s}function xi(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${yu(e)}"`)}}function Xr(...e){let t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let n=t.reduce((i,a)=>i+a.length,0),s=new r(n),o=0;for(let i of t)s.set(i,o),o+=i.length;return s}function Pe(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function de(e,t){return G(e>=0),G(t>0),e+(t-1)&~(t-1)}function yi(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let s=e.byteOffset,o=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,s,o)}return t.set(n,r),r+de(n.byteLength,4)}function Wr(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Oe=class{constructor(t,r){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Wr(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Wr()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var pe=class{constructor(t){this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t,r="count"){return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(t=[]){t.forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,s=this.stats[r];return s||(t instanceof Oe?s=t:s=new Oe(r,n),this.stats[r]=s),s}};var H0="Queued Requests",z0="Active Requests",k0="Cancelled Requests",J0="Queued Requests Ever",q0="Active Requests Ever",j0={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0},me=class{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(t={}){this.props={...j0,...t},this.stats=new pe({id:this.props.id}),this.stats.get(H0),this.stats.get(z0),this.stats.get(k0),this.stats.get(J0),this.stats.get(q0)}scheduleRequest(t,r=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);let n={handle:t,priority:0,getPriority:r},s=new Promise(o=>(n.resolve=o,n));return this.requestQueue.push(n),this.requestMap.set(t,s),this._issueNewRequests(),s}_issueRequest(t){let{handle:r,resolve:n}=t,s=!1,o=()=>{s||(s=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:o}):Promise.resolve({done:o})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(let r=0;r<t;++r){let n=this.requestQueue.shift();n&&this._issueRequest(n)}}}_updateAllRequests(){let t=this.requestQueue;for(let r=0;r<t.length;++r){let n=t[r];this._updateRequest(n)||(t.splice(r,1),this.requestMap.delete(n.handle),r--)}t.sort((r,n)=>r.priority-n.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}};var ge={};ut(ge,{dirname:()=>W0,filename:()=>X0,join:()=>Y0,resolve:()=>K0});function Tu(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function X0(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function W0(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function Y0(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function K0(...e){let t=[];for(let o=0;o<e.length;o++)t[o]=e[o];let r="",n=!1,s;for(let o=t.length-1;o>=-1&&!n;o--){let i;o>=0?i=t[o]:(s===void 0&&(s=Tu()),i=s),i.length!==0&&(r=`${i}/${r}`,n=i.charCodeAt(0)===Yr)}return r=Q0(r,!n),n?`/${r}`:r.length>0?r:"."}var Yr=47,Ti=46;function Q0(e,t){let r="",n=-1,s=0,o,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)o=e.charCodeAt(a);else{if(o===Yr)break;o=Yr}if(o===Yr){if(!(n===a-1||s===1))if(n!==a-1&&s===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==Ti||r.charCodeAt(r.length-2)!==Ti){if(r.length>2){let c=r.length-1,l=c;for(;l>=0&&r.charCodeAt(l)!==Yr;--l);if(l!==c){r=l===-1?"":r.slice(0,l),n=a,s=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,s=0,i=!1;continue}}t&&(r.length>0?r+="/..":r="..",i=!0)}else{let c=e.slice(n+1,a);r.length>0?r+=`/${c}`:r=c,i=!1}n=a,s=0}else o===Ti&&s!==-1?++s:s=-1}return r}var rs=class{fetch;loadOptions;_needsRefresh=!0;props;constructor(t){this.props={...t},this.loadOptions={...t.loadOptions},this.fetch=Z0(this.loadOptions)}setProps(t){this.props=Object.assign(this.props,t),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(t=!0){let r=this._needsRefresh;return t&&(this._needsRefresh=!1),r}};function Z0(e){let t=e?.fetch;if(t&&typeof t=="function")return(n,s)=>t(n,s);let r=e?.fetch;return r&&typeof r!="function"?n=>fetch(n,r):n=>fetch(n)}var Mt=class extends rs{};ar(Mt,"type","template"),ar(Mt,"testURL",t=>!1);function _u(e,t){let r=vt.parseTextSync?.(e,t),n=r?.ServiceExceptionReport?.ServiceException||r?.["ogc:ServiceExceptionReport"]?.["ogc:ServiceException"];return typeof n=="string"?n:n.value||n.code||"Unknown error"}var $0="4.2.0-beta.2",Kr={dataType:null,batchType:null,id:"wms-error",name:"WMS Error",module:"wms",version:$0,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:tA,options:{wms:{throwOnError:!1}},parse:async(e,t)=>_i(new TextDecoder().decode(e),t),parseSync:(e,t)=>_i(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>_i(e,t)};function tA(e){return e.startsWith("<?xml")}function _i(e,t){let r={...Kr.options.wms,...t?.wms},n=_u(e,r),s=r.minimalErrors?n:`WMS Service error: ${n}`;if(r.throwOnError)throw new Error(s);return s}function Ne(e){return Array.isArray(e)?e:e?[e]:[]}function Qr(e){let t=Ne(e);return t.length>0&&t.every(r=>typeof r=="string")?t:[]}function Zr(e,t=void 0){switch(typeof e){case"number":return e;case"string":return parseFloat(e);default:return}}function ns(e,t=void 0){switch(typeof e){case"number":return e;case"string":return parseInt(e,10);default:return}}function De(e){switch(e){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function Ei(e,t){let r=vt.parseTextSync?.(e,t),n=r.WMT_MS_Capabilities||r.WMS_Capabilities||r,s=eA(n);if(t?.inheritedLayerProps)for(let o of s.layers)Bu(o,null);return t?.includeRawJSON&&(s.json=n),t?.includeXMLText&&(s.xml=e),s}function eA(e){let t={version:String(e.version||""),name:String(e.Service?.Name||"unnamed"),title:e.Service?.Title?String(e.Service?.Title):void 0,abstract:e.Service?.Abstract?String(e.Service?.Abstract):void 0,keywords:Qr(e.Service?.KeywordList?.Keyword),fees:e.Service?.Fees?JSON.stringify(e.Service?.Fees):void 0,accessConstraints:e.Service?.AccessConstraints?JSON.stringify(e.Service?.AccessConstraints):void 0,layerLimit:ns(e.Service?.LayerLimit),maxWidth:ns(e.Service?.maxWidth),maxHeight:ns(e.Service?.maxHeight),layers:[],requests:rA(e.Capability?.Request),exceptions:nA(e.Exception)},r=Ne(e.Capability?.Layer);for(let n of r)t.layers.push(Eu(n));for(let[n,s]of Object.entries(t))s===void 0&&delete t[n];return t}function rA(e){let t={};for(let[r,n]of Object.entries(e||{})){let s=Qr(n?.Format);t[r]={mimeTypes:s}}return t}function nA(e){if(Ne(e?.Format).length>0)return{mimeTypes:Qr(e)}}function Eu(e){let t={title:String(e?.Title||""),name:e?.Name&&String(e?.Name),abstract:e?.Name&&String(e?.Abstract),keywords:Qr(e.KeywordList?.Keyword)},r=e?.CRS||e?.SRS;r&&Array.isArray(r)&&r.every(l=>typeof l=="string")&&(t.crs=r);let n=e?.EX_GeographicBoundingBox&&sA(e?.EX_GeographicBoundingBox);n&&(t.geographicBoundingBox=n),n=e?.LatLonBoundingBox&&oA(e?.LatLonBoundingBox),n&&(t.geographicBoundingBox=n);let s=e?.BoundingBox&&iA(e?.BoundingBox);s&&s.length>0&&(t.boundingBoxes=s);let i=Ne(e?.Dimension).map(l=>cA(l));i.length&&(t.dimensions=i),e?.opaque&&(t.opaque=De(e?.opaque)),e?.cascaded&&(t.cascaded=De(e?.cascaded)),e?.queryable&&(t.queryable=De(e?.queryable));let a=Ne(e?.Layer),c=[];for(let l of a)c.push(Eu(l));c.length>0&&(t.layers=c);for(let[l,u]of Object.entries(t))u===void 0&&delete t[l];return t}function sA(e){let{westBoundLongitude:t,northBoundLatitude:r,eastBoundLongitude:n,southBoundLatitude:s}=e;return[[t,s],[n,r]]}function oA(e){let{minx:t,miny:r,maxx:n,maxy:s}=e;return[[t,r],[n,s]]}function iA(e){return Ne(e).map(r=>aA(r))}function aA(e){let{CRS:t,SRS:r,minx:n,miny:s,maxx:o,maxy:i,resx:a,resy:c}=e,l={crs:t||r,boundingBox:[[Zr(n),Zr(s)],[Zr(o),Zr(i)]]};return a&&(l.xResolution=a),c&&(l.yResolution=c),l}function cA(e){let{name:t,units:r,value:n}=e,s={name:t,units:r,extent:n};return e.unitSymbol&&(s.unitSymbol=e.unitSymbol),e.default&&(s.defaultValue=e.default),e.multipleValues&&(s.multipleValues=De(e.multipleValues)),e.nearestValue&&(s.nearestValue=De(e.nearestValue)),e.current&&(s.current=De(e.current)),s}function Bu(e,t){t?.geographicBoundingBox&&!e.geographicBoundingBox&&(e.geographicBoundingBox=[...t.geographicBoundingBox]),t?.crs&&!e.crs&&(e.crs=[...t.crs]),t?.boundingBoxes&&!e.boundingBoxes&&(e.boundingBoxes=[...t.boundingBoxes]),t?.dimensions&&!e.dimensions&&(e.dimensions=[...t.dimensions]);for(let r of e.layers||[])Bu(r,e)}var lA="4.2.0-beta.2",fr={dataType:null,batchType:null,id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:lA,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:uA,options:{wms:{}},parse:async(e,t)=>Ei(new TextDecoder().decode(e),t?.wms),parseTextSync:(e,t)=>Ei(e,t?.wms)};function uA(e){return e.startsWith("<?xml")}function Bi(e,t){let n=(vt.parseTextSync?.(e,t)).FeatureInfoResponse?.FIELDS||[];return{features:(Array.isArray(n)?n:[n]).map(o=>fA(o))}}function fA(e){return{attributes:e||{},type:"",bounds:{bottom:0,top:0,left:0,right:0}}}var Cu={...fr,dataType:null,id:"wms-feature-info",name:"WMS FeatureInfo",parse:async(e,t)=>Bi(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>Bi(e,t)};function Ci(e,t){return vt.parseTextSync?.(e,t)}var Su={...fr,dataType:null,id:"wms-layer-description",name:"WMS DescribeLayer",parse:async(e,t)=>Ci(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>Ci(e,t)};function bu(e,t){let{type:r="auto"}=e,n=r==="auto"?dA(e.url,t):hA(r,t);if(!n)throw new Error("Not a valid image source type");return n.create(e)}function hA(e,t){for(let r of t)if(r.type===e)return r;return null}function dA(e,t){for(let r of t)if(r.testURL&&r.testURL(e))return r;return null}var Mu="4.2.0-beta.2";var pA=globalThis.loaders?.parseImageNode,Si=typeof Image<"u",bi=typeof ImageBitmap<"u",mA=Boolean(pA),Mi=Jr?!0:mA;function Iu(e){switch(e){case"auto":return bi||Si||Mi;case"imagebitmap":return bi;case"image":return Si;case"data":return Mi;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function wu(){if(bi)return"imagebitmap";if(Si)return"image";if(Mi)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Fu(e){let t=gA(e);if(!t)throw new Error("Not an image");return t}function $r(e){switch(Fu(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function gA(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var AA=/^data:image\/svg\+xml/,xA=/\.svg((\?|#).*)?$/;function ss(e){return e&&(AA.test(e)||xA.test(e))}function Lu(e,t){if(ss(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Ii(e,t)}function Ii(e,t){if(ss(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function os(e,t,r){let n=Lu(e,r),s=self.URL||self.webkitURL,o=typeof n!="string"&&s.createObjectURL(n);try{return await yA(o||n,t)}finally{o&&s.revokeObjectURL(o)}}async function yA(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,s)=>{try{r.onload=()=>n(r),r.onerror=o=>{let i=o instanceof Error?o.message:"error";s(new Error(i))}}catch(o){s(o)}})}var TA={},Ru=!0;async function Pu(e,t,r){let n;ss(r)?n=await os(e,t,r):n=Ii(e,r);let s=t&&t.imagebitmap;return await _A(n,s)}async function _A(e,t=null){if((EA(t)||!Ru)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),Ru=!1}return await createImageBitmap(e)}function EA(e){for(let t in e||TA)return!1;return!0}function Ou(e){return!bA(e,"ftyp",4)||!(e[8]&96)?null:BA(e)}function BA(e){switch(CA(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function CA(e,t,r){return String.fromCharCode(...e.slice(t,r))}function SA(e){return[...e].map(t=>t.charCodeAt(0))}function bA(e,t,r=0){let n=SA(t);for(let s=0;s<n.length;++s)if(n[s]!==e[s+r])return!1;return!0}var Wt=!1,tn=!0;function ve(e){let t=en(e);return IA(t)||LA(t)||wA(t)||FA(t)||MA(t)}function MA(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=Ou(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function IA(e){let t=en(e);return t.byteLength>=24&&t.getUint32(0,Wt)===2303741511?{mimeType:"image/png",width:t.getUint32(16,Wt),height:t.getUint32(20,Wt)}:null}function wA(e){let t=en(e);return t.byteLength>=10&&t.getUint32(0,Wt)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,tn),height:t.getUint16(8,tn)}:null}function FA(e){let t=en(e);return t.byteLength>=14&&t.getUint16(0,Wt)===16973&&t.getUint32(2,tn)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,tn),height:t.getUint32(22,tn)}:null}function LA(e){let t=en(e);if(!(t.byteLength>=3&&t.getUint16(0,Wt)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=RA(),o=2;for(;o+9<t.byteLength;){let i=t.getUint16(o,Wt);if(s.has(i))return{mimeType:"image/jpeg",height:t.getUint16(o+5,Wt),width:t.getUint16(o+7,Wt)};if(!n.has(i))return null;o+=2,o+=t.getUint16(o,Wt)}return null}function RA(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function en(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function Nu(e,t){let{mimeType:r}=ve(e)||{},n=globalThis.loaders?.parseImageNode;return G(n),await n(e,r)}async function Du(e,t,r){t=t||{};let s=(t.image||{}).type||"auto",{url:o}=r||{},i=PA(s),a;switch(i){case"imagebitmap":a=await Pu(e,t,o);break;case"image":a=await os(e,t,o);break;case"data":a=await Nu(e,t);break;default:G(!1)}return s==="data"&&(a=$r(a)),a}function PA(e){switch(e){case"auto":case"data":return wu();default:return Iu(e),e}}var OA=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],NA=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],DA={image:{type:"auto",decode:!0}},Ae={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Mu,mimeTypes:NA,extensions:OA,parse:Du,tests:[e=>Boolean(ve(new DataView(e)))],options:DA};var wi={};function Fi(e){if(wi[e]===void 0){let t=Jr?UA(e):vA(e);wi[e]=t}return wi[e]}function vA(e){let t=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||t,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(e)}function UA(e){switch(e){case"image/avif":case"image/webp":return GA(e);default:return!0}}function GA(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}var vu={type:"wms",testURL:e=>e.toLowerCase().includes("wms"),create:e=>new Li(e)},Li=class extends Mt{url;data;substituteCRS84;flipCRS;wmsParameters;vendorParameters;capabilities=null;constructor(t){super(t),this.url=t.url,this.data=t.url,this.substituteCRS84=t.substituteCRS84??!1,this.flipCRS=["EPSG:4326"],this.wmsParameters={layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0,...t.wmsParameters},this.vendorParameters=t.vendorParameters||{}}async getMetadata(){let t=await this.getCapabilities();return this.normalizeMetadata(t)}async getImage(t){let{boundingBox:r,bbox:n,...s}=t,o={bbox:r?[...r[0],...r[1]]:n,...s};return await this.getMap(o)}normalizeMetadata(t){return t}async getCapabilities(t,r){let n=this.getCapabilitiesURL(t,r),s=await this.fetch(n),o=await s.arrayBuffer();this._checkResponse(s,o);let i=await fr.parse(o,this.loadOptions);return this.capabilities=i,i}async getMap(t,r){let n=this.getMapURL(t,r),s=await this.fetch(n),o=await s.arrayBuffer();this._checkResponse(s,o);try{return await Ae.parse(o,this.loadOptions)}catch{throw this._parseError(o)}}async getFeatureInfo(t,r){let n=this.getFeatureInfoURL(t,r),s=await this.fetch(n),o=await s.arrayBuffer();return this._checkResponse(s,o),await Cu.parse(o,this.loadOptions)}async getFeatureInfoText(t,r){let n=this.getFeatureInfoURL(t,r),s=await this.fetch(n),o=await s.arrayBuffer();return this._checkResponse(s,o),new TextDecoder().decode(o)}async describeLayer(t,r){let n=this.describeLayerURL(t,r),s=await this.fetch(n),o=await s.arrayBuffer();return this._checkResponse(s,o),await Su.parse(o,this.loadOptions)}async getLegendGraphic(t,r){let n=this.getLegendGraphicURL(t,r),s=await this.fetch(n),o=await s.arrayBuffer();this._checkResponse(s,o);try{return await Ae.parse(o,this.loadOptions)}catch{throw this._parseError(o)}}getCapabilitiesURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetCapabilities",n,r)}getMapURL(t,r){t=this._getWMS130Parameters(t);let n={version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetMap",n,r)}getFeatureInfoURL(t,r){t=this._getWMS130Parameters(t);let{boundingBox:n,bbox:s}=t;t.bbox=n?[...n[0],...n[1]]:s;let o={version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetFeatureInfo",o,r)}describeLayerURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("DescribeLayer",n,r)}getLegendGraphicURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetLegendGraphic",n,r)}_parseWMSUrl(t){let[r,n]=t.split("?"),s=n.split("&"),o={};for(let i of s){let[a,c]=i.split("=");o[a]=c}return{url:r,parameters:o}}_getWMSUrl(t,r,n){let s=this.url,o=!0,i={service:"WMS",version:r.version,request:t,...r,...this.vendorParameters,...n},a=["transparent","time","elevation"];for(let[c,l]of Object.entries(i))(!a.includes(c)||l)&&(s+=o?"?":"&",o=!1,s+=this._getURLParameter(c,l,r));return encodeURI(s)}_getWMS130Parameters(t){let r={...t};return r.srs&&(r.crs=r.crs||r.srs,delete r.srs),r}_getURLParameter(t,r,n){switch(t){case"crs":n.version!=="1.3.0"?t="srs":this.substituteCRS84&&r==="EPSG:4326"&&(r="CRS:84");break;case"srs":n.version==="1.3.0"&&(t="crs");break;case"bbox":let s=this._flipBoundingBox(r,n);s&&(r=s);break;case"x":n.version==="1.3.0"&&(t="i");break;case"y":n.version==="1.3.0"&&(t="j");break;default:}return t=t.toUpperCase(),Array.isArray(r)?`${t}=${r.join(",")}`:`${t}=${r?String(r):""}`}_flipBoundingBox(t,r){if(!Array.isArray(t)||t.length!==4)return null;let n=r.version==="1.3.0"&&this.flipCRS.includes(r.crs||"")&&!(this.substituteCRS84&&r.crs==="EPSG:4326"),s=t;return n?[s[1],s[0],s[3],s[2]]:s}async _fetchArrayBuffer(t){let r=await this.fetch(t),n=await r.arrayBuffer();return this._checkResponse(r,n),n}_checkResponse(t,r){let n=t.headers["content-type"];if(!t.ok||Kr.mimeTypes.includes(n)){let s=pi(this.loadOptions,{wms:{throwOnError:!0}}),o=Kr.parseSync?.(r,s);throw new Error(o)}}_parseError(t){let r=Kr.parseSync?.(t,this.loadOptions);return new Error(r)}};var hr=class extends Mt{constructor(t){super(t)}async getMetadata(){throw new Error("ImageSource.getMetadata not implemented")}async getImage(t){let r=this.getGranularParameters(t),n=this.getURLFromTemplate(r),o=await(await this.fetch(n)).arrayBuffer();return await Ae.parse(o)}getGranularParameters(t){let[[r,n],[s,o]]=t.boundingBox;return{...t,east:r,north:n,south:o,west:s}}getURLFromTemplate(t){let r=this.props.url;for(let[n,s]of Object.entries(t))r=r.replace(`\${${n}}`,String(s)),r=r.replace(`{${n}}`,String(s));return r}};ar(hr,"type","template"),ar(hr,"testURL",t=>t.toLowerCase().includes("{"));var Ri=class extends hr{data;constructor(t){super(t),this.data=t.url}async getMetadata(){return await this.metadata()}async getImage(t){throw new Error("not implemented")}async metadata(){throw new Error("not implemented")}exportImage(t){throw new Error("not implemented")}metadataURL(t){return`${this.props.url}?f=pjson`}exportImageURL(t){let r=`bbox=${t.bbox[0]},${t.bbox[1]},${t.bbox[2]},${t.bbox[3]}`,n=`size=${t.width},${t.height}`,s={...t,bbox:r,size:n};return delete s.width,delete s.height,this.getUrl("exportImage",s)}getUrl(t,r,n){let s=`${this.props.url}/${t}`,o=!0;for(let[i,a]of Object.entries(r))s+=o?"?":"&",o=!1,Array.isArray(a)?s+=`${i.toUpperCase()}=${a.join(",")}`:s+=`${i.toUpperCase()}=${a?String(a):""}`;return s}async checkResponse(t){if(!t.ok)throw new Error("error")}},Uu={type:"arcgis-image-server",testURL:e=>e.toLowerCase().includes("ImageServer"),create:e=>new Ri(e)};var VA=[vu,Uu];function Pi(e){return bu(e,VA)}var HA=1/Math.PI*180,zA=1/180*Math.PI,kA={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...kA}};var Y=globalThis.mathgl.config;function Oi(e,{precision:t=Y.precision}={}){return e=JA(e),`${parseFloat(e.toPrecision(t))}`}function Bt(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ni(e){return Gu(e)}function Di(e){return Ct(e)}function Gu(e,t){return vi(e,r=>r*zA,t)}function Ct(e,t){return vi(e,r=>r*HA,t)}function is(e,t,r){return vi(e,n=>Math.max(t,Math.min(r,n)))}function xe(e,t,r){return Bt(e)?e.map((n,s)=>xe(n,t[s],r)):r*t+(1-r)*e}function mt(e,t,r){let n=Y.EPSILON;r&&(Y.EPSILON=r);try{if(e===t)return!0;if(Bt(e)&&Bt(t)){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!mt(e[s],t[s]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=Y.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{Y.EPSILON=n}}function JA(e){return Math.round(e/Y.EPSILON)*Y.EPSILON}function qA(e){return e.clone?e.clone():new Array(e.length)}function vi(e,t,r){if(Bt(e)){let n=e;r=r||qA(n);for(let s=0;s<r.length&&s<n.length;++s){let o=typeof e=="number"?e:e[s];r[s]=t(o,s,r)}return r}return t(e)}var ye=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:Bt(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Y)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Oi(this[n],t);return`${t.printTypes?this.constructor.name:""}[${r}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!mt(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let s=0;s<this.ELEMENTS;++s){let o=t[s],i=typeof r=="number"?r:r[s];this[s]=o+n*(i-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(Y.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function jA(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function U(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function Te(e,t,r=""){if(Y.debug&&!jA(e,t))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return e}function at(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}var _e=class extends ye{get x(){return this[0]}set x(t){this[0]=U(t)}get y(){return this[1]}set y(t){this[1]=U(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-t[n];r+=s*s}return U(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return U(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return at(t>=0&&t<this.ELEMENTS,"index is out of range"),U(this[t])}setComponent(t,r){return at(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var Z=typeof Float32Array<"u"?Float32Array:Array,rn=Math.random;function dr(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var V2=Math.PI/180;function XA(){let e=new Z(2);return Z!=Float32Array&&(e[0]=0,e[1]=0),e}function Vu(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e}function Hu(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s+r[4],e[1]=r[1]*n+r[3]*s+r[5],e}function as(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[3]*s+r[6],e[1]=r[1]*n+r[4]*s+r[7],e}function cs(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[4]*s+r[12],e[1]=r[1]*n+r[5]*s+r[13],e}var H2=function(){let e=XA();return function(t,r,n,s,o,i){let a,c;for(r||(r=2),n||(n=0),s?c=Math.min(s*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function ls(e,t,r){let n=t[0],s=t[1],o=r[3]*n+r[7]*s||1;return e[0]=(r[0]*n+r[4]*s)/o,e[1]=(r[1]*n+r[5]*s)/o,e}function us(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o||1;return e[0]=(r[0]*n+r[4]*s+r[8]*o)/i,e[1]=(r[1]*n+r[5]*s+r[9]*o)/i,e[2]=(r[2]*n+r[6]*s+r[10]*o)/i,e}function zu(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e}function ku(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e[3]=t[3],e}function fs(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=r[0]*n+r[3]*s+r[6]*o,e[1]=r[1]*n+r[4]*s+r[7]*o,e[2]=r[2]*n+r[5]*s+r[8]*o,e[3]=t[3],e}var Ue=class extends _e{constructor(t=0,r=0){super(2),Bt(t)&&arguments.length===1?this.copy(t):(Y.debug&&(U(t),U(r)),this[0]=t,this[1]=r)}set(t,r){return this[0]=t,this[1]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return Y.debug&&(U(t.x),U(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return cs(this,this,t),this.check()}transformAsVector(t){return ls(this,this,t),this.check()}transformByMatrix3(t){return as(this,this,t),this.check()}transformByMatrix2x3(t){return Hu(this,this,t),this.check()}transformByMatrix2(t){return Vu(this,this,t),this.check()}};var He={};ut(He,{add:()=>QA,angle:()=>zi,bezier:()=>u1,ceil:()=>ZA,clone:()=>WA,copy:()=>YA,create:()=>hs,cross:()=>Ge,dist:()=>y1,distance:()=>Wu,div:()=>x1,divide:()=>Xu,dot:()=>nn,equals:()=>m1,exactEquals:()=>p1,floor:()=>$A,forEach:()=>E1,fromValues:()=>ds,hermite:()=>l1,inverse:()=>i1,len:()=>ki,length:()=>Ju,lerp:()=>a1,max:()=>e1,min:()=>t1,mul:()=>A1,multiply:()=>ju,negate:()=>o1,normalize:()=>Ui,random:()=>f1,rotateX:()=>Gi,rotateY:()=>Vi,rotateZ:()=>Hi,round:()=>r1,scale:()=>n1,scaleAndAdd:()=>s1,set:()=>KA,slerp:()=>c1,sqrDist:()=>T1,sqrLen:()=>_1,squaredDistance:()=>Yu,squaredLength:()=>Ku,str:()=>d1,sub:()=>g1,subtract:()=>qu,transformMat3:()=>sn,transformMat4:()=>Ve,transformQuat:()=>on,zero:()=>h1});function hs(){let e=new Z(3);return Z!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function WA(e){let t=new Z(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ju(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function ds(e,t,r){let n=new Z(3);return n[0]=e,n[1]=t,n[2]=r,n}function YA(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function KA(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function QA(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function qu(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function ju(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function Xu(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function ZA(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function $A(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function t1(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function e1(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function r1(e,t){return e[0]=dr(t[0]),e[1]=dr(t[1]),e[2]=dr(t[2]),e}function n1(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function s1(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function Wu(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return Math.sqrt(r*r+n*n+s*s)}function Yu(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return r*r+n*n+s*s}function Ku(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function o1(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function i1(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function Ui(e,t){let r=t[0],n=t[1],s=t[2],o=r*r+n*n+s*s;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function nn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ge(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],c=r[2];return e[0]=s*c-o*a,e[1]=o*i-n*c,e[2]=n*a-s*i,e}function a1(e,t,r,n){let s=t[0],o=t[1],i=t[2];return e[0]=s+n*(r[0]-s),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e}function c1(e,t,r,n){let s=Math.acos(Math.min(Math.max(nn(t,r),-1),1)),o=Math.sin(s),i=Math.sin((1-n)*s)/o,a=Math.sin(n*s)/o;return e[0]=i*t[0]+a*r[0],e[1]=i*t[1]+a*r[1],e[2]=i*t[2]+a*r[2],e}function l1(e,t,r,n,s,o){let i=o*o,a=i*(2*o-3)+1,c=i*(o-2)+o,l=i*(o-1),u=i*(3-2*o);return e[0]=t[0]*a+r[0]*c+n[0]*l+s[0]*u,e[1]=t[1]*a+r[1]*c+n[1]*l+s[1]*u,e[2]=t[2]*a+r[2]*c+n[2]*l+s[2]*u,e}function u1(e,t,r,n,s,o){let i=1-o,a=i*i,c=o*o,l=a*i,u=3*o*a,f=3*c*i,h=c*o;return e[0]=t[0]*l+r[0]*u+n[0]*f+s[0]*h,e[1]=t[1]*l+r[1]*u+n[1]*f+s[1]*h,e[2]=t[2]*l+r[2]*u+n[2]*f+s[2]*h,e}function f1(e,t){t=t===void 0?1:t;let r=rn()*2*Math.PI,n=rn()*2-1,s=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*s,e[1]=Math.sin(r)*s,e[2]=n*t,e}function Ve(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*s+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*s+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*s+r[10]*o+r[14])/i,e}function sn(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=n*r[0]+s*r[3]+o*r[6],e[1]=n*r[1]+s*r[4]+o*r[7],e[2]=n*r[2]+s*r[5]+o*r[8],e}function on(e,t,r){let n=r[0],s=r[1],o=r[2],i=r[3],a=t[0],c=t[1],l=t[2],u=s*l-o*c,f=o*a-n*l,h=n*c-s*a,d=s*h-o*f,p=o*u-n*h,A=n*f-s*u,g=i*2;return u*=g,f*=g,h*=g,d*=2,p*=2,A*=2,e[0]=a+u+d,e[1]=c+f+p,e[2]=l+h+A,e}function Gi(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0],o[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),o[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Vi(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),o[1]=s[1],o[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Hi(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),o[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),o[2]=s[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function zi(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2],c=Math.sqrt((r*r+n*n+s*s)*(o*o+i*i+a*a)),l=c&&nn(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}function h1(e){return e[0]=0,e[1]=0,e[2]=0,e}function d1(e){return`vec3(${e[0]}, ${e[1]}, ${e[2]})`}function p1(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function m1(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2];return Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}var g1=qu,A1=ju,x1=Xu,y1=Wu,T1=Yu,ki=Ju,_1=Ku,E1=function(){let e=hs();return function(t,r,n,s,o,i){let a,c;for(r||(r=3),n||(n=0),s?c=Math.min(s*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var Ji=[0,0,0],ps,x=class extends _e{static get ZERO(){return ps||(ps=new x(0,0,0),Object.freeze(ps)),ps}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Bt(t)?this.copy(t):(Y.debug&&(U(t),U(r),U(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return Y.debug&&(U(t.x),U(t.y),U(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=U(t)}angle(t){return zi(this,t)}cross(t){return Ge(this,this,t),this.check()}rotateX({radians:t,origin:r=Ji}){return Gi(this,this,r,t),this.check()}rotateY({radians:t,origin:r=Ji}){return Vi(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=Ji}){return Hi(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Ve(this,this,t),this.check()}transformAsVector(t){return us(this,this,t),this.check()}transformByMatrix3(t){return sn(this,this,t),this.check()}transformByMatrix2(t){return zu(this,this,t),this.check()}transformByQuaternion(t){return on(this,this,t),this.check()}};var ms,mr=class extends _e{static get ZERO(){return ms||(ms=new mr(0,0,0,0),Object.freeze(ms)),ms}constructor(t=0,r=0,n=0,s=0){super(-0,-0,-0,-0),Bt(t)&&arguments.length===1?this.copy(t):(Y.debug&&(U(t),U(r),U(n),U(s)),this[0]=t,this[1]=r,this[2]=n,this[3]=s)}set(t,r,n,s){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return Y.debug&&(U(t.x),U(t.y),U(t.z),U(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=U(t)}get w(){return this[3]}set w(t){this[3]=U(t)}transform(t){return Ve(this,this,t),this.check()}transformByMatrix3(t){return fs(this,this,t),this.check()}transformByMatrix2(t){return ku(this,this,t),this.check()}transformByQuaternion(t){return on(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var gr=class extends ye{toString(){let t="[";if(Y.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+r]}`}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=` ${this[r]}`}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=U(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)r[s]=this[n+s];return r}setColumn(t,r){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=r[s];return this}};function Qu(){let e=new Z(9);return Z!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function Zu(e,t){if(e===t){let r=t[1],n=t[2],s=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=s}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function $u(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],c=t[6],l=t[7],u=t[8],f=u*i-a*l,h=-u*o+a*c,d=l*o-i*c,p=r*f+n*h+s*d;return p?(p=1/p,e[0]=f*p,e[1]=(-u*n+s*l)*p,e[2]=(a*n-s*i)*p,e[3]=h*p,e[4]=(u*r-s*c)*p,e[5]=(-a*r+s*o)*p,e[6]=d*p,e[7]=(-l*r+n*c)*p,e[8]=(i*r-n*o)*p,e):null}function tf(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],c=e[7],l=e[8];return t*(l*o-i*c)+r*(-l*s+i*a)+n*(c*s-o*a)}function qi(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],l=t[6],u=t[7],f=t[8],h=r[0],d=r[1],p=r[2],A=r[3],g=r[4],y=r[5],E=r[6],_=r[7],B=r[8];return e[0]=h*n+d*i+p*l,e[1]=h*s+d*a+p*u,e[2]=h*o+d*c+p*f,e[3]=A*n+g*i+y*l,e[4]=A*s+g*a+y*u,e[5]=A*o+g*c+y*f,e[6]=E*n+_*i+B*l,e[7]=E*s+_*a+B*u,e[8]=E*o+_*c+B*f,e}function ef(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],l=t[6],u=t[7],f=t[8],h=r[0],d=r[1];return e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=a,e[5]=c,e[6]=h*n+d*i+l,e[7]=h*s+d*a+u,e[8]=h*o+d*c+f,e}function rf(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],l=t[6],u=t[7],f=t[8],h=Math.sin(r),d=Math.cos(r);return e[0]=d*n+h*i,e[1]=d*s+h*a,e[2]=d*o+h*c,e[3]=d*i-h*n,e[4]=d*a-h*s,e[5]=d*c-h*o,e[6]=l,e[7]=u,e[8]=f,e}function ji(e,t,r){let n=r[0],s=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=s*t[3],e[4]=s*t[4],e[5]=s*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function nf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,c=s+s,l=r*i,u=n*i,f=n*a,h=s*i,d=s*a,p=s*c,A=o*i,g=o*a,y=o*c;return e[0]=1-f-p,e[3]=u-y,e[6]=h+g,e[1]=u+y,e[4]=1-l-p,e[7]=d-A,e[2]=h-g,e[5]=d+A,e[8]=1-l-f,e}var Xi;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(Xi||(Xi={}));var C1=Object.freeze([1,0,0,0,1,0,0,0,1]),z=class extends gr{static get IDENTITY(){return b1()}static get ZERO(){return S1()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return Xi}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(C1)}fromObject(t){return this.check()}fromQuaternion(t){return nf(this,t),this.check()}set(t,r,n,s,o,i,a,c,l){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=c,this[8]=l,this.check()}setRowMajor(t,r,n,s,o,i,a,c,l){return this[0]=t,this[1]=s,this[2]=a,this[3]=r,this[4]=o,this[5]=c,this[6]=n,this[7]=i,this[8]=l,this.check()}determinant(){return tf(this)}transpose(){return Zu(this,this),this.check()}invert(){return $u(this,this),this.check()}multiplyLeft(t){return qi(this,t,this),this.check()}multiplyRight(t){return qi(this,this,t),this.check()}rotate(t){return rf(this,this,t),this.check()}scale(t){return Array.isArray(t)?ji(this,this,t):ji(this,this,[t,t]),this.check()}translate(t){return ef(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=as(r||[-0,-0],t,this);break;case 3:n=sn(r||[-0,-0,-0],t,this);break;case 4:n=fs(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Te(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},gs,As=null;function S1(){return gs||(gs=new z([0,0,0,0,0,0,0,0,0]),Object.freeze(gs)),gs}function b1(){return As||(As=new z,Object.freeze(As)),As}var cn={};ut(cn,{add:()=>Q1,adjoint:()=>R1,clone:()=>I1,copy:()=>w1,create:()=>M1,decompose:()=>z1,determinant:()=>Ki,equals:()=>ex,exactEquals:()=>tx,frob:()=>K1,fromQuat:()=>na,fromQuat2:()=>G1,fromRotation:()=>N1,fromRotationTranslation:()=>of,fromRotationTranslationScale:()=>k1,fromRotationTranslationScaleOrigin:()=>J1,fromScaling:()=>O1,fromTranslation:()=>P1,fromValues:()=>F1,fromXRotation:()=>D1,fromYRotation:()=>v1,fromZRotation:()=>U1,frustum:()=>sa,getRotation:()=>H1,getScaling:()=>af,getTranslation:()=>V1,identity:()=>sf,invert:()=>Yi,lookAt:()=>aa,mul:()=>rx,multiply:()=>an,multiplyScalar:()=>Z1,multiplyScalarAndAdd:()=>$1,ortho:()=>ia,orthoNO:()=>lf,orthoZO:()=>X1,perspective:()=>oa,perspectiveFromFieldOfView:()=>j1,perspectiveNO:()=>cf,perspectiveZO:()=>q1,rotate:()=>$i,rotateX:()=>ta,rotateY:()=>ea,rotateZ:()=>ra,scale:()=>Zi,set:()=>L1,str:()=>Y1,sub:()=>nx,subtract:()=>uf,targetTo:()=>W1,translate:()=>Qi,transpose:()=>Wi});function M1(){let e=new Z(16);return Z!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function I1(e){let t=new Z(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function w1(e,t){return 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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function F1(e,t,r,n,s,o,i,a,c,l,u,f,h,d,p,A){let g=new Z(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=n,g[4]=s,g[5]=o,g[6]=i,g[7]=a,g[8]=c,g[9]=l,g[10]=u,g[11]=f,g[12]=h,g[13]=d,g[14]=p,g[15]=A,g}function L1(e,t,r,n,s,o,i,a,c,l,u,f,h,d,p,A,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=s,e[4]=o,e[5]=i,e[6]=a,e[7]=c,e[8]=l,e[9]=u,e[10]=f,e[11]=h,e[12]=d,e[13]=p,e[14]=A,e[15]=g,e}function sf(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Wi(e,t){if(e===t){let r=t[1],n=t[2],s=t[3],o=t[6],i=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=s,e[13]=i,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function Yi(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],A=t[13],g=t[14],y=t[15],E=r*a-n*i,_=r*c-s*i,B=r*l-o*i,S=n*c-s*a,b=n*l-o*a,w=s*l-o*c,C=u*A-f*p,T=u*g-h*p,m=u*y-d*p,M=f*g-h*A,L=f*y-d*A,R=h*y-d*g,F=E*R-_*L+B*M+S*m-b*T+w*C;return F?(F=1/F,e[0]=(a*R-c*L+l*M)*F,e[1]=(s*L-n*R-o*M)*F,e[2]=(A*w-g*b+y*S)*F,e[3]=(h*b-f*w-d*S)*F,e[4]=(c*m-i*R-l*T)*F,e[5]=(r*R-s*m+o*T)*F,e[6]=(g*B-p*w-y*_)*F,e[7]=(u*w-h*B+d*_)*F,e[8]=(i*L-a*m+l*C)*F,e[9]=(n*m-r*L-o*C)*F,e[10]=(p*b-A*B+y*E)*F,e[11]=(f*B-u*b-d*E)*F,e[12]=(a*T-i*M-c*C)*F,e[13]=(r*M-n*T+s*C)*F,e[14]=(A*_-p*S-g*E)*F,e[15]=(u*S-f*_+h*E)*F,e):null}function R1(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],A=t[13],g=t[14],y=t[15],E=r*a-n*i,_=r*c-s*i,B=r*l-o*i,S=n*c-s*a,b=n*l-o*a,w=s*l-o*c,C=u*A-f*p,T=u*g-h*p,m=u*y-d*p,M=f*g-h*A,L=f*y-d*A,R=h*y-d*g;return e[0]=a*R-c*L+l*M,e[1]=s*L-n*R-o*M,e[2]=A*w-g*b+y*S,e[3]=h*b-f*w-d*S,e[4]=c*m-i*R-l*T,e[5]=r*R-s*m+o*T,e[6]=g*B-p*w-y*_,e[7]=u*w-h*B+d*_,e[8]=i*L-a*m+l*C,e[9]=n*m-r*L-o*C,e[10]=p*b-A*B+y*E,e[11]=f*B-u*b-d*E,e[12]=a*T-i*M-c*C,e[13]=r*M-n*T+s*C,e[14]=A*_-p*S-g*E,e[15]=u*S-f*_+h*E,e}function Ki(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=e[11],d=e[12],p=e[13],A=e[14],g=e[15],y=t*i-r*o,E=t*a-n*o,_=r*a-n*i,B=l*p-u*d,S=l*A-f*d,b=u*A-f*p,w=t*b-r*S+n*B,C=o*b-i*S+a*B,T=l*_-u*E+f*y,m=d*_-p*E+A*y;return c*w-s*C+g*T-h*m}function an(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],c=t[5],l=t[6],u=t[7],f=t[8],h=t[9],d=t[10],p=t[11],A=t[12],g=t[13],y=t[14],E=t[15],_=r[0],B=r[1],S=r[2],b=r[3];return e[0]=_*n+B*a+S*f+b*A,e[1]=_*s+B*c+S*h+b*g,e[2]=_*o+B*l+S*d+b*y,e[3]=_*i+B*u+S*p+b*E,_=r[4],B=r[5],S=r[6],b=r[7],e[4]=_*n+B*a+S*f+b*A,e[5]=_*s+B*c+S*h+b*g,e[6]=_*o+B*l+S*d+b*y,e[7]=_*i+B*u+S*p+b*E,_=r[8],B=r[9],S=r[10],b=r[11],e[8]=_*n+B*a+S*f+b*A,e[9]=_*s+B*c+S*h+b*g,e[10]=_*o+B*l+S*d+b*y,e[11]=_*i+B*u+S*p+b*E,_=r[12],B=r[13],S=r[14],b=r[15],e[12]=_*n+B*a+S*f+b*A,e[13]=_*s+B*c+S*h+b*g,e[14]=_*o+B*l+S*d+b*y,e[15]=_*i+B*u+S*p+b*E,e}function Qi(e,t,r){let n=r[0],s=r[1],o=r[2],i,a,c,l,u,f,h,d,p,A,g,y;return t===e?(e[12]=t[0]*n+t[4]*s+t[8]*o+t[12],e[13]=t[1]*n+t[5]*s+t[9]*o+t[13],e[14]=t[2]*n+t[6]*s+t[10]*o+t[14],e[15]=t[3]*n+t[7]*s+t[11]*o+t[15]):(i=t[0],a=t[1],c=t[2],l=t[3],u=t[4],f=t[5],h=t[6],d=t[7],p=t[8],A=t[9],g=t[10],y=t[11],e[0]=i,e[1]=a,e[2]=c,e[3]=l,e[4]=u,e[5]=f,e[6]=h,e[7]=d,e[8]=p,e[9]=A,e[10]=g,e[11]=y,e[12]=i*n+u*s+p*o+t[12],e[13]=a*n+f*s+A*o+t[13],e[14]=c*n+h*s+g*o+t[14],e[15]=l*n+d*s+y*o+t[15]),e}function Zi(e,t,r){let n=r[0],s=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function $i(e,t,r,n){let s=n[0],o=n[1],i=n[2],a=Math.sqrt(s*s+o*o+i*i),c,l,u,f,h,d,p,A,g,y,E,_,B,S,b,w,C,T,m,M,L,R,F,D;return a<1e-6?null:(a=1/a,s*=a,o*=a,i*=a,l=Math.sin(r),c=Math.cos(r),u=1-c,f=t[0],h=t[1],d=t[2],p=t[3],A=t[4],g=t[5],y=t[6],E=t[7],_=t[8],B=t[9],S=t[10],b=t[11],w=s*s*u+c,C=o*s*u+i*l,T=i*s*u-o*l,m=s*o*u-i*l,M=o*o*u+c,L=i*o*u+s*l,R=s*i*u+o*l,F=o*i*u-s*l,D=i*i*u+c,e[0]=f*w+A*C+_*T,e[1]=h*w+g*C+B*T,e[2]=d*w+y*C+S*T,e[3]=p*w+E*C+b*T,e[4]=f*m+A*M+_*L,e[5]=h*m+g*M+B*L,e[6]=d*m+y*M+S*L,e[7]=p*m+E*M+b*L,e[8]=f*R+A*F+_*D,e[9]=h*R+g*F+B*D,e[10]=d*R+y*F+S*D,e[11]=p*R+E*F+b*D,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function ta(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[4],i=t[5],a=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*s+l*n,e[5]=i*s+u*n,e[6]=a*s+f*n,e[7]=c*s+h*n,e[8]=l*s-o*n,e[9]=u*s-i*n,e[10]=f*s-a*n,e[11]=h*s-c*n,e}function ea(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[0],i=t[1],a=t[2],c=t[3],l=t[8],u=t[9],f=t[10],h=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*s-l*n,e[1]=i*s-u*n,e[2]=a*s-f*n,e[3]=c*s-h*n,e[8]=o*n+l*s,e[9]=i*n+u*s,e[10]=a*n+f*s,e[11]=c*n+h*s,e}function ra(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[0],i=t[1],a=t[2],c=t[3],l=t[4],u=t[5],f=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*s+l*n,e[1]=i*s+u*n,e[2]=a*s+f*n,e[3]=c*s+h*n,e[4]=l*s-o*n,e[5]=u*s-i*n,e[6]=f*s-a*n,e[7]=h*s-c*n,e}function P1(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function O1(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function N1(e,t,r){let n=r[0],s=r[1],o=r[2],i=Math.sqrt(n*n+s*s+o*o),a,c,l;return i<1e-6?null:(i=1/i,n*=i,s*=i,o*=i,c=Math.sin(t),a=Math.cos(t),l=1-a,e[0]=n*n*l+a,e[1]=s*n*l+o*c,e[2]=o*n*l-s*c,e[3]=0,e[4]=n*s*l-o*c,e[5]=s*s*l+a,e[6]=o*s*l+n*c,e[7]=0,e[8]=n*o*l+s*c,e[9]=s*o*l-n*c,e[10]=o*o*l+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function D1(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function v1(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function U1(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function of(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=n+n,c=s+s,l=o+o,u=n*a,f=n*c,h=n*l,d=s*c,p=s*l,A=o*l,g=i*a,y=i*c,E=i*l;return e[0]=1-(d+A),e[1]=f+E,e[2]=h-y,e[3]=0,e[4]=f-E,e[5]=1-(u+A),e[6]=p+g,e[7]=0,e[8]=h+y,e[9]=p-g,e[10]=1-(u+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function G1(e,t){let r=new Z(3),n=-t[0],s=-t[1],o=-t[2],i=t[3],a=t[4],c=t[5],l=t[6],u=t[7],f=n*n+s*s+o*o+i*i;return f>0?(r[0]=(a*i+u*n+c*o-l*s)*2/f,r[1]=(c*i+u*s+l*n-a*o)*2/f,r[2]=(l*i+u*o+a*s-c*n)*2/f):(r[0]=(a*i+u*n+c*o-l*s)*2,r[1]=(c*i+u*s+l*n-a*o)*2,r[2]=(l*i+u*o+a*s-c*n)*2),of(e,t,r),e}function V1(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function af(e,t){let r=t[0],n=t[1],s=t[2],o=t[4],i=t[5],a=t[6],c=t[8],l=t[9],u=t[10];return e[0]=Math.sqrt(r*r+n*n+s*s),e[1]=Math.sqrt(o*o+i*i+a*a),e[2]=Math.sqrt(c*c+l*l+u*u),e}function H1(e,t){let r=new Z(3);af(r,t);let n=1/r[0],s=1/r[1],o=1/r[2],i=t[0]*n,a=t[1]*s,c=t[2]*o,l=t[4]*n,u=t[5]*s,f=t[6]*o,h=t[8]*n,d=t[9]*s,p=t[10]*o,A=i+u+p,g=0;return A>0?(g=Math.sqrt(A+1)*2,e[3]=.25*g,e[0]=(f-d)/g,e[1]=(h-c)/g,e[2]=(a-l)/g):i>u&&i>p?(g=Math.sqrt(1+i-u-p)*2,e[3]=(f-d)/g,e[0]=.25*g,e[1]=(a+l)/g,e[2]=(h+c)/g):u>p?(g=Math.sqrt(1+u-i-p)*2,e[3]=(h-c)/g,e[0]=(a+l)/g,e[1]=.25*g,e[2]=(f+d)/g):(g=Math.sqrt(1+p-i-u)*2,e[3]=(a-l)/g,e[0]=(h+c)/g,e[1]=(f+d)/g,e[2]=.25*g),e}function z1(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let s=n[0],o=n[1],i=n[2],a=n[4],c=n[5],l=n[6],u=n[8],f=n[9],h=n[10];r[0]=Math.sqrt(s*s+o*o+i*i),r[1]=Math.sqrt(a*a+c*c+l*l),r[2]=Math.sqrt(u*u+f*f+h*h);let d=1/r[0],p=1/r[1],A=1/r[2],g=s*d,y=o*p,E=i*A,_=a*d,B=c*p,S=l*A,b=u*d,w=f*p,C=h*A,T=g+B+C,m=0;return T>0?(m=Math.sqrt(T+1)*2,e[3]=.25*m,e[0]=(S-w)/m,e[1]=(b-E)/m,e[2]=(y-_)/m):g>B&&g>C?(m=Math.sqrt(1+g-B-C)*2,e[3]=(S-w)/m,e[0]=.25*m,e[1]=(y+_)/m,e[2]=(b+E)/m):B>C?(m=Math.sqrt(1+B-g-C)*2,e[3]=(b-E)/m,e[0]=(y+_)/m,e[1]=.25*m,e[2]=(S+w)/m):(m=Math.sqrt(1+C-g-B)*2,e[3]=(y-_)/m,e[0]=(b+E)/m,e[1]=(S+w)/m,e[2]=.25*m),e}function k1(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3],c=s+s,l=o+o,u=i+i,f=s*c,h=s*l,d=s*u,p=o*l,A=o*u,g=i*u,y=a*c,E=a*l,_=a*u,B=n[0],S=n[1],b=n[2];return e[0]=(1-(p+g))*B,e[1]=(h+_)*B,e[2]=(d-E)*B,e[3]=0,e[4]=(h-_)*S,e[5]=(1-(f+g))*S,e[6]=(A+y)*S,e[7]=0,e[8]=(d+E)*b,e[9]=(A-y)*b,e[10]=(1-(f+p))*b,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function J1(e,t,r,n,s){let o=t[0],i=t[1],a=t[2],c=t[3],l=o+o,u=i+i,f=a+a,h=o*l,d=o*u,p=o*f,A=i*u,g=i*f,y=a*f,E=c*l,_=c*u,B=c*f,S=n[0],b=n[1],w=n[2],C=s[0],T=s[1],m=s[2],M=(1-(A+y))*S,L=(d+B)*S,R=(p-_)*S,F=(d-B)*b,D=(1-(h+y))*b,X=(g+E)*b,H=(p+_)*w,Q=(g-E)*w,j=(1-(h+A))*w;return e[0]=M,e[1]=L,e[2]=R,e[3]=0,e[4]=F,e[5]=D,e[6]=X,e[7]=0,e[8]=H,e[9]=Q,e[10]=j,e[11]=0,e[12]=r[0]+C-(M*C+F*T+H*m),e[13]=r[1]+T-(L*C+D*T+Q*m),e[14]=r[2]+m-(R*C+X*T+j*m),e[15]=1,e}function na(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,c=s+s,l=r*i,u=n*i,f=n*a,h=s*i,d=s*a,p=s*c,A=o*i,g=o*a,y=o*c;return e[0]=1-f-p,e[1]=u+y,e[2]=h-g,e[3]=0,e[4]=u-y,e[5]=1-l-p,e[6]=d+A,e[7]=0,e[8]=h+g,e[9]=d-A,e[10]=1-l-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function sa(e,t,r,n,s,o,i){let a=1/(r-t),c=1/(s-n),l=1/(o-i);return e[0]=o*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*c,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(s+n)*c,e[10]=(i+o)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*o*2*l,e[15]=0,e}function cf(e,t,r,n,s){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0){let i=1/(n-s);e[10]=(s+n)*i,e[14]=2*s*n*i}else e[10]=-1,e[14]=-2*n;return e}var oa=cf;function q1(e,t,r,n,s){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0){let i=1/(n-s);e[10]=s*i,e[14]=s*n*i}else e[10]=-1,e[14]=-n;return e}function j1(e,t,r,n){let s=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),c=2/(i+a),l=2/(s+o);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=l,e[6]=0,e[7]=0,e[8]=-((i-a)*c*.5),e[9]=(s-o)*l*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function lf(e,t,r,n,s,o,i){let a=1/(t-r),c=1/(n-s),l=1/(o-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+r)*a,e[13]=(s+n)*c,e[14]=(i+o)*l,e[15]=1,e}var ia=lf;function X1(e,t,r,n,s,o,i){let a=1/(t-r),c=1/(n-s),l=1/(o-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=l,e[11]=0,e[12]=(t+r)*a,e[13]=(s+n)*c,e[14]=o*l,e[15]=1,e}function aa(e,t,r,n){let s,o,i,a,c,l,u,f,h,d,p=t[0],A=t[1],g=t[2],y=n[0],E=n[1],_=n[2],B=r[0],S=r[1],b=r[2];return Math.abs(p-B)<1e-6&&Math.abs(A-S)<1e-6&&Math.abs(g-b)<1e-6?sf(e):(f=p-B,h=A-S,d=g-b,s=1/Math.sqrt(f*f+h*h+d*d),f*=s,h*=s,d*=s,o=E*d-_*h,i=_*f-y*d,a=y*h-E*f,s=Math.sqrt(o*o+i*i+a*a),s?(s=1/s,o*=s,i*=s,a*=s):(o=0,i=0,a=0),c=h*a-d*i,l=d*o-f*a,u=f*i-h*o,s=Math.sqrt(c*c+l*l+u*u),s?(s=1/s,c*=s,l*=s,u*=s):(c=0,l=0,u=0),e[0]=o,e[1]=c,e[2]=f,e[3]=0,e[4]=i,e[5]=l,e[6]=h,e[7]=0,e[8]=a,e[9]=u,e[10]=d,e[11]=0,e[12]=-(o*p+i*A+a*g),e[13]=-(c*p+l*A+u*g),e[14]=-(f*p+h*A+d*g),e[15]=1,e)}function W1(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=n[0],c=n[1],l=n[2],u=s-r[0],f=o-r[1],h=i-r[2],d=u*u+f*f+h*h;d>0&&(d=1/Math.sqrt(d),u*=d,f*=d,h*=d);let p=c*h-l*f,A=l*u-a*h,g=a*f-c*u;return d=p*p+A*A+g*g,d>0&&(d=1/Math.sqrt(d),p*=d,A*=d,g*=d),e[0]=p,e[1]=A,e[2]=g,e[3]=0,e[4]=f*g-h*A,e[5]=h*p-u*g,e[6]=u*A-f*p,e[7]=0,e[8]=u,e[9]=f,e[10]=h,e[11]=0,e[12]=s,e[13]=o,e[14]=i,e[15]=1,e}function Y1(e){return`mat4(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]}, ${e[4]}, ${e[5]}, ${e[6]}, ${e[7]}, ${e[8]}, ${e[9]}, ${e[10]}, ${e[11]}, ${e[12]}, ${e[13]}, ${e[14]}, ${e[15]})`}function K1(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function Q1(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function uf(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function Z1(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function $1(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function tx(e,t){return 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]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function ex(e,t){let r=e[0],n=e[1],s=e[2],o=e[3],i=e[4],a=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],A=e[13],g=e[14],y=e[15],E=t[0],_=t[1],B=t[2],S=t[3],b=t[4],w=t[5],C=t[6],T=t[7],m=t[8],M=t[9],L=t[10],R=t[11],F=t[12],D=t[13],X=t[14],H=t[15];return Math.abs(r-E)<=1e-6*Math.max(1,Math.abs(r),Math.abs(E))&&Math.abs(n-_)<=1e-6*Math.max(1,Math.abs(n),Math.abs(_))&&Math.abs(s-B)<=1e-6*Math.max(1,Math.abs(s),Math.abs(B))&&Math.abs(o-S)<=1e-6*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(c-C)<=1e-6*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(l-T)<=1e-6*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(u-m)<=1e-6*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(f-M)<=1e-6*Math.max(1,Math.abs(f),Math.abs(M))&&Math.abs(h-L)<=1e-6*Math.max(1,Math.abs(h),Math.abs(L))&&Math.abs(d-R)<=1e-6*Math.max(1,Math.abs(d),Math.abs(R))&&Math.abs(p-F)<=1e-6*Math.max(1,Math.abs(p),Math.abs(F))&&Math.abs(A-D)<=1e-6*Math.max(1,Math.abs(A),Math.abs(D))&&Math.abs(g-X)<=1e-6*Math.max(1,Math.abs(g),Math.abs(X))&&Math.abs(y-H)<=1e-6*Math.max(1,Math.abs(y),Math.abs(H))}var rx=an,nx=uf;function sx(){let e=new Z(4);return Z!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function ff(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function hf(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function df(e){let t=e[0],r=e[1],n=e[2],s=e[3];return Math.sqrt(t*t+r*r+n*n+s*s)}function pf(e){let t=e[0],r=e[1],n=e[2],s=e[3];return t*t+r*r+n*n+s*s}function mf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r*r+n*n+s*s+o*o;return i>0&&(i=1/Math.sqrt(i)),e[0]=r*i,e[1]=n*i,e[2]=s*i,e[3]=o*i,e}function gf(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Af(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3];return e[0]=s+n*(r[0]-s),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e[3]=a+n*(r[3]-a),e}function xf(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3];return e[0]=r[0]*n+r[4]*s+r[8]*o+r[12]*i,e[1]=r[1]*n+r[5]*s+r[9]*o+r[13]*i,e[2]=r[2]*n+r[6]*s+r[10]*o+r[14]*i,e[3]=r[3]*n+r[7]*s+r[11]*o+r[15]*i,e}function yf(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],c=r[2],l=r[3],u=l*n+a*o-c*s,f=l*s+c*n-i*o,h=l*o+i*s-a*n,d=-i*n-a*s-c*o;return e[0]=u*l+d*-i+f*-c-h*-a,e[1]=f*l+d*-a+h*-i-u*-c,e[2]=h*l+d*-c+u*-a-f*-i,e[3]=t[3],e}var yw=function(){let e=sx();return function(t,r,n,s,o,i){let a,c;for(r||(r=4),n||(n=0),s?c=Math.min(s*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}();var ua;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(ua||(ua={}));var ix=45*Math.PI/180,ax=1,ca=.1,la=500,cx=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),P=class extends gr{static get IDENTITY(){return ux()}static get ZERO(){return lx()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return ua}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,s,o,i,a,c,l,u,f,h,d,p,A,g){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=c,this[8]=l,this[9]=u,this[10]=f,this[11]=h,this[12]=d,this[13]=p,this[14]=A,this[15]=g,this.check()}setRowMajor(t,r,n,s,o,i,a,c,l,u,f,h,d,p,A,g){return this[0]=t,this[1]=o,this[2]=l,this[3]=d,this[4]=r,this[5]=i,this[6]=u,this[7]=p,this[8]=n,this[9]=a,this[10]=f,this[11]=A,this[12]=s,this[13]=c,this[14]=h,this[15]=g,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(cx)}fromObject(t){return this.check()}fromQuaternion(t){return na(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:s,top:o,near:i=ca,far:a=la}=t;return a===1/0?fx(this,r,n,s,o,i):sa(this,r,n,s,o,i,a),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:s=[0,1,0]}=t;return aa(this,r,n,s),this.check()}ortho(t){let{left:r,right:n,bottom:s,top:o,near:i=ca,far:a=la}=t;return ia(this,r,n,s,o,i,a),this.check()}orthographic(t){let{fovy:r=ix,aspect:n=ax,focalDistance:s=1,near:o=ca,far:i=la}=t;Tf(r);let a=r/2,c=s*Math.tan(a),l=c*n;return this.ortho({left:-l,right:l,bottom:-c,top:c,near:o,far:i})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:s=.1,far:o=500}=t;return Tf(r),oa(this,r,n,s,o),this.check()}determinant(){return Ki(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),s=1/n[0],o=1/n[1],i=1/n[2];return t[0]=this[0]*s,t[1]=this[1]*o,t[2]=this[2]*i,t[3]=0,t[4]=this[4]*s,t[5]=this[5]*o,t[6]=this[6]*i,t[7]=0,t[8]=this[8]*s,t[9]=this[9]*o,t[10]=this[10]*i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),s=1/n[0],o=1/n[1],i=1/n[2];return t[0]=this[0]*s,t[1]=this[1]*o,t[2]=this[2]*i,t[3]=this[4]*s,t[4]=this[5]*o,t[5]=this[6]*i,t[6]=this[8]*s,t[7]=this[9]*o,t[8]=this[10]*i,t}transpose(){return Wi(this,this),this.check()}invert(){return Yi(this,this),this.check()}multiplyLeft(t){return an(this,t,this),this.check()}multiplyRight(t){return an(this,this,t),this.check()}rotateX(t){return ta(this,this,t),this.check()}rotateY(t){return ea(this,this,t),this.check()}rotateZ(t){return ra(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return $i(this,this,t,r),this.check()}scale(t){return Zi(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return Qi(this,this,t),this.check()}transform(t,r){return t.length===4?(r=xf(r||[-0,-0,-0,-0],t,this),Te(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,s;switch(n){case 2:s=cs(r||[-0,-0],t,this);break;case 3:s=Ve(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Te(s,t.length),s}transformAsVector(t,r){let n;switch(t.length){case 2:n=ls(r||[-0,-0],t,this);break;case 3:n=us(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Te(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},xs,ys;function lx(){return xs||(xs=new P([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(xs)),xs}function ux(){return ys||(ys=new P,Object.freeze(ys)),ys}function Tf(e){if(e>Math.PI*2)throw Error("expected radians")}function fx(e,t,r,n,s,o){let i=2*o/(r-t),a=2*o/(s-n),c=(r+t)/(r-t),l=(s+n)/(s-n),u=-1,f=-1,h=-2*o;return e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=c,e[9]=l,e[10]=u,e[11]=f,e[12]=0,e[13]=0,e[14]=h,e[15]=0,e}function _f(){let e=new Z(4);return Z!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Ef(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function fa(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function ha(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=r[0],c=r[1],l=r[2],u=r[3];return e[0]=n*u+i*a+s*l-o*c,e[1]=s*u+i*c+o*a-n*l,e[2]=o*u+i*l+n*c-s*a,e[3]=i*u-n*a-s*c-o*l,e}function Bf(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+i*a,e[1]=s*c+o*a,e[2]=o*c-s*a,e[3]=i*c-n*a,e}function Cf(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c-o*a,e[1]=s*c+i*a,e[2]=o*c+n*a,e[3]=i*c-s*a,e}function Sf(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+s*a,e[1]=s*c-n*a,e[2]=o*c+i*a,e[3]=i*c-o*a,e}function bf(e,t){let r=t[0],n=t[1],s=t[2];return e[0]=r,e[1]=n,e[2]=s,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-s*s)),e}function ln(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3],c=r[0],l=r[1],u=r[2],f=r[3],h,d,p,A,g;return h=s*c+o*l+i*u+a*f,h<0&&(h=-h,c=-c,l=-l,u=-u,f=-f),1-h>1e-6?(d=Math.acos(h),g=Math.sin(d),p=Math.sin((1-n)*d)/g,A=Math.sin(n*d)/g):(p=1-n,A=n),e[0]=p*s+A*c,e[1]=p*o+A*l,e[2]=p*i+A*u,e[3]=p*a+A*f,e}function Mf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r*r+n*n+s*s+o*o,a=i?1/i:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-s*a,e[3]=o*a,e}function If(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function da(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[s*3+s]&&(s=2);let o=(s+1)%3,i=(s+2)%3;n=Math.sqrt(t[s*3+s]-t[o*3+o]-t[i*3+i]+1),e[s]=.5*n,n=.5/n,e[3]=(t[o*3+i]-t[i*3+o])*n,e[o]=(t[o*3+s]+t[s*3+o])*n,e[i]=(t[i*3+s]+t[s*3+i])*n}return e}var wf=ff;var Ff=hf,Lf=gf,Rf=Af,Pf=df;var Of=pf;var Nf=mf;var Df=function(){let e=hs(),t=ds(1,0,0),r=ds(0,1,0);return function(n,s,o){let i=nn(s,o);return i<-.999999?(Ge(e,t,s),ki(e)<1e-6&&Ge(e,r,s),Ui(e,e),fa(n,e,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Ge(e,s,o),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+i,Nf(n,n))}}(),Pw=function(){let e=_f(),t=_f();return function(r,n,s,o,i,a){return ln(e,n,i,a),ln(t,s,o,a),ln(r,e,t,2*a*(1-a)),r}}(),Ow=function(){let e=Qu();return function(t,r,n,s){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=s[0],e[4]=s[1],e[7]=s[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],Nf(t,da(t,e))}}();var hx=[0,0,0,1],Yt=class extends ye{constructor(t=0,r=0,n=0,s=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,s)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,s){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return da(this,t),this.check()}fromAxisRotation(t,r){return fa(this,t,r),this.check()}identity(){return Ef(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=U(t)}get y(){return this[1]}set y(t){this[1]=U(t)}get z(){return this[2]}set z(t){this[2]=U(t)}get w(){return this[3]}set w(t){this[3]=U(t)}len(){return Pf(this)}lengthSquared(){return Of(this)}dot(t){return Lf(this,t)}rotationTo(t,r){return Df(this,t,r),this.check()}add(t){return wf(this,this,t),this.check()}calculateW(){return bf(this,this),this.check()}conjugate(){return If(this,this),this.check()}invert(){return Mf(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(Rf(this,t,r,n),this.check())}multiplyRight(t){return ha(this,this,t),this.check()}multiplyLeft(t){return ha(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return Bf(this,this,t),this.check()}rotateY(t){return Cf(this,this,t),this.check()}rotateZ(t){return Sf(this,this,t),this.check()}scale(t){return Ff(this,this,t),this.check()}slerp(t,r,n){let s,o,i;switch(arguments.length){case 1:({start:s=hx,target:o,ratio:i}=t);break;case 2:s=this,o=t,i=r;break;default:s=t,o=r,i=n}return ln(this,s,o,i),this.check()}transformVector4(t,r=new mr){return yf(r,t,this),Te(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var It={};ut(It,{EPSILON1:()=>dx,EPSILON10:()=>Ex,EPSILON11:()=>Bx,EPSILON12:()=>Cx,EPSILON13:()=>Sx,EPSILON14:()=>bx,EPSILON15:()=>Mx,EPSILON16:()=>Ix,EPSILON17:()=>wx,EPSILON18:()=>Fx,EPSILON19:()=>Lx,EPSILON2:()=>px,EPSILON20:()=>Rx,EPSILON3:()=>mx,EPSILON4:()=>gx,EPSILON5:()=>Ax,EPSILON6:()=>xx,EPSILON7:()=>yx,EPSILON8:()=>Tx,EPSILON9:()=>_x,PI_OVER_FOUR:()=>Ox,PI_OVER_SIX:()=>Nx,PI_OVER_TWO:()=>Px,TWO_PI:()=>Dx});var dx=.1,px=.01,mx=.001,gx=1e-4,Ax=1e-5,xx=1e-6,yx=1e-7,Tx=1e-8,_x=1e-9,Ex=1e-10,Bx=1e-11,Cx=1e-12,Sx=1e-13,bx=1e-14,Mx=1e-15,Ix=1e-16,wx=1e-17,Fx=1e-18,Lx=1e-19,Rx=1e-20,Px=Math.PI/2,Ox=Math.PI/4,Nx=Math.PI/6,Dx=Math.PI*2;function Ts(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var Ut=Math.PI,Vf=Ut/4,vf=Ut/180,Uf=180/Ut,_s=512;function re(e){let[t,r]=e;Ts(Number.isFinite(t)),Ts(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");let n=t*vf,s=r*vf,o=_s*(n+Ut)/(2*Ut),i=_s*(Ut+Math.log(Math.tan(Vf+s*.5)))/(2*Ut);return[o,i]}function ne(e){let[t,r]=e,n=t/_s*(2*Ut)-Ut,s=2*(Math.atan(Math.exp(r/_s*(2*Ut)-Ut))-Vf);return[n*Uf,s*Uf]}var AF=Math.PI/180;var zf=6378137*Math.PI;function pa(e){let t=re(e);return t[0]=(t[0]/256-1)*zf,t[1]=(t[1]/256-1)*zf,t}var Zx={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:()=>{}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:()=>{}},onImageLoad:{type:"function",value:()=>{}},onImageLoadError:{type:"function",compare:!1,value:(e,t)=>console.error(t,e)}},Bs=class extends ze.CompositeLayer{get isLoaded(){return this.state?.loadCounter===0&&super.isLoaded}shouldUpdateState(){return!0}initializeState(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}updateState({changeFlags:t,props:r,oldProps:n}){let{viewport:s}=this.context;t.dataChanged||r.serviceType!==n.serviceType?(this.state.imageSource=this._createImageSource(r),this._loadMetadata(),this.debounce(()=>this.loadImage(s,"image source changed"),0)):(0,ze._deepEqual)(r.layers,n.layers,1)?t.viewportChanged&&this.debounce(()=>this.loadImage(s,"viewport changed")):this.debounce(()=>this.loadImage(s,"layers changed"),0)}finalizeState(){}renderLayers(){let{bounds:t,image:r,lastRequestParameters:n}=this.state;return r&&new kf.BitmapLayer({...this.getSubLayerProps({id:"bitmap"}),_imageCoordinateSystem:n.srs==="EPSG:4326"?ze.COORDINATE_SYSTEM.LNGLAT:ze.COORDINATE_SYSTEM.CARTESIAN,bounds:t,image:r})}async getFeatureInfoText(t,r){let{lastRequestParameters:n}=this.state;return n?await this.state.imageSource.getFeatureInfoText?.({...n,query_layers:n.layers,x:t,y:r,info_format:"application/vnd.ogc.gml"}):""}_createImageSource(t){if(t.data instanceof Mt)return t.data;if(typeof t.data=="string")return Pi({url:t.data,loadOptions:t.loadOptions,type:t.serviceType});throw new Error("invalid image source in props.data")}async _loadMetadata(){let{imageSource:t}=this.state;try{this.state.loadCounter++;let r=await t.getMetadata();this.state.imageSource===t&&this.getCurrentLayer()?.props.onMetadataLoad(r)}catch(r){this.getCurrentLayer()?.props.onMetadataLoadError(r)}finally{this.state.loadCounter--}}async loadImage(t,r){let{layers:n,serviceType:s}=this.props;if(s==="wms"&&n.length===0)return;let o=t.getBounds(),{width:i,height:a}=t,c=this.getRequestId(),{srs:l}=this.props;l==="auto"&&(l=t.resolution?"EPSG:4326":"EPSG:3857");let u={width:i,height:a,boundingBox:[[o[0],o[1]],[o[2],o[3]]],layers:n,crs:l};if(l==="EPSG:3857"){let f=pa([o[0],o[1]]),h=pa([o[2],o[3]]);u.boundingBox=[f,h]}try{this.state.loadCounter++,this.props.onImageLoadStart(c);let f=await this.state.imageSource.getImage(u);this.state.lastRequestId<c&&(this.getCurrentLayer()?.props.onImageLoad(c),this.setState({image:f,bounds:o,lastRequestParameters:u,lastRequestId:c}))}catch(f){this.raiseError(f,"Load image"),this.getCurrentLayer()?.props.onImageLoadError(c,f)}finally{this.state.loadCounter--}}getRequestId(){return this.state._nextRequestId++}debounce(t,r=500){clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(()=>t(),r)}},Es=Bs;(()=>{Bs.layerName="WMSLayer"})(),(()=>{Bs.defaultProps=Zx})();var Jf=N(Nt(),1),$x={getHeight:{type:"accessor",value:0},greatCircle:!0},Cs=class extends Jf.ArcLayer{},un=Cs;(()=>{Cs.layerName="GreatCircleLayer"})(),(()=>{Cs.defaultProps=$x})();var qf=N(Dt(),1),ma=N(Nt(),1),ty={...ma.PolygonLayer.defaultProps},Ss=class extends qf.CompositeLayer{indexToBounds(){return null}renderLayers(){let{elevationScale:t,extruded:r,wireframe:n,filled:s,stroked:o,lineWidthUnits:i,lineWidthScale:a,lineWidthMinPixels:c,lineWidthMaxPixels:l,lineJointRounded:u,lineMiterLimit:f,lineDashJustified:h,getElevation:d,getFillColor:p,getLineColor:A,getLineWidth:g}=this.props,{updateTriggers:y,material:E,transitions:_}=this.props,B=this.getSubLayerClass("cell",ma.PolygonLayer),{updateTriggers:S,...b}=this.indexToBounds()||{};return new B({filled:s,wireframe:n,extruded:r,elevationScale:t,stroked:o,lineWidthUnits:i,lineWidthScale:a,lineWidthMinPixels:c,lineWidthMaxPixels:l,lineJointRounded:u,lineMiterLimit:f,lineDashJustified:h,material:E,transitions:_,getElevation:d,getFillColor:p,getLineColor:A,getLineWidth:g},this.getSubLayerProps({id:"cell",updateTriggers:y&&{...S,getElevation:y.getElevation,getFillColor:y.getFillColor,getLineColor:y.getLineColor,getLineWidth:y.getLineWidth}}),b)}},St=Ss;(()=>{Ss.layerName="GeoCellLayer"})(),(()=>{Ss.defaultProps=ty})();var bs=N(ga(),1),ey=3,ry=30,ny=2*ry+1,Xf=180/Math.PI;function Yf(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function Wf(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Kf(e){return[Wf(e[0]),Wf(e[1])]}function Qf(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function Zf([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*Xf,n*Xf]}function $f(e){let t=bs.default.fromString(e,!0,10).toString(2);for(;t.length<ey+ny;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),s=t.substring(3,r),o=s.length/2,i=bs.default.fromString(n,!0,2).toString(10),a=bs.default.fromString(s,!0,2).toString(4);for(;a.length<o;)a="0"+a;return`${i}/${a}`}function sy(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let s=t[0];t[0]=t[1],t[1]=s}}function th(e){let t=e.split("/"),r=parseInt(t[0],10),n=t[1],s=n.length,o=[0,0],i;for(let a=s-1;a>=0;a--){i=s-a;let c=n[a],l=0,u=0;c==="1"?u=1:c==="2"?(l=1,u=1):c==="3"&&(l=1);let f=Math.pow(2,i-1);sy(f,o,l,u),o[0]+=f*l,o[1]+=f*u}if(r%2===1){let a=o[0];o[0]=o[1],o[1]=a}return{face:r,ij:o,level:i}}var eh=N(ga(),1);function oy(e){let t=e.padEnd(16,"0");return eh.default.fromString(t,16)}var iy=100;function ay({face:e,ij:t,level:r}){let n=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil(iy*Math.pow(2,-r))),o=new Float64Array(4*s*2+2),i=0,a=0;for(let c=0;c<4;c++){let l=n[c].slice(0),u=n[c+1],f=(u[0]-l[0])/s,h=(u[1]-l[1])/s;for(let d=0;d<s;d++){l[0]+=f,l[1]+=h;let p=Yf(t,r,l),A=Kf(p),g=Qf(e,A),y=Zf(g);Math.abs(y[1])>89.999&&(y[0]=a);let E=y[0]-a;y[0]+=E>180?-360:E<-180?360:0,o[i++]=y[0],o[i++]=y[1],a=y[0]}}return o[i++]=o[0],o[i++]=o[1],o}function cy(e){if(typeof e=="string"){if(e.indexOf("/")>0)return e;e=oy(e)}return $f(e.toString())}function rh(e){let t=cy(e),r=th(t);return ay(r)}var ly={getS2Token:{type:"accessor",value:e=>e.token}},Ms=class extends St{indexToBounds(){let{data:t,getS2Token:r}=this.props;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(n,s)=>rh(r(n,s))}}},hn=Ms;(()=>{Ms.layerName="S2Layer"})(),(()=>{Ms.defaultProps=ly})();var Aa=512;function uy(e,t){let r=0,n=0,s=1<<e.length,o=s/Aa;for(let i=0;i<e.length;i++){s>>=1;let a=parseInt(e[i]);a%2&&(r|=s),a>1&&(n|=s)}return[[r/o,Aa-n/o],[(r+t)/o,Aa-(n+t)/o]]}function nh(e,t=1){let[r,n]=uy(e,t),[s,o]=ne(r),[i,a]=ne(n);return[i,o,i,a,s,a,s,o,i,o]}var fy={getQuadkey:{type:"accessor",value:e=>e.quadkey}},Is=class extends St{indexToBounds(){let{data:t,extruded:r,getQuadkey:n}=this.props,s=r?.99:1;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(o,i)=>nh(n(o,i),s),updateTriggers:{getPolygon:s}}}},dn=Is;(()=>{Is.layerName="QuadkeyLayer"})(),(()=>{Is.defaultProps=fy})();var Ds=N(Dt(),1),_h=N(Nt(),1);var ke=class{constructor(t){this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get bbox(){return this._bbox}set bbox(t){this._bbox||(this._bbox=t,"west"in t?this.boundingBox=[[t.west,t.south],[t.east,t.north]]:this.boundingBox=[[t.left,t.top],[t.right,t.bottom]])}get data(){return this.isLoading&&this._loader?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return Boolean(this._loader)&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){let t=this.content?this.content.byteLength:0;return Number.isFinite(t)||console.error("byteLength not defined in tile data"),t}async _loadData({getData:t,requestScheduler:r,onLoad:n,onError:s}){let{index:o,id:i,bbox:a,userData:c,zoom:l}=this,u=this._loaderId;this._abortController=new AbortController;let{signal:f}=this._abortController,h=await r.scheduleRequest(this,A=>A.isSelected?1:-1);if(!h){this._isCancelled=!0;return}if(this._isCancelled){h.done();return}let d=null,p;try{d=await t({index:o,id:i,bbox:a,userData:c,zoom:l,signal:f})}catch(A){p=A||!0}finally{h.done()}if(u===this._loaderId){if(this._loader=void 0,this.content=d,this._isCancelled&&!d){this._isLoaded=!1;return}this._isLoaded=!0,this._isCancelled=!1,p?s(p,this):n(this)}}loadData(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController?.abort())}};var gn=N(Dt(),1);var rt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var sh=new x,hy=new x,Ee=class{constructor(t=[0,0,0],r=[0,0,0],n){n=n||sh.copy(t).add(r).scale(.5),this.center=new x(n),this.halfDiagonal=new x(r).subtract(this.center),this.minimum=new x(t),this.maximum=new x(r)}clone(){return new Ee(this.minimum,this.maximum,this.center)}equals(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}transform(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}intersectPlane(t){let{halfDiagonal:r}=this,n=hy.from(t.normal),s=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),o=this.center.dot(n)+t.distance;return o-s>0?rt.INSIDE:o+s<0?rt.OUTSIDE:rt.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=sh.from(t).subtract(this.center),{halfDiagonal:n}=this,s=0,o;return o=Math.abs(r.x)-n.x,o>0&&(s+=o*o),o=Math.abs(r.y)-n.y,o>0&&(s+=o*o),o=Math.abs(r.z)-n.z,o>0&&(s+=o*o),s}};var pn=new x,oh=new x,wt=class{constructor(t=[0,0,0],r=0){this.radius=-0,this.center=new x,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=pn.from(r),this.center=new x().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new wt(this.center,this.radius)}union(t){let r=this.center,n=this.radius,s=t.center,o=t.radius,i=pn.copy(s).subtract(r),a=i.magnitude();if(n>=a+o)return this.clone();if(o>=a+n)return t.clone();let c=(n+a+o)*.5;return oh.copy(i).scale((-n+c)/a).add(r),this.center.copy(oh),this.radius=c,this}expand(t){let n=pn.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=cn.getScaling(pn,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=pn.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,o=t.normal.dot(r)+t.distance;return o<-n?rt.OUTSIDE:o<n?rt.INTERSECTING:rt.INSIDE}};var dy=new x,py=new x,ws=new x,Fs=new x,Ls=new x,my=new x,gy=new x,se={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},Gt=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new x().from(t),this.halfAxes=new z(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new x(t).len(),new x(r).len(),new x(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),s=new x(t).normalize(),o=new x(r).normalize(),i=new x(n).normalize();return new Yt().fromMatrix3(new z([...s,...o,...i]))}fromCenterHalfSizeQuaternion(t,r,n){let s=new Yt(n),o=new z().fromQuaternion(s);return o[0]=o[0]*r[0],o[1]=o[1]*r[0],o[2]=o[2]*r[0],o[3]=o[3]*r[1],o[4]=o[4]*r[1],o[5]=o[5]*r[1],o[6]=o[6]*r[2],o[7]=o[7]*r[2],o[8]=o[8]*r[2],this.center=new x().from(t),this.halfAxes=o,this}clone(){return new Gt(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new wt){let r=this.halfAxes,n=r.getColumn(0,ws),s=r.getColumn(1,Fs),o=r.getColumn(2,Ls),i=dy.copy(n).add(s).add(o);return t.center.copy(this.center),t.radius=i.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,s=this.halfAxes,o=n.x,i=n.y,a=n.z,c=Math.abs(o*s[se.COLUMN0ROW0]+i*s[se.COLUMN0ROW1]+a*s[se.COLUMN0ROW2])+Math.abs(o*s[se.COLUMN1ROW0]+i*s[se.COLUMN1ROW1]+a*s[se.COLUMN1ROW2])+Math.abs(o*s[se.COLUMN2ROW0]+i*s[se.COLUMN2ROW1]+a*s[se.COLUMN2ROW2]),l=n.dot(r)+t.distance;return l<=-c?rt.OUTSIDE:l>=c?rt.INSIDE:rt.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=py.from(t).subtract(this.center),n=this.halfAxes,s=n.getColumn(0,ws),o=n.getColumn(1,Fs),i=n.getColumn(2,Ls),a=s.magnitude(),c=o.magnitude(),l=i.magnitude();s.normalize(),o.normalize(),i.normalize();let u=0,f;return f=Math.abs(r.dot(s))-a,f>0&&(u+=f*f),f=Math.abs(r.dot(o))-c,f>0&&(u+=f*f),f=Math.abs(r.dot(i))-l,f>0&&(u+=f*f),u}computePlaneDistances(t,r,n=[-0,-0]){let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,c=a.getColumn(0,ws),l=a.getColumn(1,Fs),u=a.getColumn(2,Ls),f=my.copy(c).add(l).add(u).add(i),h=gy.copy(f).subtract(t),d=r.dot(h);return s=Math.min(d,s),o=Math.max(d,o),f.copy(i).add(c).add(l).subtract(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),f.copy(i).add(c).subtract(l).add(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),f.copy(i).add(c).subtract(l).subtract(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),i.copy(f).subtract(c).add(l).add(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),i.copy(f).subtract(c).add(l).subtract(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),i.copy(f).subtract(c).subtract(l).add(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),i.copy(f).subtract(c).subtract(l).subtract(u),h.copy(f).subtract(t),d=r.dot(h),s=Math.min(d,s),o=Math.max(d,o),n[0]=s,n[1]=o,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,ws);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,Fs);n.transformAsPoint(t);let s=this.halfAxes.getColumn(2,Ls);return s.transformAsPoint(t),this.halfAxes=new z([...r,...n,...s]),this}getTransform(){throw new Error("not implemented")}};var ih=new x,ah=new x,ct=class{constructor(t=[0,0,1],r=0){this.normal=new x,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return at(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=ih.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,s){return this.normal.set(t,r,n),at(mt(this.normal.len(),1)),this.distance=s,this}clone(){return new ct(this.normal,this.distance)}equals(t){return mt(this.distance,t.distance)&&mt(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=ah.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=ih.from(t),s=this.getPointDistance(n),o=ah.copy(this.normal).scale(s);return n.subtract(o).to(r)}};var ch=[new x([1,0,0]),new x([0,1,0]),new x([0,0,1])],lh=new x,Ay=new x,ot=class{constructor(t=[]){this.planes=t}fromBoundingSphere(t){this.planes.length=2*ch.length;let r=t.center,n=t.radius,s=0;for(let o of ch){let i=this.planes[s],a=this.planes[s+1];i||(i=this.planes[s]=new ct),a||(a=this.planes[s+1]=new ct);let c=lh.copy(o).scale(-n).add(r);i.fromPointNormal(c,o);let l=lh.copy(o).scale(n).add(r),u=Ay.copy(o).negate();a.fromPointNormal(l,u),s+=2}return this}computeVisibility(t){let r=rt.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case rt.OUTSIDE:return rt.OUTSIDE;case rt.INTERSECTING:r=rt.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(at(Number.isFinite(r),"parentPlaneMask is required."),r===ot.MASK_OUTSIDE||r===ot.MASK_INSIDE)return r;let n=ot.MASK_INSIDE,s=this.planes;for(let o=0;o<this.planes.length;++o){let i=o<31?1<<o:0;if(o<31&&!(r&i))continue;let a=s[o],c=t.intersectPlane(a);if(c===rt.OUTSIDE)return ot.MASK_OUTSIDE;c===rt.INTERSECTING&&(n|=i)}return n}};ot.MASK_OUTSIDE=4294967295;ot.MASK_INSIDE=0;ot.MASK_INDETERMINATE=2147483647;var OL=new x,NL=new x,DL=new x,vL=new x,UL=new x;var qL=new x,jL=new x,XL=new x,WL=new x,YL=new x,KL=new x,QL=new x,ZL=new x,$L=new x,tR=new x,eR=new x,rR=new x;var Kt=new z,yy=new z,Ty=new z,Rs=new z,uh=new z;function Ta(e,t={}){let r=It.EPSILON20,n=10,s=0,o=0,i=yy,a=Ty;i.identity(),a.copy(e);let c=r*_y(a);for(;o<n&&Ey(a)>c;)By(a,Rs),uh.copy(Rs).transpose(),a.multiplyRight(Rs),a.multiplyLeft(uh),i.multiplyRight(Rs),++s>2&&(++o,s=0);return t.unitary=i.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}function _y(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var xa=[1,0,0],ya=[2,2,1];function Ey(e){let t=0;for(let r=0;r<3;++r){let n=e[Kt.getElementIndex(ya[r],xa[r])];t+=2*n*n}return Math.sqrt(t)}function By(e,t){let r=It.EPSILON15,n=0,s=1;for(let l=0;l<3;++l){let u=Math.abs(e[Kt.getElementIndex(ya[l],xa[l])]);u>n&&(s=l,n=u)}let o=xa[s],i=ya[s],a=1,c=0;if(Math.abs(e[Kt.getElementIndex(i,o)])>r){let l=e[Kt.getElementIndex(i,i)],u=e[Kt.getElementIndex(o,o)],f=e[Kt.getElementIndex(i,o)],h=(l-u)/2/f,d;h<0?d=-1/(-h+Math.sqrt(1+h*h)):d=1/(h+Math.sqrt(1+h*h)),a=1/Math.sqrt(1+d*d),c=d*a}return z.IDENTITY.to(t),t[Kt.getElementIndex(o,o)]=t[Kt.getElementIndex(i,i)]=a,t[Kt.getElementIndex(i,o)]=c,t[Kt.getElementIndex(o,i)]=-c,t}var Be=new x,Cy=new x,Sy=new x,by=new x,My=new x,Iy=new z,wy={diagonal:new z,unitary:new z};function mn(e,t=new Gt){if(!e||e.length===0)return t.halfAxes=new z([0,0,0,0,0,0,0,0,0]),t.center=new x,t;let r=e.length,n=new x(0,0,0);for(let T of e)n.add(T);let s=1/r;n.multiplyByScalar(s);let o=0,i=0,a=0,c=0,l=0,u=0;for(let T of e){let m=Be.copy(T).subtract(n);o+=m.x*m.x,i+=m.x*m.y,a+=m.x*m.z,c+=m.y*m.y,l+=m.y*m.z,u+=m.z*m.z}o*=s,i*=s,a*=s,c*=s,l*=s,u*=s;let f=Iy;f[0]=o,f[1]=i,f[2]=a,f[3]=i,f[4]=c,f[5]=l,f[6]=a,f[7]=l,f[8]=u;let{unitary:h}=Ta(f,wy),d=t.halfAxes.copy(h),p=d.getColumn(0,Sy),A=d.getColumn(1,by),g=d.getColumn(2,My),y=-Number.MAX_VALUE,E=-Number.MAX_VALUE,_=-Number.MAX_VALUE,B=Number.MAX_VALUE,S=Number.MAX_VALUE,b=Number.MAX_VALUE;for(let T of e)Be.copy(T),y=Math.max(Be.dot(p),y),E=Math.max(Be.dot(A),E),_=Math.max(Be.dot(g),_),B=Math.min(Be.dot(p),B),S=Math.min(Be.dot(A),S),b=Math.min(Be.dot(g),b);p=p.multiplyByScalar(.5*(B+y)),A=A.multiplyByScalar(.5*(S+E)),g=g.multiplyByScalar(.5*(b+_)),t.center.copy(p).add(A).add(g);let w=Cy.set(y-B,E-S,_-b).multiplyByScalar(.5),C=new z([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(C),t}var Ar=512,fh=3,hh=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],dh=hh.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Fy=dh.concat([[.25,.5],[.75,.5]]),Ce=class{constructor(t,r,n){this.x=t,this.y=r,this.z=n}get children(){if(!this._children){let t=this.x*2,r=this.y*2,n=this.z+1;this._children=[new Ce(t,r,n),new Ce(t,r+1,n),new Ce(t+1,r,n),new Ce(t+1,r+1,n)]}return this._children}update(t){let{viewport:r,cullingVolume:n,elevationBounds:s,minZ:o,maxZ:i,bounds:a,offset:c,project:l}=t,u=this.getBoundingVolume(s,c,l);if(a&&!this.insideBounds(a)||n.computeVisibility(u)<0)return!1;if(!this.childVisible){let{z:h}=this;if(h<i&&h>=o){let d=u.distanceTo(r.cameraPosition)*r.scale/r.height;h+=Math.floor(Math.log2(d))}if(h>=i)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(let h of this.children)h.update(t);return!0}getSelected(t=[]){if(this.selected&&t.push(this),this._children)for(let r of this._children)r.getSelected(t);return t}insideBounds([t,r,n,s]){let o=Math.pow(2,this.z),i=Ar/o;return this.x*i<n&&this.y*i<s&&(this.x+1)*i>t&&(this.y+1)*i>r}getBoundingVolume(t,r,n){if(n){let c=this.z<1?Fy:this.z<2?dh:hh,l=[];for(let u of c){let f=Ps(this.x+u[0],this.y+u[1],this.z);f[2]=t[0],l.push(n(f)),t[0]!==t[1]&&(f[2]=t[1],l.push(n(f)))}return mn(l)}let s=Math.pow(2,this.z),o=Ar/s,i=this.x*o+r*Ar,a=Ar-(this.y+1)*o;return new Ee([i,a,t[0]],[i+o,a+o,t[1]])}};function ph(e,t,r,n){let s=e instanceof gn._GlobeViewport&&e.resolution?e.projectPosition:null,o=Object.values(e.getFrustumPlanes()).map(({normal:d,distance:p})=>new ct(d.clone().negate(),p)),i=new ot(o),a=e.distanceScales.unitsPerMeter[2],c=r&&r[0]*a||0,l=r&&r[1]*a||0,u=e instanceof gn.WebMercatorViewport&&e.pitch<=60?t:0;if(n){let[d,p,A,g]=n,y=re([d,g]),E=re([A,p]);n=[y[0],Ar-y[1],E[0],Ar-E[1]]}let f=new Ce(0,0,0),h={viewport:e,project:s,cullingVolume:i,elevationBounds:[c,l],minZ:u,maxZ:t,bounds:n,offset:0};if(f.update(h),e instanceof gn.WebMercatorViewport&&e.subViewports&&e.subViewports.length>1){for(h.offset=-1;f.update(h)&&!(--h.offset<-fh););for(h.offset=1;f.update(h)&&!(++h.offset>fh););}return f.getSelected()}var oe=512,Ly=[-1/0,-1/0,1/0,1/0],Se={type:"object",value:null,validate:(e,t)=>t.optional&&e===null||typeof e=="string"||Array.isArray(e)&&e.every(r=>typeof r=="string"),equal:(e,t)=>{if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;let r=e.length;if(r!==t.length)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}};function gh(e,t){let r=[t.transformAsPoint([e[0],e[1]]),t.transformAsPoint([e[2],e[1]]),t.transformAsPoint([e[0],e[3]]),t.transformAsPoint([e[2],e[3]])];return[Math.min(...r.map(s=>s[0])),Math.min(...r.map(s=>s[1])),Math.max(...r.map(s=>s[0])),Math.max(...r.map(s=>s[1]))]}function Ry(e){return Math.abs(e.split("").reduce((t,r)=>(t<<5)-t+r.charCodeAt(0)|0,0))}function Qt(e,t){if(!e||!e.length)return null;let{index:r,id:n}=t;if(Array.isArray(e)){let o=Ry(n)%e.length;e=e[o]}let s=e;for(let o of Object.keys(r)){let i=new RegExp(`{${o}}`,"g");s=s.replace(i,String(r[o]))}return Number.isInteger(r.y)&&Number.isInteger(r.z)&&(s=s.replace(/\{-y\}/g,String(Math.pow(2,r.z)-r.y-1))),s}function Py(e,t,r){let n;if(t&&t.length===2){let[s,o]=t,i=e.getBounds({z:s}),a=e.getBounds({z:o});n=[Math.min(i[0],a[0]),Math.min(i[1],a[1]),Math.max(i[2],a[2]),Math.max(i[3],a[3])]}else n=e.getBounds();return e.isGeospatial?[Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.min(n[2],r[2]),Math.min(n[3],r[3])]:[Math.max(Math.min(n[0],r[2]),r[0]),Math.max(Math.min(n[1],r[3]),r[1]),Math.min(Math.max(n[2],r[0]),r[2]),Math.min(Math.max(n[3],r[1]),r[3])]}function Ah({viewport:e,z:t,cullRect:r}){return(e.subViewports||[e]).map(s=>_a(s,t||0,r))}function _a(e,t,r){if(!Array.isArray(t)){let o=r.x-e.x,i=r.y-e.y,{width:a,height:c}=r,l={targetZ:t},u=e.unproject([o,i],l),f=e.unproject([o+a,i],l),h=e.unproject([o,i+c],l),d=e.unproject([o+a,i+c],l);return[Math.min(u[0],f[0],h[0],d[0]),Math.min(u[1],f[1],h[1],d[1]),Math.max(u[0],f[0],h[0],d[0]),Math.max(u[1],f[1],h[1],d[1])]}let n=_a(e,t[0],r),s=_a(e,t[1],r);return[Math.min(n[0],s[0]),Math.min(n[1],s[1]),Math.max(n[2],s[2]),Math.max(n[3],s[3])]}function Oy(e,t,r){return r?gh(e,r).map(s=>s*t/oe):e.map(n=>n*t/oe)}function Ea(e,t){return Math.pow(2,e)*oe/t}function Ps(e,t,r){let n=Ea(r,oe),s=e/n*360-180,o=Math.PI-2*Math.PI*t/n,i=180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)));return[s,i]}function mh(e,t,r,n){let s=Ea(r,n);return[e/s*oe,t/s*oe]}function Ba(e,t,r,n,s=oe){if(e.isGeospatial){let[l,u]=Ps(t,r,n),[f,h]=Ps(t+1,r+1,n);return{west:l,north:u,east:f,south:h}}let[o,i]=mh(t,r,n,s),[a,c]=mh(t+1,r+1,n,s);return{left:o,top:i,right:a,bottom:c}}function Ny(e,t,r,n,s){let o=Py(e,null,n),i=Ea(t,r),[a,c,l,u]=Oy(o,i,s),f=[];for(let h=Math.floor(a);h<l;h++)for(let d=Math.floor(c);d<u;d++)f.push({x:h,y:d,z:t});return f}function Ca({viewport:e,maxZoom:t,minZoom:r,zRange:n,extent:s,tileSize:o=oe,modelMatrix:i,modelMatrixInverse:a,zoomOffset:c=0}){let l=e.isGeospatial?Math.round(e.zoom+Math.log2(oe/o))+c:Math.ceil(e.zoom)+c;if(typeof r=="number"&&Number.isFinite(r)&&l<r){if(!s)return[];l=r}typeof t=="number"&&Number.isFinite(t)&&l>t&&(l=t);let u=s;return i&&a&&s&&!e.isGeospatial&&(u=gh(s,i)),e.isGeospatial?ph(e,l,n,s):Ny(e,l,o,u||Ly,a)}function Sa(e){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}function ba(e){return Number.isFinite(e.west)&&Number.isFinite(e.north)&&Number.isFinite(e.east)&&Number.isFinite(e.south)}function xh(e){let t={},r;return n=>{for(let s in n)if(!Dy(n[s],t[s])){r=e(n),t=n;break}return r}}function Dy(e,t){if(e===t)return!0;if(Array.isArray(e)){let r=e.length;if(!t||t.length!==r)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}return!1}var yh=1,Os=2,vy="never",Uy="no-overlap",An="best-available",Gy=5,Vy={[An]:zy,[Uy]:ky,[vy]:()=>{}},Hy={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{}},Je=class{constructor(t){this._getCullBounds=xh(Ah),this.opts={...Hy,...t},this.setOptions(this.opts),this.onTileLoad=r=>{this.opts.onTileLoad?.(r),this.opts.maxCacheByteSize&&(this._cacheByteSize+=r.byteLength,this._resizeCache())},this._requestScheduler=new me({throttleRequests:this.opts.maxRequests>0||this.opts.debounceTime>0,maxRequests:this.opts.maxRequests,debounceTime:this.opts.debounceTime}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._zRange=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new P,this._modelMatrixInverse=new P}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles!==null&&this._selectedTiles.every(t=>t.isLoaded)}get needsReload(){return this._selectedTiles!==null&&this._selectedTiles.some(t=>t.needsReload)}setOptions(t){Object.assign(this.opts,t),Number.isFinite(t.maxZoom)&&(this._maxZoom=Math.floor(t.maxZoom)),Number.isFinite(t.minZoom)&&(this._minZoom=Math.ceil(t.minZoom))}finalize(){for(let t of this._cache.values())t.isLoading&&t.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(let t of this._cache.keys()){let r=this._cache.get(t);!this._selectedTiles||!this._selectedTiles.includes(r)?this._cache.delete(t):r.setNeedsReload()}}update(t,{zRange:r,modelMatrix:n}={zRange:null,modelMatrix:null}){let s=n?new P(n):new P,o=!s.equals(this._modelMatrix);if(!this._viewport||!t.equals(this._viewport)||!mt(this._zRange,r)||o){o&&(this._modelMatrixInverse=s.clone().invert(),this._modelMatrix=s),this._viewport=t,this._zRange=r;let a=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:r,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=a.map(c=>this._getTile(c,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(a=>this._getTile(a.index,!0)));let i=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),i&&this._frameNumber++,this._frameNumber}isTileVisible(t,r){if(!t.isVisible)return!1;if(r&&this._viewport){let n=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:r}),{bbox:s}=t;for(let[o,i,a,c]of n){let l;if("west"in s)l=s.west<a&&s.east>o&&s.south<c&&s.north>i;else{let u=Math.min(s.top,s.bottom),f=Math.max(s.top,s.bottom);l=s.left<a&&s.right>o&&u<c&&f>i}if(l)return!0}return!1}return!0}getTileIndices({viewport:t,maxZoom:r,minZoom:n,zRange:s,modelMatrix:o,modelMatrixInverse:i}){let{tileSize:a,extent:c,zoomOffset:l}=this.opts;return Ca({viewport:t,maxZoom:r,minZoom:n,zRange:s,tileSize:a,extent:c,modelMatrix:o,modelMatrixInverse:i,zoomOffset:l})}getTileId(t){return`${t.x}-${t.y}-${t.z}`}getTileZoom(t){return t.z}getTileMetadata(t){let{tileSize:r}=this.opts;return{bbox:Ba(this._viewport,t.x,t.y,t.z,r)}}getParentIndex(t){let r=Math.floor(t.x/2),n=Math.floor(t.y/2),s=t.z-1;return{x:r,y:n,z:s}}updateTileStates(){let t=this.opts.refinementStrategy||An,r=new Array(this._cache.size),n=0;for(let s of this._cache.values())r[n++]=s.isVisible,s.isSelected=!1,s.isVisible=!1;for(let s of this._selectedTiles)s.isSelected=!0,s.isVisible=!0;(typeof t=="function"?t:Vy[t])(Array.from(this._cache.values())),n=0;for(let s of this._cache.values())if(r[n++]!==s.isVisible)return!0;return!1}_pruneRequests(){let{maxRequests:t=0}=this.opts,r=[],n=0;for(let s of this._cache.values())s.isLoading&&(n++,!s.isSelected&&!s.isVisible&&r.push(s));for(;t>0&&n>t&&r.length>0;)r.shift().abort(),n--}_rebuildTree(){let{_cache:t}=this;for(let r of t.values())r.parent=null,r.children&&(r.children.length=0);for(let r of t.values()){let n=this._getNearestAncestor(r);r.parent=n,n?.children&&n.children.push(r)}}_resizeCache(){let{_cache:t,opts:r}=this,n=r.maxCacheSize||(r.maxCacheByteSize?1/0:Gy*this.selectedTiles.length),s=r.maxCacheByteSize||1/0;if(t.size>n||this._cacheByteSize>s){for(let[i,a]of t)if(!a.isVisible&&!a.isSelected&&(this._cacheByteSize-=r.maxCacheByteSize?a.byteLength:0,t.delete(i),this.opts.onTileUnload?.(a)),t.size<=n&&this._cacheByteSize<=s)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((i,a)=>i.zoom-a.zoom),this._dirty=!1)}_getTile(t,r){let n=this.getTileId(t),s=this._cache.get(n),o=!1;return!s&&r?(s=new ke(t),Object.assign(s,this.getTileMetadata(s.index)),Object.assign(s,{id:n,zoom:this.getTileZoom(s.index)}),o=!0,this._cache.set(n,s),this._dirty=!0):s&&s.needsReload&&(o=!0),s&&o&&s.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),s}_getNearestAncestor(t){let{_minZoom:r=0}=this,n=t.index;for(;this.getTileZoom(n)>r;){n=this.getParentIndex(n);let s=this._getTile(n);if(s)return s}return null}};function zy(e){for(let t of e)t.state=0;for(let t of e)t.isSelected&&!Th(t)&&Ma(t);for(let t of e)t.isVisible=Boolean(t.state&Os)}function ky(e){for(let r of e)r.state=0;for(let r of e)r.isSelected&&Th(r);let t=Array.from(e).sort((r,n)=>r.zoom-n.zoom);for(let r of t)if(r.isVisible=Boolean(r.state&Os),r.children&&(r.isVisible||r.state&yh))for(let n of r.children)n.state=yh;else r.isSelected&&Ma(r)}function Th(e){let t=e;for(;t;){if(t.isLoaded||t.content)return t.state|=Os,!0;t=t.parent}return!1}function Ma(e){for(let t of e.children)t.isLoaded||t.content?t.state|=Os:Ma(t)}var Jy={TilesetClass:Je,data:{type:"data",value:[]},dataComparator:Se.equal,renderSubLayers:{type:"function",value:e=>new _h.GeoJsonLayer(e)},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:e=>{}},onTileUnload:{type:"function",value:e=>{}},onTileError:{type:"function",value:e=>console.error(e)},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:An,zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0},Ns=class extends Ds.CompositeLayer{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){this.state?.tileset?.finalize()}get isLoaded(){return Boolean(this.state?.tileset?.selectedTiles?.every(t=>t.isLoaded&&t.layers&&t.layers.every(r=>r.isLoaded)))}shouldUpdateState({changeFlags:t}){return t.somethingChanged}updateState({changeFlags:t}){let{tileset:r}=this.state,n=t.propsOrDataChanged||t.updateTriggersChanged,s=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);r?n&&(r.setOptions(this._getTilesetOptions()),s?r.reloadAll():r.tiles.forEach(o=>{o.layers=null})):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}_getTilesetOptions(){let{tileSize:t,maxCacheSize:r,maxCacheByteSize:n,refinementStrategy:s,extent:o,maxZoom:i,minZoom:a,maxRequests:c,debounceTime:l,zoomOffset:u}=this.props;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:i,minZoom:a,tileSize:t,refinementStrategy:s,extent:o,maxRequests:c,debounceTime:l,zoomOffset:u,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){let t=this.state.tileset,{zRange:r,modelMatrix:n}=this.props,s=t.update(this.context.viewport,{zRange:r,modelMatrix:n}),{isLoaded:o}=t,i=this.state.isLoaded!==o,a=this.state.frameNumber!==s;o&&(i||a)&&this._onViewportLoad(),a&&this.setState({frameNumber:s}),this.state.isLoaded=o}_onViewportLoad(){let{tileset:t}=this.state,{onViewportLoad:r}=this.props;r&&r(t.selectedTiles)}_onTileLoad(t){this.props.onTileLoad(t),t.layers=null,this.setNeedsUpdate()}_onTileError(t,r){this.props.onTileError(t),r.layers=null,this.setNeedsUpdate()}_onTileUnload(t){this.props.onTileUnload(t)}getTileData(t){let{data:r,getTileData:n,fetch:s}=this.props,{signal:o}=t;return t.url=typeof r=="string"||Array.isArray(r)?Qt(r,t):null,n?n(t):s&&t.url?s(t.url,{propName:"data",layer:this,signal:o}):null}renderSubLayers(t){return this.props.renderSubLayers(t)}getSubLayerPropsByTile(t){return null}getPickingInfo(t){let r=t.sourceLayer,n=r.props.tile,s=t.info;return s.picked&&(s.tile=n),s.sourceTile=n,s.sourceTileSubLayer=r,s}_updateAutoHighlight(t){t.sourceTileSubLayer.updateAutoHighlight(t)}renderLayers(){return this.state.tileset.tiles.map(t=>{let r=this.getSubLayerPropsByTile(t);if(!(!t.isLoaded&&!t.content))if(t.layers)r&&t.layers[0]&&Object.keys(r).some(n=>t.layers[0].props[n]!==r[n])&&(t.layers=t.layers.map(n=>n.clone(r)));else{let n=this.renderSubLayers({...this.props,...this.getSubLayerProps({id:t.id,updateTriggers:this.props.updateTriggers}),data:t.content,_offset:0,tile:t});t.layers=(0,Ds._flatten)(n,Boolean).map(s=>s.clone({tile:t,...r}))}return t.layers})}filterSubLayer({layer:t,cullRect:r}){let{tile:n}=t.props;return this.state.tileset.isTileVisible(n,r)}},Zt=Ns;(()=>{Ns.defaultProps=Jy})(),(()=>{Ns.layerName="TileLayer"})();var Eh=N(Nt(),1),qy={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:e=>e.timestamps}},vs=class extends Eh.PathLayer{getShaders(){let t=super.getShaders();return t.inject={"vs:#decl":`uniform float trailLength;
|
|
14
14
|
in float instanceTimestamps;
|
|
15
15
|
in float instanceNextTimestamps;
|
|
16
16
|
out float vTime;
|