@deck.gl/geo-layers 8.10.0-alpha.6 → 9.0.0-alpha.3

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.
Files changed (120) hide show
  1. package/dist/dist.dev.js +7621 -22014
  2. package/dist/es5/geo-cell-layer/GeoCellLayer.js.map +1 -1
  3. package/dist/es5/geohash-layer/geohash-layer.js.map +1 -1
  4. package/dist/es5/great-circle-layer/great-circle-layer.js.map +1 -1
  5. package/dist/es5/h3-layers/h3-cluster-layer.js +10 -1
  6. package/dist/es5/h3-layers/h3-cluster-layer.js.map +1 -1
  7. package/dist/es5/h3-layers/h3-hexagon-layer.js.map +1 -1
  8. package/dist/es5/index.js +0 -8
  9. package/dist/es5/index.js.map +1 -1
  10. package/{src/mesh-layer/mesh-layer.ts → dist/es5/mesh-layer/mesh-layer.ts.disabled} +8 -7
  11. package/dist/es5/mvt-layer/find-index-binary.js.map +1 -1
  12. package/dist/es5/mvt-layer/mvt-layer.js +15 -6
  13. package/dist/es5/mvt-layer/mvt-layer.js.map +1 -1
  14. package/dist/es5/quadkey-layer/quadkey-layer.js.map +1 -1
  15. package/dist/es5/s2-layer/s2-layer.js.map +1 -1
  16. package/dist/es5/terrain-layer/terrain-layer.js.map +1 -1
  17. package/{src/tile-3d-layer/tile-3d-layer.ts → dist/es5/tile-3d-layer/tile-3d-layer.ts.disabled} +9 -9
  18. package/dist/es5/tile-layer/tile-layer.js +19 -9
  19. package/dist/es5/tile-layer/tile-layer.js.map +1 -1
  20. package/dist/es5/tileset-2d/tile-2d-traversal.js.map +1 -1
  21. package/dist/es5/tileset-2d/tileset-2d.js +1 -1
  22. package/dist/es5/tileset-2d/tileset-2d.js.map +1 -1
  23. package/dist/es5/tileset-2d/utils.js +2 -3
  24. package/dist/es5/tileset-2d/utils.js.map +1 -1
  25. package/dist/es5/trips-layer/trips-layer.js.map +1 -1
  26. package/dist/es5/wms-layer/wms-layer.js +6 -8
  27. package/dist/es5/wms-layer/wms-layer.js.map +1 -1
  28. package/dist/esm/geo-cell-layer/GeoCellLayer.js.map +1 -1
  29. package/dist/esm/geohash-layer/geohash-layer.js.map +1 -1
  30. package/dist/esm/great-circle-layer/great-circle-layer.js.map +1 -1
  31. package/dist/esm/h3-layers/h3-cluster-layer.js +5 -0
  32. package/dist/esm/h3-layers/h3-cluster-layer.js.map +1 -1
  33. package/dist/esm/h3-layers/h3-hexagon-layer.js.map +1 -1
  34. package/dist/esm/index.js +0 -1
  35. package/dist/esm/index.js.map +1 -1
  36. package/dist/esm/mesh-layer/mesh-layer.ts.disabled +176 -0
  37. package/dist/esm/mvt-layer/find-index-binary.js.map +1 -1
  38. package/dist/esm/mvt-layer/mvt-layer.js +6 -1
  39. package/dist/esm/mvt-layer/mvt-layer.js.map +1 -1
  40. package/dist/esm/quadkey-layer/quadkey-layer.js.map +1 -1
  41. package/dist/esm/s2-layer/s2-layer.js.map +1 -1
  42. package/dist/esm/terrain-layer/terrain-layer.js.map +1 -1
  43. package/dist/esm/tile-3d-layer/tile-3d-layer.ts.disabled +436 -0
  44. package/dist/esm/tile-layer/tile-layer.js +10 -6
  45. package/dist/esm/tile-layer/tile-layer.js.map +1 -1
  46. package/dist/esm/tileset-2d/tile-2d-traversal.js.map +1 -1
  47. package/dist/esm/tileset-2d/tileset-2d.js +1 -1
  48. package/dist/esm/tileset-2d/tileset-2d.js.map +1 -1
  49. package/dist/esm/tileset-2d/utils.js +2 -2
  50. package/dist/esm/tileset-2d/utils.js.map +1 -1
  51. package/dist/esm/trips-layer/trips-layer.js.map +1 -1
  52. package/dist/esm/wms-layer/wms-layer.js +5 -5
  53. package/dist/esm/wms-layer/wms-layer.js.map +1 -1
  54. package/dist.min.js +29 -227
  55. package/package.json +17 -17
  56. package/src/geo-cell-layer/GeoCellLayer.ts +1 -1
  57. package/src/geohash-layer/geohash-layer.ts +2 -2
  58. package/src/great-circle-layer/great-circle-layer.ts +1 -1
  59. package/src/h3-layers/h3-cluster-layer.ts +6 -2
  60. package/src/h3-layers/h3-hexagon-layer.ts +2 -2
  61. package/src/index.ts +4 -2
  62. package/src/mesh-layer/mesh-layer.ts.disabled +176 -0
  63. package/src/mvt-layer/find-index-binary.ts +6 -6
  64. package/src/mvt-layer/mvt-layer.ts +19 -9
  65. package/src/quadkey-layer/quadkey-layer.ts +3 -2
  66. package/src/s2-layer/s2-layer.ts +2 -2
  67. package/src/terrain-layer/terrain-layer.ts +2 -2
  68. package/src/tile-3d-layer/tile-3d-layer.ts.disabled +436 -0
  69. package/src/tile-layer/tile-layer.ts +20 -10
  70. package/src/tileset-2d/tile-2d-traversal.ts +1 -1
  71. package/src/tileset-2d/tileset-2d.ts +6 -7
  72. package/src/tileset-2d/utils.ts +4 -4
  73. package/src/trips-layer/trips-layer.ts +3 -3
  74. package/src/wms-layer/wms-layer.ts +11 -7
  75. package/typed/geo-cell-layer/GeoCellLayer.d.ts +1 -1
  76. package/typed/geo-cell-layer/GeoCellLayer.d.ts.map +1 -1
  77. package/typed/geohash-layer/geohash-layer.d.ts +2 -2
  78. package/typed/geohash-layer/geohash-layer.d.ts.map +1 -1
  79. package/typed/great-circle-layer/great-circle-layer.d.ts +2 -2
  80. package/typed/great-circle-layer/great-circle-layer.d.ts.map +1 -1
  81. package/typed/h3-layers/h3-cluster-layer.d.ts +7 -2
  82. package/typed/h3-layers/h3-cluster-layer.d.ts.map +1 -1
  83. package/typed/h3-layers/h3-hexagon-layer.d.ts +2 -2
  84. package/typed/h3-layers/h3-hexagon-layer.d.ts.map +1 -1
  85. package/typed/index.d.ts +0 -2
  86. package/typed/index.d.ts.map +1 -1
  87. package/typed/mvt-layer/find-index-binary.d.ts +2 -2
  88. package/typed/mvt-layer/find-index-binary.d.ts.map +1 -1
  89. package/typed/mvt-layer/mvt-layer.d.ts +11 -3
  90. package/typed/mvt-layer/mvt-layer.d.ts.map +1 -1
  91. package/typed/quadkey-layer/quadkey-layer.d.ts +2 -2
  92. package/typed/quadkey-layer/quadkey-layer.d.ts.map +1 -1
  93. package/typed/s2-layer/s2-layer.d.ts +2 -2
  94. package/typed/s2-layer/s2-layer.d.ts.map +1 -1
  95. package/typed/terrain-layer/terrain-layer.d.ts +2 -2
  96. package/typed/terrain-layer/terrain-layer.d.ts.map +1 -1
  97. package/typed/tile-layer/tile-layer.d.ts +7 -2
  98. package/typed/tile-layer/tile-layer.d.ts.map +1 -1
  99. package/typed/tileset-2d/tile-2d-traversal.d.ts +1 -1
  100. package/typed/tileset-2d/tile-2d-traversal.d.ts.map +1 -1
  101. package/typed/tileset-2d/tileset-2d.d.ts +4 -4
  102. package/typed/tileset-2d/tileset-2d.d.ts.map +1 -1
  103. package/typed/tileset-2d/utils.d.ts +2 -2
  104. package/typed/tileset-2d/utils.d.ts.map +1 -1
  105. package/typed/trips-layer/trips-layer.d.ts +3 -3
  106. package/typed/trips-layer/trips-layer.d.ts.map +1 -1
  107. package/typed/wms-layer/wms-layer.d.ts +2 -1
  108. package/typed/wms-layer/wms-layer.d.ts.map +1 -1
  109. package/dist/es5/mesh-layer/mesh-layer.js +0 -212
  110. package/dist/es5/mesh-layer/mesh-layer.js.map +0 -1
  111. package/dist/es5/tile-3d-layer/tile-3d-layer.js +0 -512
  112. package/dist/es5/tile-3d-layer/tile-3d-layer.js.map +0 -1
  113. package/dist/esm/mesh-layer/mesh-layer.js +0 -177
  114. package/dist/esm/mesh-layer/mesh-layer.js.map +0 -1
  115. package/dist/esm/tile-3d-layer/tile-3d-layer.js +0 -443
  116. package/dist/esm/tile-3d-layer/tile-3d-layer.js.map +0 -1
  117. package/typed/mesh-layer/mesh-layer.d.ts +0 -38
  118. package/typed/mesh-layer/mesh-layer.d.ts.map +0 -1
  119. package/typed/tile-3d-layer/tile-3d-layer.d.ts +0 -62
  120. package/typed/tile-3d-layer/tile-3d-layer.d.ts.map +0 -1
package/dist.min.js CHANGED
@@ -4,42 +4,23 @@
4
4
  else if (typeof define === 'function' && define.amd) define([], factory);
5
5
  else if (typeof exports === 'object') exports['deck'] = factory();
6
6
  else root['deck'] = factory();})(globalThis, function () {
7
- "use strict";var __exports__=(()=>{var VE=Object.create;var Ia=Object.defineProperty;var zE=Object.getOwnPropertyDescriptor;var WE=Object.getOwnPropertyNames;var JE=Object.getPrototypeOf,XE=Object.prototype.hasOwnProperty;var qm=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),lt=(e,t)=>{for(var r in t)Ia(e,r,{get:t[r],enumerable:!0})},Ma=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of WE(t))!XE.call(e,i)&&i!==r&&Ia(e,i,{get:()=>t[i],enumerable:!(n=zE(t,i))||n.enumerable});return e},sr=(e,t,r)=>(Ma(e,t,"default"),r&&Ma(r,t,"default")),q=(e,t,r)=>(r=e!=null?VE(JE(e)):{},Ma(t||!e||!e.__esModule?Ia(r,"default",{value:e,enumerable:!0}):r,e)),qE=e=>Ma(Ia({},"__esModule",{value:!0}),e);var ht=be((MV,Km)=>{Km.exports=globalThis.deck});var dt=be((RV,$m)=>{$m.exports=globalThis.deck});var Ra=be(Ht=>{"use strict";var Zm=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",KE=Zm+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Qm="["+Zm+"]["+KE+"]*",YE=new RegExp("^"+Qm+"$"),$E=function(t,r){for(var n=[],i=r.exec(t);i;){var a=[];a.startIndex=r.lastIndex-i[0].length;for(var o=i.length,s=0;s<o;s++)a.push(i[s]);n.push(a),i=r.exec(t)}return n},ZE=function(t){var r=YE.exec(t);return!(r===null||typeof r>"u")};Ht.isExist=function(e){return typeof e<"u"};Ht.isEmptyObject=function(e){return Object.keys(e).length===0};Ht.merge=function(e,t,r){if(t)for(var n=Object.keys(t),i=n.length,a=0;a<i;a++)r==="strict"?e[n[a]]=[t[n[a]]]:e[n[a]]=t[n[a]]};Ht.getValue=function(e){return Ht.isExist(e)?e:""};Ht.isName=ZE;Ht.getAllMatches=$E;Ht.nameRegexp=Qm});var ec=be(iv=>{"use strict";var Qf=Ra(),QE={allowBooleanAttributes:!1,unpairedTags:[]};iv.validate=function(e,t){t=Object.assign({},QE,t);var r=[],n=!1,i=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(var a=0;a<e.length;a++)if(e[a]==="<"&&e[a+1]==="?"){if(a+=2,a=tv(e,a),a.err)return a}else if(e[a]==="<"){var o=a;if(a++,e[a]==="!"){a=rv(e,a);continue}else{var s=!1;e[a]==="/"&&(s=!0,a++);for(var u="";a<e.length&&e[a]!==">"&&e[a]!==" "&&e[a]!==" "&&e[a]!==`
8
- `&&e[a]!=="\r";a++)u+=e[a];if(u=u.trim(),u[u.length-1]==="/"&&(u=u.substring(0,u.length-1),a--),!sO(u)){var f=void 0;return u.trim().length===0?f="Invalid space after '<'.":f="Tag '"+u+"' is an invalid name.",Ee("InvalidTag",f,He(e,a))}var c=rO(e,a);if(c===!1)return Ee("InvalidAttr","Attributes for '"+u+"' have open quote.",He(e,a));var l=c.value;if(a=c.index,l[l.length-1]==="/"){var d=a-l.length;l=l.substring(0,l.length-1);var h=nv(l,t);if(h===!0)n=!0;else return Ee(h.err.code,h.err.msg,He(e,d+h.err.line))}else if(s)if(c.tagClosed){if(l.trim().length>0)return Ee("InvalidTag","Closing tag '"+u+"' can't have attributes or invalid starting.",He(e,o));var p=r.pop();if(u!==p.tagName){var m=He(e,p.tagStartPos);return Ee("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+m.line+", col "+m.col+") instead of closing tag '"+u+"'.",He(e,o))}r.length==0&&(i=!0)}else return Ee("InvalidTag","Closing tag '"+u+"' doesn't have proper closing.",He(e,a));else{var g=nv(l,t);if(g!==!0)return Ee(g.err.code,g.err.msg,He(e,a-l.length+g.err.line));if(i===!0)return Ee("InvalidXml","Multiple possible root nodes found.",He(e,a));t.unpairedTags.indexOf(u)!==-1||r.push({tagName:u,tagStartPos:o}),n=!0}for(a++;a<e.length;a++)if(e[a]==="<")if(e[a+1]==="!"){a++,a=rv(e,a);continue}else if(e[a+1]==="?"){if(a=tv(e,++a),a.err)return a}else break;else if(e[a]==="&"){var y=aO(e,a);if(y==-1)return Ee("InvalidChar","char '&' is not expected.",He(e,a));a=y}else if(i===!0&&!ev(e[a]))return Ee("InvalidXml","Extra text at the end",He(e,a));e[a]==="<"&&a--}}else{if(ev(e[a]))continue;return Ee("InvalidChar","char '"+e[a]+"' is not expected.",He(e,a))}if(n){if(r.length==1)return Ee("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",He(e,r[0].tagStartPos));if(r.length>0)return Ee("InvalidXml","Invalid '"+JSON.stringify(r.map(function(b){return b.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Ee("InvalidXml","Start tag expected.",1);return!0};function ev(e){return e===" "||e===" "||e===`
9
- `||e==="\r"}function tv(e,t){for(var r=t;t<e.length;t++)if(e[t]=="?"||e[t]==" "){var n=e.substr(r,t-r);if(t>5&&n==="xml")return Ee("InvalidXml","XML declaration allowed only at the start of the document.",He(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function rv(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){var r=1;for(t+=8;t<e.length;t++)if(e[t]==="<")r++;else if(e[t]===">"&&(r--,r===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}var eO='"',tO="'";function rO(e,t){for(var r="",n="",i=!1;t<e.length;t++){if(e[t]===eO||e[t]===tO)n===""?n=e[t]:n!==e[t]||(n="");else if(e[t]===">"&&n===""){i=!0;break}r+=e[t]}return n!==""?!1:{value:r,index:t,tagClosed:i}}var nO=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function nv(e,t){for(var r=Qf.getAllMatches(e,nO),n={},i=0;i<r.length;i++){if(r[i][1].length===0)return Ee("InvalidAttr","Attribute '"+r[i][2]+"' has no space in starting.",Ti(r[i]));if(r[i][3]!==void 0&&r[i][4]===void 0)return Ee("InvalidAttr","Attribute '"+r[i][2]+"' is without value.",Ti(r[i]));if(r[i][3]===void 0&&!t.allowBooleanAttributes)return Ee("InvalidAttr","boolean attribute '"+r[i][2]+"' is not allowed.",Ti(r[i]));var a=r[i][2];if(!oO(a))return Ee("InvalidAttr","Attribute '"+a+"' is an invalid name.",Ti(r[i]));if(!n.hasOwnProperty(a))n[a]=1;else return Ee("InvalidAttr","Attribute '"+a+"' is repeated.",Ti(r[i]))}return!0}function iO(e,t){var r=/\d/;for(e[t]==="x"&&(t++,r=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(r))break}return-1}function aO(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,iO(e,t);for(var r=0;t<e.length;t++,r++)if(!(e[t].match(/\w/)&&r<20)){if(e[t]===";")break;return-1}return t}function Ee(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}function oO(e){return Qf.isName(e)}function sO(e){return Qf.isName(e)}function He(e,t){var r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function Ti(e){return e.startIndex+e[1].length}});var ov=be(tc=>{var av={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,r){return r},attributeValueProcessor:function(t,r){return r},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,r,n){return t}},uO=function(t){return Object.assign({},av,t)};tc.buildOptions=uO;tc.defaultOptions=av});var uv=be((NV,sv)=>{"use strict";function Fa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var cO=function(){function e(r){fO(this,e),this.tagname=r,this.child=[],this[":@"]={}}var t=e.prototype;return t.add=function(n,i){n==="__proto__"&&(n="#__proto__"),this.child.push(Fa({},n,i))},t.addChild=function(n){if(n.tagname==="__proto__"&&(n.tagname="#__proto__"),n[":@"]&&Object.keys(n[":@"]).length>0){var i;this.child.push((i={},Fa(i,n.tagname,n.child),Fa(i,":@",n[":@"]),i))}else this.child.push(Fa({},n.tagname,n.child))},e}();sv.exports=cO});var lv=be((UV,cv)=>{function lO(e,t){return mO(e)||pO(e,t)||dO(e,t)||hO()}function hO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dO(e,t){if(e){if(typeof e=="string")return fv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fv(e,t)}}function fv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pO(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function mO(e){if(Array.isArray(e))return e}var vO=Ra();function gO(e,t){var r={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;for(var n=1,i=!1,a=!1,o="";t<e.length;t++)if(e[t]==="<"&&!a){if(i&&_O(e,t)){t+=7;var s=yO(e,t+1),u=lO(s,3);entityName=u[0],val=u[1],t=u[2],val.indexOf("&")===-1&&(r[wO(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val})}else if(i&&AO(e,t))t+=8;else if(i&&TO(e,t))t+=8;else if(i&&SO(e,t))t+=9;else if(bO)a=!0;else throw new Error("Invalid DOCTYPE");n++,o=""}else if(e[t]===">"){if(a?e[t-1]==="-"&&e[t-2]==="-"&&(a=!1,n--):n--,n===0)break}else e[t]==="["?i=!0:o+=e[t];if(n!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:t}}function yO(e,t){for(var r="";t<e.length&&e[t]!=="'"&&e[t]!=='"';t++)r+=e[t];if(r=r.trim(),r.indexOf(" ")!==-1)throw new Error("External entites are not supported");for(var n=e[t++],i="";t<e.length&&e[t]!==n;t++)i+=e[t];return[r,i,t]}function bO(e,t){return e[t+1]==="!"&&e[t+2]==="-"&&e[t+3]==="-"}function _O(e,t){return e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="N"&&e[t+4]==="T"&&e[t+5]==="I"&&e[t+6]==="T"&&e[t+7]==="Y"}function AO(e,t){return e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="L"&&e[t+4]==="E"&&e[t+5]==="M"&&e[t+6]==="E"&&e[t+7]==="N"&&e[t+8]==="T"}function TO(e,t){return e[t+1]==="!"&&e[t+2]==="A"&&e[t+3]==="T"&&e[t+4]==="T"&&e[t+5]==="L"&&e[t+6]==="I"&&e[t+7]==="S"&&e[t+8]==="T"}function SO(e,t){return e[t+1]==="!"&&e[t+2]==="N"&&e[t+3]==="O"&&e[t+4]==="T"&&e[t+5]==="A"&&e[t+6]==="T"&&e[t+7]==="I"&&e[t+8]==="O"&&e[t+9]==="N"}function wO(e){if(vO.isName(e))return e;throw new Error("Invalid entity name ".concat(e))}cv.exports=gO});var dv=be((jV,hv)=>{var xO=/^[-+]?0x[a-fA-F0-9]+$/,EO=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt);!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var OO={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function PO(e,t={}){if(t=Object.assign({},OO,t),!e||typeof e!="string")return e;let r=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(r))return e;if(t.hex&&xO.test(r))return Number.parseInt(r,16);{let n=EO.exec(r);if(n){let i=n[1],a=n[2],o=BO(n[3]),s=n[4]||n[6];if(!t.leadingZeros&&a.length>0&&i&&r[2]!==".")return e;if(!t.leadingZeros&&a.length>0&&!i&&r[1]!==".")return e;{let u=Number(r),f=""+u;return f.search(/[eE]/)!==-1||s?t.eNotation?u:e:r.indexOf(".")!==-1?f==="0"&&o===""||f===o||i&&f==="-"+o?u:e:a?o===f||i+o===f?u:e:r===f||r===i+f?u:e}}else return e}}function BO(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substr(0,e.length-1))),e}hv.exports=PO});var vv=be((HV,mv)=>{"use strict";function pv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?jr=function(r){return typeof r}:jr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},jr(e)}function CO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ic=Ra(),Si=uv(),MO=lv(),IO=dv(),kV="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,ic.nameRegexp),RO=function e(t){CO(this,e),this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"}},this.addExternalEntities=FO,this.parseXml=UO,this.parseTextData=LO,this.resolveNameSpace=DO,this.buildAttributesMap=NO,this.isItStopNode=VO,this.replaceEntitiesValue=kO,this.readStopNodeData=WO,this.saveTextToParentTag=HO,this.addChild=jO};function FO(e){for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:e[n]}}}function LO(e,t,r,n,i,a,o){if(e!==void 0&&(this.options.trimValues&&!n&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));var s=this.options.tagValueProcessor(t,e,r,i,a);if(s==null)return e;if(jr(s)!==jr(e)||s!==e)return s;if(this.options.trimValues)return nc(e,this.options.parseTagValue,this.options.numberParseOptions);var u=e.trim();return u===e?nc(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function DO(e){if(this.options.removeNSPrefix){var t=e.split(":"),r=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=r+t[1])}return e}var GO=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function NO(e,t,r){if(!this.options.ignoreAttributes&&typeof e=="string"){for(var n=ic.getAllMatches(e,GO),i=n.length,a={},o=0;o<i;o++){var s=this.resolveNameSpace(n[o][1]),u=n[o][4],f=this.options.attributeNamePrefix+s;if(s.length)if(this.options.transformAttributeName&&(f=this.options.transformAttributeName(f)),f==="__proto__"&&(f="#__proto__"),u!==void 0){this.options.trimValues&&(u=u.trim()),u=this.replaceEntitiesValue(u);var c=this.options.attributeValueProcessor(s,u,t);c==null?a[f]=u:jr(c)!==jr(u)||c!==u?a[f]=c:a[f]=nc(u,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(a[f]=!0)}if(!Object.keys(a).length)return;if(this.options.attributesGroupName){var l={};return l[this.options.attributesGroupName]=a,l}return a}}var UO=function(t){t=t.replace(/\r\n?/g,`
11
- `);for(var r=new Si("!xml"),n=r,i="",a="",o=0;o<t.length;o++){var s=t[o];if(s==="<")if(t[o+1]==="/"){var u=Ur(t,">",o,"Closing Tag is not closed."),f=t.substring(o+2,u).trim();if(this.options.removeNSPrefix){var c=f.indexOf(":");c!==-1&&(f=f.substr(c+1))}this.options.transformTagName&&(f=this.options.transformTagName(f)),n&&(i=this.saveTextToParentTag(i,n,a));var l=a.substring(a.lastIndexOf(".")+1);if(f&&this.options.unpairedTags.indexOf(f)!==-1)throw new Error("Unpaired tag can not be used as closing tag: </".concat(f,">"));var d=0;l&&this.options.unpairedTags.indexOf(l)!==-1?(d=a.lastIndexOf(".",a.lastIndexOf(".")-1),this.tagsNodeStack.pop()):d=a.lastIndexOf("."),a=a.substring(0,d),n=this.tagsNodeStack.pop(),i="",o=u}else if(t[o+1]==="?"){var h=rc(t,o,!1,"?>");if(!h)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,a),!(this.options.ignoreDeclaration&&h.tagName==="?xml"||this.options.ignorePiTags)){var p=new Si(h.tagName);p.add(this.options.textNodeName,""),h.tagName!==h.tagExp&&h.attrExpPresent&&(p[":@"]=this.buildAttributesMap(h.tagExp,a,h.tagName)),this.addChild(n,p,a)}o=h.closeIndex+1}else if(t.substr(o+1,3)==="!--"){var m=Ur(t,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){var g=t.substring(o+4,m-2);i=this.saveTextToParentTag(i,n,a),n.add(this.options.commentPropName,[pv({},this.options.textNodeName,g)])}o=m}else if(t.substr(o+1,2)==="!D"){var y=MO(t,o);this.docTypeEntities=y.entities,o=y.i}else if(t.substr(o+1,2)==="!["){var b=Ur(t,"]]>",o,"CDATA is not closed.")-2,A=t.substring(o+9,b);if(i=this.saveTextToParentTag(i,n,a),this.options.cdataPropName)n.add(this.options.cdataPropName,[pv({},this.options.textNodeName,A)]);else{var S=this.parseTextData(A,n.tagname,a,!0,!1,!0);S==null&&(S=""),n.add(this.options.textNodeName,S)}o=b+2}else{var O=rc(t,o,this.options.removeNSPrefix),w=O.tagName,B=O.tagExp,P=O.attrExpPresent,x=O.closeIndex;this.options.transformTagName&&(w=this.options.transformTagName(w)),n&&i&&n.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,n,a,!1));var _=n;if(_&&this.options.unpairedTags.indexOf(_.tagname)!==-1&&(n=this.tagsNodeStack.pop(),a=a.substring(0,a.lastIndexOf("."))),w!==r.tagname&&(a+=a?"."+w:w),this.isItStopNode(this.options.stopNodes,a,w)){var C="";if(B.length>0&&B.lastIndexOf("/")===B.length-1)o=O.closeIndex;else if(this.options.unpairedTags.indexOf(w)!==-1)o=O.closeIndex;else{var I=this.readStopNodeData(t,w,x+1);if(!I)throw new Error("Unexpected end of ".concat(w));o=I.i,C=I.tagContent}var R=new Si(w);w!==B&&P&&(R[":@"]=this.buildAttributesMap(B,a,w)),C&&(C=this.parseTextData(C,w,a,!0,P,!0,!0)),a=a.substr(0,a.lastIndexOf(".")),R.add(this.options.textNodeName,C),this.addChild(n,R,a)}else{if(B.length>0&&B.lastIndexOf("/")===B.length-1){w[w.length-1]==="/"?(w=w.substr(0,w.length-1),a=a.substr(0,a.length-1),B=w):B=B.substr(0,B.length-1),this.options.transformTagName&&(w=this.options.transformTagName(w));var M=new Si(w);w!==B&&P&&(M[":@"]=this.buildAttributesMap(B,a,w)),this.addChild(n,M,a),a=a.substr(0,a.lastIndexOf("."))}else{var D=new Si(w);this.tagsNodeStack.push(n),w!==B&&P&&(D[":@"]=this.buildAttributesMap(B,a,w)),this.addChild(n,D,a),n=D}i="",o=x}}else i+=t[o]}return r.child};function jO(e,t,r){var n=this.options.updateTag(t.tagname,r,t[":@"]);n===!1||(typeof n=="string"&&(t.tagname=n),e.addChild(t))}var kO=function(t){if(this.options.processEntities){for(var r in this.docTypeEntities){var n=this.docTypeEntities[r];t=t.replace(n.regx,n.val)}for(var i in this.lastEntities){var a=this.lastEntities[i];t=t.replace(a.regex,a.val)}if(this.options.htmlEntities)for(var o in this.htmlEntities){var s=this.htmlEntities[o];t=t.replace(s.regex,s.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function HO(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 VO(e,t,r){var n="*."+r;for(var i in e){var a=e[i];if(n===a||t===a)return!0}return!1}function zO(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",n,i="",a=t;a<e.length;a++){var o=e[a];if(n)o===n&&(n="");else if(o==='"'||o==="'")n=o;else if(o===r[0])if(r[1]){if(e[a+1]===r[1])return{data:i,index:a}}else return{data:i,index:a};else o===" "&&(o=" ");i+=o}}function Ur(e,t,r,n){var i=e.indexOf(t,r);if(i===-1)throw new Error(n);return i+t.length-1}function rc(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:">",i=zO(e,t+1,n);if(i){var a=i.data,o=i.index,s=a.search(/\s/),u=a,f=!0;if(s!==-1&&(u=a.substr(0,s).replace(/\s\s*$/,""),a=a.substr(s+1)),r){var c=u.indexOf(":");c!==-1&&(u=u.substr(c+1),f=u!==i.data.substr(c+1))}return{tagName:u,tagExp:a,closeIndex:o,attrExpPresent:f}}}function WO(e,t,r){for(var n=r,i=1;r<e.length;r++)if(e[r]==="<")if(e[r+1]==="/"){var a=Ur(e,">",r,"".concat(t," is not closed")),o=e.substring(r+2,a).trim();if(o===t&&(i--,i===0))return{tagContent:e.substring(n,r),i:a};r=a}else if(e[r+1]==="?"){var s=Ur(e,"?>",r+1,"StopNode is not closed.");r=s}else if(e.substr(r+1,3)==="!--"){var u=Ur(e,"-->",r+3,"StopNode is not closed.");r=u}else if(e.substr(r+1,2)==="!["){var f=Ur(e,"]]>",r,"StopNode is not closed.")-2;r=f}else{var c=rc(e,r,">");if(c){var l=c&&c.tagName;l===t&&c.tagExp[c.tagExp.length-1]!=="/"&&i++,r=c.closeIndex}}}function nc(e,t,r){if(t&&typeof e=="string"){var n=e.trim();return n==="true"?!0:n==="false"?!1:IO(e,r)}else return ic.isExist(e)?e:""}mv.exports=RO});var bv=be(yv=>{"use strict";function JO(e,t){return gv(e,t)}function gv(e,t,r){for(var n,i={},a=0;a<e.length;a++){var o=e[a],s=XO(o),u="";if(r===void 0?u=s:u=r+"."+s,s===t.textNodeName)n===void 0?n=o[s]:n+=""+o[s];else{if(s===void 0)continue;if(o[s]){var f=gv(o[s],t,u),c=KO(f,t);o[":@"]?qO(f,o[":@"],u,t):Object.keys(f).length===1&&f[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?f=f[t.textNodeName]:Object.keys(f).length===0&&(t.alwaysCreateTextNode?f[t.textNodeName]="":f=""),i[s]!==void 0&&i.hasOwnProperty(s)?(Array.isArray(i[s])||(i[s]=[i[s]]),i[s].push(f)):t.isArray(s,u,c)?i[s]=[f]:i[s]=f}}}return typeof n=="string"?n.length>0&&(i[t.textNodeName]=n):n!==void 0&&(i[t.textNodeName]=n),i}function XO(e){for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];if(n!==":@")return n}}function qO(e,t,r,n){if(t)for(var i=Object.keys(t),a=i.length,o=0;o<a;o++){var s=i[o];n.isArray(s,r+"."+s,!0,!0)?e[s]=[t[s]]:e[s]=t[s]}}function KO(e,t){var r=t.textNodeName,n=Object.keys(e).length;return!!(n===0||n===1&&(e[r]||typeof e[r]=="boolean"||e[r]===0))}yv.prettify=JO});var Av=be((zV,_v)=>{function YO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var $O=ov(),ZO=$O.buildOptions,QO=vv(),e2=bv(),t2=e2.prettify,r2=ec(),n2=function(){function e(r){YO(this,e),this.externalEntities={},this.options=ZO(r)}var t=e.prototype;return t.parse=function(n,i){if(typeof n!="string")if(n.toString)n=n.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(i){i===!0&&(i={});var a=r2.validate(n,i);if(a!==!0)throw Error("".concat(a.err.msg,":").concat(a.err.line,":").concat(a.err.col))}var o=new QO(this.options);o.addExternalEntities(this.externalEntities);var s=o.parseXml(n);return this.options.preserveOrder||s===void 0?s:t2(s,this.options)},t.addEntity=function(n,i){if(i.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(n.indexOf("&")!==-1||n.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(i==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[n]=i},e}();_v.exports=n2});var Ev=be((WV,xv)=>{var i2=`
12
- `;function a2(e,t){var r="";return t.format&&t.indentBy.length>0&&(r=i2),Sv(e,t,"",r)}function Sv(e,t,r,n){for(var i="",a=!1,o=0;o<e.length;o++){var s=e[o],u=o2(s),f="";if(r.length===0?f=u:f="".concat(r,".").concat(u),u===t.textNodeName){var c=s[u];s2(f,t)||(c=t.tagValueProcessor(u,c),c=wv(c,t)),a&&(i+=n),i+=c,a=!1;continue}else if(u===t.cdataPropName){a&&(i+=n),i+="<![CDATA[".concat(s[u][0][t.textNodeName],"]]>"),a=!1;continue}else if(u===t.commentPropName){i+=n+"<!--".concat(s[u][0][t.textNodeName],"-->"),a=!0;continue}else if(u[0]==="?"){var l=Tv(s[":@"],t),d=u==="?xml"?"":n,h=s[u][0][t.textNodeName];h=h.length!==0?" "+h:"",i+=d+"<".concat(u).concat(h).concat(l,"?>"),a=!0;continue}var p=n;p!==""&&(p+=t.indentBy);var m=Tv(s[":@"],t),g=n+"<".concat(u).concat(m),y=Sv(s[u],t,f,p);t.unpairedTags.indexOf(u)!==-1?t.suppressUnpairedNode?i+=g+">":i+=g+"/>":(!y||y.length===0)&&t.suppressEmptyNode?i+=g+"/>":y&&y.endsWith(">")?i+=g+">".concat(y).concat(n,"</").concat(u,">"):(i+=g+">",y&&n!==""&&(y.includes("/>")||y.includes("</"))?i+=n+t.indentBy+y+n:i+=y,i+="</".concat(u,">")),a=!0}return i}function o2(e){for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];if(n!==":@")return n}}function Tv(e,t){var r="";if(e&&!t.ignoreAttributes)for(var n in e){var i=t.attributeValueProcessor(n,e[n]);i=wv(i,t),i===!0&&t.suppressBooleanAttributes?r+=" ".concat(n.substr(t.attributeNamePrefix.length)):r+=" ".concat(n.substr(t.attributeNamePrefix.length),'="').concat(i,'"')}return r}function s2(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);var r=e.substr(e.lastIndexOf(".")+1);for(var n in t.stopNodes)if(t.stopNodes[n]===e||t.stopNodes[n]==="*."+r)return!0;return!1}function wv(e,t){if(e&&e.length>0&&t.processEntities)for(var r=0;r<t.entities.length;r++){var n=t.entities[r];e=e.replace(n.regex,n.val)}return e}xv.exports=a2});var Pv=be((JV,Ov)=>{"use strict";function wi(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wi=function(r){return typeof r}:wi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},wi(e)}function u2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var f2=Ev(),c2={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,r){return r},attributeValueProcessor:function(t,r){return r},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ur(e){this.options=Object.assign({},c2,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=d2),this.processTextOrObjNode=l2,this.options.format?(this.indentate=h2,this.tagEndChar=`>
7
+ "use strict";var __exports__=(()=>{var xu=Object.create;var sr=Object.defineProperty;var _u=Object.getOwnPropertyDescriptor;var bu=Object.getOwnPropertyNames;var wu=Object.getPrototypeOf,Mu=Object.prototype.hasOwnProperty;var jo=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var Y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),kn=(t,e)=>{for(var r in e)sr(t,r,{get:e[r],enumerable:!0})},or=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of bu(e))!Mu.call(t,i)&&i!==r&&sr(t,i,{get:()=>e[i],enumerable:!(n=_u(e,i))||n.enumerable});return t},Et=(t,e,r)=>(or(t,e,"default"),r&&or(r,e,"default")),B=(t,e,r)=>(r=t!=null?xu(wu(t)):{},or(e||!t||!t.__esModule?sr(r,"default",{value:t,enumerable:!0}):r,t)),Su=t=>or(sr({},"__esModule",{value:!0}),t);var ct=Y((gv,Vo)=>{Vo.exports=globalThis.deck});var ut=Y((vv,Do)=>{Do.exports=globalThis.deck});var cr=Y(_t=>{"use strict";var Go=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Pu=Go+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Zo="["+Go+"]["+Pu+"]*",Eu=new RegExp("^"+Zo+"$"),Ou=function(e,r){for(var n=[],i=r.exec(e);i;){var o=[];o.startIndex=r.lastIndex-i[0].length;for(var s=i.length,a=0;a<s;a++)o.push(i[a]);n.push(o),i=r.exec(e)}return n},Iu=function(e){var r=Eu.exec(e);return!(r===null||typeof r>"u")};_t.isExist=function(t){return typeof t<"u"};_t.isEmptyObject=function(t){return Object.keys(t).length===0};_t.merge=function(t,e,r){if(e)for(var n=Object.keys(e),i=n.length,o=0;o<i;o++)r==="strict"?t[n[o]]=[e[n[o]]]:t[n[o]]=e[n[o]]};_t.getValue=function(t){return _t.isExist(t)?t:""};_t.isName=Iu;_t.getAllMatches=Ou;_t.nameRegexp=Zo});var Un=Y(Qo=>{"use strict";var qn=cr(),Au={allowBooleanAttributes:!1,unpairedTags:[]};Qo.validate=function(t,e){e=Object.assign({},Au,e);var r=[],n=!1,i=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(var o=0;o<t.length;o++)if(t[o]==="<"&&t[o+1]==="?"){if(o+=2,o=Yo(t,o),o.err)return o}else if(t[o]==="<"){var s=o;if(o++,t[o]==="!"){o=Ho(t,o);continue}else{var a=!1;t[o]==="/"&&(a=!0,o++);for(var c="";o<t.length&&t[o]!==">"&&t[o]!==" "&&t[o]!==" "&&t[o]!==`
8
+ `&&t[o]!=="\r";o++)c+=t[o];if(c=c.trim(),c[c.length-1]==="/"&&(c=c.substring(0,c.length-1),o--),!ku(c)){var l=void 0;return c.trim().length===0?l="Invalid space after '<'.":l="Tag '"+c+"' is an invalid name.",H("InvalidTag",l,J(t,o))}var u=Fu(t,o);if(u===!1)return H("InvalidAttr","Attributes for '"+c+"' have open quote.",J(t,o));var f=u.value;if(o=u.index,f[f.length-1]==="/"){var h=o-f.length;f=f.substring(0,f.length-1);var d=$o(f,e);if(d===!0)n=!0;else return H(d.err.code,d.err.msg,J(t,h+d.err.line))}else if(a)if(u.tagClosed){if(f.trim().length>0)return H("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",J(t,s));var p=r.pop();if(c!==p.tagName){var g=J(t,p.tagStartPos);return H("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+g.line+", col "+g.col+") instead of closing tag '"+c+"'.",J(t,s))}r.length==0&&(i=!0)}else return H("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",J(t,o));else{var m=$o(f,e);if(m!==!0)return H(m.err.code,m.err.msg,J(t,o-f.length+m.err.line));if(i===!0)return H("InvalidXml","Multiple possible root nodes found.",J(t,o));e.unpairedTags.indexOf(c)!==-1||r.push({tagName:c,tagStartPos:s}),n=!0}for(o++;o<t.length;o++)if(t[o]==="<")if(t[o+1]==="!"){o++,o=Ho(t,o);continue}else if(t[o+1]==="?"){if(o=Yo(t,++o),o.err)return o}else break;else if(t[o]==="&"){var v=zu(t,o);if(v==-1)return H("InvalidChar","char '&' is not expected.",J(t,o));o=v}else if(i===!0&&!Xo(t[o]))return H("InvalidXml","Extra text at the end",J(t,o));t[o]==="<"&&o--}}else{if(Xo(t[o]))continue;return H("InvalidChar","char '"+t[o]+"' is not expected.",J(t,o))}if(n){if(r.length==1)return H("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",J(t,r[0].tagStartPos));if(r.length>0)return H("InvalidXml","Invalid '"+JSON.stringify(r.map(function(w){return w.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return H("InvalidXml","Start tag expected.",1);return!0};function Xo(t){return t===" "||t===" "||t===`
9
+ `||t==="\r"}function Yo(t,e){for(var r=e;e<t.length;e++)if(t[e]=="?"||t[e]==" "){var n=t.substr(r,e-r);if(e>5&&n==="xml")return H("InvalidXml","XML declaration allowed only at the start of the document.",J(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}function Ho(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++)if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){var r=1;for(e+=8;e<t.length;e++)if(t[e]==="<")r++;else if(t[e]===">"&&(r--,r===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++)if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}return e}var Lu='"',Ru="'";function Fu(t,e){for(var r="",n="",i=!1;e<t.length;e++){if(t[e]===Lu||t[e]===Ru)n===""?n=t[e]:n!==t[e]||(n="");else if(t[e]===">"&&n===""){i=!0;break}r+=t[e]}return n!==""?!1:{value:r,index:e,tagClosed:i}}var Nu=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function $o(t,e){for(var r=qn.getAllMatches(t,Nu),n={},i=0;i<r.length;i++){if(r[i][1].length===0)return H("InvalidAttr","Attribute '"+r[i][2]+"' has no space in starting.",xe(r[i]));if(r[i][3]!==void 0&&r[i][4]===void 0)return H("InvalidAttr","Attribute '"+r[i][2]+"' is without value.",xe(r[i]));if(r[i][3]===void 0&&!e.allowBooleanAttributes)return H("InvalidAttr","boolean attribute '"+r[i][2]+"' is not allowed.",xe(r[i]));var o=r[i][2];if(!Bu(o))return H("InvalidAttr","Attribute '"+o+"' is an invalid name.",xe(r[i]));if(!n.hasOwnProperty(o))n[o]=1;else return H("InvalidAttr","Attribute '"+o+"' is repeated.",xe(r[i]))}return!0}function Cu(t,e){var r=/\d/;for(t[e]==="x"&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(t[e]===";")return e;if(!t[e].match(r))break}return-1}function zu(t,e){if(e++,t[e]===";")return-1;if(t[e]==="#")return e++,Cu(t,e);for(var r=0;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(t[e]===";")break;return-1}return e}function H(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}function Bu(t){return qn.isName(t)}function ku(t){return qn.isName(t)}function J(t,e){var r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function xe(t){return t.startIndex+t[1].length}});var Jo=Y(jn=>{var Ko={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,r){return r},attributeValueProcessor:function(e,r){return r},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,r,n){return e}},qu=function(e){return Object.assign({},Ko,e)};jn.buildOptions=qu;jn.defaultOptions=Ko});var es=Y((Mv,ts)=>{"use strict";function lr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Uu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var ju=function(){function t(r){Uu(this,t),this.tagname=r,this.child=[],this[":@"]={}}var e=t.prototype;return e.add=function(n,i){n==="__proto__"&&(n="#__proto__"),this.child.push(lr({},n,i))},e.addChild=function(n){if(n.tagname==="__proto__"&&(n.tagname="#__proto__"),n[":@"]&&Object.keys(n[":@"]).length>0){var i;this.child.push((i={},lr(i,n.tagname,n.child),lr(i,":@",n[":@"]),i))}else this.child.push(lr({},n.tagname,n.child))},t}();ts.exports=ju});var is=Y((Sv,ns)=>{function Vu(t,e){return Zu(t)||Gu(t,e)||Du(t,e)||Wu()}function Wu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Du(t,e){if(t){if(typeof t=="string")return rs(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rs(t,e)}}function rs(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Gu(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function Zu(t){if(Array.isArray(t))return t}var Xu=cr();function Yu(t,e){var r={};if(t[e+3]==="O"&&t[e+4]==="C"&&t[e+5]==="T"&&t[e+6]==="Y"&&t[e+7]==="P"&&t[e+8]==="E"){e=e+9;for(var n=1,i=!1,o=!1,s="";e<t.length;e++)if(t[e]==="<"&&!o){if(i&&Qu(t,e)){e+=7;var a=Hu(t,e+1),c=Vu(a,3);entityName=c[0],val=c[1],e=c[2],val.indexOf("&")===-1&&(r[ef(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val})}else if(i&&Ku(t,e))e+=8;else if(i&&Ju(t,e))e+=8;else if(i&&tf(t,e))e+=9;else if($u)o=!0;else throw new Error("Invalid DOCTYPE");n++,s=""}else if(t[e]===">"){if(o?t[e-1]==="-"&&t[e-2]==="-"&&(o=!1,n--):n--,n===0)break}else t[e]==="["?i=!0:s+=t[e];if(n!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:e}}function Hu(t,e){for(var r="";e<t.length&&t[e]!=="'"&&t[e]!=='"';e++)r+=t[e];if(r=r.trim(),r.indexOf(" ")!==-1)throw new Error("External entites are not supported");for(var n=t[e++],i="";e<t.length&&t[e]!==n;e++)i+=t[e];return[r,i,e]}function $u(t,e){return t[e+1]==="!"&&t[e+2]==="-"&&t[e+3]==="-"}function Qu(t,e){return t[e+1]==="!"&&t[e+2]==="E"&&t[e+3]==="N"&&t[e+4]==="T"&&t[e+5]==="I"&&t[e+6]==="T"&&t[e+7]==="Y"}function Ku(t,e){return t[e+1]==="!"&&t[e+2]==="E"&&t[e+3]==="L"&&t[e+4]==="E"&&t[e+5]==="M"&&t[e+6]==="E"&&t[e+7]==="N"&&t[e+8]==="T"}function Ju(t,e){return t[e+1]==="!"&&t[e+2]==="A"&&t[e+3]==="T"&&t[e+4]==="T"&&t[e+5]==="L"&&t[e+6]==="I"&&t[e+7]==="S"&&t[e+8]==="T"}function tf(t,e){return t[e+1]==="!"&&t[e+2]==="N"&&t[e+3]==="O"&&t[e+4]==="T"&&t[e+5]==="A"&&t[e+6]==="T"&&t[e+7]==="I"&&t[e+8]==="O"&&t[e+9]==="N"}function ef(t){if(Xu.isName(t))return t;throw new Error("Invalid entity name ".concat(t))}ns.exports=Yu});var ss=Y((Tv,os)=>{var rf=/^[-+]?0x[a-fA-F0-9]+$/,nf=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt);!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var of={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function sf(t,e={}){if(e=Object.assign({},of,e),!t||typeof t!="string")return t;let r=t.trim();if(e.skipLike!==void 0&&e.skipLike.test(r))return t;if(e.hex&&rf.test(r))return Number.parseInt(r,16);{let n=nf.exec(r);if(n){let i=n[1],o=n[2],s=af(n[3]),a=n[4]||n[6];if(!e.leadingZeros&&o.length>0&&i&&r[2]!==".")return t;if(!e.leadingZeros&&o.length>0&&!i&&r[1]!==".")return t;{let c=Number(r),l=""+c;return l.search(/[eE]/)!==-1||a?e.eNotation?c:t:r.indexOf(".")!==-1?l==="0"&&s===""||l===s||i&&l==="-"+s?c:t:o?s===l||i+s===l?c:t:r===l||r===i+l?c:t}}else return t}}function af(t){return t&&t.indexOf(".")!==-1&&(t=t.replace(/0+$/,""),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substr(0,t.length-1))),t}os.exports=sf});var ls=Y((Ev,cs)=>{"use strict";function as(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ut(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ut=function(r){return typeof r}:Ut=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ut(t)}function cf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Dn=cr(),_e=es(),lf=is(),uf=ss(),Pv="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,Dn.nameRegexp),ff=function t(e){cf(this,t),this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"}},this.addExternalEntities=hf,this.parseXml=yf,this.parseTextData=df,this.resolveNameSpace=pf,this.buildAttributesMap=gf,this.isItStopNode=bf,this.replaceEntitiesValue=xf,this.readStopNodeData=Mf,this.saveTextToParentTag=_f,this.addChild=vf};function hf(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:t[n]}}}function df(t,e,r,n,i,o,s){if(t!==void 0&&(this.options.trimValues&&!n&&(t=t.trim()),t.length>0)){s||(t=this.replaceEntitiesValue(t));var a=this.options.tagValueProcessor(e,t,r,i,o);if(a==null)return t;if(Ut(a)!==Ut(t)||a!==t)return a;if(this.options.trimValues)return Wn(t,this.options.parseTagValue,this.options.numberParseOptions);var c=t.trim();return c===t?Wn(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function pf(t){if(this.options.removeNSPrefix){var e=t.split(":"),r=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(t=r+e[1])}return t}var mf=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function gf(t,e,r){if(!this.options.ignoreAttributes&&typeof t=="string"){for(var n=Dn.getAllMatches(t,mf),i=n.length,o={},s=0;s<i;s++){var a=this.resolveNameSpace(n[s][1]),c=n[s][4],l=this.options.attributeNamePrefix+a;if(a.length)if(this.options.transformAttributeName&&(l=this.options.transformAttributeName(l)),l==="__proto__"&&(l="#__proto__"),c!==void 0){this.options.trimValues&&(c=c.trim()),c=this.replaceEntitiesValue(c);var u=this.options.attributeValueProcessor(a,c,e);u==null?o[l]=c:Ut(u)!==Ut(c)||u!==c?o[l]=u:o[l]=Wn(c,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[l]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){var f={};return f[this.options.attributesGroupName]=o,f}return o}}var yf=function(e){e=e.replace(/\r\n?/g,`
11
+ `);for(var r=new _e("!xml"),n=r,i="",o="",s=0;s<e.length;s++){var a=e[s];if(a==="<")if(e[s+1]==="/"){var c=qt(e,">",s,"Closing Tag is not closed."),l=e.substring(s+2,c).trim();if(this.options.removeNSPrefix){var u=l.indexOf(":");u!==-1&&(l=l.substr(u+1))}this.options.transformTagName&&(l=this.options.transformTagName(l)),n&&(i=this.saveTextToParentTag(i,n,o));var f=o.substring(o.lastIndexOf(".")+1);if(l&&this.options.unpairedTags.indexOf(l)!==-1)throw new Error("Unpaired tag can not be used as closing tag: </".concat(l,">"));var h=0;f&&this.options.unpairedTags.indexOf(f)!==-1?(h=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=o.lastIndexOf("."),o=o.substring(0,h),n=this.tagsNodeStack.pop(),i="",s=c}else if(e[s+1]==="?"){var d=Vn(e,s,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,o),!(this.options.ignoreDeclaration&&d.tagName==="?xml"||this.options.ignorePiTags)){var p=new _e(d.tagName);p.add(this.options.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&(p[":@"]=this.buildAttributesMap(d.tagExp,o,d.tagName)),this.addChild(n,p,o)}s=d.closeIndex+1}else if(e.substr(s+1,3)==="!--"){var g=qt(e,"-->",s+4,"Comment is not closed.");if(this.options.commentPropName){var m=e.substring(s+4,g-2);i=this.saveTextToParentTag(i,n,o),n.add(this.options.commentPropName,[as({},this.options.textNodeName,m)])}s=g}else if(e.substr(s+1,2)==="!D"){var v=lf(e,s);this.docTypeEntities=v.entities,s=v.i}else if(e.substr(s+1,2)==="!["){var w=qt(e,"]]>",s,"CDATA is not closed.")-2,x=e.substring(s+9,w);if(i=this.saveTextToParentTag(i,n,o),this.options.cdataPropName)n.add(this.options.cdataPropName,[as({},this.options.textNodeName,x)]);else{var b=this.parseTextData(x,n.tagname,o,!0,!1,!0);b==null&&(b=""),n.add(this.options.textNodeName,b)}s=w+2}else{var T=Vn(e,s,this.options.removeNSPrefix),S=T.tagName,P=T.tagExp,M=T.attrExpPresent,_=T.closeIndex;this.options.transformTagName&&(S=this.options.transformTagName(S)),n&&i&&n.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,n,o,!1));var y=n;if(y&&this.options.unpairedTags.indexOf(y.tagname)!==-1&&(n=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),S!==r.tagname&&(o+=o?"."+S:S),this.isItStopNode(this.options.stopNodes,o,S)){var E="";if(P.length>0&&P.lastIndexOf("/")===P.length-1)s=T.closeIndex;else if(this.options.unpairedTags.indexOf(S)!==-1)s=T.closeIndex;else{var A=this.readStopNodeData(e,S,_+1);if(!A)throw new Error("Unexpected end of ".concat(S));s=A.i,E=A.tagContent}var L=new _e(S);S!==P&&M&&(L[":@"]=this.buildAttributesMap(P,o,S)),E&&(E=this.parseTextData(E,S,o,!0,M,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),L.add(this.options.textNodeName,E),this.addChild(n,L,o)}else{if(P.length>0&&P.lastIndexOf("/")===P.length-1){S[S.length-1]==="/"?(S=S.substr(0,S.length-1),o=o.substr(0,o.length-1),P=S):P=P.substr(0,P.length-1),this.options.transformTagName&&(S=this.options.transformTagName(S));var I=new _e(S);S!==P&&M&&(I[":@"]=this.buildAttributesMap(P,o,S)),this.addChild(n,I,o),o=o.substr(0,o.lastIndexOf("."))}else{var R=new _e(S);this.tagsNodeStack.push(n),S!==P&&M&&(R[":@"]=this.buildAttributesMap(P,o,S)),this.addChild(n,R,o),n=R}i="",s=_}}else i+=e[s]}return r.child};function vf(t,e,r){var n=this.options.updateTag(e.tagname,r,e[":@"]);n===!1||(typeof n=="string"&&(e.tagname=n),t.addChild(e))}var xf=function(e){if(this.options.processEntities){for(var r in this.docTypeEntities){var n=this.docTypeEntities[r];e=e.replace(n.regx,n.val)}for(var i in this.lastEntities){var o=this.lastEntities[i];e=e.replace(o.regex,o.val)}if(this.options.htmlEntities)for(var s in this.htmlEntities){var a=this.htmlEntities[s];e=e.replace(a.regex,a.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function _f(t,e,r,n){return t&&(n===void 0&&(n=Object.keys(e.child).length===0),t=this.parseTextData(t,e.tagname,r,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,n),t!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}function bf(t,e,r){var n="*."+r;for(var i in t){var o=t[i];if(n===o||e===o)return!0}return!1}function wf(t,e){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",n,i="",o=e;o<t.length;o++){var s=t[o];if(n)s===n&&(n="");else if(s==='"'||s==="'")n=s;else if(s===r[0])if(r[1]){if(t[o+1]===r[1])return{data:i,index:o}}else return{data:i,index:o};else s===" "&&(s=" ");i+=s}}function qt(t,e,r,n){var i=t.indexOf(e,r);if(i===-1)throw new Error(n);return i+e.length-1}function Vn(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:">",i=wf(t,e+1,n);if(i){var o=i.data,s=i.index,a=o.search(/\s/),c=o,l=!0;if(a!==-1&&(c=o.substr(0,a).replace(/\s\s*$/,""),o=o.substr(a+1)),r){var u=c.indexOf(":");u!==-1&&(c=c.substr(u+1),l=c!==i.data.substr(u+1))}return{tagName:c,tagExp:o,closeIndex:s,attrExpPresent:l}}}function Mf(t,e,r){for(var n=r,i=1;r<t.length;r++)if(t[r]==="<")if(t[r+1]==="/"){var o=qt(t,">",r,"".concat(e," is not closed")),s=t.substring(r+2,o).trim();if(s===e&&(i--,i===0))return{tagContent:t.substring(n,r),i:o};r=o}else if(t[r+1]==="?"){var a=qt(t,"?>",r+1,"StopNode is not closed.");r=a}else if(t.substr(r+1,3)==="!--"){var c=qt(t,"-->",r+3,"StopNode is not closed.");r=c}else if(t.substr(r+1,2)==="!["){var l=qt(t,"]]>",r,"StopNode is not closed.")-2;r=l}else{var u=Vn(t,r,">");if(u){var f=u&&u.tagName;f===e&&u.tagExp[u.tagExp.length-1]!=="/"&&i++,r=u.closeIndex}}}function Wn(t,e,r){if(e&&typeof t=="string"){var n=t.trim();return n==="true"?!0:n==="false"?!1:uf(t,r)}else return Dn.isExist(t)?t:""}cs.exports=ff});var hs=Y(fs=>{"use strict";function Sf(t,e){return us(t,e)}function us(t,e,r){for(var n,i={},o=0;o<t.length;o++){var s=t[o],a=Tf(s),c="";if(r===void 0?c=a:c=r+"."+a,a===e.textNodeName)n===void 0?n=s[a]:n+=""+s[a];else{if(a===void 0)continue;if(s[a]){var l=us(s[a],e,c),u=Ef(l,e);s[":@"]?Pf(l,s[":@"],c,e):Object.keys(l).length===1&&l[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?l=l[e.textNodeName]:Object.keys(l).length===0&&(e.alwaysCreateTextNode?l[e.textNodeName]="":l=""),i[a]!==void 0&&i.hasOwnProperty(a)?(Array.isArray(i[a])||(i[a]=[i[a]]),i[a].push(l)):e.isArray(a,c,u)?i[a]=[l]:i[a]=l}}}return typeof n=="string"?n.length>0&&(i[e.textNodeName]=n):n!==void 0&&(i[e.textNodeName]=n),i}function Tf(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r];if(n!==":@")return n}}function Pf(t,e,r,n){if(e)for(var i=Object.keys(e),o=i.length,s=0;s<o;s++){var a=i[s];n.isArray(a,r+"."+a,!0,!0)?t[a]=[e[a]]:t[a]=e[a]}}function Ef(t,e){var r=e.textNodeName,n=Object.keys(t).length;return!!(n===0||n===1&&(t[r]||typeof t[r]=="boolean"||t[r]===0))}fs.prettify=Sf});var ps=Y((Iv,ds)=>{function Of(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var If=Jo(),Af=If.buildOptions,Lf=ls(),Rf=hs(),Ff=Rf.prettify,Nf=Un(),Cf=function(){function t(r){Of(this,t),this.externalEntities={},this.options=Af(r)}var e=t.prototype;return e.parse=function(n,i){if(typeof n!="string")if(n.toString)n=n.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(i){i===!0&&(i={});var o=Nf.validate(n,i);if(o!==!0)throw Error("".concat(o.err.msg,":").concat(o.err.line,":").concat(o.err.col))}var s=new Lf(this.options);s.addExternalEntities(this.externalEntities);var a=s.parseXml(n);return this.options.preserveOrder||a===void 0?a:Ff(a,this.options)},e.addEntity=function(n,i){if(i.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(n.indexOf("&")!==-1||n.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(i==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[n]=i},t}();ds.exports=Cf});var xs=Y((Av,vs)=>{var zf=`
12
+ `;function Bf(t,e){var r="";return e.format&&e.indentBy.length>0&&(r=zf),gs(t,e,"",r)}function gs(t,e,r,n){for(var i="",o=!1,s=0;s<t.length;s++){var a=t[s],c=kf(a),l="";if(r.length===0?l=c:l="".concat(r,".").concat(c),c===e.textNodeName){var u=a[c];qf(l,e)||(u=e.tagValueProcessor(c,u),u=ys(u,e)),o&&(i+=n),i+=u,o=!1;continue}else if(c===e.cdataPropName){o&&(i+=n),i+="<![CDATA[".concat(a[c][0][e.textNodeName],"]]>"),o=!1;continue}else if(c===e.commentPropName){i+=n+"<!--".concat(a[c][0][e.textNodeName],"-->"),o=!0;continue}else if(c[0]==="?"){var f=ms(a[":@"],e),h=c==="?xml"?"":n,d=a[c][0][e.textNodeName];d=d.length!==0?" "+d:"",i+=h+"<".concat(c).concat(d).concat(f,"?>"),o=!0;continue}var p=n;p!==""&&(p+=e.indentBy);var g=ms(a[":@"],e),m=n+"<".concat(c).concat(g),v=gs(a[c],e,l,p);e.unpairedTags.indexOf(c)!==-1?e.suppressUnpairedNode?i+=m+">":i+=m+"/>":(!v||v.length===0)&&e.suppressEmptyNode?i+=m+"/>":v&&v.endsWith(">")?i+=m+">".concat(v).concat(n,"</").concat(c,">"):(i+=m+">",v&&n!==""&&(v.includes("/>")||v.includes("</"))?i+=n+e.indentBy+v+n:i+=v,i+="</".concat(c,">")),o=!0}return i}function kf(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var n=e[r];if(n!==":@")return n}}function ms(t,e){var r="";if(t&&!e.ignoreAttributes)for(var n in t){var i=e.attributeValueProcessor(n,t[n]);i=ys(i,e),i===!0&&e.suppressBooleanAttributes?r+=" ".concat(n.substr(e.attributeNamePrefix.length)):r+=" ".concat(n.substr(e.attributeNamePrefix.length),'="').concat(i,'"')}return r}function qf(t,e){t=t.substr(0,t.length-e.textNodeName.length-1);var r=t.substr(t.lastIndexOf(".")+1);for(var n in e.stopNodes)if(e.stopNodes[n]===t||e.stopNodes[n]==="*."+r)return!0;return!1}function ys(t,e){if(t&&t.length>0&&e.processEntities)for(var r=0;r<e.entities.length;r++){var n=e.entities[r];t=t.replace(n.regex,n.val)}return t}vs.exports=Bf});var bs=Y((Lv,_s)=>{"use strict";function be(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?be=function(r){return typeof r}:be=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},be(t)}function Uf(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var jf=xs(),Vf={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,r){return r},attributeValueProcessor:function(e,r){return r},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Ot(t){this.options=Object.assign({},Vf,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Gf),this.processTextOrObjNode=Wf,this.options.format?(this.indentate=Df,this.tagEndChar=`>
13
13
  `,this.newLine=`
14
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}ur.prototype.build=function(e){return this.options.preserveOrder?f2(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e=u2({},this.options.arrayNodeName,e)),this.j2x(e,0).val)};ur.prototype.j2x=function(e,t){var r="",n="";for(var i in e)if(typeof e[i]>"u")this.isAttribute(i)&&(n+="");else if(e[i]===null)this.isAttribute(i)?n+="":i[0]==="?"?n+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(e[i]instanceof Date)n+=this.buildTextValNode(e[i],i,"",t);else if(wi(e[i])!=="object"){var a=this.isAttribute(i);if(a)r+=this.buildAttrPairStr(a,""+e[i]);else if(i===this.options.textNodeName){var o=this.options.tagValueProcessor(i,""+e[i]);n+=this.replaceEntitiesValue(o)}else n+=this.buildTextValNode(e[i],i,"",t)}else if(Array.isArray(e[i])){for(var s=e[i].length,u="",f=0;f<s;f++){var c=e[i][f];typeof c>"u"||(c===null?i[0]==="?"?n+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+i+"/"+this.tagEndChar:wi(c)==="object"?this.options.oneListGroup?u+=this.j2x(c,t+1).val:u+=this.processTextOrObjNode(c,i,t):u+=this.buildTextValNode(c,i,"",t))}this.options.oneListGroup&&(u=this.buildObjectNode(u,i,"",t)),n+=u}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName)for(var l=Object.keys(e[i]),d=l.length,h=0;h<d;h++)r+=this.buildAttrPairStr(l[h],""+e[i][l[h]]);else n+=this.processTextOrObjNode(e[i],i,t);return{attrStr:r,val:n}};ur.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 l2(e,t,r){var 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)}ur.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;var i="</"+t+this.tagEndChar,a="";return t[0]==="?"&&(a="?",i=""),(r||r==="")&&e.indexOf("<")===-1?this.indentate(n)+"<"+t+r+a+">"+e+i:this.options.commentPropName!==!1&&t===this.options.commentPropName&&a.length===0?this.indentate(n)+"<!--".concat(e,"-->")+this.newLine:this.indentate(n)+"<"+t+r+a+this.tagEndChar+e+this.indentate(n)+i};ur.prototype.closeTag=function(e){var t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t="></".concat(e),t};ur.prototype.buildTextValNode=function(e,t,r,n){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(n)+"<![CDATA[".concat(e,"]]>")+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(n)+"<!--".concat(e,"-->")+this.newLine;if(t[0]==="?")return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar;var i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),i===""?this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+r+">"+i+"</"+t+this.tagEndChar};ur.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(var t=0;t<this.options.entities.length;t++){var r=this.options.entities[t];e=e.replace(r.regex,r.val)}return e};function h2(e){return this.options.indentBy.repeat(e)}function d2(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}Ov.exports=ur});var Cv=be((XV,Bv)=>{"use strict";var p2=ec(),m2=Av(),v2=Pv();Bv.exports={XMLParser:m2,XMLValidator:p2,XMLBuilder:v2}});var zv=be(()=>{});var hl=be((Gy,Vi)=>{(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof qm=="function"&&typeof Vi=="object"&&Vi&&Vi.exports?Vi.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(Gy,function(){"use strict";function e(x,_,C){this.low=x|0,this.high=_|0,this.unsigned=!!C}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function t(x){return(x&&x.__isLong__)===!0}e.isLong=t;var r={},n={};function i(x,_){var C,I,R;return _?(x>>>=0,(R=0<=x&&x<256)&&(I=n[x],I)?I:(C=o(x,(x|0)<0?-1:0,!0),R&&(n[x]=C),C)):(x|=0,(R=-128<=x&&x<128)&&(I=r[x],I)?I:(C=o(x,x<0?-1:0,!1),R&&(r[x]=C),C))}e.fromInt=i;function a(x,_){if(isNaN(x)||!isFinite(x))return _?y:g;if(_){if(x<0)return y;if(x>=h)return w}else{if(x<=-p)return B;if(x+1>=p)return O}return x<0?a(-x,_).neg():o(x%d|0,x/d|0,_)}e.fromNumber=a;function o(x,_,C){return new e(x,_,C)}e.fromBits=o;var s=Math.pow;function u(x,_,C){if(x.length===0)throw Error("empty string");if(x==="NaN"||x==="Infinity"||x==="+Infinity"||x==="-Infinity")return g;if(typeof _=="number"?(C=_,_=!1):_=!!_,C=C||10,C<2||36<C)throw RangeError("radix");var I;if((I=x.indexOf("-"))>0)throw Error("interior hyphen");if(I===0)return u(x.substring(1),_,C).neg();for(var R=a(s(C,8)),M=g,D=0;D<x.length;D+=8){var N=Math.min(8,x.length-D),j=parseInt(x.substring(D,D+N),C);if(N<8){var U=a(s(C,N));M=M.mul(U).add(a(j))}else M=M.mul(R),M=M.add(a(j))}return M.unsigned=_,M}e.fromString=u;function f(x){return x instanceof e?x:typeof x=="number"?a(x):typeof x=="string"?u(x):o(x.low,x.high,x.unsigned)}e.fromValue=f;var c=1<<16,l=1<<24,d=c*c,h=d*d,p=h/2,m=i(l),g=i(0);e.ZERO=g;var y=i(0,!0);e.UZERO=y;var b=i(1);e.ONE=b;var A=i(1,!0);e.UONE=A;var S=i(-1);e.NEG_ONE=S;var O=o(-1,2147483647,!1);e.MAX_VALUE=O;var w=o(-1,-1,!0);e.MAX_UNSIGNED_VALUE=w;var B=o(0,-2147483648,!1);e.MIN_VALUE=B;var P=e.prototype;return P.toInt=function(){return this.unsigned?this.low>>>0:this.low},P.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},P.toString=function(_){if(_=_||10,_<2||36<_)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(B)){var C=a(_),I=this.div(C),R=I.mul(C).sub(this);return I.toString(_)+R.toInt().toString(_)}else return"-"+this.neg().toString(_);for(var M=a(s(_,6),this.unsigned),D=this,N="";;){var j=D.div(M),U=D.sub(j.mul(M)).toInt()>>>0,k=U.toString(_);if(D=j,D.isZero())return k+N;for(;k.length<6;)k="0"+k;N=""+k+N}},P.getHighBits=function(){return this.high},P.getHighBitsUnsigned=function(){return this.high>>>0},P.getLowBits=function(){return this.low},P.getLowBitsUnsigned=function(){return this.low>>>0},P.getNumBitsAbs=function(){if(this.isNegative())return this.eq(B)?64:this.neg().getNumBitsAbs();for(var _=this.high!=0?this.high:this.low,C=31;C>0&&!(_&1<<C);C--);return this.high!=0?C+33:C+1},P.isZero=function(){return this.high===0&&this.low===0},P.isNegative=function(){return!this.unsigned&&this.high<0},P.isPositive=function(){return this.unsigned||this.high>=0},P.isOdd=function(){return(this.low&1)===1},P.isEven=function(){return(this.low&1)===0},P.equals=function(_){return t(_)||(_=f(_)),this.unsigned!==_.unsigned&&this.high>>>31===1&&_.high>>>31===1?!1:this.high===_.high&&this.low===_.low},P.eq=P.equals,P.notEquals=function(_){return!this.eq(_)},P.neq=P.notEquals,P.lessThan=function(_){return this.comp(_)<0},P.lt=P.lessThan,P.lessThanOrEqual=function(_){return this.comp(_)<=0},P.lte=P.lessThanOrEqual,P.greaterThan=function(_){return this.comp(_)>0},P.gt=P.greaterThan,P.greaterThanOrEqual=function(_){return this.comp(_)>=0},P.gte=P.greaterThanOrEqual,P.compare=function(_){if(t(_)||(_=f(_)),this.eq(_))return 0;var C=this.isNegative(),I=_.isNegative();return C&&!I?-1:!C&&I?1:this.unsigned?_.high>>>0>this.high>>>0||_.high===this.high&&_.low>>>0>this.low>>>0?-1:1:this.sub(_).isNegative()?-1:1},P.comp=P.compare,P.negate=function(){return!this.unsigned&&this.eq(B)?B:this.not().add(b)},P.neg=P.negate,P.add=function(_){t(_)||(_=f(_));var C=this.high>>>16,I=this.high&65535,R=this.low>>>16,M=this.low&65535,D=_.high>>>16,N=_.high&65535,j=_.low>>>16,U=_.low&65535,k=0,H=0,W=0,re=0;return re+=M+U,W+=re>>>16,re&=65535,W+=R+j,H+=W>>>16,W&=65535,H+=I+N,k+=H>>>16,H&=65535,k+=C+D,k&=65535,o(W<<16|re,k<<16|H,this.unsigned)},P.subtract=function(_){return t(_)||(_=f(_)),this.add(_.neg())},P.sub=P.subtract,P.multiply=function(_){if(this.isZero()||(t(_)||(_=f(_)),_.isZero()))return g;if(this.eq(B))return _.isOdd()?B:g;if(_.eq(B))return this.isOdd()?B:g;if(this.isNegative())return _.isNegative()?this.neg().mul(_.neg()):this.neg().mul(_).neg();if(_.isNegative())return this.mul(_.neg()).neg();if(this.lt(m)&&_.lt(m))return a(this.toNumber()*_.toNumber(),this.unsigned);var C=this.high>>>16,I=this.high&65535,R=this.low>>>16,M=this.low&65535,D=_.high>>>16,N=_.high&65535,j=_.low>>>16,U=_.low&65535,k=0,H=0,W=0,re=0;return re+=M*U,W+=re>>>16,re&=65535,W+=R*U,H+=W>>>16,W&=65535,W+=M*j,H+=W>>>16,W&=65535,H+=I*U,k+=H>>>16,H&=65535,H+=R*j,k+=H>>>16,H&=65535,H+=M*N,k+=H>>>16,H&=65535,k+=C*U+I*j+R*N+M*D,k&=65535,o(W<<16|re,k<<16|H,this.unsigned)},P.mul=P.multiply,P.divide=function(_){if(t(_)||(_=f(_)),_.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?y:g;var C,I,R;if(this.unsigned){if(_.unsigned||(_=_.toUnsigned()),_.gt(this))return y;if(_.gt(this.shru(1)))return A;R=y}else{if(this.eq(B)){if(_.eq(b)||_.eq(S))return B;if(_.eq(B))return b;var M=this.shr(1);return C=M.div(_).shl(1),C.eq(g)?_.isNegative()?b:S:(I=this.sub(_.mul(C)),R=C.add(I.div(_)),R)}else if(_.eq(B))return this.unsigned?y:g;if(this.isNegative())return _.isNegative()?this.neg().div(_.neg()):this.neg().div(_).neg();if(_.isNegative())return this.div(_.neg()).neg();R=g}for(I=this;I.gte(_);){C=Math.max(1,Math.floor(I.toNumber()/_.toNumber()));for(var D=Math.ceil(Math.log(C)/Math.LN2),N=D<=48?1:s(2,D-48),j=a(C),U=j.mul(_);U.isNegative()||U.gt(I);)C-=N,j=a(C,this.unsigned),U=j.mul(_);j.isZero()&&(j=b),R=R.add(j),I=I.sub(U)}return R},P.div=P.divide,P.modulo=function(_){return t(_)||(_=f(_)),this.sub(this.div(_).mul(_))},P.mod=P.modulo,P.not=function(){return o(~this.low,~this.high,this.unsigned)},P.and=function(_){return t(_)||(_=f(_)),o(this.low&_.low,this.high&_.high,this.unsigned)},P.or=function(_){return t(_)||(_=f(_)),o(this.low|_.low,this.high|_.high,this.unsigned)},P.xor=function(_){return t(_)||(_=f(_)),o(this.low^_.low,this.high^_.high,this.unsigned)},P.shiftLeft=function(_){return t(_)&&(_=_.toInt()),(_&=63)===0?this:_<32?o(this.low<<_,this.high<<_|this.low>>>32-_,this.unsigned):o(0,this.low<<_-32,this.unsigned)},P.shl=P.shiftLeft,P.shiftRight=function(_){return t(_)&&(_=_.toInt()),(_&=63)===0?this:_<32?o(this.low>>>_|this.high<<32-_,this.high>>_,this.unsigned):o(this.high>>_-32,this.high>=0?0:-1,this.unsigned)},P.shr=P.shiftRight,P.shiftRightUnsigned=function(_){if(t(_)&&(_=_.toInt()),_&=63,_===0)return this;var C=this.high;if(_<32){var I=this.low;return o(I>>>_|C<<32-_,C>>>_,this.unsigned)}else return _===32?o(C,0,this.unsigned):o(C>>>_-32,0,this.unsigned)},P.shru=P.shiftRightUnsigned,P.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},P.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},P.toBytes=function(x){return x?this.toBytesLE():this.toBytesBE()},P.toBytesLE=function(){var x=this.high,_=this.low;return[_&255,_>>>8&255,_>>>16&255,_>>>24&255,x&255,x>>>8&255,x>>>16&255,x>>>24&255]},P.toBytesBE=function(){var x=this.high,_=this.low;return[x>>>24&255,x>>>16&255,x>>>8&255,x&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255]},e})});var Bs=be((Fq,wb)=>{wb.exports=globalThis.h3||{}});var oh=be((Vq,Nb)=>{Nb.exports=globalThis.luma});var Gs=be((zq,Ub)=>{Ub.exports=globalThis.deck});var Zn=be((LZ,s1)=>{s1.exports=globalThis.loaders});var Px=be((Foe,Ox)=>{Ox.exports=globalThis.deck});var Xx=be(Im=>{Im.read=function(e,t,r,n,i){var a,o,s=i*8-n-1,u=(1<<s)-1,f=u>>1,c=-7,l=r?i-1:0,d=r?-1:1,h=e[t+l];for(l+=d,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=a*256+e[t+l],l+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=o*256+e[t+l],l+=d,c-=8);if(a===0)a=1-f;else{if(a===u)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-f}return(h?-1:1)*o*Math.pow(2,a-n)};Im.write=function(e,t,r,n,i,a){var o,s,u,f=a*8-i-1,c=(1<<f)-1,l=c>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+l>=1?t+=d/u:t+=d*Math.pow(2,1-l),t*u>=2&&(o++,u/=2),o+l>=c?(s=0,o=c):o+l>=1?(s=(t*u-1)*Math.pow(2,i),o=o+l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=s&255,h+=p,s/=256,i-=8);for(o=o<<i|s,f+=i;f>0;e[r+h]=o&255,h+=p,o/=256,f-=8);e[r+h-p]|=m*128}});var Qx=be((Ase,Zx)=>{"use strict";Zx.exports=fe;var Hf=Xx();function fe(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}fe.Varint=0;fe.Fixed64=1;fe.Bytes=2;fe.Fixed32=5;var Rm=(1<<16)*(1<<16),qx=1/Rm,Gk=12,$x=typeof TextDecoder>"u"?null:new TextDecoder("utf8");fe.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=n&7,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Vf(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Yx(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Vf(this.buf,this.pos)+Vf(this.buf,this.pos+4)*Rm;return this.pos+=8,e},readSFixed64:function(){var e=Vf(this.buf,this.pos)+Yx(this.buf,this.pos+4)*Rm;return this.pos+=8,e},readFloat:function(){var e=Hf.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Hf.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,Nk(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>=Gk&&$x?Zk(this.buf,t,e):$k(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!==fe.Bytes)return e.push(this.readVarint(t));var r=or(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==fe.Bytes)return e.push(this.readSVarint());var t=or(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==fe.Bytes)return e.push(this.readBoolean());var t=or(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==fe.Bytes)return e.push(this.readFloat());var t=or(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==fe.Bytes)return e.push(this.readDouble());var t=or(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==fe.Bytes)return e.push(this.readFixed32());var t=or(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==fe.Bytes)return e.push(this.readSFixed32());var t=or(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==fe.Bytes)return e.push(this.readFixed64());var t=or(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==fe.Bytes)return e.push(this.readSFixed64());var t=or(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=e&7;if(t===fe.Varint)for(;this.buf[this.pos++]>127;);else if(t===fe.Bytes)this.pos=this.readVarint()+this.pos;else if(t===fe.Fixed32)this.pos+=4;else if(t===fe.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),Ai(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Ai(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Ai(this.buf,e&-1,this.pos),Ai(this.buf,Math.floor(e*qx),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Ai(this.buf,e&-1,this.pos),Ai(this.buf,Math.floor(e*qx),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){Uk(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=Qk(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Kx(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Hf.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Hf.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&&Kx(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,fe.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Hk,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Vk,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Jk,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,zk,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Wk,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Xk,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,qk,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Kk,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Yk,t)},writeBytesField:function(e,t){this.writeTag(e,fe.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,fe.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,fe.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,fe.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,fe.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,fe.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,fe.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,fe.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,fe.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,fe.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};function Nk(e,t,r){var n=r.buf,i,a;if(a=n[r.pos++],i=(a&112)>>4,a<128||(a=n[r.pos++],i|=(a&127)<<3,a<128)||(a=n[r.pos++],i|=(a&127)<<10,a<128)||(a=n[r.pos++],i|=(a&127)<<17,a<128)||(a=n[r.pos++],i|=(a&127)<<24,a<128)||(a=n[r.pos++],i|=(a&1)<<31,a<128))return _i(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function or(e){return e.type===fe.Bytes?e.readVarint()+e.pos:e.pos+1}function _i(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Uk(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),jk(r,n,t),kk(n,t)}function jk(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 kk(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 Kx(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 i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function Hk(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function Vk(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function zk(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Wk(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Jk(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Xk(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function qk(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Kk(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Yk(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Vf(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function Ai(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Yx(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function $k(e,t,r){for(var n="",i=t;i<r;){var a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s>r)break;var u,f,c;s===1?a<128&&(o=a):s===2?(u=e[i+1],(u&192)===128&&(o=(a&31)<<6|u&63,o<=127&&(o=null))):s===3?(u=e[i+1],f=e[i+2],(u&192)===128&&(f&192)===128&&(o=(a&15)<<12|(u&63)<<6|f&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):s===4&&(u=e[i+1],f=e[i+2],c=e[i+3],(u&192)===128&&(f&192)===128&&(c&192)===128&&(o=(a&15)<<18|(u&63)<<12|(f&63)<<6|c&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,s=1):o>65535&&(o-=65536,n+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),n+=String.fromCharCode(o),i+=s}return n}function Zk(e,t,r){return $x.decode(e.subarray(t,r))}function Qk(e,t,r){for(var n=0,i,a;n<t.length;n++){if(i=t.charCodeAt(n),i>55295&&i<57344)if(a)if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,a=i;continue}else i=a-55296<<10|i-56320|65536,a=null;else{i>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):a=i;continue}else a&&(e[r++]=239,e[r++]=191,e[r++]=189,a=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=i&63|128)}return r}});var Ca={};lt(Ca,{GeohashLayer:()=>Zf,GreatCircleLayer:()=>Po,H3ClusterLayer:()=>Ds,H3HexagonLayer:()=>Qr,MVTLayer:()=>Kf,QuadkeyLayer:()=>Go,S2Layer:()=>Fo,TerrainLayer:()=>Lf,Tile3DLayer:()=>Sf,TileLayer:()=>Kt,TripsLayer:()=>Ps,_GeoCellLayer:()=>rt,_Tile2DHeader:()=>Wi,_Tileset2D:()=>$i,_WMSLayer:()=>xo,_getURLFromTemplate:()=>Rt});var wt={},Ym=q(ht());sr(wt,q(ht()));if(!Ym.GeoJsonLayer)throw new Error("@deck.gl/layers is not found");sr(Ca,wt);var Yr=q(dt()),Ry=q(ht());function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Iv=q(Cv());function Mv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function g2(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mv(Object(r),!0).forEach(function(n){y2(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function y2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rv(e,t){var r=new Iv.XMLParser(g2({ignoreAttributes:!1,attributeNamePrefix:""},t)),n=r.parse(e);return n}function b2(e,t){return S2(e)||T2(e,t)||A2(e,t)||_2()}function _2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
15
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A2(e,t){if(e){if(typeof e=="string")return Fv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fv(e,t)}}function Fv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function T2(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function S2(e){if(Array.isArray(e))return e}function La(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?La=function(r){return typeof r}:La=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},La(e)}function w2(e){return typeof e=="string"?e.charAt(0).toLowerCase()+e.slice(1):e}function Da(e){if(Array.isArray(e))return e.map(function(s){return Da(s)});if(e&&La(e)==="object"){for(var t={},r=0,n=Object.entries(e);r<n.length;r++){var i=b2(n[r],2),a=i[0],o=i[1];t[w2(a)]=Da(o)}return t}return e}function Lv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ac(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lv(Object(r),!0).forEach(function(n){x2(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function x2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dv(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function E2(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){Dv(a,n,i,o,s,"next",u)}function s(u){Dv(a,n,i,o,s,"throw",u)}o(void 0)})}}var O2="3.4.13",tt={name:"XML",id:"xml",module:"xml",version:O2,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:P2,options:{xml:{parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:function(){var e=E2(regeneratorRuntime.mark(function r(n,i){return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Gv(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},r)}));function t(r,n){return e.apply(this,arguments)}return t}(),parseTextSync:function(t,r){return Gv(t,r)}};function P2(e){return e.startsWith("<?xml")}function Gv(e,t){var r,n=ac(ac({},tt.options.xml),t?.xml);switch(n.parser){case"fast-xml-parser":var i=ac({allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:n.removeNSPrefix,textNodeName:n.textNodeName,isArray:function(s,u,f,c){var l,d=Boolean(n==null||(l=n.arrayPaths)===null||l===void 0?void 0:l.some(function(h){return u===h}));return d}},t?._fastXML),a=Rv(e,i);return n.uncapitalizeKeys?Da(a):a;default:throw new Error(t==null||(r=t.xml)===null||r===void 0?void 0:r.parser)}}function Z(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function Ga(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ga=function(r){return typeof r}:Ga=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ga(e)}var xt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},B2=xt.self||xt.window||xt.global||{},C2=xt.window||xt.self||xt.global||{},M2=xt.global||xt.self||xt.window||{},I2=xt.document||{};var xi=Boolean((typeof process>"u"?"undefined":Ga(process))!=="object"||String(process)!=="[object process]"||process.browser);var Nv=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),R2=Nv&&parseFloat(Nv[1])||0;function Na(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Na=function(r){return typeof r}:Na=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Na(e)}function F2(e,t){return N2(e)||G2(e,t)||D2(e,t)||L2()}function L2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D2(e,t){if(e){if(typeof e=="string")return Uv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uv(e,t)}}function Uv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function G2(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function N2(e){if(Array.isArray(e))return e}function jv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function U2(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jv(Object(r),!0).forEach(function(n){j2(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function j2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oc(e,t){for(var r=U2({},e),n=0,i=Object.entries(t);n<i.length;n++){var a=F2(i[n],2),o=a[0],s=a[1];s&&Na(s)==="object"?(r[o]=r[o]||{},Object.assign(r[o],t[o])):r[o]=t[o]}return r}function kv(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}function Ua(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ua=function(r){return typeof r}:Ua=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ua(e)}var Et={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},n5=Et.self||Et.window||Et.global||{},i5=Et.window||Et.self||Et.global||{},Vv=Et.global||Et.self||Et.window||{},a5=Et.document||{};var Vt=(typeof process>"u"?"undefined":Ua(process))!=="object"||String(process)!=="[object process]"||process.browser,Ei=typeof importScripts=="function",o5=typeof window<"u"&&typeof window.orientation<"u",Hv=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),s5=Hv&&parseFloat(Hv[1])||0;var kr=q(zv());function Wv(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function Jv(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){Wv(a,n,i,o,s,"next",u)}function s(u){Wv(a,n,i,o,s,"throw",u)}o(void 0)})}}var k2="3.4.13",sc={};function Ot(e){return uc.apply(this,arguments)}function uc(){return uc=Jv(regeneratorRuntime.mark(function e(t){var r,n,i=arguments;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return r=i.length>1&&i[1]!==void 0?i[1]:null,n=i.length>2&&i[2]!==void 0?i[2]:{},r&&(t=Xv(t,r,n)),sc[t]=sc[t]||H2(t),o.next=6,sc[t];case 6:return o.abrupt("return",o.sent);case 7:case"end":return o.stop()}},e)})),uc.apply(this,arguments)}function Xv(e,t,r){if(e.startsWith("http"))return e;var n=r.modules||{};return n[e]?n[e]:Vt?r.CDN?(kv(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(t,"@").concat(k2,"/dist/libs/").concat(e)):Ei?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function H2(e){return fc.apply(this,arguments)}function fc(){return fc=Jv(regeneratorRuntime.mark(function e(t){var r,n,i;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!t.endsWith("wasm")){o.next=7;break}return o.next=3,fetch(t);case 3:return r=o.sent,o.next=6,r.arrayBuffer();case 6:return o.abrupt("return",o.sent);case 7:if(Vt){o.next=20;break}if(o.prev=8,o.t0=kr&&kr.requireFromFile,!o.t0){o.next=14;break}return o.next=13,kr.requireFromFile(t);case 13:o.t0=o.sent;case 14:return o.abrupt("return",o.t0);case 17:return o.prev=17,o.t1=o.catch(8),o.abrupt("return",null);case 20:if(!Ei){o.next=22;break}return o.abrupt("return",importScripts(t));case 22:return o.next=24,fetch(t);case 24:return n=o.sent,o.next=27,n.text();case 27:return i=o.sent,o.abrupt("return",V2(i,t));case 29:case"end":return o.stop()}},e,null,[[8,17]])})),fc.apply(this,arguments)}function V2(e,t){if(!Vt)return kr.requireFromString&&kr.requireFromString(e,t);if(Ei)return eval.call(Vv,e),null;var r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}function Kv(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5;if(typeof e=="string")return e.slice(0,t);if(ArrayBuffer.isView(e))return qv(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return qv(e,r,t)}return""}function qv(e,t,r){if(e.byteLength<=t+r)return"";for(var n=new DataView(e),i="",a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function cc(e){try{return JSON.parse(e)}catch{throw new Error('Failed to parse JSON from data starting with "'.concat(Kv(e),'"'))}}function Oi(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t,i=n&&n.length>1&&n[0].constructor||null;if(!i)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');for(var a=n.reduce(function(l,d){return l+d.length},0),o=new i(a),s=0,u=0,f=n;u<f.length;u++){var c=f[u];o.set(c,s),s+=c.length}return o}function Hr(e,t,r){var n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t),i=new Uint8Array(n);return i.buffer}function fr(e,t){return Z(e>=0),Z(t>0),e+(t-1)&~(t-1)}function lc(e,t,r){var n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{var i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return t.set(n,r),r+fr(n.byteLength,4)}function Pi(){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 Vr=class{constructor(t,r){v(this,"name",void 0),v(this,"type",void 0),v(this,"sampleSize",1),v(this,"time",0),v(this,"count",0),v(this,"samples",0),v(this,"lastTiming",0),v(this,"lastSampleTime",0),v(this,"lastSampleCount",0),v(this,"_count",0),v(this,"_time",0),v(this,"_samples",0),v(this,"_startTime",0),v(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=Pi(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Pi()-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 wn=class{constructor(t){v(this,"id",void 0),v(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"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(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,i=this.stats[r];return i||(t instanceof Vr?i=t:i=new Vr(r,n),this.stats[r]=i),i}};function Yv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $v(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yv(Object(r),!0).forEach(function(n){z2(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function z2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function W2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var J2="Queued Requests",X2="Active Requests",q2="Cancelled Requests",K2="Queued Requests Ever",Y2="Active Requests Ever",$2={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Bi=function(){function e(){W2(this,e);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};v(this,"props",void 0),v(this,"stats",void 0),v(this,"activeRequestCount",0),v(this,"requestQueue",[]),v(this,"requestMap",new Map),v(this,"deferredUpdate",null),this.props=$v($v({},$2),r),this.stats=new wn({id:this.props.id}),this.stats.get(J2),this.stats.get(X2),this.stats.get(q2),this.stats.get(K2),this.stats.get(Y2)}var t=e.prototype;return t.scheduleRequest=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(n))return this.requestMap.get(n);var a={handle:n,priority:0,getPriority:i},o=new Promise(function(s){return a.resolve=s,a});return this.requestQueue.push(a),this.requestMap.set(n,o),this._issueNewRequests(),o},t._issueRequest=function(n){var i=this,a=n.handle,o=n.resolve,s=!1,u=function(){s||(s=!0,i.requestMap.delete(a),i.activeRequestCount--,i._issueNewRequests())};return this.activeRequestCount++,o?o({done:u}):Promise.resolve({done:u})},t._issueNewRequests=function(){var n=this;this.deferredUpdate||(this.deferredUpdate=setTimeout(function(){return n._issueNewRequestsAsync()},0))},t._issueNewRequestsAsync=function(){this.deferredUpdate=null;var n=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(n!==0){this._updateAllRequests();for(var i=0;i<n;++i){var a=this.requestQueue.shift();a&&this._issueRequest(a)}}},t._updateAllRequests=function(){for(var n=this.requestQueue,i=0;i<n.length;++i){var a=n[i];this._updateRequest(a)||(n.splice(i,1),this.requestMap.delete(a.handle),i--)}n.sort(function(o,s){return o.priority-s.priority})},t._updateRequest=function(n){return n.priority=n.getPriority(n.handle),n.priority<0?(n.resolve(null),!1):!0},e}();var xn={};lt(xn,{dirname:()=>Q2,filename:()=>Z2,join:()=>eP,resolve:()=>tP});function Zv(){var e;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();var t=(e=window.location)===null||e===void 0?void 0:e.pathname;return t?.slice(0,t.lastIndexOf("/")+1)||""}function Z2(e){var t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function Q2(e){var t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function eP(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n="/";return t=t.map(function(i,a){return a&&(i=i.replace(new RegExp("^".concat(n)),"")),a!==t.length-1&&(i=i.replace(new RegExp("".concat(n,"$")),"")),i}),t.join(n)}function tP(){for(var e=[],t=0;t<arguments.length;t++)e[t]=t<0||arguments.length<=t?void 0:arguments[t];for(var r="",n=!1,i,a=e.length-1;a>=-1&&!n;a--){var o=void 0;a>=0?o=e[a]:(i===void 0&&(i=Zv()),o=i),o.length!==0&&(r="".concat(o,"/").concat(r),n=o.charCodeAt(0)===Ci)}return r=rP(r,!n),n?"/".concat(r):r.length>0?r:"."}var Ci=47,hc=46;function rP(e,t){for(var r="",n=-1,i=0,a,o=!1,s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===Ci)break;a=Ci}if(a===Ci){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==hc||r.charCodeAt(r.length-2)!==hc){if(r.length>2){for(var u=r.length-1,f=u;f>=0&&r.charCodeAt(f)!==Ci;--f);if(f!==u){r=f===-1?"":r.slice(0,f),n=s,i=0,o=!1;continue}}else if(r.length===2||r.length===1){r="",n=s,i=0,o=!1;continue}}t&&(r.length>0?r+="/..":r="..",o=!0)}else{var c=e.slice(n+1,s);r.length>0?r+="/".concat(c):r=c,o=!1}n=s,i=0}else a===hc&&i!==-1?++i:i=-1}return r}function Qv(e,t){var r,n,i,a=(r=tt.parseTextSync)===null||r===void 0?void 0:r.call(tt,e,t),o=(a==null||(n=a.ServiceExceptionReport)===null||n===void 0?void 0:n.ServiceException)||(a==null||(i=a["ogc:ServiceExceptionReport"])===null||i===void 0?void 0:i["ogc:ServiceException"]),s=typeof o=="string"?o:o.value||o.code||"Unknown error";return s}function eg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eg(Object(r),!0).forEach(function(n){nP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rg(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function iP(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){rg(a,n,i,o,s,"next",u)}function s(u){rg(a,n,i,o,s,"throw",u)}o(void 0)})}}var aP="3.4.13",En={id:"wms-error",name:"WMS Error",module:"wms",version:aP,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:oP,options:{wms:{throwOnError:!1}},parse:function(){var e=iP(regeneratorRuntime.mark(function r(n,i){return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",dc(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},r)}));function t(r,n){return e.apply(this,arguments)}return t}(),parseSync:function(t,r){return dc(new TextDecoder().decode(t),r)},parseTextSync:function(t,r){return dc(t,r)}};function oP(e){return e.startsWith("<?xml")}function dc(e,t){var r=tg(tg({},En.options.wms),t?.wms),n=Qv(e,r),i=r.minimalErrors?n:"WMS Service error: ".concat(n);if(r.throwOnError)throw new Error(i);return i}function Mi(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mi=function(r){return typeof r}:Mi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Mi(e)}function zr(e){return Array.isArray(e)?e:e?[e]:[]}function Ii(e){var t=zr(e);return t.length>0&&t.every(function(r){return typeof r=="string"})?t:[]}function Ri(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;switch(Mi(e)){case"number":return e;case"string":return parseFloat(e);default:return}}function ja(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;switch(Mi(e)){case"number":return e;case"string":return parseInt(e,10);default:return}}function Wr(e){switch(e){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function ka(e){return fP(e)||uP(e)||vc(e)||sP()}function sP(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
17
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uP(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fP(e){if(Array.isArray(e))return pc(e)}function mc(e,t){return hP(e)||lP(e,t)||vc(e,t)||cP()}function cP(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
18
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lP(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function hP(e){if(Array.isArray(e))return e}function Ha(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=vc(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
19
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function vc(e,t){if(e){if(typeof e=="string")return pc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pc(e,t)}}function pc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function gc(e,t){var r=tt.parseTextSync(e,t),n=r.WMT_MS_Capabilities||r.WMS_Capabilities||r,i=dP(n);if(t!=null&&t.inheritedLayerProps){var a=Ha(i.layers),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;ig(s,null)}}catch(u){a.e(u)}finally{a.f()}}return(t!=null&&t.includeRawData||t!=null&&t.raw)&&(i.raw=n),t!=null&&t.includeXMLText&&(i.xml=e),i}function dP(e){var t,r,n,i,a,o,s,u,f,c,l,d,h,p,m,g,y={version:String(e.version||""),name:String(((t=e.Service)===null||t===void 0?void 0:t.Name)||"unnamed"),title:(r=e.Service)!==null&&r!==void 0&&r.Title?String((n=e.Service)===null||n===void 0?void 0:n.Title):void 0,abstract:(i=e.Service)!==null&&i!==void 0&&i.Abstract?String((a=e.Service)===null||a===void 0?void 0:a.Abstract):void 0,keywords:Ii((o=e.Service)===null||o===void 0||(s=o.KeywordList)===null||s===void 0?void 0:s.Keyword),fees:(u=e.Service)!==null&&u!==void 0&&u.Fees?JSON.stringify((f=e.Service)===null||f===void 0?void 0:f.Fees):void 0,accessConstraints:(c=e.Service)!==null&&c!==void 0&&c.AccessConstraints?JSON.stringify((l=e.Service)===null||l===void 0?void 0:l.AccessConstraints):void 0,layerLimit:ja((d=e.Service)===null||d===void 0?void 0:d.LayerLimit),maxWidth:ja((h=e.Service)===null||h===void 0?void 0:h.maxWidth),maxHeight:ja((p=e.Service)===null||p===void 0?void 0:p.maxHeight),layers:[],requests:pP((m=e.Capability)===null||m===void 0?void 0:m.Request),exceptions:mP(e.Exception)},b=zr((g=e.Capability)===null||g===void 0?void 0:g.Layer),A=Ha(b),S;try{for(A.s();!(S=A.n()).done;){var O=S.value;y.layers.push(ng(O))}}catch(C){A.e(C)}finally{A.f()}for(var w=0,B=Object.entries(y);w<B.length;w++){var P=mc(B[w],2),x=P[0],_=P[1];_===void 0&&delete y[x]}return y}function pP(e){for(var t={},r=0,n=Object.entries(e||{});r<n.length;r++){var i=mc(n[r],2),a=i[0],o=i[1],s=Ii(o?.Format);t[a]={mimeTypes:s}}return t}function mP(e){var t=zr(e?.Format);if(t.length>0)return{mimeTypes:Ii(e)}}function ng(e){var t,r={title:String(e?.Title||""),name:e?.Name&&String(e?.Name),abstract:e?.Name&&String(e?.Abstract),keywords:Ii((t=e.KeywordList)===null||t===void 0?void 0:t.Keyword)},n=e?.CRS||e?.SRS;n&&Array.isArray(n)&&n.every(function(b){return typeof b=="string"})&&(r.crs=n);var i=e?.EX_GeographicBoundingBox&&vP(e?.EX_GeographicBoundingBox);i&&(r.geographicBoundingBox=i),i=e?.LatLonBoundingBox&&gP(e?.LatLonBoundingBox),i&&(r.geographicBoundingBox=i);var a=e?.BoundingBox&&yP(e?.BoundingBox);a&&a.length>0&&(r.boundingBoxes=a);var o=zr(e?.Dimension),s=o.map(function(b){return _P(b)});s.length&&(r.dimensions=s),e!=null&&e.opaque&&(r.opaque=Wr(e?.opaque)),e!=null&&e.cascaded&&(r.cascaded=Wr(e?.cascaded)),e!=null&&e.queryable&&(r.queryable=Wr(e?.queryable));var u=zr(e?.Layer),f=[],c=Ha(u),l;try{for(c.s();!(l=c.n()).done;){var d=l.value;f.push(ng(d))}}catch(b){c.e(b)}finally{c.f()}f.length>0&&(r.layers=f);for(var h=0,p=Object.entries(r);h<p.length;h++){var m=mc(p[h],2),g=m[0],y=m[1];y===void 0&&delete r[g]}return r}function vP(e){var t=e.westBoundLongitude,r=e.northBoundLatitude,n=e.eastBoundLongitude,i=e.southBoundLatitude;return[[t,i],[n,r]]}function gP(e){var t=e.minx,r=e.miny,n=e.maxx,i=e.maxy;return[[t,r],[n,i]]}function yP(e){var t=zr(e);return t.map(function(r){return bP(r)})}function bP(e){var t=e.CRS,r=e.SRS,n=e.minx,i=e.miny,a=e.maxx,o=e.maxy,s=e.resx,u=e.resy,f={crs:t||r,boundingBox:[[Ri(n),Ri(i)],[Ri(a),Ri(o)]]};return s&&(f.xResolution=s),u&&(f.yResolution=u),f}function _P(e){var t=e.name,r=e.units,n=e.value,i={name:t,units:r,extent:n};return e.unitSymbol&&(i.unitSymbol=e.unitSymbol),e.default&&(i.defaultValue=e.default),e.multipleValues&&(i.multipleValues=Wr(e.multipleValues)),e.nearestValue&&(i.nearestValue=Wr(e.nearestValue)),e.current&&(i.current=Wr(e.current)),i}function ig(e,t){t!=null&&t.geographicBoundingBox&&!e.geographicBoundingBox&&(e.geographicBoundingBox=ka(t.geographicBoundingBox)),t!=null&&t.crs&&!e.crs&&(e.crs=ka(t.crs)),t!=null&&t.boundingBoxes&&!e.boundingBoxes&&(e.boundingBoxes=ka(t.boundingBoxes)),t!=null&&t.dimensions&&!e.dimensions&&(e.dimensions=ka(t.dimensions));var r=Ha(e.layers||[]),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;ig(i,e)}}catch(a){r.e(a)}finally{r.f()}}function ag(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function AP(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){ag(a,n,i,o,s,"next",u)}function s(u){ag(a,n,i,o,s,"throw",u)}o(void 0)})}}var TP="3.4.13",Jr={id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:TP,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:SP,options:{wms:{}},parse:function(){var e=AP(regeneratorRuntime.mark(function r(n,i){return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",gc(new TextDecoder().decode(n),i?.wms));case 1:case"end":return o.stop()}},r)}));function t(r,n){return e.apply(this,arguments)}return t}(),parseTextSync:function(t,r){return gc(t,r?.wms)}};function SP(e){return e.startsWith("<?xml")}function yc(e,t){var r,n=tt.parseTextSync(e,t),i=((r=n.FeatureInfoResponse)===null||r===void 0?void 0:r.FIELDS)||[],a=Array.isArray(i)?i:[i];return{features:a.map(function(o){return wP(o)})}}function wP(e){var t=e||{};return{attributes:t,type:"",bounds:{bottom:0,top:0,left:0,right:0}}}function og(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function xP(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){og(a,n,i,o,s,"next",u)}function s(u){og(a,n,i,o,s,"throw",u)}o(void 0)})}}function sg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ug(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sg(Object(r),!0).forEach(function(n){EP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var bc=ug(ug({},Jr),{},{id:"wms-feature-info",name:"WMS FeatureInfo",parse:function(){var e=xP(regeneratorRuntime.mark(function r(n,i){return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",yc(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},r)}));function t(r,n){return e.apply(this,arguments)}return t}(),parseTextSync:function(t,r){return yc(t,r)}});function _c(e,t){var r,n=(r=tt.parseTextSync)===null||r===void 0?void 0:r.call(tt,e,t);return n}function fg(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function OP(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){fg(a,n,i,o,s,"next",u)}function s(u){fg(a,n,i,o,s,"throw",u)}o(void 0)})}}function cg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function lg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cg(Object(r),!0).forEach(function(n){PP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ac=lg(lg({},Jr),{},{id:"wms-layer-description",name:"WMS DescribeLayer",parse:function(){var e=OP(regeneratorRuntime.mark(function r(n,i){return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",_c(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},r)}));function t(r,n){return e.apply(this,arguments)}return t}(),parseTextSync:function(t,r){return _c(t,r)}});function hg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hg(Object(r),!0).forEach(function(n){BP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var pg=function(){function e(r){CP(this,e),v(this,"fetch",void 0),v(this,"loadOptions",void 0),v(this,"_needsRefresh",!0),v(this,"props",void 0),this.props=dg({},r),this.loadOptions=dg({},r.loadOptions),this.fetch=MP(this.loadOptions)}var t=e.prototype;return t.setProps=function(n){this.props=Object.assign(this.props,n),this.setNeedsRefresh()},t.setNeedsRefresh=function(){this._needsRefresh=!0},t.getNeedsRefresh=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,i=this._needsRefresh;return n&&(this._needsRefresh=!1),i},e}();function MP(e){var t=e?.fetch;if(t&&typeof t=="function")return function(n,i){return t(n,i)};var r=e?.fetch;return r&&typeof r!="function"?function(n){return fetch(n,r)}:function(n){return fetch(n)}}function Va(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Va=function(r){return typeof r}:Va=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Va(e)}function IP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RP(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Tc(e,t)}function Tc(e,t){return Tc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Tc(e,t)}function FP(e){var t=GP();return function(){var n=za(e),i;if(t){var a=za(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return LP(this,i)}}function LP(e,t){if(t&&(Va(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return DP(e)}function DP(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GP(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function za(e){return za=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},za(e)}var zt=function(e){RP(r,e);var t=FP(r);function r(){return IP(this,r),t.apply(this,arguments)}return r}(pg);var mg="3.4.13";var NP=globalThis._parseImageNode,Sc=typeof Image<"u",wc=typeof ImageBitmap<"u",UP=Boolean(NP),xc=xi?!0:UP;function vg(e){switch(e){case"auto":return wc||Sc||xc;case"imagebitmap":return wc;case"image":return Sc;case"data":return xc;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}function gg(){if(wc)return"imagebitmap";if(Sc)return"image";if(xc)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Wa(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Wa=function(r){return typeof r}:Wa=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Wa(e)}function jP(e){var t=kP(e);if(!t)throw new Error("Not an image");return t}function yg(e){switch(jP(e)){case"data":return e;case"image":case"imagebitmap":var 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 kP(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&Wa(e)==="object"&&e.data&&e.width&&e.height?"data":null}var HP=/^data:image\/svg\+xml/,VP=/\.svg((\?|#).*)?$/;function Ja(e){return e&&(HP.test(e)||VP.test(e))}function bg(e,t){if(Ja(t)){var r=new TextDecoder,n=r.decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(a){throw new Error(a.message)}var i="data:image/svg+xml;base64,".concat(btoa(n));return i}return Ec(e,t)}function Ec(e,t){if(Ja(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function _g(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function Ag(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){_g(a,n,i,o,s,"next",u)}function s(u){_g(a,n,i,o,s,"throw",u)}o(void 0)})}}function Fi(e,t,r){return Oc.apply(this,arguments)}function Oc(){return Oc=Ag(regeneratorRuntime.mark(function e(t,r,n){var i,a,o;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return i=bg(t,n),a=self.URL||self.webkitURL,o=typeof i!="string"&&a.createObjectURL(i),u.prev=3,u.next=6,zP(o||i,r);case 6:return u.abrupt("return",u.sent);case 7:return u.prev=7,o&&a.revokeObjectURL(o),u.finish(7);case 10:case"end":return u.stop()}},e,null,[[3,,7,10]])})),Oc.apply(this,arguments)}function zP(e,t){return Pc.apply(this,arguments)}function Pc(){return Pc=Ag(regeneratorRuntime.mark(function e(t,r){var n;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(n=new Image,n.src=t,!(r.image&&r.image.decode&&n.decode)){a.next=6;break}return a.next=5,n.decode();case 5:return a.abrupt("return",n);case 6:return a.next=8,new Promise(function(o,s){try{n.onload=function(){return o(n)},n.onerror=function(u){return s(new Error("Could not load image ".concat(t,": ").concat(u)))}}catch(u){s(u)}});case 8:return a.abrupt("return",a.sent);case 9:case"end":return a.stop()}},e)})),Pc.apply(this,arguments)}function Tg(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function wg(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){Tg(a,n,i,o,s,"next",u)}function s(u){Tg(a,n,i,o,s,"throw",u)}o(void 0)})}}var WP={},Sg=!0;function Mc(e,t,r){return Bc.apply(this,arguments)}function Bc(){return Bc=wg(regeneratorRuntime.mark(function e(t,r,n){var i,a,o;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!Ja(n)){u.next=7;break}return u.next=3,Fi(t,r,n);case 3:a=u.sent,i=a,u.next=8;break;case 7:i=Ec(t,n);case 8:return o=r&&r.imagebitmap,u.next=11,JP(i,o);case 11:return u.abrupt("return",u.sent);case 12:case"end":return u.stop()}},e)})),Bc.apply(this,arguments)}function JP(e){return Cc.apply(this,arguments)}function Cc(){return Cc=wg(regeneratorRuntime.mark(function e(t){var r,n=arguments;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(r=n.length>1&&n[1]!==void 0?n[1]:null,(XP(r)||!Sg)&&(r=null),!r){a.next=13;break}return a.prev=3,a.next=6,createImageBitmap(t,r);case 6:return a.abrupt("return",a.sent);case 9:a.prev=9,a.t0=a.catch(3),console.warn(a.t0),Sg=!1;case 13:return a.next=15,createImageBitmap(t);case 15:return a.abrupt("return",a.sent);case 16:case"end":return a.stop()}},e,null,[[3,9]])})),Cc.apply(this,arguments)}function XP(e){for(var t in e||WP)return!1;return!0}function xg(e){return $P(e)||YP(e)||KP(e)||qP()}function qP(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
20
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KP(e,t){if(e){if(typeof e=="string")return Ic(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ic(e,t)}}function YP(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $P(e){if(Array.isArray(e))return Ic(e)}function Ic(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Eg(e){return!tB(e,"ftyp",4)||!(e[8]&96)?null:ZP(e)}function ZP(e){var t=QP(e,8,12).replace("\0"," ").trim();switch(t){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function QP(e,t,r){return String.fromCharCode.apply(String,xg(e.slice(t,r)))}function eB(e){return xg(e).map(function(t){return t.charCodeAt(0)})}function tB(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=eB(t),i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var Pt=!1,Li=!0;function Xr(e){var t=Di(e);return nB(t)||oB(t)||iB(t)||aB(t)||rB(t)}function rB(e){var t=new Uint8Array(e instanceof DataView?e.buffer:e),r=Eg(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function nB(e){var t=Di(e),r=t.byteLength>=24&&t.getUint32(0,Pt)===2303741511;return r?{mimeType:"image/png",width:t.getUint32(16,Pt),height:t.getUint32(20,Pt)}:null}function iB(e){var t=Di(e),r=t.byteLength>=10&&t.getUint32(0,Pt)===1195984440;return r?{mimeType:"image/gif",width:t.getUint16(6,Li),height:t.getUint16(8,Li)}:null}function aB(e){var t=Di(e),r=t.byteLength>=14&&t.getUint16(0,Pt)===16973&&t.getUint32(2,Li)===t.byteLength;return r?{mimeType:"image/bmp",width:t.getUint32(18,Li),height:t.getUint32(22,Li)}:null}function oB(e){var t=Di(e),r=t.byteLength>=3&&t.getUint16(0,Pt)===65496&&t.getUint8(2)===255;if(!r)return null;for(var n=sB(),i=n.tableMarkers,a=n.sofMarkers,o=2;o+9<t.byteLength;){var s=t.getUint16(o,Pt);if(a.has(s))return{mimeType:"image/jpeg",height:t.getUint16(o+5,Pt),width:t.getUint16(o+7,Pt)};if(!i.has(s))return null;o+=2,o+=t.getUint16(o,Pt)}return null}function sB(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var r=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:r}}function Di(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")}function Og(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function uB(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){Og(a,n,i,o,s,"next",u)}function s(u){Og(a,n,i,o,s,"throw",u)}o(void 0)})}}function Fc(e,t){return Rc.apply(this,arguments)}function Rc(){return Rc=uB(regeneratorRuntime.mark(function e(t,r){var n,i,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=Xr(t)||{},i=n.mimeType,a=globalThis._parseImageNode,Z(a),s.next=5,a(t,i);case 5:return s.abrupt("return",s.sent);case 6:case"end":return s.stop()}},e)})),Rc.apply(this,arguments)}function Pg(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function fB(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){Pg(a,n,i,o,s,"next",u)}function s(u){Pg(a,n,i,o,s,"throw",u)}o(void 0)})}}function Dc(e,t,r){return Lc.apply(this,arguments)}function Lc(){return Lc=fB(regeneratorRuntime.mark(function e(t,r,n){var i,a,o,s,u,f;return regeneratorRuntime.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:r=r||{},i=r.image||{},a=i.type||"auto",o=n||{},s=o.url,u=cB(a),l.t0=u,l.next=l.t0==="imagebitmap"?8:l.t0==="image"?12:l.t0==="data"?16:20;break;case 8:return l.next=10,Mc(t,r,s);case 10:return f=l.sent,l.abrupt("break",21);case 12:return l.next=14,Fi(t,r,s);case 14:return f=l.sent,l.abrupt("break",21);case 16:return l.next=18,Fc(t,r);case 18:return f=l.sent,l.abrupt("break",21);case 20:Z(!1);case 21:return a==="data"&&(f=yg(f)),l.abrupt("return",f);case 23:case"end":return l.stop()}},e)})),Lc.apply(this,arguments)}function cB(e){switch(e){case"auto":case"data":return gg();default:return vg(e),e}}var lB=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],hB=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],dB={image:{type:"auto",decode:!0}},Wt={id:"image",module:"images",name:"Images",version:mg,mimeTypes:hB,extensions:lB,parse:Dc,tests:[function(e){return Boolean(Xr(new DataView(e)))}],options:dB};var Gc={};function Nc(e){if(Gc[e]===void 0){var t=xi?mB(e):pB(e);Gc[e]=t}return Gc[e]}function pB(e){var t=["image/png","image/jpeg","image/gif"],r=globalThis._parseImageNode,n=globalThis._imageFormatsNode,i=n===void 0?t:n;return Boolean(r)&&i.includes(e)}function mB(e){switch(e){case"image/avif":case"image/webp":return vB(e);default:return!0}}function vB(e){try{var t=document.createElement("canvas"),r=t.toDataURL(e);return r.indexOf("data:".concat(e))===0}catch{return!1}}function Xa(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Xa=function(r){return typeof r}:Xa=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Xa(e)}function Bg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Cg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bg(Object(r),!0).forEach(function(n){gB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mg(e,t){return AB(e)||_B(e,t)||bB(e,t)||yB()}function yB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
21
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bB(e,t){if(e){if(typeof e=="string")return Ig(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ig(e,t)}}function Ig(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _B(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function AB(e){if(Array.isArray(e))return e}function Rg(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function Fg(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){Rg(a,n,i,o,s,"next",u)}function s(u){Rg(a,n,i,o,s,"throw",u)}o(void 0)})}}function TB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SB(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Uc(e,t)}function Uc(e,t){return Uc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Uc(e,t)}function wB(e){var t=OB();return function(){var n=qa(e),i;if(t){var a=qa(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return xB(this,i)}}function xB(e,t){if(t&&(Xa(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return EB(e)}function EB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OB(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qa(e){return qa=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},qa(e)}var Gi=function(e){SB(r,e);var t=wB(r);function r(i){return TB(this,r),t.call(this,i)}var n=r.prototype;return n.getMetadata=function(){var i=Fg(regeneratorRuntime.mark(function o(){return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:throw new Error("ImageSource.getMetadata not implemented");case 1:case"end":return u.stop()}},o)}));function a(){return i.apply(this,arguments)}return a}(),n.getImage=function(){var i=Fg(regeneratorRuntime.mark(function o(s){var u,f,c,l;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return u=this.getGranularParameters(s),f=this.getURLFromTemplate(u),h.next=4,this.fetch(f);case 4:return c=h.sent,h.next=7,c.arrayBuffer();case 7:return l=h.sent,h.next=10,Wt.parse(l);case 10:return h.abrupt("return",h.sent);case 11:case"end":return h.stop()}},o,this)}));function a(o){return i.apply(this,arguments)}return a}(),n.getGranularParameters=function(a){var o=Mg(a.bbox,4),s=o[0],u=o[1],f=o[2],c=o[3];return Cg(Cg({},a),{},{east:s,north:u,south:c,west:f})},n.getURLFromTemplate=function(a){for(var o=this.props.url,s=0,u=Object.entries(a);s<u.length;s++){var f=Mg(u[s],2),c=f[0],l=f[1];o=o.replace("${".concat(c,"}"),String(l)),o=o.replace("{".concat(c,"}"),String(l))}return o},r}(zt);v(Gi,"type","template");v(Gi,"testURL",function(e){return e.toLowerCase().includes("{")});function Ka(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ka=function(r){return typeof r}:Ka=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ka(e)}function PB(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ng(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
22
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function jc(e,t){return MB(e)||CB(e,t)||Ng(e,t)||BB()}function BB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
23
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ng(e,t){if(e){if(typeof e=="string")return Lg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lg(e,t)}}function Lg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function CB(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function MB(e){if(Array.isArray(e))return e}function Dg(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function Jt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){Dg(a,n,i,o,s,"next",u)}function s(u){Dg(a,n,i,o,s,"throw",u)}o(void 0)})}}function Gg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Bt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gg(Object(r),!0).forEach(function(n){IB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FB(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&kc(e,t)}function kc(e,t){return kc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},kc(e,t)}function LB(e){var t=GB();return function(){var n=Ya(e),i;if(t){var a=Ya(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return DB(this,i)}}function DB(e,t){if(t&&(Ka(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cr(e)}function cr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GB(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ya(e){return Ya=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ya(e)}var Ni=function(e){FB(r,e);var t=LB(r);function r(i){var a;RB(this,r);var o;return a=t.call(this,i),v(cr(a),"url",void 0),v(cr(a),"substituteCRS84",void 0),v(cr(a),"flipCRS",void 0),v(cr(a),"wmsParameters",void 0),v(cr(a),"vendorParameters",void 0),v(cr(a),"capabilities",null),v(cr(a),"loaders",[Wt,En,Jr,bc,Ac]),a.url=i.url,a.substituteCRS84=(o=i.substituteCRS84)!==null&&o!==void 0?o:!1,a.flipCRS=["EPSG:4326"],a.wmsParameters=Bt({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},i.wmsParameters),a.vendorParameters=i.vendorParameters||{},a}var n=r.prototype;return n.getMetadata=function(){var i=Jt(regeneratorRuntime.mark(function o(){var s;return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.getCapabilities();case 2:return s=f.sent,f.abrupt("return",this.normalizeMetadata(s));case 4:case"end":return f.stop()}},o,this)}));function a(){return i.apply(this,arguments)}return a}(),n.getImage=function(){var i=Jt(regeneratorRuntime.mark(function o(s){return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.getMap(s);case 2:return f.abrupt("return",f.sent);case 3:case"end":return f.stop()}},o,this)}));function a(o){return i.apply(this,arguments)}return a}(),n.normalizeMetadata=function(a){return a},n.getCapabilities=function(){var i=Jt(regeneratorRuntime.mark(function o(s,u){var f,c,l,d;return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return f=this.getCapabilitiesURL(s,u),p.next=3,this.fetch(f);case 3:return c=p.sent,p.next=6,c.arrayBuffer();case 6:return l=p.sent,this._checkResponse(c,l),p.next=10,Jr.parse(l,this.loadOptions);case 10:return d=p.sent,this.capabilities=d,p.abrupt("return",d);case 13:case"end":return p.stop()}},o,this)}));function a(o,s){return i.apply(this,arguments)}return a}(),n.getMap=function(){var i=Jt(regeneratorRuntime.mark(function o(s,u){var f,c,l;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return f=this.getMapURL(s,u),h.next=3,this.fetch(f);case 3:return c=h.sent,h.next=6,c.arrayBuffer();case 6:return l=h.sent,this._checkResponse(c,l),h.prev=8,h.next=11,Wt.parse(l,this.loadOptions);case 11:return h.abrupt("return",h.sent);case 14:throw h.prev=14,h.t0=h.catch(8),this._parseError(l);case 17:case"end":return h.stop()}},o,this,[[8,14]])}));function a(o,s){return i.apply(this,arguments)}return a}(),n.getFeatureInfo=function(){var i=Jt(regeneratorRuntime.mark(function o(s,u){var f,c,l;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return f=this.getFeatureInfoURL(s,u),h.next=3,this.fetch(f);case 3:return c=h.sent,h.next=6,c.arrayBuffer();case 6:return l=h.sent,this._checkResponse(c,l),h.next=10,bc.parse(l,this.loadOptions);case 10:return h.abrupt("return",h.sent);case 11:case"end":return h.stop()}},o,this)}));function a(o,s){return i.apply(this,arguments)}return a}(),n.getFeatureInfoText=function(){var i=Jt(regeneratorRuntime.mark(function o(s,u){var f,c,l;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return f=this.getFeatureInfoURL(s,u),h.next=3,this.fetch(f);case 3:return c=h.sent,h.next=6,c.arrayBuffer();case 6:return l=h.sent,this._checkResponse(c,l),h.abrupt("return",new TextDecoder().decode(l));case 9:case"end":return h.stop()}},o,this)}));function a(o,s){return i.apply(this,arguments)}return a}(),n.describeLayer=function(){var i=Jt(regeneratorRuntime.mark(function o(s,u){var f,c,l;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return f=this.describeLayerURL(s,u),h.next=3,this.fetch(f);case 3:return c=h.sent,h.next=6,c.arrayBuffer();case 6:return l=h.sent,this._checkResponse(c,l),h.next=10,Ac.parse(l,this.loadOptions);case 10:return h.abrupt("return",h.sent);case 11:case"end":return h.stop()}},o,this)}));function a(o,s){return i.apply(this,arguments)}return a}(),n.getLegendGraphic=function(){var i=Jt(regeneratorRuntime.mark(function o(s,u){var f,c,l;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return f=this.getLegendGraphicURL(s,u),h.next=3,this.fetch(f);case 3:return c=h.sent,h.next=6,c.arrayBuffer();case 6:return l=h.sent,this._checkResponse(c,l),h.prev=8,h.next=11,Wt.parse(l,this.loadOptions);case 11:return h.abrupt("return",h.sent);case 14:throw h.prev=14,h.t0=h.catch(8),this._parseError(l);case 17:case"end":return h.stop()}},o,this,[[8,14]])}));function a(o,s){return i.apply(this,arguments)}return a}(),n.getCapabilitiesURL=function(a,o){var s=Bt({version:this.wmsParameters.version},a);return this._getWMSUrl("GetCapabilities",s,o)},n.getMapURL=function(a,o){a=this._getWMS130Parameters(a);var s=Bt({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},a);return this._getWMSUrl("GetMap",s,o)},n.getFeatureInfoURL=function(a,o){var s=Bt({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},a);return this._getWMSUrl("GetFeatureInfo",s,o)},n.describeLayerURL=function(a,o){var s=Bt({version:this.wmsParameters.version},a);return this._getWMSUrl("DescribeLayer",s,o)},n.getLegendGraphicURL=function(a,o){var s=Bt({version:this.wmsParameters.version},a);return this._getWMSUrl("GetLegendGraphic",s,o)},n._parseWMSUrl=function(a){var o=a.split("?"),s=jc(o,2),u=s[0],f=s[1],c=f.split("&"),l={},d=PB(c),h;try{for(d.s();!(h=d.n()).done;){var p=h.value,m=p.split("="),g=jc(m,2),y=g[0],b=g[1];l[y]=b}}catch(A){d.e(A)}finally{d.f()}return{url:u,parameters:l}},n._getWMSUrl=function(a,o,s){for(var u=this.url,f=!0,c=Bt(Bt(Bt({service:"WMS",version:o.version,request:a},o),this.vendorParameters),s),l=["transparent","time","elevation"],d=0,h=Object.entries(c);d<h.length;d++){var p=jc(h[d],2),m=p[0],g=p[1];(!l.includes(m)||g)&&(u+=f?"?":"&",f=!1,u+=this._getURLParameter(m,g,o))}return encodeURI(u)},n._getWMS130Parameters=function(a){var o=Bt({},a);return o.srs&&(o.crs=o.crs||o.srs,delete o.srs),o},n._getURLParameter=function(a,o,s){switch(a){case"crs":s.version!=="1.3.0"?a="srs":this.substituteCRS84&&o==="EPSG:4326"&&(o="CRS:84");break;case"srs":s.version==="1.3.0"&&(a="crs");break;case"bbox":var u=this._flipBoundingBox(o,s);u&&(o=u);break;default:}return a=a.toUpperCase(),Array.isArray(o)?"".concat(a,"=").concat(o.join(",")):"".concat(a,"=").concat(o?String(o):"")},n._flipBoundingBox=function(a,o){if(!Array.isArray(a)||a.length!==4)return null;var s=o.version==="1.3.0"&&this.flipCRS.includes(o.crs||"")&&!(this.substituteCRS84&&o.crs==="EPSG:4326"),u=a;return s?[u[1],u[0],u[3],u[2]]:u},n._fetchArrayBuffer=function(){var i=Jt(regeneratorRuntime.mark(function o(s){var u,f;return regeneratorRuntime.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.fetch(s);case 2:return u=l.sent,l.next=5,u.arrayBuffer();case 5:return f=l.sent,this._checkResponse(u,f),l.abrupt("return",f);case 8:case"end":return l.stop()}},o,this)}));function a(o){return i.apply(this,arguments)}return a}(),n._checkResponse=function(a,o){var s=a.headers["content-type"];if(!a.ok||En.mimeTypes.includes(s)){var u=oc(this.loadOptions,{wms:{throwOnError:!0}}),f=En.parseSync(o,u);throw new Error(f)}},n._parseError=function(a){var o=En.parseSync(a,this.loadOptions);return new Error(o)},r}(zt);v(Ni,"type","wms");v(Ni,"testURL",function(e){return e.toLowerCase().includes("wms")});function Za(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Za=function(r){return typeof r}:Za=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Za(e)}function NB(e,t){return HB(e)||kB(e,t)||jB(e,t)||UB()}function UB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
24
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jB(e,t){if(e){if(typeof e=="string")return Ug(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ug(e,t)}}function Ug(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kB(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function HB(e){if(Array.isArray(e))return e}function jg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jg(Object(r),!0).forEach(function(n){VB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function VB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hg(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function $a(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){Hg(a,n,i,o,s,"next",u)}function s(u){Hg(a,n,i,o,s,"throw",u)}o(void 0)})}}function zB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WB(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Hc(e,t)}function Hc(e,t){return Hc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Hc(e,t)}function JB(e){var t=KB();return function(){var n=Qa(e),i;if(t){var a=Qa(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return XB(this,i)}}function XB(e,t){if(t&&(Za(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qB(e)}function qB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KB(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qa(e){return Qa=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Qa(e)}var eo=function(e){WB(r,e);var t=JB(r);function r(i){return zB(this,r),t.call(this,i)}var n=r.prototype;return n.getMetadata=function(){var i=$a(regeneratorRuntime.mark(function o(){return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.metadata();case 2:return u.abrupt("return",u.sent);case 3:case"end":return u.stop()}},o,this)}));function a(){return i.apply(this,arguments)}return a}(),n.getImage=function(){var i=$a(regeneratorRuntime.mark(function o(s){return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:throw new Error("not implemented");case 1:case"end":return f.stop()}},o)}));function a(o){return i.apply(this,arguments)}return a}(),n.metadata=function(){var i=$a(regeneratorRuntime.mark(function o(){return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:throw new Error("not implemented");case 1:case"end":return u.stop()}},o)}));function a(){return i.apply(this,arguments)}return a}(),n.exportImage=function(a){throw new Error("not implemented")},n.metadataURL=function(a){return"".concat(this.props.url,"?f=pjson")},n.exportImageURL=function(a){var o="bbox=".concat(a.bbox[0],",").concat(a.bbox[1],",").concat(a.bbox[2],",").concat(a.bbox[3]),s="size=".concat(a.width,",").concat(a.height),u=kg(kg({},a),{},{bbox:o,size:s});return delete u.width,delete u.height,this.getUrl("exportImage",u)},n.getUrl=function(a,o,s){for(var u="".concat(this.props.url,"/").concat(a),f=!0,c=0,l=Object.entries(o);c<l.length;c++){var d=NB(l[c],2),h=d[0],p=d[1];u+=f?"?":"&",f=!1,Array.isArray(p)?u+="".concat(h.toUpperCase(),"=").concat(p.join(",")):u+="".concat(h.toUpperCase(),"=").concat(p?String(p):"")}return u},n.checkResponse=function(){var i=$a(regeneratorRuntime.mark(function o(s){return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(s.ok){f.next=2;break}throw new Error("error");case 2:case"end":return f.stop()}},o)}));function a(o){return i.apply(this,arguments)}return a}(),r}(zt);v(eo,"type","arcgis-image-server");v(eo,"testURL",function(e){return e.toLowerCase().includes("ImageServer")});function YB(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=$B(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
25
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function $B(e,t){if(e){if(typeof e=="string")return Vg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vg(e,t)}}function Vg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ZB=[Ni,eo,Gi];function Vc(e){var t=e.type,r=t===void 0?"auto":t,n=r==="auto"?QB(e.url):r;switch(n){case"template":return new Gi(e);case"wms":return new Ni(e);default:throw new Error("Not a valid image source type")}}function QB(e){var t=YB(ZB),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;if(n.testURL&&n.testURL(e))return n.type}}catch(i){t.e(i)}finally{t.f()}return"wms"}var he=1e-6,Ie=typeof Float32Array<"u"?Float32Array:Array;var xW=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function eC(){var e=new Ie(4);return Ie!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function zg(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 to(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 Wg(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.hypot(t,r,n,i)}function Jg(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function Xg(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e}function qg(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Kg(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}function ro(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function Yg(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],f=r[3],c=f*n+s*a-u*i,l=f*i+u*n-o*a,d=f*a+o*i-s*n,h=-o*n-s*i-u*a;return e[0]=c*f+h*-o+l*-u-d*-s,e[1]=l*f+h*-s+d*-o-c*-u,e[2]=d*f+h*-u+c*-s-l*-o,e[3]=t[3],e}var EW=function(){var e=eC();return function(t,r,n,i,a,o){var s,u;for(r||(r=4),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();function Pn(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function lr(e,t){var r=ro([],t,e);return to(r,r,1/r[3]),r}function Ui(e,t,r){return e<t?t:e>r?r:e}function tC(e){return Math.log(e)*Math.LOG2E}var no=Math.log2||tC;function rC(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 $g(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=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]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}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 io(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],f=t[7],c=t[8],l=t[9],d=t[10],h=t[11],p=t[12],m=t[13],g=t[14],y=t[15],b=r*s-n*o,A=r*u-i*o,S=r*f-a*o,O=n*u-i*s,w=n*f-a*s,B=i*f-a*u,P=c*m-l*p,x=c*g-d*p,_=c*y-h*p,C=l*g-d*m,I=l*y-h*m,R=d*y-h*g,M=b*R-A*I+S*C+O*_-w*x+B*P;return M?(M=1/M,e[0]=(s*R-u*I+f*C)*M,e[1]=(i*I-n*R-a*C)*M,e[2]=(m*B-g*w+y*O)*M,e[3]=(d*w-l*B-h*O)*M,e[4]=(u*_-o*R-f*x)*M,e[5]=(r*R-i*_+a*x)*M,e[6]=(g*S-p*B-y*A)*M,e[7]=(c*B-d*S+h*A)*M,e[8]=(o*I-s*_+f*P)*M,e[9]=(n*_-r*I-a*P)*M,e[10]=(p*w-m*S+y*b)*M,e[11]=(l*S-c*w-h*b)*M,e[12]=(s*x-o*C-u*P)*M,e[13]=(r*C-n*x+i*P)*M,e[14]=(m*A-p*O-g*b)*M,e[15]=(c*O-l*A+d*b)*M,e):null}function Zg(e){var t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],f=e[8],c=e[9],l=e[10],d=e[11],h=e[12],p=e[13],m=e[14],g=e[15],y=t*o-r*a,b=t*s-n*a,A=t*u-i*a,S=r*s-n*o,O=r*u-i*o,w=n*u-i*s,B=f*p-c*h,P=f*m-l*h,x=f*g-d*h,_=c*m-l*p,C=c*g-d*p,I=l*g-d*m;return y*I-b*C+A*_+S*x-O*P+w*B}function qr(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=t[6],c=t[7],l=t[8],d=t[9],h=t[10],p=t[11],m=t[12],g=t[13],y=t[14],b=t[15],A=r[0],S=r[1],O=r[2],w=r[3];return e[0]=A*n+S*s+O*l+w*m,e[1]=A*i+S*u+O*d+w*g,e[2]=A*a+S*f+O*h+w*y,e[3]=A*o+S*c+O*p+w*b,A=r[4],S=r[5],O=r[6],w=r[7],e[4]=A*n+S*s+O*l+w*m,e[5]=A*i+S*u+O*d+w*g,e[6]=A*a+S*f+O*h+w*y,e[7]=A*o+S*c+O*p+w*b,A=r[8],S=r[9],O=r[10],w=r[11],e[8]=A*n+S*s+O*l+w*m,e[9]=A*i+S*u+O*d+w*g,e[10]=A*a+S*f+O*h+w*y,e[11]=A*o+S*c+O*p+w*b,A=r[12],S=r[13],O=r[14],w=r[15],e[12]=A*n+S*s+O*l+w*m,e[13]=A*i+S*u+O*d+w*g,e[14]=A*a+S*f+O*h+w*y,e[15]=A*o+S*c+O*p+w*b,e}function Kr(e,t,r){var n=r[0],i=r[1],a=r[2],o,s,u,f,c,l,d,h,p,m,g,y;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*a+t[12],e[13]=t[1]*n+t[5]*i+t[9]*a+t[13],e[14]=t[2]*n+t[6]*i+t[10]*a+t[14],e[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],f=t[3],c=t[4],l=t[5],d=t[6],h=t[7],p=t[8],m=t[9],g=t[10],y=t[11],e[0]=o,e[1]=s,e[2]=u,e[3]=f,e[4]=c,e[5]=l,e[6]=d,e[7]=h,e[8]=p,e[9]=m,e[10]=g,e[11]=y,e[12]=o*n+c*i+p*a+t[12],e[13]=s*n+l*i+m*a+t[13],e[14]=u*n+d*i+g*a+t[14],e[15]=f*n+h*i+y*a+t[15]),e}function Bn(e,t,r){var n=r[0],i=r[1],a=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]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Qg(e,t,r,n){var i=n[0],a=n[1],o=n[2],s=Math.hypot(i,a,o),u,f,c,l,d,h,p,m,g,y,b,A,S,O,w,B,P,x,_,C,I,R,M,D;return s<he?null:(s=1/s,i*=s,a*=s,o*=s,u=Math.sin(r),f=Math.cos(r),c=1-f,l=t[0],d=t[1],h=t[2],p=t[3],m=t[4],g=t[5],y=t[6],b=t[7],A=t[8],S=t[9],O=t[10],w=t[11],B=i*i*c+f,P=a*i*c+o*u,x=o*i*c-a*u,_=i*a*c-o*u,C=a*a*c+f,I=o*a*c+i*u,R=i*o*c+a*u,M=a*o*c-i*u,D=o*o*c+f,e[0]=l*B+m*P+A*x,e[1]=d*B+g*P+S*x,e[2]=h*B+y*P+O*x,e[3]=p*B+b*P+w*x,e[4]=l*_+m*C+A*I,e[5]=d*_+g*C+S*I,e[6]=h*_+y*C+O*I,e[7]=p*_+b*C+w*I,e[8]=l*R+m*M+A*D,e[9]=d*R+g*M+S*D,e[10]=h*R+y*M+O*D,e[11]=p*R+b*M+w*D,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function ao(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],f=t[8],c=t[9],l=t[10],d=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]=a*i+f*n,e[5]=o*i+c*n,e[6]=s*i+l*n,e[7]=u*i+d*n,e[8]=f*i-a*n,e[9]=c*i-o*n,e[10]=l*i-s*n,e[11]=d*i-u*n,e}function ey(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],f=t[8],c=t[9],l=t[10],d=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]=a*i-f*n,e[1]=o*i-c*n,e[2]=s*i-l*n,e[3]=u*i-d*n,e[8]=a*n+f*i,e[9]=o*n+c*i,e[10]=s*n+l*i,e[11]=u*n+d*i,e}function oo(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],f=t[4],c=t[5],l=t[6],d=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]=a*i+f*n,e[1]=o*i+c*n,e[2]=s*i+l*n,e[3]=u*i+d*n,e[4]=f*i-a*n,e[5]=c*i-o*n,e[6]=l*i-s*n,e[7]=d*i-u*n,e}function ty(e,t){var r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],f=t[9],c=t[10];return e[0]=Math.hypot(r,n,i),e[1]=Math.hypot(a,o,s),e[2]=Math.hypot(u,f,c),e}function ry(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,f=r*o,c=n*o,l=n*s,d=i*o,h=i*s,p=i*u,m=a*o,g=a*s,y=a*u;return e[0]=1-l-p,e[1]=c+y,e[2]=d-g,e[3]=0,e[4]=c-y,e[5]=1-f-p,e[6]=h+m,e[7]=0,e[8]=d+g,e[9]=h-m,e[10]=1-f-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ny(e,t,r,n,i,a,o){var s=1/(r-t),u=1/(i-n),f=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(o+a)*f,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*f,e[15]=0,e}function nC(e,t,r,n,i){var a=1/Math.tan(t/2),o;return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(o=1/(n-i),e[10]=(i+n)*o,e[14]=2*i*n*o):(e[10]=-1,e[14]=-2*n),e}var so=nC;function iC(e,t,r,n,i,a,o){var s=1/(t-r),u=1/(n-i),f=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*f,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(o+a)*f,e[15]=1,e}var iy=iC;function ay(e,t,r,n){var i,a,o,s,u,f,c,l,d,h,p=t[0],m=t[1],g=t[2],y=n[0],b=n[1],A=n[2],S=r[0],O=r[1],w=r[2];return Math.abs(p-S)<he&&Math.abs(m-O)<he&&Math.abs(g-w)<he?rC(e):(c=p-S,l=m-O,d=g-w,h=1/Math.hypot(c,l,d),c*=h,l*=h,d*=h,i=b*d-A*l,a=A*c-y*d,o=y*l-b*c,h=Math.hypot(i,a,o),h?(h=1/h,i*=h,a*=h,o*=h):(i=0,a=0,o=0),s=l*o-d*a,u=d*i-c*o,f=c*a-l*i,h=Math.hypot(s,u,f),h?(h=1/h,s*=h,u*=h,f*=h):(s=0,u=0,f=0),e[0]=i,e[1]=s,e[2]=c,e[3]=0,e[4]=a,e[5]=u,e[6]=l,e[7]=0,e[8]=o,e[9]=f,e[10]=d,e[11]=0,e[12]=-(i*p+a*m+o*g),e[13]=-(s*p+u*m+f*g),e[14]=-(c*p+l*m+d*g),e[15]=1,e)}function Jc(e,t){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],f=e[7],c=e[8],l=e[9],d=e[10],h=e[11],p=e[12],m=e[13],g=e[14],y=e[15],b=t[0],A=t[1],S=t[2],O=t[3],w=t[4],B=t[5],P=t[6],x=t[7],_=t[8],C=t[9],I=t[10],R=t[11],M=t[12],D=t[13],N=t[14],j=t[15];return Math.abs(r-b)<=he*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-A)<=he*Math.max(1,Math.abs(n),Math.abs(A))&&Math.abs(i-S)<=he*Math.max(1,Math.abs(i),Math.abs(S))&&Math.abs(a-O)<=he*Math.max(1,Math.abs(a),Math.abs(O))&&Math.abs(o-w)<=he*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-B)<=he*Math.max(1,Math.abs(s),Math.abs(B))&&Math.abs(u-P)<=he*Math.max(1,Math.abs(u),Math.abs(P))&&Math.abs(f-x)<=he*Math.max(1,Math.abs(f),Math.abs(x))&&Math.abs(c-_)<=he*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(l-C)<=he*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(d-I)<=he*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(h-R)<=he*Math.max(1,Math.abs(h),Math.abs(R))&&Math.abs(p-M)<=he*Math.max(1,Math.abs(p),Math.abs(M))&&Math.abs(m-D)<=he*Math.max(1,Math.abs(m),Math.abs(D))&&Math.abs(g-N)<=he*Math.max(1,Math.abs(g),Math.abs(N))&&Math.abs(y-j)<=he*Math.max(1,Math.abs(y),Math.abs(j))}function aC(){var e=new Ie(2);return Ie!=Float32Array&&(e[0]=0,e[1]=0),e}function Xc(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}function oy(e,t){return e[0]=-t[0],e[1]=-t[1],e}function fo(e,t,r,n){var i=t[0],a=t[1];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e}function sy(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e}function uy(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e}function co(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function lo(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var BW=function(){var e=aC();return function(t,r,n,i,a,o){var s,u;for(r||(r=2),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],a(e,e,o),t[s]=e[0],t[s+1]=e[1];return t}}();function qc(){var e=new Ie(3);return Ie!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Kc(e){var t=e[0],r=e[1],n=e[2];return Math.hypot(t,r,n)}function Yc(e,t,r){var n=new Ie(3);return n[0]=e,n[1]=t,n[2]=r,n}function fy(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function oC(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function cy(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function ly(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function ji(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Mn(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e}function In(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}function ho(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}function po(e,t,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],f=t[2],c=i*f-a*u,l=a*s-n*f,d=n*u-i*s,h=i*d-a*l,p=a*c-n*d,m=n*l-i*c,g=o*2;return c*=g,l*=g,d*=g,h*=2,p*=2,m*=2,e[0]=s+c+h,e[1]=u+l+p,e[2]=f+d+m,e}function hy(e,t,r,n){var i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function dy(e,t,r,n){var i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function py(e,t,r,n){var i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function my(e,t){var r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2],u=Math.sqrt(r*r+n*n+i*i),f=Math.sqrt(a*a+o*o+s*s),c=u*f,l=c&&ji(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}var vy=oC;var gy=Kc;var CW=function(){var e=qc();return function(t,r,n,i,a,o){var s,u;for(r||(r=3),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}}();function pt(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}function mo(e,t){return cC(e)||fC(e,t)||uC(e,t)||sC()}function sC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
26
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uC(e,t){if(e){if(typeof e=="string")return yy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yy(e,t)}}function yy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fC(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function cC(e){if(Array.isArray(e))return e}var mt=Math.PI,_y=mt/4,Ct=mt/180,$c=180/mt,ki=512,by=4003e4,Fn=85.051129,Zc=1.5;function vo(e){return Math.pow(2,e)}function Ge(e){var t=mo(e,2),r=t[0],n=t[1];pt(Number.isFinite(r)),pt(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var i=r*Ct,a=n*Ct,o=ki*(i+mt)/(2*mt),s=ki*(mt+Math.log(Math.tan(_y+a*.5)))/(2*mt);return[o,s]}function Ve(e){var t=mo(e,2),r=t[0],n=t[1],i=r/ki*(2*mt)-mt,a=2*(Math.atan(Math.exp(n/ki*(2*mt)-mt))-_y);return[i*$c,a*$c]}function Qc(e){var t=e.latitude,r=e.longitude,n=e.highPrecision,i=n===void 0?!1:n;pt(Number.isFinite(t)&&Number.isFinite(r));var a=ki,o=Math.cos(t*Ct),s=a/360,u=s/o,f=a/by/o,c={unitsPerMeter:[f,f,f],metersPerUnit:[1/f,1/f,1/f],unitsPerDegree:[s,u,f],degreesPerUnit:[1/s,1/u,1/f]};if(i){var l=Ct*Math.tan(t*Ct)/o,d=s*l/2,h=a/by*l,p=h/u*f;c.unitsPerDegree2=[0,d,h],c.unitsPerMeter2=[p,0,p]}return c}function el(e){var t=e.height,r=e.pitch,n=e.bearing,i=e.altitude,a=e.scale,o=e.center,s=Pn();Kr(s,s,[0,0,-i]),ao(s,s,-r*Ct),oo(s,s,n*Ct);var u=a/t;return Bn(s,s,[u,u,u]),o&&Kr(s,s,cy([],o)),s}function Ay(e){var t=e.width,r=e.height,n=e.altitude,i=e.pitch,a=i===void 0?0:i,o=e.offset,s=e.center,u=e.scale,f=e.nearZMultiplier,c=f===void 0?1:f,l=e.farZMultiplier,d=l===void 0?1:l,h=e.fovy,p=h===void 0?Rn(Zc):h;n!==void 0&&(p=Rn(n));var m=p*Ct,g=a*Ct,y=go(p),b=y;s&&(b+=s[2]*u/Math.cos(g)/r);var A=m*(.5+(o?o[1]:0)/r),S=Math.sin(A)*b/Math.sin(Ui(Math.PI/2-g-A,.01,Math.PI-.01)),O=Math.sin(g)*S+b,w=b*10,B=Math.min(O*d,w);return{fov:m,aspect:t/r,focalDistance:y,near:c,far:B}}function tl(e){var t=Ay(e),r=t.fov,n=t.aspect,i=t.near,a=t.far,o=so([],r,n,i,a);return o}function Rn(e){return 2*Math.atan(.5/e)*$c}function go(e){return .5/Math.tan(.5*e*Ct)}function rl(e,t){var r=mo(e,3),n=r[0],i=r[1],a=r[2],o=a===void 0?0:a;return pt(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o)),lr(t,[n,i,o,1])}function yo(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=mo(e,3),i=n[0],a=n[1],o=n[2];if(pt(Number.isFinite(i)&&Number.isFinite(a),"invalid pixel coordinate"),Number.isFinite(o)){var s=lr(t,[i,a,o,1]);return s}var u=lr(t,[i,a,0,1]),f=lr(t,[i,a,1,1]),c=u[2],l=f[2],d=c===l?0:((r||0)-c)/(l-c);return fo([],u,f,d)}function nl(e,t){return pC(e)||dC(e,t)||hC(e,t)||lC()}function lC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
27
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hC(e,t){if(e){if(typeof e=="string")return Ty(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ty(e,t)}}function Ty(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dC(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function pC(e){if(Array.isArray(e))return e}function bo(e){var t=e.width,r=e.height,n=e.bounds,i=e.minExtent,a=i===void 0?0:i,o=e.maxZoom,s=o===void 0?24:o,u=e.offset,f=u===void 0?[0,0]:u,c=nl(n,2),l=nl(c[0],2),d=l[0],h=l[1],p=nl(c[1],2),m=p[0],g=p[1],y=mC(e.padding),b=Ge([d,Ui(g,-Fn,Fn)]),A=Ge([m,Ui(h,-Fn,Fn)]),S=[Math.max(Math.abs(A[0]-b[0]),a),Math.max(Math.abs(A[1]-b[1]),a)],O=[t-y.left-y.right-Math.abs(f[0])*2,r-y.top-y.bottom-Math.abs(f[1])*2];pt(O[0]>0&&O[1]>0);var w=O[0]/S[0],B=O[1]/S[1],P=(y.right-y.left)/2/w,x=(y.bottom-y.top)/2/B,_=[(A[0]+b[0])/2+P,(A[1]+b[1])/2+x],C=Ve(_),I=Math.min(s,no(Math.abs(Math.min(w,B))));return pt(Number.isFinite(I)),{longitude:C[0],latitude:C[1],zoom:I}}function mC(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:(pt(Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)),e)}var Sy=Math.PI/180;function _o(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=e.width,n=e.height,i=e.unproject,a={targetZ:t},o=i([0,n],a),s=i([r,n],a),u,f,c=e.fovy?.5*e.fovy*Sy:Math.atan(.5/e.altitude),l=(90-e.pitch)*Sy;return c>l-.01?(u=wy(e,0,t),f=wy(e,r,t)):(u=i([0,0],a),f=i([r,0],a)),[o,s,f,u]}function wy(e,t,r){var n=e.pixelUnprojectionMatrix,i=lr(n,[t,0,1,1]),a=lr(n,[t,e.height,1,1]),o=r*e.distanceScales.unitsPerMeter[2],s=(o-i[2])/(a[2]-i[2]),u=fo([],i,a,s),f=Ve(u);return f.push(r),f}function Ao(e){return yC(e)||gC(e)||xy(e)||vC()}function vC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
28
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yC(e){if(Array.isArray(e))return il(e)}function Hi(e,t){return AC(e)||_C(e,t)||xy(e,t)||bC()}function bC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
29
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xy(e,t){if(e){if(typeof e=="string")return il(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return il(e,t)}}function il(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _C(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function AC(e){if(Array.isArray(e))return e}function TC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ey=function(){function e(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{width:1,height:1};TC(this,e),v(this,"latitude",void 0),v(this,"longitude",void 0),v(this,"zoom",void 0),v(this,"pitch",void 0),v(this,"bearing",void 0),v(this,"altitude",void 0),v(this,"fovy",void 0),v(this,"meterOffset",void 0),v(this,"center",void 0),v(this,"width",void 0),v(this,"height",void 0),v(this,"scale",void 0),v(this,"distanceScales",void 0),v(this,"viewMatrix",void 0),v(this,"projectionMatrix",void 0),v(this,"viewProjectionMatrix",void 0),v(this,"pixelProjectionMatrix",void 0),v(this,"pixelUnprojectionMatrix",void 0),v(this,"equals",function(R){return R instanceof e?R.width===r.width&&R.height===r.height&&Jc(R.projectionMatrix,r.projectionMatrix)&&Jc(R.viewMatrix,r.viewMatrix):!1}),v(this,"project",function(R){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},D=M.topLeft,N=D===void 0?!0:D,j=r.projectPosition(R),U=rl(j,r.pixelProjectionMatrix),k=Hi(U,2),H=k[0],W=k[1],re=N?W:r.height-W;return R.length===2?[H,re]:[H,re,U[2]]}),v(this,"unproject",function(R){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},D=M.topLeft,N=D===void 0?!0:D,j=M.targetZ,U=j===void 0?void 0:j,k=Hi(R,3),H=k[0],W=k[1],re=k[2],De=N?W:r.height-W,At=U&&U*r.distanceScales.unitsPerMeter[2],ct=yo([H,De,re],r.pixelUnprojectionMatrix,At),Tt=r.unprojectPosition(ct),kt=Hi(Tt,3),St=kt[0],et=kt[1],Sn=kt[2];return Number.isFinite(re)?[St,et,Sn]:Number.isFinite(U)?[St,et,U]:[St,et]}),v(this,"projectPosition",function(R){var M=Ge(R),D=Hi(M,2),N=D[0],j=D[1],U=(R[2]||0)*r.distanceScales.unitsPerMeter[2];return[N,j,U]}),v(this,"unprojectPosition",function(R){var M=Ve(R),D=Hi(M,2),N=D[0],j=D[1],U=(R[2]||0)*r.distanceScales.metersPerUnit[2];return[N,j,U]});var i=n.width,a=n.height,o=n.altitude,s=o===void 0?null:o,u=n.fovy,f=u===void 0?null:u,c=n.latitude,l=c===void 0?0:c,d=n.longitude,h=d===void 0?0:d,p=n.zoom,m=p===void 0?0:p,g=n.pitch,y=g===void 0?0:g,b=n.bearing,A=b===void 0?0:b,S=n.position,O=S===void 0?null:S,w=n.nearZMultiplier,B=w===void 0?.02:w,P=n.farZMultiplier,x=P===void 0?1.01:P;i=i||1,a=a||1,f===null&&s===null?(s=Zc,f=Rn(s)):f===null?f=Rn(s):s===null&&(s=go(f));var _=vo(m);s=Math.max(.75,s);var C=Qc({longitude:h,latitude:l}),I=Ge([h,l]);I.push(0),O&&fy(I,I,vy([],O,C.unitsPerMeter)),this.projectionMatrix=tl({width:i,height:a,scale:_,center:I,pitch:y,fovy:f,nearZMultiplier:B,farZMultiplier:x}),this.viewMatrix=el({height:a,scale:_,center:I,pitch:y,bearing:A,altitude:s}),this.width=i,this.height=a,this.scale=_,this.latitude=l,this.longitude=h,this.zoom=m,this.pitch=y,this.bearing=A,this.altitude=s,this.fovy=f,this.center=I,this.meterOffset=O||[0,0,0],this.distanceScales=C,this._initMatrices(),Object.freeze(this)}var t=e.prototype;return t._initMatrices=function(){var n=this.width,i=this.height,a=this.projectionMatrix,o=this.viewMatrix,s=Pn();qr(s,s,a),qr(s,s,o),this.viewProjectionMatrix=s;var u=Pn();Bn(u,u,[n/2,-i/2,1]),Kr(u,u,[1,-1,0]),qr(u,u,s);var f=io(Pn(),u);if(!f)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=u,this.pixelUnprojectionMatrix=f},t.projectFlat=function(n){return Ge(n)},t.unprojectFlat=function(n){return Ve(n)},t.getMapCenterByLngLatPosition=function(n){var i=n.lngLat,a=n.pos,o=yo(a,this.pixelUnprojectionMatrix),s=Ge(i),u=Xc([],s,oy([],o)),f=Xc([],this.center,u);return Ve(f)},t.fitBounds=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.width,o=this.height,s=bo(Object.assign({width:a,height:o,bounds:n},i)),u=s.longitude,f=s.latitude,c=s.zoom;return new e({width:a,height:o,longitude:u,latitude:f,zoom:c})},t.getBounds=function(n){var i=this.getBoundingRegion(n),a=Math.min.apply(Math,Ao(i.map(function(f){return f[0]}))),o=Math.max.apply(Math,Ao(i.map(function(f){return f[0]}))),s=Math.min.apply(Math,Ao(i.map(function(f){return f[1]}))),u=Math.max.apply(Math,Ao(i.map(function(f){return f[1]})));return[[a,s],[o,u]]},t.getBoundingRegion=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return _o(this,n.z||0)},t.getLocationAtPoint=function(n){var i=n.lngLat,a=n.pos;return this.getMapCenterByLngLatPosition({lngLat:i,pos:a})},e}();var Oy=6378137*Math.PI;function al(e){var t=Ge(e);return t[0]=(t[0]/256-1)*Oy,t[1]=(t[1]/256-1)*Oy,t}function So(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?So=function(r){return typeof r}:So=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},So(e)}function Py(e,t){return OC(e)||EC(e,t)||xC(e,t)||wC()}function wC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xC(e,t){if(e){if(typeof e=="string")return By(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return By(e,t)}}function By(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function EC(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function OC(e){if(Array.isArray(e))return e}function Cy(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function ol(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){Cy(a,n,i,o,s,"next",u)}function s(u){Cy(a,n,i,o,s,"throw",u)}o(void 0)})}}function My(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function To(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?My(Object(r),!0).forEach(function(n){PC(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):My(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PC(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Iy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function CC(e,t,r){return t&&Iy(e.prototype,t),r&&Iy(e,r),e}function wo(e,t,r){return typeof Reflect<"u"&&Reflect.get?wo=Reflect.get:wo=function(i,a,o){var s=MC(i,a);if(s){var u=Object.getOwnPropertyDescriptor(s,a);return u.get?u.get.call(o):u.value}},wo(e,t,r||e)}function MC(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Ln(e),e!==null););return e}function IC(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&sl(e,t)}function sl(e,t){return sl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},sl(e,t)}function RC(e){var t=DC();return function(){var n=Ln(e),i;if(t){var a=Ln(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return FC(this,i)}}function FC(e,t){if(t&&(So(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LC(e)}function LC(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ln(e){return Ln=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ln(e)}var GC={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:function(){}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:function(){}},onImageLoad:{type:"function",value:function(){}},onImageLoadError:{type:"function",compare:!1,value:function(t,r){return console.error(r,t)}}},xo=function(e){IC(r,e);var t=RC(r);function r(){var i;BC(this,r);for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return i=t.call.apply(t,[this].concat(o)),i.state=void 0,i}var n=r.prototype;return n.shouldUpdateState=function(){return!0},n.initializeState=function(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0},n.updateState=function(a){var o=this,s=a.changeFlags,u=a.props,f=a.oldProps,c=this.context.viewport;s.dataChanged||u.serviceType!==f.serviceType?(this.state.imageSource=this._createImageSource(u),this._loadMetadata(),this.debounce(function(){return o.loadImage(c,"image source changed")},0)):(0,Yr._deepEqual)(u.layers,f.layers,1)?s.viewportChanged&&this.debounce(function(){return o.loadImage(c,"viewport changed")}):this.debounce(function(){return o.loadImage(c,"layers changed")},0)},n.finalizeState=function(){},n.renderLayers=function(){var a=this.state,o=a.bounds,s=a.image,u=a.lastRequestParameters;return s&&new Ry.BitmapLayer(To(To({},this.getSubLayerProps({id:"bitmap"})),{},{_imageCoordinateSystem:u.srs==="EPSG:4326"?Yr.COORDINATE_SYSTEM.LNGLAT:Yr.COORDINATE_SYSTEM.CARTESIAN,bounds:o,image:s}))},n.getFeatureInfoText=function(){var i=ol(regeneratorRuntime.mark(function o(s,u){var f,c,l,d;return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(f=this.state.lastRequestParameters,!f){p.next=6;break}return p.next=4,(c=(l=this.state.imageSource).getFeatureInfoText)===null||c===void 0?void 0:c.call(l,To(To({},f),{},{query_layers:f.layers,x:s,y:u,info_format:"application/vnd.ogc.gml"}));case 4:return d=p.sent,p.abrupt("return",d);case 6:return p.abrupt("return","");case 7:case"end":return p.stop()}},o,this)}));function a(o,s){return i.apply(this,arguments)}return a}(),n._createImageSource=function(a){if(a.data instanceof zt)return a.data;if(typeof a.data=="string")return Vc({url:a.data,loadOptions:a.loadOptions,type:a.serviceType});throw new Error("invalid image source in props.data")},n._loadMetadata=function(){var i=ol(regeneratorRuntime.mark(function o(){var s,u,f,c;return regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return s=this.state.imageSource,d.prev=1,this.state.loadCounter++,d.next=5,s.getMetadata();case 5:u=d.sent,this.state.imageSource===s&&((f=this.getCurrentLayer())===null||f===void 0||f.props.onMetadataLoad(u)),d.next=12;break;case 9:d.prev=9,d.t0=d.catch(1),(c=this.getCurrentLayer())===null||c===void 0||c.props.onMetadataLoadError(d.t0);case 12:return d.prev=12,this.state.loadCounter--,d.finish(12);case 15:case"end":return d.stop()}},o,this,[[1,9,12,15]])}));function a(){return i.apply(this,arguments)}return a}(),n.loadImage=function(){var i=ol(regeneratorRuntime.mark(function o(s,u){var f,c,l,d,h,p,m,g,y,b,A,S,O,w,B,P,x,_,C,I;return regeneratorRuntime.wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(f=this.props,c=f.layers,l=f.serviceType,!(l==="wms"&&c.length===0)){M.next=3;break}return M.abrupt("return");case 3:return d=s.getBounds(),h=s.width,p=s.height,m=this.getRequestId(),g=this.props.srs,g==="auto"&&(g=s.resolution?"EPSG:4326":"EPSG:3857"),y={width:h,height:p,bbox:d,layers:c,srs:g},g==="EPSG:3857"&&(b=al([d[0],d[1]]),A=Py(b,2),S=A[0],O=A[1],w=al([d[2],d[3]]),B=Py(w,2),P=B[0],x=B[1],y.bbox=[S,O,P,x]),M.prev=10,this.state.loadCounter++,this.props.onImageLoadStart(m),M.next=15,this.state.imageSource.getImage(y);case 15:_=M.sent,this.state.lastRequestId<m&&((C=this.getCurrentLayer())===null||C===void 0||C.props.onImageLoad(m),this.setState({image:_,bounds:d,lastRequestParameters:y,lastRequestId:m})),M.next=23;break;case 19:M.prev=19,M.t0=M.catch(10),this.raiseError(M.t0,"Load image"),(I=this.getCurrentLayer())===null||I===void 0||I.props.onImageLoadError(m,M.t0);case 23:return M.prev=23,this.state.loadCounter--,M.finish(23);case 26:case"end":return M.stop()}},o,this,[[10,19,23,26]])}));function a(o,s){return i.apply(this,arguments)}return a}(),n.getRequestId=function(){return this.state._nextRequestId++},n.debounce=function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:500;clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(function(){return a()},o)},CC(r,[{key:"isLoaded",get:function(){return Boolean(this.state)&&this.state.loadCounter===0&&wo(Ln(r.prototype),"isLoaded",this)}}]),r}(Yr.CompositeLayer);xo.layerName="WMSLayer";xo.defaultProps=GC;var Fy=q(ht());function Eo(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Eo=function(r){return typeof r}:Eo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Eo(e)}function NC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UC(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ul(e,t)}function ul(e,t){return ul=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ul(e,t)}function jC(e){var t=VC();return function(){var n=Oo(e),i;if(t){var a=Oo(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return kC(this,i)}}function kC(e,t){if(t&&(Eo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return HC(e)}function HC(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Oo(e){return Oo=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Oo(e)}var zC={getHeight:{type:"accessor",value:0},greatCircle:!0},Po=function(e){UC(r,e);var t=jC(r);function r(){return NC(this,r),t.apply(this,arguments)}return r}(Fy.ArcLayer);Po.layerName="GreatCircleLayer";Po.defaultProps=zC;var Dy=q(dt()),ll=q(ht());function Bo(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bo=function(r){return typeof r}:Bo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Bo(e)}var WC=["updateTriggers"];function JC(e,t){if(e==null)return{};var r=XC(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function XC(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function qC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KC(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&fl(e,t)}function fl(e,t){return fl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},fl(e,t)}function YC(e){var t=QC();return function(){var n=Co(e),i;if(t){var a=Co(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $C(this,i)}}function $C(e,t){if(t&&(Bo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZC(e)}function ZC(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Co(e){return Co=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Co(e)}function Ly(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function cl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ly(Object(r),!0).forEach(function(n){eM(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ly(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var tM=cl({},ll.PolygonLayer.defaultProps),rt=function(e){KC(r,e);var t=YC(r);function r(){return qC(this,r),t.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){return null},n.renderLayers=function(){var a=this.props,o=a.elevationScale,s=a.extruded,u=a.wireframe,f=a.filled,c=a.stroked,l=a.lineWidthUnits,d=a.lineWidthScale,h=a.lineWidthMinPixels,p=a.lineWidthMaxPixels,m=a.lineJointRounded,g=a.lineMiterLimit,y=a.lineDashJustified,b=a.getElevation,A=a.getFillColor,S=a.getLineColor,O=a.getLineWidth,w=this.props,B=w.updateTriggers,P=w.material,x=w.transitions,_=this.getSubLayerClass("cell",ll.PolygonLayer),C=this.indexToBounds()||{},I=C.updateTriggers,R=JC(C,WC);return new _({filled:f,wireframe:u,extruded:s,elevationScale:o,stroked:c,lineWidthUnits:l,lineWidthScale:d,lineWidthMinPixels:h,lineWidthMaxPixels:p,lineJointRounded:m,lineMiterLimit:g,lineDashJustified:y,material:P,transitions:x,getElevation:b,getFillColor:A,getLineColor:S,getLineWidth:O},this.getSubLayerProps({id:"cell",updateTriggers:B&&cl(cl({},I),{},{getElevation:B.getElevation,getFillColor:B.getFillColor,getLineColor:B.getLineColor,getLineWidth:B.getLineWidth})}),R)},r}(Dy.CompositeLayer);rt.layerName="GeoCellLayer";rt.defaultProps=tM;var Mo=q(hl());function ky(e,t){return aM(e)||iM(e,t)||nM(e,t)||rM()}function rM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
31
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nM(e,t){if(e){if(typeof e=="string")return Ny(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ny(e,t)}}function Ny(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function iM(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function aM(e){if(Array.isArray(e))return e}var oM=3,sM=30,uM=2*sM+1,Uy=180/Math.PI;function Hy(e,t,r){var n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function jy(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Vy(e){return[jy(e[0]),jy(e[1])]}function zy(e,t){var r=ky(t,2),n=r[0],i=r[1];switch(e){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function Wy(e){var t=ky(e,3),r=t[0],n=t[1],i=t[2],a=Math.atan2(i,Math.sqrt(r*r+n*n)),o=Math.atan2(n,r);return[o*Uy,a*Uy]}function Jy(e){for(var t=Mo.default.fromString(e,!0,10).toString(2);t.length<oM+uM;)t="0"+t;for(var r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=Mo.default.fromString(n,!0,2).toString(10),s=Mo.default.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}function fM(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);var i=t[0];t[0]=t[1],t[1]=i}}function Xy(e){for(var t=e.split("/"),r=parseInt(t[0],10),n=t[1],i=n.length,a=[0,0],o,s=i-1;s>=0;s--){o=i-s;var u=n[s],f=0,c=0;u==="1"?c=1:u==="2"?(f=1,c=1):u==="3"&&(f=1);var l=Math.pow(2,o-1);fM(l,a,f,c),a[0]+=l*f,a[1]+=l*c}if(r%2===1){var d=a[0];a[0]=a[1],a[1]=d}return{face:r,ij:a,level:o}}var qy=q(hl());function cM(e){var t=e.padEnd(16,"0");return qy.default.fromString(t,16)}var lM=100;function hM(e){for(var t=e.face,r=e.ij,n=e.level,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(lM*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0,f=0;f<4;f++)for(var c=i[f].slice(0),l=i[f+1],d=(l[0]-c[0])/a,h=(l[1]-c[1])/a,p=0;p<a;p++){c[0]+=d,c[1]+=h;var m=Hy(r,n,c),g=Vy(m),y=zy(t,g),b=Wy(y);Math.abs(b[1])>89.999&&(b[0]=u);var A=b[0]-u;b[0]+=A>180?-360:A<-180?360:0,o[s++]=b[0],o[s++]=b[1],u=b[0]}return o[s++]=o[0],o[s++]=o[1],o}function dM(e){if(typeof e=="string"){if(e.indexOf("/")>0)return e;e=cM(e)}return Jy(e.toString())}function Ky(e){var t=dM(e),r=Xy(t);return hM(r)}function Io(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Io=function(r){return typeof r}:Io=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Io(e)}function pM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mM(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&dl(e,t)}function dl(e,t){return dl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},dl(e,t)}function vM(e){var t=bM();return function(){var n=Ro(e),i;if(t){var a=Ro(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return gM(this,i)}}function gM(e,t){if(t&&(Io(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yM(e)}function yM(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bM(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ro(e){return Ro=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ro(e)}var _M={getS2Token:{type:"accessor",value:function(t){return t.token}}},Fo=function(e){mM(r,e);var t=vM(r);function r(){return pM(this,r),t.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){var a=this.props,o=a.data,s=a.getS2Token;return{data:o,_normalize:!1,positionFormat:"XY",getPolygon:function(f,c){return Ky(s(f,c))}}},r}(rt);Fo.layerName="S2Layer";Fo.defaultProps=_M;function pl(e,t){return wM(e)||SM(e,t)||TM(e,t)||AM()}function AM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
32
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TM(e,t){if(e){if(typeof e=="string")return Yy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yy(e,t)}}function Yy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function SM(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function wM(e){if(Array.isArray(e))return e}var ml=512;function xM(e,t){for(var r=0,n=0,i=1<<e.length,a=i/ml,o=0;o<e.length;o++){i>>=1;var s=parseInt(e[o]);s%2&&(r|=i),s>1&&(n|=i)}return[[r/a,ml-n/a],[(r+t)/a,ml-(n+t)/a]]}function $y(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=xM(e,t),n=pl(r,2),i=n[0],a=n[1],o=Ve(i),s=pl(o,2),u=s[0],f=s[1],c=Ve(a),l=pl(c,2),d=l[0],h=l[1];return[d,f,d,h,u,h,u,f,d,f]}function Lo(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Lo=function(r){return typeof r}:Lo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Lo(e)}function EM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OM(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vl(e,t)}function vl(e,t){return vl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},vl(e,t)}function PM(e){var t=MM();return function(){var n=Do(e),i;if(t){var a=Do(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return BM(this,i)}}function BM(e,t){if(t&&(Lo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return CM(e)}function CM(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MM(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Do(e){return Do=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Do(e)}var IM={getQuadkey:{type:"accessor",value:function(t){return t.quadkey}}},Go=function(e){OM(r,e);var t=PM(r);function r(){return EM(this,r),t.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){var a=this.props,o=a.data,s=a.extruded,u=a.getQuadkey,f=s?.99:1;return{data:o,_normalize:!1,positionFormat:"XY",getPolygon:function(l,d){return $y(u(l,d),f)},updateTriggers:{getPolygon:f}}},r}(rt);Go.layerName="QuadkeyLayer";Go.defaultProps=IM;var Es=q(dt()),_b=q(ht());function ee(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var RM=1/Math.PI*180,FM=1/180*Math.PI,de={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function gl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.precision,n=r===void 0?de.precision:r;return e=LM(e),"".concat(parseFloat(e.toPrecision(n)))}function Ne(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function yl(e){return Zy(e)}function bl(e){return vt(e)}function Zy(e,t){return _l(e,function(r){return r*FM},t)}function vt(e,t){return _l(e,function(r){return r*RM},t)}function No(e,t,r){return _l(e,function(n){return Math.max(t,Math.min(r,n))})}function dr(e,t,r){return Ne(e)?e.map(function(n,i){return dr(n,t[i],r)}):r*t+(1-r)*e}function Pe(e,t,r){var n=de.EPSILON;r&&(de.EPSILON=r);try{if(e===t)return!0;if(Ne(e)&&Ne(t)){if(e.length!==t.length)return!1;for(var i=0;i<e.length;++i)if(!Pe(e[i],t[i]))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)<=de.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{de.EPSILON=n}}function LM(e){return Math.round(e/de.EPSILON)*de.EPSILON}function DM(e){return e.clone?e.clone():new Array(e.length)}function _l(e,t,r){if(Ne(e)){var n=e;r=r||DM(n);for(var i=0;i<r.length&&i<n.length;++i)r[i]=t(e[i],i,r);return r}return t(e)}function Uo(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Uo=function(r){return typeof r}:Uo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Uo(e)}function GM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function NM(e,t,r){return t&&Qy(e.prototype,t),r&&Qy(e,r),e}function UM(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Al(e,t)}function Al(e,t){return Al=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Al(e,t)}function jM(e){var t=VM();return function(){var n=jo(e),i;if(t){var a=jo(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return kM(this,i)}}function kM(e,t){if(t&&(Uo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return HM(e)}function HM(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VM(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jo(e){return jo=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},jo(e)}function zM(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var Dn=function(e){UM(r,e);var t=jM(r);function r(){return GM(this,r),t.apply(this,arguments)}var n=r.prototype;return n.clone=function(){return new this.constructor().copy(this)},n.fromArray=function(a){for(var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=0;s<this.ELEMENTS;++s)this[s]=a[s+o];return this.check()},n.toArray=function(){for(var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=0;s<this.ELEMENTS;++s)a[o+s]=this[s];return a},n.from=function(a){return Array.isArray(a)?this.copy(a):this.fromObject(a)},n.to=function(a){return a===this?this:Ne(a)?this.toArray(a):this.toObject(a)},n.toTarget=function(a){return a?this.to(a):this},n.toFloat32Array=function(){return new Float32Array(this)},n.toString=function(){return this.formatString(de)},n.formatString=function(a){for(var o="",s=0;s<this.ELEMENTS;++s)o+=(s>0?", ":"")+gl(this[s],a);return"".concat(a.printTypes?this.constructor.name:"","[").concat(o,"]")},n.equals=function(a){if(!a||this.length!==a.length)return!1;for(var o=0;o<this.ELEMENTS;++o)if(!Pe(this[o],a[o]))return!1;return!0},n.exactEquals=function(a){if(!a||this.length!==a.length)return!1;for(var o=0;o<this.ELEMENTS;++o)if(this[o]!==a[o])return!1;return!0},n.negate=function(){for(var a=0;a<this.ELEMENTS;++a)this[a]=-this[a];return this.check()},n.lerp=function(a,o,s){if(s===void 0)return this.lerp(this,a,o);for(var u=0;u<this.ELEMENTS;++u){var f=a[u];this[u]=f+s*(o[u]-f)}return this.check()},n.min=function(a){for(var o=0;o<this.ELEMENTS;++o)this[o]=Math.min(a[o],this[o]);return this.check()},n.max=function(a){for(var o=0;o<this.ELEMENTS;++o)this[o]=Math.max(a[o],this[o]);return this.check()},n.clamp=function(a,o){for(var s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],a[s]),o[s]);return this.check()},n.add=function(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];for(var u=0,f=o;u<f.length;u++)for(var c=f[u],l=0;l<this.ELEMENTS;++l)this[l]+=c[l];return this.check()},n.subtract=function(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];for(var u=0,f=o;u<f.length;u++)for(var c=f[u],l=0;l<this.ELEMENTS;++l)this[l]-=c[l];return this.check()},n.scale=function(a){if(typeof a=="number")for(var o=0;o<this.ELEMENTS;++o)this[o]*=a;else for(var s=0;s<this.ELEMENTS&&s<a.length;++s)this[s]*=a[s];return this.check()},n.multiplyByScalar=function(a){for(var o=0;o<this.ELEMENTS;++o)this[o]*=a;return this.check()},n.check=function(){if(de.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this},n.validate=function(){for(var a=this.length===this.ELEMENTS,o=0;o<this.ELEMENTS;++o)a=a&&Number.isFinite(this[o]);return a},n.sub=function(a){return this.subtract(a)},n.setScalar=function(a){for(var o=0;o<this.ELEMENTS;++o)this[o]=a;return this.check()},n.addScalar=function(a){for(var o=0;o<this.ELEMENTS;++o)this[o]+=a;return this.check()},n.subScalar=function(a){return this.addScalar(-a)},n.multiplyScalar=function(a){for(var o=0;o<this.ELEMENTS;++o)this[o]*=a;return this.check()},n.divideScalar=function(a){return this.multiplyByScalar(1/a)},n.clampScalar=function(a,o){for(var s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],a),o);return this.check()},NM(r,[{key:"elements",get:function(){return this}}]),r}(zM(Array));function WM(e,t){if(e.length!==t)return!1;for(var r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function Y(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function pr(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(de.debug&&!WM(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function ko(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ko=function(r){return typeof r}:ko=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ko(e)}function JM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function XM(e,t,r){return t&&e0(e.prototype,t),r&&e0(e,r),e}function qM(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Tl(e,t)}function Tl(e,t){return Tl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Tl(e,t)}function KM(e){var t=ZM();return function(){var n=Ho(e),i;if(t){var a=Ho(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return YM(this,i)}}function YM(e,t){if(t&&(ko(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $M(e)}function $M(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZM(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ho(e){return Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ho(e)}var Gn=function(e){qM(r,e);var t=KM(r);function r(){return JM(this,r),t.apply(this,arguments)}var n=r.prototype;return n.len=function(){return Math.sqrt(this.lengthSquared())},n.magnitude=function(){return this.len()},n.lengthSquared=function(){for(var a=0,o=0;o<this.ELEMENTS;++o)a+=this[o]*this[o];return a},n.magnitudeSquared=function(){return this.lengthSquared()},n.distance=function(a){return Math.sqrt(this.distanceSquared(a))},n.distanceSquared=function(a){for(var o=0,s=0;s<this.ELEMENTS;++s){var u=this[s]-a[s];o+=u*u}return Y(o)},n.dot=function(a){for(var o=0,s=0;s<this.ELEMENTS;++s)o+=this[s]*a[s];return Y(o)},n.normalize=function(){var a=this.magnitude();if(a!==0)for(var o=0;o<this.ELEMENTS;++o)this[o]/=a;return this.check()},n.multiply=function(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];for(var u=0,f=o;u<f.length;u++)for(var c=f[u],l=0;l<this.ELEMENTS;++l)this[l]*=c[l];return this.check()},n.divide=function(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];for(var u=0,f=o;u<f.length;u++)for(var c=f[u],l=0;l<this.ELEMENTS;++l)this[l]/=c[l];return this.check()},n.lengthSq=function(){return this.lengthSquared()},n.distanceTo=function(a){return this.distance(a)},n.distanceToSquared=function(a){return this.distanceSquared(a)},n.getComponent=function(a){return ee(a>=0&&a<this.ELEMENTS,"index is out of range"),Y(this[a])},n.setComponent=function(a,o){return ee(a>=0&&a<this.ELEMENTS,"index is out of range"),this[a]=o,this.check()},n.addVectors=function(a,o){return this.copy(a).add(o)},n.subVectors=function(a,o){return this.copy(a).subtract(o)},n.multiplyVectors=function(a,o){return this.copy(a).multiply(o)},n.addScaledVector=function(a,o){return this.add(new this.constructor(a).multiplyScalar(o))},XM(r,[{key:"x",get:function(){return this[0]},set:function(a){this[0]=Y(a)}},{key:"y",get:function(){return this[1]},set:function(a){this[1]=Y(a)}}]),r}(Dn);function Vo(e,t,r){var n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}function zo(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}function t0(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e}function r0(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e[3]=t[3],e}function Wo(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*a,e[1]=r[1]*n+r[4]*i+r[7]*a,e[2]=r[2]*n+r[5]*i+r[8]*a,e[3]=t[3],e}function Jo(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Jo=function(r){return typeof r}:Jo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Jo(e)}function QM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function eI(e,t,r){return t&&n0(e.prototype,t),r&&n0(e,r),e}function tI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Sl(e,t)}function Sl(e,t){return Sl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Sl(e,t)}function rI(e){var t=aI();return function(){var n=Xo(e),i;if(t){var a=Xo(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return nI(this,i)}}function nI(e,t){if(t&&(Jo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iI(e)}function iI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Xo(e){return Xo=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Xo(e)}var $r=function(e){tI(r,e);var t=rI(r);function r(){var i,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return QM(this,r),i=t.call(this,2),Ne(a)&&arguments.length===1?i.copy(a):(de.debug&&(Y(a),Y(o)),i[0]=a,i[1]=o),i}var n=r.prototype;return n.set=function(a,o){return this[0]=a,this[1]=o,this.check()},n.copy=function(a){return this[0]=a[0],this[1]=a[1],this.check()},n.fromObject=function(a){return de.debug&&(Y(a.x),Y(a.y)),this[0]=a.x,this[1]=a.y,this.check()},n.toObject=function(a){return a.x=this[0],a.y=this[1],a},n.horizontalAngle=function(){return Math.atan2(this.y,this.x)},n.verticalAngle=function(){return Math.atan2(this.x,this.y)},n.transform=function(a){return this.transformAsPoint(a)},n.transformAsPoint=function(a){return lo(this,this,a),this.check()},n.transformAsVector=function(a){return Vo(this,this,a),this.check()},n.transformByMatrix3=function(a){return co(this,this,a),this.check()},n.transformByMatrix2x3=function(a){return uy(this,this,a),this.check()},n.transformByMatrix2=function(a){return sy(this,this,a),this.check()},eI(r,[{key:"ELEMENTS",get:function(){return 2}}]),r}(Gn);function Ko(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ko=function(r){return typeof r}:Ko=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ko(e)}function oI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function sI(e,t,r){return t&&i0(e.prototype,t),r&&i0(e,r),e}function uI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xl(e,t)}function xl(e,t){return xl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},xl(e,t)}function fI(e){var t=hI();return function(){var n=Yo(e),i;if(t){var a=Yo(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return cI(this,i)}}function cI(e,t){if(t&&(Ko(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lI(e)}function lI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Yo(e){return Yo=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Yo(e)}var wl=[0,0,0],qo,E=function(e){uI(r,e);var t=fI(r);function r(){var i,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return oI(this,r),i=t.call(this,-0,-0,-0),arguments.length===1&&Ne(a)?i.copy(a):(de.debug&&(Y(a),Y(o),Y(s)),i[0]=a,i[1]=o,i[2]=s),i}var n=r.prototype;return n.set=function(a,o,s){return this[0]=a,this[1]=o,this[2]=s,this.check()},n.copy=function(a){return this[0]=a[0],this[1]=a[1],this[2]=a[2],this.check()},n.fromObject=function(a){return de.debug&&(Y(a.x),Y(a.y),Y(a.z)),this[0]=a.x,this[1]=a.y,this[2]=a.z,this.check()},n.toObject=function(a){return a.x=this[0],a.y=this[1],a.z=this[2],a},n.angle=function(a){return my(this,a)},n.cross=function(a){return Mn(this,this,a),this.check()},n.rotateX=function(a){var o=a.radians,s=a.origin,u=s===void 0?wl:s;return hy(this,this,u,o),this.check()},n.rotateY=function(a){var o=a.radians,s=a.origin,u=s===void 0?wl:s;return dy(this,this,u,o),this.check()},n.rotateZ=function(a){var o=a.radians,s=a.origin,u=s===void 0?wl:s;return py(this,this,u,o),this.check()},n.transform=function(a){return this.transformAsPoint(a)},n.transformAsPoint=function(a){return In(this,this,a),this.check()},n.transformAsVector=function(a){return zo(this,this,a),this.check()},n.transformByMatrix3=function(a){return ho(this,this,a),this.check()},n.transformByMatrix2=function(a){return t0(this,this,a),this.check()},n.transformByQuaternion=function(a){return po(this,this,a),this.check()},sI(r,[{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(a){this[2]=Y(a)}}],[{key:"ZERO",get:function(){return qo||(qo=new r(0,0,0),Object.freeze(qo)),qo}}]),r}(Gn);function Zo(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Zo=function(r){return typeof r}:Zo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Zo(e)}function dI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function pI(e,t,r){return t&&a0(e.prototype,t),r&&a0(e,r),e}function mI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&El(e,t)}function El(e,t){return El=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},El(e,t)}function vI(e){var t=bI();return function(){var n=Qo(e),i;if(t){var a=Qo(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return gI(this,i)}}function gI(e,t){if(t&&(Zo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yI(e)}function yI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qo(e){return Qo=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Qo(e)}var $o,o0=function(e){mI(r,e);var t=vI(r);function r(){var i,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return dI(this,r),i=t.call(this,-0,-0,-0,-0),Ne(a)&&arguments.length===1?i.copy(a):(de.debug&&(Y(a),Y(o),Y(s),Y(u)),i[0]=a,i[1]=o,i[2]=s,i[3]=u),i}var n=r.prototype;return n.set=function(a,o,s,u){return this[0]=a,this[1]=o,this[2]=s,this[3]=u,this.check()},n.copy=function(a){return this[0]=a[0],this[1]=a[1],this[2]=a[2],this[3]=a[3],this.check()},n.fromObject=function(a){return de.debug&&(Y(a.x),Y(a.y),Y(a.z),Y(a.w)),this[0]=a.x,this[1]=a.y,this[2]=a.z,this[3]=a.w,this},n.toObject=function(a){return a.x=this[0],a.y=this[1],a.z=this[2],a.w=this[3],a},n.transform=function(a){return In(this,this,a),this.check()},n.transformByMatrix3=function(a){return Wo(this,this,a),this.check()},n.transformByMatrix2=function(a){return r0(this,this,a),this.check()},n.transformByQuaternion=function(a){return po(this,this,a),this.check()},n.applyMatrix4=function(a){return a.transform(this,this),this},pI(r,[{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(a){this[2]=Y(a)}},{key:"w",get:function(){return this[3]},set:function(a){this[3]=Y(a)}}],[{key:"ZERO",get:function(){return $o||($o=new r(0,0,0,0),Object.freeze($o)),$o}}]),r}(Gn);function es(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?es=function(r){return typeof r}:es=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},es(e)}function _I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ol(e,t)}function Ol(e,t){return Ol=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ol(e,t)}function TI(e){var t=xI();return function(){var n=ts(e),i;if(t){var a=ts(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return SI(this,i)}}function SI(e,t){if(t&&(es(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wI(e)}function wI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ts(e){return ts=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ts(e)}var rs=function(e){AI(r,e);var t=TI(r);function r(){return _I(this,r),t.apply(this,arguments)}var n=r.prototype;return n.toString=function(){var a="[";if(de.printRowMajor){a+="row-major:";for(var o=0;o<this.RANK;++o)for(var s=0;s<this.RANK;++s)a+=" ".concat(this[s*this.RANK+o])}else{a+="column-major:";for(var u=0;u<this.ELEMENTS;++u)a+=" ".concat(this[u])}return a+="]",a},n.getElementIndex=function(a,o){return o*this.RANK+a},n.getElement=function(a,o){return this[o*this.RANK+a]},n.setElement=function(a,o,s){return this[o*this.RANK+a]=Y(s),this},n.getColumn=function(a){for(var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Array(this.RANK).fill(-0),s=a*this.RANK,u=0;u<this.RANK;++u)o[u]=this[s+u];return o},n.setColumn=function(a,o){for(var s=a*this.RANK,u=0;u<this.RANK;++u)this[s+u]=o[u];return this},r}(Dn);function s0(){var e=new Ie(9);return Ie!=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 u0(e,t){if(e===t){var r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}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 f0(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],f=t[7],c=t[8],l=c*o-s*f,d=-c*a+s*u,h=f*a-o*u,p=r*l+n*d+i*h;return p?(p=1/p,e[0]=l*p,e[1]=(-c*n+i*f)*p,e[2]=(s*n-i*o)*p,e[3]=d*p,e[4]=(c*r-i*u)*p,e[5]=(-s*r+i*a)*p,e[6]=h*p,e[7]=(-f*r+n*u)*p,e[8]=(o*r-n*a)*p,e):null}function c0(e){var t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],f=e[8];return t*(f*a-o*u)+r*(-f*i+o*s)+n*(u*i-a*s)}function Pl(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=t[6],c=t[7],l=t[8],d=r[0],h=r[1],p=r[2],m=r[3],g=r[4],y=r[5],b=r[6],A=r[7],S=r[8];return e[0]=d*n+h*o+p*f,e[1]=d*i+h*s+p*c,e[2]=d*a+h*u+p*l,e[3]=m*n+g*o+y*f,e[4]=m*i+g*s+y*c,e[5]=m*a+g*u+y*l,e[6]=b*n+A*o+S*f,e[7]=b*i+A*s+S*c,e[8]=b*a+A*u+S*l,e}function l0(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=t[6],c=t[7],l=t[8],d=r[0],h=r[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=d*n+h*o+f,e[7]=d*i+h*s+c,e[8]=d*a+h*u+l,e}function h0(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=t[6],c=t[7],l=t[8],d=Math.sin(r),h=Math.cos(r);return e[0]=h*n+d*o,e[1]=h*i+d*s,e[2]=h*a+d*u,e[3]=h*o-d*n,e[4]=h*s-d*i,e[5]=h*u-d*a,e[6]=f,e[7]=c,e[8]=l,e}function Bl(e,t,r){var n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function d0(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,f=r*o,c=n*o,l=n*s,d=i*o,h=i*s,p=i*u,m=a*o,g=a*s,y=a*u;return e[0]=1-l-p,e[3]=c-y,e[6]=d+g,e[1]=c+y,e[4]=1-f-p,e[7]=h-m,e[2]=d-g,e[5]=h+m,e[8]=1-f-l,e}function as(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?as=function(r){return typeof r}:as=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},as(e)}function EI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function OI(e,t,r){return t&&m0(e.prototype,t),r&&m0(e,r),e}function PI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cl(e,t)}function Cl(e,t){return Cl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Cl(e,t)}function BI(e){var t=II();return function(){var n=os(e),i;if(t){var a=os(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return CI(this,i)}}function CI(e,t){if(t&&(as(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return MI(e)}function MI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function II(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function os(e){return os=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},os(e)}var Ml;(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"})(Ml||(Ml={}));var RI=Object.freeze([1,0,0,0,1,0,0,0,1]),le=function(e){PI(r,e);var t=BI(r);function r(i){for(var a,o=arguments.length,s=new Array(o>1?o-1:0),u=1;u<o;u++)s[u-1]=arguments[u];return EI(this,r),a=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(i)?a.copy(i):s.length>0?a.copy([i].concat(s)):a.identity(),a}var n=r.prototype;return n.copy=function(a){return this[0]=a[0],this[1]=a[1],this[2]=a[2],this[3]=a[3],this[4]=a[4],this[5]=a[5],this[6]=a[6],this[7]=a[7],this[8]=a[8],this.check()},n.identity=function(){return this.copy(RI)},n.fromObject=function(a){return this.check()},n.fromQuaternion=function(a){return d0(this,a),this.check()},n.set=function(a,o,s,u,f,c,l,d,h){return this[0]=a,this[1]=o,this[2]=s,this[3]=u,this[4]=f,this[5]=c,this[6]=l,this[7]=d,this[8]=h,this.check()},n.setRowMajor=function(a,o,s,u,f,c,l,d,h){return this[0]=a,this[1]=u,this[2]=l,this[3]=o,this[4]=f,this[5]=d,this[6]=s,this[7]=c,this[8]=h,this.check()},n.determinant=function(){return c0(this)},n.transpose=function(){return u0(this,this),this.check()},n.invert=function(){return f0(this,this),this.check()},n.multiplyLeft=function(a){return Pl(this,a,this),this.check()},n.multiplyRight=function(a){return Pl(this,this,a),this.check()},n.rotate=function(a){return h0(this,this,a),this.check()},n.scale=function(a){return Array.isArray(a)?Bl(this,this,a):Bl(this,this,[a,a]),this.check()},n.translate=function(a){return l0(this,this,a),this.check()},n.transform=function(a,o){var s;switch(a.length){case 2:s=co(o||[-0,-0],a,this);break;case 3:s=ho(o||[-0,-0,-0],a,this);break;case 4:s=Wo(o||[-0,-0,-0,-0],a,this);break;default:throw new Error("Illegal vector")}return pr(s,a.length),s},n.transformVector=function(a,o){return this.transform(a,o)},n.transformVector2=function(a,o){return this.transform(a,o)},n.transformVector3=function(a,o){return this.transform(a,o)},OI(r,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Ml}}],[{key:"IDENTITY",get:function(){return LI()}},{key:"ZERO",get:function(){return FI()}}]),r}(rs);var ns,is;function FI(){return ns||(ns=new le([0,0,0,0,0,0,0,0,0]),Object.freeze(ns)),ns}function LI(){return is||(is=new le,Object.freeze(is)),is}function fs(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fs=function(r){return typeof r}:fs=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},fs(e)}function DI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function GI(e,t,r){return t&&v0(e.prototype,t),r&&v0(e,r),e}function NI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fl(e,t)}function Fl(e,t){return Fl=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Fl(e,t)}function UI(e){var t=HI();return function(){var n=cs(e),i;if(t){var a=cs(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return jI(this,i)}}function jI(e,t){if(t&&(fs(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kI(e)}function kI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function cs(e){return cs=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},cs(e)}var Ll;(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"})(Ll||(Ll={}));var VI=45*Math.PI/180,zI=1,Il=.1,Rl=500,WI=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),J=function(e){NI(r,e);var t=UI(r);function r(i){var a;return DI(this,r),a=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(i)?a.copy(i):a.identity(),a}var n=r.prototype;return n.copy=function(a){return this[0]=a[0],this[1]=a[1],this[2]=a[2],this[3]=a[3],this[4]=a[4],this[5]=a[5],this[6]=a[6],this[7]=a[7],this[8]=a[8],this[9]=a[9],this[10]=a[10],this[11]=a[11],this[12]=a[12],this[13]=a[13],this[14]=a[14],this[15]=a[15],this.check()},n.set=function(a,o,s,u,f,c,l,d,h,p,m,g,y,b,A,S){return this[0]=a,this[1]=o,this[2]=s,this[3]=u,this[4]=f,this[5]=c,this[6]=l,this[7]=d,this[8]=h,this[9]=p,this[10]=m,this[11]=g,this[12]=y,this[13]=b,this[14]=A,this[15]=S,this.check()},n.setRowMajor=function(a,o,s,u,f,c,l,d,h,p,m,g,y,b,A,S){return this[0]=a,this[1]=f,this[2]=h,this[3]=y,this[4]=o,this[5]=c,this[6]=p,this[7]=b,this[8]=s,this[9]=l,this[10]=m,this[11]=A,this[12]=u,this[13]=d,this[14]=g,this[15]=S,this.check()},n.toRowMajor=function(a){return a[0]=this[0],a[1]=this[4],a[2]=this[8],a[3]=this[12],a[4]=this[1],a[5]=this[5],a[6]=this[9],a[7]=this[13],a[8]=this[2],a[9]=this[6],a[10]=this[10],a[11]=this[14],a[12]=this[3],a[13]=this[7],a[14]=this[11],a[15]=this[15],a},n.identity=function(){return this.copy(WI)},n.fromObject=function(a){return this.check()},n.fromQuaternion=function(a){return ry(this,a),this.check()},n.frustum=function(a){var o=a.left,s=a.right,u=a.bottom,f=a.top,c=a.near,l=c===void 0?Il:c,d=a.far,h=d===void 0?Rl:d;return h===1/0?qI(this,o,s,u,f,l):ny(this,o,s,u,f,l,h),this.check()},n.lookAt=function(a){var o=a.eye,s=a.center,u=s===void 0?[0,0,0]:s,f=a.up,c=f===void 0?[0,1,0]:f;return ay(this,o,u,c),this.check()},n.ortho=function(a){var o=a.left,s=a.right,u=a.bottom,f=a.top,c=a.near,l=c===void 0?Il:c,d=a.far,h=d===void 0?Rl:d;return iy(this,o,s,u,f,l,h),this.check()},n.orthographic=function(a){var o=a.fovy,s=o===void 0?VI:o,u=a.aspect,f=u===void 0?zI:u,c=a.focalDistance,l=c===void 0?1:c,d=a.near,h=d===void 0?Il:d,p=a.far,m=p===void 0?Rl:p;g0(s);var g=s/2,y=l*Math.tan(g),b=y*f;return this.ortho({left:-b,right:b,bottom:-y,top:y,near:h,far:m})},n.perspective=function(a){var o=a.fovy,s=o===void 0?45*Math.PI/180:o,u=a.aspect,f=u===void 0?1:u,c=a.near,l=c===void 0?.1:c,d=a.far,h=d===void 0?500:d;return g0(s),so(this,s,f,l,h),this.check()},n.determinant=function(){return Zg(this)},n.getScale=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return a[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),a[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),a[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),a},n.getTranslation=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return a[0]=this[12],a[1]=this[13],a[2]=this[14],a},n.getRotation=function(a,o){a=a||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],o=o||[-0,-0,-0];var s=this.getScale(o),u=1/s[0],f=1/s[1],c=1/s[2];return a[0]=this[0]*u,a[1]=this[1]*f,a[2]=this[2]*c,a[3]=0,a[4]=this[4]*u,a[5]=this[5]*f,a[6]=this[6]*c,a[7]=0,a[8]=this[8]*u,a[9]=this[9]*f,a[10]=this[10]*c,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a},n.getRotationMatrix3=function(a,o){a=a||[-0,-0,-0,-0,-0,-0,-0,-0,-0],o=o||[-0,-0,-0];var s=this.getScale(o),u=1/s[0],f=1/s[1],c=1/s[2];return a[0]=this[0]*u,a[1]=this[1]*f,a[2]=this[2]*c,a[3]=this[4]*u,a[4]=this[5]*f,a[5]=this[6]*c,a[6]=this[8]*u,a[7]=this[9]*f,a[8]=this[10]*c,a},n.transpose=function(){return $g(this,this),this.check()},n.invert=function(){return io(this,this),this.check()},n.multiplyLeft=function(a){return qr(this,a,this),this.check()},n.multiplyRight=function(a){return qr(this,this,a),this.check()},n.rotateX=function(a){return ao(this,this,a),this.check()},n.rotateY=function(a){return ey(this,this,a),this.check()},n.rotateZ=function(a){return oo(this,this,a),this.check()},n.rotateXYZ=function(a){return this.rotateX(a[0]).rotateY(a[1]).rotateZ(a[2])},n.rotateAxis=function(a,o){return Qg(this,this,a,o),this.check()},n.scale=function(a){return Bn(this,this,Array.isArray(a)?a:[a,a,a]),this.check()},n.translate=function(a){return Kr(this,this,a),this.check()},n.transform=function(a,o){return a.length===4?(o=ro(o||[-0,-0,-0,-0],a,this),pr(o,4),o):this.transformAsPoint(a,o)},n.transformAsPoint=function(a,o){var s=a.length,u;switch(s){case 2:u=lo(o||[-0,-0],a,this);break;case 3:u=In(o||[-0,-0,-0],a,this);break;default:throw new Error("Illegal vector")}return pr(u,a.length),u},n.transformAsVector=function(a,o){var s;switch(a.length){case 2:s=Vo(o||[-0,-0],a,this);break;case 3:s=zo(o||[-0,-0,-0],a,this);break;default:throw new Error("Illegal vector")}return pr(s,a.length),s},n.transformPoint=function(a,o){return this.transformAsPoint(a,o)},n.transformVector=function(a,o){return this.transformAsPoint(a,o)},n.transformDirection=function(a,o){return this.transformAsVector(a,o)},n.makeRotationX=function(a){return this.identity().rotateX(a)},n.makeTranslation=function(a,o,s){return this.identity().translate([a,o,s])},GI(r,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return Ll}}],[{key:"IDENTITY",get:function(){return XI()}},{key:"ZERO",get:function(){return JI()}}]),r}(rs);var ss,us;function JI(){return ss||(ss=new J([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(ss)),ss}function XI(){return us||(us=new J,Object.freeze(us)),us}function g0(e){if(e>Math.PI*2)throw Error("expected radians")}function qI(e,t,r,n,i,a){var o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),f=(i+n)/(i-n),c=-1,l=-1,d=-2*a;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=f,e[10]=c,e[11]=l,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}function y0(){var e=new Ie(4);return Ie!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function b0(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Dl(e,t,r){r=r*.5;var 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 Gl(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],f=r[2],c=r[3];return e[0]=n*c+o*s+i*f-a*u,e[1]=i*c+o*u+a*s-n*f,e[2]=a*c+o*f+n*u-i*s,e[3]=o*c-n*s-i*u-a*f,e}function _0(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s,e}function A0(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s,e}function T0(e,t,r){r*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s,e}function S0(e,t){var r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e}function zi(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3],u=r[0],f=r[1],c=r[2],l=r[3],d,h,p,m,g;return h=i*u+a*f+o*c+s*l,h<0&&(h=-h,u=-u,f=-f,c=-c,l=-l),1-h>he?(d=Math.acos(h),p=Math.sin(d),m=Math.sin((1-n)*d)/p,g=Math.sin(n*d)/p):(m=1-n,g=n),e[0]=m*i+g*u,e[1]=m*a+g*f,e[2]=m*o+g*c,e[3]=m*s+g*l,e}function w0(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s,e}function x0(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function Nl(e,t){var 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{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),e[i]=.5*n,n=.5/n,e[3]=(t[a*3+o]-t[o*3+a])*n,e[a]=(t[a*3+i]+t[i*3+a])*n,e[o]=(t[o*3+i]+t[i*3+o])*n}return e}var E0=zg;var O0=to,P0=qg,B0=Kg,C0=Wg;var M0=Jg;var I0=Xg;var R0=function(){var e=qc(),t=Yc(1,0,0),r=Yc(0,1,0);return function(n,i,a){var o=ji(i,a);return o<-.999999?(Mn(e,t,i),gy(e)<1e-6&&Mn(e,r,i),ly(e,e),Dl(n,e,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Mn(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+o,I0(n,n))}}(),xX=function(){var e=y0(),t=y0();return function(r,n,i,a,o,s){return zi(e,n,o,s),zi(t,i,a,s),zi(r,e,t,2*s*(1-s)),r}}(),EX=function(){var e=s0();return function(t,r,n,i){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],I0(t,Nl(t,e))}}();function ls(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ls=function(r){return typeof r}:ls=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ls(e)}function YI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $I(e,t,r){return t&&F0(e.prototype,t),r&&F0(e,r),e}function ZI(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ul(e,t)}function Ul(e,t){return Ul=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ul(e,t)}function QI(e){var t=r3();return function(){var n=hs(e),i;if(t){var a=hs(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return e3(this,i)}}function e3(e,t){if(t&&(ls(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return t3(e)}function t3(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r3(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hs(e){return hs=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},hs(e)}var n3=[0,0,0,1],mr=function(e){ZI(r,e);var t=QI(r);function r(){var i,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;return YI(this,r),i=t.call(this,-0,-0,-0,-0),Array.isArray(a)&&arguments.length===1?i.copy(a):i.set(a,o,s,u),i}var n=r.prototype;return n.copy=function(a){return this[0]=a[0],this[1]=a[1],this[2]=a[2],this[3]=a[3],this.check()},n.set=function(a,o,s,u){return this[0]=a,this[1]=o,this[2]=s,this[3]=u,this.check()},n.fromObject=function(a){return this[0]=a.x,this[1]=a.y,this[2]=a.z,this[3]=a.w,this.check()},n.fromMatrix3=function(a){return Nl(this,a),this.check()},n.fromAxisRotation=function(a,o){return Dl(this,a,o),this.check()},n.identity=function(){return b0(this),this.check()},n.setAxisAngle=function(a,o){return this.fromAxisRotation(a,o)},n.len=function(){return C0(this)},n.lengthSquared=function(){return M0(this)},n.dot=function(a){return P0(this,a)},n.rotationTo=function(a,o){return R0(this,a,o),this.check()},n.add=function(a){return E0(this,this,a),this.check()},n.calculateW=function(){return S0(this,this),this.check()},n.conjugate=function(){return x0(this,this),this.check()},n.invert=function(){return w0(this,this),this.check()},n.lerp=function(a,o,s){return s===void 0?this.lerp(this,a,o):(B0(this,a,o,s),this.check())},n.multiplyRight=function(a){return Gl(this,this,a),this.check()},n.multiplyLeft=function(a){return Gl(this,a,this),this.check()},n.normalize=function(){var a=this.len(),o=a>0?1/a:0;return this[0]=this[0]*o,this[1]=this[1]*o,this[2]=this[2]*o,this[3]=this[3]*o,a===0&&(this[3]=1),this.check()},n.rotateX=function(a){return _0(this,this,a),this.check()},n.rotateY=function(a){return A0(this,this,a),this.check()},n.rotateZ=function(a){return T0(this,this,a),this.check()},n.scale=function(a){return O0(this,this,a),this.check()},n.slerp=function(a,o,s){var u,f,c;switch(arguments.length){case 1:var l=a.start;u=l===void 0?n3:l,f=a.target,c=a.ratio;break;case 2:u=this,f=a,c=o;break;default:u=a,f=o,c=s}return zi(this,u,f,c),this.check()},n.transformVector4=function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new o0;return Yg(o,a,this),pr(o,4)},n.lengthSq=function(){return this.lengthSquared()},n.setFromAxisAngle=function(a,o){return this.setAxisAngle(a,o)},n.premultiply=function(a){return this.multiplyLeft(a)},n.multiply=function(a){return this.multiplyRight(a)},$I(r,[{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(a){this[0]=Y(a)}},{key:"y",get:function(){return this[1]},set:function(a){this[1]=Y(a)}},{key:"z",get:function(){return this[2]},set:function(a){this[2]=Y(a)}},{key:"w",get:function(){return this[3]},set:function(a){this[3]=Y(a)}}]),r}(Dn);var Mt={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:Math.PI*2};function L0(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function i3(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){L0(a,n,i,o,s,"next",u)}function s(u){L0(a,n,i,o,s,"throw",u)}o(void 0)})}}function a3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o3(e,t,r){return t&&D0(e.prototype,t),r&&D0(e,r),e}var Wi=function(){function e(r){a3(this,e),this.index=void 0,this.isVisible=void 0,this.isSelected=void 0,this.parent=void 0,this.children=void 0,this.content=void 0,this.state=void 0,this.layers=void 0,this.id=void 0,this.zoom=void 0,this.userData=void 0,this.boundingBox=void 0,this._abortController=void 0,this._loader=void 0,this._loaderId=void 0,this._isLoaded=void 0,this._isCancelled=void 0,this._needsReload=void 0,this._bbox=void 0,this.index=r,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}var t=e.prototype;return t._loadData=function(){var r=i3(regeneratorRuntime.mark(function i(a){var o,s,u,f,c,l,d,h,p,m,g,y,b,A;return regeneratorRuntime.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return o=a.getData,s=a.requestScheduler,u=a.onLoad,f=a.onError,c=this.index,l=this.id,d=this.bbox,h=this.userData,p=this.zoom,m=this._loaderId,this._abortController=new AbortController,g=this._abortController.signal,O.next=7,s.scheduleRequest(this,function(w){return w.isSelected?1:-1});case 7:if(y=O.sent,y){O.next=11;break}return this._isCancelled=!0,O.abrupt("return");case 11:if(!this._isCancelled){O.next=14;break}return y.done(),O.abrupt("return");case 14:return b=null,O.prev=15,O.next=18,o({index:c,id:l,bbox:d,userData:h,zoom:p,signal:g});case 18:b=O.sent,O.next=24;break;case 21:O.prev=21,O.t0=O.catch(15),A=O.t0||!0;case 24:return O.prev=24,y.done(),O.finish(24);case 27:if(m===this._loaderId){O.next=29;break}return O.abrupt("return");case 29:if(this._loader=void 0,this.content=b,!(this._isCancelled&&!b)){O.next=34;break}return this._isLoaded=!1,O.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,A?f(A,this):u(this);case 37:case"end":return O.stop()}},i,this,[[15,21,24,27]])}));function n(i){return r.apply(this,arguments)}return n}(),t.loadData=function(n){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(n),this._loader},t.setNeedsReload=function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0},t.abort=function(){var n;this.isLoaded||(this._isCancelled=!0,(n=this._abortController)===null||n===void 0||n.abort())},o3(e,[{key:"bbox",get:function(){return this._bbox},set:function(n){this._bbox||(this._bbox=n,"west"in n?this.boundingBox=[[n.west,n.south],[n.east,n.north]]:this.boundingBox=[[n.left,n.top],[n.right,n.bottom]])}},{key:"data",get:function(){var n=this;return this.isLoading&&this._loader?this._loader.then(function(){return n.data}):this.content}},{key:"isLoaded",get:function(){return this._isLoaded&&!this._needsReload}},{key:"isLoading",get:function(){return Boolean(this._loader)&&!this._isCancelled}},{key:"needsReload",get:function(){return this._needsReload||this._isCancelled}},{key:"byteLength",get:function(){var n=this.content?this.content.byteLength:0;return Number.isFinite(n)||console.error("byteLength not defined in tile data"),n}}]),e}();var qi=q(dt());var we={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};function s3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var G0=new E,u3=new E,ds=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],i=arguments.length>2?arguments[2]:void 0;s3(this,e),v(this,"center",void 0),v(this,"halfDiagonal",void 0),v(this,"minimum",void 0),v(this,"maximum",void 0),i=i||G0.copy(r).add(n).scale(.5),this.center=new E(i),this.halfDiagonal=new E(n).subtract(this.center),this.minimum=new E(r),this.maximum=new E(n)}var t=e.prototype;return t.clone=function(){return new e(this.minimum,this.maximum,this.center)},t.equals=function(n){return this===n||Boolean(n)&&this.minimum.equals(n.minimum)&&this.maximum.equals(n.maximum)},t.transform=function(n){return this.center.transformAsPoint(n),this.halfDiagonal.transform(n),this.minimum.transform(n),this.maximum.transform(n),this},t.intersectPlane=function(n){var i=this.halfDiagonal,a=u3.from(n.normal),o=i.x*Math.abs(a.x)+i.y*Math.abs(a.y)+i.z*Math.abs(a.z),s=this.center.dot(a)+n.distance;return s-o>0?we.INSIDE:s+o<0?we.OUTSIDE:we.INTERSECTING},t.distanceTo=function(n){return Math.sqrt(this.distanceSquaredTo(n))},t.distanceSquaredTo=function(n){var i=G0.from(n).subtract(this.center),a=this.halfDiagonal,o=0,s;return s=Math.abs(i.x)-a.x,s>0&&(o+=s*s),s=Math.abs(i.y)-a.y,s>0&&(o+=s*s),s=Math.abs(i.z)-a.z,s>0&&(o+=s*s),o},e}();function f3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ji=new E,N0=new E,vr=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;f3(this,e),v(this,"center",void 0),v(this,"radius",void 0),this.radius=-0,this.center=new E,this.fromCenterRadius(r,n)}var t=e.prototype;return t.fromCenterRadius=function(n,i){return this.center.from(n),this.radius=i,this},t.fromCornerPoints=function(n,i){return i=Ji.from(i),this.center=new E().from(n).add(i).scale(.5),this.radius=this.center.distance(i),this},t.equals=function(n){return this===n||Boolean(n)&&this.center.equals(n.center)&&this.radius===n.radius},t.clone=function(){return new e(this.center,this.radius)},t.union=function(n){var i=this.center,a=this.radius,o=n.center,s=n.radius,u=Ji.copy(o).subtract(i),f=u.magnitude();if(a>=f+s)return this.clone();if(s>=f+a)return n.clone();var c=(a+f+s)*.5;return N0.copy(u).scale((-a+c)/f).add(i),this.center.copy(N0),this.radius=c,this},t.expand=function(n){var i=Ji.from(n),a=i.subtract(this.center).magnitude();return a>this.radius&&(this.radius=a),this},t.transform=function(n){this.center.transform(n);var i=ty(Ji,n);return this.radius=Math.max(i[0],Math.max(i[1],i[2]))*this.radius,this},t.distanceSquaredTo=function(n){var i=this.distanceTo(n);return i*i},t.distanceTo=function(n){var i=Ji.from(n),a=i.subtract(this.center);return Math.max(0,a.len()-this.radius)},t.intersectPlane=function(n){var i=this.center,a=this.radius,o=n.normal,s=o.dot(i)+n.distance;return s<-a?we.OUTSIDE:s<a?we.INTERSECTING:we.INSIDE},e}();function Nn(e){return d3(e)||h3(e)||l3(e)||c3()}function c3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
33
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l3(e,t){if(e){if(typeof e=="string")return jl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jl(e,t)}}function h3(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function d3(e){if(Array.isArray(e))return jl(e)}function jl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function U0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m3(e,t,r){return t&&U0(e.prototype,t),r&&U0(e,r),e}var v3=new E,g3=new E,ps=new E,ms=new E,vs=new E,y3=new E,b3=new E,Xt={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},Zr=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0,0,0,0,0,0,0];p3(this,e),v(this,"center",void 0),v(this,"halfAxes",void 0),this.center=new E().from(r),this.halfAxes=new le(n)}var t=e.prototype;return t.fromCenterHalfSizeQuaternion=function(n,i,a){var o=new mr(a),s=new le().fromQuaternion(o);return s[0]=s[0]*i[0],s[1]=s[1]*i[0],s[2]=s[2]*i[0],s[3]=s[3]*i[1],s[4]=s[4]*i[1],s[5]=s[5]*i[1],s[6]=s[6]*i[2],s[7]=s[7]*i[2],s[8]=s[8]*i[2],this.center=new E().from(n),this.halfAxes=s,this},t.clone=function(){return new e(this.center,this.halfAxes)},t.equals=function(n){return this===n||Boolean(n)&&this.center.equals(n.center)&&this.halfAxes.equals(n.halfAxes)},t.getBoundingSphere=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new vr,i=this.halfAxes,a=i.getColumn(0,ps),o=i.getColumn(1,ms),s=i.getColumn(2,vs),u=v3.copy(a).add(o).add(s);return n.center.copy(this.center),n.radius=u.magnitude(),n},t.intersectPlane=function(n){var i=this.center,a=n.normal,o=this.halfAxes,s=a.x,u=a.y,f=a.z,c=Math.abs(s*o[Xt.COLUMN0ROW0]+u*o[Xt.COLUMN0ROW1]+f*o[Xt.COLUMN0ROW2])+Math.abs(s*o[Xt.COLUMN1ROW0]+u*o[Xt.COLUMN1ROW1]+f*o[Xt.COLUMN1ROW2])+Math.abs(s*o[Xt.COLUMN2ROW0]+u*o[Xt.COLUMN2ROW1]+f*o[Xt.COLUMN2ROW2]),l=a.dot(i)+n.distance;return l<=-c?we.OUTSIDE:l>=c?we.INSIDE:we.INTERSECTING},t.distanceTo=function(n){return Math.sqrt(this.distanceSquaredTo(n))},t.distanceSquaredTo=function(n){var i=g3.from(n).subtract(this.center),a=this.halfAxes,o=a.getColumn(0,ps),s=a.getColumn(1,ms),u=a.getColumn(2,vs),f=o.magnitude(),c=s.magnitude(),l=u.magnitude();o.normalize(),s.normalize(),u.normalize();var d=0,h;return h=Math.abs(i.dot(o))-f,h>0&&(d+=h*h),h=Math.abs(i.dot(s))-c,h>0&&(d+=h*h),h=Math.abs(i.dot(u))-l,h>0&&(d+=h*h),d},t.computePlaneDistances=function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[-0,-0],o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,u=this.center,f=this.halfAxes,c=f.getColumn(0,ps),l=f.getColumn(1,ms),d=f.getColumn(2,vs),h=y3.copy(c).add(l).add(d).add(u),p=b3.copy(h).subtract(n),m=i.dot(p);return o=Math.min(m,o),s=Math.max(m,s),h.copy(u).add(c).add(l).subtract(d),p.copy(h).subtract(n),m=i.dot(p),o=Math.min(m,o),s=Math.max(m,s),h.copy(u).add(c).subtract(l).add(d),p.copy(h).subtract(n),m=i.dot(p),o=Math.min(m,o),s=Math.max(m,s),h.copy(u).add(c).subtract(l).subtract(d),p.copy(h).subtract(n),m=i.dot(p),o=Math.min(m,o),s=Math.max(m,s),u.copy(h).subtract(c).add(l).add(d),p.copy(h).subtract(n),m=i.dot(p),o=Math.min(m,o),s=Math.max(m,s),u.copy(h).subtract(c).add(l).subtract(d),p.copy(h).subtract(n),m=i.dot(p),o=Math.min(m,o),s=Math.max(m,s),u.copy(h).subtract(c).subtract(l).add(d),p.copy(h).subtract(n),m=i.dot(p),o=Math.min(m,o),s=Math.max(m,s),u.copy(h).subtract(c).subtract(l).subtract(d),p.copy(h).subtract(n),m=i.dot(p),o=Math.min(m,o),s=Math.max(m,s),a[0]=o,a[1]=s,a},t.transform=function(n){this.center.transformAsPoint(n);var i=this.halfAxes.getColumn(0,ps);i.transformAsPoint(n);var a=this.halfAxes.getColumn(1,ms);a.transformAsPoint(n);var o=this.halfAxes.getColumn(2,vs);return o.transformAsPoint(n),this.halfAxes=new le([].concat(Nn(i),Nn(a),Nn(o))),this},t.getTransform=function(){throw new Error("not implemented")},m3(e,[{key:"halfSize",get:function(){var n=this.halfAxes.getColumn(0),i=this.halfAxes.getColumn(1),a=this.halfAxes.getColumn(2);return[new E(n).len(),new E(i).len(),new E(a).len()]}},{key:"quaternion",get:function(){var n=this.halfAxes.getColumn(0),i=this.halfAxes.getColumn(1),a=this.halfAxes.getColumn(2),o=new E(n).normalize(),s=new E(i).normalize(),u=new E(a).normalize();return new mr().fromMatrix3(new le([].concat(Nn(o),Nn(s),Nn(u))))}}]),e}();function _3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var j0=new E,k0=new E,xe=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,1],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;_3(this,e),v(this,"normal",void 0),v(this,"distance",void 0),this.normal=new E,this.distance=-0,this.fromNormalDistance(r,n)}var t=e.prototype;return t.fromNormalDistance=function(n,i){return ee(Number.isFinite(i)),this.normal.from(n).normalize(),this.distance=i,this},t.fromPointNormal=function(n,i){n=j0.from(n),this.normal.from(i).normalize();var a=-this.normal.dot(n);return this.distance=a,this},t.fromCoefficients=function(n,i,a,o){return this.normal.set(n,i,a),ee(Pe(this.normal.len(),1)),this.distance=o,this},t.clone=function(){return new e(this.normal,this.distance)},t.equals=function(n){return Pe(this.distance,n.distance)&&Pe(this.normal,n.normal)},t.getPointDistance=function(n){return this.normal.dot(n)+this.distance},t.transform=function(n){var i=k0.copy(this.normal).transformAsVector(n).normalize(),a=this.normal.scale(-this.distance).transform(n);return this.fromPointNormal(a,i)},t.projectPointOntoPlane=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];n=j0.from(n);var a=this.getPointDistance(n),o=k0.copy(this.normal).scale(a);return n.subtract(o).to(i)},e}();function H0(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=A3(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
34
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function A3(e,t){if(e){if(typeof e=="string")return V0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return V0(e,t)}}function V0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function T3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var z0=[new E([1,0,0]),new E([0,1,0]),new E([0,0,1])],W0=new E,S3=new E,b7=new xe(new E(1,0,0),0),ze=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];T3(this,e),v(this,"planes",void 0),this.planes=r}var t=e.prototype;return t.fromBoundingSphere=function(n){this.planes.length=2*z0.length;var i=n.center,a=n.radius,o=0,s=H0(z0),u;try{for(s.s();!(u=s.n()).done;){var f=u.value,c=this.planes[o],l=this.planes[o+1];c||(c=this.planes[o]=new xe),l||(l=this.planes[o+1]=new xe);var d=W0.copy(f).scale(-a).add(i),h=-f.dot(d);c.fromPointNormal(d,f);var p=W0.copy(f).scale(a).add(i),m=S3.copy(f).negate(),g=-m.dot(p);l.fromPointNormal(p,m),o+=2}}catch(y){s.e(y)}finally{s.f()}return this},t.computeVisibility=function(n){var i=we.INSIDE,a=H0(this.planes),o;try{for(a.s();!(o=a.n()).done;){var s=o.value,u=n.intersectPlane(s);switch(u){case we.OUTSIDE:return we.OUTSIDE;case we.INTERSECTING:i=we.INTERSECTING;break;default:}}}catch(f){a.e(f)}finally{a.f()}return i},t.computeVisibilityWithPlaneMask=function(n,i){if(ee(Number.isFinite(i),"parentPlaneMask is required."),i===e.MASK_OUTSIDE||i===e.MASK_INSIDE)return i;for(var a=e.MASK_INSIDE,o=this.planes,s=0;s<this.planes.length;++s){var u=s<31?1<<s:0;if(!(s<31&&!(i&u))){var f=o[s],c=n.intersectPlane(f);if(c===we.OUTSIDE)return e.MASK_OUTSIDE;c===we.INTERSECTING&&(a|=u)}}return a},e}();v(ze,"MASK_OUTSIDE",4294967295);v(ze,"MASK_INSIDE",0);v(ze,"MASK_INDETERMINATE",2147483647);function w3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x3(e,t,r){return t&&J0(e.prototype,t),r&&J0(e,r),e}var E3=new E,O3=new E,P3=new E,B3=new E,C3=new E,kl=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};w3(this,e),v(this,"left",void 0),v(this,"_left",void 0),v(this,"right",void 0),v(this,"_right",void 0),v(this,"top",void 0),v(this,"_top",void 0),v(this,"bottom",void 0),v(this,"_bottom",void 0),v(this,"near",void 0),v(this,"_near",void 0),v(this,"far",void 0),v(this,"_far",void 0),v(this,"_cullingVolume",new ze([new xe,new xe,new xe,new xe,new xe,new xe])),v(this,"_perspectiveMatrix",new J),v(this,"_infinitePerspective",new J);var n=r.near,i=n===void 0?1:n,a=r.far,o=a===void 0?5e8:a;this.left=r.left,this._left=void 0,this.right=r.right,this._right=void 0,this.top=r.top,this._top=void 0,this.bottom=r.bottom,this._bottom=void 0,this.near=i,this._near=i,this.far=o,this._far=o}var t=e.prototype;return t.clone=function(){return new e({right:this.right,left:this.left,top:this.top,bottom:this.bottom,near:this.near,far:this.far})},t.equals=function(n){return n&&n instanceof e&&this.right===n.right&&this.left===n.left&&this.top===n.top&&this.bottom===n.bottom&&this.near===n.near&&this.far===n.far},t.computeCullingVolume=function(n,i,a){ee(n,"position is required."),ee(i,"direction is required."),ee(a,"up is required.");var o=this._cullingVolume.planes;a=E3.copy(a).normalize();var s=O3.copy(i).cross(a).normalize(),u=P3.copy(i).multiplyByScalar(this.near).add(n),f=B3.copy(i).multiplyByScalar(this.far).add(n),c=C3;return c.copy(s).multiplyByScalar(this.left).add(u).subtract(n).cross(a),o[0].fromPointNormal(n,c),c.copy(s).multiplyByScalar(this.right).add(u).subtract(n).cross(a).negate(),o[1].fromPointNormal(n,c),c.copy(a).multiplyByScalar(this.bottom).add(u).subtract(n).cross(s).negate(),o[2].fromPointNormal(n,c),c.copy(a).multiplyByScalar(this.top).add(u).subtract(n).cross(s),o[3].fromPointNormal(n,c),c=new E().copy(i),o[4].fromPointNormal(u,c),c.negate(),o[5].fromPointNormal(f,c),this._cullingVolume},t.getPixelDimensions=function(n,i,a,o){this._update(),ee(Number.isFinite(n)&&Number.isFinite(i)),ee(n>0),ee(i>0),ee(a>0),ee(o);var s=1/this.near,u=this.top*s,f=2*a*u/i;u=this.right*s;var c=2*a*u/n;return o.x=c,o.y=f,o},t._update=function(){ee(Number.isFinite(this.right)&&Number.isFinite(this.left)&&Number.isFinite(this.top)&&Number.isFinite(this.bottom)&&Number.isFinite(this.near)&&Number.isFinite(this.far));var n=this.top,i=this.bottom,a=this.right,o=this.left,s=this.near,u=this.far;(n!==this._top||i!==this._bottom||o!==this._left||a!==this._right||s!==this._near||u!==this._far)&&(ee(this.near>0&&this.near<this.far,"near must be greater than zero and less than far."),this._left=o,this._right=a,this._top=n,this._bottom=i,this._near=s,this._far=u,this._perspectiveMatrix=new J().frustum({left:o,right:a,bottom:i,top:n,near:s,far:u}),this._infinitePerspective=new J().frustum({left:o,right:a,bottom:i,top:n,near:s,far:1/0}))},x3(e,[{key:"projectionMatrix",get:function(){return this._update(),this._perspectiveMatrix}},{key:"infiniteProjectionMatrix",get:function(){return this._update(),this._infinitePerspective}}]),e}();function M3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function I3(e,t,r){return t&&X0(e.prototype,t),r&&X0(e,r),e}var R3=function(t){return t!==null&&typeof t<"u"},F3=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M3(this,e),v(this,"_offCenterFrustum",new kl),v(this,"fov",void 0),v(this,"_fov",void 0),v(this,"_fovy",void 0),v(this,"_sseDenominator",void 0),v(this,"aspectRatio",void 0),v(this,"_aspectRatio",void 0),v(this,"near",void 0),v(this,"_near",void 0),v(this,"far",void 0),v(this,"_far",void 0),v(this,"xOffset",void 0),v(this,"_xOffset",void 0),v(this,"yOffset",void 0),v(this,"_yOffset",void 0);var n=r.fov,i=r.aspectRatio,a=r.near,o=a===void 0?1:a,s=r.far,u=s===void 0?5e8:s,f=r.xOffset,c=f===void 0?0:f,l=r.yOffset,d=l===void 0?0:l;this.fov=n,this.aspectRatio=i,this.near=o,this.far=u,this.xOffset=c,this.yOffset=d}var t=e.prototype;return t.clone=function(){return new e({aspectRatio:this.aspectRatio,fov:this.fov,near:this.near,far:this.far})},t.equals=function(n){return!R3(n)||!(n instanceof e)?!1:(this._update(),n._update(),this.fov===n.fov&&this.aspectRatio===n.aspectRatio&&this.near===n.near&&this.far===n.far&&this._offCenterFrustum.equals(n._offCenterFrustum))},t.computeCullingVolume=function(n,i,a){return this._update(),this._offCenterFrustum.computeCullingVolume(n,i,a)},t.getPixelDimensions=function(n,i,a,o){return this._update(),this._offCenterFrustum.getPixelDimensions(n,i,a,o||new $r)},t._update=function(){ee(Number.isFinite(this.fov)&&Number.isFinite(this.aspectRatio)&&Number.isFinite(this.near)&&Number.isFinite(this.far));var n=this._offCenterFrustum;(this.fov!==this._fov||this.aspectRatio!==this._aspectRatio||this.near!==this._near||this.far!==this._far||this.xOffset!==this._xOffset||this.yOffset!==this._yOffset)&&(ee(this.fov>=0&&this.fov<Math.PI),ee(this.aspectRatio>0),ee(this.near>=0&&this.near<this.far),this._aspectRatio=this.aspectRatio,this._fov=this.fov,this._fovy=this.aspectRatio<=1?this.fov:Math.atan(Math.tan(this.fov*.5)/this.aspectRatio)*2,this._near=this.near,this._far=this.far,this._sseDenominator=2*Math.tan(.5*this._fovy),this._xOffset=this.xOffset,this._yOffset=this.yOffset,n.top=this.near*Math.tan(.5*this._fovy),n.bottom=-n.top,n.right=this.aspectRatio*n.top,n.left=-n.right,n.near=this.near,n.far=this.far,n.right+=this.xOffset,n.left+=this.xOffset,n.top+=this.yOffset,n.bottom+=this.yOffset)},I3(e,[{key:"projectionMatrix",get:function(){return this._update(),this._offCenterFrustum.projectionMatrix}},{key:"infiniteProjectionMatrix",get:function(){return this._update(),this._offCenterFrustum.infiniteProjectionMatrix}},{key:"fovy",get:function(){return this._update(),this._fovy}},{key:"sseDenominator",get:function(){return this._update(),this._sseDenominator}}]),e}();var I7=new E,R7=new E,F7=new E,L7=new E,D7=new E,G7=new E,N7=new E,U7=new E,j7=new E,k7=new E,H7=new E,V7=new E,z7=4/3*Math.PI;var It=new le,L3=new le,D3=new le,gs=new le,q0=new le;function ys(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=Mt.EPSILON20,n=10,i=0,a=0,o=L3,s=D3;o.identity(),s.copy(e);for(var u=r*G3(s);a<n&&N3(s)>u;)U3(s,gs),q0.copy(gs).transpose(),s.multiplyRight(gs),s.multiplyLeft(q0),o.multiplyRight(gs),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function G3(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}var Hl=[1,0,0],Vl=[2,2,1];function N3(e){for(var t=0,r=0;r<3;++r){var n=e[It.getElementIndex(Vl[r],Hl[r])];t+=2*n*n}return Math.sqrt(t)}function U3(e,t){for(var r=Mt.EPSILON15,n=0,i=1,a=0;a<3;++a){var o=Math.abs(e[It.getElementIndex(Vl[a],Hl[a])]);o>n&&(i=a,n=o)}var s=Hl[i],u=Vl[i],f=1,c=0;if(Math.abs(e[It.getElementIndex(u,s)])>r){var l=e[It.getElementIndex(u,u)],d=e[It.getElementIndex(s,s)],h=e[It.getElementIndex(u,s)],p=(l-d)/2/h,m;p<0?m=-1/(-p+Math.sqrt(1+p*p)):m=1/(p+Math.sqrt(1+p*p)),f=1/Math.sqrt(1+m*m),c=m*f}return le.IDENTITY.to(t),t[It.getElementIndex(s,s)]=t[It.getElementIndex(u,u)]=f,t[It.getElementIndex(u,s)]=c,t[It.getElementIndex(s,u)]=-c,t}function zl(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=j3(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
35
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function j3(e,t){if(e){if(typeof e=="string")return K0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K0(e,t)}}function K0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var gr=new E,k3=new E,H3=new E,V3=new E,z3=new E,W3=new le,J3={diagonal:new le,unitary:new le};function Xi(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Zr;if(!e||e.length===0)return t.halfAxes=new le([0,0,0,0,0,0,0,0,0]),t.center=new E,t;var r=e.length,n=new E(0,0,0),i=zl(e),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;n.add(o)}}catch(H){i.e(H)}finally{i.f()}var s=1/r;n.multiplyByScalar(s);var u=0,f=0,c=0,l=0,d=0,h=0,p=zl(e),m;try{for(p.s();!(m=p.n()).done;){var g=m.value,y=gr.copy(g).subtract(n);u+=y.x*y.x,f+=y.x*y.y,c+=y.x*y.z,l+=y.y*y.y,d+=y.y*y.z,h+=y.z*y.z}}catch(H){p.e(H)}finally{p.f()}u*=s,f*=s,c*=s,l*=s,d*=s,h*=s;var b=W3;b[0]=u,b[1]=f,b[2]=c,b[3]=f,b[4]=l,b[5]=d,b[6]=c,b[7]=d,b[8]=h;var A=ys(b,J3),S=A.unitary,O=t.halfAxes.copy(S),w=O.getColumn(0,H3),B=O.getColumn(1,V3),P=O.getColumn(2,z3),x=-Number.MAX_VALUE,_=-Number.MAX_VALUE,C=-Number.MAX_VALUE,I=Number.MAX_VALUE,R=Number.MAX_VALUE,M=Number.MAX_VALUE,D=zl(e),N;try{for(D.s();!(N=D.n()).done;){var j=N.value;gr.copy(j),x=Math.max(gr.dot(w),x),_=Math.max(gr.dot(B),_),C=Math.max(gr.dot(P),C),I=Math.min(gr.dot(w),I),R=Math.min(gr.dot(B),R),M=Math.min(gr.dot(P),M)}}catch(H){D.e(H)}finally{D.f()}w=w.multiplyByScalar(.5*(I+x)),B=B.multiplyByScalar(.5*(R+_)),P=P.multiplyByScalar(.5*(M+C)),t.center.copy(w).add(B).add(P);var U=k3.set(x-I,_-R,C-M).multiplyByScalar(.5),k=new le([U[0],0,0,0,U[1],0,0,0,U[2]]);return t.halfAxes.multiplyRight(k),t}function Q0(e,t){return K3(e)||q3(e,t)||eb(e,t)||X3()}function X3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
36
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q3(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function K3(e){if(Array.isArray(e))return e}function Wl(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=eb(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
37
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function eb(e,t){if(e){if(typeof e=="string")return Y0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Y0(e,t)}}function Y0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Y3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $3(e,t,r){return t&&$0(e.prototype,t),r&&$0(e,r),e}var Un=512,Z0=3,tb=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],rb=tb.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Z3=rb.concat([[.25,.5],[.75,.5]]),Q3=function(){function e(r,n,i){Y3(this,e),this.x=void 0,this.y=void 0,this.z=void 0,this.childVisible=void 0,this.selected=void 0,this._children=void 0,this.x=r,this.y=n,this.z=i}var t=e.prototype;return t.update=function(n){var i=n.viewport,a=n.cullingVolume,o=n.elevationBounds,s=n.minZ,u=n.maxZ,f=n.bounds,c=n.offset,l=n.project,d=this.getBoundingVolume(o,c,l);if(f&&!this.insideBounds(f))return!1;var h=a.computeVisibility(d);if(h<0)return!1;if(!this.childVisible){var p=this.z;if(p<u&&p>=s){var m=d.distanceTo(i.cameraPosition)*i.scale/i.height;p+=Math.floor(Math.log2(m))}if(p>=u)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var g=Wl(this.children),y;try{for(g.s();!(y=g.n()).done;){var b=y.value;b.update(n)}}catch(A){g.e(A)}finally{g.f()}return!0},t.getSelected=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(this.selected&&n.push(this),this._children){var i=Wl(this._children),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.getSelected(n)}}catch(s){i.e(s)}finally{i.f()}}return n},t.insideBounds=function(n){var i=Q0(n,4),a=i[0],o=i[1],s=i[2],u=i[3],f=Math.pow(2,this.z),c=Un/f;return this.x*c<s&&this.y*c<u&&(this.x+1)*c>a&&(this.y+1)*c>o},t.getBoundingVolume=function(n,i,a){if(a){var o=this.z<1?Z3:this.z<2?rb:tb,s=[],u=Wl(o),f;try{for(u.s();!(f=u.n()).done;){var c=f.value,l=bs(this.x+c[0],this.y+c[1],this.z);l[2]=n[0],s.push(a(l)),n[0]!==n[1]&&(l[2]=n[1],s.push(a(l)))}}catch(g){u.e(g)}finally{u.f()}return Xi(s)}var d=Math.pow(2,this.z),h=Un/d,p=this.x*h+i*Un,m=Un-(this.y+1)*h;return new ds([p,m,n[0]],[p+h,m+h,n[1]])},$3(e,[{key:"children",get:function(){if(!this._children){var n=this.x*2,i=this.y*2,a=this.z+1;this._children=[new e(n,i,a),new e(n,i+1,a),new e(n+1,i,a),new e(n+1,i+1,a)]}return this._children}}]),e}();function nb(e,t,r,n){var i=e instanceof qi._GlobeViewport&&e.resolution?e.projectPosition:null,a=Object.values(e.getFrustumPlanes()).map(function(O){var w=O.normal,B=O.distance;return new xe(w.clone().negate(),B)}),o=new ze(a),s=e.distanceScales.unitsPerMeter[2],u=r&&r[0]*s||0,f=r&&r[1]*s||0,c=e instanceof qi.WebMercatorViewport&&e.pitch<=60?t:0;if(n){var l=n,d=Q0(l,4),h=d[0],p=d[1],m=d[2],g=d[3],y=Ge([h,g]),b=Ge([m,p]);n=[y[0],Un-y[1],b[0],Un-b[1]]}var A=new Q3(0,0,0),S={viewport:e,project:i,cullingVolume:o,elevationBounds:[u,f],minZ:c,maxZ:t,bounds:n,offset:0};if(A.update(S),e instanceof qi.WebMercatorViewport&&e.subViewports&&e.subViewports.length>1){for(S.offset=-1;A.update(S)&&!(--S.offset<-Z0););for(S.offset=1;A.update(S)&&!(++S.offset>Z0););}return A.getSelected()}function jn(e,t){return rR(e)||tR(e,t)||ab(e,t)||eR()}function eR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
38
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tR(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function rR(e){if(Array.isArray(e))return e}function _s(e){return aR(e)||iR(e)||ab(e)||nR()}function nR(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
39
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ab(e,t){if(e){if(typeof e=="string")return Jl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jl(e,t)}}function iR(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aR(e){if(Array.isArray(e))return Jl(e)}function Jl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var qt=512,oR=[-1/0,-1/0,1/0,1/0],yr={type:"object",value:null,validate:function(t,r){return r.optional&&t===null||typeof t=="string"||Array.isArray(t)&&t.every(function(n){return typeof n=="string"})},equal:function(t,r){if(t===r)return!0;if(!Array.isArray(t)||!Array.isArray(r))return!1;var n=t.length;if(n!==r.length)return!1;for(var i=0;i<n;i++)if(t[i]!==r[i])return!1;return!0}};function ob(e,t){var 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]])],n=[Math.min.apply(Math,_s(r.map(function(i){return i[0]}))),Math.min.apply(Math,_s(r.map(function(i){return i[1]}))),Math.max.apply(Math,_s(r.map(function(i){return i[0]}))),Math.max.apply(Math,_s(r.map(function(i){return i[1]})))];return n}function sR(e){return Math.abs(e.split("").reduce(function(t,r){return(t<<5)-t+r.charCodeAt(0)|0},0))}function Rt(e,t){if(!e||!e.length)return null;var r=t.index,n=t.id;if(Array.isArray(e)){var i=sR(n)%e.length;e=e[i]}for(var a=e,o=0,s=Object.keys(r);o<s.length;o++){var u=s[o],f=new RegExp("{".concat(u,"}"),"g");a=a.replace(f,String(r[u]))}return Number.isInteger(r.y)&&Number.isInteger(r.z)&&(a=a.replace(/\{-y\}/g,String(Math.pow(2,r.z)-r.y-1))),a}function uR(e,t,r){var n;if(t&&t.length===2){var i=jn(t,2),a=i[0],o=i[1],s=e.getBounds({z:a}),u=e.getBounds({z:o});n=[Math.min(s[0],u[0]),Math.min(s[1],u[1]),Math.max(s[2],u[2]),Math.max(s[3],u[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 sb(e){var t=e.viewport,r=e.z,n=r===void 0?0:r,i=e.cullRect,a=t.subViewports||[t];return a.map(function(o){return Xl(o,n,i)})}function Xl(e,t,r){if(!Array.isArray(t)){var n=r.x-e.x,i=r.y-e.y,a=r.width,o=r.height,s={targetZ:t},u=e.unproject([n,i],s),f=e.unproject([n+a,i],s),c=e.unproject([n,i+o],s),l=e.unproject([n+a,i+o],s);return[Math.min(u[0],f[0],c[0],l[0]),Math.min(u[1],f[1],c[1],l[1]),Math.max(u[0],f[0],c[0],l[0]),Math.max(u[1],f[1],c[1],l[1])]}var d=Xl(e,t[0],r),h=Xl(e,t[1],r);return[Math.min(d[0],h[0]),Math.min(d[1],h[1]),Math.max(d[2],h[2]),Math.max(d[3],h[3])]}function fR(e,t,r){if(r){var n=ob(e,r).map(function(i){return i*t/qt});return n}return e.map(function(i){return i*t/qt})}function ql(e,t){return Math.pow(2,e)*qt/t}function bs(e,t,r){var n=ql(r,qt),i=e/n*360-180,a=Math.PI-2*Math.PI*t/n,o=180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)));return[i,o]}function ib(e,t,r,n){var i=ql(r,n);return[e/i*qt,t/i*qt]}function Kl(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:qt;if(e.isGeospatial){var a=bs(t,r,n),o=jn(a,2),s=o[0],u=o[1],f=bs(t+1,r+1,n),c=jn(f,2),l=c[0],d=c[1];return{west:s,north:u,east:l,south:d}}var h=ib(t,r,n,i),p=jn(h,2),m=p[0],g=p[1],y=ib(t+1,r+1,n,i),b=jn(y,2),A=b[0],S=b[1];return{left:m,top:g,right:A,bottom:S}}function cR(e,t,r,n,i){for(var a=uR(e,null,n),o=ql(t,r),s=fR(a,o,i),u=jn(s,4),f=u[0],c=u[1],l=u[2],d=u[3],h=[],p=Math.floor(f);p<l;p++)for(var m=Math.floor(c);m<d;m++)h.push({x:p,y:m,z:t});return h}function Yl(e){var t=e.viewport,r=e.maxZoom,n=e.minZoom,i=e.zRange,a=e.extent,o=e.tileSize,s=o===void 0?qt:o,u=e.modelMatrix,f=e.modelMatrixInverse,c=e.zoomOffset,l=c===void 0?0:c,d=t.isGeospatial?Math.round(t.zoom+Math.log2(qt/s))+l:Math.ceil(t.zoom)+l;if(typeof n=="number"&&Number.isFinite(n)&&d<n){if(!a)return[];d=n}typeof r=="number"&&Number.isFinite(r)&&d>r&&(d=r);var h=a;return u&&f&&a&&!t.isGeospatial&&(h=ob(a,u)),t.isGeospatial?nb(t,d,i,a):cR(t,d,s,h||oR,f)}function $l(e){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}function Zl(e){return Number.isFinite(e.west)&&Number.isFinite(e.north)&&Number.isFinite(e.east)&&Number.isFinite(e.south)}function ub(e){var t={},r;return function(n){for(var i in n)if(!lR(n[i],t[i])){r=e(n),t=n;break}return r}}function lR(e,t){if(e===t)return!0;if(Array.isArray(e)){var r=e.length;if(!t||t.length!==r)return!1;for(var n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}return!1}var Ki;function fb(e,t){return pR(e)||dR(e,t)||mb(e,t)||hR()}function hR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
40
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dR(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function pR(e){if(Array.isArray(e))return e}function Ce(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=mb(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
41
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function mb(e,t){if(e){if(typeof e=="string")return cb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cb(e,t)}}function cb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lb(Object(r),!0).forEach(function(n){As(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function db(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function vR(e,t,r){return t&&db(e.prototype,t),r&&db(e,r),e}function As(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var pb=1,Ts=2,gR="never",yR="no-overlap",Yi="best-available",bR=5,_R=(Ki={},As(Ki,Yi,TR),As(Ki,yR,SR),As(Ki,gR,function(){}),Ki),AR={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){}},$i=function(){function e(r){var n=this;mR(this,e),this.opts=void 0,this._requestScheduler=void 0,this._cache=void 0,this._dirty=void 0,this._tiles=void 0,this._cacheByteSize=void 0,this._viewport=void 0,this._zRange=void 0,this._selectedTiles=void 0,this._frameNumber=void 0,this._modelMatrix=void 0,this._modelMatrixInverse=void 0,this._maxZoom=void 0,this._minZoom=void 0,this.onTileLoad=void 0,this._getCullBounds=ub(sb),this.opts=hb(hb({},AR),r),this.onTileLoad=function(i){var a,o;(a=(o=n.opts).onTileLoad)===null||a===void 0||a.call(o,i),n.opts.maxCacheByteSize&&(n._cacheByteSize+=i.byteLength,n._resizeCache())},this._requestScheduler=new Bi({maxRequests:r.maxRequests,throttleRequests:Boolean(r.maxRequests&&r.maxRequests>0)}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new J,this._modelMatrixInverse=new J,this.setOptions(r)}var t=e.prototype;return t.setOptions=function(n){Object.assign(this.opts,n),Number.isFinite(n.maxZoom)&&(this._maxZoom=Math.floor(n.maxZoom)),Number.isFinite(n.minZoom)&&(this._minZoom=Math.ceil(n.minZoom))},t.finalize=function(){var n=Ce(this._cache.values()),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.isLoading&&a.abort()}}catch(o){n.e(o)}finally{n.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null},t.reloadAll=function(){var n=Ce(this._cache.keys()),i;try{for(n.s();!(i=n.n()).done;){var a=i.value,o=this._cache.get(a);!this._selectedTiles||!this._selectedTiles.includes(o)?this._cache.delete(a):o.setNeedsReload()}}catch(s){n.e(s)}finally{n.f()}},t.update=function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.zRange,s=a.modelMatrix,u=new J(s),f=!u.equals(this._modelMatrix);if(!this._viewport||!n.equals(this._viewport)||!Pe(this._zRange,o)||f){f&&(this._modelMatrixInverse=u.clone().invert(),this._modelMatrix=u),this._viewport=n,this._zRange=o;var c=this.getTileIndices({viewport:n,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:o,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=c.map(function(d){return i._getTile(d,!0)}),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(function(d){return i._getTile(d.index,!0)}));var l=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),l&&this._frameNumber++,this._frameNumber},t.isTileVisible=function(n,i){if(!n.isVisible)return!1;if(i&&this._viewport){var a=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:i}),o=n.bbox,s=Ce(a),u;try{for(s.s();!(u=s.n()).done;){var f=fb(u.value,4),c=f[0],l=f[1],d=f[2],h=f[3],p=void 0;if("west"in o)p=o.west<d&&o.east>c&&o.south<h&&o.north>l;else{var m=Math.min(o.top,o.bottom),g=Math.max(o.top,o.bottom);p=o.left<d&&o.right>c&&m<h&&g>l}if(p)return!0}}catch(y){s.e(y)}finally{s.f()}return!1}return!0},t.getTileIndices=function(n){var i=n.viewport,a=n.maxZoom,o=n.minZoom,s=n.zRange,u=n.modelMatrix,f=n.modelMatrixInverse,c=this.opts,l=c.tileSize,d=c.extent,h=c.zoomOffset;return Yl({viewport:i,maxZoom:a,minZoom:o,zRange:s,tileSize:l,extent:d,modelMatrix:u,modelMatrixInverse:f,zoomOffset:h})},t.getTileId=function(n){return"".concat(n.x,"-").concat(n.y,"-").concat(n.z)},t.getTileZoom=function(n){return n.z},t.getTileMetadata=function(n){var i=this.opts.tileSize;return{bbox:Kl(this._viewport,n.x,n.y,n.z,i)}},t.getParentIndex=function(n){var i=Math.floor(n.x/2),a=Math.floor(n.y/2),o=n.z-1;return{x:i,y:a,z:o}},t.updateTileStates=function(){var n=this.opts.refinementStrategy||Yi,i=new Array(this._cache.size),a=0,o=Ce(this._cache.values()),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;i[a++]=u.isVisible,u.isSelected=!1,u.isVisible=!1}}catch(m){o.e(m)}finally{o.f()}var f=Ce(this._selectedTiles),c;try{for(f.s();!(c=f.n()).done;){var l=c.value;l.isSelected=!0,l.isVisible=!0}}catch(m){f.e(m)}finally{f.f()}(typeof n=="function"?n:_R[n])(Array.from(this._cache.values())),a=0;var d=Ce(this._cache.values()),h;try{for(d.s();!(h=d.n()).done;){var p=h.value;if(i[a++]!==p.isVisible)return!0}}catch(m){d.e(m)}finally{d.f()}return!1},t._pruneRequests=function(){var n=this.opts.maxRequests,i=n===void 0?0:n,a=[],o=0,s=Ce(this._cache.values()),u;try{for(s.s();!(u=s.n()).done;){var f=u.value;f.isLoading&&(o++,!f.isSelected&&!f.isVisible&&a.push(f))}}catch(l){s.e(l)}finally{s.f()}for(;i>0&&o>i&&a.length>0;){var c=a.shift();c.abort(),o--}},t._rebuildTree=function(){var n=this._cache,i=Ce(n.values()),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.parent=null,o.children&&(o.children.length=0)}}catch(l){i.e(l)}finally{i.f()}var s=Ce(n.values()),u;try{for(s.s();!(u=s.n()).done;){var f=u.value,c=this._getNearestAncestor(f);f.parent=c,c!=null&&c.children&&c.children.push(f)}}catch(l){s.e(l)}finally{s.f()}},t._resizeCache=function(){var n=this._cache,i=this.opts,a=i.maxCacheSize||(i.maxCacheByteSize?1/0:bR*this.selectedTiles.length),o=i.maxCacheByteSize||1/0,s=n.size>a||this._cacheByteSize>o;if(s){var u=Ce(n),f;try{for(u.s();!(f=u.n()).done;){var c=fb(f.value,2),l=c[0],d=c[1];if(!d.isVisible&&!d.isSelected){var h,p;this._cacheByteSize-=i.maxCacheByteSize?d.byteLength:0,n.delete(l),(h=(p=this.opts).onTileUnload)===null||h===void 0||h.call(p,d)}if(n.size<=a&&this._cacheByteSize<=o)break}}catch(m){u.e(m)}finally{u.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort(function(m,g){return m.zoom-g.zoom}),this._dirty=!1)},t._getTile=function(n,i){var a=this.getTileId(n),o=this._cache.get(a),s=!1;return!o&&i?(o=new Wi(n),Object.assign(o,this.getTileMetadata(o.index)),Object.assign(o,{id:a,zoom:this.getTileZoom(o.index)}),s=!0,this._cache.set(a,o),this._dirty=!0):o&&o.needsReload&&(s=!0),o&&s&&o.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),o},t._getNearestAncestor=function(n){for(var i=this._minZoom,a=i===void 0?0:i,o=n.index;this.getTileZoom(o)>a;){o=this.getParentIndex(o);var s=this._getTile(o);if(s)return s}return null},vR(e,[{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return this._selectedTiles!==null&&this._selectedTiles.every(function(n){return n.isLoaded})}},{key:"needsReload",get:function(){return this._selectedTiles!==null&&this._selectedTiles.some(function(n){return n.needsReload})}}]),e}();function TR(e){var t=Ce(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;n.state=0}}catch(c){t.e(c)}finally{t.f()}var i=Ce(e),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.isSelected&&!vb(o)&&Ql(o)}}catch(c){i.e(c)}finally{i.f()}var s=Ce(e),u;try{for(s.s();!(u=s.n()).done;){var f=u.value;f.isVisible=Boolean(f.state&Ts)}}catch(c){s.e(c)}finally{s.f()}}function SR(e){var t=Ce(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;n.state=0}}catch(p){t.e(p)}finally{t.f()}var i=Ce(e),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.isSelected&&vb(o)}}catch(p){i.e(p)}finally{i.f()}var s=Array.from(e).sort(function(p,m){return p.zoom-m.zoom}),u=Ce(s),f;try{for(u.s();!(f=u.n()).done;){var c=f.value;if(c.isVisible=Boolean(c.state&Ts),c.children&&(c.isVisible||c.state&pb)){var l=Ce(c.children),d;try{for(l.s();!(d=l.n()).done;){var h=d.value;h.state=pb}}catch(p){l.e(p)}finally{l.f()}}else c.isSelected&&Ql(c)}}catch(p){u.e(p)}finally{u.f()}}function vb(e){for(var t=e;t;){if(t.isLoaded||t.content)return t.state|=Ts,!0;t=t.parent}return!1}function Ql(e){var t=Ce(e.children),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;n.isLoaded||n.content?n.state|=Ts:Ql(n)}}catch(i){t.e(i)}finally{t.f()}}function ws(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ws=function(r){return typeof r}:ws=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ws(e)}function gb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ss(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gb(Object(r),!0).forEach(function(n){wR(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wR(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xR(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ER(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
42
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function ER(e,t){if(e){if(typeof e=="string")return yb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yb(e,t)}}function yb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function OR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bb(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function PR(e,t,r){return t&&bb(e.prototype,t),r&&bb(e,r),e}function BR(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&eh(e,t)}function eh(e,t){return eh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},eh(e,t)}function CR(e){var t=RR();return function(){var n=xs(e),i;if(t){var a=xs(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return MR(this,i)}}function MR(e,t){if(t&&(ws(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return IR(e)}function IR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RR(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function xs(e){return xs=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},xs(e)}var FR={TilesetClass:$i,data:{type:"data",value:[]},dataComparator:yr.equal,renderSubLayers:{type:"function",value:function(t){return new _b.GeoJsonLayer(t)}},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:function(t){}},onTileUnload:{type:"function",value:function(t){}},onTileError:{type:"function",value:function(t){return console.error(t)}},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:Yi,zRange:null,maxRequests:6,zoomOffset:0},Kt=function(e){BR(r,e);var t=CR(r);function r(){return OR(this,r),t.apply(this,arguments)}var n=r.prototype;return n.initializeState=function(){this.state={tileset:null,isLoaded:!1}},n.finalizeState=function(){var a,o;(a=this.state)===null||a===void 0||(o=a.tileset)===null||o===void 0||o.finalize()},n.shouldUpdateState=function(a){var o=a.changeFlags;return o.somethingChanged},n.updateState=function(a){var o=a.changeFlags,s=this.state.tileset,u=o.propsOrDataChanged||o.updateTriggersChanged,f=o.dataChanged||o.updateTriggersChanged&&(o.updateTriggersChanged.all||o.updateTriggersChanged.getTileData);s?u&&(s.setOptions(this._getTilesetOptions()),f?s.reloadAll():this.state.tileset.tiles.forEach(function(c){c.layers=null})):(s=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:s})),this._updateTileset()},n._getTilesetOptions=function(){var a=this.props,o=a.tileSize,s=a.maxCacheSize,u=a.maxCacheByteSize,f=a.refinementStrategy,c=a.extent,l=a.maxZoom,d=a.minZoom,h=a.maxRequests,p=a.zoomOffset;return{maxCacheSize:s,maxCacheByteSize:u,maxZoom:l,minZoom:d,tileSize:o,refinementStrategy:f,extent:c,maxRequests:h,zoomOffset:p,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}},n._updateTileset=function(){var a=this.state.tileset,o=this.props,s=o.zRange,u=o.modelMatrix,f=a.update(this.context.viewport,{zRange:s,modelMatrix:u}),c=a.isLoaded,l=this.state.isLoaded!==c,d=this.state.frameNumber!==f;c&&(l||d)&&this._onViewportLoad(),d&&this.setState({frameNumber:f}),this.state.isLoaded=c},n._onViewportLoad=function(){var a=this.state.tileset,o=this.props.onViewportLoad;o&&o(a.selectedTiles)},n._onTileLoad=function(a){this.props.onTileLoad(a),a.layers=null,this.setNeedsUpdate()},n._onTileError=function(a,o){this.props.onTileError(a),o.layers=null,this.setNeedsUpdate()},n._onTileUnload=function(a){this.props.onTileUnload(a)},n.getTileData=function(a){var o=this.props,s=o.data,u=o.getTileData,f=o.fetch,c=a.signal;return a.url=typeof s=="string"||Array.isArray(s)?Rt(s,a):null,u?u(a):f&&a.url?f(a.url,{propName:"data",layer:this,signal:c}):null},n.renderSubLayers=function(a){return this.props.renderSubLayers(a)},n.getSubLayerPropsByTile=function(a){return null},n.getPickingInfo=function(a){var o=a.info,s=a.sourceLayer,u=s.props.tile;return o.picked&&(o.tile=u),o.sourceTile=u,o},n._updateAutoHighlight=function(a){var o=a.sourceTile;if(o&&o.layers){var s=xR(o.layers),u;try{for(s.s();!(u=s.n()).done;){var f=u.value;f.updateAutoHighlight(a)}}catch(c){s.e(c)}finally{s.f()}}},n.renderLayers=function(){var a=this;return this.state.tileset.tiles.map(function(o){var s=a.getSubLayerPropsByTile(o);if(!(!o.isLoaded&&!o.content))if(o.layers)s&&o.layers[0]&&Object.keys(s).some(function(f){return o.layers[0].props[f]!==s[f]})&&(o.layers=o.layers.map(function(f){return f.clone(s)}));else{var u=a.renderSubLayers(Ss(Ss(Ss({},a.props),a.getSubLayerProps({id:o.id,updateTriggers:a.props.updateTriggers})),{},{data:o.content,_offset:0,tile:o}));o.layers=(0,Es._flatten)(u,Boolean).map(function(f){return f.clone(Ss({tile:o},s))})}return o.layers})},n.filterSubLayer=function(a){var o=a.layer,s=a.cullRect,u=o.props.tile;return this.state.tileset.isTileVisible(u,s)},PR(r,[{key:"isLoaded",get:function(){var a,o,s;return(a=this.state)===null||a===void 0||(o=a.tileset)===null||o===void 0||(s=o.selectedTiles)===null||s===void 0?void 0:s.every(function(u){return u.isLoaded&&u.layers&&u.layers.every(function(f){return f.isLoaded})})}}]),r}(Es.CompositeLayer);Kt.defaultProps=FR;Kt.layerName="TileLayer";var Sb=q(ht());function Os(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Os=function(r){return typeof r}:Os=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Os(e)}function Ab(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ab(Object(r),!0).forEach(function(n){LR(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ab(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LR(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kn(e,t,r){return typeof Reflect<"u"&&Reflect.get?kn=Reflect.get:kn=function(i,a,o){var s=GR(i,a);if(s){var u=Object.getOwnPropertyDescriptor(s,a);return u.get?u.get.call(o):u.value}},kn(e,t,r||e)}function GR(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=br(e),e!==null););return e}function NR(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&th(e,t)}function th(e,t){return th=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},th(e,t)}function UR(e){var t=HR();return function(){var n=br(e),i;if(t){var a=br(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return jR(this,i)}}function jR(e,t){if(t&&(Os(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kR(e)}function kR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HR(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function br(e){return br=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},br(e)}var VR={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(t){return t.timestamps}}},Ps=function(e){NR(r,e);var t=UR(r);function r(){return DR(this,r),t.apply(this,arguments)}var n=r.prototype;return n.getShaders=function(){var a=kn(br(r.prototype),"getShaders",this).call(this);return a.inject={"vs:#decl":`uniform float trailLength;
14
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Ot.prototype.build=function(t){return this.options.preserveOrder?jf(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t=Uf({},this.options.arrayNodeName,t)),this.j2x(t,0).val)};Ot.prototype.j2x=function(t,e){var r="",n="";for(var i in t)if(typeof t[i]>"u")this.isAttribute(i)&&(n+="");else if(t[i]===null)this.isAttribute(i)?n+="":i[0]==="?"?n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(t[i]instanceof Date)n+=this.buildTextValNode(t[i],i,"",e);else if(be(t[i])!=="object"){var o=this.isAttribute(i);if(o)r+=this.buildAttrPairStr(o,""+t[i]);else if(i===this.options.textNodeName){var s=this.options.tagValueProcessor(i,""+t[i]);n+=this.replaceEntitiesValue(s)}else n+=this.buildTextValNode(t[i],i,"",e)}else if(Array.isArray(t[i])){for(var a=t[i].length,c="",l=0;l<a;l++){var u=t[i][l];typeof u>"u"||(u===null?i[0]==="?"?n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar:be(u)==="object"?this.options.oneListGroup?c+=this.j2x(u,e+1).val:c+=this.processTextOrObjNode(u,i,e):c+=this.buildTextValNode(u,i,"",e))}this.options.oneListGroup&&(c=this.buildObjectNode(c,i,"",e)),n+=c}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName)for(var f=Object.keys(t[i]),h=f.length,d=0;d<h;d++)r+=this.buildAttrPairStr(f[d],""+t[i][f[d]]);else n+=this.processTextOrObjNode(t[i],i,e);return{attrStr:r,val:n}};Ot.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&e==="true"?" "+t:" "+t+'="'+e+'"'};function Wf(t,e,r){var n=this.j2x(t,r+1);return t[this.options.textNodeName]!==void 0&&Object.keys(t).length===1?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r):this.buildObjectNode(n.val,e,n.attrStr,r)}Ot.prototype.buildObjectNode=function(t,e,r,n){if(t==="")return e[0]==="?"?this.indentate(n)+"<"+e+r+"?"+this.tagEndChar:this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar;var i="</"+e+this.tagEndChar,o="";return e[0]==="?"&&(o="?",i=""),(r||r==="")&&t.indexOf("<")===-1?this.indentate(n)+"<"+e+r+o+">"+t+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(n)+"<!--".concat(t,"-->")+this.newLine:this.indentate(n)+"<"+e+r+o+this.tagEndChar+t+this.indentate(n)+i};Ot.prototype.closeTag=function(t){var e="";return this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e="></".concat(t),e};Ot.prototype.buildTextValNode=function(t,e,r,n){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(n)+"<![CDATA[".concat(t,"]]>")+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(n)+"<!--".concat(t,"-->")+this.newLine;if(e[0]==="?")return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar;var i=this.options.tagValueProcessor(e,t);return i=this.replaceEntitiesValue(i),i===""?this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+r+">"+i+"</"+e+this.tagEndChar};Ot.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(var e=0;e<this.options.entities.length;e++){var r=this.options.entities[e];t=t.replace(r.regex,r.val)}return t};function Df(t){return this.options.indentBy.repeat(t)}function Gf(t){return t.startsWith(this.options.attributeNamePrefix)&&t!==this.options.textNodeName?t.substr(this.attrPrefixLen):!1}_s.exports=Ot});var Ms=Y((Rv,ws)=>{"use strict";var Zf=Un(),Xf=ps(),Yf=bs();ws.exports={XMLParser:Xf,XMLValidator:Zf,XMLBuilder:Yf}});var Vi=Y((rc,Re)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof jo=="function"&&typeof Re=="object"&&Re&&Re.exports?Re.exports=e():(t.dcodeIO=t.dcodeIO||{}).Long=e()})(rc,function(){"use strict";function t(_,y,E){this.low=_|0,this.high=y|0,this.unsigned=!!E}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function e(_){return(_&&_.__isLong__)===!0}t.isLong=e;var r={},n={};function i(_,y){var E,A,L;return y?(_>>>=0,(L=0<=_&&_<256)&&(A=n[_],A)?A:(E=s(_,(_|0)<0?-1:0,!0),L&&(n[_]=E),E)):(_|=0,(L=-128<=_&&_<128)&&(A=r[_],A)?A:(E=s(_,_<0?-1:0,!1),L&&(r[_]=E),E))}t.fromInt=i;function o(_,y){if(isNaN(_)||!isFinite(_))return y?v:m;if(y){if(_<0)return v;if(_>=d)return S}else{if(_<=-p)return P;if(_+1>=p)return T}return _<0?o(-_,y).neg():s(_%h|0,_/h|0,y)}t.fromNumber=o;function s(_,y,E){return new t(_,y,E)}t.fromBits=s;var a=Math.pow;function c(_,y,E){if(_.length===0)throw Error("empty string");if(_==="NaN"||_==="Infinity"||_==="+Infinity"||_==="-Infinity")return m;if(typeof y=="number"?(E=y,y=!1):y=!!y,E=E||10,E<2||36<E)throw RangeError("radix");var A;if((A=_.indexOf("-"))>0)throw Error("interior hyphen");if(A===0)return c(_.substring(1),y,E).neg();for(var L=o(a(E,8)),I=m,R=0;R<_.length;R+=8){var U=Math.min(8,_.length-R),z=parseInt(_.substring(R,R+U),E);if(U<8){var D=o(a(E,U));I=I.mul(D).add(o(z))}else I=I.mul(L),I=I.add(o(z))}return I.unsigned=y,I}t.fromString=c;function l(_){return _ instanceof t?_:typeof _=="number"?o(_):typeof _=="string"?c(_):s(_.low,_.high,_.unsigned)}t.fromValue=l;var u=1<<16,f=1<<24,h=u*u,d=h*h,p=d/2,g=i(f),m=i(0);t.ZERO=m;var v=i(0,!0);t.UZERO=v;var w=i(1);t.ONE=w;var x=i(1,!0);t.UONE=x;var b=i(-1);t.NEG_ONE=b;var T=s(-1,2147483647,!1);t.MAX_VALUE=T;var S=s(-1,-1,!0);t.MAX_UNSIGNED_VALUE=S;var P=s(0,-2147483648,!1);t.MIN_VALUE=P;var M=t.prototype;return M.toInt=function(){return this.unsigned?this.low>>>0:this.low},M.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},M.toString=function(y){if(y=y||10,y<2||36<y)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(P)){var E=o(y),A=this.div(E),L=A.mul(E).sub(this);return A.toString(y)+L.toInt().toString(y)}else return"-"+this.neg().toString(y);for(var I=o(a(y,6),this.unsigned),R=this,U="";;){var z=R.div(I),D=R.sub(z.mul(I)).toInt()>>>0,q=D.toString(y);if(R=z,R.isZero())return q+U;for(;q.length<6;)q="0"+q;U=""+q+U}},M.getHighBits=function(){return this.high},M.getHighBitsUnsigned=function(){return this.high>>>0},M.getLowBits=function(){return this.low},M.getLowBitsUnsigned=function(){return this.low>>>0},M.getNumBitsAbs=function(){if(this.isNegative())return this.eq(P)?64:this.neg().getNumBitsAbs();for(var y=this.high!=0?this.high:this.low,E=31;E>0&&!(y&1<<E);E--);return this.high!=0?E+33:E+1},M.isZero=function(){return this.high===0&&this.low===0},M.isNegative=function(){return!this.unsigned&&this.high<0},M.isPositive=function(){return this.unsigned||this.high>=0},M.isOdd=function(){return(this.low&1)===1},M.isEven=function(){return(this.low&1)===0},M.equals=function(y){return e(y)||(y=l(y)),this.unsigned!==y.unsigned&&this.high>>>31===1&&y.high>>>31===1?!1:this.high===y.high&&this.low===y.low},M.eq=M.equals,M.notEquals=function(y){return!this.eq(y)},M.neq=M.notEquals,M.lessThan=function(y){return this.comp(y)<0},M.lt=M.lessThan,M.lessThanOrEqual=function(y){return this.comp(y)<=0},M.lte=M.lessThanOrEqual,M.greaterThan=function(y){return this.comp(y)>0},M.gt=M.greaterThan,M.greaterThanOrEqual=function(y){return this.comp(y)>=0},M.gte=M.greaterThanOrEqual,M.compare=function(y){if(e(y)||(y=l(y)),this.eq(y))return 0;var E=this.isNegative(),A=y.isNegative();return E&&!A?-1:!E&&A?1:this.unsigned?y.high>>>0>this.high>>>0||y.high===this.high&&y.low>>>0>this.low>>>0?-1:1:this.sub(y).isNegative()?-1:1},M.comp=M.compare,M.negate=function(){return!this.unsigned&&this.eq(P)?P:this.not().add(w)},M.neg=M.negate,M.add=function(y){e(y)||(y=l(y));var E=this.high>>>16,A=this.high&65535,L=this.low>>>16,I=this.low&65535,R=y.high>>>16,U=y.high&65535,z=y.low>>>16,D=y.low&65535,q=0,X=0,$=0,xt=0;return xt+=I+D,$+=xt>>>16,xt&=65535,$+=L+z,X+=$>>>16,$&=65535,X+=A+U,q+=X>>>16,X&=65535,q+=E+R,q&=65535,s($<<16|xt,q<<16|X,this.unsigned)},M.subtract=function(y){return e(y)||(y=l(y)),this.add(y.neg())},M.sub=M.subtract,M.multiply=function(y){if(this.isZero()||(e(y)||(y=l(y)),y.isZero()))return m;if(this.eq(P))return y.isOdd()?P:m;if(y.eq(P))return this.isOdd()?P:m;if(this.isNegative())return y.isNegative()?this.neg().mul(y.neg()):this.neg().mul(y).neg();if(y.isNegative())return this.mul(y.neg()).neg();if(this.lt(g)&&y.lt(g))return o(this.toNumber()*y.toNumber(),this.unsigned);var E=this.high>>>16,A=this.high&65535,L=this.low>>>16,I=this.low&65535,R=y.high>>>16,U=y.high&65535,z=y.low>>>16,D=y.low&65535,q=0,X=0,$=0,xt=0;return xt+=I*D,$+=xt>>>16,xt&=65535,$+=L*D,X+=$>>>16,$&=65535,$+=I*z,X+=$>>>16,$&=65535,X+=A*D,q+=X>>>16,X&=65535,X+=L*z,q+=X>>>16,X&=65535,X+=I*U,q+=X>>>16,X&=65535,q+=E*D+A*z+L*U+I*R,q&=65535,s($<<16|xt,q<<16|X,this.unsigned)},M.mul=M.multiply,M.divide=function(y){if(e(y)||(y=l(y)),y.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?v:m;var E,A,L;if(this.unsigned){if(y.unsigned||(y=y.toUnsigned()),y.gt(this))return v;if(y.gt(this.shru(1)))return x;L=v}else{if(this.eq(P)){if(y.eq(w)||y.eq(b))return P;if(y.eq(P))return w;var I=this.shr(1);return E=I.div(y).shl(1),E.eq(m)?y.isNegative()?w:b:(A=this.sub(y.mul(E)),L=E.add(A.div(y)),L)}else if(y.eq(P))return this.unsigned?v:m;if(this.isNegative())return y.isNegative()?this.neg().div(y.neg()):this.neg().div(y).neg();if(y.isNegative())return this.div(y.neg()).neg();L=m}for(A=this;A.gte(y);){E=Math.max(1,Math.floor(A.toNumber()/y.toNumber()));for(var R=Math.ceil(Math.log(E)/Math.LN2),U=R<=48?1:a(2,R-48),z=o(E),D=z.mul(y);D.isNegative()||D.gt(A);)E-=U,z=o(E,this.unsigned),D=z.mul(y);z.isZero()&&(z=w),L=L.add(z),A=A.sub(D)}return L},M.div=M.divide,M.modulo=function(y){return e(y)||(y=l(y)),this.sub(this.div(y).mul(y))},M.mod=M.modulo,M.not=function(){return s(~this.low,~this.high,this.unsigned)},M.and=function(y){return e(y)||(y=l(y)),s(this.low&y.low,this.high&y.high,this.unsigned)},M.or=function(y){return e(y)||(y=l(y)),s(this.low|y.low,this.high|y.high,this.unsigned)},M.xor=function(y){return e(y)||(y=l(y)),s(this.low^y.low,this.high^y.high,this.unsigned)},M.shiftLeft=function(y){return e(y)&&(y=y.toInt()),(y&=63)===0?this:y<32?s(this.low<<y,this.high<<y|this.low>>>32-y,this.unsigned):s(0,this.low<<y-32,this.unsigned)},M.shl=M.shiftLeft,M.shiftRight=function(y){return e(y)&&(y=y.toInt()),(y&=63)===0?this:y<32?s(this.low>>>y|this.high<<32-y,this.high>>y,this.unsigned):s(this.high>>y-32,this.high>=0?0:-1,this.unsigned)},M.shr=M.shiftRight,M.shiftRightUnsigned=function(y){if(e(y)&&(y=y.toInt()),y&=63,y===0)return this;var E=this.high;if(y<32){var A=this.low;return s(A>>>y|E<<32-y,E>>>y,this.unsigned)}else return y===32?s(E,0,this.unsigned):s(E>>>y-32,0,this.unsigned)},M.shru=M.shiftRightUnsigned,M.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},M.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},M.toBytes=function(_){return _?this.toBytesLE():this.toBytesBE()},M.toBytesLE=function(){var _=this.high,y=this.low;return[y&255,y>>>8&255,y>>>16&255,y>>>24&255,_&255,_>>>8&255,_>>>16&255,_>>>24&255]},M.toBytesBE=function(){var _=this.high,y=this.low;return[_>>>24&255,_>>>16&255,_>>>8&255,_&255,y>>>24&255,y>>>16&255,y>>>8&255,y&255]},t})});var on=Y((sS,tl)=>{tl.exports=globalThis.h3||{}});var ml=Y((mS,pl)=>{pl.exports=globalThis.deck});var El=Y(($S,Pl)=>{Pl.exports=globalThis.deck});var Bl=Y(Po=>{Po.read=function(t,e,r,n,i){var o,s,a=i*8-n-1,c=(1<<a)-1,l=c>>1,u=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,o=d&(1<<-u)-1,d>>=-u,u+=a;u>0;o=o*256+t[e+f],f+=h,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=s*256+t[e+f],f+=h,u-=8);if(o===0)o=1-l;else{if(o===c)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-l}return(d?-1:1)*s*Math.pow(2,o-n)};Po.write=function(t,e,r,n,i,o){var s,a,c,l=o*8-i-1,u=(1<<l)-1,f=u>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+f>=1?e+=h/c:e+=h*Math.pow(2,1-f),e*c>=2&&(s++,c/=2),s+f>=u?(a=0,s=u):s+f>=1?(a=(e*c-1)*Math.pow(2,i),s=s+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=a&255,d+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;t[r+d]=s&255,d+=p,s/=256,l-=8);t[r+d-p]|=g*128}});var Wl=Y((qT,Vl)=>{"use strict";Vl.exports=C;var En=Bl();function C(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}C.Varint=0;C.Fixed64=1;C.Bytes=2;C.Fixed32=5;var Eo=(1<<16)*(1<<16),kl=1/Eo,jy=12,jl=typeof TextDecoder>"u"?null:new TextDecoder("utf8");C.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=On(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ul(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=On(this.buf,this.pos)+On(this.buf,this.pos+4)*Eo;return this.pos+=8,t},readSFixed64:function(){var t=On(this.buf,this.pos)+Ul(this.buf,this.pos+4)*Eo;return this.pos+=8,t},readFloat:function(){var t=En.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=En.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,r,n;return n=e[this.pos++],r=n&127,n<128||(n=e[this.pos++],r|=(n&127)<<7,n<128)||(n=e[this.pos++],r|=(n&127)<<14,n<128)||(n=e[this.pos++],r|=(n&127)<<21,n<128)?r:(n=e[this.pos],r|=(n&15)<<28,Vy(r,t,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=jy&&jl?r1(this.buf,e,t):e1(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==C.Bytes)return t.push(this.readVarint(e));var r=Pt(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==C.Bytes)return t.push(this.readSVarint());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==C.Bytes)return t.push(this.readBoolean());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==C.Bytes)return t.push(this.readFloat());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==C.Bytes)return t.push(this.readDouble());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==C.Bytes)return t.push(this.readFixed32());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==C.Bytes)return t.push(this.readSFixed32());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==C.Bytes)return t.push(this.readFixed64());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==C.Bytes)return t.push(this.readSFixed64());var e=Pt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===C.Varint)for(;this.buf[this.pos++]>127;);else if(e===C.Bytes)this.pos=this.readVarint()+this.pos;else if(e===C.Fixed32)this.pos+=4;else if(e===C.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ve(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ve(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ve(this.buf,t&-1,this.pos),ve(this.buf,Math.floor(t*kl),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ve(this.buf,t&-1,this.pos),ve(this.buf,Math.floor(t*kl),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){Wy(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=n1(this.buf,t,this.pos);var r=this.pos-e;r>=128&&ql(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),En.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),En.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&ql(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,C.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Zy,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Xy,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,$y,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Yy,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Hy,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Qy,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Ky,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Jy,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,t1,e)},writeBytesField:function(t,e){this.writeTag(t,C.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,C.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,C.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,C.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,C.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,C.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,C.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,C.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,C.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,C.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};function Vy(t,e,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return ye(t,i,e);throw new Error("Expected varint not more than 10 bytes")}function Pt(t){return t.type===C.Bytes?t.readVarint()+t.pos:t.pos+1}function ye(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Wy(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(r=~(-t%4294967296),n=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),Dy(r,n,e),Gy(n,e)}function Dy(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function Gy(t,e){var r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function ql(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Zy(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Xy(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Yy(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Hy(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function $y(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Qy(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Ky(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Jy(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function t1(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function On(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function ve(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Ul(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function e1(t,e,r){for(var n="",i=e;i<r;){var o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a>r)break;var c,l,u;a===1?o<128&&(s=o):a===2?(c=t[i+1],(c&192)===128&&(s=(o&31)<<6|c&63,s<=127&&(s=null))):a===3?(c=t[i+1],l=t[i+2],(c&192)===128&&(l&192)===128&&(s=(o&15)<<12|(c&63)<<6|l&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):a===4&&(c=t[i+1],l=t[i+2],u=t[i+3],(c&192)===128&&(l&192)===128&&(u&192)===128&&(s=(o&15)<<18|(c&63)<<12|(l&63)<<6|u&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,a=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),n+=String.fromCharCode(s),i+=a}return n}function r1(t,e,r){return jl.decode(t.subarray(e,r))}function n1(t,e,r){for(var n=0,i,o;n<e.length;n++){if(i=e.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):o=i;continue}else o&&(t[r++]=239,t[r++]=191,t[r++]=189,o=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=i&63|128)}return r}});var ir={};kn(ir,{GeohashLayer:()=>Bn,GreatCircleLayer:()=>Nr,H3ClusterLayer:()=>hn,H3HexagonLayer:()=>Xt,MVTLayer:()=>Nn,QuadkeyLayer:()=>Wr,S2Layer:()=>Ur,TerrainLayer:()=>_n,TileLayer:()=>Tt,TripsLayer:()=>nn,_GeoCellLayer:()=>nt,_Tile2DHeader:()=>Fe,_Tileset2D:()=>ke,_WMSLayer:()=>Lr,_getURLFromTemplate:()=>yt});var lt={},Wo=B(ct());Et(lt,B(ct()));if(!Wo.GeoJsonLayer)throw new Error("@deck.gl/layers is not found");Et(ir,lt);var Gt=B(ut()),Ka=B(ct());function Tu(t){return typeof t=="string"?t.charAt(0).toLowerCase()+t.slice(1):t}function ar(t){if(Array.isArray(t))return t.map(e=>ar(e));if(t&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[Tu(r)]=ar(n);return e}return t}var Ss=B(Ms(),1);function Gn(t,e){if(e!=null&&e._parser&&e._parser!=="fast-xml-parser")throw new Error(e?._parser);let r={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:e?.removeNSPrefix,textNodeName:e?.textNodeName,isArray:(i,o,s,a)=>{var c;return Boolean(e==null||(c=e.arrayPaths)===null||c===void 0?void 0:c.some(u=>o===u))},...e?._fastXML},n=Hf(t,r);return e!=null&&e.uncapitalizeKeys?ar(n):n}function Hf(t,e){return new Ss.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...e}).parse(t)}var $f=typeof __VERSION__<"u"?__VERSION__:"latest",K={name:"XML",id:"xml",module:"xml",version:$f,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:Qf,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(t,e)=>Gn(new TextDecoder().decode(t),{...K.options.xml,...e?.xml}),parseTextSync:(t,e)=>Gn(t,{...K.options.xml,...e?.xml})};function Qf(t){return t.startsWith("<?xml")}async function Zn(t,e,r,n){return n._parse(t,e,r,n)}function we(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var ft={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Kf=ft.self||ft.window||ft.global||{},Jf=ft.window||ft.self||ft.global||{},th=ft.global||ft.self||ft.window||{},eh=ft.document||{};var Xn=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Ts=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),rh=Ts&&parseFloat(Ts[1])||0;function Yn(t,e){return Ps(t||{},e)}function Ps(t,e){let r={...t};for(let[n,i]of Object.entries(e))i&&typeof i=="object"&&!Array.isArray(i)?r[n]=Ps(r[n]||{},e[n]):r[n]=e[n];return r}function Me(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];let n=e,i=n&&n.length>1&&n[0].constructor||null;if(!i)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let o=n.reduce((c,l)=>c+l.length,0),s=new i(o),a=0;for(let c of n)s.set(c,a),a+=c.length;return s}function Se(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){let e=process.hrtime();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}var jt=class{constructor(e,r){this.name=void 0,this.type=void 0,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=e,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(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Se(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Se()-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 te=class{constructor(e){this.id=void 0,this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:e,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let e of Object.values(this.stats))e.reset();return this}forEach(e){for(let r of Object.values(this.stats))e(r)}getTable(){let e={};return this.forEach(r=>{e[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(e){let{name:r,type:n}=e,i=this.stats[r];return i||(e instanceof jt?i=e:i=new jt(r,n),this.stats[r]=i),i}};var nh="Queued Requests",ih="Active Requests",oh="Cancelled Requests",sh="Queued Requests Ever",ah="Active Requests Ever",ch={id:"request-scheduler",throttleRequests:!0,maxRequests:6},ee=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.props=void 0,this.stats=void 0,this.activeRequestCount=0,this.requestQueue=[],this.requestMap=new Map,this.deferredUpdate=null,this.props={...ch,...e},this.stats=new te({id:this.props.id}),this.stats.get(nh),this.stats.get(ih),this.stats.get(oh),this.stats.get(sh),this.stats.get(ah)}scheduleRequest(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>0;if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(e))return this.requestMap.get(e);let n={handle:e,priority:0,getPriority:r},i=new Promise(o=>(n.resolve=o,n));return this.requestQueue.push(n),this.requestMap.set(e,i),this._issueNewRequests(),i}_issueRequest(e){let{handle:r,resolve:n}=e,i=!1,o=()=>{i||(i=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:o}):Promise.resolve({done:o})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout(()=>this._issueNewRequestsAsync(),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;let e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(e!==0){this._updateAllRequests();for(let r=0;r<e;++r){let n=this.requestQueue.shift();n&&this._issueRequest(n)}}}_updateAllRequests(){let e=this.requestQueue;for(let r=0;r<e.length;++r){let n=e[r];this._updateRequest(n)||(e.splice(r,1),this.requestMap.delete(n.handle),r--)}e.sort((r,n)=>r.priority-n.priority)}_updateRequest(e){return e.priority=e.getPriority(e.handle),e.priority<0?(e.resolve(null),!1):!0}};var ur=class{constructor(e){this.data=void 0,this.fetch=void 0,this.loadOptions=void 0,this._needsRefresh=!0,this.props=void 0,this.props={...e},this.loadOptions={...e.loadOptions},this.fetch=lh(this.loadOptions)}setProps(e){this.props=Object.assign(this.props,e),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=this._needsRefresh;return e&&(this._needsRefresh=!1),r}};function lh(t){let e=t?.fetch;if(e&&typeof e=="function")return(n,i)=>e(n,i);let r=t?.fetch;return r&&typeof r!="function"?n=>fetch(n,r):n=>fetch(n)}var rt=class extends ur{};rt.type="template";rt.testURL=t=>!1;function Es(t,e){var r,n,i;let o=(r=K.parseTextSync)===null||r===void 0?void 0:r.call(K,t,e),s=(o==null||(n=o.ServiceExceptionReport)===null||n===void 0?void 0:n.ServiceException)||(o==null||(i=o["ogc:ServiceExceptionReport"])===null||i===void 0?void 0:i["ogc:ServiceException"]);return typeof s=="string"?s:s.value||s.code||"Unknown error"}var uh=typeof __VERSION__<"u"?__VERSION__:"latest",Vt={id:"wms-error",name:"WMS Error",module:"wms",version:uh,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:fh,options:{wms:{throwOnError:!1}},parse:async(t,e)=>Hn(new TextDecoder().decode(t),e),parseSync:(t,e)=>Hn(new TextDecoder().decode(t),e),parseTextSync:(t,e)=>Hn(t,e)};function fh(t){return t.startsWith("<?xml")}function Hn(t,e){let r={...Vt.options.wms,...e?.wms},n=Es(t,r),i=r.minimalErrors?n:`WMS Service error: ${n}`;if(r.throwOnError)throw new Error(i);return i}function Wt(t){return Array.isArray(t)?t:t?[t]:[]}function Te(t){let e=Wt(t);return e.length>0&&e.every(r=>typeof r=="string")?e:[]}function Pe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;switch(typeof t){case"number":return t;case"string":return parseFloat(t);default:return}}function fr(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;switch(typeof t){case"number":return t;case"string":return parseInt(t,10);default:return}}function Dt(t){switch(t){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function $n(t,e){var r;let n=(r=K.parseTextSync)===null||r===void 0?void 0:r.call(K,t,e),i=n.WMT_MS_Capabilities||n.WMS_Capabilities||n,o=hh(i);if(e!=null&&e.inheritedLayerProps)for(let s of o.layers)Is(s,null);return e!=null&&e.includeRawJSON&&(o.json=i),e!=null&&e.includeXMLText&&(o.xml=t),o}function hh(t){var e,r,n,i,o,s,a,c,l,u,f,h,d,p,g,m;let v={version:String(t.version||""),name:String(((e=t.Service)===null||e===void 0?void 0:e.Name)||"unnamed"),title:(r=t.Service)!==null&&r!==void 0&&r.Title?String((n=t.Service)===null||n===void 0?void 0:n.Title):void 0,abstract:(i=t.Service)!==null&&i!==void 0&&i.Abstract?String((o=t.Service)===null||o===void 0?void 0:o.Abstract):void 0,keywords:Te((s=t.Service)===null||s===void 0||(a=s.KeywordList)===null||a===void 0?void 0:a.Keyword),fees:(c=t.Service)!==null&&c!==void 0&&c.Fees?JSON.stringify((l=t.Service)===null||l===void 0?void 0:l.Fees):void 0,accessConstraints:(u=t.Service)!==null&&u!==void 0&&u.AccessConstraints?JSON.stringify((f=t.Service)===null||f===void 0?void 0:f.AccessConstraints):void 0,layerLimit:fr((h=t.Service)===null||h===void 0?void 0:h.LayerLimit),maxWidth:fr((d=t.Service)===null||d===void 0?void 0:d.maxWidth),maxHeight:fr((p=t.Service)===null||p===void 0?void 0:p.maxHeight),layers:[],requests:dh((g=t.Capability)===null||g===void 0?void 0:g.Request),exceptions:ph(t.Exception)},w=Wt((m=t.Capability)===null||m===void 0?void 0:m.Layer);for(let x of w)v.layers.push(Os(x));for(let[x,b]of Object.entries(v))b===void 0&&delete v[x];return v}function dh(t){let e={};for(let[r,n]of Object.entries(t||{})){let i=Te(n?.Format);e[r]={mimeTypes:i}}return e}function ph(t){if(Wt(t?.Format).length>0)return{mimeTypes:Te(t)}}function Os(t){var e;let r={title:String(t?.Title||""),name:t?.Name&&String(t?.Name),abstract:t?.Name&&String(t?.Abstract),keywords:Te((e=t.KeywordList)===null||e===void 0?void 0:e.Keyword)},n=t?.CRS||t?.SRS;n&&Array.isArray(n)&&n.every(u=>typeof u=="string")&&(r.crs=n);let i=t?.EX_GeographicBoundingBox&&mh(t?.EX_GeographicBoundingBox);i&&(r.geographicBoundingBox=i),i=t?.LatLonBoundingBox&&gh(t?.LatLonBoundingBox),i&&(r.geographicBoundingBox=i);let o=t?.BoundingBox&&yh(t?.BoundingBox);o&&o.length>0&&(r.boundingBoxes=o);let a=Wt(t?.Dimension).map(u=>xh(u));a.length&&(r.dimensions=a),t!=null&&t.opaque&&(r.opaque=Dt(t?.opaque)),t!=null&&t.cascaded&&(r.cascaded=Dt(t?.cascaded)),t!=null&&t.queryable&&(r.queryable=Dt(t?.queryable));let c=Wt(t?.Layer),l=[];for(let u of c)l.push(Os(u));l.length>0&&(r.layers=l);for(let[u,f]of Object.entries(r))f===void 0&&delete r[u];return r}function mh(t){let{westBoundLongitude:e,northBoundLatitude:r,eastBoundLongitude:n,southBoundLatitude:i}=t;return[[e,i],[n,r]]}function gh(t){let{minx:e,miny:r,maxx:n,maxy:i}=t;return[[e,r],[n,i]]}function yh(t){return Wt(t).map(r=>vh(r))}function vh(t){let{CRS:e,SRS:r,minx:n,miny:i,maxx:o,maxy:s,resx:a,resy:c}=t,l={crs:e||r,boundingBox:[[Pe(n),Pe(i)],[Pe(o),Pe(s)]]};return a&&(l.xResolution=a),c&&(l.yResolution=c),l}function xh(t){let{name:e,units:r,value:n}=t,i={name:e,units:r,extent:n};return t.unitSymbol&&(i.unitSymbol=t.unitSymbol),t.default&&(i.defaultValue=t.default),t.multipleValues&&(i.multipleValues=Dt(t.multipleValues)),t.nearestValue&&(i.nearestValue=Dt(t.nearestValue)),t.current&&(i.current=Dt(t.current)),i}function Is(t,e){e!=null&&e.geographicBoundingBox&&!t.geographicBoundingBox&&(t.geographicBoundingBox=[...e.geographicBoundingBox]),e!=null&&e.crs&&!t.crs&&(t.crs=[...e.crs]),e!=null&&e.boundingBoxes&&!t.boundingBoxes&&(t.boundingBoxes=[...e.boundingBoxes]),e!=null&&e.dimensions&&!t.dimensions&&(t.dimensions=[...e.dimensions]);for(let r of t.layers||[])Is(r,t)}var _h=typeof __VERSION__<"u"?__VERSION__:"latest",re={id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:_h,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:bh,options:{wms:{}},parse:async(t,e)=>$n(new TextDecoder().decode(t),e?.wms),parseTextSync:(t,e)=>$n(t,e?.wms)};function bh(t){return t.startsWith("<?xml")}function Qn(t,e){var r,n;let o=((n=((r=K.parseTextSync)===null||r===void 0?void 0:r.call(K,t,e)).FeatureInfoResponse)===null||n===void 0?void 0:n.FIELDS)||[];return{features:(Array.isArray(o)?o:[o]).map(a=>wh(a))}}function wh(t){return{attributes:t||{},type:"",bounds:{bottom:0,top:0,left:0,right:0}}}var As={...re,id:"wms-feature-info",name:"WMS FeatureInfo",parse:async(t,e)=>Qn(new TextDecoder().decode(t),e),parseTextSync:(t,e)=>Qn(t,e)};function Kn(t,e){var r;return(r=K.parseTextSync)===null||r===void 0?void 0:r.call(K,t,e)}var Ls={...re,id:"wms-layer-description",name:"WMS DescribeLayer",parse:async(t,e)=>Kn(new TextDecoder().decode(t),e),parseTextSync:(t,e)=>Kn(t,e)};function Rs(t,e){let{type:r="auto"}=t,n=r==="auto"?Sh(t.url,e):Mh(r,e);if(!n)throw new Error("Not a valid image source type");return n.create(t)}function Mh(t,e){for(let r of e)if(r.type===t)return r;return null}function Sh(t,e){for(let r of e)if(r.testURL&&r.testURL(t))return r;return null}var Fs=typeof __VERSION__<"u"?__VERSION__:"latest";var Jn,Th=(Jn=globalThis.loaders)===null||Jn===void 0?void 0:Jn.parseImageNode,ti=typeof Image<"u",ei=typeof ImageBitmap<"u",Ph=Boolean(Th),ri=Xn?!0:Ph;function Ns(t){switch(t){case"auto":return ei||ti||ri;case"imagebitmap":return ei;case"image":return ti;case"data":return ri;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function Cs(){if(ei)return"imagebitmap";if(ti)return"image";if(ri)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Eh(t){let e=Oh(t);if(!e)throw new Error("Not an image");return e}function zs(t){switch(Eh(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Oh(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var Ih=/^data:image\/svg\+xml/,Ah=/\.svg((\?|#).*)?$/;function hr(t){return t&&(Ih.test(t)||Ah.test(t))}function Bs(t,e){if(hr(e)){let n=new TextDecoder().decode(t);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 ni(t,e)}function ni(t,e){if(hr(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function dr(t,e,r){let n=Bs(t,r),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await Lh(o||n,e)}finally{o&&i.revokeObjectURL(o)}}async function Lh(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,i)=>{try{r.onload=()=>n(r),r.onerror=o=>{let s=o instanceof Error?o.message:"error";i(new Error(s))}}catch(o){i(o)}})}var Rh={},ks=!0;async function qs(t,e,r){let n;hr(r)?n=await dr(t,e,r):n=ni(t,r);let i=e&&e.imagebitmap;return await Fh(n,i)}async function Fh(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if((Nh(e)||!ks)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),ks=!1}return await createImageBitmap(t)}function Nh(t){for(let e in t||Rh)return!1;return!0}function Us(t){return!kh(t,"ftyp",4)||!(t[8]&96)?null:Ch(t)}function Ch(t){switch(zh(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function zh(t,e,r){return String.fromCharCode(...t.slice(e,r))}function Bh(t){return[...t].map(e=>e.charCodeAt(0))}function kh(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=Bh(e);for(let i=0;i<n.length;++i)if(n[i]!==t[i+r])return!1;return!0}var ht=!1,Ee=!0;function pr(t){let e=Oe(t);return Uh(e)||Wh(e)||jh(e)||Vh(e)||qh(e)}function qh(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Us(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function Uh(t){let e=Oe(t);return e.byteLength>=24&&e.getUint32(0,ht)===2303741511?{mimeType:"image/png",width:e.getUint32(16,ht),height:e.getUint32(20,ht)}:null}function jh(t){let e=Oe(t);return e.byteLength>=10&&e.getUint32(0,ht)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Ee),height:e.getUint16(8,Ee)}:null}function Vh(t){let e=Oe(t);return e.byteLength>=14&&e.getUint16(0,ht)===16973&&e.getUint32(2,Ee)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Ee),height:e.getUint32(22,Ee)}:null}function Wh(t){let e=Oe(t);if(!(e.byteLength>=3&&e.getUint16(0,ht)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=Dh(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,ht);if(i.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,ht),width:e.getUint16(o+7,ht)};if(!n.has(s))return null;o+=2,o+=e.getUint16(o,ht)}return null}function Dh(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Oe(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function js(t,e){var r;let{mimeType:n}=pr(t)||{},i=(r=globalThis.loaders)===null||r===void 0?void 0:r.parseImageNode;return we(i),await i(t,n)}async function Vs(t,e,r){e=e||{};let i=(e.image||{}).type||"auto",{url:o}=r||{},s=Gh(i),a;switch(s){case"imagebitmap":a=await qs(t,e,o);break;case"image":a=await dr(t,e,o);break;case"data":a=await js(t,e);break;default:we(!1)}return i==="data"&&(a=zs(a)),a}function Gh(t){switch(t){case"auto":case"data":return Cs();default:return Ns(t),t}}var Zh=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Xh=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Yh={image:{type:"auto",decode:!0}},ne={id:"image",module:"images",name:"Images",version:Fs,mimeTypes:Xh,extensions:Zh,parse:Vs,tests:[t=>Boolean(pr(new DataView(t)))],options:Yh};var Ws={type:"wms",testURL:t=>t.toLowerCase().includes("wms"),create:t=>new ii(t)},ii=class extends rt{constructor(e){var r;super(e),this.url=void 0,this.data=void 0,this.substituteCRS84=void 0,this.flipCRS=void 0,this.wmsParameters=void 0,this.vendorParameters=void 0,this.capabilities=null,this.url=e.url,this.data=e.url,this.substituteCRS84=(r=e.substituteCRS84)!==null&&r!==void 0?r:!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,...e.wmsParameters},this.vendorParameters=e.vendorParameters||{}}async getMetadata(){let e=await this.getCapabilities();return this.normalizeMetadata(e)}async getImage(e){return await this.getMap(e)}normalizeMetadata(e){return e}async getCapabilities(e,r){let n=this.getCapabilitiesURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();this._checkResponse(i,o);let s=await re.parse(o,this.loadOptions);return this.capabilities=s,s}async getMap(e,r){let n=this.getMapURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();this._checkResponse(i,o);try{return await ne.parse(o,this.loadOptions)}catch{throw this._parseError(o)}}async getFeatureInfo(e,r){let n=this.getFeatureInfoURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();return this._checkResponse(i,o),await As.parse(o,this.loadOptions)}async getFeatureInfoText(e,r){let n=this.getFeatureInfoURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();return this._checkResponse(i,o),new TextDecoder().decode(o)}async describeLayer(e,r){let n=this.describeLayerURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();return this._checkResponse(i,o),await Ls.parse(o,this.loadOptions)}async getLegendGraphic(e,r){let n=this.getLegendGraphicURL(e,r),i=await this.fetch(n),o=await i.arrayBuffer();this._checkResponse(i,o);try{return await ne.parse(o,this.loadOptions)}catch{throw this._parseError(o)}}getCapabilitiesURL(e,r){let n={version:this.wmsParameters.version,...e};return this._getWMSUrl("GetCapabilities",n,r)}getMapURL(e,r){e=this._getWMS130Parameters(e);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,...e};return this._getWMSUrl("GetMap",n,r)}getFeatureInfoURL(e,r){e=this._getWMS130Parameters(e);let n={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,...e};return this._getWMSUrl("GetFeatureInfo",n,r)}describeLayerURL(e,r){let n={version:this.wmsParameters.version,...e};return this._getWMSUrl("DescribeLayer",n,r)}getLegendGraphicURL(e,r){let n={version:this.wmsParameters.version,...e};return this._getWMSUrl("GetLegendGraphic",n,r)}_parseWMSUrl(e){let[r,n]=e.split("?"),i=n.split("&"),o={};for(let s of i){let[a,c]=s.split("=");o[a]=c}return{url:r,parameters:o}}_getWMSUrl(e,r,n){let i=this.url,o=!0,s={service:"WMS",version:r.version,request:e,...r,...this.vendorParameters,...n},a=["transparent","time","elevation"];for(let[c,l]of Object.entries(s))(!a.includes(c)||l)&&(i+=o?"?":"&",o=!1,i+=this._getURLParameter(c,l,r));return encodeURI(i)}_getWMS130Parameters(e){let r={...e};return r.srs&&(r.crs=r.crs||r.srs,delete r.srs),r}_getURLParameter(e,r,n){switch(e){case"crs":n.version!=="1.3.0"?e="srs":this.substituteCRS84&&r==="EPSG:4326"&&(r="CRS:84");break;case"srs":n.version==="1.3.0"&&(e="crs");break;case"boundingBox":let i=r,o=[...i[0],...i[1]];o=this._flipBoundingBox(i,n),o&&(r=o);break;case"bbox":let s=this._flipBoundingBox(r,n);s&&(r=s);break;default:}return e=e.toUpperCase(),Array.isArray(r)?`${e}=${r.join(",")}`:`${e}=${r?String(r):""}`}_flipBoundingBox(e,r){if(!Array.isArray(e)||e.length!==4)return null;let n=r.version==="1.3.0"&&this.flipCRS.includes(r.crs||"")&&!(this.substituteCRS84&&r.crs==="EPSG:4326"),i=e;return n?[i[1],i[0],i[3],i[2]]:i}async _fetchArrayBuffer(e){let r=await this.fetch(e),n=await r.arrayBuffer();return this._checkResponse(r,n),n}_checkResponse(e,r){let n=e.headers["content-type"];if(!e.ok||Vt.mimeTypes.includes(n)){var i;let o=Yn(this.loadOptions,{wms:{throwOnError:!0}}),s=(i=Vt.parseSync)===null||i===void 0?void 0:i.call(Vt,r,o);throw new Error(s)}}_parseError(e){var r;let n=(r=Vt.parseSync)===null||r===void 0?void 0:r.call(Vt,e,this.loadOptions);return new Error(n)}};var ie=class extends rt{constructor(e){super(e)}async getMetadata(){throw new Error("ImageSource.getMetadata not implemented")}async getImage(e){let r=this.getGranularParameters(e),n=this.getURLFromTemplate(r),o=await(await this.fetch(n)).arrayBuffer();return await ne.parse(o)}getGranularParameters(e){let[[r,n],[i,o]]=e.boundingBox;return{...e,east:r,north:n,south:o,west:i}}getURLFromTemplate(e){let r=this.props.url;for(let[n,i]of Object.entries(e))r=r.replace(`\${${n}}`,String(i)),r=r.replace(`{${n}}`,String(i));return r}};ie.type="template";ie.testURL=t=>t.toLowerCase().includes("{");var oi=class extends ie{constructor(e){super(e),this.data=void 0,this.data=e.url}async getMetadata(){return await this.metadata()}async getImage(e){throw new Error("not implemented")}async metadata(){throw new Error("not implemented")}exportImage(e){throw new Error("not implemented")}metadataURL(e){return`${this.props.url}?f=pjson`}exportImageURL(e){let r=`bbox=${e.bbox[0]},${e.bbox[1]},${e.bbox[2]},${e.bbox[3]}`,n=`size=${e.width},${e.height}`,i={...e,bbox:r,size:n};return delete i.width,delete i.height,this.getUrl("exportImage",i)}getUrl(e,r,n){let i=`${this.props.url}/${e}`,o=!0;for(let[s,a]of Object.entries(r))i+=o?"?":"&",o=!1,Array.isArray(a)?i+=`${s.toUpperCase()}=${a.join(",")}`:i+=`${s.toUpperCase()}=${a?String(a):""}`;return i}async checkResponse(e){if(!e.ok)throw new Error("error")}},Ds={type:"arcgis-image-server",testURL:t=>t.toLowerCase().includes("ImageServer"),create:t=>new oi(t)};var Hh=[Ws,Ds];function si(t){return Rs(t,Hh)}function F(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var C2=1/Math.PI*180,z2=1/180*Math.PI,$h={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...$h}};var G=globalThis.mathgl.config;function ai(t,{precision:e=G.precision}={}){return t=Qh(t),"".concat(parseFloat(t.toPrecision(e)))}function dt(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function It(t,e,r){return dt(t)?t.map((n,i)=>It(n,e[i],r)):r*e+(1-r)*t}function pt(t,e,r){let n=G.EPSILON;r&&(G.EPSILON=r);try{if(t===e)return!0;if(dt(t)&&dt(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!pt(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=G.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{G.EPSILON=n}}function Qh(t){return Math.round(t/G.EPSILON)*G.EPSILON}function Kh(t){function e(){var r=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}var At=class extends Kh(Array){clone(){return new this.constructor().copy(this)}fromArray(e,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+r];return this.check()}toArray(e=[],r=0){for(let n=0;n<this.ELEMENTS;++n)e[r+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:dt(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(G)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+ai(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!pt(this[r],e[r]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==e[r])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,r,n){if(n===void 0)return this.lerp(this,e,r);for(let i=0;i<this.ELEMENTS;++i){let o=e[i],s=typeof r=="number"?r:r[i];this[i]=o+n*(s-o)}return this.check()}min(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(e[r],this[r]);return this.check()}max(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(e[r],this[r]);return this.check()}clamp(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),r[n]);return this.check()}add(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(e){if(typeof e=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;else for(let r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}multiplyByScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}check(){if(G.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=e;return this.check()}addScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),r);return this.check()}get elements(){return this}};function Jh(t,e){if(t.length!==e)return!1;for(let r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function N(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(JSON.stringify(t)));return t}function Lt(t,e,r=""){if(G.debug&&!Jh(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}function mt(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var oe=class extends At{get x(){return this[0]}set x(e){this[0]=N(e)}get y(){return this[1]}set y(e){this[1]=N(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*this[r];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-e[n];r+=i*i}return N(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return N(r)}normalize(){let e=this.magnitude();if(e!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e;return this.check()}multiply(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return mt(e>=0&&e<this.ELEMENTS,"index is out of range"),N(this[e])}setComponent(e,r){return mt(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=r,this.check()}addVectors(e,r){return this.copy(e).add(r)}subVectors(e,r){return this.copy(e).subtract(r)}multiplyVectors(e,r){return this.copy(e).multiply(r)}addScaledVector(e,r){return this.add(new this.constructor(e).multiplyScalar(r))}};var j=typeof Float32Array<"u"?Float32Array:Array;var X2=Math.PI/180;function td(){let t=new j(2);return j!=Float32Array&&(t[0]=0,t[1]=0),t}function Xs(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function Ys(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}var Y2=function(){let t=td();return function(e,r,n,i,o,s){let a,c;for(r||(r=2),n||(n=0),i?c=Math.min(i*r+n,e.length):c=e.length,a=n;a<c;a+=r)t[0]=e[a],t[1]=e[a+1],o(t,t,s),e[a]=t[0],e[a+1]=t[1];return e}}();function Hs(t,e,r){let n=e[0],i=e[1],o=r[3]*n+r[7]*i||1;return t[0]=(r[0]*n+r[4]*i)/o,t[1]=(r[1]*n+r[5]*i)/o,t}function mr(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o||1;return t[0]=(r[0]*n+r[4]*i+r[8]*o)/s,t[1]=(r[1]*n+r[5]*i+r[9]*o)/s,t[2]=(r[2]*n+r[6]*i+r[10]*o)/s,t}function $s(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t}function Qs(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t[3]=e[3],t}function gr(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=r[0]*n+r[3]*i+r[6]*o,t[1]=r[1]*n+r[4]*i+r[7]*o,t[2]=r[2]*n+r[5]*i+r[8]*o,t[3]=e[3],t}function ci(){let t=new j(3);return j!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ed(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function li(t,e,r){let n=new j(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ks(t,e){let r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function ui(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ae(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[0],a=r[1],c=r[2];return t[0]=i*c-o*a,t[1]=o*s-n*c,t[2]=n*a-i*s,t}function ce(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return s=s||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/s,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,t}function yr(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function vr(t,e,r){let n=r[0],i=r[1],o=r[2],s=r[3],a=e[0],c=e[1],l=e[2],u=i*l-o*c,f=o*a-n*l,h=n*c-i*a,d=i*h-o*f,p=o*u-n*h,g=n*f-i*u,m=s*2;return u*=m,f*=m,h*=m,d*=2,p*=2,g*=2,t[0]=a+u+d,t[1]=c+f+p,t[2]=l+h+g,t}function Js(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function ta(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function ea(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function ra(t,e){let r=t[0],n=t[1],i=t[2],o=e[0],s=e[1],a=e[2],c=Math.sqrt((r*r+n*n+i*i)*(o*o+s*s+a*a)),l=c&&ui(t,e)/c;return Math.acos(Math.min(Math.max(l,-1),1))}var na=ed;var Q2=function(){let t=ci();return function(e,r,n,i,o,s){let a,c;for(r||(r=3),n||(n=0),i?c=Math.min(i*r+n,e.length):c=e.length,a=n;a<c;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}();var fi=[0,0,0],xr,O=class extends oe{static get ZERO(){return xr||(xr=new O(0,0,0),Object.freeze(xr)),xr}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&dt(e)?this.copy(e):(G.debug&&(N(e),N(r),N(n)),this[0]=e,this[1]=r,this[2]=n)}set(e,r,n){return this[0]=e,this[1]=r,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return G.debug&&(N(e.x),N(e.y),N(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=N(e)}angle(e){return ra(this,e)}cross(e){return ae(this,this,e),this.check()}rotateX({radians:e,origin:r=fi}){return Js(this,this,r,e),this.check()}rotateY({radians:e,origin:r=fi}){return ta(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=fi}){return ea(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return ce(this,this,e),this.check()}transformAsVector(e){return mr(this,this,e),this.check()}transformByMatrix3(e){return yr(this,this,e),this.check()}transformByMatrix2(e){return $s(this,this,e),this.check()}transformByQuaternion(e){return vr(this,this,e),this.check()}};var _r,le=class extends oe{static get ZERO(){return _r||(_r=new le(0,0,0,0),Object.freeze(_r)),_r}constructor(e=0,r=0,n=0,i=0){super(-0,-0,-0,-0),dt(e)&&arguments.length===1?this.copy(e):(G.debug&&(N(e),N(r),N(n),N(i)),this[0]=e,this[1]=r,this[2]=n,this[3]=i)}set(e,r,n,i){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return G.debug&&(N(e.x),N(e.y),N(e.z),N(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=N(e)}get w(){return this[3]}set w(e){this[3]=N(e)}transform(e){return ce(this,this,e),this.check()}transformByMatrix3(e){return gr(this,this,e),this.check()}transformByMatrix2(e){return Qs(this,this,e),this.check()}transformByQuaternion(e){return vr(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var ue=class extends At{toString(){let e="[";if(G.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+r])}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=" ".concat(this[r])}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=N(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(e,r){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function ia(){let t=new j(9);return j!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function oa(t,e){if(t===e){let r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function sa(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],c=e[6],l=e[7],u=e[8],f=u*s-a*l,h=-u*o+a*c,d=l*o-s*c,p=r*f+n*h+i*d;return p?(p=1/p,t[0]=f*p,t[1]=(-u*n+i*l)*p,t[2]=(a*n-i*s)*p,t[3]=h*p,t[4]=(u*r-i*c)*p,t[5]=(-a*r+i*o)*p,t[6]=d*p,t[7]=(-l*r+n*c)*p,t[8]=(s*r-n*o)*p,t):null}function aa(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],c=t[7],l=t[8];return e*(l*o-s*c)+r*(-l*i+s*a)+n*(c*i-o*a)}function hi(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=r[0],d=r[1],p=r[2],g=r[3],m=r[4],v=r[5],w=r[6],x=r[7],b=r[8];return t[0]=h*n+d*s+p*l,t[1]=h*i+d*a+p*u,t[2]=h*o+d*c+p*f,t[3]=g*n+m*s+v*l,t[4]=g*i+m*a+v*u,t[5]=g*o+m*c+v*f,t[6]=w*n+x*s+b*l,t[7]=w*i+x*a+b*u,t[8]=w*o+x*c+b*f,t}function ca(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=c,t[6]=h*n+d*s+l,t[7]=h*i+d*a+u,t[8]=h*o+d*c+f,t}function la(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=Math.sin(r),d=Math.cos(r);return t[0]=d*n+h*s,t[1]=d*i+h*a,t[2]=d*o+h*c,t[3]=d*s-h*n,t[4]=d*a-h*i,t[5]=d*c-h*o,t[6]=l,t[7]=u,t[8]=f,t}function di(t,e,r){let n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function ua(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r+r,a=n+n,c=i+i,l=r*s,u=n*s,f=n*a,h=i*s,d=i*a,p=i*c,g=o*s,m=o*a,v=o*c;return t[0]=1-f-p,t[3]=u-v,t[6]=h+m,t[1]=u+v,t[4]=1-l-p,t[7]=d-g,t[2]=h-m,t[5]=d+g,t[8]=1-l-f,t}var pi;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(pi||(pi={}));var id=Object.freeze([1,0,0,0,1,0,0,0,1]),V=class extends ue{static get IDENTITY(){return sd()}static get ZERO(){return od()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return pi}constructor(e,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):r.length>0?this.copy([e,...r]):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(id)}fromObject(e){return this.check()}fromQuaternion(e){return ua(this,e),this.check()}set(e,r,n,i,o,s,a,c,l){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=c,this[8]=l,this.check()}setRowMajor(e,r,n,i,o,s,a,c,l){return this[0]=e,this[1]=i,this[2]=a,this[3]=r,this[4]=o,this[5]=c,this[6]=n,this[7]=s,this[8]=l,this.check()}determinant(){return aa(this)}transpose(){return oa(this,this),this.check()}invert(){return sa(this,this),this.check()}multiplyLeft(e){return hi(this,e,this),this.check()}multiplyRight(e){return hi(this,this,e),this.check()}rotate(e){return la(this,this,e),this.check()}scale(e){return Array.isArray(e)?di(this,this,e):di(this,this,[e,e]),this.check()}translate(e){return ca(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=Xs(r||[-0,-0],e,this);break;case 3:n=yr(r||[-0,-0,-0],e,this);break;case 4:n=gr(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Lt(n,e.length),n}transformVector(e,r){return this.transform(e,r)}transformVector2(e,r){return this.transform(e,r)}transformVector3(e,r){return this.transform(e,r)}},br,wr=null;function od(){return br||(br=new V([0,0,0,0,0,0,0,0,0]),Object.freeze(br)),br}function sd(){return wr||(wr=new V,Object.freeze(wr)),wr}var Mr={};kn(Mr,{add:()=>Ld,adjoint:()=>hd,clone:()=>cd,copy:()=>ld,create:()=>ad,decompose:()=>wd,determinant:()=>yi,equals:()=>Cd,exactEquals:()=>Nd,frob:()=>Ad,fromQuat:()=>Si,fromQuat2:()=>xd,fromRotation:()=>md,fromRotationTranslation:()=>ha,fromRotationTranslationScale:()=>Md,fromRotationTranslationScaleOrigin:()=>Sd,fromScaling:()=>pd,fromTranslation:()=>dd,fromValues:()=>ud,fromXRotation:()=>gd,fromYRotation:()=>yd,fromZRotation:()=>vd,frustum:()=>Ti,getRotation:()=>bd,getScaling:()=>da,getTranslation:()=>_d,identity:()=>fa,invert:()=>gi,lookAt:()=>Oi,mul:()=>zd,multiply:()=>Ie,multiplyScalar:()=>Rd,multiplyScalarAndAdd:()=>Fd,ortho:()=>Ei,orthoNO:()=>ma,orthoZO:()=>Ed,perspective:()=>Pi,perspectiveFromFieldOfView:()=>Pd,perspectiveNO:()=>pa,perspectiveZO:()=>Td,rotate:()=>_i,rotateX:()=>bi,rotateY:()=>wi,rotateZ:()=>Mi,scale:()=>xi,set:()=>fd,str:()=>Id,sub:()=>Bd,subtract:()=>ga,targetTo:()=>Od,translate:()=>vi,transpose:()=>mi});function ad(){let t=new j(16);return j!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function cd(t){let e=new j(16);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 ld(t,e){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 ud(t,e,r,n,i,o,s,a,c,l,u,f,h,d,p,g){let m=new j(16);return m[0]=t,m[1]=e,m[2]=r,m[3]=n,m[4]=i,m[5]=o,m[6]=s,m[7]=a,m[8]=c,m[9]=l,m[10]=u,m[11]=f,m[12]=h,m[13]=d,m[14]=p,m[15]=g,m}function fd(t,e,r,n,i,o,s,a,c,l,u,f,h,d,p,g,m){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t}function fa(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function mi(t,e){if(t===e){let r=e[1],n=e[2],i=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function gi(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=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],g=e[13],m=e[14],v=e[15],w=r*a-n*s,x=r*c-i*s,b=r*l-o*s,T=n*c-i*a,S=n*l-o*a,P=i*l-o*c,M=u*g-f*p,_=u*m-h*p,y=u*v-d*p,E=f*m-h*g,A=f*v-d*g,L=h*v-d*m,I=w*L-x*A+b*E+T*y-S*_+P*M;return I?(I=1/I,t[0]=(a*L-c*A+l*E)*I,t[1]=(i*A-n*L-o*E)*I,t[2]=(g*P-m*S+v*T)*I,t[3]=(h*S-f*P-d*T)*I,t[4]=(c*y-s*L-l*_)*I,t[5]=(r*L-i*y+o*_)*I,t[6]=(m*b-p*P-v*x)*I,t[7]=(u*P-h*b+d*x)*I,t[8]=(s*A-a*y+l*M)*I,t[9]=(n*y-r*A-o*M)*I,t[10]=(p*S-g*b+v*w)*I,t[11]=(f*b-u*S-d*w)*I,t[12]=(a*_-s*E-c*M)*I,t[13]=(r*E-n*_+i*M)*I,t[14]=(g*x-p*T-m*w)*I,t[15]=(u*T-f*x+h*w)*I,t):null}function hd(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=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],g=e[13],m=e[14],v=e[15],w=r*a-n*s,x=r*c-i*s,b=r*l-o*s,T=n*c-i*a,S=n*l-o*a,P=i*l-o*c,M=u*g-f*p,_=u*m-h*p,y=u*v-d*p,E=f*m-h*g,A=f*v-d*g,L=h*v-d*m;return t[0]=a*L-c*A+l*E,t[1]=i*A-n*L-o*E,t[2]=g*P-m*S+v*T,t[3]=h*S-f*P-d*T,t[4]=c*y-s*L-l*_,t[5]=r*L-i*y+o*_,t[6]=m*b-p*P-v*x,t[7]=u*P-h*b+d*x,t[8]=s*A-a*y+l*M,t[9]=n*y-r*A-o*M,t[10]=p*S-g*b+v*w,t[11]=f*b-u*S-d*w,t[12]=a*_-s*E-c*M,t[13]=r*E-n*_+i*M,t[14]=g*x-p*T-m*w,t[15]=u*T-f*x+h*w,t}function yi(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],m=t[15],v=e*s-r*o,w=e*a-n*o,x=r*a-n*s,b=l*p-u*d,T=l*g-f*d,S=u*g-f*p,P=e*S-r*T+n*b,M=o*S-s*T+a*b,_=l*x-u*w+f*v,y=d*x-p*w+g*v;return c*P-i*M+m*_-h*y}function Ie(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],m=e[13],v=e[14],w=e[15],x=r[0],b=r[1],T=r[2],S=r[3];return t[0]=x*n+b*a+T*f+S*g,t[1]=x*i+b*c+T*h+S*m,t[2]=x*o+b*l+T*d+S*v,t[3]=x*s+b*u+T*p+S*w,x=r[4],b=r[5],T=r[6],S=r[7],t[4]=x*n+b*a+T*f+S*g,t[5]=x*i+b*c+T*h+S*m,t[6]=x*o+b*l+T*d+S*v,t[7]=x*s+b*u+T*p+S*w,x=r[8],b=r[9],T=r[10],S=r[11],t[8]=x*n+b*a+T*f+S*g,t[9]=x*i+b*c+T*h+S*m,t[10]=x*o+b*l+T*d+S*v,t[11]=x*s+b*u+T*p+S*w,x=r[12],b=r[13],T=r[14],S=r[15],t[12]=x*n+b*a+T*f+S*g,t[13]=x*i+b*c+T*h+S*m,t[14]=x*o+b*l+T*d+S*v,t[15]=x*s+b*u+T*p+S*w,t}function vi(t,e,r){let n=r[0],i=r[1],o=r[2],s,a,c,l,u,f,h,d,p,g,m,v;return e===t?(t[12]=e[0]*n+e[4]*i+e[8]*o+e[12],t[13]=e[1]*n+e[5]*i+e[9]*o+e[13],t[14]=e[2]*n+e[6]*i+e[10]*o+e[14],t[15]=e[3]*n+e[7]*i+e[11]*o+e[15]):(s=e[0],a=e[1],c=e[2],l=e[3],u=e[4],f=e[5],h=e[6],d=e[7],p=e[8],g=e[9],m=e[10],v=e[11],t[0]=s,t[1]=a,t[2]=c,t[3]=l,t[4]=u,t[5]=f,t[6]=h,t[7]=d,t[8]=p,t[9]=g,t[10]=m,t[11]=v,t[12]=s*n+u*i+p*o+e[12],t[13]=a*n+f*i+g*o+e[13],t[14]=c*n+h*i+m*o+e[14],t[15]=l*n+d*i+v*o+e[15]),t}function xi(t,e,r){let n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function _i(t,e,r,n){let i=n[0],o=n[1],s=n[2],a=Math.sqrt(i*i+o*o+s*s),c,l,u,f,h,d,p,g,m,v,w,x,b,T,S,P,M,_,y,E,A,L,I,R;return a<1e-6?null:(a=1/a,i*=a,o*=a,s*=a,l=Math.sin(r),c=Math.cos(r),u=1-c,f=e[0],h=e[1],d=e[2],p=e[3],g=e[4],m=e[5],v=e[6],w=e[7],x=e[8],b=e[9],T=e[10],S=e[11],P=i*i*u+c,M=o*i*u+s*l,_=s*i*u-o*l,y=i*o*u-s*l,E=o*o*u+c,A=s*o*u+i*l,L=i*s*u+o*l,I=o*s*u-i*l,R=s*s*u+c,t[0]=f*P+g*M+x*_,t[1]=h*P+m*M+b*_,t[2]=d*P+v*M+T*_,t[3]=p*P+w*M+S*_,t[4]=f*y+g*E+x*A,t[5]=h*y+m*E+b*A,t[6]=d*y+v*E+T*A,t[7]=p*y+w*E+S*A,t[8]=f*L+g*I+x*R,t[9]=h*L+m*I+b*R,t[10]=d*L+v*I+T*R,t[11]=p*L+w*I+S*R,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function bi(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[4],s=e[5],a=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*n,t[5]=s*i+u*n,t[6]=a*i+f*n,t[7]=c*i+h*n,t[8]=l*i-o*n,t[9]=u*i-s*n,t[10]=f*i-a*n,t[11]=h*i-c*n,t}function wi(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],c=e[3],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*n,t[1]=s*i-u*n,t[2]=a*i-f*n,t[3]=c*i-h*n,t[8]=o*n+l*i,t[9]=s*n+u*i,t[10]=a*n+f*i,t[11]=c*n+h*i,t}function Mi(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],c=e[3],l=e[4],u=e[5],f=e[6],h=e[7];return e!==t&&(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[0]=o*i+l*n,t[1]=s*i+u*n,t[2]=a*i+f*n,t[3]=c*i+h*n,t[4]=l*i-o*n,t[5]=u*i-s*n,t[6]=f*i-a*n,t[7]=h*i-c*n,t}function dd(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function pd(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function md(t,e,r){let n=r[0],i=r[1],o=r[2],s=Math.sqrt(n*n+i*i+o*o),a,c,l;return s<1e-6?null:(s=1/s,n*=s,i*=s,o*=s,c=Math.sin(e),a=Math.cos(e),l=1-a,t[0]=n*n*l+a,t[1]=i*n*l+o*c,t[2]=o*n*l-i*c,t[3]=0,t[4]=n*i*l-o*c,t[5]=i*i*l+a,t[6]=o*i*l+n*c,t[7]=0,t[8]=n*o*l+i*c,t[9]=i*o*l-n*c,t[10]=o*o*l+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function gd(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function yd(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function vd(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ha(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=n+n,c=i+i,l=o+o,u=n*a,f=n*c,h=n*l,d=i*c,p=i*l,g=o*l,m=s*a,v=s*c,w=s*l;return t[0]=1-(d+g),t[1]=f+w,t[2]=h-v,t[3]=0,t[4]=f-w,t[5]=1-(u+g),t[6]=p+m,t[7]=0,t[8]=h+v,t[9]=p-m,t[10]=1-(u+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function xd(t,e){let r=new j(3),n=-e[0],i=-e[1],o=-e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],f=n*n+i*i+o*o+s*s;return f>0?(r[0]=(a*s+u*n+c*o-l*i)*2/f,r[1]=(c*s+u*i+l*n-a*o)*2/f,r[2]=(l*s+u*o+a*i-c*n)*2/f):(r[0]=(a*s+u*n+c*o-l*i)*2,r[1]=(c*s+u*i+l*n-a*o)*2,r[2]=(l*s+u*o+a*i-c*n)*2),ha(t,e,r),t}function _d(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function da(t,e){let r=e[0],n=e[1],i=e[2],o=e[4],s=e[5],a=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.sqrt(r*r+n*n+i*i),t[1]=Math.sqrt(o*o+s*s+a*a),t[2]=Math.sqrt(c*c+l*l+u*u),t}function bd(t,e){let r=new j(3);da(r,e);let n=1/r[0],i=1/r[1],o=1/r[2],s=e[0]*n,a=e[1]*i,c=e[2]*o,l=e[4]*n,u=e[5]*i,f=e[6]*o,h=e[8]*n,d=e[9]*i,p=e[10]*o,g=s+u+p,m=0;return g>0?(m=Math.sqrt(g+1)*2,t[3]=.25*m,t[0]=(f-d)/m,t[1]=(h-c)/m,t[2]=(a-l)/m):s>u&&s>p?(m=Math.sqrt(1+s-u-p)*2,t[3]=(f-d)/m,t[0]=.25*m,t[1]=(a+l)/m,t[2]=(h+c)/m):u>p?(m=Math.sqrt(1+u-s-p)*2,t[3]=(h-c)/m,t[0]=(a+l)/m,t[1]=.25*m,t[2]=(f+d)/m):(m=Math.sqrt(1+p-s-u)*2,t[3]=(a-l)/m,t[0]=(h+c)/m,t[1]=(f+d)/m,t[2]=.25*m),t}function wd(t,e,r,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];let i=n[0],o=n[1],s=n[2],a=n[4],c=n[5],l=n[6],u=n[8],f=n[9],h=n[10];r[0]=Math.sqrt(i*i+o*o+s*s),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],g=1/r[2],m=i*d,v=o*p,w=s*g,x=a*d,b=c*p,T=l*g,S=u*d,P=f*p,M=h*g,_=m+b+M,y=0;return _>0?(y=Math.sqrt(_+1)*2,t[3]=.25*y,t[0]=(T-P)/y,t[1]=(S-w)/y,t[2]=(v-x)/y):m>b&&m>M?(y=Math.sqrt(1+m-b-M)*2,t[3]=(T-P)/y,t[0]=.25*y,t[1]=(v+x)/y,t[2]=(S+w)/y):b>M?(y=Math.sqrt(1+b-m-M)*2,t[3]=(S-w)/y,t[0]=(v+x)/y,t[1]=.25*y,t[2]=(T+P)/y):(y=Math.sqrt(1+M-m-b)*2,t[3]=(v-x)/y,t[0]=(S+w)/y,t[1]=(T+P)/y,t[2]=.25*y),t}function Md(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3],c=i+i,l=o+o,u=s+s,f=i*c,h=i*l,d=i*u,p=o*l,g=o*u,m=s*u,v=a*c,w=a*l,x=a*u,b=n[0],T=n[1],S=n[2];return t[0]=(1-(p+m))*b,t[1]=(h+x)*b,t[2]=(d-w)*b,t[3]=0,t[4]=(h-x)*T,t[5]=(1-(f+m))*T,t[6]=(g+v)*T,t[7]=0,t[8]=(d+w)*S,t[9]=(g-v)*S,t[10]=(1-(f+p))*S,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Sd(t,e,r,n,i){let o=e[0],s=e[1],a=e[2],c=e[3],l=o+o,u=s+s,f=a+a,h=o*l,d=o*u,p=o*f,g=s*u,m=s*f,v=a*f,w=c*l,x=c*u,b=c*f,T=n[0],S=n[1],P=n[2],M=i[0],_=i[1],y=i[2],E=(1-(g+v))*T,A=(d+b)*T,L=(p-x)*T,I=(d-b)*S,R=(1-(h+v))*S,U=(m+w)*S,z=(p+x)*P,D=(m-w)*P,q=(1-(h+g))*P;return t[0]=E,t[1]=A,t[2]=L,t[3]=0,t[4]=I,t[5]=R,t[6]=U,t[7]=0,t[8]=z,t[9]=D,t[10]=q,t[11]=0,t[12]=r[0]+M-(E*M+I*_+z*y),t[13]=r[1]+_-(A*M+R*_+D*y),t[14]=r[2]+y-(L*M+U*_+q*y),t[15]=1,t}function Si(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r+r,a=n+n,c=i+i,l=r*s,u=n*s,f=n*a,h=i*s,d=i*a,p=i*c,g=o*s,m=o*a,v=o*c;return t[0]=1-f-p,t[1]=u+v,t[2]=h-m,t[3]=0,t[4]=u-v,t[5]=1-l-p,t[6]=d+g,t[7]=0,t[8]=h+m,t[9]=d-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ti(t,e,r,n,i,o,s){let a=1/(r-e),c=1/(i-n),l=1/(o-s);return t[0]=o*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*c,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*c,t[10]=(s+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*l,t[15]=0,t}function pa(t,e,r,n,i){let o=1/Math.tan(e/2);if(t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){let s=1/(n-i);t[10]=(i+n)*s,t[14]=2*i*n*s}else t[10]=-1,t[14]=-2*n;return t}var Pi=pa;function Td(t,e,r,n,i){let o=1/Math.tan(e/2);if(t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){let s=1/(n-i);t[10]=i*s,t[14]=i*n*s}else t[10]=-1,t[14]=-n;return t}function Pd(t,e,r,n){let i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),c=2/(s+a),l=2/(i+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-((s-a)*c*.5),t[9]=(i-o)*l*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function ma(t,e,r,n,i,o,s){let a=1/(e-r),c=1/(n-i),l=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*c,t[14]=(s+o)*l,t[15]=1,t}var Ei=ma;function Ed(t,e,r,n,i,o,s){let a=1/(e-r),c=1/(n-i),l=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*c,t[14]=o*l,t[15]=1,t}function Oi(t,e,r,n){let i,o,s,a,c,l,u,f,h,d,p=e[0],g=e[1],m=e[2],v=n[0],w=n[1],x=n[2],b=r[0],T=r[1],S=r[2];return Math.abs(p-b)<1e-6&&Math.abs(g-T)<1e-6&&Math.abs(m-S)<1e-6?fa(t):(f=p-b,h=g-T,d=m-S,i=1/Math.sqrt(f*f+h*h+d*d),f*=i,h*=i,d*=i,o=w*d-x*h,s=x*f-v*d,a=v*h-w*f,i=Math.sqrt(o*o+s*s+a*a),i?(i=1/i,o*=i,s*=i,a*=i):(o=0,s=0,a=0),c=h*a-d*s,l=d*o-f*a,u=f*s-h*o,i=Math.sqrt(c*c+l*l+u*u),i?(i=1/i,c*=i,l*=i,u*=i):(c=0,l=0,u=0),t[0]=o,t[1]=c,t[2]=f,t[3]=0,t[4]=s,t[5]=l,t[6]=h,t[7]=0,t[8]=a,t[9]=u,t[10]=d,t[11]=0,t[12]=-(o*p+s*g+a*m),t[13]=-(c*p+l*g+u*m),t[14]=-(f*p+h*g+d*m),t[15]=1,t)}function Od(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=n[0],c=n[1],l=n[2],u=i-r[0],f=o-r[1],h=s-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,g=l*u-a*h,m=a*f-c*u;return d=p*p+g*g+m*m,d>0&&(d=1/Math.sqrt(d),p*=d,g*=d,m*=d),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=f*m-h*g,t[5]=h*p-u*m,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=s,t[15]=1,t}function Id(t){return"mat4(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(t[3],", ").concat(t[4],", ").concat(t[5],", ").concat(t[6],", ").concat(t[7],", ").concat(t[8],", ").concat(t[9],", ").concat(t[10],", ").concat(t[11],", ").concat(t[12],", ").concat(t[13],", ").concat(t[14],", ").concat(t[15],")")}function Ad(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])}function Ld(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function ga(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Rd(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Fd(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function Nd(t,e){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]}function Cd(t,e){let r=t[0],n=t[1],i=t[2],o=t[3],s=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],g=t[13],m=t[14],v=t[15],w=e[0],x=e[1],b=e[2],T=e[3],S=e[4],P=e[5],M=e[6],_=e[7],y=e[8],E=e[9],A=e[10],L=e[11],I=e[12],R=e[13],U=e[14],z=e[15];return Math.abs(r-w)<=1e-6*Math.max(1,Math.abs(r),Math.abs(w))&&Math.abs(n-x)<=1e-6*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(o-T)<=1e-6*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(s-S)<=1e-6*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(a-P)<=1e-6*Math.max(1,Math.abs(a),Math.abs(P))&&Math.abs(c-M)<=1e-6*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(l-_)<=1e-6*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(u-y)<=1e-6*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(f-E)<=1e-6*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(h-A)<=1e-6*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(d-L)<=1e-6*Math.max(1,Math.abs(d),Math.abs(L))&&Math.abs(p-I)<=1e-6*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(g-R)<=1e-6*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(m-U)<=1e-6*Math.max(1,Math.abs(m),Math.abs(U))&&Math.abs(v-z)<=1e-6*Math.max(1,Math.abs(v),Math.abs(z))}var zd=Ie,Bd=ga;function kd(){let t=new j(4);return j!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function ya(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function va(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function xa(t){let e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}function _a(t){let e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function ba(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=o*s,t}function wa(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Ma(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=s+n*(r[2]-s),t[3]=a+n*(r[3]-a),t}function Sa(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,t}function Ta(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[0],a=r[1],c=r[2],l=r[3],u=l*n+a*o-c*i,f=l*i+c*n-s*o,h=l*o+s*i-a*n,d=-s*n-a*i-c*o;return t[0]=u*l+d*-s+f*-c-h*-a,t[1]=f*l+d*-a+h*-s-u*-c,t[2]=h*l+d*-c+u*-a-f*-s,t[3]=e[3],t}var b_=function(){let t=kd();return function(e,r,n,i,o,s){let a,c;for(r||(r=4),n||(n=0),i?c=Math.min(i*r+n,e.length):c=e.length,a=n;a<c;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],t[3]=e[a+3],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();var Li;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})(Li||(Li={}));var Ud=45*Math.PI/180,jd=1,Ii=.1,Ai=500,Vd=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),et=class extends ue{static get IDENTITY(){return Dd()}static get ZERO(){return Wd()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Li}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,r,n,i,o,s,a,c,l,u,f,h,d,p,g,m){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,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]=g,this[15]=m,this.check()}setRowMajor(e,r,n,i,o,s,a,c,l,u,f,h,d,p,g,m){return this[0]=e,this[1]=o,this[2]=l,this[3]=d,this[4]=r,this[5]=s,this[6]=u,this[7]=p,this[8]=n,this[9]=a,this[10]=f,this[11]=g,this[12]=i,this[13]=c,this[14]=h,this[15]=m,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(Vd)}fromObject(e){return this.check()}fromQuaternion(e){return Si(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:i,top:o,near:s=Ii,far:a=Ai}=e;return a===1/0?Gd(this,r,n,i,o,s):Ti(this,r,n,i,o,s,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=e;return Oi(this,r,n,i),this.check()}ortho(e){let{left:r,right:n,bottom:i,top:o,near:s=Ii,far:a=Ai}=e;return Ei(this,r,n,i,o,s,a),this.check()}orthographic(e){let{fovy:r=Ud,aspect:n=jd,focalDistance:i=1,near:o=Ii,far:s=Ai}=e;Pa(r);let a=r/2,c=i*Math.tan(a),l=c*n;return this.ortho({left:-l,right:l,bottom:-c,top:c,near:o,far:s})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=e;return Pa(r),Pi(this,r,n,i,o),this.check()}determinant(){return yi(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,r){e=e||[-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),i=1/n[0],o=1/n[1],s=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*o,e[2]=this[2]*s,e[3]=0,e[4]=this[4]*i,e[5]=this[5]*o,e[6]=this[6]*s,e[7]=0,e[8]=this[8]*i,e[9]=this[9]*o,e[10]=this[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],s=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*o,e[2]=this[2]*s,e[3]=this[4]*i,e[4]=this[5]*o,e[5]=this[6]*s,e[6]=this[8]*i,e[7]=this[9]*o,e[8]=this[10]*s,e}transpose(){return mi(this,this),this.check()}invert(){return gi(this,this),this.check()}multiplyLeft(e){return Ie(this,e,this),this.check()}multiplyRight(e){return Ie(this,this,e),this.check()}rotateX(e){return bi(this,this,e),this.check()}rotateY(e){return wi(this,this,e),this.check()}rotateZ(e){return Mi(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return _i(this,this,e,r),this.check()}scale(e){return xi(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return vi(this,this,e),this.check()}transform(e,r){return e.length===4?(r=Sa(r||[-0,-0,-0,-0],e,this),Lt(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,i;switch(n){case 2:i=Ys(r||[-0,-0],e,this);break;case 3:i=ce(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Lt(i,e.length),i}transformAsVector(e,r){let n;switch(e.length){case 2:n=Hs(r||[-0,-0],e,this);break;case 3:n=mr(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Lt(n,e.length),n}transformPoint(e,r){return this.transformAsPoint(e,r)}transformVector(e,r){return this.transformAsPoint(e,r)}transformDirection(e,r){return this.transformAsVector(e,r)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}},Sr,Tr;function Wd(){return Sr||(Sr=new et([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Sr)),Sr}function Dd(){return Tr||(Tr=new et,Object.freeze(Tr)),Tr}function Pa(t){if(t>Math.PI*2)throw Error("expected radians")}function Gd(t,e,r,n,i,o){let s=2*o/(r-e),a=2*o/(i-n),c=(r+e)/(r-e),l=(i+n)/(i-n),u=-1,f=-1,h=-2*o;return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=c,t[9]=l,t[10]=u,t[11]=f,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}function Ea(){let t=new j(4);return j!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Oa(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ri(t,e,r){r=r*.5;let n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function Fi(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=r[0],c=r[1],l=r[2],u=r[3];return t[0]=n*u+s*a+i*l-o*c,t[1]=i*u+s*c+o*a-n*l,t[2]=o*u+s*l+n*c-i*a,t[3]=s*u-n*a-i*c-o*l,t}function Ia(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*a,t[1]=i*c+o*a,t[2]=o*c-i*a,t[3]=s*c-n*a,t}function Aa(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c-o*a,t[1]=i*c+s*a,t[2]=o*c+n*a,t[3]=s*c-i*a,t}function La(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c+i*a,t[1]=i*c-n*a,t[2]=o*c+s*a,t[3]=s*c-o*a,t}function Ra(t,e){let r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function Ae(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3],c=r[0],l=r[1],u=r[2],f=r[3],h,d,p,g,m;return h=i*c+o*l+s*u+a*f,h<0&&(h=-h,c=-c,l=-l,u=-u,f=-f),1-h>1e-6?(d=Math.acos(h),m=Math.sin(d),p=Math.sin((1-n)*d)/m,g=Math.sin(n*d)/m):(p=1-n,g=n),t[0]=p*i+g*c,t[1]=p*o+g*l,t[2]=p*s+g*u,t[3]=p*a+g*f,t}function Fa(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o,a=s?1/s:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=o*a,t}function Na(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Ni(t,e){let r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);let o=(i+1)%3,s=(i+2)%3;n=Math.sqrt(e[i*3+i]-e[o*3+o]-e[s*3+s]+1),t[i]=.5*n,n=.5/n,t[3]=(e[o*3+s]-e[s*3+o])*n,t[o]=(e[o*3+i]+e[i*3+o])*n,t[s]=(e[s*3+i]+e[i*3+s])*n}return t}var Ca=ya;var za=va,Ba=wa,ka=Ma,qa=xa;var Ua=_a;var ja=ba;var Va=function(){let t=ci(),e=li(1,0,0),r=li(0,1,0);return function(n,i,o){let s=ui(i,o);return s<-.999999?(ae(t,e,i),na(t)<1e-6&&ae(t,r,i),Ks(t,t),Ri(n,t,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(ae(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+s,ja(n,n))}}(),C_=function(){let t=Ea(),e=Ea();return function(r,n,i,o,s,a){return Ae(t,n,s,a),Ae(e,i,o,a),Ae(r,t,e,2*a*(1-a)),r}}(),z_=function(){let t=ia();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],ja(e,Ni(e,t))}}();var Zd=[0,0,0,1],fe=class extends At{constructor(e=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,i)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,r,n,i){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return Ni(this,e),this.check()}fromAxisRotation(e,r){return Ri(this,e,r),this.check()}identity(){return Oa(this),this.check()}setAxisAngle(e,r){return this.fromAxisRotation(e,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=N(e)}get y(){return this[1]}set y(e){this[1]=N(e)}get z(){return this[2]}set z(e){this[2]=N(e)}get w(){return this[3]}set w(e){this[3]=N(e)}len(){return qa(this)}lengthSquared(){return Ua(this)}dot(e){return Ba(this,e)}rotationTo(e,r){return Va(this,e,r),this.check()}add(e){return Ca(this,this,e),this.check()}calculateW(){return Ra(this,this),this.check()}conjugate(){return Na(this,this),this.check()}invert(){return Fa(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(ka(this,e,r,n),this.check())}multiplyRight(e){return Fi(this,this,e),this.check()}multiplyLeft(e){return Fi(this,e,this),this.check()}normalize(){let e=this.len(),r=e>0?1/e:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,e===0&&(this[3]=1),this.check()}rotateX(e){return Ia(this,this,e),this.check()}rotateY(e){return Aa(this,this,e),this.check()}rotateZ(e){return La(this,this,e),this.check()}scale(e){return za(this,this,e),this.check()}slerp(e,r,n){let i,o,s;switch(arguments.length){case 1:({start:i=Zd,target:o,ratio:s}=e);break;case 2:i=this,o=e,s=r;break;default:i=e,o=r,s=n}return Ae(this,i,o,s),this.check()}transformVector4(e,r=new le){return Ta(r,e,this),Lt(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,r){return this.setAxisAngle(e,r)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}};var Le={};kn(Le,{EPSILON1:()=>Xd,EPSILON10:()=>rp,EPSILON11:()=>np,EPSILON12:()=>ip,EPSILON13:()=>op,EPSILON14:()=>sp,EPSILON15:()=>ap,EPSILON16:()=>cp,EPSILON17:()=>lp,EPSILON18:()=>up,EPSILON19:()=>fp,EPSILON2:()=>Yd,EPSILON20:()=>hp,EPSILON3:()=>Hd,EPSILON4:()=>$d,EPSILON5:()=>Qd,EPSILON6:()=>Kd,EPSILON7:()=>Jd,EPSILON8:()=>tp,EPSILON9:()=>ep,PI_OVER_FOUR:()=>pp,PI_OVER_SIX:()=>mp,PI_OVER_TWO:()=>dp,TWO_PI:()=>gp});var Xd=.1,Yd=.01,Hd=.001,$d=1e-4,Qd=1e-5,Kd=1e-6,Jd=1e-7,tp=1e-8,ep=1e-9,rp=1e-10,np=1e-11,ip=1e-12,op=1e-13,sp=1e-14,ap=1e-15,cp=1e-16,lp=1e-17,up=1e-18,fp=1e-19,hp=1e-20,dp=Math.PI/2,pp=Math.PI/4,mp=Math.PI/6,gp=Math.PI*2;function Pr(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}var st=Math.PI,Za=st/4,Wa=st/180,Da=180/st,Er=512;function bt(t){let[e,r]=t;Pr(Number.isFinite(e)),Pr(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");let n=e*Wa,i=r*Wa,o=Er*(n+st)/(2*st),s=Er*(st+Math.log(Math.tan(Za+i*.5)))/(2*st);return[o,s]}function wt(t){let[e,r]=t,n=e/Er*(2*st)-st,i=2*(Math.atan(Math.exp(r/Er*(2*st)-st))-Za);return[n*Da,i*Da]}var Mb=Math.PI/180;var Ya=6378137*Math.PI;function Ci(t){var e=bt(t);return e[0]=(e[0]/256-1)*Ya,e[1]=(e[1]/256-1)*Ya,e}function Ir(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ir=function(r){return typeof r}:Ir=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ir(t)}function Ha(t,e,r,n,i,o,s){try{var a=t[o](s),c=a.value}catch(l){r(l);return}a.done?e(c):Promise.resolve(c).then(n,i)}function zi(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(c){Ha(o,n,i,s,a,"next",c)}function a(c){Ha(o,n,i,s,a,"throw",c)}s(void 0)})}}function $a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Or(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$a(Object(r),!0).forEach(function(n){Rp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$a(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Rp(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Np(t,e,r){return e&&Qa(t.prototype,e),r&&Qa(t,r),t}function Ar(t,e,r){return typeof Reflect<"u"&&Reflect.get?Ar=Reflect.get:Ar=function(i,o,s){var a=Cp(i,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(s):c.value}},Ar(t,e,r||t)}function Cp(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=he(t),t!==null););return t}function zp(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Bi(t,e)}function Bi(t,e){return Bi=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Bi(t,e)}function Bp(t){var e=Up();return function(){var n=he(t),i;if(e){var o=he(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return kp(this,i)}}function kp(t,e){if(e&&(Ir(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qp(t)}function qp(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Up(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function he(t){return he=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},he(t)}var jp={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:function(){}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:function(){}},onImageLoad:{type:"function",value:function(){}},onImageLoadError:{type:"function",compare:!1,value:function(e,r){return console.error(r,e)}}},Lr=function(t){zp(r,t);var e=Bp(r);function r(){var i;Fp(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.shouldUpdateState=function(){return!0},n.initializeState=function(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0},n.updateState=function(o){var s=this,a=o.changeFlags,c=o.props,l=o.oldProps,u=this.context.viewport;a.dataChanged||c.serviceType!==l.serviceType?(this.state.imageSource=this._createImageSource(c),this._loadMetadata(),this.debounce(function(){return s.loadImage(u,"image source changed")},0)):(0,Gt._deepEqual)(c.layers,l.layers,1)?a.viewportChanged&&this.debounce(function(){return s.loadImage(u,"viewport changed")}):this.debounce(function(){return s.loadImage(u,"layers changed")},0)},n.finalizeState=function(){},n.renderLayers=function(){var o=this.state,s=o.bounds,a=o.image,c=o.lastRequestParameters;return a&&new Ka.BitmapLayer(Or(Or({},this.getSubLayerProps({id:"bitmap"})),{},{_imageCoordinateSystem:c.srs==="EPSG:4326"?Gt.COORDINATE_SYSTEM.LNGLAT:Gt.COORDINATE_SYSTEM.CARTESIAN,bounds:s,image:a}))},n.getFeatureInfoText=function(){var i=zi(regeneratorRuntime.mark(function s(a,c){var l,u,f,h;return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(l=this.state.lastRequestParameters,!l){p.next=6;break}return p.next=4,(u=(f=this.state.imageSource).getFeatureInfoText)===null||u===void 0?void 0:u.call(f,Or(Or({},l),{},{query_layers:l.layers,x:a,y:c,info_format:"application/vnd.ogc.gml"}));case 4:return h=p.sent,p.abrupt("return",h);case 6:return p.abrupt("return","");case 7:case"end":return p.stop()}},s,this)}));function o(s,a){return i.apply(this,arguments)}return o}(),n._createImageSource=function(o){if(o.data instanceof rt)return o.data;if(typeof o.data=="string")return si({url:o.data,loadOptions:o.loadOptions,type:o.serviceType});throw new Error("invalid image source in props.data")},n._loadMetadata=function(){var i=zi(regeneratorRuntime.mark(function s(){var a,c,l,u;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return a=this.state.imageSource,h.prev=1,this.state.loadCounter++,h.next=5,a.getMetadata();case 5:c=h.sent,this.state.imageSource===a&&((l=this.getCurrentLayer())===null||l===void 0||l.props.onMetadataLoad(c)),h.next=12;break;case 9:h.prev=9,h.t0=h.catch(1),(u=this.getCurrentLayer())===null||u===void 0||u.props.onMetadataLoadError(h.t0);case 12:return h.prev=12,this.state.loadCounter--,h.finish(12);case 15:case"end":return h.stop()}},s,this,[[1,9,12,15]])}));function o(){return i.apply(this,arguments)}return o}(),n.loadImage=function(){var i=zi(regeneratorRuntime.mark(function s(a,c){var l,u,f,h,d,p,g,m,v,w,x,b,T,S;return regeneratorRuntime.wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(l=this.props,u=l.layers,f=l.serviceType,!(f==="wms"&&u.length===0)){M.next=3;break}return M.abrupt("return");case 3:return h=a.getBounds(),d=a.width,p=a.height,g=this.getRequestId(),m=this.props.srs,m==="auto"&&(m=a.resolution?"EPSG:4326":"EPSG:3857"),v={width:d,height:p,boundingBox:[[h[0],h[1]],[h[2],h[3]]],layers:u,crs:m},m==="EPSG:3857"&&(w=Ci([h[0],h[1]]),x=Ci([h[2],h[3]]),v.boundingBox=[w,x]),M.prev=10,this.state.loadCounter++,this.props.onImageLoadStart(g),M.next=15,this.state.imageSource.getImage(v);case 15:b=M.sent,this.state.lastRequestId<g&&((T=this.getCurrentLayer())===null||T===void 0||T.props.onImageLoad(g),this.setState({image:b,bounds:h,lastRequestParameters:v,lastRequestId:g})),M.next=23;break;case 19:M.prev=19,M.t0=M.catch(10),this.raiseError(M.t0,"Load image"),(S=this.getCurrentLayer())===null||S===void 0||S.props.onImageLoadError(g,M.t0);case 23:return M.prev=23,this.state.loadCounter--,M.finish(23);case 26:case"end":return M.stop()}},s,this,[[10,19,23,26]])}));function o(s,a){return i.apply(this,arguments)}return o}(),n.getRequestId=function(){return this.state._nextRequestId++},n.debounce=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:500;clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(function(){return o()},s)},Np(r,[{key:"isLoaded",get:function(){return Boolean(this.state)&&this.state.loadCounter===0&&Ar(he(r.prototype),"isLoaded",this)}}]),r}(Gt.CompositeLayer);Lr.layerName="WMSLayer";Lr.defaultProps=jp;var Ja=B(ct());function Rr(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rr=function(r){return typeof r}:Rr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Rr(t)}function Vp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wp(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ki(t,e)}function ki(t,e){return ki=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ki(t,e)}function Dp(t){var e=Xp();return function(){var n=Fr(t),i;if(e){var o=Fr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Gp(this,i)}}function Gp(t,e){if(e&&(Rr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zp(t)}function Zp(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Fr(t){return Fr=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Fr(t)}var Yp={getHeight:{type:"accessor",value:0},greatCircle:!0},Nr=function(t){Wp(r,t);var e=Dp(r);function r(){return Vp(this,r),e.apply(this,arguments)}return r}(Ja.ArcLayer);Nr.layerName="GreatCircleLayer";Nr.defaultProps=Yp;var ec=B(ut()),ji=B(ct());function Cr(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Cr=function(r){return typeof r}:Cr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Cr(t)}var Hp=["updateTriggers"];function $p(t,e){if(t==null)return{};var r=Qp(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Qp(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function Kp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jp(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&qi(t,e)}function qi(t,e){return qi=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},qi(t,e)}function t0(t){var e=n0();return function(){var n=zr(t),i;if(e){var o=zr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return e0(this,i)}}function e0(t,e){if(e&&(Cr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return r0(t)}function r0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n0(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zr(t){return zr=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},zr(t)}function tc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ui(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tc(Object(r),!0).forEach(function(n){i0(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tc(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function i0(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o0=Ui({},ji.PolygonLayer.defaultProps),nt=function(t){Jp(r,t);var e=t0(r);function r(){return Kp(this,r),e.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){return null},n.renderLayers=function(){var o=this.props,s=o.elevationScale,a=o.extruded,c=o.wireframe,l=o.filled,u=o.stroked,f=o.lineWidthUnits,h=o.lineWidthScale,d=o.lineWidthMinPixels,p=o.lineWidthMaxPixels,g=o.lineJointRounded,m=o.lineMiterLimit,v=o.lineDashJustified,w=o.getElevation,x=o.getFillColor,b=o.getLineColor,T=o.getLineWidth,S=this.props,P=S.updateTriggers,M=S.material,_=S.transitions,y=this.getSubLayerClass("cell",ji.PolygonLayer),E=this.indexToBounds()||{},A=E.updateTriggers,L=$p(E,Hp);return new y({filled:l,wireframe:c,extruded:a,elevationScale:s,stroked:u,lineWidthUnits:f,lineWidthScale:h,lineWidthMinPixels:d,lineWidthMaxPixels:p,lineJointRounded:g,lineMiterLimit:m,lineDashJustified:v,material:M,transitions:_,getElevation:w,getFillColor:x,getLineColor:b,getLineWidth:T},this.getSubLayerProps({id:"cell",updateTriggers:P&&Ui(Ui({},A),{},{getElevation:P.getElevation,getFillColor:P.getFillColor,getLineColor:P.getLineColor,getLineWidth:P.getLineWidth})}),L)},r}(ec.CompositeLayer);nt.layerName="GeoCellLayer";nt.defaultProps=o0;var Br=B(Vi());function sc(t,e){return l0(t)||c0(t,e)||a0(t,e)||s0()}function s0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
15
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a0(t,e){if(t){if(typeof t=="string")return nc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nc(t,e)}}function nc(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function c0(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function l0(t){if(Array.isArray(t))return t}var u0=3,f0=30,h0=2*f0+1,ic=180/Math.PI;function ac(t,e,r){var n=1<<e;return[(t[0]+r[0])/n,(t[1]+r[1])/n]}function oc(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function cc(t){return[oc(t[0]),oc(t[1])]}function lc(t,e){var r=sc(e,2),n=r[0],i=r[1];switch(t){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function uc(t){var e=sc(t,3),r=e[0],n=e[1],i=e[2],o=Math.atan2(i,Math.sqrt(r*r+n*n)),s=Math.atan2(n,r);return[s*ic,o*ic]}function fc(t){for(var e=Br.default.fromString(t,!0,10).toString(2);e.length<u0+h0;)e="0"+e;for(var r=e.lastIndexOf("1"),n=e.substring(0,3),i=e.substring(3,r),o=i.length/2,s=Br.default.fromString(n,!0,2).toString(10),a=Br.default.fromString(i,!0,2).toString(4);a.length<o;)a="0"+a;return"".concat(s,"/").concat(a)}function d0(t,e,r,n){if(n===0){r===1&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);var i=e[0];e[0]=e[1],e[1]=i}}function hc(t){for(var e=t.split("/"),r=parseInt(e[0],10),n=e[1],i=n.length,o=[0,0],s,a=i-1;a>=0;a--){s=i-a;var c=n[a],l=0,u=0;c==="1"?u=1:c==="2"?(l=1,u=1):c==="3"&&(l=1);var f=Math.pow(2,s-1);d0(f,o,l,u),o[0]+=f*l,o[1]+=f*u}if(r%2===1){var h=o[0];o[0]=o[1],o[1]=h}return{face:r,ij:o,level:s}}var dc=B(Vi());function p0(t){var e=t.padEnd(16,"0");return dc.default.fromString(e,16)}var m0=100;function g0(t){for(var e=t.face,r=t.ij,n=t.level,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(m0*Math.pow(2,-n))),s=new Float64Array(4*o*2+2),a=0,c=0,l=0;l<4;l++)for(var u=i[l].slice(0),f=i[l+1],h=(f[0]-u[0])/o,d=(f[1]-u[1])/o,p=0;p<o;p++){u[0]+=h,u[1]+=d;var g=ac(r,n,u),m=cc(g),v=lc(e,m),w=uc(v);Math.abs(w[1])>89.999&&(w[0]=c);var x=w[0]-c;w[0]+=x>180?-360:x<-180?360:0,s[a++]=w[0],s[a++]=w[1],c=w[0]}return s[a++]=s[0],s[a++]=s[1],s}function y0(t){if(typeof t=="string"){if(t.indexOf("/")>0)return t;t=p0(t)}return fc(t.toString())}function pc(t){var e=y0(t),r=hc(e);return g0(r)}function kr(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?kr=function(r){return typeof r}:kr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},kr(t)}function v0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x0(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Wi(t,e)}function Wi(t,e){return Wi=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Wi(t,e)}function _0(t){var e=M0();return function(){var n=qr(t),i;if(e){var o=qr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return b0(this,i)}}function b0(t,e){if(e&&(kr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return w0(t)}function w0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function M0(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qr(t){return qr=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},qr(t)}var S0={getS2Token:{type:"accessor",value:function(e){return e.token}}},Ur=function(t){x0(r,t);var e=_0(r);function r(){return v0(this,r),e.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){var o=this.props,s=o.data,a=o.getS2Token;return{data:s,_normalize:!1,positionFormat:"XY",getPolygon:function(l,u){return pc(a(l,u))}}},r}(nt);Ur.layerName="S2Layer";Ur.defaultProps=S0;function Di(t,e){return O0(t)||E0(t,e)||P0(t,e)||T0()}function T0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P0(t,e){if(t){if(typeof t=="string")return mc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mc(t,e)}}function mc(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function E0(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function O0(t){if(Array.isArray(t))return t}var Gi=512;function I0(t,e){for(var r=0,n=0,i=1<<t.length,o=i/Gi,s=0;s<t.length;s++){i>>=1;var a=parseInt(t[s]);a%2&&(r|=i),a>1&&(n|=i)}return[[r/o,Gi-n/o],[(r+e)/o,Gi-(n+e)/o]]}function gc(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=I0(t,e),n=Di(r,2),i=n[0],o=n[1],s=wt(i),a=Di(s,2),c=a[0],l=a[1],u=wt(o),f=Di(u,2),h=f[0],d=f[1];return[h,l,h,d,c,d,c,l,h,l]}function jr(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?jr=function(r){return typeof r}:jr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},jr(t)}function A0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L0(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Zi(t,e)}function Zi(t,e){return Zi=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Zi(t,e)}function R0(t){var e=C0();return function(){var n=Vr(t),i;if(e){var o=Vr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return F0(this,i)}}function F0(t,e){if(e&&(jr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N0(t)}function N0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function C0(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vr(t){return Vr=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Vr(t)}var z0={getQuadkey:{type:"accessor",value:function(e){return e.quadkey}}},Wr=function(t){L0(r,t);var e=R0(r);function r(){return A0(this,r),e.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){var o=this.props,s=o.data,a=o.extruded,c=o.getQuadkey,l=a?.99:1;return{data:s,_normalize:!1,positionFormat:"XY",getPolygon:function(f,h){return gc(c(f,h),l)},updateTriggers:{getPolygon:l}}},r}(nt);Wr.layerName="QuadkeyLayer";Wr.defaultProps=z0;var en=B(ut()),$c=B(ct());function yc(t,e,r,n,i,o,s){try{var a=t[o](s),c=a.value}catch(l){r(l);return}a.done?e(c):Promise.resolve(c).then(n,i)}function B0(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(c){yc(o,n,i,s,a,"next",c)}function a(c){yc(o,n,i,s,a,"throw",c)}s(void 0)})}}function k0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function q0(t,e,r){return e&&vc(t.prototype,e),r&&vc(t,r),t}var Fe=function(){function t(r){k0(this,t),this.index=void 0,this.isVisible=void 0,this.isSelected=void 0,this.parent=void 0,this.children=void 0,this.content=void 0,this.state=void 0,this.layers=void 0,this.id=void 0,this.zoom=void 0,this.userData=void 0,this.boundingBox=void 0,this._abortController=void 0,this._loader=void 0,this._loaderId=void 0,this._isLoaded=void 0,this._isCancelled=void 0,this._needsReload=void 0,this._bbox=void 0,this.index=r,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}var e=t.prototype;return e._loadData=function(){var r=B0(regeneratorRuntime.mark(function i(o){var s,a,c,l,u,f,h,d,p,g,m,v,w,x;return regeneratorRuntime.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return s=o.getData,a=o.requestScheduler,c=o.onLoad,l=o.onError,u=this.index,f=this.id,h=this.bbox,d=this.userData,p=this.zoom,g=this._loaderId,this._abortController=new AbortController,m=this._abortController.signal,T.next=7,a.scheduleRequest(this,function(S){return S.isSelected?1:-1});case 7:if(v=T.sent,v){T.next=11;break}return this._isCancelled=!0,T.abrupt("return");case 11:if(!this._isCancelled){T.next=14;break}return v.done(),T.abrupt("return");case 14:return w=null,T.prev=15,T.next=18,s({index:u,id:f,bbox:h,userData:d,zoom:p,signal:m});case 18:w=T.sent,T.next=24;break;case 21:T.prev=21,T.t0=T.catch(15),x=T.t0||!0;case 24:return T.prev=24,v.done(),T.finish(24);case 27:if(g===this._loaderId){T.next=29;break}return T.abrupt("return");case 29:if(this._loader=void 0,this.content=w,!(this._isCancelled&&!w)){T.next=34;break}return this._isLoaded=!1,T.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,x?l(x,this):c(this);case 37:case"end":return T.stop()}},i,this,[[15,21,24,27]])}));function n(i){return r.apply(this,arguments)}return n}(),e.loadData=function(n){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(n),this._loader},e.setNeedsReload=function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0},e.abort=function(){var n;this.isLoaded||(this._isCancelled=!0,(n=this._abortController)===null||n===void 0||n.abort())},q0(t,[{key:"bbox",get:function(){return this._bbox},set:function(n){this._bbox||(this._bbox=n,"west"in n?this.boundingBox=[[n.west,n.south],[n.east,n.north]]:this.boundingBox=[[n.left,n.top],[n.right,n.bottom]])}},{key:"data",get:function(){var n=this;return this.isLoading&&this._loader?this._loader.then(function(){return n.data}):this.content}},{key:"isLoaded",get:function(){return this._isLoaded&&!this._needsReload}},{key:"isLoading",get:function(){return Boolean(this._loader)&&!this._isCancelled}},{key:"needsReload",get:function(){return this._needsReload||this._isCancelled}},{key:"byteLength",get:function(){var n=this.content?this.content.byteLength:0;return Number.isFinite(n)||console.error("byteLength not defined in tile data"),n}}]),t}();var Ce=B(ut());var Z={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var xc=new O,U0=new O,Rt=class{constructor(e=[0,0,0],r=[0,0,0],n){F(this,"center",void 0),F(this,"halfDiagonal",void 0),F(this,"minimum",void 0),F(this,"maximum",void 0),n=n||xc.copy(e).add(r).scale(.5),this.center=new O(n),this.halfDiagonal=new O(r).subtract(this.center),this.minimum=new O(e),this.maximum=new O(r)}clone(){return new Rt(this.minimum,this.maximum,this.center)}equals(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}transform(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}intersectPlane(e){let{halfDiagonal:r}=this,n=U0.from(e.normal),i=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),o=this.center.dot(n)+e.distance;return o-i>0?Z.INSIDE:o+i<0?Z.OUTSIDE:Z.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=xc.from(e).subtract(this.center),{halfDiagonal:n}=this,i=0,o;return o=Math.abs(r.x)-n.x,o>0&&(i+=o*o),o=Math.abs(r.y)-n.y,o>0&&(i+=o*o),o=Math.abs(r.z)-n.z,o>0&&(i+=o*o),i}};var Ne=new O,_c=new O,Ft=class{constructor(e=[0,0,0],r=0){F(this,"center",void 0),F(this,"radius",void 0),this.radius=-0,this.center=new O,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=Ne.from(r),this.center=new O().from(e).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new Ft(this.center,this.radius)}union(e){let r=this.center,n=this.radius,i=e.center,o=e.radius,s=Ne.copy(i).subtract(r),a=s.magnitude();if(n>=a+o)return this.clone();if(o>=a+n)return e.clone();let c=(n+a+o)*.5;return _c.copy(s).scale((-n+c)/a).add(r),this.center.copy(_c),this.radius=c,this}expand(e){let n=Ne.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=Mr.getScaling(Ne,e);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(e){let r=this.distanceTo(e);return r*r}distanceTo(e){let n=Ne.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){let r=this.center,n=this.radius,o=e.normal.dot(r)+e.distance;return o<-n?Z.OUTSIDE:o<n?Z.INTERSECTING:Z.INSIDE}};var j0=new O,V0=new O,Dr=new O,Gr=new O,Zr=new O,W0=new O,D0=new O,Mt={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},Zt=class{constructor(e=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){F(this,"center",void 0),F(this,"halfAxes",void 0),this.center=new O().from(e),this.halfAxes=new V(r)}get halfSize(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new O(e).len(),new O(r).len(),new O(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new O(e).normalize(),o=new O(r).normalize(),s=new O(n).normalize();return new fe().fromMatrix3(new V([...i,...o,...s]))}fromCenterHalfSizeQuaternion(e,r,n){let i=new fe(n),o=new V().fromQuaternion(i);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 O().from(e),this.halfAxes=o,this}clone(){return new Zt(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new Ft){let r=this.halfAxes,n=r.getColumn(0,Dr),i=r.getColumn(1,Gr),o=r.getColumn(2,Zr),s=j0.copy(n).add(i).add(o);return e.center.copy(this.center),e.radius=s.magnitude(),e}intersectPlane(e){let r=this.center,n=e.normal,i=this.halfAxes,o=n.x,s=n.y,a=n.z,c=Math.abs(o*i[Mt.COLUMN0ROW0]+s*i[Mt.COLUMN0ROW1]+a*i[Mt.COLUMN0ROW2])+Math.abs(o*i[Mt.COLUMN1ROW0]+s*i[Mt.COLUMN1ROW1]+a*i[Mt.COLUMN1ROW2])+Math.abs(o*i[Mt.COLUMN2ROW0]+s*i[Mt.COLUMN2ROW1]+a*i[Mt.COLUMN2ROW2]),l=n.dot(r)+e.distance;return l<=-c?Z.OUTSIDE:l>=c?Z.INSIDE:Z.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=V0.from(e).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,Dr),o=n.getColumn(1,Gr),s=n.getColumn(2,Zr),a=i.magnitude(),c=o.magnitude(),l=s.magnitude();i.normalize(),o.normalize(),s.normalize();let u=0,f;return f=Math.abs(r.dot(i))-a,f>0&&(u+=f*f),f=Math.abs(r.dot(o))-c,f>0&&(u+=f*f),f=Math.abs(r.dot(s))-l,f>0&&(u+=f*f),u}computePlaneDistances(e,r,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=this.center,a=this.halfAxes,c=a.getColumn(0,Dr),l=a.getColumn(1,Gr),u=a.getColumn(2,Zr),f=W0.copy(c).add(l).add(u).add(s),h=D0.copy(f).subtract(e),d=r.dot(h);return i=Math.min(d,i),o=Math.max(d,o),f.copy(s).add(c).add(l).subtract(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),f.copy(s).add(c).subtract(l).add(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),f.copy(s).add(c).subtract(l).subtract(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),s.copy(f).subtract(c).add(l).add(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),s.copy(f).subtract(c).add(l).subtract(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),s.copy(f).subtract(c).subtract(l).add(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),s.copy(f).subtract(c).subtract(l).subtract(u),h.copy(f).subtract(e),d=r.dot(h),i=Math.min(d,i),o=Math.max(d,o),n[0]=i,n[1]=o,n}transform(e){this.center.transformAsPoint(e);let r=this.halfAxes.getColumn(0,Dr);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,Gr);n.transformAsPoint(e);let i=this.halfAxes.getColumn(2,Zr);return i.transformAsPoint(e),this.halfAxes=new V([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var bc=new O,wc=new O,at=class{constructor(e=[0,0,1],r=0){F(this,"normal",void 0),F(this,"distance",void 0),this.normal=new O,this.distance=-0,this.fromNormalDistance(e,r)}fromNormalDistance(e,r){return mt(Number.isFinite(r)),this.normal.from(e).normalize(),this.distance=r,this}fromPointNormal(e,r){e=bc.from(e),this.normal.from(r).normalize();let n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,r,n,i){return this.normal.set(e,r,n),mt(pt(this.normal.len(),1)),this.distance=i,this}clone(){return new at(this.normal,this.distance)}equals(e){return pt(this.distance,e.distance)&&pt(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){let r=wc.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,r)}projectPointOntoPlane(e,r=[0,0,0]){let n=bc.from(e),i=this.getPointDistance(n),o=wc.copy(this.normal).scale(i);return n.subtract(o).to(r)}};var Mc=[new O([1,0,0]),new O([0,1,0]),new O([0,0,1])],Sc=new O,G0=new O,tt=class{constructor(e=[]){F(this,"planes",void 0),this.planes=e}fromBoundingSphere(e){this.planes.length=2*Mc.length;let r=e.center,n=e.radius,i=0;for(let o of Mc){let s=this.planes[i],a=this.planes[i+1];s||(s=this.planes[i]=new at),a||(a=this.planes[i+1]=new at);let c=Sc.copy(o).scale(-n).add(r);s.fromPointNormal(c,o);let l=Sc.copy(o).scale(n).add(r),u=G0.copy(o).negate();a.fromPointNormal(l,u),i+=2}return this}computeVisibility(e){let r=Z.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case Z.OUTSIDE:return Z.OUTSIDE;case Z.INTERSECTING:r=Z.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(mt(Number.isFinite(r),"parentPlaneMask is required."),r===tt.MASK_OUTSIDE||r===tt.MASK_INSIDE)return r;let n=tt.MASK_INSIDE,i=this.planes;for(let o=0;o<this.planes.length;++o){let s=o<31?1<<o:0;if(o<31&&!(r&s))continue;let a=i[o],c=e.intersectPlane(a);if(c===Z.OUTSIDE)return tt.MASK_OUTSIDE;c===Z.INTERSECTING&&(n|=s)}return n}};F(tt,"MASK_OUTSIDE",4294967295);F(tt,"MASK_INSIDE",0);F(tt,"MASK_INDETERMINATE",2147483647);var Xw=new O,Yw=new O,Hw=new O,$w=new O,Qw=new O;var iM=new O,oM=new O,sM=new O,aM=new O,cM=new O,lM=new O,uM=new O,fM=new O,hM=new O,dM=new O,pM=new O,mM=new O;var gt=new V,X0=new V,Y0=new V,Xr=new V,Tc=new V;function Hi(t,e={}){let r=Le.EPSILON20,n=10,i=0,o=0,s=X0,a=Y0;s.identity(),a.copy(t);let c=r*H0(a);for(;o<n&&$0(a)>c;)Q0(a,Xr),Tc.copy(Xr).transpose(),a.multiplyRight(Xr),a.multiplyLeft(Tc),s.multiplyRight(Xr),++i>2&&(++o,i=0);return e.unitary=s.toTarget(e.unitary),e.diagonal=a.toTarget(e.diagonal),e}function H0(t){let e=0;for(let r=0;r<9;++r){let n=t[r];e+=n*n}return Math.sqrt(e)}var Xi=[1,0,0],Yi=[2,2,1];function $0(t){let e=0;for(let r=0;r<3;++r){let n=t[gt.getElementIndex(Yi[r],Xi[r])];e+=2*n*n}return Math.sqrt(e)}function Q0(t,e){let r=Le.EPSILON15,n=0,i=1;for(let l=0;l<3;++l){let u=Math.abs(t[gt.getElementIndex(Yi[l],Xi[l])]);u>n&&(i=l,n=u)}let o=Xi[i],s=Yi[i],a=1,c=0;if(Math.abs(t[gt.getElementIndex(s,o)])>r){let l=t[gt.getElementIndex(s,s)],u=t[gt.getElementIndex(o,o)],f=t[gt.getElementIndex(s,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 V.IDENTITY.to(e),e[gt.getElementIndex(o,o)]=e[gt.getElementIndex(s,s)]=a,e[gt.getElementIndex(s,o)]=c,e[gt.getElementIndex(o,s)]=-c,e}var Nt=new O,K0=new O,J0=new O,tm=new O,em=new O,rm=new V,nm={diagonal:new V,unitary:new V};function $i(t,e=new Zt){if(!t||t.length===0)return e.halfAxes=new V([0,0,0,0,0,0,0,0,0]),e.center=new O,e;let r=t.length,n=new O(0,0,0);for(let _ of t)n.add(_);let i=1/r;n.multiplyByScalar(i);let o=0,s=0,a=0,c=0,l=0,u=0;for(let _ of t){let y=Nt.copy(_).subtract(n);o+=y.x*y.x,s+=y.x*y.y,a+=y.x*y.z,c+=y.y*y.y,l+=y.y*y.z,u+=y.z*y.z}o*=i,s*=i,a*=i,c*=i,l*=i,u*=i;let f=rm;f[0]=o,f[1]=s,f[2]=a,f[3]=s,f[4]=c,f[5]=l,f[6]=a,f[7]=l,f[8]=u;let{unitary:h}=Hi(f,nm),d=e.halfAxes.copy(h),p=d.getColumn(0,J0),g=d.getColumn(1,tm),m=d.getColumn(2,em),v=-Number.MAX_VALUE,w=-Number.MAX_VALUE,x=-Number.MAX_VALUE,b=Number.MAX_VALUE,T=Number.MAX_VALUE,S=Number.MAX_VALUE;for(let _ of t)Nt.copy(_),v=Math.max(Nt.dot(p),v),w=Math.max(Nt.dot(g),w),x=Math.max(Nt.dot(m),x),b=Math.min(Nt.dot(p),b),T=Math.min(Nt.dot(g),T),S=Math.min(Nt.dot(m),S);p=p.multiplyByScalar(.5*(b+v)),g=g.multiplyByScalar(.5*(T+w)),m=m.multiplyByScalar(.5*(S+x)),e.center.copy(p).add(g).add(m);let P=K0.set(v-b,w-T,x-S).multiplyByScalar(.5),M=new V([P[0],0,0,0,P[1],0,0,0,P[2]]);return e.halfAxes.multiplyRight(M),e}function Ic(t,e){return sm(t)||om(t,e)||Ac(t,e)||im()}function im(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
17
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function om(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function sm(t){if(Array.isArray(t))return t}function Qi(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Ac(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
18
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function Ac(t,e){if(t){if(typeof t=="string")return Pc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pc(t,e)}}function Pc(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function am(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ec(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function cm(t,e,r){return e&&Ec(t.prototype,e),r&&Ec(t,r),t}var de=512,Oc=3,Lc=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],Rc=Lc.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),lm=Rc.concat([[.25,.5],[.75,.5]]),um=function(){function t(r,n,i){am(this,t),this.x=void 0,this.y=void 0,this.z=void 0,this.childVisible=void 0,this.selected=void 0,this._children=void 0,this.x=r,this.y=n,this.z=i}var e=t.prototype;return e.update=function(n){var i=n.viewport,o=n.cullingVolume,s=n.elevationBounds,a=n.minZ,c=n.maxZ,l=n.bounds,u=n.offset,f=n.project,h=this.getBoundingVolume(s,u,f);if(l&&!this.insideBounds(l))return!1;var d=o.computeVisibility(h);if(d<0)return!1;if(!this.childVisible){var p=this.z;if(p<c&&p>=a){var g=h.distanceTo(i.cameraPosition)*i.scale/i.height;p+=Math.floor(Math.log2(g))}if(p>=c)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var m=Qi(this.children),v;try{for(m.s();!(v=m.n()).done;){var w=v.value;w.update(n)}}catch(x){m.e(x)}finally{m.f()}return!0},e.getSelected=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(this.selected&&n.push(this),this._children){var i=Qi(this._children),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.getSelected(n)}}catch(a){i.e(a)}finally{i.f()}}return n},e.insideBounds=function(n){var i=Ic(n,4),o=i[0],s=i[1],a=i[2],c=i[3],l=Math.pow(2,this.z),u=de/l;return this.x*u<a&&this.y*u<c&&(this.x+1)*u>o&&(this.y+1)*u>s},e.getBoundingVolume=function(n,i,o){if(o){var s=this.z<1?lm:this.z<2?Rc:Lc,a=[],c=Qi(s),l;try{for(c.s();!(l=c.n()).done;){var u=l.value,f=Yr(this.x+u[0],this.y+u[1],this.z);f[2]=n[0],a.push(o(f)),n[0]!==n[1]&&(f[2]=n[1],a.push(o(f)))}}catch(m){c.e(m)}finally{c.f()}return $i(a)}var h=Math.pow(2,this.z),d=de/h,p=this.x*d+i*de,g=de-(this.y+1)*d;return new Rt([p,g,n[0]],[p+d,g+d,n[1]])},cm(t,[{key:"children",get:function(){if(!this._children){var n=this.x*2,i=this.y*2,o=this.z+1;this._children=[new t(n,i,o),new t(n,i+1,o),new t(n+1,i,o),new t(n+1,i+1,o)]}return this._children}}]),t}();function Fc(t,e,r,n){var i=t instanceof Ce._GlobeViewport&&t.resolution?t.projectPosition:null,o=Object.values(t.getFrustumPlanes()).map(function(T){var S=T.normal,P=T.distance;return new at(S.clone().negate(),P)}),s=new tt(o),a=t.distanceScales.unitsPerMeter[2],c=r&&r[0]*a||0,l=r&&r[1]*a||0,u=t instanceof Ce.WebMercatorViewport&&t.pitch<=60?e:0;if(n){var f=n,h=Ic(f,4),d=h[0],p=h[1],g=h[2],m=h[3],v=bt([d,m]),w=bt([g,p]);n=[v[0],de-v[1],w[0],de-w[1]]}var x=new um(0,0,0),b={viewport:t,project:i,cullingVolume:s,elevationBounds:[c,l],minZ:u,maxZ:e,bounds:n,offset:0};if(x.update(b),t instanceof Ce.WebMercatorViewport&&t.subViewports&&t.subViewports.length>1){for(b.offset=-1;x.update(b)&&!(--b.offset<-Oc););for(b.offset=1;x.update(b)&&!(++b.offset>Oc););}return x.getSelected()}function pe(t,e){return dm(t)||hm(t,e)||Cc(t,e)||fm()}function fm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hm(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function dm(t){if(Array.isArray(t))return t}function Hr(t){return gm(t)||mm(t)||Cc(t)||pm()}function pm(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
20
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cc(t,e){if(t){if(typeof t=="string")return Ki(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ki(t,e)}}function mm(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function gm(t){if(Array.isArray(t))return Ki(t)}function Ki(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var St=512,ym=[-1/0,-1/0,1/0,1/0],Ct={type:"object",value:null,validate:function(e,r){return r.optional&&e===null||typeof e=="string"||Array.isArray(e)&&e.every(function(n){return typeof n=="string"})},equal:function(e,r){if(e===r)return!0;if(!Array.isArray(e)||!Array.isArray(r))return!1;var n=e.length;if(n!==r.length)return!1;for(var i=0;i<n;i++)if(e[i]!==r[i])return!1;return!0}};function zc(t,e){var r=[e.transformAsPoint([t[0],t[1]]),e.transformAsPoint([t[2],t[1]]),e.transformAsPoint([t[0],t[3]]),e.transformAsPoint([t[2],t[3]])],n=[Math.min.apply(Math,Hr(r.map(function(i){return i[0]}))),Math.min.apply(Math,Hr(r.map(function(i){return i[1]}))),Math.max.apply(Math,Hr(r.map(function(i){return i[0]}))),Math.max.apply(Math,Hr(r.map(function(i){return i[1]})))];return n}function vm(t){return Math.abs(t.split("").reduce(function(e,r){return(e<<5)-e+r.charCodeAt(0)|0},0))}function yt(t,e){if(!t||!t.length)return null;var r=e.index,n=e.id;if(Array.isArray(t)){var i=vm(n)%t.length;t=t[i]}for(var o=t,s=0,a=Object.keys(r);s<a.length;s++){var c=a[s],l=new RegExp("{".concat(c,"}"),"g");o=o.replace(l,String(r[c]))}return Number.isInteger(r.y)&&Number.isInteger(r.z)&&(o=o.replace(/\{-y\}/g,String(Math.pow(2,r.z)-r.y-1))),o}function xm(t,e,r){var n;if(e&&e.length===2){var i=pe(e,2),o=i[0],s=i[1],a=t.getBounds({z:o}),c=t.getBounds({z:s});n=[Math.min(a[0],c[0]),Math.min(a[1],c[1]),Math.max(a[2],c[2]),Math.max(a[3],c[3])]}else n=t.getBounds();return t.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 Bc(t){var e=t.viewport,r=t.z,n=t.cullRect,i=e.subViewports||[e];return i.map(function(o){return Ji(o,r||0,n)})}function Ji(t,e,r){if(!Array.isArray(e)){var n=r.x-t.x,i=r.y-t.y,o=r.width,s=r.height,a={targetZ:e},c=t.unproject([n,i],a),l=t.unproject([n+o,i],a),u=t.unproject([n,i+s],a),f=t.unproject([n+o,i+s],a);return[Math.min(c[0],l[0],u[0],f[0]),Math.min(c[1],l[1],u[1],f[1]),Math.max(c[0],l[0],u[0],f[0]),Math.max(c[1],l[1],u[1],f[1])]}var h=Ji(t,e[0],r),d=Ji(t,e[1],r);return[Math.min(h[0],d[0]),Math.min(h[1],d[1]),Math.max(h[2],d[2]),Math.max(h[3],d[3])]}function _m(t,e,r){if(r){var n=zc(t,r).map(function(i){return i*e/St});return n}return t.map(function(i){return i*e/St})}function to(t,e){return Math.pow(2,t)*St/e}function Yr(t,e,r){var n=to(r,St),i=t/n*360-180,o=Math.PI-2*Math.PI*e/n,s=180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)));return[i,s]}function Nc(t,e,r,n){var i=to(r,n);return[t/i*St,e/i*St]}function eo(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:St;if(t.isGeospatial){var o=Yr(e,r,n),s=pe(o,2),a=s[0],c=s[1],l=Yr(e+1,r+1,n),u=pe(l,2),f=u[0],h=u[1];return{west:a,north:c,east:f,south:h}}var d=Nc(e,r,n,i),p=pe(d,2),g=p[0],m=p[1],v=Nc(e+1,r+1,n,i),w=pe(v,2),x=w[0],b=w[1];return{left:g,top:m,right:x,bottom:b}}function bm(t,e,r,n,i){for(var o=xm(t,null,n),s=to(e,r),a=_m(o,s,i),c=pe(a,4),l=c[0],u=c[1],f=c[2],h=c[3],d=[],p=Math.floor(l);p<f;p++)for(var g=Math.floor(u);g<h;g++)d.push({x:p,y:g,z:e});return d}function ro(t){var e=t.viewport,r=t.maxZoom,n=t.minZoom,i=t.zRange,o=t.extent,s=t.tileSize,a=s===void 0?St:s,c=t.modelMatrix,l=t.modelMatrixInverse,u=t.zoomOffset,f=u===void 0?0:u,h=e.isGeospatial?Math.round(e.zoom+Math.log2(St/a))+f:Math.ceil(e.zoom)+f;if(typeof n=="number"&&Number.isFinite(n)&&h<n){if(!o)return[];h=n}typeof r=="number"&&Number.isFinite(r)&&h>r&&(h=r);var d=o;return c&&l&&o&&!e.isGeospatial&&(d=zc(o,c)),e.isGeospatial?Fc(e,h,i,o):bm(e,h,a,d||ym,l)}function no(t){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)}function io(t){return Number.isFinite(t.west)&&Number.isFinite(t.north)&&Number.isFinite(t.east)&&Number.isFinite(t.south)}function kc(t){var e={},r;return function(n){for(var i in n)if(!wm(n[i],e[i])){r=t(n),e=n;break}return r}}function wm(t,e){if(t===e)return!0;if(Array.isArray(t)){var r=t.length;if(!e||e.length!==r)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}return!1}var ze;function qc(t,e){return Tm(t)||Sm(t,e)||Gc(t,e)||Mm()}function Mm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
21
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sm(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function Tm(t){if(Array.isArray(t))return t}function Q(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Gc(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
22
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function Gc(t,e){if(t){if(typeof t=="string")return Uc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uc(t,e)}}function Uc(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function jc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Vc(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jc(Object(r),!0).forEach(function(n){$r(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jc(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Em(t,e,r){return e&&Wc(t.prototype,e),r&&Wc(t,r),t}function $r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Dc=1,Qr=2,Om="never",Im="no-overlap",Be="best-available",Am=5,Lm=(ze={},$r(ze,Be,Fm),$r(ze,Im,Nm),$r(ze,Om,function(){}),ze),Rm={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){}},ke=function(){function t(r){var n=this;Pm(this,t),this.opts=void 0,this._requestScheduler=void 0,this._cache=void 0,this._dirty=void 0,this._tiles=void 0,this._cacheByteSize=void 0,this._viewport=void 0,this._zRange=void 0,this._selectedTiles=void 0,this._frameNumber=void 0,this._modelMatrix=void 0,this._modelMatrixInverse=void 0,this._maxZoom=void 0,this._minZoom=void 0,this.onTileLoad=void 0,this._getCullBounds=kc(Bc),this.opts=Vc(Vc({},Rm),r),this.onTileLoad=function(i){var o,s;(o=(s=n.opts).onTileLoad)===null||o===void 0||o.call(s,i),n.opts.maxCacheByteSize&&(n._cacheByteSize+=i.byteLength,n._resizeCache())},this._requestScheduler=new ee({maxRequests:r.maxRequests,throttleRequests:Boolean(r.maxRequests&&r.maxRequests>0)}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new et,this._modelMatrixInverse=new et,this.setOptions(r)}var e=t.prototype;return e.setOptions=function(n){Object.assign(this.opts,n),Number.isFinite(n.maxZoom)&&(this._maxZoom=Math.floor(n.maxZoom)),Number.isFinite(n.minZoom)&&(this._minZoom=Math.ceil(n.minZoom))},e.finalize=function(){var n=Q(this._cache.values()),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;o.isLoading&&o.abort()}}catch(s){n.e(s)}finally{n.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null},e.reloadAll=function(){var n=Q(this._cache.keys()),i;try{for(n.s();!(i=n.n()).done;){var o=i.value,s=this._cache.get(o);!this._selectedTiles||!this._selectedTiles.includes(s)?this._cache.delete(o):s.setNeedsReload()}}catch(a){n.e(a)}finally{n.f()}},e.update=function(n){var i=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.zRange,a=o.modelMatrix,c=a?new et(a):new et,l=!c.equals(this._modelMatrix);if(!this._viewport||!n.equals(this._viewport)||!pt(this._zRange,s)||l){l&&(this._modelMatrixInverse=c.clone().invert(),this._modelMatrix=c),this._viewport=n,this._zRange=s;var u=this.getTileIndices({viewport:n,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:s,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=u.map(function(h){return i._getTile(h,!0)}),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(function(h){return i._getTile(h.index,!0)}));var f=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),f&&this._frameNumber++,this._frameNumber},e.isTileVisible=function(n,i){if(!n.isVisible)return!1;if(i&&this._viewport){var o=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:i}),s=n.bbox,a=Q(o),c;try{for(a.s();!(c=a.n()).done;){var l=qc(c.value,4),u=l[0],f=l[1],h=l[2],d=l[3],p=void 0;if("west"in s)p=s.west<h&&s.east>u&&s.south<d&&s.north>f;else{var g=Math.min(s.top,s.bottom),m=Math.max(s.top,s.bottom);p=s.left<h&&s.right>u&&g<d&&m>f}if(p)return!0}}catch(v){a.e(v)}finally{a.f()}return!1}return!0},e.getTileIndices=function(n){var i=n.viewport,o=n.maxZoom,s=n.minZoom,a=n.zRange,c=n.modelMatrix,l=n.modelMatrixInverse,u=this.opts,f=u.tileSize,h=u.extent,d=u.zoomOffset;return ro({viewport:i,maxZoom:o,minZoom:s,zRange:a,tileSize:f,extent:h,modelMatrix:c,modelMatrixInverse:l,zoomOffset:d})},e.getTileId=function(n){return"".concat(n.x,"-").concat(n.y,"-").concat(n.z)},e.getTileZoom=function(n){return n.z},e.getTileMetadata=function(n){var i=this.opts.tileSize;return{bbox:eo(this._viewport,n.x,n.y,n.z,i)}},e.getParentIndex=function(n){var i=Math.floor(n.x/2),o=Math.floor(n.y/2),s=n.z-1;return{x:i,y:o,z:s}},e.updateTileStates=function(){var n=this.opts.refinementStrategy||Be,i=new Array(this._cache.size),o=0,s=Q(this._cache.values()),a;try{for(s.s();!(a=s.n()).done;){var c=a.value;i[o++]=c.isVisible,c.isSelected=!1,c.isVisible=!1}}catch(g){s.e(g)}finally{s.f()}var l=Q(this._selectedTiles),u;try{for(l.s();!(u=l.n()).done;){var f=u.value;f.isSelected=!0,f.isVisible=!0}}catch(g){l.e(g)}finally{l.f()}(typeof n=="function"?n:Lm[n])(Array.from(this._cache.values())),o=0;var h=Q(this._cache.values()),d;try{for(h.s();!(d=h.n()).done;){var p=d.value;if(i[o++]!==p.isVisible)return!0}}catch(g){h.e(g)}finally{h.f()}return!1},e._pruneRequests=function(){var n=this.opts.maxRequests,i=n===void 0?0:n,o=[],s=0,a=Q(this._cache.values()),c;try{for(a.s();!(c=a.n()).done;){var l=c.value;l.isLoading&&(s++,!l.isSelected&&!l.isVisible&&o.push(l))}}catch(f){a.e(f)}finally{a.f()}for(;i>0&&s>i&&o.length>0;){var u=o.shift();u.abort(),s--}},e._rebuildTree=function(){var n=this._cache,i=Q(n.values()),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.parent=null,s.children&&(s.children.length=0)}}catch(f){i.e(f)}finally{i.f()}var a=Q(n.values()),c;try{for(a.s();!(c=a.n()).done;){var l=c.value,u=this._getNearestAncestor(l);l.parent=u,u!=null&&u.children&&u.children.push(l)}}catch(f){a.e(f)}finally{a.f()}},e._resizeCache=function(){var n=this._cache,i=this.opts,o=i.maxCacheSize||(i.maxCacheByteSize?1/0:Am*this.selectedTiles.length),s=i.maxCacheByteSize||1/0,a=n.size>o||this._cacheByteSize>s;if(a){var c=Q(n),l;try{for(c.s();!(l=c.n()).done;){var u=qc(l.value,2),f=u[0],h=u[1];if(!h.isVisible&&!h.isSelected){var d,p;this._cacheByteSize-=i.maxCacheByteSize?h.byteLength:0,n.delete(f),(d=(p=this.opts).onTileUnload)===null||d===void 0||d.call(p,h)}if(n.size<=o&&this._cacheByteSize<=s)break}}catch(g){c.e(g)}finally{c.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort(function(g,m){return g.zoom-m.zoom}),this._dirty=!1)},e._getTile=function(n,i){var o=this.getTileId(n),s=this._cache.get(o),a=!1;return!s&&i?(s=new Fe(n),Object.assign(s,this.getTileMetadata(s.index)),Object.assign(s,{id:o,zoom:this.getTileZoom(s.index)}),a=!0,this._cache.set(o,s),this._dirty=!0):s&&s.needsReload&&(a=!0),s&&a&&s.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),s},e._getNearestAncestor=function(n){for(var i=this._minZoom,o=i===void 0?0:i,s=n.index;this.getTileZoom(s)>o;){s=this.getParentIndex(s);var a=this._getTile(s);if(a)return a}return null},Em(t,[{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return this._selectedTiles!==null&&this._selectedTiles.every(function(n){return n.isLoaded})}},{key:"needsReload",get:function(){return this._selectedTiles!==null&&this._selectedTiles.some(function(n){return n.needsReload})}}]),t}();function Fm(t){var e=Q(t),r;try{for(e.s();!(r=e.n()).done;){var n=r.value;n.state=0}}catch(u){e.e(u)}finally{e.f()}var i=Q(t),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.isSelected&&!Zc(s)&&oo(s)}}catch(u){i.e(u)}finally{i.f()}var a=Q(t),c;try{for(a.s();!(c=a.n()).done;){var l=c.value;l.isVisible=Boolean(l.state&Qr)}}catch(u){a.e(u)}finally{a.f()}}function Nm(t){var e=Q(t),r;try{for(e.s();!(r=e.n()).done;){var n=r.value;n.state=0}}catch(p){e.e(p)}finally{e.f()}var i=Q(t),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.isSelected&&Zc(s)}}catch(p){i.e(p)}finally{i.f()}var a=Array.from(t).sort(function(p,g){return p.zoom-g.zoom}),c=Q(a),l;try{for(c.s();!(l=c.n()).done;){var u=l.value;if(u.isVisible=Boolean(u.state&Qr),u.children&&(u.isVisible||u.state&Dc)){var f=Q(u.children),h;try{for(f.s();!(h=f.n()).done;){var d=h.value;d.state=Dc}}catch(p){f.e(p)}finally{f.f()}}else u.isSelected&&oo(u)}}catch(p){c.e(p)}finally{c.f()}}function Zc(t){for(var e=t;e;){if(e.isLoaded||e.content)return e.state|=Qr,!0;e=e.parent}return!1}function oo(t){var e=Q(t.children),r;try{for(e.s();!(r=e.n()).done;){var n=r.value;n.isLoaded||n.content?n.state|=Qr:oo(n)}}catch(i){e.e(i)}finally{e.f()}}function Jr(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Jr=function(r){return typeof r}:Jr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Jr(t)}function Xc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Kr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xc(Object(r),!0).forEach(function(n){Cm(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xc(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Cm(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zm(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Bm(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
23
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function Bm(t,e){if(t){if(typeof t=="string")return Yc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yc(t,e)}}function Yc(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function km(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function qm(t,e,r){return e&&Hc(t.prototype,e),r&&Hc(t,r),t}function Um(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&so(t,e)}function so(t,e){return so=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},so(t,e)}function jm(t){var e=Dm();return function(){var n=tn(t),i;if(e){var o=tn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Vm(this,i)}}function Vm(t,e){if(e&&(Jr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wm(t)}function Wm(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Dm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function tn(t){return tn=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},tn(t)}var Gm={TilesetClass:ke,data:{type:"data",value:[]},dataComparator:Ct.equal,renderSubLayers:{type:"function",value:function(e){return new $c.GeoJsonLayer(e)}},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:function(e){}},onTileUnload:{type:"function",value:function(e){}},onTileError:{type:"function",value:function(e){return console.error(e)}},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:Be,zRange:null,maxRequests:6,zoomOffset:0},Tt=function(t){Um(r,t);var e=jm(r);function r(){var i;km(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.initializeState=function(){this.state={tileset:null,isLoaded:!1}},n.finalizeState=function(){var o,s;(o=this.state)===null||o===void 0||(s=o.tileset)===null||s===void 0||s.finalize()},n.shouldUpdateState=function(o){var s=o.changeFlags;return s.somethingChanged},n.updateState=function(o){var s=o.changeFlags,a=this.state.tileset,c=s.propsOrDataChanged||s.updateTriggersChanged,l=s.dataChanged||s.updateTriggersChanged&&(s.updateTriggersChanged.all||s.updateTriggersChanged.getTileData);a?c&&(a.setOptions(this._getTilesetOptions()),l?a.reloadAll():a.tiles.forEach(function(u){u.layers=null})):(a=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:a})),this._updateTileset()},n._getTilesetOptions=function(){var o=this.props,s=o.tileSize,a=o.maxCacheSize,c=o.maxCacheByteSize,l=o.refinementStrategy,u=o.extent,f=o.maxZoom,h=o.minZoom,d=o.maxRequests,p=o.zoomOffset;return{maxCacheSize:a,maxCacheByteSize:c,maxZoom:f,minZoom:h,tileSize:s,refinementStrategy:l,extent:u,maxRequests:d,zoomOffset:p,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}},n._updateTileset=function(){var o=this.state.tileset,s=this.props,a=s.zRange,c=s.modelMatrix,l=o.update(this.context.viewport,{zRange:a,modelMatrix:c}),u=o.isLoaded,f=this.state.isLoaded!==u,h=this.state.frameNumber!==l;u&&(f||h)&&this._onViewportLoad(),h&&this.setState({frameNumber:l}),this.state.isLoaded=u},n._onViewportLoad=function(){var o=this.state.tileset,s=this.props.onViewportLoad;s&&s(o.selectedTiles)},n._onTileLoad=function(o){this.props.onTileLoad(o),o.layers=null,this.setNeedsUpdate()},n._onTileError=function(o,s){this.props.onTileError(o),s.layers=null,this.setNeedsUpdate()},n._onTileUnload=function(o){this.props.onTileUnload(o)},n.getTileData=function(o){var s=this.props,a=s.data,c=s.getTileData,l=s.fetch,u=o.signal;return o.url=typeof a=="string"||Array.isArray(a)?yt(a,o):null,c?c(o):l&&o.url?l(o.url,{propName:"data",layer:this,signal:u}):null},n.renderSubLayers=function(o){return this.props.renderSubLayers(o)},n.getSubLayerPropsByTile=function(o){return null},n.getPickingInfo=function(o){var s=o.info,a=o.sourceLayer,c=a.props.tile;return s.picked&&(s.tile=c),s.sourceTile=c,s},n._updateAutoHighlight=function(o){var s=o.sourceTile;if(s&&s.layers){var a=zm(s.layers),c;try{for(a.s();!(c=a.n()).done;){var l=c.value;l.updateAutoHighlight(o)}}catch(u){a.e(u)}finally{a.f()}}},n.renderLayers=function(){var o=this;return this.state.tileset.tiles.map(function(s){var a=o.getSubLayerPropsByTile(s);if(!(!s.isLoaded&&!s.content))if(s.layers)a&&s.layers[0]&&Object.keys(a).some(function(l){return s.layers[0].props[l]!==a[l]})&&(s.layers=s.layers.map(function(l){return l.clone(a)}));else{var c=o.renderSubLayers(Kr(Kr(Kr({},o.props),o.getSubLayerProps({id:s.id,updateTriggers:o.props.updateTriggers})),{},{data:s.content,_offset:0,tile:s}));s.layers=(0,en._flatten)(c,Boolean).map(function(l){return l.clone(Kr({tile:s},a))})}return s.layers})},n.filterSubLayer=function(o){var s=o.layer,a=o.cullRect,c=s.props.tile;return this.state.tileset.isTileVisible(c,a)},qm(r,[{key:"isLoaded",get:function(){var o,s,a=(o=this.state)===null||o===void 0||(s=o.tileset)===null||s===void 0?void 0:s.selectedTiles;return a?a.every(function(c){return c.isLoaded&&c.layers&&c.layers.every(function(l){return l.isLoaded})}):!1}}]),r}(en.CompositeLayer);Tt.defaultProps=Gm;Tt.layerName="TileLayer";var Jc=B(ct());function rn(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rn=function(r){return typeof r}:rn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},rn(t)}function Qc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Kc(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qc(Object(r),!0).forEach(function(n){Zm(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qc(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Zm(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function me(t,e,r){return typeof Reflect<"u"&&Reflect.get?me=Reflect.get:me=function(i,o,s){var a=Ym(i,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(s):c.value}},me(t,e,r||t)}function Ym(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=zt(t),t!==null););return t}function Hm(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ao(t,e)}function ao(t,e){return ao=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ao(t,e)}function $m(t){var e=Jm();return function(){var n=zt(t),i;if(e){var o=zt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Qm(this,i)}}function Qm(t,e){if(e&&(rn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Km(t)}function Km(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Jm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zt(t){return zt=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},zt(t)}var tg={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(e){return e.timestamps}}},nn=function(t){Hm(r,t);var e=$m(r);function r(){return Xm(this,r),e.apply(this,arguments)}var n=r.prototype;return n.getShaders=function(){var o=me(zt(r.prototype),"getShaders",this).call(this);return o.inject={"vs:#decl":`uniform float trailLength;
43
24
  attribute float instanceTimestamps;
44
25
  attribute float instanceNextTimestamps;
45
26
  varying float vTime;
@@ -54,197 +35,18 @@ varying float vTime;
54
35
  `,"fs:DECKGL_FILTER_COLOR":`if(fadeTrail) {
55
36
  color.a *= 1.0 - (currentTime - vTime) / trailLength;
56
37
  }
57
- `},a},n.initializeState=function(){kn(br(r.prototype),"initializeState",this).call(this);var a=this.getAttributeManager();a.addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})},n.draw=function(a){var o=this.props,s=o.fadeTrail,u=o.trailLength,f=o.currentTime;a.uniforms=Tb(Tb({},a.uniforms),{},{fadeTrail:s,trailLength:u,currentTime:f}),kn(br(r.prototype),"draw",this).call(this,a)},r}(Sb.PathLayer);Ps.layerName="TripsLayer";Ps.defaultProps=VR;var Db=q(Bs()),Gb=q(dt());var nt=q(Bs()),Rs=q(dt()),ea=q(ht());var Zi=q(Bs());function Eb(e,t){return JR(e)||WR(e,t)||Pb(e,t)||zR()}function zR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
58
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WR(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function JR(e){if(Array.isArray(e))return e}function Ob(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Pb(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
59
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function Pb(e,t){if(e){if(typeof e=="string")return xb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xb(e,t)}}function xb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Cs(e,t){t=t===void 0?e[0][0]:t;var r=Ob(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value,a=i[0]-t;a>180?i[0]-=360:a<-180&&(i[0]+=360)}}catch(o){r.e(o)}finally{r.f()}}function XR(e,t,r){var n=(0,Zi.cellToLatLng)(e),i=Eb(n,2),a=i[0],o=i[1],s=t.length;Cs(t,o);for(var u=t[0]===t[s-1]?s-1:s,f=0;f<u;f++)t[f][0]=dr(o,t[f][0],r),t[f][1]=dr(a,t[f][1],r)}function Bb(e,t,r){var n=e(t,r),i=(0,Zi.cellToLatLng)(n),a=Eb(i,2),o=a[0],s=a[1];return[s,o]}function rh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=(0,Zi.cellToBoundary)(e,!0);return t!==1?XR(e,r,t):Cs(r),r}function Cb(e){var t=new Float64Array(e.length*2),r=0,n=Ob(e),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;t[r++]=a[0],t[r++]=a[1]}}catch(o){n.e(o)}finally{n.f()}return t}function Mb(e,t){return YR(e)||KR(e,t)||Fb(e,t)||qR()}function qR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
60
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KR(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function YR(e){if(Array.isArray(e))return e}function $R(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Fb(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
61
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function Fb(e,t){if(e){if(typeof e=="string")return Ib(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ib(e,t)}}function Ib(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ZR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QR(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&nh(e,t)}function nh(e,t){return nh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},nh(e,t)}function eF(e){var t=nF();return function(){var n=Ms(e),i;if(t){var a=Ms(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return tF(this,i)}}function tF(e,t){if(t&&(Qi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rF(e)}function rF(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nF(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ms(e){return Ms=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ms(e)}function Rb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Is(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rb(Object(r),!0).forEach(function(n){iF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iF(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qi(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qi=function(r){return typeof r}:Qi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Qi(e)}var aF=10;function oF(e,t){var r;return e==null?r=t:Qi(e)==="object"?r=Is(Is({},e),{},{coverage:t}):r={getHexagon:e,coverage:t},r}var sF=Is(Is({},ea.PolygonLayer.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(t){return t.hexagon}},extruded:!0}),Qr=function(e){QR(r,e);var t=eF(r);function r(){var i;ZR(this,r);for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return i=t.call.apply(t,[this].concat(o)),i.state=void 0,i}var n=r.prototype;return n.initializeState=function(){r._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}},n.shouldUpdateState=function(a){var o=a.changeFlags;return this._shouldUseHighPrecision()?o.propsOrDataChanged:o.somethingChanged},n.updateState=function(a){var o=a.props,s=a.changeFlags;if(o.highPrecision!==!0&&(s.dataChanged||s.updateTriggersChanged&&s.updateTriggersChanged.getHexagon)){var u=this._calculateH3DataProps();this.setState(u)}this._updateVertices(this.context.viewport)},n._calculateH3DataProps=function(){var a=-1,o=!1,s=!1,u=(0,Rs.createIterable)(this.props.data),f=u.iterable,c=u.objectInfo,l=$R(f),d;try{for(l.s();!(d=l.n()).done;){var h=d.value;c.index++;var p=this.props.getHexagon(h,c),m=(0,nt.getResolution)(p);if(a<0){if(a=m,!this.props.highPrecision)break}else if(a!==m){s=!0;break}if((0,nt.isPentagon)(p)){o=!0;break}}}catch(g){l.e(g)}finally{l.f()}return{resolution:a,edgeLengthKM:a>=0?(0,nt.getHexagonEdgeLengthAvg)(a,"km"):0,hasMultipleRes:s,hasPentagon:o}},n._shouldUseHighPrecision=function(){if(this.props.highPrecision==="auto"){var a=this.state,o=a.resolution,s=a.hasPentagon,u=a.hasMultipleRes,f=this.context.viewport;return Boolean(f?.resolution)||u||s||o>=0&&o<=5}return this.props.highPrecision},n._updateVertices=function(a){if(!this._shouldUseHighPrecision()){var o=this.state,s=o.resolution,u=o.edgeLengthKM,f=o.centerHex;if(!(s<0)){var c=this.props.centerHexagon||(0,nt.latLngToCell)(a.latitude,a.longitude,s);if(f!==c){if(f)try{var l=(0,nt.gridDistance)(f,c);if(l*u<aF)return}catch{}var d=a.distanceScales.unitsPerMeter,h=rh(c),p=(0,nt.cellToLatLng)(c),m=Mb(p,2),g=m[0],y=m[1],b=a.projectFlat([y,g]),A=Mb(b,2),S=A[0],O=A[1];h=h.map(function(w){var B=a.projectFlat(w);return[(B[0]-S)/d[0],(B[1]-O)/d[1]]}),this.setState({centerHex:c,vertices:h})}}}},n.renderLayers=function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()},n._getForwardProps=function(){var a=this.props,o=a.elevationScale,s=a.material,u=a.coverage,f=a.extruded,c=a.wireframe,l=a.stroked,d=a.filled,h=a.lineWidthUnits,p=a.lineWidthScale,m=a.lineWidthMinPixels,g=a.lineWidthMaxPixels,y=a.getFillColor,b=a.getElevation,A=a.getLineColor,S=a.getLineWidth,O=a.transitions,w=a.updateTriggers;return{elevationScale:o,extruded:f,coverage:u,wireframe:c,stroked:l,filled:d,lineWidthUnits:h,lineWidthScale:p,lineWidthMinPixels:m,lineWidthMaxPixels:g,material:s,getElevation:b,getFillColor:y,getLineColor:A,getLineWidth:S,transitions:O,updateTriggers:{getFillColor:w.getFillColor,getElevation:w.getElevation,getLineColor:w.getLineColor,getLineWidth:w.getLineWidth}}},n._renderPolygonLayer=function(){var a=this.props,o=a.data,s=a.getHexagon,u=a.updateTriggers,f=a.coverage,c=this.getSubLayerClass("hexagon-cell-hifi",ea.PolygonLayer),l=this._getForwardProps();return l.updateTriggers.getPolygon=oF(u.getHexagon,f),new c(l,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:l.updateTriggers}),{data:o,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(h,p){var m=s(h,p);return Cb(rh(m,f))}})},n._renderColumnLayer=function(){var a=this.props,o=a.data,s=a.getHexagon,u=a.updateTriggers,f=this.getSubLayerClass("hexagon-cell",ea.ColumnLayer),c=this._getForwardProps();return c.updateTriggers.getPosition=u.getHexagon,new f(c,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:c.updateTriggers}),{data:o,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Bb.bind(null,s)})},r}(Rs.CompositeLayer);Qr.defaultProps=sF;Qr.layerName="H3HexagonLayer";Qr._checkH3Lib=function(){};function Fs(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fs=function(r){return typeof r}:Fs=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Fs(e)}function ih(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=uF(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
62
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function uF(e,t){if(e){if(typeof e=="string")return Lb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lb(e,t)}}function Lb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cF(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ah(e,t)}function ah(e,t){return ah=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ah(e,t)}function lF(e){var t=pF();return function(){var n=Ls(e),i;if(t){var a=Ls(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return hF(this,i)}}function hF(e,t){if(t&&(Fs(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dF(e)}function dF(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pF(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ls(e){return Ls=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ls(e)}var mF={getHexagons:{type:"accessor",value:function(t){return t.hexagons}}},Ds=function(e){cF(r,e);var t=lF(r);function r(){return fF(this,r),t.apply(this,arguments)}var n=r.prototype;return n.initializeState=function(){Qr._checkH3Lib()},n.updateState=function(a){var o=a.props,s=a.changeFlags;if(s.dataChanged||s.updateTriggersChanged&&s.updateTriggersChanged.getHexagons){var u=o.data,f=o.getHexagons,c=[],l=(0,Gb.createIterable)(u),d=l.iterable,h=l.objectInfo,p=ih(d),m;try{for(p.s();!(m=p.n()).done;){var g=m.value;h.index++;var y=f(g,h),b=(0,Db.cellsToMultiPolygon)(y,!0),A=ih(b),S;try{for(A.s();!(S=A.n()).done;){var O=S.value,w=ih(O),B;try{for(w.s();!(B=w.n()).done;){var P=B.value;Cs(P)}}catch(x){w.e(x)}finally{w.f()}c.push(this.getSubLayerRow({polygon:O},g,h.index))}}catch(x){A.e(x)}finally{A.f()}}}catch(x){p.e(x)}finally{p.f()}this.setState({polygons:c})}},n.indexToBounds=function(){var a=this.props,o=a.getElevation,s=a.getFillColor,u=a.getLineColor,f=a.getLineWidth;return{data:this.state.polygons,getPolygon:function(l){return l.polygon},getElevation:this.getSubLayerAccessor(o),getFillColor:this.getSubLayerAccessor(s),getLineColor:this.getSubLayerAccessor(u),getLineWidth:this.getSubLayerAccessor(f)}},r}(rt);Ds.layerName="H3ClusterLayer";Ds.defaultProps=mF;var ax=q(oh()),Lr=q(dt()),ox=q(ht()),sx=q(Gs());function Hn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Hn=function(r){return typeof r}:Hn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Hn(e)}function sh(e){if(typeof window<"u"&&Hn(window.process)==="object"&&window.process.type==="renderer"||typeof process<"u"&&Hn(process.versions)==="object"&&Boolean(process.versions.electron))return!0;var t=(typeof navigator>"u"?"undefined":Hn(navigator))==="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function Ns(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ns=function(r){return typeof r}:Ns=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ns(e)}function Ue(){var e=(typeof process>"u"?"undefined":Ns(process))==="object"&&String(process)==="[object process]"&&!process.browser;return!e||sh()}function Us(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Us=function(r){return typeof r}:Us=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Us(e)}var _r={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document,process:(typeof process>"u"?"undefined":Us(process))==="object"&&process};var vF=_r.self||_r.window||_r.global,Vn=_r.window||_r.self||_r.global,gF=_r.document||{},en=_r.process||{};var js="8.10.0-alpha.6",Yq=Ue();function yF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bF(e){try{var t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var jb=function(){function e(r){yF(this,e);var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";v(this,"storage",void 0),v(this,"id",void 0),v(this,"config",{}),this.storage=bF(i),this.id=r,this.config={},Object.assign(this.config,n),this._loadConfiguration()}var t=e.prototype;return t.getConfiguration=function(){return this.config},t.setConfiguration=function(n){return this.config={},this.updateConfiguration(n)},t.updateConfiguration=function(n){if(Object.assign(this.config,n),this.storage){var i=JSON.stringify(this.config);this.storage.setItem(this.id,i)}return this},t._loadConfiguration=function(){var n={};if(this.storage){var i=this.storage.getItem(this.id);n=i?JSON.parse(i):{}}return Object.assign(this.config,n),this},e}();function kb(e){var t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function Hb(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function ks(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));var a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var Hs;(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"})(Hs||(Hs={}));function Vb(e){return typeof e=="string"?Hs[e.toUpperCase()]||Hs.WHITE:e}function zb(e,t,r){return!Ue&&typeof e=="string"&&(t&&(t=Vb(t),e="\x1B[".concat(t,"m").concat(e,"\x1B[39m")),r&&(t=Vb(r),e="\x1B[".concat(r+10,"m").concat(e,"\x1B[49m"))),e}function _F(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=AF(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
63
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function AF(e,t){if(e){if(typeof e=="string")return Wb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wb(e,t)}}function Wb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Jb(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=_F(n),a;try{var o=function(){var u=a.value;typeof e[u]=="function"&&(t.find(function(f){return u===f})||(e[u]=e[u].bind(e)))};for(i.s();!(a=i.n()).done;)o()}catch(s){i.e(s)}finally{i.f()}}function zn(e,t){if(!e)throw new Error(t||"Assertion failed")}function tn(){var e;if(Ue&&"performance"in Vn){var t,r;e=Vn===null||Vn===void 0||(t=Vn.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in en){var n,i=en===null||en===void 0||(n=en.hrtime)===null||n===void 0?void 0:n.call(en);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}function Jn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Jn=function(r){return typeof r}:Jn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Jn(e)}function Vs(e){return xF(e)||wF(e)||SF(e)||TF()}function TF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
64
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SF(e,t){if(e){if(typeof e=="string")return uh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uh(e,t)}}function wF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xF(e){if(Array.isArray(e))return uh(e)}function uh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function EF(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xb(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function PF(e,t,r){return t&&Xb(e.prototype,t),r&&Xb(e,r),e}var Wn={debug:Ue&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},BF={enabled:!0,level:0};function it(){}var qb={},Kb={once:!0},Xn=function(){function e(){OF(this,e);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""},n=r.id;v(this,"id",void 0),v(this,"VERSION",js),v(this,"_startTs",tn()),v(this,"_deltaTs",tn()),v(this,"_storage",void 0),v(this,"userData",{}),v(this,"LOG_THROTTLE_TIMEOUT",0),this.id=n,this._storage=new jb("__probe-".concat(this.id,"__"),BF),this.userData={},this.timeStamp("".concat(this.id," started")),Jb(this),Object.seal(this)}var t=e.prototype;return t.isEnabled=function(){return this._storage.config.enabled},t.getLevel=function(){return this._storage.config.level},t.getTotal=function(){return Number((tn()-this._startTs).toPrecision(10))},t.getDelta=function(){return Number((tn()-this._deltaTs).toPrecision(10))},t.getPriority=function(){return this.level},t.enable=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.updateConfiguration({enabled:n}),this},t.setLevel=function(n){return this._storage.updateConfiguration({level:n}),this},t.get=function(n){return this._storage.config[n]},t.set=function(n,i){this._storage.updateConfiguration(EF({},n,i))},t.settings=function(){console.table?console.table(this._storage.config):console.log(this._storage.config)},t.assert=function(n,i){zn(n,i)},t.warn=function(n){return this._getLogFunction(0,n,Wn.warn,arguments,Kb)},t.error=function(n){return this._getLogFunction(0,n,Wn.error,arguments)},t.deprecated=function(n,i){return this.warn("`".concat(n,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))},t.removed=function(n,i){return this.error("`".concat(n,"` has been removed. Use `").concat(i,"` instead"))},t.probe=function(n,i){return this._getLogFunction(n,i,Wn.log,arguments,{time:!0,once:!0})},t.log=function(n,i){return this._getLogFunction(n,i,Wn.debug,arguments)},t.info=function(n,i){return this._getLogFunction(n,i,console.info,arguments)},t.once=function(n,i){for(var a=arguments.length,o=new Array(a>2?a-2:0),s=2;s<a;s++)o[s-2]=arguments[s];return this._getLogFunction(n,i,Wn.debug||Wn.info,arguments,Kb)},t.table=function(n,i,a){return i?this._getLogFunction(n,i,console.table||it,a&&[a],{tag:RF(i)}):it},t.image=function(n){var i=n.logLevel,a=n.priority,o=n.image,s=n.message,u=s===void 0?"":s,f=n.scale,c=f===void 0?1:f;return this._shouldLog(i||a)?Ue?IF({image:o,message:u,scale:c}):MF({image:o,message:u,scale:c}):it},t.time=function(n,i){return this._getLogFunction(n,i,console.time?console.time:console.info)},t.timeEnd=function(n,i){return this._getLogFunction(n,i,console.timeEnd?console.timeEnd:console.info)},t.timeStamp=function(n,i){return this._getLogFunction(n,i,console.timeStamp||it)},t.group=function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=Yb({logLevel:n,message:i,opts:a}),s=a.collapsed;return o.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)},t.groupCollapsed=function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(n,i,Object.assign({},a,{collapsed:!0}))},t.groupEnd=function(n){return this._getLogFunction(n,"",console.groupEnd||it)},t.withGroup=function(n,i,a){this.group(n,i)();try{a()}finally{this.groupEnd(n)()}},t.trace=function(){console.trace&&console.trace()},t._shouldLog=function(n){return this.isEnabled()&&this.getLevel()>=$b(n)},t._getLogFunction=function(n,i,a,o,s){if(this._shouldLog(n)){var u;s=Yb({logLevel:n,message:i,args:o,opts:s}),a=a||s.method,zn(a),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=tn();var f=s.tag||s.message;if(s.once)if(!qb[f])qb[f]=tn();else return it;return i=CF(this.id,s.message,s),(u=a).bind.apply(u,[console,i].concat(Vs(s.args)))}return it},PF(e,[{key:"level",get:function(){return this.getLevel()},set:function(n){this.setLevel(n)}},{key:"priority",get:function(){return this.level},set:function(n){this.level=n}}]),e}();v(Xn,"VERSION",js);function $b(e){if(!e)return 0;var t;switch(Jn(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return zn(Number.isFinite(t)&&t>=0),t}function Yb(e){var t=e.logLevel,r=e.message;e.logLevel=$b(t);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==r;);switch(Jn(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());var i=Jn(e.message);return zn(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function CF(e,t,r){if(typeof t=="string"){var n=r.time?Hb(kb(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=zb(t,r.color,r.background)}return t}function MF(e){var t=e.image,r=e.message,n=r===void 0?"":r,i=e.scale,a=i===void 0?1:i,o=null;try{o=module.require("asciify-image")}catch{}return o?function(){return o(t,{fit:"box",width:"".concat(Math.round(80*a),"%")}).then(function(s){return console.log(s)})}:it}function IF(e){var t=e.image,r=e.message,n=r===void 0?"":r,i=e.scale,a=i===void 0?1:i;if(typeof t=="string"){var o=new Image;return o.onload=function(){var c,l=ks(o,n,a);(c=console).log.apply(c,Vs(l))},o.src=t,it}var s=t.nodeName||"";if(s.toLowerCase()==="img"){var u;return(u=console).log.apply(u,Vs(ks(t,n,a))),it}if(s.toLowerCase()==="canvas"){var f=new Image;return f.onload=function(){var c;return(c=console).log.apply(c,Vs(ks(f,n,a)))},f.src=t.toDataURL(),it}return it}function RF(e){for(var t in e)for(var r in e[t])return r||"untitled";return"empty"}var wK=new Xn({id:"@probe.gl/log"});var Q=new Xn({id:"luma.gl"});function Oe(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}var FF="Invalid WebGLRenderingContext";var LF="Requires WebGL2";function zs(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function ne(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function fh(e){return ne(e)?e:null}function ta(e){return Oe(zs(e),FF),e}function Me(e){return Oe(ne(e),LF),e}var ra={};function DF(e){globalThis.console&&globalThis.console.error&&globalThis.console.error(e)}function GF(e){globalThis.console&&globalThis.console.log&&globalThis.console.log(e)}function NF(e,t){ra[e]=!0,t!==void 0&&DF(t)}function UF(e){var t=e.getError;e.getError=function(){var n;do n=t.apply(e),n!==0&&(ra[n]=!0);while(n!==0);for(n in ra)if(ra[n])return delete ra[n],parseInt(n,10);return 0}}var na=function e(t){var r=t.gl;this.ext=t,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(t.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new e.VertexAttrib(r);this.attribs[n]=i}this.maxAttrib=0};na.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()};na.VertexAttrib.prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var rn=function(t){var r=this;this.gl=t,UF(t);var n=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(a){return a===r.VERTEX_ARRAY_BINDING_OES?r.currentVertexArrayObject===r.defaultVertexArrayObject?null:r.currentVertexArrayObject:n.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(a){var o=r.currentVertexArrayObject;o.maxAttrib=Math.max(o.maxAttrib,a);var s=o.attribs[a];return s.enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(a){var o=r.currentVertexArrayObject;o.maxAttrib=Math.max(o.maxAttrib,a);var s=o.attribs[a];return s.enabled=!1,n.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(a,o){switch(a){case 34962:r.currentArrayBuffer=o;break;case 34963:r.currentVertexArrayObject.elementArrayBuffer=o;break;default:}return n.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(a,o){var s=r.currentVertexArrayObject,u=s.attribs[a];switch(o){case 34975:return u.buffer;case 34338:return u.enabled;case 34339:return u.size;case 34340:return u.stride;case 34341:return u.type;case 34922:return u.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(a,o,s,u,f,c){var l=r.currentVertexArrayObject;l.maxAttrib=Math.max(l.maxAttrib,a);var d=l.attribs[a];return d.buffer=r.currentArrayBuffer,d.size=o,d.type=s,d.normalized=u,d.stride=f,d.offset=c,d.recache(),n.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",function(){GF("OESVertexArrayObject emulation library context restored"),r.reset_()},!0),this.reset_()};rn.prototype.VERTEX_ARRAY_BINDING_OES=34229;rn.prototype.reset_=function(){var t=this.vertexArrayObjects!==void 0;if(t)for(var r=0;r<this.vertexArrayObjects.length;++r)this.vertexArrayObjects.isAlive=!1;var n=this.gl;this.maxVertexAttribs=n.getParameter(34921),this.defaultVertexArrayObject=new na(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)};rn.prototype.createVertexArrayOES=function(){var t=new na(this);return this.vertexArrayObjects.push(t),t};rn.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)};rn.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof na&&t.hasBeenBound&&t.ext===this)};rn.prototype.bindVertexArrayOES=function(t){var r=this.gl;if(t&&!t.isAlive){NF(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");return}var n=this.original,i=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var a=this.currentVertexArrayObject;if(i!==a){(!i||a.elementArrayBuffer!==i.elementArrayBuffer)&&n.bindBuffer.call(r,34963,a.elementArrayBuffer);for(var o=this.currentArrayBuffer,s=Math.max(i?i.maxAttrib:0,a.maxAttrib),u=0;u<=s;u++){var f=a.attribs[u],c=i?i.attribs[u]:null;if((!i||f.enabled!==c.enabled)&&(f.enabled?n.enableVertexAttribArray.call(r,u):n.disableVertexAttribArray.call(r,u)),f.enabled){var l=!1;(!i||f.buffer!==c.buffer)&&(o!==f.buffer&&(n.bindBuffer.call(r,34962,f.buffer),o=f.buffer),l=!0),(l||f.cached!==c.cached)&&n.vertexAttribPointer.call(r,u,f.size,f.type,f.normalized,f.stride,f.offset)}}this.currentArrayBuffer!==o&&n.bindBuffer.call(r,34962,this.currentArrayBuffer)}};function Zb(e){if(typeof e.createVertexArray!="function"){var t=e.getSupportedExtensions;e.getSupportedExtensions=function(){var i=t.call(this)||[];return i.indexOf("OES_vertex_array_object")<0&&i.push("OES_vertex_array_object"),i};var r=e.getExtension;e.getExtension=function(i){var a=r.call(this,i);return a||(i!=="OES_vertex_array_object"?null:(e.__OESVertexArrayObject||(this.__OESVertexArrayObject=new rn(this)),this.__OESVertexArrayObject))}}}var K;function $(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Qb="OES_element_index",e_="WEBGL_draw_buffers",jF="EXT_disjoint_timer_query",kF="EXT_disjoint_timer_query_webgl2",HF="EXT_texture_filter_anisotropic",t_="WEBGL_debug_renderer_info",VF=35723,zF=4352,WF=36795,JF=34047,XF=37445,qF=37446,pe=function(t){return ne(t)?void 0:0},KF=(K={},$(K,3074,function(t){return ne(t)?void 0:36064}),$(K,VF,function(e){return ne(e)?void 0:zF}),$(K,35977,pe),$(K,32937,pe),$(K,WF,function(e,t){var r=ne(e)?e.getExtension(kF):e.getExtension(jF);return r&&r.GPU_DISJOINT_EXT?t(r.GPU_DISJOINT_EXT):0}),$(K,XF,function(e,t){var r=e.getExtension(t_);return t(r&&r.UNMASKED_VENDOR_WEBGL||7936)}),$(K,qF,function(e,t){var r=e.getExtension(t_);return t(r&&r.UNMASKED_RENDERER_WEBGL||7937)}),$(K,JF,function(e,t){var r=e.luma.extensions[HF];return r?t(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),$(K,32883,pe),$(K,35071,pe),$(K,37447,pe),$(K,36063,function(t,r){if(!ne(t)){var n=t.getExtension(e_);return n?r(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),$(K,35379,pe),$(K,35374,pe),$(K,35377,pe),$(K,34852,function(t){if(!ne(t)){var r=t.getExtension(e_);return r?r.MAX_DRAW_BUFFERS_WEBGL:0}}),$(K,36203,function(t){return t.getExtension(Qb)?2147483647:65535}),$(K,33001,function(t){return t.getExtension(Qb)?16777216:65535}),$(K,33e3,function(t){return 16777216}),$(K,37157,pe),$(K,35373,pe),$(K,35657,pe),$(K,36183,pe),$(K,37137,pe),$(K,34045,pe),$(K,35978,pe),$(K,35979,pe),$(K,35968,pe),$(K,35376,pe),$(K,35375,pe),$(K,35659,pe),$(K,37154,pe),$(K,35371,pe),$(K,35658,pe),$(K,35076,pe),$(K,35077,pe),$(K,35380,pe),K);function r_(e,t,r){var n=KF[r],i=typeof n=="function"?n(e,t,r):n,a=i!==void 0?i:t(r);return a}var qn;function Ws(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var YF="OES_vertex_array_object",n_="ANGLE_instanced_arrays",$F="WEBGL_draw_buffers",ZF="EXT_disjoint_timer_query",QF="EXT_texture_filter_anisotropic",eL="VertexArray requires WebGL2 or OES_vertex_array_object extension";function tL(e,t){return{webgl2:ne(e),ext:e.getExtension(t)}}var ch=(qn={},Ws(qn,YF,{meta:{suffix:"OES"},createVertexArray:function(){Oe(!1,eL)},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Ws(qn,n_,{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(t,r){Oe(r===0,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Ws(qn,$F,{meta:{suffix:"WEBGL"},drawBuffers:function(){Oe(!1)}}),Ws(qn,ZF,{meta:{suffix:"EXT"},createQuery:function(){Oe(!1)},deleteQuery:function(){Oe(!1)},beginQuery:function(){Oe(!1)},endQuery:function(){},getQuery:function(t,r){return this.getQueryObject(t,r)},getQueryParameter:function(t,r){return this.getQueryObject(t,r)},getQueryObject:function(){}}),qn),Js={readBuffer:function(t,r,n){ne(t)&&r(n)},getVertexAttrib:function(t,r,n,i){var a=tL(t,n_),o=a.webgl2,s=a.ext,u;switch(i){case 35069:u=o?void 0:!1;break;case 35070:u=!o&&!s?0:void 0;break;default:}return u!==void 0?u:r(n,i)},getProgramParameter:function(t,r,n,i){if(!ne(t))switch(i){case 35967:return 35981;case 35971:return 0;case 35382:return 0;default:}return r(n,i)},getInternalformatParameter:function(t,r,n,i,a){if(!ne(t))switch(a){case 32937:return new Int32Array([0]);default:}return t.getInternalformatParameter(n,i,a)},getTexParameter:function(t,r,n,i){switch(i){case 34046:var a=t.luma.extensions,o=a[QF];i=o&&o.TEXTURE_MAX_ANISOTROPY_EXT||34046;break;default:}return r(n,i)},getParameter:r_,hint:function(t,r,n,i){return r(n,i)}};function a_(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=rL(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
65
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function rL(e,t){if(e){if(typeof e=="string")return i_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i_(e,t)}}function i_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o_(e){e.luma=e.luma||{};var t=e.luma;return t.polyfilled||(Zb(e),nL(e),aL(e,ch),iL(e,{target:t,target2:e}),t.polyfilled=!0),e}globalThis.polyfillContext=o_;function nL(e){e.luma.extensions={};var t=e.getSupportedExtensions()||[],r=a_(t),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;e.luma[i]=e.getExtension(i)}}catch(a){r.e(a)}finally{r.f()}}function iL(e,t){var r=t.target,n=t.target2;Object.keys(Js).forEach(function(i){if(typeof Js[i]=="function"){var a=e[i]?e[i].bind(e):function(){},o=Js[i].bind(null,e,a);r[i]=o,n[i]=o}})}function aL(e,t){var r=a_(Object.getOwnPropertyNames(t)),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i!=="overrides"&&oL(e,{extension:i,target:e.luma,target2:e})}}catch(a){r.e(a)}finally{r.f()}}function oL(e,t){var r=t.extension,n=t.target,i=t.target2,a=ch[r];Oe(a);for(var o=a.meta,s=o===void 0?{}:o,u=s.suffix,f=u===void 0?"":u,c=e.getExtension(r),l=function(){var m=h[d],g="".concat(m).concat(f),y=null;m==="meta"||typeof e[m]=="function"||(c&&typeof c[g]=="function"?y=function(){return c[g].apply(c,arguments)}:typeof a[m]=="function"&&(y=a[m].bind(n))),y&&(n[m]=y,i[m]=y)},d=0,h=Object.keys(a);d<h.length;d++)l()}var G,F,at;function lh(e,t){return fL(e)||uL(e,t)||u_(e,t)||sL()}function sL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
66
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uL(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function fL(e){if(Array.isArray(e))return e}function Te(e){return hL(e)||lL(e)||u_(e)||cL()}function cL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
67
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u_(e,t){if(e){if(typeof e=="string")return hh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hh(e,t)}}function lL(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hL(e){if(Array.isArray(e))return hh(e)}function hh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Xs=(G={},T(G,3042,!1),T(G,32773,new Float32Array([0,0,0,0])),T(G,32777,32774),T(G,34877,32774),T(G,32969,1),T(G,32968,0),T(G,32971,1),T(G,32970,0),T(G,3106,new Float32Array([0,0,0,0])),T(G,3107,[!0,!0,!0,!0]),T(G,2884,!1),T(G,2885,1029),T(G,2929,!1),T(G,2931,1),T(G,2932,513),T(G,2928,new Float32Array([0,1])),T(G,2930,!0),T(G,3024,!0),T(G,36006,null),T(G,2886,2305),T(G,33170,4352),T(G,2849,1),T(G,32823,!1),T(G,32824,0),T(G,10752,0),T(G,32938,1),T(G,32939,!1),T(G,3089,!1),T(G,3088,new Int32Array([0,0,1024,1024])),T(G,2960,!1),T(G,2961,0),T(G,2968,4294967295),T(G,36005,4294967295),T(G,2962,519),T(G,2967,0),T(G,2963,4294967295),T(G,34816,519),T(G,36003,0),T(G,36004,4294967295),T(G,2964,7680),T(G,2965,7680),T(G,2966,7680),T(G,34817,7680),T(G,34818,7680),T(G,34819,7680),T(G,2978,[0,0,1024,1024]),T(G,3333,4),T(G,3317,4),T(G,37440,!1),T(G,37441,!1),T(G,37443,37444),T(G,35723,4352),T(G,36010,null),T(G,35977,!1),T(G,3330,0),T(G,3332,0),T(G,3331,0),T(G,3314,0),T(G,32878,0),T(G,3316,0),T(G,3315,0),T(G,32877,0),G),Ar=function(t,r,n){return r?t.enable(n):t.disable(n)},s_=function(t,r,n){return t.hint(n,r)},Ye=function(t,r,n){return t.pixelStorei(n,r)},dL=function(t,r){var n=ne(t)?36009:36160;return t.bindFramebuffer(n,r)},pL=function(t,r){return t.bindFramebuffer(36008,r)};function ia(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var f_=(F={},T(F,3042,Ar),T(F,32773,function(t,r){return t.blendColor.apply(t,Te(r))}),T(F,32777,"blendEquation"),T(F,34877,"blendEquation"),T(F,32969,"blendFunc"),T(F,32968,"blendFunc"),T(F,32971,"blendFunc"),T(F,32970,"blendFunc"),T(F,3106,function(t,r){return t.clearColor.apply(t,Te(r))}),T(F,3107,function(t,r){return t.colorMask.apply(t,Te(r))}),T(F,2884,Ar),T(F,2885,function(t,r){return t.cullFace(r)}),T(F,2929,Ar),T(F,2931,function(t,r){return t.clearDepth(r)}),T(F,2932,function(t,r){return t.depthFunc(r)}),T(F,2928,function(t,r){return t.depthRange.apply(t,Te(r))}),T(F,2930,function(t,r){return t.depthMask(r)}),T(F,3024,Ar),T(F,35723,s_),T(F,36006,dL),T(F,2886,function(t,r){return t.frontFace(r)}),T(F,33170,s_),T(F,2849,function(t,r){return t.lineWidth(r)}),T(F,32823,Ar),T(F,32824,"polygonOffset"),T(F,10752,"polygonOffset"),T(F,35977,Ar),T(F,32938,"sampleCoverage"),T(F,32939,"sampleCoverage"),T(F,3089,Ar),T(F,3088,function(t,r){return t.scissor.apply(t,Te(r))}),T(F,2960,Ar),T(F,2961,function(t,r){return t.clearStencil(r)}),T(F,2968,function(t,r){return t.stencilMaskSeparate(1028,r)}),T(F,36005,function(t,r){return t.stencilMaskSeparate(1029,r)}),T(F,2962,"stencilFuncFront"),T(F,2967,"stencilFuncFront"),T(F,2963,"stencilFuncFront"),T(F,34816,"stencilFuncBack"),T(F,36003,"stencilFuncBack"),T(F,36004,"stencilFuncBack"),T(F,2964,"stencilOpFront"),T(F,2965,"stencilOpFront"),T(F,2966,"stencilOpFront"),T(F,34817,"stencilOpBack"),T(F,34818,"stencilOpBack"),T(F,34819,"stencilOpBack"),T(F,2978,function(t,r){return t.viewport.apply(t,Te(r))}),T(F,3333,Ye),T(F,3317,Ye),T(F,37440,Ye),T(F,37441,Ye),T(F,37443,Ye),T(F,3330,Ye),T(F,3332,Ye),T(F,3331,Ye),T(F,36010,pL),T(F,3314,Ye),T(F,32878,Ye),T(F,3316,Ye),T(F,3315,Ye),T(F,32877,Ye),T(F,"framebuffer",function(t,r){var n=r&&"handle"in r?r.handle:r;return t.bindFramebuffer(36160,n)}),T(F,"blend",function(t,r){return r?t.enable(3042):t.disable(3042)}),T(F,"blendColor",function(t,r){return t.blendColor.apply(t,Te(r))}),T(F,"blendEquation",function(t,r){r=ia(r)?r:[r,r],t.blendEquationSeparate.apply(t,Te(r))}),T(F,"blendFunc",function(t,r){r=ia(r)&&r.length===2?[].concat(Te(r),Te(r)):r,t.blendFuncSeparate.apply(t,Te(r))}),T(F,"clearColor",function(t,r){return t.clearColor.apply(t,Te(r))}),T(F,"clearDepth",function(t,r){return t.clearDepth(r)}),T(F,"clearStencil",function(t,r){return t.clearStencil(r)}),T(F,"colorMask",function(t,r){return t.colorMask.apply(t,Te(r))}),T(F,"cull",function(t,r){return r?t.enable(2884):t.disable(2884)}),T(F,"cullFace",function(t,r){return t.cullFace(r)}),T(F,"depthTest",function(t,r){return r?t.enable(2929):t.disable(2929)}),T(F,"depthFunc",function(t,r){return t.depthFunc(r)}),T(F,"depthMask",function(t,r){return t.depthMask(r)}),T(F,"depthRange",function(t,r){return t.depthRange.apply(t,Te(r))}),T(F,"dither",function(t,r){return r?t.enable(3024):t.disable(3024)}),T(F,"derivativeHint",function(t,r){t.hint(35723,r)}),T(F,"frontFace",function(t,r){return t.frontFace(r)}),T(F,"mipmapHint",function(t,r){return t.hint(33170,r)}),T(F,"lineWidth",function(t,r){return t.lineWidth(r)}),T(F,"polygonOffsetFill",function(t,r){return r?t.enable(32823):t.disable(32823)}),T(F,"polygonOffset",function(t,r){return t.polygonOffset.apply(t,Te(r))}),T(F,"sampleCoverage",function(t,r){return t.sampleCoverage.apply(t,Te(r))}),T(F,"scissorTest",function(t,r){return r?t.enable(3089):t.disable(3089)}),T(F,"scissor",function(t,r){return t.scissor.apply(t,Te(r))}),T(F,"stencilTest",function(t,r){return r?t.enable(2960):t.disable(2960)}),T(F,"stencilMask",function(t,r){r=ia(r)?r:[r,r];var n=r,i=lh(n,2),a=i[0],o=i[1];t.stencilMaskSeparate(1028,a),t.stencilMaskSeparate(1029,o)}),T(F,"stencilFunc",function(t,r){r=ia(r)&&r.length===3?[].concat(Te(r),Te(r)):r;var n=r,i=lh(n,6),a=i[0],o=i[1],s=i[2],u=i[3],f=i[4],c=i[5];t.stencilFuncSeparate(1028,a,o,s),t.stencilFuncSeparate(1029,u,f,c)}),T(F,"stencilOp",function(t,r){r=ia(r)&&r.length===3?[].concat(Te(r),Te(r)):r;var n=r,i=lh(n,6),a=i[0],o=i[1],s=i[2],u=i[3],f=i[4],c=i[5];t.stencilOpSeparate(1028,a,o,s),t.stencilOpSeparate(1029,u,f,c)}),T(F,"viewport",function(t,r){return t.viewport.apply(t,Te(r))}),F);function Se(e,t,r){return t[e]!==void 0?t[e]:r[e]}var c_={blendEquation:function(t,r,n){return t.blendEquationSeparate(Se(32777,r,n),Se(34877,r,n))},blendFunc:function(t,r,n){return t.blendFuncSeparate(Se(32969,r,n),Se(32968,r,n),Se(32971,r,n),Se(32970,r,n))},polygonOffset:function(t,r,n){return t.polygonOffset(Se(32824,r,n),Se(10752,r,n))},sampleCoverage:function(t,r,n){return t.sampleCoverage(Se(32938,r,n),Se(32939,r,n))},stencilFuncFront:function(t,r,n){return t.stencilFuncSeparate(1028,Se(2962,r,n),Se(2967,r,n),Se(2963,r,n))},stencilFuncBack:function(t,r,n){return t.stencilFuncSeparate(1029,Se(34816,r,n),Se(36003,r,n),Se(36004,r,n))},stencilOpFront:function(t,r,n){return t.stencilOpSeparate(1028,Se(2964,r,n),Se(2965,r,n),Se(2966,r,n))},stencilOpBack:function(t,r,n){return t.stencilOpSeparate(1029,Se(34817,r,n),Se(34818,r,n),Se(34819,r,n))}},dh={enable:function(t,r){return t(T({},r,!0))},disable:function(t,r){return t(T({},r,!1))},pixelStorei:function(t,r,n){return t(T({},r,n))},hint:function(t,r,n){return t(T({},r,n))},bindFramebuffer:function(t,r,n){var i;switch(r){case 36160:return t((i={},T(i,36006,n),T(i,36010,n),i));case 36009:return t(T({},36006,n));case 36008:return t(T({},36010,n));default:return null}},blendColor:function(t,r,n,i,a){return t(T({},32773,new Float32Array([r,n,i,a])))},blendEquation:function(t,r){var n;return t((n={},T(n,32777,r),T(n,34877,r),n))},blendEquationSeparate:function(t,r,n){var i;return t((i={},T(i,32777,r),T(i,34877,n),i))},blendFunc:function(t,r,n){var i;return t((i={},T(i,32969,r),T(i,32968,n),T(i,32971,r),T(i,32970,n),i))},blendFuncSeparate:function(t,r,n,i,a){var o;return t((o={},T(o,32969,r),T(o,32968,n),T(o,32971,i),T(o,32970,a),o))},clearColor:function(t,r,n,i,a){return t(T({},3106,new Float32Array([r,n,i,a])))},clearDepth:function(t,r){return t(T({},2931,r))},clearStencil:function(t,r){return t(T({},2961,r))},colorMask:function(t,r,n,i,a){return t(T({},3107,[r,n,i,a]))},cullFace:function(t,r){return t(T({},2885,r))},depthFunc:function(t,r){return t(T({},2932,r))},depthRange:function(t,r,n){return t(T({},2928,new Float32Array([r,n])))},depthMask:function(t,r){return t(T({},2930,r))},frontFace:function(t,r){return t(T({},2886,r))},lineWidth:function(t,r){return t(T({},2849,r))},polygonOffset:function(t,r,n){var i;return t((i={},T(i,32824,r),T(i,10752,n),i))},sampleCoverage:function(t,r,n){var i;return t((i={},T(i,32938,r),T(i,32939,n),i))},scissor:function(t,r,n,i,a){return t(T({},3088,new Int32Array([r,n,i,a])))},stencilMask:function(t,r){var n;return t((n={},T(n,2968,r),T(n,36005,r),n))},stencilMaskSeparate:function(t,r,n){return t(T({},r===1028?2968:36005,n))},stencilFunc:function(t,r,n,i){var a;return t((a={},T(a,2962,r),T(a,2967,n),T(a,2963,i),T(a,34816,r),T(a,36003,n),T(a,36004,i),a))},stencilFuncSeparate:function(t,r,n,i,a){var o;return t((o={},T(o,r===1028?2962:34816,n),T(o,r===1028?2967:36003,i),T(o,r===1028?2963:36004,a),o))},stencilOp:function(t,r,n,i){var a;return t((a={},T(a,2964,r),T(a,2965,n),T(a,2966,i),T(a,34817,r),T(a,34818,n),T(a,34819,i),a))},stencilOpSeparate:function(t,r,n,i,a){var o;return t((o={},T(o,r===1028?2964:34817,n),T(o,r===1028?2965:34818,i),T(o,r===1028?2966:34819,a),o))},viewport:function(t,r,n,i,a){return t(T({},2978,[r,n,i,a]))}},Ft=function(t,r){return t.isEnabled(r)},ph=(at={},T(at,3042,Ft),T(at,2884,Ft),T(at,2929,Ft),T(at,3024,Ft),T(at,32823,Ft),T(at,32926,Ft),T(at,32928,Ft),T(at,3089,Ft),T(at,2960,Ft),T(at,35977,Ft),at);function mh(e){for(var t in e)return!1;return!0}function l_(e,t){if(e===t)return!0;var r=Array.isArray(e)||ArrayBuffer.isView(e),n=Array.isArray(t)||ArrayBuffer.isView(t);if(r&&n&&e.length===t.length){for(var i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}return!1}function mL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h_(e,t){var r=e[t].bind(e);e[t]=function(){var i=arguments.length<=0?void 0:arguments[0];return i in e.state.cache&&e.state.enable?e.state.cache[i]:r.apply(void 0,arguments)},Object.defineProperty(e[t],"name",{value:"".concat(t,"-from-cache"),configurable:!1})}function vL(e,t,r){var n=e[t].bind(e);e[t]=function(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];var u=r.apply(void 0,[e.state._updateCache].concat(o)),f=u.valueChanged,c=u.oldValue;return f&&n.apply(void 0,o),c},Object.defineProperty(e[t],"name",{value:"".concat(t,"-to-cache"),configurable:!1})}function gL(e){var t=e.useProgram.bind(e);e.useProgram=function(n){e.state.program!==n&&(t(n),e.state.program=n)}}var yL=function(){function e(r){mL(this,e);var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.copyState,a=i===void 0?!1:i,o=n.log,s=o===void 0?function(){}:o;this.gl=r,this.program=null,this.stateStack=[],this.enable=!0,this.cache=a?yh(r):Object.assign({},Xs),this.log=s,this._updateCache=this._updateCache.bind(this),Object.seal(this)}var t=e.prototype;return t.push=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.stateStack.push({})},t.pop=function(){Oe(this.stateStack.length>0);var n=this.stateStack[this.stateStack.length-1];Ks(this.gl,n),this.stateStack.pop()},t._updateCache=function(n){var i=!1,a,o=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var s in n){Oe(s!==void 0);var u=n[s],f=this.cache[s];l_(u,f)||(i=!0,a=f,o&&!(s in o)&&(o[s]=f),this.cache[s]=u)}return{valueChanged:i,oldValue:a}},e}();function vh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enable,n=r===void 0?!0:r,i=t.copyState;if(Oe(i!==void 0),!e.state){var a=globalThis.polyfillContext;a&&a(e),e.state=new yL(e,{copyState:i}),gL(e);for(var o in dh){var s=dh[o];vL(e,o,s)}h_(e,"getParameter"),h_(e,"isEnabled")}return e.state.enable=n,e}function gh(e){e.state||vh(e,{copyState:!1}),e.state.push()}function qs(e){Oe(e.state),e.state.pop()}function bL(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_L(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
68
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function _L(e,t){if(e){if(typeof e=="string")return d_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d_(e,t)}}function d_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ks(e,t){if(Oe(zs(e),"setParameters requires a WebGL context"),!mh(t)){var r={};for(var n in t){var i=Number(n),a=f_[n];a&&(typeof a=="string"?r[a]=!0:a(e,t[n],i))}var o=e.state&&e.state.cache;if(o)for(var s in r){var u=c_[s];u(e,t,o)}}}function yh(e,t){if(t=t||Xs,typeof t=="number"){var r=t,n=ph[r];return n?n(e,r):e.getParameter(r)}var i=Array.isArray(t)?t:Object.keys(t),a={},o=bL(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,f=ph[u];a[u]=f?f(e,Number(u)):e.getParameter(Number(u))}}catch(c){o.e(c)}finally{o.f()}return a}function Yt(e,t,r){if(mh(t))return r(e);var n=t.nocatch,i=n===void 0?!0:n;gh(e),Ks(e,t);var a;if(i)a=r(e),qs(e);else try{a=r(e)}finally{qs(e)}return a}var lY=Ue();function aa(){var e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){var t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}function AL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ys=function(){function e(r,n){AL(this,e),v(this,"name",void 0),v(this,"type",void 0),v(this,"sampleSize",1),v(this,"time",void 0),v(this,"count",void 0),v(this,"samples",void 0),v(this,"lastTiming",void 0),v(this,"lastSampleTime",void 0),v(this,"lastSampleCount",void 0),v(this,"_count",0),v(this,"_time",0),v(this,"_samples",0),v(this,"_startTime",0),v(this,"_timerPending",!1),this.name=r,this.type=n,this.reset()}var t=e.prototype;return t.setSampleSize=function(n){return this.sampleSize=n,this},t.incrementCount=function(){return this.addCount(1),this},t.decrementCount=function(){return this.subtractCount(1),this},t.addCount=function(n){return this._count+=n,this._samples++,this._checkSampling(),this},t.subtractCount=function(n){return this._count-=n,this._samples++,this._checkSampling(),this},t.addTime=function(n){return this._time+=n,this.lastTiming=n,this._samples++,this._checkSampling(),this},t.timeStart=function(){return this._startTime=aa(),this._timerPending=!0,this},t.timeEnd=function(){return this._timerPending?(this.addTime(aa()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this},t.getSampleAverageCount=function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0},t.getSampleAverageTime=function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0},t.getSampleHz=function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0},t.getAverageCount=function(){return this.samples>0?this.count/this.samples:0},t.getAverageTime=function(){return this.samples>0?this.time/this.samples:0},t.getHz=function(){return this.time>0?this.samples/(this.time/1e3):0},t.reset=function(){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},t._checkSampling=function(){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)},e}();function TL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function SL(e,t,r){return t&&p_(e.prototype,t),r&&p_(e,r),e}var bh=function(){function e(r){TL(this,e),v(this,"id",void 0),v(this,"stats",{}),this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}var t=e.prototype;return t.get=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:n,type:i})},t.reset=function(){for(var n in this.stats)this.stats[n].reset();return this},t.forEach=function(n){for(var i in this.stats)n(this.stats[i])},t.getTable=function(){var n={};return this.forEach(function(i){n[i.name]={time:i.time||0,count:i.count||0,average:i.getAverageTime()||0,hz:i.getHz()||0}}),n},t._initializeStats=function(){var n=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];i.forEach(function(a){return n._getOrCreate(a)})},t._getOrCreate=function(n){if(!n||!n.name)return null;var i=n.name,a=n.type;return this.stats[i]||(n instanceof Ys?this.stats[i]=n:this.stats[i]=new Ys(i,a)),this.stats[i]},SL(e,[{key:"size",get:function(){return Object.keys(this.stats).length}}]),e}();function wL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var oa="8.5.20",xL="set luma.log.level=1 (or higher) to trace rendering",EL=function(){function e(){wL(this,e),this.stats=new Map}var t=e.prototype;return t.get=function(n){return this.stats.has(n)||this.stats.set(n,new bh({id:n})),this.stats.get(n)},e}(),Kn=new EL;if(globalThis.luma&&globalThis.luma.VERSION!==oa)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(oa));globalThis.luma||(Ue()&&Q.log(1,"luma.gl ".concat(oa," - ").concat(xL))(),globalThis.luma=globalThis.luma||{VERSION:oa,version:oa,log:Q,stats:Kn,globals:{modules:{},nodeIO:{}}});var HY=globalThis.luma;function V(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function $s(e,t){if(typeof t!="string")return t;var r=Number(t);if(!isNaN(r))return r;t=t.replace(/^.*\./,"");var n=e[t];return V(n!==void 0,"Accessing undefined constant GL.".concat(t)),n}function nn(e,t){t=Number(t);for(var r in e)if(e[r]===t)return"GL.".concat(r);return String(t)}var _h={};function Zs(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";_h[e]=_h[e]||1;var t=_h[e]++;return"".concat(e,"-").concat(t)}function Ah(e){return V(typeof e=="number","Input must be a number"),e&&(e&e-1)===0}function m_(e,t,r,n){var i="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),a=Object.getPrototypeOf(e);n.forEach(function(o){a.methodName||(a[o]=function(){throw Q.removed("Calling removed method ".concat(t,".").concat(o,": "),i)(),new Error(o)})})}function OL(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=PL(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
69
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function PL(e,t){if(e){if(typeof e=="string")return v_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v_(e,t)}}function v_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function BL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function CL(e,t,r){return t&&g_(e.prototype,t),r&&g_(e,r),e}var Yn="Resource subclass must define virtual methods",Tr=function(e){function t(n){BL(this,t);var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ta(n);var a=i.id,o=i.userData,s=o===void 0?{}:o;this.gl=n,this.gl2=n,this.id=a||Zs(this[Symbol.toStringTag]),this.userData=s,this._bound=!1,this._handle=i.handle,this._handle===void 0&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}var r=t.prototype;return r.toString=function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")},r.delete=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=i.deleteChildren,o=a===void 0?!1:a,s=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,s&&o&&s.filter(Boolean).forEach(function(u){return u.delete()}),this},r.bind=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof i!="function")return this._bindHandle(i),this;var a;return this._bound?a=i():(this._bindHandle(this.handle),this._bound=!0,a=i(),this._bound=!1,this._bindHandle(null)),a},r.unbind=function(){this.bind(null)},r.getParameter=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};i=$s(this.gl,i),V(i);var o=this.constructor.PARAMETERS||{},s=o[i];if(s){var u=ne(this.gl),f=(!("webgl2"in s)||u)&&(!("extension"in s)||this.gl.getExtension(s.extension));if(!f){var c=s.webgl1,l="webgl2"in s?s.webgl2:s.webgl1,d=u?l:c;return d}}return this._getParameter(i,a)},r.getParameters=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=i.parameters,o=i.keys,s=this.constructor.PARAMETERS||{},u=ne(this.gl),f={},c=a||Object.keys(s),l=OL(c),d;try{for(l.s();!(d=l.n()).done;){var h=d.value,p=s[h],m=p&&(!("webgl2"in p)||u)&&(!("extension"in p)||this.gl.getExtension(p.extension));if(m){var g=o?nn(this.gl,h):h;f[g]=this.getParameter(h,i),o&&p.type==="GLenum"&&(f[g]=nn(this.gl,f[g]))}}}catch(y){l.e(y)}finally{l.f()}return f},r.setParameter=function(i,a){i=$s(this.gl,i),V(i);var o=this.constructor.PARAMETERS||{},s=o[i];if(s){var u=ne(this.gl),f=(!("webgl2"in s)||u)&&(!("extension"in s)||this.gl.getExtension(s.extension));if(!f)throw new Error("Parameter not available on this platform");s.type==="GLenum"&&(a=$s(a))}return this._setParameter(i,a),this},r.setParameters=function(i){for(var a in i)this.setParameter(a,i[a]);return this},r.stubRemovedMethods=function(i,a,o){return m_(this,i,a,o)},r.initialize=function(i){},r._createHandle=function(){throw new Error(Yn)},r._deleteHandle=function(){throw new Error(Yn)},r._bindHandle=function(i){throw new Error(Yn)},r._getOptsFromHandle=function(){throw new Error(Yn)},r._getParameter=function(i,a){throw new Error(Yn)},r._setParameter=function(i,a){throw new Error(Yn)},r._context=function(){return this.gl.luma=this.gl.luma||{},this.gl.luma},r._addStats=function(){var i=this[Symbol.toStringTag],a=Kn.get("Resource Counts");a.get("Resources Created").incrementCount(),a.get("".concat(i,"s Created")).incrementCount(),a.get("".concat(i,"s Active")).incrementCount()},r._removeStats=function(){var i=this[Symbol.toStringTag],a=Kn.get("Resource Counts");a.get("".concat(i,"s Active")).decrementCount()},r._trackAllocatedMemory=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag];this._trackAllocatedMemoryForContext(i,a),this._trackAllocatedMemoryForContext(i,a,this.gl.canvas&&this.gl.canvas.id),this.byteLength=i},r._trackAllocatedMemoryForContext=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",s=Kn.get("Memory Usage".concat(o));s.get("GPU Memory").addCount(i),s.get("".concat(a," Memory")).addCount(i)},r._trackDeallocatedMemory=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag];this._trackDeallocatedMemoryForContext(i),this._trackDeallocatedMemoryForContext(i,this.gl.canvas&&this.gl.canvas.id),this.byteLength=0},r._trackDeallocatedMemoryForContext=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=Kn.get("Memory Usage".concat(a));o.get("GPU Memory").subtractCount(this.byteLength),o.get("".concat(i," Memory")).subtractCount(this.byteLength)},CL(t,[{key:e,get:function(){return"Resource"}},{key:"handle",get:function(){return this._handle}}]),t}(Symbol.toStringTag);var ML="Failed to deduce GL constant from typed array";function sa(e){var t=ArrayBuffer.isView(e)?e.constructor:e;switch(t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(ML)}}function Sr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.clamped,n=r===void 0?!0:r;switch(e){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function y_(e){var t=e.data,r=e.width,n=e.height,i=e.bytesPerPixel,a=i===void 0?4:i,o=e.temp,s=r*a;o=o||new Uint8Array(s);for(var u=0;u<n/2;++u){var f=u*s,c=(n-u-1)*s;o.set(t.subarray(f,f+s)),t.copyWithin(f,c,c+s),t.set(o,c)}}function b_(e){for(var t=e.data,r=e.width,n=e.height,i=Math.round(r/2),a=Math.round(n/2),o=new Uint8Array(i*a*4),s=0;s<a;s++)for(var u=0;u<i;u++)for(var f=0;f<4;f++)o[(s*i+u)*4+f]=t[(s*2*r+u*2)*4+f];return{data:o,width:i,height:a}}function ua(e,t,r){var n=r.removedProps,i=n===void 0?{}:n,a=r.deprecatedProps,o=a===void 0?{}:a,s=r.replacedProps,u=s===void 0?{}:s;for(var f in i)if(f in t){var c=i[f],l=c?"".concat(e,".").concat(i[f]):"N/A";Q.removed("".concat(e,".").concat(f),l)()}for(var d in o)if(d in t){var h=o[d];Q.deprecated("".concat(e,".").concat(d),"".concat(e,".").concat(h))()}var p=null;for(var m in u)if(m in t){var g=u[m];Q.deprecated("".concat(e,".").concat(m),"".concat(e,".").concat(g))(),p=p||Object.assign({},t),p[g]=t[m],delete p[m]}return p||t}function Qs(e,t,r){return IL()?Qs=Reflect.construct:Qs=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),f=new u;return o&&Th(f,o.prototype),f},Qs.apply(null,arguments)}function IL(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Th(e,t){return Th=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Th(e,t)}function RL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function __(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function FL(e,t,r){return t&&__(e.prototype,t),r&&__(e,r),e}var LL={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},DL={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},an=function(){e.getBytesPerElement=function(n){var i=Sr(n.type||5126);return i.BYTES_PER_ELEMENT},e.getBytesPerVertex=function(n){V(n.size);var i=Sr(n.type||5126);return i.BYTES_PER_ELEMENT*n.size},e.resolve=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return Qs(e,[LL].concat(i))};function e(){var r=this;RL(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];i.forEach(function(o){return r._assign(o)}),Object.freeze(this)}var t=e.prototype;return t.toString=function(){return JSON.stringify(this)},t._assign=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return n=ua("Accessor",n,DL),n.type!==void 0&&(this.type=n.type,(n.type===5124||n.type===5125)&&(this.integer=!0)),n.size!==void 0&&(this.size=n.size),n.offset!==void 0&&(this.offset=n.offset),n.stride!==void 0&&(this.stride=n.stride),n.normalized!==void 0&&(this.normalized=n.normalized),n.integer!==void 0&&(this.integer=n.integer),n.divisor!==void 0&&(this.divisor=n.divisor),n.buffer!==void 0&&(this.buffer=n.buffer),n.index!==void 0&&(typeof n.index=="boolean"?this.index=n.index?1:0:this.index=n.index),n.instanced!==void 0&&(this.divisor=n.instanced?1:0),n.isInstanced!==void 0&&(this.divisor=n.isInstanced?1:0),this},FL(e,[{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}();function eu(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?eu=function(r){return typeof r}:eu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},eu(e)}function GL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function NL(e,t,r){return t&&A_(e.prototype,t),r&&A_(e,r),e}function UL(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Sh(e,t)}function Sh(e,t){return Sh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Sh(e,t)}function jL(e){var t=HL();return function(){var n=tu(e),i;if(t){var a=tu(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return kL(this,i)}}function kL(e,t){if(t&&(eu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return S_(e)}function S_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HL(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function tu(e){return tu=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},tu(e)}var T_=10,w_={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},VL={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:w_},zL={removedProps:w_},wh=function(e,t){UL(n,e);var r=jL(n);function n(a){var o;GL(this,n);var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=r.call(this,a,s),o.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),o.target=s.target||(o.gl.webgl2?36662:34962),o.initialize(s),Object.seal(S_(o)),o}var i=n.prototype;return i.getElementCount=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/an.getBytesPerElement(o))},i.getVertexCount=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/an.getBytesPerVertex(o))},i.initialize=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ArrayBuffer.isView(o)&&(o={data:o}),Number.isFinite(o)&&(o={byteLength:o}),o=ua("Buffer",o,VL),this.usage=o.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},o,o.accessor)),o.data?this._setData(o.data,o.offset,o.byteLength):this._setByteLength(o.byteLength||0),this},i.setProps=function(o){return o=ua("Buffer",o,zL),"accessor"in o&&this.setAccessor(o.accessor),this},i.setAccessor=function(o){return o=Object.assign({},o),delete o.buffer,this.accessor=new an(o),this},i.reallocate=function(o){return o>this.byteLength?(this._setByteLength(o),!0):(this.bytesUsed=o,!1)},i.setData=function(o){return this.initialize(o)},i.subData=function(o){ArrayBuffer.isView(o)&&(o={data:o});var s=o,u=s.data,f=s.offset,c=f===void 0?0:f,l=s.srcOffset,d=l===void 0?0:l,h=o.byteLength||o.length;V(u);var p=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(p,this.handle),d!==0||h!==void 0?(Me(this.gl),this.gl.bufferSubData(this.target,c,u,d,h)):this.gl.bufferSubData(p,c,u),this.gl.bindBuffer(p,null),this.debugData=null,this._inferType(u),this},i.copyData=function(o){var s=o.sourceBuffer,u=o.readOffset,f=u===void 0?0:u,c=o.writeOffset,l=c===void 0?0:c,d=o.size,h=this.gl;return Me(h),h.bindBuffer(36662,s.handle),h.bindBuffer(36663,this.handle),h.copyBufferSubData(36662,36663,f,l,d),h.bindBuffer(36662,null),h.bindBuffer(36663,null),this.debugData=null,this},i.getData=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.dstData,u=s===void 0?null:s,f=o.srcByteOffset,c=f===void 0?0:f,l=o.dstOffset,d=l===void 0?0:l,h=o.length,p=h===void 0?0:h;Me(this.gl);var m=Sr(this.accessor.type||5126,{clamped:!1}),g=this._getAvailableElementCount(c),y=d,b,A;u?(A=u.length,b=A-y):(b=Math.min(g,p||g),A=y+b);var S=Math.min(g,b);return p=p||S,V(p<=S),u=u||new m(A),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,c,u,d,p),this.gl.bindBuffer(36662,null),u},i.bind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.target,u=s===void 0?this.target:s,f=o.index,c=f===void 0?this.accessor&&this.accessor.index:f,l=o.offset,d=l===void 0?0:l,h=o.size;return u===35345||u===35982?h!==void 0?this.gl.bindBufferRange(u,c,this.handle,d,h):(V(d===0),this.gl.bindBufferBase(u,c,this.handle)):this.gl.bindBuffer(u,this.handle),this},i.unbind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.target,u=s===void 0?this.target:s,f=o.index,c=f===void 0?this.accessor&&this.accessor.index:f,l=u===35345||u===35982;return l?this.gl.bindBufferBase(u,c,null):this.gl.bindBuffer(u,null),this},i.getDebugData=function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(T_,this.byteLength)}),{data:this.debugData,changed:!0})},i.invalidateDebugData=function(){this.debugData=null},i._setData=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:o.byteLength+s;V(ArrayBuffer.isView(o)),this._trackDeallocatedMemory();var f=this._getTarget();this.gl.bindBuffer(f,this.handle),this.gl.bufferData(f,u,this.usage),this.gl.bufferSubData(f,s,o),this.gl.bindBuffer(f,null),this.debugData=o.slice(0,T_),this.bytesUsed=u,this._trackAllocatedMemory(u);var c=sa(o);return V(c),this.setAccessor(new an(this.accessor,{type:c})),this},i._setByteLength=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.usage;V(o>=0),this._trackDeallocatedMemory();var u=o;o===0&&(u=new Float32Array(0));var f=this._getTarget();return this.gl.bindBuffer(f,this.handle),this.gl.bufferData(f,u,s),this.gl.bindBuffer(f,null),this.usage=s,this.debugData=null,this.bytesUsed=o,this._trackAllocatedMemory(o),this},i._getTarget=function(){return this.gl.webgl2?36663:this.target},i._getAvailableElementCount=function(o){var s=Sr(this.accessor.type||5126,{clamped:!1}),u=o/s.BYTES_PER_ELEMENT;return this.getElementCount()-u},i._inferType=function(o){this.accessor.type||this.setAccessor(new an(this.accessor,{type:sa(o)}))},i._createHandle=function(){return this.gl.createBuffer()},i._deleteHandle=function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()},i._getParameter=function(o){this.gl.bindBuffer(this.target,this.handle);var s=this.gl.getBufferParameter(this.target,o);return this.gl.bindBuffer(this.target,null),s},i.setByteLength=function(o){return Q.deprecated("setByteLength","reallocate")(),this.reallocate(o)},i.updateAccessor=function(o){return Q.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new an(this.accessor,o),this},NL(n,[{key:t,get:function(){return"Buffer"}},{key:"type",get:function(){return Q.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return Q.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),n}(Tr,Symbol.toStringTag);var gt,je,Lt;function ce(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ru=(gt={},ce(gt,6407,{dataFormat:6407,types:[5121,33635]}),ce(gt,6408,{dataFormat:6408,types:[5121,32819,32820]}),ce(gt,6406,{dataFormat:6406,types:[5121]}),ce(gt,6409,{dataFormat:6409,types:[5121]}),ce(gt,6410,{dataFormat:6410,types:[5121]}),ce(gt,33326,{dataFormat:6403,types:[5126],gl2:!0}),ce(gt,33328,{dataFormat:33319,types:[5126],gl2:!0}),ce(gt,34837,{dataFormat:6407,types:[5126],gl2:!0}),ce(gt,34836,{dataFormat:6408,types:[5126],gl2:!0}),gt),x_=(je={},ce(je,6403,1),ce(je,36244,1),ce(je,33319,2),ce(je,33320,2),ce(je,6407,3),ce(je,36248,3),ce(je,6408,4),ce(je,36249,4),ce(je,6402,1),ce(je,34041,1),ce(je,6406,1),ce(je,6409,1),ce(je,6410,2),je),E_=(Lt={},ce(Lt,5126,4),ce(Lt,5125,4),ce(Lt,5124,4),ce(Lt,5123,2),ce(Lt,5122,2),ce(Lt,5131,2),ce(Lt,5120,1),ce(Lt,5121,1),Lt);function O_(e,t){var r=ru[t];if(!r)return!1;if(r.gl1===void 0&&r.gl2===void 0)return!0;var n=ne(e)&&r.gl2||r.gl1;return typeof n=="string"?e.getExtension(n):n}function P_(e,t){var r=ru[t];switch(r&&r.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}function nu(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?nu=function(r){return typeof r}:nu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},nu(e)}function WL(e,t){return qL(e)||XL(e,t)||I_(e,t)||JL()}function JL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
70
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XL(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function qL(e){if(Array.isArray(e))return e}function KL(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=I_(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
71
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function I_(e,t){if(e){if(typeof e=="string")return B_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B_(e,t)}}function B_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function YL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $L(e,t,r){return t&&C_(e.prototype,t),r&&C_(e,r),e}function ZL(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xh(e,t)}function xh(e,t){return xh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},xh(e,t)}function QL(e){var t=rD();return function(){var n=iu(e),i;if(t){var a=iu(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return eD(this,i)}}function eD(e,t){if(t&&(nu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tD(e)}function tD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function iu(e){return iu=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},iu(e)}var nD=[9729,9728],M_=globalThis.WebGLBuffer||function(){},Eh=function(e,t){ZL(n,e);var r=QL(n);n.isSupported=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=s.format,f=s.linearFiltering,c=!0;return u&&(c=c&&O_(o,u),c=c&&(!f||P_(o,u))),c};function n(a,o){var s;YL(this,n);var u=o.id,f=u===void 0?Zs("texture"):u,c=o.handle,l=o.target;return s=r.call(this,a,{id:f,handle:c}),s.target=l,s.textureUnit=void 0,s.loaded=!1,s.width=void 0,s.height=void 0,s.depth=void 0,s.format=void 0,s.type=void 0,s.dataFormat=void 0,s.border=void 0,s.textureUnit=void 0,s.mipmaps=void 0,s}var i=n.prototype;return i.toString=function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")},i.initialize=function(){var o=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=s.data;if(u instanceof Promise)return u.then(function(k){return o.initialize(Object.assign({},s,{pixels:k,data:k}))}),this;var f=typeof HTMLVideoElement<"u"&&u instanceof HTMLVideoElement;if(f&&u.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,u.addEventListener("loadeddata",function(){return o.initialize(s)}),this;var c=s.pixels,l=c===void 0?null:c,d=s.format,h=d===void 0?6408:d,p=s.border,m=p===void 0?0:p,g=s.recreate,y=g===void 0?!1:g,b=s.parameters,A=b===void 0?{}:b,S=s.pixelStore,O=S===void 0?{}:S,w=s.textureUnit,B=w===void 0?void 0:w;u||(u=l);var P=s.width,x=s.height,_=s.dataFormat,C=s.type,I=s.compressed,R=I===void 0?!1:I,M=s.mipmaps,D=M===void 0?!0:M,N=s.depth,j=N===void 0?0:N,U=this._deduceParameters({format:h,type:C,dataFormat:_,compressed:R,data:u,width:P,height:x});return P=U.width,x=U.height,R=U.compressed,_=U.dataFormat,C=U.type,this.width=P,this.height=x,this.depth=j,this.format=h,this.type=C,this.dataFormat=_,this.border=m,this.textureUnit=B,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),D&&this._isNPOT()&&(Q.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),D=!1,this._updateForNPOT(A)),this.mipmaps=D,this.setImageData({data:u,width:P,height:x,depth:j,format:h,type:C,dataFormat:_,border:m,mipmaps:D,parameters:O,compressed:R}),D&&this.generateMipmap(),this.setParameters(A),y&&(this.data=u),f&&(this._video={video:u,parameters:A,lastTime:u.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?u.currentTime:-1}),this},i.update=function(){if(this._video){var o=this._video,s=o.video,u=o.parameters,f=o.lastTime;if(f===s.currentTime||s.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:s,parameters:u}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=s.currentTime}},i.resize=function(o){var s=o.height,u=o.width,f=o.mipmaps,c=f===void 0?!1:f;return u!==this.width||s!==this.height?this.initialize({width:u,height:s,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:c}):this},i.generateMipmap=function(){var o=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._isNPOT()?(Q.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Yt(this.gl,s,function(){o.gl.generateMipmap(o.target)}),this.gl.bindTexture(this.target,null),this)},i.setImageData=function(o){this._trackDeallocatedMemory("Texture");var s=o.target,u=s===void 0?this.target:s,f=o.pixels,c=f===void 0?null:f,l=o.level,d=l===void 0?0:l,h=o.format,p=h===void 0?this.format:h,m=o.border,g=m===void 0?this.border:m,y=o.offset,b=y===void 0?0:y,A=o.parameters,S=A===void 0?{}:A,O=o.data,w=O===void 0?null:O,B=o.type,P=B===void 0?this.type:B,x=o.width,_=x===void 0?this.width:x,C=o.height,I=C===void 0?this.height:C,R=o.dataFormat,M=R===void 0?this.dataFormat:R,D=o.compressed,N=D===void 0?!1:D;w||(w=c);var j=this._deduceParameters({format:p,type:P,dataFormat:M,compressed:N,data:w,width:_,height:I});P=j.type,M=j.dataFormat,N=j.compressed,_=j.width,I=j.height;var U=this.gl;U.bindTexture(this.target,this.handle);var k=null,H=this._getDataType({data:w,compressed:N});w=H.data,k=H.dataType;var W,re=0;if(Yt(this.gl,S,function(){switch(k){case"null":U.texImage2D(u,d,p,_,I,g,M,P,w);break;case"typed-array":U.texImage2D(u,d,p,_,I,g,M,P,w,b);break;case"buffer":W=Me(U),W.bindBuffer(35052,w.handle||w),W.texImage2D(u,d,p,_,I,g,M,P,b),W.bindBuffer(35052,null);break;case"browser-object":ne(U)?U.texImage2D(u,d,p,_,I,g,M,P,w):U.texImage2D(u,d,p,M,P,w);break;case"compressed":var ct=KL(w.entries()),Tt;try{for(ct.s();!(Tt=ct.n()).done;){var kt=WL(Tt.value,2),St=kt[0],et=kt[1];U.compressedTexImage2D(u,St,et.format,et.width,et.height,g,et.data),re+=et.levelSize}}catch(Sn){ct.e(Sn)}finally{ct.f()}break;default:V(!1,"Unknown image data type")}}),k==="compressed")this._trackAllocatedMemory(re,"Texture");else if(w&&w.byteLength)this._trackAllocatedMemory(w.byteLength,"Texture");else{var De=x_[this.dataFormat]||4,At=E_[this.type]||1;this._trackAllocatedMemory(this.width*this.height*De*At,"Texture")}return this.loaded=!0,this},i.setSubImageData=function(o){var s=this,u=o.target,f=u===void 0?this.target:u,c=o.pixels,l=c===void 0?null:c,d=o.data,h=d===void 0?null:d,p=o.x,m=p===void 0?0:p,g=o.y,y=g===void 0?0:g,b=o.width,A=b===void 0?this.width:b,S=o.height,O=S===void 0?this.height:S,w=o.level,B=w===void 0?0:w,P=o.format,x=P===void 0?this.format:P,_=o.type,C=_===void 0?this.type:_,I=o.dataFormat,R=I===void 0?this.dataFormat:I,M=o.compressed,D=M===void 0?!1:M,N=o.offset,j=N===void 0?0:N,U=o.border,k=U===void 0?this.border:U,H=o.parameters,W=H===void 0?{}:H,re=this._deduceParameters({format:x,type:C,dataFormat:R,compressed:D,data:h,width:A,height:O});if(C=re.type,R=re.dataFormat,D=re.compressed,A=re.width,O=re.height,V(this.depth===0,"texSubImage not supported for 3D textures"),h||(h=l),h&&h.data){var De=h;h=De.data,A=De.shape[0],O=De.shape[1]}h instanceof wh&&(h=h.handle),this.gl.bindTexture(this.target,this.handle),Yt(this.gl,W,function(){if(D)s.gl.compressedTexSubImage2D(f,B,m,y,A,O,x,h);else if(h===null)s.gl.texSubImage2D(f,B,m,y,A,O,R,C,null);else if(ArrayBuffer.isView(h))s.gl.texSubImage2D(f,B,m,y,A,O,R,C,h,j);else if(h instanceof M_){var At=Me(s.gl);At.bindBuffer(35052,h),At.texSubImage2D(f,B,m,y,A,O,R,C,j),At.bindBuffer(35052,null)}else if(ne(s.gl)){var ct=Me(s.gl);ct.texSubImage2D(f,B,m,y,A,O,R,C,h)}else s.gl.texSubImage2D(f,B,m,y,R,C,h)}),this.gl.bindTexture(this.target,null)},i.copyFramebuffer=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Q.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null},i.getActiveUnit=function(){return this.gl.getParameter(34016)-33984},i.bind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,s=this.gl;return o!==void 0&&(this.textureUnit=o,s.activeTexture(33984+o)),s.bindTexture(this.target,this.handle),o},i.unbind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,s=this.gl;return o!==void 0&&(this.textureUnit=o,s.activeTexture(33984+o)),s.bindTexture(this.target,null),o},i._getDataType=function(o){var s=o.data,u=o.compressed,f=u===void 0?!1:u;return f?{data:s,dataType:"compressed"}:s===null?{data:s,dataType:"null"}:ArrayBuffer.isView(s)?{data:s,dataType:"typed-array"}:s instanceof wh?{data:s.handle,dataType:"buffer"}:s instanceof M_?{data:s,dataType:"buffer"}:{data:s,dataType:"browser-object"}},i._deduceParameters=function(o){var s=o.format,u=o.data,f=o.width,c=o.height,l=o.dataFormat,d=o.type,h=o.compressed,p=ru[s];l=l||p&&p.dataFormat,d=d||p&&p.types[0],h=h||p&&p.compressed;var m=this._deduceImageSize(u,f,c);return f=m.width,c=m.height,{dataFormat:l,type:d,compressed:h,width:f,height:c,format:s,data:u}},i._deduceImageSize=function(o,s,u){var f;return typeof ImageData<"u"&&o instanceof ImageData?f={width:o.width,height:o.height}:typeof HTMLImageElement<"u"&&o instanceof HTMLImageElement?f={width:o.naturalWidth,height:o.naturalHeight}:typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement?f={width:o.width,height:o.height}:typeof ImageBitmap<"u"&&o instanceof ImageBitmap?f={width:o.width,height:o.height}:typeof HTMLVideoElement<"u"&&o instanceof HTMLVideoElement?f={width:o.videoWidth,height:o.videoHeight}:o?f={width:s,height:u}:f={width:s>=0?s:1,height:u>=0?u:1},V(f,"Could not deduced texture size"),V(s===void 0||f.width===s,"Deduced texture width does not match supplied width"),V(u===void 0||f.height===u,"Deduced texture height does not match supplied height"),f},i._createHandle=function(){return this.gl.createTexture()},i._deleteHandle=function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")},i._getParameter=function(o){switch(o){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var s=this.gl.getTexParameter(this.target,o);return this.gl.bindTexture(this.target,null),s}},i._setParameter=function(o,s){switch(this.gl.bindTexture(this.target,this.handle),s=this._getNPOTParam(o,s),o){case 33082:case 33083:this.gl.texParameterf(this.handle,o,s);break;case 4096:case 4097:V(!1);break;default:this.gl.texParameteri(this.target,o,s);break}return this.gl.bindTexture(this.target,null),this},i._isNPOT=function(){return ne(this.gl)||!this.width||!this.height?!1:!Ah(this.width)||!Ah(this.height)},i._updateForNPOT=function(o){o[this.gl.TEXTURE_MIN_FILTER]===void 0&&(o[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),o[this.gl.TEXTURE_WRAP_S]===void 0&&(o[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),o[this.gl.TEXTURE_WRAP_T]===void 0&&(o[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)},i._getNPOTParam=function(o,s){if(this._isNPOT())switch(o){case 10241:nD.indexOf(s)===-1&&(s=9729);break;case 10242:case 10243:s!==33071&&(s=33071);break;default:break}return s},$L(n,[{key:t,get:function(){return"Texture"}}]),n}(Tr,Symbol.toStringTag);var iD="";function R_(e,t){return V(typeof e=="string"),e=iD+e,new Promise(function(r,n){try{var i=new Image;i.onload=function(){return r(i)},i.onerror=function(){return n(new Error("Could not load image ".concat(e,".")))},i.crossOrigin=t&&t.crossOrigin||"anonymous",i.src=e}catch(a){n(a)}})}function au(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?au=function(r){return typeof r}:au=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},au(e)}function aD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function oD(e,t,r){return t&&F_(e.prototype,t),r&&F_(e,r),e}function sD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Oh(e,t)}function Oh(e,t){return Oh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Oh(e,t)}function uD(e){var t=cD();return function(){var n=ou(e),i;if(t){var a=ou(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return fD(this,i)}}function fD(e,t){if(t&&(au(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return L_(e)}function L_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ou(e){return ou=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ou(e)}var on=function(e,t){sD(n,e);var r=uD(n);n.isSupported=function(a,o){return Eh.isSupported(a,o)};function n(i){var a;aD(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ta(i),(o instanceof Promise||typeof o=="string")&&(o={data:o}),typeof o.data=="string"&&(o=Object.assign({},o,{data:R_(o.data)})),a=r.call(this,i,Object.assign({},o,{target:3553})),a.initialize(o),Object.seal(L_(a)),a}return oD(n,[{key:t,get:function(){return"Texture2D"}}]),n}(Eh,Symbol.toStringTag);var z;function X(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var sn="EXT_color_buffer_float",Ph=(z={},X(z,33189,{bpp:2}),X(z,33190,{gl2:!0,bpp:3}),X(z,36012,{gl2:!0,bpp:4}),X(z,36168,{bpp:1}),X(z,34041,{bpp:4}),X(z,35056,{gl2:!0,bpp:4}),X(z,36013,{gl2:!0,bpp:5}),X(z,32854,{bpp:2}),X(z,36194,{bpp:2}),X(z,32855,{bpp:2}),X(z,33321,{gl2:!0,bpp:1}),X(z,33330,{gl2:!0,bpp:1}),X(z,33329,{gl2:!0,bpp:1}),X(z,33332,{gl2:!0,bpp:2}),X(z,33331,{gl2:!0,bpp:2}),X(z,33334,{gl2:!0,bpp:4}),X(z,33333,{gl2:!0,bpp:4}),X(z,33323,{gl2:!0,bpp:2}),X(z,33336,{gl2:!0,bpp:2}),X(z,33335,{gl2:!0,bpp:2}),X(z,33338,{gl2:!0,bpp:4}),X(z,33337,{gl2:!0,bpp:4}),X(z,33340,{gl2:!0,bpp:8}),X(z,33339,{gl2:!0,bpp:8}),X(z,32849,{gl2:!0,bpp:3}),X(z,32856,{gl2:!0,bpp:4}),X(z,32857,{gl2:!0,bpp:4}),X(z,36220,{gl2:!0,bpp:4}),X(z,36238,{gl2:!0,bpp:4}),X(z,36975,{gl2:!0,bpp:4}),X(z,36214,{gl2:!0,bpp:8}),X(z,36232,{gl2:!0,bpp:8}),X(z,36226,{gl2:!0,bpp:16}),X(z,36208,{gl2:!0,bpp:16}),X(z,33325,{gl2:sn,bpp:2}),X(z,33327,{gl2:sn,bpp:4}),X(z,34842,{gl2:sn,bpp:8}),X(z,33326,{gl2:sn,bpp:4}),X(z,33328,{gl2:sn,bpp:8}),X(z,34836,{gl2:sn,bpp:16}),X(z,35898,{gl2:sn,bpp:4}),z);function su(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?su=function(r){return typeof r}:su=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},su(e)}function lD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hD(e,t,r){return t&&D_(e.prototype,t),r&&D_(e,r),e}function dD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bh(e,t)}function Bh(e,t){return Bh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Bh(e,t)}function pD(e){var t=vD();return function(){var n=uu(e),i;if(t){var a=uu(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return mD(this,i)}}function mD(e,t){if(t&&(su(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return G_(e)}function G_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function uu(e){return uu=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},uu(e)}function gD(e,t,r){var n=r[t];if(!n)return!1;var i=ne(e)&&n.gl2||n.gl1;return typeof i=="string"?e.getExtension(i):i}var fa=function(e,t){dD(n,e);var r=pD(n);n.isSupported=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{format:null},u=s.format;return!u||gD(o,u,Ph)},n.getSamplesForFormat=function(o,s){var u=s.format;return o.getInternalformatParameter(36161,u,32937)};function n(a){var o;lD(this,n);var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=r.call(this,a,s),o.initialize(s),Object.seal(G_(o)),o}var i=n.prototype;return i.initialize=function(o){var s=o.format,u=o.width,f=u===void 0?1:u,c=o.height,l=c===void 0?1:c,d=o.samples,h=d===void 0?0:d;return V(s,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),h!==0&&ne(this.gl)?this.gl.renderbufferStorageMultisample(36161,h,s,f,l):this.gl.renderbufferStorage(36161,s,f,l),this.format=s,this.width=f,this.height=l,this.samples=h,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Ph[this.format].bpp),this},i.resize=function(o){var s=o.width,u=o.height;return s!==this.width||u!==this.height?this.initialize({width:s,height:u,format:this.format,samples:this.samples}):this},i._createHandle=function(){return this.gl.createRenderbuffer()},i._deleteHandle=function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()},i._bindHandle=function(o){this.gl.bindRenderbuffer(36161,o)},i._syncHandle=function(o){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)},i._getParameter=function(o){this.gl.bindRenderbuffer(36161,this.handle);var s=this.gl.getRenderbufferParameter(36161,o);return s},hD(n,[{key:t,get:function(){return"Renderbuffer"}}]),n}(Tr,Symbol.toStringTag);function yD(e,t){return TD(e)||AD(e,t)||_D(e,t)||bD()}function bD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
72
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _D(e,t){if(e){if(typeof e=="string")return N_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return N_(e,t)}}function N_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function AD(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function TD(e){if(Array.isArray(e))return e}var SD=256,wD=1024,xD=16384,U_=6144,j_=6145,k_=6146,H_=34041,V_="clear: bad arguments";function z_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.framebuffer,n=r===void 0?null:r,i=t.color,a=i===void 0?null:i,o=t.depth,s=o===void 0?null:o,u=t.stencil,f=u===void 0?null:u,c={};n&&(c.framebuffer=n);var l=0;a&&(l|=xD,a!==!0&&(c.clearColor=a)),s&&(l|=SD,s!==!0&&(c.clearDepth=s)),f&&(l|=wD,s!==!0&&(c.clearStencil=s)),V(l!==0,V_),Yt(e,c,function(){e.clear(l)})}function W_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.framebuffer,n=r===void 0?null:r,i=t.buffer,a=i===void 0?U_:i,o=t.drawBuffer,s=o===void 0?0:o,u=t.value,f=u===void 0?[0,0,0,0]:u;Me(e),Yt(e,{framebuffer:n},function(){switch(a){case U_:switch(f.constructor){case Int32Array:e.clearBufferiv(a,s,f);break;case Uint32Array:e.clearBufferuiv(a,s,f);break;case Float32Array:default:e.clearBufferfv(a,s,f)}break;case j_:e.clearBufferfv(j_,0,[f]);break;case k_:e.clearBufferiv(k_,0,[f]);break;case H_:var c=yD(f,2),l=c[0],d=c[1];e.clearBufferfi(H_,0,l,d);break;default:V(!1,V_)}})}function J_(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return V(!1),0}}function ED(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.sourceX,n=r===void 0?0:r,i=t.sourceY,a=i===void 0?0:i,o=t.sourceFormat,s=o===void 0?6408:o,u=t.sourceAttachment,f=u===void 0?36064:u,c=t.target,l=c===void 0?null:c,d=t.sourceWidth,h=t.sourceHeight,p=t.sourceType,m=OD(e),g=m.framebuffer,y=m.deleteFramebuffer;V(g);var b=g.gl,A=g.handle,S=g.attachments;d=d||g.width,h=h||g.height,f===36064&&A===null&&(f=1028),V(S[f]),p=p||S[f].type,l=PD(l,p,s,d,h),p=p||sa(l);var O=b.bindFramebuffer(36160,A);return b.readPixels(n,a,d,h,s,p,l),b.bindFramebuffer(36160,O||null),y&&g.delete(),l}function Ch(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.sourceAttachment,n=r===void 0?36064:r,i=t.targetMaxHeight,a=i===void 0?Number.MAX_SAFE_INTEGER:i,o=ED(e,{sourceAttachment:n}),s=e.width,u=e.height;u>a;){var f=b_({data:o,width:s,height:u});o=f.data,s=f.width,u=f.height}y_({data:o,width:s,height:u});var c=document.createElement("canvas");c.width=s,c.height=u;var l=c.getContext("2d"),d=l.createImageData(s,u);return d.data.set(o),l.putImageData(d,0,0),c.toDataURL()}function OD(e){return e instanceof wr?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:X_(e),deleteFramebuffer:!0}}function PD(e,t,r,n,i){if(e)return e;t=t||5121;var a=Sr(t,{clamped:!1}),o=J_(r);return new a(n*i*o)}var ge;function _e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ve={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};function BD(e){var t=new on(e,{format:6408,type:5126,dataFormat:6408}),r=new wr(e,{id:"test-framebuffer",check:!1,attachments:_e({},36064,t)}),n=r.getStatus();return t.delete(),r.delete(),n===36053}var Mh=(ge={},_e(ge,ve.WEBGL2,[!1,!0]),_e(ge,ve.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),_e(ge,ve.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),_e(ge,ve.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),_e(ge,ve.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),_e(ge,ve.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),_e(ge,ve.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),_e(ge,ve.FLOAT_BLEND,["EXT_float_blend"]),_e(ge,ve.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),_e(ge,ve.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),_e(ge,ve.TEXTURE_FLOAT,["OES_texture_float",!0]),_e(ge,ve.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),_e(ge,ve.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),_e(ge,ve.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),_e(ge,ve.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),_e(ge,ve.COLOR_ATTACHMENT_RGBA32F,[BD,"EXT_color_buffer_float"]),_e(ge,ve.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),_e(ge,ve.COLOR_ATTACHMENT_HALF_FLOAT,["EXT_color_buffer_half_float"]),_e(ge,ve.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),_e(ge,ve.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),_e(ge,ve.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),_e(ge,ve.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),ge);function CD(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=MD(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
73
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function MD(e,t){if(e){if(typeof e=="string")return q_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return q_(e,t)}}function q_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ID=2;function fu(e,t){return Ih(e,t)}function Ih(e,t){return t=Array.isArray(t)?t:[t],t.every(function(r){return K_(e,r)})}function cu(e){e.luma=e.luma||{},e.luma.caps=e.luma.caps||{};for(var t in Mh)e.luma.caps[t]===void 0&&(e.luma.caps[t]=K_(e,t));return e.luma.caps}function K_(e,t){return e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},e.luma.caps[t]===void 0&&(e.luma.caps[t]=RD(e,t)),e.luma.caps[t]||Q.log(ID,"Feature: ".concat(t," not supported"))(),e.luma.caps[t]}function RD(e,t){var r=Mh[t];V(r,t);var n,i=ne(e)&&r[1]||r[0];if(typeof i=="function")n=i(e);else if(Array.isArray(i)){n=!0;var a=CD(i),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;n=n&&Boolean(e.getExtension(s))}}catch(u){a.e(u)}finally{a.f()}}else typeof i=="string"?n=Boolean(e.getExtension(i)):typeof i=="boolean"?n=i:V(!1);return n}function hu(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?hu=function(r){return typeof r}:hu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},hu(e)}function lu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FD(e,t){return GD(e)||DD(e,t)||e1(e,t)||LD()}function LD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
74
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DD(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function GD(e){if(Array.isArray(e))return e}function Y_(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=e1(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
75
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function e1(e,t){if(e){if(typeof e=="string")return $_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $_(e,t)}}function $_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ND(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z_(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function UD(e,t,r){return t&&Z_(e.prototype,t),r&&Z_(e,r),e}function du(e,t,r){return typeof Reflect<"u"&&Reflect.get?du=Reflect.get:du=function(i,a,o){var s=jD(i,a);if(s){var u=Object.getOwnPropertyDescriptor(s,a);return u.get?u.get.call(o):u.value}},du(e,t,r||e)}function jD(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=$n(e),e!==null););return e}function kD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Rh(e,t)}function Rh(e,t){return Rh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Rh(e,t)}function HD(e){var t=zD();return function(){var n=$n(e),i;if(t){var a=$n(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return VD(this,i)}}function VD(e,t){if(t&&(hu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return t1(e)}function t1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $n(e){return $n=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},$n(e)}var Q_="Multiple render targets not supported",wr=function(e,t){kD(n,e);var r=HD(n);n.isSupported=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=s.colorBufferFloat,f=s.colorBufferHalfFloat,c=!0;return u&&(c=Boolean(o.getExtension("EXT_color_buffer_float")||o.getExtension("WEBGL_color_buffer_float")||o.getExtension("OES_texture_float"))),f&&(c=c&&Boolean(o.getExtension("EXT_color_buffer_float")||o.getExtension("EXT_color_buffer_half_float"))),c},n.getDefaultFramebuffer=function(o){return o.luma=o.luma||{},o.luma.defaultFramebuffer=o.luma.defaultFramebuffer||new n(o,{id:"default-framebuffer",handle:null,attachments:{}}),o.luma.defaultFramebuffer};function n(a){var o;ND(this,n);var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=r.call(this,a,s),o.width=null,o.height=null,o.attachments={},o.readBuffer=36064,o.drawBuffers=[36064],o.ownResources=[],o.initialize(s),Object.seal(t1(o)),o}var i=n.prototype;return i.initialize=function(o){var s=o.width,u=s===void 0?1:s,f=o.height,c=f===void 0?1:f,l=o.attachments,d=l===void 0?null:l,h=o.color,p=h===void 0?!0:h,m=o.depth,g=m===void 0?!0:m,y=o.stencil,b=y===void 0?!1:y,A=o.check,S=A===void 0?!0:A,O=o.readBuffer,w=O===void 0?void 0:O,B=o.drawBuffers,P=B===void 0?void 0:B;if(V(u>=0&&c>=0,"Width and height need to be integers"),this.width=u,this.height=c,d)for(var x in d){var _=d[x],C=Array.isArray(_)?_[0]:_;C.resize({width:u,height:c})}else d=this._createDefaultAttachments(p,g,b,u,c);this.update({clearAttachments:!0,attachments:d,readBuffer:w,drawBuffers:P}),d&&S&&this.checkStatus()},i.delete=function(){var o=Y_(this.ownResources),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;u.delete()}}catch(f){o.e(f)}finally{o.f()}return du($n(n.prototype),"delete",this).call(this),this},i.update=function(o){var s=o.attachments,u=s===void 0?{}:s,f=o.readBuffer,c=o.drawBuffers,l=o.clearAttachments,d=l===void 0?!1:l,h=o.resizeAttachments,p=h===void 0?!0:h;this.attach(u,{clearAttachments:d,resizeAttachments:p});var m=this.gl,g=m.bindFramebuffer(36160,this.handle);return f&&this._setReadBuffer(f),c&&this._setDrawBuffers(c),m.bindFramebuffer(36160,g||null),this},i.resize=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.width,u=o.height;if(this.handle===null)return V(s===void 0&&u===void 0),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;s===void 0&&(s=this.gl.drawingBufferWidth),u===void 0&&(u=this.gl.drawingBufferHeight),s!==this.width&&u!==this.height&&Q.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(s,"x").concat(u))();for(var f in this.attachments)this.attachments[f].resize({width:s,height:u});return this.width=s,this.height=u,this},i.attach=function(o){var s=this,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=u.clearAttachments,c=f===void 0?!1:f,l=u.resizeAttachments,d=l===void 0?!0:l,h={};c&&Object.keys(this.attachments).forEach(function(x){h[x]=null}),Object.assign(h,o);var p=this.gl.bindFramebuffer(36160,this.handle);for(var m in h){V(m!==void 0,"Misspelled framebuffer binding point?");var g=Number(m),y=h[g],b=y;if(!b)this._unattach(g);else if(b instanceof fa)this._attachRenderbuffer({attachment:g,renderbuffer:b});else if(Array.isArray(y)){var A=FD(y,3),S=A[0],O=A[1],w=O===void 0?0:O,B=A[2],P=B===void 0?0:B;b=S,this._attachTexture({attachment:g,texture:S,layer:w,level:P})}else this._attachTexture({attachment:g,texture:b,layer:0,level:0});d&&b&&b.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,p||null),Object.assign(this.attachments,o),Object.keys(this.attachments).filter(function(x){return!s.attachments[x]}).forEach(function(x){delete s.attachments[x]})},i.checkStatus=function(){var o=this.gl,s=this.getStatus();if(s!==36053)throw new Error(JD(s));return this},i.getStatus=function(){var o=this.gl,s=o.bindFramebuffer(36160,this.handle),u=o.checkFramebufferStatus(36160);return o.bindFramebuffer(36160,s||null),u},i.clear=function(){var o=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=s.color,f=s.depth,c=s.stencil,l=s.drawBuffers,d=l===void 0?[]:l,h=this.gl.bindFramebuffer(36160,this.handle);return(u||f||c)&&z_(this.gl,{color:u,depth:f,stencil:c}),d.forEach(function(p,m){W_(o.gl,{drawBuffer:m,value:p})}),this.gl.bindFramebuffer(36160,h||null),this},i.readPixels=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Q.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null},i.readPixelsToBuffer=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Q.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null},i.copyToDataUrl=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Q.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null},i.copyToImage=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Q.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null},i.copyToTexture=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Q.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null},i.blit=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Q.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null},i.invalidate=function(o){var s=o.attachments,u=s===void 0?[]:s,f=o.x,c=f===void 0?0:f,l=o.y,d=l===void 0?0:l,h=o.width,p=o.height,m=Me(this.gl),g=m.bindFramebuffer(36008,this.handle),y=c===0&&d===0&&h===void 0&&p===void 0;return y?m.invalidateFramebuffer(36008,u):m.invalidateFramebuffer(36008,u,c,d,h,p),m.bindFramebuffer(36008,g),this},i.getAttachmentParameter=function(o,s,u){var f=this._getAttachmentParameterFallback(s);return f===null&&(this.gl.bindFramebuffer(36160,this.handle),f=this.gl.getFramebufferAttachmentParameter(36160,o,s),this.gl.bindFramebuffer(36160,null)),u&&f>1e3&&(f=nn(this.gl,f)),f},i.getAttachmentParameters=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:36064,s=arguments.length>1?arguments[1]:void 0,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],f={},c=Y_(u),l;try{for(c.s();!(l=c.n()).done;){var d=l.value,h=s?nn(this.gl,d):d;f[h]=this.getAttachmentParameter(o,d,s)}}catch(p){c.e(p)}finally{c.f()}return f},i.getParameters=function(){for(var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,s=Object.keys(this.attachments),u={},f=0,c=s;f<c.length;f++){var l=c[f],d=Number(l),h=o?nn(this.gl,d):d;u[h]=this.getAttachmentParameters(d,o)}return u},i.show=function(){return typeof window<"u"&&window.open(Ch(this),"luma-debug-texture"),this},i.log=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(o>Q.level||typeof window>"u")return this;s=s||"Framebuffer ".concat(this.id);var u=Ch(this,{targetMaxHeight:100});return Q.image({logLevel:o,message:s,image:u},s)(),this},i.bind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.target,u=s===void 0?36160:s;return this.gl.bindFramebuffer(u,this.handle),this},i.unbind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.target,u=s===void 0?36160:s;return this.gl.bindFramebuffer(u,null),this},i._createDefaultAttachments=function(o,s,u,f,c){var l=null;if(o){var d;l=l||{},l[36064]=new on(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:f,height:c,mipmaps:!1,parameters:(d={},lu(d,10241,9729),lu(d,10240,9729),lu(d,10242,33071),lu(d,10243,33071),d)}),this.ownResources.push(l[36064])}return s&&u?(l=l||{},l[33306]=new fa(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:f,height:111}),this.ownResources.push(l[33306])):s?(l=l||{},l[36096]=new fa(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:f,height:c}),this.ownResources.push(l[36096])):u&&V(!1),l},i._unattach=function(o){var s=this.attachments[o];s&&(s instanceof fa?this.gl.framebufferRenderbuffer(36160,o,36161,null):this.gl.framebufferTexture2D(36160,o,3553,null,0),delete this.attachments[o])},i._attachRenderbuffer=function(o){var s=o.attachment,u=s===void 0?36064:s,f=o.renderbuffer,c=this.gl;c.framebufferRenderbuffer(36160,u,36161,f.handle),this.attachments[u]=f},i._attachTexture=function(o){var s=o.attachment,u=s===void 0?36064:s,f=o.texture,c=o.layer,l=o.level,d=this.gl;switch(d.bindTexture(f.target,f.handle),f.target){case 35866:case 32879:var h=Me(d);h.framebufferTextureLayer(36160,u,f.target,l,c);break;case 34067:var p=WD(c);d.framebufferTexture2D(36160,u,p,f.handle,l);break;case 3553:d.framebufferTexture2D(36160,u,3553,f.handle,l);break;default:V(!1,"Illegal texture type")}d.bindTexture(f.target,null),this.attachments[u]=f},i._setReadBuffer=function(o){var s=fh(this.gl);s?s.readBuffer(o):V(o===36064||o===1029,Q_),this.readBuffer=o},i._setDrawBuffers=function(o){var s=this.gl,u=Me(s);if(u)u.drawBuffers(o);else{var f=s.getExtension("WEBGL_draw_buffers");f?f.drawBuffersWEBGL(o):V(o.length===1&&(o[0]===36064||o[0]===1029),Q_)}this.drawBuffers=o},i._getAttachmentParameterFallback=function(o){var s=cu(this.gl);switch(o){case 36052:return s.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return s.WEBGL2?null:8;case 33297:return s.WEBGL2?null:5125;case 33296:return!s.WEBGL2&&!s.EXT_sRGB?9729:null;default:return null}},i._createHandle=function(){return this.gl.createFramebuffer()},i._deleteHandle=function(){this.gl.deleteFramebuffer(this.handle)},i._bindHandle=function(o){return this.gl.bindFramebuffer(36160,o)},UD(n,[{key:t,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var o=Me(this.gl);return o.getParameter(o.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var o=Me(this.gl);return o.getParameter(o.MAX_DRAW_BUFFERS)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}}]),n}(Tr,Symbol.toStringTag);function WD(e){return e<34069?e+34069:e}function JD(e){var t=wr.STATUS||{};return t[e]||"Framebuffer error ".concat(e)}var XD=[36049,36048,33296,33298,33299,33300,33301,33302,33303];wr.ATTACHMENT_PARAMETERS=XD;function qD(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X_(e,t){var r=e.gl,n=e.width,i=e.height,a=e.id,o=new wr(r,Object.assign({},t,{id:"framebuffer-for-".concat(a),width:n,height:i,attachments:qD({},36064,e)}));return o}function r1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Fh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?r1(Object(r),!0).forEach(function(n){Lh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):r1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Lh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Dh=function(){function e(r,n){KD(this,e);var i=n.attributes,a=n.material,o=n.pbrDebug,s=n.imageBasedLightingEnvironment,u=n.lights,f=n.useTangents;this.gl=r,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},fu(r,ve.GLSL_TEXTURE_LOD)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),o&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(i.NORMAL,"HAS_NORMALS"),this.defineIfPresent(i.TANGENT&&f,"HAS_TANGENTS"),this.defineIfPresent(i.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(u,"USE_LIGHTS"),this.defineIfPresent(o,"PBR_DEBUG"),a&&this.parseMaterial(a)}var t=e.prototype;return t.defineIfPresent=function(n,i){n&&(this.defines[i]=1)},t.parseTexture=function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,o=n.texture&&n.texture.sampler&&n.texture.sampler.parameters||{},s=n.texture.source.image,u,f={};s.compressed?(u=s,f=Lh({},this.gl.TEXTURE_MIN_FILTER,s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):u={data:s};var c=new on(this.gl,Fh({id:n.name||n.id,parameters:Fh(Fh({},o),f),pixelStore:Lh({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},u));this.uniforms[i]=c,this.defineIfPresent(a,a),this.generatedTextures.push(c)},t.parsePbrMetallicRoughness=function(n){n.baseColorTexture&&this.parseTexture(n.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=n.baseColorFactor||[1,1,1,1],n.metallicRoughnessTexture&&this.parseTexture(n.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var i=n.metallicFactor,a=i===void 0?1:i,o=n.roughnessFactor,s=o===void 0?1:o;this.uniforms.u_MetallicRoughnessValues=[a,s]},t.parseMaterial=function(n){if(this.uniforms.pbr_uUnlit=Boolean(n.unlit),n.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(n.pbrMetallicRoughness),n.normalTexture){this.parseTexture(n.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var i=n.normalTexture.scale,a=i===void 0?1:i;this.uniforms.u_NormalScale=a}if(n.occlusionTexture){this.parseTexture(n.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var o=n.occlusionTexture.strength,s=o===void 0?1:o;this.uniforms.u_OcclusionStrength=s}if(n.emissiveTexture&&(this.parseTexture(n.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=n.emissiveFactor||[0,0,0]),n.alphaMode==="MASK"){var u=n.alphaCutoff,f=u===void 0?.5:u;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=f}else n.alphaMode==="BLEND"&&(Q.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))},t.delete=function(){this.generatedTextures.forEach(function(n){return n.delete()})},e}();var mu=q(oh()),o1=q(Gs());var n1=`#version 300 es
76
- #define SHADER_NAME simple-mesh-layer-vs
77
- uniform float sizeScale;
78
- uniform bool composeModelMatrix;
79
- uniform bool pickFeatureIds;
80
- in vec3 positions;
81
- in vec3 normals;
82
- in vec3 colors;
83
- in vec2 texCoords;
84
- in vec4 uvRegions;
85
- in vec3 featureIdsPickingColors;
86
- in vec4 instanceColors;
87
- in vec3 instancePickingColors;
88
- in mat3 instanceModelMatrix;
89
- out vec2 vTexCoord;
90
- out vec3 cameraPosition;
91
- out vec3 normals_commonspace;
92
- out vec4 position_commonspace;
93
- out vec4 vColor;
94
-
95
- vec2 applyUVRegion(vec2 uv) {
96
- #ifdef HAS_UV_REGIONS
97
- return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;
98
- #else
99
- return uv;
100
- #endif
101
- }
102
-
103
- void main(void) {
104
- vec2 uv = applyUVRegion(texCoords);
105
- geometry.uv = uv;
106
-
107
- if (pickFeatureIds) {
108
- geometry.pickingColor = featureIdsPickingColors;
109
- } else {
110
- geometry.pickingColor = instancePickingColors;
111
- }
112
-
113
- vTexCoord = uv;
114
- cameraPosition = project_uCameraPosition;
115
- vColor = vec4(colors * instanceColors.rgb, instanceColors.a);
116
-
117
- vec3 pos = (instanceModelMatrix * positions) * sizeScale;
118
- vec3 projectedPosition = project_position(positions);
119
- position_commonspace = vec4(projectedPosition, 1.0);
120
- gl_Position = project_common_position_to_clipspace(position_commonspace);
121
-
122
- geometry.position = position_commonspace;
123
- normals_commonspace = project_normal(instanceModelMatrix * normals);
124
- geometry.normal = normals_commonspace;
125
-
126
- DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
127
-
128
- #ifdef MODULE_PBR
129
- pbr_vPosition = geometry.position.xyz;
130
- #ifdef HAS_NORMALS
131
- pbr_vNormal = geometry.normal;
132
- #endif
133
-
134
- #ifdef HAS_UV
135
- pbr_vUV = uv;
136
- #else
137
- pbr_vUV = vec2(0., 0.);
138
- #endif
139
- geometry.uv = pbr_vUV;
140
- #endif
141
-
142
- DECKGL_FILTER_COLOR(vColor, geometry);
143
- }
144
- `;var i1=`#version 300 es
145
- #define SHADER_NAME simple-mesh-layer-fs
146
-
147
- precision highp float;
148
-
149
- uniform bool hasTexture;
150
- uniform sampler2D sampler;
151
- uniform bool flatShading;
152
- uniform float opacity;
153
-
154
- in vec2 vTexCoord;
155
- in vec3 cameraPosition;
156
- in vec3 normals_commonspace;
157
- in vec4 position_commonspace;
158
- in vec4 vColor;
159
-
160
- out vec4 fragColor;
161
-
162
- void main(void) {
163
-
164
- #ifdef MODULE_PBR
165
-
166
- fragColor = vColor * pbr_filterColor(vec4(0));
167
- geometry.uv = pbr_vUV;
168
- fragColor.a *= opacity;
169
-
170
- #else
171
-
172
- geometry.uv = vTexCoord;
173
-
174
- vec3 normal;
175
- if (flatShading) {
176
- #ifdef DERIVATIVES_AVAILABLE
177
- normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));
178
- #else
179
- normal = vec3(0.0, 0.0, 1.0);
180
- #endif
181
- } else {
182
- normal = normals_commonspace;
183
- }
184
-
185
- vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;
186
- vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
187
- fragColor = vec4(lightColor, color.a * opacity);
188
-
189
- #endif
190
-
191
- DECKGL_FILTER_COLOR(fragColor, geometry);
192
- }
193
- `;function pu(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pu=function(r){return typeof r}:pu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},pu(e)}function a1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?a1(Object(r),!0).forEach(function(n){YD(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function YD(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Er(e,t,r){return typeof Reflect<"u"&&Reflect.get?Er=Reflect.get:Er=function(i,a,o){var s=ZD(i,a);if(s){var u=Object.getOwnPropertyDescriptor(s,a);return u.get?u.get.call(o):u.value}},Er(e,t,r||e)}function ZD(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Dt(e),e!==null););return e}function QD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gh(e,t)}function Gh(e,t){return Gh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Gh(e,t)}function eG(e){var t=nG();return function(){var n=Dt(e),i;if(t){var a=Dt(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return tG(this,i)}}function tG(e,t){if(t&&(pu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rG(e)}function rG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nG(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Dt(e){return Dt=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Dt(e)}function iG(e){var t=e.COLOR_0||e.colors;t||(e.colors={constant:!0,value:new Float32Array([1,1,1])})}var aG={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}},vu=function(e){QD(r,e);var t=eG(r);function r(){return $D(this,r),t.apply(this,arguments)}var n=r.prototype;return n.getShaders=function(){var a=Er(Dt(r.prototype),"getShaders",this).call(this),o=a.modules;return o.push(mu.pbr),xr(xr({},a),{},{vs:n1,fs:i1})},n.initializeState=function(){var a=this.props.featureIds;Er(Dt(r.prototype),"initializeState",this).call(this);var o=this.getAttributeManager();a&&o.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})},n.updateState=function(a){Er(Dt(r.prototype),"updateState",this).call(this,a);var o=a.props,s=a.oldProps;o.pbrMaterial!==s.pbrMaterial&&this.updatePbrMaterialUniforms(o.pbrMaterial)},n.draw=function(a){var o=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(o)}),Er(Dt(r.prototype),"draw",this).call(this,a))},n.getModel=function(a){var o=this.props,s=o.id,u=o.pbrMaterial,f=this.parseMaterial(u,a);this.setState({materialParser:f});var c=this.getShaders();iG(a.attributes);var l=new mu.Model(this.context.gl,xr(xr({},this.getShaders()),{},{id:s,geometry:a,defines:xr(xr(xr({},c.defines),f?.defines),{},{HAS_UV_REGIONS:a.attributes.uvRegions}),parameters:f?.parameters,isInstanced:!0}));return l},n.updatePbrMaterialUniforms=function(a){var o=this.state.model;if(o){var s=this.props.mesh,u=this.parseMaterial(a,s);this.setState({materialParser:u}),o.setUniforms(u.uniforms)}},n.parseMaterial=function(a,o){var s,u=Boolean(a.pbrMetallicRoughness&&a.pbrMetallicRoughness.baseColorTexture);return(s=this.state.materialParser)===null||s===void 0||s.delete(),new Dh(this.context.gl,{attributes:{NORMAL:o.attributes.normals,TEXCOORD_0:o.attributes.texCoords},material:xr({unlit:u},a),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})},n.calculateFeatureIdsPickingColors=function(a){for(var o=this.props.featureIds,s=new Uint8ClampedArray(o.length*a.size),u=[],f=0;f<o.length;f++)this.encodePickingColor(o[f],u),s[f*3]=u[0],s[f*3+1]=u[1],s[f*3+2]=u[2];a.value=s},n.finalizeState=function(a){var o;Er(Dt(r.prototype),"finalizeState",this).call(this,a),(o=this.state.materialParser)===null||o===void 0||o.delete(),this.setState({materialParser:null})},r}(o1.SimpleMeshLayer);vu.layerName="MeshLayer";vu.defaultProps=aG;var ux=q(Zn());var $t=6378137,Zt=6378137,Qt=6356752314245179e-9,oG={radii:[$t,Zt,Qt],radiiSquared:[$t*$t,Zt*Zt,Qt*Qt],oneOverRadii:[1/$t,1/Zt,1/Qt],oneOverRadiiSquared:[1/($t*$t),1/(Zt*Zt),1/(Qt*Qt)],maximumRadius:Math.max($t,Zt,Qt),centerToleranceSquared:.1};function gu(e){return e}var UZ=new E;function sG(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gu;return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function u1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return sG(e,t,de._cartographicRadians?gu:yl)}function uG(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gu;return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function f1(e,t){return uG(e,t,de._cartographicRadians?gu:bl)}var Qn=new E,fG=new E,cG=new E;function Nh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=t.oneOverRadii,i=t.oneOverRadiiSquared,a=t.centerToleranceSquared;Qn.from(e);var o=Qn.x,s=Qn.y,u=Qn.z,f=n.x,c=n.y,l=n.z,d=o*o*f*f,h=s*s*c*c,p=u*u*l*l,m=d+h+p,g=Math.sqrt(1/m);if(Number.isFinite(g)){var y=fG;if(y.copy(e).scale(g),m<a)return y.to(r);var b=i.x,A=i.y,S=i.z,O=cG;O.set(y.x*b*2,y.y*A*2,y.z*S*2);var w=(1-g)*Qn.len()/(.5*O.len()),B=0,P,x,_,C;do{w-=B,P=1/(1+w*b),x=1/(1+w*A),_=1/(1+w*S);var I=P*P,R=x*x,M=_*_,D=I*P,N=R*x,j=M*_;C=d*I+h*R+p*M-1;var U=d*D*b+h*N*A+p*j*S,k=-2*U;B=C/k}while(Math.abs(C)>Mt.EPSILON12);return Qn.scale([P,x,_]).to(r)}}var c1=1e-14,lG=new E,l1={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Uh={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},er={east:new E,north:new E,up:new E,west:new E,south:new E,down:new E},hG=new E,dG=new E,pG=new E;function yu(e,t,r,n,i,a){var o=l1[t]&&l1[t][r];ee(o&&(!n||n===o));var s,u,f,c=lG.copy(i),l=Pe(c.x,0,c1)&&Pe(c.y,0,c1);if(l){var d=Math.sign(c.z);s=hG.fromArray(Uh[t]),t!=="east"&&t!=="west"&&s.scale(d),u=dG.fromArray(Uh[r]),r!=="east"&&r!=="west"&&u.scale(d),f=pG.fromArray(Uh[n]),n!=="east"&&n!=="west"&&f.scale(d)}else{var h=er.up,p=er.east,m=er.north;p.set(-c.y,c.x,0).normalize(),e.geodeticSurfaceNormal(c,h),m.copy(h).cross(p);var g=er.down,y=er.west,b=er.south;g.copy(h).scale(-1),y.copy(p).scale(-1),b.copy(m).scale(-1),s=er[t],u=er[r],f=er[n]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=u.x,a[5]=u.y,a[6]=u.z,a[7]=0,a[8]=f.x,a[9]=f.y,a[10]=f.z,a[11]=0,a[12]=c.x,a[13]=c.y,a[14]=c.z,a[15]=1,a}function mG(e,t){return bG(e)||yG(e,t)||gG(e,t)||vG()}function vG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
194
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gG(e,t){if(e){if(typeof e=="string")return h1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h1(e,t)}}function h1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yG(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function bG(e){if(Array.isArray(e))return e}function _G(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var bu=new E,d1=new E,AG=new E,yt=new E,TG=new E,_u=new E;var oe=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;_G(this,e),v(this,"radii",void 0),v(this,"radiiSquared",void 0),v(this,"radiiToTheFourth",void 0),v(this,"oneOverRadii",void 0),v(this,"oneOverRadiiSquared",void 0),v(this,"minimumRadius",void 0),v(this,"maximumRadius",void 0),v(this,"centerToleranceSquared",Mt.EPSILON1),v(this,"squaredXOverSquaredZ",void 0),ee(r>=0),ee(n>=0),ee(i>=0),this.radii=new E(r,n,i),this.radiiSquared=new E(r*r,n*n,i*i),this.radiiToTheFourth=new E(r*r*r*r,n*n*n*n,i*i*i*i),this.oneOverRadii=new E(r===0?0:1/r,n===0?0:1/n,i===0?0:1/i),this.oneOverRadiiSquared=new E(r===0?0:1/(r*r),n===0?0:1/(n*n),i===0?0:1/(i*i)),this.minimumRadius=Math.min(r,n,i),this.maximumRadius=Math.max(r,n,i),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}var t=e.prototype;return t.equals=function(n){return this===n||Boolean(n&&this.radii.equals(n.radii))},t.toString=function(){return this.radii.toString()},t.cartographicToCartesian=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],a=d1,o=AG,s=mG(n,3),u=s[2];this.geodeticSurfaceNormalCartographic(n,a),o.copy(this.radiiSquared).scale(a);var f=Math.sqrt(a.dot(o));return o.scale(1/f),a.scale(u),o.add(a),o.to(i)},t.cartesianToCartographic=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];_u.from(n);var a=this.scaleToGeodeticSurface(_u,yt);if(a){var o=this.geodeticSurfaceNormal(a,d1),s=TG;s.copy(_u).subtract(a);var u=Math.atan2(o.y,o.x),f=Math.asin(o.z),c=Math.sign(ji(s,_u))*Kc(s);return f1([u,f,c],i)}},t.eastNorthUpToFixedFrame=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new J;return yu(this,"east","north","up",n,i)},t.localFrameToFixedFrame=function(n,i,a,o){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new J;return yu(this,n,i,a,o,s)},t.geocentricSurfaceNormal=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return bu.from(n).normalize().to(i)},t.geodeticSurfaceNormalCartographic=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],a=u1(n),o=a[0],s=a[1],u=Math.cos(s);return bu.set(u*Math.cos(o),u*Math.sin(o),Math.sin(s)).normalize(),bu.to(i)},t.geodeticSurfaceNormal=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return bu.from(n).scale(this.oneOverRadiiSquared).normalize().to(i)},t.scaleToGeodeticSurface=function(n,i){return Nh(n,this,i)},t.scaleToGeocentricSurface=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];yt.from(n);var a=yt.x,o=yt.y,s=yt.z,u=this.oneOverRadiiSquared,f=1/Math.sqrt(a*a*u.x+o*o*u.y+s*s*u.z);return yt.multiplyScalar(f).to(i)},t.transformPositionToScaledSpace=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return yt.from(n).scale(this.oneOverRadii).to(i)},t.transformPositionFromScaledSpace=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return yt.from(n).scale(this.radii).to(i)},t.getSurfaceNormalIntersectionWithZAxis=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0,0];ee(Pe(this.radii.x,this.radii.y,Mt.EPSILON15)),ee(this.radii.z>0),yt.from(n);var o=yt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(o)>=this.radii.z-i))return yt.set(0,0,o).to(a)},e}();v(oe,"WGS84",new oe($t,Zt,Qt));function ca(){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 un=class{constructor(t,r){v(this,"name",void 0),v(this,"type",void 0),v(this,"sampleSize",1),v(this,"time",0),v(this,"count",0),v(this,"samples",0),v(this,"lastTiming",0),v(this,"lastSampleTime",0),v(this,"lastSampleCount",0),v(this,"_count",0),v(this,"_time",0),v(this,"_samples",0),v(this,"_startTime",0),v(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=ca(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(ca()-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 ei=class{constructor(t){v(this,"id",void 0),v(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"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(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,i=this.stats[r];return i||(t instanceof un?i=t:i=new un(r,n),this.stats[r]=i),i}};function SG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var p1=function e(t,r,n){SG(this,e),v(this,"item",void 0),v(this,"previous",void 0),v(this,"next",void 0),this.item=t,this.previous=r,this.next=n};function wG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function xG(e,t,r){return t&&m1(e.prototype,t),r&&m1(e,r),e}var v1=function(){function e(){wG(this,e),v(this,"head",null),v(this,"tail",null),v(this,"_length",0)}var t=e.prototype;return t.add=function(n){var i=new p1(n,this.tail,null);return this.tail?(this.tail.next=i,this.tail=i):(this.head=i,this.tail=i),++this._length,i},t.remove=function(n){n&&(n.previous&&n.next?(n.previous.next=n.next,n.next.previous=n.previous):n.previous?(n.previous.next=null,this.tail=n.previous):n.next?(n.next.previous=null,this.head=n.next):(this.head=null,this.tail=null),n.next=null,n.previous=null,--this._length)},t.splice=function(n,i){n!==i&&(this.remove(i),this._insert(n,i))},t._insert=function(n,i){var a=n.next;n.next=i,this.tail===n?this.tail=i:a.previous=i,i.next=a,i.previous=n,++this._length},xG(e,[{key:"length",get:function(){return this._length}}]),e}();function EG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var g1=function(){function e(){EG(this,e),v(this,"_list",void 0),v(this,"_sentinel",void 0),v(this,"_trimTiles",void 0),this._list=new v1,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}var t=e.prototype;return t.reset=function(){this._list.splice(this._list.tail,this._sentinel)},t.touch=function(n){var i=n._cacheNode;i&&this._list.splice(this._sentinel,i)},t.add=function(n,i,a){i._cacheNode||(i._cacheNode=this._list.add(i),a&&a(n,i))},t.unloadTile=function(n,i,a){var o=i._cacheNode;o&&(this._list.remove(o),i._cacheNode=null,a&&a(n,i))},t.unloadTiles=function(n,i){var a=this._trimTiles;this._trimTiles=!1;for(var o=this._list,s=n.maximumMemoryUsage*1024*1024,u=this._sentinel,f=o.head;f!==u&&(n.gpuMemoryUsageInBytes>s||a);){var c=f.item;f=f.next,this.unloadTile(n,c,i)}},t.trim=function(){this._trimTiles=!0},e}();function y1(e,t){Z(e),Z(t);var r=t.rtcCenter,n=t.gltfUpAxis,i=e.computedTransform,a=e.boundingVolume.center,o=new J(i);switch(r&&o.translate(r),n){case"Z":break;case"Y":var s=new J().rotateX(Math.PI/2);o=o.multiplyRight(s);break;case"X":var u=new J().rotateY(-Math.PI/2);o=o.multiplyRight(u);break;default:break}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);var f=new E(a);t.cartesianModelMatrix=o,t.cartesianOrigin=f;var c=oe.WGS84.cartesianToCartographic(f,new E),l=oe.WGS84.eastNorthUpToFixedFrame(f),d=l.invert();t.cartographicModelMatrix=d.multiplyRight(o),t.cartographicOrigin=c,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}function b1(e,t){return BG(e)||PG(e,t)||S1(e,t)||OG()}function OG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
195
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PG(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function BG(e){if(Array.isArray(e))return e}function CG(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=S1(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
196
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function S1(e,t){if(e){if(typeof e=="string")return _1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _1(e,t)}}function _1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var A1=new E,jh=new E,kh=new ze([new xe,new xe,new xe,new xe,new xe,new xe]);function w1(e,t){var r=e.cameraDirection,n=e.cameraUp,i=e.height,a=e.distanceScales.metersPerUnit,o=Au(e,e.center),s=oe.WGS84.eastNorthUpToFixedFrame(o),u=e.unprojectPosition(e.cameraPosition),f=oe.WGS84.cartographicToCartesian(u,new E),c=new E(s.transformAsVector(new E(r).scale(a))).normalize(),l=new E(s.transformAsVector(new E(n).scale(a))).normalize();MG(e);var d=e.constructor,h=e.longitude,p=e.latitude,m=e.width,g=e.bearing,y=e.zoom,b=new d({longitude:h,latitude:p,height:i,width:m,bearing:g,zoom:y,pitch:0});return{camera:{position:f,direction:c,up:l},viewport:e,topDownViewport:b,height:i,cullingVolume:kh,frameNumber:t,sseDenominator:1.15}}function x1(e,t,r){if(r===0||e.length<=r)return[e,[]];var n=[],i=t.viewport,a=i.longitude,o=i.latitude,s=CG(e.entries()),u;try{for(s.s();!(u=s.n()).done;){var f=b1(u.value,2),c=f[0],l=f[1],d=b1(l.header.mbs,2),h=d[0],p=d[1],m=Math.abs(a-h),g=Math.abs(o-p),y=Math.sqrt(g*g+m*m);n.push([c,y])}}catch(B){s.e(B)}finally{s.f()}for(var b=n.sort(function(B,P){return B[1]-P[1]}),A=[],S=0;S<r;S++)A.push(e[b[S][0]]);for(var O=[],w=r;w<b.length;w++)O.push(e[b[w][0]]);return[A,O]}function MG(e){var t=e.getFrustumPlanes(),r=T1(t.near,e.cameraPosition),n=Au(e,r),i=Au(e,e.cameraPosition,jh),a=0;kh.planes[a++].fromPointNormal(n,A1.copy(n).subtract(i));for(var o in t)if(o!=="near"){var s=t[o],u=T1(s,r,jh),f=Au(e,u,jh);kh.planes[a++].fromPointNormal(f,A1.copy(n).subtract(f))}}function T1(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new E,n=e.normal.dot(t);return r.copy(e.normal).scale(e.distance-n).add(t),r}function Au(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new E,n=e.unprojectPosition(t);return oe.WGS84.cartographicToCartesian(n,r)}function IG(e,t){return DG(e)||LG(e,t)||FG(e,t)||RG()}function RG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
197
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FG(e,t){if(e){if(typeof e=="string")return E1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return E1(e,t)}}function E1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function LG(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function DG(e){if(Array.isArray(e))return e}var GG=6378137,NG=6378137,Hh=6356752314245179e-9,O1=new E;function P1(e,t){if(e instanceof Zr){var r=e.halfAxes,n=UG(r);return Math.log2(Hh/(n+t[2]))}else if(e instanceof vr){var i=e.radius;return Math.log2(Hh/(i+t[2]))}else if(e.width&&e.height){var a=e.width,o=e.height,s=Math.log2(GG/a),u=Math.log2(NG/o);return(s+u)/2}return 1}function Vh(e,t,r){var n=oe.WGS84.cartographicToCartesian([e.xmax,e.ymax,e.zmax],new E),i=Math.sqrt(Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2)+Math.pow(n[2]-r[2],2));return Math.log2(Hh/(i+t[2]))}function B1(e,t,r){var n=IG(e,4),i=n[0],a=n[1],o=n[2],s=n[3];return Vh({xmin:i,xmax:o,ymin:a,ymax:s,zmin:0,zmax:0},t,r)}function UG(e){e.getColumn(0,O1);var t=e.getColumn(1),r=e.getColumn(2),n=O1.add(t).add(r),i=n.len();return i}var Z1=q(Zn());var ke={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},We={ADD:1,REPLACE:2},tr={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},Re={I3S:"I3S",TILES3D:"TILES3D"},fn={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},C1={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};function ti(e){return HG(e)||kG(e)||R1(e)||jG()}function jG(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
198
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kG(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function HG(e){if(Array.isArray(e))return zh(e)}function I1(e,t){return WG(e)||zG(e,t)||R1(e,t)||VG()}function VG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
199
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R1(e,t){if(e){if(typeof e=="string")return zh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zh(e,t)}}function zh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function zG(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function WG(e){if(Array.isArray(e))return e}function F1(e){return e!=null}var Fe=new E,Tu=new E,JG=new E,XG=new E;function Su(e,t,r){if(Z(e,"3D Tile: boundingVolume must be defined"),e.box)return qG(e.box,t,r);if(e.region){var n=I1(e.region,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],f=n[5],c=oe.WGS84.cartographicToCartesian([vt(i),vt(s),u],JG),l=oe.WGS84.cartographicToCartesian([vt(o),vt(a),f],XG),d=new E().addVectors(c,l).multiplyScalar(.5),h=new E().subVectors(c,l).len()/2;return M1([d[0],d[1],d[2],h],new J)}if(e.sphere)return M1(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function L1(e,t){if(e.box)return KG(t);if(e.region){var r=I1(e.region,6),n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5];return[[vt(n),vt(i),s],[vt(a),vt(o),u]]}if(e.sphere)return YG(t);throw new Error("Unkown boundingVolume type")}function qG(e,t,r){var n=new E(e[0],e[1],e[2]);t.transform(n,n);var i=[];if(e.length===10){var a=e.slice(3,6),o=new mr;o.fromArray(e,6);var s=new E([1,0,0]),u=new E([0,1,0]),f=new E([0,0,1]);s.transformByQuaternion(o),s.scale(a[0]),u.transformByQuaternion(o),u.scale(a[1]),f.transformByQuaternion(o),f.scale(a[2]),i=[].concat(ti(s.toArray()),ti(u.toArray()),ti(f.toArray()))}else i=[].concat(ti(e.slice(3,6)),ti(e.slice(6,9)),ti(e.slice(9,12)));var c=t.transformAsVector(i.slice(0,3)),l=t.transformAsVector(i.slice(3,6)),d=t.transformAsVector(i.slice(6,9)),h=new le([c[0],c[1],c[2],l[0],l[1],l[2],d[0],d[1],d[2]]);return F1(r)?(r.center=n,r.halfAxes=h,r):new Zr(n,h)}function M1(e,t,r){var n=new E(e[0],e[1],e[2]);t.transform(n,n);var i=t.getScale(Tu),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return F1(r)?(r.center=n,r.radius=o,r):new vr(n,o)}function KG(e){for(var t=D1(),r=e.halfAxes,n=new E(r.getColumn(0)),i=new E(r.getColumn(1)),a=new E(r.getColumn(2)),o=0;o<2;o++){for(var s=0;s<2;s++){for(var u=0;u<2;u++)Fe.copy(e.center),Fe.add(n),Fe.add(i),Fe.add(a),G1(t,Fe),a.negate();i.negate()}n.negate()}return t}function YG(e){var t=D1(),r=e.center,n=e.radius,i=oe.WGS84.scaleToGeodeticSurface(r,Fe),a;i?a=oe.WGS84.geodeticSurfaceNormal(i):a=new E(0,0,1);var o=new E(a[2],-a[1],0);o.len()>0?o.normalize():o=new E(0,1,0);for(var s=o.clone().cross(a),u=0,f=[o,s,a];u<f.length;u++){var c=f[u];Tu.copy(c).scale(n);for(var l=0;l<2;l++)Fe.copy(r),Fe.add(Tu),G1(t,Fe),Tu.negate()}return t}function D1(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function G1(e,t){oe.WGS84.cartesianToCartographic(t,Fe),e[0][0]=Math.min(e[0][0],Fe[0]),e[0][1]=Math.min(e[0][1],Fe[1]),e[0][2]=Math.min(e[0][2],Fe[2]),e[1][0]=Math.max(e[1][0],Fe[0]),e[1][1]=Math.max(e[1][1],Fe[1]),e[1][2]=Math.max(e[1][2],Fe[2])}var jQ=new E,kQ=new E,HQ=new J,VQ=new E,zQ=new E,WQ=new E;function $G(e,t){var r=e*t;return 1-Math.exp(-(r*r))}function ZG(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){var r=e.dynamicScreenSpaceErrorComputedDensity,n=e.dynamicScreenSpaceErrorFactor,i=$G(t,r)*n;return i}return 0}function N1(e,t,r){var n=e.tileset,i=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,a=r?i:e.lodMetricValue;if(a===0)return 0;var o=Math.max(e._distanceToCamera,1e-7),s=t.height,u=t.sseDenominator,f=n.options.viewDistanceScale,c=a*s*(f||1)/(o*u);return c-=ZG(n,o),c}function QG(e){return nN(e)||rN(e)||tN(e)||eN()}function eN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
200
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tN(e,t){if(e){if(typeof e=="string")return Xh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xh(e,t)}}function rN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nN(e){if(Array.isArray(e))return Xh(e)}function Xh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Wh=new E,U1=new E,Or=new E,j1=new E,iN=new E,Jh=new J,k1=new J;function H1(e,t){if(e.lodMetricValue===0||isNaN(e.lodMetricValue))return"DIG";var r=2*qh(e,t);return r<2?"OUT":!e.header.children||r<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}function qh(e,t){var r=t.topDownViewport,n=e.header.mbs[1],i=e.header.mbs[0],a=e.header.mbs[2],o=e.header.mbs[3],s=QG(e.boundingVolume.center),u=r.unprojectPosition(r.cameraPosition);oe.WGS84.cartographicToCartesian(u,Wh),U1.copy(Wh).subtract(s).normalize(),oe.WGS84.eastNorthUpToFixedFrame(s,Jh),k1.copy(Jh).invert(),Or.copy(Wh).transform(k1);var f=Math.sqrt(Or[0]*Or[0]+Or[1]*Or[1]),c=f*f/Or[2];j1.copy([Or[0],Or[1],c]);var l=j1.transform(Jh),d=l.subtract(s).normalize(),h=U1.cross(d).normalize().scale(o),p=h.add(s),m=oe.WGS84.cartesianToCartographic(p),g=r.project([i,n,a]),y=r.project(m),b=iN.copy(g).subtract(y).magnitude();return b}function V1(e){return{assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}}function aN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function oN(e,t,r){return t&&z1(e.prototype,t),r&&z1(e,r),e}var Kh=function(){function e(){aN(this,e);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;v(this,"_map",new Map),v(this,"_array",void 0),v(this,"_length",void 0),this._array=new Array(r),this._length=r}var t=e.prototype;return t.get=function(n){return Z(n<this._array.length),this._array[n]},t.set=function(n,i){Z(n>=0),n>=this.length&&(this.length=n+1),this._map.has(this._array[n])&&this._map.delete(this._array[n]),this._array[n]=i,this._map.set(i,n)},t.delete=function(n){var i=this._map.get(n);i>=0&&(this._array.splice(i,1),this._map.delete(n),this.length--)},t.peek=function(){return this._array[this._length-1]},t.push=function(n){if(!this._map.has(n)){var i=this.length++;this._array[i]=n,this._map.set(n,i)}},t.pop=function(){var n=this._array[--this.length];return this._map.delete(n),n},t.reserve=function(n){Z(n>=0),n>this._array.length&&(this._array.length=n)},t.resize=function(n){Z(n>=0),this.length=n},t.trim=function(n){n==null&&(n=this.length),this._array.length=n},t.reset=function(){this._array=[],this._map=new Map,this._length=0},t.find=function(n){return this._map.has(n)},oN(e,[{key:"length",get:function(){return this._length},set:function(n){this._length=n,n>this._array.length&&(this._array.length=n)}},{key:"values",get:function(){return this._array}}]),e}();function wu(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=sN(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
201
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function sN(e,t){if(e){if(typeof e=="string")return W1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return W1(e,t)}}function W1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function J1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?J1(Object(r),!0).forEach(function(n){uN(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var cN={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},Pr=function(){var e=t.prototype;e.traversalFinished=function(n){return!0};function t(r){fN(this,t),v(this,"options",void 0),v(this,"root",null),v(this,"selectedTiles",{}),v(this,"requestedTiles",{}),v(this,"emptyTiles",{}),v(this,"lastUpdate",new Date().getTime()),v(this,"updateDebounceTime",1e3),v(this,"_traversalStack",new Kh),v(this,"_emptyTraversalStack",new Kh),v(this,"_frameNumber",null),this.options=xu(xu({},cN),r)}return e.traverse=function(n,i,a){this.root=n,this.options=xu(xu({},this.options),a),this.reset(),this.updateTile(n,i),this._frameNumber=i.frameNumber,this.executeTraversal(n,i)},e.reset=function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()},e.executeTraversal=function(n,i){var a=this._traversalStack;for(n._selectionDepth=1,a.push(n);a.length>0;){var o=a.pop(),s=!1;this.canTraverse(o,i)&&(this.updateChildTiles(o,i),s=this.updateAndPushChildren(o,i,a,o.hasRenderContent?o._selectionDepth+1:o._selectionDepth));var u=o.parent,f=Boolean(!u||u._shouldRefine),c=!s;o.hasRenderContent?o.refine===We.ADD?(this.loadTile(o,i),this.selectTile(o,i)):o.refine===We.REPLACE&&(this.loadTile(o,i),c&&this.selectTile(o,i)):(this.emptyTiles[o.id]=o,this.loadTile(o,i),c&&this.selectTile(o,i)),this.touchTile(o,i),o._shouldRefine=s&&f}var l=new Date().getTime();(this.traversalFinished(i)||l-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=l,this.options.onTraversalEnd(i))},e.updateChildTiles=function(n,i){var a=n.children,o=wu(a),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;this.updateTile(u,i)}}catch(f){o.e(f)}finally{o.f()}},e.updateAndPushChildren=function(n,i,a,o){var s=this.options,u=s.loadSiblings,f=s.skipLevelOfDetail,c=n.children;c.sort(this.compareDistanceToCamera.bind(this));var l=n.refine===We.REPLACE&&n.hasRenderContent&&!f,d=!1,h=!0,p=wu(c),m;try{for(p.s();!(m=p.n()).done;){var g=m.value;if(g._selectionDepth=o,g.isVisibleAndInRequestVolume?(a.find(g)&&a.delete(g),a.push(g),d=!0):(l||u)&&(this.loadTile(g,i),this.touchTile(g,i)),l){var y=void 0;if(g._inRequestVolume?g.hasRenderContent?y=g.contentAvailable:y=this.executeEmptyTraversal(g,i):y=!1,h=h&&y,!h)return!1}}}catch(b){p.e(b)}finally{p.f()}return d||(h=!1),h},e.updateTile=function(n,i){this.updateTileVisibility(n,i)},e.selectTile=function(n,i){this.shouldSelectTile(n)&&(n._selectedFrame=i.frameNumber,this.selectedTiles[n.id]=n)},e.loadTile=function(n,i){this.shouldLoadTile(n)&&(n._requestedFrame=i.frameNumber,n._priority=n._getPriority(),this.requestedTiles[n.id]=n)},e.touchTile=function(n,i){n.tileset._cache.touch(n),n._touchedFrame=i.frameNumber},e.canTraverse=function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return n.hasChildren?n.hasTilesetContent?!n.contentExpired:!o&&!n.isVisibleAndInRequestVolume?!1:this.shouldRefine(n,i,a):!1},e.shouldLoadTile=function(n){return n.hasUnloadedContent||n.contentExpired},e.shouldSelectTile=function(n){return n.contentAvailable&&!this.options.skipLevelOfDetail},e.shouldRefine=function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=n._screenSpaceError;return a&&(o=n.getScreenSpaceError(i,!0)),o>this.options.maximumScreenSpaceError},e.updateTileVisibility=function(n,i){var a=[];if(this.options.viewportTraversersMap)for(var o in this.options.viewportTraversersMap){var s=this.options.viewportTraversersMap[o];s===i.viewport.id&&a.push(o)}else a.push(i.viewport.id);n.updateVisibility(i,a)},e.compareDistanceToCamera=function(n,i){return n._distanceToCamera-i._distanceToCamera},e.anyChildrenVisible=function(n,i){var a=!1,o=wu(n.children),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;u.updateVisibility(i),a=a||u.isVisibleAndInRequestVolume}}catch(f){o.e(f)}finally{o.f()}return a},e.executeEmptyTraversal=function(n,i){var a=!0,o=this._emptyTraversalStack;for(o.push(n);o.length>0&&a;){var s=o.pop();this.updateTile(s,i),s.isVisibleAndInRequestVolume||this.loadTile(s,i),this.touchTile(s,i);var u=!s.hasRenderContent&&this.canTraverse(s,i,!1,!0);if(u){var f=s.children,c=wu(f),l;try{for(c.s();!(l=c.n()).done;){var d=l.value;o.find(d)&&o.delete(d),o.push(d)}}catch(h){c.e(h)}finally{c.f()}}else!s.contentAvailable&&!s.hasEmptyContent&&(a=!1)}return a},t}();function X1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ri(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X1(Object(r),!0).forEach(function(n){$1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $1(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q1(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function lN(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){q1(a,n,i,o,s,"next",u)}function s(u){q1(a,n,i,o,s,"throw",u)}o(void 0)})}}function hN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function dN(e,t,r){return t&&K1(e.prototype,t),r&&K1(e,r),e}var Y1=new E;function pN(e){return e!=null}var la=function(){function e(r,n,i){hN(this,e);var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";v(this,"tileset",void 0),v(this,"header",void 0),v(this,"id",void 0),v(this,"url",void 0),v(this,"parent",void 0),v(this,"refine",void 0),v(this,"type",void 0),v(this,"contentUrl",void 0),v(this,"lodMetricType","geometricError"),v(this,"lodMetricValue",0),v(this,"boundingVolume",null),v(this,"content",null),v(this,"contentState",ke.UNLOADED),v(this,"gpuMemoryUsageInBytes",0),v(this,"children",[]),v(this,"depth",0),v(this,"viewportIds",[]),v(this,"transform",new J),v(this,"extensions",null),v(this,"implicitTiling",null),v(this,"userData",{}),v(this,"computedTransform",void 0),v(this,"hasEmptyContent",!1),v(this,"hasTilesetContent",!1),v(this,"traverser",new Pr({})),v(this,"_cacheNode",null),v(this,"_frameNumber",null),v(this,"_expireDate",null),v(this,"_expiredContent",null),v(this,"_boundingBox",void 0),v(this,"_distanceToCamera",0),v(this,"_screenSpaceError",0),v(this,"_visibilityPlaneMask",void 0),v(this,"_visible",void 0),v(this,"_contentBoundingVolume",void 0),v(this,"_viewerRequestVolume",void 0),v(this,"_initialTransform",new J),v(this,"_priority",0),v(this,"_selectedFrame",0),v(this,"_requestedFrame",0),v(this,"_selectionDepth",0),v(this,"_touchedFrame",0),v(this,"_centerZDepth",0),v(this,"_shouldRefine",!1),v(this,"_stackLength",0),v(this,"_visitedFrame",0),v(this,"_inRequestVolume",!1),v(this,"_lodJudge",null),this.header=n,this.tileset=r,this.id=a||n.id,this.url=n.url,this.parent=i,this.refine=this._getRefine(n.refine),this.type=n.type,this.contentUrl=n.contentUrl,this._initializeLodMetric(n),this._initializeTransforms(n),this._initializeBoundingVolumes(n),this._initializeContent(n),this._initializeRenderingState(n),Object.seal(this)}var t=e.prototype;return t.destroy=function(){this.header=null},t.isDestroyed=function(){return this.header===null},t.getScreenSpaceError=function(n,i){switch(this.tileset.type){case Re.I3S:return qh(this,n);case Re.TILES3D:return N1(this,n,i);default:throw new Error("Unsupported tileset type")}},t.unselect=function(){this._selectedFrame=0},t._getGpuMemoryUsageInBytes=function(){return this.content.gpuMemoryUsageInBytes||this.content.byteLength||0},t._getPriority=function(){var n=this.tileset._traverser,i=n.options.skipLevelOfDetail,a=this.refine===We.ADD||i;if(a&&!this.isVisible&&this._visible!==void 0||this.tileset._frameNumber-this._touchedFrame>=1||this.contentState===ke.UNLOADED)return-1;var o=this.parent,s=o&&(!a||this._screenSpaceError===0||o.hasTilesetContent),u=s?o._screenSpaceError:this._screenSpaceError,f=n.root?n.root._screenSpaceError:0;return Math.max(f-u,0)},t.loadContent=function(){var r=lN(regeneratorRuntime.mark(function i(){var a,o,s,u,f;return regeneratorRuntime.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!this.hasEmptyContent){l.next=2;break}return l.abrupt("return",!1);case 2:if(!this.content){l.next=4;break}return l.abrupt("return",!0);case 4:return a=this.contentExpired,a&&(this._expireDate=null),this.contentState=ke.LOADING,l.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));case 9:if(o=l.sent,o){l.next=13;break}return this.contentState=ke.UNLOADED,l.abrupt("return",!1);case 13:return l.prev=13,s=this.tileset.getTileUrl(this.contentUrl),u=this.tileset.loader,f=ri(ri({},this.tileset.loadOptions),{},$1({},u.id,ri(ri({},this.tileset.loadOptions[u.id]),{},{isTileset:this.type==="json"},this._getLoaderSpecificOptions(u.id)))),l.next=19,(0,Z1.load)(s,u,f);case 19:if(this.content=l.sent,!this.tileset.options.contentLoader){l.next=23;break}return l.next=23,this.tileset.options.contentLoader(this);case 23:return this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=ke.READY,this._onContentLoaded(),l.abrupt("return",!0);case 29:throw l.prev=29,l.t0=l.catch(13),this.contentState=ke.FAILED,l.t0;case 33:return l.prev=33,o.done(),l.finish(33);case 36:case"end":return l.stop()}},i,this,[[13,29,33,36]])}));function n(){return r.apply(this,arguments)}return n}(),t.unloadContent=function(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=ke.UNLOADED,!0},t.updateVisibility=function(n,i){if(this._frameNumber!==n.frameNumber){var a=this.parent,o=a?a._visibilityPlaneMask:ze.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){var s=a?a.computedTransform:this.tileset.modelMatrix;this._updateTransform(s)}this._distanceToCamera=this.distanceToTile(n),this._screenSpaceError=this.getScreenSpaceError(n,!1),this._visibilityPlaneMask=this.visibility(n,o),this._visible=this._visibilityPlaneMask!==ze.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(n),this._frameNumber=n.frameNumber,this.viewportIds=i}},t.visibility=function(n,i){var a=n.cullingVolume,o=this.boundingVolume;return a.computeVisibilityWithPlaneMask(o,i)},t.contentVisibility=function(){return!0},t.distanceToTile=function(n){var i=this.boundingVolume;return Math.sqrt(Math.max(i.distanceSquaredTo(n.camera.position),0))},t.cameraSpaceZDepth=function(n){var i=n.camera,a=this.boundingVolume;return Y1.subVectors(a.center,i.position),i.direction.dot(Y1)},t.insideViewerRequestVolume=function(n){var i=this._viewerRequestVolume;return!i||i.distanceSquaredTo(n.camera.position)<=0},t.updateExpiration=function(){if(pN(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){var n=Date.now();Date.lessThan(this._expireDate,n)&&(this.contentState=ke.EXPIRED,this._expiredContent=this.content)}},t._initializeLodMetric=function(n){"lodMetricType"in n?this.lodMetricType=n.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in n?this.lodMetricValue=n.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))},t._initializeTransforms=function(n){this.transform=n.transform?new J(n.transform):new J;var i=this.parent,a=this.tileset,o=i&&i.computedTransform?i.computedTransform.clone():a.modelMatrix.clone();this.computedTransform=new J(o).multiplyRight(this.transform);var s=i&&i._initialTransform?i._initialTransform.clone():new J;this._initialTransform=new J(s).multiplyRight(this.transform)},t._initializeBoundingVolumes=function(n){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(n)},t._initializeContent=function(n){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=ke.UNLOADED,this.hasTilesetContent=!1,n.contentUrl&&(this.content=null,this.hasEmptyContent=!1)},t._initializeRenderingState=function(n){this.depth=n.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=ze.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0},t._getRefine=function(n){return n||this.parent&&this.parent.refine||We.REPLACE},t._isTileset=function(){return this.contentUrl.indexOf(".json")!==-1},t._onContentLoaded=function(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0;break;default:}this._isTileset()?this.hasTilesetContent=!0:this.gpuMemoryUsageInBytes=this._getGpuMemoryUsageInBytes()},t._updateBoundingVolume=function(n){this.boundingVolume=Su(n.boundingVolume,this.computedTransform,this.boundingVolume);var i=n.content;i&&(i.boundingVolume&&(this._contentBoundingVolume=Su(i.boundingVolume,this.computedTransform,this._contentBoundingVolume)),n.viewerRequestVolume&&(this._viewerRequestVolume=Su(n.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))},t._updateTransform=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new J,i=n.clone().multiplyRight(this.transform),a=!i.equals(this.computedTransform);a&&(this.computedTransform=i,this._updateBoundingVolume(this.header))},t._getLoaderSpecificOptions=function(n){switch(n){case"i3s":return ri(ri({},this.tileset.options.i3s),{},{_tileOptions:{attributeUrls:this.header.attributeUrls,textureUrl:this.header.textureUrl,textureFormat:this.header.textureFormat,textureLoaderOptions:this.header.textureLoaderOptions,materialDefinition:this.header.materialDefinition,isDracoGeometry:this.header.isDracoGeometry,mbs:this.header.mbs},_tilesetOptions:{store:this.tileset.tileset.store,attributeStorageInfo:this.tileset.tileset.attributeStorageInfo,fields:this.tileset.tileset.fields},isTileHeader:!1});case"3d-tiles":case"cesium-ion":default:return V1(this.tileset.tileset)}},dN(e,[{key:"selected",get:function(){return this._selectedFrame===this.tileset._frameNumber}},{key:"isVisible",get:function(){return this._visible}},{key:"isVisibleAndInRequestVolume",get:function(){return this._visible&&this._inRequestVolume}},{key:"hasRenderContent",get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent}},{key:"hasChildren",get:function(){return this.children.length>0||this.header.children&&this.header.children.length>0}},{key:"contentReady",get:function(){return this.contentState===ke.READY||this.hasEmptyContent}},{key:"contentAvailable",get:function(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}},{key:"hasUnloadedContent",get:function(){return this.hasRenderContent&&this.contentUnloaded}},{key:"contentUnloaded",get:function(){return this.contentState===ke.UNLOADED}},{key:"contentExpired",get:function(){return this.contentState===ke.EXPIRED}},{key:"contentFailed",get:function(){return this.contentState===ke.FAILED}},{key:"distanceToCamera",get:function(){return this._distanceToCamera}},{key:"screenSpaceError",get:function(){return this._screenSpaceError}},{key:"boundingBox",get:function(){return this._boundingBox||(this._boundingBox=L1(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}},{key:"extras",get:function(){return this.header.extras}}]),e}();function Eu(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Eu=function(r){return typeof r}:Eu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Eu(e)}function mN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ou(e,t,r){return typeof Reflect<"u"&&Reflect.get?Ou=Reflect.get:Ou=function(i,a,o){var s=vN(i,a);if(s){var u=Object.getOwnPropertyDescriptor(s,a);return u.get?u.get.call(o):u.value}},Ou(e,t,r||e)}function vN(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=ni(e),e!==null););return e}function gN(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Yh(e,t)}function Yh(e,t){return Yh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Yh(e,t)}function yN(e){var t=AN();return function(){var n=ni(e),i;if(t){var a=ni(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return bN(this,i)}}function bN(e,t){if(t&&(Eu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _N(e)}function _N(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AN(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ni(e){return ni=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ni(e)}var Q1=function(e){gN(r,e);var t=yN(r);function r(){return mN(this,r),t.apply(this,arguments)}var n=r.prototype;return n.compareDistanceToCamera=function(a,o){return o._distanceToCamera===0&&a._distanceToCamera===0?o._centerZDepth-a._centerZDepth:o._distanceToCamera-a._distanceToCamera},n.updateTileVisibility=function(a,o){if(Ou(ni(r.prototype),"updateTileVisibility",this).call(this,a,o),!!a.isVisibleAndInRequestVolume){var s=a.children.length>0;if(a.hasTilesetContent&&s){var u=a.children[0];this.updateTileVisibility(u,o),a._visible=u._visible;return}if(this.meetsScreenSpaceErrorEarly(a,o)){a._visible=!1;return}var f=a.refine===We.REPLACE,c=a._optimChildrenWithinParent===C1.USE_OPTIMIZATION;if(f&&c&&s&&!this.anyChildrenVisible(a,o)){a._visible=!1;return}}},n.meetsScreenSpaceErrorEarly=function(a,o){var s=a.parent;return!s||s.hasTilesetContent||s.refine!==We.ADD?!1:!this.shouldRefine(a,o,!0)},r}(Pr);var oA=q(Zn());function TN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var eA=function(){function e(){TN(this,e),v(this,"frameNumberMap",new Map)}var t=e.prototype;return t.register=function(n,i){var a=this.frameNumberMap.get(n)||new Map,o=a.get(i)||0;a.set(i,o+1),this.frameNumberMap.set(n,a)},t.deregister=function(n,i){var a=this.frameNumberMap.get(n);if(a){var o=a.get(i)||1;a.set(i,o-1)}},t.isZero=function(n,i){var a,o=((a=this.frameNumberMap.get(n))===null||a===void 0?void 0:a.get(i))||0;return o===0},e}();function SN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var $h={REQUESTED:"REQUESTED",COMPLETED:"COMPLETED",ERROR:"ERROR"},tA=function(){function e(){SN(this,e),v(this,"_statusMap",void 0),v(this,"pendingTilesRegister",new eA),this._statusMap={}}var t=e.prototype;return t.add=function(n,i,a,o){var s=this;if(!this._statusMap[i]){var u=o.frameNumber,f=o.viewport.id;this._statusMap[i]={request:n,callback:a,key:i,frameState:o,status:$h.REQUESTED},this.pendingTilesRegister.register(f,u),n().then(function(c){s._statusMap[i].status=$h.COMPLETED;var l=s._statusMap[i].frameState,d=l.frameNumber,h=l.viewport.id;s.pendingTilesRegister.deregister(h,d),s._statusMap[i].callback(c,o)}).catch(function(c){s._statusMap[i].status=$h.ERROR;var l=s._statusMap[i].frameState,d=l.frameNumber,h=l.viewport.id;s.pendingTilesRegister.deregister(h,d),a(c)})}},t.update=function(n,i){if(this._statusMap[n]){var a=this._statusMap[n].frameState,o=a.frameNumber,s=a.viewport.id;this.pendingTilesRegister.deregister(s,o);var u=i.frameNumber,f=i.viewport.id;this.pendingTilesRegister.register(f,u),this._statusMap[n].frameState=i}},t.find=function(n){return this._statusMap[n]},t.hasPendingTiles=function(n,i){return!this.pendingTilesRegister.isZero(n,i)},e}();function Bu(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bu=function(r){return typeof r}:Bu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Bu(e)}function rA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rA(Object(r),!0).forEach(function(n){wN(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nA(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function xN(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){nA(a,n,i,o,s,"next",u)}function s(u){nA(a,n,i,o,s,"throw",u)}o(void 0)})}}function EN(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ON(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
202
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function ON(e,t){if(e){if(typeof e=="string")return iA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return iA(e,t)}}function iA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function PN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BN(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Zh(e,t)}function Zh(e,t){return Zh=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Zh(e,t)}function CN(e){var t=IN();return function(){var n=Cu(e),i;if(t){var a=Cu(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return MN(this,i)}}function MN(e,t){if(t&&(Bu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aA(e)}function aA(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function IN(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Cu(e){return Cu=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Cu(e)}var sA=function(e){BN(r,e);var t=CN(r);function r(i){var a;return PN(this,r),a=t.call(this,i),v(aA(a),"_tileManager",void 0),a._tileManager=new tA,a}var n=r.prototype;return n.traversalFinished=function(a){return!this._tileManager.hasPendingTiles(a.viewport.id,this._frameNumber||0)},n.shouldRefine=function(a,o){return a._lodJudge=H1(a,o),a._lodJudge==="DIG"},n.updateChildTiles=function(a,o){var s=this,u=a.header.children||[],f=a.children,c=a.tileset,l=EN(u),d;try{var h=function(){var m=d.value,g="".concat(m.id,"-").concat(o.viewport.id),y=f&&f.find(function(S){return S.id===g});if(y)y&&s.updateTile(y,o);else{var b=function(){return s._loadTile(m.id,c)},A=s._tileManager.find(g);A?s._tileManager.update(g,o):(c.tileset.nodePages&&(b=function(){return c.tileset.nodePagesTile.formTileFromNodePages(m.id)}),s._tileManager.add(b,g,function(S){return s._onTileLoad(S,a,g)},o))}};for(l.s();!(d=l.n()).done;)h()}catch(p){l.e(p)}finally{l.f()}return!1},n._loadTile=function(){var i=xN(regeneratorRuntime.mark(function o(s,u){var f,c,l;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return f=u.loader,c=u.getTileUrl("".concat(u.url,"/nodes/").concat(s)),l=Pu(Pu({},u.loadOptions),{},{i3s:Pu(Pu({},u.loadOptions.i3s),{},{isTileHeader:!0})}),h.next=5,(0,oA.load)(c,f,l);case 5:return h.abrupt("return",h.sent);case 6:case"end":return h.stop()}},o)}));function a(o,s){return i.apply(this,arguments)}return a}(),n._onTileLoad=function(a,o,s){var u=new la(o.tileset,a,o,s);o.children.push(u);var f=this._tileManager.find(u.id).frameState;this.updateTile(u,f),this._frameNumber===f.frameNumber&&(this.traversalFinished(f)||new Date().getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(u,f)},r}(Pr);function uA(e,t){return LN(e)||FN(e,t)||bA(e,t)||RN()}function RN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
203
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FN(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function LN(e){if(Array.isArray(e))return e}function rr(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=bA(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
204
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function bA(e,t){if(e){if(typeof e=="string")return fA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fA(e,t)}}function fA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function cA(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function Qh(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){cA(a,n,i,o,s,"next",u)}function s(u){cA(a,n,i,o,s,"throw",u)}o(void 0)})}}function lA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Br(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lA(Object(r),!0).forEach(function(n){DN(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function NN(e,t,r){return t&&hA(e.prototype,t),r&&hA(e,r),e}var UN={description:"",ellipsoid:oe.WGS84,modelMatrix:new J,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){},onTraversalComplete:function(t){return t},contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},Mu="Tiles In Tileset(s)",ed="Tiles In Memory",dA="Tiles In View",pA="Tiles To Render",mA="Tiles Loaded",td="Tiles Loading",vA="Tiles Unloaded",gA="Failed Tile Loads",yA="Points/Vertices",rd="Tile Memory Use",nd=function(){function e(r,n){GN(this,e),v(this,"options",void 0),v(this,"loadOptions",void 0),v(this,"type",void 0),v(this,"tileset",void 0),v(this,"loader",void 0),v(this,"url",void 0),v(this,"basePath",void 0),v(this,"modelMatrix",void 0),v(this,"ellipsoid",void 0),v(this,"lodMetricType",void 0),v(this,"lodMetricValue",void 0),v(this,"refine",void 0),v(this,"root",null),v(this,"roots",{}),v(this,"asset",{}),v(this,"description",""),v(this,"properties",void 0),v(this,"extras",null),v(this,"attributions",{}),v(this,"credits",{}),v(this,"stats",void 0),v(this,"contentFormats",{draco:!1,meshopt:!1,dds:!1,ktx2:!1}),v(this,"cartographicCenter",null),v(this,"cartesianCenter",null),v(this,"zoom",1),v(this,"boundingVolume",null),v(this,"dynamicScreenSpaceErrorComputedDensity",0),v(this,"maximumMemoryUsage",32),v(this,"gpuMemoryUsageInBytes",0),v(this,"_frameNumber",0),v(this,"_queryParams",{}),v(this,"_extensionsUsed",[]),v(this,"_tiles",{}),v(this,"_pendingCount",0),v(this,"selectedTiles",[]),v(this,"traverseCounter",0),v(this,"geometricError",0),v(this,"lastUpdatedVieports",null),v(this,"_requestedTiles",[]),v(this,"_emptyTiles",[]),v(this,"frameStateData",{}),v(this,"_traverser",void 0),v(this,"_cache",new g1),v(this,"_requestScheduler",void 0),v(this,"updatePromise",null),v(this,"tilesetInitializationPromise",void 0),this.options=Br(Br({},UN),n),this.tileset=r,this.loader=r.loader,this.type=r.type,this.url=r.url,this.basePath=r.basePath||xn.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=r.lodMetricType,this.lodMetricValue=r.lodMetricValue,this.refine=r.root.refine,this.loadOptions=this.options.loadOptions||{},this._traverser=this._initializeTraverser(),this._requestScheduler=new Bi({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.stats=new ei({id:this.url}),this._initializeStats(),this.tilesetInitializationPromise=this._initializeTileSet(r)}var t=e.prototype;return t.destroy=function(){this._destroy()},t.isLoaded=function(){return this._pendingCount===0&&this._frameNumber!==0&&this._requestedTiles.length===0},t.setProps=function(n){this.options=Br(Br({},this.options),n)},t.setOptions=function(n){this.options=Br(Br({},this.options),n)},t.getTileUrl=function(n){var i=n.startsWith("data:");return i?n:"".concat(n).concat(n.includes("?")?"&":"?").concat(this.queryParams)},t.hasExtension=function(n){return Boolean(this._extensionsUsed.indexOf(n)>-1)},t.update=function(){var n=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.tilesetInitializationPromise.then(function(){!i&&n.lastUpdatedVieports?i=n.lastUpdatedVieports:n.lastUpdatedVieports=i,i&&n.doUpdate(i)})},t.selectTiles=function(){var r=Qh(regeneratorRuntime.mark(function i(){var a=this,o,s=arguments;return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return o=s.length>0&&s[0]!==void 0?s[0]:null,f.next=3,this.tilesetInitializationPromise;case 3:return o&&(this.lastUpdatedVieports=o),this.updatePromise||(this.updatePromise=new Promise(function(c){setTimeout(function(){a.lastUpdatedVieports&&a.doUpdate(a.lastUpdatedVieports),c(a._frameNumber),a.updatePromise=null},a.options.debounceTime)})),f.abrupt("return",this.updatePromise);case 6:case"end":return f.stop()}},i,this)}));function n(){return r.apply(this,arguments)}return n}(),t.doUpdate=function(n){if(!("loadTiles"in this.options&&!this.options.loadTiles)&&!(this.traverseCounter>0)){var i=n instanceof Array?n:[n];this._cache.reset(),this._frameNumber++,this.traverseCounter=i.length;var a=[],o=rr(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,f=u.id;this._needTraverse(f)?a.push(f):this.traverseCounter--}}catch(m){o.e(m)}finally{o.f()}var c=rr(i),l;try{for(c.s();!(l=c.n()).done;){var d=l.value,h=d.id;if(this.roots[h]||(this.roots[h]=this._initializeTileHeaders(this.tileset,null)),!!a.includes(h)){var p=w1(d,this._frameNumber);this._traverser.traverse(this.roots[h],p,this.options)}}}catch(m){c.e(m)}finally{c.f()}}},t._needTraverse=function(n){var i=n;return this.options.viewportTraversersMap&&(i=this.options.viewportTraversersMap[n]),i===n},t._onTraversalEnd=function(n){var i=n.viewport.id;this.frameStateData[i]||(this.frameStateData[i]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});var a=this.frameStateData[i],o=Object.values(this._traverser.selectedTiles),s=x1(o,n,this.options.maximumTilesSelected),u=uA(s,2),f=u[0],c=u[1];a.selectedTiles=f;var l=rr(c),d;try{for(l.s();!(d=l.n()).done;){var h=d.value;h.unselect()}}catch(p){l.e(p)}finally{l.f()}a._requestedTiles=Object.values(this._traverser.requestedTiles),a._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,!(this.traverseCounter>0)&&this._updateTiles()},t._updateTiles=function(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(var n in this.frameStateData){var i=this.frameStateData[n];this.selectedTiles=this.selectedTiles.concat(i.selectedTiles),this._requestedTiles=this._requestedTiles.concat(i._requestedTiles),this._emptyTiles=this._emptyTiles.concat(i._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);var a=rr(this.selectedTiles),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;this._tiles[s.id]=s}}catch(u){a.e(u)}finally{a.f()}this._loadTiles(),this._unloadTiles(),this._updateStats()},t._tilesChanged=function(n,i){if(n.length!==i.length)return!0;var a=new Set(n.map(function(u){return u.id})),o=new Set(i.map(function(u){return u.id})),s=n.filter(function(u){return!o.has(u.id)}).length>0;return s=s||i.filter(function(u){return!a.has(u.id)}).length>0,s},t._loadTiles=function(){var n=rr(this._requestedTiles),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.contentUnloaded&&this._loadTile(a)}}catch(o){n.e(o)}finally{n.f()}},t._unloadTiles=function(){this._cache.unloadTiles(this,function(n,i){return n._unloadTile(i)})},t._updateStats=function(){var n=0,i=0,a=rr(this.selectedTiles),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.contentAvailable&&s.content&&(n++,s.content.pointCount?i+=s.content.pointCount:i+=s.content.vertexCount)}}catch(u){a.e(u)}finally{a.f()}this.stats.get(dA).count=this.selectedTiles.length,this.stats.get(pA).count=n,this.stats.get(yA).count=i},t._initializeTileSet=function(){var r=Qh(regeneratorRuntime.mark(function i(a){return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(this.type!==Re.I3S){s.next=5;break}return this.calculateViewPropsI3S(),s.next=4,a.root;case 4:a.root=s.sent;case 5:this.root=this._initializeTileHeaders(a,null),this.type===Re.TILES3D&&(this._initializeTiles3DTileset(a),this.calculateViewPropsTiles3D()),this.type===Re.I3S&&this._initializeI3STileset();case 8:case"end":return s.stop()}},i,this)}));function n(i){return r.apply(this,arguments)}return n}(),t.calculateViewPropsI3S=function(){var n,i=this.tileset.fullExtent;if(i){var a=i.xmin,o=i.xmax,s=i.ymin,u=i.ymax,f=i.zmin,c=i.zmax;this.cartographicCenter=new E(a+(o-a)/2,s+(u-s)/2,f+(c-f)/2),this.cartesianCenter=oe.WGS84.cartographicToCartesian(this.cartographicCenter,new E),this.zoom=Vh(i,this.cartographicCenter,this.cartesianCenter);return}var l=(n=this.tileset.store)===null||n===void 0?void 0:n.extent;if(l){var d=uA(l,4),h=d[0],p=d[1],m=d[2],g=d[3];this.cartographicCenter=new E(h+(m-h)/2,p+(g-p)/2,0),this.cartesianCenter=oe.WGS84.cartographicToCartesian(this.cartographicCenter,new E),this.zoom=B1(l,this.cartographicCenter,this.cartesianCenter);return}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new E,this.zoom=1},t.calculateViewPropsTiles3D=function(){var n=this.root,i=n.boundingVolume.center;if(!i){console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new E,this.zoom=1;return}i[0]!==0||i[1]!==0||i[2]!==0?this.cartographicCenter=oe.WGS84.cartesianToCartographic(i,new E):this.cartographicCenter=new E(0,0,-oe.WGS84.radii[0]),this.cartesianCenter=i,this.zoom=P1(n.boundingVolume,this.cartographicCenter)},t._initializeStats=function(){this.stats.get(Mu),this.stats.get(td),this.stats.get(ed),this.stats.get(dA),this.stats.get(pA),this.stats.get(mA),this.stats.get(vA),this.stats.get(gA),this.stats.get(yA),this.stats.get(rd,"memory")},t._initializeTileHeaders=function(n,i){var a=new la(this,n.root,i);if(i&&(i.children.push(a),a.depth=i.depth+1),this.type===Re.TILES3D){var o=[];for(o.push(a);o.length>0;){var s=o.pop();this.stats.get(Mu).incrementCount();var u=s.header.children||[],f=rr(u),c;try{for(f.s();!(c=f.n()).done;){var l=c.value,d,h=new la(this,l,s);if((d=h.contentUrl)!==null&&d!==void 0&&d.includes("?session=")){var p=new URL(h.contentUrl),m=p.searchParams.get("session");m&&(this._queryParams.session=m)}s.children.push(h),h.depth=s.depth+1,o.push(h)}}catch(g){f.e(g)}finally{f.f()}}}return a},t._initializeTraverser=function(){var n,i=this.type;switch(i){case Re.TILES3D:n=Q1;break;case Re.I3S:n=sA;break;default:n=Pr}return new n({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})},t._destroyTileHeaders=function(n){this._destroySubtree(n)},t._loadTile=function(){var r=Qh(regeneratorRuntime.mark(function i(a){var o;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,this._onStartTileLoading(),u.next=4,a.loadContent();case 4:o=u.sent,u.next=10;break;case 7:u.prev=7,u.t0=u.catch(0),this._onTileLoadError(a,u.t0 instanceof Error?u.t0:new Error("load failed"));case 10:return u.prev=10,this._onEndTileLoading(),this._onTileLoad(a,o),u.finish(10);case 14:case"end":return u.stop()}},i,this,[[0,7,10,14]])}));function n(i){return r.apply(this,arguments)}return n}(),t._onTileLoadError=function(n,i){this.stats.get(gA).incrementCount();var a=i.message||i.toString(),o=n.url;console.error("A 3D tile failed to load: ".concat(n.url," ").concat(a)),this.options.onTileError(n,a,o)},t._onTileLoad=function(n,i){if(i){if(this.type===Re.I3S){var a,o,s=((a=this.tileset)===null||a===void 0||(o=a.nodePagesTile)===null||o===void 0?void 0:o.nodesInNodePages)||0;this.stats.get(Mu).reset(),this.stats.get(Mu).addCount(s)}n&&n.content&&y1(n,n.content),this.updateContentTypes(n),this._addTileToCache(n),this.options.onTileLoad(n)}},t.updateContentTypes=function(n){if(this.type===Re.I3S)switch(n.header.isDracoGeometry&&(this.contentFormats.draco=!0),n.header.textureFormat){case"dds":this.contentFormats.dds=!0;break;case"ktx2":this.contentFormats.ktx2=!0;break;default:}else if(this.type===Re.TILES3D){var i,a=((i=n.content)===null||i===void 0?void 0:i.gltf)||{},o=a.extensionsRemoved,s=o===void 0?[]:o;s.includes("KHR_draco_mesh_compression")&&(this.contentFormats.draco=!0),s.includes("EXT_meshopt_compression")&&(this.contentFormats.meshopt=!0),s.includes("KHR_texture_basisu")&&(this.contentFormats.ktx2=!0)}},t._onStartTileLoading=function(){this._pendingCount++,this.stats.get(td).incrementCount()},t._onEndTileLoading=function(){this._pendingCount--,this.stats.get(td).decrementCount()},t._addTileToCache=function(n){this._cache.add(this,n,function(i){return i._updateCacheStats(n)})},t._updateCacheStats=function(n){this.stats.get(mA).incrementCount(),this.stats.get(ed).incrementCount(),this.gpuMemoryUsageInBytes+=n.gpuMemoryUsageInBytes||0,this.stats.get(rd).count=this.gpuMemoryUsageInBytes},t._unloadTile=function(n){this.gpuMemoryUsageInBytes-=n.gpuMemoryUsageInBytes||0,this.stats.get(ed).decrementCount(),this.stats.get(vA).incrementCount(),this.stats.get(rd).count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(n),n.unloadContent()},t._destroy=function(){var n=[];for(this.root&&n.push(this.root);n.length>0;){var i=n.pop(),a=rr(i.children),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;n.push(s)}}catch(u){a.e(u)}finally{a.f()}this._destroyTile(i)}this.root=null},t._destroySubtree=function(n){var i=n,a=[];for(a.push(i);a.length>0;){n=a.pop();var o=rr(n.children),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;a.push(u)}}catch(f){o.e(f)}finally{o.f()}n!==i&&this._destroyTile(n)}i.children=[]},t._destroyTile=function(n){this._cache.unloadTile(this,n),this._unloadTile(n),n.destroy()},t._initializeTiles3DTileset=function(n){if(n.queryString){var i=new URLSearchParams(n.queryString),a=Object.fromEntries(i.entries());this._queryParams=Br(Br({},this._queryParams),a)}if(this.asset=n.asset,!this.asset)throw new Error("Tileset must have an asset property.");if(this.asset.version!=="0.0"&&this.asset.version!=="1.0")throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=n.properties,this.geometricError=n.geometricError,this._extensionsUsed=n.extensionsUsed||[],this.extras=n.extras},t._initializeI3STileset=function(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)},NN(e,[{key:"tiles",get:function(){return Object.values(this._tiles)}},{key:"frameNumber",get:function(){return this._frameNumber}},{key:"queryParams",get:function(){return new URLSearchParams(this._queryParams).toString()}}]),e}();var Iu="3.4.13";var cn={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Xee=Object.keys(cn);function id(e,t,r){Z(e instanceof ArrayBuffer);var n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r),a=n.decode(i);return a}function _A(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=new DataView(e);return"".concat(String.fromCharCode(r.getUint8(t+0))).concat(String.fromCharCode(r.getUint8(t+1))).concat(String.fromCharCode(r.getUint8(t+2))).concat(String.fromCharCode(r.getUint8(t+3)))}var AA="3.4.13";function Ru(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ru=function(r){return typeof r}:Ru=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ru(e)}var jN={draco:{decoderType:(typeof WebAssembly>"u"?"undefined":Ru(WebAssembly))==="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},TA={name:"Draco",id:Vt?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:AA,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:jN};function ln(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length,f=0;f<u;f+=3){var c=s[f],l=s[f+1],d=s[f+2];t=c<t?c:t,r=l<r?l:r,n=d<n?d:n,i=c>i?c:i,a=l>a?l:a,o=d>o?d:o}return[[t,r,n],[i,a,o]]}function SA(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function wA(e){return VN(e)||HN(e)||EA(e)||kN()}function kN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
205
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function VN(e){if(Array.isArray(e))return od(e)}function ad(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=EA(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
206
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function EA(e,t){if(e){if(typeof e=="string")return od(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return od(e,t)}}function od(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function zN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ha=function(){function e(r,n){zN(this,e),v(this,"fields",void 0),v(this,"metadata",void 0),SA(Array.isArray(r)),WN(r),this.fields=r,this.metadata=n||new Map}var t=e.prototype;return t.compareTo=function(n){if(this.metadata!==n.metadata||this.fields.length!==n.fields.length)return!1;for(var i=0;i<this.fields.length;++i)if(!this.fields[i].compareTo(n.fields[i]))return!1;return!0},t.select=function(){for(var n=Object.create(null),i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++){var f=u[s];n[f]=!0}var c=this.fields.filter(function(l){return n[l.name]});return new e(c,this.metadata)},t.selectAt=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=a.map(function(u){return n.fields[u]}).filter(Boolean);return new e(s,this.metadata)},t.assign=function(n){var i,a=this.metadata;if(n instanceof e){var o=n;i=o.fields,a=xA(xA(new Map,this.metadata),o.metadata)}else i=n;var s=Object.create(null),u=ad(this.fields),f;try{for(u.s();!(f=u.n()).done;){var c=f.value;s[c.name]=c}}catch(m){u.e(m)}finally{u.f()}var l=ad(i),d;try{for(l.s();!(d=l.n()).done;){var h=d.value;s[h.name]=h}}catch(m){l.e(m)}finally{l.f()}var p=Object.values(s);return new e(p,a)},e}();function WN(e){var t={},r=ad(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;t[i.name]&&console.warn("Schema: duplicated field name",i.name,i),t[i.name]=!0}}catch(a){r.e(a)}finally{r.f()}}function xA(e,t){return new Map([].concat(wA(e||new Map),wA(t||new Map)))}function JN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function XN(e,t,r){return t&&OA(e.prototype,t),r&&OA(e,r),e}var da=function(){function e(r,n){JN(this,e);var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map;v(this,"name",void 0),v(this,"type",void 0),v(this,"nullable",void 0),v(this,"metadata",void 0),this.name=r,this.type=n,this.nullable=i,this.metadata=a}var t=e.prototype;return t.clone=function(){return new e(this.name,this.type,this.nullable,this.metadata)},t.compareTo=function(n){return this.name===n.name&&this.type===n.type&&this.nullable===n.nullable&&this.metadata===n.metadata},t.toString=function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")},XN(e,[{key:"typeId",get:function(){return this.type&&this.type.typeId}}]),e}();var se=function(e){return e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e}({});function Fu(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fu=function(r){return typeof r}:Fu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Fu(e)}function ie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&sd(e,t)}function sd(e,t){return sd=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},sd(e,t)}function ae(e){var t=KN();return function(){var n=Lu(e),i;if(t){var a=Lu(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return qN(this,i)}}function qN(e,t){if(t&&(Fu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $e(e)}function $e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KN(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Lu(e){return Lu=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Lu(e)}function te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ze(e,t,r){return t&&PA(e.prototype,t),r&&PA(e,r),e}var BA,CA,MA,IA,RA,FA,LA,DA,Je=function(){function e(){te(this,e)}e.isNull=function(n){return n&&n.typeId===se.Null},e.isInt=function(n){return n&&n.typeId===se.Int},e.isFloat=function(n){return n&&n.typeId===se.Float},e.isBinary=function(n){return n&&n.typeId===se.Binary},e.isUtf8=function(n){return n&&n.typeId===se.Utf8},e.isBool=function(n){return n&&n.typeId===se.Bool},e.isDecimal=function(n){return n&&n.typeId===se.Decimal},e.isDate=function(n){return n&&n.typeId===se.Date},e.isTime=function(n){return n&&n.typeId===se.Time},e.isTimestamp=function(n){return n&&n.typeId===se.Timestamp},e.isInterval=function(n){return n&&n.typeId===se.Interval},e.isList=function(n){return n&&n.typeId===se.List},e.isStruct=function(n){return n&&n.typeId===se.Struct},e.isUnion=function(n){return n&&n.typeId===se.Union},e.isFixedSizeBinary=function(n){return n&&n.typeId===se.FixedSizeBinary},e.isFixedSizeList=function(n){return n&&n.typeId===se.FixedSizeList},e.isMap=function(n){return n&&n.typeId===se.Map},e.isDictionary=function(n){return n&&n.typeId===se.Dictionary};var t=e.prototype;return t.compareTo=function(n){return this===n},Ze(e,[{key:"typeId",get:function(){return se.NONE}}]),e}(),GA=function(e,t){ie(n,e);var r=ae(n);function n(){return te(this,n),r.apply(this,arguments)}var i=n.prototype;return i.toString=function(){return"Null"},Ze(n,[{key:"typeId",get:function(){return se.Null}},{key:t,get:function(){return"Null"}}]),n}(Je,Symbol.toStringTag),NA=function(e,t){ie(n,e);var r=ae(n);function n(){return te(this,n),r.apply(this,arguments)}var i=n.prototype;return i.toString=function(){return"Bool"},Ze(n,[{key:"typeId",get:function(){return se.Bool}},{key:t,get:function(){return"Bool"}}]),n}(Je,Symbol.toStringTag);BA=Symbol.toStringTag;var Gt=function(e,t){ie(n,e);var r=ae(n);function n(a,o){var s;return te(this,n),s=r.call(this),v($e(s),"isSigned",void 0),v($e(s),"bitWidth",void 0),s.isSigned=a,s.bitWidth=o,s}var i=n.prototype;return i.toString=function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)},Ze(n,[{key:"typeId",get:function(){return se.Int}},{key:t,get:function(){return"Int"}}]),n}(Je,BA),Du=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,!0,8)}return r}(Gt),Gu=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,!0,16)}return r}(Gt),Nu=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,!0,32)}return r}(Gt),UA=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,!0,64)}return r}(Gt),Uu=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,!1,8)}return r}(Gt),ju=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,!1,16)}return r}(Gt),ku=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,!1,32)}return r}(Gt),jA=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,!1,64)}return r}(Gt),ud={HALF:16,SINGLE:32,DOUBLE:64};CA=Symbol.toStringTag;var pa=function(e,t){ie(n,e);var r=ae(n);function n(a){var o;return te(this,n),o=r.call(this),v($e(o),"precision",void 0),o.precision=a,o}var i=n.prototype;return i.toString=function(){return"Float".concat(this.precision)},Ze(n,[{key:"typeId",get:function(){return se.Float}},{key:t,get:function(){return"Float"}}]),n}(Je,CA),kA=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,ud.HALF)}return r}(pa),Hu=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,ud.SINGLE)}return r}(pa),Vu=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,ud.DOUBLE)}return r}(pa),HA=function(e,t){ie(n,e);var r=ae(n);function n(){return te(this,n),r.call(this)}var i=n.prototype;return i.toString=function(){return"Binary"},Ze(n,[{key:"typeId",get:function(){return se.Binary}},{key:t,get:function(){return"Binary"}}]),n}(Je,Symbol.toStringTag),VA=function(e,t){ie(n,e);var r=ae(n);function n(){return te(this,n),r.apply(this,arguments)}var i=n.prototype;return i.toString=function(){return"Utf8"},Ze(n,[{key:"typeId",get:function(){return se.Utf8}},{key:t,get:function(){return"Utf8"}}]),n}(Je,Symbol.toStringTag),fd={DAY:0,MILLISECOND:1};MA=Symbol.toStringTag;var zu=function(e,t){ie(n,e);var r=ae(n);function n(a){var o;return te(this,n),o=r.call(this),v($e(o),"unit",void 0),o.unit=a,o}var i=n.prototype;return i.toString=function(){return"Date".concat((this.unit+1)*32,"<").concat(fd[this.unit],">")},Ze(n,[{key:"typeId",get:function(){return se.Date}},{key:t,get:function(){return"Date"}}]),n}(Je,MA),zA=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,fd.DAY)}return r}(zu),WA=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,fd.MILLISECOND)}return r}(zu),Cr={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9};IA=Symbol.toStringTag;var Wu=function(e,t){ie(n,e);var r=ae(n);function n(a,o){var s;return te(this,n),s=r.call(this),v($e(s),"unit",void 0),v($e(s),"bitWidth",void 0),s.unit=a,s.bitWidth=o,s}var i=n.prototype;return i.toString=function(){return"Time".concat(this.bitWidth,"<").concat(Cr[this.unit],">")},Ze(n,[{key:"typeId",get:function(){return se.Time}},{key:t,get:function(){return"Time"}}]),n}(Je,IA),JA=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,Cr.SECOND,32)}return r}(Wu),XA=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,Cr.MILLISECOND,32)}return r}(Wu);RA=Symbol.toStringTag;var ii=function(e,t){ie(n,e);var r=ae(n);function n(a){var o;te(this,n);var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return o=r.call(this),v($e(o),"unit",void 0),v($e(o),"timezone",void 0),o.unit=a,o.timezone=s,o}var i=n.prototype;return i.toString=function(){return"Timestamp<".concat(Cr[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")},Ze(n,[{key:"typeId",get:function(){return se.Timestamp}},{key:t,get:function(){return"Timestamp"}}]),n}(Je,RA),qA=function(e){ie(r,e);var t=ae(r);function r(){te(this,r);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return t.call(this,Cr.SECOND,n)}return r}(ii),KA=function(e){ie(r,e);var t=ae(r);function r(){te(this,r);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return t.call(this,Cr.MILLISECOND,n)}return r}(ii),YA=function(e){ie(r,e);var t=ae(r);function r(){te(this,r);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return t.call(this,Cr.MICROSECOND,n)}return r}(ii),$A=function(e){ie(r,e);var t=ae(r);function r(){te(this,r);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return t.call(this,Cr.NANOSECOND,n)}return r}(ii),cd={DAY_TIME:0,YEAR_MONTH:1};FA=Symbol.toStringTag;var Ju=function(e,t){ie(n,e);var r=ae(n);function n(a){var o;return te(this,n),o=r.call(this),v($e(o),"unit",void 0),o.unit=a,o}var i=n.prototype;return i.toString=function(){return"Interval<".concat(cd[this.unit],">")},Ze(n,[{key:"typeId",get:function(){return se.Interval}},{key:t,get:function(){return"Interval"}}]),n}(Je,FA),ZA=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,cd.DAY_TIME)}return r}(Ju),QA=function(e){ie(r,e);var t=ae(r);function r(){return te(this,r),t.call(this,cd.YEAR_MONTH)}return r}(Ju);LA=Symbol.toStringTag;var Xu=function(e,t){ie(n,e);var r=ae(n);function n(a,o){var s;return te(this,n),s=r.call(this),v($e(s),"listSize",void 0),v($e(s),"children",void 0),s.listSize=a,s.children=[o],s}var i=n.prototype;return i.toString=function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")},Ze(n,[{key:"typeId",get:function(){return se.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:t,get:function(){return"FixedSizeList"}}]),n}(Je,LA);DA=Symbol.toStringTag;var eT=function(e,t){ie(n,e);var r=ae(n);function n(a){var o;return te(this,n),o=r.call(this),v($e(o),"children",void 0),o.children=a,o}var i=n.prototype;return i.toString=function(){return"Struct<{".concat(this.children.map(function(o){return"".concat(o.name,":").concat(o.type)}).join(", "),"}>")},Ze(n,[{key:"typeId",get:function(){return se.Struct}},{key:t,get:function(){return"Struct"}}]),n}(Je,DA);function tT(e){switch(e.constructor){case Int8Array:return new Du;case Uint8Array:return new Uu;case Int16Array:return new Gu;case Uint16Array:return new ju;case Int32Array:return new Nu;case Uint32Array:return new ku;case Float32Array:return new Hu;case Float64Array:return new Vu;default:throw new Error("array type not supported")}}function ld(e,t,r){var n=tT(t.value),i=r||rT(t),a=new da(e,new Xu(t.size,new da("value",n)),!1,i);return a}function rT(e){var t=new Map;return"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10)),"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10)),"normalized"in e&&t.set("normalized",e.normalized.toString()),t}function iT(e,t,r){var n=aT(t.metadata),i=[],a=YN(t.attributes);for(var o in e){var s=e[o],u=nT(o,s,a[o]);i.push(u)}if(r){var f=nT("indices",r);i.push(f)}return new ha(i,n)}function YN(e){var t={};for(var r in e){var n=e[r];t[n.name||"undefined"]=n}return t}function nT(e,t,r){var n=r?aT(r.metadata):void 0,i=ld(e,t,n);return i}function aT(e){var t=new Map;for(var r in e)t.set("".concat(r,".string"),JSON.stringify(e[r]));return t}function $N(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=dd(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
207
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function oT(e){return eU(e)||QN(e)||dd(e)||ZN()}function ZN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
208
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function eU(e){if(Array.isArray(e))return hd(e)}function tU(e,t){return iU(e)||nU(e,t)||dd(e,t)||rU()}function rU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
209
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dd(e,t){if(e){if(typeof e=="string")return hd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hd(e,t)}}function hd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function nU(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function iU(e){if(Array.isArray(e))return e}function sT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function uT(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sT(Object(r),!0).forEach(function(n){aU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var fT={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},sU={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},uU=4,cT=function(){function e(r){oU(this,e),v(this,"draco",void 0),v(this,"decoder",void 0),v(this,"metadataQuerier",void 0),this.draco=r,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}var t=e.prototype;return t.destroy=function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)},t.parseSync=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=new this.draco.DecoderBuffer;a.Init(new Int8Array(n),n.byteLength),this._disableAttributeTransforms(i);var o=this.decoder.GetEncodedGeometryType(a),s=o===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var u;switch(o){case this.draco.TRIANGULAR_MESH:u=this.decoder.DecodeBufferToMesh(a,s);break;case this.draco.POINT_CLOUD:u=this.decoder.DecodeBufferToPointCloud(a,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!u.ok()||!s.ptr){var f="DRACO decompression failed: ".concat(u.error_msg());throw new Error(f)}var c=this._getDracoLoaderData(s,o,i),l=this._getMeshData(s,c,i),d=ln(l.attributes),h=iT(l.attributes,c,l.indices),p=uT(uT({loader:"draco",loaderData:c,header:{vertexCount:s.num_points(),boundingBox:d}},l),{},{schema:h});return p}finally{this.draco.destroy(a),s&&this.draco.destroy(s)}},t._getDracoLoaderData=function(n,i,a){var o=this._getTopLevelMetadata(n),s=this._getDracoAttributes(n,a);return{geometry_type:i,num_attributes:n.num_attributes(),num_points:n.num_points(),num_faces:n instanceof this.draco.Mesh?n.num_faces():0,metadata:o,attributes:s}},t._getDracoAttributes=function(n,i){for(var a={},o=0;o<n.num_attributes();o++){var s=this.decoder.GetAttribute(n,o),u=this._getAttributeMetadata(n,o);a[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:o,metadata:u};var f=this._getQuantizationTransform(s,i);f&&(a[s.unique_id()].quantization_transform=f);var c=this._getOctahedronTransform(s,i);c&&(a[s.unique_id()].octahedron_transform=c)}return a},t._getMeshData=function(n,i,a){var o=this._getMeshAttributes(i,n,a),s=o.POSITION;if(!s)throw new Error("DRACO: No position attribute found.");if(n instanceof this.draco.Mesh)switch(a.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:o,indices:{value:this._getTriangleStripIndices(n),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:o,indices:{value:this._getTriangleListIndices(n),size:1}}}return{topology:"point-list",mode:0,attributes:o}},t._getMeshAttributes=function(n,i,a){for(var o={},s=0,u=Object.values(n.attributes);s<u.length;s++){var f=u[s],c=this._deduceAttributeName(f,a);f.name=c;var l=this._getAttributeValues(i,f),d=l.value,h=l.size;o[c]={value:d,size:h,byteOffset:f.byte_offset,byteStride:f.byte_stride,normalized:f.normalized}}return o},t._getTriangleListIndices=function(n){var i=n.num_faces(),a=i*3,o=a*uU,s=this.draco._malloc(o);try{return this.decoder.GetTrianglesUInt32Array(n,o,s),new Uint32Array(this.draco.HEAPF32.buffer,s,a).slice()}finally{this.draco._free(s)}},t._getTriangleStripIndices=function(n){var i=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(n,i),lU(i)}finally{this.draco.destroy(i)}},t._getAttributeValues=function(n,i){var a=sU[i.data_type],o=i.num_components,s=n.num_points(),u=s*o,f=u*a.BYTES_PER_ELEMENT,c=fU(this.draco,a),l,d=this.draco._malloc(f);try{var h=this.decoder.GetAttribute(n,i.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(n,h,c,f,d),l=new a(this.draco.HEAPF32.buffer,d,u).slice()}finally{this.draco._free(d)}return{value:l,size:o}},t._deduceAttributeName=function(n,i){for(var a=n.unique_id,o=0,s=Object.entries(i.extraAttributes||{});o<s.length;o++){var u=tU(s[o],2),f=u[0],c=u[1];if(c===a)return f}var l=n.attribute_type;for(var d in fT){var h=this.draco[d];if(h===l)return fT[d]}var p=i.attributeNameEntry||"name";return n.metadata[p]?n.metadata[p].string:"CUSTOM_ATTRIBUTE_".concat(a)},t._getTopLevelMetadata=function(n){var i=this.decoder.GetMetadata(n);return this._getDracoMetadata(i)},t._getAttributeMetadata=function(n,i){var a=this.decoder.GetAttributeMetadata(n,i);return this._getDracoMetadata(a)},t._getDracoMetadata=function(n){if(!n||!n.ptr)return{};for(var i={},a=this.metadataQuerier.NumEntries(n),o=0;o<a;o++){var s=this.metadataQuerier.GetEntryName(n,o);i[s]=this._getDracoMetadataField(n,s)}return i},t._getDracoMetadataField=function(n,i){var a=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(n,i,a);var o=cU(a);return{int:this.metadataQuerier.GetIntEntry(n,i),string:this.metadataQuerier.GetStringEntry(n,i),double:this.metadataQuerier.GetDoubleEntry(n,i),intArray:o}}finally{this.draco.destroy(a)}},t._disableAttributeTransforms=function(n){var i=n.quantizedAttributes,a=i===void 0?[]:i,o=n.octahedronAttributes,s=o===void 0?[]:o,u=[].concat(oT(a),oT(s)),f=$N(u),c;try{for(f.s();!(c=f.n()).done;){var l=c.value;this.decoder.SkipAttributeTransform(this.draco[l])}}catch(d){f.e(d)}finally{f.f()}},t._getQuantizationTransform=function(n,i){var a=this,o=i.quantizedAttributes,s=o===void 0?[]:o,u=n.attribute_type(),f=s.map(function(l){return a.decoder[l]}).includes(u);if(f){var c=new this.draco.AttributeQuantizationTransform;try{if(c.InitFromAttribute(n))return{quantization_bits:c.quantization_bits(),range:c.range(),min_values:new Float32Array([1,2,3]).map(function(l){return c.min_value(l)})}}finally{this.draco.destroy(c)}}return null},t._getOctahedronTransform=function(n,i){var a=this,o=i.octahedronAttributes,s=o===void 0?[]:o,u=n.attribute_type(),f=s.map(function(l){return a.decoder[l]}).includes(u);if(f){var c=new this.draco.AttributeQuantizationTransform;try{if(c.InitFromAttribute(n))return{quantization_bits:c.quantization_bits()}}finally{this.draco.destroy(c)}}return null},e}();function fU(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function cU(e){for(var t=e.size(),r=new Int32Array(t),n=0;n<t;n++)r[n]=e.GetValue(n);return r}function lU(e){for(var t=e.size(),r=new Int32Array(t),n=0;n<t;n++)r[n]=e.GetValue(n);return r}function hU(e,t){return vU(e)||mU(e,t)||pU(e,t)||dU()}function dU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
210
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pU(e,t){if(e){if(typeof e=="string")return lT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lT(e,t)}}function lT(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mU(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function vU(e){if(Array.isArray(e))return e}function hT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dT(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hT(Object(r),!0).forEach(function(n){gU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pT(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function mT(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){pT(a,n,i,o,s,"next",u)}function s(u){pT(a,n,i,o,s,"throw",u)}o(void 0)})}}var yU="1.5.5",bU="1.4.1",vd="https://www.gstatic.com/draco/versioned/decoders/".concat(yU),_U="".concat(vd,"/draco_decoder.js"),AU="".concat(vd,"/draco_wasm_wrapper.js"),TU="".concat(vd,"/draco_decoder.wasm"),Lte="https://raw.githubusercontent.com/google/draco/".concat(bU,"/javascript/draco_encoder.js"),ma;function vT(e){return pd.apply(this,arguments)}function pd(){return pd=mT(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=t.modules||{},r.draco3d?ma=ma||r.draco3d.createDecoderModule({}).then(function(a){return{draco:a}}):ma=ma||SU(t),i.next=4,ma;case 4:return i.abrupt("return",i.sent);case 5:case"end":return i.stop()}},e)})),pd.apply(this,arguments)}function SU(e){return md.apply(this,arguments)}function md(){return md=mT(regeneratorRuntime.mark(function e(t){var r,n,i,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:s.t0=t.draco&&t.draco.decoderType,s.next=s.t0==="js"?3:(s.t0==="wasm",7);break;case 3:return s.next=5,Ot(_U,"draco",t);case 5:return r=s.sent,s.abrupt("break",21);case 7:return s.t1=Promise,s.next=10,Ot(AU,"draco",t);case 10:return s.t2=s.sent,s.next=13,Ot(TU,"draco",t);case 13:return s.t3=s.sent,s.t4=[s.t2,s.t3],s.next=17,s.t1.all.call(s.t1,s.t4);case 17:i=s.sent,a=hU(i,2),r=a[0],n=a[1];case 21:return r=r||globalThis.DracoDecoderModule,s.next=24,wU(r,n);case 24:return s.abrupt("return",s.sent);case 25:case"end":return s.stop()}},e)})),md.apply(this,arguments)}function wU(e,t){var r={};return t&&(r.wasmBinary=t),new Promise(function(n){e(dT(dT({},r),{},{onModuleLoaded:function(a){return n({draco:a})}}))})}function gT(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function xU(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){gT(a,n,i,o,s,"next",u)}function s(u){gT(a,n,i,o,s,"throw",u)}o(void 0)})}}function yT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function bT(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yT(Object(r),!0).forEach(function(n){EU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var qu=bT(bT({},TA),{},{parse:OU});function OU(e,t){return gd.apply(this,arguments)}function gd(){return gd=xU(regeneratorRuntime.mark(function e(t,r){var n,i,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,vT(r);case 2:return n=s.sent,i=n.draco,a=new cT(i),s.prev=5,s.abrupt("return",a.parseSync(t,r?.draco));case 7:return s.prev=7,a.destroy(),s.finish(7);case 10:case"end":return s.stop()}},e,null,[[5,,7,10]])})),gd.apply(this,arguments)}var Nt;function PU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yd=(Nt={},Mr(Nt,5130,Float64Array),Mr(Nt,5126,Float32Array),Mr(Nt,5123,Uint16Array),Mr(Nt,5125,Uint32Array),Mr(Nt,5121,Uint8Array),Mr(Nt,5120,Int8Array),Mr(Nt,5122,Int16Array),Mr(Nt,5124,Int32Array),Nt),BU={DOUBLE:5130,FLOAT:5126,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,UNSIGNED_BYTE:5121,BYTE:5120,SHORT:5122,INT:5124},bd="Failed to convert GL type",Ir=function(){function e(){PU(this,e)}return e.fromTypedArray=function(r){r=ArrayBuffer.isView(r)?r.constructor:r;for(var n in yd){var i=yd[n];if(i===r)return n}throw new Error(bd)},e.fromName=function(r){var n=BU[r];if(!n)throw new Error(bd);return n},e.getArrayType=function(r){switch(r){case 33635:case 32819:case 32820:return Uint16Array;default:var n=yd[r];if(!n)throw new Error(bd);return n}},e.getByteSize=function(r){var n=e.getArrayType(r);return n.BYTES_PER_ELEMENT},e.validate=function(r){return Boolean(e.getArrayType(r))},e.createTypedArray=function(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3?arguments[3]:void 0;a===void 0&&(a=(n.byteLength-i)/e.getByteSize(r));var o=e.getArrayType(r);return new o(n,i,a)},e}();function _T(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}function _d(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],r=e>>11&31,n=e>>5&63,i=e&31;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}var Jte=1/256;var Xte=new $r,qte=new E,Kte=new $r,Yte=new $r,$te=new Uint8Array(1);function AT(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:255;return No(e,0,t)/t*2-1}function TT(e){return e<0?-1:1}function ST(e,t,r,n){if(_T(n),e<0||e>r||t<0||t>r)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(r));if(n.x=AT(e,r),n.y=AT(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*TT(i),n.y=(1-Math.abs(i))*TT(n.y)}return n.normalize()}function Ad(e,t,r){return ST(e,t,255,r)}function CU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ai=function(){function e(r,n){CU(this,e),v(this,"json",void 0),v(this,"buffer",void 0),v(this,"featuresLength",0),v(this,"_cachedTypedArrays",{}),this.json=r,this.buffer=n}var t=e.prototype;return t.getExtension=function(n){return this.json.extensions&&this.json.extensions[n]},t.hasProperty=function(n){return Boolean(this.json[n])},t.getGlobalProperty=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5125,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,o=this.json[n];return o&&Number.isFinite(o.byteOffset)?this._getTypedArrayFromBinary(n,i,a,1,o.byteOffset):o},t.getPropertyArray=function(n,i,a){var o=this.json[n];return o&&Number.isFinite(o.byteOffset)?("componentType"in o&&(i=Ir.fromName(o.componentType)),this._getTypedArrayFromBinary(n,i,a,this.featuresLength,o.byteOffset)):this._getTypedArrayFromArray(n,i,o)},t.getProperty=function(n,i,a,o,s){var u=this.json[n];if(!u)return u;var f=this.getPropertyArray(n,i,a);if(a===1)return f[o];for(var c=0;c<a;++c)s[c]=f[a*o+c];return s},t._getTypedArrayFromBinary=function(n,i,a,o,s){var u=this._cachedTypedArrays,f=u[n];return f||(f=Ir.createTypedArray(i,this.buffer.buffer,this.buffer.byteOffset+s,o*a),u[n]=f),f},t._getTypedArrayFromArray=function(n,i,a){var o=this._cachedTypedArrays,s=o[n];return s||(s=Ir.createTypedArray(i,a),o[n]=s),s},e}();var MU={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},IU={SCALAR:function(t,r){return t[r]},VEC2:function(t,r){return[t[2*r+0],t[2*r+1]]},VEC3:function(t,r){return[t[3*r+0],t[3*r+1],t[3*r+2]]},VEC4:function(t,r){return[t[4*r+0],t[4*r+1],t[4*r+2],t[4*r+3]]},MAT2:function(t,r){return[t[4*r+0],t[4*r+1],t[4*r+2],t[4*r+3]]},MAT3:function(t,r){return[t[9*r+0],t[9*r+1],t[9*r+2],t[9*r+3],t[9*r+4],t[9*r+5],t[9*r+6],t[9*r+7],t[9*r+8]]},MAT4:function(t,r){return[t[16*r+0],t[16*r+1],t[16*r+2],t[16*r+3],t[16*r+4],t[16*r+5],t[16*r+6],t[16*r+7],t[16*r+8],t[16*r+9],t[16*r+10],t[16*r+11],t[16*r+12],t[16*r+13],t[16*r+14],t[16*r+15]]}},RU={SCALAR:function(t,r,n){r[n]=t},VEC2:function(t,r,n){r[2*n+0]=t[0],r[2*n+1]=t[1]},VEC3:function(t,r,n){r[3*n+0]=t[0],r[3*n+1]=t[1],r[3*n+2]=t[2]},VEC4:function(t,r,n){r[4*n+0]=t[0],r[4*n+1]=t[1],r[4*n+2]=t[2],r[4*n+3]=t[3]},MAT2:function(t,r,n){r[4*n+0]=t[0],r[4*n+1]=t[1],r[4*n+2]=t[2],r[4*n+3]=t[3]},MAT3:function(t,r,n){r[9*n+0]=t[0],r[9*n+1]=t[1],r[9*n+2]=t[2],r[9*n+3]=t[3],r[9*n+4]=t[4],r[9*n+5]=t[5],r[9*n+6]=t[6],r[9*n+7]=t[7],r[9*n+8]=t[8],r[9*n+9]=t[9]},MAT4:function(t,r,n){r[16*n+0]=t[0],r[16*n+1]=t[1],r[16*n+2]=t[2],r[16*n+3]=t[3],r[16*n+4]=t[4],r[16*n+5]=t[5],r[16*n+6]=t[6],r[16*n+7]=t[7],r[16*n+8]=t[8],r[16*n+9]=t[9],r[16*n+10]=t[10],r[16*n+11]=t[11],r[16*n+12]=t[12],r[16*n+13]=t[13],r[16*n+14]=t[14],r[16*n+15]=t[15]}};function wT(e,t,r,n){var i=e.componentType;Z(e.componentType);var a=typeof i=="string"?Ir.fromName(i):i,o=MU[e.type],s=IU[e.type],u=RU[e.type];r+=e.byteOffset;var f=Ir.createTypedArray(a,t,r,o*n);return{values:f,type:a,size:o,unpacker:s,packer:u}}var Ut=function(t){return t!==void 0};function xT(e,t,r){if(!t)return null;var n=e.getExtension("3DTILES_batch_table_hierarchy"),i=t.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?FU(n,r):null}function FU(e,t){var r,n,i,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,f=e.parentIds,c=a;Ut(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,5123),s.type=AttributeType.SCALAR,i=getBinaryAccessor(s),s=i.createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,a));var l;if(Ut(u))for(Ut(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,5123),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,a)),l=new Uint16Array(a),c=0,r=0;r<a;++r)l[r]=c,c+=u[r];Ut(f)&&Ut(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,5123),f.type=AttributeType.SCALAR,i=getBinaryAccessor(f),f=i.createArrayBufferView(t.buffer,t.byteOffset+f.byteOffset,c));var d=o.length;for(r=0;r<d;++r){var h=o[r].length,p=o[r].instances,m=getBinaryProperties(h,p,t);o[r].instances=combine(m,p)}var g=new Array(d).fill(0),y=new Uint16Array(a);for(r=0;r<a;++r)n=s[r],y[r]=g[n],++g[n];var b={classes:o,classIds:s,classIndexes:y,parentCounts:u,parentIndexes:l,parentIds:f};return GU(b),b}function oi(e,t,r){if(e){var n=e.parentCounts,i=e.parentIds;return i?r(e,t):n>0?LU(e,t,r):DU(e,t,r)}}function LU(e,t,r){var n=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);var f=++marker,c=scratchStack;for(c.length=0,c.push(t);c.length>0;)if(t=c.pop(),u[t]!==f){u[t]=f;var l=r(e,t);if(Ut(l))return l;for(var d=i[t],h=o[t],p=0;p<d;++p){var m=a[h+p];m!==t&&c.push(m)}}return null}function DU(e,t,r){for(var n=!0;n;){var i=r(e,t);if(Ut(i))return i;var a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function GU(e){for(var t=[],r=e.classIds,n=r.length,i=0;i<n;++i)ET(e,i,stack)}function ET(e,t,r){var n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,o=e.classIds,s=o.length;if(Ut(i)){assert(t<s,"Parent index ".concat(t," exceeds the total number of instances: ").concat(s)),assert(r.indexOf(t)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(t);for(var u=Ut(n)?n[t]:1,f=Ut(n)?a[t]:t,c=0;c<u;++c){var l=i[f+c];l!==t&&ET(e,l,r)}r.pop(t)}}function NU(e){return HU(e)||kU(e)||jU(e)||UU()}function UU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
211
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jU(e,t){if(e){if(typeof e=="string")return Td(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Td(e,t)}}function kU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function HU(e){if(Array.isArray(e))return Td(e)}function Td(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function VU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xe(e){return e!=null}var Ku=function(t,r){return t},zU={HIERARCHY:!0,extensions:!0,extras:!0},Yu=function(){function e(r,n,i){VU(this,e);var a,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};v(this,"json",void 0),v(this,"binary",void 0),v(this,"featureCount",void 0),v(this,"_extensions",void 0),v(this,"_properties",void 0),v(this,"_binaryProperties",void 0),v(this,"_hierarchy",void 0),Z(i>=0),this.json=r||{},this.binary=n,this.featureCount=i,this._extensions=((a=this.json)===null||a===void 0?void 0:a.extensions)||{},this._properties={};for(var s in this.json)zU[s]||(this._properties[s]=this.json[s]);this._binaryProperties=this._initializeBinaryProperties(),o["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=xT(this,this.json,this.binary))}var t=e.prototype;return t.getExtension=function(n){return this.json&&this.json.extensions&&this.json.extensions[n]},t.memorySizeInBytes=function(){return 0},t.isClass=function(n,i){if(this._checkBatchId(n),Z(typeof i=="string",i),this._hierarchy){var a=oi(this._hierarchy,n,function(o,s){var u=o.classIds[s],f=o.classes[u];return f.name===i});return Xe(a)}return!1},t.isExactClass=function(n,i){return Z(typeof i=="string",i),this.getExactClassName(n)===i},t.getExactClassName=function(n){if(this._checkBatchId(n),this._hierarchy){var i=this._hierarchy.classIds[n],a=this._hierarchy.classes[i];return a.name}},t.hasProperty=function(n,i){return this._checkBatchId(n),Z(typeof i=="string",i),Xe(this._properties[i])||this._hasPropertyInHierarchy(n,i)},t.getPropertyNames=function(n,i){var a;this._checkBatchId(n),i=Xe(i)?i:[],i.length=0;var o=Object.keys(this._properties);return(a=i).push.apply(a,NU(o)),this._hierarchy&&this._getPropertyNamesInHierarchy(n,i),i},t.getProperty=function(n,i){if(this._checkBatchId(n),Z(typeof i=="string",i),this._binaryProperties){var a=this._binaryProperties[i];if(Xe(a))return this._getBinaryProperty(a,n)}var o=this._properties[i];if(Xe(o))return Ku(o[n],!0);if(this._hierarchy){var s=this._getHierarchyProperty(n,i);if(Xe(s))return s}},t.setProperty=function(n,i,a){var o=this.featureCount;if(this._checkBatchId(n),Z(typeof i=="string",i),this._binaryProperties){var s=this._binaryProperties[i];if(s){this._setBinaryProperty(s,n,a);return}}if(!(this._hierarchy&&this._setHierarchyProperty(this,n,i,a))){var u=this._properties[i];Xe(u)||(this._properties[i]=new Array(o),u=this._properties[i]),u[n]=Ku(a,!0)}},t._checkBatchId=function(n){var i=n>=0&&n<this.featureCount;if(!i)throw new Error("batchId not in range [0, featureCount - 1].")},t._getBinaryProperty=function(n,i){return n.unpack(n.typedArray,i)},t._setBinaryProperty=function(n,i,a){n.pack(a,n.typedArray,i)},t._initializeBinaryProperties=function(){var n=null;for(var i in this._properties){var a=this._properties[i],o=this._initializeBinaryProperty(i,a);o&&(n=n||{},n[i]=o)}return n},t._initializeBinaryProperty=function(n,i){if("byteOffset"in i){var a=i;Z(this.binary,"Property ".concat(n," requires a batch table binary.")),Z(a.type,"Property ".concat(n," requires a type."));var o=wT(a,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:o.values,componentCount:o.size,unpack:o.unpacker,pack:o.packer}}return null},t._hasPropertyInHierarchy=function(n,i){if(!this._hierarchy)return!1;var a=oi(this._hierarchy,n,function(o,s){var u=o.classIds[s],f=o.classes[u].instances;return Xe(f[i])});return Xe(a)},t._getPropertyNamesInHierarchy=function(n,i){oi(this._hierarchy,n,function(a,o){var s=a.classIds[o],u=a.classes[s].instances;for(var f in u)u.hasOwnProperty(f)&&i.indexOf(f)===-1&&i.push(f)})},t._getHierarchyProperty=function(n,i){var a=this;return oi(this._hierarchy,n,function(o,s){var u=o.classIds[s],f=o.classes[u],c=o.classIndexes[s],l=f.instances[i];return Xe(l)?Xe(l.typedArray)?a._getBinaryProperty(l,c):Ku(l[c],!0):null})},t._setHierarchyProperty=function(n,i,a,o){var s=this,u=oi(this._hierarchy,i,function(f,c){var l=f.classIds[c],d=f.classes[l],h=f.classIndexes[c],p=d.instances[a];return Xe(p)?(Z(c===i,'Inherited property "'.concat(a,'" is read-only.')),Xe(p.typedArray)?s._setBinaryProperty(p,h,o):p[h]=Ku(o,!0),!0):!1});return Xe(u)},e}();var Sd=4;function Rr(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=Sd,e.version=n.getUint32(r,!0),r+=Sd,e.byteLength=n.getUint32(r,!0),r+=Sd,e.version!==1)throw new Error("3D Tile Version ".concat(e.version," not supported"));return r}var si=4,OT="b3dm tile in legacy format.";function ui(e,t,r){var n=new DataView(t),i;e.header=e.header||{};var a=n.getUint32(r,!0);r+=si;var o=n.getUint32(r,!0);r+=si;var s=n.getUint32(r,!0);r+=si;var u=n.getUint32(r,!0);return r+=si,s>=570425344?(r-=si*2,i=a,s=o,u=0,a=0,o=0,console.warn(OT)):u>=570425344&&(r-=si,i=s,s=a,u=o,a=0,o=0,console.warn(OT)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=i,r}function fi(e,t,r,n){return r=WU(e,t,r,n),r=JU(e,t,r,n),r}function WU(e,t,r,n){var i=e.header,a=i.featureTableJsonByteLength,o=i.featureTableBinaryByteLength,s=i.batchLength;if(e.featureTableJson={BATCH_LENGTH:s||0},a>0){var u=id(t,r,a);e.featureTableJson=JSON.parse(u)}return r+=a,e.featureTableBinary=new Uint8Array(t,r,o),r+=o,r}function JU(e,t,r,n){var i=e.header,a=i.batchTableJsonByteLength,o=i.batchTableBinaryByteLength;if(a>0){var s=id(t,r,a);e.batchTableJson=JSON.parse(s),r+=a,o>0&&(e.batchTableBinary=new Uint8Array(t,r,o),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=o)}return r}function wd(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;var n=e.batchIds,i=e.isRGB565,a=e.pointCount;if(n&&r){for(var o=new Uint8ClampedArray(a*3),s=0;s<a;s++){var u=n[s],f=r.getProperty(u,"dimensions"),c=f.map(function(p){return p*255});o[s*3]=c[0],o[s*3+1]=c[1],o[s*3+2]=c[2]}return{type:5121,value:o,size:3,normalized:!0}}if(i){for(var l=new Uint8ClampedArray(a*3),d=0;d<a;d++){var h=_d(t[d]);l[d*3]=h[0],l[d*3+1]=h[1],l[d*3+2]=h[2]}return{type:5121,value:l,size:3,normalized:!0}}return t&&t.length===a*3?{type:5121,value:t,size:3,normalized:!0}:{type:5121,value:t,size:4,normalized:!0}}var PT=new E;function BT(e,t){if(!t)return null;if(e.isOctEncoded16P){for(var r=new Float32Array(e.pointsLength*3),n=0;n<e.pointsLength;n++)Ad(t[n*2],t[n*2+1],PT),PT.toArray(r,n*3);return{type:5126,size:2,value:r}}return{type:5126,size:2,value:t}}function CT(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,XU(e,t)):{type:5123,value:t,size:3,normalized:!0}:t}function XU(e,t){for(var r=new E,n=new Float32Array(e.pointCount*3),i=0;i<e.pointCount;i++)r.set(t[i*3],t[i*3+1],t[i*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,i*3);return n}function MT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MT(Object(r),!0).forEach(function(n){qU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IT(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function Pd(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){IT(a,n,i,o,s,"next",u)}function s(u){IT(a,n,i,o,s,"throw",u)}o(void 0)})}}function RT(e,t,r,n,i){return xd.apply(this,arguments)}function xd(){return xd=Pd(regeneratorRuntime.mark(function e(t,r,n,i,a){var o,s,u;return regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return n=Rr(t,r,n),n=ui(t,r,n),n=fi(t,r,n,i),KU(t),o=YU(t),s=o.featureTable,u=o.batchTable,c.next=7,t8(t,s,u,i,a);case 7:return $U(t,s,i),ZU(t,s,u),QU(t,s),c.abrupt("return",n);case 11:case"end":return c.stop()}},e)})),xd.apply(this,arguments)}function KU(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function YU(e){var t=new ai(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",5126,3);var n=e8(e,t);return{featureTable:t,batchTable:n}}function $U(e,t,r){if(!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",5126,3);else if(t.hasProperty("POSITION_QUANTIZED")){var n=t.getPropertyArray("POSITION_QUANTIZED",5123,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=CT(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function ZU(e,t,r){if(!e.attributes.colors){var n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",5121,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",5121,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",5123,1),e.isRGB565=!0),e.attributes.colors=wd(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",5121,4))}function QU(e,t){if(!e.attributes.normals){var r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",5126,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",5121,2),e.isOctEncoded16P=!0),e.attributes.normals=BT(e,r)}}function e8(e,t){var r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",5123,1),e.batchIds)){var n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");var i=e.batchTableJson,a=e.batchTableBinary;r=new Yu(i,a,n)}return r}function t8(e,t,r,n,i){return Ed.apply(this,arguments)}function Ed(){return Ed=Pd(regeneratorRuntime.mark(function e(t,r,n,i,a){var o,s,u,f,c,l,d,h;return regeneratorRuntime.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(f=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"],f&&(u=f.properties),c=r.getExtension("3DTILES_draco_point_compression"),!c){m.next=15;break}if(s=c.properties,l=c.byteOffset,d=c.byteLength,!(!s||!Number.isFinite(l)||!d)){m.next=9;break}throw new Error("Draco properties, byteOffset, and byteLength must be defined");case 9:o=t.featureTableBinary.slice(l,l+d),t.hasPositions=Number.isFinite(s.POSITION),t.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),t.hasNormals=Number.isFinite(s.NORMAL),t.hasBatchIds=Number.isFinite(s.BATCH_ID),t.isTranslucent=Number.isFinite(s.RGBA);case 15:if(o){m.next=17;break}return m.abrupt("return",!0);case 17:return h={buffer:o,properties:hn(hn({},s),u),featureTableProperties:s,batchTableProperties:u,dequantizeInShader:!1},m.next=20,r8(t,h,i,a);case 20:return m.abrupt("return",m.sent);case 21:case"end":return m.stop()}},e)})),Ed.apply(this,arguments)}function r8(e,t,r,n){return Od.apply(this,arguments)}function Od(){return Od=Pd(regeneratorRuntime.mark(function e(t,r,n,i){var a,o,s,u,f,c,l,d,h,p,m,g,y,b,A;return regeneratorRuntime.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return a=i.parse,o=hn(hn({},n),{},{draco:hn(hn({},n.draco),{},{extraAttributes:r.batchTableProperties||{}})}),delete o["3d-tiles"],O.next=5,a(r.buffer,qu,o);case 5:if(s=O.sent,u=s.attributes.POSITION&&s.attributes.POSITION.value,f=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,c=s.attributes.NORMAL&&s.attributes.NORMAL.value,l=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,d=u&&s.attributes.POSITION.value.quantization,h=c&&s.attributes.NORMAL.value.quantization,d&&(p=s.POSITION.data.quantization,m=p.range,t.quantizedVolumeScale=new E(m,m,m),t.quantizedVolumeOffset=new E(p.minValues),t.quantizedRange=(1<<p.quantizationBits)-1,t.isQuantizedDraco=!0),h&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0),g={},r.batchTableProperties)for(y=0,b=Object.keys(r.batchTableProperties);y<b.length;y++)A=b[y],s.attributes[A]&&s.attributes[A].value&&(g[A.toLowerCase()]=s.attributes[A].value);t.attributes=hn({positions:u,colors:wd(t,f,void 0),normals:c,batchIds:l},g);case 17:case"end":return O.stop()}},e)})),Od.apply(this,arguments)}var FT="3.4.13";var LT="3.4.13";function NT(e,t){return o8(e)||a8(e,t)||i8(e,t)||n8()}function n8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
212
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i8(e,t){if(e){if(typeof e=="string")return DT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return DT(e,t)}}function DT(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a8(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function o8(e){if(Array.isArray(e))return e}function GT(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function $u(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){GT(a,n,i,o,s,"next",u)}function s(u){GT(a,n,i,o,s,"throw",u)}o(void 0)})}}var UT="3.4.13",s8="https://unpkg.com/@loaders.gl/textures@".concat(UT,"/dist/libs/basis_encoder.wasm"),u8="https://unpkg.com/@loaders.gl/textures@".concat(UT,"/dist/libs/basis_encoder.js"),Bd;function Ld(e){return Md.apply(this,arguments)}function Md(){return Md=$u(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(r=t.modules||{},!r.basis){i.next=3;break}return i.abrupt("return",r.basis);case 3:return Bd=Bd||f8(t),i.next=6,Bd;case 6:return i.abrupt("return",i.sent);case 7:case"end":return i.stop()}},e)})),Md.apply(this,arguments)}function f8(e){return Id.apply(this,arguments)}function Id(){return Id=$u(regeneratorRuntime.mark(function e(t){var r,n,i,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return r=null,n=null,s.t0=Promise,s.next=5,Ot("basis_transcoder.js","textures",t);case 5:return s.t1=s.sent,s.next=8,Ot("basis_transcoder.wasm","textures",t);case 8:return s.t2=s.sent,s.t3=[s.t1,s.t2],s.next=12,s.t0.all.call(s.t0,s.t3);case 12:return i=s.sent,a=NT(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,s.next=19,c8(r,n);case 19:return s.abrupt("return",s.sent);case 20:case"end":return s.stop()}},e)})),Id.apply(this,arguments)}function c8(e,t){var r={};return t&&(r.wasmBinary=t),new Promise(function(n){e(r).then(function(i){var a=i.BasisFile,o=i.initializeBasis;o(),n({BasisFile:a})})})}var Cd;function Dd(e){return Rd.apply(this,arguments)}function Rd(){return Rd=$u(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(r=t.modules||{},!r.basisEncoder){i.next=3;break}return i.abrupt("return",r.basisEncoder);case 3:return Cd=Cd||l8(t),i.next=6,Cd;case 6:return i.abrupt("return",i.sent);case 7:case"end":return i.stop()}},e)})),Rd.apply(this,arguments)}function l8(e){return Fd.apply(this,arguments)}function Fd(){return Fd=$u(regeneratorRuntime.mark(function e(t){var r,n,i,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return r=null,n=null,s.t0=Promise,s.next=5,Ot(u8,"textures",t);case 5:return s.t1=s.sent,s.next=8,Ot(s8,"textures",t);case 8:return s.t2=s.sent,s.t3=[s.t1,s.t2],s.next=12,s.t0.all.call(s.t0,s.t3);case 12:return i=s.sent,a=NT(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,s.next=19,h8(r,n);case 19:return s.abrupt("return",s.sent);case 20:case"end":return s.stop()}},e)})),Fd.apply(this,arguments)}function h8(e,t){var r={};return t&&(r.wasmBinary=t),new Promise(function(n){e(r).then(function(i){var a=i.BasisFile,o=i.KTX2File,s=i.initializeBasis,u=i.BasisEncoder;s(),n({BasisFile:a,KTX2File:o,BasisEncoder:u})})})}var dn={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};function d8(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=p8(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
213
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function p8(e,t){if(e){if(typeof e=="string")return jT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jT(e,t)}}function jT(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var m8=["","WEBKIT_","MOZ_"],kT={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},Zu=null;function HT(e){if(!Zu){e=e||v8()||void 0,Zu=new Set;var t=d8(m8),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;for(var i in kT)if(e&&e.getExtension("".concat(n).concat(i))){var a=kT[i];Zu.add(a)}}}catch(o){t.e(o)}finally{t.f()}}return Zu}function v8(){try{var e=document.createElement("canvas");return e.getContext("webgl")}catch{return null}}var nne=new Uint8Array([0]);var VT,zT,WT,JT,XT,qT,KT,YT;(function(e){e[e.NONE=0]="NONE",e[e.BASISLZ=1]="BASISLZ",e[e.ZSTD=2]="ZSTD",e[e.ZLIB=3]="ZLIB"})(VT||(VT={})),function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(zT||(zT={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(WT||(WT={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(JT||(JT={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(XT||(XT={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(qT||(qT={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(KT||(KT={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(YT||(YT={}));var Qe=[171,75,84,88,32,50,48,187,13,10,26,10];function $T(e){var t=new Uint8Array(e),r=t.byteLength<Qe.length||t[0]!==Qe[0]||t[1]!==Qe[1]||t[2]!==Qe[2]||t[3]!==Qe[3]||t[4]!==Qe[4]||t[5]!==Qe[5]||t[6]!==Qe[6]||t[7]!==Qe[7]||t[8]!==Qe[8]||t[9]!==Qe[9]||t[10]!==Qe[10]||t[11]!==Qe[11];return!r}function Qu(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qu=function(r){return typeof r}:Qu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Qu(e)}function ZT(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function g8(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){ZT(a,n,i,o,s,"next",u)}function s(u){ZT(a,n,i,o,s,"throw",u)}o(void 0)})}}var y8={etc1:{basisFormat:0,compressed:!0,format:dn.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:dn.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:dn.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:dn.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:dn.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:dn.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function Ud(e,t){return Nd.apply(this,arguments)}function Nd(){return Nd=g8(regeneratorRuntime.mark(function e(t,r){var n,i,a,o,s,u;return regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(r.basis.containerFormat!=="auto"){c.next=11;break}if(!$T(t)){c.next=6;break}return c.next=4,Dd(r);case 4:return n=c.sent,c.abrupt("return",QT(n.KTX2File,t,r));case 6:return c.next=8,Ld(r);case 8:return i=c.sent,a=i.BasisFile,c.abrupt("return",Gd(a,t,r));case 11:c.t0=r.basis.module,c.next=c.t0==="encoder"?14:(c.t0==="transcoder",22);break;case 14:return c.next=16,Dd(r);case 16:o=c.sent,c.t1=r.basis.containerFormat,c.next=c.t1==="ktx2"?20:(c.t1==="basis",21);break;case 20:return c.abrupt("return",QT(o.KTX2File,t,r));case 21:return c.abrupt("return",Gd(o.BasisFile,t,r));case 22:return c.next=24,Ld(r);case 24:return s=c.sent,u=s.BasisFile,c.abrupt("return",Gd(u,t,r));case 27:case"end":return c.stop()}},e)})),Nd.apply(this,arguments)}function Gd(e,t,r){var n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");for(var i=n.getNumImages(),a=[],o=0;o<i;o++){for(var s=n.getNumLevels(o),u=[],f=0;f<s;f++)u.push(b8(n,o,f,r));a.push(u)}return a}finally{n.close(),n.delete()}}function b8(e,t,r,n){var i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),s=eS(n,o),u=s.compressed,f=s.format,c=s.basisFormat,l=e.getImageTranscodedSizeInBytes(t,r,c),d=new Uint8Array(l);if(!e.transcodeImage(d,t,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:a,data:d,compressed:u,format:f,hasAlpha:o}}function QT(e,t,r){var n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");for(var i=n.getLevels(),a=[],o=0;o<i;o++){a.push(_8(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function _8(e,t,r){var n=e.getImageLevelInfo(t,0,0),i=n.alphaFlag,a=n.height,o=n.width,s=eS(r,i),u=s.compressed,f=s.format,c=s.basisFormat,l=e.getImageTranscodedSizeInBytes(t,0,0,c),d=new Uint8Array(l);if(!e.transcodeImage(d,t,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:a,data:d,compressed:u,levelSize:l,hasAlpha:i,format:f}}function eS(e,t){var r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=ef()),Qu(r)==="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),y8[r]}function ef(){var e=HT();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}function tS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function rS(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tS(Object(r),!0).forEach(function(n){A8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tS(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function A8(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var nS={name:"Basis",id:Vt?"basis":"basis-nodejs",module:"textures",version:LT,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},jd=rS(rS({},nS),{},{parse:Ud});function Be(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function kd(e,t){var r=e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:");if(r)return e;var n=t.baseUri||t.uri;if(!n)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return n.substr(0,n.lastIndexOf("/")+1)+e}function iS(e,t,r){var n=e.bufferViews[r];Be(n);var i=n.buffer,a=t[i];Be(a);var o=(n.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,n.byteLength)}var Yd={};lt(Yd,{decode:()=>J8,name:()=>W8});var aS=["SCALAR","VEC2","VEC3","VEC4"],T8=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],S8=new Map(T8),w8={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},x8={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},E8={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function tf(e){var t=aS[e-1];return t||aS[0]}function rf(e){var t=S8.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function ci(e,t){var r=E8[e.componentType],n=w8[e.type],i=x8[e.componentType],a=e.count*n,o=e.count*n*i;return Be(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}function va(e){var t=e.images,r=e.bufferViews;t=t||[],r=r||[];var n=t.map(function(o){return o.bufferView});r=r.filter(function(o){return!n.includes(o)});var i=r.reduce(function(o,s){return o+s.byteLength},0),a=t.reduce(function(o,s){var u=s.image,f=u.width,c=u.height;return o+f*c},0);return i+Math.ceil(4*a*1.33)}function oS(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=O8(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
214
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function O8(e,t){if(e){if(typeof e=="string")return sS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sS(e,t)}}function sS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function nf(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?nf=function(r){return typeof r}:nf=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},nf(e)}function uS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function P8(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uS(Object(r),!0).forEach(function(n){B8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uS(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function B8(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function M8(e,t,r){return t&&fS(e.prototype,t),r&&fS(e,r),e}var I8={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},ye=function(){function e(r){C8(this,e),v(this,"gltf",void 0),v(this,"sourceBuffers",void 0),v(this,"byteLength",void 0),this.gltf=r||{json:P8({},I8),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}var t=e.prototype;return t.getApplicationData=function(n){var i=this.json[n];return i},t.getExtraData=function(n){var i=this.json.extras||{};return i[n]},t.getExtension=function(n){var i=this.getUsedExtensions().find(function(o){return o===n}),a=this.json.extensions||{};return i?a[n]||!0:null},t.getRequiredExtension=function(n){var i=this.getRequiredExtensions().find(function(a){return a===n});return i?this.getExtension(n):null},t.getRequiredExtensions=function(){return this.json.extensionsRequired||[]},t.getUsedExtensions=function(){return this.json.extensionsUsed||[]},t.getRemovedExtensions=function(){return this.json.extensionsRemoved||[]},t.getObjectExtension=function(n,i){var a=n.extensions||{};return a[i]},t.getScene=function(n){return this.getObject("scenes",n)},t.getNode=function(n){return this.getObject("nodes",n)},t.getSkin=function(n){return this.getObject("skins",n)},t.getMesh=function(n){return this.getObject("meshes",n)},t.getMaterial=function(n){return this.getObject("materials",n)},t.getAccessor=function(n){return this.getObject("accessors",n)},t.getTexture=function(n){return this.getObject("textures",n)},t.getSampler=function(n){return this.getObject("samplers",n)},t.getImage=function(n){return this.getObject("images",n)},t.getBufferView=function(n){return this.getObject("bufferViews",n)},t.getBuffer=function(n){return this.getObject("buffers",n)},t.getObject=function(n,i){if(nf(i)==="object")return i;var a=this.json[n]&&this.json[n][i];if(!a)throw new Error("glTF file error: Could not find ".concat(n,"[").concat(i,"]"));return a},t.getTypedArrayForBufferView=function(n){n=this.getBufferView(n);var i=n.buffer,a=this.gltf.buffers[i];Be(a);var o=(n.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,n.byteLength)},t.getTypedArrayForAccessor=function(n){n=this.getAccessor(n);var i=this.getBufferView(n.bufferView),a=this.getBuffer(i.buffer),o=a.data,s=ci(n,i),u=s.ArrayType,f=s.length,c=i.byteOffset+n.byteOffset;return new u(o,c,f)},t.getTypedArrayForImageData=function(n){n=this.getAccessor(n);var i=this.getBufferView(n.bufferView),a=this.getBuffer(i.buffer),o=a.data,s=i.byteOffset||0;return new Uint8Array(o,s,i.byteLength)},t.addApplicationData=function(n,i){return this.json[n]=i,this},t.addExtraData=function(n,i){return this.json.extras=this.json.extras||{},this.json.extras[n]=i,this},t.addObjectExtension=function(n,i,a){return n.extensions=n.extensions||{},n.extensions[i]=a,this.registerUsedExtension(i),this},t.setObjectExtension=function(n,i,a){var o=n.extensions||{};o[i]=a},t.removeObjectExtension=function(n,i){var a=n.extensions||{},o=a[i];return delete a[i],o},t.addExtension=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Be(i),this.json.extensions=this.json.extensions||{},this.json.extensions[n]=i,this.registerUsedExtension(n),i},t.addRequiredExtension=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Be(i),this.addExtension(n,i),this.registerRequiredExtension(n),i},t.registerUsedExtension=function(n){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(function(i){return i===n})||this.json.extensionsUsed.push(n)},t.registerRequiredExtension=function(n){this.registerUsedExtension(n),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(function(i){return i===n})||this.json.extensionsRequired.push(n)},t.removeExtension=function(n){if(this.getExtension(n)){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,n),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,n),this.json.extensions&&delete this.json.extensions[n],Array.isArray(this.json.extensionsRemoved)||(this.json.extensionsRemoved=[]);var i=this.json.extensionsRemoved;i.includes(n)||i.push(n)}},t.setDefaultScene=function(n){this.json.scene=n},t.addScene=function(n){var i=n.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:i}),this.json.scenes.length-1},t.addNode=function(n){var i=n.meshIndex,a=n.matrix;this.json.nodes=this.json.nodes||[];var o={mesh:i};return a&&(o.matrix=a),this.json.nodes.push(o),this.json.nodes.length-1},t.addMesh=function(n){var i=n.attributes,a=n.indices,o=n.material,s=n.mode,u=s===void 0?4:s,f=this._addAttributes(i),c={primitives:[{attributes:f,mode:u}]};if(a){var l=this._addIndices(a);c.primitives[0].indices=l}return Number.isFinite(o)&&(c.primitives[0].material=o),this.json.meshes=this.json.meshes||[],this.json.meshes.push(c),this.json.meshes.length-1},t.addPointCloud=function(n){var i=this._addAttributes(n),a={primitives:[{attributes:i,mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1},t.addImage=function(n,i){var a=Xr(n),o=i||a?.mimeType,s=this.addBufferView(n),u={bufferView:s,mimeType:o};return this.json.images=this.json.images||[],this.json.images.push(u),this.json.images.length-1},t.addBufferView=function(n){var i=n.byteLength;Be(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(n);var a={buffer:0,byteOffset:this.byteLength,byteLength:i};return this.byteLength+=fr(i,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1},t.addAccessor=function(n,i){var a={bufferView:n,type:tf(i.size),componentType:i.componentType,count:i.count,max:i.max,min:i.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(a),this.json.accessors.length-1},t.addBinaryBuffer=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{size:3},a=this.addBufferView(n),o={min:i.min,max:i.max};(!o.min||!o.max)&&(o=this._getAccessorMinMax(n,i.size));var s={size:i.size,componentType:rf(n),count:Math.round(n.length/i.size),min:o.min,max:o.max};return this.addAccessor(a,Object.assign(s,i))},t.addTexture=function(n){var i=n.imageIndex,a={source:i};return this.json.textures=this.json.textures||[],this.json.textures.push(a),this.json.textures.length-1},t.addMaterial=function(n){return this.json.materials=this.json.materials||[],this.json.materials.push(n),this.json.materials.length-1},t.createBinaryChunk=function(){var n,i;this.gltf.buffers=[];var a=this.byteLength,o=new ArrayBuffer(a),s=new Uint8Array(o),u=0,f=oS(this.sourceBuffers||[]),c;try{for(f.s();!(c=f.n()).done;){var l=c.value;u=lc(l,s,u)}}catch(d){f.e(d)}finally{f.f()}(n=this.json)!==null&&n!==void 0&&(i=n.buffers)!==null&&i!==void 0&&i[0]?this.json.buffers[0].byteLength=a:this.json.buffers=[{byteLength:a}],this.gltf.binary=o,this.sourceBuffers=[o]},t._removeStringFromArray=function(n,i){for(var a=!0;a;){var o=n.indexOf(i);o>-1?n.splice(o,1):a=!1}},t._addAttributes=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i={};for(var a in n){var o=n[a],s=this._getGltfAttributeName(a),u=this.addBinaryBuffer(o.value,o);i[s]=u}return i},t._addIndices=function(n){return this.addBinaryBuffer(n,{size:1})},t._getGltfAttributeName=function(n){switch(n.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return n}},t._getAccessorMinMax=function(n,i){var a={min:null,max:null};if(n.length<i)return a;a.min=[],a.max=[];var o=n.subarray(0,i),s=oS(o),u;try{for(s.s();!(u=s.n()).done;){var f=u.value;a.min.push(f),a.max.push(f)}}catch(d){s.e(d)}finally{s.f()}for(var c=i;c<n.length;c+=i)for(var l=0;l<i;l++)a.min[0+l]=Math.min(a.min[0+l],n[c+l]),a.max[0+l]=Math.max(a.max[0+l],n[c+l]);return a},M8(e,[{key:"json",get:function(){return this.gltf.json}}]),e}();function cS(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function Jd(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){cS(a,n,i,o,s,"next",u)}function s(u){cS(a,n,i,o,s,"throw",u)}o(void 0)})}}function af(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?af=function(r){return typeof r}:af=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},af(e)}var Ine=(typeof WebAssembly>"u"?"undefined":af(WebAssembly))!=="object",R8="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",F8="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",L8=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),D8=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),G8={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},N8={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function lS(e,t,r,n,i){return Vd.apply(this,arguments)}function Vd(){return Vd=Jd(regeneratorRuntime.mark(function e(t,r,n,i,a){var o,s,u=arguments;return regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return o=u.length>5&&u[5]!==void 0?u[5]:"NONE",c.next=3,U8();case 3:s=c.sent,H8(s,s.exports[N8[a]],t,r,n,i,s.exports[G8[o||"NONE"]]);case 5:case"end":return c.stop()}},e)})),Vd.apply(this,arguments)}var Hd;function U8(){return zd.apply(this,arguments)}function zd(){return zd=Jd(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return Hd||(Hd=j8()),r.abrupt("return",Hd);case 2:case"end":return r.stop()}},e)})),zd.apply(this,arguments)}function j8(){return Wd.apply(this,arguments)}function Wd(){return Wd=Jd(regeneratorRuntime.mark(function e(){var t,r;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return t=R8,WebAssembly.validate(L8)&&(t=F8,console.log("Warning: meshopt_decoder is using experimental SIMD support")),i.next=4,WebAssembly.instantiate(k8(t),{});case 4:return r=i.sent,i.next=7,r.instance.exports.__wasm_call_ctors();case 7:return i.abrupt("return",r.instance);case 8:case"end":return i.stop()}},e)})),Wd.apply(this,arguments)}function k8(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;++r){var n=e.charCodeAt(r);t[r]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}for(var i=0,a=0;a<e.length;++a)t[i++]=t[a]<60?D8[t[a]]:(t[a]-60)*64+t[++a];return t.buffer.slice(0,i)}function H8(e,t,r,n,i,a,o){var s=e.exports.sbrk,u=n+3&-4,f=s(u*i),c=s(a.length),l=new Uint8Array(e.exports.memory.buffer);l.set(a,c);var d=t(f,n,i,c,a.length);if(d===0&&o&&o(f,u,i),r.set(l.subarray(f,f+n*i)),s(f-s(0)),d!==0)throw new Error("Malformed buffer data: ".concat(d))}function V8(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=z8(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
215
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function z8(e,t){if(e){if(typeof e=="string")return hS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hS(e,t)}}function hS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dS(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function pS(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){dS(a,n,i,o,s,"next",u)}function s(u){dS(a,n,i,o,s,"throw",u)}o(void 0)})}}var Kd="EXT_meshopt_compression",W8=Kd;function J8(e,t){return Xd.apply(this,arguments)}function Xd(){return Xd=pS(regeneratorRuntime.mark(function e(t,r){var n,i,a,o,s,u;return regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(i=new ye(t),r!=null&&(n=r.gltf)!==null&&n!==void 0&&n.decompressMeshes){c.next=3;break}return c.abrupt("return");case 3:a=[],o=V8(t.json.bufferViews||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,a.push(X8(i,u))}catch(l){o.e(l)}finally{o.f()}return c.next=8,Promise.all(a);case 8:i.removeExtension(Kd);case 9:case"end":return c.stop()}},e)})),Xd.apply(this,arguments)}function X8(e,t){return qd.apply(this,arguments)}function qd(){return qd=pS(regeneratorRuntime.mark(function e(t,r){var n,i,a,o,s,u,f,c,l,d,h,p,m,g;return regeneratorRuntime.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(n=t.getObjectExtension(r,Kd),!n){b.next=9;break}return i=n.byteOffset,a=i===void 0?0:i,o=n.byteLength,s=o===void 0?0:o,u=n.byteStride,f=n.count,c=n.mode,l=n.filter,d=l===void 0?"NONE":l,h=n.buffer,p=t.gltf.buffers[h],m=new Uint8Array(p.arrayBuffer,p.byteOffset+a,s),g=new Uint8Array(t.gltf.buffers[r.buffer].arrayBuffer,r.byteOffset,r.byteLength),b.next=8,lS(g,f,u,m,c,d);case 8:return b.abrupt("return",g);case 9:return b.abrupt("return",null);case 10:case"end":return b.stop()}},e)})),qd.apply(this,arguments)}var $d={};lt($d,{name:()=>Y8,preprocess:()=>$8});function q8(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=K8(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
216
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function K8(e,t){if(e){if(typeof e=="string")return mS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mS(e,t)}}function mS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var li="EXT_texture_webp",Y8=li;function $8(e,t){var r=new ye(e);if(!Nc("image/webp")){if(r.getRequiredExtensions().includes(li))throw new Error("gltf: Required extension ".concat(li," not supported by browser"));return}var n=r.json,i=q8(n.textures||[]),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=r.getObjectExtension(o,li);s&&(o.source=s.source),r.removeObjectExtension(o,li)}}catch(u){i.e(u)}finally{i.f()}r.removeExtension(li)}var Zd={};lt(Zd,{name:()=>e6,preprocess:()=>t6});function Z8(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Q8(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
217
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function Q8(e,t){if(e){if(typeof e=="string")return vS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vS(e,t)}}function vS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var of="KHR_texture_basisu",e6=of;function t6(e,t){var r=new ye(e),n=r.json,i=Z8(n.textures||[]),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=r.getObjectExtension(o,of);s&&(o.source=s.source),r.removeObjectExtension(o,of)}}catch(u){i.e(u)}finally{i.f()}r.removeExtension(of)}var np={};lt(np,{decode:()=>h6,encode:()=>d6,name:()=>c6,preprocess:()=>l6});function gS(e){var t={};for(var r in e){var n=e[r];if(r!=="indices"){var i=Qd(n);t[r]=i}}return t}function Qd(e){var t=r6(e),r=t.buffer,n=t.size,i=t.count,a={value:r,size:n,byteOffset:0,count:i,type:tf(n),componentType:rf(r)};return a}function r6(e){var t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=n6(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function n6(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}function i6(e,t){return s6(e)||o6(e,t)||SS(e,t)||a6()}function a6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
218
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o6(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function s6(e){if(Array.isArray(e))return e}function yS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function u6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yS(Object(r),!0).forEach(function(n){AS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yS(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var f6=regeneratorRuntime.mark(rp);function AS(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bS(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function TS(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){bS(a,n,i,o,s,"next",u)}function s(u){bS(a,n,i,o,s,"throw",u)}o(void 0)})}}function ga(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=SS(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
219
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function SS(e,t){if(e){if(typeof e=="string")return _S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _S(e,t)}}function _S(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var pn="KHR_draco_mesh_compression",c6=pn;function l6(e,t,r){var n=new ye(e),i=ga(rp(n)),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;n.getObjectExtension(o,pn)}}catch(s){i.e(s)}finally{i.f()}}function h6(e,t,r){return ep.apply(this,arguments)}function ep(){return ep=TS(regeneratorRuntime.mark(function e(t,r,n){var i,a,o,s,u,f;return regeneratorRuntime.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(r!=null&&(i=r.gltf)!==null&&i!==void 0&&i.decompressMeshes){l.next=2;break}return l.abrupt("return");case 2:a=new ye(t),o=[],s=ga(rp(a));try{for(s.s();!(u=s.n()).done;)f=u.value,a.getObjectExtension(f,pn)&&o.push(p6(a,f,r,n))}catch(d){s.e(d)}finally{s.f()}return l.next=8,Promise.all(o);case 8:a.removeExtension(pn);case 9:case"end":return l.stop()}},e)})),ep.apply(this,arguments)}function d6(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=new ye(e),n=ga(r.json.meshes||[]),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;m6(a,t),r.addRequiredExtension(pn)}}catch(o){n.e(o)}finally{n.f()}}function p6(e,t,r,n){return tp.apply(this,arguments)}function tp(){return tp=TS(regeneratorRuntime.mark(function e(t,r,n,i){var a,o,s,u,f,c,l,d,h,p,m,g,y,b;return regeneratorRuntime.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(a=t.getObjectExtension(r,pn),a){S.next=3;break}return S.abrupt("return");case 3:return o=t.getTypedArrayForBufferView(a.bufferView),s=Hr(o.buffer,o.byteOffset),u=i.parse,f=u6({},n),delete f["3d-tiles"],S.next=10,u(s,qu,f,i);case 10:for(c=S.sent,l=gS(c.attributes),d=0,h=Object.entries(l);d<h.length;d++)p=i6(h[d],2),m=p[0],g=p[1],m in r.attributes&&(y=r.attributes[m],b=t.getAccessor(y),b!=null&&b.min&&b!==null&&b!==void 0&&b.max&&(g.min=b.min,g.max=b.max));r.attributes=l,c.indices&&(r.indices=Qd(c.indices)),v6(r);case 16:case"end":return S.stop()}},e)})),tp.apply(this,arguments)}function m6(e,t){var r,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var o=i.DracoWriter.encodeSync({attributes:e}),s=a==null||(r=a.parseSync)===null||r===void 0?void 0:r.call(a,{attributes:e}),u=i._addFauxAttributes(s.attributes),f=i.addBufferView(o),c={primitives:[{attributes:u,mode:n,extensions:AS({},pn,{bufferView:f,attributes:u})}]};return c}function v6(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function rp(e){var t,r,n,i,a,o;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:t=ga(e.json.meshes||[]),u.prev=1,t.s();case 3:if((r=t.n()).done){u.next=24;break}n=r.value,i=ga(n.primitives),u.prev=6,i.s();case 8:if((a=i.n()).done){u.next=14;break}return o=a.value,u.next=12,o;case 12:u.next=8;break;case 14:u.next=19;break;case 16:u.prev=16,u.t0=u.catch(6),i.e(u.t0);case 19:return u.prev=19,i.f(),u.finish(19);case 22:u.next=3;break;case 24:u.next=29;break;case 26:u.prev=26,u.t1=u.catch(1),t.e(u.t1);case 29:return u.prev=29,t.f(),u.finish(29);case 32:case"end":return u.stop()}},f6,null,[[1,26,29,32],[6,16,19,22]])}var op={};lt(op,{decode:()=>x6,name:()=>T6});var wS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},xS={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};function g6(e,t){return _6(e)||b6(e,t)||BS(e,t)||y6()}function y6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
220
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b6(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function _6(e){if(Array.isArray(e))return e}function ES(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=BS(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
221
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function BS(e,t){if(e){if(typeof e=="string")return OS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return OS(e,t)}}function OS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function PS(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function A6(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){PS(a,n,i,o,s,"next",u)}function s(u){PS(a,n,i,o,s,"throw",u)}o(void 0)})}}var ap="KHR_texture_transform",T6=ap,sf=new E,S6=new le,w6=new le;function x6(e,t){return ip.apply(this,arguments)}function ip(){return ip=A6(regeneratorRuntime.mark(function e(t,r){var n,i,a,o;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(n=new ye(t),i=n.getExtension(ap),i){u.next=4;break}return u.abrupt("return");case 4:for(a=t.json.materials||[],o=0;o<a.length;o++)E6(o,t);case 6:case"end":return u.stop()}},e)})),ip.apply(this,arguments)}function E6(e,t){var r,n,i,a=[],o=(r=t.json.materials)===null||r===void 0?void 0:r[e],s=o==null||(n=o.pbrMetallicRoughness)===null||n===void 0?void 0:n.baseColorTexture;s&&ya(t,e,s,a);var u=o?.emissiveTexture;u&&ya(t,e,u,a);var f=o?.normalTexture;f&&ya(t,e,f,a);var c=o?.occlusionTexture;c&&ya(t,e,c,a);var l=o==null||(i=o.pbrMetallicRoughness)===null||i===void 0?void 0:i.metallicRoughnessTexture;l&&ya(t,e,l,a)}function ya(e,t,r,n){var i=O6(r,n);if(i){var a=e.json.meshes||[],o=ES(a),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,f=ES(u.primitives),c;try{for(f.s();!(c=f.n()).done;){var l=c.value,d=l.material;Number.isFinite(d)&&t===d&&P6(e,l,i)}}catch(h){f.e(h)}finally{f.f()}}}catch(h){o.e(h)}finally{o.f()}}}function O6(e,t){var r,n=(r=e.extensions)===null||r===void 0?void 0:r[ap],i=e.texCoord,a=i===void 0?0:i,o=n.texCoord,s=o===void 0?a:o,u=t.findIndex(function(c){var l=g6(c,2),d=l[0],h=l[1];return d===a&&h===s})!==-1;if(!u){var f=M6(n);return a!==s&&(e.texCoord=s),t.push([a,s]),{originalTexCoord:a,texCoord:s,matrix:f}}return null}function P6(e,t,r){var n=r.originalTexCoord,i=r.texCoord,a=r.matrix,o=t.attributes["TEXCOORD_".concat(n)];if(Number.isFinite(o)){var s,u=(s=e.json.accessors)===null||s===void 0?void 0:s[o];if(u&&u.bufferView){var f,c=(f=e.json.bufferViews)===null||f===void 0?void 0:f[u.bufferView];if(c){for(var l=e.buffers[c.buffer],d=l.arrayBuffer,h=l.byteOffset,p=(h||0)+(u.byteOffset||0)+(c.byteOffset||0),m=ci(u,c),g=m.ArrayType,y=m.length,b=xS[u.componentType],A=wS[u.type],S=c.byteStride||b*A,O=new Float32Array(y),w=0;w<u.count;w++){var B=new g(d,p+w*S,2);sf.set(B[0],B[1],1),sf.transformByMatrix3(a),O.set([sf[0],sf[1]],w*A)}n===i?B6(u,c,e.buffers,O):C6(i,u,t,e,O)}}}}function B6(e,t,r,n){e.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function C6(e,t,r,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});var a=n.json.bufferViews;if(a){a.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});var o=n.json.accessors;o&&(o.push({bufferView:a?.length-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),r.attributes["TEXCOORD_".concat(e)]=o.length-1)}}function M6(e){var t=e.offset,r=t===void 0?[0,0]:t,n=e.rotation,i=n===void 0?0:n,a=e.scale,o=a===void 0?[1,1]:a,s=new le().set(1,0,0,0,1,0,r[0],r[1],1),u=S6.set(Math.cos(i),Math.sin(i),0,-Math.sin(i),Math.cos(i),0,0,0,1),f=w6.set(o[0],0,0,0,o[1],0,0,0,1);return s.multiplyRight(u).multiplyRight(f)}var fp={};lt(fp,{decode:()=>F6,encode:()=>L6,name:()=>R6});function IS(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=I6(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
222
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function I6(e,t){if(e){if(typeof e=="string")return CS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return CS(e,t)}}function CS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function MS(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function RS(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){MS(a,n,i,o,s,"next",u)}function s(u){MS(a,n,i,o,s,"throw",u)}o(void 0)})}}var mn="KHR_lights_punctual",R6=mn;function F6(e){return sp.apply(this,arguments)}function sp(){return sp=RS(regeneratorRuntime.mark(function e(t){var r,n,i,a,o,s,u;return regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:r=new ye(t),n=r.json,i=r.getExtension(mn),i&&(r.json.lights=i.lights,r.removeExtension(mn)),a=IS(n.nodes||[]);try{for(a.s();!(o=a.n()).done;)s=o.value,u=r.getObjectExtension(s,mn),u&&(s.light=u.light),r.removeObjectExtension(s,mn)}catch(l){a.e(l)}finally{a.f()}case 6:case"end":return c.stop()}},e)})),sp.apply(this,arguments)}function L6(e){return up.apply(this,arguments)}function up(){return up=RS(regeneratorRuntime.mark(function e(t){var r,n,i,a,o,s,u;return regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(r=new ye(t),n=r.json,n.lights&&(i=r.addExtension(mn),Be(!i.lights),i.lights=n.lights,delete n.lights),r.json.lights){a=IS(r.json.lights);try{for(a.s();!(o=a.n()).done;)s=o.value,u=s.node,r.addObjectExtension(u,mn,s)}catch(l){a.e(l)}finally{a.f()}delete r.json.lights}case 4:case"end":return c.stop()}},e)})),up.apply(this,arguments)}var lp={};lt(lp,{decode:()=>U6,encode:()=>j6,name:()=>N6});function DS(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=D6(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
223
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function D6(e,t){if(e){if(typeof e=="string")return FS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return FS(e,t)}}function FS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function LS(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function G6(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){LS(a,n,i,o,s,"next",u)}function s(u){LS(a,n,i,o,s,"throw",u)}o(void 0)})}}var ba="KHR_materials_unlit",N6=ba;function U6(e){return cp.apply(this,arguments)}function cp(){return cp=G6(regeneratorRuntime.mark(function e(t){var r,n,i,a,o,s;return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:r=new ye(t),n=r.json,i=DS(n.materials||[]);try{for(i.s();!(a=i.n()).done;)o=a.value,s=o.extensions&&o.extensions.KHR_materials_unlit,s&&(o.unlit=!0),r.removeObjectExtension(o,ba)}catch(c){i.e(c)}finally{i.f()}r.removeExtension(ba);case 5:case"end":return f.stop()}},e)})),cp.apply(this,arguments)}function j6(e){var t=new ye(e),r=t.json;if(t.materials){var n=DS(r.materials||[]),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.unlit&&(delete a.unlit,t.addObjectExtension(a,ba,{}),t.addExtension(ba))}}catch(o){n.e(o)}finally{n.f()}}}var pp={};lt(pp,{decode:()=>z6,encode:()=>W6,name:()=>V6});function k6(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=H6(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
224
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function H6(e,t){if(e){if(typeof e=="string")return GS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return GS(e,t)}}function GS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function uf(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?uf=function(r){return typeof r}:uf=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},uf(e)}function NS(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function US(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){NS(a,n,i,o,s,"next",u)}function s(u){NS(a,n,i,o,s,"throw",u)}o(void 0)})}}var _a="KHR_techniques_webgl",V6=_a;function z6(e){return hp.apply(this,arguments)}function hp(){return hp=US(regeneratorRuntime.mark(function e(t){var r,n,i,a,o,s,u,f;return regeneratorRuntime.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(r=new ye(t),n=r.json,i=r.getExtension(_a),i){a=J6(i,r),o=k6(n.materials||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,f=r.getObjectExtension(u,_a),f&&(u.technique=Object.assign({},f,a[f.technique]),u.technique.values=X6(u.technique,r)),r.removeObjectExtension(u,_a)}catch(d){o.e(d)}finally{o.f()}r.removeExtension(_a)}case 4:case"end":return l.stop()}},e)})),hp.apply(this,arguments)}function W6(e,t){return dp.apply(this,arguments)}function dp(){return dp=US(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:case"end":return i.stop()}},e)})),dp.apply(this,arguments)}function J6(e,t){var r=e.programs,n=r===void 0?[]:r,i=e.shaders,a=i===void 0?[]:i,o=e.techniques,s=o===void 0?[]:o,u=new TextDecoder;return a.forEach(function(f){if(Number.isFinite(f.bufferView))f.code=u.decode(t.getTypedArrayForBufferView(f.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),n.forEach(function(f){f.fragmentShader=a[f.fragmentShader],f.vertexShader=a[f.vertexShader]}),s.forEach(function(f){f.program=n[f.program]}),s}function X6(e,t){var r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(function(n){e.uniforms[n].value&&!(n in r)&&(r[n]=e.uniforms[n].value)}),Object.keys(r).forEach(function(n){uf(r[n])==="object"&&r[n].index!==void 0&&(r[n].texture=t.getTexture(r[n].index))}),r}var vp={};lt(vp,{decode:()=>Y6,name:()=>K6});function jS(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function q6(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){jS(a,n,i,o,s,"next",u)}function s(u){jS(a,n,i,o,s,"throw",u)}o(void 0)})}}var kS="EXT_feature_metadata",K6=kS;function Y6(e){return mp.apply(this,arguments)}function mp(){return mp=q6(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:r=new ye(t),$6(r);case 2:case"end":return i.stop()}},e)})),mp.apply(this,arguments)}function $6(e){var t,r=e.getExtension(kS),n=r==null||(t=r.schema)===null||t===void 0?void 0:t.classes,i=r?.featureTables,a=r?.featureTextures;if(a&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.'),n&&i)for(var o in n){var s=n[o],u=e4(i,o);u&&Z6(e,u,s)}}function Z6(e,t,r){for(var n in r.properties){var i,a=r.properties[n],o=t==null||(i=t.properties)===null||i===void 0?void 0:i[n],s=t.count;if(o){var u=Q6(e,a,s,o);o.data=u}}}function Q6(e,t,r,n){var i=n.bufferView,a=e.getTypedArrayForBufferView(i);switch(t.type){case"STRING":{var o=n.stringOffsetBufferView,s=e.getTypedArrayForBufferView(o);a=t4(a,s,r);break}default:}return a}function e4(e,t){for(var r in e){var n=e[r];if(n.class===t)return n}return null}function t4(e,t,r){for(var n=[],i=new TextDecoder("utf8"),a=0,o=4,s=0;s<r;s++){var u=t[(s+1)*o]-t[s*o],f=e.subarray(a,u+a),c=i.decode(f);n.push(c),a+=u}return n}function HS(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function r4(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){HS(a,n,i,o,s,"next",u)}function s(u){HS(a,n,i,o,s,"throw",u)}o(void 0)})}}function zS(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=n4(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
225
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function n4(e,t){if(e){if(typeof e=="string")return VS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return VS(e,t)}}function VS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var WS=[Yd,$d,Zd,np,fp,lp,pp,op,vp];function JS(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=WS.filter(function(u){return qS(u.name,t)}),i=zS(n),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s;(s=o.preprocess)===null||s===void 0||s.call(o,e,t,r)}}catch(u){i.e(u)}finally{i.f()}}function XS(e){return gp.apply(this,arguments)}function gp(){return gp=r4(regeneratorRuntime.mark(function e(t){var r,n,i,a,o,s,u,f=arguments;return regeneratorRuntime.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:r=f.length>1&&f[1]!==void 0?f[1]:{},n=f.length>2?f[2]:void 0,i=WS.filter(function(d){return qS(d.name,r)}),a=zS(i),l.prev=4,a.s();case 6:if((o=a.n()).done){l.next=12;break}return s=o.value,l.next=10,(u=s.decode)===null||u===void 0?void 0:u.call(s,t,r,n);case 10:l.next=6;break;case 12:l.next=17;break;case 14:l.prev=14,l.t0=l.catch(4),a.e(l.t0);case 17:return l.prev=17,a.f(),l.finish(17);case 20:case"end":return l.stop()}},e,null,[[4,14,17,20]])})),gp.apply(this,arguments)}function qS(e,t){var r,n=(t==null||(r=t.gltf)===null||r===void 0?void 0:r.excludeExtensions)||{},i=e in n&&!n[e];return!i}function i4(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=a4(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
226
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function a4(e,t){if(e){if(typeof e=="string")return KS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return KS(e,t)}}function KS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var yp="KHR_binary_glTF";function YS(e){var t=new ye(e),r=t.json,n=i4(r.images||[]),i;try{for(n.s();!(i=n.n()).done;){var a=i.value,o=t.getObjectExtension(a,yp);o&&Object.assign(a,o),t.removeObjectExtension(a,yp)}}catch(s){n.e(s)}finally{n.f()}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(yp)}function Fr(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=s4(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
227
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function s4(e,t){if(e){if(typeof e=="string")return $S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $S(e,t)}}function $S(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ZS={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},f4={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},c4=function(){function e(){u4(this,e),v(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),v(this,"json",void 0)}var t=e.prototype;return t.normalize=function(n,i){this.json=n.json;var a=n.json;switch(a.asset&&a.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn("glTF: Unknown version ".concat(a.asset.version));return}if(!i.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(a),this._convertTopLevelObjectsToArrays(a),YS(n),this._convertObjectIdsToArrayIndices(a),this._updateObjects(a),this._updateMaterial(a)},t._addAsset=function(n){n.asset=n.asset||{},n.asset.version="2.0",n.asset.generator=n.asset.generator||"Normalized to glTF 2.0 by loaders.gl"},t._convertTopLevelObjectsToArrays=function(n){for(var i in ZS)this._convertTopLevelObjectToArray(n,i)},t._convertTopLevelObjectToArray=function(n,i){var a=n[i];if(!(!a||Array.isArray(a))){n[i]=[];for(var o in a){var s=a[o];s.id=s.id||o;var u=n[i].length;n[i].push(s),this.idToIndexMap[i][o]=u}}},t._convertObjectIdsToArrayIndices=function(n){for(var i in ZS)this._convertIdsToIndices(n,i);"scene"in n&&(n.scene=this._convertIdToIndex(n.scene,"scene"));var a=Fr(n.textures),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;this._convertTextureIds(s)}}catch(y){a.e(y)}finally{a.f()}var u=Fr(n.meshes),f;try{for(u.s();!(f=u.n()).done;){var c=f.value;this._convertMeshIds(c)}}catch(y){u.e(y)}finally{u.f()}var l=Fr(n.nodes),d;try{for(l.s();!(d=l.n()).done;){var h=d.value;this._convertNodeIds(h)}}catch(y){l.e(y)}finally{l.f()}var p=Fr(n.scenes),m;try{for(p.s();!(m=p.n()).done;){var g=m.value;this._convertSceneIds(g)}}catch(y){p.e(y)}finally{p.f()}},t._convertTextureIds=function(n){n.source&&(n.source=this._convertIdToIndex(n.source,"image"))},t._convertMeshIds=function(n){var i=Fr(n.primitives),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=o.attributes,u=o.indices,f=o.material;for(var c in s)s[c]=this._convertIdToIndex(s[c],"accessor");u&&(o.indices=this._convertIdToIndex(u,"accessor")),f&&(o.material=this._convertIdToIndex(f,"material"))}}catch(l){i.e(l)}finally{i.f()}},t._convertNodeIds=function(n){var i=this;n.children&&(n.children=n.children.map(function(a){return i._convertIdToIndex(a,"node")})),n.meshes&&(n.meshes=n.meshes.map(function(a){return i._convertIdToIndex(a,"mesh")}))},t._convertSceneIds=function(n){var i=this;n.nodes&&(n.nodes=n.nodes.map(function(a){return i._convertIdToIndex(a,"node")}))},t._convertIdsToIndices=function(n,i){n[i]||(console.warn("gltf v1: json doesn't contain attribute ".concat(i)),n[i]=[]);var a=Fr(n[i]),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;for(var u in s){var f=s[u],c=this._convertIdToIndex(f,u);s[u]=c}}}catch(l){a.e(l)}finally{a.f()}},t._convertIdToIndex=function(n,i){var a=f4[i];if(a in this.idToIndexMap){var o=this.idToIndexMap[a][n];if(!Number.isFinite(o))throw new Error("gltf v1: failed to resolve ".concat(i," with id ").concat(n));return o}return n},t._updateObjects=function(n){var i=Fr(this.json.buffers),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;delete o.type}}catch(s){i.e(s)}finally{i.f()}},t._updateMaterial=function(n){var i=Fr(n.materials),a;try{var o=function(){var l=a.value;l.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var d=((s=l.values)===null||s===void 0?void 0:s.tex)||((u=l.values)===null||u===void 0?void 0:u.texture2d_0)||((f=l.values)===null||f===void 0?void 0:f.diffuseTex),h=n.textures.findIndex(function(p){return p.id===d});h!==-1&&(l.pbrMetallicRoughness.baseColorTexture={index:h})};for(i.s();!(a=i.n()).done;){var s,u,f;o()}}catch(c){i.e(c)}finally{i.f()}},e}();function QS(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new c4().normalize(e,t)}var hi;function ew(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function nr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ew(Object(r),!0).forEach(function(n){Aa(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ew(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ff(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ff=function(r){return typeof r}:ff=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ff(e)}function l4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Aa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var h4={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},d4={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ot={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},p4={magFilter:ot.TEXTURE_MAG_FILTER,minFilter:ot.TEXTURE_MIN_FILTER,wrapS:ot.TEXTURE_WRAP_S,wrapT:ot.TEXTURE_WRAP_T},m4=(hi={},Aa(hi,ot.TEXTURE_MAG_FILTER,ot.LINEAR),Aa(hi,ot.TEXTURE_MIN_FILTER,ot.NEAREST_MIPMAP_LINEAR),Aa(hi,ot.TEXTURE_WRAP_S,ot.REPEAT),Aa(hi,ot.TEXTURE_WRAP_T,ot.REPEAT),hi);function v4(e){return d4[e]}function g4(e){return h4[e]}var y4=function(){function e(){l4(this,e),v(this,"baseUri",""),v(this,"json",{}),v(this,"buffers",[]),v(this,"images",[])}var t=e.prototype;return t.postProcess=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.json,o=n.buffers,s=o===void 0?[]:o,u=n.images,f=u===void 0?[]:u,c=n.baseUri,l=c===void 0?"":c;return Be(a),this.baseUri=l,this.json=a,this.buffers=s,this.images=f,this._resolveTree(this.json,i),this.json},t._resolveTree=function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};n.bufferViews&&(n.bufferViews=n.bufferViews.map(function(o,s){return i._resolveBufferView(o,s)})),n.images&&(n.images=n.images.map(function(o,s){return i._resolveImage(o,s)})),n.samplers&&(n.samplers=n.samplers.map(function(o,s){return i._resolveSampler(o,s)})),n.textures&&(n.textures=n.textures.map(function(o,s){return i._resolveTexture(o,s)})),n.accessors&&(n.accessors=n.accessors.map(function(o,s){return i._resolveAccessor(o,s)})),n.materials&&(n.materials=n.materials.map(function(o,s){return i._resolveMaterial(o,s)})),n.meshes&&(n.meshes=n.meshes.map(function(o,s){return i._resolveMesh(o,s)})),n.nodes&&(n.nodes=n.nodes.map(function(o,s){return i._resolveNode(o,s)})),n.skins&&(n.skins=n.skins.map(function(o,s){return i._resolveSkin(o,s)})),n.scenes&&(n.scenes=n.scenes.map(function(o,s){return i._resolveScene(o,s)})),n.scene!==void 0&&(n.scene=n.scenes[this.json.scene])},t.getScene=function(n){return this._get("scenes",n)},t.getNode=function(n){return this._get("nodes",n)},t.getSkin=function(n){return this._get("skins",n)},t.getMesh=function(n){return this._get("meshes",n)},t.getMaterial=function(n){return this._get("materials",n)},t.getAccessor=function(n){return this._get("accessors",n)},t.getCamera=function(n){return null},t.getTexture=function(n){return this._get("textures",n)},t.getSampler=function(n){return this._get("samplers",n)},t.getImage=function(n){return this._get("images",n)},t.getBufferView=function(n){return this._get("bufferViews",n)},t.getBuffer=function(n){return this._get("buffers",n)},t._get=function(n,i){if(ff(i)==="object")return i;var a=this.json[n]&&this.json[n][i];return a||console.warn("glTF file error: Could not find ".concat(n,"[").concat(i,"]")),a},t._resolveScene=function(n,i){var a=this;return n.id=n.id||"scene-".concat(i),n.nodes=(n.nodes||[]).map(function(o){return a.getNode(o)}),n},t._resolveNode=function(n,i){var a=this;return n.id=n.id||"node-".concat(i),n.children&&(n.children=n.children.map(function(o){return a.getNode(o)})),n.mesh!==void 0?n.mesh=this.getMesh(n.mesh):n.meshes!==void 0&&n.meshes.length&&(n.mesh=n.meshes.reduce(function(o,s){var u=a.getMesh(s);return o.id=u.id,o.primitives=o.primitives.concat(u.primitives),o},{primitives:[]})),n.camera!==void 0&&(n.camera=this.getCamera(n.camera)),n.skin!==void 0&&(n.skin=this.getSkin(n.skin)),n},t._resolveSkin=function(n,i){return n.id=n.id||"skin-".concat(i),n.inverseBindMatrices=this.getAccessor(n.inverseBindMatrices),n},t._resolveMesh=function(n,i){var a=this;return n.id=n.id||"mesh-".concat(i),n.primitives&&(n.primitives=n.primitives.map(function(o){o=nr({},o);var s=o.attributes;o.attributes={};for(var u in s)o.attributes[u]=a.getAccessor(s[u]);return o.indices!==void 0&&(o.indices=a.getAccessor(o.indices)),o.material!==void 0&&(o.material=a.getMaterial(o.material)),o})),n},t._resolveMaterial=function(n,i){if(n.id=n.id||"material-".concat(i),n.normalTexture&&(n.normalTexture=nr({},n.normalTexture),n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlustionTexture=nr({},n.occlustionTexture),n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emmisiveTexture=nr({},n.emmisiveTexture),n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emmisiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness=nr({},n.pbrMetallicRoughness);var a=n.pbrMetallicRoughness;a.baseColorTexture&&(a.baseColorTexture=nr({},a.baseColorTexture),a.baseColorTexture.texture=this.getTexture(a.baseColorTexture.index)),a.metallicRoughnessTexture&&(a.metallicRoughnessTexture=nr({},a.metallicRoughnessTexture),a.metallicRoughnessTexture.texture=this.getTexture(a.metallicRoughnessTexture.index))}return n},t._resolveAccessor=function(n,i){if(n.id=n.id||"accessor-".concat(i),n.bufferView!==void 0&&(n.bufferView=this.getBufferView(n.bufferView)),n.bytesPerComponent=v4(n.componentType),n.components=g4(n.type),n.bytesPerElement=n.bytesPerComponent*n.components,n.bufferView){var a=n.bufferView.buffer,o=ci(n,n.bufferView),s=o.ArrayType,u=o.byteLength,f=(n.bufferView.byteOffset||0)+(n.byteOffset||0)+a.byteOffset,c=a.arrayBuffer.slice(f,f+u);n.bufferView.byteStride&&(c=this._getValueFromInterleavedBuffer(a,f,n.bufferView.byteStride,n.bytesPerElement,n.count)),n.value=new s(c)}return n},t._getValueFromInterleavedBuffer=function(n,i,a,o,s){for(var u=new Uint8Array(s*o),f=0;f<s;f++){var c=i+f*a;u.set(new Uint8Array(n.arrayBuffer.slice(c,c+o)),f*o)}return u.buffer},t._resolveTexture=function(n,i){return n.id=n.id||"texture-".concat(i),n.sampler="sampler"in n?this.getSampler(n.sampler):m4,n.source=this.getImage(n.source),n},t._resolveSampler=function(n,i){n.id=n.id||"sampler-".concat(i),n.parameters={};for(var a in n){var o=this._enumSamplerParameter(a);o!==void 0&&(n.parameters[o]=n[a])}return n},t._enumSamplerParameter=function(n){return p4[n]},t._resolveImage=function(n,i){n.id=n.id||"image-".concat(i),n.bufferView!==void 0&&(n.bufferView=this.getBufferView(n.bufferView));var a=this.images[i];return a&&(n.image=a),n},t._resolveBufferView=function(n,i){var a=n.buffer,o=nr(nr({id:"bufferView-".concat(i)},n),{},{buffer:this.buffers[a]}),s=this.buffers[a].arrayBuffer,u=this.buffers[a].byteOffset||0;return"byteOffset"in n&&(u+=n.byteOffset),o.data=new Uint8Array(s,u,n.byteLength),o},t._resolveCamera=function(n,i){return n.id=n.id||"camera-".concat(i),n.perspective,n.orthographic,n},e}();function tw(e,t){return new y4().postProcess(e,t)}var rw=1735152710,Ap=12,cf=8,b4=1313821514,_4=5130562,A4=0,T4=1,S4=0,di=!0;function w4(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return"".concat(String.fromCharCode(e.getUint8(t+0))).concat(String.fromCharCode(e.getUint8(t+1))).concat(String.fromCharCode(e.getUint8(t+2))).concat(String.fromCharCode(e.getUint8(t+3)))}function nw(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=new DataView(e),i=r.magic,a=i===void 0?rw:i,o=n.getUint32(t,!1);return o===a||o===rw}function Tp(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=new DataView(t),a=w4(i,r+0),o=i.getUint32(r+4,di),s=i.getUint32(r+8,di);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=Ap,e.version){case 1:return x4(e,i,r);case 2:return E4(e,i,r,n={});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}function x4(e,t,r){Z(e.header.byteLength>Ap+cf);var n=t.getUint32(r+0,di),i=t.getUint32(r+4,di);return r+=cf,Z(i===S4),bp(e,t,r,n),r+=n,r+=_p(e,t,r,e.header.byteLength),r}function E4(e,t,r,n){return Z(e.header.byteLength>Ap+cf),O4(e,t,r,n),r+e.header.byteLength}function O4(e,t,r,n){for(;r+8<=e.header.byteLength;){var i=t.getUint32(r+0,di),a=t.getUint32(r+4,di);switch(r+=cf,a){case b4:bp(e,t,r,i);break;case _4:_p(e,t,r,i);break;case A4:n.strict||bp(e,t,r,i);break;case T4:n.strict||_p(e,t,r,i);break;default:break}r+=fr(i,4)}return r}function bp(e,t,r,n){var i=new Uint8Array(t.buffer,r,n),a=new TextDecoder("utf8"),o=a.decode(i);return e.json=JSON.parse(o),fr(n,4)}function _p(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),fr(n,4)}function ow(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=P4(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
228
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function P4(e,t){if(e){if(typeof e=="string")return iw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return iw(e,t)}}function iw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function aw(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function lf(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){aw(a,n,i,o,s,"next",u)}function s(u){aw(a,n,i,o,s,"throw",u)}o(void 0)})}}function sw(e,t){return Sp.apply(this,arguments)}function Sp(){return Sp=lf(regeneratorRuntime.mark(function e(t,r){var n,i,a,o,s,u,f,c,l,d,h=arguments;return regeneratorRuntime.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(s=h.length>2&&h[2]!==void 0?h[2]:0,u=h.length>3?h[3]:void 0,f=h.length>4?h[4]:void 0,B4(t,r,s,u),QS(t,{normalize:u==null||(n=u.gltf)===null||n===void 0?void 0:n.normalize}),JS(t,u,f),c=[],!(u!=null&&(i=u.gltf)!==null&&i!==void 0&&i.loadBuffers&&t.json.buffers)){m.next=10;break}return m.next=10,C4(t,u,f);case 10:return u!=null&&(a=u.gltf)!==null&&a!==void 0&&a.loadImages&&(l=M4(t,u,f),c.push(l)),d=XS(t,u,f),c.push(d),m.next=15,Promise.all(c);case 15:return m.abrupt("return",u!=null&&(o=u.gltf)!==null&&o!==void 0&&o.postProcess?tw(t,u):t);case 16:case"end":return m.stop()}},e)})),Sp.apply(this,arguments)}function B4(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!nw(t,r,n)){var i=new TextDecoder;t=i.decode(t)}if(typeof t=="string")e.json=cc(t);else if(t instanceof ArrayBuffer){var a={};r=Tp(a,t,r,n.glb),Be(a.type==="glTF","Invalid GLB magic string ".concat(a.type)),e._glb=a,e.json=a.json}else Be(!1,"GLTF: must be ArrayBuffer or string");var o=e.json.buffers||[];if(e.buffers=new Array(o.length).fill(null),e._glb&&e._glb.header.hasBinChunk){var s=e._glb.binChunks;e.buffers[0]={arrayBuffer:s[0].arrayBuffer,byteOffset:s[0].byteOffset,byteLength:s[0].byteLength}}var u=e.json.images||[];e.images=new Array(u.length).fill({})}function C4(e,t,r){return wp.apply(this,arguments)}function wp(){return wp=lf(regeneratorRuntime.mark(function e(t,r,n){var i,a,o,s,u,f,c,l,d;return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:i=t.json.buffers||[],a=0;case 2:if(!(a<i.length)){p.next=22;break}if(o=i[a],!o.uri){p.next=18;break}return f=n.fetch,Be(f),c=kd(o.uri,r),p.next=10,n==null||(s=n.fetch)===null||s===void 0?void 0:s.call(n,c);case 10:return l=p.sent,p.next=13,l==null||(u=l.arrayBuffer)===null||u===void 0?void 0:u.call(l);case 13:d=p.sent,t.buffers[a]={arrayBuffer:d,byteOffset:0,byteLength:d.byteLength},delete o.uri,p.next=19;break;case 18:t.buffers[a]===null&&(t.buffers[a]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength});case 19:++a,p.next=2;break;case 22:case"end":return p.stop()}},e)})),wp.apply(this,arguments)}function M4(e,t,r){return xp.apply(this,arguments)}function xp(){return xp=lf(regeneratorRuntime.mark(function e(t,r,n){var i,a,o,s,u,f;return regeneratorRuntime.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:i=I4(t),a=t.json.images||[],o=[],s=ow(i);try{for(s.s();!(u=s.n()).done;)f=u.value,o.push(R4(t,a[f],f,r,n))}catch(d){s.e(d)}finally{s.f()}return l.next=7,Promise.all(o);case 7:return l.abrupt("return",l.sent);case 8:case"end":return l.stop()}},e)})),xp.apply(this,arguments)}function I4(e){var t=new Set,r=e.json.textures||[],n=ow(r),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.source!==void 0&&t.add(a.source)}}catch(o){n.e(o)}finally{n.f()}return Array.from(t).sort()}function R4(e,t,r,n,i){return Ep.apply(this,arguments)}function Ep(){return Ep=lf(regeneratorRuntime.mark(function e(t,r,n,i,a){var o,s,u,f,c,l,d;return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(o=a.fetch,s=a.parse,!(r.uri&&!r.hasOwnProperty("bufferView"))){p.next=10;break}return f=kd(r.uri,i),p.next=5,o(f);case 5:return c=p.sent,p.next=8,c.arrayBuffer();case 8:u=p.sent,r.bufferView={data:u};case 10:return Number.isFinite(r.bufferView)&&(l=iS(t.json,t.buffers,r.bufferView),u=Hr(l.buffer,l.byteOffset,l.byteLength)),Be(u,"glTF image has no data"),p.next=14,s(u,[Wt,jd],{mimeType:r.mimeType,basis:i.basis||{format:ef()}},a);case 14:d=p.sent,d&&d[0]&&(d={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d[0]}),t.images=t.images||[],t.images[n]=d;case 18:case"end":return p.stop()}},e)})),Ep.apply(this,arguments)}function uw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uw(Object(r),!0).forEach(function(n){F4(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function F4(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fw(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function L4(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){fw(a,n,i,o,s,"next",u)}function s(u){fw(a,n,i,o,s,"throw",u)}o(void 0)})}}var vn={name:"glTF",id:"gltf",module:"gltf",version:FT,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:D4,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};function D4(e){return Op.apply(this,arguments)}function Op(){return Op=L4(regeneratorRuntime.mark(function e(t){var r,n,i,a,o,s,u=arguments;return regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return r=u.length>1&&u[1]!==void 0?u[1]:{},n=u.length>2?u[2]:void 0,r=hf(hf({},vn.options),r),r.gltf=hf(hf({},vn.options.gltf),r.gltf),i=r,a=i.byteOffset,o=a===void 0?0:a,s={},c.next=8,sw(s,t,o,r,n);case 8:return c.abrupt("return",c.sent);case 9:case"end":return c.stop()}},e)})),Op.apply(this,arguments)}function cw(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function G4(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){cw(a,n,i,o,s,"next",u)}function s(u){cw(a,n,i,o,s,"throw",u)}o(void 0)})}}var df={URI:0,EMBEDDED:1};function pf(e,t,r,n){e.rotateYtoZ=!0;var i=e.byteOffset+e.byteLength-r;if(i===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=Hr(t,r,i),e.gltfByteOffset=0,e.gltfByteLength=i,r%4===0||console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.byteOffset+e.byteLength}function mf(e,t,r,n){return Pp.apply(this,arguments)}function Pp(){return Pp=G4(regeneratorRuntime.mark(function e(t,r,n,i){var a,o,s;return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(a=n["3d-tiles"]||{},N4(t,r,n),!a.loadGLTF){f.next=17;break}if(o=i.parse,s=i.fetch,!t.gltfUrl){f.next=9;break}return f.next=7,s(t.gltfUrl,n);case 7:t.gltfArrayBuffer=f.sent,t.gltfByteOffset=0;case 9:if(!t.gltfArrayBuffer){f.next=17;break}return f.next=12,o(t.gltfArrayBuffer,vn,n,i);case 12:t.gltf=f.sent,t.gpuMemoryUsageInBytes=va(t.gltf),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;case 17:case"end":return f.stop()}},e)})),Pp.apply(this,arguments)}function N4(e,t,r){switch(t){case df.URI:var n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),i=new TextDecoder,a=i.decode(n);e.gltfUrl=a.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case df.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}function lw(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function U4(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){lw(a,n,i,o,s,"next",u)}function s(u){lw(a,n,i,o,s,"throw",u)}o(void 0)})}}function hw(e,t,r,n,i){return Bp.apply(this,arguments)}function Bp(){return Bp=U4(regeneratorRuntime.mark(function e(t,r,n,i,a){var o,s;return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return n=j4(t,r,n,i,a),f.next=3,mf(t,df.EMBEDDED,i,a);case 3:return s=t==null||(o=t.gltf)===null||o===void 0?void 0:o.extensions,s&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),f.abrupt("return",n);case 6:case"end":return f.stop()}},e)})),Bp.apply(this,arguments)}function j4(e,t,r,n,i){r=Rr(e,t,r),r=ui(e,t,r),r=fi(e,t,r,n),r=pf(e,t,r,n);var a=new ai(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",5126,3),r}function dw(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function k4(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){dw(a,n,i,o,s,"next",u)}function s(u){dw(a,n,i,o,s,"throw",u)}o(void 0)})}}function pw(e,t,r,n,i){return Cp.apply(this,arguments)}function Cp(){return Cp=k4(regeneratorRuntime.mark(function e(t,r,n,i,a){return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=H4(t,r,n,i,a),s.next=3,mf(t,t.gltfFormat,i,a);case 3:return s.abrupt("return",n);case 4:case"end":return s.stop()}},e)})),Cp.apply(this,arguments)}function H4(e,t,r,n,i){if(r=Rr(e,t,r),e.version!==1)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));r=ui(e,t,r);var a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=fi(e,t,r,n),r=pf(e,t,r,n),e.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var o=new ai(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",5126,3);var u=new Yu(e.batchTableJson,e.batchTableBinary,s);return V4(e,o,u,s),r}function V4(e,t,r,n){for(var i={instances:new Array(n),batchTable:e._batchTable,cull:!1,url:void 0,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,forwardAxis:[1,0,0]},a=i.instances,o=new E,s=new E,u=new E,f=new E,c=new le,l=new mr,d=new E,h={},p=new J,m=[],g=[],y=new E,b=new E,A=0;A<n;A++){var S=void 0;if(t.hasProperty("POSITION"))S=t.getProperty("POSITION",5126,3,A,o);else if(t.hasProperty("POSITION_QUANTIZED")){S=t.getProperty("POSITION_QUANTIZED",5123,3,A,o);var O=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3,y);if(!O)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var w=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3,b);if(!w)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var B=65535,P=0;P<3;P++)S[P]=S[P]/B*w[P]+O[P]}if(!S)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(S),h.translation=o,e.normalUp=t.getProperty("NORMAL_UP",5126,3,A,m),e.normalRight=t.getProperty("NORMAL_RIGHT",5126,3,A,g);var x=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",5123,2,m),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",5123,2,g),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(oe.WGS84.eastNorthUpToFixedFrame(o,p),p.getRotationMatrix3(c)):c.identity()}x&&(f.copy(s).cross(u).normalize(),c.setColumn(0,s),c.setColumn(1,u),c.setColumn(2,f)),l.fromMatrix3(c),h.rotation=l,d.set(1,1,1);var _=t.getProperty("SCALE",5126,1,A);Number.isFinite(_)&&d.multiplyByScalar(_);var C=t.getProperty("SCALE_NON_UNIFORM",5126,3,A,m);C&&d.scale(C),h.scale=d;var I=t.getProperty("BATCH_ID",5123,1,A);I===void 0&&(I=A);var R=new J().fromQuaternion(h.rotation);p.identity(),p.translate(h.translation),p.multiplyRight(R),p.scale(h.scale);var M=p.clone();a[A]={modelMatrix:M,batchId:I}}e.instances=a}function mw(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function z4(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){mw(a,n,i,o,s,"next",u)}function s(u){mw(a,n,i,o,s,"throw",u)}o(void 0)})}}function vw(e,t,r,n,i,a){return Mp.apply(this,arguments)}function Mp(){return Mp=z4(regeneratorRuntime.mark(function e(t,r,n,i,a,o){var s,u;return regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:n=Rr(t,r,n),s=new DataView(r),t.tilesLength=s.getUint32(n,!0),n+=4,t.tiles=[];case 5:if(!(t.tiles.length<t.tilesLength&&t.byteLength-n>12)){c.next=13;break}return u={},t.tiles.push(u),c.next=10,o(r,n,i,a,u);case 10:n=c.sent,c.next=5;break;case 13:return c.abrupt("return",n);case 14:case"end":return c.stop()}},e)})),Mp.apply(this,arguments)}function gw(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function W4(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){gw(a,n,i,o,s,"next",u)}function s(u){gw(a,n,i,o,s,"throw",u)}o(void 0)})}}function yw(e,t,r,n){return Ip.apply(this,arguments)}function Ip(){return Ip=W4(regeneratorRuntime.mark(function e(t,r,n,i){var a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return t.rotateYtoZ=!0,t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",a=i.parse,s.next=5,a(r,vn,n,i);case 5:t.gltf=s.sent,t.gpuMemoryUsageInBytes=va(t.gltf);case 7:case"end":return s.stop()}},e)})),Ip.apply(this,arguments)}function bw(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function J4(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){bw(a,n,i,o,s,"next",u)}function s(u){bw(a,n,i,o,s,"throw",u)}o(void 0)})}}function Fp(e){return Rp.apply(this,arguments)}function Rp(){return Rp=J4(regeneratorRuntime.mark(function e(t){var r,n,i,a,o=arguments;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=o.length>1&&o[1]!==void 0?o[1]:0,n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,a=o.length>4&&o[4]!==void 0?o[4]:{},a.byteOffset=r,a.type=_A(t,r),u.t0=a.type,u.next=u.t0===cn.COMPOSITE?9:u.t0===cn.BATCHED_3D_MODEL?12:u.t0===cn.GLTF?15:u.t0===cn.INSTANCED_3D_MODEL?18:u.t0===cn.POINT_CLOUD?21:24;break;case 9:return u.next=11,vw(a,t,r,n,i,Fp);case 11:return u.abrupt("return",u.sent);case 12:return u.next=14,hw(a,t,r,n,i);case 14:return u.abrupt("return",u.sent);case 15:return u.next=17,yw(a,t,n,i);case 17:return u.abrupt("return",u.sent);case 18:return u.next=20,pw(a,t,r,n,i);case 20:return u.abrupt("return",u.sent);case 21:return u.next=23,RT(a,t,r,n,i);case 23:return u.abrupt("return",u.sent);case 24:throw new Error("3DTileLoader: unknown type ".concat(a.type));case 25:case"end":return u.stop()}},e)})),Rp.apply(this,arguments)}function _w(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function Tw(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){_w(a,n,i,o,s,"next",u)}function s(u){_w(a,n,i,o,s,"throw",u)}o(void 0)})}}var X4=1952609651,q4=1;function Np(e,t,r){return Dp.apply(this,arguments)}function Dp(){return Dp=Tw(regeneratorRuntime.mark(function e(t,r,n){var i,a,o,s,u,f,c,l,d;return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(i=new Uint32Array(t.slice(0,4)),i[0]===X4){p.next=3;break}throw new Error("Wrong subtree file magic number");case 3:if(a=new Uint32Array(t.slice(4,8)),a[0]===q4){p.next=6;break}throw new Error("Wrong subtree file verson, must be 1");case 6:if(o=Aw(t.slice(8,16)),s=new Uint8Array(t,24,o),u=new TextDecoder("utf8"),f=u.decode(s),c=JSON.parse(f),l=Aw(t.slice(16,24)),d=new ArrayBuffer(0),l&&(d=t.slice(24+o)),!("bufferView"in c.tileAvailability)){p.next=18;break}return p.next=17,Lp(c,"tileAvailability",d,n);case 17:c.tileAvailability.explicitBitstream=p.sent;case 18:if(!("bufferView"in c.contentAvailability)){p.next=22;break}return p.next=21,Lp(c,"contentAvailability",d,n);case 21:c.contentAvailability.explicitBitstream=p.sent;case 22:if(!("bufferView"in c.childSubtreeAvailability)){p.next=26;break}return p.next=25,Lp(c,"childSubtreeAvailability",d,n);case 25:c.childSubtreeAvailability.explicitBitstream=p.sent;case 26:return p.abrupt("return",c);case 27:case"end":return p.stop()}},e)})),Dp.apply(this,arguments)}function K4(e,t){var r=t.startsWith("http");if(r){var n=new URL(e,t);return decodeURI(n.toString())}var i="http://".concat(t),a=new URL(e,i);return"/".concat(a.host).concat(a.pathname)}function Lp(e,t,r,n){return Gp.apply(this,arguments)}function Gp(){return Gp=Tw(regeneratorRuntime.mark(function e(t,r,n,i){var a,o,s,u,f,c;return regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(a=t[r].bufferView,o=t.bufferViews[a],s=t.buffers[o.buffer],!(!(i!=null&&i.url)||!i.fetch)){d.next=5;break}throw new Error("Url is not provided");case 5:if(i.fetch){d.next=7;break}throw new Error("fetch is not provided");case 7:if(!s.uri){d.next=16;break}return u=K4(s.uri,i?.url),d.next=11,i.fetch(u);case 11:return f=d.sent,d.next=14,f.arrayBuffer();case 14:return c=d.sent,d.abrupt("return",new Uint8Array(c,o.byteOffset,o.byteLength));case 16:return d.abrupt("return",new Uint8Array(n,o.byteOffset,o.byteLength));case 17:case"end":return d.stop()}},e)})),Gp.apply(this,arguments)}function Aw(e){var t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+Math.pow(2,32)*n}var vf={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Iu,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Np,options:{}};var Zw=q(Zn());var Jw=q(Zn());var st=null;try{st=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function me(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}me.prototype.__isLong__;Object.defineProperty(me.prototype,"__isLong__",{value:!0});function Le(e){return(e&&e.__isLong__)===!0}function Sw(e){var t=Math.clz32(e&-e);return e?31-t:t}me.isLong=Le;var ww={},xw={};function gn(e,t){var r,n,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(n=xw[e],n)?n:(r=ue(e,0,!0),i&&(xw[e]=r),r)):(e|=0,(i=-128<=e&&e<128)&&(n=ww[e],n)?n:(r=ue(e,e<0?-1:0,!1),i&&(ww[e]=r),r))}me.fromInt=gn;function ut(e,t){if(isNaN(e))return t?ir:bt;if(t){if(e<0)return ir;if(e>=Bw)return Iw}else{if(e<=-Ow)return qe;if(e+1>=Ow)return Mw}return e<0?ut(-e,t).neg():ue(e%mi|0,e/mi|0,t)}me.fromNumber=ut;function ue(e,t,r){return new me(e,t,r)}me.fromBits=ue;var gf=Math.pow;function jp(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?ir:bt;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return jp(e.substring(1),t,r).neg();for(var i=ut(gf(r,8)),a=bt,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),u=parseInt(e.substring(o,o+s),r);if(s<8){var f=ut(gf(r,s));a=a.mul(f).add(ut(u))}else a=a.mul(i),a=a.add(ut(u))}return a.unsigned=t,a}me.fromString=jp;function _t(e,t){return typeof e=="number"?ut(e,t):typeof e=="string"?jp(e,t):ue(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}me.fromValue=_t;var Ew=1<<16,Y4=1<<24,mi=Ew*Ew,Bw=mi*mi,Ow=Bw/2,Pw=gn(Y4),bt=gn(0);me.ZERO=bt;var ir=gn(0,!0);me.UZERO=ir;var pi=gn(1);me.ONE=pi;var Cw=gn(1,!0);me.UONE=Cw;var Up=gn(-1);me.NEG_ONE=Up;var Mw=ue(-1,2147483647,!1);me.MAX_VALUE=Mw;var Iw=ue(-1,-1,!0);me.MAX_UNSIGNED_VALUE=Iw;var qe=ue(0,-2147483648,!1);me.MIN_VALUE=qe;var L=me.prototype;L.toInt=function(){return this.unsigned?this.low>>>0:this.low};L.toNumber=function(){return this.unsigned?(this.high>>>0)*mi+(this.low>>>0):this.high*mi+(this.low>>>0)};L.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(qe)){var r=ut(t),n=this.div(r),i=n.mul(r).sub(this);return n.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=ut(gf(t,6),this.unsigned),o=this,s="";;){var u=o.div(a),f=o.sub(u.mul(a)).toInt()>>>0,c=f.toString(t);if(o=u,o.isZero())return c+s;for(;c.length<6;)c="0"+c;s=""+c+s}};L.getHighBits=function(){return this.high};L.getHighBitsUnsigned=function(){return this.high>>>0};L.getLowBits=function(){return this.low};L.getLowBitsUnsigned=function(){return this.low>>>0};L.getNumBitsAbs=function(){if(this.isNegative())return this.eq(qe)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1};L.isZero=function(){return this.high===0&&this.low===0};L.eqz=L.isZero;L.isNegative=function(){return!this.unsigned&&this.high<0};L.isPositive=function(){return this.unsigned||this.high>=0};L.isOdd=function(){return(this.low&1)===1};L.isEven=function(){return(this.low&1)===0};L.equals=function(t){return Le(t)||(t=_t(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};L.eq=L.equals;L.notEquals=function(t){return!this.eq(t)};L.neq=L.notEquals;L.ne=L.notEquals;L.lessThan=function(t){return this.comp(t)<0};L.lt=L.lessThan;L.lessThanOrEqual=function(t){return this.comp(t)<=0};L.lte=L.lessThanOrEqual;L.le=L.lessThanOrEqual;L.greaterThan=function(t){return this.comp(t)>0};L.gt=L.greaterThan;L.greaterThanOrEqual=function(t){return this.comp(t)>=0};L.gte=L.greaterThanOrEqual;L.ge=L.greaterThanOrEqual;L.compare=function(t){if(Le(t)||(t=_t(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};L.comp=L.compare;L.negate=function(){return!this.unsigned&&this.eq(qe)?qe:this.not().add(pi)};L.neg=L.negate;L.add=function(t){Le(t)||(t=_t(t));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,u=t.low>>>16,f=t.low&65535,c=0,l=0,d=0,h=0;return h+=a+f,d+=h>>>16,h&=65535,d+=i+u,l+=d>>>16,d&=65535,l+=n+s,c+=l>>>16,l&=65535,c+=r+o,c&=65535,ue(d<<16|h,c<<16|l,this.unsigned)};L.subtract=function(t){return Le(t)||(t=_t(t)),this.add(t.neg())};L.sub=L.subtract;L.multiply=function(t){if(this.isZero())return this;if(Le(t)||(t=_t(t)),st){var r=st.mul(this.low,this.high,t.low,t.high);return ue(r,st.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?ir:bt;if(this.eq(qe))return t.isOdd()?qe:bt;if(t.eq(qe))return this.isOdd()?qe:bt;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(Pw)&&t.lt(Pw))return ut(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,u=t.high&65535,f=t.low>>>16,c=t.low&65535,l=0,d=0,h=0,p=0;return p+=o*c,h+=p>>>16,p&=65535,h+=a*c,d+=h>>>16,h&=65535,h+=o*f,d+=h>>>16,h&=65535,d+=i*c,l+=d>>>16,d&=65535,d+=a*f,l+=d>>>16,d&=65535,d+=o*u,l+=d>>>16,d&=65535,l+=n*c+i*f+a*u+o*s,l&=65535,ue(h<<16|p,l<<16|d,this.unsigned)};L.mul=L.multiply;L.divide=function(t){if(Le(t)||(t=_t(t)),t.isZero())throw Error("division by zero");if(st){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?st.div_u:st.div_s)(this.low,this.high,t.low,t.high);return ue(r,st.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?ir:bt;var n,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return ir;if(t.gt(this.shru(1)))return Cw;a=ir}else{if(this.eq(qe)){if(t.eq(pi)||t.eq(Up))return qe;if(t.eq(qe))return pi;var o=this.shr(1);return n=o.div(t).shl(1),n.eq(bt)?t.isNegative()?pi:Up:(i=this.sub(t.mul(n)),a=n.add(i.div(t)),a)}else if(t.eq(qe))return this.unsigned?ir:bt;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=bt}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:gf(2,s-48),f=ut(n),c=f.mul(t);c.isNegative()||c.gt(i);)n-=u,f=ut(n,this.unsigned),c=f.mul(t);f.isZero()&&(f=pi),a=a.add(f),i=i.sub(c)}return a};L.div=L.divide;L.modulo=function(t){if(Le(t)||(t=_t(t)),st){var r=(this.unsigned?st.rem_u:st.rem_s)(this.low,this.high,t.low,t.high);return ue(r,st.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};L.mod=L.modulo;L.rem=L.modulo;L.not=function(){return ue(~this.low,~this.high,this.unsigned)};L.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};L.clz=L.countLeadingZeros;L.countTrailingZeros=function(){return this.low?Sw(this.low):Sw(this.high)+32};L.ctz=L.countTrailingZeros;L.and=function(t){return Le(t)||(t=_t(t)),ue(this.low&t.low,this.high&t.high,this.unsigned)};L.or=function(t){return Le(t)||(t=_t(t)),ue(this.low|t.low,this.high|t.high,this.unsigned)};L.xor=function(t){return Le(t)||(t=_t(t)),ue(this.low^t.low,this.high^t.high,this.unsigned)};L.shiftLeft=function(t){return Le(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?ue(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):ue(0,this.low<<t-32,this.unsigned)};L.shl=L.shiftLeft;L.shiftRight=function(t){return Le(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?ue(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):ue(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};L.shr=L.shiftRight;L.shiftRightUnsigned=function(t){return Le(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?ue(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?ue(this.high,0,this.unsigned):ue(this.high>>>t-32,0,this.unsigned)};L.shru=L.shiftRightUnsigned;L.shr_u=L.shiftRightUnsigned;L.rotateLeft=function(t){var r;return Le(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?ue(this.high,this.low,this.unsigned):t<32?(r=32-t,ue(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,ue(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};L.rotl=L.rotateLeft;L.rotateRight=function(t){var r;return Le(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?ue(this.high,this.low,this.unsigned):t<32?(r=32-t,ue(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,ue(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};L.rotr=L.rotateRight;L.toSigned=function(){return this.unsigned?ue(this.low,this.high,!1):this};L.toUnsigned=function(){return this.unsigned?this:ue(this.low,this.high,!0)};L.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};L.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};L.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};me.fromBytes=function(t,r,n){return n?me.fromBytesLE(t,r):me.fromBytesBE(t,r)};me.fromBytesLE=function(t,r){return new me(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};me.fromBytesBE=function(t,r){return new me(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var vi=me;var $4=16;function Ta(e){e==="X"&&(e="");var t=e.padEnd($4,"0");return vi.fromString(t,!0,16)}function kp(e){if(e.isZero())return"X";var t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;var n=t;t*=4;var i=e.shiftRightUnsigned(t),a=i.toString(16).replace(/0+$/,""),o=Array(17-n-a.length).join("0");return o+a}function Hp(e,t){var r=Z4(e).shiftRightUnsigned(2),n=e.add(vi.fromNumber(2*t+1-4).multiply(r));return n}function Z4(e){return e.and(e.not().add(1))}function Dw(e,t){return r9(e)||t9(e,t)||e9(e,t)||Q4()}function Q4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
229
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e9(e,t){if(e){if(typeof e=="string")return Rw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rw(e,t)}}function Rw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t9(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function r9(e){if(Array.isArray(e))return e}var n9=3,i9=30,a9=2*i9+1,Fw=180/Math.PI;function Gw(e){if(e.length===0)throw new Error("Invalid Hilbert quad key ".concat(e));for(var t=e.split("/"),r=parseInt(t[0],10),n=t[1],i=n.length,a=0,o=[0,0],s=i-1;s>=0;s--){a=i-s;var u=n[s],f=0,c=0;u==="1"?c=1:u==="2"?(f=1,c=1):u==="3"&&(f=1);var l=Math.pow(2,a-1);o9(l,o,f,c),o[0]+=l*f,o[1]+=l*c}if(r%2===1){var d=o[0];o[0]=o[1],o[1]=d}return{face:r,ij:o,level:a}}function Nw(e){if(e.isZero())return"";for(var t=e.toString(2);t.length<n9+a9;)t="0"+t;var r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=vi.fromString(n,!0,2).toString(10),s="";if(a!==0)for(s=vi.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}function Vp(e,t,r){var n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function Lw(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function zp(e){return[Lw(e[0]),Lw(e[1])]}function Wp(e,t){var r=Dw(t,2),n=r[0],i=r[1];switch(e){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function Jp(e){var t=Dw(e,3),r=t[0],n=t[1],i=t[2],a=Math.atan2(i,Math.sqrt(r*r+n*n)),o=Math.atan2(n,r);return[o*Fw,a*Fw]}function o9(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);var i=t[0];t[0]=t[1],t[1]=i}}function Uw(e){var t=Vp(e.ij,e.level,[.5,.5]),r=zp(t),n=Wp(e.face,r);return Jp(n)}var s9=100;function Xp(e){for(var t=e.face,r=e.ij,n=e.level,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(s9*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0,f=0;f<4;f++)for(var c=i[f].slice(0),l=i[f+1],d=(l[0]-c[0])/a,h=(l[1]-c[1])/a,p=0;p<a;p++){c[0]+=d,c[1]+=h;var m=Vp(r,n,c),g=zp(m),y=Wp(t,g),b=Jp(y);Math.abs(b[1])>89.999&&(b[0]=u);var A=b[0]-u;b[0]+=A>180?-360:A<-180?360:0,o[s++]=b[0],o[s++]=b[1],u=b[0]}return o[s++]=o[0],o[s++]=o[1],o}function gi(e){var t=u9(e),r=Gw(t);return r}function u9(e){if(e.indexOf("/")>0)return e;var t=Ta(e);return Nw(t)}function qp(e){var t=gi(e);return Uw(t)}function kw(e){var t;if(e.face===2||e.face===5){for(var r=null,n=0,i=0;i<4;i++){var a="".concat(e.face,"/").concat(i),o=gi(a),s=Xp(o);(typeof r>"u"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,n),n+=s.length}t=jw(r)}else{var u=Xp(e);t=jw(u)}return t}function jw(e){if(e.length%2!==0)throw new Error("Invalid corners");for(var t=[],r=[],n=0;n<e.length;n+=2)t.push(e[n]),r.push(e[n+1]);return t.sort(function(i,a){return i-a}),r.sort(function(i,a){return i-a}),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}function Kp(e,t){var r=t?.minimumHeight||0,n=t?.maximumHeight||0,i=gi(e),a=kw(i),o=a.west,s=a.south,u=a.east,f=a.north,c=[];return c.push(new E(o,f,r)),c.push(new E(u,f,r)),c.push(new E(u,s,r)),c.push(new E(o,s,r)),c.push(new E(o,f,n)),c.push(new E(u,f,n)),c.push(new E(u,s,n)),c.push(new E(o,s,n)),c}function Hw(e){return h9(e)||l9(e)||c9(e)||f9()}function f9(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
230
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c9(e,t){if(e){if(typeof e=="string")return Yp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yp(e,t)}}function l9(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function h9(e){if(Array.isArray(e))return Yp(e)}function Yp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yf(e){var t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=Kp(t,r),i=qp(t),a=i[0],o=i[1],s=oe.WGS84.cartographicToCartesian([a,o,r.maximumHeight]),u=new E(s[0],s[1],s[2]);n.push(u);var f=Xi(n),c=[].concat(Hw(f.center),Hw(f.halfAxes));return c}function d9(e,t){return g9(e)||v9(e,t)||m9(e,t)||p9()}function p9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
231
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m9(e,t){if(e){if(typeof e=="string")return Vw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vw(e,t)}}function Vw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v9(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function g9(e){if(Array.isArray(e))return e}function zw(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function y9(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){zw(a,n,i,o,s,"next",u)}function s(u){zw(a,n,i,o,s,"throw",u)}o(void 0)})}}function Ww(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function b9(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ww(Object(r),!0).forEach(function(n){_9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ww(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _9(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var A9=4,T9=8,S9={QUADTREE:A9,OCTREE:T9};function w9(e,t,r){if(e!=null&&e.box){var n=Ta(e.s2VolumeInfo.token),i=Hp(n,t),a=kp(i),o=b9({},e.s2VolumeInfo);switch(o.token=a,r){case"OCTREE":var s=e.s2VolumeInfo,u=s.maximumHeight-s.minimumHeight,f=u/2,c=s.minimumHeight+u/2;s.minimumHeight=c-f,s.maximumHeight=c+f;break;default:break}var l=yf(o),d={box:l,s2VolumeInfo:o};return d}}function Qp(e){return Zp.apply(this,arguments)}function Zp(){return Zp=y9(regeneratorRuntime.mark(function e(t){var r,n,i,a,o,s,u,f,c,l,d,h,p,m,g,y,b,A,S,O,w,B,P,x,_,C,I,R,M,D,N,j,U,k,H,W,re,De,At,ct,Tt,kt,St,et,Sn,Xm;return regeneratorRuntime.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:if(r=t.options,n=t.parentData,i=n===void 0?{mortonIndex:0,x:0,y:0,z:0}:n,a=t.childIndex,o=a===void 0?0:a,s=t.globalData,u=s===void 0?{level:0,mortonIndex:0,x:0,y:0,z:0}:s,f=t.s2VolumeBox,c=t.subtree,l=t.level,d=l===void 0?0:l,h=r.subdivisionScheme,p=r.subtreeLevels,m=r.maximumLevel,g=r.contentUrlTemplate,y=r.subtreesUriTemplate,b=r.basePath,A={children:[],lodMetricValue:0,contentUrl:""},S=S9[h],O=o&1,w=o>>1&1,B=o>>2&1,P=(Math.pow(S,d)-1)/(S-1),x=yn(i.mortonIndex,o),_=P+x,C=yn(i.x,O),I=yn(i.y,w),R=yn(i.z,B),M=!1,d+1>p&&(M=$p(c.childSubtreeAvailability,x)),D=yn(u.x,C),N=yn(u.y,I),j=yn(u.z,R),U=d+u.level,!M){Ke.next=38;break}return k="".concat(b,"/").concat(y),H=bf(k,U,D,N,j),Ke.next=25,(0,Jw.load)(H,vf);case 25:W=Ke.sent,c=W,u.mortonIndex=x,u.x=C,u.y=I,u.z=R,u.level=d,x=0,_=0,C=0,I=0,R=0,d=0;case 38:if(re=$p(c.tileAvailability,_),!(!re||d>m)){Ke.next=41;break}return Ke.abrupt("return",A);case 41:De=$p(c.contentAvailability,_),De&&(A.contentUrl=bf(g,U,D,N,j)),At=d+1,ct={mortonIndex:x,x:C,y:I,z:R},Tt=0;case 46:if(!(Tt<S)){Ke.next=55;break}return kt=w9(f,Tt,h),Ke.next=50,Qp({subtree:c,options:r,parentData:ct,childIndex:Tt,level:At,globalData:u,s2VolumeBox:kt});case 50:St=Ke.sent,(St.contentUrl||St.children.length)&&(et=U+1,Sn={childTileX:C,childTileY:I,childTileZ:R},Xm=x9(St,et,Sn,r,f),A.children.push(Xm));case 52:Tt++,Ke.next=46;break;case 55:return Ke.abrupt("return",A);case 56:case"end":return Ke.stop()}},e)})),Zp.apply(this,arguments)}function $p(e,t){return"constant"in e?Boolean(e.constant):e.explicitBitstream?P9(t,e.explicitBitstream):!1}function x9(e,t,r,n,i){var a=n.basePath,o=n.refine,s=n.getRefine,u=n.lodMetricType,f=n.getTileType,c=n.rootLodMetricValue,l=n.rootBoundingVolume,d=e.contentUrl&&e.contentUrl.replace("".concat(a,"/"),""),h=c/Math.pow(2,t),p=i!=null&&i.box?{box:i.box}:l,m=E9(t,p,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:d},id:e.contentUrl,refine:s(o),type:f(e),lodMetricType:u,lodMetricValue:h,geometricError:h,transform:e.transform,boundingVolume:m}}function E9(e,t,r){if(t.region){var n=r.childTileX,i=r.childTileY,a=r.childTileZ,o=d9(t.region,6),s=o[0],u=o[1],f=o[2],c=o[3],l=o[4],d=o[5],h=Math.pow(2,e),p=(f-s)/h,m=(c-u)/h,g=(d-l)/h,y=s+p*n,b=s+p*(n+1),A=u+m*i,S=u+m*(i+1),O=l+g*a,w=l+g*(a+1);return{region:[y,A,b,S,O,w]}}if(t.box)return t;throw new Error("Unsupported bounding volume type ".concat(t))}function yn(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function bf(e,t,r,n,i){var a=O9({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,function(o){return a[o]})}function O9(e){var t={};for(var r in e)t["{".concat(r,"}")]=e[r];return t}function P9(e,t){var r=Math.floor(e/8),n=e%8,i=t[r]>>n&1;return i===1}function B9(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=C9(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
232
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function C9(e,t){if(e){if(typeof e=="string")return Xw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xw(e,t)}}function Xw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function qw(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function im(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){qw(a,n,i,o,s,"next",u)}function s(u){qw(a,n,i,o,s,"throw",u)}o(void 0)})}}function am(e){if(!e.contentUrl)return tr.EMPTY;var t=e.contentUrl.split("?")[0],r=t.split(".").pop();switch(r){case"pnts":return tr.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return tr.SCENEGRAPH;default:return r}}function om(e){switch(e){case"REPLACE":case"replace":return We.REPLACE;case"ADD":case"add":return We.ADD;default:return e}}function em(e,t){var r=/^[a-z][0-9a-z+.-]*:/i;if(r.test(t)){var n=new URL(e,"".concat(t,"/"));return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return"".concat(t,"/").concat(e)}function Kw(e,t){if(!e)return null;if(e.content){var r=e.content.uri||e.content.url;e.contentUrl=em(r,t.basePath)}return e.id=e.contentUrl,e.lodMetricType=fn.GEOMETRIC_ERROR,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=am(e),e.refine=om(e.refine),e}function Qw(e,t){return tm.apply(this,arguments)}function tm(){return tm=im(regeneratorRuntime.mark(function e(t,r){var n,i,a,o,s,u,f,c,l,d;return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(n=t.basePath,a=$w(t?.root),!(a&&t.root)){p.next=8;break}return p.next=5,Yw(t.root,t,a,r);case 5:i=p.sent,p.next=9;break;case 8:i=Kw(t.root,t);case 9:o=[],o.push(i);case 11:if(!(o.length>0)){p.next=40;break}s=o.pop()||{},u=s.children||[],f=B9(u),p.prev=15,f.s();case 17:if((c=f.n()).done){p.next=30;break}if(l=c.value,d=$w(l),!d){p.next=26;break}return p.next=23,Yw(l,t,d,r);case 23:l=p.sent,p.next=27;break;case 26:Kw(l,{basePath:n});case 27:o.push(l);case 28:p.next=17;break;case 30:p.next=35;break;case 32:p.prev=32,p.t0=p.catch(15),f.e(p.t0);case 35:return p.prev=35,f.f(),p.finish(35);case 38:p.next=11;break;case 40:return p.abrupt("return",i);case 41:case"end":return p.stop()}},e,null,[[15,32,35,38]])})),tm.apply(this,arguments)}function Yw(e,t,r,n){return rm.apply(this,arguments)}function rm(){return rm=im(regeneratorRuntime.mark(function e(t,r,n,i){var a,o,s,u,f,c,l,d,h,p,m,g,y,b,A,S,O,w;return regeneratorRuntime.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return s=r.basePath,u=n.subdivisionScheme,f=n.maximumLevel,c=n.subtreeLevels,l=n.subtrees.uri,d=bf(l,0,0,0,0),h=em(d,s),P.next=6,(0,Zw.load)(h,vf,i);case 6:return p=P.sent,m=em(t.content.uri,s),g=r==null||(a=r.root)===null||a===void 0?void 0:a.refine,y=t.geometricError,b=(o=t.boundingVolume.extensions)===null||o===void 0?void 0:o["3DTILES_bounding_volume_S2"],b&&(A=yf(b),S={box:A,s2VolumeInfo:b},t.boundingVolume=S),O=t.boundingVolume,w={contentUrlTemplate:m,subtreesUriTemplate:l,subdivisionScheme:u,subtreeLevels:c,maximumLevel:f,refine:g,basePath:s,lodMetricType:fn.GEOMETRIC_ERROR,rootLodMetricValue:y,rootBoundingVolume:O,getTileType:am,getRefine:om},P.next=16,M9(t,p,w);case 16:return P.abrupt("return",P.sent);case 17:case"end":return P.stop()}},e)})),rm.apply(this,arguments)}function M9(e,t,r){return nm.apply(this,arguments)}function nm(){return nm=im(regeneratorRuntime.mark(function e(t,r,n){var i,a,o;return regeneratorRuntime.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(t){u.next=2;break}return u.abrupt("return",null);case 2:return t.lodMetricType=fn.GEOMETRIC_ERROR,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,u.next=7,Qp({subtree:r,options:n,s2VolumeBox:t});case 7:return i=u.sent,a=i.children,o=i.contentUrl,o&&(t.contentUrl=o,t.content={uri:o.replace("".concat(n.basePath,"/"),"")}),t.refine=om(t.refine),t.type=am(t),t.children=a,t.id=t.contentUrl,u.abrupt("return",t);case 16:case"end":return u.stop()}},e)})),nm.apply(this,arguments)}function $w(e){var t;return(e==null||(t=e.extensions)===null||t===void 0?void 0:t["3DTILES_implicit_tiling"])||e?.implicitTiling}function ex(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function cm(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){ex(a,n,i,o,s,"next",u)}function s(u){ex(a,n,i,o,s,"throw",u)}o(void 0)})}}var _f={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Iu,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:L9,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function I9(e){return xn.dirname(e.url)}function R9(e,t,r){return sm.apply(this,arguments)}function sm(){return sm=cm(regeneratorRuntime.mark(function e(t,r,n){var i,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return i={content:{featureIds:null}},a=0,s.next=4,Fp(t,a,r,n,i.content);case 4:return s.abrupt("return",i.content);case 5:case"end":return s.stop()}},e)})),sm.apply(this,arguments)}function F9(e,t,r){return um.apply(this,arguments)}function um(){return um=cm(regeneratorRuntime.mark(function e(t,r,n){var i,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return a=JSON.parse(new TextDecoder().decode(t)),a.loader=r.loader||_f,a.url=n.url,a.queryString=n.queryString,a.basePath=I9(a),s.next=7,Qw(a,r);case 7:return a.root=s.sent,a.type=Re.TILES3D,a.lodMetricType=fn.GEOMETRIC_ERROR,a.lodMetricValue=((i=a.root)===null||i===void 0?void 0:i.lodMetricValue)||0,s.abrupt("return",a);case 12:case"end":return s.stop()}},e)})),um.apply(this,arguments)}function L9(e,t,r){return fm.apply(this,arguments)}function fm(){return fm=cm(regeneratorRuntime.mark(function e(t,r,n){var i,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(i=r["3d-tiles"]||{},i.isTileset==="auto"?a=n.url&&n.url.indexOf(".json")!==-1:a=i.isTileset,!a){s.next=8;break}return s.next=5,F9(t,r,n);case 5:t=s.sent,s.next=11;break;case 8:return s.next=10,R9(t,r,n);case 10:t=s.sent;case 11:return s.abrupt("return",t);case 12:case"end":return s.stop()}},e)})),fm.apply(this,arguments)}function Af(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Af=function(r){return typeof r}:Af=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Af(e)}function tx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tx(Object(r),!0).forEach(function(n){D9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function D9(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rx(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function G9(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){rx(a,n,i,o,s,"next",u)}function s(u){rx(a,n,i,o,s,"throw",u)}o(void 0)})}}function N9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function U9(e,t,r){return t&&nx(e.prototype,t),r&&nx(e,r),e}function j9(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&lm(e,t)}function lm(e,t){return lm=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},lm(e,t)}function k9(e){var t=z9();return function(){var n=Tf(e),i;if(t){var a=Tf(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return H9(this,i)}}function H9(e,t){if(t&&(Af(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return V9(e)}function V9(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z9(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Tf(e){return Tf=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Tf(e)}var ix=[0],W9={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:"",loader:_f,onTilesetLoad:{type:"function",value:function(t){}},onTileLoad:{type:"function",value:function(t){}},onTileUnload:{type:"function",value:function(t){}},onTileError:{type:"function",value:function(t,r,n){}},_getMeshColor:{type:"function",value:function(t){return[255,255,255]}}},Sf=function(e){j9(r,e);var t=k9(r);function r(){var i;N9(this,r);for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return i=t.call.apply(t,[this].concat(o)),i.state=void 0,i}var n=r.prototype;return n.initializeState=function(){"onTileLoadFail"in this.props&&Lr.log.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}},n.shouldUpdateState=function(a){var o=a.changeFlags;return o.somethingChanged},n.updateState=function(a){var o=a.props,s=a.oldProps,u=a.changeFlags;if(o.data&&o.data!==s.data&&this._loadTileset(o.data),u.viewportChanged){var f=this.state.activeViewports,c=Object.keys(f).length;c&&(this._updateTileset(f),this.state.lastUpdatedViewports=f,this.state.activeViewports={})}if(u.propsChanged){var l=this.state.layerMap;for(var d in l)l[d].needsUpdate=!0}},n.activateViewport=function(a){var o=this.state,s=o.activeViewports,u=o.lastUpdatedViewports;this.internalState.viewport=a,s[a.id]=a;var f=u?.[a.id];(!f||!a.equals(f))&&(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())},n.getPickingInfo=function(a){var o=a.info,s=a.sourceLayer,u=s&&s.props.tile;return o.picked&&(o.object=u),o.sourceTile=u,o},n.filterSubLayer=function(a){var o=a.layer,s=a.viewport,u=o.props,f=u.tile,c=s.id;return f.selected&&f.viewportIds.includes(c)},n._updateAutoHighlight=function(a){var o=a.sourceTile,s=this.state.layerMap[o?.id];s&&s.layer&&s.layer.updateAutoHighlight(a)},n._loadTileset=function(){var i=G9(regeneratorRuntime.mark(function o(s){var u,f,c,l,d,h,p,m;return regeneratorRuntime.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(u=this.props.loadOptions,f=u===void 0?{}:u,c=this.props.loader||this.props.loaders,Array.isArray(c)&&(c=c[0]),l={loadOptions:yi({},f)},d=s,!c.preload){y.next=12;break}return y.next=8,c.preload(s,f);case 8:h=y.sent,h.url&&(d=h.url),h.headers&&(l.loadOptions.fetch=yi(yi({},l.loadOptions.fetch),{},{headers:h.headers})),Object.assign(l,h);case 12:return y.next=14,(0,ux.load)(d,c,l.loadOptions);case 14:p=y.sent,m=new nd(p,yi({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError},l)),this.setState({tileset3d:m,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(m);case 19:case"end":return y.stop()}},o,this)}));function a(o){return i.apply(this,arguments)}return a}(),n._onTileLoad=function(a){var o=this.state.lastUpdatedViewports;this.props.onTileLoad(a),this._updateTileset(o),this.setNeedsUpdate()},n._onTileUnload=function(a){delete this.state.layerMap[a.id],this.props.onTileUnload(a)},n._updateTileset=function(a){var o=this;if(a){var s=this.state.tileset3d,u=this.context.timeline,f=Object.keys(a).length;!u||!f||!s||s.selectTiles(Object.values(a)).then(function(c){var l=o.state.frameNumber!==c;l&&o.setState({frameNumber:c})})}},n._getSubLayer=function(a,o){if(!a.content)return null;switch(a.type){case tr.POINTCLOUD:return this._makePointCloudLayer(a,o);case tr.SCENEGRAPH:return this._make3DModelLayer(a);case tr.MESH:return this._makeSimpleMeshLayer(a,o);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(a.content.type))}},n._makePointCloudLayer=function(a,o){var s=a.content,u=s.attributes,f=s.pointCount,c=s.constantRGBA,l=s.cartographicOrigin,d=s.modelMatrix,h=u.positions,p=u.normals,m=u.colors;if(!h)return null;var g=o&&o.props.data||{header:{vertexCount:f},attributes:{POSITION:h,NORMAL:p,COLOR_0:m}},y=this.props,b=y.pointSize,A=y.getPointColor,S=this.getSubLayerClass("pointcloud",ox.PointCloudLayer);return new S({pointSize:b},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(a.id),tile:a,data:g,coordinateSystem:Lr.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:l,modelMatrix:d,getColor:c||A,_offset:0})},n._make3DModelLayer=function(a){var o=a.content,s=o.gltf,u=o.instances,f=o.cartographicOrigin,c=o.modelMatrix,l=this.getSubLayerClass("scenegraph",sx.ScenegraphLayer);return new l({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(a.id),tile:a,data:u||ix,scenegraph:s,coordinateSystem:Lr.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:f,modelMatrix:c,getTransformMatrix:function(h){return h.modelMatrix},getPosition:[0,0,0],_offset:0})},n._makeSimpleMeshLayer=function(a,o){var s=a.content,u=s.attributes,f=s.indices,c=s.modelMatrix,l=s.cartographicOrigin,d=s.coordinateSystem,h=d===void 0?Lr.COORDINATE_SYSTEM.METER_OFFSETS:d,p=s.material,m=s.featureIds,g=this.props._getMeshColor,y=o&&o.props.mesh||new ax.Geometry({drawMode:4,attributes:J9(u),indices:f}),b=this.getSubLayerClass("mesh",vu);return new b(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(a.id),tile:a,mesh:y,data:ix,getColor:g(a),pbrMaterial:p,modelMatrix:c,coordinateOrigin:l,coordinateSystem:h,featureIds:m,_offset:0})},n.renderLayers=function(){var a=this,o=this.state,s=o.tileset3d,u=o.layerMap;return s?s.tiles.map(function(f){var c=u[f.id]=u[f.id]||{tile:f},l=c.layer;return f.selected&&(l?c.needsUpdate&&(l=a._getSubLayer(f,l),c.needsUpdate=!1):l=a._getSubLayer(f)),c.layer=l,l}).filter(Boolean):null},U9(r,[{key:"isLoaded",get:function(){var a=this.state.tileset3d;return a!==null&&a.isLoaded()}}]),r}(Lr.CompositeLayer);Sf.defaultProps=W9;Sf.layerName="Tile3DLayer";function J9(e){var t={};return t.positions=yi(yi({},e.positions),{},{value:new Float32Array(e.positions.value)}),e.normals&&(t.normals=e.normals),e.texCoords&&(t.texCoords=e.texCoords),e.colors&&(t.colors=e.colors),e.uvRegions&&(t.uvRegions=e.uvRegions),t}var Ff=q(dt()),_m=q(Gs()),Ex=q(dt());function X9(e,t){return Y9(e)||K9(e,t)||cx(e,t)||q9()}function q9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
233
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K9(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function Y9(e){if(Array.isArray(e))return e}function $9(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=cx(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
234
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function cx(e,t){if(e){if(typeof e=="string")return fx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fx(e,t)}}function fx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Z9=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function hm(e){return e>>1^-(e&1)}function Q9(e){var t=0,r={},n=$9(Z9),i;try{for(n.s();!(i=n.n()).done;){var a=X9(i.value,2),o=a[0],s=a[1],u=s===8?e.getFloat64:e.getFloat32;r[o]=u.call(e,t,!0),t+=s}}catch(f){n.e(f)}finally{n.f()}return{header:r,headerEndPosition:t}}function ej(e,t){var r=t,n=3,i=e.getUint32(r,!0),a=new Uint16Array(i*n);r+=Uint32Array.BYTES_PER_ELEMENT;for(var o=Uint16Array.BYTES_PER_ELEMENT,s=i*o,u=r,f=u+s,c=f+s,l=0,d=0,h=0,p=0;p<i;p++)l+=hm(e.getUint16(u+o*p,!0)),d+=hm(e.getUint16(f+o*p,!0)),h+=hm(e.getUint16(c+o*p,!0)),a[p]=l,a[p+i]=d,a[p+i*2]=h;return r+=s*3,{vertexData:a,vertexDataEndPosition:r}}function Sa(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a;if(n===2?a=new Uint16Array(e,t,r):a=new Uint32Array(e,t,r),!i)return a;for(var o=0,s=0;s<a.length;++s){var u=a[s];a[s]=o-u,u===0&&++o}return a}function tj(e,t,r){var n=r,i=3,a=t.length/i,o=a>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%o!==0&&(n+=o-n%o);var s=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var u=s*3,f=Sa(e.buffer,n,u,o);return n+=u*o,{triangleIndicesEndPosition:n,triangleIndices:f}}function rj(e,t,r){var n=r,i=3,a=t.length/i,o=a>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,s=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var u=Sa(e.buffer,n,s,o,!1);n+=s*o;var f=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var c=Sa(e.buffer,n,f,o,!1);n+=f*o;var l=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var d=Sa(e.buffer,n,l,o,!1);n+=l*o;var h=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var p=Sa(e.buffer,n,h,o,!1);return n+=h*o,{edgeIndicesEndPosition:n,westIndices:u,southIndices:c,eastIndices:d,northIndices:p}}function nj(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function ij(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function aj(e,t){var r={};if(e.byteLength<=t)return{extensions:r,extensionsEndPosition:t};for(var n=t;n<e.byteLength;){var i=e.getUint8(n,!0);n+=Uint8Array.BYTES_PER_ELEMENT;var a=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var o=new DataView(e.buffer,n,a);switch(i){case 1:{r.vertexNormals=nj(o);break}case 2:{r.waterMask=ij(o);break}default:}n+=a}return{extensions:r,extensionsEndPosition:n}}var bn={header:0,vertices:1,triangleIndices:2,edgeIndices:3,extensions:4},oj={maxDecodingStep:bn.extensions};function dm(e,t){var r=Object.assign({},oj,t),n=new DataView(e),i=Q9(n),a=i.header,o=i.headerEndPosition;if(r.maxDecodingStep<bn.vertices)return{header:a};var s=ej(n,o),u=s.vertexData,f=s.vertexDataEndPosition;if(r.maxDecodingStep<bn.triangleIndices)return{header:a,vertexData:u};var c=tj(n,u,f),l=c.triangleIndices,d=c.triangleIndicesEndPosition;if(r.maxDecodingStep<bn.edgeIndices)return{header:a,vertexData:u,triangleIndices:l};var h=rj(n,u,d),p=h.westIndices,m=h.southIndices,g=h.eastIndices,y=h.northIndices,b=h.edgeIndicesEndPosition;if(r.maxDecodingStep<bn.extensions)return{header:a,vertexData:u,triangleIndices:l,westIndices:p,northIndices:y,eastIndices:g,southIndices:m};var A=aj(n,b),S=A.extensions;return{header:a,vertexData:u,triangleIndices:l,westIndices:p,northIndices:y,eastIndices:g,southIndices:m,extensions:S}}function wf(e){return cj(e)||fj(e)||uj(e)||sj()}function sj(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
235
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uj(e,t){if(e){if(typeof e=="string")return pm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pm(e,t)}}function fj(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cj(e){if(Array.isArray(e))return pm(e)}function pm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xf(e,t,r,n){for(var i=n?hj(n,e.POSITION.value):lj(t),a=new e.POSITION.value.constructor(i.length*6),o=new e.TEXCOORD_0.value.constructor(i.length*4),s=new t.constructor(i.length*6),u=0;u<i.length;u++){var f=i[u];dj({edge:f,edgeIndex:u,attributes:e,skirtHeight:r,newPosition:a,newTexcoord0:o,newTriangles:s})}e.POSITION.value=Oi(e.POSITION.value,a),e.TEXCOORD_0.value=Oi(e.TEXCOORD_0.value,o);var c=t instanceof Array?t.concat(s):Oi(t,s);return{attributes:e,triangles:c}}function lj(e){for(var t=[],r=0;r<e.length;r+=3)t.push([e[r],e[r+1]]),t.push([e[r+1],e[r+2]]),t.push([e[r+2],e[r]]);t.sort(function(s,u){return Math.min.apply(Math,wf(s))-Math.min.apply(Math,wf(u))||Math.max.apply(Math,wf(s))-Math.max.apply(Math,wf(u))});for(var n=[],i=0;i<t.length;){var a,o;t[i][0]===((a=t[i+1])===null||a===void 0?void 0:a[1])&&t[i][1]===((o=t[i+1])===null||o===void 0?void 0:o[0])?i+=2:(n.push(t[i]),i++)}return n}function hj(e,t){e.westIndices.sort(function(o,s){return t[3*o+1]-t[3*s+1]}),e.eastIndices.sort(function(o,s){return t[3*s+1]-t[3*o+1]}),e.southIndices.sort(function(o,s){return t[3*s]-t[3*o]}),e.northIndices.sort(function(o,s){return t[3*o]-t[3*s]});var r=[];for(var n in e)for(var i=e[n],a=0;a<i.length-1;a++)r.push([i[a],i[a+1]]);return r}function dj(e){var t=e.edge,r=e.edgeIndex,n=e.attributes,i=e.skirtHeight,a=e.newPosition,o=e.newTexcoord0,s=e.newTriangles,u=n.POSITION.value.length,f=r*2,c=r*2+1;a.set(n.POSITION.value.subarray(t[0]*3,t[0]*3+3),f*3),a[f*3+2]=a[f*3+2]-i,a.set(n.POSITION.value.subarray(t[1]*3,t[1]*3+3),c*3),a[c*3+2]=a[c*3+2]-i,o.set(n.TEXCOORD_0.value.subarray(t[0]*2,t[0]*2+2),f*2),o.set(n.TEXCOORD_0.value.subarray(t[1]*2,t[1]*2+2),c*2);var l=r*2*3;s[l]=t[0],s[l+1]=u/3+c,s[l+2]=t[1],s[l+3]=u/3+c,s[l+4]=t[0],s[l+5]=u/3+f}function pj(e,t){return yj(e)||gj(e,t)||vj(e,t)||mj()}function mj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
236
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vj(e,t){if(e){if(typeof e=="string")return lx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lx(e,t)}}function lx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function gj(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function yj(e){if(Array.isArray(e))return e}function bj(e,t,r){for(var n=t.minHeight,i=t.maxHeight,a=r||[0,0,1,1],o=pj(a,4),s=o[0],u=o[1],f=o[2],c=o[3],l=f-s,d=c-u,h=i-n,p=e.length/3,m=new Float32Array(p*3),g=new Float32Array(p*2),y=0;y<p;y++){var b=e[y]/32767,A=e[y+p]/32767,S=e[y+p*2]/32767;m[3*y+0]=b*l+s,m[3*y+1]=A*d+u,m[3*y+2]=S*h+n,g[2*y+0]=b,g[2*y+1]=A}return{POSITION:{value:m,size:3},TEXCOORD_0:{value:g,size:2}}}function _j(e,t){if(!e)return null;var r=t.bounds,n=dm(e,bn.triangleIndices),i=n.header,a=n.vertexData,o=n.triangleIndices,s=n.westIndices,u=n.northIndices,f=n.eastIndices,c=n.southIndices,l=o,d=bj(a,i,r),h=ln(d);if(t.skirtHeight){var p=xf(d,l,t.skirtHeight,{westIndices:s,northIndices:u,eastIndices:f,southIndices:c}),m=p.attributes,g=p.triangles;d=m,l=g}return{loaderData:{header:{}},header:{vertexCount:l.length,boundingBox:h},mode:4,indices:{value:l,size:1},attributes:d}}function Ef(e,t){return _j(e,t["quantized-mesh"])}var wa=class{constructor(t=257){this.gridSize=t;let r=t-1;if(r&r-1)throw new Error(`Expected grid size to be 2^n+1, got ${t}.`);this.numTriangles=r*r*2-2,this.numParentTriangles=this.numTriangles-r*r,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(this.numTriangles*4);for(let n=0;n<this.numTriangles;n++){let i=n+2,a=0,o=0,s=0,u=0,f=0,c=0;for(i&1?s=u=f=r:a=o=c=r;(i>>=1)>1;){let d=a+s>>1,h=o+u>>1;i&1?(s=a,u=o,a=f,o=c):(a=s,o=u,s=f,u=c),f=d,c=h}let l=n*4;this.coords[l+0]=a,this.coords[l+1]=o,this.coords[l+2]=s,this.coords[l+3]=u}}createTile(t){return new mm(t,this)}},mm=class{constructor(t,r){let n=r.gridSize;if(t.length!==n*n)throw new Error(`Expected terrain data of length ${n*n} (${n} x ${n}), got ${t.length}.`);this.terrain=t,this.martini=r,this.errors=new Float32Array(t.length),this.update()}update(){let{numTriangles:t,numParentTriangles:r,coords:n,gridSize:i}=this.martini,{terrain:a,errors:o}=this;for(let s=t-1;s>=0;s--){let u=s*4,f=n[u+0],c=n[u+1],l=n[u+2],d=n[u+3],h=f+l>>1,p=c+d>>1,m=h+p-c,g=p+f-h,y=(a[c*i+f]+a[d*i+l])/2,b=p*i+h,A=Math.abs(y-a[b]);if(o[b]=Math.max(o[b],A),s<r){let S=(c+g>>1)*i+(f+m>>1),O=(d+g>>1)*i+(l+m>>1);o[b]=Math.max(o[b],o[S],o[O])}}}getMesh(t=0){let{gridSize:r,indices:n}=this.martini,{errors:i}=this,a=0,o=0,s=r-1;n.fill(0);function u(h,p,m,g,y,b){let A=h+m>>1,S=p+g>>1;Math.abs(h-y)+Math.abs(p-b)>1&&i[S*r+A]>t?(u(y,b,h,p,A,S),u(m,g,y,b,A,S)):(n[p*r+h]=n[p*r+h]||++a,n[g*r+m]=n[g*r+m]||++a,n[b*r+y]=n[b*r+y]||++a,o++)}u(0,0,s,s,s,0),u(s,s,0,0,0,s);let f=new Uint16Array(a*2),c=new Uint32Array(o*3),l=0;function d(h,p,m,g,y,b){let A=h+m>>1,S=p+g>>1;if(Math.abs(h-y)+Math.abs(p-b)>1&&i[S*r+A]>t)d(y,b,h,p,A,S),d(m,g,y,b,A,S);else{let O=n[p*r+h]-1,w=n[g*r+m]-1,B=n[b*r+y]-1;f[2*O]=h,f[2*O+1]=p,f[2*w]=m,f[2*w+1]=g,f[2*B]=y,f[2*B+1]=b,c[l++]=O,c[l++]=w,c[l++]=B}}return d(0,0,s,s,s,0),d(s,s,0,0,0,s),{vertices:f,triangles:c}}};function Aj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var hx=function(){function e(r,n){Aj(this,e);var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n;this.data=r,this.width=n,this.height=i,this.coords=[],this.triangles=[],this._halfedges=[],this._candidates=[],this._queueIndices=[],this._queue=[],this._errors=[],this._rms=[],this._pending=[],this._pendingLen=0,this._rmsSum=0;var a=n-1,o=i-1,s=this._addPoint(0,0),u=this._addPoint(a,0),f=this._addPoint(0,o),c=this._addPoint(a,o),l=this._addTriangle(c,s,f,-1,-1,-1);this._addTriangle(s,c,u,l,-1,-1),this._flush()}var t=e.prototype;return t.run=function(){for(var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.getMaxError()>n;)this.refine()},t.refine=function(){this._step(),this._flush()},t.getMaxError=function(){return this._errors[0]},t.getRMSD=function(){return this._rmsSum>0?Math.sqrt(this._rmsSum/(this.width*this.height)):0},t.heightAt=function(n,i){return this.data[this.width*i+n]},t._flush=function(){for(var n=this.coords,i=0;i<this._pendingLen;i++){var a=this._pending[i],o=2*this.triangles[a*3+0],s=2*this.triangles[a*3+1],u=2*this.triangles[a*3+2];this._findCandidate(n[o],n[o+1],n[s],n[s+1],n[u],n[u+1],a)}this._pendingLen=0},t._findCandidate=function(n,i,a,o,s,u,f){for(var c=Math.min(n,a,s),l=Math.min(i,o,u),d=Math.max(n,a,s),h=Math.max(i,o,u),p=_n(a,o,s,u,c,l),m=_n(s,u,n,i,c,l),g=_n(n,i,a,o,c,l),y=o-i,b=n-a,A=u-o,S=a-s,O=i-u,w=s-n,B=_n(n,i,a,o,s,u),P=this.heightAt(n,i)/B,x=this.heightAt(a,o)/B,_=this.heightAt(s,u)/B,C=0,I=0,R=0,M=0,D=l;D<=h;D++){var N=0;p<0&&A!==0&&(N=Math.max(N,Math.floor(-p/A))),m<0&&O!==0&&(N=Math.max(N,Math.floor(-m/O))),g<0&&y!==0&&(N=Math.max(N,Math.floor(-g/y)));for(var j=p+A*N,U=m+O*N,k=g+y*N,H=!1,W=c+N;W<=d;W++){if(j>=0&&U>=0&&k>=0){H=!0;var re=P*j+x*U+_*k,De=Math.abs(re-this.heightAt(W,D));M+=De*De,De>C&&(C=De,I=W,R=D)}else if(H)break;j+=A,U+=O,k+=y}p+=S,m+=w,g+=b}(I===n&&R===i||I===a&&R===o||I===s&&R===u)&&(C=0),this._candidates[2*f]=I,this._candidates[2*f+1]=R,this._rms[f]=M,this._queuePush(f,C,M)},t._step=function(){var n=this._queuePop(),i=n*3+0,a=n*3+1,o=n*3+2,s=this.triangles[i],u=this.triangles[a],f=this.triangles[o],c=this.coords[2*s],l=this.coords[2*s+1],d=this.coords[2*u],h=this.coords[2*u+1],p=this.coords[2*f],m=this.coords[2*f+1],g=this._candidates[2*n],y=this._candidates[2*n+1],b=this._addPoint(g,y);if(_n(c,l,d,h,g,y)===0)this._handleCollinear(b,i);else if(_n(d,h,p,m,g,y)===0)this._handleCollinear(b,a);else if(_n(p,m,c,l,g,y)===0)this._handleCollinear(b,o);else{var A=this._halfedges[i],S=this._halfedges[a],O=this._halfedges[o],w=this._addTriangle(s,u,b,A,-1,-1,i),B=this._addTriangle(u,f,b,S,-1,w+1),P=this._addTriangle(f,s,b,O,w+2,B+1);this._legalize(w),this._legalize(B),this._legalize(P)}},t._addPoint=function(n,i){var a=this.coords.length>>1;return this.coords.push(n,i),a},t._addTriangle=function(n,i,a,o,s,u){var f=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this.triangles.length,c=f/3;return this.triangles[f+0]=n,this.triangles[f+1]=i,this.triangles[f+2]=a,this._halfedges[f+0]=o,this._halfedges[f+1]=s,this._halfedges[f+2]=u,o>=0&&(this._halfedges[o]=f+0),s>=0&&(this._halfedges[s]=f+1),u>=0&&(this._halfedges[u]=f+2),this._candidates[2*c+0]=0,this._candidates[2*c+1]=0,this._queueIndices[c]=-1,this._rms[c]=0,this._pending[this._pendingLen++]=c,f},t._legalize=function(n){var i=this._halfedges[n];if(!(i<0)){var a=n-n%3,o=i-i%3,s=a+(n+1)%3,u=a+(n+2)%3,f=o+(i+2)%3,c=o+(i+1)%3,l=this.triangles[u],d=this.triangles[n],h=this.triangles[s],p=this.triangles[f],m=this.coords;if(Tj(m[2*l],m[2*l+1],m[2*d],m[2*d+1],m[2*h],m[2*h+1],m[2*p],m[2*p+1])){var g=this._halfedges[s],y=this._halfedges[u],b=this._halfedges[f],A=this._halfedges[c];this._queueRemove(a/3),this._queueRemove(o/3);var S=this._addTriangle(l,p,h,-1,b,g,a),O=this._addTriangle(p,l,d,S,y,A,o);this._legalize(S+1),this._legalize(O+2)}}},t._handleCollinear=function(n,i){var a=i-i%3,o=a+(i+1)%3,s=a+(i+2)%3,u=this.triangles[s],f=this.triangles[i],c=this.triangles[o],l=this._halfedges[o],d=this._halfedges[s],h=this._halfedges[i];if(h<0){var p=this._addTriangle(n,u,f,-1,d,-1,a),m=this._addTriangle(u,n,c,p,-1,l);this._legalize(p+1),this._legalize(m+2);return}var g=h-h%3,y=g+(h+2)%3,b=g+(h+1)%3,A=this.triangles[y],S=this._halfedges[y],O=this._halfedges[b];this._queueRemove(g/3);var w=this._addTriangle(u,f,n,d,-1,-1,a),B=this._addTriangle(f,A,n,O,-1,w+1,g),P=this._addTriangle(A,c,n,S,-1,B+1),x=this._addTriangle(c,u,n,l,w+2,P+1);this._legalize(w),this._legalize(B),this._legalize(P),this._legalize(x)},t._queuePush=function(n,i,a){var o=this._queue.length;this._queueIndices[n]=o,this._queue.push(n),this._errors.push(i),this._rmsSum+=a,this._queueUp(o)},t._queuePop=function(){var n=this._queue.length-1;return this._queueSwap(0,n),this._queueDown(0,n),this._queuePopBack()},t._queuePopBack=function(){var n=this._queue.pop();return this._errors.pop(),this._rmsSum-=this._rms[n],this._queueIndices[n]=-1,n},t._queueRemove=function(n){var i=this._queueIndices[n];if(i<0){var a=this._pending.indexOf(n);if(a!==-1)this._pending[a]=this._pending[--this._pendingLen];else throw new Error("Broken triangulation (something went wrong).");return}var o=this._queue.length-1;o!==i&&(this._queueSwap(i,o),this._queueDown(i,o)||this._queueUp(i)),this._queuePopBack()},t._queueLess=function(n,i){return this._errors[n]>this._errors[i]},t._queueSwap=function(n,i){var a=this._queue[n],o=this._queue[i];this._queue[n]=o,this._queue[i]=a,this._queueIndices[a]=i,this._queueIndices[o]=n;var s=this._errors[n];this._errors[n]=this._errors[i],this._errors[i]=s},t._queueUp=function(n){for(var i=n;;){var a=i-1>>1;if(a===i||!this._queueLess(i,a))break;this._queueSwap(a,i),i=a}},t._queueDown=function(n,i){for(var a=n;;){var o=2*a+1;if(o>=i||o<0)break;var s=o+1,u=o;if(s<i&&this._queueLess(s,o)&&(u=s),!this._queueLess(u,a))break;this._queueSwap(a,u),a=u}return a>n},e}();function _n(e,t,r,n,i,a){return(r-i)*(t-a)-(n-a)*(e-i)}function Tj(e,t,r,n,i,a,o,s){var u=e-o,f=t-s,c=r-o,l=n-s,d=i-o,h=a-s,p=u*u+f*f,m=c*c+l*l,g=d*d+h*h;return u*(l*g-m*h)-f*(c*g-m*d)+p*(c*h-l*d)<0}function dx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Of(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dx(Object(r),!0).forEach(function(n){Sj(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sj(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function px(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function wj(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){px(a,n,i,o,s,"next",u)}function s(u){px(a,n,i,o,s,"throw",u)}o(void 0)})}}function xj(e,t){return Bj(e)||Pj(e,t)||Oj(e,t)||Ej()}function Ej(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
237
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oj(e,t){if(e){if(typeof e=="string")return mx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mx(e,t)}}function mx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pj(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function Bj(e){if(Array.isArray(e))return e}function Pf(e,t,r,n,i){for(var a=n.rScaler,o=n.bScaler,s=n.gScaler,u=n.offset,f=new Float32Array((t+1)*(r+1)),c=0,l=0;l<r;l++)for(var d=0;d<t;d++,c++){var h=c*4,p=e[h+0],m=e[h+1],g=e[h+2];f[c+l]=p*a+m*s+g*o+u}if(i==="martini"){for(var y=(t+1)*t,b=0;b<t;b++,y++)f[y]=f[y-t-1];for(var A=r,S=0;S<r+1;S++,A+=r+1)f[A]=f[A-1]}return f}function Cj(e,t,r,n,i){for(var a=r+1,o=e.length/2,s=new Float32Array(o*3),u=new Float32Array(o*2),f=i||[0,0,r,n],c=xj(f,4),l=c[0],d=c[1],h=c[2],p=c[3],m=(h-l)/r,g=(p-d)/n,y=0;y<o;y++){var b=e[y*2],A=e[y*2+1],S=A*a+b;s[3*y+0]=b*m+l,s[3*y+1]=-A*g+p,s[3*y+2]=t[S],u[2*y+0]=b/r,u[2*y+1]=A/n}return{POSITION:{value:s,size:3},TEXCOORD_0:{value:u,size:2}}}function Mj(e,t){if(e===null)return null;var r=t.meshMaxError,n=t.bounds,i=t.elevationDecoder,a=e.data,o=e.width,s=e.height,u,f;switch(t.tesselator){case"martini":u=Pf(a,o,s,i,t.tesselator),f=vx(r,o,u);break;case"delatin":u=Pf(a,o,s,i,t.tesselator),f=gx(r,o,s,u);break;default:o===s&&!(s&o-1)?(u=Pf(a,o,s,i,"martini"),f=vx(r,o,u)):(u=Pf(a,o,s,i,"delatin"),f=gx(r,o,s,u));break}var c=f,l=c.vertices,d=f,h=d.triangles,p=Cj(l,u,o,s,n),m=ln(p);if(t.skirtHeight){var g=xf(p,h,t.skirtHeight),y=g.attributes,b=g.triangles;p=y,h=b}return{loaderData:{header:{}},header:{vertexCount:h.length,boundingBox:m},mode:4,indices:{value:Uint32Array.from(h),size:1},attributes:p}}function vx(e,t,r){var n=t+1,i=new wa(n),a=i.createTile(r),o=a.getMesh(e),s=o.vertices,u=o.triangles;return{vertices:s,triangles:u}}function gx(e,t,r,n){var i=new hx(n,t+1,r+1);i.run(e);var a=i.coords,o=i.triangles,s=a;return{vertices:s,triangles:o}}function gm(e,t,r){return vm.apply(this,arguments)}function vm(){return vm=wj(regeneratorRuntime.mark(function e(t,r,n){var i,a;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return i=Of(Of({},r),{},{mimeType:"application/x.image",image:Of(Of({},r.image),{},{type:"data"})}),s.next=3,n.parse(t,i);case 3:return a=s.sent,s.abrupt("return",Mj(a,r.terrain));case 5:case"end":return s.stop()}},e)})),vm.apply(this,arguments)}var Bf="3.4.13";var Cf={name:"Terrain",id:"terrain",module:"terrain",version:Bf,worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}};var yx={name:"Quantized Mesh",id:"quantized-mesh",module:"terrain",version:Bf,worker:!0,extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{bounds:[0,0,1,1],skirtHeight:null}}};function bx(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function Ij(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){bx(a,n,i,o,s,"next",u)}function s(u){bx(a,n,i,o,s,"throw",u)}o(void 0)})}}function _x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_x(Object(r),!0).forEach(function(n){Rj(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rj(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ooe=Mf(Mf({},Cf),{},{parse:gm});var Poe=Mf(Mf({},yx),{},{parseSync:Ef,parse:function(){var e=Ij(regeneratorRuntime.mark(function r(n,i){return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Ef(n,i));case 1:case"end":return o.stop()}},r)}));function t(r,n){return e.apply(this,arguments)}return t}()});function If(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?If=function(r){return typeof r}:If=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},If(e)}function Ax(e){return Dj(e)||Lj(e)||xx(e)||Fj()}function Fj(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
238
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lj(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Dj(e){if(Array.isArray(e))return ym(e)}function Gj(e,t){return jj(e)||Uj(e,t)||xx(e,t)||Nj()}function Nj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
239
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xx(e,t){if(e){if(typeof e=="string")return ym(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ym(e,t)}}function ym(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Uj(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function jj(e){if(Array.isArray(e))return e}function kj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hj(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bm(e,t)}function bm(e,t){return bm=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},bm(e,t)}function Vj(e){var t=Jj();return function(){var n=Rf(e),i;if(t){var a=Rf(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return zj(this,i)}}function zj(e,t){if(t&&(If(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wj(e)}function Wj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jj(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Rf(e){return Rf=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Rf(e)}function Tx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Dr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tx(Object(r),!0).forEach(function(n){Xj(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xj(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Sx=[1],qj=Dr(Dr({},Kt.defaultProps),{},{elevationData:yr,texture:Dr(Dr({},yr),{},{optional:!0}),meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:"",wireframe:!1,material:!0,loaders:[Cf]});function wx(e){return Array.isArray(e)?e.join(";"):e||""}var Lf=function(e){Hj(r,e);var t=Vj(r);function r(){var i;kj(this,r);for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return i=t.call.apply(t,[this].concat(o)),i.state=void 0,i}var n=r.prototype;return n.updateState=function(a){var o=a.props,s=a.oldProps,u=o.elevationData!==s.elevationData;if(u){var f=o.elevationData,c=f&&(Array.isArray(f)||f.includes("{x}")&&f.includes("{y}"));this.setState({isTiled:c})}var l=u||o.meshMaxError!==s.meshMaxError||o.elevationDecoder!==s.elevationDecoder||o.bounds!==s.bounds;if(!this.state.isTiled&&l){var d=this.loadTerrain(o);this.setState({terrain:d})}o.workerUrl&&Ff.log.removed("workerUrl","loadOptions.terrain.workerUrl")()},n.loadTerrain=function(a){var o,s=a.elevationData,u=a.bounds,f=a.elevationDecoder,c=a.meshMaxError,l=a.signal;if(!s)return null;var d=this.getLoadOptions();d=Dr(Dr({},d),{},{terrain:Dr(Dr({skirtHeight:this.state.isTiled?c*2:0},(o=d)===null||o===void 0?void 0:o.terrain),{},{bounds:u,meshMaxError:c,elevationDecoder:f})});var h=this.props.fetch;return h(s,{propName:"elevationData",layer:this,loadOptions:d,signal:l})},n.getTiledTerrainData=function(a){var o=this.props,s=o.elevationData,u=o.fetch,f=o.texture,c=o.elevationDecoder,l=o.meshMaxError,d=this.context.viewport,h=Rt(s,a),p=f&&Rt(f,a),m=a.signal,g=[0,0],y=[0,0];if(d.isGeospatial){var b=a.bbox;g=d.projectFlat([b.west,b.south]),y=d.projectFlat([b.east,b.north])}else{var A=a.bbox;g=[A.left,A.bottom],y=[A.right,A.top]}var S=[g[0],g[1],y[0],y[1]],O=this.loadTerrain({elevationData:h,bounds:S,elevationDecoder:c,meshMaxError:l,signal:m}),w=p?u(p,{propName:"texture",layer:this,loaders:[],signal:m}).catch(function(B){return null}):Promise.resolve(null);return Promise.all([O,w])},n.renderSubLayers=function(a){var o=this.getSubLayerClass("mesh",_m.SimpleMeshLayer),s=this.props,u=s.color,f=s.wireframe,c=s.material,l=a.data;if(!l)return null;var d=Gj(l,2),h=d[0],p=d[1];return new o(a,{data:Sx,mesh:h,texture:p,_instanced:!1,coordinateSystem:Ex.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(g){return[0,0,0]},getColor:u,wireframe:f,material:c})},n.onViewportLoad=function(a){if(a){var o=this.state.zRange,s=a.map(function(c){return c.content}).filter(Boolean).map(function(c){var l=c[0].header.boundingBox;return l.map(function(d){return d[2]})});if(s.length!==0){var u=Math.min.apply(Math,Ax(s.map(function(c){return c[0]}))),f=Math.max.apply(Math,Ax(s.map(function(c){return c[1]})));(!o||u<o[0]||f>o[1])&&this.setState({zRange:[u,f]})}}},n.renderLayers=function(){var a=this.props,o=a.color,s=a.material,u=a.elevationData,f=a.texture,c=a.wireframe,l=a.meshMaxError,d=a.elevationDecoder,h=a.tileSize,p=a.maxZoom,m=a.minZoom,g=a.extent,y=a.maxRequests,b=a.onTileLoad,A=a.onTileUnload,S=a.onTileError,O=a.maxCacheSize,w=a.maxCacheByteSize,B=a.refinementStrategy;if(this.state.isTiled)return new Kt(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:wx(u),texture:wx(f),meshMaxError:l,elevationDecoder:d}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:h,maxZoom:p,minZoom:m,extent:g,maxRequests:y,onTileLoad:b,onTileUnload:A,onTileError:S,maxCacheSize:O,maxCacheByteSize:w,refinementStrategy:B});var P=this.getSubLayerClass("mesh",_m.SimpleMeshLayer);return new P(this.getSubLayerProps({id:"mesh"}),{data:Sx,mesh:this.state.terrain,texture:f,_instanced:!1,getPosition:function(_){return[0,0,0]},getColor:o,material:s,wireframe:c})},r}(Ff.CompositeLayer);Lf.defaultProps=qj;Lf.layerName="TerrainLayer";var qf=q(dt()),Wm=q(ht()),NE=q(Px());function Am(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=Bx(e,r);return n!==t?(Kj(e,r),!0):!1}function Bx(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Math.sign(ar(e,t))}function ar(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.start,n=r===void 0?0:r,i=t.end,a=i===void 0?e.length:i,o=t.size||2,s=0,u=n,f=a-o;u<a;u+=o)s+=(e[u]-e[f])*(e[u+1]+e[f+1]),f=u;return s/2}function Tm(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r.start,i=n===void 0?0:n,a=r.end,o=a===void 0?e.length:a,s=r.size,u=s===void 0?2:s,f=r.isClosed,c=(o-i)/u,l=0;l<c-1;++l)t(e[i+l*u],e[i+l*u+1],e[i+(l+1)*u],e[i+(l+1)*u+1],l,l+1);var d=i+(c-1)*u,h=f||Pe(e[i],e[d])&&Pe(e[i+1],e[d+1]);h||t(e[d],e[d+1],e[i],e[i+1],c-1,0)}function Kj(e,t){for(var r=t.start,n=r===void 0?0:r,i=t.end,a=i===void 0?e.length:i,o=t.size,s=o===void 0?2:o,u=(a-n)/s,f=Math.floor(u/2),c=0;c<f;++c)for(var l=n+c*s,d=n+(u-1-c)*s,h=0;h<s;++h){var p=e[l+h];e[l+h]=e[d+h],e[d+h]=p}}function Cx(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=Yj(e,r);return n!==t?(e.reverse(),!0):!1}function Yj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Math.sign(Sm(e,t))}function Sm(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.start,n=r===void 0?0:r,i=t.end,a=i===void 0?e.length:i,o=0,s=n,u=a-1;s<a;++s)o+=(e[s][0]-e[u][0])*(e[s][1]+e[u][1]),u=s;return o/2}function Mx(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r.start,i=n===void 0?0:n,a=r.end,o=a===void 0?e.length:a,s=r.isClosed,u=i;u<o-1;++u)t(e[u],e[u+1],u,u+1);var f=s||Pe(e[o-1],e[0]);f||t(e[o-1],e[0],o-1,0)}function $j(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ix=function(){function e(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$j(this,e),v(this,"points",void 0),v(this,"isFlatArray",void 0),v(this,"options",void 0),this.points=r,this.isFlatArray=!Ne(r[0]),this.options={start:n.start||0,end:n.end||r.length,size:n.size||2,isClosed:n.isClosed},Object.freeze(this)}var t=e.prototype;return t.getSignedArea=function(){return this.isFlatArray?ar(this.points,this.options):Sm(this.points,this.options)},t.getArea=function(){return Math.abs(this.getSignedArea())},t.getWindingDirection=function(){return Math.sign(this.getSignedArea())},t.forEachSegment=function(n){this.isFlatArray?Tm(this.points,function(i,a,o,s,u,f){n([i,a],[o,s],u,f)},this.options):Mx(this.points,n,this.options)},t.modifyWindingDirection=function(n){return this.isFlatArray?Am(this.points,n,this.options):Cx(this.points,n,this.options)},e}();function Em(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2,n=arguments.length>3?arguments[3]:void 0,i=t&&t.length,a=i?t[0]*r:e.length,o=Fx(e,0,a,r,!0,n&&n[0]),s=[];if(!o||o.next===o.prev)return s;var u,f,c,l,d,h,p;if(i&&(o=rk(e,t,o,r,n)),e.length>80*r){l=f=e[0],d=c=e[1];for(var m=r;m<a;m+=r)h=e[m],p=e[m+1],h<l&&(l=h),p<d&&(d=p),h>f&&(f=h),p>c&&(c=p);u=Math.max(f-l,c-d),u=u!==0?1/u:0}return xa(o,s,r,l,d,u),s}function Fx(e,t,r,n,i,a){var o,s;if(a===void 0&&(a=ar(e,{start:t,end:r,size:n})),i===a<0)for(o=t;o<r;o+=n)s=Rx(o,e[o],e[o+1],s);else for(o=r-n;o>=t;o-=n)s=Rx(o,e[o],e[o+1],s);return s&&Nf(s,s.next)&&(Oa(s),s=s.next),s}function Gr(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(Nf(r,r.next)||Ae(r.prev,r,r.next)===0)){if(Oa(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function xa(e,t,r,n,i,a,o){if(e){!o&&a&&sk(e,n,i,a);for(var s=e,u,f;e.prev!==e.next;){if(u=e.prev,f=e.next,a?Qj(e,n,i,a):Zj(e)){t.push(u.i/r),t.push(e.i/r),t.push(f.i/r),Oa(e),e=f.next,s=f.next;continue}if(e=f,e===s){o?o===1?(e=ek(Gr(e),t,r),xa(e,t,r,n,i,a,2)):o===2&&tk(e,t,r,n,i,a):xa(Gr(e),t,r,n,i,a,1);break}}}}function Zj(e){var t=e.prev,r=e,n=e.next;if(Ae(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(bi(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Ae(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Qj(e,t,r,n){var i=e.prev,a=e,o=e.next;if(Ae(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,u=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,f=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,l=wm(s,u,t,r,n),d=wm(f,c,t,r,n),h=e.prevZ,p=e.nextZ;h&&h.z>=l&&p&&p.z<=d;){if(h!==e.prev&&h!==e.next&&bi(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&Ae(h.prev,h,h.next)>=0||(h=h.prevZ,p!==e.prev&&p!==e.next&&bi(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ae(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;h&&h.z>=l;){if(h!==e.prev&&h!==e.next&&bi(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&Ae(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&bi(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ae(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function ek(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!Nf(i,a)&&Lx(i,n,n.next,a)&&Ea(i,a)&&Ea(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),Oa(n),Oa(n.next),n=e=a),n=n.next}while(n!==e);return Gr(n)}function tk(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&ck(o,s)){var u=Dx(o,s);o=Gr(o,o.next),u=Gr(u,u.next),xa(o,t,r,n,i,a),xa(u,t,r,n,i,a);return}s=s.next}o=o.next}while(o!==e)}function rk(e,t,r,n,i){var a=[],o,s,u,f,c;for(o=0,s=t.length;o<s;o++)u=t[o]*n,f=o<s-1?t[o+1]*n:e.length,c=Fx(e,u,f,n,!1,i&&i[o+1]),c===c.next&&(c.steiner=!0),a.push(fk(c));for(a.sort(nk),o=0;o<a.length;o++)ik(a[o],r),r=Gr(r,r.next);return r}function nk(e,t){return e.x-t.x}function ik(e,t){if(t=ak(e,t),t){var r=Dx(t,e);Gr(t,t.next),Gr(r,r.next)}}function ak(e,t){var r=t,n=e.x,i=e.y,a=-1/0,o;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>a){if(a=s,s===n){if(i===r.y)return r;if(i===r.next.y)return r.next}o=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!o)return null;if(n===a)return o;var u=o,f=o.x,c=o.y,l=1/0,d;r=o;do n>=r.x&&r.x>=f&&n!==r.x&&bi(i<c?n:a,i,f,c,i<c?a:n,i,r.x,r.y)&&(d=Math.abs(i-r.y)/(n-r.x),Ea(r,e)&&(d<l||d===l&&(r.x>o.x||r.x===o.x&&ok(o,r)))&&(o=r,l=d)),r=r.next;while(r!==u);return o}function ok(e,t){return Ae(e.prev,e,t.prev)<0&&Ae(t.next,e,e.next)<0}function sk(e,t,r,n){var i=e;do i.z===null&&(i.z=wm(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,uk(i)}function uk(e){var t,r,n=1,i,a,o,s,u,f;do{for(a=e,e=null,f=null,i=0;a;){for(i++,s=a,o=0,r=0;r<n&&(o++,s=s.nextZ,!!s);r++);for(u=n;o>0||u>0&&s;)o!==0&&(u===0||!s||a.z<=s.z)?(t=a,a=a.nextZ,o--):(t=s,s=s.nextZ,u--),f?f.nextZ=t:e=t,t.prevZ=f,f=t;a=s}f.nextZ=null,n*=2}while(i>1);return e}function wm(e,t,r,n,i){return e=32767*(e-r)*i,t=32767*(t-n)*i,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function fk(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function bi(e,t,r,n,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function ck(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!lk(e,t)&&(Ea(e,t)&&Ea(t,e)&&hk(e,t)&&(Ae(e.prev,e,t.prev)||Ae(e,t.prev,t))||Nf(e,t)&&Ae(e.prev,e,e.next)>0&&Ae(t.prev,t,t.next)>0)}function Ae(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Nf(e,t){return e.x===t.x&&e.y===t.y}function Lx(e,t,r,n){var i=Gf(Ae(e,t,r)),a=Gf(Ae(e,t,n)),o=Gf(Ae(r,n,e)),s=Gf(Ae(r,n,t));return!!(i!==a&&o!==s||i===0&&Df(e,r,t)||a===0&&Df(e,n,t)||o===0&&Df(r,e,n)||s===0&&Df(r,t,n))}function Df(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Gf(e){return e>0?1:e<0?-1:0}function lk(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Lx(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function Ea(e,t){return Ae(e.prev,e,e.next)<0?Ae(e,t,e.next)>=0&&Ae(e,e.prev,t)>=0:Ae(e,t,e.prev)<0||Ae(e,e.next,t)<0}function hk(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function Dx(e,t){var r=new xm(e.i,e.x,e.y),n=new xm(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Rx(e,t,r,n){var i=new xm(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Oa(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function xm(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Bm(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=vk(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
240
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function vk(e,t){if(e){if(typeof e=="string")return Ux(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ux(e,t)}}function Ux(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function An(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jx(Object(r),!0).forEach(function(n){gk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cm(e,t,r){var n=yk(e),i=Object.keys(n).filter(function(a){return n[a]!==Array});return bk(e,An({propArrayTypes:n},t),{numericPropKeys:r&&r.numericPropKeys||i,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function yk(e){var t={},r=Bm(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.properties)for(var a in i.properties){var o=i.properties[a];t[a]=xk(o,t[a])}}}catch(s){r.e(s)}finally{r.f()}return t}function bk(e,t,r){var n=t.pointPositionsCount,i=t.pointFeaturesCount,a=t.linePositionsCount,o=t.linePathsCount,s=t.lineFeaturesCount,u=t.polygonPositionsCount,f=t.polygonObjectsCount,c=t.polygonRingsCount,l=t.polygonFeaturesCount,d=t.propArrayTypes,h=t.coordLength,p=r.numericPropKeys,m=p===void 0?[]:p,g=r.PositionDataType,y=g===void 0?Float32Array:g,b=r.triangulate,A=b===void 0?!0:b,S=e[0]&&"id"in e[0],O=e.length>65535?Uint32Array:Uint16Array,w={type:"Point",positions:new y(n*h),globalFeatureIds:new O(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},B={type:"LineString",pathIndices:a>65535?new Uint32Array(o+1):new Uint16Array(o+1),positions:new y(a*h),globalFeatureIds:new O(a),featureIds:s>65535?new Uint32Array(a):new Uint16Array(a),numericProps:{},properties:[],fields:[]},P={type:"Polygon",polygonIndices:u>65535?new Uint32Array(f+1):new Uint16Array(f+1),primitivePolygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),positions:new y(u*h),globalFeatureIds:new O(u),featureIds:l>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]};A&&(P.triangles=[]);for(var x=0,_=[w,B,P];x<_.length;x++){var C=_[x],I=Bm(m),R;try{for(I.s();!(R=I.n()).done;){var M=R.value,D=d[M];C.numericProps[M]=new D(C.positions.length/h)}}catch(re){I.e(re)}finally{I.f()}}B.pathIndices[o]=a,P.polygonIndices[f]=u,P.primitivePolygonIndices[c]=u;var N={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},j=Bm(e),U;try{for(j.s();!(U=j.n()).done;){var k=U.value,H=k.geometry,W=k.properties||{};switch(H.type){case"Point":_k(H,w,N,h,W),w.properties.push(Pm(W,m)),S&&w.fields.push({id:k.id}),N.pointFeature++;break;case"LineString":Ak(H,B,N,h,W),B.properties.push(Pm(W,m)),S&&B.fields.push({id:k.id}),N.lineFeature++;break;case"Polygon":Tk(H,P,N,h,W),P.properties.push(Pm(W,m)),S&&P.fields.push({id:k.id}),N.polygonFeature++;break;default:throw new Error("Invalid geometry type")}N.feature++}}catch(re){j.e(re)}finally{j.f()}return wk(w,B,P,h)}function _k(e,t,r,n,i){t.positions.set(e.data,r.pointPosition*n);var a=e.data.length/n;Mm(t,i,r.pointPosition,a),t.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+a),t.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+a),r.pointPosition+=a}function Ak(e,t,r,n,i){t.positions.set(e.data,r.linePosition*n);var a=e.data.length/n;Mm(t,i,r.linePosition,a),t.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+a),t.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+a);for(var o=0,s=e.indices.length;o<s;++o){var u=e.indices[o],f=o===s-1?e.data.length:e.indices[o+1];t.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(f-u)/n}}function Tk(e,t,r,n,i){t.positions.set(e.data,r.polygonPosition*n);var a=e.data.length/n;Mm(t,i,r.polygonPosition,a),t.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+a),t.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+a);for(var o=0,s=e.indices.length;o<s;++o){var u=r.polygonPosition;t.polygonIndices[r.polygonObject++]=u;for(var f=e.areas[o],c=e.indices[o],l=e.indices[o+1],d=0,h=c.length;d<h;++d){var p=c[d],m=d===h-1?l===void 0?e.data.length:l[0]:c[d+1];t.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(m-p)/n}var g=r.polygonPosition;Sk(t,f,c,{startPosition:u,endPosition:g,coordLength:n})}}function Sk(e,t,r,n){var i=n.startPosition,a=n.endPosition,o=n.coordLength;if(e.triangles)for(var s=i*o,u=a*o,f=e.positions.subarray(s,u),c=r[0],l=r.slice(1).map(function(m){return(m-c)/o}),d=Em(f,l,o,t),h=0,p=d.length;h<p;++h)e.triangles.push(i+d[h])}function Om(e,t){var r={};for(var n in e)r[n]={value:e[n],size:t};return r}function wk(e,t,r,n){var i={points:An(An({},e),{},{positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:Om(e.numericProps,1)}),lines:An(An({},t),{},{positions:{value:t.positions,size:n},pathIndices:{value:t.pathIndices,size:1},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:Om(t.numericProps,1)}),polygons:An(An({},r),{},{positions:{value:r.positions,size:n},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:Om(r.numericProps,1)})};return r.triangles&&(i.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),i}function Mm(e,t,r,n){for(var i in e.numericProps)if(i in t){var a=t[i];e.numericProps[i].fill(a,r,r+n)}}function Pm(e,t){var r={};for(var n in e)t.includes(n)||(r[n]=e[n]);return r}function xk(e,t){return t===Array||!Number.isFinite(e)?Array:t===Float64Array||Math.fround(e)!==e?Float64Array:Float32Array}function kx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ek(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kx(Object(r),!0).forEach(function(n){Ok(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ok(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vx(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Pk(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
241
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function Pk(e,t){if(e){if(typeof e=="string")return Hx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hx(e,t)}}function Hx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kf(e,t){var r=t?.globalFeatureId;return r!==void 0?Bk(e,r):Ck(e,t?.type)}function Bk(e,t){var r=Wx(e),n=Vx(r),i;try{for(n.s();!(i=n.n()).done;){for(var a=i.value,o=0,s=a.featureIds.value[0],u=0;u<a.featureIds.value.length;u++){var f=a.featureIds.value[u];if(f!==s){if(t===a.globalFeatureIds.value[o])return Uf(a,o,u);o=u,s=f}}if(t===a.globalFeatureIds.value[o])return Uf(a,o,a.featureIds.value.length)}}catch(c){n.e(c)}finally{n.f()}throw new Error("featureId:".concat(t," not found"))}function Ck(e,t){var r=Wx(e,t);return Mk(r)}function zx(e,t,r){switch(e.type){case"Point":return Lk(e,t,r);case"LineString":return Fk(e,t,r);case"Polygon":return Jx(e,t,r);default:var n=e;throw new Error("Unsupported geometry type: ".concat(n?.type))}}function Wx(e,t){var r=Boolean(e.points||e.lines||e.polygons);if(!r)return e.type=t||Dk(e),[e];var n=[];return e.points&&(e.points.type="Point",n.push(e.points)),e.lines&&(e.lines.type="LineString",n.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",n.push(e.polygons)),n}function Mk(e){var t=[],r=Vx(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.featureIds.value.length!==0){for(var a=0,o=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];u!==o&&(t.push(Uf(i,a,s)),a=s,o=u)}t.push(Uf(i,a,i.featureIds.value.length))}}}catch(f){r.e(f)}finally{r.f()}return t}function Uf(e,t,r){var n=zx(e,t,r),i=Rk(e,t,r),a=Ik(e,t,r);return Ek({type:"Feature",geometry:n,properties:i},a)}function Ik(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;return e.fields&&e.fields[e.featureIds.value[t]]}function Rk(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=Object.assign({},e.properties[e.featureIds.value[t]]);for(var i in e.numericProps)n[i]=e.numericProps[i].value[t];return n}function Jx(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,n=e.positions,i=e.polygonIndices.value.filter(function(y){return y>=t&&y<=r}),a=e.primitivePolygonIndices.value.filter(function(y){return y>=t&&y<=r}),o=i.length>2;if(!o){for(var s=[],u=0;u<a.length-1;u++){var f=a[u],c=a[u+1],l=jf(n,f,c);s.push(l)}return{type:"Polygon",coordinates:s}}for(var d=[],h=0;h<i.length-1;h++){var p=i[h],m=i[h+1],g=Jx(e,p,m).coordinates;d.push(g)}return{type:"MultiPolygon",coordinates:d}}function Fk(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,n=e.positions,i=e.pathIndices.value.filter(function(c){return c>=t&&c<=r}),a=i.length>2;if(!a){var o=jf(n,i[0],i[1]);return{type:"LineString",coordinates:o}}for(var s=[],u=0;u<i.length-1;u++){var f=jf(n,i[u],i[u+1]);s.push(f)}return{type:"MultiLineString",coordinates:s}}function Lk(e,t,r){var n=e.positions,i=jf(n,t,r),a=i.length>1;return a?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function jf(e,t,r){t=t||0,r=r||e.value.length/e.size;for(var n=[],i=t;i<r;i++){for(var a=Array(),o=i*e.size;o<(i+1)*e.size;o++)a.push(Number(e.value[o]));n.push(a)}return n}function Dk(e){return e.pathIndices?"LineString":e.polygonIndices?"Polygon":"Point"}var Nm=q(Qx());function eE(e){var t=e.length;if(t<=1)return[e];for(var r=[],n,i,a=0;a<t;a++){var o=eH(e[a]);o!==0&&(i===void 0&&(i=o<0),i===o<0?(n&&r.push(n),n=[e[a]]):n&&n.push(e[a]))}return n&&r.push(n),r}function eH(e){for(var t=0,r=0,n=e.length-1,i,a;r<e.length;n=r++)i=e[r],a=e[n],t+=(a[0]-i[0])*(i[1]+a[1]);return t}function tE(e,t,r){t&&r&&(e===1?t.id=r.readVarint():e===2?tH(r,t):e===3?t.type=r.readVarint():e===4&&(t._geometry=r.pos))}function tH(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}function rH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function nH(e,t,r){return t&&rE(e.prototype,t),r&&rE(e,r),e}var nE=function(){function e(r,n,i,a,o){rH(this,e),v(this,"properties",void 0),v(this,"extent",void 0),v(this,"type",void 0),v(this,"id",void 0),v(this,"_pbf",void 0),v(this,"_geometry",void 0),v(this,"_keys",void 0),v(this,"_values",void 0),this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=r,this._geometry=-1,this._keys=a,this._values=o,r.readFields(tE,this,n)}var t=e.prototype;return t.loadGeometry=function(){var n=this._pbf;n.pos=this._geometry;for(var i=n.readVarint()+n.pos,a=1,o=0,s=0,u=0,f=[],c;n.pos<i;){if(o<=0){var l=n.readVarint();a=l&7,o=l>>3}if(o--,a===1||a===2)s+=n.readSVarint(),u+=n.readSVarint(),a===1&&(c&&f.push(c),c=[]),c&&c.push([s,u]);else if(a===7)c&&c.push(c[0].slice());else throw new Error("unknown command ".concat(a))}return c&&f.push(c),f},t.bbox=function(){var n=this._pbf;n.pos=this._geometry;for(var i=n.readVarint()+n.pos,a=1,o=0,s=0,u=0,f=1/0,c=-1/0,l=1/0,d=-1/0;n.pos<i;){if(o<=0){var h=n.readVarint();a=h&7,o=h>>3}if(o--,a===1||a===2)s+=n.readSVarint(),u+=n.readSVarint(),s<f&&(f=s),s>c&&(c=s),u<l&&(l=u),u>d&&(d=u);else if(a!==7)throw new Error("unknown command ".concat(a))}return[f,l,c,d]},t._toGeoJSON=function(n){var i=this.loadGeometry(),a=e.types[this.type],o,s;switch(this.type){case 1:var u=[];for(o=0;o<i.length;o++)u[o]=i[o][0];i=u,n(i,this);break;case 2:for(o=0;o<i.length;o++)n(i[o],this);break;case 3:for(i=eE(i),o=0;o<i.length;o++)for(s=0;s<i[o].length;s++)n(i[o][s],this);break}i.length===1?i=i[0]:a="Multi".concat(a);var f={type:"Feature",geometry:{type:a,coordinates:i},properties:this.properties};return this.id!==null&&(f.id=this.id),f},t.toGeoJSON=function(n){if(typeof n=="function")return this._toGeoJSON(n);var i=n.x,a=n.y,o=n.z,s=this.extent*Math.pow(2,o),u=this.extent*i,f=this.extent*a;function c(l){for(var d=0;d<l.length;d++){var h=l[d];h[0]=(h[0]+u)*360/s-180;var p=180-(h[1]+f)*360/s;h[1]=360/Math.PI*Math.atan(Math.exp(p*Math.PI/180))-90}}return this._toGeoJSON(c)},nH(e,null,[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),e}();function iH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var iE=function(){function e(r,n){iH(this,e),v(this,"version",void 0),v(this,"name",void 0),v(this,"extent",void 0),v(this,"length",void 0),v(this,"_pbf",void 0),v(this,"_keys",void 0),v(this,"_values",void 0),v(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=r,this._keys=[],this._values=[],this._features=[],r.readFields(aH,this,n),this.length=this._features.length}var t=e.prototype;return t.feature=function(n){if(n<0||n>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[n];var i=this._pbf.readVarint()+this._pbf.pos;return new nE(this._pbf,i,this.extent,this._keys,this._values)},e}();function aH(e,t,r){t&&r&&(e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push(oH(r)))}function oH(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var n=e.readVarint()>>3;t=n===1?e.readString():n===2?e.readFloat():n===3?e.readDouble():n===4?e.readVarint64():n===5?e.readVarint():n===6?e.readSVarint():n===7?e.readBoolean():null}return t}function sH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var aE=function e(t,r){sH(this,e),v(this,"layers",void 0),this.layers=t.readFields(uH,{},r)};function uH(e,t,r){if(e===3&&r){var n=new iE(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function oE(e){var t=e.indices.length,r="Polygon";if(t<=1)return{type:r,data:e.data,areas:[[ar(e.data)]],indices:[e.indices]};for(var n=[],i=[],a=[],o=[],s,u=0,f,c=0,l;c<t;c++){l=e.indices[c]-u,f=e.indices[c+1]-u||e.data.length;var d=e.data.slice(l,f),h=ar(d);if(h===0){var p=e.data.slice(0,l),m=e.data.slice(f);e.data=p.concat(m),u+=f-l;continue}s===void 0&&(s=h<0),s===h<0?(o.length&&(n.push(a),i.push(o)),o=[l],a=[h]):(a.push(h),o.push(l))}return a&&n.push(a),o.length&&i.push(o),{type:r,areas:n,indices:i,data:e.data}}function sE(e,t,r,n){for(var i=0,a=e.length;i<a;i+=2){e[i]=(e[i]+t)*360/n-180;var o=180-(e[i+1]+r)*360/n;e[i+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}function uE(e,t,r){t&&r&&(e===1?t.id=r.readVarint():e===2?fH(r,t):e===3?t.type=r.readVarint():e===4&&(t._geometry=r.pos))}function fH(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}function cH(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=lH(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
242
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function lH(e,t){if(e){if(typeof e=="string")return fE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fE(e,t)}}function fE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function cE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function lE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cE(Object(r),!0).forEach(function(n){hH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var hE,Tn,Fm,zf,Lm,Dm,Pa;var dE=function(){function e(r,n,i,a,o,s){dH(this,e),v(this,"properties",void 0),v(this,"extent",void 0),v(this,"type",void 0),v(this,"id",void 0),v(this,"_pbf",void 0),v(this,"_geometry",void 0),v(this,"_keys",void 0),v(this,"_values",void 0),v(this,"_geometryInfo",void 0),this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=r,this._geometry=-1,this._keys=a,this._values=o,this._geometryInfo=s,r.readFields(uE,this,n)}var t=e.prototype;return t.loadGeometry=function(){var n=this._pbf;n.pos=this._geometry,hE=n.readVarint()+n.pos,Tn=1,zf=0,Lm=0,Dm=0,Pa=0;for(var i=[],a=[];n.pos<hE;)if(zf<=0&&(Fm=n.readVarint(),Tn=Fm&7,zf=Fm>>3),zf--,Tn===1||Tn===2)Lm+=n.readSVarint(),Dm+=n.readSVarint(),Tn===1&&i.push(Pa),a.push(Lm,Dm),Pa+=2;else if(Tn===7){if(Pa>0){var o=i[i.length-1];a.push(a[o],a[o+1]),Pa+=2}}else throw new Error("unknown command ".concat(Tn));return{data:a,indices:i}},t._toBinaryCoordinates=function(n){var i=this.loadGeometry(),a;n(i.data,this);var o=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=i.indices.length,a=lE({type:"Point"},i);break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=i.indices.length,this._geometryInfo.linePositionsCount+=i.data.length/o,a=lE({type:"LineString"},i);break;case 3:a=oE(i),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=a.indices.length;var s=cH(a.indices),u;try{for(s.s();!(u=s.n()).done;){var f=u.value;this._geometryInfo.polygonRingsCount+=f.length}}catch(l){s.e(l)}finally{s.f()}this._geometryInfo.polygonPositionsCount+=a.data.length/o;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}var c={type:"Feature",geometry:a,properties:this.properties};return this.id!==null&&(c.id=this.id),c},t.toBinaryCoordinates=function(n){if(typeof n=="function")return this._toBinaryCoordinates(n);var i=n.x,a=n.y,o=n.z,s=this.extent*Math.pow(2,o),u=this.extent*i,f=this.extent*a;return this._toBinaryCoordinates(function(c){return sE(c,u,f,s)})},e}();function pH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var pE=function(){function e(r,n){pH(this,e),v(this,"version",void 0),v(this,"name",void 0),v(this,"extent",void 0),v(this,"length",void 0),v(this,"_pbf",void 0),v(this,"_keys",void 0),v(this,"_values",void 0),v(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=r,this._keys=[],this._values=[],this._features=[],r.readFields(mH,this,n),this.length=this._features.length}var t=e.prototype;return t.feature=function(n,i){if(n<0||n>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[n];var a=this._pbf.readVarint()+this._pbf.pos;return new dE(this._pbf,a,this.extent,this._keys,this._values,i)},e}();function mH(e,t,r){t&&r&&(e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push(vH(r)))}function vH(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var n=e.readVarint()>>3;t=n===1?e.readString():n===2?e.readFloat():n===3?e.readDouble():n===4?e.readVarint64():n===5?e.readVarint():n===6?e.readSVarint():n===7?e.readBoolean():null}return t}function gH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var mE=function e(t,r){gH(this,e),v(this,"layers",void 0),this.layers=t.readFields(yH,{},r)};function yH(e,t,r){if(e===3&&r){var n=new pE(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function bH(e,t){return SH(e)||TH(e,t)||AH(e,t)||_H()}function _H(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
243
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AH(e,t){if(e){if(typeof e=="string")return vE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vE(e,t)}}function vE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function TH(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function SH(e){if(Array.isArray(e))return e}function Wf(e,t){var r,n,i=xH(t),a=(t==null||(r=t.gis)===null||r===void 0?void 0:r.format)||(t==null||(n=t.mvt)===null||n===void 0?void 0:n.shape);switch(a){case"columnar-table":return{shape:"columnar-table",data:Gm(e,i)};case"geojson-row-table":{var o={shape:"geojson-row-table",data:gE(e,i)};return o}case"geojson":return gE(e,i);case"binary-geometry":return Gm(e,i);case"binary":return Gm(e,i);default:throw new Error(a)}}function Gm(e,t){var r=wH(e,t),n=bH(r,2),i=n[0],a=n[1],o=Cm(i,a);return o.byteLength=e.byteLength,o}function wH(e,t){var r=[],n={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength<=0)return[r,n];var i=new mE(new Nm.default(e)),a=t&&Array.isArray(t.layers)?t.layers:Object.keys(i.layers);return a.forEach(function(o){var s=i.layers[o];if(s)for(var u=0;u<s.length;u++){var f=s.feature(u,n),c=OH(f,t,o);r.push(c)}}),[r,n]}function gE(e,t){if(e.byteLength<=0)return[];var r=[],n=new aE(new Nm.default(e)),i=Array.isArray(t.layers)?t.layers:Object.keys(n.layers);return i.forEach(function(a){var o=n.layers[a];if(o)for(var s=0;s<o.length;s++){var u=o.feature(s),f=EH(u,t,a);r.push(f)}}),r}function xH(e){var t;if(!(e!=null&&e.mvt))throw new Error("mvt options required");var r=((t=e.mvt)===null||t===void 0?void 0:t.coordinates)==="wgs84",n=e.mvt.tileIndex,i=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(r&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return e.mvt}function EH(e,t,r){var n=e.toGeoJSON(t.coordinates==="wgs84"?t.tileIndex:PH);return t.layerProperty&&(n.properties[t.layerProperty]=r),n}function OH(e,t,r){var n=e.toBinaryCoordinates(t.coordinates==="wgs84"?t.tileIndex:BH);return t.layerProperty&&n.properties&&(n.properties[t.layerProperty]=r),n}function PH(e,t){for(var r=t.extent,n=0;n<e.length;n++){var i=e[n];i[0]/=r,i[1]/=r}}function BH(e,t){for(var r=t.extent,n=0,i=e.length;n<i;++n)e[n]/=r}function yE(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function CH(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){yE(a,n,i,o,s,"next",u)}function s(u){yE(a,n,i,o,s,"throw",u)}o(void 0)})}}function bE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _E(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bE(Object(r),!0).forEach(function(n){MH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function MH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var IH="3.4.13",RH={mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}},Jf={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:IH,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:RH},FH=_E(_E({},Jf),{},{parse:function(){var e=CH(regeneratorRuntime.mark(function r(n,i){return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Wf(n,i));case 1:case"end":return o.stop()}},r)}));function t(r,n){return e.apply(this,arguments)}return t}(),parseSync:Wf,binary:!0});function AE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function TE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?AE(Object(r),!0).forEach(function(n){LH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SE(e,t){return UH(e)||NH(e,t)||GH(e,t)||DH()}function DH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
244
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GH(e,t){if(e){if(typeof e=="string")return wE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wE(e,t)}}function wE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function NH(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function UH(e){if(Array.isArray(e))return e}var jH={Point:xE,MultiPoint:kH,LineString:EE,MultiLineString:HH,Polygon:OE,MultiPolygon:VH};function xE(e,t,r){var n=SE(e,2),i=n[0],a=n[1],o=SE(t,2),s=o[0],u=o[1],f=dr(s[0],u[0],i),c=dr(s[1],u[1],a);return r.unprojectFlat([f,c])}function Um(e,t,r){return e.map(function(n){return xE(n,t,r)})}function kH(e,t,r){return Um(e,t,r)}function EE(e,t,r){return Um(e,t,r)}function HH(e,t,r){return e.map(function(n){return EE(n,t,r)})}function OE(e,t,r){return e.map(function(n){return Um(n,t,r)})}function VH(e,t,r){return e.map(function(n){return OE(n,t,r)})}function PE(e,t,r){var n=r.projectFlat([t.west,t.north]),i=r.projectFlat([t.east,t.south]),a=[n,i];return TE(TE({},e),{},{coordinates:jH[e.type](e.coordinates,a,r)})}function zH(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=WH(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
245
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function WH(e,t){if(e){if(typeof e=="string")return BE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return BE(e,t)}}function BE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var JH=["points","lines","polygons"];function jm(e,t,r,n){var i=zH(JH),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=e[o]&&XH(e[o],t,r,n);if(s>=0)return s}}catch(u){i.e(u)}finally{i.f()}return-1}function XH(e,t,r,n){var i=e.featureIds.value;if(!i.length)return-1;var a=0,o=i[i.length-1]+1;if(n){var s=qH(e,n);if(s)a=s[0],o=s[1]+1;else return-1}var u=-1;if(t in e.numericProps){var f=e.numericProps[t].value.findIndex(function(c,l){return c===r&&i[l]>=a&&i[l]<o});return f>=0?e.globalFeatureIds.value[f]:-1}else t?u=CE(e.properties,function(c){return c[t]===r},a,o):e.fields&&(u=CE(e.fields,function(c){return c.id===r},a,o));return u>=0?KH(e,u):-1}function qH(e,t){if(!e.__layers){for(var r={},n=e.properties,i=0;i<n.length;i++){var a=n[i],o=a.layerName;o&&(r[o]?r[o][1]=i:r[o]=[i,i])}e.__layers=r}return e.__layers[t]}function KH(e,t){if(!e.__ids){for(var r=[],n=e.featureIds.value,i=e.globalFeatureIds.value,a=0;a<n.length;a++)r[n[a]]=i[a];e.__ids=r}return e.__ids[t]}function CE(e,t,r,n){for(var i=r;i<n;i++)if(t(e[i],i))return i;return-1}function Xf(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Xf=function(r){return typeof r}:Xf=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Xf(e)}function YH(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=GE(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
246
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function $H(e){return eV(e)||QH(e)||GE(e)||ZH()}function ZH(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
247
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GE(e,t){if(e){if(typeof e=="string")return Vm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vm(e,t)}}function QH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function eV(e){if(Array.isArray(e))return Vm(e)}function Vm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ME(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(f){r(f);return}s.done?t(u):Promise.resolve(u).then(n,i)}function tV(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){ME(a,n,i,o,s,"next",u)}function s(u){ME(a,n,i,o,s,"throw",u)}o(void 0)})}}function rV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function nV(e,t,r){return t&&IE(e.prototype,t),r&&IE(e,r),e}function jt(e,t,r){return typeof Reflect<"u"&&Reflect.get?jt=Reflect.get:jt=function(i,a,o){var s=iV(i,a);if(s){var u=Object.getOwnPropertyDescriptor(s,a);return u.get?u.get.call(o):u.value}},jt(e,t,r||e)}function iV(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=ft(e),e!==null););return e}function aV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zm(e,t)}function zm(e,t){return zm=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},zm(e,t)}function oV(e){var t=fV();return function(){var n=ft(e),i;if(t){var a=ft(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return sV(this,i)}}function sV(e,t){if(t&&(Xf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return uV(e)}function uV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fV(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ft(e){return ft=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ft(e)}function RE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Nr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RE(Object(r),!0).forEach(function(n){cV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var km=512,lV=Nr(Nr({},Wm.GeoJsonLayer.defaultProps),{},{data:yr,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[Jf],binary:!0}),Kf=function(e){aV(r,e);var t=oV(r);function r(){return rV(this,r),t.apply(this,arguments)}var n=r.prototype;return n.initializeState=function(){jt(ft(r.prototype),"initializeState",this).call(this);var a=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:a,data:null,tileJSON:null})},n.updateState=function(a){var o,s=a.props,u=a.oldProps,f=a.context,c=a.changeFlags;c.dataChanged&&this._updateTileData(),(o=this.state)!==null&&o!==void 0&&o.data&&(jt(ft(r.prototype),"updateState",this).call(this,{props:s,oldProps:u,context:f,changeFlags:c}),this._setWGS84PropertyForTiles());var l=s.highlightColor;l!==u.highlightColor&&Array.isArray(l)&&this.setState({highlightColor:l})},n._updateTileData=function(){var i=tV(regeneratorRuntime.mark(function o(){var s,u,f,c,l;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(s=this.props.data,u=null,!(typeof s=="string"&&!$l(s))){h.next=18;break}return f=this.props,c=f.onDataLoad,l=f.fetch,this.setState({data:null,tileJSON:null}),h.prev=5,h.next=8,l(s,{propName:"data",layer:this,loaders:[]});case 8:u=h.sent,h.next=15;break;case 11:h.prev=11,h.t0=h.catch(5),this.raiseError(h.t0,"loading TileJSON"),s=null;case 15:c&&c(u,{propName:"data",layer:this}),h.next=19;break;case 18:s.tilejson&&(u=s);case 19:u&&(s=u.tiles),this.setState({data:s,tileJSON:u});case 21:case"end":return h.stop()}},o,this,[[5,11]])}));function a(){return i.apply(this,arguments)}return a}(),n._getTilesetOptions=function(){var a=jt(ft(r.prototype),"_getTilesetOptions",this).call(this),o=this.state.tileJSON,s=this.props,u=s.minZoom,f=s.maxZoom;return o&&(Number.isFinite(o.minzoom)&&o.minzoom>u&&(a.minZoom=o.minzoom),Number.isFinite(o.maxzoom)&&(!Number.isFinite(f)||o.maxzoom<f)&&(a.maxZoom=o.maxzoom)),a},n.renderLayers=function(){var a;return(a=this.state)!==null&&a!==void 0&&a.data?jt(ft(r.prototype),"renderLayers",this).call(this):null},n.getTileData=function(a){var o,s=this.state,u=s.data,f=s.binary,c=a.index,l=a.signal,d=Rt(u,a);if(!d)return Promise.reject("Invalid URL");var h=this.getLoadOptions(),p=this.props.fetch;return h=Nr(Nr({},h),{},{mimeType:"application/x-protobuf",mvt:Nr(Nr({},(o=h)===null||o===void 0?void 0:o.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:c}),gis:f?{format:"binary"}:{}}),p(d,{propName:"data",layer:this,loadOptions:h,signal:l})},n.renderSubLayers=function(a){var o=a.tile.index,s=o.x,u=o.y,f=o.z,c=Math.pow(2,f),l=km/c,d=-l,h=km*s/c,p=km*(1-u/c),m=new J().scale([l,d,1]);a.autoHighlight=!1,this.context.viewport.resolution||(a.modelMatrix=m,a.coordinateOrigin=[h,p,0],a.coordinateSystem=qf.COORDINATE_SYSTEM.CARTESIAN,a.extensions=[].concat($H(a.extensions||[]),[new NE.ClipExtension]));var g=jt(ft(r.prototype),"renderSubLayers",this).call(this,a);return this.state.binary&&!(g instanceof Wm.GeoJsonLayer)&&qf.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),g},n._updateAutoHighlight=function(a){var o=this.props.uniqueIdProperty,s=this.state,u=s.hoveredFeatureId,f=s.hoveredFeatureLayerName,c=a.object,l,d;c&&(l=Hm(c,o),d=FE(c));var h=this.props.highlightColor;typeof h=="function"&&(h=h(a)),(u!==l||f!==d)&&this.setState({highlightColor:h,hoveredFeatureId:l,hoveredFeatureLayerName:d})},n.getPickingInfo=function(a){var o=jt(ft(r.prototype),"getPickingInfo",this).call(this,a),s=Boolean(this.context.viewport.resolution);if(this.state.binary&&o.index!==-1){var u=a.sourceLayer.props.data;o.object=kf(u,{globalFeatureId:o.index})}return o.object&&!s&&(o.object=DE(o.object,o.tile.bbox,this.context.viewport)),o},n.getSubLayerPropsByTile=function(a){return{highlightedObjectIndex:this.getHighlightedObjectIndex(a),highlightColor:this.state.highlightColor}},n.getHighlightedObjectIndex=function(a){var o=this.state,s=o.hoveredFeatureId,u=o.hoveredFeatureLayerName,f=o.binary,c=this.props,l=c.uniqueIdProperty,d=c.highlightedFeatureId,h=a.content,p=LE(d),m=LE(s)||p;if(!m)return-1;var g=p?d:s;return Array.isArray(h)?h.findIndex(function(y){var b=Hm(y,l)===g,A=p||FE(y)===u;return b&&A}):h&&f?jm(h,l,g,p?"":u):-1},n._pickObjects=function(a){var o=this.context,s=o.deck,u=o.viewport,f=u.width,c=u.height,l=u.x,d=u.y,h=[this.id];return s.pickObjects({x:l,y:d,width:f,height:c,layerIds:h,maxObjects:a})},n.getRenderedFeatures=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,o=this._pickObjects(a),s=new Set,u=[],f=YH(o),c;try{for(f.s();!(c=f.n()).done;){var l=c.value,d=Hm(l.object,this.props.uniqueIdProperty);d===void 0?u.push(l.object):s.has(d)||(s.add(d),u.push(l.object))}}catch(h){f.e(h)}finally{f.f()}return u},n._setWGS84PropertyForTiles=function(){var a=this,o="dataInWGS84",s=this.state.tileset;s.selectedTiles.forEach(function(u){u.hasOwnProperty(o)||Object.defineProperty(u,o,{get:function(){if(!u.content)return null;if(a.state.binary&&Array.isArray(u.content)&&!u.content.length)return[];var c=u.bbox;if(u._contentWGS84===void 0&&Zl(c)){var l=a.state.binary?kf(u.content):u.content;u._contentWGS84=l.map(function(d){return DE(d,c,a.context.viewport)})}return u._contentWGS84}})})},nV(r,[{key:"isLoaded",get:function(){return this.state&&this.state.data&&this.state.tileset&&jt(ft(r.prototype),"isLoaded",this)}}]),r}(Kt);Kf.layerName="MVTLayer";Kf.defaultProps=lV;function Hm(e,t){if(e.properties&&t)return e.properties[t];if("id"in e)return e.id}function FE(e){var t;return((t=e.properties)===null||t===void 0?void 0:t.layerName)||null}function LE(e){return e!=null&&e!==""}function DE(e,t,r){var n=Nr(Nr({},e),{},{geometry:{type:e.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){var a=PE(e.geometry,t,r);return a.coordinates}}),n}function hV(e,t){return vV(e)||mV(e,t)||pV(e,t)||dV()}function dV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
248
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pV(e,t){if(e){if(typeof e=="string")return UE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return UE(e,t)}}function UE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mV(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,o,s;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}return n}}function vV(e){if(Array.isArray(e))return e}var jE="0123456789bcdefghjkmnpqrstuvwxyz",kE={};for(Ba=0;Ba<jE.length;Ba++)kE[jE.charAt(Ba)]=Ba;var Ba,gV=-90,yV=90,bV=-180,_V=180;function AV(e){for(var t=!0,r=yV,n=gV,i=_V,a=bV,o,s=0,u=0,f=e.length;u<f;u++){var c=e[u].toLowerCase();s=kE[c];for(var l=4;l>=0;l--){var d=s>>l&1;t?(o=(i+a)/2,d===1?a=o:i=o):(o=(r+n)/2,d===1?n=o:r=o),t=!t}}return[n,a,r,i]}function HE(e){var t=AV(e),r=hV(t,4),n=r[0],i=r[1],a=r[2],o=r[3];return[o,a,o,n,i,n,i,a,o,a]}function Yf(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Yf=function(r){return typeof r}:Yf=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Yf(e)}function TV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Jm(e,t)}function Jm(e,t){return Jm=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Jm(e,t)}function wV(e){var t=OV();return function(){var n=$f(e),i;if(t){var a=$f(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return xV(this,i)}}function xV(e,t){if(t&&(Yf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return EV(e)}function EV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OV(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $f(e){return $f=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},$f(e)}var PV={getGeohash:{type:"accessor",value:function(t){return t.geohash}}},Zf=function(e){SV(r,e);var t=wV(r);function r(){return TV(this,r),t.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){var a=this.props,o=a.data,s=a.getGeohash;return{data:o,_normalize:!1,positionFormat:"XY",getPolygon:function(f,c){return HE(s(f,c))}}},r}(rt);Zf.layerName="GeohashLayer";Zf.defaultProps=PV;return qE(Ca);})();
38
+ `},o},n.initializeState=function(){me(zt(r.prototype),"initializeState",this).call(this);var o=this.getAttributeManager();o.addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})},n.draw=function(o){var s=this.props,a=s.fadeTrail,c=s.trailLength,l=s.currentTime;o.uniforms=Kc(Kc({},o.uniforms),{},{fadeTrail:a,trailLength:c,currentTime:l}),me(zt(r.prototype),"draw",this).call(this,o)},r}(Jc.PathLayer);nn.layerName="TripsLayer";nn.defaultProps=tg;var hl=B(on()),dl=B(ut());var it=B(on()),ln=B(ut()),je=B(ct());var qe=B(on());function rl(t,e){return ng(t)||rg(t,e)||il(t,e)||eg()}function eg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
39
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rg(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function ng(t){if(Array.isArray(t))return t}function nl(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=il(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
40
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function il(t,e){if(t){if(typeof t=="string")return el(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return el(t,e)}}function el(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function sn(t,e){e=e===void 0?t[0][0]:e;var r=nl(t),n;try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i[0]-e;o>180?i[0]-=360:o<-180&&(i[0]+=360)}}catch(s){r.e(s)}finally{r.f()}}function ig(t,e,r){var n=(0,qe.cellToLatLng)(t),i=rl(n,2),o=i[0],s=i[1],a=e.length;sn(e,s);for(var c=e[0]===e[a-1]?a-1:a,l=0;l<c;l++)e[l][0]=It(s,e[l][0],r),e[l][1]=It(o,e[l][1],r)}function ol(t,e,r){var n=t(e,r),i=(0,qe.cellToLatLng)(n),o=rl(i,2),s=o[0],a=o[1];return[a,s]}function co(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=(0,qe.cellToBoundary)(t,!0);return e!==1?ig(t,r,e):sn(r),r}function sl(t){var e=new Float64Array(t.length*2),r=0,n=nl(t),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;e[r++]=o[0],e[r++]=o[1]}}catch(s){n.e(s)}finally{n.f()}return e}function al(t,e){return ag(t)||sg(t,e)||ul(t,e)||og()}function og(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
41
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sg(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function ag(t){if(Array.isArray(t))return t}function cg(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ul(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
42
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function ul(t,e){if(t){if(typeof t=="string")return cl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cl(t,e)}}function cl(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function lg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ug(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&lo(t,e)}function lo(t,e){return lo=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},lo(t,e)}function fg(t){var e=pg();return function(){var n=an(t),i;if(e){var o=an(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return hg(this,i)}}function hg(t,e){if(e&&(Ue(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dg(t)}function dg(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function an(t){return an=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},an(t)}function ll(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function cn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ll(Object(r),!0).forEach(function(n){mg(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ll(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mg(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ue(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ue=function(r){return typeof r}:Ue=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ue(t)}var gg=10;function yg(t,e){var r;return t==null?r=e:Ue(t)==="object"?r=cn(cn({},t),{},{coverage:e}):r={getHexagon:t,coverage:e},r}var vg=cn(cn({},je.PolygonLayer.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(e){return e.hexagon}},extruded:!0}),Xt=function(t){ug(r,t);var e=fg(r);function r(){var i;lg(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.initializeState=function(){r._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}},n.shouldUpdateState=function(o){var s=o.changeFlags;return this._shouldUseHighPrecision()?s.propsOrDataChanged:s.somethingChanged},n.updateState=function(o){var s=o.props,a=o.changeFlags;if(s.highPrecision!==!0&&(a.dataChanged||a.updateTriggersChanged&&a.updateTriggersChanged.getHexagon)){var c=this._calculateH3DataProps();this.setState(c)}this._updateVertices(this.context.viewport)},n._calculateH3DataProps=function(){var o=-1,s=!1,a=!1,c=(0,ln.createIterable)(this.props.data),l=c.iterable,u=c.objectInfo,f=cg(l),h;try{for(f.s();!(h=f.n()).done;){var d=h.value;u.index++;var p=this.props.getHexagon(d,u),g=(0,it.getResolution)(p);if(o<0){if(o=g,!this.props.highPrecision)break}else if(o!==g){a=!0;break}if((0,it.isPentagon)(p)){s=!0;break}}}catch(m){f.e(m)}finally{f.f()}return{resolution:o,edgeLengthKM:o>=0?(0,it.getHexagonEdgeLengthAvg)(o,"km"):0,hasMultipleRes:a,hasPentagon:s}},n._shouldUseHighPrecision=function(){if(this.props.highPrecision==="auto"){var o=this.state,s=o.resolution,a=o.hasPentagon,c=o.hasMultipleRes,l=this.context.viewport;return Boolean(l?.resolution)||c||a||s>=0&&s<=5}return this.props.highPrecision},n._updateVertices=function(o){if(!this._shouldUseHighPrecision()){var s=this.state,a=s.resolution,c=s.edgeLengthKM,l=s.centerHex;if(!(a<0)){var u=this.props.centerHexagon||(0,it.latLngToCell)(o.latitude,o.longitude,a);if(l!==u){if(l)try{var f=(0,it.gridDistance)(l,u);if(f*c<gg)return}catch{}var h=o.distanceScales.unitsPerMeter,d=co(u),p=(0,it.cellToLatLng)(u),g=al(p,2),m=g[0],v=g[1],w=o.projectFlat([v,m]),x=al(w,2),b=x[0],T=x[1];d=d.map(function(S){var P=o.projectFlat(S);return[(P[0]-b)/h[0],(P[1]-T)/h[1]]}),this.setState({centerHex:u,vertices:d})}}}},n.renderLayers=function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()},n._getForwardProps=function(){var o=this.props,s=o.elevationScale,a=o.material,c=o.coverage,l=o.extruded,u=o.wireframe,f=o.stroked,h=o.filled,d=o.lineWidthUnits,p=o.lineWidthScale,g=o.lineWidthMinPixels,m=o.lineWidthMaxPixels,v=o.getFillColor,w=o.getElevation,x=o.getLineColor,b=o.getLineWidth,T=o.transitions,S=o.updateTriggers;return{elevationScale:s,extruded:l,coverage:c,wireframe:u,stroked:f,filled:h,lineWidthUnits:d,lineWidthScale:p,lineWidthMinPixels:g,lineWidthMaxPixels:m,material:a,getElevation:w,getFillColor:v,getLineColor:x,getLineWidth:b,transitions:T,updateTriggers:{getFillColor:S.getFillColor,getElevation:S.getElevation,getLineColor:S.getLineColor,getLineWidth:S.getLineWidth}}},n._renderPolygonLayer=function(){var o=this.props,s=o.data,a=o.getHexagon,c=o.updateTriggers,l=o.coverage,u=this.getSubLayerClass("hexagon-cell-hifi",je.PolygonLayer),f=this._getForwardProps();return f.updateTriggers.getPolygon=yg(c.getHexagon,l),new u(f,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:f.updateTriggers}),{data:s,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(d,p){var g=a(d,p);return sl(co(g,l))}})},n._renderColumnLayer=function(){var o=this.props,s=o.data,a=o.getHexagon,c=o.updateTriggers,l=this.getSubLayerClass("hexagon-cell",je.ColumnLayer),u=this._getForwardProps();return u.updateTriggers.getPosition=c.getHexagon,new l(u,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:u.updateTriggers}),{data:s,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:ol.bind(null,a)})},r}(ln.CompositeLayer);Xt.defaultProps=vg;Xt.layerName="H3HexagonLayer";Xt._checkH3Lib=function(){};function un(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?un=function(r){return typeof r}:un=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},un(t)}function uo(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=xg(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
43
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function xg(t,e){if(t){if(typeof t=="string")return fl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fl(t,e)}}function fl(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bg(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fo(t,e)}function fo(t,e){return fo=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},fo(t,e)}function wg(t){var e=Tg();return function(){var n=fn(t),i;if(e){var o=fn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Mg(this,i)}}function Mg(t,e){if(e&&(un(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sg(t)}function Sg(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Tg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fn(t){return fn=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},fn(t)}var Pg={getHexagons:{type:"accessor",value:function(e){return e.hexagons}}},hn=function(t){bg(r,t);var e=wg(r);function r(){var i;_g(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.initializeState=function(){Xt._checkH3Lib()},n.updateState=function(o){var s=o.props,a=o.changeFlags;if(a.dataChanged||a.updateTriggersChanged&&a.updateTriggersChanged.getHexagons){var c=s.data,l=s.getHexagons,u=[],f=(0,dl.createIterable)(c),h=f.iterable,d=f.objectInfo,p=uo(h),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;d.index++;var v=l(m,d),w=(0,hl.cellsToMultiPolygon)(v,!0),x=uo(w),b;try{for(x.s();!(b=x.n()).done;){var T=b.value,S=uo(T),P;try{for(S.s();!(P=S.n()).done;){var M=P.value;sn(M)}}catch(_){S.e(_)}finally{S.f()}u.push(this.getSubLayerRow({polygon:T},m,d.index))}}catch(_){x.e(_)}finally{x.f()}}}catch(_){p.e(_)}finally{p.f()}this.setState({polygons:u})}},n.indexToBounds=function(){var o=this.props,s=o.getElevation,a=o.getFillColor,c=o.getLineColor,l=o.getLineWidth;return{data:this.state.polygons,getPolygon:function(f){return f.polygon},getElevation:this.getSubLayerAccessor(s),getFillColor:this.getSubLayerAccessor(a),getLineColor:this.getSubLayerAccessor(c),getLineWidth:this.getSubLayerAccessor(l)}},r}(nt);hn.layerName="H3ClusterLayer";hn.defaultProps=Pg;var xn=B(ut()),xo=B(ml()),Tl=B(ut());function Ve(t){let e=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,s=-1/0,a=t.POSITION?t.POSITION.value:[],c=a&&a.length;for(let l=0;l<c;l+=3){let u=a[l],f=a[l+1],h=a[l+2];e=u<e?u:e,r=f<r?f:r,n=h<n?h:n,i=u>i?u:i,o=f>o?f:o,s=h>s?h:s}return[[e,r,n],[i,o,s]]}var Eg=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function ho(t){return t>>1^-(t&1)}function Og(t){let e=0,r={};for(let[n,i]of Eg){let o=i===8?t.getFloat64:t.getFloat32;r[n]=o.call(t,e,!0),e+=i}return{header:r,headerEndPosition:e}}function Ig(t,e){let r=e,n=3,i=t.getUint32(r,!0),o=new Uint16Array(i*n);r+=Uint32Array.BYTES_PER_ELEMENT;let s=Uint16Array.BYTES_PER_ELEMENT,a=i*s,c=r,l=c+a,u=l+a,f=0,h=0,d=0;for(let p=0;p<i;p++)f+=ho(t.getUint16(c+s*p,!0)),h+=ho(t.getUint16(l+s*p,!0)),d+=ho(t.getUint16(u+s*p,!0)),o[p]=f,o[p+i]=h,o[p+i*2]=d;return r+=a*3,{vertexData:o,vertexDataEndPosition:r}}function We(t,e,r,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o;if(n===2?o=new Uint16Array(t,e,r):o=new Uint32Array(t,e,r),!i)return o;let s=0;for(let a=0;a<o.length;++a){let c=o[a];o[a]=s-c,c===0&&++s}return o}function Ag(t,e,r){let n=r,i=3,s=e.length/i>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%s!==0&&(n+=s-n%s);let a=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let c=a*3,l=We(t.buffer,n,c,s);return n+=c*s,{triangleIndicesEndPosition:n,triangleIndices:l}}function Lg(t,e,r){let n=r,i=3,s=e.length/i>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,a=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let c=We(t.buffer,n,a,s,!1);n+=a*s;let l=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let u=We(t.buffer,n,l,s,!1);n+=l*s;let f=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let h=We(t.buffer,n,f,s,!1);n+=f*s;let d=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let p=We(t.buffer,n,d,s,!1);return n+=d*s,{edgeIndicesEndPosition:n,westIndices:c,southIndices:u,eastIndices:h,northIndices:p}}function Rg(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function Fg(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}function Ng(t,e){let r={};if(t.byteLength<=e)return{extensions:r,extensionsEndPosition:e};let n=e;for(;n<t.byteLength;){let i=t.getUint8(n,!0);n+=Uint8Array.BYTES_PER_ELEMENT;let o=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;let s=new DataView(t.buffer,n,o);switch(i){case 1:{r.vertexNormals=Rg(s);break}case 2:{r.waterMask=Fg(s);break}default:}n+=o}return{extensions:r,extensionsEndPosition:n}}var Yt={header:0,vertices:1,triangleIndices:2,edgeIndices:3,extensions:4},Cg={maxDecodingStep:Yt.extensions};function po(t,e){let r=Object.assign({},Cg,e),n=new DataView(t),{header:i,headerEndPosition:o}=Og(n);if(r.maxDecodingStep<Yt.vertices)return{header:i};let{vertexData:s,vertexDataEndPosition:a}=Ig(n,o);if(r.maxDecodingStep<Yt.triangleIndices)return{header:i,vertexData:s};let{triangleIndices:c,triangleIndicesEndPosition:l}=Ag(n,s,a);if(r.maxDecodingStep<Yt.edgeIndices)return{header:i,vertexData:s,triangleIndices:c};let{westIndices:u,southIndices:f,eastIndices:h,northIndices:d,edgeIndicesEndPosition:p}=Lg(n,s,l);if(r.maxDecodingStep<Yt.extensions)return{header:i,vertexData:s,triangleIndices:c,westIndices:u,northIndices:d,eastIndices:h,southIndices:f};let{extensions:g}=Ng(n,p);return{header:i,vertexData:s,triangleIndices:c,westIndices:u,northIndices:d,eastIndices:h,southIndices:f,extensions:g}}function dn(t,e,r,n){let i=n?Bg(n,t.POSITION.value):zg(e),o=new t.POSITION.value.constructor(i.length*6),s=new t.TEXCOORD_0.value.constructor(i.length*4),a=new e.constructor(i.length*6);for(let l=0;l<i.length;l++){let u=i[l];kg({edge:u,edgeIndex:l,attributes:t,skirtHeight:r,newPosition:o,newTexcoord0:s,newTriangles:a})}t.POSITION.value=Me(t.POSITION.value,o),t.TEXCOORD_0.value=Me(t.TEXCOORD_0.value,s);let c=e instanceof Array?e.concat(a):Me(e,a);return{attributes:t,triangles:c}}function zg(t){let e=[];for(let s=0;s<t.length;s+=3)e.push([t[s],t[s+1]]),e.push([t[s+1],t[s+2]]),e.push([t[s+2],t[s]]);e.sort((s,a)=>Math.min(...s)-Math.min(...a)||Math.max(...s)-Math.max(...a));let r=[],n=0;for(;n<e.length;){var i,o;e[n][0]===((i=e[n+1])===null||i===void 0?void 0:i[1])&&e[n][1]===((o=e[n+1])===null||o===void 0?void 0:o[0])?n+=2:(r.push(e[n]),n++)}return r}function Bg(t,e){t.westIndices.sort((n,i)=>e[3*n+1]-e[3*i+1]),t.eastIndices.sort((n,i)=>e[3*i+1]-e[3*n+1]),t.southIndices.sort((n,i)=>e[3*i]-e[3*n]),t.northIndices.sort((n,i)=>e[3*n]-e[3*i]);let r=[];for(let n in t){let i=t[n];for(let o=0;o<i.length-1;o++)r.push([i[o],i[o+1]])}return r}function kg(t){let{edge:e,edgeIndex:r,attributes:n,skirtHeight:i,newPosition:o,newTexcoord0:s,newTriangles:a}=t,c=n.POSITION.value.length,l=r*2,u=r*2+1;o.set(n.POSITION.value.subarray(e[0]*3,e[0]*3+3),l*3),o[l*3+2]=o[l*3+2]-i,o.set(n.POSITION.value.subarray(e[1]*3,e[1]*3+3),u*3),o[u*3+2]=o[u*3+2]-i,s.set(n.TEXCOORD_0.value.subarray(e[0]*2,e[0]*2+2),l*2),s.set(n.TEXCOORD_0.value.subarray(e[1]*2,e[1]*2+2),u*2);let f=r*2*3;a[f]=e[0],a[f+1]=c/3+u,a[f+2]=e[1],a[f+3]=c/3+u,a[f+4]=e[0],a[f+5]=c/3+l}function mo(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{bounds:r}=e,{header:n,vertexData:i,triangleIndices:o,westIndices:s,northIndices:a,eastIndices:c,southIndices:l}=po(t,Yt.triangleIndices),u=o,f=qg(i,n,r),h=Ve(f);if(e!=null&&e.skirtHeight){let{attributes:d,triangles:p}=dn(f,u,e.skirtHeight,{westIndices:s,northIndices:a,eastIndices:c,southIndices:l});f=d,u=p}return{loaderData:{header:{}},header:{vertexCount:u.length,boundingBox:h},schema:void 0,topology:"triangle-list",mode:4,indices:{value:u,size:1},attributes:f}}function qg(t,e,r){let{minHeight:n,maxHeight:i}=e,[o,s,a,c]=r||[0,0,1,1],l=a-o,u=c-s,f=i-n,h=t.length/3,d=new Float32Array(h*3),p=new Float32Array(h*2);for(let g=0;g<h;g++){let m=t[g]/32767,v=t[g+h]/32767,w=t[g+h*2]/32767;d[3*g+0]=m*l+o,d[3*g+1]=v*u+s,d[3*g+2]=w*f+n,p[2*g+0]=m,p[2*g+1]=v}return{POSITION:{value:d,size:3},TEXCOORD_0:{value:p,size:2}}}var De=class{constructor(e=257){this.gridSize=e;let r=e-1;if(r&r-1)throw new Error(`Expected grid size to be 2^n+1, got ${e}.`);this.numTriangles=r*r*2-2,this.numParentTriangles=this.numTriangles-r*r,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(this.numTriangles*4);for(let n=0;n<this.numTriangles;n++){let i=n+2,o=0,s=0,a=0,c=0,l=0,u=0;for(i&1?a=c=l=r:o=s=u=r;(i>>=1)>1;){let h=o+a>>1,d=s+c>>1;i&1?(a=o,c=s,o=l,s=u):(o=a,s=c,a=l,c=u),l=h,u=d}let f=n*4;this.coords[f+0]=o,this.coords[f+1]=s,this.coords[f+2]=a,this.coords[f+3]=c}}createTile(e){return new go(e,this)}},go=class{constructor(e,r){let n=r.gridSize;if(e.length!==n*n)throw new Error(`Expected terrain data of length ${n*n} (${n} x ${n}), got ${e.length}.`);this.terrain=e,this.martini=r,this.errors=new Float32Array(e.length),this.update()}update(){let{numTriangles:e,numParentTriangles:r,coords:n,gridSize:i}=this.martini,{terrain:o,errors:s}=this;for(let a=e-1;a>=0;a--){let c=a*4,l=n[c+0],u=n[c+1],f=n[c+2],h=n[c+3],d=l+f>>1,p=u+h>>1,g=d+p-u,m=p+l-d,v=(o[u*i+l]+o[h*i+f])/2,w=p*i+d,x=Math.abs(v-o[w]);if(s[w]=Math.max(s[w],x),a<r){let b=(u+m>>1)*i+(l+g>>1),T=(h+m>>1)*i+(f+g>>1);s[w]=Math.max(s[w],s[b],s[T])}}}getMesh(e=0){let{gridSize:r,indices:n}=this.martini,{errors:i}=this,o=0,s=0,a=r-1;n.fill(0);function c(d,p,g,m,v,w){let x=d+g>>1,b=p+m>>1;Math.abs(d-v)+Math.abs(p-w)>1&&i[b*r+x]>e?(c(v,w,d,p,x,b),c(g,m,v,w,x,b)):(n[p*r+d]=n[p*r+d]||++o,n[m*r+g]=n[m*r+g]||++o,n[w*r+v]=n[w*r+v]||++o,s++)}c(0,0,a,a,a,0),c(a,a,0,0,0,a);let l=new Uint16Array(o*2),u=new Uint32Array(s*3),f=0;function h(d,p,g,m,v,w){let x=d+g>>1,b=p+m>>1;if(Math.abs(d-v)+Math.abs(p-w)>1&&i[b*r+x]>e)h(v,w,d,p,x,b),h(g,m,v,w,x,b);else{let T=n[p*r+d]-1,S=n[m*r+g]-1,P=n[w*r+v]-1;l[2*T]=d,l[2*T+1]=p,l[2*S]=g,l[2*S+1]=m,l[2*P]=v,l[2*P+1]=w,u[f++]=T,u[f++]=S,u[f++]=P}}return h(0,0,a,a,a,0),h(a,a,0,0,0,a),{vertices:l,triangles:u}}};var Ge=class{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r;this.data=e,this.width=r,this.height=n,this.coords=[],this.triangles=[],this._halfedges=[],this._candidates=[],this._queueIndices=[],this._queue=[],this._errors=[],this._rms=[],this._pending=[],this._pendingLen=0,this._rmsSum=0;let i=r-1,o=n-1,s=this._addPoint(0,0),a=this._addPoint(i,0),c=this._addPoint(0,o),l=this._addPoint(i,o),u=this._addTriangle(l,s,c,-1,-1,-1);this._addTriangle(s,l,a,u,-1,-1),this._flush()}run(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;for(;this.getMaxError()>e;)this.refine()}refine(){this._step(),this._flush()}getMaxError(){return this._errors[0]}getRMSD(){return this._rmsSum>0?Math.sqrt(this._rmsSum/(this.width*this.height)):0}heightAt(e,r){return this.data[this.width*r+e]}_flush(){let e=this.coords;for(let r=0;r<this._pendingLen;r++){let n=this._pending[r],i=2*this.triangles[n*3+0],o=2*this.triangles[n*3+1],s=2*this.triangles[n*3+2];this._findCandidate(e[i],e[i+1],e[o],e[o+1],e[s],e[s+1],n)}this._pendingLen=0}_findCandidate(e,r,n,i,o,s,a){let c=Math.min(e,n,o),l=Math.min(r,i,s),u=Math.max(e,n,o),f=Math.max(r,i,s),h=Ht(n,i,o,s,c,l),d=Ht(o,s,e,r,c,l),p=Ht(e,r,n,i,c,l),g=i-r,m=e-n,v=s-i,w=n-o,x=r-s,b=o-e,T=Ht(e,r,n,i,o,s),S=this.heightAt(e,r)/T,P=this.heightAt(n,i)/T,M=this.heightAt(o,s)/T,_=0,y=0,E=0,A=0;for(let L=l;L<=f;L++){let I=0;h<0&&v!==0&&(I=Math.max(I,Math.floor(-h/v))),d<0&&x!==0&&(I=Math.max(I,Math.floor(-d/x))),p<0&&g!==0&&(I=Math.max(I,Math.floor(-p/g)));let R=h+v*I,U=d+x*I,z=p+g*I,D=!1;for(let q=c+I;q<=u;q++){if(R>=0&&U>=0&&z>=0){D=!0;let X=S*R+P*U+M*z,$=Math.abs(X-this.heightAt(q,L));A+=$*$,$>_&&(_=$,y=q,E=L)}else if(D)break;R+=v,U+=x,z+=g}h+=w,d+=b,p+=m}(y===e&&E===r||y===n&&E===i||y===o&&E===s)&&(_=0),this._candidates[2*a]=y,this._candidates[2*a+1]=E,this._rms[a]=A,this._queuePush(a,_,A)}_step(){let e=this._queuePop(),r=e*3+0,n=e*3+1,i=e*3+2,o=this.triangles[r],s=this.triangles[n],a=this.triangles[i],c=this.coords[2*o],l=this.coords[2*o+1],u=this.coords[2*s],f=this.coords[2*s+1],h=this.coords[2*a],d=this.coords[2*a+1],p=this._candidates[2*e],g=this._candidates[2*e+1],m=this._addPoint(p,g);if(Ht(c,l,u,f,p,g)===0)this._handleCollinear(m,r);else if(Ht(u,f,h,d,p,g)===0)this._handleCollinear(m,n);else if(Ht(h,d,c,l,p,g)===0)this._handleCollinear(m,i);else{let v=this._halfedges[r],w=this._halfedges[n],x=this._halfedges[i],b=this._addTriangle(o,s,m,v,-1,-1,r),T=this._addTriangle(s,a,m,w,-1,b+1),S=this._addTriangle(a,o,m,x,b+2,T+1);this._legalize(b),this._legalize(T),this._legalize(S)}}_addPoint(e,r){let n=this.coords.length>>1;return this.coords.push(e,r),n}_addTriangle(e,r,n,i,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this.triangles.length,c=a/3;return this.triangles[a+0]=e,this.triangles[a+1]=r,this.triangles[a+2]=n,this._halfedges[a+0]=i,this._halfedges[a+1]=o,this._halfedges[a+2]=s,i>=0&&(this._halfedges[i]=a+0),o>=0&&(this._halfedges[o]=a+1),s>=0&&(this._halfedges[s]=a+2),this._candidates[2*c+0]=0,this._candidates[2*c+1]=0,this._queueIndices[c]=-1,this._rms[c]=0,this._pending[this._pendingLen++]=c,a}_legalize(e){let r=this._halfedges[e];if(r<0)return;let n=e-e%3,i=r-r%3,o=n+(e+1)%3,s=n+(e+2)%3,a=i+(r+2)%3,c=i+(r+1)%3,l=this.triangles[s],u=this.triangles[e],f=this.triangles[o],h=this.triangles[a],d=this.coords;if(!Ug(d[2*l],d[2*l+1],d[2*u],d[2*u+1],d[2*f],d[2*f+1],d[2*h],d[2*h+1]))return;let p=this._halfedges[o],g=this._halfedges[s],m=this._halfedges[a],v=this._halfedges[c];this._queueRemove(n/3),this._queueRemove(i/3);let w=this._addTriangle(l,h,f,-1,m,p,n),x=this._addTriangle(h,l,u,w,g,v,i);this._legalize(w+1),this._legalize(x+2)}_handleCollinear(e,r){let n=r-r%3,i=n+(r+1)%3,o=n+(r+2)%3,s=this.triangles[o],a=this.triangles[r],c=this.triangles[i],l=this._halfedges[i],u=this._halfedges[o],f=this._halfedges[r];if(f<0){let S=this._addTriangle(e,s,a,-1,u,-1,n),P=this._addTriangle(s,e,c,S,-1,l);this._legalize(S+1),this._legalize(P+2);return}let h=f-f%3,d=h+(f+2)%3,p=h+(f+1)%3,g=this.triangles[d],m=this._halfedges[d],v=this._halfedges[p];this._queueRemove(h/3);let w=this._addTriangle(s,a,e,u,-1,-1,n),x=this._addTriangle(a,g,e,v,-1,w+1,h),b=this._addTriangle(g,c,e,m,-1,x+1),T=this._addTriangle(c,s,e,l,w+2,b+1);this._legalize(w),this._legalize(x),this._legalize(b),this._legalize(T)}_queuePush(e,r,n){let i=this._queue.length;this._queueIndices[e]=i,this._queue.push(e),this._errors.push(r),this._rmsSum+=n,this._queueUp(i)}_queuePop(){let e=this._queue.length-1;return this._queueSwap(0,e),this._queueDown(0,e),this._queuePopBack()}_queuePopBack(){let e=this._queue.pop();return this._errors.pop(),this._rmsSum-=this._rms[e],this._queueIndices[e]=-1,e}_queueRemove(e){let r=this._queueIndices[e];if(r<0){let i=this._pending.indexOf(e);if(i!==-1)this._pending[i]=this._pending[--this._pendingLen];else throw new Error("Broken triangulation (something went wrong).");return}let n=this._queue.length-1;n!==r&&(this._queueSwap(r,n),this._queueDown(r,n)||this._queueUp(r)),this._queuePopBack()}_queueLess(e,r){return this._errors[e]>this._errors[r]}_queueSwap(e,r){let n=this._queue[e],i=this._queue[r];this._queue[e]=i,this._queue[r]=n,this._queueIndices[n]=r,this._queueIndices[i]=e;let o=this._errors[e];this._errors[e]=this._errors[r],this._errors[r]=o}_queueUp(e){let r=e;for(;;){let n=r-1>>1;if(n===r||!this._queueLess(r,n))break;this._queueSwap(n,r),r=n}}_queueDown(e,r){let n=e;for(;;){let i=2*n+1;if(i>=r||i<0)break;let o=i+1,s=i;if(o<r&&this._queueLess(o,i)&&(s=o),!this._queueLess(s,n))break;this._queueSwap(n,s),n=s}return n>e}};function Ht(t,e,r,n,i,o){return(r-i)*(e-o)-(n-o)*(t-i)}function Ug(t,e,r,n,i,o,s,a){let c=t-s,l=e-a,u=r-s,f=n-a,h=i-s,d=o-a,p=c*c+l*l,g=u*u+f*f,m=h*h+d*d;return c*(f*m-g*d)-l*(u*m-g*h)+p*(u*d-f*h)<0}function vl(t,e){let{meshMaxError:r,bounds:n,elevationDecoder:i}=e,{data:o,width:s,height:a}=t,c,l;switch(e.tesselator){case"martini":c=pn(o,s,a,i,e.tesselator),l=gl(r,s,c);break;case"delatin":c=pn(o,s,a,i,e.tesselator),l=yl(r,s,a,c);break;default:s===a&&!(a&s-1)?(c=pn(o,s,a,i,"martini"),l=gl(r,s,c)):(c=pn(o,s,a,i,"delatin"),l=yl(r,s,a,c));break}let{vertices:u}=l,{triangles:f}=l,h=jg(u,c,s,a,n),d=Ve(h);if(e.skirtHeight){let{attributes:p,triangles:g}=dn(h,f,e.skirtHeight);h=p,f=g}return{loaderData:{header:{}},header:{vertexCount:f.length,boundingBox:d},mode:4,indices:{value:Uint32Array.from(f),size:1},attributes:h}}function gl(t,e,r){let n=e+1,o=new De(n).createTile(r),{vertices:s,triangles:a}=o.getMesh(t);return{vertices:s,triangles:a}}function yl(t,e,r,n){let i=new Ge(n,e+1,r+1);i.run(t);let{coords:o,triangles:s}=i;return{vertices:o,triangles:s}}function pn(t,e,r,n,i){let{rScaler:o,bScaler:s,gScaler:a,offset:c}=n,l=new Float32Array((e+1)*(r+1));for(let u=0,f=0;f<r;f++)for(let h=0;h<e;h++,u++){let d=u*4,p=t[d+0],g=t[d+1],m=t[d+2];l[u+f]=p*o+g*a+m*s+c}if(i==="martini"){for(let u=(e+1)*e,f=0;f<e;f++,u++)l[u]=l[u-e-1];for(let u=r,f=0;f<r+1;f++,u+=r+1)l[u]=l[u-1]}return l}function jg(t,e,r,n,i){let o=r+1,s=t.length/2,a=new Float32Array(s*3),c=new Float32Array(s*2),[l,u,f,h]=i||[0,0,r,n],d=(f-l)/r,p=(h-u)/n;for(let g=0;g<s;g++){let m=t[g*2],v=t[g*2+1],w=v*o+m;a[3*g+0]=m*d+l,a[3*g+1]=-v*p+h,a[3*g+2]=e[w],c[2*g+0]=m/r,c[2*g+1]=v/n}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:c,size:2}}}var mn=typeof __VERSION__<"u"?__VERSION__:"latest";var gn={name:"Terrain",id:"terrain",module:"terrain",version:mn,worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:void 0,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:void 0}}};var xl={name:"Quantized Mesh",id:"quantized-mesh",module:"terrain",version:mn,worker:!0,extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{bounds:[0,0,1,1],skirtHeight:null}}};var Vg={...gn,parse:Wg};async function Wg(t,e,r){let n={...e,mimeType:"application/x.image",image:{...e?.image,type:"data"}},i=await Zn(t,[],n,r),o={...Vg.options.terrain,...e?.terrain};return vl(i,o)}var DS={...xl,parseSync:(t,e)=>mo(t,e?.["quantized-mesh"]),parse:async(t,e)=>mo(t,e?.["quantized-mesh"])};function yn(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?yn=function(r){return typeof r}:yn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},yn(t)}function _l(t){return Zg(t)||Gg(t)||Sl(t)||Dg()}function Dg(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
44
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gg(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Zg(t){if(Array.isArray(t))return yo(t)}function Xg(t,e){return $g(t)||Hg(t,e)||Sl(t,e)||Yg()}function Yg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
45
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sl(t,e){if(t){if(typeof t=="string")return yo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yo(t,e)}}function yo(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Hg(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function $g(t){if(Array.isArray(t))return t}function Qg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kg(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&vo(t,e)}function vo(t,e){return vo=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},vo(t,e)}function Jg(t){var e=ry();return function(){var n=vn(t),i;if(e){var o=vn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ty(this,i)}}function ty(t,e){if(e&&(yn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ey(t)}function ey(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ry(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vn(t){return vn=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},vn(t)}function bl(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Bt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bl(Object(r),!0).forEach(function(n){ny(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bl(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ny(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var wl=[1],iy=Bt(Bt({},Tt.defaultProps),{},{elevationData:Ct,texture:Bt(Bt({},Ct),{},{optional:!0}),meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:"",wireframe:!1,material:!0,loaders:[gn]});function Ml(t){return Array.isArray(t)?t.join(";"):t||""}var _n=function(t){Kg(r,t);var e=Jg(r);function r(){var i;Qg(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.updateState=function(o){var s=o.props,a=o.oldProps,c=s.elevationData!==a.elevationData;if(c){var l=s.elevationData,u=l&&(Array.isArray(l)||l.includes("{x}")&&l.includes("{y}"));this.setState({isTiled:u})}var f=c||s.meshMaxError!==a.meshMaxError||s.elevationDecoder!==a.elevationDecoder||s.bounds!==a.bounds;if(!this.state.isTiled&&f){var h=this.loadTerrain(s);this.setState({terrain:h})}s.workerUrl&&xn.log.removed("workerUrl","loadOptions.terrain.workerUrl")()},n.loadTerrain=function(o){var s,a=o.elevationData,c=o.bounds,l=o.elevationDecoder,u=o.meshMaxError,f=o.signal;if(!a)return null;var h=this.getLoadOptions();h=Bt(Bt({},h),{},{terrain:Bt(Bt({skirtHeight:this.state.isTiled?u*2:0},(s=h)===null||s===void 0?void 0:s.terrain),{},{bounds:c,meshMaxError:u,elevationDecoder:l})});var d=this.props.fetch;return d(a,{propName:"elevationData",layer:this,loadOptions:h,signal:f})},n.getTiledTerrainData=function(o){var s=this.props,a=s.elevationData,c=s.fetch,l=s.texture,u=s.elevationDecoder,f=s.meshMaxError,h=this.context.viewport,d=yt(a,o),p=l&&yt(l,o),g=o.signal,m=[0,0],v=[0,0];if(h.isGeospatial){var w=o.bbox;m=h.projectFlat([w.west,w.south]),v=h.projectFlat([w.east,w.north])}else{var x=o.bbox;m=[x.left,x.bottom],v=[x.right,x.top]}var b=[m[0],m[1],v[0],v[1]],T=this.loadTerrain({elevationData:d,bounds:b,elevationDecoder:u,meshMaxError:f,signal:g}),S=p?c(p,{propName:"texture",layer:this,loaders:[],signal:g}).catch(function(P){return null}):Promise.resolve(null);return Promise.all([T,S])},n.renderSubLayers=function(o){var s=this.getSubLayerClass("mesh",xo.SimpleMeshLayer),a=this.props,c=a.color,l=a.wireframe,u=a.material,f=o.data;if(!f)return null;var h=Xg(f,2),d=h[0],p=h[1];return new s(o,{data:wl,mesh:d,texture:p,_instanced:!1,coordinateSystem:Tl.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(m){return[0,0,0]},getColor:c,wireframe:l,material:u})},n.onViewportLoad=function(o){if(o){var s=this.state.zRange,a=o.map(function(u){return u.content}).filter(Boolean).map(function(u){var f=u[0].header.boundingBox;return f.map(function(h){return h[2]})});if(a.length!==0){var c=Math.min.apply(Math,_l(a.map(function(u){return u[0]}))),l=Math.max.apply(Math,_l(a.map(function(u){return u[1]})));(!s||c<s[0]||l>s[1])&&this.setState({zRange:[c,l]})}}},n.renderLayers=function(){var o=this.props,s=o.color,a=o.material,c=o.elevationData,l=o.texture,u=o.wireframe,f=o.meshMaxError,h=o.elevationDecoder,d=o.tileSize,p=o.maxZoom,g=o.minZoom,m=o.extent,v=o.maxRequests,w=o.onTileLoad,x=o.onTileUnload,b=o.onTileError,T=o.maxCacheSize,S=o.maxCacheByteSize,P=o.refinementStrategy;if(this.state.isTiled)return new Tt(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:Ml(c),texture:Ml(l),meshMaxError:f,elevationDecoder:h}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:d,maxZoom:p,minZoom:g,extent:m,maxRequests:v,onTileLoad:w,onTileUnload:x,onTileError:b,maxCacheSize:T,maxCacheByteSize:S,refinementStrategy:P});var M=this.getSubLayerClass("mesh",xo.SimpleMeshLayer);return new M(this.getSubLayerProps({id:"mesh"}),{data:wl,mesh:this.state.terrain,texture:l,_instanced:!1,getPosition:function(y){return[0,0,0]},getColor:s,material:a,wireframe:u})},r}(xn.CompositeLayer);_n.defaultProps=iy;_n.layerName="TerrainLayer";var Fn=B(ut()),qo=B(ct()),pu=B(El());var Ze={x:0,y:1,z:2};function $t(t,e={}){let{start:r=0,end:n=t.length,plane:i="xy"}=e,o=e.size||2,s=0,a=Ze[i[0]],c=Ze[i[1]];for(let l=r,u=n-o;l<n;l+=o)s+=(t[l+a]-t[u+a])*(t[l+c]+t[u+c]),u=l;return s/2}function bo(t,e,r=2,n,i="xy"){let o=e&&e.length,s=o?e[0]*r:t.length,a=Il(t,0,s,r,!0,n&&n[0],i),c=[];if(!a||a.next===a.prev)return c;let l,u,f,h,d,p,g;if(o&&(a=fy(t,e,a,r,n,i)),t.length>80*r){h=u=t[0],d=f=t[1];for(let m=r;m<s;m+=r)p=t[m],g=t[m+1],p<h&&(h=p),g<d&&(d=g),p>u&&(u=p),g>f&&(f=g);l=Math.max(u-h,f-d),l=l!==0?32767/l:0}return Xe(a,c,r,h,d,l,0),c}function Il(t,e,r,n,i,o,s){let a,c;o===void 0&&(o=$t(t,{start:e,end:r,size:n,plane:s}));let l=Ze[s[0]],u=Ze[s[1]];if(i===o<0)for(a=e;a<r;a+=n)c=Ol(a,t[a+l],t[a+u],c);else for(a=r-n;a>=e;a-=n)c=Ol(a,t[a+l],t[a+u],c);return c&&Mn(c,c.next)&&(He(c),c=c.next),c}function Qt(t,e){if(!t)return t;e||(e=t);let r=t,n;do if(n=!1,!r.steiner&&(Mn(r,r.next)||W(r.prev,r,r.next)===0)){if(He(r),r=e=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==e);return e}function Xe(t,e,r,n,i,o,s){if(!t)return;!s&&o&&gy(t,n,i,o);let a=t,c,l;for(;t.prev!==t.next;){if(c=t.prev,l=t.next,o?cy(t,n,i,o):ay(t)){e.push(c.i/r|0),e.push(t.i/r|0),e.push(l.i/r|0),He(t),t=l.next,a=l.next;continue}if(t=l,t===a){s?s===1?(t=ly(Qt(t),e,r),Xe(t,e,r,n,i,o,2)):s===2&&uy(t,e,r,n,i,o):Xe(Qt(t),e,r,n,i,o,1);break}}}function ay(t){let e=t.prev,r=t,n=t.next;if(W(e,r,n)>=0)return!1;let i=e.x,o=r.x,s=n.x,a=e.y,c=r.y,l=n.y,u=i<o?i<s?i:s:o<s?o:s,f=a<c?a<l?a:l:c<l?c:l,h=i>o?i>s?i:s:o>s?o:s,d=a>c?a>l?a:l:c>l?c:l,p=n.next;for(;p!==e;){if(p.x>=u&&p.x<=h&&p.y>=f&&p.y<=d&&ge(i,a,o,c,s,l,p.x,p.y)&&W(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function cy(t,e,r,n){let i=t.prev,o=t,s=t.next;if(W(i,o,s)>=0)return!1;let a=i.x,c=o.x,l=s.x,u=i.y,f=o.y,h=s.y,d=a<c?a<l?a:l:c<l?c:l,p=u<f?u<h?u:h:f<h?f:h,g=a>c?a>l?a:l:c>l?c:l,m=u>f?u>h?u:h:f>h?f:h,v=_o(d,p,e,r,n),w=_o(g,m,e,r,n),x=t.prevZ,b=t.nextZ;for(;x&&x.z>=v&&b&&b.z<=w;){if(x.x>=d&&x.x<=g&&x.y>=p&&x.y<=m&&x!==i&&x!==s&&ge(a,u,c,f,l,h,x.x,x.y)&&W(x.prev,x,x.next)>=0||(x=x.prevZ,b.x>=d&&b.x<=g&&b.y>=p&&b.y<=m&&b!==i&&b!==s&&ge(a,u,c,f,l,h,b.x,b.y)&&W(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;x&&x.z>=v;){if(x.x>=d&&x.x<=g&&x.y>=p&&x.y<=m&&x!==i&&x!==s&&ge(a,u,c,f,l,h,x.x,x.y)&&W(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=w;){if(b.x>=d&&b.x<=g&&b.y>=p&&b.y<=m&&b!==i&&b!==s&&ge(a,u,c,f,l,h,b.x,b.y)&&W(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function ly(t,e,r){let n=t;do{let i=n.prev,o=n.next.next;!Mn(i,o)&&Al(i,n,n.next,o)&&Ye(i,o)&&Ye(o,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),He(n),He(n.next),n=t=o),n=n.next}while(n!==t);return Qt(n)}function uy(t,e,r,n,i,o){let s=t;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&xy(s,a)){let c=Ll(s,a);s=Qt(s,s.next),c=Qt(c,c.next),Xe(s,e,r,n,i,o,0),Xe(c,e,r,n,i,o,0);return}a=a.next}s=s.next}while(s!==t)}function fy(t,e,r,n,i,o){let s=[],a,c,l,u,f;for(a=0,c=e.length;a<c;a++)l=e[a]*n,u=a<c-1?e[a+1]*n:t.length,f=Il(t,l,u,n,!1,i&&i[a+1],o),f===f.next&&(f.steiner=!0),s.push(vy(f));for(s.sort(hy),a=0;a<s.length;a++)r=dy(s[a],r);return r}function hy(t,e){return t.x-e.x}function dy(t,e){let r=py(t,e);if(!r)return e;let n=Ll(r,t);return Qt(n,n.next),Qt(r,r.next)}function py(t,e){let r=e,n=t.x,i=t.y,o=-1/0,s;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){let h=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(h<=n&&h>o&&(o=h,s=r.x<r.next.x?r:r.next,h===n))return s}r=r.next}while(r!==e);if(!s)return null;let a=s,c=s.x,l=s.y,u=1/0,f;r=s;do n>=r.x&&r.x>=c&&n!==r.x&&ge(i<l?n:o,i,c,l,i<l?o:n,i,r.x,r.y)&&(f=Math.abs(i-r.y)/(n-r.x),Ye(r,t)&&(f<u||f===u&&(r.x>s.x||r.x===s.x&&my(s,r)))&&(s=r,u=f)),r=r.next;while(r!==a);return s}function my(t,e){return W(t.prev,t,e.prev)<0&&W(e.next,t,t.next)<0}function gy(t,e,r,n){let i=t;do i.z===0&&(i.z=_o(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,yy(i)}function yy(t){let e,r,n=1,i,o,s,a,c,l;do{for(o=t,t=null,l=null,i=0;o;){for(i++,a=o,s=0,r=0;r<n&&(s++,a=a.nextZ,!!a);r++);for(c=n;s>0||c>0&&a;)s!==0&&(c===0||!a||o.z<=a.z)?(e=o,o=o.nextZ,s--):(e=a,a=a.nextZ,c--),l?l.nextZ=e:t=e,e.prevZ=l,l=e;o=a}l.nextZ=null,n*=2}while(i>1);return t}function _o(t,e,r,n,i){return t=(t-r)*i|0,e=(e-n)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function vy(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function ge(t,e,r,n,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(n-a)>=(r-s)*(e-a)&&(r-s)*(o-a)>=(i-s)*(n-a)}function xy(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!_y(t,e)&&(Ye(t,e)&&Ye(e,t)&&by(t,e)&&(W(t.prev,t,e.prev)||W(t,e.prev,e))||Mn(t,e)&&W(t.prev,t,t.next)>0&&W(e.prev,e,e.next)>0)}function W(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Mn(t,e){return t.x===e.x&&t.y===e.y}function Al(t,e,r,n){let i=wn(W(t,e,r)),o=wn(W(t,e,n)),s=wn(W(r,n,t)),a=wn(W(r,n,e));return!!(i!==o&&s!==a||i===0&&bn(t,r,e)||o===0&&bn(t,n,e)||s===0&&bn(r,t,n)||a===0&&bn(r,e,n))}function bn(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function wn(t){return t>0?1:t<0?-1:0}function _y(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Al(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function Ye(t,e){return W(t.prev,t,t.next)<0?W(t,e,t.next)>=0&&W(t,t.prev,e)>=0:W(t,e,t.prev)<0||W(t,t.next,e)<0}function by(t,e){let r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function Ll(t,e){let r=new $e(t.i,t.x,t.y),n=new $e(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Ol(t,e,r,n){let i=new $e(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function He(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}var $e=class{constructor(e,r,n){F(this,"i",void 0),F(this,"x",void 0),F(this,"y",void 0),F(this,"prev",null),F(this,"next",null),F(this,"z",0),F(this,"prevZ",null),F(this,"nextZ",null),F(this,"steiner",!1),this.i=e,this.x=r,this.y=n}};function So(t,e,r){let n=Py(t),i=Object.keys(n).filter(o=>n[o]!==Array);return Ey(t,{propArrayTypes:n,...e},{numericPropKeys:r&&r.numericPropKeys||i,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function Py(t){let e={};for(let r of t)if(r.properties)for(let n in r.properties){let i=r.properties[n];e[n]=Fy(i,e[n])}return e}function Ey(t,e,r){let{pointPositionsCount:n,pointFeaturesCount:i,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:c,polygonObjectsCount:l,polygonRingsCount:u,polygonFeaturesCount:f,propArrayTypes:h,coordLength:d}=e,{numericPropKeys:p=[],PositionDataType:g=Float32Array,triangulate:m=!0}=r,v=t[0]&&"id"in t[0],w=t.length>65535?Uint32Array:Uint16Array,x={type:"Point",positions:new g(n*d),globalFeatureIds:new w(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},b={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new g(o*d),globalFeatureIds:new w(o),featureIds:a>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},T={type:"Polygon",polygonIndices:c>65535?new Uint32Array(l+1):new Uint16Array(l+1),primitivePolygonIndices:c>65535?new Uint32Array(u+1):new Uint16Array(u+1),positions:new g(c*d),globalFeatureIds:new w(c),featureIds:f>65535?new Uint32Array(c):new Uint16Array(c),numericProps:{},properties:[],fields:[]};m&&(T.triangles=[]);for(let P of[x,b,T])for(let M of p){let _=h[M];P.numericProps[M]=new _(P.positions.length/d)}b.pathIndices[s]=o,T.polygonIndices[l]=c,T.primitivePolygonIndices[u]=c;let S={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let P of t){let M=P.geometry,_=P.properties||{};switch(M.type){case"Point":Oy(M,x,S,d,_),x.properties.push(Mo(_,p)),v&&x.fields.push({id:P.id}),S.pointFeature++;break;case"LineString":Iy(M,b,S,d,_),b.properties.push(Mo(_,p)),v&&b.fields.push({id:P.id}),S.lineFeature++;break;case"Polygon":Ay(M,T,S,d,_),T.properties.push(Mo(_,p)),v&&T.fields.push({id:P.id}),S.polygonFeature++;break;default:throw new Error("Invalid geometry type")}S.feature++}return Ry(x,b,T,d)}function Oy(t,e,r,n,i){e.positions.set(t.data,r.pointPosition*n);let o=t.data.length/n;To(e,i,r.pointPosition,o),e.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+o),e.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+o),r.pointPosition+=o}function Iy(t,e,r,n,i){e.positions.set(t.data,r.linePosition*n);let o=t.data.length/n;To(e,i,r.linePosition,o),e.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+o),e.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+o);for(let s=0,a=t.indices.length;s<a;++s){let c=t.indices[s],l=s===a-1?t.data.length:t.indices[s+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(l-c)/n}}function Ay(t,e,r,n,i){e.positions.set(t.data,r.polygonPosition*n);let o=t.data.length/n;To(e,i,r.polygonPosition,o),e.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+o),e.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+o);for(let s=0,a=t.indices.length;s<a;++s){let c=r.polygonPosition;e.polygonIndices[r.polygonObject++]=c;let l=t.areas[s],u=t.indices[s],f=t.indices[s+1];for(let d=0,p=u.length;d<p;++d){let g=u[d],m=d===p-1?f===void 0?t.data.length:f[0]:u[d+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(m-g)/n}let h=r.polygonPosition;Ly(e,l,u,{startPosition:c,endPosition:h,coordLength:n})}}function Ly(t,e,r,n){let{startPosition:i,endPosition:o,coordLength:s}=n;if(!t.triangles)return;let a=i*s,c=o*s,l=t.positions.subarray(a,c),u=r[0],f=r.slice(1).map(d=>(d-u)/s),h=bo(l,f,s,e);for(let d=0,p=h.length;d<p;++d)t.triangles.push(i+h[d])}function wo(t,e){let r={};for(let n in t)r[n]={value:t[n],size:e};return r}function Ry(t,e,r,n){let i={shape:"binary-feature-collection",points:{...t,positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:wo(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:n},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:wo(e.numericProps,1)},polygons:{...r,positions:{value:r.positions,size:n},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:wo(r.numericProps,1)}};return i.polygons&&r.triangles&&(i.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),i}function To(t,e,r,n){for(let i in t.numericProps)if(i in e){let o=e[i];t.numericProps[i].fill(o,r,r+n)}}function Mo(t,e){let r={};for(let n in t)e.includes(n)||(r[n]=t[n]);return r}function Fy(t,e){return e===Array||!Number.isFinite(t)?Array:e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array}function Pn(t,e){let r=e?.globalFeatureId;return r!==void 0?Ny(t,r):Cy(t,e?.type)}function Ny(t,e){let r=Cl(t);for(let n of r){let i=0,o=n.featureIds.value[0];for(let s=0;s<n.featureIds.value.length;s++){let a=n.featureIds.value[s];if(a!==o){if(e===n.globalFeatureIds.value[i])return Sn(n,i,s);i=s,o=a}}if(e===n.globalFeatureIds.value[i])return Sn(n,i,n.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function Cy(t,e){let r=Cl(t,e);return zy(r)}function Nl(t,e,r){switch(t.type){case"Point":return Uy(t,e,r);case"LineString":return qy(t,e,r);case"Polygon":return zl(t,e,r);default:let n=t;throw new Error(`Unsupported geometry type: ${n?.type}`)}}function Cl(t,e){let r=[];return t.points&&(t.points.type="Point",r.push(t.points)),t.lines&&(t.lines.type="LineString",r.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",r.push(t.polygons)),r}function zy(t){let e=[];for(let r of t){if(r.featureIds.value.length===0)continue;let n=0,i=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let s=r.featureIds.value[o];s!==i&&(e.push(Sn(r,n,o)),n=o,i=s)}e.push(Sn(r,n,r.featureIds.value.length))}return e}function Sn(t,e,r){let n=Nl(t,e,r),i=ky(t,e,r),o=By(t,e,r);return{type:"Feature",geometry:n,properties:i,...o}}function By(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;return t.fields&&t.fields[t.featureIds.value[e]]}function ky(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=Object.assign({},t.properties[t.featureIds.value[e]]);for(let i in t.numericProps)n[i]=t.numericProps[i].value[e];return n}function zl(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:n}=t,i=t.polygonIndices.value.filter(c=>c>=e&&c<=r),o=t.primitivePolygonIndices.value.filter(c=>c>=e&&c<=r);if(!(i.length>2)){let c=[];for(let l=0;l<o.length-1;l++){let u=o[l],f=o[l+1],h=Tn(n,u,f);c.push(h)}return{type:"Polygon",coordinates:c}}let a=[];for(let c=0;c<i.length-1;c++){let l=i[c],u=i[c+1],f=zl(t,l,u).coordinates;a.push(f)}return{type:"MultiPolygon",coordinates:a}}function qy(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:n}=t,i=t.pathIndices.value.filter(a=>a>=e&&a<=r);if(!(i.length>2))return{type:"LineString",coordinates:Tn(n,i[0],i[1])};let s=[];for(let a=0;a<i.length-1;a++){let c=Tn(n,i[a],i[a+1]);s.push(c)}return{type:"MultiLineString",coordinates:s}}function Uy(t,e,r){let{positions:n}=t,i=Tn(n,e,r);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function Tn(t,e,r){e=e||0,r=r||t.value.length/t.size;let n=[];for(let i=e;i<r;i++){let o=Array();for(let s=i*t.size;s<(i+1)*t.size;s++)o.push(Number(t.value[s]));n.push(o)}return n}var Ro=B(Wl(),1);function Dl(t){let e=t.length;if(e<=1)return[t];let r=[],n,i;for(let o=0;o<e;o++){let s=i1(t[o]);s!==0&&(i===void 0&&(i=s<0),i===s<0?(n&&r.push(n),n=[t[o]]):n&&n.push(t[o]))}return n&&r.push(n),r}function i1(t){let e=0;for(let r=0,n=t.length-1,i,o;r<t.length;n=r++)i=t[r],o=t[n],e+=(o[0]-i[0])*(i[1]+o[1]);return e}function Gl(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?o1(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function o1(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}var Kt=class{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,r,n,i,o){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,e.readFields(Gl,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,a=[],c;for(;e.pos<r;){if(i<=0){let l=e.readVarint();n=l&7,i=l>>3}if(i--,n===1||n===2)o+=e.readSVarint(),s+=e.readSVarint(),n===1&&(c&&a.push(c),c=[]),c&&c.push([o,s]);else if(n===7)c&&c.push(c[0].slice());else throw new Error(`unknown command ${n}`)}return c&&a.push(c),a}bbox(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,a=1/0,c=-1/0,l=1/0,u=-1/0;for(;e.pos<r;){if(i<=0){let f=e.readVarint();n=f&7,i=f>>3}if(i--,n===1||n===2)o+=e.readSVarint(),s+=e.readSVarint(),o<a&&(a=o),o>c&&(c=o),s<l&&(l=s),s>u&&(u=s);else if(n!==7)throw new Error(`unknown command ${n}`)}return[a,l,c,u]}_toGeoJSON(e){let r=this.loadGeometry(),n=Kt.types[this.type],i,o;switch(this.type){case 1:let a=[];for(i=0;i<r.length;i++)a[i]=r[i][0];r=a,e(r,this);break;case 2:for(i=0;i<r.length;i++)e(r[i],this);break;case 3:for(r=Dl(r),i=0;i<r.length;i++)for(o=0;o<r[i].length;o++)e(r[i][o],this);break}r.length===1?r=r[0]:n=`Multi${n}`;let s={type:"Feature",geometry:{type:n,coordinates:r},properties:this.properties};return this.id!==null&&(s.id=this.id),s}toGeoJSON(e){if(typeof e=="function")return this._toGeoJSON(e);let{x:r,y:n,z:i}=e,o=this.extent*Math.pow(2,i),s=this.extent*r,a=this.extent*n;function c(l){for(let u=0;u<l.length;u++){let f=l[u];f[0]=(f[0]+s)*360/o-180;let h=180-(f[1]+a)*360/o;f[1]=360/Math.PI*Math.atan(Math.exp(h*Math.PI/180))-90}}return this._toGeoJSON(c)}};var Qe=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(s1,this,r),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let r=this._pbf.readVarint()+this._pbf.pos;return new Kt(this._pbf,r,this.extent,this._keys,this._values)}};function s1(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(a1(r)))}function a1(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}var Ke=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(c1,{},r)}};function c1(t,e,r){if(t===3&&r){let n=new Qe(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function Zl(t){let e=t.indices.length,r="Polygon";if(e<=1)return{type:r,data:t.data,areas:[[$t(t.data)]],indices:[t.indices]};let n=[],i=[],o=[],s=[],a,c=0;for(let l,u=0,f;u<e;u++){f=t.indices[u]-c,l=t.indices[u+1]-c||t.data.length;let h=t.data.slice(f,l),d=$t(h);if(d===0){let p=t.data.slice(0,f),g=t.data.slice(l);t.data=p.concat(g),c+=l-f;continue}a===void 0&&(a=d<0),a===d<0?(s.length&&(n.push(o),i.push(s)),s=[f],o=[d]):(o.push(d),s.push(f))}return o&&n.push(o),s.length&&i.push(s),{type:r,areas:n,indices:i,data:t.data}}function Xl(t,e,r,n){for(let i=0,o=t.length;i<o;i+=2){t[i]=(t[i]+e)*360/n-180;let s=180-(t[i+1]+r)*360/n;t[i+1]=360/Math.PI*Math.atan(Math.exp(s*Math.PI/180))-90}}function Yl(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?l1(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function l1(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}var Hl,Jt,Oo,In,Io,Ao,Je;var tr=class{constructor(e,r,n,i,o,s){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this._geometryInfo=void 0,this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,this._geometryInfo=s,e.readFields(Yl,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry,Hl=e.readVarint()+e.pos,Jt=1,In=0,Io=0,Ao=0,Je=0;let r=[],n=[];for(;e.pos<Hl;)if(In<=0&&(Oo=e.readVarint(),Jt=Oo&7,In=Oo>>3),In--,Jt===1||Jt===2)Io+=e.readSVarint(),Ao+=e.readSVarint(),Jt===1&&r.push(Je),n.push(Io,Ao),Je+=2;else if(Jt===7){if(Je>0){let i=r[r.length-1];n.push(n[i],n[i+1]),Je+=2}}else throw new Error(`unknown command ${Jt}`);return{data:n,indices:r}}_toBinaryCoordinates(e){let r=this.loadGeometry(),n;e(r.data,this);let i=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,n={type:"Point",...r};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/i,n={type:"LineString",...r};break;case 3:n=Zl(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=n.indices.length;for(let s of n.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=n.data.length/i;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let o={type:"Feature",geometry:n,properties:this.properties};return this.id!==null&&(o.id=this.id),o}toBinaryCoordinates(e){if(typeof e=="function")return this._toBinaryCoordinates(e);let{x:r,y:n,z:i}=e,o=this.extent*Math.pow(2,i),s=this.extent*r,a=this.extent*n;return this._toBinaryCoordinates(c=>Xl(c,s,a,o))}};var er=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(u1,this,r),this.length=this._features.length}feature(e,r){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let n=this._pbf.readVarint()+this._pbf.pos;return new tr(this._pbf,n,this.extent,this._keys,this._values,r)}};function u1(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(f1(r)))}function f1(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}var rr=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(h1,{},r)}};function h1(t,e,r){if(t===3&&r){let n=new er(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function An(t,e){var r,n;let i=p1(e),o=(e==null||(r=e.gis)===null||r===void 0?void 0:r.format)||(e==null||(n=e.mvt)===null||n===void 0?void 0:n.shape)||e?.shape;switch(o){case"columnar-table":return{shape:"columnar-table",data:Lo(t,i)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:$l(t,i)};case"geojson":return $l(t,i);case"binary-geometry":return Lo(t,i);case"binary":return Lo(t,i);default:throw new Error(o||"undefined shape")}}function Lo(t,e){let[r,n]=d1(t,e),i=So(r,n);return i.byteLength=t.byteLength,i}function d1(t,e){let r=[],n={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength<=0)return[r,n];let i=new rr(new Ro.default(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach(s=>{let a=i.layers[s];if(a)for(let c=0;c<a.length;c++){let l=a.feature(c,n),u=g1(l,e,s);r.push(u)}}),[r,n]}function $l(t,e){if(t.byteLength<=0)return[];let r=[],n=new Ke(new Ro.default(t));return(Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach(o=>{let s=n.layers[o];if(s)for(let a=0;a<s.length;a++){let c=s.feature(a),l=m1(c,e,o);r.push(l)}}),r}function p1(t){var e;if(!(t!=null&&t.mvt))throw new Error("mvt options required");let r=((e=t.mvt)===null||e===void 0?void 0:e.coordinates)==="wgs84",{tileIndex:n}=t.mvt,i=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(r&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}function m1(t,e,r){let n=t.toGeoJSON(e.coordinates==="wgs84"?e.tileIndex:y1);return e.layerProperty&&(n.properties[e.layerProperty]=r),n}function g1(t,e,r){let n=t.toBinaryCoordinates(e.coordinates==="wgs84"?e.tileIndex:v1);return e.layerProperty&&n.properties&&(n.properties[e.layerProperty]=r),n}function y1(t,e){let{extent:r}=e;for(let n=0;n<t.length;n++){let i=t[n];i[0]/=r,i[1]/=r}}function v1(t,e){let{extent:r}=e;for(let n=0,i=t.length;n<i;++n)t[n]/=r}var x1=typeof __VERSION__<"u"?__VERSION__:"latest",Ln={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:x1,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}},_1={...Ln,parse:async(t,e)=>An(t,e),parseSync:An,binary:!0};function Ql(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Kl(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ql(Object(r),!0).forEach(function(n){b1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ql(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function b1(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jl(t,e){return T1(t)||S1(t,e)||M1(t,e)||w1()}function w1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
46
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M1(t,e){if(t){if(typeof t=="string")return tu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tu(t,e)}}function tu(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function S1(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function T1(t){if(Array.isArray(t))return t}var P1={Point:eu,MultiPoint:E1,LineString:ru,MultiLineString:O1,Polygon:nu,MultiPolygon:I1};function eu(t,e,r){var n=Jl(t,2),i=n[0],o=n[1],s=Jl(e,2),a=s[0],c=s[1],l=It(a[0],c[0],i),u=It(a[1],c[1],o);return r.unprojectFlat([l,u])}function Fo(t,e,r){return t.map(function(n){return eu(n,e,r)})}function E1(t,e,r){return Fo(t,e,r)}function ru(t,e,r){return Fo(t,e,r)}function O1(t,e,r){return t.map(function(n){return ru(n,e,r)})}function nu(t,e,r){return t.map(function(n){return Fo(n,e,r)})}function I1(t,e,r){return t.map(function(n){return nu(n,e,r)})}function iu(t,e,r){var n=r.projectFlat([e.west,e.north]),i=r.projectFlat([e.east,e.south]),o=[n,i];return Kl(Kl({},t),{},{coordinates:P1[t.type](t.coordinates,o,r)})}function A1(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=L1(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
47
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function L1(t,e){if(t){if(typeof t=="string")return ou(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ou(t,e)}}function ou(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var R1=["points","lines","polygons"];function No(t,e,r,n){var i=A1(R1),o;try{for(i.s();!(o=i.n()).done;){var s=o.value,a=t[s]&&F1(t[s],e,r,n);if(a>=0)return a}}catch(c){i.e(c)}finally{i.f()}return-1}function F1(t,e,r,n){var i=t.featureIds.value;if(!i.length)return-1;var o=0,s=i[i.length-1]+1;if(n){var a=N1(t,n);if(a)o=a[0],s=a[1]+1;else return-1}var c=-1;if(e in t.numericProps){var l=t.numericProps[e].value.findIndex(function(u,f){return u===r&&i[f]>=o&&i[f]<s});return l>=0?t.globalFeatureIds.value[l]:-1}else e?c=su(t.properties,function(u){return u[e]===r},o,s):t.fields&&(c=su(t.fields,function(u){return u.id===r},o,s));return c>=0?C1(t,c):-1}function N1(t,e){if(!t.__layers){for(var r={},n=t.properties,i=0;i<n.length;i++){var o=n[i],s=o.layerName;s&&(r[s]?r[s][1]=i:r[s]=[i,i])}t.__layers=r}return t.__layers[e]}function C1(t,e){if(!t.__ids){for(var r=[],n=t.featureIds.value,i=t.globalFeatureIds.value,o=0;o<n.length;o++)r[n[o]]=i[o];t.__ids=r}return t.__ids[e]}function su(t,e,r,n){for(var i=r;i<n;i++)if(e(t[i],i))return i;return-1}function Rn(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rn=function(r){return typeof r}:Rn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Rn(t)}function z1(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=du(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
48
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function B1(t){return U1(t)||q1(t)||du(t)||k1()}function k1(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
49
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function du(t,e){if(t){if(typeof t=="string")return Bo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bo(t,e)}}function q1(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function U1(t){if(Array.isArray(t))return Bo(t)}function Bo(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function au(t,e,r,n,i,o,s){try{var a=t[o](s),c=a.value}catch(l){r(l);return}a.done?e(c):Promise.resolve(c).then(n,i)}function j1(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(c){au(o,n,i,s,a,"next",c)}function a(c){au(o,n,i,s,a,"throw",c)}s(void 0)})}}function V1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function W1(t,e,r){return e&&cu(t.prototype,e),r&&cu(t,r),t}function vt(t,e,r){return typeof Reflect<"u"&&Reflect.get?vt=Reflect.get:vt=function(i,o,s){var a=D1(i,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(s):c.value}},vt(t,e,r||t)}function D1(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=ot(t),t!==null););return t}function G1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ko(t,e)}function ko(t,e){return ko=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ko(t,e)}function Z1(t){var e=H1();return function(){var n=ot(t),i;if(e){var o=ot(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return X1(this,i)}}function X1(t,e){if(e&&(Rn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Y1(t)}function Y1(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function H1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ot(t){return ot=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ot(t)}function lu(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function kt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?lu(Object(r),!0).forEach(function(n){$1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lu(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $1(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Co=512,Q1=kt(kt({},qo.GeoJsonLayer.defaultProps),{},{data:Ct,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[Ln],binary:!0}),Nn=function(t){G1(r,t);var e=Z1(r);function r(){var i;V1(this,r);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=e.call.apply(e,[this].concat(s)),i.state=void 0,i}var n=r.prototype;return n.initializeState=function(){vt(ot(r.prototype),"initializeState",this).call(this);var o=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:o,data:null,tileJSON:null})},n.updateState=function(o){var s,a=o.props,c=o.oldProps,l=o.context,u=o.changeFlags;u.dataChanged&&this._updateTileData(),(s=this.state)!==null&&s!==void 0&&s.data&&(vt(ot(r.prototype),"updateState",this).call(this,{props:a,oldProps:c,context:l,changeFlags:u}),this._setWGS84PropertyForTiles());var f=a.highlightColor;f!==c.highlightColor&&Array.isArray(f)&&this.setState({highlightColor:f})},n._updateTileData=function(){var i=j1(regeneratorRuntime.mark(function s(){var a,c,l,u,f;return regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(a=this.props.data,c=null,!(typeof a=="string"&&!no(a))){d.next=18;break}return l=this.props,u=l.onDataLoad,f=l.fetch,this.setState({data:null,tileJSON:null}),d.prev=5,d.next=8,f(a,{propName:"data",layer:this,loaders:[]});case 8:c=d.sent,d.next=15;break;case 11:d.prev=11,d.t0=d.catch(5),this.raiseError(d.t0,"loading TileJSON"),a=null;case 15:u&&u(c,{propName:"data",layer:this}),d.next=19;break;case 18:a.tilejson&&(c=a);case 19:c&&(a=c.tiles),this.setState({data:a,tileJSON:c});case 21:case"end":return d.stop()}},s,this,[[5,11]])}));function o(){return i.apply(this,arguments)}return o}(),n._getTilesetOptions=function(){var o=vt(ot(r.prototype),"_getTilesetOptions",this).call(this),s=this.state.tileJSON,a=this.props,c=a.minZoom,l=a.maxZoom;return s&&(Number.isFinite(s.minzoom)&&s.minzoom>c&&(o.minZoom=s.minzoom),Number.isFinite(s.maxzoom)&&(!Number.isFinite(l)||s.maxzoom<l)&&(o.maxZoom=s.maxzoom)),o},n.renderLayers=function(){var o;return(o=this.state)!==null&&o!==void 0&&o.data?vt(ot(r.prototype),"renderLayers",this).call(this):null},n.getTileData=function(o){var s,a=this.state,c=a.data,l=a.binary,u=o.index,f=o.signal,h=yt(c,o);if(!h)return Promise.reject("Invalid URL");var d=this.getLoadOptions(),p=this.props.fetch;return d=kt(kt({},d),{},{mimeType:"application/x-protobuf",mvt:kt(kt({},(s=d)===null||s===void 0?void 0:s.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:u}),gis:l?{format:"binary"}:{}}),p(h,{propName:"data",layer:this,loadOptions:d,signal:f})},n.renderSubLayers=function(o){var s=o.tile.index,a=s.x,c=s.y,l=s.z,u=Math.pow(2,l),f=Co/u,h=-f,d=Co*a/u,p=Co*(1-c/u),g=new et().scale([f,h,1]);o.autoHighlight=!1,this.context.viewport.resolution||(o.modelMatrix=g,o.coordinateOrigin=[d,p,0],o.coordinateSystem=Fn.COORDINATE_SYSTEM.CARTESIAN,o.extensions=[].concat(B1(o.extensions||[]),[new pu.ClipExtension]));var m=vt(ot(r.prototype),"renderSubLayers",this).call(this,o);return this.state.binary&&!(m instanceof qo.GeoJsonLayer)&&Fn.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),m},n._updateAutoHighlight=function(o){var s=this.props.uniqueIdProperty,a=this.state,c=a.hoveredFeatureId,l=a.hoveredFeatureLayerName,u=o.object,f,h;u&&(f=zo(u,s),h=uu(u));var d=this.props.highlightColor;typeof d=="function"&&(d=d(o)),(c!==f||l!==h)&&this.setState({highlightColor:d,hoveredFeatureId:f,hoveredFeatureLayerName:h})},n.getPickingInfo=function(o){var s=vt(ot(r.prototype),"getPickingInfo",this).call(this,o),a=Boolean(this.context.viewport.resolution);if(this.state.binary&&s.index!==-1){var c=o.sourceLayer.props.data;s.object=Pn(c,{globalFeatureId:s.index})}return s.object&&!a&&(s.object=hu(s.object,s.tile.bbox,this.context.viewport)),s},n.getSubLayerPropsByTile=function(o){return{highlightedObjectIndex:this.getHighlightedObjectIndex(o),highlightColor:this.state.highlightColor}},n.getHighlightedObjectIndex=function(o){var s=this.state,a=s.hoveredFeatureId,c=s.hoveredFeatureLayerName,l=s.binary,u=this.props,f=u.uniqueIdProperty,h=u.highlightedFeatureId,d=o.content,p=fu(h),g=fu(a)||p;if(!g)return-1;var m=p?h:a;return Array.isArray(d)?d.findIndex(function(v){var w=zo(v,f)===m,x=p||uu(v)===c;return w&&x}):d&&l?No(d,f,m,p?"":c):-1},n._pickObjects=function(o){var s=this.context,a=s.deck,c=s.viewport,l=c.width,u=c.height,f=c.x,h=c.y,d=[this.id];return a.pickObjects({x:f,y:h,width:l,height:u,layerIds:d,maxObjects:o})},n.getRenderedFeatures=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,s=this._pickObjects(o),a=new Set,c=[],l=z1(s),u;try{for(l.s();!(u=l.n()).done;){var f=u.value,h=zo(f.object,this.props.uniqueIdProperty);h===void 0?c.push(f.object):a.has(h)||(a.add(h),c.push(f.object))}}catch(d){l.e(d)}finally{l.f()}return c},n._setWGS84PropertyForTiles=function(){var o=this,s="dataInWGS84",a=this.state.tileset;a.selectedTiles.forEach(function(c){c.hasOwnProperty(s)||Object.defineProperty(c,s,{get:function(){if(!c.content)return null;if(o.state.binary&&Array.isArray(c.content)&&!c.content.length)return[];var u=c.bbox;if(c._contentWGS84===void 0&&io(u)){var f=o.state.binary?Pn(c.content):c.content;c._contentWGS84=f.map(function(h){return hu(h,u,o.context.viewport)})}return c._contentWGS84}})})},W1(r,[{key:"isLoaded",get:function(){return Boolean(this.state&&this.state.data&&this.state.tileset&&vt(ot(r.prototype),"isLoaded",this))}}]),r}(Tt);Nn.layerName="MVTLayer";Nn.defaultProps=Q1;function zo(t,e){if(t.properties&&e)return t.properties[e];if("id"in t)return t.id}function uu(t){var e;return((e=t.properties)===null||e===void 0?void 0:e.layerName)||null}function fu(t){return t!=null&&t!==""}function hu(t,e,r){var n=kt(kt({},t),{},{geometry:{type:t.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){var o=iu(t.geometry,e,r);return o.coordinates}}),n}function K1(t,e){return rv(t)||ev(t,e)||tv(t,e)||J1()}function J1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
50
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tv(t,e){if(t){if(typeof t=="string")return mu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mu(t,e)}}function mu(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ev(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,s,a;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(c){o=!0,a=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw a}}return n}}function rv(t){if(Array.isArray(t))return t}var gu="0123456789bcdefghjkmnpqrstuvwxyz",yu={};for(nr=0;nr<gu.length;nr++)yu[gu.charAt(nr)]=nr;var nr,nv=-90,iv=90,ov=-180,sv=180;function av(t){for(var e=!0,r=iv,n=nv,i=sv,o=ov,s,a=0,c=0,l=t.length;c<l;c++){var u=t[c].toLowerCase();a=yu[u];for(var f=4;f>=0;f--){var h=a>>f&1;e?(s=(i+o)/2,h===1?o=s:i=s):(s=(r+n)/2,h===1?n=s:r=s),e=!e}}return[n,o,r,i]}function vu(t){var e=av(t),r=K1(e,4),n=r[0],i=r[1],o=r[2],s=r[3];return[s,o,s,n,i,n,i,o,s,o]}function Cn(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Cn=function(r){return typeof r}:Cn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Cn(t)}function cv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Uo(t,e)}function Uo(t,e){return Uo=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Uo(t,e)}function uv(t){var e=dv();return function(){var n=zn(t),i;if(e){var o=zn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return fv(this,i)}}function fv(t,e){if(e&&(Cn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hv(t)}function hv(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dv(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zn(t){return zn=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},zn(t)}var pv={getGeohash:{type:"accessor",value:function(e){return e.geohash}}},Bn=function(t){lv(r,t);var e=uv(r);function r(){return cv(this,r),e.apply(this,arguments)}var n=r.prototype;return n.indexToBounds=function(){var o=this.props,s=o.data,a=o.getGeohash;return{data:s,_normalize:!1,positionFormat:"XY",getPolygon:function(l,u){return vu(a(l,u))}}},r}(nt);Bn.layerName="GeohashLayer";Bn.defaultProps=pv;return Su(ir);})();
249
51
  return __exports__;
250
52
  });