@deck.gl/geo-layers 8.9.0-alpha.5 → 8.9.0-beta.1

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 (134) hide show
  1. package/dist/dist.dev.js +25759 -66604
  2. package/dist/es5/h3-layers/h3-cluster-layer.js +2 -2
  3. package/dist/es5/h3-layers/h3-cluster-layer.js.map +1 -1
  4. package/dist/es5/index.js +4 -8
  5. package/dist/es5/index.js.map +1 -1
  6. package/dist/es5/mesh-layer/mesh-layer-fragment.glsl.js +1 -1
  7. package/dist/es5/mesh-layer/mesh-layer-vertex.glsl.js +1 -1
  8. package/dist/es5/mvt-layer/coordinate-transform.js.map +1 -1
  9. package/dist/es5/mvt-layer/mvt-layer.js +9 -9
  10. package/dist/es5/mvt-layer/mvt-layer.js.map +1 -1
  11. package/dist/es5/terrain-layer/terrain-layer.js +5 -5
  12. package/dist/es5/terrain-layer/terrain-layer.js.map +1 -1
  13. package/dist/es5/tile-3d-layer/tile-3d-layer.js.map +1 -1
  14. package/dist/es5/tile-layer/tile-layer.js +9 -13
  15. package/dist/es5/tile-layer/tile-layer.js.map +1 -1
  16. package/dist/es5/tileset-2d/index.js +66 -0
  17. package/dist/es5/tileset-2d/index.js.map +1 -0
  18. package/dist/es5/tileset-2d/memoize.js +47 -0
  19. package/dist/es5/tileset-2d/memoize.js.map +1 -0
  20. package/dist/es5/{tile-layer → tileset-2d}/tile-2d-header.js +3 -5
  21. package/dist/es5/tileset-2d/tile-2d-header.js.map +1 -0
  22. package/dist/es5/{tile-layer → tileset-2d}/tile-2d-traversal.js +0 -0
  23. package/dist/es5/tileset-2d/tile-2d-traversal.js.map +1 -0
  24. package/dist/es5/{tile-layer → tileset-2d}/tileset-2d.js +166 -121
  25. package/dist/es5/tileset-2d/tileset-2d.js.map +1 -0
  26. package/dist/es5/{tile-layer → tileset-2d}/types.js +0 -0
  27. package/dist/es5/{tile-layer → tileset-2d}/types.js.map +0 -0
  28. package/dist/es5/{tile-layer → tileset-2d}/utils.js +15 -16
  29. package/dist/es5/tileset-2d/utils.js.map +1 -0
  30. package/dist/esm/h3-layers/h3-cluster-layer.js +1 -1
  31. package/dist/esm/h3-layers/h3-cluster-layer.js.map +1 -1
  32. package/dist/esm/index.js +3 -3
  33. package/dist/esm/index.js.map +1 -1
  34. package/dist/esm/mesh-layer/mesh-layer-fragment.glsl.js +1 -1
  35. package/dist/esm/mesh-layer/mesh-layer-vertex.glsl.js +1 -1
  36. package/dist/esm/mvt-layer/coordinate-transform.js.map +1 -1
  37. package/dist/esm/mvt-layer/mvt-layer.js +3 -3
  38. package/dist/esm/mvt-layer/mvt-layer.js.map +1 -1
  39. package/dist/esm/terrain-layer/terrain-layer.js +1 -1
  40. package/dist/esm/terrain-layer/terrain-layer.js.map +1 -1
  41. package/dist/esm/tile-3d-layer/tile-3d-layer.js.map +1 -1
  42. package/dist/esm/tile-layer/tile-layer.js +6 -3
  43. package/dist/esm/tile-layer/tile-layer.js.map +1 -1
  44. package/dist/esm/tileset-2d/index.js +4 -0
  45. package/dist/esm/tileset-2d/index.js.map +1 -0
  46. package/dist/esm/tileset-2d/memoize.js +40 -0
  47. package/dist/esm/tileset-2d/memoize.js.map +1 -0
  48. package/dist/esm/{tile-layer → tileset-2d}/tile-2d-header.js +2 -3
  49. package/dist/esm/tileset-2d/tile-2d-header.js.map +1 -0
  50. package/dist/esm/{tile-layer → tileset-2d}/tile-2d-traversal.js +0 -0
  51. package/dist/esm/tileset-2d/tile-2d-traversal.js.map +1 -0
  52. package/dist/esm/{tile-layer → tileset-2d}/tileset-2d.js +48 -16
  53. package/dist/esm/tileset-2d/tileset-2d.js.map +1 -0
  54. package/dist/esm/{tile-layer → tileset-2d}/types.js +0 -0
  55. package/dist/esm/{tile-layer → tileset-2d}/types.js.map +0 -0
  56. package/dist/esm/{tile-layer → tileset-2d}/utils.js +14 -18
  57. package/dist/esm/tileset-2d/utils.js.map +1 -0
  58. package/dist.min.js +187 -6
  59. package/package.json +11 -11
  60. package/src/h3-layers/h3-cluster-layer.ts +1 -1
  61. package/src/index.ts +9 -5
  62. package/src/mvt-layer/coordinate-transform.ts +1 -1
  63. package/src/mvt-layer/mvt-layer.ts +14 -7
  64. package/src/terrain-layer/terrain-layer.ts +2 -3
  65. package/src/tile-3d-layer/tile-3d-layer.ts +3 -0
  66. package/src/tile-layer/tile-layer.ts +13 -6
  67. package/src/tileset-2d/index.ts +24 -0
  68. package/src/tileset-2d/memoize.ts +45 -0
  69. package/src/{tile-layer → tileset-2d}/tile-2d-header.ts +4 -4
  70. package/src/{tile-layer → tileset-2d}/tile-2d-traversal.ts +3 -1
  71. package/src/{tile-layer → tileset-2d}/tileset-2d.ts +91 -39
  72. package/src/{tile-layer → tileset-2d}/types.ts +0 -0
  73. package/src/{tile-layer → tileset-2d}/utils.ts +20 -8
  74. package/typed/geo-cell-layer/GeoCellLayer.js +49 -0
  75. package/typed/great-circle-layer/great-circle-layer.js +29 -0
  76. package/typed/h3-layers/h3-cluster-layer.js +33 -0
  77. package/typed/h3-layers/h3-hexagon-layer.js +251 -0
  78. package/typed/index.d.ts +5 -5
  79. package/typed/index.d.ts.map +1 -1
  80. package/typed/index.js +33 -0
  81. package/typed/mesh-layer/mesh-layer-fragment.glsl.js +55 -0
  82. package/typed/mesh-layer/mesh-layer-vertex.glsl.js +80 -0
  83. package/typed/mesh-layer/mesh-layer.js +110 -0
  84. package/typed/mvt-layer/coordinate-transform.d.ts +1 -1
  85. package/typed/mvt-layer/coordinate-transform.d.ts.map +1 -1
  86. package/typed/mvt-layer/coordinate-transform.js +41 -0
  87. package/typed/mvt-layer/find-index-binary.js +96 -0
  88. package/typed/mvt-layer/mvt-layer.d.ts +2 -3
  89. package/typed/mvt-layer/mvt-layer.d.ts.map +1 -1
  90. package/typed/mvt-layer/mvt-layer.js +297 -0
  91. package/typed/quadkey-layer/quadkey-layer.js +18 -0
  92. package/typed/quadkey-layer/quadkey-utils.js +26 -0
  93. package/typed/s2-layer/s2-geometry.js +123 -0
  94. package/typed/s2-layer/s2-layer.js +37 -0
  95. package/typed/s2-layer/s2-utils.js +88 -0
  96. package/typed/terrain-layer/terrain-layer.d.ts +2 -2
  97. package/typed/terrain-layer/terrain-layer.d.ts.map +1 -1
  98. package/typed/terrain-layer/terrain-layer.js +226 -0
  99. package/typed/tile-3d-layer/tile-3d-layer.d.ts.map +1 -1
  100. package/typed/tile-3d-layer/tile-3d-layer.js +294 -0
  101. package/typed/tile-layer/tile-2d-header.js +113 -0
  102. package/typed/tile-layer/tile-2d-traversal.js +181 -0
  103. package/typed/tile-layer/tile-layer.d.ts +3 -4
  104. package/typed/tile-layer/tile-layer.d.ts.map +1 -1
  105. package/typed/tile-layer/tile-layer.js +192 -0
  106. package/typed/tile-layer/tileset-2d.d.ts.map +1 -1
  107. package/typed/tile-layer/tileset-2d.js +399 -0
  108. package/typed/tile-layer/types.js +1 -0
  109. package/typed/tile-layer/utils.d.ts +1 -1
  110. package/typed/tile-layer/utils.d.ts.map +1 -1
  111. package/typed/tile-layer/utils.js +197 -0
  112. package/typed/tileset-2d/index.d.ts +6 -0
  113. package/typed/tileset-2d/index.d.ts.map +1 -0
  114. package/typed/tileset-2d/memoize.d.ts +7 -0
  115. package/typed/tileset-2d/memoize.d.ts.map +1 -0
  116. package/typed/tileset-2d/tile-2d-header.d.ts +39 -0
  117. package/typed/tileset-2d/tile-2d-header.d.ts.map +1 -0
  118. package/typed/tileset-2d/tile-2d-traversal.d.ts +4 -0
  119. package/typed/tileset-2d/tile-2d-traversal.d.ts.map +1 -0
  120. package/typed/tileset-2d/tileset-2d.d.ts +121 -0
  121. package/typed/tileset-2d/tileset-2d.d.ts.map +1 -0
  122. package/typed/tileset-2d/types.d.ts +30 -0
  123. package/typed/tileset-2d/types.d.ts.map +1 -0
  124. package/typed/tileset-2d/utils.d.ts +51 -0
  125. package/typed/tileset-2d/utils.d.ts.map +1 -0
  126. package/typed/trips-layer/trips-layer.js +92 -0
  127. package/dist/es5/tile-layer/tile-2d-header.js.map +0 -1
  128. package/dist/es5/tile-layer/tile-2d-traversal.js.map +0 -1
  129. package/dist/es5/tile-layer/tileset-2d.js.map +0 -1
  130. package/dist/es5/tile-layer/utils.js.map +0 -1
  131. package/dist/esm/tile-layer/tile-2d-header.js.map +0 -1
  132. package/dist/esm/tile-layer/tile-2d-traversal.js.map +0 -1
  133. package/dist/esm/tile-layer/tileset-2d.js.map +0 -1
  134. package/dist/esm/tile-layer/utils.js.map +0 -1
package/dist.min.js CHANGED
@@ -1,6 +1,187 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("deck"),require("h3"),require("luma")):"function"==typeof define&&define.amd?define(["deck","h3","luma"],t):"object"==typeof exports?exports.deck=t(require("deck"),require("h3"),require("luma")):e.deck=t(e.deck,e.h3,e.luma)}(window,(function(e,t,r){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=59)}([function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t,r){e.exports=r(87)},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function r(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)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},function(e,t){function r(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(t)}e.exports=r},function(e,t,r){var n=r(46);e.exports=function(e,t){if("function"!=typeof t&&null!==t)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&&n(e,t)}},function(e,t,r){var n=r(69),i=r(70),a=r(71);e.exports=function(e,t){return n(e)||i(e,t)||a()}},function(e,t,r){var n=r(78),i=r(79),a=r(80);e.exports=function(e){return n(e)||i(e)||a()}},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(t,r){t.exports=e},function(e,t,r){var n=r(9),i=r(12);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?i(e):t}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},,function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(88);function i(t,r,a){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=i=Reflect.get:e.exports=i=function(e,t,r){var i=n(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(r):a.value}},i(t,r,a||t)}e.exports=i},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(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)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(81);e.exports=function(e,t){if("function"!=typeof t&&null!==t)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&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(38).default,i=r(82);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(75),i=r(76),a=r(48),o=r(77);e.exports=function(e,t){return n(e)||i(e,t)||a(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(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)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,r){e.exports=t},,function(e,t,r){var n=r(83),i=r(84),a=r(85),o=r(86);e.exports=function(e){return n(e)||i(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n,i,a;
2
- /**
3
- * @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
4
- * Released under the Apache License, Version 2.0
5
- * see: https://github.com/dcodeIO/long.js for details
6
- */i=[],void 0===(a="function"==typeof(n=function(){"use strict";function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var r={},n={};function i(e,t){var i,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=n[e])?a:(i=o(e,(0|e)<0?-1:0,!0),s&&(n[e]=i),i):(s=-128<=(e|=0)&&e<128)&&(a=r[e])?a:(i=o(e,e<0?-1:0,!1),s&&(r[e]=i),i)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?v:p;if(t){if(e<0)return v;if(e>=f)return A}else{if(e<=-h)return B;if(e+1>=h)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,r,n){return new e(t,r,n)}e.fromInt=i,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return p;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return u(e.substring(1),t,r).neg();for(var i=a(s(r,8)),o=p,c=0;c<e.length;c+=8){var l=Math.min(8,e.length-c),f=parseInt(e.substring(c,c+l),r);if(l<8){var h=a(s(r,l));o=o.mul(h).add(a(f))}else o=(o=o.mul(i)).add(a(f))}return o.unsigned=t,o}function c(t){return t instanceof e?t:"number"==typeof t?a(t):"string"==typeof t?u(t):o(t.low,t.high,t.unsigned)}e.fromString=u,e.fromValue=c;var l=4294967296,f=l*l,h=f/2,d=i(1<<24),p=i(0);e.ZERO=p;var v=i(0,!0);e.UZERO=v;var y=i(1);e.ONE=y;var g=i(1,!0);e.UONE=g;var m=i(-1);e.NEG_ONE=m;var b=o(-1,2147483647,!1);e.MAX_VALUE=b;var A=o(-1,-1,!0);e.MAX_UNSIGNED_VALUE=A;var B=o(0,-2147483648,!1);e.MIN_VALUE=B;var w=e.prototype;return w.toInt=function(){return this.unsigned?this.low>>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(B)){var t=a(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=a(s(e,6),this.unsigned),o=this,u="";;){var c=o.div(i),l=(o.sub(c.mul(i)).toInt()>>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(B)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},w.isZero=function(){return 0===this.high&&0===this.low},w.isNegative=function(){return!this.unsigned&&this.high<0},w.isPositive=function(){return this.unsigned||this.high>=0},w.isOdd=function(){return 1==(1&this.low)},w.isEven=function(){return 0==(1&this.low)},w.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(B)?B:this.not().add(y)},w.neg=w.negate,w.add=function(e){t(e)||(e=c(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,f=0,h=0,d=0,p=0;return d+=(p+=a+(65535&e.low))>>>16,h+=(d+=i+l)>>>16,f+=(h+=n+u)>>>16,f+=r+s,o((d&=65535)<<16|(p&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},w.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return p;if(t(e)||(e=c(e)),e.isZero())return p;if(this.eq(B))return e.isOdd()?B:p;if(e.eq(B))return this.isOdd()?B:p;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.low,v=0,y=0,g=0,m=0;return g+=(m+=s*h)>>>16,y+=(g+=i*h)>>>16,g&=65535,y+=(g+=s*f)>>>16,v+=(y+=n*h)>>>16,y&=65535,v+=(y+=i*f)>>>16,y&=65535,v+=(y+=s*l)>>>16,v+=r*h+n*f+i*l+s*u,o((g&=65535)<<16|(m&=65535),(v&=65535)<<16|(y&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?v:p;var r,n,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return v;if(e.gt(this.shru(1)))return g;i=v}else{if(this.eq(B))return e.eq(y)||e.eq(m)?B:e.eq(B)?y:(r=this.shr(1).div(e).shl(1)).eq(p)?e.isNegative()?y:m:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(B))return this.unsigned?v:p;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=p}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(r),f=l.mul(e);f.isNegative()||f.gt(n);)f=(l=a(r-=u,this.unsigned)).mul(e);l.isZero()&&(l=y),i=i.add(l),n=n.sub(f)}return i},w.div=w.divide,w.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):o(0,this.low<<e-32,this.unsigned)},w.shl=w.shiftLeft,w.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var r=this.high;return e<32?o(this.low>>>e|r<<32-e,r>>>e,this.unsigned):o(32===e?r:r>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?n.apply(t,i):n)||(e.exports=a)},function(e,t,r){var n=r(51);e.exports=function(e){return new n(e)}},function(e,t){},,,function(e,t){e.exports=r},function(e,t,r){var n=r(96);e.exports=function(e){return function(){return new n(e.apply(this,arguments))}}},function(e,t){e.exports=function(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,r){var n=r(72),i=r(73),a=r(48),o=r(74);e.exports=function(e){return n(e)||i(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},,,function(e,t){},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t){},function(e,t,r){"use strict";e.exports=i;var n=r(97);function i(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function o(e){return e.type===i.Bytes?e.readVarint()+e.pos:e.pos+1}function s(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function u(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function c(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function l(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function f(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function h(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function d(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function p(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function v(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function y(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function g(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function m(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function b(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function A(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}i.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=7&n,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=m(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=A(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=m(this.buf,this.pos)+4294967296*m(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=m(this.buf,this.pos)+4294967296*A(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return s(e,n,t);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return s(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,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>=12&&a?function(e,t,r){return a.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){var n="",i=t;for(;i<r;){var a,o,s,u=e[i],c=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l>r)break;1===l?u<128&&(c=u):2===l?128==(192&(a=e[i+1]))&&(c=(31&u)<<6|63&a)<=127&&(c=null):3===l?(a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&((c=(15&u)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=l}return n}(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!==i.Bytes)return e.push(this.readVarint(t));var r=o(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==i.Bytes)return e.push(this.readSVarint());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==i.Bytes)return e.push(this.readBoolean());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==i.Bytes)return e.push(this.readFloat());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==i.Bytes)return e.push(this.readDouble());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==i.Bytes)return e.push(this.readFixed32());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed32());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==i.Bytes)return e.push(this.readFixed64());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed64());var t=o(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===i.Varint)for(;this.buf[this.pos++]>127;);else if(t===i.Bytes)this.pos=this.readVarint()+this.pos;else if(t===i.Fixed32)this.pos+=4;else{if(t!==i.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},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),b(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),b(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),b(this.buf,-1&e,this.pos),b(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),b(this.buf,-1&e,this.pos),b(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,n;e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}(r,0,t),function(e,t){var r=(7&e)<<4;if(t.buf[t.pos++]|=r|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,i,a=0;a<t.length;a++){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&u(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),n.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),n.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&&u(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,i.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,c,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,l,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,d,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,f,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,h,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,p,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,v,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,y,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,g,t)},writeBytesField:function(e,t){this.writeTag(e,i.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,i.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,i.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,i.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},,,,,function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(t,n)}e.exports=r},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(47);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){e.exports=function(e){this.wrapped=e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(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)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(89),i=r(90),a=r(91),o=r(93);e.exports=function(e,t){return n(e)||i(e,t)||a(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(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)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(46);function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function a(t,r,o){return i()?e.exports=a=Reflect.construct:e.exports=a=function(e,t,r){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return r&&n(a,r.prototype),a},a.apply(null,arguments)}e.exports=a},function(e,t,r){var n=r(98),i=globalThis.deck||{};if(!i.LineLayer)throw new Error("@deck.gl/layers is not found");e.exports=Object.assign(i,n)},,,,,,,,,,function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,r){var n=r(47);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(49);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(49);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function s(e,t,r,n){var i=t&&t.prototype instanceof l?t:l,a=Object.create(i.prototype),o=new w(n||[]);return a._invoke=function(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return x()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=b(o,r);if(s){if(s===c)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(e,r,o),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var c={};function l(){}function f(){}function h(){}var d={};d[i]=function(){return this};var p=Object.getPrototypeOf,v=p&&p(p(_([])));v&&v!==t&&r.call(v,i)&&(d=v);var y=h.prototype=l.prototype=Object.create(d);function g(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function m(e){var t;this._invoke=function(n,i){function a(){return new Promise((function(t,a){!function t(n,i,a,o){var s=u(e[n],e,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then((function(e){t("next",e,a,o)}),(function(e){t("throw",e,a,o)})):Promise.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return t("throw",e,a,o)}))}o(s.arg)}(n,i,t,a)}))}return t=t?t.then(a,a):a()}}function b(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,c;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function B(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function _(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:x}}function x(){return{value:void 0,done:!0}}return f.prototype=y.constructor=h,h.constructor=f,h[o]=f.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,o in e||(e[o]="GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},g(m.prototype),m.prototype[a]=function(){return this},e.AsyncIterator=m,e.async=function(t,r,n,i){var a=new m(s(t,r,n,i));return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(y),y[o]="Generator",y[i]=function(){return this},y.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=_,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(B),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),B(r),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;B(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:_(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){var n=r(5);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(92);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){},function(e,t,r){var n=r(51);function i(e){var t,r;function i(t,r){try{var o=e[t](r),s=o.value,u=s instanceof n;Promise.resolve(u?s.wrapped:s).then((function(e){u?i("return"===t?"return":"next",e):a(o.done?"return":"normal",e)}),(function(e){i("throw",e)}))}catch(e){a("throw",e)}}function a(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise((function(a,o){var s={key:e,arg:n,resolve:a,reject:o,next:null};r?r=r.next=s:(t=r=s,i(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},e.exports=i},function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*v}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"filename",(function(){return Ol})),r.d(n,"dirname",(function(){return El})),r.d(n,"join",(function(){return Tl}));var i={};r.r(i),r.d(i,"name",(function(){return rg})),r.d(i,"decode",(function(){return ng}));var a={};r.r(a),r.d(a,"name",(function(){return hg})),r.d(a,"preprocess",(function(){return dg}));var o={};r.r(o),r.d(o,"name",(function(){return yg})),r.d(o,"preprocess",(function(){return gg}));var s={};r.r(s),r.d(s,"name",(function(){return Cg})),r.d(s,"preprocess",(function(){return Og})),r.d(s,"decode",(function(){return Eg})),r.d(s,"encode",(function(){return Sg}));var u={};r.r(u),r.d(u,"name",(function(){return Lg})),r.d(u,"decode",(function(){return jg})),r.d(u,"encode",(function(){return Ug}));var c={};r.r(c),r.d(c,"name",(function(){return Vg})),r.d(c,"decode",(function(){return zg})),r.d(c,"encode",(function(){return qg}));var l={};r.r(l),r.d(l,"name",(function(){return Wg})),r.d(l,"decode",(function(){return Zg})),r.d(l,"encode",(function(){return $g}));var f=r(2),h=r.n(f),d=r(6),p=r.n(d),v=r(11),y=r.n(v),g=r(5),m=r.n(g),b=r(0),A=r.n(b),B=r(10);function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var _=function(e){p()(r,e);var t=w(r);function r(){return h()(this,r),t.apply(this,arguments)}return r}(B.ArcLayer);A()(_,"layerName","GreatCircleLayer"),A()(_,"defaultProps",{getHeight:{type:"accessor",value:0},greatCircle:!0});var x=r(3),C=r.n(x);function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var T=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},B.PolygonLayer.defaultProps),S=function(e){p()(r,e);var t=O(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){return null}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,r=e.extruded,n=e.wireframe,i=e.filled,a=e.stroked,o=e.lineWidthUnits,s=e.lineWidthScale,u=e.lineWidthMinPixels,c=e.lineWidthMaxPixels,l=e.lineJointRounded,f=e.lineMiterLimit,h=e.lineDashJustified,d=e.getElevation,p=e.getFillColor,v=e.getLineColor,y=e.getLineWidth,g=this.props,m=g.updateTriggers,b=g.material,A=g.transitions;return new(this.getSubLayerClass("cell",B.PolygonLayer))({filled:i,wireframe:n,extruded:r,elevationScale:t,stroked:a,lineWidthUnits:o,lineWidthScale:s,lineWidthMinPixels:u,lineWidthMaxPixels:c,lineJointRounded:l,lineMiterLimit:f,lineDashJustified:h,material:b,transitions:A,getElevation:d,getFillColor:p,getLineColor:v,getLineWidth:y},this.getSubLayerProps({id:"cell",updateTriggers:m&&{getElevation:m.getElevation,getFillColor:m.getFillColor,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}),this.indexToBounds())}}]),r}(B.CompositeLayer);A()(S,"layerName","GeoCellLayer"),A()(S,"defaultProps",T);var k=r(7),M=r.n(k),I=r(26),R=r.n(I),P=180/Math.PI;function F(e,t,r){var n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function D(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function L(e){return[D(e[0]),D(e[1])]}function j(e,t){var r=M()(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 G(e,t,r,n){if(0===n){1===r&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);var i=t[0];t[0]=t[1],t[1]=i}}function U(e){if("string"==typeof e){if(e.indexOf("/")>0)return e;e=function(e){var t=e.padEnd(16,"0");return R.a.fromString(t,16)}(e)}return function(e){for(var t=R.a.fromString(e,!0,10).toString(2);t.length<64;)t="0"+t;for(var r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=R.a.fromString(n,!0,2).toString(10),s=R.a.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}(e.toString())}function N(e){return function(e){for(var t,r,n,i,a,o,s=e.face,u=e.ij,c=e.level,l=[[0,0],[0,1],[1,1],[1,0],[0,0]],f=Math.max(1,Math.ceil(100*Math.pow(2,-c))),h=new Float64Array(4*f*2+2),d=0,p=0,v=0;v<4;v++)for(var y=l[v].slice(0),g=l[v+1],m=(g[0]-y[0])/f,b=(g[1]-y[1])/f,A=0;A<f;A++){y[0]+=m,y[1]+=b;var B=j(s,L(F(u,c,y))),w=(t=B,r=void 0,n=void 0,i=void 0,a=void 0,o=void 0,r=M()(t,3),n=r[0],i=r[1],a=r[2],o=Math.atan2(a,Math.sqrt(n*n+i*i)),[Math.atan2(i,n)*P,o*P]);Math.abs(w[1])>89.999&&(w[0]=p);var _=w[0]-p;w[0]+=_>180?-360:_<-180?360:0,h[d++]=w[0],h[d++]=w[1],p=w[0]}return h[d++]=h[0],h[d++]=h[1],h}(function(e){for(var t,r=e.split("/"),n=parseInt(r[0],10),i=r[1],a=i.length,o=[0,0],s=a-1;s>=0;s--){t=a-s;var u=i[s],c=0,l=0;"1"===u?l=1:"2"===u?(c=1,l=1):"3"===u&&(c=1);var f=Math.pow(2,t-1);G(f,o,c,l),o[0]+=f*c,o[1]+=f*l}if(n%2==1){var h=o[0];o[0]=o[1],o[1]=h}return{face:n,ij:o,level:t}}(U(e)))}function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var J=function(e){p()(r,e);var t=H(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getS2Token;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return N(r(e,t))}}}}]),r}(S);A()(J,"layerName","S2Layer"),A()(J,"defaultProps",{getS2Token:{type:"accessor",value:function(e){return e.token}}});r(34);var V=r(20),z=r.n(V);r(52),r(53);var K=1e-6,q="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function X(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 Q(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.hypot(t,r,n,i)}function W(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function Z(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 Y(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*a-u*i,f=c*i+u*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-u*a;return e[0]=l*c+d*-o+f*-u-h*-s,e[1]=f*c+d*-s+h*-o-l*-u,e[2]=h*c+d*-u+l*-s-f*-o,e[3]=t[3],e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var $,ee;$=new q(4),q!=Float32Array&&($[0]=0,$[1]=0,$[2]=0,$[3]=0),ee=$;Math.log2;function te(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],p=t[12],v=t[13],y=t[14],g=t[15],m=r*s-n*o,b=r*u-i*o,A=r*c-a*o,B=n*u-i*s,w=n*c-a*s,_=i*c-a*u,x=l*v-f*p,C=l*y-h*p,O=l*g-d*p,E=f*y-h*v,T=f*g-d*v,S=h*g-d*y,k=m*S-b*T+A*E+B*O-w*C+_*x;return k?(k=1/k,e[0]=(s*S-u*T+c*E)*k,e[1]=(i*T-n*S-a*E)*k,e[2]=(v*_-y*w+g*B)*k,e[3]=(h*w-f*_-d*B)*k,e[4]=(u*O-o*S-c*C)*k,e[5]=(r*S-i*O+a*C)*k,e[6]=(y*A-p*_-g*b)*k,e[7]=(l*_-h*A+d*b)*k,e[8]=(o*T-s*O+c*x)*k,e[9]=(n*O-r*T-a*x)*k,e[10]=(p*w-v*A+g*m)*k,e[11]=(f*A-l*w-d*m)*k,e[12]=(s*C-o*E-u*x)*k,e[13]=(r*E-n*C+i*x)*k,e[14]=(v*b-p*B-y*m)*k,e[15]=(l*B-f*b+h*m)*k,e):null}function re(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],v=t[12],y=t[13],g=t[14],m=t[15],b=r[0],A=r[1],B=r[2],w=r[3];return e[0]=b*n+A*s+B*f+w*v,e[1]=b*i+A*u+B*h+w*y,e[2]=b*a+A*c+B*d+w*g,e[3]=b*o+A*l+B*p+w*m,b=r[4],A=r[5],B=r[6],w=r[7],e[4]=b*n+A*s+B*f+w*v,e[5]=b*i+A*u+B*h+w*y,e[6]=b*a+A*c+B*d+w*g,e[7]=b*o+A*l+B*p+w*m,b=r[8],A=r[9],B=r[10],w=r[11],e[8]=b*n+A*s+B*f+w*v,e[9]=b*i+A*u+B*h+w*y,e[10]=b*a+A*c+B*d+w*g,e[11]=b*o+A*l+B*p+w*m,b=r[12],A=r[13],B=r[14],w=r[15],e[12]=b*n+A*s+B*f+w*v,e[13]=b*i+A*u+B*h+w*y,e[14]=b*a+A*c+B*d+w*g,e[15]=b*o+A*l+B*p+w*m,e}function ne(e,t,r){var n,i,a,o,s,u,c,l,f,h,d,p,v=r[0],y=r[1],g=r[2];return t===e?(e[12]=t[0]*v+t[4]*y+t[8]*g+t[12],e[13]=t[1]*v+t[5]*y+t[9]*g+t[13],e[14]=t[2]*v+t[6]*y+t[10]*g+t[14],e[15]=t[3]*v+t[7]*y+t[11]*g+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],p=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=p,e[12]=n*v+s*y+f*g+t[12],e[13]=i*v+u*y+h*g+t[13],e[14]=a*v+c*y+d*g+t[14],e[15]=o*v+l*y+p*g+t[15]),e}function ie(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 ae(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+h*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=h*i-u*n,e}function oe(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+h*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=h*i-u*n,e}function se(e,t){var r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],c=t[9],l=t[10];return e[0]=Math.hypot(r,n,i),e[1]=Math.hypot(a,o,s),e[2]=Math.hypot(u,c,l),e}var ue=function(e,t,r,n,i){var a,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e};var ce=function(e,t,r,n,i,a,o){var s=1/(t-r),u=1/(n-i),c=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*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(o+a)*c,e[15]=1,e};function le(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 fe(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}!function(){var e=function(){var e=new q(2);return q!=Float32Array&&(e[0]=0,e[1]=0),e}()}();function he(){var e=new q(3);return q!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function de(e){var t=e[0],r=e[1],n=e[2];return Math.hypot(t,r,n)}function pe(e,t,r){var n=new q(3);return n[0]=e,n[1]=t,n[2]=r,n}function ve(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ye(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 ge(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 me(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 be(e,t,r){var n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,f=a*s-n*c,h=n*u-i*s,d=i*h-a*f,p=a*l-n*h,v=n*f-i*l,y=2*o;return l*=y,f*=y,h*=y,d*=2,p*=2,v*=2,e[0]=s+l+d,e[1]=u+f+p,e[2]=c+h+v,e}var Ae=de;!function(){var e=he()}();function Be(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var we=Math.PI,_e=we/4,xe=we/180,Ce=180/we;function Oe(e){var t=z()(e,2),r=t[0],n=t[1];Be(Number.isFinite(r)),Be(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var i=n*xe;return[512*(r*xe+we)/(2*we),512*(we+Math.log(Math.tan(_e+.5*i)))/(2*we)]}function Ee(e){var t=z()(e,2),r=t[0],n=t[1],i=r/512*(2*we)-we,a=2*(Math.atan(Math.exp(n/512*(2*we)-we))-_e);return[i*Ce,a*Ce]}Math.PI;r(54);function Te(e){var t=function(e){for(var t=0,r=0,n=1<<e.length,i=n/512,a=0;a<e.length;a++){n>>=1;var o=parseInt(e[a]);o%2&&(t|=n),o>1&&(r|=n)}return[[t/i,512-r/i],[(t+.99)/i,512-(r+.99)/i]]}(e),r=M()(t,2),n=r[0],i=r[1],a=Ee(n),o=M()(a,2),s=o[0],u=o[1],c=Ee(i),l=M()(c,2),f=l[0],h=l[1];return[f,u,f,h,s,h,s,u,f,u]}function Se(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var ke=function(e){p()(r,e);var t=Se(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getQuadkey;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return Te(r(e,t))}}}}]),r}(S);A()(ke,"layerName","QuadkeyLayer"),A()(ke,"defaultProps",{getQuadkey:{type:"accessor",value:function(e){return e.quadkey}}});var Me=r(4),Ie=r.n(Me),Re=r(1),Pe=r.n(Re),Fe=function(){function e(t){h()(this,e),A()(this,"index",void 0),A()(this,"isVisible",void 0),A()(this,"isSelected",void 0),A()(this,"parent",void 0),A()(this,"children",void 0),A()(this,"content",void 0),A()(this,"state",void 0),A()(this,"layers",void 0),A()(this,"id",void 0),A()(this,"bbox",void 0),A()(this,"zoom",void 0),A()(this,"userData",void 0),A()(this,"_abortController",void 0),A()(this,"_loader",void 0),A()(this,"_loaderId",void 0),A()(this,"_isLoaded",void 0),A()(this,"_isCancelled",void 0),A()(this,"_needsReload",void 0),this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}var t;return C()(e,[{key:"data",get:function(){var e=this;return this.isLoading&&this._loader?this._loader.then((function(){return e.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 e=this.content?this.content.byteLength:0;return Number.isFinite(e)||B.log.error("byteLength not defined in tile data")(),e}},{key:"_loadData",value:(t=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.getData,n=t.requestScheduler,i=t.onLoad,a=t.onError,o=this.index,s=this.id,u=this.bbox,c=this.userData,l=this.zoom,f=this._loaderId,this._abortController=new AbortController,h=this._abortController.signal,e.next=7,n.scheduleRequest(this,(function(e){return e.isSelected?1:-1}));case 7:if(d=e.sent){e.next=11;break}return this._isCancelled=!0,e.abrupt("return");case 11:if(!this._isCancelled){e.next=14;break}return d.done(),e.abrupt("return");case 14:return p=null,e.prev=15,e.next=18,r({index:o,id:s,bbox:u,userData:c,zoom:l,signal:h});case 18:p=e.sent,e.next=24;break;case 21:e.prev=21,e.t0=e.catch(15),v=e.t0||!0;case 24:return e.prev=24,d.done(),e.finish(24);case 27:if(f===this._loaderId){e.next=29;break}return e.abrupt("return");case 29:if(this._loader=void 0,this.content=p,!this._isCancelled||p){e.next=34;break}return this._isLoaded=!1,e.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,v?a(v,this):i(this);case 37:case"end":return e.stop()}}),e,this,[[15,21,24,27]])}))),function(e){return t.apply(this,arguments)})},{key:"loadData",value:function(e){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(e),this._loader}},{key:"setNeedsReload",value:function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}},{key:"abort",value:function(){var e;this.isLoaded||(this._isCancelled=!0,null===(e=this._abortController)||void 0===e||e.abort())}}]),e}(),De=r(8),Le=r.n(De),je=-1,Ge=0,Ue=1,Ne=r(21),He=r.n(Ne),Je=r(22),Ve=r.n(Je);function ze(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ke=r(16),qe=r.n(Ke),Xe=r(17),Qe=r.n(Xe),We=r(18),Ze=r.n(We),Ye=r(19),$e=r.n(Ye),et=r(14),tt=r.n(et);r(38);function rt(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var nt=1/Math.PI*180,it=1/180*Math.PI,at={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function ot(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.precision,n=void 0===r?at.precision:r;return e=pt(e),"".concat(parseFloat(e.toPrecision(n)))}function st(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ut(e){return function(e,t){return vt(e,(function(e){return e*it}),t)}(e)}function ct(e){return lt(e)}function lt(e,t){return vt(e,(function(e){return e*nt}),t)}function ft(e,t,r){return vt(e,(function(e){return Math.max(t,Math.min(r,e))}))}function ht(e,t,r){return st(e)?e.map((function(e,n){return ht(e,t[n],r)})):r*t+(1-r)*e}function dt(e,t,r){var n=at.EPSILON;r&&(at.EPSILON=r);try{if(e===t)return!0;if(st(e)&&st(t)){if(e.length!==t.length)return!1;for(var i=0;i<e.length;++i)if(!dt(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):"number"==typeof e&&"number"==typeof t&&Math.abs(e-t)<=at.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{at.EPSILON=n}}function pt(e){return Math.round(e/at.EPSILON)*at.EPSILON}function vt(e,t,r){if(st(e)){var n=e;r=r||function(e){return e.clone?e.clone():new Array(e.length)}(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 yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tt()(e);if(t){var i=tt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $e()(this,r)}}var gt=function(e){Ze()(r,e);var t=yt(r);function r(){return qe()(this,r),t.apply(this,arguments)}return Qe()(r,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)this[r]=e[r+t];return this.check()}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;r<this.ELEMENTS;++r)e[t+r]=this[r];return e}},{key:"from",value:function(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}},{key:"to",value:function(e){return e===this?this:st(e)?this.toArray(e):this.toObject(e)}},{key:"toTarget",value:function(e){return e?this.to(e):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(at)}},{key:"formatString",value:function(e){for(var t="",r=0;r<this.ELEMENTS;++r)t+=(r>0?", ":"")+ot(this[r],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"equals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(!dt(this[t],e[t]))return!1;return!0}},{key:"exactEquals",value:function(e){if(!e||this.length!==e.length)return!1;for(var t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}},{key:"negate",value:function(){for(var e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}},{key:"lerp",value:function(e,t,r){if(void 0===r)return this.lerp(this,e,t);for(var n=0;n<this.ELEMENTS;++n){var i=e[n];this[n]=i+r*(t[n]-i)}return this.check()}},{key:"min",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}},{key:"max",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}},{key:"clamp",value:function(e,t){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e[r]),t[r]);return this.check()}},{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]+=a[o];return this.check()}},{key:"subtract",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]-=a[o];return this.check()}},{key:"scale",value:function(e){if("number"==typeof e)for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;else for(var r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}},{key:"multiplyByScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"check",value:function(){if(at.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var e=this.length===this.ELEMENTS,t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}},{key:"addScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}},{key:"subScalar",value:function(e){return this.addScalar(-e)}},{key:"multiplyScalar",value:function(e){for(var t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}},{key:"divideScalar",value:function(e){return this.multiplyByScalar(1/e)}},{key:"clampScalar",value:function(e,t){for(var r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e),t);return this.check()}},{key:"elements",get:function(){return this}}]),r}(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}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}(Array));function mt(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 bt(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function At(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(at.debug&&!mt(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function Bt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tt()(e);if(t){var i=tt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $e()(this,r)}}var wt=function(e){Ze()(r,e);var t=Bt(r);function r(){return qe()(this,r),t.apply(this,arguments)}return Qe()(r,[{key:"x",get:function(){return this[0]},set:function(e){this[0]=bt(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=bt(e)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(e){return Math.sqrt(this.distanceSquared(e))}},{key:"distanceSquared",value:function(e){for(var t=0,r=0;r<this.ELEMENTS;++r){var n=this[r]-e[r];t+=n*n}return bt(t)}},{key:"dot",value:function(e){for(var t=0,r=0;r<this.ELEMENTS;++r)t+=this[r]*e[r];return bt(t)}},{key:"normalize",value:function(){var e=this.magnitude();if(0!==e)for(var t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}},{key:"multiply",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]*=a[o];return this.check()}},{key:"divide",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++)for(var a=i[n],o=0;o<this.ELEMENTS;++o)this[o]/=a[o];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(e){return this.distance(e)}},{key:"distanceToSquared",value:function(e){return this.distanceSquared(e)}},{key:"getComponent",value:function(e){return rt(e>=0&&e<this.ELEMENTS,"index is out of range"),bt(this[e])}},{key:"setComponent",value:function(e,t){return rt(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}},{key:"addVectors",value:function(e,t){return this.copy(e).add(t)}},{key:"subVectors",value:function(e,t){return this.copy(e).subtract(t)}},{key:"multiplyVectors",value:function(e,t){return this.copy(e).multiply(t)}},{key:"addScaledVector",value:function(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}]),r}(gt);function _t(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 xt(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 Ct(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 Ot(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tt()(e);if(t){var i=tt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $e()(this,r)}}var Et,Tt=[0,0,0],St=function(e){Ze()(r,e);var t=Ot(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return qe()(this,r),e=t.call(this,-0,-0,-0),1===arguments.length&&st(n)?e.copy(n):(at.debug&&(bt(n),bt(i),bt(a)),e[0]=n,e[1]=i,e[2]=a),e}return Qe()(r,[{key:"set",value:function(e,t,r){return this[0]=e,this[1]=t,this[2]=r,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}},{key:"fromObject",value:function(e){return at.debug&&(bt(e.x),bt(e.y),bt(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=bt(e)}},{key:"angle",value:function(e){return r=e,n=(t=this)[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=Math.sqrt(n*n+i*i+a*a)*Math.sqrt(o*o+s*s+u*u),l=c&&ve(t,r)/c,Math.acos(Math.min(Math.max(l,-1),1));var t,r,n,i,a,o,s,u,c,l}},{key:"cross",value:function(e){return ye(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];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]}(this,this,void 0===r?Tt:r,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];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]}(this,this,void 0===r?Tt:r,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,r=e.origin;return function(e,t,r,n){var i=[],a=[];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]}(this,this,void 0===r?Tt:r,t),this.check()}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return ge(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return xt(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return me(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return be(this,this,e),this.check()}}],[{key:"ZERO",get:function(){return Et||(Et=new r(0,0,0),Object.freeze(Et)),Et}}]),r}(wt),kt=new St,Mt=new St,It=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=arguments.length>2?arguments[2]:void 0;He()(this,e),ze(this,"center",void 0),ze(this,"halfDiagonal",void 0),ze(this,"minimum",void 0),ze(this,"maximum",void 0),n=n||kt.copy(t).add(r).scale(.5),this.center=new St(n),this.halfDiagonal=new St(r).subtract(this.center),this.minimum=new St(t),this.maximum=new St(r)}return Ve()(e,[{key:"clone",value:function(){return new e(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}},{key:"transform",value:function(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}},{key:"intersectPlane",value:function(e){var t=this.halfDiagonal,r=Mt.from(e.normal),n=t.x*Math.abs(r.x)+t.y*Math.abs(r.y)+t.z*Math.abs(r.z),i=this.center.dot(r)+e.distance;return i-n>0?Ue:i+n<0?je:Ge}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t,r=kt.from(e).subtract(this.center),n=this.halfDiagonal,i=0;return(t=Math.abs(r.x)-n.x)>0&&(i+=t*t),(t=Math.abs(r.y)-n.y)>0&&(i+=t*t),(t=Math.abs(r.z)-n.z)>0&&(i+=t*t),i}}]),e}(),Rt=new St,Pt=new St,Ft=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;He()(this,e),ze(this,"center",void 0),ze(this,"radius",void 0),this.radius=-0,this.center=new St,this.fromCenterRadius(t,r)}return Ve()(e,[{key:"fromCenterRadius",value:function(e,t){return this.center.from(e),this.radius=t,this}},{key:"fromCornerPoints",value:function(e,t){return t=Rt.from(t),this.center=(new St).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}},{key:"clone",value:function(){return new e(this.center,this.radius)}},{key:"union",value:function(e){var t=this.center,r=this.radius,n=e.center,i=e.radius,a=Rt.copy(n).subtract(t),o=a.magnitude();if(r>=o+i)return this.clone();if(i>=o+r)return e.clone();var s=.5*(r+o+i);return Pt.copy(a).scale((-r+s)/o).add(t),this.center.copy(Pt),this.radius=s,this}},{key:"expand",value:function(e){var t=Rt.from(e).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}},{key:"transform",value:function(e){this.center.transform(e);var t=se(Rt,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(e){var t=this.distanceTo(e);return t*t}},{key:"distanceTo",value:function(e){var t=Rt.from(e).subtract(this.center);return Math.max(0,t.len()-this.radius)}},{key:"intersectPlane",value:function(e){var t=this.center,r=this.radius,n=e.normal.dot(t)+e.distance;return n<-r?je:n<r?Ge:Ue}}]),e}(),Dt=r(25),Lt=r.n(Dt);function jt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tt()(e);if(t){var i=tt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $e()(this,r)}}var Gt=function(e){Ze()(r,e);var t=jt(r);function r(){return qe()(this,r),t.apply(this,arguments)}return Qe()(r,[{key:"toString",value:function(){var e="[";if(at.printRowMajor){e+="row-major:";for(var t=0;t<this.RANK;++t)for(var r=0;r<this.RANK;++r)e+=" ".concat(this[r*this.RANK+t])}else{e+="column-major:";for(var n=0;n<this.ELEMENTS;++n)e+=" ".concat(this[n])}return e+="]"}},{key:"getElementIndex",value:function(e,t){return t*this.RANK+e}},{key:"getElement",value:function(e,t){return this[t*this.RANK+e]}},{key:"setElement",value:function(e,t,r){return this[t*this.RANK+e]=bt(r),this}},{key:"getColumn",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),r=e*this.RANK,n=0;n<this.RANK;++n)t[n]=this[r+n];return t}},{key:"setColumn",value:function(e,t){for(var r=e*this.RANK,n=0;n<this.RANK;++n)this[r+n]=t[n];return this}}]),r}(gt);function Ut(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=r[0],d=r[1],p=r[2],v=r[3],y=r[4],g=r[5],m=r[6],b=r[7],A=r[8];return e[0]=h*n+d*o+p*c,e[1]=h*i+d*s+p*l,e[2]=h*a+d*u+p*f,e[3]=v*n+y*o+g*c,e[4]=v*i+y*s+g*l,e[5]=v*a+y*u+g*f,e[6]=m*n+b*o+A*c,e[7]=m*i+b*s+A*l,e[8]=m*a+b*u+A*f,e}function Nt(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}var Ht;function Jt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tt()(e);if(t){var i=tt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $e()(this,r)}}!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"}(Ht||(Ht={}));var Vt,zt,Kt,qt=Object.freeze([1,0,0,0,1,0,0,0,1]),Xt=function(e){Ze()(r,e);var t=Jt(r);function r(e){for(var n,i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return qe()(this,r),n=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?n.copy(e):a.length>0?n.copy([e].concat(a)):n.identity(),n}return Qe()(r,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Ht}},{key:"copy",value:function(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()}},{key:"identity",value:function(){return this.copy(qt)}},{key:"fromObject",value:function(e){return this.check()}},{key:"fromQuaternion",value:function(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,d=i*s,p=i*u,v=a*o,y=a*s,g=a*u;e[0]=1-f-p,e[3]=l-g,e[6]=h+y,e[1]=l+g,e[4]=1-c-p,e[7]=d-v,e[2]=h-y,e[5]=d+v,e[8]=1-c-f}(this,e),this.check()}},{key:"set",value:function(e,t,r,n,i,a,o,s,u){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this.check()}},{key:"setRowMajor",value:function(e,t,r,n,i,a,o,s,u){return this[0]=e,this[1]=n,this[2]=o,this[3]=t,this[4]=i,this[5]=s,this[6]=r,this[7]=a,this[8]=u,this.check()}},{key:"determinant",value:function(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],t*(c*a-o*u)+r*(-c*i+o*s)+n*(u*i-a*s);var e,t,r,n,i,a,o,s,u,c}},{key:"transpose",value:function(){return function(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]}(this,this),this.check()}},{key:"invert",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=l*o-s*c,h=-l*a+s*u,d=c*a-o*u,p=r*f+n*h+i*d;p&&(p=1/p,e[0]=f*p,e[1]=(-l*n+i*c)*p,e[2]=(s*n-i*o)*p,e[3]=h*p,e[4]=(l*r-i*u)*p,e[5]=(-s*r+i*a)*p,e[6]=d*p,e[7]=(-c*r+n*u)*p,e[8]=(o*r-n*a)*p)}(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return Ut(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return Ut(this,this,e),this.check()}},{key:"rotate",value:function(e){return function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=Math.sin(r),d=Math.cos(r);e[0]=d*n+h*o,e[1]=d*i+h*s,e[2]=d*a+h*u,e[3]=d*o-h*n,e[4]=d*s-h*i,e[5]=d*u-h*a,e[6]=c,e[7]=l,e[8]=f}(this,this,e),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?Nt(this,this,e):Nt(this,this,[e,e]),this.check()}},{key:"translate",value:function(e){return function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=r[0],d=r[1];e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=h*n+d*o+c,e[7]=h*i+d*s+l,e[8]=h*a+d*u+f}(this,this,e),this.check()}},{key:"transform",value:function(e,t){var r;switch(e.length){case 2:r=le(t||[-0,-0],e,this);break;case 3:r=me(t||[-0,-0,-0],e,this);break;case 4:r=Ct(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return At(r,e.length),r}},{key:"transformVector",value:function(e,t){return this.transform(e,t)}},{key:"transformVector2",value:function(e,t){return this.transform(e,t)}},{key:"transformVector3",value:function(e,t){return this.transform(e,t)}}],[{key:"IDENTITY",get:function(){return function(){zt||(zt=new Xt,Object.freeze(zt));return zt}()}},{key:"ZERO",get:function(){return function(){Vt||(Vt=new Xt([0,0,0,0,0,0,0,0,0]),Object.freeze(Vt));return Vt}()}}]),r}(Gt);function Qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tt()(e);if(t){var i=tt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $e()(this,r)}}var Wt=function(e){Ze()(r,e);var t=Qt(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return qe()(this,r),e=t.call(this,-0,-0,-0,-0),st(n)&&1===arguments.length?e.copy(n):(at.debug&&(bt(n),bt(i),bt(a),bt(o)),e[0]=n,e[1]=i,e[2]=a,e[3]=o),e}return Qe()(r,[{key:"set",value:function(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}},{key:"fromObject",value:function(e){return at.debug&&(bt(e.x),bt(e.y),bt(e.z),bt(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=bt(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=bt(e)}},{key:"transform",value:function(e){return ge(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return Ct(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e[3]=t[3]}(this,this,e),this.check()}},{key:"transformByQuaternion",value:function(e){return be(this,this,e),this.check()}},{key:"applyMatrix4",value:function(e){return e.transform(this,this),this}}],[{key:"ZERO",get:function(){return Kt||(Kt=new r(0,0,0,0),Object.freeze(Kt)),Kt}}]),r}(wt);function Zt(){var e=new q(4);return q!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Yt(e,t,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 $t(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],c=r[2],l=r[3];return e[0]=n*l+o*s+i*c-a*u,e[1]=i*l+o*u+a*s-n*c,e[2]=a*l+o*c+n*u-i*s,e[3]=o*l-n*s-i*u-a*c,e}function er(e,t,r,n){var i,a,o,s,u,c=t[0],l=t[1],f=t[2],h=t[3],d=r[0],p=r[1],v=r[2],y=r[3];return(a=c*d+l*p+f*v+h*y)<0&&(a=-a,d=-d,p=-p,v=-v,y=-y),1-a>K?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,u=Math.sin(n*i)/o):(s=1-n,u=n),e[0]=s*c+u*d,e[1]=s*l+u*p,e[2]=s*f+u*v,e[3]=s*h+u*y,e}function tr(e,t){var r,n=t[0]+t[4]+t[8];if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(t[3*i+i]-t[3*a+a]-t[3*o+o]+1),e[i]=.5*r,r=.5/r,e[3]=(t[3*a+o]-t[3*o+a])*r,e[a]=(t[3*a+i]+t[3*i+a])*r,e[o]=(t[3*o+i]+t[3*i+o])*r}return e}var rr,nr,ir,ar,or,sr,ur=function(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},cr=X,lr=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},fr=function(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},hr=Q,dr=W,pr=function(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},vr=(rr=he(),nr=pe(1,0,0),ir=pe(0,1,0),function(e,t,r){var n=ve(t,r);return n<-.999999?(ye(rr,nr,t),Ae(rr)<1e-6&&ye(rr,ir,t),function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a}(rr,rr),Yt(e,rr,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(ye(rr,t,r),e[0]=rr[0],e[1]=rr[1],e[2]=rr[2],e[3]=1+n,pr(e,e))});ar=Zt(),or=Zt(),sr=function(){var e=new q(9);return q!=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 yr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tt()(e);if(t){var i=tt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $e()(this,r)}}var gr=[0,0,0,1],mr=function(e){Ze()(r,e);var t=yr(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return qe()(this,r),e=t.call(this,-0,-0,-0,-0),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,a,o),e}return Qe()(r,[{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}},{key:"set",value:function(e,t,r,n){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this.check()}},{key:"fromObject",value:function(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}},{key:"fromMatrix3",value:function(e){return tr(this,e),this.check()}},{key:"fromAxisRotation",value:function(e,t){return Yt(this,e,t),this.check()}},{key:"identity",value:function(){return function(e){e[0]=0,e[1]=0,e[2]=0,e[3]=1}(this),this.check()}},{key:"setAxisAngle",value:function(e,t){return this.fromAxisRotation(e,t)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){this[0]=bt(e)}},{key:"y",get:function(){return this[1]},set:function(e){this[1]=bt(e)}},{key:"z",get:function(){return this[2]},set:function(e){this[2]=bt(e)}},{key:"w",get:function(){return this[3]},set:function(e){this[3]=bt(e)}},{key:"len",value:function(){return hr(this)}},{key:"lengthSquared",value:function(){return dr(this)}},{key:"dot",value:function(e){return lr(this,e)}},{key:"rotationTo",value:function(e,t){return vr(this,e,t),this.check()}},{key:"add",value:function(e){return ur(this,this,e),this.check()}},{key:"calculateW",value:function(){return function(e,t){var r=t[0],n=t[1],i=t[2];e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i))}(this,this),this.check()}},{key:"conjugate",value:function(){return function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this,this),this.check()}},{key:"invert",value:function(){return function(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;e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s}(this,this),this.check()}},{key:"lerp",value:function(e,t,r){return void 0===r?this.lerp(this,e,t):(fr(this,e,t,r),this.check())}},{key:"multiplyRight",value:function(e){return $t(this,this,e),this.check()}},{key:"multiplyLeft",value:function(e){return $t(this,e,this),this.check()}},{key:"normalize",value:function(){var e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}},{key:"rotateX",value:function(e){return function(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);e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(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);e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(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);e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return cr(this,this,e),this.check()}},{key:"slerp",value:function(e,t,r){var n,i,a;switch(arguments.length){case 1:var o=e.start;n=void 0===o?gr:o,i=e.target,a=e.ratio;break;case 2:n=this,i=e,a=t;break;default:n=e,i=t,a=r}return er(this,n,i,a),this.check()}},{key:"transformVector4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wt;return Y(t,e,this),At(t,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(e,t){return this.setAxisAngle(e,t)}},{key:"premultiply",value:function(e){return this.multiplyLeft(e)}},{key:"multiply",value:function(e){return this.multiplyRight(e)}}]),r}(gt),br=new St,Ar=new St,Br=new St,wr=new St,_r=new St,xr=new St,Cr=new St,Or=0,Er=1,Tr=2,Sr=3,kr=4,Mr=5,Ir=6,Rr=7,Pr=8,Fr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];He()(this,e),ze(this,"center",void 0),ze(this,"halfAxes",void 0),this.center=(new St).from(t),this.halfAxes=new Xt(r)}return Ve()(e,[{key:"halfSize",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2);return[new St(e).len(),new St(t).len(),new St(r).len()]}},{key:"quaternion",get:function(){var e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),r=this.halfAxes.getColumn(2),n=new St(e).normalize(),i=new St(t).normalize(),a=new St(r).normalize();return(new mr).fromMatrix3(new Xt([].concat(Lt()(n),Lt()(i),Lt()(a))))}},{key:"fromCenterHalfSizeQuaternion",value:function(e,t,r){var n=new mr(r),i=(new Xt).fromQuaternion(n);return i[0]=i[0]*t[0],i[1]=i[1]*t[0],i[2]=i[2]*t[0],i[3]=i[3]*t[1],i[4]=i[4]*t[1],i[5]=i[5]*t[1],i[6]=i[6]*t[2],i[7]=i[7]*t[2],i[8]=i[8]*t[2],this.center=(new St).from(e),this.halfAxes=i,this}},{key:"clone",value:function(){return new e(this.center,this.halfAxes)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}},{key:"getBoundingSphere",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ft,t=this.halfAxes,r=t.getColumn(0,Br),n=t.getColumn(1,wr),i=t.getColumn(2,_r),a=br.copy(r).add(n).add(i);return e.center.copy(this.center),e.radius=a.magnitude(),e}},{key:"intersectPlane",value:function(e){var t=this.center,r=e.normal,n=this.halfAxes,i=r.x,a=r.y,o=r.z,s=Math.abs(i*n[Or]+a*n[Er]+o*n[Tr])+Math.abs(i*n[Sr]+a*n[kr]+o*n[Mr])+Math.abs(i*n[Ir]+a*n[Rr]+o*n[Pr]),u=r.dot(t)+e.distance;return u<=-s?je:u>=s?Ue:Ge}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var t=Ar.from(e).subtract(this.center),r=this.halfAxes,n=r.getColumn(0,Br),i=r.getColumn(1,wr),a=r.getColumn(2,_r),o=n.magnitude(),s=i.magnitude(),u=a.magnitude();n.normalize(),i.normalize(),a.normalize();var c,l=0;return(c=Math.abs(t.dot(n))-o)>0&&(l+=c*c),(c=Math.abs(t.dot(i))-s)>0&&(l+=c*c),(c=Math.abs(t.dot(a))-u)>0&&(l+=c*c),l}},{key:"computePlaneDistances",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,a=this.center,o=this.halfAxes,s=o.getColumn(0,Br),u=o.getColumn(1,wr),c=o.getColumn(2,_r),l=xr.copy(s).add(u).add(c).add(a),f=Cr.copy(l).subtract(e),h=t.dot(f);return n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).add(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).subtract(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),l.copy(a).add(s).subtract(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).add(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).add(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).subtract(u).add(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),a.copy(l).subtract(s).subtract(u).subtract(c),f.copy(l).subtract(e),h=t.dot(f),n=Math.min(h,n),i=Math.max(h,i),r[0]=n,r[1]=i,r}},{key:"transform",value:function(e){this.center.transformAsPoint(e);var t=this.halfAxes.getColumn(0,Br);t.transformAsPoint(e);var r=this.halfAxes.getColumn(1,wr);r.transformAsPoint(e);var n=this.halfAxes.getColumn(2,_r);return n.transformAsPoint(e),this.halfAxes=new Xt([].concat(Lt()(t),Lt()(r),Lt()(n))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),e}(),Dr=new St,Lr=new St,jr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;He()(this,e),ze(this,"normal",void 0),ze(this,"distance",void 0),this.normal=new St,this.distance=-0,this.fromNormalDistance(t,r)}return Ve()(e,[{key:"fromNormalDistance",value:function(e,t){return rt(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}},{key:"fromPointNormal",value:function(e,t){e=Dr.from(e),this.normal.from(t).normalize();var r=-this.normal.dot(e);return this.distance=r,this}},{key:"fromCoefficients",value:function(e,t,r,n){return this.normal.set(e,t,r),rt(dt(this.normal.len(),1)),this.distance=n,this}},{key:"clone",value:function(){return new e(this.normal,this.distance)}},{key:"equals",value:function(e){return dt(this.distance,e.distance)&&dt(this.normal,e.normal)}},{key:"getPointDistance",value:function(e){return this.normal.dot(e)+this.distance}},{key:"transform",value:function(e){var t=Lr.copy(this.normal).transformAsVector(e).normalize(),r=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(r,t)}},{key:"projectPointOntoPlane",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];e=Dr.from(e);var r=this.getPointDistance(e),n=Lr.copy(this.normal).scale(r);return e.subtract(n).to(t)}}]),e}();function Gr(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ur(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ur(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ur(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Nr,Hr=[new St([1,0,0]),new St([0,1,0]),new St([0,0,1])],Jr=new St,Vr=new St,zr=(new jr(new St(1,0,0),0),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];He()(this,e),ze(this,"planes",void 0),this.planes=t}return Ve()(e,[{key:"fromBoundingSphere",value:function(e){this.planes.length=2*Hr.length;var t,r=e.center,n=e.radius,i=0,a=Gr(Hr);try{for(a.s();!(t=a.n()).done;){var o=t.value,s=this.planes[i],u=this.planes[i+1];s||(s=this.planes[i]=new jr),u||(u=this.planes[i+1]=new jr);var c=Jr.copy(o).scale(-n).add(r);o.dot(c);s.fromPointNormal(c,o);var l=Jr.copy(o).scale(n).add(r),f=Vr.copy(o).negate();f.dot(l);u.fromPointNormal(l,f),i+=2}}catch(e){a.e(e)}finally{a.f()}return this}},{key:"computeVisibility",value:function(e){var t,r=Ue,n=Gr(this.planes);try{for(n.s();!(t=n.n()).done;){var i=t.value;switch(e.intersectPlane(i)){case je:return je;case Ge:r=Ge}}}catch(e){n.e(e)}finally{n.f()}return r}},{key:"computeVisibilityWithPlaneMask",value:function(t,r){if(rt(Number.isFinite(r),"parentPlaneMask is required."),r===e.MASK_OUTSIDE||r===e.MASK_INSIDE)return r;for(var n=e.MASK_INSIDE,i=this.planes,a=0;a<this.planes.length;++a){var o=a<31?1<<a:0;if(!(a<31&&0==(r&o))){var s=i[a],u=t.intersectPlane(s);if(u===je)return e.MASK_OUTSIDE;u===Ge&&(n|=o)}}return n}}]),e}());function Kr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tt()(e);if(t){var i=tt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $e()(this,r)}}ze(zr,"MASK_OUTSIDE",4294967295),ze(zr,"MASK_INSIDE",0),ze(zr,"MASK_INDETERMINATE",2147483647),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"}(Nr||(Nr={}));var qr,Xr,Qr=45*Math.PI/180,Wr=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Zr=function(e){Ze()(r,e);var t=Kr(r);function r(e){var n;return qe()(this,r),n=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?n.copy(e):n.identity(),n}return Qe()(r,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return Nr}},{key:"copy",value:function(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()}},{key:"set",value:function(e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,v){return this[0]=e,this[1]=t,this[2]=r,this[3]=n,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=p,this[15]=v,this.check()}},{key:"setRowMajor",value:function(e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,v){return this[0]=e,this[1]=i,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=r,this[9]=o,this[10]=l,this[11]=p,this[12]=n,this[13]=s,this[14]=f,this[15]=v,this.check()}},{key:"toRowMajor",value:function(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}},{key:"identity",value:function(){return this.copy(Wr)}},{key:"fromObject",value:function(e){return this.check()}},{key:"fromQuaternion",value:function(e){return function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,h=i*o,d=i*s,p=i*u,v=a*o,y=a*s,g=a*u;e[0]=1-f-p,e[1]=l+g,e[2]=h-y,e[3]=0,e[4]=l-g,e[5]=1-c-p,e[6]=d+v,e[7]=0,e[8]=h+y,e[9]=d-v,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,r=e.right,n=e.bottom,i=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return u===1/0?function(e,t,r,n,i,a){var o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),c=(i+n)/(i-n),l=-2*a;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]=c,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=l,e[15]=0}(this,t,r,n,i,o):function(e,t,r,n,i,a,o){var s=1/(r-t),u=1/(i-n),c=1/(a-o);e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0}(this,t,r,n,i,o,u),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,r=e.center,n=void 0===r?[0,0,0]:r,i=e.up;return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p=t[0],v=t[1],y=t[2],g=n[0],m=n[1],b=n[2],A=r[0],B=r[1],w=r[2];Math.abs(p-A)<K&&Math.abs(v-B)<K&&Math.abs(y-w)<K?function(e){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):(l=p-A,f=v-B,h=y-w,i=m*(h*=d=1/Math.hypot(l,f,h))-b*(f*=d),a=b*(l*=d)-g*h,o=g*f-m*l,(d=Math.hypot(i,a,o))?(i*=d=1/d,a*=d,o*=d):(i=0,a=0,o=0),s=f*o-h*a,u=h*i-l*o,c=l*a-f*i,(d=Math.hypot(s,u,c))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),e[0]=i,e[1]=s,e[2]=l,e[3]=0,e[4]=a,e[5]=u,e[6]=f,e[7]=0,e[8]=o,e[9]=c,e[10]=h,e[11]=0,e[12]=-(i*p+a*v+o*y),e[13]=-(s*p+u*v+c*y),e[14]=-(l*p+f*v+h*y),e[15]=1)}(this,t,n,void 0===i?[0,1,0]:i),this.check()}},{key:"ortho",value:function(e){var t=e.left,r=e.right,n=e.bottom,i=e.top,a=e.near,o=void 0===a?.1:a,s=e.far;return ce(this,t,r,n,i,o,void 0===s?500:s),this.check()}},{key:"orthographic",value:function(e){var t=e.fovy,r=void 0===t?Qr:t,n=e.aspect,i=void 0===n?1:n,a=e.focalDistance,o=void 0===a?1:a,s=e.near,u=void 0===s?.1:s,c=e.far,l=void 0===c?500:c;Yr(r);var f=r/2,h=o*Math.tan(f),d=h*i;return this.ortho({left:-d,right:d,bottom:-h,top:h,near:u,far:l})}},{key:"perspective",value:function(e){var t=e.fovy,r=void 0===t?45*Math.PI/180:t,n=e.aspect,i=void 0===n?1:n,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return Yr(r),ue(this,r,i,o,u),this.check()}},{key:"determinant",value:function(){return t=(e=this)[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],p=e[13],v=e[14],y=e[15],(t*o-r*a)*(f*y-h*v)-(t*s-n*a)*(l*y-h*p)+(t*u-i*a)*(l*v-f*p)+(r*s-n*o)*(c*y-h*d)-(r*u-i*o)*(c*v-f*d)+(n*u-i*s)*(c*p-l*d);var e,t,r,n,i,a,o,s,u,c,l,f,h,d,p,v,y}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-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}},{key:"getTranslation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}},{key:"getRotation",value:function(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];var r=this.getScale(t),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=0,e[4]=this[4]*n,e[5]=this[5]*i,e[6]=this[6]*a,e[7]=0,e[8]=this[8]*n,e[9]=this[9]*i,e[10]=this[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{key:"getRotationMatrix3",value:function(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];var r=this.getScale(t),n=1/r[0],i=1/r[1],a=1/r[2];return e[0]=this[0]*n,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=this[4]*n,e[4]=this[5]*i,e[5]=this[6]*a,e[6]=this[8]*n,e[7]=this[9]*i,e[8]=this[10]*a,e}},{key:"transpose",value:function(){return function(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]}(this,this),this.check()}},{key:"invert",value:function(){return te(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return re(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return re(this,this,e),this.check()}},{key:"rotateX",value:function(e){return ae(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],h=t[11];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-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-h*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+h*i}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return oe(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}},{key:"rotateAxis",value:function(e,t){return function(e,t,r,n){var i,a,o,s,u,c,l,f,h,d,p,v,y,g,m,b,A,B,w,_,x,C,O,E,T=n[0],S=n[1],k=n[2],M=Math.hypot(T,S,k);M<K||(T*=M=1/M,S*=M,k*=M,i=Math.sin(r),o=1-(a=Math.cos(r)),s=t[0],u=t[1],c=t[2],l=t[3],f=t[4],h=t[5],d=t[6],p=t[7],v=t[8],y=t[9],g=t[10],m=t[11],b=T*T*o+a,A=S*T*o+k*i,B=k*T*o-S*i,w=T*S*o-k*i,_=S*S*o+a,x=k*S*o+T*i,C=T*k*o+S*i,O=S*k*o-T*i,E=k*k*o+a,e[0]=s*b+f*A+v*B,e[1]=u*b+h*A+y*B,e[2]=c*b+d*A+g*B,e[3]=l*b+p*A+m*B,e[4]=s*w+f*_+v*x,e[5]=u*w+h*_+y*x,e[6]=c*w+d*_+g*x,e[7]=l*w+p*_+m*x,e[8]=s*C+f*O+v*E,e[9]=u*C+h*O+y*E,e[10]=c*C+d*O+g*E,e[11]=l*C+p*O+m*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]))}(this,this,e,t),this.check()}},{key:"scale",value:function(e){return ie(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}},{key:"translate",value:function(e){return ne(this,this,e),this.check()}},{key:"transform",value:function(e,t){return 4===e.length?(At(t=Z(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}},{key:"transformAsPoint",value:function(e,t){var r;switch(e.length){case 2:r=fe(t||[-0,-0],e,this);break;case 3:r=ge(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return At(r,e.length),r}},{key:"transformAsVector",value:function(e,t){var r;switch(e.length){case 2:r=_t(t||[-0,-0],e,this);break;case 3:r=xt(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return At(r,e.length),r}},{key:"transformPoint",value:function(e,t){return this.transformAsPoint(e,t)}},{key:"transformVector",value:function(e,t){return this.transformAsPoint(e,t)}},{key:"transformDirection",value:function(e,t){return this.transformAsVector(e,t)}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,r){return this.identity().translate([e,t,r])}}],[{key:"IDENTITY",get:function(){return function(){Xr||(Xr=new Zr,Object.freeze(Xr));return Xr}()}},{key:"ZERO",get:function(){return function(){qr||(qr=new Zr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(qr));return qr}()}}]),r}(Gt);function Yr(e){if(e>2*Math.PI)throw Error("expected radians")}new St,new St,new St,new St,new St;function $r(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tt()(e);if(t){var i=tt()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $e()(this,r)}}var en=function(e){Ze()(r,e);var t=$r(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return qe()(this,r),e=t.call(this,2),st(n)&&1===arguments.length?e.copy(n):(at.debug&&(bt(n),bt(i)),e[0]=n,e[1]=i),e}return Qe()(r,[{key:"set",value:function(e,t){return this[0]=e,this[1]=t,this.check()}},{key:"copy",value:function(e){return this[0]=e[0],this[1]=e[1],this.check()}},{key:"fromObject",value:function(e){return at.debug&&(bt(e.x),bt(e.y)),this[0]=e.x,this[1]=e.y,this.check()}},{key:"toObject",value:function(e){return e.x=this[0],e.y=this[1],e}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(e){return this.transformAsPoint(e)}},{key:"transformAsPoint",value:function(e){return fe(this,this,e),this.check()}},{key:"transformAsVector",value:function(e){return _t(this,this,e),this.check()}},{key:"transformByMatrix3",value:function(e){return le(this,this,e),this.check()}},{key:"transformByMatrix2x3",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5]}(this,this,e),this.check()}},{key:"transformByMatrix2",value:function(e){return function(e,t,r){var n=t[0],i=t[1];e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i}(this,this,e),this.check()}}]),r}(wt);new St,new St,new St,new St,new St,new St,new St,new St,new St,new St,new St,new St,Math.PI;var tn=.1,rn=1e-12,nn=1e-15,an=1e-20,on=(Math.PI,Math.PI,Math.PI,Math.PI,new Xt),sn=new Xt,un=new Xt,cn=new Xt,ln=new Xt;function fn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=an,n=10,i=0,a=0,o=sn,s=un;o.identity(),s.copy(e);for(var u=r*hn(s);a<n&&vn(s)>u;)yn(s,cn),ln.copy(cn).transpose(),s.multiplyRight(cn),s.multiplyLeft(ln),o.multiplyRight(cn),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function hn(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}var dn=[1,0,0],pn=[2,2,1];function vn(e){for(var t=0,r=0;r<3;++r){var n=e[on.getElementIndex(pn[r],dn[r])];t+=2*n*n}return Math.sqrt(t)}function yn(e,t){for(var r=nn,n=0,i=1,a=0;a<3;++a){var o=Math.abs(e[on.getElementIndex(pn[a],dn[a])]);o>n&&(i=a,n=o)}var s=dn[i],u=pn[i],c=1,l=0;if(Math.abs(e[on.getElementIndex(u,s)])>r){var f,h=(e[on.getElementIndex(u,u)]-e[on.getElementIndex(s,s)])/2/e[on.getElementIndex(u,s)];l=(f=h<0?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)))*(c=1/Math.sqrt(1+f*f))}return Xt.IDENTITY.to(t),t[on.getElementIndex(s,s)]=t[on.getElementIndex(u,u)]=c,t[on.getElementIndex(u,s)]=l,t[on.getElementIndex(s,u)]=-l,t}function gn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return mn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mn(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var bn=new St,An=new St,Bn=new St,wn=new St,_n=new St,xn=new Xt,Cn={diagonal:new Xt,unitary:new Xt};function On(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return En(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return En(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function En(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Tn=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],Sn=Tn.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),kn=Sn.concat([[.25,.5],[.75,.5]]),Mn=function(){function e(t,r,n){h()(this,e),A()(this,"x",void 0),A()(this,"y",void 0),A()(this,"z",void 0),A()(this,"childVisible",void 0),A()(this,"selected",void 0),A()(this,"_children",void 0),this.x=t,this.y=r,this.z=n}return C()(e,[{key:"children",get:function(){if(!this._children){var t=2*this.x,r=2*this.y,n=this.z+1;this._children=[new e(t,r,n),new e(t,r+1,n),new e(t+1,r,n),new e(t+1,r+1,n)]}return this._children}},{key:"update",value:function(e){var t=e.viewport,r=e.cullingVolume,n=e.elevationBounds,i=e.minZ,a=e.maxZ,o=e.bounds,s=e.offset,u=e.project,c=this.getBoundingVolume(n,s,u);if(o&&!this.insideBounds(o))return!1;if(r.computeVisibility(c)<0)return!1;if(!this.childVisible){var l=this.z;if(l<a&&l>=i){var f=c.distanceTo(t.cameraPosition)*t.scale/t.height;l+=Math.floor(Math.log2(f))}if(l>=a)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var h,d=On(this.children);try{for(d.s();!(h=d.n()).done;){h.value.update(e)}}catch(e){d.e(e)}finally{d.f()}return!0}},{key:"getSelected",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.selected&&e.push(this),this._children){var t,r=On(this._children);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.getSelected(e)}}catch(e){r.e(e)}finally{r.f()}}return e}},{key:"insideBounds",value:function(e){var t=M()(e,4),r=t[0],n=t[1],i=t[2],a=t[3],o=512/Math.pow(2,this.z);return this.x*o<i&&this.y*o<a&&(this.x+1)*o>r&&(this.y+1)*o>n}},{key:"getBoundingVolume",value:function(e,t,r){if(r){var n,i=[],a=On(this.z<1?kn:this.z<2?Sn:Tn);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=jn(this.x+o[0],this.y+o[1],this.z);s[2]=e[0],i.push(r(s)),e[0]!==e[1]&&(s[2]=e[1],i.push(r(s)))}}catch(e){a.e(e)}finally{a.f()}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Fr;if(!e||0===e.length)return t.halfAxes=new Xt([0,0,0,0,0,0,0,0,0]),t.center=new St,t;var r,n=e.length,i=new St(0,0,0),a=gn(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i.add(o)}}catch(e){a.e(e)}finally{a.f()}var s=1/n;i.multiplyByScalar(s);var u,c=0,l=0,f=0,h=0,d=0,p=0,v=gn(e);try{for(v.s();!(u=v.n()).done;){var y=u.value,g=bn.copy(y).subtract(i);c+=g.x*g.x,l+=g.x*g.y,f+=g.x*g.z,h+=g.y*g.y,d+=g.y*g.z,p+=g.z*g.z}}catch(e){v.e(e)}finally{v.f()}c*=s,l*=s,f*=s,h*=s,d*=s,p*=s;var m=xn;m[0]=c,m[1]=l,m[2]=f,m[3]=l,m[4]=h,m[5]=d,m[6]=f,m[7]=d,m[8]=p;var b,A=fn(m,Cn),B=A.unitary,w=t.halfAxes.copy(B),_=w.getColumn(0,Bn),x=w.getColumn(1,wn),C=w.getColumn(2,_n),O=-Number.MAX_VALUE,E=-Number.MAX_VALUE,T=-Number.MAX_VALUE,S=Number.MAX_VALUE,k=Number.MAX_VALUE,M=Number.MAX_VALUE,I=gn(e);try{for(I.s();!(b=I.n()).done;){var R=b.value;bn.copy(R),O=Math.max(bn.dot(_),O),E=Math.max(bn.dot(x),E),T=Math.max(bn.dot(C),T),S=Math.min(bn.dot(_),S),k=Math.min(bn.dot(x),k),M=Math.min(bn.dot(C),M)}}catch(e){I.e(e)}finally{I.f()}_=_.multiplyByScalar(.5*(S+O)),x=x.multiplyByScalar(.5*(k+E)),C=C.multiplyByScalar(.5*(M+T)),t.center.copy(_).add(x).add(C);var P=An.set(O-S,E-k,T-M).multiplyByScalar(.5),F=new Xt([P[0],0,0,0,P[1],0,0,0,P[2]]);return t.halfAxes.multiplyRight(F),t}(i)}var u=512/Math.pow(2,this.z),c=this.x*u+512*t,l=512-(this.y+1)*u;return new It([c,l,e[0]],[c+u,l+u,e[1]])}}]),e}();var In=[-1/0,-1/0,1/0,1/0],Rn={type:"url",value:null,validate:function(e,t){return t.optional&&null===e||"string"==typeof e||Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))},equals:function(e,t){if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;var r=e.length;if(r!==t.length)return!1;for(var n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}};function Pn(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]])];return[Math.min.apply(Math,Le()(r.map((function(e){return e[0]})))),Math.min.apply(Math,Le()(r.map((function(e){return e[1]})))),Math.max.apply(Math,Le()(r.map((function(e){return e[0]})))),Math.max.apply(Math,Le()(r.map((function(e){return e[1]}))))]}function Fn(e,t){if(!e||!e.length)return null;var r,n=t.index,i=t.id;Array.isArray(e)&&(e=e[(r=i,Math.abs(r.split("").reduce((function(e,t){return(e<<5)-e+t.charCodeAt(0)|0}),0))%e.length)]);for(var a=e,o=0,s=Object.keys(n);o<s.length;o++){var u=s[o],c=new RegExp("{".concat(u,"}"),"g");a=a.replace(c,String(n[u]))}return Number.isInteger(n.y)&&Number.isInteger(n.z)&&(a=a.replace(/\{-y\}/g,String(Math.pow(2,n.z)-n.y-1))),a}function Dn(e){var t=e.viewport,r=e.z,n=e.cullRect,i=n.x-t.x,a=n.y-t.y,o=n.width,s=n.height;if(!Array.isArray(r)){var u={targetZ:r||0},c=t.unproject([i,a],u),l=t.unproject([i+o,a],u),f=t.unproject([i,a+s],u),h=t.unproject([i+o,a+s],u);return[Math.min(c[0],l[0],f[0],h[0]),Math.min(c[1],l[1],f[1],h[1]),Math.max(c[0],l[0],f[0],h[0]),Math.max(c[1],l[1],f[1],h[1])]}var d=Dn({viewport:t,z:r[0],cullRect:n}),p=Dn({viewport:t,z:r[1],cullRect:n});return[Math.min(d[0],p[0]),Math.min(d[1],p[1]),Math.max(d[2],p[2]),Math.max(d[3],p[3])]}function Ln(e,t){return 512*Math.pow(2,e)/t}function jn(e,t,r){var n=Ln(r,512),i=e/n*360-180,a=Math.PI-2*Math.PI*t/n;return[i,180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)))]}function Gn(e,t,r,n){var i=Ln(r,n);return[e/i*512,t/i*512]}function Un(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:512;if(e.isGeospatial){var a=jn(t,r,n),o=M()(a,2),s=o[0],u=o[1],c=jn(t+1,r+1,n),l=M()(c,2),f=l[0],h=l[1];return{west:s,north:u,east:f,south:h}}var d=Gn(t,r,n,i),p=M()(d,2),v=p[0],y=p[1],g=Gn(t+1,r+1,n,i),m=M()(g,2),b=m[0],A=m[1];return{left:v,top:y,right:b,bottom:A}}function Nn(e,t,r,n,i){for(var a=function(e,t,r){return r?Pn(e,r).map((function(e){return e*t/512})):e.map((function(e){return e*t/512}))}(function(e,t,r){var n;if(t&&2===t.length){var i=M()(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])]}(e,null,n),Ln(t,r),i),o=M()(a,4),s=o[0],u=o[1],c=o[2],l=o[3],f=[],h=Math.floor(s);h<c;h++)for(var d=Math.floor(u);d<l;d++)f.push({x:h,y:d,z:t});return f}function Hn(e){var t=e.viewport,r=e.maxZoom,n=e.minZoom,i=e.zRange,a=e.extent,o=e.tileSize,s=void 0===o?512:o,u=e.modelMatrix,c=e.modelMatrixInverse,l=e.zoomOffset,f=void 0===l?0:l,h=t.isGeospatial?Math.round(t.zoom+Math.log2(512/s))+f:Math.ceil(t.zoom)+f;if("number"==typeof n&&Number.isFinite(n)&&h<n){if(!a)return[];h=n}"number"==typeof r&&Number.isFinite(r)&&h>r&&(h=r);var d=a;return u&&c&&a&&!t.isGeospatial&&(d=Pn(a,u)),t.isGeospatial?function(e,t,r,n){var i=e instanceof B._GlobeViewport&&e.resolution?e.projectPosition:null,a=Object.values(e.getFrustumPlanes()).map((function(e){var t=e.normal,r=e.distance;return new jr(t.clone().negate(),r)})),o=new zr(a),s=e.distanceScales.unitsPerMeter[2],u=r&&r[0]*s||0,c=r&&r[1]*s||0,l=e instanceof B.WebMercatorViewport&&e.pitch<=60?t:0;if(n){var f=n,h=M()(f,4),d=h[0],p=h[1],v=h[2],y=Oe([d,h[3]]),g=Oe([v,p]);n=[y[0],512-y[1],g[0],512-g[1]]}var m=new Mn(0,0,0),b={viewport:e,project:i,cullingVolume:o,elevationBounds:[u,c],minZ:l,maxZ:t,bounds:n,offset:0};if(m.update(b),e instanceof B.WebMercatorViewport&&e.subViewports&&e.subViewports.length>1){for(b.offset=-1;m.update(b)&&!(--b.offset<-3););for(b.offset=1;m.update(b)&&!(++b.offset>3););}return m.getSelected()}(t,h,i,a):Nn(t,h,s,d||In,c)}function Jn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vn(){var e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){var t=process.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var zn=function(){function e(t,r){h()(this,e),Jn(this,"name",void 0),Jn(this,"type",void 0),Jn(this,"sampleSize",1),Jn(this,"time",void 0),Jn(this,"count",void 0),Jn(this,"samples",void 0),Jn(this,"lastTiming",void 0),Jn(this,"lastSampleTime",void 0),Jn(this,"lastSampleCount",void 0),Jn(this,"_count",0),Jn(this,"_time",0),Jn(this,"_samples",0),Jn(this,"_startTime",0),Jn(this,"_timerPending",!1),this.name=t,this.type=r,this.reset()}return C()(e,[{key:"setSampleSize",value:function(e){return this.sampleSize=e,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(e){return this._count+=e,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(e){return this._count-=e,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=Vn(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Vn()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value: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}},{key:"_checkSampling",value: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}(),Kn=function(){function e(t){h()(this,e),Jn(this,"id",void 0),Jn(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}return C()(e,[{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach((function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}})),e}},{key:"_initializeStats",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach((function(t){return e._getOrCreate(t)}))}},{key:"_getOrCreate",value:function(e){if(!e||!e.name)return null;var t=e.name,r=e.type;return this.stats[t]||(this.stats[t]=e instanceof zn?e:new zn(t,r)),this.stats[t]}}]),e}();function qn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qn(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Qn,Wn={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Zn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h()(this,e),Jn(this,"props",void 0),Jn(this,"stats",void 0),Jn(this,"activeRequestCount",0),Jn(this,"requestQueue",[]),Jn(this,"requestMap",new Map),Jn(this,"deferredUpdate",null),this.props=Xn(Xn({},Wn),t),this.stats=new Kn({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}return C()(e,[{key:"scheduleRequest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(e))return this.requestMap.get(e);var r={handle:e,priority:0,getPriority:t},n=new Promise((function(e){return r.resolve=e,r}));return this.requestQueue.push(r),this.requestMap.set(e,n),this._issueNewRequests(),n}},{key:"_issueRequest",value:function(e){var t=this,r=e.handle,n=e.resolve,i=!1,a=function(){i||(i=!0,t.requestMap.delete(r),t.activeRequestCount--,t._issueNewRequests())};return this.activeRequestCount++,n?n({done:a}):Promise.resolve({done:a})}},{key:"_issueNewRequests",value:function(){var e=this;this.deferredUpdate||(this.deferredUpdate=setTimeout((function(){return e._issueNewRequestsAsync()}),0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==e){this._updateAllRequests();for(var t=0;t<e;++t){var r=this.requestQueue.shift();r&&this._issueRequest(r)}}}},{key:"_updateAllRequests",value:function(){for(var e=this.requestQueue,t=0;t<e.length;++t){var r=e[t];this._updateRequest(r)||(e.splice(t,1),this.requestMap.delete(r.handle),t--)}e.sort((function(e,t){return e.priority-t.priority}))}},{key:"_updateRequest",value:function(e){return e.priority=e.getPriority(e.handle),!(e.priority<0)||(e.resolve(null),!1)}}]),e}();function Yn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return $n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $n(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function $n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ei=(Qn={},A()(Qn,"best-available",(function(e){var t,r=Yn(e);try{for(r.s();!(t=r.n()).done;){t.value.state=0}}catch(e){r.e(e)}finally{r.f()}var n,i=Yn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.isSelected&&!ri(a)&&ni(a)}}catch(e){i.e(e)}finally{i.f()}var o,s=Yn(e);try{for(s.s();!(o=s.n()).done;){var u=o.value;u.isVisible=Boolean(2&u.state)}}catch(e){s.e(e)}finally{s.f()}})),A()(Qn,"no-overlap",(function(e){var t,r=Yn(e);try{for(r.s();!(t=r.n()).done;){t.value.state=0}}catch(e){r.e(e)}finally{r.f()}var n,i=Yn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.isSelected&&ri(a)}}catch(e){i.e(e)}finally{i.f()}var o,s=Yn(Array.from(e).sort((function(e,t){return e.zoom-t.zoom})));try{for(s.s();!(o=s.n()).done;){var u=o.value;if(u.isVisible=Boolean(2&u.state),u.children&&(u.isVisible||1&u.state)){var c,l=Yn(u.children);try{for(l.s();!(c=l.n()).done;){c.value.state=1}}catch(e){l.e(e)}finally{l.f()}}else u.isSelected&&ni(u)}}catch(e){s.e(e)}finally{s.f()}})),A()(Qn,"never",(function(){})),Qn),ti=function(){function e(t){var r=this;h()(this,e),A()(this,"opts",void 0),A()(this,"_requestScheduler",void 0),A()(this,"_cache",void 0),A()(this,"_dirty",void 0),A()(this,"_tiles",void 0),A()(this,"_cacheByteSize",void 0),A()(this,"_viewport",void 0),A()(this,"_zRange",void 0),A()(this,"_selectedTiles",void 0),A()(this,"_frameNumber",void 0),A()(this,"_modelMatrix",void 0),A()(this,"_modelMatrixInverse",void 0),A()(this,"_maxZoom",void 0),A()(this,"_minZoom",void 0),A()(this,"onTileLoad",void 0),A()(this,"_getCullBounds",Object(B._memoize)(Dn)),this.opts=t,this.onTileLoad=function(e){r.opts.onTileLoad(e),r.opts.maxCacheByteSize&&(r._cacheByteSize+=e.byteLength,r._resizeCache())},this._requestScheduler=new Zn({maxRequests:t.maxRequests,throttleRequests:t.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 Zr,this._modelMatrixInverse=new Zr,this.setOptions(t)}return C()(e,[{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return null!==this._selectedTiles&&this._selectedTiles.every((function(e){return e.isLoaded}))}},{key:"needsReload",get:function(){return null!==this._selectedTiles&&this._selectedTiles.some((function(e){return e.needsReload}))}},{key:"setOptions",value:function(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom))}},{key:"finalize",value:function(){var e,t=Yn(this._cache.values());try{for(t.s();!(e=t.n()).done;){var r=e.value;r.isLoading&&r.abort()}}catch(e){t.e(e)}finally{t.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null}},{key:"reloadAll",value:function(){var e,t=Yn(this._cache.keys());try{for(t.s();!(e=t.n()).done;){var r=e.value,n=this._cache.get(r);this._selectedTiles&&this._selectedTiles.includes(n)?n.setNeedsReload():this._cache.delete(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"update",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.zRange,i=r.modelMatrix,a=new Zr(i),o=!a.equals(this._modelMatrix);if(this._viewport&&e.equals(this._viewport)&&dt(this._zRange,n)&&!o)this.needsReload&&(this._selectedTiles=this._selectedTiles.map((function(e){return t._getTile(e.index,!0)})));else{o&&(this._modelMatrixInverse=a.clone().invert(),this._modelMatrix=a),this._viewport=e,this._zRange=n;var s=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:n,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=s.map((function(e){return t._getTile(e,!0)})),this._dirty&&this._rebuildTree()}var u=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),u&&this._frameNumber++,this._frameNumber}},{key:"isTileVisible",value:function(e,t){if(!e.isVisible)return!1;if(t&&this._viewport){var r=Dn({viewport:this._viewport,z:this._zRange,cullRect:t}),n=M()(r,4),i=n[0],a=n[1],o=n[2],s=n[3],u=e.bbox;if("west"in u)return u.west<o&&u.east>i&&u.south<s&&u.north>a;var c=Math.min(u.top,u.bottom),l=Math.max(u.top,u.bottom);return u.left<o&&u.right>i&&c<s&&l>a}return!0}},{key:"getTileIndices",value:function(e){var t=e.viewport,r=e.maxZoom,n=e.minZoom,i=e.zRange,a=e.modelMatrix,o=e.modelMatrixInverse,s=this.opts;return Hn({viewport:t,maxZoom:r,minZoom:n,zRange:i,tileSize:s.tileSize,extent:s.extent,modelMatrix:a,modelMatrixInverse:o,zoomOffset:s.zoomOffset})}},{key:"getTileId",value:function(e){return"".concat(e.x,"-").concat(e.y,"-").concat(e.z)}},{key:"getTileZoom",value:function(e){return e.z}},{key:"getTileMetadata",value:function(e){var t=this.opts.tileSize;return{bbox:Un(this._viewport,e.x,e.y,e.z,t)}}},{key:"getParentIndex",value:function(e){return{x:Math.floor(e.x/2),y:Math.floor(e.y/2),z:e.z-1}}},{key:"updateTileStates",value:function(){var e,t=this.opts.refinementStrategy||"best-available",r=new Array(this._cache.size),n=0,i=Yn(this._cache.values());try{for(i.s();!(e=i.n()).done;){var a=e.value;r[n++]=a.isVisible,a.isSelected=!1,a.isVisible=!1}}catch(e){i.e(e)}finally{i.f()}var o,s=Yn(this._selectedTiles);try{for(s.s();!(o=s.n()).done;){var u=o.value;u.isSelected=!0,u.isVisible=!0}}catch(e){s.e(e)}finally{s.f()}("function"==typeof t?t:ei[t])(Array.from(this._cache.values())),n=0;var c,l=Yn(this._cache.values());try{for(l.s();!(c=l.n()).done;){var f=c.value;if(r[n++]!==f.isVisible)return!0}}catch(e){l.e(e)}finally{l.f()}return!1}},{key:"_pruneRequests",value:function(){var e,t=this.opts.maxRequests,r=[],n=0,i=Yn(this._cache.values());try{for(i.s();!(e=i.n()).done;){var a=e.value;a.isLoading&&(n++,a.isSelected||a.isVisible||r.push(a))}}catch(e){i.e(e)}finally{i.f()}for(;t>0&&n>t&&r.length>0;){r.shift().abort(),n--}}},{key:"_rebuildTree",value:function(){var e,t=this._cache,r=Yn(t.values());try{for(r.s();!(e=r.n()).done;){var n=e.value;n.parent=null,n.children&&(n.children.length=0)}}catch(e){r.e(e)}finally{r.f()}var i,a=Yn(t.values());try{for(a.s();!(i=a.n()).done;){var o=i.value,s=this._getNearestAncestor(o);o.parent=s,null!=s&&s.children&&s.children.push(o)}}catch(e){a.e(e)}finally{a.f()}}},{key:"_resizeCache",value:function(){var e=this._cache,t=this.opts,r=t.maxCacheSize||(t.maxCacheByteSize?1/0:5*this.selectedTiles.length),n=t.maxCacheByteSize||1/0;if(e.size>r||this._cacheByteSize>n){var i,a=Yn(e);try{for(a.s();!(i=a.n()).done;){var o=M()(i.value,2),s=o[0],u=o[1];if(u.isVisible||(this._cacheByteSize-=t.maxCacheByteSize?u.byteLength:0,e.delete(s),this.opts.onTileUnload(u)),e.size<=r&&this._cacheByteSize<=n)break}}catch(e){a.e(e)}finally{a.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((function(e,t){return e.zoom-t.zoom})),this._dirty=!1)}},{key:"_getTile",value:function(e,t){var r=this.getTileId(e),n=this._cache.get(r),i=!1;return!n&&t?(n=new Fe(e),Object.assign(n,this.getTileMetadata(n.index)),Object.assign(n,{id:r,zoom:this.getTileZoom(n.index)}),i=!0,this._cache.set(r,n),this._dirty=!0):n&&n.needsReload&&(i=!0),n&&i&&n.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),n}},{key:"_getNearestAncestor",value:function(e){for(var t=this._minZoom,r=void 0===t?0:t,n=e.index;this.getTileZoom(n)>r;){n=this.getParentIndex(n);var i=this._getTile(n);if(i)return i}return null}}]),e}();function ri(e){for(var t=e;t;){if(t.isLoaded||t.content)return t.state|=2,!0;t=t.parent}return!1}function ni(e){var t,r=Yn(e.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.isLoaded||n.content?n.state|=2:ni(n)}}catch(e){r.e(e)}finally{r.f()}}function ii(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ai(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ii(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ii(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var si={TilesetClass:ti,data:{type:"data",value:[]},dataComparator:Rn.equals,renderSubLayers:{type:"function",value:function(e){return new B.GeoJsonLayer(e)},compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:function(e){},compare:!1},onTileUnload:{type:"function",value:function(e){},compare:!1},onTileError:{type:"function",value:function(e){return console.error(e)},compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0},ui=function(e){p()(r,e);var t=oi(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var e,t;null===(e=this.state)||void 0===e||null===(t=e.tileset)||void 0===t||t.finalize()}},{key:"isLoaded",get:function(){var e,t;return null===(e=this.state)||void 0===e||null===(t=e.tileset)||void 0===t?void 0:t.selectedTiles.every((function(e){return e.isLoaded&&e.layers&&e.layers.every((function(e){return e.isLoaded}))}))}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=e.changeFlags,r=this.state.tileset,n=t.propsOrDataChanged||t.updateTriggersChanged,i=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);r?n&&(r.setOptions(this._getTilesetOptions()),i?r.reloadAll():this.state.tileset.tiles.forEach((function(e){e.layers=null}))):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(){var e=this.props,t=e.tileSize,r=e.maxCacheSize,n=e.maxCacheByteSize,i=e.refinementStrategy,a=e.extent;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:t,refinementStrategy:i,extent:a,maxRequests:e.maxRequests,zoomOffset:e.zoomOffset,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}},{key:"_updateTileset",value:function(){var e=this.state.tileset,t=this.props,r=t.zRange,n=t.modelMatrix,i=e.update(this.context.viewport,{zRange:r,modelMatrix:n}),a=e.isLoaded,o=this.state.isLoaded!==a,s=this.state.frameNumber!==i;a&&(o||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:i}),this.state.isLoaded=a}},{key:"_onViewportLoad",value:function(){var e=this.state.tileset,t=this.props.onViewportLoad;t&&t(e.selectedTiles)}},{key:"_onTileLoad",value:function(e){this.props.onTileLoad(e),e.layers=null,this.setNeedsUpdate()}},{key:"_onTileError",value:function(e,t){this.props.onTileError(e),t.layers=null,this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(e){this.props.onTileUnload(e)}},{key:"getTileData",value:function(e){var t=this.props,r=t.data,n=t.getTileData,i=t.fetch,a=e.signal;return e.url="string"==typeof r||Array.isArray(r)?Fn(r,e):null,n?n(e):i&&e.url?i(e.url,{propName:"data",layer:this,signal:a}):null}},{key:"renderSubLayers",value:function(e){return this.props.renderSubLayers(e)}},{key:"getSubLayerPropsByTile",value:function(e){return null}},{key:"getPickingInfo",value:function(e){var t=e.info,r=e.sourceLayer;return t.tile=r.props.tile,t}},{key:"_updateAutoHighlight",value:function(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}},{key:"renderLayers",value:function(){var e=this;return this.state.tileset.tiles.map((function(t){var r=e.getSubLayerPropsByTile(t);if(t.isLoaded||t.content)if(t.layers)r&&t.layers[0]&&Object.keys(r).some((function(e){return t.layers[0].props[e]!==r[e]}))&&(t.layers=t.layers.map((function(e){return e.clone(r)})));else{var n=e.renderSubLayers(ai(ai({},e.props),{},{id:"".concat(e.id,"-").concat(t.id),data:t.content,_offset:0,tile:t}));t.layers=Object(B._flatten)(n,Boolean).map((function(e){return e.clone(ai({tile:t},r))}))}else;return t.layers}))}},{key:"filterSubLayer",value:function(e){var t=e.layer,r=e.cullRect,n=t.props.tile;return this.state.tileset.isTileVisible(n,r)}}]),r}(B.CompositeLayer);A()(ui,"defaultProps",si),A()(ui,"layerName","TileLayer");var ci=r(15),li=r.n(ci);function fi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function hi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fi(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function di(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var pi=function(e){p()(r,e);var t=di(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"getShaders",value:function(){var e=li()(m()(r.prototype),"getShaders",this).call(this);return e.inject={"vs:#decl":"uniform float trailLength;\nattribute float instanceTimestamps;\nattribute float instanceNextTimestamps;\nvarying float vTime;\n","vs:#main-end":"vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;\n","fs:#decl":"uniform bool fadeTrail;\nuniform float trailLength;\nuniform float currentTime;\nvarying float vTime;\n","fs:#main-start":"if(vTime > currentTime || (fadeTrail && (vTime < currentTime - trailLength))) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"if(fadeTrail) {\n color.a *= 1.0 - (currentTime - vTime) / trailLength;\n}\n"},e}},{key:"initializeState",value:function(){li()(m()(r.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}},{key:"draw",value:function(e){var t=this.props,n=t.fadeTrail,i=t.trailLength,a=t.currentTime;e.uniforms=hi(hi({},e.uniforms),{},{fadeTrail:n,trailLength:i,currentTime:a}),li()(m()(r.prototype),"draw",this).call(this,e)}}]),r}(B.PathLayer);A()(pi,"layerName","TripsLayer"),A()(pi,"defaultProps",{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}}});var vi=r(23),yi=r(12),gi=r.n(yi),mi=r(9),bi=r.n(mi);function Ai(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function Bi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bi(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return xi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xi(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function xi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ci(e,t){t=void 0===t?e[0][0]:t;var r,n=_i(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=i[0]-t;a>180?i[0]-=360:a<-180&&(i[0]+=360)}}catch(e){n.e(e)}finally{n.f()}}function Oi(e,t,r){var n=Object(vi.h3ToGeo)(e),i=M()(n,2),a=i[0],o=i[1],s=t.length;Ci(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c<u;c++)t[c][0]=ht(o,t[c][0],r),t[c][1]=ht(a,t[c][1],r)}function Ei(e,t,r){var n=e(t,r),i=Object(vi.h3ToGeo)(n),a=M()(i,2),o=a[0];return[a[1],o]}function Ti(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=Object(vi.h3ToGeoBoundary)(e,!0);return 1!==t?Oi(e,r,t):Ci(r),r}var Si=wi(wi({},B.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}),ki=function(e){p()(r,e);var t=Ai(r);function r(){var e;h()(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=t.call.apply(t,[this].concat(i)),A()(gi()(e),"state",void 0),e}return C()(r,[{key:"initializeState",value:function(){r._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}},{key:"shouldUpdateState",value:function(e){var t=e.changeFlags;return this._shouldUseHighPrecision()?t.propsOrDataChanged:t.somethingChanged}},{key:"updateState",value:function(e){var t=e.props,r=e.changeFlags;if(!0!==t.highPrecision&&(r.dataChanged||r.updateTriggersChanged&&r.updateTriggersChanged.getHexagon)){var n=this._calculateH3DataProps();this.setState(n)}this._updateVertices(this.context.viewport)}},{key:"_calculateH3DataProps",value:function(){var e,t=-1,r=!1,n=!1,i=Object(B.createIterable)(this.props.data),a=i.iterable,o=i.objectInfo,s=_i(a);try{for(s.s();!(e=s.n()).done;){var u=e.value;o.index++;var c=this.props.getHexagon(u,o),l=Object(vi.h3GetResolution)(c);if(t<0){if(t=l,!this.props.highPrecision)break}else if(t!==l){n=!0;break}if(Object(vi.h3IsPentagon)(c)){r=!0;break}}}catch(e){s.e(e)}finally{s.f()}return{resolution:t,edgeLengthKM:t>=0?Object(vi.edgeLength)(t,"km"):0,hasMultipleRes:n,hasPentagon:r}}},{key:"_shouldUseHighPrecision",value:function(){if("auto"===this.props.highPrecision){var e=this.state,t=e.resolution,r=e.hasPentagon,n=e.hasMultipleRes,i=this.context.viewport;return Boolean(null==i?void 0:i.resolution)||n||r||t>=0&&t<=5}return this.props.highPrecision}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,r=t.resolution,n=t.edgeLengthKM,i=t.centerHex;if(!(r<0)){var a=this.props.centerHexagon||Object(vi.geoToH3)(e.latitude,e.longitude,r);if(i!==a){if(i){var o=Object(vi.h3Distance)(i,a);if(o>=0&&o*n<10)return}var s=e.distanceScales.unitsPerMeter,u=Ti(a),c=Object(vi.h3ToGeo)(a),l=M()(c,2),f=l[0],h=l[1],d=e.projectFlat([h,f]),p=M()(d,2),v=p[0],y=p[1];u=u.map((function(t){var r=e.projectFlat(t);return[(r[0]-v)/s[0],(r[1]-y)/s[1]]})),this.setState({centerHex:a,vertices:u})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,r=e.material,n=e.coverage,i=e.extruded,a=e.wireframe,o=e.stroked,s=e.filled,u=e.lineWidthUnits,c=e.lineWidthScale,l=e.lineWidthMinPixels,f=e.lineWidthMaxPixels,h=e.getFillColor,d=e.getElevation,p=e.getLineColor,v=e.getLineWidth,y=e.transitions,g=e.updateTriggers;return{elevationScale:t,extruded:i,coverage:n,wireframe:a,stroked:o,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:f,material:r,getElevation:d,getFillColor:h,getLineColor:p,getLineWidth:v,transitions:y,updateTriggers:{getFillColor:g.getFillColor,getElevation:g.getElevation,getLineColor:g.getLineColor,getLineWidth:g.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var e=this.props,t=e.data,r=e.getHexagon,n=e.updateTriggers,i=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",B.PolygonLayer),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===bi()(e)?wi(wi({},e),{},{coverage:t}):{getHexagon:e,coverage:t}}(n.getHexagon,i),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(e,t){return function(e){var t,r=new Float64Array(2*e.length),n=0,i=_i(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;r[n++]=a[0],r[n++]=a[1]}}catch(e){i.e(e)}finally{i.f()}return r}(Ti(r(e,t),i))}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,r=e.getHexagon,n=e.updateTriggers,i=this.getSubLayerClass("hexagon-cell",B.ColumnLayer),a=this._getForwardProps();return a.updateTriggers.getPosition=n.getHexagon,new i(a,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Ei.bind(null,r)})}}]),r}(B.CompositeLayer);function Mi(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ii(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ii(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ii(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ri(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}A()(ki,"defaultProps",Si),A()(ki,"layerName","H3HexagonLayer"),A()(ki,"_checkH3Lib",(function(){}));var Pi=function(e){p()(r,e);var t=Ri(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"initializeState",value:function(){ki._checkH3Lib()}},{key:"updateState",value:function(e){var t=e.props,r=e.changeFlags;if(r.dataChanged||r.updateTriggersChanged&&r.updateTriggersChanged.getHexagons){var n,i=t.data,a=t.getHexagons,o=[],s=Object(B.createIterable)(i),u=s.iterable,c=s.objectInfo,l=Mi(u);try{for(l.s();!(n=l.n()).done;){var f=n.value;c.index++;var h,d=a(f,c),p=Mi(Object(vi.h3SetToMultiPolygon)(d,!0));try{for(p.s();!(h=p.n()).done;){var v=h.value;o.push(this.getSubLayerRow({polygon:v},f,c.index))}}catch(e){p.e(e)}finally{p.f()}}}catch(e){l.e(e)}finally{l.f()}this.setState({polygons:o})}}},{key:"indexToBounds",value:function(){return{data:this.state.polygons,getPolygon:function(e){return e.polygon}}}}]),r}(S);A()(Pi,"layerName","H3ClusterLayer"),A()(Pi,"defaultProps",{getHexagons:{type:"accessor",value:function(e){return e.hexagons}}});var Fi=r(31);function Di(){return!("object"===("undefined"==typeof process?"undefined":bi()(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===bi()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===bi()(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":bi()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}Di();function Li(e){try{var t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}var ji,Gi=function(){function e(t){h()(this,e);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Jn(this,"storage",void 0),Jn(this,"id",void 0),Jn(this,"config",{}),this.storage=Li(n),this.id=t,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return C()(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function Ui(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?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]}function Ni(e){return"string"==typeof e?ji[e.toUpperCase()]||ji.WHITE:e}function Hi(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ji(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ji(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ji(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Vi(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),a=Hi(i);try{var o=function(){var n=t.value;"function"==typeof e[n]&&(r.find((function(e){return n===e}))||(e[n]=e[n].bind(e)))};for(a.s();!(t=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}}function zi(e,t){if(!e)throw new Error(t||"Assertion failed")}!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"}(ji||(ji={}));var Ki={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":bi()(process))&&process},qi=(globalThis,Ki.window||Ki.self||Ki.global),Xi=Ki.process||{};console;function Qi(){var e,t,r;if(Di&&"performance"in qi)e=null==qi||null===(t=qi.performance)||void 0===t||null===(r=t.now)||void 0===r?void 0:r.call(t);else if("hrtime"in Xi){var n,i=null==Xi||null===(n=Xi.hrtime)||void 0===n?void 0:n.call(Xi);e=1e3*i[0]+i[1]/1e6}else e=Date.now();return e}var Wi={debug:Di&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Zi={enabled:!0,level:0};function Yi(){}var $i={},ea={once:!0},ta=function(){function e(){h()(this,e);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=t.id;Jn(this,"id",void 0),Jn(this,"VERSION","8.9.0-alpha.5"),Jn(this,"_startTs",Qi()),Jn(this,"_deltaTs",Qi()),Jn(this,"_storage",void 0),Jn(this,"userData",{}),Jn(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this._storage=new Gi("__probe-".concat(this.id,"__"),Zi),this.userData={},this.timeStamp("".concat(this.id," started")),Vi(this),Object.seal(this)}return C()(e,[{key:"level",get:function(){return this.getLevel()},set:function(e){this.setLevel(e)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Qi()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Qi()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(e){this.level=e}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({level:e}),this}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(A()({},e,t))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(e,t){zi(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Wi.warn,arguments,ea)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Wi.error,arguments)}},{key:"deprecated",value:function(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}},{key:"removed",value:function(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}},{key:"probe",value:function(e,t){return this._getLogFunction(e,t,Wi.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,Wi.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return this._getLogFunction(e,t,Wi.debug||Wi.info,arguments,ea)}},{key:"table",value:function(e,t,r){return t?this._getLogFunction(e,t,console.table||Yi,r&&[r],{tag:ia(t)}):Yi}},{key:"image",value:function(e){var t=e.logLevel,n=e.priority,i=e.image,a=e.message,o=void 0===a?"":a,s=e.scale,u=void 0===s?1:s;return this._shouldLog(t||n)?Di?function(e){var t=e.image,r=e.message,n=void 0===r?"":r,i=e.scale,a=void 0===i?1:i;if("string"==typeof t){var o=new Image;return o.onload=function(){var e,t=Ui(o,n,a);(e=console).log.apply(e,Le()(t))},o.src=t,Yi}var s=t.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,Le()(Ui(t,n,a))),Yi}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,Le()(Ui(c,n,a)))},c.src=t.toDataURL(),Yi}return Yi}({image:i,message:o,scale:u}):function(e){var t=e.image,n=(e.message,e.scale),i=void 0===n?1:n,a=null;try{a=r(95)}catch(e){}if(a)return function(){return a(t,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(e){return console.log(e)}))};return Yi}({image:i,message:o,scale:u}):Yi}},{key:"time",value:function(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,t){return this._getLogFunction(e,t,console.timeStamp||Yi)}},{key:"group",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=na({logLevel:e,message:t,opts:r}),i=r.collapsed;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}},{key:"groupCollapsed",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||Yi)}},{key:"withGroup",value:function(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=ra(e)}},{key:"_getLogFunction",value:function(e,t,r,n,i){if(this._shouldLog(e)){var a;i=na({logLevel:e,message:t,args:n,opts:i}),zi(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Qi();var o=i.tag||i.message;if(i.once){if($i[o])return Yi;$i[o]=Qi()}return t=function(e,t,r){if("string"==typeof t){var n=r.time?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}((s=r.total)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s")):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),i=t,a=r.color,o=r.background,Di||"string"!=typeof i||(a&&(a=Ni(a),i="[".concat(a,"m").concat(i,"")),o&&(a=Ni(o),i="[".concat(o+10,"m").concat(i,""))),t=i}var i,a,o;var s;return t}(this.id,i.message,i),(a=r).bind.apply(a,[console,t].concat(Le()(i.args)))}return Yi}}]),e}();function ra(e){if(!e)return 0;var t;switch(bi()(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return zi(Number.isFinite(t)&&t>=0),t}function na(e){var t=e.logLevel,r=e.message;e.logLevel=ra(t);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==r;);switch(bi()(t)){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());var i=bi()(e.message);return zi("string"===i||"object"===i),Object.assign(e,{args:n},e.opts)}function ia(e){for(var t in e)for(var r in e[t])return r||"untitled";return"empty"}Jn(ta,"VERSION","8.9.0-alpha.5");var aa=new ta({id:"luma.gl"});function oa(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function sa(e){return"undefined"!=typeof WebGLRenderingContext&&e instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&Number.isFinite(e._version)))}function ua(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}function ca(e){return oa(sa(e),"Invalid WebGLRenderingContext"),e}function la(e){return oa(ua(e),"Requires WebGL2"),e}var fa={};function ha(e,t){var r;fa[e]=!0,void 0!==t&&(r=t,globalThis.console&&globalThis.console.error&&globalThis.console.error(r))}var da=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};(da.VertexAttrib=function(e){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()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var pa,va=function(e){var t=this;this.gl=e,function(e){var t=e.getError;e.getError=function(){var r;do{0!==(r=t.apply(e))&&(fa[r]=!0)}while(0!==r);for(r in fa)if(fa[r])return delete fa[r],parseInt(r,10);return 0}}(e);var r=this.original={getParameter:e.getParameter,enableVertexAttribArray:e.enableVertexAttribArray,disableVertexAttribArray:e.disableVertexAttribArray,bindBuffer:e.bindBuffer,getVertexAttrib:e.getVertexAttrib,vertexAttribPointer:e.vertexAttribPointer};e.getParameter=function(e){return e===t.VERTEX_ARRAY_BINDING_OES?t.currentVertexArrayObject===t.defaultVertexArrayObject?null:t.currentVertexArrayObject:r.getParameter.apply(this,arguments)},e.enableVertexAttribArray=function(e){var n=t.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,e);var i=n.attribs[e];return i.enabled=!0,r.enableVertexAttribArray.apply(this,arguments)},e.disableVertexAttribArray=function(e){var n=t.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,e);var i=n.attribs[e];return i.enabled=!1,r.disableVertexAttribArray.apply(this,arguments)},e.bindBuffer=function(e,n){switch(e){case 34962:t.currentArrayBuffer=n;break;case 34963:t.currentVertexArrayObject.elementArrayBuffer=n}return r.bindBuffer.apply(this,arguments)},e.getVertexAttrib=function(e,n){var i=t.currentVertexArrayObject,a=i.attribs[e];switch(n){case 34975:return a.buffer;case 34338:return a.enabled;case 34339:return a.size;case 34340:return a.stride;case 34341:return a.type;case 34922:return a.normalized;default:return r.getVertexAttrib.apply(this,arguments)}},e.vertexAttribPointer=function(e,n,i,a,o,s){var u=t.currentVertexArrayObject;u.maxAttrib=Math.max(u.maxAttrib,e);var c=u.attribs[e];return c.buffer=t.currentArrayBuffer,c.size=n,c.type=i,c.normalized=a,c.stride=o,c.offset=s,c.recache(),r.vertexAttribPointer.apply(this,arguments)},e.instrumentExtension&&e.instrumentExtension(this,"OES_vertex_array_object"),e.canvas&&e.canvas.addEventListener("webglcontextrestored",(function(){var e;e="OESVertexArrayObject emulation library context restored",globalThis.console&&globalThis.console.log&&globalThis.console.log(e),t.reset_()}),!0),this.reset_()};va.prototype.VERTEX_ARRAY_BINDING_OES=34229,va.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(var e=0;e<this.vertexArrayObjects.length;++e)this.vertexArrayObjects.isAlive=!1;var t=this.gl;this.maxVertexAttribs=t.getParameter(34921),this.defaultVertexArrayObject=new da(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},va.prototype.createVertexArrayOES=function(){var e=new da(this);return this.vertexArrayObjects.push(e),e},va.prototype.deleteVertexArrayOES=function(e){e.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(e),1),this.currentVertexArrayObject===e&&this.bindVertexArrayOES(null)},va.prototype.isVertexArrayOES=function(e){return!!(e&&e instanceof da&&e.hasBeenBound&&e.ext===this)},va.prototype.bindVertexArrayOES=function(e){var t=this.gl;if(!e||e.isAlive){var r=this.original,n=this.currentVertexArrayObject;this.currentVertexArrayObject=e||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(n!==i){n&&i.elementArrayBuffer===n.elementArrayBuffer||r.bindBuffer.call(t,34963,i.elementArrayBuffer);for(var a=this.currentArrayBuffer,o=Math.max(n?n.maxAttrib:0,i.maxAttrib),s=0;s<=o;s++){var u=i.attribs[s],c=n?n.attribs[s]:null;if(n&&u.enabled===c.enabled||(u.enabled?r.enableVertexAttribArray.call(t,s):r.disableVertexAttribArray.call(t,s)),u.enabled){var l=!1;n&&u.buffer===c.buffer||(a!==u.buffer&&(r.bindBuffer.call(t,34962,u.buffer),a=u.buffer),l=!0),(l||u.cached!==c.cached)&&r.vertexAttribPointer.call(t,s,u.size,u.type,u.normalized,u.stride,u.offset)}}this.currentArrayBuffer!==a&&r.bindBuffer.call(t,34962,this.currentArrayBuffer)}}else ha(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject")};var ya,ga=function(e){return ua(e)?void 0:0},ma=(pa={},A()(pa,3074,(function(e){return ua(e)?void 0:36064})),A()(pa,35723,(function(e){return ua(e)?void 0:4352})),A()(pa,35977,ga),A()(pa,32937,ga),A()(pa,36795,(function(e,t){var r=ua(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return r&&r.GPU_DISJOINT_EXT?t(r.GPU_DISJOINT_EXT):0})),A()(pa,37445,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_VENDOR_WEBGL||7936)})),A()(pa,37446,(function(e,t){var r=e.getExtension("WEBGL_debug_renderer_info");return t(r&&r.UNMASKED_RENDERER_WEBGL||7937)})),A()(pa,34047,(function(e,t){var r=e.luma.extensions.EXT_texture_filter_anisotropic;return r?t(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1})),A()(pa,32883,ga),A()(pa,35071,ga),A()(pa,37447,ga),A()(pa,36063,(function(e,t){if(!ua(e)){var r=e.getExtension("WEBGL_draw_buffers");return r?t(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}})),A()(pa,35379,ga),A()(pa,35374,ga),A()(pa,35377,ga),A()(pa,34852,(function(e){if(!ua(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}})),A()(pa,36203,(function(e){return e.getExtension("OES_element_index")?2147483647:65535})),A()(pa,33001,(function(e){return e.getExtension("OES_element_index")?16777216:65535})),A()(pa,33e3,(function(e){return 16777216})),A()(pa,37157,ga),A()(pa,35373,ga),A()(pa,35657,ga),A()(pa,36183,ga),A()(pa,37137,ga),A()(pa,34045,ga),A()(pa,35978,ga),A()(pa,35979,ga),A()(pa,35968,ga),A()(pa,35376,ga),A()(pa,35375,ga),A()(pa,35659,ga),A()(pa,37154,ga),A()(pa,35371,ga),A()(pa,35658,ga),A()(pa,35076,ga),A()(pa,35077,ga),A()(pa,35380,ga),pa);var ba,Aa,Ba,wa=(ya={},A()(ya,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){oa(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),A()(ya,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){oa(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),A()(ya,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){oa(!1)}}),A()(ya,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){oa(!1)},deleteQuery:function(){oa(!1)},beginQuery:function(){oa(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),ya),_a={readBuffer:function(e,t,r){ua(e)&&t(r)},getVertexAttrib:function(e,t,r,n){var i,a=function(e,t){return{webgl2:ua(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(n){case 35069:i=!!o&&void 0;break;case 35070:i=o||s?void 0:0}return void 0!==i?i:t(r,n)},getProgramParameter:function(e,t,r,n){if(!ua(e))switch(n){case 35967:return 35981;case 35971:case 35382:return 0}return t(r,n)},getInternalformatParameter:function(e,t,r,n,i){if(!ua(e))switch(i){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(r,n,i)},getTexParameter:function(e,t,r,n){switch(n){case 34046:var i=e.luma.extensions.EXT_texture_filter_anisotropic;n=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(r,n)},getParameter:function(e,t,r){var n=ma[r],i="function"==typeof n?n(e,t,r):n;return void 0!==i?i:t(r)},hint:function(e,t,r,n){return t(r,n)}};function xa(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ca(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ca(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ca(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Oa(e,t){var r=t.extension,n=t.target,i=t.target2,a=wa[r];oa(a);for(var o=a.meta,s=(void 0===o?{}:o).suffix,u=void 0===s?"":s,c=e.getExtension(r),l=function(){var t=h[f],r="".concat(t).concat(u),o=null;"meta"===t||"function"==typeof e[t]||(c&&"function"==typeof c[r]?o=function(){return c[r].apply(c,arguments)}:"function"==typeof a[t]&&(o=a[t].bind(n))),o&&(n[t]=o,i[t]=o)},f=0,h=Object.keys(a);f<h.length;f++)l()}globalThis.polyfillContext=function(e){e.luma=e.luma||{};var t=e.luma;return t.polyfilled||(!function(e){if("function"!=typeof e.createVertexArray){var t=e.getSupportedExtensions;e.getSupportedExtensions=function(){var e=t.call(this)||[];return e.indexOf("OES_vertex_array_object")<0&&e.push("OES_vertex_array_object"),e};var r=e.getExtension;e.getExtension=function(t){var n=r.call(this,t);return n||("OES_vertex_array_object"!==t?null:(e.__OESVertexArrayObject||(this.__OESVertexArrayObject=new va(this)),this.__OESVertexArrayObject))}}}(e),function(e){e.luma.extensions={};var t,r=xa(e.getSupportedExtensions()||[]);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.luma[n]=e.getExtension(n)}}catch(e){r.e(e)}finally{r.f()}}(e),function(e,t){var r,n=xa(Object.getOwnPropertyNames(t));try{for(n.s();!(r=n.n()).done;){var i=r.value;"overrides"!==i&&Oa(e,{extension:i,target:e.luma,target2:e})}}catch(e){n.e(e)}finally{n.f()}}(e,wa),function(e,t){var r=t.target,n=t.target2;Object.keys(_a).forEach((function(t){if("function"==typeof _a[t]){var i=e[t]?e[t].bind(e):function(){},a=_a[t].bind(null,e,i);r[t]=a,n[t]=a}}))}(e,{target:t,target2:e}),t.polyfilled=!0),e};var Ea=(ba={},A()(ba,3042,!1),A()(ba,32773,new Float32Array([0,0,0,0])),A()(ba,32777,32774),A()(ba,34877,32774),A()(ba,32969,1),A()(ba,32968,0),A()(ba,32971,1),A()(ba,32970,0),A()(ba,3106,new Float32Array([0,0,0,0])),A()(ba,3107,[!0,!0,!0,!0]),A()(ba,2884,!1),A()(ba,2885,1029),A()(ba,2929,!1),A()(ba,2931,1),A()(ba,2932,513),A()(ba,2928,new Float32Array([0,1])),A()(ba,2930,!0),A()(ba,3024,!0),A()(ba,36006,null),A()(ba,2886,2305),A()(ba,33170,4352),A()(ba,2849,1),A()(ba,32823,!1),A()(ba,32824,0),A()(ba,10752,0),A()(ba,32938,1),A()(ba,32939,!1),A()(ba,3089,!1),A()(ba,3088,new Int32Array([0,0,1024,1024])),A()(ba,2960,!1),A()(ba,2961,0),A()(ba,2968,4294967295),A()(ba,36005,4294967295),A()(ba,2962,519),A()(ba,2967,0),A()(ba,2963,4294967295),A()(ba,34816,519),A()(ba,36003,0),A()(ba,36004,4294967295),A()(ba,2964,7680),A()(ba,2965,7680),A()(ba,2966,7680),A()(ba,34817,7680),A()(ba,34818,7680),A()(ba,34819,7680),A()(ba,2978,[0,0,1024,1024]),A()(ba,3333,4),A()(ba,3317,4),A()(ba,37440,!1),A()(ba,37441,!1),A()(ba,37443,37444),A()(ba,35723,4352),A()(ba,36010,null),A()(ba,35977,!1),A()(ba,3330,0),A()(ba,3332,0),A()(ba,3331,0),A()(ba,3314,0),A()(ba,32878,0),A()(ba,3316,0),A()(ba,3315,0),A()(ba,32877,0),ba),Ta=function(e,t,r){return t?e.enable(r):e.disable(r)},Sa=function(e,t,r){return e.hint(r,t)},ka=function(e,t,r){return e.pixelStorei(r,t)};function Ma(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var Ia=(Aa={},A()(Aa,3042,Ta),A()(Aa,32773,(function(e,t){return e.blendColor.apply(e,Le()(t))})),A()(Aa,32777,"blendEquation"),A()(Aa,34877,"blendEquation"),A()(Aa,32969,"blendFunc"),A()(Aa,32968,"blendFunc"),A()(Aa,32971,"blendFunc"),A()(Aa,32970,"blendFunc"),A()(Aa,3106,(function(e,t){return e.clearColor.apply(e,Le()(t))})),A()(Aa,3107,(function(e,t){return e.colorMask.apply(e,Le()(t))})),A()(Aa,2884,Ta),A()(Aa,2885,(function(e,t){return e.cullFace(t)})),A()(Aa,2929,Ta),A()(Aa,2931,(function(e,t){return e.clearDepth(t)})),A()(Aa,2932,(function(e,t){return e.depthFunc(t)})),A()(Aa,2928,(function(e,t){return e.depthRange.apply(e,Le()(t))})),A()(Aa,2930,(function(e,t){return e.depthMask(t)})),A()(Aa,3024,Ta),A()(Aa,35723,Sa),A()(Aa,36006,(function(e,t){var r=ua(e)?36009:36160;return e.bindFramebuffer(r,t)})),A()(Aa,2886,(function(e,t){return e.frontFace(t)})),A()(Aa,33170,Sa),A()(Aa,2849,(function(e,t){return e.lineWidth(t)})),A()(Aa,32823,Ta),A()(Aa,32824,"polygonOffset"),A()(Aa,10752,"polygonOffset"),A()(Aa,35977,Ta),A()(Aa,32938,"sampleCoverage"),A()(Aa,32939,"sampleCoverage"),A()(Aa,3089,Ta),A()(Aa,3088,(function(e,t){return e.scissor.apply(e,Le()(t))})),A()(Aa,2960,Ta),A()(Aa,2961,(function(e,t){return e.clearStencil(t)})),A()(Aa,2968,(function(e,t){return e.stencilMaskSeparate(1028,t)})),A()(Aa,36005,(function(e,t){return e.stencilMaskSeparate(1029,t)})),A()(Aa,2962,"stencilFuncFront"),A()(Aa,2967,"stencilFuncFront"),A()(Aa,2963,"stencilFuncFront"),A()(Aa,34816,"stencilFuncBack"),A()(Aa,36003,"stencilFuncBack"),A()(Aa,36004,"stencilFuncBack"),A()(Aa,2964,"stencilOpFront"),A()(Aa,2965,"stencilOpFront"),A()(Aa,2966,"stencilOpFront"),A()(Aa,34817,"stencilOpBack"),A()(Aa,34818,"stencilOpBack"),A()(Aa,34819,"stencilOpBack"),A()(Aa,2978,(function(e,t){return e.viewport.apply(e,Le()(t))})),A()(Aa,3333,ka),A()(Aa,3317,ka),A()(Aa,37440,ka),A()(Aa,37441,ka),A()(Aa,37443,ka),A()(Aa,3330,ka),A()(Aa,3332,ka),A()(Aa,3331,ka),A()(Aa,36010,(function(e,t){return e.bindFramebuffer(36008,t)})),A()(Aa,3314,ka),A()(Aa,32878,ka),A()(Aa,3316,ka),A()(Aa,3315,ka),A()(Aa,32877,ka),A()(Aa,"framebuffer",(function(e,t){var r=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,r)})),A()(Aa,"blend",(function(e,t){return t?e.enable(3042):e.disable(3042)})),A()(Aa,"blendColor",(function(e,t){return e.blendColor.apply(e,Le()(t))})),A()(Aa,"blendEquation",(function(e,t){t=Ma(t)?t:[t,t],e.blendEquationSeparate.apply(e,Le()(t))})),A()(Aa,"blendFunc",(function(e,t){t=Ma(t)&&2===t.length?[].concat(Le()(t),Le()(t)):t,e.blendFuncSeparate.apply(e,Le()(t))})),A()(Aa,"clearColor",(function(e,t){return e.clearColor.apply(e,Le()(t))})),A()(Aa,"clearDepth",(function(e,t){return e.clearDepth(t)})),A()(Aa,"clearStencil",(function(e,t){return e.clearStencil(t)})),A()(Aa,"colorMask",(function(e,t){return e.colorMask.apply(e,Le()(t))})),A()(Aa,"cull",(function(e,t){return t?e.enable(2884):e.disable(2884)})),A()(Aa,"cullFace",(function(e,t){return e.cullFace(t)})),A()(Aa,"depthTest",(function(e,t){return t?e.enable(2929):e.disable(2929)})),A()(Aa,"depthFunc",(function(e,t){return e.depthFunc(t)})),A()(Aa,"depthMask",(function(e,t){return e.depthMask(t)})),A()(Aa,"depthRange",(function(e,t){return e.depthRange.apply(e,Le()(t))})),A()(Aa,"dither",(function(e,t){return t?e.enable(3024):e.disable(3024)})),A()(Aa,"derivativeHint",(function(e,t){e.hint(35723,t)})),A()(Aa,"frontFace",(function(e,t){return e.frontFace(t)})),A()(Aa,"mipmapHint",(function(e,t){return e.hint(33170,t)})),A()(Aa,"lineWidth",(function(e,t){return e.lineWidth(t)})),A()(Aa,"polygonOffsetFill",(function(e,t){return t?e.enable(32823):e.disable(32823)})),A()(Aa,"polygonOffset",(function(e,t){return e.polygonOffset.apply(e,Le()(t))})),A()(Aa,"sampleCoverage",(function(e,t){return e.sampleCoverage.apply(e,Le()(t))})),A()(Aa,"scissorTest",(function(e,t){return t?e.enable(3089):e.disable(3089)})),A()(Aa,"scissor",(function(e,t){return e.scissor.apply(e,Le()(t))})),A()(Aa,"stencilTest",(function(e,t){return t?e.enable(2960):e.disable(2960)})),A()(Aa,"stencilMask",(function(e,t){var r=t=Ma(t)?t:[t,t],n=M()(r,2),i=n[0],a=n[1];e.stencilMaskSeparate(1028,i),e.stencilMaskSeparate(1029,a)})),A()(Aa,"stencilFunc",(function(e,t){var r=t=Ma(t)&&3===t.length?[].concat(Le()(t),Le()(t)):t,n=M()(r,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5];e.stencilFuncSeparate(1028,i,a,o),e.stencilFuncSeparate(1029,s,u,c)})),A()(Aa,"stencilOp",(function(e,t){var r=t=Ma(t)&&3===t.length?[].concat(Le()(t),Le()(t)):t,n=M()(r,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5];e.stencilOpSeparate(1028,i,a,o),e.stencilOpSeparate(1029,s,u,c)})),A()(Aa,"viewport",(function(e,t){return e.viewport.apply(e,Le()(t))})),Aa);function Ra(e,t,r){return void 0!==t[e]?t[e]:r[e]}var Pa={blendEquation:function(e,t,r){return e.blendEquationSeparate(Ra(32777,t,r),Ra(34877,t,r))},blendFunc:function(e,t,r){return e.blendFuncSeparate(Ra(32969,t,r),Ra(32968,t,r),Ra(32971,t,r),Ra(32970,t,r))},polygonOffset:function(e,t,r){return e.polygonOffset(Ra(32824,t,r),Ra(10752,t,r))},sampleCoverage:function(e,t,r){return e.sampleCoverage(Ra(32938,t,r),Ra(32939,t,r))},stencilFuncFront:function(e,t,r){return e.stencilFuncSeparate(1028,Ra(2962,t,r),Ra(2967,t,r),Ra(2963,t,r))},stencilFuncBack:function(e,t,r){return e.stencilFuncSeparate(1029,Ra(34816,t,r),Ra(36003,t,r),Ra(36004,t,r))},stencilOpFront:function(e,t,r){return e.stencilOpSeparate(1028,Ra(2964,t,r),Ra(2965,t,r),Ra(2966,t,r))},stencilOpBack:function(e,t,r){return e.stencilOpSeparate(1029,Ra(34817,t,r),Ra(34818,t,r),Ra(34819,t,r))}},Fa={enable:function(e,t){return e(A()({},t,!0))},disable:function(e,t){return e(A()({},t,!1))},pixelStorei:function(e,t,r){return e(A()({},t,r))},hint:function(e,t,r){return e(A()({},t,r))},bindFramebuffer:function(e,t,r){var n;switch(t){case 36160:return e((n={},A()(n,36006,r),A()(n,36010,r),n));case 36009:return e(A()({},36006,r));case 36008:return e(A()({},36010,r));default:return null}},blendColor:function(e,t,r,n,i){return e(A()({},32773,new Float32Array([t,r,n,i])))},blendEquation:function(e,t){var r;return e((r={},A()(r,32777,t),A()(r,34877,t),r))},blendEquationSeparate:function(e,t,r){var n;return e((n={},A()(n,32777,t),A()(n,34877,r),n))},blendFunc:function(e,t,r){var n;return e((n={},A()(n,32969,t),A()(n,32968,r),A()(n,32971,t),A()(n,32970,r),n))},blendFuncSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,32969,t),A()(a,32968,r),A()(a,32971,n),A()(a,32970,i),a))},clearColor:function(e,t,r,n,i){return e(A()({},3106,new Float32Array([t,r,n,i])))},clearDepth:function(e,t){return e(A()({},2931,t))},clearStencil:function(e,t){return e(A()({},2961,t))},colorMask:function(e,t,r,n,i){return e(A()({},3107,[t,r,n,i]))},cullFace:function(e,t){return e(A()({},2885,t))},depthFunc:function(e,t){return e(A()({},2932,t))},depthRange:function(e,t,r){return e(A()({},2928,new Float32Array([t,r])))},depthMask:function(e,t){return e(A()({},2930,t))},frontFace:function(e,t){return e(A()({},2886,t))},lineWidth:function(e,t){return e(A()({},2849,t))},polygonOffset:function(e,t,r){var n;return e((n={},A()(n,32824,t),A()(n,10752,r),n))},sampleCoverage:function(e,t,r){var n;return e((n={},A()(n,32938,t),A()(n,32939,r),n))},scissor:function(e,t,r,n,i){return e(A()({},3088,new Int32Array([t,r,n,i])))},stencilMask:function(e,t){var r;return e((r={},A()(r,2968,t),A()(r,36005,t),r))},stencilMaskSeparate:function(e,t,r){return e(A()({},1028===t?2968:36005,r))},stencilFunc:function(e,t,r,n){var i;return e((i={},A()(i,2962,t),A()(i,2967,r),A()(i,2963,n),A()(i,34816,t),A()(i,36003,r),A()(i,36004,n),i))},stencilFuncSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,1028===t?2962:34816,r),A()(a,1028===t?2967:36003,n),A()(a,1028===t?2963:36004,i),a))},stencilOp:function(e,t,r,n){var i;return e((i={},A()(i,2964,t),A()(i,2965,r),A()(i,2966,n),A()(i,34817,t),A()(i,34818,r),A()(i,34819,n),i))},stencilOpSeparate:function(e,t,r,n,i){var a;return e((a={},A()(a,1028===t?2964:34817,r),A()(a,1028===t?2965:34818,n),A()(a,1028===t?2966:34819,i),a))},viewport:function(e,t,r,n,i){return e(A()({},2978,[t,r,n,i]))}},Da=function(e,t){return e.isEnabled(t)},La=(Ba={},A()(Ba,3042,Da),A()(Ba,2884,Da),A()(Ba,2929,Da),A()(Ba,3024,Da),A()(Ba,32823,Da),A()(Ba,32926,Da),A()(Ba,32928,Da),A()(Ba,3089,Da),A()(Ba,2960,Da),A()(Ba,35977,Da),Ba);function ja(e){for(var t in e)return!1;return!0}function Ga(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 Ua(e,t){var r=e[t].bind(e);e[t]=function(){var t=arguments.length<=0?void 0:arguments[0];return t in e.state.cache&&e.state.enable?e.state.cache[t]:r.apply(void 0,arguments)},Object.defineProperty(e[t],"name",{value:"".concat(t,"-from-cache"),configurable:!1})}function Na(e,t,r){var n=e[t].bind(e);e[t]=function(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];var o=r.apply(void 0,[e.state._updateCache].concat(i)),s=o.valueChanged,u=o.oldValue;return s&&n.apply(void 0,i),u},Object.defineProperty(e[t],"name",{value:"".concat(t,"-to-cache"),configurable:!1})}function Ha(e){var t=e.useProgram.bind(e);e.useProgram=function(r){e.state.program!==r&&(t(r),e.state.program=r)}}var Ja=function(){function e(t){h()(this,e);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.copyState,i=void 0!==n&&n,a=r.log,o=void 0===a?function(){}:a;this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=i?Qa(t):Object.assign({},Ea),this.log=o,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return C()(e,[{key:"push",value:function(){this.stateStack.push({})}},{key:"pop",value:function(){oa(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Xa(this.gl,e),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,r=!1,n=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var i in e){oa(void 0!==i);var a=e[i],o=this.cache[i];Ga(a,o)||(r=!0,t=o,n&&!(i in n)&&(n[i]=o),this.cache[i]=a)}return{valueChanged:r,oldValue:t}}}]),e}();function Va(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.enable,n=void 0===r||r,i=t.copyState;if(oa(void 0!==i),!e.state){var a=globalThis.polyfillContext;for(var o in a&&a(e),e.state=new Ja(e,{copyState:i}),Ha(e),Fa){var s=Fa[o];Na(e,o,s)}Ua(e,"getParameter"),Ua(e,"isEnabled")}return e.state.enable=n,e}function za(e){oa(e.state),e.state.pop()}function Ka(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return qa(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qa(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function qa(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Xa(e,t){if(oa(sa(e),"setParameters requires a WebGL context"),!ja(t)){var r={};for(var n in t){var i=Number(n),a=Ia[n];a&&("string"==typeof a?r[a]=!0:a(e,t[n],i))}var o=e.state&&e.state.cache;if(o)for(var s in r){(0,Pa[s])(e,t,o)}}}function Qa(e,t){if("number"==typeof(t=t||Ea)){var r=t,n=La[r];return n?n(e,r):e.getParameter(r)}var i,a={},o=Ka(Array.isArray(t)?t:Object.keys(t));try{for(o.s();!(i=o.n()).done;){var s=i.value,u=La[s];a[s]=u?u(e,Number(s)):e.getParameter(Number(s))}}catch(e){o.e(e)}finally{o.f()}return a}function Wa(e,t,r){if(ja(t))return r(e);var n,i=t.nocatch,a=void 0===i||i;if(function(e){e.state||Va(e,{copyState:!1}),e.state.push()}(e),Xa(e,t),a)n=r(e),za(e);else try{n=r(e)}finally{za(e)}return n}var Za=Di();var Ya=function(){function e(){h()(this,e),this.stats=new Map}return C()(e,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new Kn({id:e})),this.stats.get(e)}}]),e}(),$a=new Ya;if(globalThis.luma&&"8.5.16"!==globalThis.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat("8.5.16"));globalThis.luma||(Di()&&aa.log(1,"luma.gl ".concat("8.5.16"," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:"8.5.16",version:"8.5.16",log:aa,stats:$a,globals:{modules:{},nodeIO:{}}});globalThis.luma;function eo(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function to(e,t){if("string"!=typeof t)return t;var r=Number(t);if(!isNaN(r))return r;var n=e[t=t.replace(/^.*\./,"")];return eo(void 0!==n,"Accessing undefined constant GL.".concat(t)),n}function ro(e,t){for(var r in t=Number(t),e)if(e[r]===t)return"GL.".concat(r);return String(t)}var no={};function io(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";no[e]=no[e]||1;var t=no[e]++;return"".concat(e,"-").concat(t)}function ao(e){return eo("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function oo(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return so(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return so(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function so(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var uo="Resource subclass must define virtual methods",co=function(e){function t(e){h()(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ca(e);var n=r.id,i=r.userData,a=void 0===i?{}:i;this.gl=e,this.gl2=e,this.id=n||io(this[Symbol.toStringTag]),this.userData=a,this._bound=!1,this._handle=r.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._initStats(),this._addStats()}return C()(t,[{key:e,get:function(){return"Resource"}},{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}},{key:"handle",get:function(){return this._handle}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.deleteChildren,r=void 0!==t&&t,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&r&&n.filter(Boolean).forEach((function(e){return e.delete()})),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};eo(e=to(this.gl,e));var r=this.constructor.PARAMETERS||{},n=r[e];if(n){var i=ua(this.gl),a=(!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension));if(!a){var o=n.webgl1,s="webgl2"in n?n.webgl2:n.webgl1,u=i?s:o;return u}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.parameters,n=t.keys,i=this.constructor.PARAMETERS||{},a=ua(this.gl),o={},s=r||Object.keys(i),u=oo(s);try{for(u.s();!(e=u.n()).done;){var c=e.value,l=i[c],f=l&&(!("webgl2"in l)||a)&&(!("extension"in l)||this.gl.getExtension(l.extension));if(f){var h=n?ro(this.gl,c):c;o[h]=this.getParameter(c,t),n&&"GLenum"===l.type&&(o[h]=ro(this.gl,o[h]))}}}catch(e){u.e(e)}finally{u.f()}return o}},{key:"setParameter",value:function(e,t){eo(e=to(this.gl,e));var r=(this.constructor.PARAMETERS||{})[e];if(r){var n=ua(this.gl);if(!((!("webgl2"in r)||n)&&(!("extension"in r)||this.gl.getExtension(r.extension))))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=to(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,r){return function(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(e){a.methodName||(a[e]=function(){throw aa.removed("Calling removed method ".concat(t,".").concat(e,": "),i)(),new Error(e)})}))}(this,e,t,r)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(uo)}},{key:"_deleteHandle",value:function(){throw new Error(uo)}},{key:"_bindHandle",value:function(e){throw new Error(uo)}},{key:"_getOptsFromHandle",value:function(){throw new Error(uo)}},{key:"_getParameter",value:function(e,t){throw new Error(uo)}},{key:"_setParameter",value:function(e,t){throw new Error(uo)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_initStats",value:function(){this.gl.stats=this.gl.stats||new Ya}},{key:"_addStats",value:function(){var e=this[Symbol.toStringTag],t=$a.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this[Symbol.toStringTag];$a.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag];this._doTrackAllocatedMemory(e,t),this._doTrackAllocatedMemory(e,t,this.gl.stats.get("Memory Usage"))}},{key:"_doTrackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$a.get("Memory Usage");r.get("GPU Memory").addCount(e),r.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag];this._doTrackDeallocatedMemory(e),this._doTrackDeallocatedMemory(e,this.gl.stats.get("Memory Usage"))}},{key:"_doTrackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$a.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}}]),t}(Symbol.toStringTag),lo=r(58),fo=r.n(lo);function ho(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function po(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.clamped,n=void 0===r||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 vo(e){var t=e.data,r=e.width,n=e.height,i=e.bytesPerPixel,a=void 0===i?4:i,o=e.temp,s=r*a;o=o||new Uint8Array(s);for(var u=0;u<n/2;++u){var c=u*s,l=(n-u-1)*s;o.set(t.subarray(c,c+s)),t.copyWithin(c,l,l+s),t.set(o,l)}}function yo(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 c=0;c<4;c++)o[4*(s*i+u)+c]=t[4*(2*s*r+2*u)+c];return{data:o,width:i,height:a}}function go(e,t,r){var n=r.removedProps,i=void 0===n?{}:n,a=r.deprecatedProps,o=void 0===a?{}:a,s=r.replacedProps,u=void 0===s?{}:s;for(var c in i)if(c in t){var l=i[c]?"".concat(e,".").concat(i[c]):"N/A";aa.removed("".concat(e,".").concat(c),l)()}for(var f in o)if(f in t){var h=o[f];aa.deprecated("".concat(e,".").concat(f),"".concat(e,".").concat(h))()}var d=null;for(var p in u)if(p in t){var v=u[p];aa.deprecated("".concat(e,".").concat(p),"".concat(e,".").concat(v))(),(d=d||Object.assign({},t))[v]=t[p],delete d[p]}return d||t}var mo={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},bo={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},Ao=function(){function e(){var t=this;h()(this,e);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];n.forEach((function(e){return t._assign(e)})),Object.freeze(this)}return C()(e,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}},{key:"_assign",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=go("Accessor",e,bo)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof e.index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}],[{key:"getBytesPerElement",value:function(e){return po(e.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(e){return eo(e.size),po(e.type||5126).BYTES_PER_ELEMENT*e.size}},{key:"resolve",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return fo()(e,[mo].concat(r))}}]),e}();function Bo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var wo,_o,xo,Co={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"},Oo={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Co},Eo={removedProps:Co},To=function(e,t){p()(n,e);var r=Bo(n);function n(e){var t;h()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(t=r.call(this,e,i)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),t.target=i.target||(t.gl.webgl2?36662:34962),t.initialize(i),Object.seal(gi()(t)),t}return C()(n,[{key:t,get:function(){return"Buffer"}},{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/Ao.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/Ao.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=go("Buffer",e,Oo),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=go("Buffer",e,Eo))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new Ao(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,r=t.data,n=t.offset,i=void 0===n?0:n,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;eo(r);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(la(this.gl),this.gl.bufferSubData(this.target,i,r,o,s)):this.gl.bufferSubData(u,i,r),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(r),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,r=e.readOffset,n=void 0===r?0:r,i=e.writeOffset,a=void 0===i?0:i,o=e.size,s=this.gl;return la(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,n,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,r=void 0===t?null:t,n=e.srcByteOffset,i=void 0===n?0:n,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;la(this.gl);var c,l,f=po(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(i),d=o;r?c=(l=r.length)-d:l=d+(c=Math.min(h,u||h));var p=Math.min(h,c);return eo((u=u||p)<=p),r=r||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,i,r,o,u),this.gl.bindBuffer(36662,null),r}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?this.target:t,n=e.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===r||35982===r?void 0!==s?this.gl.bindBufferRange(r,i,this.handle,o,s):(eo(0===o),this.gl.bindBufferBase(r,i,this.handle)):this.gl.bindBuffer(r,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?this.target:t,n=e.index,i=void 0===n?this.accessor&&this.accessor.index:n,a=35345===r||35982===r;return a?this.gl.bindBufferBase(r,i,null):this.gl.bindBuffer(r,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.byteLength+t;eo(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,this.usage),this.gl.bufferSubData(n,t,e),this.gl.bindBuffer(n,null),this.debugData=e.slice(0,10),this.bytesUsed=r,this._trackAllocatedMemory(r);var i=ho(e);return eo(i),this.setAccessor(new Ao(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;eo(e>=0),this._trackDeallocatedMemory();var r=e;0===e&&(r=new Float32Array(0));var n=this._getTarget();return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/po(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new Ao(this.accessor,{type:ho(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"type",get:function(){return aa.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return aa.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(e){return aa.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return aa.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new Ao(this.accessor,e),this}}]),n}(co,Symbol.toStringTag),So=(wo={},A()(wo,6407,{dataFormat:6407,types:[5121,33635]}),A()(wo,6408,{dataFormat:6408,types:[5121,32819,32820]}),A()(wo,6406,{dataFormat:6406,types:[5121]}),A()(wo,6409,{dataFormat:6409,types:[5121]}),A()(wo,6410,{dataFormat:6410,types:[5121]}),A()(wo,33326,{dataFormat:6403,types:[5126],gl2:!0}),A()(wo,33328,{dataFormat:33319,types:[5126],gl2:!0}),A()(wo,34837,{dataFormat:6407,types:[5126],gl2:!0}),A()(wo,34836,{dataFormat:6408,types:[5126],gl2:!0}),wo),ko=(_o={},A()(_o,6403,1),A()(_o,36244,1),A()(_o,33319,2),A()(_o,33320,2),A()(_o,6407,3),A()(_o,36248,3),A()(_o,6408,4),A()(_o,36249,4),A()(_o,6402,1),A()(_o,34041,1),A()(_o,6406,1),A()(_o,6409,1),A()(_o,6410,2),_o),Mo=(xo={},A()(xo,5126,4),A()(xo,5125,4),A()(xo,5124,4),A()(xo,5123,2),A()(xo,5122,2),A()(xo,5131,2),A()(xo,5120,1),A()(xo,5121,1),xo);function Io(e,t){var r=So[t];if(!r)return!1;if(void 0===r.gl1&&void 0===r.gl2)return!0;var n=ua(e)&&r.gl2||r.gl1;return"string"==typeof n?e.getExtension(n):n}function Ro(e,t){var r=So[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 Po(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Fo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fo(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Fo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Do(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Lo=[9729,9728],jo=globalThis.WebGLBuffer||function(){},Go=function(e,t){p()(n,e);var r=Do(n);function n(e,t){var i;h()(this,n);var a=t.id,o=void 0===a?io("texture"):a,s=t.handle,u=t.target;return(i=r.call(this,e,{id:o,handle:s})).target=u,i.textureUnit=void 0,i.loaded=!1,i.width=void 0,i.height=void 0,i.depth=void 0,i.format=void 0,i.type=void 0,i.dataFormat=void 0,i.border=void 0,i.textureUnit=void 0,i.mipmaps=void 0,i}return C()(n,[{key:t,get:function(){return"Texture"}},{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.data;if(r instanceof Promise)return r.then((function(r){return e.initialize(Object.assign({},t,{pixels:r,data:r}))})),this;var n="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement;if(n&&r.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,r.addEventListener("loadeddata",(function(){return e.initialize(t)})),this;var i=t.pixels,a=void 0===i?null:i,o=t.format,s=void 0===o?6408:o,u=t.border,c=void 0===u?0:u,l=t.recreate,f=void 0!==l&&l,h=t.parameters,d=void 0===h?{}:h,p=t.pixelStore,v=void 0===p?{}:p,y=t.textureUnit,g=void 0===y?void 0:y;r||(r=a);var m=t.width,b=t.height,A=t.dataFormat,B=t.type,w=t.compressed,_=void 0!==w&&w,x=t.mipmaps,C=void 0===x||x,O=t.depth,E=void 0===O?0:O,T=this._deduceParameters({format:s,type:B,dataFormat:A,compressed:_,data:r,width:m,height:b});return m=T.width,b=T.height,_=T.compressed,A=T.dataFormat,B=T.type,this.width=m,this.height=b,this.depth=E,this.format=s,this.type=B,this.dataFormat=A,this.border=c,this.textureUnit=g,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),C&&this._isNPOT()&&(aa.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),C=!1,this._updateForNPOT(d)),this.mipmaps=C,this.setImageData({data:r,width:m,height:b,depth:E,format:s,type:B,dataFormat:A,border:c,mipmaps:C,parameters:v,compressed:_}),C&&this.generateMipmap(),this.setParameters(d),f&&(this.data=r),n&&(this._video={video:r,parameters:d,lastTime:r.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?r.currentTime:-1}),this}},{key:"update",value:function(){if(this._video){var e=this._video,t=e.video,r=e.parameters;if(e.lastTime===t.currentTime||t.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:t,parameters:r}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=t.currentTime}}},{key:"resize",value:function(e){var t=e.height,r=e.width,n=e.mipmaps,i=void 0!==n&&n;return r!==this.width||t!==this.height?this.initialize({width:r,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:i}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(aa.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Wa(this.gl,t,(function(){e.gl.generateMipmap(e.target)})),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,r=void 0===t?this.target:t,n=e.pixels,i=void 0===n?null:n,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,f=e.offset,h=void 0===f?0:f,d=e.parameters,p=void 0===d?{}:d,v=e.data,y=void 0===v?null:v,g=e.type,m=void 0===g?this.type:g,b=e.width,A=void 0===b?this.width:b,B=e.height,w=void 0===B?this.height:B,_=e.dataFormat,x=void 0===_?this.dataFormat:_,C=e.compressed,O=void 0!==C&&C;y||(y=i);var E=this._deduceParameters({format:u,type:m,dataFormat:x,compressed:O,data:y,width:A,height:w});m=E.type,x=E.dataFormat,O=E.compressed,A=E.width,w=E.height;var T=this.gl;T.bindTexture(this.target,this.handle);var S,k,I=this._getDataType({data:y,compressed:O});y=I.data,S=I.dataType;var R=0;if(Wa(this.gl,p,(function(){switch(S){case"null":T.texImage2D(r,o,u,A,w,l,x,m,y);break;case"typed-array":T.texImage2D(r,o,u,A,w,l,x,m,y,h);break;case"buffer":(k=la(T)).bindBuffer(35052,y.handle||y),k.texImage2D(r,o,u,A,w,l,x,m,h),k.bindBuffer(35052,null);break;case"browser-object":ua(T)?T.texImage2D(r,o,u,A,w,l,x,m,y):T.texImage2D(r,o,u,x,m,y);break;case"compressed":var e,t=Po(y.entries());try{for(t.s();!(e=t.n()).done;){var n=M()(e.value,2),i=n[0],a=n[1];T.compressedTexImage2D(r,i,a.format,a.width,a.height,l,a.data),R+=a.levelSize}}catch(e){t.e(e)}finally{t.f()}break;default:eo(!1,"Unknown image data type")}})),"compressed"===S)this._trackAllocatedMemory(R,"Texture");else if(y&&y.byteLength)this._trackAllocatedMemory(y.byteLength,"Texture");else{var P=ko[this.dataFormat]||4,F=Mo[this.type]||1;this._trackAllocatedMemory(this.width*this.height*P*F,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,r=e.target,n=void 0===r?this.target:r,i=e.pixels,a=void 0===i?null:i,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,l=e.y,f=void 0===l?0:l,h=e.width,d=void 0===h?this.width:h,p=e.height,v=void 0===p?this.height:p,y=e.level,g=void 0===y?0:y,m=e.format,b=void 0===m?this.format:m,A=e.type,B=void 0===A?this.type:A,w=e.dataFormat,_=void 0===w?this.dataFormat:w,x=e.compressed,C=void 0!==x&&x,O=e.offset,E=void 0===O?0:O,T=e.border,S=(void 0===T&&this.border,e.parameters),k=void 0===S?{}:S,M=this._deduceParameters({format:b,type:B,dataFormat:_,compressed:C,data:s,width:d,height:v});if(B=M.type,_=M.dataFormat,C=M.compressed,d=M.width,v=M.height,eo(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var I=s;s=I.data,d=I.shape[0],v=I.shape[1]}s instanceof To&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Wa(this.gl,k,(function(){if(C)t.gl.compressedTexSubImage2D(n,g,c,f,d,v,b,s);else if(null===s)t.gl.texSubImage2D(n,g,c,f,d,v,_,B,null);else if(ArrayBuffer.isView(s))t.gl.texSubImage2D(n,g,c,f,d,v,_,B,s,E);else if(s instanceof jo){var e=la(t.gl);e.bindBuffer(35052,s),e.texSubImage2D(n,g,c,f,d,v,_,B,E),e.bindBuffer(35052,null)}else if(ua(t.gl)){la(t.gl).texSubImage2D(n,g,c,f,d,v,_,B,s)}else t.gl.texSubImage2D(n,g,c,f,_,B,s)})),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){return aa.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,r=e.compressed;return void 0!==r&&r?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof To?{data:t.handle,dataType:"buffer"}:t instanceof jo?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,r=e.data,n=e.width,i=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=So[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(r,n,i);return{dataFormat:a,type:o,compressed:s,width:n=c.width,height:i=c.height,format:t,data:r}}},{key:"_deduceImageSize",value:function(e,t,r){var n;return eo(n="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:r}:{width:t>=0?t:1,height:r>=0?r:1},"Could not deduced texture size"),eo(void 0===t||n.width===t,"Deduced texture width does not match supplied width"),eo(void 0===r||n.height===r,"Deduced texture height does not match supplied height"),n}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:eo(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!ua(this.gl)&&(!(!this.width||!this.height)&&(!ao(this.width)||!ao(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===Lo.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.format,n=t.linearFiltering,i=!0;return r&&(i=(i=i&&Io(e,r))&&(!n||Ro(e,r))),i}}]),n}(co,Symbol.toStringTag),Uo="";function No(e,t){return eo("string"==typeof e),e=Uo+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(e){n(e)}}))}function Ho(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Jo,Vo=function(e,t){p()(n,e);var r=Ho(n);function n(e){var t;h()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ca(e),(i instanceof Promise||"string"==typeof i)&&(i={data:i}),"string"==typeof i.data&&(i=Object.assign({},i,{data:No(i.data)})),(t=r.call(this,e,Object.assign({},i,{target:3553}))).initialize(i),Object.seal(gi()(t)),t}return C()(n,[{key:t,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(e,t){return Go.isSupported(e,t)}}]),n}(Go,Symbol.toStringTag),zo="EXT_color_buffer_float",Ko=(Jo={},A()(Jo,33189,{bpp:2}),A()(Jo,33190,{gl2:!0,bpp:3}),A()(Jo,36012,{gl2:!0,bpp:4}),A()(Jo,36168,{bpp:1}),A()(Jo,34041,{bpp:4}),A()(Jo,35056,{gl2:!0,bpp:4}),A()(Jo,36013,{gl2:!0,bpp:5}),A()(Jo,32854,{bpp:2}),A()(Jo,36194,{bpp:2}),A()(Jo,32855,{bpp:2}),A()(Jo,33321,{gl2:!0,bpp:1}),A()(Jo,33330,{gl2:!0,bpp:1}),A()(Jo,33329,{gl2:!0,bpp:1}),A()(Jo,33332,{gl2:!0,bpp:2}),A()(Jo,33331,{gl2:!0,bpp:2}),A()(Jo,33334,{gl2:!0,bpp:4}),A()(Jo,33333,{gl2:!0,bpp:4}),A()(Jo,33323,{gl2:!0,bpp:2}),A()(Jo,33336,{gl2:!0,bpp:2}),A()(Jo,33335,{gl2:!0,bpp:2}),A()(Jo,33338,{gl2:!0,bpp:4}),A()(Jo,33337,{gl2:!0,bpp:4}),A()(Jo,33340,{gl2:!0,bpp:8}),A()(Jo,33339,{gl2:!0,bpp:8}),A()(Jo,32849,{gl2:!0,bpp:3}),A()(Jo,32856,{gl2:!0,bpp:4}),A()(Jo,32857,{gl2:!0,bpp:4}),A()(Jo,36220,{gl2:!0,bpp:4}),A()(Jo,36238,{gl2:!0,bpp:4}),A()(Jo,36975,{gl2:!0,bpp:4}),A()(Jo,36214,{gl2:!0,bpp:8}),A()(Jo,36232,{gl2:!0,bpp:8}),A()(Jo,36226,{gl2:!0,bpp:16}),A()(Jo,36208,{gl2:!0,bpp:16}),A()(Jo,33325,{gl2:zo,bpp:2}),A()(Jo,33327,{gl2:zo,bpp:4}),A()(Jo,34842,{gl2:zo,bpp:8}),A()(Jo,33326,{gl2:zo,bpp:4}),A()(Jo,33328,{gl2:zo,bpp:8}),A()(Jo,34836,{gl2:zo,bpp:16}),A()(Jo,35898,{gl2:zo,bpp:4}),Jo);function qo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function Xo(e,t,r){var n=r[t];if(!n)return!1;var i=ua(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}var Qo=function(e,t){p()(n,e);var r=qo(n);function n(e){var t;h()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(t=r.call(this,e,i)).initialize(i),Object.seal(gi()(t)),t}return C()(n,[{key:t,get:function(){return"Renderbuffer"}},{key:"initialize",value:function(e){var t=e.format,r=e.width,n=void 0===r?1:r,i=e.height,a=void 0===i?1:i,o=e.samples,s=void 0===o?0:o;return eo(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&ua(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,n,a):this.gl.renderbufferStorage(36161,t,n,a),this.format=t,this.width=n,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Ko[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,r=e.height;return t!==this.width||r!==this.height?this.initialize({width:t,height:r,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null},r=t.format;return!r||Xo(e,r,Ko)}},{key:"getSamplesForFormat",value:function(e,t){var r=t.format;return e.getInternalformatParameter(36161,r,32937)}}]),n}(co,Symbol.toStringTag);function Wo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.framebuffer,n=void 0===r?null:r,i=t.color,a=void 0===i?null:i,o=t.depth,s=void 0===o?null:o,u=t.stencil,c=void 0===u?null:u,l={};n&&(l.framebuffer=n);var f=0;a&&(f|=16384,!0!==a&&(l.clearColor=a)),s&&(f|=256,!0!==s&&(l.clearDepth=s)),c&&(f|=1024,!0!==s&&(l.clearStencil=s)),eo(0!==f,"clear: bad arguments"),Wa(e,l,(function(){e.clear(f)}))}function Zo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.framebuffer,n=void 0===r?null:r,i=t.buffer,a=void 0===i?6144:i,o=t.drawBuffer,s=void 0===o?0:o,u=t.value,c=void 0===u?[0,0,0,0]:u;la(e),Wa(e,{framebuffer:n},(function(){switch(a){case 6144:switch(c.constructor){case Int32Array:e.clearBufferiv(a,s,c);break;case Uint32Array:e.clearBufferuiv(a,s,c);break;case Float32Array:default:e.clearBufferfv(a,s,c)}break;case 6145:e.clearBufferfv(6145,0,[c]);break;case 6146:e.clearBufferiv(6146,0,[c]);break;case 34041:var t=M()(c,2),r=t[0],n=t[1];e.clearBufferfi(34041,0,r,n);break;default:eo(!1,"clear: bad arguments")}}))}function Yo(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 eo(!1),0}}function $o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var es=[34069,34070,34071,34072,34073,34074],ts=function(e,t){p()(i,e);var r,n=$o(i);function i(e){var t;h()(this,i);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ca(e),(t=n.call(this,e,Object.assign({},r,{target:34067}))).initialize(r),Object.seal(gi()(t)),t}return C()(i,[{key:t,get:function(){return"TextureCube"}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.mipmaps,n=void 0===r||r,i=t.parameters,a=void 0===i?{}:i;return this.opts=t,this.setCubeMapImageData(t).then((function(){e.loaded=!0,n&&e.generateMipmap(t),e.setParameters(a)})),this}},{key:"subImage",value:function(e){var t=e.face,r=e.data,n=e.x,i=void 0===n?0:n,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:r,x:i,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:(r=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v=this;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.width,n=t.height,i=t.pixels,a=t.data,o=t.border,s=void 0===o?0:o,u=t.format,c=void 0===u?6408:u,l=t.type,f=void 0===l?5121:l,h=this.gl,d=i||a,e.next=5,Promise.all(es.map((function(e){var t=d[e];return Promise.all(Array.isArray(t)?t:[t])})));case 5:p=e.sent,this.bind(),es.forEach((function(e,t){p[t].length>1&&!1!==v.opts.mipmaps&&aa.warn("".concat(v.id," has mipmap and multiple LODs."))(),p[t].forEach((function(t,i){r&&n?h.texImage2D(e,i,c,r,n,s,c,f,t):h.texImage2D(e,i,c,c,f,t)}))})),this.unbind();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"setImageDataForFace",value:function(e){var t=this,r=e.face,n=e.width,i=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,p=a||o;return this.bind(),p instanceof Promise?p.then((function(n){return t.setImageDataForFace(Object.assign({},e,{face:r,data:n,pixels:n}))})):this.width||this.height?d.texImage2D(r,0,l,n,i,u,l,h,p):d.texImage2D(r,0,l,l,h,p),this}}]),i}(Go,Symbol.toStringTag);function rs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;Reflect.construct(n,arguments,i)}else n.apply(this,arguments);return y()(this,r)}}ts.FACES=es;Symbol.toStringTag;function ns(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.sourceX,n=void 0===r?0:r,i=t.sourceY,a=void 0===i?0:i,o=t.sourceFormat,s=void 0===o?6408:o,u=t.sourceAttachment,c=void 0===u?36064:u,l=t.target,f=void 0===l?null:l,h=t.sourceWidth,d=t.sourceHeight,p=t.sourceType,v=as(e),y=v.framebuffer,g=v.deleteFramebuffer;eo(y);var m=y.gl,b=y.handle,A=y.attachments;h=h||y.width,d=d||y.height,36064===c&&null===b&&(c=1028),eo(A[c]),f=os(f,p=p||A[c].type,s,h,d),p=p||ho(f);var B=m.bindFramebuffer(36160,b);return m.readPixels(n,a,h,d,s,p,f),m.bindFramebuffer(36160,B||null),g&&y.delete(),f}function is(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.sourceAttachment,n=void 0===r?36064:r,i=t.targetMaxHeight,a=void 0===i?Number.MAX_SAFE_INTEGER:i,o=ns(e,{sourceAttachment:n}),s=e.width,u=e.height;u>a;){var c=yo({data:o,width:s,height:u});o=c.data,s=c.width,u=c.height}vo({data:o,width:s,height:u});var l=document.createElement("canvas");l.width=s,l.height=u;var f=l.getContext("2d"),h=f.createImageData(s,u);return h.data.set(o),f.putImageData(h,0,0),l.toDataURL()}function as(e){return e instanceof ls?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:(t=e,n=t.gl,i=t.width,a=t.height,o=t.id,new ls(n,Object.assign({},r,{id:"framebuffer-for-".concat(o),width:i,height:a,attachments:A()({},36064,t)}))),deleteFramebuffer:!0};var t,r,n,i,a,o}function os(e,t,r,n,i){return e||new(po(t=t||5121,{clamped:!1}))(n*i*Yo(r))}function ss(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return us(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return us(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function us(e,t){(null==t||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){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var ls=function(e,t){p()(n,e);var r=cs(n);function n(e){var t;h()(this,n);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(t=r.call(this,e,i)).width=null,t.height=null,t.attachments={},t.readBuffer=36064,t.drawBuffers=[36064],t.ownResources=[],t.initialize(i),Object.seal(gi()(t)),t}return C()(n,[{key:t,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var e=la(this.gl);return e.getParameter(e.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var e=la(this.gl);return e.getParameter(e.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}},{key:"initialize",value:function(e){var t=e.width,r=void 0===t?1:t,n=e.height,i=void 0===n?1:n,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,p=void 0===d||d,v=e.readBuffer,y=void 0===v?void 0:v,g=e.drawBuffers,m=void 0===g?void 0:g;if(eo(r>=0&&i>=0,"Width and height need to be integers"),this.width=r,this.height=i,o)for(var b in o){var A=o[b];(Array.isArray(A)?A[0]:A).resize({width:r,height:i})}else o=this._createDefaultAttachments(u,l,h,r,i);this.update({clearAttachments:!0,attachments:o,readBuffer:y,drawBuffers:m}),o&&p&&this.checkStatus()}},{key:"delete",value:function(){var e,t=ss(this.ownResources);try{for(t.s();!(e=t.n()).done;){e.value.delete()}}catch(e){t.e(e)}finally{t.f()}return li()(m()(n.prototype),"delete",this).call(this),this}},{key:"update",value:function(e){var t=e.attachments,r=void 0===t?{}:t,n=e.readBuffer,i=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(r,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return n&&this._setReadBuffer(n),i&&this._setDrawBuffers(i),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,r=e.height;if(null===this.handle)return eo(void 0===t&&void 0===r),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var n in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===r&&(r=this.gl.drawingBufferHeight),t!==this.width&&r!==this.height&&aa.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(r))(),this.attachments)this.attachments[n].resize({width:t,height:r});return this.width=t,this.height=r,this}},{key:"attach",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.clearAttachments,i=void 0!==n&&n,a=r.resizeAttachments,o=void 0===a||a,s={};i&&Object.keys(this.attachments).forEach((function(e){s[e]=null})),Object.assign(s,e);var u=this.gl.bindFramebuffer(36160,this.handle);for(var c in s){eo(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],h=f;if(h)if(h instanceof Qo)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=M()(f,3),p=d[0],v=d[1],y=void 0===v?0:v,g=d[2],m=void 0===g?0:g;h=p,this._attachTexture({attachment:l,texture:p,layer:y,level:m})}else this._attachTexture({attachment:l,texture:h,layer:0,level:0});else this._unattach(l);o&&h&&h.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,u||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter((function(e){return!t.attachments[e]})).forEach((function(e){delete t.attachments[e]}))}},{key:"checkStatus",value:function(){this.gl;var e=this.getStatus();if(36053!==e)throw new Error(function(e){return(ls.STATUS||{})[e]||"Framebuffer error ".concat(e)}(e));return this}},{key:"getStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),r=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),r}},{key:"clear",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.color,n=t.depth,i=t.stencil,a=t.drawBuffers,o=void 0===a?[]:a,s=this.gl.bindFramebuffer(36160,this.handle);return(r||n||i)&&Wo(this.gl,{color:r,depth:n,stencil:i}),o.forEach((function(t,r){Zo(e.gl,{drawBuffer:r,value:t})})),this.gl.bindFramebuffer(36160,s||null),this}},{key:"readPixels",value:function(){return aa.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){return aa.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){return aa.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){return aa.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){return aa.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){return aa.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,r=void 0===t?[]:t,n=e.x,i=void 0===n?0:n,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=la(this.gl),l=c.bindFramebuffer(36008,this.handle);return 0===i&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,r):c.invalidateFramebuffer(36008,r,i,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,r){var n=this._getAttachmentParameterFallback(t);return null===n&&(this.gl.bindFramebuffer(36160,this.handle),n=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),r&&n>1e3&&(n=ro(this.gl,n)),n}},{key:"getAttachmentParameters",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},a=ss(n);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=r?ro(this.gl,o):o;i[s]=this.getAttachmentParameter(t,o,r)}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Object.keys(this.attachments),r={},n=0,i=t;n<i.length;n++){var a=i[n],o=Number(a),s=e?ro(this.gl,o):o;r[s]=this.getAttachmentParameters(o,e)}return r}},{key:"show",value:function(){return"undefined"!=typeof window&&window.open(is(this),"luma-debug-texture"),this}},{key:"log",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>aa.level||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var r=is(this,{targetMaxHeight:100});return aa.image({logLevel:e,message:t,image:r},t)(),this}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?36160:t;return this.gl.bindFramebuffer(r,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,r=void 0===t?36160:t;return this.gl.bindFramebuffer(r,null),this}},{key:"_createDefaultAttachments",value:function(e,t,r,n,i){var a,o=null;e&&((o=o||{})[36064]=new Vo(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:n,height:i,mipmaps:!1,parameters:(a={},A()(a,10241,9729),A()(a,10240,9729),A()(a,10242,33071),A()(a,10243,33071),a)}),this.ownResources.push(o[36064]));return t&&r?((o=o||{})[33306]=new Qo(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:n,height:111}),this.ownResources.push(o[33306])):t?((o=o||{})[36096]=new Qo(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:n,height:i}),this.ownResources.push(o[36096])):r&&eo(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof Qo?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,r=void 0===t?36064:t,n=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,r,36161,n.handle),this.attachments[r]=n}},{key:"_attachTexture",value:function(e){var t=e.attachment,r=void 0===t?36064:t,n=e.texture,i=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(n.target,n.handle),n.target){case 35866:case 32879:la(o).framebufferTextureLayer(36160,r,n.target,a,i);break;case 34067:var s=function(e){return e<34069?e+34069:e}(i);o.framebufferTexture2D(36160,r,s,n.handle,a);break;case 3553:o.framebufferTexture2D(36160,r,3553,n.handle,a);break;default:eo(!1,"Illegal texture type")}o.bindTexture(n.target,null),this.attachments[r]=n}},{key:"_setReadBuffer",value:function(e){var t,r=ua(t=this.gl)?t:null;r?r.readBuffer(e):eo(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl,r=la(t);if(r)r.drawBuffers(e);else{var n=t.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(e):eo(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=function(e){for(var t in e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},Ps)void 0===e.luma.caps[t]&&(e.luma.caps[t]=js(e,t));return e.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.colorBufferFloat,n=t.colorBufferHalfFloat,i=!0;return r&&(i=Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("WEBGL_color_buffer_float")||e.getExtension("OES_texture_float"))),n&&(i=i&&Boolean(e.getExtension("EXT_color_buffer_float")||e.getExtension("EXT_color_buffer_half_float"))),i}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new n(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),n}(co,Symbol.toStringTag);var fs;ls.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];var hs="WEBGL2",ds="VERTEX_ARRAY_OBJECT",ps="TIMER_QUERY",vs="INSTANCED_RENDERING",ys="MULTIPLE_RENDER_TARGETS",gs="ELEMENT_INDEX_UINT32",ms="BLEND_EQUATION_MINMAX",bs="FLOAT_BLEND",As="COLOR_ENCODING_SRGB",Bs="TEXTURE_DEPTH",ws="TEXTURE_FLOAT",_s="TEXTURE_HALF_FLOAT",xs="TEXTURE_FILTER_LINEAR_FLOAT",Cs="TEXTURE_FILTER_LINEAR_HALF_FLOAT",Os="TEXTURE_FILTER_ANISOTROPIC",Es="COLOR_ATTACHMENT_RGBA32F",Ts="COLOR_ATTACHMENT_FLOAT",Ss="COLOR_ATTACHMENT_HALF_FLOAT",ks="GLSL_FRAG_DATA",Ms="GLSL_FRAG_DEPTH",Is="GLSL_DERIVATIVES",Rs="GLSL_TEXTURE_LOD";var Ps=(fs={},A()(fs,hs,[!1,!0]),A()(fs,ds,["OES_vertex_array_object",!0]),A()(fs,ps,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),A()(fs,vs,["ANGLE_instanced_arrays",!0]),A()(fs,ys,["WEBGL_draw_buffers",!0]),A()(fs,gs,["OES_element_index_uint",!0]),A()(fs,ms,["EXT_blend_minmax",!0]),A()(fs,bs,["EXT_float_blend"]),A()(fs,As,["EXT_sRGB",!0]),A()(fs,Bs,["WEBGL_depth_texture",!0]),A()(fs,ws,["OES_texture_float",!0]),A()(fs,_s,["OES_texture_half_float",!0]),A()(fs,xs,["OES_texture_float_linear"]),A()(fs,Cs,["OES_texture_half_float_linear"]),A()(fs,Os,["EXT_texture_filter_anisotropic"]),A()(fs,Es,[function(e){var t=new Vo(e,{format:6408,type:5126,dataFormat:6408}),r=new ls(e,{id:"test-framebuffer",check:!1,attachments:A()({},36064,t)}),n=r.getStatus();return t.delete(),r.delete(),36053===n},"EXT_color_buffer_float"]),A()(fs,Ts,[!1,"EXT_color_buffer_float"]),A()(fs,Ss,["EXT_color_buffer_half_float"]),A()(fs,ks,["WEBGL_draw_buffers",!0]),A()(fs,Ms,["EXT_frag_depth",!0]),A()(fs,Is,["OES_standard_derivatives",!0]),A()(fs,Rs,["EXT_shader_texture_lod",!0]),fs);function Fs(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ds(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ds(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ds(e,t){(null==t||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){return function(e,t){return(t=Array.isArray(t)?t:[t]).every((function(t){return js(e,t)}))}(e,t)}function js(e,t){return e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},void 0===e.luma.caps[t]&&(e.luma.caps[t]=function(e,t){var r,n=Ps[t];eo(n,t);var i=ua(e)&&n[1]||n[0];if("function"==typeof i)r=i(e);else if(Array.isArray(i)){r=!0;var a,o=Fs(i);try{for(o.s();!(a=o.n()).done;){var s=a.value;r=r&&Boolean(e.getExtension(s))}}catch(e){o.e(e)}finally{o.f()}}else"string"==typeof i?r=Boolean(e.getExtension(i)):"boolean"==typeof i?r=i:eo(!1);return r}(e,t)),e.luma.caps[t]||aa.log(2,"Feature: ".concat(t," not supported"))(),e.luma.caps[t]}function Gs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Us(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gs(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ns=function(){function e(t,r){h()(this,e);var n=r.attributes,i=r.material,a=r.pbrDebug,o=r.imageBasedLightingEnvironment,s=r.lights,u=r.useTangents;this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},Ls(t,Rs)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],o&&(this.uniforms.u_DiffuseEnvSampler=o.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=o.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=o.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),a&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(n.NORMAL,"HAS_NORMALS"),this.defineIfPresent(n.TANGENT&&u,"HAS_TANGENTS"),this.defineIfPresent(n.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(o,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(a,"PBR_DEBUG"),i&&this.parseMaterial(i)}return C()(e,[{key:"defineIfPresent",value:function(e,t){e&&(this.defines[t]=1)}},{key:"parseTexture",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},a=e.texture.source.image,o={};a.compressed?(r=a,o=A()({},this.gl.TEXTURE_MIN_FILTER,a.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):r={data:a};var s=new Vo(this.gl,Us({id:e.name||e.id,parameters:Us(Us({},i),o),pixelStore:A()({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},r));this.uniforms[t]=s,this.defineIfPresent(n,n),this.generatedTextures.push(s)}},{key:"parsePbrMetallicRoughness",value:function(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var t=e.metallicFactor,r=void 0===t?1:t,n=e.roughnessFactor,i=void 0===n?1:n;this.uniforms.u_MetallicRoughnessValues=[r,i]}},{key:"parseMaterial",value:function(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,r=void 0===t?1:t;this.uniforms.u_NormalScale=r}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var n=e.occlusionTexture.strength,i=void 0===n?1:n;this.uniforms.u_OcclusionStrength=i}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var a=e.alphaCutoff,o=void 0===a?.5:a;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=o}else"BLEND"===e.alphaMode&&(aa.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]}))}},{key:"delete",value:function(){this.generatedTextures.forEach((function(e){return e.delete()}))}}]),e}();function Hs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Js(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hs(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Vs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var zs=function(e){p()(r,e);var t=Vs(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"getShaders",value:function(){var e=li()(m()(r.prototype),"getShaders",this).call(this);return e.modules.push(Fi.pbr),Js(Js({},e),{},{vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool pickFeatureIds;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\n\n// Instance attributes\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\n\n// Outputs to fragment shader\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvec2 applyUVRegion(vec2 uv) {\n #ifdef HAS_UV_REGIONS\n // https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md\n return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n #else\n return uv;\n #endif\n}\n\nvoid main(void) {\n vec2 uv = applyUVRegion(texCoords);\n geometry.uv = uv;\n\n if (pickFeatureIds) {\n geometry.pickingColor = featureIdsPickingColors;\n } else {\n geometry.pickingColor = instancePickingColors;\n }\n\n vTexCoord = uv;\n cameraPosition = project_uCameraPosition;\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale;\n vec3 projectedPosition = project_position(positions);\n position_commonspace = vec4(projectedPosition, 1.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n geometry.position = position_commonspace;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n geometry.normal = normals_commonspace;\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n // set PBR data\n pbr_vPosition = geometry.position.xyz;\n #ifdef HAS_NORMALS\n pbr_vNormal = geometry.normal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = uv;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n \n#ifdef MODULE_PBR\n\n fragColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n fragColor.a *= opacity;\n\n#else\n\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n\n// NOTE(Tarek): This is necessary because\n// headless.gl reports the extension as\n// available but does not support it in\n// the shader.\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n#endif\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){var e=this.props.featureIds;li()(m()(r.prototype),"initializeState",this).call(this);var t=this.getAttributeManager();e&&t.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(e){li()(m()(r.prototype),"updateState",this).call(this,e);var t=e.props,n=e.oldProps;t.pbrMaterial!==n.pbrMaterial&&this.updatePbrMaterialUniforms(t.pbrMaterial)}},{key:"draw",value:function(e){var t=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(t)}),li()(m()(r.prototype),"draw",this).call(this,e))}},{key:"getModel",value:function(e){var t=this.props,r=t.id,n=t.pbrMaterial,i=this.parseMaterial(n,e);this.setState({materialParser:i});var a,o=this.getShaders();return(a=e.attributes).COLOR_0||a.colors||(a.colors={constant:!0,value:new Float32Array([1,1,1])}),new Fi.Model(this.context.gl,Js(Js({},this.getShaders()),{},{id:r,geometry:e,defines:Js(Js(Js({},o.defines),null==i?void 0:i.defines),{},{HAS_UV_REGIONS:e.attributes.uvRegions}),parameters:null==i?void 0:i.parameters,isInstanced:!0}))}},{key:"updatePbrMaterialUniforms",value:function(e){var t=this.state.model;if(t){var r=this.props.mesh,n=this.parseMaterial(e,r);this.setState({materialParser:n}),t.setUniforms(n.uniforms)}}},{key:"parseMaterial",value:function(e,t){var r,n=Boolean(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture);return null===(r=this.state.materialParser)||void 0===r||r.delete(),new Ns(this.context.gl,{attributes:{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},material:Js({unlit:n},e),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}},{key:"calculateFeatureIdsPickingColors",value:function(e){for(var t=this.props.featureIds,r=new Uint8ClampedArray(t.length*e.size),n=[],i=0;i<t.length;i++)this.encodePickingColor(t[i],n),r[3*i]=n[0],r[3*i+1]=n[1],r[3*i+2]=n[2];e.value=r}},{key:"finalizeState",value:function(e){var t;li()(m()(r.prototype),"finalizeState",this).call(this,e),null===(t=this.state.materialParser)||void 0===t||t.delete(),this.setState({materialParser:null})}}]),r}(B.SimpleMeshLayer);A()(zs,"layerName","MeshLayer"),A()(zs,"defaultProps",{pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}});var Ks=function(e){return"boolean"==typeof e},qs=function(e){return"function"==typeof e},Xs=function(e){return null!==e&&"object"===bi()(e)},Qs=function(e){return Xs(e)&&e.constructor==={}.constructor},Ws=function(e){return e&&"function"==typeof e[Symbol.iterator]},Zs=function(e){return e&&"function"==typeof e[Symbol.asyncIterator]},Ys=function(e){return"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json},$s=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},eu=function(e){return function(e){return"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||Xs(e)&&qs(e.tee)&&qs(e.cancel)&&qs(e.getReader)}(e)||function(e){return Xs(e)&&qs(e.read)&&qs(e.pipe)&&Ks(e.readable)}(e)};function tu(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function ru(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ru(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ru(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function iu(e){var t;return!!e&&(Array.isArray(e)&&(e=e[0]),Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions))}function au(e){var t,r,n;return tu(e,"null loader"),tu(iu(e),"invalid loader"),Array.isArray(e)&&(n=e[1],e=nu(nu({},e=e[0]),{},{options:nu(nu({},e.options),n)})),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(r=e)&&void 0!==r&&r.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var ou="",su={};function uu(e){for(var t in su)if(e.startsWith(t)){var r=su[t];e=e.replace(t,r)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(ou).concat(e)),e}var cu=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,lu=/^([-\w.]+\/[-\w.+]+)/;function fu(e){var t=lu.exec(e);return t?t[1]:e}function hu(e){var t=cu.exec(e);return t?t[1]:""}var du=/\?.*/;function pu(e){if(Ys(e)){var t=yu(e.url||"");return{url:t,type:fu(e.headers.get("content-type")||"")||hu(t)}}return $s(e)?{url:yu(e.name||""),type:e.type||""}:"string"==typeof e?{url:yu(e),type:hu(e)}:{url:"",type:""}}function vu(e){return Ys(e)?e.headers["content-length"]||-1:$s(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}function yu(e){return e.replace(du,"")}function gu(e){return mu.apply(this,arguments)}function mu(){return(mu=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Ys(t)){e.next=2;break}return e.abrupt("return",t);case 2:return r={},(n=vu(t))>=0&&(r["content-length"]=String(n)),i=pu(t),a=i.url,(o=i.type)&&(r["content-type"]=o),e.next=9,_u(t);case 9:return(s=e.sent)&&(r["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t)),u=new Response(t,{headers:r}),Object.defineProperty(u,"url",{value:a}),e.abrupt("return",u);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bu(e){return Au.apply(this,arguments)}function Au(){return(Au=Ie()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=5;break}return e.next=3,Bu(t);case 3:throw r=e.sent,new Error(r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Bu(e){return wu.apply(this,arguments)}function wu(){return(wu=Ie()(Pe.a.mark((function e(t){var r,n,i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): "),e.prev=1,n=t.headers.get("Content-Type"),i=t.statusText,!n.includes("application/json")){e.next=11;break}return e.t0=i,e.t1=" ",e.next=9,t.text();case 9:e.t2=e.sent,i=e.t0+=e.t1.concat.call(e.t1,e.t2);case 11:r=(r+=i).length>60?"".concat(r.slice(0,60),"..."):r,e.next=17;break;case 15:e.prev=15,e.t3=e.catch(1);case 17:return e.abrupt("return",r);case 18:case"end":return e.stop()}}),e,null,[[1,15]])})))).apply(this,arguments)}function _u(e){return xu.apply(this,arguments)}function xu(){return(xu=Ie()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=5,"string"!=typeof t){e.next=3;break}return e.abrupt("return","data:,".concat(t.slice(0,r)));case 3:if(!(t instanceof Blob)){e.next=8;break}return n=t.slice(0,5),e.next=7,new Promise((function(e){var t=new FileReader;t.onload=function(t){var r;return e(null==t||null===(r=t.target)||void 0===r?void 0:r.result)},t.readAsDataURL(n)}));case 7:return e.abrupt("return",e.sent);case 8:if(!(t instanceof ArrayBuffer)){e.next=12;break}return i=t.slice(0,r),a=Cu(i),e.abrupt("return","data:base64,".concat(a));case 12:return e.abrupt("return",null);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Cu(e){for(var t="",r=new Uint8Array(e),n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function Ou(e,t){return Eu.apply(this,arguments)}function Eu(){return(Eu=Ie()(Pe.a.mark((function e(t,r){var n;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=7;break}return t=uu(t),n=r,null!=r&&r.fetch&&"function"!=typeof(null==r?void 0:r.fetch)&&(n=r.fetch),e.next=6,fetch(t,n);case 6:return e.abrupt("return",e.sent);case 7:return e.next=9,gu(t);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tu(){return!("object"===("undefined"==typeof process?"undefined":bi()(process))&&"[object process]"===String(process)&&!process.browser)||function(e){if("undefined"!=typeof window&&"object"===bi()(window.process)&&"renderer"===window.process.type)return!0;if("undefined"!=typeof process&&"object"===bi()(process.versions)&&Boolean(process.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":bi()(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}()}var Su=Tu();function ku(e){try{var t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}var Mu=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";h()(this,e),this.storage=ku(n),this.id=t,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return C()(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function Iu(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?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 Ru={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function Pu(e){return"string"==typeof e?Ru[e.toUpperCase()]||Ru.WHITE:e}function Fu(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Du(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Du(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Du(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lu(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),a=Fu(i);try{var o=function(){var n=t.value;"function"==typeof e[n]&&(r.find((function(e){return n===e}))||(e[n]=e[n].bind(e)))};for(a.s();!(t=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}}function ju(e,t){if(!e)throw new Error(t||"Assertion failed")}var Gu={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":bi()(process))&&process},Uu=Gu.window||Gu.self||Gu.global,Nu=Gu.process||{};console;function Hu(){var e;if(Su&&Uu.performance)e=Uu.performance.now();else if(Nu.hrtime){var t=Nu.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var Ju={debug:Su&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Vu={enabled:!0,level:0};function zu(){}var Ku={},qu={once:!0};function Xu(e){for(var t in e)for(var r in e[t])return r||"untitled";return"empty"}var Qu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""},r=t.id;h()(this,e),this.id=r,this.VERSION="8.9.0-alpha.5",this._startTs=Hu(),this._deltaTs=Hu(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Mu("__probe-".concat(this.id,"__"),Vu),this.userData={},this.timeStamp("".concat(this.id," started")),Lu(this),Object.seal(this)}return C()(e,[{key:"level",get:function(){return this.getLevel()},set:function(e){this.setLevel(e)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Hu()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Hu()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(e){this.level=e}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({level:e}),this}},{key:"assert",value:function(e,t){ju(e,t)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Ju.warn,arguments,qu)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Ju.error,arguments)}},{key:"deprecated",value:function(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}},{key:"removed",value:function(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}},{key:"probe",value:function(e,t){return this._getLogFunction(e,t,Ju.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,t){return this._getLogFunction(e,t,Ju.debug,arguments)}},{key:"info",value:function(e,t){return this._getLogFunction(e,t,console.info,arguments)}},{key:"once",value:function(e,t){return this._getLogFunction(e,t,Ju.debug||Ju.info,arguments,qu)}},{key:"table",value:function(e,t,r){return t?this._getLogFunction(e,t,console.table||zu,r&&[r],{tag:Xu(t)}):zu}},{key:"image",value:function(e){var t=e.logLevel,n=e.priority,i=e.image,a=e.message,o=void 0===a?"":a,s=e.scale,u=void 0===s?1:s;return this._shouldLog(t||n)?Su?function(e){var t=e.image,r=e.message,n=void 0===r?"":r,i=e.scale,a=void 0===i?1:i;if("string"==typeof t){var o=new Image;return o.onload=function(){var e,t=Iu(o,n,a);(e=console).log.apply(e,Le()(t))},o.src=t,zu}var s=t.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,Le()(Iu(t,n,a))),zu}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var e;return(e=console).log.apply(e,Le()(Iu(c,n,a)))},c.src=t.toDataURL(),zu}return zu}({image:i,message:o,scale:u}):function(e){var t=e.image,n=(e.message,e.scale),i=void 0===n?1:n,a=null;try{a=r(94)}catch(e){}if(a)return function(){return a(t,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(e){return console.log(e)}))};return zu}({image:i,message:o,scale:u}):zu}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(A()({},e,t))}},{key:"time",value:function(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,t){return this._getLogFunction(e,t,console.timeStamp||zu)}},{key:"group",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=r=Zu({logLevel:e,message:t,opts:r}),i=n.collapsed;return r.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}},{key:"groupCollapsed",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||zu)}},{key:"withGroup",value:function(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=Wu(e)}},{key:"_getLogFunction",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(e)){var a;i=Zu({logLevel:e,message:t,args:n,opts:i}),ju(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Hu();var o=i.tag||i.message;if(i.once){if(Ku[o])return zu;Ku[o]=Hu()}return t=Yu(this.id,i.message,i),(a=r).bind.apply(a,[console,t].concat(Le()(i.args)))}return zu}}]),e}();function Wu(e){if(!e)return 0;var t;switch(bi()(e)){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return ju(Number.isFinite(t)&&t>=0),t}function Zu(e){var t=e.logLevel,r=e.message;e.logLevel=Wu(t);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==r;);switch(e.args=n,bi()(t)){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());var i=bi()(e.message);return ju("string"===i||"object"===i),Object.assign(e,e.opts)}function Yu(e,t,r){if("string"==typeof t){var n=r.time?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}((s=r.total)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s")):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),i=t,a=r.color,o=r.background,Su||"string"!=typeof i||(a&&(a=Pu(a),i="[".concat(a,"m").concat(i,"")),o&&(a=Pu(o),i="[".concat(o+10,"m").concat(i,""))),t=i}var i,a,o,s;return t}Qu.VERSION="8.9.0-alpha.5";var $u=new Qu({id:"loaders.gl"}),ec=function(){function e(){h()(this,e)}return C()(e,[{key:"log",value:function(){return function(){}}},{key:"info",value:function(){return function(){}}},{key:"warn",value:function(){return function(){}}},{key:"error",value:function(){return function(){}}}]),e}(),tc=function(){function e(){h()(this,e),Jn(this,"console",void 0),this.console=console}return C()(e,[{key:"log",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.log).bind.apply(e,[this.console].concat(r))}},{key:"info",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.info).bind.apply(e,[this.console].concat(r))}},{key:"warn",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.warn).bind.apply(e,[this.console].concat(r))}},{key:"error",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.console.error).bind.apply(e,[this.console].concat(r))}}]),e}(),rc=("undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof global&&global,"undefined"!=typeof document&&document,Boolean("object"!==("undefined"==typeof process?"undefined":bi()(process))||"[object process]"!==String(process)||process.browser)),nc="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),ic=(nc&&parseFloat(nc[1]),{fetch:null,mimeType:void 0,nothrow:!1,log:new tc,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:rc,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]}),ac={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function oc(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return sc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sc(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function sc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function uc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function cc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function lc(){globalThis.loaders=globalThis.loaders||{};var e=globalThis.loaders;return e._state=e._state||{},e._state}var fc=function(){var e=lc();return e.globalOptions=e.globalOptions||cc({},ic),e.globalOptions};function hc(e,t,r,n){return r=r||[],function(e,t){pc(e,null,ic,ac,t);var r,n=oc(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=e&&e[i.id]||{},o=i.options&&i.options[i.id]||{},s=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};pc(a,i.id,o,s,t)}}catch(e){n.e(e)}finally{n.f()}}(e,r=Array.isArray(r)?r:[r]),yc(t,e,n)}function dc(e,t){var r=fc(),n=e||r;return"function"==typeof n.fetch?n.fetch:Xs(n.fetch)?function(e){return Ou(e,n)}:null!=t&&t.fetch?null==t?void 0:t.fetch:Ou}function pc(e,t,r,n,i){var a=t||"Top level",o=t?"".concat(t,"."):"";for(var s in e){var u=!t&&Xs(e[s]);if(!(s in r)&&!("baseUri"===s&&!t)&&!("workerUrl"===s&&t))if(s in n)$u.warn("".concat(a," loader option '").concat(o).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!u){var c=vc(s,i);$u.warn("".concat(a," loader option '").concat(o).concat(s,"' not recognized. ").concat(c))()}}}function vc(e,t){var r,n=e.toLowerCase(),i="",a=oc(t);try{for(a.s();!(r=a.n()).done;){var o=r.value;for(var s in o.options){if(e===s)return"Did you mean '".concat(o.id,".").concat(s,"'?");var u=s.toLowerCase();(n.startsWith(u)||u.startsWith(n))&&(i=i||"Did you mean '".concat(o.id,".").concat(s,"'?"))}}}catch(e){a.e(e)}finally{a.f()}return i}function yc(e,t,r){var n=cc({},e.options||{});return function(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}(n,r),null===n.log&&(n.log=new ec),gc(n,fc()),gc(n,t),n}function gc(e,t){for(var r in t)if(r in t){var n=t[r];Qs(n)&&Qs(e[r])?e[r]=cc(cc({},e[r]),t[r]):e[r]=t[r]}}function mc(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}function bc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.2.10";mc(e,"no worker provided");var r=e.version;return!(!t||!r)}var Ac={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Bc=Ac.global||Ac.self||Ac.window||{},wc="object"!==("undefined"==typeof process?"undefined":bi()(process))||"[object process]"!==String(process)||process.browser,_c="function"==typeof importScripts,xc="undefined"!=typeof window&&void 0!==window.orientation,Cc="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),Oc=(Cc&&parseFloat(Cc[1]),function e(){h()(this,e)}),Ec=new Map;function Tc(e){mc(e.source&&!e.url||!e.source&&e.url);var t=Ec.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return Sc((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),Ec.set(e.url,t)),e.source&&(t=Sc(e.source),Ec.set(e.source,t))),mc(t),t}function Sc(e){var t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function kc(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}var Mc=function(){},Ic=function(){function e(t){h()(this,e),Jn(this,"name",void 0),Jn(this,"source",void 0),Jn(this,"url",void 0),Jn(this,"terminated",!1),Jn(this,"worker",void 0),Jn(this,"onMessage",void 0),Jn(this,"onError",void 0),Jn(this,"_loadableURL","");var r=t.name,n=t.source,i=t.url;mc(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=Mc,this.onError=function(e){return console.log(e)},this.worker=wc?this._createBrowserWorker():this._createNodeWorker()}return C()(e,[{key:"destroy",value:function(){this.onMessage=Mc,this.onError=Mc,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(e,t){t=t||function e(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,i=n||new Set;if(t){if(kc(t))i.add(t);else if(kc(t.buffer))i.add(t.buffer);else if(ArrayBuffer.isView(t));else if(r&&"object"===bi()(t))for(var a in t)e(t[a],r,i)}else;return void 0===n?Array.from(i):[]}(e),this.worker.postMessage(e,t)}},{key:"_getErrorFromErrorEvent",value:function(e){var t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}},{key:"_createBrowserWorker",value:function(){var e=this;this._loadableURL=Tc({source:this.source,url:this.url});var t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=function(t){t.data?e.onMessage(t.data):e.onError(new Error("No data received"))},t.onerror=function(t){e.onError(e._getErrorFromErrorEvent(t)),e.terminated=!0},t.onmessageerror=function(e){return console.error(e)},t}},{key:"_createNodeWorker",value:function(){var e,t=this;if(this.url){var r=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);e=new Oc(r,{eval:!1})}else{if(!this.source)throw new Error("no worker");e=new Oc(this.source,{eval:!0})}return e.on("message",(function(e){t.onMessage(e)})),e.on("error",(function(e){t.onError(e)})),e.on("exit",(function(e){})),e}}],[{key:"isSupported",value:function(){return"undefined"!=typeof Worker&&wc||void 0!==Oc&&!wc}}]),e}(),Rc=function(){function e(t,r){var n=this;h()(this,e),Jn(this,"name",void 0),Jn(this,"workerThread",void 0),Jn(this,"isRunning",!0),Jn(this,"result",void 0),Jn(this,"_resolve",(function(){})),Jn(this,"_reject",(function(){})),this.name=t,this.workerThread=r,this.result=new Promise((function(e,t){n._resolve=e,n._reject=t}))}return C()(e,[{key:"postMessage",value:function(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}},{key:"done",value:function(e){mc(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){mc(this.isRunning),this.isRunning=!1,this._reject(e)}}]),e}();function Pc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Dc=function(){function e(t){h()(this,e),Jn(this,"name","unnamed"),Jn(this,"source",void 0),Jn(this,"url",void 0),Jn(this,"maxConcurrency",1),Jn(this,"maxMobileConcurrency",1),Jn(this,"onDebug",(function(){})),Jn(this,"reuseWorkers",!0),Jn(this,"props",{}),Jn(this,"jobQueue",[]),Jn(this,"idleQueue",[]),Jn(this,"count",0),Jn(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}var t,r;return C()(e,[{key:"destroy",value:function(){this.idleQueue.forEach((function(e){return e.destroy()})),this.isDestroyed=!0}},{key:"setProps",value:function(e){this.props=Fc(Fc({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}},{key:"startJob",value:(r=Ie()(Pe.a.mark((function e(t){var r,n,i,a=this,o=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:function(e,t,r){return e.done(r)},n=o.length>2&&void 0!==o[2]?o[2]:function(e,t){return e.error(t)},i=new Promise((function(e){return a.jobQueue.push({name:t,onMessage:r,onError:n,onStart:e}),a})),this._startQueuedJob(),e.next=6,i;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_startQueuedJob",value:(t=Ie()(Pe.a.mark((function e(){var t,r,n;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.jobQueue.length){e.next=2;break}return e.abrupt("return");case 2:if(t=this._getAvailableWorker()){e.next=5;break}return e.abrupt("return");case 5:if(!(r=this.jobQueue.shift())){e.next=18;break}return this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length}),n=new Rc(r.name,t),t.onMessage=function(e){return r.onMessage(n,e.type,e.payload)},t.onError=function(e){return r.onError(n,e)},r.onStart(n),e.prev=12,e.next=15,n.result;case 15:return e.prev=15,this.returnWorkerToQueue(t),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[12,,15,18]])}))),function(){return t.apply(this,arguments)})},{key:"returnWorkerToQueue",value:function(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}},{key:"_getAvailableWorker",value:function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;var e="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new Ic({name:e,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return xc?this.maxMobileConcurrency:this.maxConcurrency}}],[{key:"isSupported",value:function(){return Ic.isSupported()}}]),e}();function Lc(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return jc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jc(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function jc(e,t){(null==t||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=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Uc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gc(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Nc={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:function(){}},Hc=function(){function e(t){h()(this,e),Jn(this,"props",void 0),Jn(this,"workerPools",new Map),this.props=Uc({},Nc),this.setProps(t),this.workerPools=new Map}return C()(e,[{key:"destroy",value:function(){var e,t=Lc(this.workerPools.values());try{for(t.s();!(e=t.n()).done;){e.value.destroy()}}catch(e){t.e(e)}finally{t.f()}this.workerPools=new Map}},{key:"setProps",value:function(e){this.props=Uc(Uc({},this.props),e);var t,r=Lc(this.workerPools.values());try{for(r.s();!(t=r.n()).done;){t.value.setProps(this._getWorkerPoolProps())}}catch(e){r.e(e)}finally{r.f()}}},{key:"getWorkerPool",value:function(e){var t=e.name,r=e.source,n=e.url,i=this.workerPools.get(t);return i||((i=new Dc({name:t,source:r,url:n})).setProps(this._getWorkerPoolProps()),this.workerPools.set(t,i)),i}},{key:"_getWorkerPoolProps",value:function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}],[{key:"isSupported",value:function(){return Ic.isSupported()}},{key:"getWorkerFarm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e._workerFarm=e._workerFarm||new e({}),e._workerFarm.setProps(t),e._workerFarm}}]),e}();Jn(Hc,"_workerFarm",void 0);function Jc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t[e.id]||{},n="".concat(e.id,"-worker.js"),i=r.workerUrl;if(i||"compression"!==e.id||(i=t.workerUrl),"test"===t._workerType&&(i="modules/".concat(e.module,"/dist/").concat(n)),!i){var a=e.version;"latest"===a&&(a="latest");var o=a?"@".concat(a):"";i="https://unpkg.com/@loaders.gl/".concat(e.module).concat(o,"/dist/").concat(n)}return mc(i),i}function Vc(e,t){return!!Hc.isSupported()&&(!!(wc||null!=t&&t._nodeWorkers)&&(e.worker&&(null==t?void 0:t.worker)))}function zc(e,t,r,n,i){return Kc.apply(this,arguments)}function Kc(){return(Kc=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.id,s=Jc(t,n),u=Hc.getWorkerFarm(n),c=u.getWorkerPool({name:o,url:s}),n=JSON.parse(JSON.stringify(n)),i=JSON.parse(JSON.stringify(i||{})),e.next=8,c.startJob("process-on-worker",qc.bind(null,a));case 8:return(l=e.sent).postMessage("process",{input:r,options:n,context:i}),e.next=12,l.result;case 12:return f=e.sent,e.next=15,f.result;case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qc(e,t,r,n){return Xc.apply(this,arguments)}function Xc(){return(Xc=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n,e.next="done"===e.t0?3:"error"===e.t0?5:"process"===e.t0?7:20;break;case 3:return r.done(i),e.abrupt("break",21);case 5:return r.error(new Error(i.error)),e.abrupt("break",21);case 7:return a=i.id,o=i.input,s=i.options,e.prev=8,e.next=11,t(o,s);case 11:u=e.sent,r.postMessage("done",{id:a,result:u}),e.next=19;break;case 15:e.prev=15,e.t1=e.catch(8),c=e.t1 instanceof Error?e.t1.message:"unknown error",r.postMessage("error",{id:a,error:c});case 19:return e.abrupt("break",21);case 20:console.warn("parse-with-worker unknown message ".concat(n));case 21:case"end":return e.stop()}}),e,null,[[8,15]])})))).apply(this,arguments)}var Qc=r(33),Wc=r.n(Qc);r(40);function Zc(e){return e&&"object"===bi()(e)&&e.isBuffer}function Yc(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return $c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $c(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function $c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function el(e){if(Zc(e))return Zc(t=e)?new Uint8Array(t.buffer,t.byteOffset,t.length).slice().buffer:t;var t;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("string"==typeof e){var r=e;return(new TextEncoder).encode(r).buffer}if(e&&"object"===bi()(e)&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function tl(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=t.map((function(e){return e instanceof ArrayBuffer?new Uint8Array(e):e})),a=i.reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(a),s=0,u=Yc(i);try{for(u.s();!(n=u.n()).done;){var c=n.value;o.set(c,s),s+=c.byteLength}}catch(e){u.e(e)}finally{u.f()}return o.buffer}function rl(e,t,r){var n=void 0!==r?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function nl(e){return il.apply(this,arguments)}function il(){return(il=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=[],n=!1,i=!1,e.prev=3,o=Wc()(t);case 5:return e.next=7,o.next();case 7:if(!(n=!(s=e.sent).done)){e.next=13;break}u=s.value,r.push(u);case 10:n=!1,e.next=5;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(3),i=!0,a=e.t0;case 19:if(e.prev=19,e.prev=20,!n||null==o.return){e.next=24;break}return e.next=24,o.return();case 24:if(e.prev=24,!i){e.next=27;break}throw a;case 27:return e.finish(24);case 28:return e.finish(19);case 29:return e.abrupt("return",tl.apply(void 0,r));case 30:case"end":return e.stop()}}),e,null,[[3,15,19,29],[20,,24,28]])})))).apply(this,arguments)}var al=Pe.a.mark(ol);function ol(e,t){var r,n,i,a,o;return Pe.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:r=(null==t?void 0:t.chunkSize)||262144,n=0,i=new TextEncoder;case 3:if(!(n<e.length)){s.next=11;break}return a=Math.min(e.length-n,r),o=e.slice(n,n+a),n+=a,s.next=9,i.encode(o);case 9:s.next=3;break;case 11:case"end":return s.stop()}}),al)}var sl=Pe.a.mark(ul);function ul(e){var t,r,n,i,a,o,s,u=arguments;return Pe.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:t=u.length>1&&void 0!==u[1]?u[1]:{},r=t.chunkSize,n=void 0===r?262144:r,i=0;case 3:if(!(i<e.byteLength)){c.next=14;break}return a=Math.min(e.byteLength-i,n),o=new ArrayBuffer(a),s=new Uint8Array(e,i,a),new Uint8Array(o).set(s),i+=a,c.next=12,o;case 12:c.next=3;break;case 14:case"end":return c.stop()}}),sl)}var cl=r(27),ll=r.n(cl),fl=r(32),hl=r.n(fl);function dl(){return(dl=hl()(Pe.a.mark((function e(t,r){var n,i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=(null==r?void 0:r.chunkSize)||1048576,i=0;case 2:if(!(i<t.size)){e.next=12;break}return a=i+n,e.next=6,ll()(t.slice(i,a).arrayBuffer());case 6:return o=e.sent,i=a,e.next=10,o;case 10:e.next=2;break;case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pl(e,t){return rc?function(e,t){return vl.apply(this,arguments)}(e,t):function(e,t){return yl.apply(this,arguments)}(e,t)}function vl(){return(vl=hl()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.getReader(),e.prev=1;case 2:return a=i||n.read(),null!=r&&r._streamReadAhead&&(i=n.read()),e.next=7,ll()(a);case 7:if(o=e.sent,s=o.done,u=o.value,!s){e.next=12;break}return e.abrupt("return");case 12:return e.next=14,el(u);case 14:e.next=2;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(1),n.releaseLock();case 21:case"end":return e.stop()}}),e,null,[[1,18]])})))).apply(this,arguments)}function yl(){return(yl=hl()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!1,i=!1,e.prev=2,o=Wc()(t);case 4:return e.next=6,ll()(o.next());case 6:if(!(n=!(s=e.sent).done)){e.next=13;break}return u=s.value,e.next=10,el(u);case 10:n=!1,e.next=4;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(2),i=!0,a=e.t0;case 19:if(e.prev=19,e.prev=20,!n||null==o.return){e.next=24;break}return e.next=24,ll()(o.return());case 24:if(e.prev=24,!i){e.next=27;break}throw a;case 27:return e.finish(24);case 28:return e.finish(19);case 29:case"end":return e.stop()}}),e,null,[[2,15,19,29],[20,,24,28]])})))).apply(this,arguments)}function gl(e,t){if("string"==typeof e)return ol(e,t);if(e instanceof ArrayBuffer)return ul(e,t);if($s(e))return function(e,t){return dl.apply(this,arguments)}(e,t);if(eu(e))return pl(e,t);if(Ys(e))return pl(e.body,t);throw new Error("makeIterator")}var ml="Cannot convert supplied data type";function bl(e,t,r){if(t.text&&"string"==typeof e)return e;var n;if((n=e)&&"object"===bi()(n)&&n.isBuffer&&(e=e.buffer),e instanceof ArrayBuffer){var i=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);var a=e.buffer,o=e.byteLength||e.length;return 0===e.byteOffset&&o===a.byteLength||(a=a.slice(e.byteOffset,e.byteOffset+o)),a}throw new Error(ml)}function Al(e,t,r){return Bl.apply(this,arguments)}function Bl(){return(Bl=Ie()(Pe.a.mark((function e(t,r,n){var i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!i){e.next=3;break}return e.abrupt("return",bl(t,r));case 3:if(!$s(t)){e.next=7;break}return e.next=6,gu(t);case 6:t=e.sent;case 7:if(!Ys(t)){e.next=21;break}return a=t,e.next=11,bu(a);case 11:if(!r.binary){e.next=17;break}return e.next=14,a.arrayBuffer();case 14:e.t0=e.sent,e.next=20;break;case 17:return e.next=19,a.text();case 19:e.t0=e.sent;case 20:return e.abrupt("return",e.t0);case 21:if(eu(t)&&(t=gl(t,n)),!Ws(t)&&!Zs(t)){e.next=24;break}return e.abrupt("return",nl(t));case 24:throw new Error(ml);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wl(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xl(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(r)return r;var n=_l({fetch:dc(t,e)},e);return Array.isArray(n.loaders)||(n.loaders=null),n}function Cl(e,t){if(!t&&e&&!Array.isArray(e))return e;var r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){var n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[].concat(Le()(r),Le()(n)):n}return r&&r.length?r:null}function Ol(e){var t=e&&e.lastIndexOf("/");return t>=0?e.substr(t+1):""}function El(e){var t=e&&e.lastIndexOf("/");return t>=0?e.substr(0,t):""}function Tl(){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(e,r){return r&&(e=e.replace(new RegExp("^".concat(n)),"")),r!==t.length-1&&(e=e.replace(new RegExp("".concat(n,"$")),"")),e}))).join(n)}r(37),r(50);var Sl=new ta({id:"loaders.gl"});var kl=function(){var e=lc();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function Ml(){return kl()}function Il(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Il(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Il(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pl(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Fl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fl(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Fl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Dl=/\.([^.]+)$/;function Ll(e){return jl.apply(this,arguments)}function jl(){return(jl=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]?o[1]:[],n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,Nl(t)){e.next=5;break}return e.abrupt("return",null);case 5:if(!(a=Gl(t,r,Rl(Rl({},n),{},{nothrow:!0}),i))){e.next=8;break}return e.abrupt("return",a);case 8:if(!$s(t)){e.next=13;break}return e.next=11,t.slice(0,10).arrayBuffer();case 11:t=e.sent,a=Gl(t,r,n,i);case 13:if(a||null!=n&&n.nothrow){e.next=15;break}throw new Error(Hl(t));case 15:return e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Gl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!Nl(e))return null;if(t&&!Array.isArray(t))return au(t);var i,a=[];(t&&(a=a.concat(t)),null!=r&&r.ignoreRegisteredLoaders)||(i=a).push.apply(i,Le()(Ml()));Jl(a);var o=Ul(e,a,r,n);if(!(o||null!=r&&r.nothrow))throw new Error(Hl(e));return o}function Ul(e,t,r,n){var i,a=pu(e),o=a.url,s=a.type,u=o||(null==n?void 0:n.url),c=null,l="";(null!=r&&r.mimeType&&(c=Vl(t,null==r?void 0:r.mimeType),l="match forced by supplied MIME type ".concat(null==r?void 0:r.mimeType)),c=c||function(e,t){var r=t&&Dl.exec(t),n=r&&r[1];return n?function(e,t){t=t.toLowerCase();var r,n=Pl(e);try{for(n.s();!(r=n.n()).done;){var i,a=r.value,o=Pl(a.extensions);try{for(o.s();!(i=o.n()).done;){if(i.value.toLowerCase()===t)return a}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}return null}(e,n):null}(t,u),l=l||(c?"matched url ".concat(u):""),c=c||Vl(t,s),l=l||(c?"matched MIME type ".concat(s):""),c=c||function(e,t){if(!t)return null;var r,n=Pl(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if("string"==typeof t){if(zl(t,i))return i}else if(ArrayBuffer.isView(t)){if(Kl(t.buffer,t.byteOffset,i))return i}else if(t instanceof ArrayBuffer){if(Kl(t,0,i))return i}}}catch(e){n.e(e)}finally{n.f()}return null}(t,e),l=l||(c?"matched initial data ".concat(ql(e)):""),c=c||Vl(t,null==r?void 0:r.fallbackMimeType),l=l||(c?"matched fallback MIME type ".concat(s):""))&&Sl.log(1,"selectLoader selected ".concat(null===(i=c)||void 0===i?void 0:i.name,": ").concat(l,"."));return c}function Nl(e){return!(e instanceof Response&&204===e.status)}function Hl(e){var t=pu(e),r=t.url,i=t.type,a="No valid loader found (";a+=r?"".concat(n.filename(r),", "):"no url provided, ",a+="MIME type: ".concat(i?'"'.concat(i,'"'):"not provided",", ");var o=e?ql(e):"";return a+=o?' first bytes: "'.concat(o,'"'):"first bytes: not available",a+=")"}function Jl(e){var t,r=Pl(e);try{for(r.s();!(t=r.n()).done;){au(t.value)}}catch(e){r.e(e)}finally{r.f()}}function Vl(e,t){var r,n=Pl(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(i.mimeTypes&&i.mimeTypes.includes(t))return i;if(t==="application/x.".concat(i.id))return i}}catch(e){n.e(e)}finally{n.f()}return null}function zl(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some((function(t){return e.startsWith(t)}))}function Kl(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some((function(n){return function(e,t,r,n){if(n instanceof ArrayBuffer)return function(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;for(var n=new Uint8Array(e),i=new Uint8Array(t),a=0;a<n.length;++a)if(n[a]!==i[a])return!1;return!0}(n,e,n.byteLength);switch(bi()(n)){case"function":return n(e,r);case"string":var i=Xl(e,t,n.length);return n===i;default:return!1}}(e,t,r,n)}))}function ql(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return Xl(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return Xl(e,r,t)}return""}function Xl(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 Ql(e,t,r,n){return Wl.apply(this,arguments)}function Wl(){return(Wl=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return mc(!i||"object"===bi()(i)),!r||Array.isArray(r)||iu(r)||(i=void 0,n=r,r=void 0),e.next=4,t;case 4:return t=e.sent,n=n||{},a=pu(t),o=a.url,s=Cl(r,i),e.next=11,Ll(t,s,n);case 11:if(u=e.sent){e.next=14;break}return e.abrupt("return",null);case 14:return n=hc(n,u,s,o),i=xl({url:o,parse:Ql,loaders:s},n,i),e.next=18,Zl(u,t,n,i);case 18:return e.abrupt("return",e.sent);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zl(e,t,r,n){return Yl.apply(this,arguments)}function Yl(){return(Yl=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return bc(t),Ys(r)&&(o=(a=r).ok,s=a.redirected,u=a.status,c=a.statusText,l=a.type,f=a.url,h=Object.fromEntries(a.headers.entries()),i.response={headers:h,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}),e.next=4,Al(r,t,n);case 4:if(r=e.sent,!t.parseTextSync||"string"!=typeof r){e.next=8;break}return n.dataType="text",e.abrupt("return",t.parseTextSync(r,n,i,t));case 8:if(!Vc(t,n)){e.next=12;break}return e.next=11,zc(t,r,n,i,Ql);case 11:return e.abrupt("return",e.sent);case 12:if(!t.parseText||"string"!=typeof r){e.next=16;break}return e.next=15,t.parseText(r,n,i,t);case 15:return e.abrupt("return",e.sent);case 16:if(!t.parse){e.next=20;break}return e.next=19,t.parse(r,n,i,t);case 19:return e.abrupt("return",e.sent);case 20:throw mc(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"));case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $l(e,t,r,n){return ef.apply(this,arguments)}function ef(){return(ef=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(r)||iu(r)||(void 0,n=r,r=void 0),a=dc(n),o=t,"string"!=typeof t){e.next=7;break}return e.next=6,a(t);case 6:o=e.sent;case 7:if(!$s(t)){e.next=11;break}return e.next=10,a(t);case 10:o=e.sent;case 11:return e.next=13,Ql(o,r,n);case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var tf=r(55),rf=r.n(tf),nf=r(56),af=r.n(nf),of=r(57),sf=r.n(of);function uf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Math.max(6378137,6378137,6356752.314245179);function cf(e){return e}new St;function lf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:cf;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 ff(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return lf(e,t,at._cartographicRadians?cf:ut)}function hf(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:cf;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 df(e,t){return hf(e,t,at._cartographicRadians?cf:ct)}var pf=new St,vf=new St,yf=new St;var gf=new St,mf={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"}},bf={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Af={east:new St,north:new St,up:new St,west:new St,south:new St,down:new St},Bf=new St,wf=new St,_f=new St;function xf(e,t,r,n,i,a){var o,s,u,c=mf[t]&&mf[t][r];rt(c&&(!n||n===c));var l=gf.copy(i);if(dt(l.x,0,1e-14)&&dt(l.y,0,1e-14)){var f=Math.sign(l.z);o=Bf.fromArray(bf[t]),"east"!==t&&"west"!==t&&o.scale(f),s=wf.fromArray(bf[r]),"east"!==r&&"west"!==r&&s.scale(f),u=_f.fromArray(bf[n]),"east"!==n&&"west"!==n&&u.scale(f)}else{var h=Af.up,d=Af.east,p=Af.north;d.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,h),p.copy(h).cross(d);var v=Af.west,y=Af.south;Af.down.copy(h).scale(-1),v.copy(d).scale(-1),y.copy(p).scale(-1),o=Af[t],s=Af[r],u=Af[n]}return a[0]=o.x,a[1]=o.y,a[2]=o.z,a[3]=0,a[4]=s.x,a[5]=s.y,a[6]=s.z,a[7]=0,a[8]=u.x,a[9]=u.y,a[10]=u.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}var Cf=new St,Of=new St,Ef=new St,Tf=new St,Sf=new St,kf=new St,Mf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;af()(this,e),uf(this,"radii",void 0),uf(this,"radiiSquared",void 0),uf(this,"radiiToTheFourth",void 0),uf(this,"oneOverRadii",void 0),uf(this,"oneOverRadiiSquared",void 0),uf(this,"minimumRadius",void 0),uf(this,"maximumRadius",void 0),uf(this,"centerToleranceSquared",tn),uf(this,"squaredXOverSquaredZ",void 0),rt(t>=0),rt(r>=0),rt(n>=0),this.radii=new St(t,r,n),this.radiiSquared=new St(t*t,r*r,n*n),this.radiiToTheFourth=new St(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new St(0===t?0:1/t,0===r?0:1/r,0===n?0:1/n),this.oneOverRadiiSquared=new St(0===t?0:1/(t*t),0===r?0:1/(r*r),0===n?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return sf()(e,[{key:"equals",value:function(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=Of,n=Ef,i=rf()(e,3),a=i[2];this.geodeticSurfaceNormalCartographic(e,r),n.copy(this.radiiSquared).scale(r);var o=Math.sqrt(r.dot(n));return n.scale(1/o),r.scale(a),n.add(r),n.to(t)}},{key:"cartesianToCartographic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];kf.from(e);var r=this.scaleToGeodeticSurface(kf,Tf);if(r){var n=this.geodeticSurfaceNormal(r,Of),i=Sf;i.copy(kf).subtract(r);var a=Math.atan2(n.y,n.x),o=Math.asin(n.z),s=Math.sign(ve(i,kf))*de(i);return df([a,o,s],t)}}},{key:"eastNorthUpToFixedFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Zr;return xf(this,"east","north","up",e,t)}},{key:"localFrameToFixedFrame",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Zr;return xf(this,e,t,r,n,i)}},{key:"geocentricSurfaceNormal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Cf.from(e).normalize().to(t)}},{key:"geodeticSurfaceNormalCartographic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=ff(e),n=r[0],i=r[1],a=Math.cos(i);return Cf.set(a*Math.cos(n),a*Math.sin(n),Math.sin(i)).normalize(),Cf.to(t)}},{key:"geodeticSurfaceNormal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Cf.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}},{key:"scaleToGeodeticSurface",value:function(e,t){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=t.oneOverRadii,i=t.oneOverRadiiSquared,a=t.centerToleranceSquared;pf.from(e);var o=pf.x,s=pf.y,u=pf.z,c=n.x,l=n.y,f=n.z,h=o*o*c*c,d=s*s*l*l,p=u*u*f*f,v=h+d+p,y=Math.sqrt(1/v);if(Number.isFinite(y)){var g=vf;if(g.copy(e).scale(y),v<a)return g.to(r);var m=i.x,b=i.y,A=i.z,B=yf;B.set(g.x*m*2,g.y*b*2,g.z*A*2);var w,_,x,C,O=(1-y)*pf.len()/(.5*B.len()),E=0;do{var T=(w=1/(1+(O-=E)*m))*w,S=(_=1/(1+O*b))*_,k=(x=1/(1+O*A))*x,M=T*w,I=S*_,R=k*x,P=h*M*m+d*I*b+p*R*A,F=-2*P;E=(C=h*T+d*S+p*k-1)/F}while(Math.abs(C)>rn);return pf.scale([w,_,x]).to(r)}}(e,this,t)}},{key:"scaleToGeocentricSurface",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];Tf.from(e);var r=Tf.x,n=Tf.y,i=Tf.z,a=this.oneOverRadiiSquared,o=1/Math.sqrt(r*r*a.x+n*n*a.y+i*i*a.z);return Tf.multiplyScalar(o).to(t)}},{key:"transformPositionToScaledSpace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Tf.from(e).scale(this.oneOverRadii).to(t)}},{key:"transformPositionFromScaledSpace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return Tf.from(e).scale(this.radii).to(t)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0];rt(dt(this.radii.x,this.radii.y,nn)),rt(this.radii.z>0),Tf.from(e);var n=Tf.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-t))return Tf.set(0,0,n).to(r)}}]),e}();uf(Mf,"WGS84",new Mf(6378137,6378137,6356752.314245179));var If=function e(t,r,n){h()(this,e),Jn(this,"item",void 0),Jn(this,"previous",void 0),Jn(this,"next",void 0),this.item=t,this.previous=r,this.next=n},Rf=function(){function e(){h()(this,e),Jn(this,"head",null),Jn(this,"tail",null),Jn(this,"_length",0)}return C()(e,[{key:"length",get:function(){return this._length}},{key:"add",value:function(e){var t=new If(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t}},{key:"remove",value:function(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}},{key:"splice",value:function(e,t){e!==t&&(this.remove(t),this._insert(e,t))}},{key:"_insert",value:function(e,t){var r=e.next;e.next=t,this.tail===e?this.tail=t:r.previous=t,t.next=r,t.previous=e,++this._length}}]),e}();function Pf(e){return null!=e}var Ff=function(){function e(){h()(this,e),Jn(this,"_list",void 0),Jn(this,"_sentinel",void 0),Jn(this,"_trimTiles",void 0),this._list=new Rf,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return C()(e,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(e){var t=e._cacheNode;Pf(t)&&this._list.splice(this._sentinel,t)}},{key:"add",value:function(e,t,r){Pf(t._cacheNode)||(t._cacheNode=this._list.add(t),r&&r(e,t))}},{key:"unloadTile",value:function(e,t,r){var n=t._cacheNode;Pf(n)&&(this._list.remove(n),t._cacheNode=void 0,r&&r(e,t))}},{key:"unloadTiles",value:function(e,t){var r=this._trimTiles;this._trimTiles=!1;for(var n=this._list,i=1024*e.maximumMemoryUsage*1024,a=this._sentinel,o=n.head;o!==a&&(e.gpuMemoryUsageInBytes>i||r);){var s=o.item;o=o.next,this.unloadTile(e,s,t)}}},{key:"trim",value:function(){this._trimTiles=!0}}]),e}();function Df(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Lf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lf(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Lf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var jf=new St,Gf=new St,Uf=new zr([new jr,new jr,new jr,new jr,new jr,new jr]);function Nf(e,t){var r=e.cameraDirection,n=e.cameraUp,i=e.height,a=e.distanceScales.metersPerUnit,o=Jf(e,e.center),s=Mf.WGS84.eastNorthUpToFixedFrame(o),u=e.unprojectPosition(e.cameraPosition),c=Mf.WGS84.cartographicToCartesian(u,new St),l=new St(s.transformAsVector(new St(r).scale(a))).normalize(),f=new St(s.transformAsVector(new St(n).scale(a))).normalize();return function(e){var t=e.getFrustumPlanes(),r=Hf(t.near,e.cameraPosition),n=Jf(e,r),i=Jf(e,e.cameraPosition,Gf),a=0;for(var o in Uf.planes[a++].fromPointNormal(n,jf.copy(n).subtract(i)),t)if("near"!==o){var s=Hf(t[o],r,Gf),u=Jf(e,s,Gf);Uf.planes[a++].fromPointNormal(u,jf.copy(n).subtract(u))}}(e),{camera:{position:c,direction:l,up:f},viewport:e,topDownViewport:new(0,e.constructor)({longitude:e.longitude,latitude:e.latitude,height:i,width:e.width,bearing:e.bearing,zoom:e.zoom,pitch:0}),height:i,cullingVolume:Uf,frameNumber:t,sseDenominator:1.15}}function Hf(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new St,n=e.normal.dot(t);return r.copy(e.normal).scale(e.distance-n).add(t),r}function Jf(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new St,n=e.unprojectPosition(t);return Mf.WGS84.cartographicToCartesian(n,r)}var Vf=new St;function zf(e,t){if(e instanceof Fr){var r=function(e){e.getColumn(0,Vf);var t=e.getColumn(1),r=e.getColumn(2);return Vf.add(t).add(r).len()}(e.halfAxes);return Math.log2(6356752.314245179/(r+t[2]))}if(e instanceof Ft){var n=e.radius;return Math.log2(6356752.314245179/(n+t[2]))}if(e.width&&e.height){var i=e.width,a=e.height;return(Math.log2(6378137/i)+Math.log2(6378137/a))/2}return 1}function Kf(e,t,r){var n=Mf.WGS84.cartographicToCartesian([e.xmax,e.ymax,e.zmax],new St),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(6356752.314245179/(i+t[2]))}var qf=0,Xf=1,Qf=3,Wf=4,Zf=5,Yf=1,$f=2,eh="empty",th="scenegraph",rh="pointcloud",nh="mesh",ih="I3S",ah="TILES3D",oh="geometricError",sh=1;function uh(e){return null!=e}var ch=new St,lh=new St,fh=new St;function hh(e,t,r){if(tu(e,"3D Tile: boundingVolume must be defined"),e.box)return function(e,t,r){var n=new St(e[0],e[1],e[2]);t.transform(n,n);var i=[];if(10===e.length){var a=e.slice(3,6),o=new mr;o.fromArray(e,6);var s=new St([1,0,0]),u=new St([0,1,0]),c=new St([0,0,1]);s.transformByQuaternion(o),s.scale(a[0]),u.transformByQuaternion(o),u.scale(a[1]),c.transformByQuaternion(o),c.scale(a[2]),i=[].concat(Le()(s.toArray()),Le()(u.toArray()),Le()(c.toArray()))}else i=[].concat(Le()(e.slice(3,6)),Le()(e.slice(6,9)),Le()(e.slice(9,12)));var l=t.transformAsVector(i.slice(0,3)),f=t.transformAsVector(i.slice(3,6)),h=t.transformAsVector(i.slice(6,9)),d=new Xt([l[0],l[1],l[2],f[0],f[1],f[2],h[0],h[1],h[2]]);if(uh(r))return r.center=n,r.halfAxes=d,r;return new Fr(n,d)}(e.box,t,r);if(e.region){var n=M()(e.region,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5],l=Mf.WGS84.cartographicToCartesian([lt(i),lt(s),u],lh),f=Mf.WGS84.cartographicToCartesian([lt(o),lt(a),c],fh),h=(new St).addVectors(l,f).multiplyScalar(.5),d=(new St).subVectors(l,f).len()/2;return dh([h[0],h[1],h[2],d],new Zr)}if(e.sphere)return dh(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function dh(e,t,r){var n=new St(e[0],e[1],e[2]);t.transform(n,n);var i=t.getScale(ch),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return uh(r)?(r.center=n,r.radius=o,r):new Ft(n,o)}new St,new St,new Zr,new St,new St,new St;function ph(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){var r=e.dynamicScreenSpaceErrorComputedDensity,n=e.dynamicScreenSpaceErrorFactor;return function(e,t){var r=e*t;return 1-Math.exp(-r*r)}(t,r)*n}return 0}var vh=new St,yh=new St,gh=new St,mh=new St,bh=new St,Ah=new Zr,Bh=new Zr;function wh(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=Le()(e.boundingVolume.center),u=r.unprojectPosition(r.cameraPosition);Mf.WGS84.cartographicToCartesian(u,vh),yh.copy(vh).subtract(s).normalize(),Mf.WGS84.eastNorthUpToFixedFrame(s,Ah),Bh.copy(Ah).invert(),gh.copy(vh).transform(Bh);var c=Math.sqrt(gh[0]*gh[0]+gh[1]*gh[1]),l=c*c/gh[2];mh.copy([gh[0],gh[1],l]);var f=mh.transform(Ah).subtract(s).normalize(),h=yh.cross(f).normalize().scale(o).add(s),d=Mf.WGS84.cartesianToCartographic(h),p=r.project([i,n,a]),v=r.project(d);return bh.copy(p).subtract(v).magnitude()}var _h=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;h()(this,e),Jn(this,"_map",new Map),Jn(this,"_array",void 0),Jn(this,"_length",void 0),this._array=new Array(t),this._length=t}return C()(e,[{key:"length",get:function(){return this._length},set:function(e){this._length=e,e>this._array.length&&(this._array.length=e)}},{key:"values",get:function(){return this._array}},{key:"get",value:function(e){return tu(e<this._array.length),this._array[e]}},{key:"set",value:function(e,t){tu(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}},{key:"delete",value:function(e){var t=this._map.get(e);t>=0&&(this._array.splice(t,1),this._map.delete(e),this.length--)}},{key:"peek",value:function(){return this._array[this._length-1]}},{key:"push",value:function(e){if(!this._map.has(e)){var t=this.length++;this._array[t]=e,this._map.set(e,t)}}},{key:"pop",value:function(){var e=this._array[--this.length];return this._map.delete(e),e}},{key:"reserve",value:function(e){tu(e>=0),e>this._array.length&&(this._array.length=e)}},{key:"resize",value:function(e){tu(e>=0),this.length=e}},{key:"trim",value:function(e){null==e&&(e=this.length),this._array.length=e}},{key:"reset",value:function(){this._array=[],this._map=new Map,this._length=0}},{key:"find",value:function(e){return this._map.has(e)}}]),e}();function xh(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ch(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ch(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Ch(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Oh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Eh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Oh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Th={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},Sh=function(){function e(t){h()(this,e),Jn(this,"options",void 0),Jn(this,"root",void 0),Jn(this,"requestedTiles",void 0),Jn(this,"selectedTiles",void 0),Jn(this,"emptyTiles",void 0),Jn(this,"lastUpdate",(new Date).getTime()),Jn(this,"updateDebounceTime",1e3),Jn(this,"_traversalStack",void 0),Jn(this,"_emptyTraversalStack",void 0),Jn(this,"_frameNumber",void 0),this.options=Eh(Eh({},Th),t),this._traversalStack=new _h,this._emptyTraversalStack=new _h,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}return C()(e,[{key:"traversalFinished",value:function(e){return!0}},{key:"traverse",value:function(e,t,r){this.root=e,this.options=Eh(Eh({},this.options),r),this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}},{key:"reset",value:function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}},{key:"executeTraversal",value:function(e,t){var r=this._traversalStack;for(e._selectionDepth=1,r.push(e);r.length>0;){var n=r.pop(),i=!1;this.canTraverse(n,t)&&(this.updateChildTiles(n,t),i=this.updateAndPushChildren(n,t,r,n.hasRenderContent?n._selectionDepth+1:n._selectionDepth));var a=n.parent,o=Boolean(!a||a._shouldRefine),s=!i;n.hasRenderContent?n.refine===Yf?(this.loadTile(n,t),this.selectTile(n,t)):n.refine===$f&&(this.loadTile(n,t),s&&this.selectTile(n,t)):(this.emptyTiles[n.id]=n,this.loadTile(n,t),s&&this.selectTile(n,t)),this.touchTile(n,t),n._shouldRefine=i&&o}var u=(new Date).getTime();(this.traversalFinished(t)||u-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=u,this.options.onTraversalEnd(t))}},{key:"updateChildTiles",value:function(e,t){var r,n=xh(e.children);try{for(n.s();!(r=n.n()).done;){var i=r.value;this.updateTile(i,t)}}catch(e){n.e(e)}finally{n.f()}return!0}},{key:"updateAndPushChildren",value:function(e,t,r,n){var i=this.options,a=i.loadSiblings,o=i.skipLevelOfDetail,s=e.children;s.sort(this.compareDistanceToCamera.bind(this));var u,c=e.refine===$f&&e.hasRenderContent&&!o,l=!1,f=!0,h=xh(s);try{for(h.s();!(u=h.n()).done;){var d=u.value;if(d._selectionDepth=n,d.isVisibleAndInRequestVolume?(r.find(d)&&r.delete(d),r.push(d),l=!0):(c||a)&&(this.loadTile(d,t),this.touchTile(d,t)),c){var p=void 0;if(p=!!d._inRequestVolume&&(d.hasRenderContent?d.contentAvailable:this.executeEmptyTraversal(d,t)),!(f=f&&p))return!1}}}catch(e){h.e(e)}finally{h.f()}return l||(f=!1),f}},{key:"updateTile",value:function(e,t){this.updateTileVisibility(e,t)}},{key:"selectTile",value:function(e,t){this.shouldSelectTile(e)&&(e._selectedFrame=t.frameNumber,this.selectedTiles[e.id]=e)}},{key:"loadTile",value:function(e,t){this.shouldLoadTile(e)&&(e._requestedFrame=t.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}},{key:"touchTile",value:function(e,t){e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber}},{key:"canTraverse",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!e.hasChildren&&(e.hasTilesetContent?!e.contentExpired:!(!n&&!e.isVisibleAndInRequestVolume)&&this.shouldRefine(e,t,r))}},{key:"shouldLoadTile",value:function(e){return e.hasUnloadedContent||e.contentExpired}},{key:"shouldSelectTile",value:function(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}},{key:"shouldRefine",value:function(e,t,r){var n=e._screenSpaceError;return r&&(n=e.getScreenSpaceError(t,!0)),n>this.options.maximumScreenSpaceError}},{key:"updateTileVisibility",value:function(e,t){var r=[];if(this.options.viewportTraversersMap)for(var n in this.options.viewportTraversersMap){this.options.viewportTraversersMap[n]===t.viewport.id&&r.push(n)}else r.push(t.viewport.id);e.updateVisibility(t,r)}},{key:"compareDistanceToCamera",value:function(e,t){return e._distanceToCamera-t._distanceToCamera}},{key:"anyChildrenVisible",value:function(e,t){var r,n=!1,i=xh(e.children);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.updateVisibility(t),n=n||a.isVisibleAndInRequestVolume}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"executeEmptyTraversal",value:function(e,t){var r=!0,n=this._emptyTraversalStack;for(n.push(e);n.length>0&&r;){var i=n.pop();if(this.updateTile(i,t),i.isVisibleAndInRequestVolume||this.loadTile(i,t),this.touchTile(i,t),!i.hasRenderContent&&this.canTraverse(i,t,!1,!0)){var a,o=xh(i.children);try{for(o.s();!(a=o.n()).done;){var s=a.value;n.find(s)&&n.delete(s),n.push(s)}}catch(e){o.e(e)}finally{o.f()}}else i.contentAvailable||(r=!1)}return r}}]),e}();function kh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ih=new St;var Rh=function(){function e(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";h()(this,e),Jn(this,"tileset",void 0),Jn(this,"header",void 0),Jn(this,"id",void 0),Jn(this,"url",void 0),Jn(this,"parent",void 0),Jn(this,"refine",void 0),Jn(this,"type",void 0),Jn(this,"contentUrl",void 0),Jn(this,"lodMetricType",void 0),Jn(this,"lodMetricValue",void 0),Jn(this,"boundingVolume",void 0),Jn(this,"content",void 0),Jn(this,"contentState",void 0),Jn(this,"gpuMemoryUsageInBytes",void 0),Jn(this,"children",void 0),Jn(this,"depth",void 0),Jn(this,"viewportIds",void 0),Jn(this,"transform",void 0),Jn(this,"extensions",void 0),Jn(this,"userData",void 0),Jn(this,"computedTransform",void 0),Jn(this,"hasEmptyContent",void 0),Jn(this,"hasTilesetContent",void 0),Jn(this,"traverser",void 0),Jn(this,"_cacheNode",void 0),Jn(this,"_frameNumber",void 0),Jn(this,"_lodJudge",void 0),Jn(this,"_expireDate",void 0),Jn(this,"_expiredContent",void 0),Jn(this,"_shouldRefine",void 0),Jn(this,"_distanceToCamera",void 0),Jn(this,"_centerZDepth",void 0),Jn(this,"_screenSpaceError",void 0),Jn(this,"_visibilityPlaneMask",void 0),Jn(this,"_visible",void 0),Jn(this,"_inRequestVolume",void 0),Jn(this,"_stackLength",void 0),Jn(this,"_selectionDepth",void 0),Jn(this,"_touchedFrame",void 0),Jn(this,"_visitedFrame",void 0),Jn(this,"_selectedFrame",void 0),Jn(this,"_requestedFrame",void 0),Jn(this,"_priority",void 0),Jn(this,"_contentBoundingVolume",void 0),Jn(this,"_viewerRequestVolume",void 0),Jn(this,"_initialTransform",void 0),this.header=r,this.tileset=t,this.id=i||r.id,this.url=r.url,this.parent=n,this.refine=this._getRefine(r.refine),this.type=r.type,this.contentUrl=r.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=qf,this.gpuMemoryUsageInBytes=0,this.children=[],this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.depth=0,this.viewportIds=[],this.userData={},this.extensions=null,this._priority=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._screenSpaceError=0,this._cacheNode=null,this._frameNumber=null,this._cacheNode=null,this.traverser=new Sh({}),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._initialTransform=new Zr,this.transform=new Zr,this._initializeLodMetric(r),this._initializeTransforms(r),this._initializeBoundingVolumes(r),this._initializeContent(r),this._initializeRenderingState(r),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,Object.seal(this)}var t;return C()(e,[{key:"destroy",value:function(){this.header=null}},{key:"isDestroyed",value:function(){return null===this.header}},{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===Qf||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===qf}},{key:"contentExpired",get:function(){return this.contentState===Wf}},{key:"contentFailed",get:function(){return this.contentState===Zf}},{key:"getScreenSpaceError",value:function(e,t){switch(this.tileset.type){case ih:return wh(this,e);case ah:return function(e,t,r){var n=e.tileset,i=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,a=r?i:e.lodMetricValue;if(0===a)return 0;var o=Math.max(e._distanceToCamera,1e-7),s=t.height,u=t.sseDenominator,c=a*s*(n.options.viewDistanceScale||1)/(o*u);return c-=ph(n,o)}(this,e,t);default:throw new Error("Unsupported tileset type")}}},{key:"unselect",value:function(){this._selectedFrame=0}},{key:"_getPriority",value:function(){var e=this.tileset._traverser,t=e.options.skipLevelOfDetail,r=this.refine===Yf||t;if(r&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===qf)return-1;var n=this.parent,i=n&&(!r||0===this._screenSpaceError||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,a=e.root?e.root._screenSpaceError:0;return Math.max(a-i,0)}},{key:"loadContent",value:(t=Ie()(Pe.a.mark((function e(){var t,r,n,i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.hasEmptyContent){e.next=2;break}return e.abrupt("return",!1);case 2:if(!this.content){e.next=4;break}return e.abrupt("return",!0);case 4:return this.contentExpired&&(this._expireDate=null),this.contentState=Xf,e.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));case 9:if(t=e.sent){e.next=13;break}return this.contentState=qf,e.abrupt("return",!1);case 13:return e.prev=13,r=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,i=Mh(Mh({},this.tileset.loadOptions),{},A()({},n.id,Mh(Mh({},this.tileset.loadOptions[n.id]),{},{isTileset:"json"===this.type},this._getLoaderSpecificOptions(n.id)))),e.next=19,$l(r,n,i);case 19:if(this.content=e.sent,!this.tileset.options.contentLoader){e.next=23;break}return e.next=23,this.tileset.options.contentLoader(this);case 23:return this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Qf,this._onContentLoaded(),e.abrupt("return",!0);case 29:throw e.prev=29,e.t0=e.catch(13),this.contentState=Zf,e.t0;case 33:return e.prev=33,t.done(),e.finish(33);case 36:case"end":return e.stop()}}),e,this,[[13,29,33,36]])}))),function(){return t.apply(this,arguments)})},{key:"unloadContent",value: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=qf,!0}},{key:"updateVisibility",value:function(e,t){if(this._frameNumber!==e.frameNumber){var r=this.parent,n=r?r._visibilityPlaneMask:zr.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){var i=r?r.computedTransform:this.tileset.modelMatrix;this._updateTransform(i)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,n),this._visible=this._visibilityPlaneMask!==zr.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=t}}},{key:"visibility",value:function(e,t){var r=e.cullingVolume,n=this.boundingVolume;return r.computeVisibilityWithPlaneMask(n,t)}},{key:"contentVisibility",value:function(){return!0}},{key:"distanceToTile",value:function(e){var t=this.boundingVolume;return Math.sqrt(Math.max(t.distanceSquaredTo(e.camera.position),0))}},{key:"cameraSpaceZDepth",value:function(e){var t=e.camera,r=this.boundingVolume;return Ih.subVectors(r.center,t.position),t.direction.dot(Ih)}},{key:"insideViewerRequestVolume",value:function(e){var t=this._viewerRequestVolume;return!t||t.distanceSquaredTo(e.camera.position)<=0}},{key:"updateExpiration",value:function(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){var e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=Wf,this._expiredContent=this.content)}}},{key:"extras",get:function(){return this.header.extras}},{key:"_initializeLodMetric",value:function(e){"lodMetricType"in e?this.lodMetricType=e.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 e?this.lodMetricValue=e.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}},{key:"_initializeTransforms",value:function(e){this.transform=e.transform?new Zr(e.transform):new Zr;var t=this.parent,r=this.tileset,n=t&&t.computedTransform?t.computedTransform.clone():r.modelMatrix.clone();this.computedTransform=new Zr(n).multiplyRight(this.transform);var i=t&&t._initialTransform?t._initialTransform.clone():new Zr;this._initialTransform=new Zr(i).multiplyRight(this.transform)}},{key:"_initializeBoundingVolumes",value:function(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}},{key:"_initializeContent",value:function(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=qf,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}},{key:"_initializeRenderingState",value:function(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=zr.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}},{key:"_getRefine",value:function(e){return e||this.parent&&this.parent.refine||$f}},{key:"_isTileset",value:function(){return-1!==this.contentUrl.indexOf(".json")}},{key:"_onContentLoaded",value:function(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()&&(this.hasTilesetContent=!0)}},{key:"_updateBoundingVolume",value:function(e){this.boundingVolume=hh(e.boundingVolume,this.computedTransform,this.boundingVolume);var t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=hh(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=hh(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Zr,t=e.clone().multiplyRight(this.transform),r=!t.equals(this.computedTransform);r&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}},{key:"_getLoaderSpecificOptions",value:function(e){switch(e){case"i3s":return Mh(Mh({},this.tileset.options.i3s),{},{tile:this.header,tileset:this.tileset.tileset,isTileHeader:!1});case"3d-tiles":case"cesium-ion":default:return{assetGltfUpAxis:(t=this.tileset.tileset).asset&&t.asset.gltfUpAxis||"Y"}}var t}}]),e}();function Ph(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Fh=function(e){p()(r,e);var t=Ph(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"compareDistanceToCamera",value:function(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}},{key:"updateTileVisibility",value:function(e,t){if(li()(m()(r.prototype),"updateTileVisibility",this).call(this,e,t),e.isVisibleAndInRequestVolume){var n=e.children.length>0;if(e.hasTilesetContent&&n){var i=e.children[0];return this.updateTileVisibility(i,t),void(e._visible=i._visible)}if(this.meetsScreenSpaceErrorEarly(e,t))e._visible=!1;else{var a=e.refine===$f,o=e._optimChildrenWithinParent===sh;a&&o&&n&&!this.anyChildrenVisible(e,t)&&(e._visible=!1)}}}},{key:"meetsScreenSpaceErrorEarly",value:function(e,t){var r=e.parent;return!(!r||r.hasTilesetContent||r.refine!==Yf)&&!this.shouldRefine(e,t,!0)}}]),r}(Sh),Dh=function(){function e(){h()(this,e),Jn(this,"frameNumberMap",new Map)}return C()(e,[{key:"register",value:function(e,t){var r=this.frameNumberMap.get(e)||new Map,n=r.get(t)||0;r.set(t,n+1),this.frameNumberMap.set(e,r)}},{key:"deregister",value:function(e,t){var r=this.frameNumberMap.get(e);if(r){var n=r.get(t)||1;r.set(t,n-1)}}},{key:"isZero",value:function(e,t){var r;return 0===((null===(r=this.frameNumberMap.get(e))||void 0===r?void 0:r.get(t))||0)}}]),e}(),Lh="REQUESTED",jh="COMPLETED",Gh="ERROR",Uh=function(){function e(){h()(this,e),Jn(this,"_statusMap",void 0),Jn(this,"pendingTilesRegister",new Dh),this._statusMap={}}return C()(e,[{key:"add",value:function(e,t,r,n){var i=this;if(!this._statusMap[t]){var a=n.frameNumber,o=n.viewport.id;this._statusMap[t]={request:e,callback:r,key:t,frameState:n,status:Lh},this.pendingTilesRegister.register(o,a),e().then((function(e){i._statusMap[t].status=jh;var r=i._statusMap[t].frameState,a=r.frameNumber,o=r.viewport.id;i.pendingTilesRegister.deregister(o,a),i._statusMap[t].callback(e,n)})).catch((function(e){i._statusMap[t].status=Gh;var n=i._statusMap[t].frameState,a=n.frameNumber,o=n.viewport.id;i.pendingTilesRegister.deregister(o,a),r(e)}))}}},{key:"update",value:function(e,t){if(this._statusMap[e]){var r=this._statusMap[e].frameState,n=r.frameNumber,i=r.viewport.id;this.pendingTilesRegister.deregister(i,n);var a=t.frameNumber,o=t.viewport.id;this.pendingTilesRegister.register(o,a),this._statusMap[e].frameState=t}}},{key:"find",value:function(e){return this._statusMap[e]}},{key:"hasPendingTiles",value:function(e,t){return!this.pendingTilesRegister.isZero(e,t)}}]),e}();function Nh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Jh(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Vh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vh(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Vh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function zh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var Kh=function(e){p()(n,e);var t,r=zh(n);function n(e){var t;return h()(this,n),t=r.call(this,e),Jn(gi()(t),"_tileManager",void 0),t._tileManager=new Uh,t}return C()(n,[{key:"traversalFinished",value:function(e){return!this._tileManager.hasPendingTiles(e.viewport.id,this._frameNumber||0)}},{key:"shouldRefine",value:function(e,t){return e._lodJudge=function(e,t){if(0===e.lodMetricValue||isNaN(e.lodMetricValue))return"DIG";var r=2*wh(e,t);return r<2?"OUT":!e.header.children||r<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}(e,t),"DIG"===e._lodJudge}},{key:"updateChildTiles",value:function(e,t){var r,n=this,i=e.header.children||[],a=e.children,o=e.tileset,s=Jh(i);try{var u=function(){var i=r.value,s="".concat(i.id,"-").concat(t.viewport.id),u=a&&a.find((function(e){return e.id===s}));if(u)u&&n.updateTile(u,t);else{var c=function(){return n._loadTile(i.id,o)};n._tileManager.find(s)?n._tileManager.update(s,t):(o.tileset.nodePages&&(c=function(){return o.tileset.nodePagesTile.formTileFromNodePages(i.id)}),n._tileManager.add(c,s,(function(t){return n._onTileLoad(t,e,s)}),t))}};for(s.s();!(r=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}return!1}},{key:"_loadTile",value:(t=Ie()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.loader,i=r.getTileUrl("".concat(r.url,"/nodes/").concat(t)),a=Hh(Hh({},r.loadOptions),{},{i3s:Hh(Hh({},r.loadOptions.i3s),{},{isTileHeader:!0,loadContent:!1})}),e.next=5,$l(i,n,a);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),function(e,r){return t.apply(this,arguments)})},{key:"_onTileLoad",value:function(e,t,r){var n=new Rh(t.tileset,e,t,r);t.children.push(n);var i=this._tileManager.find(n.id).frameState;this.updateTile(n,i),this._frameNumber===i.frameNumber&&(this.traversalFinished(i)||(new Date).getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(n,i)}}]),n}(Sh);function qh(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Xh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xh(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Xh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Qh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qh(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Zh={description:"",ellipsoid:Mf.WGS84,modelMatrix:new Zr,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){},onTraversalComplete:function(e){return e},contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},Yh="Tiles In Tileset(s)",$h=function(){function e(t,r){h()(this,e),Jn(this,"options",void 0),Jn(this,"loadOptions",void 0),Jn(this,"type",void 0),Jn(this,"tileset",void 0),Jn(this,"loader",void 0),Jn(this,"url",void 0),Jn(this,"basePath",void 0),Jn(this,"modelMatrix",void 0),Jn(this,"ellipsoid",void 0),Jn(this,"lodMetricType",void 0),Jn(this,"lodMetricValue",void 0),Jn(this,"refine",void 0),Jn(this,"root",void 0),Jn(this,"roots",void 0),Jn(this,"asset",void 0),Jn(this,"description",void 0),Jn(this,"properties",void 0),Jn(this,"extras",void 0),Jn(this,"attributions",void 0),Jn(this,"credits",void 0),Jn(this,"stats",void 0),Jn(this,"traverseCounter",void 0),Jn(this,"geometricError",void 0),Jn(this,"selectedTiles",void 0),Jn(this,"updatePromise",null),Jn(this,"tilesetInitializationPromise",void 0),Jn(this,"cartographicCenter",void 0),Jn(this,"cartesianCenter",void 0),Jn(this,"zoom",void 0),Jn(this,"boundingVolume",void 0),Jn(this,"gpuMemoryUsageInBytes",void 0),Jn(this,"dynamicScreenSpaceErrorComputedDensity",void 0),Jn(this,"_traverser",void 0),Jn(this,"_cache",void 0),Jn(this,"_requestScheduler",void 0),Jn(this,"_frameNumber",void 0),Jn(this,"_queryParamsString",void 0),Jn(this,"_queryParams",void 0),Jn(this,"_extensionsUsed",void 0),Jn(this,"_tiles",void 0),Jn(this,"_pendingCount",void 0),Jn(this,"lastUpdatedVieports",void 0),Jn(this,"_requestedTiles",void 0),Jn(this,"_emptyTiles",void 0),Jn(this,"frameStateData",void 0),Jn(this,"maximumMemoryUsage",void 0),tu(t),this.options=Wh(Wh({},Zh),r),this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||n.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new Ff,this._requestScheduler=new Zn({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new Kn({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this.tilesetInitializationPromise=this._initializeTileSet(t)}var t,r,i;return C()(e,[{key:"destroy",value:function(){this._destroy()}},{key:"isLoaded",value:function(){return 0===this._pendingCount&&0!==this._frameNumber&&0===this._requestedTiles.length}},{key:"tiles",get:function(){return Object.values(this._tiles)}},{key:"frameNumber",get:function(){return this._frameNumber}},{key:"queryParams",get:function(){return this._queryParamsString||(this._queryParamsString=function(e){for(var t=[],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];t.push("".concat(i,"=").concat(e[i]))}switch(t.length){case 0:return"";case 1:return"?".concat(t[0]);default:return"?".concat(t.join("&"))}}(this._queryParams)),this._queryParamsString}},{key:"setProps",value:function(e){this.options=Wh(Wh({},this.options),e)}},{key:"setOptions",value:function(e){this.options=Wh(Wh({},this.options),e)}},{key:"getTileUrl",value:function(e){return e.startsWith("data:")?e:"".concat(e).concat(this.queryParams)}},{key:"hasExtension",value:function(e){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(e)>-1)}},{key:"update",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.tilesetInitializationPromise.then((function(){!t&&e.lastUpdatedVieports?t=e.lastUpdatedVieports:e.lastUpdatedVieports=t,t&&e.doUpdate(t)}))}},{key:"selectTiles",value:(i=Ie()(Pe.a.mark((function e(){var t,r=this,n=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:null,e.next=3,this.tilesetInitializationPromise;case 3:return t&&(this.lastUpdatedVieports=t),this.updatePromise||(this.updatePromise=new Promise((function(e){setTimeout((function(){r.lastUpdatedVieports&&r.doUpdate(r.lastUpdatedVieports),e(r._frameNumber),r.updatePromise=null}),r.options.debounceTime)}))),e.abrupt("return",this.updatePromise);case 6:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"doUpdate",value:function(e){if((!("loadTiles"in this.options)||this.options.loadTiles)&&!(this.traverseCounter>0)){var t=e instanceof Array?e:[e];this._cache.reset(),this._frameNumber++,this.traverseCounter=t.length;var r,n=[],i=qh(t);try{for(i.s();!(r=i.n()).done;){var a=r.value.id;this._needTraverse(a)?n.push(a):this.traverseCounter--}}catch(e){i.e(e)}finally{i.f()}var o,s=qh(t);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=u.id;if(this.roots[c]||(this.roots[c]=this._initializeTileHeaders(this.tileset,null)),n.includes(c)){var l=Nf(u,this._frameNumber);this._traverser.traverse(this.roots[c],l,this.options)}}}catch(e){s.e(e)}finally{s.f()}}}},{key:"_needTraverse",value:function(e){var t=e;return this.options.viewportTraversersMap&&(t=this.options.viewportTraversersMap[e]),t===e}},{key:"_onTraversalEnd",value:function(e){var t=e.viewport.id;this.frameStateData[t]||(this.frameStateData[t]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});var r=this.frameStateData[t],n=function(e,t,r){if(0===r||e.length<=r)return[e,[]];var n,i=[],a=t.viewport,o=a.longitude,s=a.latitude,u=Df(e.entries());try{for(u.s();!(n=u.n()).done;){var c=M()(n.value,2),l=c[0],f=c[1],h=M()(f.header.mbs,2),d=h[0],p=h[1],v=Math.abs(o-d),y=Math.abs(s-p),g=Math.sqrt(y*y+v*v);i.push([l,g])}}catch(e){u.e(e)}finally{u.f()}for(var m=i.sort((function(e,t){return e[1]-t[1]})),b=[],A=0;A<r;A++)b.push(e[m[A][0]]);for(var B=[],w=r;w<m.length;w++)B.push(e[m[w][0]]);return[b,B]}(Object.values(this._traverser.selectedTiles),e,this.options.maximumTilesSelected),i=M()(n,2),a=i[0],o=i[1];r.selectedTiles=a;var s,u=qh(o);try{for(u.s();!(s=u.n()).done;){s.value.unselect()}}catch(e){u.e(e)}finally{u.f()}r._requestedTiles=Object.values(this._traverser.requestedTiles),r._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}},{key:"_updateTiles",value:function(){for(var e in this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[],this.frameStateData){var t=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(t.selectedTiles),this._requestedTiles=this._requestedTiles.concat(t._requestedTiles),this._emptyTiles=this._emptyTiles.concat(t._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);var r,n=qh(this.selectedTiles);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._tiles[i.id]=i}}catch(e){n.e(e)}finally{n.f()}this._loadTiles(),this._unloadTiles(),this._updateStats()}},{key:"_tilesChanged",value:function(e,t){if(e.length!==t.length)return!0;var r=new Set(e.map((function(e){return e.id}))),n=new Set(t.map((function(e){return e.id}))),i=e.filter((function(e){return!n.has(e.id)})).length>0;return i=i||t.filter((function(e){return!r.has(e.id)})).length>0}},{key:"_loadTiles",value:function(){var e,t=qh(this._requestedTiles);try{for(t.s();!(e=t.n()).done;){var r=e.value;r.contentUnloaded&&this._loadTile(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"_unloadTiles",value:function(){this._cache.unloadTiles(this,(function(e,t){return e._unloadTile(t)}))}},{key:"_updateStats",value:function(){var e,t=0,r=0,n=qh(this.selectedTiles);try{for(n.s();!(e=n.n()).done;){var i=e.value;i.contentAvailable&&i.content&&(t++,i.content.pointCount?r+=i.content.pointCount:r+=i.content.vertexCount)}}catch(e){n.e(e)}finally{n.f()}this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=t,this.stats.get("Points/Vertices").count=r}},{key:"_initializeTileSet",value:(r=Ie()(Pe.a.mark((function e(t){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.type!==ih){e.next=5;break}return this.calculateViewPropsI3S(),e.next=4,t.root;case 4:t.root=e.sent;case 5:this.root=this._initializeTileHeaders(t,null),this.type===ah&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===ih&&this._initializeI3STileset();case 8:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"calculateViewPropsI3S",value:function(){var e,t=this.tileset.fullExtent;if(t){var r=t.xmin,n=t.xmax,i=t.ymin,a=t.ymax,o=t.zmin,s=t.zmax;return this.cartographicCenter=new St(r+(n-r)/2,i+(a-i)/2,o+(s-o)/2),this.cartesianCenter=Mf.WGS84.cartographicToCartesian(this.cartographicCenter,new St),void(this.zoom=Kf(t,this.cartographicCenter,this.cartesianCenter))}var u=null===(e=this.tileset.store)||void 0===e?void 0:e.extent;if(u){var c=M()(u,4),l=c[0],f=c[1],h=c[2],d=c[3];return this.cartographicCenter=new St(l+(h-l)/2,f+(d-f)/2,0),this.cartesianCenter=Mf.WGS84.cartographicToCartesian(this.cartographicCenter,new St),void(this.zoom=function(e,t,r){var n=M()(e,4),i=n[0],a=n[1];return Kf({xmin:i,xmax:n[2],ymin:a,ymax:n[3],zmin:0,zmax:0},t,r)}(u,this.cartographicCenter,this.cartesianCenter))}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new St,this.zoom=1}},{key:"calculateViewPropsTiles3D",value:function(){var e=this.root;tu(e);var t=e.boundingVolume.center;if(!t)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new St,void(this.zoom=1);0!==t[0]||0!==t[1]||0!==t[2]?this.cartographicCenter=Mf.WGS84.cartesianToCartographic(t,new St):this.cartographicCenter=new St(0,0,-Mf.WGS84.radii[0]),this.cartesianCenter=t,this.zoom=zf(e.boundingVolume,this.cartographicCenter)}},{key:"_initializeStats",value:function(){this.stats.get(Yh),this.stats.get("Tiles Loading"),this.stats.get("Tiles In Memory"),this.stats.get("Tiles In View"),this.stats.get("Tiles To Render"),this.stats.get("Tiles Loaded"),this.stats.get("Tiles Unloaded"),this.stats.get("Failed Tile Loads"),this.stats.get("Points/Vertices","memory"),this.stats.get("Tile Memory Use","memory")}},{key:"_initializeTileHeaders",value:function(e,t){var r=new Rh(this,e.root,t);if(t&&(t.children.push(r),r.depth=t.depth+1),this.type===ah){var n=[];for(n.push(r);n.length>0;){var i=n.pop();this.stats.get(Yh).incrementCount();var a,o=qh(i.header.children||[]);try{for(o.s();!(a=o.n()).done;){var s=a.value,u=new Rh(this,s,i);i.children.push(u),u.depth=i.depth+1,n.push(u)}}catch(e){o.e(e)}finally{o.f()}}}return r}},{key:"_initializeTraverser",value:function(){var e;switch(this.type){case ah:e=Fh;break;case ih:e=Kh;break;default:e=Sh}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(e){this._destroySubtree(e)}},{key:"_loadTile",value:(t=Ie()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this._onStartTileLoading(),e.next=4,t.loadContent();case 4:r=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),this._onTileLoadError(t,e.t0);case 10:return e.prev=10,this._onEndTileLoading(),this._onTileLoad(t,r),e.finish(10);case 14:case"end":return e.stop()}}),e,this,[[0,7,10,14]])}))),function(e){return t.apply(this,arguments)})},{key:"_onTileLoadError",value:function(e,t){this.stats.get("Failed Tile Loads").incrementCount();var r=t.message||t.toString(),n=e.url;console.error("A 3D tile failed to load: ".concat(e.url," ").concat(r)),this.options.onTileError(e,r,n)}},{key:"_onTileLoad",value:function(e,t){if(t){if(this.type===ih){var r,n,i=(null===(r=this.tileset)||void 0===r||null===(n=r.nodePagesTile)||void 0===n?void 0:n.nodesInNodePages)||0;this.stats.get(Yh).reset(),this.stats.get(Yh).addCount(i)}e&&e.content&&function(e,t){tu(e),tu(t);var r=t.rtcCenter,n=t.gltfUpAxis,i=e.computedTransform,a=e.boundingVolume.center,o=new Zr(i);switch(r&&o.translate(r),n){case"Z":break;case"Y":var s=(new Zr).rotateX(Math.PI/2);o=o.multiplyRight(s);break;case"X":var u=(new Zr).rotateY(-Math.PI/2);o=o.multiplyRight(u)}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);var c=new St(a);t.cartesianModelMatrix=o,t.cartesianOrigin=c;var l=Mf.WGS84.cartesianToCartographic(c,new St),f=Mf.WGS84.eastNorthUpToFixedFrame(c).invert();t.cartographicModelMatrix=f.multiplyRight(o),t.cartographicOrigin=l,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}(e,e.content),this._addTileToCache(e),this.options.onTileLoad(e)}}},{key:"_onStartTileLoading",value:function(){this._pendingCount++,this.stats.get("Tiles Loading").incrementCount()}},{key:"_onEndTileLoading",value:function(){this._pendingCount--,this.stats.get("Tiles Loading").decrementCount()}},{key:"_addTileToCache",value:function(e){this._cache.add(this,e,(function(t){return t._updateCacheStats(e)}))}},{key:"_updateCacheStats",value:function(e){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=e.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}},{key:"_unloadTile",value:function(e){this.gpuMemoryUsageInBytes-=e.content&&e.content.byteLength||0,this.stats.get("Tiles In Memory").decrementCount(),this.stats.get("Tiles Unloaded").incrementCount(),this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}},{key:"_destroy",value:function(){var e=[];for(this.root&&e.push(this.root);e.length>0;){var t,r=e.pop(),n=qh(r.children);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.push(i)}}catch(e){n.e(e)}finally{n.f()}this._destroyTile(r)}this.root=null}},{key:"_destroySubtree",value:function(e){var t=e,r=[];for(r.push(t);r.length>0;){var n,i=qh((e=r.pop()).children);try{for(i.s();!(n=i.n()).done;){var a=n.value;r.push(a)}}catch(e){i.e(e)}finally{i.f()}e!==t&&this._destroyTile(e)}t.children=[]}},{key:"_destroyTile",value:function(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}},{key:"_initializeTiles3DTileset",value:function(e){if(this.asset=e.asset,!this.asset)throw new Error("Tileset must have an asset property.");if("0.0"!==this.asset.version&&"1.0"!==this.asset.version)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=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed,this.extras=e.extras}},{key:"_initializeI3STileset",value:function(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}]),e}();var ed={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(ed);function td(e,t,r){tu(e instanceof ArrayBuffer);var n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function rd(e){var t=arguments.length>1&&void 0!==arguments[1]?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 nd={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:"3.2.10",worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"===("undefined"==typeof WebAssembly?"undefined":bi()(WebAssembly))?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function id(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,c=0;c<u;c+=3){var l=s[c],f=s[c+1],h=s[c+2];t=l<t?l:t,r=f<r?f:r,n=h<n?h:n,i=l>i?l:i,a=f>a?f:a,o=h>o?h:o}return[[t,r,n],[i,a,o]]}function ad(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return od(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return od(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function od(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var sd=function(){function e(t,r){h()(this,e),Jn(this,"fields",void 0),Jn(this,"metadata",void 0),function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}(Array.isArray(t)),function(e){var t,r={},n=ad(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;r[i.name]&&console.warn("Schema: duplicated field name",i.name,i),r[i.name]=!0}}catch(e){n.e(e)}finally{n.f()}}(t),this.fields=t,this.metadata=r||new Map}return C()(e,[{key:"compareTo",value:function(e){if(this.metadata!==e.metadata)return!1;if(this.fields.length!==e.fields.length)return!1;for(var t=0;t<this.fields.length;++t)if(!this.fields[t].compareTo(e.fields[t]))return!1;return!0}},{key:"select",value:function(){for(var t=Object.create(null),r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];for(var a=0,o=n;a<o.length;a++){var s=o[a];t[s]=!0}var u=this.fields.filter((function(e){return t[e.name]}));return new e(u,this.metadata)}},{key:"selectAt",value:function(){for(var t=this,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var a=n.map((function(e){return t.fields[e]})).filter(Boolean);return new e(a,this.metadata)}},{key:"assign",value:function(t){var r,n=this.metadata;if(t instanceof e){var i=t;r=i.fields,n=ud(ud(new Map,this.metadata),i.metadata)}else r=t;var a,o=Object.create(null),s=ad(this.fields);try{for(s.s();!(a=s.n()).done;){var u=a.value;o[u.name]=u}}catch(e){s.e(e)}finally{s.f()}var c,l=ad(r);try{for(l.s();!(c=l.n()).done;){var f=c.value;o[f.name]=f}}catch(e){l.e(e)}finally{l.f()}return new e(Object.values(o),n)}}]),e}();function ud(e,t){return new Map([].concat(Le()(e||new Map),Le()(t||new Map)))}var cd,ld=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;h()(this,e),Jn(this,"name",void 0),Jn(this,"type",void 0),Jn(this,"nullable",void 0),Jn(this,"metadata",void 0),this.name=t,this.type=r,this.nullable=n,this.metadata=i}return C()(e,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new e(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}]),e}();function fd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}!function(e){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"}(cd||(cd={}));var hd=function(){function e(){h()(this,e)}return C()(e,[{key:"typeId",get:function(){return cd.NONE}},{key:"compareTo",value:function(e){return this===e}}],[{key:"isNull",value:function(e){return e&&e.typeId===cd.Null}},{key:"isInt",value:function(e){return e&&e.typeId===cd.Int}},{key:"isFloat",value:function(e){return e&&e.typeId===cd.Float}},{key:"isBinary",value:function(e){return e&&e.typeId===cd.Binary}},{key:"isUtf8",value:function(e){return e&&e.typeId===cd.Utf8}},{key:"isBool",value:function(e){return e&&e.typeId===cd.Bool}},{key:"isDecimal",value:function(e){return e&&e.typeId===cd.Decimal}},{key:"isDate",value:function(e){return e&&e.typeId===cd.Date}},{key:"isTime",value:function(e){return e&&e.typeId===cd.Time}},{key:"isTimestamp",value:function(e){return e&&e.typeId===cd.Timestamp}},{key:"isInterval",value:function(e){return e&&e.typeId===cd.Interval}},{key:"isList",value:function(e){return e&&e.typeId===cd.List}},{key:"isStruct",value:function(e){return e&&e.typeId===cd.Struct}},{key:"isUnion",value:function(e){return e&&e.typeId===cd.Union}},{key:"isFixedSizeBinary",value:function(e){return e&&e.typeId===cd.FixedSizeBinary}},{key:"isFixedSizeList",value:function(e){return e&&e.typeId===cd.FixedSizeList}},{key:"isMap",value:function(e){return e&&e.typeId===cd.Map}},{key:"isDictionary",value:function(e){return e&&e.typeId===cd.Dictionary}}]),e}(),dd=(Symbol.toStringTag,Symbol.toStringTag,function(e,t){p()(n,e);var r=fd(n);function n(e,t){var i;return h()(this,n),i=r.call(this),Jn(gi()(i),"isSigned",void 0),Jn(gi()(i),"bitWidth",void 0),i.isSigned=e,i.bitWidth=t,i}return C()(n,[{key:"typeId",get:function(){return cd.Int}},{key:t,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),n}(hd,Symbol.toStringTag)),pd=function(e){p()(r,e);var t=fd(r);function r(){return h()(this,r),t.call(this,!0,8)}return r}(dd),vd=function(e){p()(r,e);var t=fd(r);function r(){return h()(this,r),t.call(this,!0,16)}return r}(dd),yd=function(e){p()(r,e);var t=fd(r);function r(){return h()(this,r),t.call(this,!0,32)}return r}(dd),gd=function(e){p()(r,e);var t=fd(r);function r(){return h()(this,r),t.call(this,!1,8)}return r}(dd),md=function(e){p()(r,e);var t=fd(r);function r(){return h()(this,r),t.call(this,!1,16)}return r}(dd),bd=function(e){p()(r,e);var t=fd(r);function r(){return h()(this,r),t.call(this,!1,32)}return r}(dd),Ad=32,Bd=64,wd=function(e,t){p()(n,e);var r=fd(n);function n(e){var t;return h()(this,n),t=r.call(this),Jn(gi()(t),"precision",void 0),t.precision=e,t}return C()(n,[{key:"typeId",get:function(){return cd.Float}},{key:t,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),n}(hd,Symbol.toStringTag),_d=function(e){p()(r,e);var t=fd(r);function r(){return h()(this,r),t.call(this,Ad)}return r}(wd),xd=function(e){p()(r,e);var t=fd(r);function r(){return h()(this,r),t.call(this,Bd)}return r}(wd),Cd=(Symbol.toStringTag,Symbol.toStringTag,{DAY:0,MILLISECOND:1}),Od=(Symbol.toStringTag,{SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9}),Ed=(Symbol.toStringTag,Symbol.toStringTag,{DAY_TIME:0,YEAR_MONTH:1}),Td=(Symbol.toStringTag,function(e,t){p()(n,e);var r=fd(n);function n(e,t){var i;return h()(this,n),i=r.call(this),Jn(gi()(i),"listSize",void 0),Jn(gi()(i),"children",void 0),i.listSize=e,i.children=[t],i}return C()(n,[{key:"typeId",get:function(){return cd.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:t,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}]),n}(hd,Symbol.toStringTag));Symbol.toStringTag;function Sd(e,t,r){var n=function(e){switch(e.constructor){case Int8Array:return new pd;case Uint8Array:return new gd;case Int16Array:return new vd;case Uint16Array:return new md;case Int32Array:return new yd;case Uint32Array:return new bd;case Float32Array:return new _d;case Float64Array:return new xd;default:throw new Error("array type not supported")}}(t.value),i=r||function(e){var t=new Map;"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());return t}(t);return new ld(e,new Td(t.size,new ld("value",n)),!1,i)}function kd(e,t,r){var n=Id(t.metadata),i=[],a=function(e){var t={};for(var r in e){var n=e[r];t[n.name||"undefined"]=n}return t}(t.attributes);for(var o in e){var s=Md(o,e[o],a[o]);i.push(s)}if(r){var u=Md("indices",r);i.push(u)}return new sd(i,n)}function Md(e,t,r){return Sd(e,t,r?Id(r.metadata):void 0)}function Id(e){var t=new Map;for(var r in e)t.set("".concat(r,".string"),JSON.stringify(e[r]));return t}function Rd(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Pd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pd(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Pd(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Dd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fd(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ld={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},jd={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},Gd=function(){function e(t){h()(this,e),Jn(this,"draco",void 0),Jn(this,"decoder",void 0),Jn(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return C()(e,[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new this.draco.DecoderBuffer;r.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);var n=this.decoder.GetEncodedGeometryType(r),i=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var a;switch(n){case this.draco.TRIANGULAR_MESH:a=this.decoder.DecodeBufferToMesh(r,i);break;case this.draco.POINT_CLOUD:a=this.decoder.DecodeBufferToPointCloud(r,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!a.ok()||!i.ptr){var o="DRACO decompression failed: ".concat(a.error_msg());throw new Error(o)}var s=this._getDracoLoaderData(i,n,t),u=this._getMeshData(i,s,t),c=id(u.attributes),l=kd(u.attributes,s,u.indices),f=Dd(Dd({loader:"draco",loaderData:s,header:{vertexCount:i.num_points(),boundingBox:c}},u),{},{schema:l});return f}finally{this.draco.destroy(r),i&&this.draco.destroy(i)}}},{key:"_getDracoLoaderData",value:function(e,t,r){var n=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,r);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:n,attributes:i}}},{key:"_getDracoAttributes",value:function(e,t){for(var r={},n=0;n<e.num_attributes();n++){var i=this.decoder.GetAttribute(e,n),a=this._getAttributeMetadata(e,n);r[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:n,metadata:a};var o=this._getQuantizationTransform(i,t);o&&(r[i.unique_id()].quantization_transform=o);var s=this._getOctahedronTransform(i,t);s&&(r[i.unique_id()].octahedron_transform=s)}return r}},{key:"_getMeshData",value:function(e,t,r){var n=this._getMeshAttributes(t,e,r);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:n}}},{key:"_getMeshAttributes",value:function(e,t,r){for(var n={},i=0,a=Object.values(e.attributes);i<a.length;i++){var o=a[i],s=this._deduceAttributeName(o,r);o.name=s;var u=this._getAttributeValues(t,o),c=u.value,l=u.size;n[s]={value:c,size:l,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}return n}},{key:"_getTriangleListIndices",value:function(e){var t=3*e.num_faces(),r=4*t,n=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(e,r,n),new Uint32Array(this.draco.HEAPF32.buffer,n,t).slice()}finally{this.draco._free(n)}}},{key:"_getTriangleStripIndices",value:function(e){var t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),function(e){for(var t=e.size(),r=new Int32Array(t),n=0;n<t;n++)r[n]=e.GetValue(n);return r}(t)}finally{this.draco.destroy(t)}}},{key:"_getAttributeValues",value:function(e,t){var r,n=jd[t.data_type],i=t.num_components,a=e.num_points()*i,o=a*n.BYTES_PER_ELEMENT,s=function(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}}(this.draco,n),u=this.draco._malloc(o);try{var c=this.decoder.GetAttribute(e,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,c,s,o,u),r=new n(this.draco.HEAPF32.buffer,u,a).slice()}finally{this.draco._free(u)}return{value:r,size:i}}},{key:"_deduceAttributeName",value:function(e,t){for(var r=e.unique_id,n=0,i=Object.entries(t.extraAttributes||{});n<i.length;n++){var a=M()(i[n],2),o=a[0];if(a[1]===r)return o}var s=e.attribute_type;for(var u in Ld){if(this.draco[u]===s)return Ld[u]}var c=t.attributeNameEntry||"name";return e.metadata[c]?e.metadata[c].string:"CUSTOM_ATTRIBUTE_".concat(r)}},{key:"_getTopLevelMetadata",value:function(e){var t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}},{key:"_getAttributeMetadata",value:function(e,t){var r=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(r)}},{key:"_getDracoMetadata",value:function(e){if(!e||!e.ptr)return{};for(var t={},r=this.metadataQuerier.NumEntries(e),n=0;n<r;n++){var i=this.metadataQuerier.GetEntryName(e,n);t[i]=this._getDracoMetadataField(e,i)}return t}},{key:"_getDracoMetadataField",value:function(e,t){var r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,r);var n=function(e){for(var t=e.size(),r=new Int32Array(t),n=0;n<t;n++)r[n]=e.GetValue(n);return r}(r);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:n}}finally{this.draco.destroy(r)}}},{key:"_disableAttributeTransforms",value:function(e){var t,r=e.quantizedAttributes,n=void 0===r?[]:r,i=e.octahedronAttributes,a=void 0===i?[]:i,o=Rd([].concat(Le()(n),Le()(a)));try{for(o.s();!(t=o.n()).done;){var s=t.value;this.decoder.SkipAttributeTransform(this.draco[s])}}catch(e){o.e(e)}finally{o.f()}}},{key:"_getQuantizationTransform",value:function(e,t){var r=this,n=t.quantizedAttributes,i=void 0===n?[]:n,a=e.attribute_type();if(i.map((function(e){return r.decoder[e]})).includes(a)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map((function(e){return o.min_value(e)}))}}finally{this.draco.destroy(o)}}return null}},{key:"_getOctahedronTransform",value:function(e,t){var r=this,n=t.octahedronAttributes,i=void 0===n?[]:n,a=e.attribute_type();if(i.map((function(e){return r.decoder[e]})).includes(a)){var o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}]),e}();var Ud=r(28),Nd={};function Hd(e){return Jd.apply(this,arguments)}function Jd(){return(Jd=Ie()(Pe.a.mark((function e(t){var r,n,i=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:null,n=i.length>2&&void 0!==i[2]?i[2]:{},r&&(t=Vd(t,r,n)),Nd[t]=Nd[t]||zd(t),e.next=6,Nd[t];case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vd(e,t,r){if(e.startsWith("http"))return e;var n=r.modules||{};return n[e]?n[e]:wc?r.CDN?(mc(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(t,"@").concat("3.2.10","/dist/libs/").concat(e)):_c?"../src/libs/".concat(e):"modules/".concat(t,"/src/libs/").concat(e):"modules/".concat(t,"/dist/libs/").concat(e)}function zd(e){return Kd.apply(this,arguments)}function Kd(){return(Kd=Ie()(Pe.a.mark((function e(t){var r,n,i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.endsWith("wasm")){e.next=7;break}return e.next=3,fetch(t);case 3:return r=e.sent,e.next=6,r.arrayBuffer();case 6:return e.abrupt("return",e.sent);case 7:if(wc){e.next=20;break}if(e.prev=8,e.t0=Ud&&Ud.requireFromFile,!e.t0){e.next=14;break}return e.next=13,Ud.requireFromFile(t);case 13:e.t0=e.sent;case 14:return e.abrupt("return",e.t0);case 17:return e.prev=17,e.t1=e.catch(8),e.abrupt("return",null);case 20:if(!_c){e.next=22;break}return e.abrupt("return",importScripts(t));case 22:return e.next=24,fetch(t);case 24:return n=e.sent,e.next=27,n.text();case 27:return i=e.sent,e.abrupt("return",qd(i,t));case 29:case"end":return e.stop()}}),e,null,[[8,17]])})))).apply(this,arguments)}function qd(e,t){if(!wc)return Ud.requireFromString&&Ud.requireFromString(e,t);if(_c)return eval.call(Bc,e),null;var r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch(t){r.text=e}return document.body.appendChild(r),null}function Xd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xd(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Wd,Zd="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),Yd="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),$d="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat("1.4.1","/javascript/draco_encoder.js");function ep(e){return tp.apply(this,arguments)}function tp(){return(tp=Ie()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modules||{},Wd=r.draco3d?Wd||r.draco3d.createDecoderModule({}).then((function(e){return{draco:e}})):Wd||rp(t),e.next=4,Wd;case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rp(e){return np.apply(this,arguments)}function np(){return(np=Ie()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.draco&&t.draco.decoderType,e.next="js"===e.t0?3:(e.t0,7);break;case 3:return e.next=5,Hd(Zd,"draco",t);case 5:return r=e.sent,e.abrupt("break",21);case 7:return e.t1=Promise,e.next=10,Hd(Yd,"draco",t);case 10:return e.t2=e.sent,e.next=13,Hd($d,"draco",t);case 13:return e.t3=e.sent,e.t4=[e.t2,e.t3],e.next=17,e.t1.all.call(e.t1,e.t4);case 17:i=e.sent,a=M()(i,2),r=a[0],n=a[1];case 21:return r=r||globalThis.DracoDecoderModule,e.next=24,ip(r,n);case 24:return e.abrupt("return",e.sent);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ip(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(Qd(Qd({},r),{},{onModuleLoaded:function(e){return t({draco:e})}}))}))}function ap(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function op(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ap(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ap(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var sp=op(op({},nd),{},{parse:function(e,t){return up.apply(this,arguments)}});function up(){return(up=Ie()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ep(r);case 2:return n=e.sent,i=n.draco,a=new Gd(i),e.prev=5,e.abrupt("return",a.parseSync(t,null==r?void 0:r.draco));case 7:return e.prev=7,a.destroy(),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[5,,7,10]])})))).apply(this,arguments)}var cp,lp=(cp={},A()(cp,5130,Float64Array),A()(cp,5126,Float32Array),A()(cp,5123,Uint16Array),A()(cp,5125,Uint32Array),A()(cp,5121,Uint8Array),A()(cp,5120,Int8Array),A()(cp,5122,Int16Array),A()(cp,5124,Int32Array),cp),fp={DOUBLE:5130,FLOAT:5126,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,UNSIGNED_BYTE:5121,BYTE:5120,SHORT:5122,INT:5124},hp=function(){function e(){h()(this,e)}return C()(e,null,[{key:"fromTypedArray",value:function(e){for(var t in e=ArrayBuffer.isView(e)?e.constructor:e,lp){if(lp[t]===e)return t}throw new Error("Failed to convert GL type")}},{key:"fromName",value:function(e){var t=fp[e];if(!t)throw new Error("Failed to convert GL type");return t}},{key:"getArrayType",value:function(e){switch(e){case 33635:case 32819:case 32820:return Uint16Array;default:var t=lp[e];if(!t)throw new Error("Failed to convert GL type");return t}}},{key:"getByteSize",value:function(t){return e.getArrayType(t).BYTES_PER_ELEMENT}},{key:"validate",value:function(t){return Boolean(e.getArrayType(t))}},{key:"createTypedArray",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;void 0===i&&(i=(r.byteLength-n)/e.getByteSize(t));var a=e.getArrayType(t);return new a(r,n,i)}}]),e}(),dp=function(){function e(t,r){h()(this,e),Jn(this,"json",void 0),Jn(this,"buffer",void 0),Jn(this,"featuresLength",0),Jn(this,"_cachedTypedArrays",{}),this.json=t,this.buffer=r}return C()(e,[{key:"getExtension",value:function(e){return this.json.extensions&&this.json.extensions[e]}},{key:"hasProperty",value:function(e){return Boolean(this.json[e])}},{key:"getGlobalProperty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5125,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.json[e];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(e,t,r,1,n.byteOffset):n}},{key:"getPropertyArray",value:function(e,t,r){var n=this.json[e];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(t=hp.fromName(n.componentType)),this._getTypedArrayFromBinary(e,t,r,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(e,t,n)}},{key:"getProperty",value:function(e,t,r,n,i){var a=this.json[e];if(!a)return a;var o=this.getPropertyArray(e,t,r);if(1===r)return o[n];for(var s=0;s<r;++s)i[s]=o[r*n+s];return i}},{key:"_getTypedArrayFromBinary",value:function(e,t,r,n,i){var a=this._cachedTypedArrays,o=a[e];return o||(o=hp.createTypedArray(t,this.buffer.buffer,this.buffer.byteOffset+i,n*r),a[e]=o),o}},{key:"_getTypedArrayFromArray",value:function(e,t,r){var n=this._cachedTypedArrays,i=n[e];return i||(i=hp.createTypedArray(t,r),n[e]=i),i}}]),e}(),pp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},vp={SCALAR:function(e,t){return e[t]},VEC2:function(e,t){return[e[2*t+0],e[2*t+1]]},VEC3:function(e,t){return[e[3*t+0],e[3*t+1],e[3*t+2]]},VEC4:function(e,t){return[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]]},MAT2:function(e,t){return[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]]},MAT3:function(e,t){return[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]]},MAT4:function(e,t){return[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]}},yp={SCALAR:function(e,t,r){t[r]=e},VEC2:function(e,t,r){t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:function(e,t,r){t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:function(e,t,r){t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:function(e,t,r){t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:function(e,t,r){t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:function(e,t,r){t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};var gp=function(e){return void 0!==e};function mp(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?function(e,t){var r,n,i,a,o=e.instancesLength,s=e.classes,u=e.classIds,c=e.parentCounts,l=e.parentIds,f=o;gp(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,5123),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,o));if(gp(c))for(gp(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,5123),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,o)),a=new Uint16Array(o),f=0,r=0;r<o;++r)a[r]=f,f+=c[r];gp(l)&&gp(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,5123),l.type=AttributeType.SCALAR,i=getBinaryAccessor(l),l=i.createArrayBufferView(t.buffer,t.byteOffset+l.byteOffset,f));var h=s.length;for(r=0;r<h;++r){var d=s[r].length,p=s[r].instances,v=getBinaryProperties(d,p,t);s[r].instances=combine(v,p)}var y=new Array(h).fill(0),g=new Uint16Array(o);for(r=0;r<o;++r)n=u[r],g[r]=y[n],++y[n];var m={classes:s,classIds:u,classIndexes:g,parentCounts:c,parentIndexes:a,parentIds:l};return function(e){for(var t=e.classIds.length,r=0;r<t;++r)Ap(e,r,stack)}(m),m}(n,r):null}function bp(e,t,r){if(e){var n=e.parentCounts;return e.parentIds?r(e,t):n>0?function(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 c=++marker,l=scratchStack;l.length=0,l.push(t);for(;l.length>0;)if(t=l.pop(),u[t]!==c){u[t]=c;var f=r(e,t);if(gp(f))return f;for(var h=i[t],d=o[t],p=0;p<h;++p){var v=a[d+p];v!==t&&l.push(v)}}return null}(e,t,r):function(e,t,r){var n=!0;for(;n;){var i=r(e,t);if(gp(i))return i;var a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}(e,t,r)}}function Ap(e,t,r){var n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,o=e.classIds.length;if(gp(i)){assert(t<o,"Parent index ".concat(t," exceeds the total number of instances: ").concat(o)),assert(-1===r.indexOf(t),"Circular dependency detected in the batch table hierarchy."),r.push(t);for(var s=gp(n)?n[t]:1,u=gp(n)?a[t]:t,c=0;c<s;++c){var l=i[u+c];l!==t&&Ap(e,l,r)}r.pop(t)}}function Bp(e){return null!=e}var wp=function(e,t){return e},_p={HIERARCHY:!0,extensions:!0,extras:!0},xp=function(){function e(t,r,n){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};for(var o in h()(this,e),Jn(this,"json",void 0),Jn(this,"binary",void 0),Jn(this,"featureCount",void 0),Jn(this,"_extensions",void 0),Jn(this,"_properties",void 0),Jn(this,"_binaryProperties",void 0),Jn(this,"_hierarchy",void 0),tu(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=(null===(i=this.json)||void 0===i?void 0:i.extensions)||{},this._properties={},this.json)_p[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),a["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=mp(this,this.json,this.binary))}return C()(e,[{key:"getExtension",value:function(e){return this.json&&this.json.extensions&&this.json.extensions[e]}},{key:"memorySizeInBytes",value:function(){return 0}},{key:"isClass",value:function(e,t){return this._checkBatchId(e),tu("string"==typeof t,t),!!this._hierarchy&&Bp(bp(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return e.classes[n].name===t})))}},{key:"isExactClass",value:function(e,t){return tu("string"==typeof t,t),this.getExactClassName(e)===t}},{key:"getExactClassName",value:function(e){if(this._checkBatchId(e),this._hierarchy){var t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}},{key:"hasProperty",value:function(e,t){return this._checkBatchId(e),tu("string"==typeof t,t),Bp(this._properties[t])||this._hasPropertyInHierarchy(e,t)}},{key:"getPropertyNames",value:function(e,t){var r;this._checkBatchId(e),(t=Bp(t)?t:[]).length=0;var n=Object.keys(this._properties);return(r=t).push.apply(r,Le()(n)),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}},{key:"getProperty",value:function(e,t){if(this._checkBatchId(e),tu("string"==typeof t,t),this._binaryProperties){var r=this._binaryProperties[t];if(Bp(r))return this._getBinaryProperty(r,e)}var n=this._properties[t];if(Bp(n))return wp(n[e]);if(this._hierarchy){var i=this._getHierarchyProperty(e,t);if(Bp(i))return i}}},{key:"setProperty",value:function(e,t,r){var n=this.featureCount;if(this._checkBatchId(e),tu("string"==typeof t,t),this._binaryProperties){var i=this._binaryProperties[t];if(i)return void this._setBinaryProperty(i,e,r)}if(!this._hierarchy||!this._setHierarchyProperty(this,e,t,r)){var a=this._properties[t];Bp(a)||(this._properties[t]=new Array(n),a=this._properties[t]),a[e]=wp(r)}}},{key:"_checkBatchId",value:function(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}},{key:"_getBinaryProperty",value:function(e,t){return e.unpack(e.typedArray,t)}},{key:"_setBinaryProperty",value:function(e,t,r){e.pack(r,e.typedArray,t)}},{key:"_initializeBinaryProperties",value:function(){var e=null;for(var t in this._properties){var r=this._properties[t],n=this._initializeBinaryProperty(t,r);n&&((e=e||{})[t]=n)}return e}},{key:"_initializeBinaryProperty",value:function(e,t){if("byteOffset"in t){var r=t;tu(this.binary,"Property ".concat(e," requires a batch table binary.")),tu(r.type,"Property ".concat(e," requires a type."));var n=function(e,t,r,n){var i=e.componentType;tu(e.componentType);var a="string"==typeof i?hp.fromName(i):i,o=pp[e.type],s=vp[e.type],u=yp[e.type];return r+=e.byteOffset,{values:hp.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:u}}(r,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}},{key:"_hasPropertyInHierarchy",value:function(e,t){if(!this._hierarchy)return!1;var r=bp(this._hierarchy,e,(function(e,r){var n=e.classIds[r];return Bp(e.classes[n].instances[t])}));return Bp(r)}},{key:"_getPropertyNamesInHierarchy",value:function(e,t){bp(this._hierarchy,e,(function(e,r){var n=e.classIds[r],i=e.classes[n].instances;for(var a in i)i.hasOwnProperty(a)&&-1===t.indexOf(a)&&t.push(a)}))}},{key:"_getHierarchyProperty",value:function(e,t){var r=this;return bp(this._hierarchy,e,(function(e,n){var i=e.classIds[n],a=e.classes[i],o=e.classIndexes[n],s=a.instances[t];return Bp(s)?Bp(s.typedArray)?r._getBinaryProperty(s,o):wp(s[o]):null}))}},{key:"_setHierarchyProperty",value:function(e,t,r,n){var i=this,a=bp(this._hierarchy,t,(function(e,a){var o=e.classIds[a],s=e.classes[o],u=e.classIndexes[a],c=s.instances[r];return!!Bp(c)&&(tu(a===t,'Inherited property "'.concat(r,'" is read-only.')),Bp(c.typedArray)?i._setBinaryProperty(c,u,n):c[u]=wp(n),!0)}));return Bp(a)}}]),e}();function Cp(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=4,e.version=n.getUint32(r,!0),r+=4,e.byteLength=n.getUint32(r,!0),r+=4,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return r}function Op(e,t,r){var n,i=new DataView(t);e.header=e.header||{};var a=i.getUint32(r,!0);r+=4;var o=i.getUint32(r,!0);r+=4;var s=i.getUint32(r,!0);r+=4;var u=i.getUint32(r,!0);return r+=4,s>=570425344?(r-=8,n=a,s=o,u=0,a=0,o=0,console.warn("b3dm tile in legacy format.")):u>=570425344&&(r-=4,n=s,s=a,u=o,a=0,o=0,console.warn("b3dm tile in legacy format.")),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=n,r}function Ep(e,t,r,n){return r=function(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=td(t,r,a);e.featureTableJson=JSON.parse(u)}return r+=a,e.featureTableBinary=new Uint8Array(t,r,o),r+=o}(e,t,r),r=function(e,t,r,n){var i=e.header,a=i.batchTableJsonByteLength,o=i.batchTableBinaryByteLength;if(a>0){var s=td(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}(e,t,r)}function Tp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=e>>11&31,n=e>>5&63,i=31&e;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}function Sp(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(3*a),s=0;s<a;s++){var u=n[s],c=r.getProperty(u,"dimensions").map((function(e){return 255*e}));o[3*s]=c[0],o[3*s+1]=c[1],o[3*s+2]=c[2]}return{type:5121,value:o,size:3,normalized:!0}}if(i){for(var l=new Uint8ClampedArray(3*a),f=0;f<a;f++){var h=Tp(t[f]);l[3*f]=h[0],l[3*f+1]=h[1],l[3*f+2]=h[2]}return{type:5121,value:l,size:3,normalized:!0}}return t&&t.length===3*a?{type:5121,value:t,size:3,normalized:!0}:{type:5121,value:t,size:4,normalized:!0}}function kp(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}new en,new St,new en,new en,new Uint8Array(1);function Mp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return ft(e,0,t)/t*2-1}function Ip(e){return e<0?-1:1}function Rp(e,t,r,n){if(kp(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=Mp(e,r),n.y=Mp(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))*Ip(i),n.y=(1-Math.abs(i))*Ip(n.y)}return n.normalize()}function Pp(e,t,r){return Rp(e,t,255,r)}var Fp=new St;function Dp(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,function(e,t){for(var r=new St,n=new Float32Array(3*e.pointCount),i=0;i<e.pointCount;i++)r.set(t[3*i],t[3*i+1],t[3*i+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,3*i);return n}(e,t)):{type:5123,value:t,size:3,normalized:!0}:t}function Lp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function jp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lp(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Gp(e,t,r,n,i){return Up.apply(this,arguments)}function Up(){return(Up=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Cp(t,r,n),n=Op(t,r,n),n=Ep(t,r,n),Np(t),o=Hp(t),s=o.featureTable,u=o.batchTable,e.next=7,Kp(t,s,u,i,a);case 7:return Jp(t,s,i),Vp(t,s,u),zp(t,s),e.abrupt("return",n);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Np(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function Hp(e){var t=new dp(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=function(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 xp(i,a,n)}return r}(e,t);return{featureTable:t,batchTable:n}}function Jp(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=65535,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=Dp(e,n,r)}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Vp(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=Sp(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",5121,4))}function zp(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=function(e,t){if(!t)return null;if(e.isOctEncoded16P){for(var r=new Float32Array(3*e.pointsLength),n=0;n<e.pointsLength;n++)Pp(t[2*n],t[2*n+1],Fp),Fp.toArray(r,3*n);return{type:5126,size:2,value:r}}return{type:5126,size:2,value:t}}(e,r)}}function Kp(e,t,r,n,i){return qp.apply(this,arguments)}function qp(){return(qp=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h,d;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((c=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"])&&(u=c.properties),!(l=r.getExtension("3DTILES_draco_point_compression"))){e.next=15;break}if(s=l.properties,f=l.byteOffset,h=l.byteLength,s&&Number.isFinite(f)&&h){e.next=9;break}throw new Error("Draco properties, byteOffset, and byteLength must be defined");case 9:o=t.featureTableBinary.slice(f,f+h),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){e.next=17;break}return e.abrupt("return",!0);case 17:return d={buffer:o,properties:jp(jp({},s),u),featureTableProperties:s,batchTableProperties:u,dequantizeInShader:!1},e.next=20,Xp(t,d,i,a);case 20:return e.abrupt("return",e.sent);case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xp(e,t,r,n){return Qp.apply(this,arguments)}function Qp(){return(Qp=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,v,y,g,m,b;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.parse,delete(o=jp(jp({},n),{},{draco:jp(jp({},n.draco),{},{extraAttributes:r.batchTableProperties||{}})}))["3d-tiles"],e.next=5,a(r.buffer,sp,o);case 5:if(s=e.sent,u=s.attributes.POSITION&&s.attributes.POSITION.value,c=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,l=s.attributes.NORMAL&&s.attributes.NORMAL.value,f=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,h=u&&s.attributes.POSITION.value.quantization,d=l&&s.attributes.NORMAL.value.quantization,h&&(p=s.POSITION.data.quantization,v=p.range,t.quantizedVolumeScale=new St(v,v,v),t.quantizedVolumeOffset=new St(p.minValues),t.quantizedRange=(1<<p.quantizationBits)-1,t.isQuantizedDraco=!0),d&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0),y={},r.batchTableProperties)for(g=0,m=Object.keys(r.batchTableProperties);g<m.length;g++)b=m[g],s.attributes[b]&&s.attributes[b].value&&(y[b.toLowerCase()]=s.attributes[b].value);t.attributes=jp({positions:u,colors:Sp(t,c,void 0),normals:l,batchIds:f},y);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Wp,Zp,Yp="https://unpkg.com/@loaders.gl/textures@".concat("3.2.10","/dist/libs/basis_encoder.wasm"),$p="https://unpkg.com/@loaders.gl/textures@".concat("3.2.10","/dist/libs/basis_encoder.js");function ev(e){return tv.apply(this,arguments)}function tv(){return(tv=Ie()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.modules||{}).basis){e.next=3;break}return e.abrupt("return",r.basis);case 3:return Wp=Wp||rv(t),e.next=6,Wp;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rv(e){return nv.apply(this,arguments)}function nv(){return(nv=Ie()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,n=null,e.t0=Promise,e.next=5,Hd("basis_transcoder.js","textures",t);case 5:return e.t1=e.sent,e.next=8,Hd("basis_transcoder.wasm","textures",t);case 8:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=12,e.t0.all.call(e.t0,e.t3);case 12:return i=e.sent,a=M()(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,e.next=19,iv(r,n);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function iv(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(r).then((function(e){var r=e.BasisFile;(0,e.initializeBasis)(),t({BasisFile:r})}))}))}function av(e){return ov.apply(this,arguments)}function ov(){return(ov=Ie()(Pe.a.mark((function e(t){var r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.modules||{}).basisEncoder){e.next=3;break}return e.abrupt("return",r.basisEncoder);case 3:return Zp=Zp||sv(t),e.next=6,Zp;case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sv(e){return uv.apply(this,arguments)}function uv(){return(uv=Ie()(Pe.a.mark((function e(t){var r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,n=null,e.t0=Promise,e.next=5,Hd($p,"textures",t);case 5:return e.t1=e.sent,e.next=8,Hd(Yp,"textures",t);case 8:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=12,e.t0.all.call(e.t0,e.t3);case 12:return i=e.sent,a=M()(i,2),r=a[0],n=a[1],r=r||globalThis.BASIS,e.next=19,cv(r,n);case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cv(e,t){var r={};return t&&(r.wasmBinary=t),new Promise((function(t){e(r).then((function(e){var r=e.BasisFile,n=e.KTX2File,i=e.initializeBasis,a=e.BasisEncoder;i(),t({BasisFile:r,KTX2File:n,BasisEncoder:a})}))}))}var lv={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 fv(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return hv(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hv(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function hv(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var dv=["","WEBKIT_","MOZ_"],pv={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"},vv=null;function yv(e){if(!vv){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,vv=new Set;var t,r=fv(dv);try{for(r.s();!(t=r.n()).done;){var n=t.value;for(var i in pv)if(e&&e.getExtension("".concat(n).concat(i))){var a=pv[i];vv.add(a)}}}catch(e){r.e(e)}finally{r.f()}}return vv}new Uint8Array([0]);var gv,mv,bv,Av,Bv,wv,_v,xv,Cv;(Cv=gv||(gv={}))[Cv.NONE=0]="NONE",Cv[Cv.BASISLZ=1]="BASISLZ",Cv[Cv.ZSTD=2]="ZSTD",Cv[Cv.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(mv||(mv={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(bv||(bv={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(Av||(Av={})),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"}(Bv||(Bv={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(wv||(wv={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(_v||(_v={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(xv||(xv={}));var Ov=[171,75,84,88,32,50,48,187,13,10,26,10];function Ev(e){var t=new Uint8Array(e);return!(t.byteLength<Ov.length||t[0]!==Ov[0]||t[1]!==Ov[1]||t[2]!==Ov[2]||t[3]!==Ov[3]||t[4]!==Ov[4]||t[5]!==Ov[5]||t[6]!==Ov[6]||t[7]!==Ov[7]||t[8]!==Ov[8]||t[9]!==Ov[9]||t[10]!==Ov[10]||t[11]!==Ov[11])}var Tv={etc1:{basisFormat:0,compressed:!0,format:lv.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:lv.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:lv.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:lv.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:lv.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:lv.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 Sv(){return(Sv=Ie()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("auto"!==r.basis.containerFormat){e.next=11;break}if(!Ev(t)){e.next=6;break}return e.next=4,av(r);case 4:return n=e.sent,e.abrupt("return",Iv(n.KTX2File,t,r));case 6:return e.next=8,ev(r);case 8:return i=e.sent,a=i.BasisFile,e.abrupt("return",kv(a,t,r));case 11:e.t0=r.basis.module,e.next="encoder"===e.t0?14:(e.t0,22);break;case 14:return e.next=16,av(r);case 16:o=e.sent,e.t1=r.basis.containerFormat,e.next="ktx2"===e.t1?20:(e.t1,21);break;case 20:return e.abrupt("return",Iv(o.KTX2File,t,r));case 21:return e.abrupt("return",kv(o.BasisFile,t,r));case 22:return e.next=24,ev(r);case 24:return s=e.sent,u=s.BasisFile,e.abrupt("return",kv(u,t,r));case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kv(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=[],c=0;c<s;c++)u.push(Mv(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function Mv(e,t,r,n){var i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),s=Pv(n,o),u=s.compressed,c=s.format,l=s.basisFormat,f=e.getImageTranscodedSizeInBytes(t,r,l),h=new Uint8Array(f);if(!e.transcodeImage(h,t,r,l,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:a,data:h,compressed:u,format:c,hasAlpha:o}}function Iv(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(Rv(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function Rv(e,t,r){var n=e.getImageLevelInfo(t,0,0),i=n.alphaFlag,a=n.height,o=n.width,s=Pv(r,i),u=s.compressed,c=s.format,l=s.basisFormat,f=e.getImageTranscodedSizeInBytes(t,0,0,l),h=new Uint8Array(f);if(!e.transcodeImage(h,t,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:a,data:h,compressed:u,hasAlpha:i,format:c}}function Pv(e,t){var r=e&&e.basis&&e.basis.format;return"auto"===r&&(r=Fv()),"object"===bi()(r)&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),Tv[r]}function Fv(){var e=yv();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 Dv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Lv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dv(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dv(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var jv={name:"Basis",id:"basis",module:"textures",version:"3.2.10",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"}}},Gv=Lv(Lv({},jv),{},{parse:function(e,t){return Sv.apply(this,arguments)}}),Uv=globalThis._parseImageNode,Nv="undefined"!=typeof Image,Hv="undefined"!=typeof ImageBitmap,Jv=Boolean(Uv),Vv=!!rc||Jv;function zv(e){var t=qv(e);if(!t)throw new Error("Not an image");return t}function Kv(e){switch(zv(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 qv(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"===bi()(e)&&e.data&&e.width&&e.height?"data":null}var Xv=/^data:image\/svg\+xml/,Qv=/\.svg((\?|#).*)?$/;function Wv(e){return e&&(Xv.test(e)||Qv.test(e))}function Zv(e,t){if(Wv(t)){var r=(new TextDecoder).decode(e);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(r=unescape(encodeURIComponent(r)))}catch(e){throw new Error(e.message)}return"data:image/svg+xml;base64,".concat(btoa(r))}return Yv(e,t)}function Yv(e,t){if(Wv(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}function $v(e,t,r){return ey.apply(this,arguments)}function ey(){return(ey=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Zv(t,n),a=self.URL||self.webkitURL,o="string"!=typeof i&&a.createObjectURL(i),e.prev=3,e.next=6,ty(o||i,r);case 6:return e.abrupt("return",e.sent);case 7:return e.prev=7,o&&a.revokeObjectURL(o),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[3,,7,10]])})))).apply(this,arguments)}function ty(e,t){return ry.apply(this,arguments)}function ry(){return(ry=Ie()(Pe.a.mark((function e(t,r){var n;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=new Image).src=t,!(r.image&&r.image.decode&&n.decode)){e.next=6;break}return e.next=5,n.decode();case 5:return e.abrupt("return",n);case 6:return e.next=8,new Promise((function(e,r){try{n.onload=function(){return e(n)},n.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))}}catch(e){r(e)}}));case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ny={},iy=!0;function ay(e,t,r){return oy.apply(this,arguments)}function oy(){return(oy=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Wv(n)){e.next=7;break}return e.next=3,$v(t,r,n);case 3:a=e.sent,i=a,e.next=8;break;case 7:i=Yv(t,n);case 8:return o=r&&r.imagebitmap,e.next=11,sy(i,o);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sy(e){return uy.apply(this,arguments)}function uy(){return(uy=Ie()(Pe.a.mark((function e(t){var r,n=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!cy(r=n.length>1&&void 0!==n[1]?n[1]:null)&&iy||(r=null),!r){e.next=13;break}return e.prev=3,e.next=6,createImageBitmap(t,r);case 6:return e.abrupt("return",e.sent);case 9:e.prev=9,e.t0=e.catch(3),console.warn(e.t0),iy=!1;case 13:return e.next=15,createImageBitmap(t);case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e,null,[[3,9]])})))).apply(this,arguments)}function cy(e){for(var t in e||ny)return!1;return!0}function ly(e){var t=fy(e);return function(e){var t=fy(e);if(!(t.byteLength>=24&&2303741511===t.getUint32(0,!1)))return null;return{mimeType:"image/png",width:t.getUint32(16,!1),height:t.getUint32(20,!1)}}(t)||function(e){var t=fy(e);if(!(t.byteLength>=3&&65496===t.getUint16(0,!1)&&255===t.getUint8(2)))return null;var r=function(){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}}(),n=r.tableMarkers,i=r.sofMarkers,a=2;for(;a+9<t.byteLength;){var o=t.getUint16(a,!1);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,!1),width:t.getUint16(a+7,!1)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,!1)}return null}(t)||function(e){var t=fy(e);if(!(t.byteLength>=10&&1195984440===t.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:t.getUint16(6,!0),height:t.getUint16(8,!0)}}(t)||function(e){var t=fy(e);if(!(t.byteLength>=14&&16973===t.getUint16(0,!1)&&t.getUint32(2,!0)===t.byteLength))return null;return{mimeType:"image/bmp",width:t.getUint32(18,!0),height:t.getUint32(22,!0)}}(t)}function fy(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 hy(e,t){return dy.apply(this,arguments)}function dy(){return(dy=Ie()(Pe.a.mark((function e(t,r){var n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ly(t)||{},i=n.mimeType,tu(a=globalThis._parseImageNode),e.next=5,a(t,i);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function py(){return(py=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=(r=r||{}).image||{},a=i.type||"auto",o=(n||{}).url,s=vy(a),e.t0=s,e.next="imagebitmap"===e.t0?8:"image"===e.t0?12:"data"===e.t0?16:20;break;case 8:return e.next=10,ay(t,r,o);case 10:return u=e.sent,e.abrupt("break",21);case 12:return e.next=14,$v(t,r,o);case 14:return u=e.sent,e.abrupt("break",21);case 16:return e.next=18,hy(t,r);case 18:return u=e.sent,e.abrupt("break",21);case 20:tu(!1);case 21:return"data"===a&&(u=Kv(u)),e.abrupt("return",u);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vy(e){switch(e){case"auto":case"data":return function(){if(Hv)return"imagebitmap";if(Nv)return"image";if(Vv)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return Hv||Nv||Vv;case"imagebitmap":return Hv;case"image":return Nv;case"data":return Vv;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}var yy={id:"image",module:"images",name:"Images",version:"3.2.10",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(e,t,r){return py.apply(this,arguments)},tests:[function(e){return Boolean(ly(new DataView(e)))}],options:{image:{type:"auto",decode:!0}}};function gy(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 my(e){try{return JSON.parse(e)}catch(t){throw new Error('Failed to parse JSON from data starting with "'.concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return gy(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){var r=0;return gy(e,r,t)}return""}(e),'"'))}}function by(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function Ay(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;var r=t.baseUri||t.uri;if(!r)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return r.substr(0,r.lastIndexOf("/")+1)+e}function By(e,t,r){var n=e.bufferViews[r];by(n);var i=t[n.buffer];by(i);var a=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,a,n.byteLength)}function wy(e,t){return tu(e>=0),tu(t>0),e+(t-1)&~(t-1)}function _y(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+wy(n.byteLength,4)}var xy=["SCALAR","VEC2","VEC3","VEC4"],Cy=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Oy=new Map(Cy),Ey={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ty={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Sy={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function ky(e){return xy[e-1]||xy[0]}function My(e){var t=Oy.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Iy(e,t){var r=Sy[e.componentType],n=Ey[e.type],i=Ty[e.componentType],a=e.count*n,o=e.count*n*i;return by(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}function Ry(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Py(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Py(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Py(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Dy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fy(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fy(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ly,jy={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},Gy=function(){function e(t){h()(this,e),Jn(this,"gltf",void 0),Jn(this,"sourceBuffers",void 0),Jn(this,"byteLength",void 0),this.gltf=t||{json:Dy({},jy),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]])}return C()(e,[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(e){return this.json[e]}},{key:"getExtraData",value:function(e){return(this.json.extras||{})[e]}},{key:"getExtension",value:function(e){var t=this.getUsedExtensions().find((function(t){return t===e})),r=this.json.extensions||{};return t?r[e]||!0:null}},{key:"getRequiredExtension",value:function(e){return this.getRequiredExtensions().find((function(t){return t===e}))?this.getExtension(e):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getObjectExtension",value:function(e,t){return(e.extensions||{})[t]}},{key:"getScene",value:function(e){return this.getObject("scenes",e)}},{key:"getNode",value:function(e){return this.getObject("nodes",e)}},{key:"getSkin",value:function(e){return this.getObject("skins",e)}},{key:"getMesh",value:function(e){return this.getObject("meshes",e)}},{key:"getMaterial",value:function(e){return this.getObject("materials",e)}},{key:"getAccessor",value:function(e){return this.getObject("accessors",e)}},{key:"getTexture",value:function(e){return this.getObject("textures",e)}},{key:"getSampler",value:function(e){return this.getObject("samplers",e)}},{key:"getImage",value:function(e){return this.getObject("images",e)}},{key:"getBufferView",value:function(e){return this.getObject("bufferViews",e)}},{key:"getBuffer",value:function(e){return this.getObject("buffers",e)}},{key:"getObject",value:function(e,t){if("object"===bi()(t))return t;var r=this.json[e]&&this.json[e][t];if(!r)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return r}},{key:"getTypedArrayForBufferView",value:function(e){var t=(e=this.getBufferView(e)).buffer,r=this.gltf.buffers[t];by(r);var n=(e.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,e.byteLength)}},{key:"getTypedArrayForAccessor",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=Iy(e,t),i=n.ArrayType,a=n.length;return new i(r,t.byteOffset+e.byteOffset,a)}},{key:"getTypedArrayForImageData",value:function(e){e=this.getAccessor(e);var t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=t.byteOffset||0;return new Uint8Array(r,n,t.byteLength)}},{key:"addApplicationData",value:function(e,t){return this.json[e]=t,this}},{key:"addExtraData",value:function(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}},{key:"addObjectExtension",value:function(e,t,r){return e.extensions=e.extensions||{},e.extensions[t]=r,this.registerUsedExtension(t),this}},{key:"setObjectExtension",value:function(e,t,r){(e.extensions||{})[t]=r}},{key:"removeObjectExtension",value:function(e,t){var r=e.extensions||{},n=r[t];return delete r[t],n}},{key:"addExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return by(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}},{key:"addRequiredExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return by(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}},{key:"registerUsedExtension",value:function(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((function(t){return t===e}))||this.json.extensionsUsed.push(e)}},{key:"registerRequiredExtension",value:function(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((function(t){return t===e}))||this.json.extensionsRequired.push(e)}},{key:"removeExtension",value:function(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}},{key:"setDefaultScene",value:function(e){this.json.scene=e}},{key:"addScene",value:function(e){var t=e.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}},{key:"addNode",value:function(e){var t=e.meshIndex,r=e.matrix;this.json.nodes=this.json.nodes||[];var n={mesh:t};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}},{key:"addMesh",value:function(e){var t=e.attributes,r=e.indices,n=e.material,i=e.mode,a=void 0===i?4:i,o={primitives:[{attributes:this._addAttributes(t),mode:a}]};if(r){var s=this._addIndices(r);o.primitives[0].indices=s}return Number.isFinite(n)&&(o.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}},{key:"addPointCloud",value:function(e){var t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}},{key:"addImage",value:function(e,t){var r=ly(e),n=t||(null==r?void 0:r.mimeType),i={bufferView:this.addBufferView(e),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}},{key:"addBufferView",value:function(e){var t=e.byteLength;by(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var r={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=wy(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(e,t){var r={bufferView:e,type:ky(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},r=this.addBufferView(e),n={min:t.min,max:t.max};n.min&&n.max||(n=this._getAccessorMinMax(e,t.size));var i={size:t.size,componentType:My(e),count:Math.round(e.length/t.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(i,t))}},{key:"addTexture",value:function(e){var t={source:e.imageIndex};return this.json.textures=this.json.textures||[],this.json.textures.push(t),this.json.textures.length-1}},{key:"addMaterial",value:function(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var e,t;this.gltf.buffers=[];var r,n=this.byteLength,i=new ArrayBuffer(n),a=new Uint8Array(i),o=0,s=Ry(this.sourceBuffers||[]);try{for(s.s();!(r=s.n()).done;){o=_y(r.value,a,o)}}catch(e){s.e(e)}finally{s.f()}null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=i,this.sourceBuffers=[i]}},{key:"_removeStringFromArray",value:function(e,t){for(var r=!0;r;){var n=e.indexOf(t);n>-1?e.splice(n,1):r=!1}}},{key:"_addAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};for(var r in e){var n=e[r],i=this._getGltfAttributeName(r),a=this.addBinaryBuffer(n.value,n);t[i]=a}return t}},{key:"_addIndices",value:function(e){return this.addBinaryBuffer(e,{size:1})}},{key:"_getGltfAttributeName",value:function(e){switch(e.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 e}}},{key:"_getAccessorMinMax",value:function(e,t){var r={min:null,max:null};if(e.length<t)return r;r.min=[],r.max=[];var n,i=Ry(e.subarray(0,t));try{for(i.s();!(n=i.n()).done;){var a=n.value;r.min.push(a),r.max.push(a)}}catch(e){i.e(e)}finally{i.f()}for(var o=t;o<e.length;o+=t)for(var s=0;s<t;s++)r.min[0+s]=Math.min(r.min[0+s],e[o+s]),r.max[0+s]=Math.max(r.max[0+s],e[o+s]);return r}}]),e}(),Uy=("undefined"==typeof WebAssembly||bi()(WebAssembly),"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"),Ny="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",Hy=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]),Jy=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]),Vy={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},zy={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function Ky(e,t,r,n,i){return qy.apply(this,arguments)}function qy(){return(qy=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>5&&void 0!==u[5]?u[5]:"NONE",e.next=3,Xy();case 3:$y(s=e.sent,s.exports[zy[a]],t,r,n,i,s.exports[Vy[o||"NONE"]]);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xy(){return Qy.apply(this,arguments)}function Qy(){return(Qy=Ie()(Pe.a.mark((function e(){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ly||(Ly=Wy()),e.abrupt("return",Ly);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wy(){return Zy.apply(this,arguments)}function Zy(){return(Zy=Ie()(Pe.a.mark((function e(){var t,r;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Uy,WebAssembly.validate(Hy)&&(t=Ny,console.log("Warning: meshopt_decoder is using experimental SIMD support")),e.next=4,WebAssembly.instantiate(Yy(t),{});case 4:return r=e.sent,e.next=7,r.instance.exports.__wasm_call_ctors();case 7:return e.abrupt("return",r.instance);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yy(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?Jy[t[a]]:64*(t[a]-60)+t[++a];return t.buffer.slice(0,i)}function $y(e,t,r,n,i,a,o){var s=e.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,l);var h=t(c,n,i,l,a.length);if(0===h&&o&&o(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),0!==h)throw new Error("Malformed buffer data: ".concat(h))}function eg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return tg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tg(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function tg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var rg="EXT_meshopt_compression";function ng(e,t){return ig.apply(this,arguments)}function ig(){return(ig=Ie()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=new Gy(t),null!=r&&null!==(n=r.gltf)&&void 0!==n&&n.decompressMeshes){e.next=3;break}return e.abrupt("return");case 3:a=[],o=eg(t.json.bufferViews||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,a.push(ag(i,u))}catch(e){o.e(e)}finally{o.f()}return e.next=8,Promise.all(a);case 8:i.removeExtension("EXT_meshopt_compression");case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ag(e,t){return og.apply(this,arguments)}function og(){return(og=Ie()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d,p,v,y;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.getObjectExtension(r,"EXT_meshopt_compression"))){e.next=9;break}return i=n.byteOffset,a=void 0===i?0:i,o=n.byteLength,s=void 0===o?0:o,u=n.byteStride,c=n.count,l=n.mode,f=n.filter,h=void 0===f?"NONE":f,d=n.buffer,p=t.gltf.buffers[d],v=new Uint8Array(p.arrayBuffer,p.byteOffset+a,s),y=new Uint8Array(t.gltf.buffers[r.buffer].arrayBuffer,r.byteOffset,r.byteLength),e.next=8,Ky(y,c,u,v,l,h);case 8:return e.abrupt("return",y);case 9:return e.abrupt("return",null);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var sg=["image/png","image/jpeg","image/gif"],ug={};function cg(e){return void 0===ug[e]&&(ug[e]=function(e){switch(e){case"image/webp":return function(){if(!rc)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch(e){return!1}}();case"image/svg":return rc;default:if(!rc){var t=globalThis._parseImageNode;return Boolean(t)&&sg.includes(e)}return!0}}(e)),ug[e]}function lg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return fg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fg(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function fg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var hg="EXT_texture_webp";function dg(e,t){var r=new Gy(e);if(cg("image/webp")){var n,i=lg(r.json.textures||[]);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=r.getObjectExtension(a,"EXT_texture_webp");o&&(a.source=o.source),r.removeObjectExtension(a,"EXT_texture_webp")}}catch(e){i.e(e)}finally{i.f()}r.removeExtension("EXT_texture_webp")}else if(r.getRequiredExtensions().includes("EXT_texture_webp"))throw new Error("gltf: Required extension ".concat("EXT_texture_webp"," not supported by browser"))}function pg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return vg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vg(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function vg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var yg="KHR_texture_basisu";function gg(e,t){var r,n=new Gy(e),i=pg(n.json.textures||[]);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=n.getObjectExtension(a,"KHR_texture_basisu");o&&(a.source=o.source),n.removeObjectExtension(a,"KHR_texture_basisu")}}catch(e){i.e(e)}finally{i.f()}n.removeExtension("KHR_texture_basisu")}function mg(e){var t={};for(var r in e){var n=e[r];if("indices"!==r){var i=bg(n);t[r]=i}}return t}function bg(e){var t=function(e){var t=e,r=1,n=0;e&&e.value&&(t=e.value,r=e.size||1);t&&(ArrayBuffer.isView(t)||(t=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return null;if(Array.isArray(e))return new t(e);if(r&&!(e instanceof t))return new t(e);return e}(t,Float32Array)),n=t.length/r);return{buffer:t,size:r,count:n}}(e),r=t.buffer,n=t.size;return{value:r,size:n,byteOffset:0,count:t.count,type:ky(n),componentType:My(r)}}function Ag(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ag(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ag(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var wg=Pe.a.mark(Pg);function _g(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return xg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xg(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function xg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Cg="KHR_draco_mesh_compression";function Og(e,t,r){var n,i=new Gy(e),a=_g(Pg(i));try{for(a.s();!(n=a.n()).done;){var o=n.value;i.getObjectExtension(o,"KHR_draco_mesh_compression")}}catch(e){a.e(e)}finally{a.f()}}function Eg(e,t,r){return Tg.apply(this,arguments)}function Tg(){return(Tg=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r&&null!==(i=r.gltf)&&void 0!==i&&i.decompressMeshes){e.next=2;break}return e.abrupt("return");case 2:a=new Gy(t),o=[],s=_g(Pg(a));try{for(s.s();!(u=s.n()).done;)c=u.value,a.getObjectExtension(c,"KHR_draco_mesh_compression")&&o.push(kg(a,c,r,n))}catch(e){s.e(e)}finally{s.f()}return e.next=8,Promise.all(o);case 8:a.removeExtension("KHR_draco_mesh_compression");case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Sg(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Gy(e),i=_g(n.json.meshes||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value;Ig(a,r),n.addRequiredExtension("KHR_draco_mesh_compression")}}catch(e){i.e(e)}finally{i.f()}}function kg(e,t,r,n){return Mg.apply(this,arguments)}function Mg(){return(Mg=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s,u,c,l,f,h,d,p,v,y,g,m;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.getObjectExtension(r,"KHR_draco_mesh_compression")){e.next=3;break}return e.abrupt("return");case 3:return o=t.getTypedArrayForBufferView(a.bufferView),s=rl(o.buffer,o.byteOffset),u=i.parse,delete(c=Bg({},n))["3d-tiles"],e.next=10,u(s,sp,c,i);case 10:for(l=e.sent,f=mg(l.attributes),h=0,d=Object.entries(f);h<d.length;h++)p=M()(d[h],2),v=p[0],y=p[1],v in r.attributes&&(g=r.attributes[v],null!=(m=t.getAccessor(g))&&m.min&&null!=m&&m.max&&(y.min=m.min,y.max=m.max));r.attributes=f,l.indices&&(r.indices=bg(l.indices)),Rg(r);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ig(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?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=null==a||null===(r=a.parseSync)||void 0===r?void 0:r.call(a,{attributes:e}),u=i._addFauxAttributes(s.attributes),c=i.addBufferView(o),l={primitives:[{attributes:u,mode:n,extensions:A()({},"KHR_draco_mesh_compression",{bufferView:c,attributes:u})}]};return l}function Rg(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function Pg(e){var t,r,n,i,a,o;return Pe.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:t=_g(e.json.meshes||[]),s.prev=1,t.s();case 3:if((r=t.n()).done){s.next=24;break}n=r.value,i=_g(n.primitives),s.prev=6,i.s();case 8:if((a=i.n()).done){s.next=14;break}return o=a.value,s.next=12,o;case 12:s.next=8;break;case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(6),i.e(s.t0);case 19:return s.prev=19,i.f(),s.finish(19);case 22:s.next=3;break;case 24:s.next=29;break;case 26:s.prev=26,s.t1=s.catch(1),t.e(s.t1);case 29:return s.prev=29,t.f(),s.finish(29);case 32:case"end":return s.stop()}}),wg,null,[[1,26,29,32],[6,16,19,22]])}function Fg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Dg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dg(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Dg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Lg="KHR_lights_punctual";function jg(e){return Gg.apply(this,arguments)}function Gg(){return(Gg=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new Gy(t),n=r.json,(i=r.getExtension("KHR_lights_punctual"))&&(r.json.lights=i.lights,r.removeExtension("KHR_lights_punctual")),a=Fg(n.nodes||[]);try{for(a.s();!(o=a.n()).done;)s=o.value,(u=r.getObjectExtension(s,"KHR_lights_punctual"))&&(s.light=u.light),r.removeObjectExtension(s,"KHR_lights_punctual")}catch(e){a.e(e)}finally{a.f()}case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ug(e){return Ng.apply(this,arguments)}function Ng(){return(Ng=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new Gy(t),(n=r.json).lights&&(by(!(i=r.addExtension("KHR_lights_punctual")).lights),i.lights=n.lights,delete n.lights),r.json.lights){a=Fg(r.json.lights);try{for(a.s();!(o=a.n()).done;)s=o.value,u=s.node,r.addObjectExtension(u,"KHR_lights_punctual",s)}catch(e){a.e(e)}finally{a.f()}delete r.json.lights}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Hg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Jg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jg(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Jg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Vg="KHR_materials_unlit";function zg(e){return Kg.apply(this,arguments)}function Kg(){return(Kg=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new Gy(t),n=r.json,r.removeExtension("KHR_materials_unlit"),i=Hg(n.materials||[]);try{for(i.s();!(a=i.n()).done;)o=a.value,o.extensions&&o.extensions.KHR_materials_unlit&&(o.unlit=!0),r.removeObjectExtension(o,"KHR_materials_unlit")}catch(e){i.e(e)}finally{i.f()}case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qg(e){var t=new Gy(e),r=t.json;if(t.materials){var n,i=Hg(r.materials||[]);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.unlit&&(delete a.unlit,t.addObjectExtension(a,"KHR_materials_unlit",{}),t.addExtension("KHR_materials_unlit"))}}catch(e){i.e(e)}finally{i.f()}}}function Xg(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Qg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qg(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Qg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Wg="KHR_techniques_webgl";function Zg(e){return Yg.apply(this,arguments)}function Yg(){return(Yg=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new Gy(t),n=r.json,i=r.getExtension("KHR_techniques_webgl")){a=tm(i,r),o=Xg(n.materials||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,(c=r.getObjectExtension(u,"KHR_techniques_webgl"))&&(u.technique=Object.assign({},c,a[c.technique]),u.technique.values=rm(u.technique,r)),r.removeObjectExtension(u,"KHR_techniques_webgl")}catch(e){o.e(e)}finally{o.f()}r.removeExtension("KHR_techniques_webgl")}case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $g(e,t){return em.apply(this,arguments)}function em(){return(em=Ie()(Pe.a.mark((function e(t,r){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tm(e,t){var r=e.programs,n=void 0===r?[]:r,i=e.shaders,a=void 0===i?[]:i,o=e.techniques,s=void 0===o?[]:o,u=new TextDecoder;return a.forEach((function(e){if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=u.decode(t.getTypedArrayForBufferView(e.bufferView))})),n.forEach((function(e){e.fragmentShader=a[e.fragmentShader],e.vertexShader=a[e.vertexShader]})),s.forEach((function(e){e.program=n[e.program]})),s}function rm(e,t){var r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach((function(t){e.uniforms[t].value&&!(t in r)&&(r[t]=e.uniforms[t].value)})),Object.keys(r).forEach((function(e){"object"===bi()(r[e])&&void 0!==r[e].index&&(r[e].texture=t.getTexture(r[e].index))})),r}function nm(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return im(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return im(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function im(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var am=[i,a,o,s,u,c,l];function om(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=am.filter((function(e){return cm(e.name,r)})),a=nm(i);try{for(a.s();!(t=a.n()).done;){var o,s=t.value;null===(o=s.preprocess)||void 0===o||o.call(s,e,r,n)}}catch(e){a.e(e)}finally{a.f()}}function sm(e){return um.apply(this,arguments)}function um(){return(um=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=c.length>1&&void 0!==c[1]?c[1]:{},n=c.length>2?c[2]:void 0,i=am.filter((function(e){return cm(e.name,r)})),a=nm(i),e.prev=4,a.s();case 6:if((o=a.n()).done){e.next=12;break}return s=o.value,e.next=10,null===(u=s.decode)||void 0===u?void 0:u.call(s,t,r,n);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),a.e(e.t0);case 17:return e.prev=17,a.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[4,14,17,20]])})))).apply(this,arguments)}function cm(e,t){var r,n=(null==t||null===(r=t.gltf)||void 0===r?void 0:r.excludeExtensions)||{};return!(e in n&&!n[e])}function lm(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return fm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fm(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function fm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hm(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return dm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dm(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function dm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var pm,vm={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},ym={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},gm=function(){function e(){h()(this,e),Jn(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Jn(this,"json",void 0)}return C()(e,[{key:"normalize",value:function(e,t){this.json=e.json;var r=e.json;switch(r.asset&&r.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(r.asset.version))}if(!t.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(r),this._convertTopLevelObjectsToArrays(r),function(e){var t,r=new Gy(e),n=r.json,i=lm(n.images||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=r.getObjectExtension(a,"KHR_binary_glTF");o&&Object.assign(a,o),r.removeObjectExtension(a,"KHR_binary_glTF")}}catch(e){i.e(e)}finally{i.f()}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,r.removeExtension("KHR_binary_glTF")}(e),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}},{key:"_addAsset",value:function(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(e){for(var t in vm)this._convertTopLevelObjectToArray(e,t)}},{key:"_convertTopLevelObjectToArray",value:function(e,t){var r=e[t];if(r&&!Array.isArray(r))for(var n in e[t]=[],r){var i=r[n];i.id=i.id||n;var a=e[t].length;e[t].push(i),this.idToIndexMap[t][n]=a}}},{key:"_convertObjectIdsToArrayIndices",value:function(e){for(var t in vm)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));var r,n=hm(e.textures);try{for(n.s();!(r=n.n()).done;){var i=r.value;this._convertTextureIds(i)}}catch(e){n.e(e)}finally{n.f()}var a,o=hm(e.meshes);try{for(o.s();!(a=o.n()).done;){var s=a.value;this._convertMeshIds(s)}}catch(e){o.e(e)}finally{o.f()}var u,c=hm(e.nodes);try{for(c.s();!(u=c.n()).done;){var l=u.value;this._convertNodeIds(l)}}catch(e){c.e(e)}finally{c.f()}var f,h=hm(e.scenes);try{for(h.s();!(f=h.n()).done;){var d=f.value;this._convertSceneIds(d)}}catch(e){h.e(e)}finally{h.f()}}},{key:"_convertTextureIds",value:function(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}},{key:"_convertMeshIds",value:function(e){var t,r=hm(e.primitives);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=n.attributes,a=n.indices,o=n.material;for(var s in i)i[s]=this._convertIdToIndex(i[s],"accessor");a&&(n.indices=this._convertIdToIndex(a,"accessor")),o&&(n.material=this._convertIdToIndex(o,"material"))}}catch(e){r.e(e)}finally{r.f()}}},{key:"_convertNodeIds",value:function(e){var t=this;e.children&&(e.children=e.children.map((function(e){return t._convertIdToIndex(e,"node")}))),e.meshes&&(e.meshes=e.meshes.map((function(e){return t._convertIdToIndex(e,"mesh")})))}},{key:"_convertSceneIds",value:function(e){var t=this;e.nodes&&(e.nodes=e.nodes.map((function(e){return t._convertIdToIndex(e,"node")})))}},{key:"_convertIdsToIndices",value:function(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);var r,n=hm(e[t]);try{for(n.s();!(r=n.n()).done;){var i=r.value;for(var a in i){var o=i[a],s=this._convertIdToIndex(o,a);i[a]=s}}}catch(e){n.e(e)}finally{n.f()}}},{key:"_convertIdToIndex",value:function(e,t){var r=ym[t];if(r in this.idToIndexMap){var n=this.idToIndexMap[r][e];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return n}return e}},{key:"_updateObjects",value:function(e){var t,r=hm(this.json.buffers);try{for(r.s();!(t=r.n()).done;){delete t.value.type}}catch(e){r.e(e)}finally{r.f()}}},{key:"_updateMaterial",value:function(e){var t,r=hm(e.materials);try{var n=function(){var r=t.value;r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var n=(null===(i=r.values)||void 0===i?void 0:i.tex)||(null===(a=r.values)||void 0===a?void 0:a.texture2d_0)||(null===(o=r.values)||void 0===o?void 0:o.diffuseTex),s=e.textures.findIndex((function(e){return e.id===n}));-1!==s&&(r.pbrMetallicRoughness.baseColorTexture={index:s})};for(r.s();!(t=r.n()).done;){var i,a,o;n()}}catch(e){r.e(e)}finally{r.f()}}}]),e}();function mm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new gm).normalize(e,t)}function bm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Am(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bm(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Bm={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},wm={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},_m=10240,xm=10241,Cm=10242,Om=10243,Em=10497,Tm=9729,Sm=9986,km={magFilter:_m,minFilter:xm,wrapS:Cm,wrapT:Om},Mm=(pm={},A()(pm,_m,Tm),A()(pm,xm,Sm),A()(pm,Cm,Em),A()(pm,Om,Em),pm);var Im=function(){function e(){h()(this,e),Jn(this,"baseUri",""),Jn(this,"json",{}),Jn(this,"buffers",[]),Jn(this,"images",[])}return C()(e,[{key:"postProcess",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.json,n=e.buffers,i=void 0===n?[]:n,a=e.images,o=void 0===a?[]:a,s=e.baseUri,u=void 0===s?"":s;return by(r),this.baseUri=u,this.json=r,this.buffers=i,this.images=o,this._resolveTree(this.json,t),this.json}},{key:"_resolveTree",value:function(e){var t=this;e.bufferViews&&(e.bufferViews=e.bufferViews.map((function(e,r){return t._resolveBufferView(e,r)}))),e.images&&(e.images=e.images.map((function(e,r){return t._resolveImage(e,r)}))),e.samplers&&(e.samplers=e.samplers.map((function(e,r){return t._resolveSampler(e,r)}))),e.textures&&(e.textures=e.textures.map((function(e,r){return t._resolveTexture(e,r)}))),e.accessors&&(e.accessors=e.accessors.map((function(e,r){return t._resolveAccessor(e,r)}))),e.materials&&(e.materials=e.materials.map((function(e,r){return t._resolveMaterial(e,r)}))),e.meshes&&(e.meshes=e.meshes.map((function(e,r){return t._resolveMesh(e,r)}))),e.nodes&&(e.nodes=e.nodes.map((function(e,r){return t._resolveNode(e,r)}))),e.skins&&(e.skins=e.skins.map((function(e,r){return t._resolveSkin(e,r)}))),e.scenes&&(e.scenes=e.scenes.map((function(e,r){return t._resolveScene(e,r)}))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}},{key:"getScene",value:function(e){return this._get("scenes",e)}},{key:"getNode",value:function(e){return this._get("nodes",e)}},{key:"getSkin",value:function(e){return this._get("skins",e)}},{key:"getMesh",value:function(e){return this._get("meshes",e)}},{key:"getMaterial",value:function(e){return this._get("materials",e)}},{key:"getAccessor",value:function(e){return this._get("accessors",e)}},{key:"getCamera",value:function(e){return null}},{key:"getTexture",value:function(e){return this._get("textures",e)}},{key:"getSampler",value:function(e){return this._get("samplers",e)}},{key:"getImage",value:function(e){return this._get("images",e)}},{key:"getBufferView",value:function(e){return this._get("bufferViews",e)}},{key:"getBuffer",value:function(e){return this._get("buffers",e)}},{key:"_get",value:function(e,t){if("object"===bi()(t))return t;var r=this.json[e]&&this.json[e][t];return r||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),r}},{key:"_resolveScene",value:function(e,t){var r=this;return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map((function(e){return r.getNode(e)})),e}},{key:"_resolveNode",value:function(e,t){var r=this;return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map((function(e){return r.getNode(e)}))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((function(e,t){var n=r.getMesh(t);return e.id=n.id,e.primitives=e.primitives.concat(n.primitives),e}),{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}},{key:"_resolveSkin",value:function(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}},{key:"_resolveMesh",value:function(e,t){var r=this;return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map((function(e){var t=(e=Am({},e)).attributes;for(var n in e.attributes={},t)e.attributes[n]=r.getAccessor(t[n]);return void 0!==e.indices&&(e.indices=r.getAccessor(e.indices)),void 0!==e.material&&(e.material=r.getMaterial(e.material)),e}))),e}},{key:"_resolveMaterial",value:function(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture=Am({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=Am({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=Am({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=Am({},e.pbrMetallicRoughness);var r=e.pbrMetallicRoughness;r.baseColorTexture&&(r.baseColorTexture=Am({},r.baseColorTexture),r.baseColorTexture.texture=this.getTexture(r.baseColorTexture.index)),r.metallicRoughnessTexture&&(r.metallicRoughnessTexture=Am({},r.metallicRoughnessTexture),r.metallicRoughnessTexture.texture=this.getTexture(r.metallicRoughnessTexture.index))}return e}},{key:"_resolveAccessor",value:function(e,t){var r,n;if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(r=e.componentType,wm[r]),e.components=(n=e.type,Bm[n]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var i=e.bufferView.buffer,a=Iy(e,e.bufferView),o=a.ArrayType,s=a.byteLength,u=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,c=i.arrayBuffer.slice(u,u+s);e.bufferView.byteStride&&(c=this._getValueFromInterleavedBuffer(i,u,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new o(c)}return e}},{key:"_getValueFromInterleavedBuffer",value:function(e,t,r,n,i){for(var a=new Uint8Array(i*n),o=0;o<i;o++){var s=t+o*r;a.set(new Uint8Array(e.arrayBuffer.slice(s,s+n)),o*n)}return a.buffer}},{key:"_resolveTexture",value:function(e,t){return e.id=e.id||"texture-".concat(t),e.sampler="sampler"in e?this.getSampler(e.sampler):Mm,e.source=this.getImage(e.source),e}},{key:"_resolveSampler",value:function(e,t){for(var r in e.id=e.id||"sampler-".concat(t),e.parameters={},e){var n=this._enumSamplerParameter(r);void 0!==n&&(e.parameters[n]=e[r])}return e}},{key:"_enumSamplerParameter",value:function(e){return km[e]}},{key:"_resolveImage",value:function(e,t){e.id=e.id||"image-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));var r=this.images[t];return r&&(e.image=r),e}},{key:"_resolveBufferView",value:function(e,t){var r=e.buffer,n=Am(Am({id:"bufferView-".concat(t)},e),{},{buffer:this.buffers[r]}),i=this.buffers[r].arrayBuffer,a=this.buffers[r].byteOffset||0;return"byteOffset"in e&&(a+=e.byteOffset),n.data=new Uint8Array(i,a,e.byteLength),n}},{key:"_resolveCamera",value:function(e,t){return e.id=e.id||"camera-".concat(t),e.perspective,e.orthographic,e}}]),e}();function Rm(e,t){return(new Im).postProcess(e,t)}function Pm(e){var t=arguments.length>1&&void 0!==arguments[1]?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 Fm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new DataView(e),i=r.magic,a=void 0===i?1735152710:i,o=n.getUint32(t,!1);return o===a||1735152710===o}function Dm(e,t,r){tu(e.header.byteLength>20);var n=t.getUint32(r+0,!0),i=t.getUint32(r+4,!0);return r+=8,tu(0===i),jm(e,t,r,n),r+=n,r+=Gm(e,t,r,e.header.byteLength)}function Lm(e,t,r,n){return tu(e.header.byteLength>20),function(e,t,r,n){for(;r+8<=e.header.byteLength;){var i=t.getUint32(r+0,!0),a=t.getUint32(r+4,!0);switch(r+=8,a){case 1313821514:jm(e,t,r,i);break;case 5130562:Gm(e,t,r,i);break;case 0:n.strict||jm(e,t,r,i);break;case 1:n.strict||Gm(e,t,r,i)}r+=wy(i,4)}}(e,t,r,n),r+e.header.byteLength}function jm(e,t,r,n){var i=new Uint8Array(t.buffer,r,n),a=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(a),wy(n,4)}function Gm(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),wy(n,4)}function Um(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Nm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Nm(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Nm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Hm(e,t){return Jm.apply(this,arguments)}function Jm(){return(Jm=Ie()(Pe.a.mark((function e(t,r){var n,i,a,o,s,u,c,l,f,h,d=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=d.length>2&&void 0!==d[2]?d[2]:0,i=d.length>3?d[3]:void 0,a=d.length>4?d[4]:void 0,Vm(t,r,n,i),mm(t,{normalize:null==i||null===(o=i.gltf)||void 0===o?void 0:o.normalize}),om(t,i,a),l=[],null==i||null===(s=i.gltf)||void 0===s||!s.loadBuffers||!t.json.buffers){e.next=10;break}return e.next=10,zm(t,i,a);case 10:return null!=i&&null!==(u=i.gltf)&&void 0!==u&&u.loadImages&&(f=qm(t,i,a),l.push(f)),h=sm(t,i,a),l.push(h),e.next=15,Promise.all(l);case 15:return e.abrupt("return",null!=i&&null!==(c=i.gltf)&&void 0!==c&&c.postProcess?Rm(t,i):t);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vm(e,t,r,n){(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!Fm(t,r,n))&&(t=(new TextDecoder).decode(t));if("string"==typeof t)e.json=my(t);else if(t instanceof ArrayBuffer){var i={};r=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new DataView(t),i=Pm(n,r+0),a=n.getUint32(r+4,!0),o=n.getUint32(r+8,!0);switch(Object.assign(e,{header:{byteOffset:r,byteLength:o,hasBinChunk:!1},type:i,version:a,json:{},binChunks:[]}),r+=12,e.version){case 1:return Dm(e,n,r);case 2:return Lm(e,n,r,{});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}(i,t,r,n.glb),by("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),e._glb=i,e.json=i.json}else by(!1,"GLTF: must be ArrayBuffer or string");var a=e.json.buffers||[];if(e.buffers=new Array(a.length).fill(null),e._glb&&e._glb.header.hasBinChunk){var o=e._glb.binChunks;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}var s=e.json.images||[];e.images=new Array(s.length).fill({})}function zm(e,t,r){return Km.apply(this,arguments)}function Km(){return(Km=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c,l,f;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.json.buffers||[],a=0;case 2:if(!(a<i.length)){e.next=22;break}if(!(o=i[a]).uri){e.next=18;break}return by(n.fetch),c=Ay(o.uri,r),e.next=10,null==n||null===(s=n.fetch)||void 0===s?void 0:s.call(n,c);case 10:return l=e.sent,e.next=13,null==l||null===(u=l.arrayBuffer)||void 0===u?void 0:u.call(l);case 13:f=e.sent,t.buffers[a]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete o.uri,e.next=19;break;case 18:null===t.buffers[a]&&(t.buffers[a]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength});case 19:++a,e.next=2;break;case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qm(e,t,r){return Xm.apply(this,arguments)}function Xm(){return(Xm=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u,c;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=Qm(t),a=t.json.images||[],o=[],s=Um(i);try{for(s.s();!(u=s.n()).done;)c=u.value,o.push(Wm(t,a[c],c,r,n))}catch(e){s.e(e)}finally{s.f()}return e.next=7,Promise.all(o);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qm(e){var t,r=new Set,n=Um(e.json.textures||[]);try{for(n.s();!(t=n.n()).done;){var i=t.value;void 0!==i.source&&r.add(i.source)}}catch(e){n.e(e)}finally{n.f()}return Array.from(r).sort()}function Wm(e,t,r,n,i){return Zm.apply(this,arguments)}function Zm(){return(Zm=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s,u,c,l,f,h;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=a.fetch,s=a.parse,!r.uri||r.hasOwnProperty("bufferView")){e.next=9;break}return c=Ay(r.uri,i),e.next=5,o(c);case 5:return l=e.sent,e.next=8,l.arrayBuffer();case 8:u=e.sent;case 9:return Number.isFinite(r.bufferView)&&(f=By(t.json,t.buffers,r.bufferView),u=rl(f.buffer,f.byteOffset,f.byteLength)),by(u,"glTF image has no data"),e.next=13,s(u,[yy,Gv],{mimeType:r.mimeType,basis:i.basis||{format:Fv()}},a);case 13:(h=e.sent)&&h[0]&&(h={compressed:!0,mipmaps:!1,width:h[0].width,height:h[0].height,data:h[0]}),t.images=t.images||[],t.images[n]=h;case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ym(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ym(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ym(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var eb={name:"glTF",id:"gltf",module:"gltf",version:"3.2.10",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:function(e){return tb.apply(this,arguments)},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 tb(){return(tb=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=s.length>2?s[2]:void 0,(r=$m($m({},eb.options),r)).gltf=$m($m({},eb.options.gltf),r.gltf),i=r.byteOffset,a=void 0===i?0:i,o={},e.next=8,Hm(o,t,a,r,n);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var rb=0,nb=1;function ib(e,t,r,n){e.rotateYtoZ=!0;var i=e.byteOffset+e.byteLength-r;if(0===i)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=rl(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 ab(e,t,r,n){return ob.apply(this,arguments)}function ob(){return(ob=Ie()(Pe.a.mark((function e(t,r,n,i){var a,o,s;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n["3d-tiles"]||{},sb(t,r,n),!a.loadGLTF){e.next=16;break}if(o=i.parse,s=i.fetch,!t.gltfUrl){e.next=9;break}return e.next=7,s(t.gltfUrl,n);case 7:t.gltfArrayBuffer=e.sent,t.gltfByteOffset=0;case 9:if(!t.gltfArrayBuffer){e.next=16;break}return e.next=12,o(t.gltfArrayBuffer,eb,n,i);case 12:t.gltf=e.sent,delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sb(e,t,r){switch(t){case rb:var n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),i=(new TextDecoder).decode(n);e.gltfUrl=i.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case nb:break;default:throw new Error("b3dm: Illegal glTF format field")}}function ub(e,t,r,n,i){return cb.apply(this,arguments)}function cb(){return(cb=Ie()(Pe.a.mark((function e(t,r,n,i,a){var o,s;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=lb(t,r,n,i,a),e.next=3,ab(t,nb,i,a);case 3:return(s=null==t||null===(o=t.gltf)||void 0===o?void 0:o.extensions)&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lb(e,t,r,n,i){r=ib(e,t,r=Ep(e,t,r=Op(e,t,r=Cp(e,t,r))),n);var a=new dp(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",5126,3),r}function fb(e,t,r,n,i){return hb.apply(this,arguments)}function hb(){return(hb=Ie()(Pe.a.mark((function e(t,r,n,i,a){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=db(t,r,n,i,a),e.next=3,ab(t,t.gltfFormat,i,a);case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function db(e,t,r,n,i){if(r=Cp(e,t,r),1!==e.version)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));r=Op(e,t,r);var a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r=ib(e,t,r=Ep(e,t,r+=4),n),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var o=new dp(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);new xp(e.batchTableJson,e.batchTableBinary,s);return function(e,t,r,n){for(var i=[new Array(n),e._batchTable][0],a=new St,o=(new St,new St,new St,new Xt),s=new mr,u=new St,c={},l=new Zr,f=[],h=[],d=new St,p=new St,v=0;v<n;v++){var y=void 0;if(t.hasProperty("POSITION"))y=t.getProperty("POSITION",5126,3,v,a);else if(t.hasProperty("POSITION_QUANTIZED")){y=t.getProperty("POSITION_QUANTIZED",5123,3,v,a);var g=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3,d);if(!g)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var m=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3,p);if(!m)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var b=0;b<3;b++)y[b]=y[b]/65535*m[b]+g[b]}if(!y)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(y),c.translation=a,e.normalUp=t.getProperty("NORMAL_UP",5126,3,v,f),e.normalRight=t.getProperty("NORMAL_RIGHT",5126,3,v,h);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,f),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",5123,2,h),e.octNormalUp){if(!e.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}e.eastNorthUp?(Mf.WGS84.eastNorthUpToFixedFrame(a,l),l.getRotationMatrix3(o)):o.identity()}!1,s.fromMatrix3(o),c.rotation=s,u.set(1,1,1);var A=t.getProperty("SCALE",5126,1,v);Number.isFinite(A)&&u.multiplyByScalar(A);var B=t.getProperty("SCALE_NON_UNIFORM",5126,3,v,f);B&&u.scale(B),c.scale=u;var w=t.getProperty("BATCH_ID",5123,1,v);void 0===w&&(w=v);var _=(new Zr).fromQuaternion(c.rotation);l.identity(),l.translate(c.translation),l.multiplyRight(_),l.scale(c.scale);var x=l.clone();i[v]={modelMatrix:x,batchId:w}}e.instances=i}(e,o,0,s),r}function pb(e,t,r,n,i,a){return vb.apply(this,arguments)}function vb(){return(vb=Ie()(Pe.a.mark((function e(t,r,n,i,a,o){var s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Cp(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)){e.next=13;break}return u={},t.tiles.push(u),e.next=10,o(r,n,i,a,u);case 10:n=e.sent,e.next=5;break;case 13:return e.abrupt("return",n);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function yb(e,t,r,n){return gb.apply(this,arguments)}function gb(){return(gb=Ie()(Pe.a.mark((function e(t,r,n,i){var a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.rotateYtoZ=!0,t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",a=i.parse,e.next=5,a(r,eb,n,i);case 5:t.gltf=e.sent;case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mb(e){return bb.apply(this,arguments)}function bb(){return(bb=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o=arguments;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=o.length>1&&void 0!==o[1]?o[1]:0,n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,(a=o.length>4&&void 0!==o[4]?o[4]:{}).byteOffset=r,a.type=rd(t,r),e.t0=a.type,e.next=e.t0===ed.COMPOSITE?9:e.t0===ed.BATCHED_3D_MODEL?12:e.t0===ed.GLTF?15:e.t0===ed.INSTANCED_3D_MODEL?18:e.t0===ed.POINT_CLOUD?21:24;break;case 9:return e.next=11,pb(a,t,r,n,i,mb);case 11:return e.abrupt("return",e.sent);case 12:return e.next=14,ub(a,t,r,n,i);case 14:return e.abrupt("return",e.sent);case 15:return e.next=17,yb(a,t,n,i);case 17:return e.abrupt("return",e.sent);case 18:return e.next=20,fb(a,t,r,n,i);case 20:return e.abrupt("return",e.sent);case 21:return e.next=23,Gp(a,t,r,n,i);case 23:return e.abrupt("return",e.sent);case 24:throw new Error("3DTileLoader: unknown type ".concat(a.type));case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ab(){return(Ab=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(1952609651===new Uint32Array(t.slice(0,4))[0]){e.next=3;break}throw new Error("Wrong subtree file magic number");case 3:if(1===new Uint32Array(t.slice(4,8))[0]){e.next=6;break}throw new Error("Wrong subtree file verson, must be 1");case 6:if(r=_b(t.slice(8,16)),n=new Uint8Array(t,24,r),i=new TextDecoder("utf8"),a=i.decode(n),o=JSON.parse(a),s=_b(t.slice(16,24)),u=new ArrayBuffer(0),s&&(u=t.slice(24+r)),!("bufferView"in o.tileAvailability)){e.next=18;break}return e.next=17,Bb(o,"tileAvailability",u);case 17:o.tileAvailability.explicitBitstream=e.sent;case 18:if(!("bufferView"in o.contentAvailability)){e.next=22;break}return e.next=21,Bb(o,"contentAvailability",u);case 21:o.contentAvailability.explicitBitstream=e.sent;case 22:if(!("bufferView"in o.childSubtreeAvailability)){e.next=26;break}return e.next=25,Bb(o,"childSubtreeAvailability",u);case 25:o.childSubtreeAvailability.explicitBitstream=e.sent;case 26:return e.abrupt("return",o);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Bb(e,t,r){return wb.apply(this,arguments)}function wb(){return(wb=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t[r].bufferView,a=t.bufferViews[i],!(o=t.buffers[a.buffer]).uri){e.next=11;break}return e.next=6,Ou(o.uri);case 6:return s=e.sent,e.next=9,s.arrayBuffer();case 9:return u=e.sent,e.abrupt("return",new Uint8Array(u,a.byteOffset,a.byteLength));case 11:return e.abrupt("return",new Uint8Array(n,a.byteOffset,a.byteLength));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _b(e){var t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+Math.pow(2,32)*n}var xb={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:"3.2.10",extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:function(e){return Ab.apply(this,arguments)},options:{}},Cb={QUADTREE:4,OCTREE:8};function Ob(e){return Eb.apply(this,arguments)}function Eb(){return(Eb=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v,y,g,m,b,A,B,w,_,x,C,O,E,T,S,k,M,I,R,P,F,D,L,j,G,U,N;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.options,n=t.parentData,i=void 0===n?{mortonIndex:0,x:0,y:0,z:0}:n,a=t.childIndex,o=void 0===a?0:a,s=t.globalData,u=void 0===s?{level:0,mortonIndex:0,x:0,y:0,z:0}:s,c=t.subtree,l=t.level,f=void 0===l?0:l,h=r.subdivisionScheme,d=r.subtreeLevels,p=r.maximumLevel,v=r.contentUrlTemplate,y=r.subtreesUriTemplate,g=r.basePath,m={children:[],lodMetricValue:0,contentUrl:""},b=Cb[h],A=1&o,B=o>>1&1,w=o>>2&1,_=(Math.pow(b,f)-1)/(b-1),x=kb(i.mortonIndex,o),C=_+x,O=kb(i.x,A),E=kb(i.y,B),T=kb(i.z,w),S=!1,f+1>d&&(S=Tb(c.childSubtreeAvailability,x)),k=kb(u.x,O),M=kb(u.y,E),I=kb(u.z,T),R=f+u.level,!S){e.next=38;break}return P="".concat(g,"/").concat(y),F=Mb(P,R,k,M,I),e.next=25,$l(F,xb);case 25:D=e.sent,c=D,u.mortonIndex=x,u.x=O,u.y=E,u.z=T,u.level=f,x=0,C=0,O=0,E=0,T=0,f=0;case 38:if(Tb(c.tileAvailability,C)&&!(f>p)){e.next=41;break}return e.abrupt("return",m);case 41:Tb(c.contentAvailability,C)&&(m.contentUrl=Mb(v,R,k,M,I)),L=f+1,j={mortonIndex:x,x:O,y:E,z:T},G=0;case 46:if(!(G<b)){e.next=54;break}return e.next=49,Ob({subtree:c,options:r,parentData:j,childIndex:G,level:L,globalData:u});case 49:((U=e.sent).contentUrl||U.children.length)&&(N=Sb(U,R+1,{childTileX:O,childTileY:E,childTileZ:T},r),m.children.push(N));case 51:G++,e.next=46;break;case 54:return e.abrupt("return",m);case 55:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tb(e,t){return"constant"in e?Boolean(e.constant):!!e.explicitBitstream&&(r=t,n=e.explicitBitstream,i=Math.floor(r/8),a=r%8,1==(n[i]>>a&1));var r,n,i,a}function Sb(e,t,r,n){var i=n.basePath,a=n.refine,o=n.getRefine,s=n.lodMetricType,u=n.getTileType,c=n.rootLodMetricValue,l=n.rootBoundingVolume,f=e.contentUrl&&e.contentUrl.replace("".concat(i,"/"),""),h=c/Math.pow(2,t),d=function(e,t,r){if(t.region){var n=r.childTileX,i=r.childTileY,a=r.childTileZ,o=M()(t.region,6),s=o[0],u=o[1],c=o[2],l=o[3],f=o[4],h=o[5],d=Math.pow(2,e),p=(c-s)/d,v=(l-u)/d,y=(h-f)/d;return{region:[s+p*n,u+v*i,s+p*(n+1),u+v*(i+1),f+y*a,f+y*(a+1)]}}return console.warn("Unsupported bounding volume type: ",t),null}(t,l,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:f},id:e.contentUrl,refine:o(a),type:u(e),lodMetricType:s,lodMetricValue:h,boundingVolume:d}}function kb(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function Mb(e,t,r,n,i){var a=function(e){var t={};for(var r in e)t["{".concat(r,"}")]=e[r];return t}({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,(function(e){return a[e]}))}function Ib(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Rb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rb(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function Rb(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pb(e){if(!e.contentUrl)return eh;var t=e.contentUrl.split(".").pop();switch(t){case"pnts":return rh;case"i3dm":case"b3dm":case"glb":case"gltf":return th;default:return t}}function Fb(e){switch(e){case"REPLACE":case"replace":return $f;case"ADD":case"add":return Yf;default:return e}}function Db(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){var r=new URL(e,"".concat(t,"/"));return decodeURI(r.toString())}return e.startsWith("/")?e:"".concat(t,"/").concat(e)}function Lb(e,t){if(!e)return null;if(e.content){var r=e.content.uri||e.content.url;e.contentUrl=Db(r,t.basePath)}return e.id=e.contentUrl,e.lodMetricType=oh,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=Pb(e),e.refine=Fb(e.refine),e}function jb(e){var t=e.basePath,r=Lb(e.root,e),n=[];for(n.push(r);n.length>0;){var i,a=Ib((n.pop()||{}).children||[]);try{for(a.s();!(i=a.n()).done;){var o=i.value;Lb(o,{basePath:t}),n.push(o)}}catch(e){a.e(e)}finally{a.f()}}return r}function Gb(e){return Ub.apply(this,arguments)}function Ub(){return(Ub=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u,c,l,f,h,d,p,v;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.root){e.next=2;break}return e.abrupt("return",null);case 2:return r=t.basePath,n=t.root.extensions["3DTILES_implicit_tiling"],i=n.subdivisionScheme,a=n.maximumLevel,o=n.subtreeLevels,s=n.subtrees.uri,u=Mb(s,0,0,0,0),c=Db(u,r),e.next=9,$l(c,xb);case 9:return l=e.sent,f=Db(t.root.content.uri,r),h=t.root.refine,d=t.root.geometricError,p=t.root.boundingVolume,v={contentUrlTemplate:f,subtreesUriTemplate:s,subdivisionScheme:i,subtreeLevels:o,maximumLevel:a,refine:h,basePath:r,lodMetricType:oh,rootLodMetricValue:d,rootBoundingVolume:p,getTileType:Pb,getRefine:Fb},e.next=17,Nb(t.root,l,v);case 17:return e.abrupt("return",e.sent);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nb(e,t,r){return Hb.apply(this,arguments)}function Hb(){return(Hb=Ie()(Pe.a.mark((function e(t,r,n){var i,a,o;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",null);case 2:return t.lodMetricType=oh,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,e.next=7,Ob({subtree:r,options:n});case 7:return i=e.sent,a=i.children,(o=i.contentUrl)&&(t.contentUrl=o,t.content={uri:o.replace("".concat(n.basePath,"/"),"")}),t.refine=Fb(t.refine),t.type=Pb(t),t.children=a,t.id=t.contentUrl,e.abrupt("return",t);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Jb={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.2.10",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:function(e,t,r){return Qb.apply(this,arguments)},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function Vb(e){return n.dirname(e.url)}function zb(e,t,r){return Kb.apply(this,arguments)}function Kb(){return(Kb=Ie()(Pe.a.mark((function e(t,r,n){var i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={content:{featureIds:null}},0,e.next=4,mb(t,0,r,n,i.content);case 4:return e.abrupt("return",i.content);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qb(e,t,r){return Xb.apply(this,arguments)}function Xb(){return(Xb=Ie()(Pe.a.mark((function e(t,r,n){var i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=JSON.parse((new TextDecoder).decode(t))).loader=r.loader||Jb,a.url=n.url,a.basePath=Vb(a),!Wb(a)){e.next=10;break}return e.next=7,Gb(a);case 7:e.t0=e.sent,e.next=11;break;case 10:e.t0=jb(a);case 11:return a.root=e.t0,a.type=ah,a.lodMetricType=oh,a.lodMetricValue=(null===(i=a.root)||void 0===i?void 0:i.lodMetricValue)||0,e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qb(){return(Qb=Ie()(Pe.a.mark((function e(t,r,n){var i;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r["3d-tiles"]||{},!("auto"===i.isTileset?n.url&&-1!==n.url.indexOf(".json"):i.isTileset)){e.next=8;break}return e.next=5,qb(t,r,n);case 5:t=e.sent,e.next=11;break;case 8:return e.next=10,zb(t,r,n);case 10:t=e.sent;case 11:return e.abrupt("return",t);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wb(e){var t,r;return(null==e||null===(t=e.extensionsRequired)||void 0===t?void 0:t.includes("3DTILES_implicit_tiling"))&&(null==e||null===(r=e.extensionsUsed)||void 0===r?void 0:r.includes("3DTILES_implicit_tiling"))}function Zb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zb(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var eA=[0],tA={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:Jb,onTilesetLoad:{type:"function",value:function(e){},compare:!1},onTileLoad:{type:"function",value:function(e){},compare:!1},onTileUnload:{type:"function",value:function(e){},compare:!1},onTileError:{type:"function",value:function(e,t,r){},compare:!1},_getMeshColor:{type:"function",value:function(e){return[255,255,255]},compare:!1}},rA=function(e){p()(n,e);var t,r=$b(n);function n(){var e;h()(this,n);for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return e=r.call.apply(r,[this].concat(i)),A()(gi()(e),"state",void 0),e}return C()(n,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&B.log.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}},{key:"isLoaded",get:function(){var e=this.state.tileset3d;return null!==e&&e.isLoaded()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=e.props,r=e.oldProps,n=e.changeFlags;if(t.data&&t.data!==r.data&&this._loadTileset(t.data),n.viewportChanged){var i=this.state.activeViewports;Object.keys(i).length&&(this._updateTileset(i),this.state.lastUpdatedViewports=i,this.state.activeViewports={})}if(n.propsChanged){var a=this.state.layerMap;for(var o in a)a[o].needsUpdate=!0}}},{key:"activateViewport",value:function(e){var t=this.state,r=t.activeViewports,n=t.lastUpdatedViewports;this.internalState.viewport=e,r[e.id]=e;var i=null==n?void 0:n[e.id];i&&e.equals(i)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}},{key:"getPickingInfo",value:function(e){var t=e.info,r=e.sourceLayer,n=this.state.layerMap,i=r&&r.id;if(i){var a=i.substring(this.id.length+1),o=a.substring(a.indexOf("-")+1);t.object=n[o]&&n[o].tile}return t}},{key:"filterSubLayer",value:function(e){var t=e.layer,r=e.viewport,n=t.props.tile,i=r.id;return n.selected&&n.viewportIds.includes(i)}},{key:"_updateAutoHighlight",value:function(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}},{key:"_loadTileset",value:(t=Ie()(Pe.a.mark((function e(t){var r,n,i,a,o,s,u;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.props.loadOptions,n=void 0===r?{}:r,i=this.props.loader||this.props.loaders,Array.isArray(i)&&(i=i[0]),a={loadOptions:Yb({},n)},!i.preload){e.next=10;break}return e.next=7,i.preload(t,n);case 7:(o=e.sent).headers&&(a.loadOptions.fetch=Yb(Yb({},a.loadOptions.fetch),{},{headers:o.headers})),Object.assign(a,o);case 10:return e.next=12,$l(t,i,a.loadOptions);case 12:s=e.sent,u=new $h(s,Yb({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError},a)),this.setState({tileset3d:u,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(u);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_onTileLoad",value:function(e){var t=this.state.lastUpdatedViewports;this.props.onTileLoad(e),this._updateTileset(t),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(e){delete this.state.layerMap[e.id],this.props.onTileUnload(e)}},{key:"_updateTileset",value:function(e){var t=this;if(e){var r=this.state.tileset3d,n=this.context.timeline,i=Object.keys(e).length;n&&i&&r&&r.selectTiles(Object.values(e)).then((function(e){t.state.frameNumber!==e&&t.setState({frameNumber:e})}))}}},{key:"_getSubLayer",value:function(e,t){if(!e.content)return null;switch(e.type){case rh:return this._makePointCloudLayer(e,t);case th:return this._make3DModelLayer(e);case nh:return this._makeSimpleMeshLayer(e,t);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(e.content.type))}}},{key:"_makePointCloudLayer",value:function(e,t){var r=e.content,n=r.attributes,i=r.pointCount,a=r.constantRGBA,o=r.cartographicOrigin,s=r.modelMatrix,u=n.positions,c=n.normals,l=n.colors;if(!u)return null;var f=t&&t.props.data||{header:{vertexCount:i},attributes:{POSITION:u,NORMAL:c,COLOR_0:l}},h=this.props,d=h.pointSize,p=h.getPointColor;return new(this.getSubLayerClass("pointcloud",B.PointCloudLayer))({pointSize:d},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(e.id),tile:e,data:f,coordinateSystem:B.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:o,modelMatrix:s,getColor:a||p,_offset:0})}},{key:"_make3DModelLayer",value:function(e){var t=e.content,r=t.gltf,n=t.instances,i=t.cartographicOrigin,a=t.modelMatrix;return new(this.getSubLayerClass("scenegraph",B.ScenegraphLayer))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(e.id),tile:e,data:n||eA,scenegraph:r,coordinateSystem:B.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:i,modelMatrix:a,getTransformMatrix:function(e){return e.modelMatrix},getPosition:[0,0,0],_offset:0})}},{key:"_makeSimpleMeshLayer",value:function(e,t){var r=e.content,n=r.attributes,i=r.indices,a=r.modelMatrix,o=r.cartographicOrigin,s=r.coordinateSystem,u=void 0===s?B.COORDINATE_SYSTEM.METER_OFFSETS:s,c=r.material,l=r.featureIds,f=this.props._getMeshColor,h=t&&t.props.mesh||new Fi.Geometry({drawMode:4,attributes:nA(n),indices:i});return new(this.getSubLayerClass("mesh",zs))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(e.id),tile:e,mesh:h,data:eA,getColor:f(e),pbrMaterial:c,modelMatrix:a,coordinateOrigin:o,coordinateSystem:u,featureIds:l,_offset:0})}},{key:"renderLayers",value:function(){var e=this,t=this.state,r=t.tileset3d,n=t.layerMap;return r?r.tiles.map((function(t){var r=n[t.id]=n[t.id]||{tile:t},i=r.layer;return t.selected&&(i?r.needsUpdate&&(i=e._getSubLayer(t,i),r.needsUpdate=!1):i=e._getSubLayer(t)),r.layer=i,i})).filter(Boolean):null}}]),n}(B.CompositeLayer);function nA(e){var t={};return t.positions=Yb(Yb({},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}A()(rA,"defaultProps",tA),A()(rA,"layerName","Tile3DLayer");var iA={name:"Terrain",id:"terrain",module:"terrain",version:"3.2.10",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}}};function aA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function oA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oA(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var uA=[1],cA=sA(sA({},ui.defaultProps),{},{elevationData:Rn,texture:sA(sA({},Rn),{},{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:{type:"string",value:null},wireframe:!1,material:!0,loaders:[iA]});function lA(e){return Array.isArray(e)?e.join(";"):e||""}var fA=function(e){p()(r,e);var t=aA(r);function r(){var e;h()(this,r);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=t.call.apply(t,[this].concat(i)),A()(gi()(e),"state",void 0),e}return C()(r,[{key:"updateState",value:function(e){var t=e.props,r=e.oldProps,n=t.elevationData!==r.elevationData;if(n){var i=t.elevationData,a=i&&(Array.isArray(i)||i.includes("{x}")&&i.includes("{y}"));this.setState({isTiled:a})}var o=n||t.meshMaxError!==r.meshMaxError||t.elevationDecoder!==r.elevationDecoder||t.bounds!==r.bounds;if(!this.state.isTiled&&o){var s=this.loadTerrain(t);this.setState({terrain:s})}t.workerUrl&&B.log.removed("workerUrl","loadOptions.terrain.workerUrl")()}},{key:"loadTerrain",value:function(e){var t,r=e.elevationData,n=e.bounds,i=e.elevationDecoder,a=e.meshMaxError,o=e.signal;if(!r)return null;var s=this.getLoadOptions();return s=sA(sA({},s),{},{terrain:sA(sA({skirtHeight:this.state.isTiled?2*a:0},null===(t=s)||void 0===t?void 0:t.terrain),{},{bounds:n,meshMaxError:a,elevationDecoder:i})}),(0,this.props.fetch)(r,{propName:"elevationData",layer:this,loadOptions:s,signal:o})}},{key:"getTiledTerrainData",value:function(e){var t=this.props,r=t.elevationData,n=t.fetch,i=t.texture,a=t.elevationDecoder,o=t.meshMaxError,s=this.context.viewport,u=Fn(r,e),c=i&&Fn(i,e),l=e.signal,f=[0,0],h=[0,0];if(s.isGeospatial){var d=e.bbox;f=s.projectFlat([d.west,d.south]),h=s.projectFlat([d.east,d.north])}else{var p=e.bbox;f=[p.left,p.bottom],h=[p.right,p.top]}var v=[f[0],f[1],h[0],h[1]],y=this.loadTerrain({elevationData:u,bounds:v,elevationDecoder:a,meshMaxError:o,signal:l}),g=c?n(c,{propName:"texture",layer:this,loaders:[],signal:l}).catch((function(e){return null})):Promise.resolve(null);return Promise.all([y,g])}},{key:"renderSubLayers",value:function(e){var t=this.getSubLayerClass("mesh",B.SimpleMeshLayer),r=this.props,n=r.color,i=r.wireframe,a=r.material,o=e.data;if(!o)return null;var s=M()(o,2),u=s[0],c=s[1];return new t(e,{data:uA,mesh:u,texture:c,_instanced:!1,coordinateSystem:B.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(e){return[0,0,0]},getColor:n,wireframe:i,material:a})}},{key:"onViewportLoad",value:function(e){if(e){var t=this.state.zRange,r=e.map((function(e){return e.content})).filter(Boolean).map((function(e){return e[0].header.boundingBox.map((function(e){return e[2]}))}));if(0!==r.length){var n=Math.min.apply(Math,Le()(r.map((function(e){return e[0]})))),i=Math.max.apply(Math,Le()(r.map((function(e){return e[1]}))));(!t||n<t[0]||i>t[1])&&this.setState({zRange:[n,i]})}}}},{key:"renderLayers",value:function(){var e=this.props,t=e.color,r=e.material,n=e.elevationData,i=e.texture,a=e.wireframe,o=e.meshMaxError,s=e.elevationDecoder,u=e.tileSize,c=e.maxZoom,l=e.minZoom,f=e.extent,h=e.maxRequests,d=e.onTileLoad,p=e.onTileUnload,v=e.onTileError,y=e.maxCacheSize,g=e.maxCacheByteSize,m=e.refinementStrategy;return this.state.isTiled?new ui(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:lA(n),texture:lA(i),meshMaxError:o,elevationDecoder:s}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:u,maxZoom:c,minZoom:l,extent:f,maxRequests:h,onTileLoad:d,onTileUnload:p,onTileError:v,maxCacheSize:y,maxCacheByteSize:g,refinementStrategy:m}):new(this.getSubLayerClass("mesh",B.SimpleMeshLayer))(this.getSubLayerProps({id:"mesh"}),{data:uA,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:function(e){return[0,0,0]},getColor:t,material:r,wireframe:a})}}]),r}(B.CompositeLayer);A()(fA,"defaultProps",cA),A()(fA,"layerName","TerrainLayer");function hA(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.start,n=void 0===r?0:r,i=t.end,a=void 0===i?e.length:i,o=t.size||2,s=0,u=n,c=a-o;u<a;u+=o)s+=(e[u]-e[c])*(e[u+1]+e[c+1]),c=u;return s/2}function dA(e,t,r,n,i,a){var o,s;if(void 0===a&&(a=hA(e,{start:t,end:r,size:n})),i===a<0)for(o=t;o<r;o+=n)s=FA(o,e[o],e[o+1],s);else for(o=r-n;o>=t;o-=n)s=FA(o,e[o],e[o+1],s);return s&&SA(s,s.next)&&(DA(s),s=s.next),s}function pA(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!SA(n,n.next)&&0!==TA(n.prev,n,n.next))n=n.next;else{if(DA(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function vA(e,t,r,n,i,a,o){if(e){!o&&a&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=xA(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,function(e){var t,r,n,i,a,o,s,u,c=1;do{for(i=e,e=null,u=null,n=0;i;){for(n++,o=i,a=0,r=0;r<c&&(a++,o=o.nextZ);r++);for(s=c;a>0||s>0&&o;)0!==a&&(0===s||!o||i.z<=o.z)?(t=i,i=i.nextZ,a--):(t=o,o=o.nextZ,s--),u?u.nextZ=t:e=t,t.prevZ=u,u=t;i=o}u.nextZ=null,c*=2}while(n>1)}(i)}(e,n,i,a);for(var s,u,c=e;e.prev!==e.next;)if(s=e.prev,u=e.next,a?gA(e,n,i,a):yA(e))t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),DA(e),e=u.next,c=u.next;else if((e=u)===c){o?1===o?vA(e=mA(pA(e),t,r),t,r,n,i,a,2):2===o&&bA(e,t,r,n,i,a):vA(pA(e),t,r,n,i,a,1);break}}}function yA(e){var t=e.prev,r=e,n=e.next;if(TA(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(OA(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&TA(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function gA(e,t,r,n){var i=e.prev,a=e,o=e.next;if(TA(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,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=xA(s,u,t,r,n),h=xA(c,l,t,r,n),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&OA(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&TA(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&OA(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&TA(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&OA(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&TA(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&OA(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&TA(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function mA(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!SA(i,a)&&kA(i,n,n.next,a)&&RA(i,a)&&RA(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),DA(n),DA(n.next),n=e=a),n=n.next}while(n!==e);return pA(n)}function bA(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&EA(o,s)){var u=PA(o,s);return o=pA(o,o.next),u=pA(u,u.next),vA(o,t,r,n,i,a),void vA(u,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function AA(e,t,r,n,i){var a,o,s,u=[];for(a=0,o=t.length;a<o;a++)(s=dA(e,t[a]*n,a<o-1?t[a+1]*n:e.length,n,!1,i&&i[a+1]))===s.next&&(s.steiner=!0),u.push(CA(s));for(u.sort(BA),a=0;a<u.length;a++)wA(u[a],r),r=pA(r,r.next);return r}function BA(e,t){return e.x-t.x}function wA(e,t){if(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===o)return r;var u,c=r,l=r.x,f=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=l&&i!==n.x&&OA(a<f?i:o,a,l,f,a<f?o:i,a,n.x,n.y)&&(u=Math.abs(a-n.y)/(i-n.x),RA(n,e)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&_A(r,n)))&&(r=n,h=u)),n=n.next}while(n!==c);return r}(e,t)){var r=PA(t,e);pA(t,t.next),pA(r,r.next)}}function _A(e,t){return TA(e.prev,e,t.prev)<0&&TA(t.next,e,e.next)<0}function xA(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function CA(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 OA(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 EA(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(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&&kA(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(RA(e,t)&&RA(t,e)&&function(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}(e,t)&&(TA(e.prev,e,t.prev)||TA(e,t.prev,t))||SA(e,t)&&TA(e.prev,e,e.next)>0&&TA(t.prev,t,t.next)>0)}function TA(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function SA(e,t){return e.x===t.x&&e.y===t.y}function kA(e,t,r,n){var i=IA(TA(e,t,r)),a=IA(TA(e,t,n)),o=IA(TA(r,n,e)),s=IA(TA(r,n,t));return i!==a&&o!==s||(!(0!==i||!MA(e,r,t))||(!(0!==a||!MA(e,n,t))||(!(0!==o||!MA(r,e,n))||!(0!==s||!MA(r,t,n)))))}function MA(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 IA(e){return e>0?1:e<0?-1:0}function RA(e,t){return TA(e.prev,e,e.next)<0?TA(e,t,e.next)>=0&&TA(e,e.prev,t)>=0:TA(e,t,e.prev)<0||TA(e,e.next,t)<0}function PA(e,t){var r=new LA(e.i,e.x,e.y),n=new LA(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 FA(e,t,r,n){var i=new LA(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 DA(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 LA(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 jA(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return GA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return GA(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function GA(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function UA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function NA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?UA(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UA(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function HA(e,t,r){var n=JA(e),i=Object.keys(n).filter((function(e){return n[e]!==Array}));return function(e,t,r){for(var n=t.pointPositionsCount,i=t.pointFeaturesCount,a=t.linePositionsCount,o=t.linePathsCount,s=t.lineFeaturesCount,u=t.polygonPositionsCount,c=t.polygonObjectsCount,l=t.polygonRingsCount,f=t.polygonFeaturesCount,h=t.propArrayTypes,d=t.coordLength,p=r.numericPropKeys,v=void 0===p?[]:p,y=r.PositionDataType,g=void 0===y?Float32Array:y,m=(e[0]&&"id"in e[0]),b=e.length>65535?Uint32Array:Uint16Array,A={type:"Point",positions:new g(n*d),globalFeatureIds:new b(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 g(a*d),globalFeatureIds:new b(a),featureIds:s>65535?new Uint32Array(a):new Uint16Array(a),numericProps:{},properties:[],fields:[]},w={type:"Polygon",polygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),positions:new g(u*d),triangles:[],globalFeatureIds:new b(u),featureIds:f>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]},_=0,x=[A,B,w];_<x.length;_++){var C,O=x[_],E=jA(v);try{for(E.s();!(C=E.n()).done;){var T=C.value,S=h[T];O.numericProps[T]=new S(O.positions.length/d)}}catch(e){E.e(e)}finally{E.f()}}B.pathIndices[o]=a,w.polygonIndices[c]=u,w.primitivePolygonIndices[l]=u;var k,M={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},I=jA(e);try{for(I.s();!(k=I.n()).done;){var R=k.value,P=R.geometry,F=R.properties||{};switch(P.type){case"Point":VA(P,A,M,d,F),A.properties.push(WA(F,v)),m&&A.fields.push({id:R.id}),M.pointFeature++;break;case"LineString":zA(P,B,M,d,F),B.properties.push(WA(F,v)),m&&B.fields.push({id:R.id}),M.lineFeature++;break;case"Polygon":KA(P,w,M,d,F),w.properties.push(WA(F,v)),m&&w.fields.push({id:R.id}),M.polygonFeature++;break;default:throw new Error("Invalid geometry type")}M.feature++}}catch(e){I.e(e)}finally{I.f()}return function(e,t,r,n){return{points:NA(NA({},e),{},{positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:XA(e.numericProps,1)}),lines:NA(NA({},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:XA(t.numericProps,1)}),polygons:NA(NA({},r),{},{positions:{value:r.positions,size:n},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},triangles:{value:new Uint32Array(r.triangles),size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:XA(r.numericProps,1)})}}(A,B,w,d)}(e,NA({propArrayTypes:n},t),{numericPropKeys:r&&r.numericPropKeys||i,PositionDataType:r?r.PositionDataType:Float32Array})}function JA(e){var t,r={},n=jA(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.properties)for(var a in i.properties){var o=i.properties[a];r[a]=ZA(o,r[a])}}}catch(e){n.e(e)}finally{n.f()}return r}function VA(e,t,r,n,i){t.positions.set(e.data,r.pointPosition*n);var a=e.data.length/n;QA(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 zA(e,t,r,n,i){t.positions.set(e.data,r.linePosition*n);var a=e.data.length/n;QA(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],c=o===s-1?e.data.length:e.indices[o+1];t.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(c-u)/n}}function KA(e,t,r,n,i){t.positions.set(e.data,r.polygonPosition*n);var a=e.data.length/n;QA(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 c=e.areas[o],l=e.indices[o],f=e.indices[o+1],h=0,d=l.length;h<d;++h){var p=l[h],v=h===d-1?void 0===f?e.data.length:f[0]:l[h+1];t.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(v-p)/n}qA(t,c,l,{startPosition:u,endPosition:r.polygonPosition,coordLength:n})}}function qA(e,t,r,n){for(var i=n.startPosition,a=n.endPosition,o=n.coordLength,s=i*o,u=a*o,c=e.positions.subarray(s,u),l=r[0],f=function(e,t){var r,n,i,a,o,s,u,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,l=arguments.length>3?arguments[3]:void 0,f=t&&t.length,h=f?t[0]*c:e.length,d=dA(e,0,h,c,!0,l&&l[0]),p=[];if(!d||d.next===d.prev)return p;if(f&&(d=AA(e,t,d,c,l)),e.length>80*c){a=n=e[0],o=i=e[1];for(var v=c;v<h;v+=c)(s=e[v])<a&&(a=s),(u=e[v+1])<o&&(o=u),s>n&&(n=s),u>i&&(i=u);r=0!==(r=Math.max(n-a,i-o))?1/r:0}return vA(d,p,c,a,o,r),p}(c,r.slice(1).map((function(e){return(e-l)/o})),o,t),h=0,d=f.length;h<d;++h)e.triangles.push(i+f[h])}function XA(e,t){var r={};for(var n in e)r[n]={value:e[n],size:t};return r}function QA(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 WA(e,t){var r={};for(var n in e)t.includes(n)||(r[n]=e[n]);return r}function ZA(e,t){return t!==Array&&Number.isFinite(e)?t===Float64Array||Math.fround(e)!==e?Float64Array:Float32Array:Array}var YA=r(41),$A=r.n(YA);function eB(e){for(var t,r,n=0,i=0,a=e.length-1;i<e.length;a=i++)t=e[i],n+=((r=e[a])[0]-t[0])*(t[1]+r[1]);return n}function tB(e,t,r){t&&r&&(1===e?t.id=r.readVarint():2===e?function(e,t){var r=e.readVarint()+e.pos;for(;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3===e?t.type=r.readVarint():4===e&&(t._geometry=r.pos))}var rB=function(){function e(t,r,n,i,a){h()(this,e),Jn(this,"properties",void 0),Jn(this,"extent",void 0),Jn(this,"type",void 0),Jn(this,"id",void 0),Jn(this,"_pbf",void 0),Jn(this,"_geometry",void 0),Jn(this,"_keys",void 0),Jn(this,"_values",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=i,this._values=a,t.readFields(tB,this,r)}return C()(e,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,a=0,o=0,s=[];e.pos<r;){if(i<=0){var u=e.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)a+=e.readSVarint(),o+=e.readSVarint(),1===n&&(t&&s.push(t),t=[]),t&&t.push([a,o]);else{if(7!==n)throw new Error("unknown command ".concat(n));t&&t.push(t[0].slice())}}return t&&s.push(t),s}},{key:"bbox",value:function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,u=1/0,c=-1/0;e.pos<t;){if(n<=0){var l=e.readVarint();r=7&l,n=l>>3}if(n--,1===r||2===r)(i+=e.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=e.readSVarint())<u&&(u=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command ".concat(r))}return[o,u,s,c]}},{key:"_toGeoJSON",value:function(t){var r,n,i=this.loadGeometry(),a=e.types[this.type];switch(this.type){case 1:var o=[];for(r=0;r<i.length;r++)o[r]=i[r][0];t(i=o,this);break;case 2:for(r=0;r<i.length;r++)t(i[r],this);break;case 3:for(i=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,i=[],a=0;a<t;a++){var o=eB(e[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[e[a]]):r&&r.push(e[a]))}return r&&i.push(r),i}(i),r=0;r<i.length;r++)for(n=0;n<i[r].length;n++)t(i[r][n],this)}1===i.length?i=i[0]:a="Multi".concat(a);var s={type:"Feature",geometry:{type:a,coordinates:i},properties:this.properties};return null!==this.id&&(s.id=this.id),s}},{key:"toGeoJSON",value:function(e){if("function"==typeof e)return this._toGeoJSON(e);var t=e.x,r=e.y,n=e.z,i=this.extent*Math.pow(2,n),a=this.extent*t,o=this.extent*r;return this._toGeoJSON((function(e){for(var t=0;t<e.length;t++){var r=e[t];r[0]=360*(r[0]+a)/i-180;var n=180-360*(r[1]+o)/i;r[1]=360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90}}))}}],[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),e}(),nB=function(){function e(t,r){h()(this,e),Jn(this,"version",void 0),Jn(this,"name",void 0),Jn(this,"extent",void 0),Jn(this,"length",void 0),Jn(this,"_pbf",void 0),Jn(this,"_keys",void 0),Jn(this,"_values",void 0),Jn(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(iB,this,r),this.length=this._features.length}return C()(e,[{key:"feature",value:function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new rB(this._pbf,t,this.extent,this._keys,this._values)}}]),e}();function iB(e,t,r){t&&r&&(15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){var t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r)))}var aB,oB,sB,uB,cB,lB,fB,hB=function e(t,r){h()(this,e),Jn(this,"layers",void 0),this.layers=t.readFields(dB,{},r)};function dB(e,t,r){if(3===e&&r){var n=new nB(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function pB(e){var t=e.indices.length;if(t<=1)return{type:"Polygon",data:e.data,areas:[[hA(e.data)]],indices:[e.indices]};for(var r,n,i,a=[],o=[],s=[],u=[],c=0,l=0;l<t;l++){i=e.indices[l]-c,n=e.indices[l+1]-c||e.data.length;var f=hA(e.data.slice(i,n));if(0!==f)void 0===r&&(r=f<0),r===f<0?(u.length&&(a.push(s),o.push(u)),u=[i],s=[f]):(s.push(f),u.push(i));else{var h=e.data.slice(0,i),d=e.data.slice(n);e.data=h.concat(d),c+=n-i}}return s&&a.push(s),u.length&&o.push(u),{type:"Polygon",areas:a,indices:o,data:e.data}}function vB(e,t,r){t&&r&&(1===e?t.id=r.readVarint():2===e?function(e,t){var r=e.readVarint()+e.pos;for(;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3===e?t.type=r.readVarint():4===e&&(t._geometry=r.pos))}function yB(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return gB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gB(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function gB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var AB=function(){function e(t,r,n,i,a,o){h()(this,e),Jn(this,"properties",void 0),Jn(this,"extent",void 0),Jn(this,"type",void 0),Jn(this,"id",void 0),Jn(this,"_pbf",void 0),Jn(this,"_geometry",void 0),Jn(this,"_keys",void 0),Jn(this,"_values",void 0),Jn(this,"_geometryInfo",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=i,this._values=a,this._geometryInfo=o,t.readFields(vB,this,r)}return C()(e,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry,aB=e.readVarint()+e.pos,oB=1,uB=0,cB=0,lB=0,fB=0;for(var t=[],r=[];e.pos<aB;)if(uB<=0&&(sB=e.readVarint(),oB=7&sB,uB=sB>>3),uB--,1===oB||2===oB)cB+=e.readSVarint(),lB+=e.readSVarint(),1===oB&&t.push(fB),r.push(cB,lB),fB+=2;else{if(7!==oB)throw new Error("unknown command ".concat(oB));if(fB>0){var n=t[t.length-1];r.push(r[n],r[n+1]),fB+=2}}return{data:r,indices:t}}},{key:"_toBinaryCoordinates",value:function(e){var t,r=this.loadGeometry();e(r.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,t=bB({type:"Point"},r);break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/2,t=bB({type:"LineString"},r);break;case 3:t=pB(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=t.indices.length;var n,i=yB(t.indices);try{for(i.s();!(n=i.n()).done;){var a=n.value;this._geometryInfo.polygonRingsCount+=a.length}}catch(e){i.e(e)}finally{i.f()}this._geometryInfo.polygonPositionsCount+=t.data.length/2;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}var o={type:"Feature",geometry:t,properties:this.properties};return null!==this.id&&(o.id=this.id),o}},{key:"toBinaryCoordinates",value:function(e){if("function"==typeof e)return this._toBinaryCoordinates(e);var t=e.x,r=e.y,n=e.z,i=this.extent*Math.pow(2,n),a=this.extent*t,o=this.extent*r;return this._toBinaryCoordinates((function(e){return function(e,t,r,n){for(var i=0,a=e.length;i<a;i+=2){e[i]=360*(e[i]+t)/n-180;var o=180-360*(e[i+1]+r)/n;e[i+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}(e,a,o,i)}))}}]),e}(),BB=function(){function e(t,r){h()(this,e),Jn(this,"version",void 0),Jn(this,"name",void 0),Jn(this,"extent",void 0),Jn(this,"length",void 0),Jn(this,"_pbf",void 0),Jn(this,"_keys",void 0),Jn(this,"_values",void 0),Jn(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(wB,this,r),this.length=this._features.length}return C()(e,[{key:"feature",value:function(e,t){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var r=this._pbf.readVarint()+this._pbf.pos;return new AB(this._pbf,r,this.extent,this._keys,this._values,t)}}]),e}();function wB(e,t,r){t&&r&&(15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){var t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r)))}var _B=function e(t,r){h()(this,e),Jn(this,"layers",void 0),this.layers=t.readFields(xB,{},r)};function xB(e,t,r){if(3===e&&r){var n=new BB(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function CB(e,t){var r,n,i=function(e){var t;if(null==e||!e.mvt)throw new Error("mvt options required");var r="wgs84"===(null===(t=e.mvt)||void 0===t?void 0:t.coordinates),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}(t),a=(null==t||null===(r=t.gis)||void 0===r?void 0:r.format)||(null==t||null===(n=t.mvt)||void 0===n?void 0:n.shape);switch(a){case"columnar-table":return{shape:"columnar-table",data:OB(e,i)};case"geojson-row-table":return{shape:"geojson-row-table",data:EB(e,i)};case"geojson":return EB(e,i);case"binary-geometry":case"binary":return OB(e,i);default:throw new Error(a)}}function OB(e,t){var r=function(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 _B(new $A.a(e));return(t&&Array.isArray(t.layers)?t.layers:Object.keys(i.layers)).forEach((function(e){var a=i.layers[e];if(a)for(var o=0;o<a.length;o++){var s=SB(a.feature(o,n),t,e);r.push(s)}})),[r,n]}(e,t),n=M()(r,2),i=HA(n[0],n[1]);return i.byteLength=e.byteLength,i}function EB(e,t){if(e.byteLength<=0)return[];var r=[],n=new hB(new $A.a(e));return(Array.isArray(t.layers)?t.layers:Object.keys(n.layers)).forEach((function(e){var i=n.layers[e];if(i)for(var a=0;a<i.length;a++){var o=TB(i.feature(a),t,e);r.push(o)}})),r}function TB(e,t,r){var n=e.toGeoJSON("wgs84"===t.coordinates?t.tileIndex:kB);return t.layerProperty&&(n.properties[t.layerProperty]=r),n}function SB(e,t,r){var n=e.toBinaryCoordinates("wgs84"===t.coordinates?t.tileIndex:MB);return t.layerProperty&&n.properties&&(n.properties[t.layerProperty]=r),n}function kB(e,t){for(var r=t.extent,n=0;n<e.length;n++){var i=e[n];i[0]/=r,i[1]/=r}}function MB(e,t){for(var r=t.extent,n=0,i=e.length;n<i;++n)e[n]/=r}function IB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function RB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?IB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):IB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var PB,FB={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.2.10",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}}};RB(RB({},FB),{},{parse:(PB=Ie()(Pe.a.mark((function e(t,r){return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",CB(t,r));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return PB.apply(this,arguments)}),parseSync:CB,binary:!0});function DB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function LB(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return jB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jB(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function jB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function GB(e,t){var r=null==t?void 0:t.globalFeatureId;return void 0!==r?function(e,t){var r,n=LB(HB(e));try{for(n.s();!(r=n.n()).done;){for(var i=r.value,a=0,o=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];if(u!==o){if(t===i.globalFeatureIds.value[a])return JB(i,a,s);a=s,o=u}}if(t===i.globalFeatureIds.value[a])return JB(i,a,i.featureIds.value.length)}}catch(e){n.e(e)}finally{n.f()}throw new Error("featureId:".concat(t," not found"))}(e,r):UB(e,null==t?void 0:t.type)}function UB(e,t){return function(e){var t,r=[],n=LB(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(0!==i.featureIds.value.length){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&&(r.push(JB(i,a,s)),a=s,o=u)}r.push(JB(i,a,i.featureIds.value.length))}}}catch(e){n.e(e)}finally{n.f()}return r}(HB(e,t))}function NB(e,t,r){switch(e.type){case"Point":return function(e,t,r){var n=VB(e.positions,t,r);if(n.length>1)return{type:"MultiPoint",coordinates:n};return{type:"Point",coordinates:n[0]}}(e,t,r);case"LineString":return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=e.positions,i=e.pathIndices.value.filter((function(e){return e>=t&&e<=r})),a=i.length>2;if(!a){var o=VB(n,i[0],i[1]);return{type:"LineString",coordinates:o}}for(var s=[],u=0;u<i.length-1;u++){var c=VB(n,i[u],i[u+1]);s.push(c)}return{type:"MultiLineString",coordinates:s}}(e,t,r);case"Polygon":return function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,i=t.positions,a=t.polygonIndices.value.filter((function(e){return e>=r&&e<=n})),o=t.primitivePolygonIndices.value.filter((function(e){return e>=r&&e<=n})),s=a.length>2;if(!s){for(var u=[],c=0;c<o.length-1;c++){var l=o[c],f=o[c+1],h=VB(i,l,f);u.push(h)}return{type:"Polygon",coordinates:u}}for(var d=[],p=0;p<a.length-1;p++){var v=a[p],y=a[p+1],g=e(t,v,y).coordinates;d.push(g)}return{type:"MultiPolygon",coordinates:d}}(e,t,r);default:var n=e;throw new Error("Unsupported geometry type: ".concat(null==n?void 0:n.type))}}function HB(e,t){if(!Boolean(e.points||e.lines||e.polygons))return e.type=t||function(e){if(e.pathIndices)return"LineString";if(e.polygonIndices)return"Polygon";return"Point"}(e),[e];var r=[];return e.points&&(e.points.type="Point",r.push(e.points)),e.lines&&(e.lines.type="LineString",r.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",r.push(e.polygons)),r}function JB(e,t,r){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?DB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({type:"Feature",geometry:NB(e,t,r),properties:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=Object.assign({},e.properties[e.featureIds.value[t]]);for(var n in e.numericProps)r[n]=e.numericProps[n].value[t];return r}(e,t,r)},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.fields&&e.fields[e.featureIds.value[t]]}(e,t,r))}function VB(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 zB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function KB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zB(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qB={Point:XB,MultiPoint:function(e,t,r){return QB(e,t,r)},LineString:WB,MultiLineString:function(e,t,r){return e.map((function(e){return WB(e,t,r)}))},Polygon:ZB,MultiPolygon:function(e,t,r){return e.map((function(e){return ZB(e,t,r)}))}};function XB(e,t,r){var n=M()(e,2),i=n[0],a=n[1],o=M()(t,2),s=o[0],u=o[1],c=ht(s[0],u[0],i),l=ht(s[1],u[1],a);return r.unprojectFlat([c,l])}function QB(e,t,r){return e.map((function(e){return XB(e,t,r)}))}function WB(e,t,r){return QB(e,t,r)}function ZB(e,t,r){return e.map((function(e){return QB(e,t,r)}))}function YB(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return $B(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $B(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function $B(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ew=["points","lines","polygons"];function tw(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=function(e,t){if(!e.__layers){for(var r={},n=e.properties,i=0;i<n.length;i++){var a=n[i].layerName;a&&(r[a]?r[a][1]=i:r[a]=[i,i])}e.__layers=r}return e.__layers[t]}(e,n);if(!s)return-1;a=s[0],o=s[1]+1}var u=-1;if(t in e.numericProps){var c=e.numericProps[t].value.findIndex((function(e,t){return e===r&&i[t]>=a&&i[t]<o}));return c>=0?e.globalFeatureIds.value[c]:-1}return t?u=rw(e.properties,(function(e){return e[t]===r}),a,o):e.fields&&(u=rw(e.fields,(function(e){return e.id===r}),a,o)),u>=0?function(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]}(e,u):-1}function rw(e,t,r,n){for(var i=r;i<n;i++)if(t(e[i],i))return i;return-1}function nw(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return iw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return iw(e,t)}(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function iw(e,t){(null==t||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){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}function ow(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ow(Object(r),!0).forEach((function(t){A()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ow(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var uw=sw(sw({},B.GeoJsonLayer.defaultProps),{},{onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[FB],binary:!0}),cw=function(e){p()(n,e);var t,r=aw(n);function n(){return h()(this,n),r.apply(this,arguments)}return C()(n,[{key:"initializeState",value:function(){li()(m()(n.prototype),"initializeState",this).call(this);var e=void 0===this.context.viewport.resolution&&this.props.binary;this.setState({binary:e,data:null,tileJSON:null})}},{key:"isLoaded",get:function(){return this.state&&this.state.data&&this.state.tileset&&li()(m()(n.prototype),"isLoaded",this)}},{key:"updateState",value:function(e){var t,r=e.props,i=e.oldProps,a=e.context,o=e.changeFlags;o.dataChanged&&this._updateTileData(),null!==(t=this.state)&&void 0!==t&&t.data&&(li()(m()(n.prototype),"updateState",this).call(this,{props:r,oldProps:i,context:a,changeFlags:o}),this._setWGS84PropertyForTiles());var s=r.highlightColor;s!==i.highlightColor&&Array.isArray(s)&&this.setState({highlightColor:s})}},{key:"_updateTileData",value:(t=Ie()(Pe.a.mark((function e(){var t,r,n,i,a;return Pe.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props.data,r=null,"string"!=typeof t||/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)){e.next=18;break}return n=this.props,i=n.onDataLoad,a=n.fetch,this.setState({data:null,tileJSON:null}),e.prev=5,e.next=8,a(t,{propName:"data",layer:this,loaders:[]});case 8:r=e.sent,e.next=15;break;case 11:e.prev=11,e.t0=e.catch(5),this.raiseError(e.t0,"loading TileJSON"),t=null;case 15:i&&i(r,{propName:"data",layer:this}),e.next=19;break;case 18:t.tilejson&&(r=t);case 19:r&&(t=r.tiles),this.setState({data:t,tileJSON:r});case 21:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return t.apply(this,arguments)})},{key:"_getTilesetOptions",value:function(){var e=li()(m()(n.prototype),"_getTilesetOptions",this).call(this),t=this.state.tileJSON,r=this.props,i=r.minZoom,a=r.maxZoom;return t&&(Number.isFinite(t.minzoom)&&t.minzoom>i&&(e.minZoom=t.minzoom),Number.isFinite(t.maxzoom)&&(!Number.isFinite(a)||t.maxzoom<a)&&(e.maxZoom=t.maxzoom)),e}},{key:"renderLayers",value:function(){var e;return null!==(e=this.state)&&void 0!==e&&e.data?li()(m()(n.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(e){var t,r=this.state,n=r.data,i=r.binary,a=e.index,o=e.signal,s=Fn(n,e);if(!s)return Promise.reject("Invalid URL");var u=this.getLoadOptions();return(0,this.props.fetch)(s,{propName:"data",layer:this,loadOptions:u=sw(sw({},u),{},{mimeType:"application/x-protobuf",mvt:sw(sw({},null===(t=u)||void 0===t?void 0:t.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:a}),gis:i?{format:"binary"}:{}}),signal:o})}},{key:"renderSubLayers",value:function(e){var t=e.tile.index,r=t.x,i=t.y,a=t.z,o=Math.pow(2,a),s=512/o,u=-s,c=512*r/o,l=512*(1-i/o),f=(new Zr).scale([s,u,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=f,e.coordinateOrigin=[c,l,0],e.coordinateSystem=B.COORDINATE_SYSTEM.CARTESIAN,e.extensions=[].concat(Le()(e.extensions||[]),[new B.ClipExtension]));var h=li()(m()(n.prototype),"renderSubLayers",this).call(this,e);return!this.state.binary||h instanceof B.GeoJsonLayer||B.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),h}},{key:"_updateAutoHighlight",value:function(e){var t,r,n=this.props.uniqueIdProperty,i=this.state,a=i.hoveredFeatureId,o=i.hoveredFeatureLayerName,s=e.object;s&&(t=lw(s,n),r=fw(s));var u=this.props.highlightColor;"function"==typeof u&&(u=u(e)),a===t&&o===r||this.setState({highlightColor:u,hoveredFeatureId:t,hoveredFeatureLayerName:r})}},{key:"getPickingInfo",value:function(e){var t=li()(m()(n.prototype),"getPickingInfo",this).call(this,e),r=Boolean(this.context.viewport.resolution);if(this.state.binary&&-1!==t.index){var i=e.sourceLayer.props.data;t.object=GB(i,{globalFeatureId:t.index})}return t.object&&!r&&(t.object=dw(t.object,t.tile.bbox,this.context.viewport)),t}},{key:"getSubLayerPropsByTile",value:function(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}},{key:"getHighlightedObjectIndex",value:function(e){var t=this.state,r=t.hoveredFeatureId,n=t.hoveredFeatureLayerName,i=t.binary,a=this.props,o=a.uniqueIdProperty,s=a.highlightedFeatureId,u=e.content,c=hw(s);if(!(hw(r)||c))return-1;var l=c?s:r;return Array.isArray(u)?u.findIndex((function(e){var t=lw(e,o)===l,r=c||fw(e)===n;return t&&r})):u&&i?function(e,t,r,n){var i,a=YB(ew);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e[o]&&tw(e[o],t,r,n);if(s>=0)return s}}catch(e){a.e(e)}finally{a.f()}return-1}(u,o,l,c?"":n):-1}},{key:"_pickObjects",value:function(e){var t=this.context,r=t.deck,n=t.viewport,i=n.width,a=n.height,o=n.x,s=n.y,u=[this.id];return r.pickObjects({x:o,y:s,width:i,height:a,layerIds:u,maxObjects:e})}},{key:"getRenderedFeatures",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=this._pickObjects(t),n=new Set,i=[],a=nw(r);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=lw(o.object,this.props.uniqueIdProperty);void 0===s?i.push(o.object):n.has(s)||(n.add(s),i.push(o.object))}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"_setWGS84PropertyForTiles",value:function(){var e=this;this.state.tileset.selectedTiles.forEach((function(t){t.hasOwnProperty("dataInWGS84")||Object.defineProperty(t,"dataInWGS84",{get:function(){if(!t.content)return null;if(e.state.binary&&Array.isArray(t.content)&&!t.content.length)return[];var r,n=t.bbox;if(void 0===t._contentWGS84&&(r=n,Number.isFinite(r.west)&&Number.isFinite(r.north)&&Number.isFinite(r.east)&&Number.isFinite(r.south))){var i=e.state.binary?GB(t.content):t.content;t._contentWGS84=i.map((function(t){return dw(t,n,e.context.viewport)}))}return t._contentWGS84}})}))}}]),n}(ui);function lw(e,t){return e.properties&&t?e.properties[t]:"id"in e?e.id:void 0}function fw(e){var t;return(null===(t=e.properties)||void 0===t?void 0:t.layerName)||null}function hw(e){return null!=e&&""!==e}function dw(e,t,r){var n=sw(sw({},e),{},{geometry:{type:e.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){return function(e,t,r){var n=[r.projectFlat([t.west,t.north]),r.projectFlat([t.east,t.south])];return KB(KB({},e),{},{coordinates:qB[e.type](e.coordinates,n,r)})}(e.geometry,t,r).coordinates}}),n}A()(cw,"layerName","MVTLayer"),A()(cw,"defaultProps",uw);for(var pw={},vw=0;vw<"0123456789bcdefghjkmnpqrstuvwxyz".length;vw++)pw["0123456789bcdefghjkmnpqrstuvwxyz".charAt(vw)]=vw;function yw(e){var t=function(e){for(var t,r=!0,n=90,i=-90,a=180,o=-180,s=0,u=0,c=e.length;u<c;u++){var l=e[u].toLowerCase();s=pw[l];for(var f=4;f>=0;f--){var h=s>>f&1;r?(t=(a+o)/2,1===h?o=t:a=t):(t=(n+i)/2,1===h?i=t:n=t),r=!r}}return[i,o,n,a]}(e),r=M()(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 gw(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m()(e);if(t){var i=m()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return y()(this,r)}}var mw=function(e){p()(r,e);var t=gw(r);function r(){return h()(this,r),t.apply(this,arguments)}return C()(r,[{key:"indexToBounds",value:function(){var e=this.props,t=e.data,r=e.getGeohash;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:function(e,t){return yw(r(e,t))}}}}]),r}(S);A()(mw,"layerName","GeohashLayer"),A()(mw,"defaultProps",{getGeohash:{type:"accessor",value:function(e){return e.geohash}}}),r.d(t,"GreatCircleLayer",(function(){return _})),r.d(t,"S2Layer",(function(){return J})),r.d(t,"QuadkeyLayer",(function(){return ke})),r.d(t,"TileLayer",(function(){return ui})),r.d(t,"TripsLayer",(function(){return pi})),r.d(t,"H3ClusterLayer",(function(){return Pi})),r.d(t,"H3HexagonLayer",(function(){return ki})),r.d(t,"Tile3DLayer",(function(){return rA})),r.d(t,"TerrainLayer",(function(){return fA})),r.d(t,"MVTLayer",(function(){return cw})),r.d(t,"GeohashLayer",(function(){return mw})),r.d(t,"_GeoCellLayer",(function(){return S})),r.d(t,"_getURLFromTemplate",(function(){return Fn})),r.d(t,"_Tileset2D",(function(){return ti})),r.d(t,"_Tile2DHeader",(function(){return Fe}))}])}));
1
+ "use strict";var deck=(()=>{var ZB=Object.create;var Ki=Object.defineProperty;var e2=Object.getOwnPropertyDescriptor;var r2=Object.getOwnPropertyNames;var t2=Object.getPrototypeOf,n2=Object.prototype.hasOwnProperty;var rv=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var ne=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Cr=(r,t)=>{for(var e in t)Ki(r,e,{get:t[e],enumerable:!0})},Xi=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of r2(t))!n2.call(r,a)&&a!==e&&Ki(r,a,{get:()=>t[a],enumerable:!(n=e2(t,a))||n.enumerable});return r},At=(r,t,e)=>(Xi(r,t,"default"),e&&Xi(e,t,"default")),m=(r,t,e)=>(e=r!=null?ZB(t2(r)):{},Xi(t||!r||!r.__esModule?Ki(e,"default",{value:r,enumerable:!0}):e,r)),a2=r=>Xi(Ki({},"__esModule",{value:!0}),r);var Dr=ne((IU,tv)=>{tv.exports=globalThis.deck});var V=ne((FU,av)=>{function i2(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}av.exports=i2});var Zu=ne((LU,$u)=>{function Qu(r,t){return $u.exports=Qu=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},Qu(r,t)}$u.exports=Qu});var Ie=ne((kU,iv)=>{var o2=Zu();function s2(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),t&&o2(r,t)}iv.exports=s2});var Re=ne((DU,Qi)=>{function Yi(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qi.exports=Yi=function(e){return typeof e}:Qi.exports=Yi=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yi(r)}Qi.exports=Yi});var Br=ne((GU,ov)=>{function u2(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}ov.exports=u2});var Fe=ne((UU,sv)=>{var f2=Re(),l2=Br();function c2(r,t){return t&&(f2(t)==="object"||typeof t=="function")?t:l2(r)}sv.exports=c2});var Be=ne((NU,rf)=>{function ef(r){return rf.exports=ef=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ef(r)}rf.exports=ef});var W=ne((jU,uv)=>{function h2(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}uv.exports=h2});var z=ne((HU,pv)=>{function dv(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function v2(r,t,e){return t&&dv(r.prototype,t),e&&dv(r,e),r}pv.exports=v2});var Ur=ne((zU,mv)=>{mv.exports=globalThis.deck});var xv=ne((JU,Tv)=>{function _2(r){if(Array.isArray(r))return r}Tv.exports=_2});var Sv=ne((qU,Ev)=>{function T2(r,t){if(Symbol.iterator in Object(r)||Object.prototype.toString.call(r)==="[object Arguments]"){var e=[],n=!0,a=!1,i=void 0;try{for(var o=r[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(e.push(s.value),!(t&&e.length===t));n=!0);}catch(u){a=!0,i=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(a)throw i}}return e}}Ev.exports=T2});var Cv=ne((XU,wv)=>{function x2(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}wv.exports=x2});var ge=ne((KU,Bv)=>{var E2=xv(),S2=Sv(),w2=Cv();function C2(r,t){return E2(r)||S2(r,t)||w2()}Bv.exports=C2});var sf=ne((Mv,Ca)=>{(function(r,t){typeof define=="function"&&define.amd?define([],t):typeof rv=="function"&&typeof Ca=="object"&&Ca&&Ca.exports?Ca.exports=t():(r.dcodeIO=r.dcodeIO||{}).Long=t()})(Mv,function(){"use strict";function r(S,b,R){this.low=S|0,this.high=b|0,this.unsigned=!!R}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function t(S){return(S&&S.__isLong__)===!0}r.isLong=t;var e={},n={};function a(S,b){var R,F,N;return b?(S>>>=0,(N=0<=S&&S<256)&&(F=n[S],F)?F:(R=o(S,(S|0)<0?-1:0,!0),N&&(n[S]=R),R)):(S|=0,(N=-128<=S&&S<128)&&(F=e[S],F)?F:(R=o(S,S<0?-1:0,!1),N&&(e[S]=R),R))}r.fromInt=a;function i(S,b){if(isNaN(S)||!isFinite(S))return b?A:y;if(b){if(S<0)return A;if(S>=d)return P}else{if(S<=-p)return L;if(S+1>=p)return C}return S<0?i(-S,b).neg():o(S%h|0,S/h|0,b)}r.fromNumber=i;function o(S,b,R){return new r(S,b,R)}r.fromBits=o;var s=Math.pow;function u(S,b,R){if(S.length===0)throw Error("empty string");if(S==="NaN"||S==="Infinity"||S==="+Infinity"||S==="-Infinity")return y;if(typeof b=="number"?(R=b,b=!1):b=!!b,R=R||10,R<2||36<R)throw RangeError("radix");var F;if((F=S.indexOf("-"))>0)throw Error("interior hyphen");if(F===0)return u(S.substring(1),b,R).neg();for(var N=i(s(R,8)),k=y,B=0;B<S.length;B+=8){var O=Math.min(8,S.length-B),I=parseInt(S.substring(B,B+O),R);if(O<8){var U=i(s(R,O));k=k.mul(U).add(i(I))}else k=k.mul(N),k=k.add(i(I))}return k.unsigned=b,k}r.fromString=u;function f(S){return S instanceof r?S:typeof S=="number"?i(S):typeof S=="string"?u(S):o(S.low,S.high,S.unsigned)}r.fromValue=f;var l=1<<16,c=1<<24,h=l*l,d=h*h,p=d/2,v=a(c),y=a(0);r.ZERO=y;var A=a(0,!0);r.UZERO=A;var _=a(1);r.ONE=_;var E=a(1,!0);r.UONE=E;var x=a(-1);r.NEG_ONE=x;var C=o(-1,2147483647,!1);r.MAX_VALUE=C;var P=o(-1,-1,!0);r.MAX_UNSIGNED_VALUE=P;var L=o(0,-2147483648,!1);r.MIN_VALUE=L;var M=r.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(b){if(b=b||10,b<2||36<b)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(L)){var R=i(b),F=this.div(R),N=F.mul(R).sub(this);return F.toString(b)+N.toInt().toString(b)}else return"-"+this.neg().toString(b);for(var k=i(s(b,6),this.unsigned),B=this,O="";;){var I=B.div(k),U=B.sub(I.mul(k)).toInt()>>>0,D=U.toString(b);if(B=I,B.isZero())return D+O;for(;D.length<6;)D="0"+D;O=""+D+O}},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(L)?64:this.neg().getNumBitsAbs();for(var b=this.high!=0?this.high:this.low,R=31;R>0&&!(b&1<<R);R--);return this.high!=0?R+33:R+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(b){return t(b)||(b=f(b)),this.unsigned!==b.unsigned&&this.high>>>31===1&&b.high>>>31===1?!1:this.high===b.high&&this.low===b.low},M.eq=M.equals,M.notEquals=function(b){return!this.eq(b)},M.neq=M.notEquals,M.lessThan=function(b){return this.comp(b)<0},M.lt=M.lessThan,M.lessThanOrEqual=function(b){return this.comp(b)<=0},M.lte=M.lessThanOrEqual,M.greaterThan=function(b){return this.comp(b)>0},M.gt=M.greaterThan,M.greaterThanOrEqual=function(b){return this.comp(b)>=0},M.gte=M.greaterThanOrEqual,M.compare=function(b){if(t(b)||(b=f(b)),this.eq(b))return 0;var R=this.isNegative(),F=b.isNegative();return R&&!F?-1:!R&&F?1:this.unsigned?b.high>>>0>this.high>>>0||b.high===this.high&&b.low>>>0>this.low>>>0?-1:1:this.sub(b).isNegative()?-1:1},M.comp=M.compare,M.negate=function(){return!this.unsigned&&this.eq(L)?L:this.not().add(_)},M.neg=M.negate,M.add=function(b){t(b)||(b=f(b));var R=this.high>>>16,F=this.high&65535,N=this.low>>>16,k=this.low&65535,B=b.high>>>16,O=b.high&65535,I=b.low>>>16,U=b.low&65535,D=0,j=0,X=0,te=0;return te+=k+U,X+=te>>>16,te&=65535,X+=N+I,j+=X>>>16,X&=65535,j+=F+O,D+=j>>>16,j&=65535,D+=R+B,D&=65535,o(X<<16|te,D<<16|j,this.unsigned)},M.subtract=function(b){return t(b)||(b=f(b)),this.add(b.neg())},M.sub=M.subtract,M.multiply=function(b){if(this.isZero()||(t(b)||(b=f(b)),b.isZero()))return y;if(this.eq(L))return b.isOdd()?L:y;if(b.eq(L))return this.isOdd()?L:y;if(this.isNegative())return b.isNegative()?this.neg().mul(b.neg()):this.neg().mul(b).neg();if(b.isNegative())return this.mul(b.neg()).neg();if(this.lt(v)&&b.lt(v))return i(this.toNumber()*b.toNumber(),this.unsigned);var R=this.high>>>16,F=this.high&65535,N=this.low>>>16,k=this.low&65535,B=b.high>>>16,O=b.high&65535,I=b.low>>>16,U=b.low&65535,D=0,j=0,X=0,te=0;return te+=k*U,X+=te>>>16,te&=65535,X+=N*U,j+=X>>>16,X&=65535,X+=k*I,j+=X>>>16,X&=65535,j+=F*U,D+=j>>>16,j&=65535,j+=N*I,D+=j>>>16,j&=65535,j+=k*O,D+=j>>>16,j&=65535,D+=R*U+F*I+N*O+k*B,D&=65535,o(X<<16|te,D<<16|j,this.unsigned)},M.mul=M.multiply,M.divide=function(b){if(t(b)||(b=f(b)),b.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?A:y;var R,F,N;if(this.unsigned){if(b.unsigned||(b=b.toUnsigned()),b.gt(this))return A;if(b.gt(this.shru(1)))return E;N=A}else{if(this.eq(L)){if(b.eq(_)||b.eq(x))return L;if(b.eq(L))return _;var k=this.shr(1);return R=k.div(b).shl(1),R.eq(y)?b.isNegative()?_:x:(F=this.sub(b.mul(R)),N=R.add(F.div(b)),N)}else if(b.eq(L))return this.unsigned?A:y;if(this.isNegative())return b.isNegative()?this.neg().div(b.neg()):this.neg().div(b).neg();if(b.isNegative())return this.div(b.neg()).neg();N=y}for(F=this;F.gte(b);){R=Math.max(1,Math.floor(F.toNumber()/b.toNumber()));for(var B=Math.ceil(Math.log(R)/Math.LN2),O=B<=48?1:s(2,B-48),I=i(R),U=I.mul(b);U.isNegative()||U.gt(F);)R-=O,I=i(R,this.unsigned),U=I.mul(b);I.isZero()&&(I=_),N=N.add(I),F=F.sub(U)}return N},M.div=M.divide,M.modulo=function(b){return t(b)||(b=f(b)),this.sub(this.div(b).mul(b))},M.mod=M.modulo,M.not=function(){return o(~this.low,~this.high,this.unsigned)},M.and=function(b){return t(b)||(b=f(b)),o(this.low&b.low,this.high&b.high,this.unsigned)},M.or=function(b){return t(b)||(b=f(b)),o(this.low|b.low,this.high|b.high,this.unsigned)},M.xor=function(b){return t(b)||(b=f(b)),o(this.low^b.low,this.high^b.high,this.unsigned)},M.shiftLeft=function(b){return t(b)&&(b=b.toInt()),(b&=63)===0?this:b<32?o(this.low<<b,this.high<<b|this.low>>>32-b,this.unsigned):o(0,this.low<<b-32,this.unsigned)},M.shl=M.shiftLeft,M.shiftRight=function(b){return t(b)&&(b=b.toInt()),(b&=63)===0?this:b<32?o(this.low>>>b|this.high<<32-b,this.high>>b,this.unsigned):o(this.high>>b-32,this.high>=0?0:-1,this.unsigned)},M.shr=M.shiftRight,M.shiftRightUnsigned=function(b){if(t(b)&&(b=b.toInt()),b&=63,b===0)return this;var R=this.high;if(b<32){var F=this.low;return o(F>>>b|R<<32-b,R>>>b,this.unsigned)}else return b===32?o(R,0,this.unsigned):o(R>>>b-32,0,this.unsigned)},M.shru=M.shiftRightUnsigned,M.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},M.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},M.toBytes=function(S){return S?this.toBytesLE():this.toBytesBE()},M.toBytesLE=function(){var S=this.high,b=this.low;return[b&255,b>>>8&255,b>>>16&255,b>>>24&255,S&255,S>>>8&255,S>>>16&255,S>>>24&255]},M.toBytesBE=function(){var S=this.high,b=this.low;return[S>>>24&255,S>>>16&255,S>>>8&255,S&255,b>>>24&255,b>>>16&255,b>>>8&255,b&255]},r})});var K=ne((P8,Rg)=>{function Ig(r,t,e,n,a,i,o){try{var s=r[i](o),u=s.value}catch(f){e(f);return}s.done?t(u):Promise.resolve(u).then(n,a)}function nM(r){return function(){var t=this,e=arguments;return new Promise(function(n,a){var i=r.apply(t,e);function o(u){Ig(i,n,a,o,s,"next",u)}function s(u){Ig(i,n,a,o,s,"throw",u)}o(void 0)})}}Rg.exports=nM});var Lg=ne((I8,Lf)=>{var Fg=function(r){"use strict";var t=Object.prototype,e=t.hasOwnProperty,n,a=typeof Symbol=="function"?Symbol:{},i=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(B,O,I,U){var D=O&&O.prototype instanceof v?O:v,j=Object.create(D.prototype),X=new F(U||[]);return j._invoke=M(B,I,X),j}r.wrap=u;function f(B,O,I){try{return{type:"normal",arg:B.call(O,I)}}catch(U){return{type:"throw",arg:U}}}var l="suspendedStart",c="suspendedYield",h="executing",d="completed",p={};function v(){}function y(){}function A(){}var _={};_[i]=function(){return this};var E=Object.getPrototypeOf,x=E&&E(E(N([])));x&&x!==t&&e.call(x,i)&&(_=x);var C=A.prototype=v.prototype=Object.create(_);y.prototype=C.constructor=A,A.constructor=y,A[s]=y.displayName="GeneratorFunction";function P(B){["next","throw","return"].forEach(function(O){B[O]=function(I){return this._invoke(O,I)}})}r.isGeneratorFunction=function(B){var O=typeof B=="function"&&B.constructor;return O?O===y||(O.displayName||O.name)==="GeneratorFunction":!1},r.mark=function(B){return Object.setPrototypeOf?Object.setPrototypeOf(B,A):(B.__proto__=A,s in B||(B[s]="GeneratorFunction")),B.prototype=Object.create(C),B},r.awrap=function(B){return{__await:B}};function L(B){function O(D,j,X,te){var Pe=f(B[D],B,j);if(Pe.type==="throw")te(Pe.arg);else{var Ee=Pe.arg,rr=Ee.value;return rr&&typeof rr=="object"&&e.call(rr,"__await")?Promise.resolve(rr.__await).then(function(Ne){O("next",Ne,X,te)},function(Ne){O("throw",Ne,X,te)}):Promise.resolve(rr).then(function(Ne){Ee.value=Ne,X(Ee)},function(Ne){return O("throw",Ne,X,te)})}}var I;function U(D,j){function X(){return new Promise(function(te,Pe){O(D,j,te,Pe)})}return I=I?I.then(X,X):X()}this._invoke=U}P(L.prototype),L.prototype[o]=function(){return this},r.AsyncIterator=L,r.async=function(B,O,I,U){var D=new L(u(B,O,I,U));return r.isGeneratorFunction(O)?D:D.next().then(function(j){return j.done?j.value:D.next()})};function M(B,O,I){var U=l;return function(j,X){if(U===h)throw new Error("Generator is already running");if(U===d){if(j==="throw")throw X;return k()}for(I.method=j,I.arg=X;;){var te=I.delegate;if(te){var Pe=S(te,I);if(Pe){if(Pe===p)continue;return Pe}}if(I.method==="next")I.sent=I._sent=I.arg;else if(I.method==="throw"){if(U===l)throw U=d,I.arg;I.dispatchException(I.arg)}else I.method==="return"&&I.abrupt("return",I.arg);U=h;var Ee=f(B,O,I);if(Ee.type==="normal"){if(U=I.done?d:c,Ee.arg===p)continue;return{value:Ee.arg,done:I.done}}else Ee.type==="throw"&&(U=d,I.method="throw",I.arg=Ee.arg)}}}function S(B,O){var I=B.iterator[O.method];if(I===n){if(O.delegate=null,O.method==="throw"){if(B.iterator.return&&(O.method="return",O.arg=n,S(B,O),O.method==="throw"))return p;O.method="throw",O.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var U=f(I,B.iterator,O.arg);if(U.type==="throw")return O.method="throw",O.arg=U.arg,O.delegate=null,p;var D=U.arg;if(!D)return O.method="throw",O.arg=new TypeError("iterator result is not an object"),O.delegate=null,p;if(D.done)O[B.resultName]=D.value,O.next=B.nextLoc,O.method!=="return"&&(O.method="next",O.arg=n);else return D;return O.delegate=null,p}P(C),C[s]="Generator",C[i]=function(){return this},C.toString=function(){return"[object Generator]"};function b(B){var O={tryLoc:B[0]};1 in B&&(O.catchLoc=B[1]),2 in B&&(O.finallyLoc=B[2],O.afterLoc=B[3]),this.tryEntries.push(O)}function R(B){var O=B.completion||{};O.type="normal",delete O.arg,B.completion=O}function F(B){this.tryEntries=[{tryLoc:"root"}],B.forEach(b,this),this.reset(!0)}r.keys=function(B){var O=[];for(var I in B)O.push(I);return O.reverse(),function U(){for(;O.length;){var D=O.pop();if(D in B)return U.value=D,U.done=!1,U}return U.done=!0,U}};function N(B){if(B){var O=B[i];if(O)return O.call(B);if(typeof B.next=="function")return B;if(!isNaN(B.length)){var I=-1,U=function D(){for(;++I<B.length;)if(e.call(B,I))return D.value=B[I],D.done=!1,D;return D.value=n,D.done=!0,D};return U.next=U}}return{next:k}}r.values=N;function k(){return{value:n,done:!0}}return F.prototype={constructor:F,reset:function(B){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(R),!B)for(var O in this)O.charAt(0)==="t"&&e.call(this,O)&&!isNaN(+O.slice(1))&&(this[O]=n)},stop:function(){this.done=!0;var B=this.tryEntries[0],O=B.completion;if(O.type==="throw")throw O.arg;return this.rval},dispatchException:function(B){if(this.done)throw B;var O=this;function I(Pe,Ee){return j.type="throw",j.arg=B,O.next=Pe,Ee&&(O.method="next",O.arg=n),!!Ee}for(var U=this.tryEntries.length-1;U>=0;--U){var D=this.tryEntries[U],j=D.completion;if(D.tryLoc==="root")return I("end");if(D.tryLoc<=this.prev){var X=e.call(D,"catchLoc"),te=e.call(D,"finallyLoc");if(X&&te){if(this.prev<D.catchLoc)return I(D.catchLoc,!0);if(this.prev<D.finallyLoc)return I(D.finallyLoc)}else if(X){if(this.prev<D.catchLoc)return I(D.catchLoc,!0)}else if(te){if(this.prev<D.finallyLoc)return I(D.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(B,O){for(var I=this.tryEntries.length-1;I>=0;--I){var U=this.tryEntries[I];if(U.tryLoc<=this.prev&&e.call(U,"finallyLoc")&&this.prev<U.finallyLoc){var D=U;break}}D&&(B==="break"||B==="continue")&&D.tryLoc<=O&&O<=D.finallyLoc&&(D=null);var j=D?D.completion:{};return j.type=B,j.arg=O,D?(this.method="next",this.next=D.finallyLoc,p):this.complete(j)},complete:function(B,O){if(B.type==="throw")throw B.arg;return B.type==="break"||B.type==="continue"?this.next=B.arg:B.type==="return"?(this.rval=this.arg=B.arg,this.method="return",this.next="end"):B.type==="normal"&&O&&(this.next=O),p},finish:function(B){for(var O=this.tryEntries.length-1;O>=0;--O){var I=this.tryEntries[O];if(I.finallyLoc===B)return this.complete(I.completion,I.afterLoc),R(I),p}},catch:function(B){for(var O=this.tryEntries.length-1;O>=0;--O){var I=this.tryEntries[O];if(I.tryLoc===B){var U=I.completion;if(U.type==="throw"){var D=U.arg;R(I)}return D}}throw new Error("illegal catch attempt")},delegateYield:function(B,O,I){return this.delegate={iterator:N(B),resultName:O,nextLoc:I},this.method==="next"&&(this.arg=n),p}},r}(typeof Lf=="object"?Lf.exports:{});try{regeneratorRuntime=Fg}catch{Function("r","regeneratorRuntime = r")(Fg)}});var J=ne((R8,kg)=>{kg.exports=Lg()});var Vf=ne((d6,ly)=>{function fM(r){var t;if(typeof Symbol<"u"&&(Symbol.asyncIterator&&(t=r[Symbol.asyncIterator],t!=null)||Symbol.iterator&&(t=r[Symbol.iterator],t!=null)))return t.call(r);throw new TypeError("Object is not async iterable")}ly.exports=fM});var cy=ne(()=>{});var al=ne((N6,Ay)=>{function vM(r){this.wrapped=r}Ay.exports=vM});var il=ne((j6,by)=>{var gM=al();function yM(r){return new gM(r)}by.exports=yM});var Ty=ne((V6,_y)=>{var AM=al();function Ua(r){var t,e;function n(o,s){return new Promise(function(u,f){var l={key:o,arg:s,resolve:u,reject:f,next:null};e?e=e.next=l:(t=e=l,a(o,s))})}function a(o,s){try{var u=r[o](s),f=u.value,l=f instanceof AM;Promise.resolve(l?f.wrapped:f).then(function(c){if(l){a(o==="return"?"return":"next",c);return}i(u.done?"return":"normal",c)},function(c){a("throw",c)})}catch(c){i("throw",c)}}function i(o,s){switch(o){case"return":t.resolve({value:s,done:!0});break;case"throw":t.reject(s);break;default:t.resolve({value:s,done:!1});break}t=t.next,t?a(t.key,t.arg):e=null}this._invoke=n,typeof r.return!="function"&&(this.return=void 0)}typeof Symbol=="function"&&Symbol.asyncIterator&&(Ua.prototype[Symbol.asyncIterator]=function(){return this});Ua.prototype.next=function(r){return this._invoke("next",r)};Ua.prototype.throw=function(r){return this._invoke("throw",r)};Ua.prototype.return=function(r){return this._invoke("return",r)};_y.exports=Ua});var ol=ne((H6,xy)=>{var bM=Ty();function _M(r){return function(){return new bM(r.apply(this,arguments))}}xy.exports=_M});var v0=ne((Vj,m0)=>{function dO(r){if(Array.isArray(r)){for(var t=0,e=new Array(r.length);t<r.length;t++)e[t]=r[t];return e}}m0.exports=dO});var y0=ne((Hj,g0)=>{function pO(r){if(Symbol.iterator in Object(r)||Object.prototype.toString.call(r)==="[object Arguments]")return Array.from(r)}g0.exports=pO});var b0=ne((zj,A0)=>{function mO(){throw new TypeError("Invalid attempt to spread non-iterable instance")}A0.exports=mO});var lr=ne((Wj,_0)=>{var vO=v0(),gO=y0(),yO=b0();function AO(r){return vO(r)||gO(r)||yO()}_0.exports=AO});var a1=ne((n5,n1)=>{var hP=Be();function dP(r,t){for(;!Object.prototype.hasOwnProperty.call(r,t)&&(r=hP(r),r!==null););return r}n1.exports=dP});var $n=ne((a5,Xo)=>{var pP=a1();function qo(r,t,e){return typeof Reflect<"u"&&Reflect.get?Xo.exports=qo=Reflect.get:Xo.exports=qo=function(a,i,o){var s=pP(a,i);if(s){var u=Object.getOwnPropertyDescriptor(s,i);return u.get?u.get.call(o):u.value}},qo(r,t,e||r)}Xo.exports=qo});var Xl=ne((o5,h1)=>{h1.exports=globalThis.h3||{}});var Zl=ne((h5,P1)=>{P1.exports=globalThis.luma});var rs=ne((d5,I1)=>{I1.exports=globalThis.deck});var bA=ne((vW,vs)=>{var EI=Zu();function SI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function ms(r,t,e){return SI()?vs.exports=ms=Reflect.construct:vs.exports=ms=function(a,i,o){var s=[null];s.push.apply(s,i);var u=Function.bind.apply(a,s),f=new u;return o&&EI(f,o.prototype),f},ms.apply(null,arguments)}vs.exports=ms});var vC=ne((vre,mC)=>{mC.exports=globalThis.deck});var UC=ne(Gm=>{Gm.read=function(r,t,e,n,a){var i,o,s=a*8-n-1,u=(1<<s)-1,f=u>>1,l=-7,c=e?a-1:0,h=e?-1:1,d=r[t+c];for(c+=h,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=i*256+r[t+c],c+=h,l-=8);for(o=i&(1<<-l)-1,i>>=-l,l+=n;l>0;o=o*256+r[t+c],c+=h,l-=8);if(i===0)i=1-f;else{if(i===u)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),i=i-f}return(d?-1:1)*o*Math.pow(2,i-n)};Gm.write=function(r,t,e,n,a,i){var o,s,u,f=i*8-a-1,l=(1<<f)-1,c=l>>1,h=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,v=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=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+c>=1?t+=h/u:t+=h*Math.pow(2,1-c),t*u>=2&&(o++,u/=2),o+c>=l?(s=0,o=l):o+c>=1?(s=(t*u-1)*Math.pow(2,a),o=o+c):(s=t*Math.pow(2,c-1)*Math.pow(2,a),o=0));a>=8;r[e+d]=s&255,d+=p,s/=256,a-=8);for(o=o<<a|s,f+=a;f>0;r[e+d]=o&255,d+=p,o/=256,f-=8);r[e+d-p]|=v*128}});var WC=ne((nte,zC)=>{"use strict";zC.exports=pe;var Vu=UC();function pe(r){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(r)?r:new Uint8Array(r||0),this.pos=0,this.type=0,this.length=this.buf.length}pe.Varint=0;pe.Fixed64=1;pe.Bytes=2;pe.Fixed32=5;var Um=(1<<16)*(1<<16),NC=1/Um,EG=12,HC=typeof TextDecoder>"u"?null:new TextDecoder("utf8");pe.prototype={destroy:function(){this.buf=null},readFields:function(r,t,e){for(e=e||this.length;this.pos<e;){var n=this.readVarint(),a=n>>3,i=this.pos;this.type=n&7,r(a,t,this),this.pos===i&&this.skip(n)}return t},readMessage:function(r,t){return this.readFields(r,t,this.readVarint()+this.pos)},readFixed32:function(){var r=Hu(this.buf,this.pos);return this.pos+=4,r},readSFixed32:function(){var r=VC(this.buf,this.pos);return this.pos+=4,r},readFixed64:function(){var r=Hu(this.buf,this.pos)+Hu(this.buf,this.pos+4)*Um;return this.pos+=8,r},readSFixed64:function(){var r=Hu(this.buf,this.pos)+VC(this.buf,this.pos+4)*Um;return this.pos+=8,r},readFloat:function(){var r=Vu.read(this.buf,this.pos,!0,23,4);return this.pos+=4,r},readDouble:function(){var r=Vu.read(this.buf,this.pos,!0,52,8);return this.pos+=8,r},readVarint:function(r){var t=this.buf,e,n;return n=t[this.pos++],e=n&127,n<128||(n=t[this.pos++],e|=(n&127)<<7,n<128)||(n=t[this.pos++],e|=(n&127)<<14,n<128)||(n=t[this.pos++],e|=(n&127)<<21,n<128)?e:(n=t[this.pos],e|=(n&15)<<28,SG(e,r,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var r=this.readVarint();return r%2===1?(r+1)/-2:r/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var r=this.readVarint()+this.pos,t=this.pos;return this.pos=r,r-t>=EG&&HC?UG(this.buf,t,r):GG(this.buf,t,r)},readBytes:function(){var r=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,r);return this.pos=r,t},readPackedVarint:function(r,t){if(this.type!==pe.Bytes)return r.push(this.readVarint(t));var e=gt(this);for(r=r||[];this.pos<e;)r.push(this.readVarint(t));return r},readPackedSVarint:function(r){if(this.type!==pe.Bytes)return r.push(this.readSVarint());var t=gt(this);for(r=r||[];this.pos<t;)r.push(this.readSVarint());return r},readPackedBoolean:function(r){if(this.type!==pe.Bytes)return r.push(this.readBoolean());var t=gt(this);for(r=r||[];this.pos<t;)r.push(this.readBoolean());return r},readPackedFloat:function(r){if(this.type!==pe.Bytes)return r.push(this.readFloat());var t=gt(this);for(r=r||[];this.pos<t;)r.push(this.readFloat());return r},readPackedDouble:function(r){if(this.type!==pe.Bytes)return r.push(this.readDouble());var t=gt(this);for(r=r||[];this.pos<t;)r.push(this.readDouble());return r},readPackedFixed32:function(r){if(this.type!==pe.Bytes)return r.push(this.readFixed32());var t=gt(this);for(r=r||[];this.pos<t;)r.push(this.readFixed32());return r},readPackedSFixed32:function(r){if(this.type!==pe.Bytes)return r.push(this.readSFixed32());var t=gt(this);for(r=r||[];this.pos<t;)r.push(this.readSFixed32());return r},readPackedFixed64:function(r){if(this.type!==pe.Bytes)return r.push(this.readFixed64());var t=gt(this);for(r=r||[];this.pos<t;)r.push(this.readFixed64());return r},readPackedSFixed64:function(r){if(this.type!==pe.Bytes)return r.push(this.readSFixed64());var t=gt(this);for(r=r||[];this.pos<t;)r.push(this.readSFixed64());return r},skip:function(r){var t=r&7;if(t===pe.Varint)for(;this.buf[this.pos++]>127;);else if(t===pe.Bytes)this.pos=this.readVarint()+this.pos;else if(t===pe.Fixed32)this.pos+=4;else if(t===pe.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(r,t){this.writeVarint(r<<3|t)},realloc:function(r){for(var t=this.length||16;t<this.pos+r;)t*=2;if(t!==this.length){var e=new Uint8Array(t);e.set(this.buf),this.buf=e,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(r){this.realloc(4),wa(this.buf,r,this.pos),this.pos+=4},writeSFixed32:function(r){this.realloc(4),wa(this.buf,r,this.pos),this.pos+=4},writeFixed64:function(r){this.realloc(8),wa(this.buf,r&-1,this.pos),wa(this.buf,Math.floor(r*NC),this.pos+4),this.pos+=8},writeSFixed64:function(r){this.realloc(8),wa(this.buf,r&-1,this.pos),wa(this.buf,Math.floor(r*NC),this.pos+4),this.pos+=8},writeVarint:function(r){if(r=+r||0,r>268435455||r<0){wG(r,this);return}this.realloc(4),this.buf[this.pos++]=r&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=(r>>>=7)&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=(r>>>=7)&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=r>>>7&127)))},writeSVarint:function(r){this.writeVarint(r<0?-r*2-1:r*2)},writeBoolean:function(r){this.writeVarint(Boolean(r))},writeString:function(r){r=String(r),this.realloc(r.length*4),this.pos++;var t=this.pos;this.pos=NG(this.buf,r,this.pos);var e=this.pos-t;e>=128&&jC(t,e,this),this.pos=t-1,this.writeVarint(e),this.pos+=e},writeFloat:function(r){this.realloc(4),Vu.write(this.buf,r,this.pos,!0,23,4),this.pos+=4},writeDouble:function(r){this.realloc(8),Vu.write(this.buf,r,this.pos,!0,52,8),this.pos+=8},writeBytes:function(r){var t=r.length;this.writeVarint(t),this.realloc(t);for(var e=0;e<t;e++)this.buf[this.pos++]=r[e]},writeRawMessage:function(r,t){this.pos++;var e=this.pos;r(t,this);var n=this.pos-e;n>=128&&jC(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeMessage:function(r,t,e){this.writeTag(r,pe.Bytes),this.writeRawMessage(t,e)},writePackedVarint:function(r,t){t.length&&this.writeMessage(r,MG,t)},writePackedSVarint:function(r,t){t.length&&this.writeMessage(r,OG,t)},writePackedBoolean:function(r,t){t.length&&this.writeMessage(r,RG,t)},writePackedFloat:function(r,t){t.length&&this.writeMessage(r,PG,t)},writePackedDouble:function(r,t){t.length&&this.writeMessage(r,IG,t)},writePackedFixed32:function(r,t){t.length&&this.writeMessage(r,FG,t)},writePackedSFixed32:function(r,t){t.length&&this.writeMessage(r,LG,t)},writePackedFixed64:function(r,t){t.length&&this.writeMessage(r,kG,t)},writePackedSFixed64:function(r,t){t.length&&this.writeMessage(r,DG,t)},writeBytesField:function(r,t){this.writeTag(r,pe.Bytes),this.writeBytes(t)},writeFixed32Field:function(r,t){this.writeTag(r,pe.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(r,t){this.writeTag(r,pe.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(r,t){this.writeTag(r,pe.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(r,t){this.writeTag(r,pe.Fixed64),this.writeSFixed64(t)},writeVarintField:function(r,t){this.writeTag(r,pe.Varint),this.writeVarint(t)},writeSVarintField:function(r,t){this.writeTag(r,pe.Varint),this.writeSVarint(t)},writeStringField:function(r,t){this.writeTag(r,pe.Bytes),this.writeString(t)},writeFloatField:function(r,t){this.writeTag(r,pe.Fixed32),this.writeFloat(t)},writeDoubleField:function(r,t){this.writeTag(r,pe.Fixed64),this.writeDouble(t)},writeBooleanField:function(r,t){this.writeVarintField(r,Boolean(t))}};function SG(r,t,e){var n=e.buf,a,i;if(i=n[e.pos++],a=(i&112)>>4,i<128||(i=n[e.pos++],a|=(i&127)<<3,i<128)||(i=n[e.pos++],a|=(i&127)<<10,i<128)||(i=n[e.pos++],a|=(i&127)<<17,i<128)||(i=n[e.pos++],a|=(i&127)<<24,i<128)||(i=n[e.pos++],a|=(i&1)<<31,i<128))return Sa(r,a,t);throw new Error("Expected varint not more than 10 bytes")}function gt(r){return r.type===pe.Bytes?r.readVarint()+r.pos:r.pos+1}function Sa(r,t,e){return e?t*4294967296+(r>>>0):(t>>>0)*4294967296+(r>>>0)}function wG(r,t){var e,n;if(r>=0?(e=r%4294967296|0,n=r/4294967296|0):(e=~(-r%4294967296),n=~(-r/4294967296),e^4294967295?e=e+1|0:(e=0,n=n+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),CG(e,n,t),BG(n,t)}function CG(r,t,e){e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos]=r&127}function BG(r,t){var e=(r&7)<<4;t.buf[t.pos++]|=e|((r>>>=3)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127)))))}function jC(r,t,e){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));e.realloc(n);for(var a=e.pos-1;a>=r;a--)e.buf[a+n]=e.buf[a]}function MG(r,t){for(var e=0;e<r.length;e++)t.writeVarint(r[e])}function OG(r,t){for(var e=0;e<r.length;e++)t.writeSVarint(r[e])}function PG(r,t){for(var e=0;e<r.length;e++)t.writeFloat(r[e])}function IG(r,t){for(var e=0;e<r.length;e++)t.writeDouble(r[e])}function RG(r,t){for(var e=0;e<r.length;e++)t.writeBoolean(r[e])}function FG(r,t){for(var e=0;e<r.length;e++)t.writeFixed32(r[e])}function LG(r,t){for(var e=0;e<r.length;e++)t.writeSFixed32(r[e])}function kG(r,t){for(var e=0;e<r.length;e++)t.writeFixed64(r[e])}function DG(r,t){for(var e=0;e<r.length;e++)t.writeSFixed64(r[e])}function Hu(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16)+r[t+3]*16777216}function wa(r,t,e){r[e]=t,r[e+1]=t>>>8,r[e+2]=t>>>16,r[e+3]=t>>>24}function VC(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16)+(r[t+3]<<24)}function GG(r,t,e){for(var n="",a=t;a<e;){var i=r[a],o=null,s=i>239?4:i>223?3:i>191?2:1;if(a+s>e)break;var u,f,l;s===1?i<128&&(o=i):s===2?(u=r[a+1],(u&192)===128&&(o=(i&31)<<6|u&63,o<=127&&(o=null))):s===3?(u=r[a+1],f=r[a+2],(u&192)===128&&(f&192)===128&&(o=(i&15)<<12|(u&63)<<6|f&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):s===4&&(u=r[a+1],f=r[a+2],l=r[a+3],(u&192)===128&&(f&192)===128&&(l&192)===128&&(o=(i&15)<<18|(u&63)<<12|(f&63)<<6|l&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),a+=s}return n}function UG(r,t,e){return HC.decode(r.subarray(t,e))}function NG(r,t,e){for(var n=0,a,i;n<t.length;n++){if(a=t.charCodeAt(n),a>55295&&a<57344)if(i)if(a<56320){r[e++]=239,r[e++]=191,r[e++]=189,i=a;continue}else a=i-55296<<10|a-56320|65536,i=null;else{a>56319||n+1===t.length?(r[e++]=239,r[e++]=191,r[e++]=189):i=a;continue}else i&&(r[e++]=239,r[e++]=191,r[e++]=189,i=null);a<128?r[e++]=a:(a<2048?r[e++]=a>>6|192:(a<65536?r[e++]=a>>12|224:(r[e++]=a>>18|240,r[e++]=a>>12&63|128),r[e++]=a>>6&63|128),r[e++]=a&63|128)}return e}});var qi={};Cr(qi,{GeohashLayer:()=>Yu,GreatCircleLayer:()=>$i,H3ClusterLayer:()=>es,H3HexagonLayer:()=>on,MVTLayer:()=>Ku,QuadkeyLayer:()=>To,S2Layer:()=>ro,TerrainLayer:()=>Lu,Tile3DLayer:()=>wu,TileLayer:()=>nt,TripsLayer:()=>Qo,_GeoCellLayer:()=>Tr,_Tile2DHeader:()=>za,_Tileset2D:()=>Ya,_getURLFromTemplate:()=>Jr});var Gr={},nv=m(Dr());At(Gr,m(Dr()));if(!nv.GeoJsonLayer)throw new Error("@deck.gl/layers is not found");At(qi,Gr);var fv=m(V()),lv=m(Ie()),cv=m(Fe()),tf=m(Be()),nf=m(W()),hv=m(Dr());function d2(r){var t=p2();return function(){var n=(0,tf.default)(r),a;if(t){var i=(0,tf.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,cv.default)(this,a)}}function p2(){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}}var m2={getHeight:{type:"accessor",value:0},greatCircle:!0},$i=function(r){(0,lv.default)(e,r);var t=d2(e);function e(){return(0,fv.default)(this,e),t.apply(this,arguments)}return e}(hv.ArcLayer);(0,nf.default)($i,"layerName","GreatCircleLayer");(0,nf.default)($i,"defaultProps",m2);var Nv=m(V()),jv=m(z()),Vv=m(Ie()),Hv=m(Fe()),ff=m(Be()),lf=m(W());var gv=m(V()),yv=m(z()),Av=m(Ie()),bv=m(Fe()),af=m(Be()),Zi=m(W()),_v=m(Ur()),of=m(Dr());function g2(r){var t=y2();return function(){var n=(0,af.default)(r),a;if(t){var i=(0,af.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,bv.default)(this,a)}}function y2(){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 vv(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function A2(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?vv(Object(e),!0).forEach(function(n){(0,Zi.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):vv(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var b2=A2({},of.PolygonLayer.defaultProps),Tr=function(r){(0,Av.default)(e,r);var t=g2(e);function e(){return(0,gv.default)(this,e),t.apply(this,arguments)}return(0,yv.default)(e,[{key:"indexToBounds",value:function(){return null}},{key:"renderLayers",value:function(){var a=this.props,i=a.elevationScale,o=a.extruded,s=a.wireframe,u=a.filled,f=a.stroked,l=a.lineWidthUnits,c=a.lineWidthScale,h=a.lineWidthMinPixels,d=a.lineWidthMaxPixels,p=a.lineJointRounded,v=a.lineMiterLimit,y=a.lineDashJustified,A=a.getElevation,_=a.getFillColor,E=a.getLineColor,x=a.getLineWidth,C=this.props,P=C.updateTriggers,L=C.material,M=C.transitions,S=this.getSubLayerClass("cell",of.PolygonLayer);return new S({filled:u,wireframe:s,extruded:o,elevationScale:i,stroked:f,lineWidthUnits:l,lineWidthScale:c,lineWidthMinPixels:h,lineWidthMaxPixels:d,lineJointRounded:p,lineMiterLimit:v,lineDashJustified:y,material:L,transitions:M,getElevation:A,getFillColor:_,getLineColor:E,getLineWidth:x},this.getSubLayerProps({id:"cell",updateTriggers:P&&{getElevation:P.getElevation,getFillColor:P.getFillColor,getLineColor:P.getLineColor,getLineWidth:P.getLineWidth}}),this.indexToBounds())}}]),e}(_v.CompositeLayer);(0,Zi.default)(Tr,"layerName","GeoCellLayer");(0,Zi.default)(Tr,"defaultProps",b2);var uf=m(ge()),eo=m(sf()),B2=3,M2=30,O2=2*M2+1,Ov=180/Math.PI;function Iv(r,t,e){var n=1<<t;return[(r[0]+e[0])/n,(r[1]+e[1])/n]}function Pv(r){return r>=.5?1/3*(4*r*r-1):1/3*(1-4*(1-r)*(1-r))}function Rv(r){return[Pv(r[0]),Pv(r[1])]}function Fv(r,t){var e=(0,uf.default)(t,2),n=e[0],a=e[1];switch(r){case 0:return[1,n,a];case 1:return[-n,1,a];case 2:return[-n,-a,1];case 3:return[-1,-a,-n];case 4:return[a,-1,-n];case 5:return[a,n,-1];default:throw new Error("Invalid face")}}function Lv(r){var t=(0,uf.default)(r,3),e=t[0],n=t[1],a=t[2],i=Math.atan2(a,Math.sqrt(e*e+n*n)),o=Math.atan2(n,e);return[o*Ov,i*Ov]}function kv(r){for(var t=eo.default.fromString(r,!0,10).toString(2);t.length<B2+O2;)t="0"+t;for(var e=t.lastIndexOf("1"),n=t.substring(0,3),a=t.substring(3,e),i=a.length/2,o=eo.default.fromString(n,!0,2).toString(10),s=eo.default.fromString(a,!0,2).toString(4);s.length<i;)s="0"+s;return"".concat(o,"/").concat(s)}function P2(r,t,e,n){if(n===0){e===1&&(t[0]=r-1-t[0],t[1]=r-1-t[1]);var a=t[0];t[0]=t[1],t[1]=a}}function Dv(r){for(var t=r.split("/"),e=parseInt(t[0],10),n=t[1],a=n.length,i=[0,0],o,s=a-1;s>=0;s--){o=a-s;var u=n[s],f=0,l=0;u==="1"?l=1:u==="2"?(f=1,l=1):u==="3"&&(f=1);var c=Math.pow(2,o-1);P2(c,i,f,l),i[0]+=c*f,i[1]+=c*l}if(e%2===1){var h=i[0];i[0]=i[1],i[1]=h}return{face:e,ij:i,level:o}}var Gv=m(sf());function I2(r){var t=r.padEnd(16,"0");return Gv.default.fromString(t,16)}var R2=100;function F2(r){for(var t=r.face,e=r.ij,n=r.level,a=[[0,0],[0,1],[1,1],[1,0],[0,0]],i=Math.max(1,Math.ceil(R2*Math.pow(2,-n))),o=new Float64Array(4*i*2+2),s=0,u=0,f=0;f<4;f++)for(var l=a[f].slice(0),c=a[f+1],h=(c[0]-l[0])/i,d=(c[1]-l[1])/i,p=0;p<i;p++){l[0]+=h,l[1]+=d;var v=Iv(e,n,l),y=Rv(v),A=Fv(t,y),_=Lv(A);Math.abs(_[1])>89.999&&(_[0]=u);var E=_[0]-u;_[0]+=E>180?-360:E<-180?360:0,o[s++]=_[0],o[s++]=_[1],u=_[0]}return o[s++]=o[0],o[s++]=o[1],o}function L2(r){if(typeof r=="string"){if(r.indexOf("/")>0)return r;r=I2(r)}return kv(r.toString())}function Uv(r){var t=L2(r),e=Dv(t);return F2(e)}function k2(r){var t=D2();return function(){var n=(0,ff.default)(r),a;if(t){var i=(0,ff.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,Hv.default)(this,a)}}function D2(){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}}var G2={getS2Token:{type:"accessor",value:function(t){return t.token}}},ro=function(r){(0,Vv.default)(e,r);var t=k2(e);function e(){return(0,Nv.default)(this,e),t.apply(this,arguments)}return(0,jv.default)(e,[{key:"indexToBounds",value:function(){var a=this.props,i=a.data,o=a.getS2Token;return{data:i,_normalize:!1,positionFormat:"XY",getPolygon:function(u,f){return Uv(o(u,f))}}}}]),e}(Tr);(0,lf.default)(ro,"layerName","S2Layer");(0,lf.default)(ro,"defaultProps",G2);var wg=m(V()),Cg=m(z()),Bg=m(Ie()),Mg=m(Fe()),Rf=m(Be()),Ff=m(W());var _o=m(ge());function Dn(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function cf(r){if(Array.isArray(r))return Dn(r)}function hf(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Ba(r,t){if(r){if(typeof r=="string")return Dn(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Dn(r,t)}}function df(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gn(r){return cf(r)||hf(r)||Ba(r)||df()}function pf(r){if(Array.isArray(r))return r}function mf(r,t){var e=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(e!=null){var n=[],a=!0,i=!1,o,s;try{for(e=e.call(r);!(a=(o=e.next()).done)&&(n.push(o.value),!(t&&n.length===t));a=!0);}catch(u){i=!0,s=u}finally{try{!a&&e.return!=null&&e.return()}finally{if(i)throw s}}return n}}function vf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $e(r,t){return pf(r)||mf(r,t)||Ba(r,t)||vf()}function gf(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function zv(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function yf(r,t,e){return t&&zv(r.prototype,t),e&&zv(r,e),r}function _e(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var ye=1e-6,Qe=typeof Float32Array<"u"?Float32Array:Array;var wN=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var r=0,t=arguments.length;t--;)r+=arguments[t]*arguments[t];return Math.sqrt(r)});function U2(){var r=new Qe(4);return Qe!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function Wv(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r}function to(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r}function Jv(r){var t=r[0],e=r[1],n=r[2],a=r[3];return Math.hypot(t,e,n,a)}function qv(r){var t=r[0],e=r[1],n=r[2],a=r[3];return t*t+e*e+n*n+a*a}function Xv(r,t){var e=t[0],n=t[1],a=t[2],i=t[3],o=e*e+n*n+a*a+i*i;return o>0&&(o=1/Math.sqrt(o)),r[0]=e*o,r[1]=n*o,r[2]=a*o,r[3]=i*o,r}function Kv(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]+r[3]*t[3]}function Yv(r,t,e,n){var a=t[0],i=t[1],o=t[2],s=t[3];return r[0]=a+n*(e[0]-a),r[1]=i+n*(e[1]-i),r[2]=o+n*(e[2]-o),r[3]=s+n*(e[3]-s),r}function no(r,t,e){var n=t[0],a=t[1],i=t[2],o=t[3];return r[0]=e[0]*n+e[4]*a+e[8]*i+e[12]*o,r[1]=e[1]*n+e[5]*a+e[9]*i+e[13]*o,r[2]=e[2]*n+e[6]*a+e[10]*i+e[14]*o,r[3]=e[3]*n+e[7]*a+e[11]*i+e[15]*o,r}function Qv(r,t,e){var n=t[0],a=t[1],i=t[2],o=e[0],s=e[1],u=e[2],f=e[3],l=f*n+s*i-u*a,c=f*a+u*n-o*i,h=f*i+o*a-s*n,d=-o*n-s*a-u*i;return r[0]=l*f+d*-o+c*-u-h*-s,r[1]=c*f+d*-s+h*-o-l*-u,r[2]=h*f+d*-u+l*-s-c*-o,r[3]=t[3],r}var CN=function(){var r=U2();return function(t,e,n,a,i,o){var s,u;for(e||(e=4),n||(n=0),a?u=Math.min(a*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],r[2]=t[s+2],r[3]=t[s+3],i(r,r,o),t[s]=r[0],t[s+1]=r[1],t[s+2]=r[2],t[s+3]=r[3];return t}}();function Nn(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function bt(r,t){var e=no([],t,r);return to(e,e,1/e[3]),e}function Ma(r,t,e){return r<t?t:r>e?e:r}function N2(r){return Math.log(r)*Math.LOG2E}var ao=Math.log2||N2;function j2(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function $v(r,t){if(r===t){var e=t[1],n=t[2],a=t[3],i=t[6],o=t[7],s=t[11];r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=e,r[6]=t[9],r[7]=t[13],r[8]=n,r[9]=i,r[11]=t[14],r[12]=a,r[13]=o,r[14]=s}else r[0]=t[0],r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=t[1],r[5]=t[5],r[6]=t[9],r[7]=t[13],r[8]=t[2],r[9]=t[6],r[10]=t[10],r[11]=t[14],r[12]=t[3],r[13]=t[7],r[14]=t[11],r[15]=t[15];return r}function io(r,t){var e=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],u=t[6],f=t[7],l=t[8],c=t[9],h=t[10],d=t[11],p=t[12],v=t[13],y=t[14],A=t[15],_=e*s-n*o,E=e*u-a*o,x=e*f-i*o,C=n*u-a*s,P=n*f-i*s,L=a*f-i*u,M=l*v-c*p,S=l*y-h*p,b=l*A-d*p,R=c*y-h*v,F=c*A-d*v,N=h*A-d*y,k=_*N-E*F+x*R+C*b-P*S+L*M;return k?(k=1/k,r[0]=(s*N-u*F+f*R)*k,r[1]=(a*F-n*N-i*R)*k,r[2]=(v*L-y*P+A*C)*k,r[3]=(h*P-c*L-d*C)*k,r[4]=(u*b-o*N-f*S)*k,r[5]=(e*N-a*b+i*S)*k,r[6]=(y*x-p*L-A*E)*k,r[7]=(l*L-h*x+d*E)*k,r[8]=(o*F-s*b+f*M)*k,r[9]=(n*b-e*F-i*M)*k,r[10]=(p*P-v*x+A*_)*k,r[11]=(c*x-l*P-d*_)*k,r[12]=(s*S-o*R-u*M)*k,r[13]=(e*R-n*S+a*M)*k,r[14]=(v*E-p*C-y*_)*k,r[15]=(l*C-c*E+h*_)*k,r):null}function Zv(r){var t=r[0],e=r[1],n=r[2],a=r[3],i=r[4],o=r[5],s=r[6],u=r[7],f=r[8],l=r[9],c=r[10],h=r[11],d=r[12],p=r[13],v=r[14],y=r[15],A=t*o-e*i,_=t*s-n*i,E=t*u-a*i,x=e*s-n*o,C=e*u-a*o,P=n*u-a*s,L=f*p-l*d,M=f*v-c*d,S=f*y-h*d,b=l*v-c*p,R=l*y-h*p,F=c*y-h*v;return A*F-_*R+E*b+x*S-C*M+P*L}function Xt(r,t,e){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=t[8],h=t[9],d=t[10],p=t[11],v=t[12],y=t[13],A=t[14],_=t[15],E=e[0],x=e[1],C=e[2],P=e[3];return r[0]=E*n+x*s+C*c+P*v,r[1]=E*a+x*u+C*h+P*y,r[2]=E*i+x*f+C*d+P*A,r[3]=E*o+x*l+C*p+P*_,E=e[4],x=e[5],C=e[6],P=e[7],r[4]=E*n+x*s+C*c+P*v,r[5]=E*a+x*u+C*h+P*y,r[6]=E*i+x*f+C*d+P*A,r[7]=E*o+x*l+C*p+P*_,E=e[8],x=e[9],C=e[10],P=e[11],r[8]=E*n+x*s+C*c+P*v,r[9]=E*a+x*u+C*h+P*y,r[10]=E*i+x*f+C*d+P*A,r[11]=E*o+x*l+C*p+P*_,E=e[12],x=e[13],C=e[14],P=e[15],r[12]=E*n+x*s+C*c+P*v,r[13]=E*a+x*u+C*h+P*y,r[14]=E*i+x*f+C*d+P*A,r[15]=E*o+x*l+C*p+P*_,r}function Kt(r,t,e){var n=e[0],a=e[1],i=e[2],o,s,u,f,l,c,h,d,p,v,y,A;return t===r?(r[12]=t[0]*n+t[4]*a+t[8]*i+t[12],r[13]=t[1]*n+t[5]*a+t[9]*i+t[13],r[14]=t[2]*n+t[6]*a+t[10]*i+t[14],r[15]=t[3]*n+t[7]*a+t[11]*i+t[15]):(o=t[0],s=t[1],u=t[2],f=t[3],l=t[4],c=t[5],h=t[6],d=t[7],p=t[8],v=t[9],y=t[10],A=t[11],r[0]=o,r[1]=s,r[2]=u,r[3]=f,r[4]=l,r[5]=c,r[6]=h,r[7]=d,r[8]=p,r[9]=v,r[10]=y,r[11]=A,r[12]=o*n+l*a+p*i+t[12],r[13]=s*n+c*a+v*i+t[13],r[14]=u*n+h*a+y*i+t[14],r[15]=f*n+d*a+A*i+t[15]),r}function jn(r,t,e){var n=e[0],a=e[1],i=e[2];return r[0]=t[0]*n,r[1]=t[1]*n,r[2]=t[2]*n,r[3]=t[3]*n,r[4]=t[4]*a,r[5]=t[5]*a,r[6]=t[6]*a,r[7]=t[7]*a,r[8]=t[8]*i,r[9]=t[9]*i,r[10]=t[10]*i,r[11]=t[11]*i,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function eg(r,t,e,n){var a=n[0],i=n[1],o=n[2],s=Math.hypot(a,i,o),u,f,l,c,h,d,p,v,y,A,_,E,x,C,P,L,M,S,b,R,F,N,k,B;return s<ye?null:(s=1/s,a*=s,i*=s,o*=s,u=Math.sin(e),f=Math.cos(e),l=1-f,c=t[0],h=t[1],d=t[2],p=t[3],v=t[4],y=t[5],A=t[6],_=t[7],E=t[8],x=t[9],C=t[10],P=t[11],L=a*a*l+f,M=i*a*l+o*u,S=o*a*l-i*u,b=a*i*l-o*u,R=i*i*l+f,F=o*i*l+a*u,N=a*o*l+i*u,k=i*o*l-a*u,B=o*o*l+f,r[0]=c*L+v*M+E*S,r[1]=h*L+y*M+x*S,r[2]=d*L+A*M+C*S,r[3]=p*L+_*M+P*S,r[4]=c*b+v*R+E*F,r[5]=h*b+y*R+x*F,r[6]=d*b+A*R+C*F,r[7]=p*b+_*R+P*F,r[8]=c*N+v*k+E*B,r[9]=h*N+y*k+x*B,r[10]=d*N+A*k+C*B,r[11]=p*N+_*k+P*B,t!==r&&(r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r)}function oo(r,t,e){var n=Math.sin(e),a=Math.cos(e),i=t[4],o=t[5],s=t[6],u=t[7],f=t[8],l=t[9],c=t[10],h=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=i*a+f*n,r[5]=o*a+l*n,r[6]=s*a+c*n,r[7]=u*a+h*n,r[8]=f*a-i*n,r[9]=l*a-o*n,r[10]=c*a-s*n,r[11]=h*a-u*n,r}function rg(r,t,e){var n=Math.sin(e),a=Math.cos(e),i=t[0],o=t[1],s=t[2],u=t[3],f=t[8],l=t[9],c=t[10],h=t[11];return t!==r&&(r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=i*a-f*n,r[1]=o*a-l*n,r[2]=s*a-c*n,r[3]=u*a-h*n,r[8]=i*n+f*a,r[9]=o*n+l*a,r[10]=s*n+c*a,r[11]=u*n+h*a,r}function so(r,t,e){var n=Math.sin(e),a=Math.cos(e),i=t[0],o=t[1],s=t[2],u=t[3],f=t[4],l=t[5],c=t[6],h=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=i*a+f*n,r[1]=o*a+l*n,r[2]=s*a+c*n,r[3]=u*a+h*n,r[4]=f*a-i*n,r[5]=l*a-o*n,r[6]=c*a-s*n,r[7]=h*a-u*n,r}function tg(r,t){var e=t[0],n=t[1],a=t[2],i=t[4],o=t[5],s=t[6],u=t[8],f=t[9],l=t[10];return r[0]=Math.hypot(e,n,a),r[1]=Math.hypot(i,o,s),r[2]=Math.hypot(u,f,l),r}function ng(r,t){var e=t[0],n=t[1],a=t[2],i=t[3],o=e+e,s=n+n,u=a+a,f=e*o,l=n*o,c=n*s,h=a*o,d=a*s,p=a*u,v=i*o,y=i*s,A=i*u;return r[0]=1-c-p,r[1]=l+A,r[2]=h-y,r[3]=0,r[4]=l-A,r[5]=1-f-p,r[6]=d+v,r[7]=0,r[8]=h+y,r[9]=d-v,r[10]=1-f-c,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function ag(r,t,e,n,a,i,o){var s=1/(e-t),u=1/(a-n),f=1/(i-o);return r[0]=i*2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=i*2*u,r[6]=0,r[7]=0,r[8]=(e+t)*s,r[9]=(a+n)*u,r[10]=(o+i)*f,r[11]=-1,r[12]=0,r[13]=0,r[14]=o*i*2*f,r[15]=0,r}function V2(r,t,e,n,a){var i=1/Math.tan(t/2),o;return r[0]=i/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=i,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,a!=null&&a!==1/0?(o=1/(n-a),r[10]=(a+n)*o,r[14]=2*a*n*o):(r[10]=-1,r[14]=-2*n),r}var uo=V2;function H2(r,t,e,n,a,i,o){var s=1/(t-e),u=1/(n-a),f=1/(i-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*f,r[11]=0,r[12]=(t+e)*s,r[13]=(a+n)*u,r[14]=(o+i)*f,r[15]=1,r}var ig=H2;function og(r,t,e,n){var a,i,o,s,u,f,l,c,h,d,p=t[0],v=t[1],y=t[2],A=n[0],_=n[1],E=n[2],x=e[0],C=e[1],P=e[2];return Math.abs(p-x)<ye&&Math.abs(v-C)<ye&&Math.abs(y-P)<ye?j2(r):(l=p-x,c=v-C,h=y-P,d=1/Math.hypot(l,c,h),l*=d,c*=d,h*=d,a=_*h-E*c,i=E*l-A*h,o=A*c-_*l,d=Math.hypot(a,i,o),d?(d=1/d,a*=d,i*=d,o*=d):(a=0,i=0,o=0),s=c*o-h*i,u=h*a-l*o,f=l*i-c*a,d=Math.hypot(s,u,f),d?(d=1/d,s*=d,u*=d,f*=d):(s=0,u=0,f=0),r[0]=a,r[1]=s,r[2]=l,r[3]=0,r[4]=i,r[5]=u,r[6]=c,r[7]=0,r[8]=o,r[9]=f,r[10]=h,r[11]=0,r[12]=-(a*p+i*v+o*y),r[13]=-(s*p+u*v+f*y),r[14]=-(l*p+c*v+h*y),r[15]=1,r)}function _f(r,t){var e=r[0],n=r[1],a=r[2],i=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],c=r[9],h=r[10],d=r[11],p=r[12],v=r[13],y=r[14],A=r[15],_=t[0],E=t[1],x=t[2],C=t[3],P=t[4],L=t[5],M=t[6],S=t[7],b=t[8],R=t[9],F=t[10],N=t[11],k=t[12],B=t[13],O=t[14],I=t[15];return Math.abs(e-_)<=ye*Math.max(1,Math.abs(e),Math.abs(_))&&Math.abs(n-E)<=ye*Math.max(1,Math.abs(n),Math.abs(E))&&Math.abs(a-x)<=ye*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(i-C)<=ye*Math.max(1,Math.abs(i),Math.abs(C))&&Math.abs(o-P)<=ye*Math.max(1,Math.abs(o),Math.abs(P))&&Math.abs(s-L)<=ye*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(u-M)<=ye*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(f-S)<=ye*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(l-b)<=ye*Math.max(1,Math.abs(l),Math.abs(b))&&Math.abs(c-R)<=ye*Math.max(1,Math.abs(c),Math.abs(R))&&Math.abs(h-F)<=ye*Math.max(1,Math.abs(h),Math.abs(F))&&Math.abs(d-N)<=ye*Math.max(1,Math.abs(d),Math.abs(N))&&Math.abs(p-k)<=ye*Math.max(1,Math.abs(p),Math.abs(k))&&Math.abs(v-B)<=ye*Math.max(1,Math.abs(v),Math.abs(B))&&Math.abs(y-O)<=ye*Math.max(1,Math.abs(y),Math.abs(O))&&Math.abs(A-I)<=ye*Math.max(1,Math.abs(A),Math.abs(I))}function z2(){var r=new Qe(2);return Qe!=Float32Array&&(r[0]=0,r[1]=0),r}function Tf(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r}function sg(r,t){return r[0]=-t[0],r[1]=-t[1],r}function lo(r,t,e,n){var a=t[0],i=t[1];return r[0]=a+n*(e[0]-a),r[1]=i+n*(e[1]-i),r}function ug(r,t,e){var n=t[0],a=t[1];return r[0]=e[0]*n+e[2]*a,r[1]=e[1]*n+e[3]*a,r}function fg(r,t,e){var n=t[0],a=t[1];return r[0]=e[0]*n+e[2]*a+e[4],r[1]=e[1]*n+e[3]*a+e[5],r}function co(r,t,e){var n=t[0],a=t[1];return r[0]=e[0]*n+e[3]*a+e[6],r[1]=e[1]*n+e[4]*a+e[7],r}function ho(r,t,e){var n=t[0],a=t[1];return r[0]=e[0]*n+e[4]*a+e[12],r[1]=e[1]*n+e[5]*a+e[13],r}var ON=function(){var r=z2();return function(t,e,n,a,i,o){var s,u;for(e||(e=2),n||(n=0),a?u=Math.min(a*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],i(r,r,o),t[s]=r[0],t[s+1]=r[1];return t}}();function xf(){var r=new Qe(3);return Qe!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function Ef(r){var t=r[0],e=r[1],n=r[2];return Math.hypot(t,e,n)}function Sf(r,t,e){var n=new Qe(3);return n[0]=r,n[1]=t,n[2]=e,n}function lg(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r}function W2(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r}function cg(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r}function hg(r,t){var e=t[0],n=t[1],a=t[2],i=e*e+n*n+a*a;return i>0&&(i=1/Math.sqrt(i)),r[0]=t[0]*i,r[1]=t[1]*i,r[2]=t[2]*i,r}function Oa(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function Hn(r,t,e){var n=t[0],a=t[1],i=t[2],o=e[0],s=e[1],u=e[2];return r[0]=a*u-i*s,r[1]=i*o-n*u,r[2]=n*s-a*o,r}function zn(r,t,e){var n=t[0],a=t[1],i=t[2],o=e[3]*n+e[7]*a+e[11]*i+e[15];return o=o||1,r[0]=(e[0]*n+e[4]*a+e[8]*i+e[12])/o,r[1]=(e[1]*n+e[5]*a+e[9]*i+e[13])/o,r[2]=(e[2]*n+e[6]*a+e[10]*i+e[14])/o,r}function po(r,t,e){var n=t[0],a=t[1],i=t[2];return r[0]=n*e[0]+a*e[3]+i*e[6],r[1]=n*e[1]+a*e[4]+i*e[7],r[2]=n*e[2]+a*e[5]+i*e[8],r}function mo(r,t,e){var n=e[0],a=e[1],i=e[2],o=e[3],s=t[0],u=t[1],f=t[2],l=a*f-i*u,c=i*s-n*f,h=n*u-a*s,d=a*h-i*c,p=i*l-n*h,v=n*c-a*l,y=o*2;return l*=y,c*=y,h*=y,d*=2,p*=2,v*=2,r[0]=s+l+d,r[1]=u+c+p,r[2]=f+h+v,r}function dg(r,t,e,n){var a=[],i=[];return a[0]=t[0]-e[0],a[1]=t[1]-e[1],a[2]=t[2]-e[2],i[0]=a[0],i[1]=a[1]*Math.cos(n)-a[2]*Math.sin(n),i[2]=a[1]*Math.sin(n)+a[2]*Math.cos(n),r[0]=i[0]+e[0],r[1]=i[1]+e[1],r[2]=i[2]+e[2],r}function pg(r,t,e,n){var a=[],i=[];return a[0]=t[0]-e[0],a[1]=t[1]-e[1],a[2]=t[2]-e[2],i[0]=a[2]*Math.sin(n)+a[0]*Math.cos(n),i[1]=a[1],i[2]=a[2]*Math.cos(n)-a[0]*Math.sin(n),r[0]=i[0]+e[0],r[1]=i[1]+e[1],r[2]=i[2]+e[2],r}function mg(r,t,e,n){var a=[],i=[];return a[0]=t[0]-e[0],a[1]=t[1]-e[1],a[2]=t[2]-e[2],i[0]=a[0]*Math.cos(n)-a[1]*Math.sin(n),i[1]=a[0]*Math.sin(n)+a[1]*Math.cos(n),i[2]=a[2],r[0]=i[0]+e[0],r[1]=i[1]+e[1],r[2]=i[2]+e[2],r}function vg(r,t){var e=r[0],n=r[1],a=r[2],i=t[0],o=t[1],s=t[2],u=Math.sqrt(e*e+n*n+a*a),f=Math.sqrt(i*i+o*o+s*s),l=u*f,c=l&&Oa(r,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))}var gg=W2;var yg=Ef;var PN=function(){var r=xf();return function(t,e,n,a,i,o){var s,u;for(e||(e=3),n||(n=0),a?u=Math.min(a*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],r[2]=t[s+2],i(r,r,o),t[s]=r[0],t[s+1]=r[1],t[s+2]=r[2];return t}}();function Mr(r,t){if(!r)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var Or=Math.PI,bg=Or/4,Nr=Or/180,wf=180/Or,Pa=512,Ag=4003e4,Jn=85.051129,Cf=1.5;function vo(r){return Math.pow(2,r)}function gr(r){var t=$e(r,2),e=t[0],n=t[1];Mr(Number.isFinite(e)),Mr(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var a=e*Nr,i=n*Nr,o=Pa*(a+Or)/(2*Or),s=Pa*(Or+Math.log(Math.tan(bg+i*.5)))/(2*Or);return[o,s]}function fr(r){var t=$e(r,2),e=t[0],n=t[1],a=e/Pa*(2*Or)-Or,i=2*(Math.atan(Math.exp(n/Pa*(2*Or)-Or))-bg);return[a*wf,i*wf]}function Bf(r){var t=r.latitude,e=r.longitude,n=r.highPrecision,a=n===void 0?!1:n;Mr(Number.isFinite(t)&&Number.isFinite(e));var i=Pa,o=Math.cos(t*Nr),s=i/360,u=s/o,f=i/Ag/o,l={unitsPerMeter:[f,f,f],metersPerUnit:[1/f,1/f,1/f],unitsPerDegree:[s,u,f],degreesPerUnit:[1/s,1/u,1/f]};if(a){var c=Nr*Math.tan(t*Nr)/o,h=s*c/2,d=i/Ag*c,p=d/u*f;l.unitsPerDegree2=[0,h,d],l.unitsPerMeter2=[p,0,p]}return l}function Mf(r){var t=r.height,e=r.pitch,n=r.bearing,a=r.altitude,i=r.scale,o=r.center,s=Nn();Kt(s,s,[0,0,-a]),oo(s,s,-e*Nr),so(s,s,n*Nr);var u=i/t;return jn(s,s,[u,u,u]),o&&Kt(s,s,cg([],o)),s}function _g(r){var t=r.width,e=r.height,n=r.altitude,a=r.pitch,i=a===void 0?0:a,o=r.offset,s=r.center,u=r.scale,f=r.nearZMultiplier,l=f===void 0?1:f,c=r.farZMultiplier,h=c===void 0?1:c,d=r.fovy,p=d===void 0?Wn(Cf):d;n!==void 0&&(p=Wn(n));var v=p*Nr,y=i*Nr,A=go(p),_=A;s&&(_+=s[2]*u/Math.cos(y)/e);var E=v*(.5+(o?o[1]:0)/e),x=Math.sin(E)*_/Math.sin(Ma(Math.PI/2-y-E,.01,Math.PI-.01)),C=Math.sin(y)*x+_,P=_*10,L=Math.min(C*h,P);return{fov:v,aspect:t/e,focalDistance:A,near:l,far:L}}function Of(r){var t=_g(r),e=t.fov,n=t.aspect,a=t.near,i=t.far,o=uo([],e,n,a,i);return o}function Wn(r){return 2*Math.atan(.5/r)*wf}function go(r){return .5/Math.tan(.5*r*Nr)}function Pf(r,t){var e=$e(r,3),n=e[0],a=e[1],i=e[2],o=i===void 0?0:i;return Mr(Number.isFinite(n)&&Number.isFinite(a)&&Number.isFinite(o)),bt(t,[n,a,o,1])}function yo(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=$e(r,3),a=n[0],i=n[1],o=n[2];if(Mr(Number.isFinite(a)&&Number.isFinite(i),"invalid pixel coordinate"),Number.isFinite(o)){var s=bt(t,[a,i,o,1]);return s}var u=bt(t,[a,i,0,1]),f=bt(t,[a,i,1,1]),l=u[2],c=f[2],h=l===c?0:((e||0)-l)/(c-l);return lo([],u,f,h)}function Ao(r){var t=r.width,e=r.height,n=r.bounds,a=r.minExtent,i=a===void 0?0:a,o=r.maxZoom,s=o===void 0?24:o,u=r.offset,f=u===void 0?[0,0]:u,l=$e(n,2),c=$e(l[0],2),h=c[0],d=c[1],p=$e(l[1],2),v=p[0],y=p[1],A=J2(r.padding),_=gr([h,Ma(y,-Jn,Jn)]),E=gr([v,Ma(d,-Jn,Jn)]),x=[Math.max(Math.abs(E[0]-_[0]),i),Math.max(Math.abs(E[1]-_[1]),i)],C=[t-A.left-A.right-Math.abs(f[0])*2,e-A.top-A.bottom-Math.abs(f[1])*2];Mr(C[0]>0&&C[1]>0);var P=C[0]/x[0],L=C[1]/x[1],M=(A.right-A.left)/2/P,S=(A.bottom-A.top)/2/L,b=[(E[0]+_[0])/2+M,(E[1]+_[1])/2+S],R=fr(b),F=Math.min(s,ao(Math.abs(Math.min(P,L))));return Mr(Number.isFinite(F)),{longitude:R[0],latitude:R[1],zoom:F}}function J2(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return typeof r=="number"?{top:r,bottom:r,left:r,right:r}:(Mr(Number.isFinite(r.top)&&Number.isFinite(r.bottom)&&Number.isFinite(r.left)&&Number.isFinite(r.right)),r)}var Tg=Math.PI/180;function bo(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=r.width,n=r.height,a=r.unproject,i={targetZ:t},o=a([0,n],i),s=a([e,n],i),u,f,l=r.fovy?.5*r.fovy*Tg:Math.atan(.5/r.altitude),c=(90-r.pitch)*Tg;return l>c-.01?(u=xg(r,0,t),f=xg(r,e,t)):(u=a([0,0],i),f=a([e,0],i)),[o,s,f,u]}function xg(r,t,e){var n=r.pixelUnprojectionMatrix,a=bt(n,[t,0,1,1]),i=bt(n,[t,r.height,1,1]),o=e*r.distanceScales.unitsPerMeter[2],s=(o-a[2])/(i[2]-a[2]),u=lo([],a,i,s),f=fr(u);return f.push(e),f}var Eg=function(){function r(){var t=this,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{width:1,height:1};gf(this,r),_e(this,"latitude",void 0),_e(this,"longitude",void 0),_e(this,"zoom",void 0),_e(this,"pitch",void 0),_e(this,"bearing",void 0),_e(this,"altitude",void 0),_e(this,"fovy",void 0),_e(this,"meterOffset",void 0),_e(this,"center",void 0),_e(this,"width",void 0),_e(this,"height",void 0),_e(this,"scale",void 0),_e(this,"distanceScales",void 0),_e(this,"viewMatrix",void 0),_e(this,"projectionMatrix",void 0),_e(this,"viewProjectionMatrix",void 0),_e(this,"pixelProjectionMatrix",void 0),_e(this,"pixelUnprojectionMatrix",void 0),_e(this,"equals",function(F){return F instanceof r?F.width===t.width&&F.height===t.height&&_f(F.projectionMatrix,t.projectionMatrix)&&_f(F.viewMatrix,t.viewMatrix):!1}),_e(this,"project",function(F){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=N.topLeft,B=k===void 0?!0:k,O=t.projectPosition(F),I=Pf(O,t.pixelProjectionMatrix),U=$e(I,2),D=U[0],j=U[1],X=B?j:t.height-j;return F.length===2?[D,X]:[D,X,I[2]]}),_e(this,"unproject",function(F){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=N.topLeft,B=k===void 0?!0:k,O=N.targetZ,I=O===void 0?void 0:O,U=$e(F,3),D=U[0],j=U[1],X=U[2],te=B?j:t.height-j,Pe=I&&I*t.distanceScales.unitsPerMeter[2],Ee=yo([D,te,X],t.pixelUnprojectionMatrix,Pe),rr=t.unprojectPosition(Ee),Ne=$e(rr,3),yt=Ne[0],_r=Ne[1],kn=Ne[2];return Number.isFinite(X)?[yt,_r,kn]:Number.isFinite(I)?[yt,_r,I]:[yt,_r]}),_e(this,"projectPosition",function(F){var N=gr(F),k=$e(N,2),B=k[0],O=k[1],I=(F[2]||0)*t.distanceScales.unitsPerMeter[2];return[B,O,I]}),_e(this,"unprojectPosition",function(F){var N=fr(F),k=$e(N,2),B=k[0],O=k[1],I=(F[2]||0)*t.distanceScales.metersPerUnit[2];return[B,O,I]});var n=e.width,a=e.height,i=e.altitude,o=i===void 0?null:i,s=e.fovy,u=s===void 0?null:s,f=e.latitude,l=f===void 0?0:f,c=e.longitude,h=c===void 0?0:c,d=e.zoom,p=d===void 0?0:d,v=e.pitch,y=v===void 0?0:v,A=e.bearing,_=A===void 0?0:A,E=e.position,x=E===void 0?null:E,C=e.nearZMultiplier,P=C===void 0?.02:C,L=e.farZMultiplier,M=L===void 0?1.01:L;n=n||1,a=a||1,u===null&&o===null?(o=Cf,u=Wn(o)):u===null?u=Wn(o):o===null&&(o=go(u));var S=vo(p);o=Math.max(.75,o);var b=Bf({longitude:h,latitude:l}),R=gr([h,l]);R.push(0),x&&lg(R,R,gg([],x,b.unitsPerMeter)),this.projectionMatrix=Of({width:n,height:a,scale:S,center:R,pitch:y,fovy:u,nearZMultiplier:P,farZMultiplier:M}),this.viewMatrix=Mf({height:a,scale:S,center:R,pitch:y,bearing:_,altitude:o}),this.width=n,this.height=a,this.scale=S,this.latitude=l,this.longitude=h,this.zoom=p,this.pitch=y,this.bearing=_,this.altitude=o,this.fovy=u,this.center=R,this.meterOffset=x||[0,0,0],this.distanceScales=b,this._initMatrices(),Object.freeze(this)}return yf(r,[{key:"_initMatrices",value:function(){var e=this.width,n=this.height,a=this.projectionMatrix,i=this.viewMatrix,o=Nn();Xt(o,o,a),Xt(o,o,i),this.viewProjectionMatrix=o;var s=Nn();jn(s,s,[e/2,-n/2,1]),Kt(s,s,[1,-1,0]),Xt(s,s,o);var u=io(Nn(),s);if(!u)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=s,this.pixelUnprojectionMatrix=u}},{key:"projectFlat",value:function(e){return gr(e)}},{key:"unprojectFlat",value:function(e){return fr(e)}},{key:"getMapCenterByLngLatPosition",value:function(e){var n=e.lngLat,a=e.pos,i=yo(a,this.pixelUnprojectionMatrix),o=gr(n),s=Tf([],o,sg([],i)),u=Tf([],this.center,s);return fr(u)}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.width,i=this.height,o=Ao(Object.assign({width:a,height:i,bounds:e},n)),s=o.longitude,u=o.latitude,f=o.zoom;return new r({width:a,height:i,longitude:s,latitude:u,zoom:f})}},{key:"getBounds",value:function(e){var n=this.getBoundingRegion(e),a=Math.min.apply(Math,Gn(n.map(function(u){return u[0]}))),i=Math.max.apply(Math,Gn(n.map(function(u){return u[0]}))),o=Math.min.apply(Math,Gn(n.map(function(u){return u[1]}))),s=Math.max.apply(Math,Gn(n.map(function(u){return u[1]})));return[[a,o],[i,s]]}},{key:"getBoundingRegion",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return bo(this,e.z||0)}},{key:"getLocationAtPoint",value:function(e){var n=e.lngLat,a=e.pos;return this.getMapCenterByLngLatPosition({lngLat:n,pos:a})}}]),r}();var If=512;function X2(r){for(var t=0,e=0,n=1<<r.length,a=n/If,i=0;i<r.length;i++){n>>=1;var o=parseInt(r[i]);o%2&&(t|=n),o>1&&(e|=n)}return[[t/a,If-e/a],[(t+.99)/a,If-(e+.99)/a]]}function Sg(r){var t=X2(r),e=(0,_o.default)(t,2),n=e[0],a=e[1],i=fr(n),o=(0,_o.default)(i,2),s=o[0],u=o[1],f=fr(a),l=(0,_o.default)(f,2),c=l[0],h=l[1];return[c,u,c,h,s,h,s,u,c,u]}function K2(r){var t=Y2();return function(){var n=(0,Rf.default)(r),a;if(t){var i=(0,Rf.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,Mg.default)(this,a)}}function Y2(){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}}var Q2={getQuadkey:{type:"accessor",value:function(t){return t.quadkey}}},To=function(r){(0,Bg.default)(e,r);var t=K2(e);function e(){return(0,wg.default)(this,e),t.apply(this,arguments)}return(0,Cg.default)(e,[{key:"indexToBounds",value:function(){var a=this.props,i=a.data,o=a.getQuadkey;return{data:i,_normalize:!1,positionFormat:"XY",getPolygon:function(u,f){return Sg(o(u,f))}}}}]),e}(Tr);(0,Ff.default)(To,"layerName","QuadkeyLayer");(0,Ff.default)(To,"defaultProps",Q2);var $0=m(V()),Z0=m(z()),e1=m(Ie()),r1=m(Fe()),ql=m(Be()),Wo=m(W()),Jo=m(Ur()),t1=m(Dr());var zl=m(ge()),X0=m(V()),K0=m(z()),Ge=m(W());function $(r,t){if(!r)throw new Error(t||"loader assertion failed.")}var Pg=m(Re()),jr={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},$2=jr.self||jr.window||jr.global||{},Z2=jr.window||jr.self||jr.global||{},eM=jr.global||jr.self||jr.window||{},rM=jr.document||{};var Pr=Boolean((typeof process>"u"?"undefined":(0,Pg.default)(process))!=="object"||String(process)!=="[object process]"||process.browser);var Og=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),tM=Og&&parseFloat(Og[1])||0;var Dg="3.3.0-alpha.10";function Xe(r,t){if(!r)throw new Error(t||"loaders.gl assertion failed.")}var Ug=m(Re()),Vr={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},k8=Vr.self||Vr.window||Vr.global||{},D8=Vr.window||Vr.self||Vr.global||{},Ng=Vr.global||Vr.self||Vr.window||{},G8=Vr.document||{};var tr=(typeof process>"u"?"undefined":(0,Ug.default)(process))!=="object"||String(process)!=="[object process]"||process.browser,Ia=typeof importScripts=="function",jg=typeof window<"u"&&typeof window.orientation<"u",Gg=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),U8=Gg&&parseFloat(Gg[1])||0;var Vg=m(V()),Hg=m(z());function g(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var zg=function(){function r(t,e){var n=this;(0,Vg.default)(this,r),g(this,"name",void 0),g(this,"workerThread",void 0),g(this,"isRunning",!0),g(this,"result",void 0),g(this,"_resolve",function(){}),g(this,"_reject",function(){}),this.name=t,this.workerThread=e,this.result=new Promise(function(a,i){n._resolve=a,n._reject=i})}return(0,Hg.default)(r,[{key:"postMessage",value:function(e,n){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:n})}},{key:"done",value:function(e){Xe(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){Xe(this.isRunning),this.isRunning=!1,this._reject(e)}}]),r}();var Yg=m(V()),Qg=m(z());var Wg=m(V()),xo=function r(){(0,Wg.default)(this,r)};var kf=new Map;function Jg(r){Xe(r.source&&!r.url||!r.source&&r.url);var t=kf.get(r.source||r.url);return t||(r.url&&(t=aM(r.url),kf.set(r.url,t)),r.source&&(t=qg(r.source),kf.set(r.source,t))),Xe(t),t}function aM(r){if(!r.startsWith("http"))return r;var t=iM(r);return qg(t)}function qg(r){var t=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(t)}function iM(r){return`try {
4
+ importScripts('`.concat(r,`');
5
+ } catch (error) {
6
+ console.error(error);
7
+ throw error;
8
+ }`)}var Kg=m(Re());function Df(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,e=arguments.length>2?arguments[2]:void 0,n=e||new Set;if(r){if(Xg(r))n.add(r);else if(Xg(r.buffer))n.add(r.buffer);else if(!ArrayBuffer.isView(r)){if(t&&(0,Kg.default)(r)==="object")for(var a in r)Df(r[a],t,n)}}return e===void 0?Array.from(n):[]}function Xg(r){return r?r instanceof ArrayBuffer||typeof MessagePort<"u"&&r instanceof MessagePort||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas:!1}var Gf=function(){},Ra=function(){function r(t){(0,Yg.default)(this,r),g(this,"name",void 0),g(this,"source",void 0),g(this,"url",void 0),g(this,"terminated",!1),g(this,"worker",void 0),g(this,"onMessage",void 0),g(this,"onError",void 0),g(this,"_loadableURL","");var e=t.name,n=t.source,a=t.url;Xe(n||a),this.name=e,this.source=n,this.url=a,this.onMessage=Gf,this.onError=function(i){return console.log(i)},this.worker=tr?this._createBrowserWorker():this._createNodeWorker()}return(0,Qg.default)(r,[{key:"destroy",value:function(){this.onMessage=Gf,this.onError=Gf,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(e,n){n=n||Df(e),this.worker.postMessage(e,n)}},{key:"_getErrorFromErrorEvent",value:function(e){var n="Failed to load ";return n+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(n+="".concat(e.message," in ")),e.lineno&&(n+=":".concat(e.lineno,":").concat(e.colno)),new Error(n)}},{key:"_createBrowserWorker",value:function(){var e=this;this._loadableURL=Jg({source:this.source,url:this.url});var n=new Worker(this._loadableURL,{name:this.name});return n.onmessage=function(a){a.data?e.onMessage(a.data):e.onError(new Error("No data received"))},n.onerror=function(a){e.onError(e._getErrorFromErrorEvent(a)),e.terminated=!0},n.onmessageerror=function(a){return console.error(a)},n}},{key:"_createNodeWorker",value:function(){var e=this,n;if(this.url){var a=this.url.includes(":/")||this.url.startsWith("/"),i=a?this.url:"./".concat(this.url);n=new xo(i,{eval:!1})}else if(this.source)n=new xo(this.source,{eval:!0});else throw new Error("no worker");return n.on("message",function(o){e.onMessage(o)}),n.on("error",function(o){e.onError(o)}),n.on("exit",function(o){}),n}}],[{key:"isSupported",value:function(){return typeof Worker<"u"&&tr||typeof xo<"u"&&!tr}}]),r}();var sy=m(W()),uy=m(V()),fy=m(z());var Uf=m(K()),ey=m(W()),ry=m(V()),ty=m(z()),Fa=m(J());function $g(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function Zg(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?$g(Object(e),!0).forEach(function(n){(0,ey.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):$g(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var ny=function(){function r(t){(0,ry.default)(this,r),g(this,"name","unnamed"),g(this,"source",void 0),g(this,"url",void 0),g(this,"maxConcurrency",1),g(this,"maxMobileConcurrency",1),g(this,"onDebug",function(){}),g(this,"reuseWorkers",!0),g(this,"props",{}),g(this,"jobQueue",[]),g(this,"idleQueue",[]),g(this,"count",0),g(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}return(0,ty.default)(r,[{key:"destroy",value:function(){this.idleQueue.forEach(function(e){return e.destroy()}),this.isDestroyed=!0}},{key:"setProps",value:function(e){this.props=Zg(Zg({},this.props),e),e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}},{key:"startJob",value:function(){var t=(0,Uf.default)(Fa.default.mark(function n(a){var i=this,o,s,u,f=arguments;return Fa.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return o=f.length>1&&f[1]!==void 0?f[1]:function(h,d,p){return h.done(p)},s=f.length>2&&f[2]!==void 0?f[2]:function(h,d){return h.error(d)},u=new Promise(function(h){return i.jobQueue.push({name:a,onMessage:o,onError:s,onStart:h}),i}),this._startQueuedJob(),c.next=6,u;case 6:return c.abrupt("return",c.sent);case 7:case"end":return c.stop()}},n,this)}));function e(n){return t.apply(this,arguments)}return e}()},{key:"_startQueuedJob",value:function(){var t=(0,Uf.default)(Fa.default.mark(function n(){var a,i,o;return Fa.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(this.jobQueue.length){u.next=2;break}return u.abrupt("return");case 2:if(a=this._getAvailableWorker(),a){u.next=5;break}return u.abrupt("return");case 5:if(i=this.jobQueue.shift(),!i){u.next=18;break}return this.onDebug({message:"Starting job",name:i.name,workerThread:a,backlog:this.jobQueue.length}),o=new zg(i.name,a),a.onMessage=function(f){return i.onMessage(o,f.type,f.payload)},a.onError=function(f){return i.onError(o,f)},i.onStart(o),u.prev=12,u.next=15,o.result;case 15:return u.prev=15,this.returnWorkerToQueue(a),u.finish(15);case 18:case"end":return u.stop()}},n,this,[[12,,15,18]])}));function e(){return t.apply(this,arguments)}return e}()},{key:"returnWorkerToQueue",value:function(e){var n=this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency();n?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}},{key:"_getAvailableWorker",value:function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;var e="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new Ra({name:e,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return jg?this.maxMobileConcurrency:this.maxConcurrency}}],[{key:"isSupported",value:function(){return Ra.isSupported()}}]),r}();function ay(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=oM(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function oM(r,t){if(r){if(typeof r=="string")return iy(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return iy(r,t)}}function iy(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function oy(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function Nf(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?oy(Object(e),!0).forEach(function(n){(0,sy.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):oy(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var sM={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:function(){}},La=function(){function r(t){(0,uy.default)(this,r),g(this,"props",void 0),g(this,"workerPools",new Map),this.props=Nf({},sM),this.setProps(t),this.workerPools=new Map}return(0,fy.default)(r,[{key:"destroy",value:function(){var e=ay(this.workerPools.values()),n;try{for(e.s();!(n=e.n()).done;){var a=n.value;a.destroy()}}catch(i){e.e(i)}finally{e.f()}this.workerPools=new Map}},{key:"setProps",value:function(e){this.props=Nf(Nf({},this.props),e);var n=ay(this.workerPools.values()),a;try{for(n.s();!(a=n.n()).done;){var i=a.value;i.setProps(this._getWorkerPoolProps())}}catch(o){n.e(o)}finally{n.f()}}},{key:"getWorkerPool",value:function(e){var n=e.name,a=e.source,i=e.url,o=this.workerPools.get(n);return o||(o=new ny({name:n,source:a,url:i}),o.setProps(this._getWorkerPoolProps()),this.workerPools.set(n,o)),o}},{key:"_getWorkerPoolProps",value:function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}],[{key:"isSupported",value:function(){return Ra.isSupported()}},{key:"getWorkerFarm",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return r._workerFarm=r._workerFarm||new r({}),r._workerFarm.setProps(e),r._workerFarm}}]),r}();g(La,"_workerFarm",void 0);var uM="beta";function jf(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t[r.id]||{},n="".concat(r.id,"-worker.js"),a=e.workerUrl;if(!a&&r.id==="compression"&&(a=t.workerUrl),t._workerType==="test"&&(a="modules/".concat(r.module,"/dist/").concat(n)),!a){var i=r.version;i==="latest"&&(i=uM);var o=i?"@".concat(i):"";a="https://unpkg.com/@loaders.gl/".concat(r.module).concat(o,"/dist/").concat(n)}return Xe(a),a}function Hf(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Dg;Xe(r,"no worker provided");var e=r.version;return!(!t||!e)}var qf=m(K()),ka=m(J());var Yt=m(cy());var lM="3.3.0-alpha.10",zf={};function Hr(r){return Wf.apply(this,arguments)}function Wf(){return Wf=(0,qf.default)(ka.default.mark(function r(t){var e,n,a=arguments;return ka.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return e=a.length>1&&a[1]!==void 0?a[1]:null,n=a.length>2&&a[2]!==void 0?a[2]:{},e&&(t=hy(t,e,n)),zf[t]=zf[t]||cM(t),o.next=6,zf[t];case 6:return o.abrupt("return",o.sent);case 7:case"end":return o.stop()}},r)})),Wf.apply(this,arguments)}function hy(r,t,e){if(r.startsWith("http"))return r;var n=e.modules||{};return n[r]?n[r]:tr?e.CDN?(Xe(e.CDN.startsWith("http")),"".concat(e.CDN,"/").concat(t,"@").concat(lM,"/dist/libs/").concat(r)):Ia?"../src/libs/".concat(r):"modules/".concat(t,"/src/libs/").concat(r):"modules/".concat(t,"/dist/libs/").concat(r)}function cM(r){return Jf.apply(this,arguments)}function Jf(){return Jf=(0,qf.default)(ka.default.mark(function r(t){var e,n,a;return ka.default.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 e=o.sent,o.next=6,e.arrayBuffer();case 6:return o.abrupt("return",o.sent);case 7:if(tr){o.next=20;break}if(o.prev=8,o.t0=Yt&&Yt.requireFromFile,!o.t0){o.next=14;break}return o.next=13,Yt.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(!Ia){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 a=o.sent,o.abrupt("return",hM(a,t));case 29:case"end":return o.stop()}},r,null,[[8,17]])})),Jf.apply(this,arguments)}function hM(r,t){if(!tr)return Yt.requireFromString&&Yt.requireFromString(r,t);if(Ia)return eval.call(Ng,r),null;var e=document.createElement("script");e.id=t;try{e.appendChild(document.createTextNode(r))}catch{e.text=r}return document.body.appendChild(e),null}var Yf=m(K()),Da=m(J());function Qf(r,t){return!La.isSupported()||!tr&&!(t!=null&&t._nodeWorkers)?!1:r.worker&&t?.worker}function $f(r,t,e,n,a){return Xf.apply(this,arguments)}function Xf(){return Xf=(0,Yf.default)(Da.default.mark(function r(t,e,n,a,i){var o,s,u,f,l,c;return Da.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return o=t.id,s=jf(t,n),u=La.getWorkerFarm(n),f=u.getWorkerPool({name:o,url:s}),n=JSON.parse(JSON.stringify(n)),a=JSON.parse(JSON.stringify(a||{})),d.next=8,f.startJob("process-on-worker",dM.bind(null,i));case 8:return l=d.sent,l.postMessage("process",{input:e,options:n,context:a}),d.next=12,l.result;case 12:return c=d.sent,d.next=15,c.result;case 15:return d.abrupt("return",d.sent);case 16:case"end":return d.stop()}},r)})),Xf.apply(this,arguments)}function dM(r,t,e,n){return Kf.apply(this,arguments)}function Kf(){return Kf=(0,Yf.default)(Da.default.mark(function r(t,e,n,a){var i,o,s,u,f;return Da.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:c.t0=n,c.next=c.t0==="done"?3:c.t0==="error"?5:c.t0==="process"?7:20;break;case 3:return e.done(a),c.abrupt("break",21);case 5:return e.error(new Error(a.error)),c.abrupt("break",21);case 7:return i=a.id,o=a.input,s=a.options,c.prev=8,c.next=11,t(o,s);case 11:u=c.sent,e.postMessage("done",{id:i,result:u}),c.next=19;break;case 15:c.prev=15,c.t1=c.catch(8),f=c.t1 instanceof Error?c.t1.message:"unknown error",e.postMessage("error",{id:i,error:f});case 19:return c.abrupt("break",21);case 20:console.warn("parse-with-worker unknown message ".concat(n));case 21:case"end":return c.stop()}},r,null,[[8,15]])})),Kf.apply(this,arguments)}function py(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5;if(typeof r=="string")return r.slice(0,t);if(ArrayBuffer.isView(r))return dy(r.buffer,r.byteOffset,t);if(r instanceof ArrayBuffer){var e=0;return dy(r,e,t)}return""}function dy(r,t,e){if(r.byteLength<=t+e)return"";for(var n=new DataView(r),a="",i=0;i<e;i++)a+=String.fromCharCode(n.getUint8(t+i));return a}function Zf(r){try{return JSON.parse(r)}catch{throw new Error('Failed to parse JSON from data starting with "'.concat(py(r),'"'))}}var yy=m(Re());var my=m(Re());function el(r){return r&&(0,my.default)(r)==="object"&&r.isBuffer}function vy(r){if(el(r)){var t=new Uint8Array(r.buffer,r.byteOffset,r.length);return t.slice().buffer}return r}function pM(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=mM(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function mM(r,t){if(r){if(typeof r=="string")return gy(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return gy(r,t)}}function gy(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function Eo(r){if(el(r))return vy(r);if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r))return r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);if(typeof r=="string"){var t=r,e=new TextEncoder().encode(t);return e.buffer}if(r&&(0,yy.default)(r)==="object"&&r._toArrayBuffer)return r._toArrayBuffer();throw new Error("toArrayBuffer")}function rl(r,t,e){if(e=e||r.byteLength,r.byteLength<e||t.byteLength<e)return!1;for(var n=new Uint8Array(r),a=new Uint8Array(t),i=0;i<n.length;++i)if(n[i]!==a[i])return!1;return!0}function tl(){for(var r=arguments.length,t=new Array(r),e=0;e<r;e++)t[e]=arguments[e];var n=t.map(function(l){return l instanceof ArrayBuffer?new Uint8Array(l):l}),a=n.reduce(function(l,c){return l+c.byteLength},0),i=new Uint8Array(a),o=0,s=pM(n),u;try{for(s.s();!(u=s.n()).done;){var f=u.value;i.set(f,o),o+=f.byteLength}}catch(l){s.e(l)}finally{s.f()}return i.buffer}function Ga(){for(var r=arguments.length,t=new Array(r),e=0;e<r;e++)t[e]=arguments[e];var n=t,a=n&&n.length>1&&n[0].constructor||null;if(!a)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');for(var i=n.reduce(function(c,h){return c+h.length},0),o=new a(i),s=0,u=0,f=n;u<f.length;u++){var l=f[u];o.set(l,s),s+=l.length}return o}function Qt(r,t,e){var n=e!==void 0?new Uint8Array(r).subarray(t,t+e):new Uint8Array(r).subarray(t),a=new Uint8Array(n);return a.buffer}function Tt(r,t){return $(r>=0),$(t>0),r+(t-1)&~(t-1)}function nl(r,t,e){var n;if(r instanceof ArrayBuffer)n=new Uint8Array(r);else{var a=r.byteOffset,i=r.byteLength;n=new Uint8Array(r.buffer||r.arrayBuffer,a,i)}return t.set(n,e),e+Tt(n.byteLength,4)}var Ey=m(K()),Sy=m(Vf()),sl=m(J());function fl(r){return ul.apply(this,arguments)}function ul(){return ul=(0,Ey.default)(sl.default.mark(function r(t){var e,n,a,i,o,s,u;return sl.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:e=[],n=!1,a=!1,l.prev=3,o=(0,Sy.default)(t);case 5:return l.next=7,o.next();case 7:if(!(n=!(s=l.sent).done)){l.next=13;break}u=s.value,e.push(u);case 10:n=!1,l.next=5;break;case 13:l.next=19;break;case 15:l.prev=15,l.t0=l.catch(3),a=!0,i=l.t0;case 19:if(l.prev=19,l.prev=20,!(n&&o.return!=null)){l.next=24;break}return l.next=24,o.return();case 24:if(l.prev=24,!a){l.next=27;break}throw i;case 27:return l.finish(24);case 28:return l.finish(19);case 29:return l.abrupt("return",tl.apply(void 0,e));case 30:case"end":return l.stop()}},r,null,[[3,15,19,29],[20,,24,28]])})),ul.apply(this,arguments)}var Iy=m(W()),Ry=m(V()),Fy=m(z());var By=m(V()),My=m(z());var wy=m(V()),Cy=m(z());function Na(){var r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){var t=process.hrtime();r=t[0]*1e3+t[1]/1e6}else r=Date.now();return r}var So=function(){function r(t,e){(0,wy.default)(this,r),g(this,"name",void 0),g(this,"type",void 0),g(this,"sampleSize",1),g(this,"time",void 0),g(this,"count",void 0),g(this,"samples",void 0),g(this,"lastTiming",void 0),g(this,"lastSampleTime",void 0),g(this,"lastSampleCount",void 0),g(this,"_count",0),g(this,"_time",0),g(this,"_samples",0),g(this,"_startTime",0),g(this,"_timerPending",!1),this.name=t,this.type=e,this.reset()}return(0,Cy.default)(r,[{key:"setSampleSize",value:function(e){return this.sampleSize=e,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(e){return this._count+=e,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(e){return this._count-=e,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=Na(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Na()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value: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}},{key:"_checkSampling",value: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)}}]),r}();var $t=function(){function r(t){(0,By.default)(this,r),g(this,"id",void 0),g(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}return(0,My.default)(r,[{key:"get",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:e,type:n})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var n in this.stats)e(this.stats[n])}},{key:"getTable",value:function(){var e={};return this.forEach(function(n){e[n.name]={time:n.time||0,count:n.count||0,average:n.getAverageTime()||0,hz:n.getHz()||0}}),e}},{key:"_initializeStats",value:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];n.forEach(function(a){return e._getOrCreate(a)})}},{key:"_getOrCreate",value:function(e){if(!e||!e.name)return null;var n=e.name,a=e.type;return this.stats[n]||(e instanceof So?this.stats[n]=e:this.stats[n]=new So(n,a)),this.stats[n]}}]),r}();function Oy(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function Py(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Oy(Object(e),!0).forEach(function(n){(0,Iy.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):Oy(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var TM="Queued Requests",xM="Active Requests",EM="Cancelled Requests",SM="Queued Requests Ever",wM="Active Requests Ever",CM={id:"request-scheduler",throttleRequests:!0,maxRequests:6},ja=function(){function r(){(0,Ry.default)(this,r);var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};g(this,"props",void 0),g(this,"stats",void 0),g(this,"activeRequestCount",0),g(this,"requestQueue",[]),g(this,"requestMap",new Map),g(this,"deferredUpdate",null),this.props=Py(Py({},CM),t),this.stats=new $t({id:this.props.id}),this.stats.get(TM),this.stats.get(xM),this.stats.get(EM),this.stats.get(SM),this.stats.get(wM)}return(0,Fy.default)(r,[{key:"scheduleRequest",value:function(e){var n=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(e))return this.requestMap.get(e);var a={handle:e,priority:0,getPriority:n},i=new Promise(function(o){return a.resolve=o,a});return this.requestQueue.push(a),this.requestMap.set(e,i),this._issueNewRequests(),i}},{key:"_issueRequest",value:function(e){var n=this,a=e.handle,i=e.resolve,o=!1,s=function(){o||(o=!0,n.requestMap.delete(a),n.activeRequestCount--,n._issueNewRequests())};return this.activeRequestCount++,i?i({done:s}):Promise.resolve({done:s})}},{key:"_issueNewRequests",value:function(){var e=this;this.deferredUpdate||(this.deferredUpdate=setTimeout(function(){return e._issueNewRequestsAsync()},0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(e!==0){this._updateAllRequests();for(var n=0;n<e;++n){var a=this.requestQueue.shift();a&&this._issueRequest(a)}}}},{key:"_updateAllRequests",value:function(){for(var e=this.requestQueue,n=0;n<e.length;++n){var a=e[n];this._updateRequest(a)||(e.splice(n,1),this.requestMap.delete(a.handle),n--)}e.sort(function(i,o){return i.priority-o.priority})}},{key:"_updateRequest",value:function(e){return e.priority=e.getPriority(e.handle),e.priority<0?(e.resolve(null),!1):!0}}]),r}();var BM="",Ly={};function ll(r){for(var t in Ly)if(r.startsWith(t)){var e=Ly[t];r=r.replace(t,e)}return!r.startsWith("http://")&&!r.startsWith("https://")&&(r="".concat(BM).concat(r)),r}var xt={};Cr(xt,{dirname:()=>OM,filename:()=>MM,join:()=>PM});function MM(r){var t=r&&r.lastIndexOf("/");return t>=0?r.substr(t+1):""}function OM(r){var t=r&&r.lastIndexOf("/");return t>=0?r.substr(0,t):""}function PM(){for(var r=arguments.length,t=new Array(r),e=0;e<r;e++)t[e]=arguments[e];var n="/";return t=t.map(function(a,i){return i&&(a=a.replace(new RegExp("^".concat(n)),"")),i!==t.length-1&&(a=a.replace(new RegExp("".concat(n,"$")),"")),a}),t.join(n)}function je(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function ky(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Ve(r,t,e){return t&&ky(r.prototype,t),e&&ky(r,e),r}function Va(r,t){return Va=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},Va(r,t)}function He(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),t&&Va(r,t)}function Zt(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Zt=function(e){return typeof e}:Zt=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zt(r)}function cl(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function ze(r,t){if(t&&(Zt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cl(r)}function me(r){return me=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},me(r)}function ue(r,t){if(!r)throw new Error("math.gl assertion ".concat(t))}var IM=1/Math.PI*180,RM=1/180*Math.PI,Ae={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function hl(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t.precision,n=e===void 0?Ae.precision:e;return r=FM(r),"".concat(parseFloat(r.toPrecision(n)))}function nr(r){return Array.isArray(r)||ArrayBuffer.isView(r)&&!(r instanceof DataView)}function dl(r){return Dy(r)}function pl(r){return en(r)}function Dy(r,t){return ml(r,function(e){return e*RM},t)}function en(r,t){return ml(r,function(e){return e*IM},t)}function wo(r,t,e){return ml(r,function(n){return Math.max(t,Math.min(e,n))})}function Et(r,t,e){return nr(r)?r.map(function(n,a){return Et(n,t[a],e)}):e*t+(1-e)*r}function We(r,t,e){var n=Ae.EPSILON;e&&(Ae.EPSILON=e);try{if(r===t)return!0;if(nr(r)&&nr(t)){if(r.length!==t.length)return!1;for(var a=0;a<r.length;++a)if(!We(r[a],t[a]))return!1;return!0}return r&&r.equals?r.equals(t):t&&t.equals?t.equals(r):typeof r=="number"&&typeof t=="number"?Math.abs(r-t)<=Ae.EPSILON*Math.max(1,Math.abs(r),Math.abs(t)):!1}finally{Ae.EPSILON=n}}function FM(r){return Math.round(r/Ae.EPSILON)*Ae.EPSILON}function LM(r){return r.clone?r.clone():new Array(r.length)}function ml(r,t,e){if(nr(r)){var n=r;e=e||LM(n);for(var a=0;a<e.length&&a<n.length;++a)e[a]=t(r[a],a,e);return e}return t(r)}function kM(r){var t=DM();return function(){var n=me(r),a;if(t){var i=me(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return ze(this,a)}}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 GM(r){function t(){var e=Reflect.construct(r,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return t.prototype=Object.create(r.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,r):t.__proto__=r,t}var qn=function(r){He(e,r);var t=kM(e);function e(){return je(this,e),t.apply(this,arguments)}return Ve(e,[{key:"clone",value:function(){return new this.constructor().copy(this)}},{key:"fromArray",value:function(a){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=0;o<this.ELEMENTS;++o)this[o]=a[o+i];return this.check()}},{key:"toArray",value:function(){for(var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=0;o<this.ELEMENTS;++o)a[i+o]=this[o];return a}},{key:"from",value:function(a){return Array.isArray(a)?this.copy(a):this.fromObject(a)}},{key:"to",value:function(a){return a===this?this:nr(a)?this.toArray(a):this.toObject(a)}},{key:"toTarget",value:function(a){return a?this.to(a):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(Ae)}},{key:"formatString",value:function(a){for(var i="",o=0;o<this.ELEMENTS;++o)i+=(o>0?", ":"")+hl(this[o],a);return"".concat(a.printTypes?this.constructor.name:"","[").concat(i,"]")}},{key:"equals",value:function(a){if(!a||this.length!==a.length)return!1;for(var i=0;i<this.ELEMENTS;++i)if(!We(this[i],a[i]))return!1;return!0}},{key:"exactEquals",value:function(a){if(!a||this.length!==a.length)return!1;for(var i=0;i<this.ELEMENTS;++i)if(this[i]!==a[i])return!1;return!0}},{key:"negate",value:function(){for(var a=0;a<this.ELEMENTS;++a)this[a]=-this[a];return this.check()}},{key:"lerp",value:function(a,i,o){if(o===void 0)return this.lerp(this,a,i);for(var s=0;s<this.ELEMENTS;++s){var u=a[s];this[s]=u+o*(i[s]-u)}return this.check()}},{key:"min",value:function(a){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.min(a[i],this[i]);return this.check()}},{key:"max",value:function(a){for(var i=0;i<this.ELEMENTS;++i)this[i]=Math.max(a[i],this[i]);return this.check()}},{key:"clamp",value:function(a,i){for(var o=0;o<this.ELEMENTS;++o)this[o]=Math.min(Math.max(this[o],a[o]),i[o]);return this.check()}},{key:"add",value:function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];for(var s=0,u=i;s<u.length;s++)for(var f=u[s],l=0;l<this.ELEMENTS;++l)this[l]+=f[l];return this.check()}},{key:"subtract",value:function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];for(var s=0,u=i;s<u.length;s++)for(var f=u[s],l=0;l<this.ELEMENTS;++l)this[l]-=f[l];return this.check()}},{key:"scale",value:function(a){if(typeof a=="number")for(var i=0;i<this.ELEMENTS;++i)this[i]*=a;else for(var o=0;o<this.ELEMENTS&&o<a.length;++o)this[o]*=a[o];return this.check()}},{key:"multiplyByScalar",value:function(a){for(var i=0;i<this.ELEMENTS;++i)this[i]*=a;return this.check()}},{key:"check",value:function(){if(Ae.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"validate",value:function(){for(var a=this.length===this.ELEMENTS,i=0;i<this.ELEMENTS;++i)a=a&&Number.isFinite(this[i]);return a}},{key:"sub",value:function(a){return this.subtract(a)}},{key:"setScalar",value:function(a){for(var i=0;i<this.ELEMENTS;++i)this[i]=a;return this.check()}},{key:"addScalar",value:function(a){for(var i=0;i<this.ELEMENTS;++i)this[i]+=a;return this.check()}},{key:"subScalar",value:function(a){return this.addScalar(-a)}},{key:"multiplyScalar",value:function(a){for(var i=0;i<this.ELEMENTS;++i)this[i]*=a;return this.check()}},{key:"divideScalar",value:function(a){return this.multiplyByScalar(1/a)}},{key:"clampScalar",value:function(a,i){for(var o=0;o<this.ELEMENTS;++o)this[o]=Math.min(Math.max(this[o],a),i);return this.check()}},{key:"elements",get:function(){return this}}]),e}(GM(Array));function UM(r,t){if(r.length!==t)return!1;for(var e=0;e<r.length;++e)if(!Number.isFinite(r[e]))return!1;return!0}function ie(r){if(!Number.isFinite(r))throw new Error("Invalid number ".concat(r));return r}function St(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(Ae.debug&&!UM(r,t))throw new Error("math.gl: ".concat(e," some fields set to invalid numbers'"));return r}function NM(r){var t=jM();return function(){var n=me(r),a;if(t){var i=me(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return ze(this,a)}}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}}var Xn=function(r){He(e,r);var t=NM(e);function e(){return je(this,e),t.apply(this,arguments)}return Ve(e,[{key:"x",get:function(){return this[0]},set:function(a){this[0]=ie(a)}},{key:"y",get:function(){return this[1]},set:function(a){this[1]=ie(a)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var a=0,i=0;i<this.ELEMENTS;++i)a+=this[i]*this[i];return a}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(a){return Math.sqrt(this.distanceSquared(a))}},{key:"distanceSquared",value:function(a){for(var i=0,o=0;o<this.ELEMENTS;++o){var s=this[o]-a[o];i+=s*s}return ie(i)}},{key:"dot",value:function(a){for(var i=0,o=0;o<this.ELEMENTS;++o)i+=this[o]*a[o];return ie(i)}},{key:"normalize",value:function(){var a=this.magnitude();if(a!==0)for(var i=0;i<this.ELEMENTS;++i)this[i]/=a;return this.check()}},{key:"multiply",value:function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];for(var s=0,u=i;s<u.length;s++)for(var f=u[s],l=0;l<this.ELEMENTS;++l)this[l]*=f[l];return this.check()}},{key:"divide",value:function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];for(var s=0,u=i;s<u.length;s++)for(var f=u[s],l=0;l<this.ELEMENTS;++l)this[l]/=f[l];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(a){return this.distance(a)}},{key:"distanceToSquared",value:function(a){return this.distanceSquared(a)}},{key:"getComponent",value:function(a){return ue(a>=0&&a<this.ELEMENTS,"index is out of range"),ie(this[a])}},{key:"setComponent",value:function(a,i){return ue(a>=0&&a<this.ELEMENTS,"index is out of range"),this[a]=i,this.check()}},{key:"addVectors",value:function(a,i){return this.copy(a).add(i)}},{key:"subVectors",value:function(a,i){return this.copy(a).subtract(i)}},{key:"multiplyVectors",value:function(a,i){return this.copy(a).multiply(i)}},{key:"addScaledVector",value:function(a,i){return this.add(new this.constructor(a).multiplyScalar(i))}}]),e}(qn);function Co(r,t,e){var n=t[0],a=t[1],i=e[3]*n+e[7]*a||1;return r[0]=(e[0]*n+e[4]*a)/i,r[1]=(e[1]*n+e[5]*a)/i,r}function Bo(r,t,e){var n=t[0],a=t[1],i=t[2],o=e[3]*n+e[7]*a+e[11]*i||1;return r[0]=(e[0]*n+e[4]*a+e[8]*i)/o,r[1]=(e[1]*n+e[5]*a+e[9]*i)/o,r[2]=(e[2]*n+e[6]*a+e[10]*i)/o,r}function Gy(r,t,e){var n=t[0],a=t[1];return r[0]=e[0]*n+e[2]*a,r[1]=e[1]*n+e[3]*a,r[2]=t[2],r}function Uy(r,t,e){var n=t[0],a=t[1];return r[0]=e[0]*n+e[2]*a,r[1]=e[1]*n+e[3]*a,r[2]=t[2],r[3]=t[3],r}function Mo(r,t,e){var n=t[0],a=t[1],i=t[2];return r[0]=e[0]*n+e[3]*a+e[6]*i,r[1]=e[1]*n+e[4]*a+e[7]*i,r[2]=e[2]*n+e[5]*a+e[8]*i,r[3]=t[3],r}function VM(r){var t=HM();return function(){var n=me(r),a;if(t){var i=me(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return ze(this,a)}}function HM(){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}}var rn=function(r){He(e,r);var t=VM(e);function e(){var n,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return je(this,e),n=t.call(this,2),nr(a)&&arguments.length===1?n.copy(a):(Ae.debug&&(ie(a),ie(i)),n[0]=a,n[1]=i),n}return Ve(e,[{key:"set",value:function(a,i){return this[0]=a,this[1]=i,this.check()}},{key:"copy",value:function(a){return this[0]=a[0],this[1]=a[1],this.check()}},{key:"fromObject",value:function(a){return Ae.debug&&(ie(a.x),ie(a.y)),this[0]=a.x,this[1]=a.y,this.check()}},{key:"toObject",value:function(a){return a.x=this[0],a.y=this[1],a}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(a){return this.transformAsPoint(a)}},{key:"transformAsPoint",value:function(a){return ho(this,this,a),this.check()}},{key:"transformAsVector",value:function(a){return Co(this,this,a),this.check()}},{key:"transformByMatrix3",value:function(a){return co(this,this,a),this.check()}},{key:"transformByMatrix2x3",value:function(a){return fg(this,this,a),this.check()}},{key:"transformByMatrix2",value:function(a){return ug(this,this,a),this.check()}}]),e}(Xn);function zM(r){var t=WM();return function(){var n=me(r),a;if(t){var i=me(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return ze(this,a)}}function WM(){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}}var vl=[0,0,0],Oo,w=function(r){He(e,r);var t=zM(e);function e(){var n,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return je(this,e),n=t.call(this,-0,-0,-0),arguments.length===1&&nr(a)?n.copy(a):(Ae.debug&&(ie(a),ie(i),ie(o)),n[0]=a,n[1]=i,n[2]=o),n}return Ve(e,[{key:"set",value:function(a,i,o){return this[0]=a,this[1]=i,this[2]=o,this.check()}},{key:"copy",value:function(a){return this[0]=a[0],this[1]=a[1],this[2]=a[2],this.check()}},{key:"fromObject",value:function(a){return Ae.debug&&(ie(a.x),ie(a.y),ie(a.z)),this[0]=a.x,this[1]=a.y,this[2]=a.z,this.check()}},{key:"toObject",value:function(a){return a.x=this[0],a.y=this[1],a.z=this[2],a}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(a){this[2]=ie(a)}},{key:"angle",value:function(a){return vg(this,a)}},{key:"cross",value:function(a){return Hn(this,this,a),this.check()}},{key:"rotateX",value:function(a){var i=a.radians,o=a.origin,s=o===void 0?vl:o;return dg(this,this,s,i),this.check()}},{key:"rotateY",value:function(a){var i=a.radians,o=a.origin,s=o===void 0?vl:o;return pg(this,this,s,i),this.check()}},{key:"rotateZ",value:function(a){var i=a.radians,o=a.origin,s=o===void 0?vl:o;return mg(this,this,s,i),this.check()}},{key:"transform",value:function(a){return this.transformAsPoint(a)}},{key:"transformAsPoint",value:function(a){return zn(this,this,a),this.check()}},{key:"transformAsVector",value:function(a){return Bo(this,this,a),this.check()}},{key:"transformByMatrix3",value:function(a){return po(this,this,a),this.check()}},{key:"transformByMatrix2",value:function(a){return Gy(this,this,a),this.check()}},{key:"transformByQuaternion",value:function(a){return mo(this,this,a),this.check()}}],[{key:"ZERO",get:function(){return Oo||(Oo=new e(0,0,0),Object.freeze(Oo)),Oo}}]),e}(Xn);function JM(r){var t=qM();return function(){var n=me(r),a;if(t){var i=me(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return ze(this,a)}}function qM(){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}}var Po,Ny=function(r){He(e,r);var t=JM(e);function e(){var n,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return je(this,e),n=t.call(this,-0,-0,-0,-0),nr(a)&&arguments.length===1?n.copy(a):(Ae.debug&&(ie(a),ie(i),ie(o),ie(s)),n[0]=a,n[1]=i,n[2]=o,n[3]=s),n}return Ve(e,[{key:"set",value:function(a,i,o,s){return this[0]=a,this[1]=i,this[2]=o,this[3]=s,this.check()}},{key:"copy",value:function(a){return this[0]=a[0],this[1]=a[1],this[2]=a[2],this[3]=a[3],this.check()}},{key:"fromObject",value:function(a){return Ae.debug&&(ie(a.x),ie(a.y),ie(a.z),ie(a.w)),this[0]=a.x,this[1]=a.y,this[2]=a.z,this[3]=a.w,this}},{key:"toObject",value:function(a){return a.x=this[0],a.y=this[1],a.z=this[2],a.w=this[3],a}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(a){this[2]=ie(a)}},{key:"w",get:function(){return this[3]},set:function(a){this[3]=ie(a)}},{key:"transform",value:function(a){return zn(this,this,a),this.check()}},{key:"transformByMatrix3",value:function(a){return Mo(this,this,a),this.check()}},{key:"transformByMatrix2",value:function(a){return Uy(this,this,a),this.check()}},{key:"transformByQuaternion",value:function(a){return mo(this,this,a),this.check()}},{key:"applyMatrix4",value:function(a){return a.transform(this,this),this}}],[{key:"ZERO",get:function(){return Po||(Po=new e(0,0,0,0),Object.freeze(Po)),Po}}]),e}(Xn);function XM(r){var t=KM();return function(){var n=me(r),a;if(t){var i=me(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return ze(this,a)}}function KM(){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}}var Io=function(r){He(e,r);var t=XM(e);function e(){return je(this,e),t.apply(this,arguments)}return Ve(e,[{key:"toString",value:function(){var a="[";if(Ae.printRowMajor){a+="row-major:";for(var i=0;i<this.RANK;++i)for(var o=0;o<this.RANK;++o)a+=" ".concat(this[o*this.RANK+i])}else{a+="column-major:";for(var s=0;s<this.ELEMENTS;++s)a+=" ".concat(this[s])}return a+="]",a}},{key:"getElementIndex",value:function(a,i){return i*this.RANK+a}},{key:"getElement",value:function(a,i){return this[i*this.RANK+a]}},{key:"setElement",value:function(a,i,o){return this[i*this.RANK+a]=ie(o),this}},{key:"getColumn",value:function(a){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Array(this.RANK).fill(-0),o=a*this.RANK,s=0;s<this.RANK;++s)i[s]=this[o+s];return i}},{key:"setColumn",value:function(a,i){for(var o=a*this.RANK,s=0;s<this.RANK;++s)this[o+s]=i[s];return this}}]),e}(qn);function jy(){var r=new Qe(9);return Qe!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function Vy(r,t){if(r===t){var e=t[1],n=t[2],a=t[5];r[1]=t[3],r[2]=t[6],r[3]=e,r[5]=t[7],r[6]=n,r[7]=a}else r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8];return r}function Hy(r,t){var e=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5],u=t[6],f=t[7],l=t[8],c=l*o-s*f,h=-l*i+s*u,d=f*i-o*u,p=e*c+n*h+a*d;return p?(p=1/p,r[0]=c*p,r[1]=(-l*n+a*f)*p,r[2]=(s*n-a*o)*p,r[3]=h*p,r[4]=(l*e-a*u)*p,r[5]=(-s*e+a*i)*p,r[6]=d*p,r[7]=(-f*e+n*u)*p,r[8]=(o*e-n*i)*p,r):null}function zy(r){var t=r[0],e=r[1],n=r[2],a=r[3],i=r[4],o=r[5],s=r[6],u=r[7],f=r[8];return t*(f*i-o*u)+e*(-f*a+o*s)+n*(u*a-i*s)}function gl(r,t,e){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=t[8],h=e[0],d=e[1],p=e[2],v=e[3],y=e[4],A=e[5],_=e[6],E=e[7],x=e[8];return r[0]=h*n+d*o+p*f,r[1]=h*a+d*s+p*l,r[2]=h*i+d*u+p*c,r[3]=v*n+y*o+A*f,r[4]=v*a+y*s+A*l,r[5]=v*i+y*u+A*c,r[6]=_*n+E*o+x*f,r[7]=_*a+E*s+x*l,r[8]=_*i+E*u+x*c,r}function Wy(r,t,e){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=t[8],h=e[0],d=e[1];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=s,r[5]=u,r[6]=h*n+d*o+f,r[7]=h*a+d*s+l,r[8]=h*i+d*u+c,r}function Jy(r,t,e){var n=t[0],a=t[1],i=t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=t[8],h=Math.sin(e),d=Math.cos(e);return r[0]=d*n+h*o,r[1]=d*a+h*s,r[2]=d*i+h*u,r[3]=d*o-h*n,r[4]=d*s-h*a,r[5]=d*u-h*i,r[6]=f,r[7]=l,r[8]=c,r}function yl(r,t,e){var n=e[0],a=e[1];return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=a*t[3],r[4]=a*t[4],r[5]=a*t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function qy(r,t){var e=t[0],n=t[1],a=t[2],i=t[3],o=e+e,s=n+n,u=a+a,f=e*o,l=n*o,c=n*s,h=a*o,d=a*s,p=a*u,v=i*o,y=i*s,A=i*u;return r[0]=1-c-p,r[3]=l-A,r[6]=h+y,r[1]=l+A,r[4]=1-f-p,r[7]=d-v,r[2]=h-y,r[5]=d+v,r[8]=1-f-c,r}function YM(r){var t=QM();return function(){var n=me(r),a;if(t){var i=me(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return ze(this,a)}}function QM(){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}}var Al;(function(r){r[r.COL0ROW0=0]="COL0ROW0",r[r.COL0ROW1=1]="COL0ROW1",r[r.COL0ROW2=2]="COL0ROW2",r[r.COL1ROW0=3]="COL1ROW0",r[r.COL1ROW1=4]="COL1ROW1",r[r.COL1ROW2=5]="COL1ROW2",r[r.COL2ROW0=6]="COL2ROW0",r[r.COL2ROW1=7]="COL2ROW1",r[r.COL2ROW2=8]="COL2ROW2"})(Al||(Al={}));var $M=Object.freeze([1,0,0,0,1,0,0,0,1]),ve=function(r){He(e,r);var t=YM(e);function e(n){for(var a,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return je(this,e),a=t.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(n)?a.copy(n):o.length>0?a.copy([n].concat(o)):a.identity(),a}return Ve(e,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return Al}},{key:"copy",value: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()}},{key:"identity",value:function(){return this.copy($M)}},{key:"fromObject",value:function(a){return this.check()}},{key:"fromQuaternion",value:function(a){return qy(this,a),this.check()}},{key:"set",value:function(a,i,o,s,u,f,l,c,h){return this[0]=a,this[1]=i,this[2]=o,this[3]=s,this[4]=u,this[5]=f,this[6]=l,this[7]=c,this[8]=h,this.check()}},{key:"setRowMajor",value:function(a,i,o,s,u,f,l,c,h){return this[0]=a,this[1]=s,this[2]=l,this[3]=i,this[4]=u,this[5]=c,this[6]=o,this[7]=f,this[8]=h,this.check()}},{key:"determinant",value:function(){return zy(this)}},{key:"transpose",value:function(){return Vy(this,this),this.check()}},{key:"invert",value:function(){return Hy(this,this),this.check()}},{key:"multiplyLeft",value:function(a){return gl(this,a,this),this.check()}},{key:"multiplyRight",value:function(a){return gl(this,this,a),this.check()}},{key:"rotate",value:function(a){return Jy(this,this,a),this.check()}},{key:"scale",value:function(a){return Array.isArray(a)?yl(this,this,a):yl(this,this,[a,a]),this.check()}},{key:"translate",value:function(a){return Wy(this,this,a),this.check()}},{key:"transform",value:function(a,i){var o;switch(a.length){case 2:o=co(i||[-0,-0],a,this);break;case 3:o=po(i||[-0,-0,-0],a,this);break;case 4:o=Mo(i||[-0,-0,-0,-0],a,this);break;default:throw new Error("Illegal vector")}return St(o,a.length),o}},{key:"transformVector",value:function(a,i){return this.transform(a,i)}},{key:"transformVector2",value:function(a,i){return this.transform(a,i)}},{key:"transformVector3",value:function(a,i){return this.transform(a,i)}}],[{key:"IDENTITY",get:function(){return eO()}},{key:"ZERO",get:function(){return ZM()}}]),e}(Io);var Ro,Fo;function ZM(){return Ro||(Ro=new ve([0,0,0,0,0,0,0,0,0]),Object.freeze(Ro)),Ro}function eO(){return Fo||(Fo=new ve,Object.freeze(Fo)),Fo}function rO(r){var t=tO();return function(){var n=me(r),a;if(t){var i=me(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return ze(this,a)}}function tO(){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}}var Tl;(function(r){r[r.COL0ROW0=0]="COL0ROW0",r[r.COL0ROW1=1]="COL0ROW1",r[r.COL0ROW2=2]="COL0ROW2",r[r.COL0ROW3=3]="COL0ROW3",r[r.COL1ROW0=4]="COL1ROW0",r[r.COL1ROW1=5]="COL1ROW1",r[r.COL1ROW2=6]="COL1ROW2",r[r.COL1ROW3=7]="COL1ROW3",r[r.COL2ROW0=8]="COL2ROW0",r[r.COL2ROW1=9]="COL2ROW1",r[r.COL2ROW2=10]="COL2ROW2",r[r.COL2ROW3=11]="COL2ROW3",r[r.COL3ROW0=12]="COL3ROW0",r[r.COL3ROW1=13]="COL3ROW1",r[r.COL3ROW2=14]="COL3ROW2",r[r.COL3ROW3=15]="COL3ROW3"})(Tl||(Tl={}));var nO=45*Math.PI/180,aO=1,bl=.1,_l=500,iO=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Z=function(r){He(e,r);var t=rO(e);function e(n){var a;return je(this,e),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(n)?a.copy(n):a.identity(),a}return Ve(e,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return Tl}},{key:"copy",value: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()}},{key:"set",value:function(a,i,o,s,u,f,l,c,h,d,p,v,y,A,_,E){return this[0]=a,this[1]=i,this[2]=o,this[3]=s,this[4]=u,this[5]=f,this[6]=l,this[7]=c,this[8]=h,this[9]=d,this[10]=p,this[11]=v,this[12]=y,this[13]=A,this[14]=_,this[15]=E,this.check()}},{key:"setRowMajor",value:function(a,i,o,s,u,f,l,c,h,d,p,v,y,A,_,E){return this[0]=a,this[1]=u,this[2]=h,this[3]=y,this[4]=i,this[5]=f,this[6]=d,this[7]=A,this[8]=o,this[9]=l,this[10]=p,this[11]=_,this[12]=s,this[13]=c,this[14]=v,this[15]=E,this.check()}},{key:"toRowMajor",value: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}},{key:"identity",value:function(){return this.copy(iO)}},{key:"fromObject",value:function(a){return this.check()}},{key:"fromQuaternion",value:function(a){return ng(this,a),this.check()}},{key:"frustum",value:function(a){var i=a.left,o=a.right,s=a.bottom,u=a.top,f=a.near,l=f===void 0?bl:f,c=a.far,h=c===void 0?_l:c;return h===1/0?uO(this,i,o,s,u,l):ag(this,i,o,s,u,l,h),this.check()}},{key:"lookAt",value:function(a){var i=a.eye,o=a.center,s=o===void 0?[0,0,0]:o,u=a.up,f=u===void 0?[0,1,0]:u;return og(this,i,s,f),this.check()}},{key:"ortho",value:function(a){var i=a.left,o=a.right,s=a.bottom,u=a.top,f=a.near,l=f===void 0?bl:f,c=a.far,h=c===void 0?_l:c;return ig(this,i,o,s,u,l,h),this.check()}},{key:"orthographic",value:function(a){var i=a.fovy,o=i===void 0?nO:i,s=a.aspect,u=s===void 0?aO:s,f=a.focalDistance,l=f===void 0?1:f,c=a.near,h=c===void 0?bl:c,d=a.far,p=d===void 0?_l:d;Ky(o);var v=o/2,y=l*Math.tan(v),A=y*u;return this.ortho({left:-A,right:A,bottom:-y,top:y,near:h,far:p})}},{key:"perspective",value:function(a){var i=a.fovy,o=i===void 0?45*Math.PI/180:i,s=a.aspect,u=s===void 0?1:s,f=a.near,l=f===void 0?.1:f,c=a.far,h=c===void 0?500:c;return Ky(o),uo(this,o,u,l,h),this.check()}},{key:"determinant",value:function(){return Zv(this)}},{key:"getScale",value: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}},{key:"getTranslation",value: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}},{key:"getRotation",value:function(a,i){a=a||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],i=i||[-0,-0,-0];var o=this.getScale(i),s=1/o[0],u=1/o[1],f=1/o[2];return a[0]=this[0]*s,a[1]=this[1]*u,a[2]=this[2]*f,a[3]=0,a[4]=this[4]*s,a[5]=this[5]*u,a[6]=this[6]*f,a[7]=0,a[8]=this[8]*s,a[9]=this[9]*u,a[10]=this[10]*f,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}},{key:"getRotationMatrix3",value:function(a,i){a=a||[-0,-0,-0,-0,-0,-0,-0,-0,-0],i=i||[-0,-0,-0];var o=this.getScale(i),s=1/o[0],u=1/o[1],f=1/o[2];return a[0]=this[0]*s,a[1]=this[1]*u,a[2]=this[2]*f,a[3]=this[4]*s,a[4]=this[5]*u,a[5]=this[6]*f,a[6]=this[8]*s,a[7]=this[9]*u,a[8]=this[10]*f,a}},{key:"transpose",value:function(){return $v(this,this),this.check()}},{key:"invert",value:function(){return io(this,this),this.check()}},{key:"multiplyLeft",value:function(a){return Xt(this,a,this),this.check()}},{key:"multiplyRight",value:function(a){return Xt(this,this,a),this.check()}},{key:"rotateX",value:function(a){return oo(this,this,a),this.check()}},{key:"rotateY",value:function(a){return rg(this,this,a),this.check()}},{key:"rotateZ",value:function(a){return so(this,this,a),this.check()}},{key:"rotateXYZ",value:function(a){return this.rotateX(a[0]).rotateY(a[1]).rotateZ(a[2])}},{key:"rotateAxis",value:function(a,i){return eg(this,this,a,i),this.check()}},{key:"scale",value:function(a){return jn(this,this,Array.isArray(a)?a:[a,a,a]),this.check()}},{key:"translate",value:function(a){return Kt(this,this,a),this.check()}},{key:"transform",value:function(a,i){return a.length===4?(i=no(i||[-0,-0,-0,-0],a,this),St(i,4),i):this.transformAsPoint(a,i)}},{key:"transformAsPoint",value:function(a,i){var o=a.length,s;switch(o){case 2:s=ho(i||[-0,-0],a,this);break;case 3:s=zn(i||[-0,-0,-0],a,this);break;default:throw new Error("Illegal vector")}return St(s,a.length),s}},{key:"transformAsVector",value:function(a,i){var o;switch(a.length){case 2:o=Co(i||[-0,-0],a,this);break;case 3:o=Bo(i||[-0,-0,-0],a,this);break;default:throw new Error("Illegal vector")}return St(o,a.length),o}},{key:"transformPoint",value:function(a,i){return this.transformAsPoint(a,i)}},{key:"transformVector",value:function(a,i){return this.transformAsPoint(a,i)}},{key:"transformDirection",value:function(a,i){return this.transformAsVector(a,i)}},{key:"makeRotationX",value:function(a){return this.identity().rotateX(a)}},{key:"makeTranslation",value:function(a,i,o){return this.identity().translate([a,i,o])}}],[{key:"IDENTITY",get:function(){return sO()}},{key:"ZERO",get:function(){return oO()}}]),e}(Io);var Lo,ko;function oO(){return Lo||(Lo=new Z([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Lo)),Lo}function sO(){return ko||(ko=new Z,Object.freeze(ko)),ko}function Ky(r){if(r>Math.PI*2)throw Error("expected radians")}function uO(r,t,e,n,a,i){var o=2*i/(e-t),s=2*i/(a-n),u=(e+t)/(e-t),f=(a+n)/(a-n),l=-1,c=-1,h=-2*i;return r[0]=o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=u,r[9]=f,r[10]=l,r[11]=c,r[12]=0,r[13]=0,r[14]=h,r[15]=0,r}function Yy(){var r=new Qe(4);return Qe!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function Qy(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function xl(r,t,e){e=e*.5;var n=Math.sin(e);return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=Math.cos(e),r}function El(r,t,e){var n=t[0],a=t[1],i=t[2],o=t[3],s=e[0],u=e[1],f=e[2],l=e[3];return r[0]=n*l+o*s+a*f-i*u,r[1]=a*l+o*u+i*s-n*f,r[2]=i*l+o*f+n*u-a*s,r[3]=o*l-n*s-a*u-i*f,r}function $y(r,t,e){e*=.5;var n=t[0],a=t[1],i=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+o*s,r[1]=a*u+i*s,r[2]=i*u-a*s,r[3]=o*u-n*s,r}function Zy(r,t,e){e*=.5;var n=t[0],a=t[1],i=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u-i*s,r[1]=a*u+o*s,r[2]=i*u+n*s,r[3]=o*u-a*s,r}function e0(r,t,e){e*=.5;var n=t[0],a=t[1],i=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+a*s,r[1]=a*u-n*s,r[2]=i*u+o*s,r[3]=o*u-i*s,r}function r0(r,t){var e=t[0],n=t[1],a=t[2];return r[0]=e,r[1]=n,r[2]=a,r[3]=Math.sqrt(Math.abs(1-e*e-n*n-a*a)),r}function Ha(r,t,e,n){var a=t[0],i=t[1],o=t[2],s=t[3],u=e[0],f=e[1],l=e[2],c=e[3],h,d,p,v,y;return d=a*u+i*f+o*l+s*c,d<0&&(d=-d,u=-u,f=-f,l=-l,c=-c),1-d>ye?(h=Math.acos(d),p=Math.sin(h),v=Math.sin((1-n)*h)/p,y=Math.sin(n*h)/p):(v=1-n,y=n),r[0]=v*a+y*u,r[1]=v*i+y*f,r[2]=v*o+y*l,r[3]=v*s+y*c,r}function t0(r,t){var e=t[0],n=t[1],a=t[2],i=t[3],o=e*e+n*n+a*a+i*i,s=o?1/o:0;return r[0]=-e*s,r[1]=-n*s,r[2]=-a*s,r[3]=i*s,r}function n0(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r}function Sl(r,t){var e=t[0]+t[4]+t[8],n;if(e>0)n=Math.sqrt(e+1),r[3]=.5*n,n=.5/n,r[0]=(t[5]-t[7])*n,r[1]=(t[6]-t[2])*n,r[2]=(t[1]-t[3])*n;else{var a=0;t[4]>t[0]&&(a=1),t[8]>t[a*3+a]&&(a=2);var i=(a+1)%3,o=(a+2)%3;n=Math.sqrt(t[a*3+a]-t[i*3+i]-t[o*3+o]+1),r[a]=.5*n,n=.5/n,r[3]=(t[i*3+o]-t[o*3+i])*n,r[i]=(t[i*3+a]+t[a*3+i])*n,r[o]=(t[o*3+a]+t[a*3+o])*n}return r}var a0=Wv;var i0=to,o0=Kv,s0=Yv,u0=Jv;var f0=qv;var l0=Xv;var c0=function(){var r=xf(),t=Sf(1,0,0),e=Sf(0,1,0);return function(n,a,i){var o=Oa(a,i);return o<-.999999?(Hn(r,t,a),yg(r)<1e-6&&Hn(r,e,a),hg(r,r),xl(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Hn(r,a,i),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,l0(n,n))}}(),lj=function(){var r=Yy(),t=Yy();return function(e,n,a,i,o,s){return Ha(r,n,o,s),Ha(t,a,i,s),Ha(e,r,t,2*s*(1-s)),e}}(),cj=function(){var r=jy();return function(t,e,n,a){return r[0]=n[0],r[3]=n[1],r[6]=n[2],r[1]=a[0],r[4]=a[1],r[7]=a[2],r[2]=-e[0],r[5]=-e[1],r[8]=-e[2],l0(t,Sl(t,r))}}();function lO(r){var t=cO();return function(){var n=me(r),a;if(t){var i=me(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return ze(this,a)}}function cO(){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}}var hO=[0,0,0,1],wt=function(r){He(e,r);var t=lO(e);function e(){var n,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;return je(this,e),n=t.call(this,-0,-0,-0,-0),Array.isArray(a)&&arguments.length===1?n.copy(a):n.set(a,i,o,s),n}return Ve(e,[{key:"copy",value:function(a){return this[0]=a[0],this[1]=a[1],this[2]=a[2],this[3]=a[3],this.check()}},{key:"set",value:function(a,i,o,s){return this[0]=a,this[1]=i,this[2]=o,this[3]=s,this.check()}},{key:"fromObject",value:function(a){return this[0]=a.x,this[1]=a.y,this[2]=a.z,this[3]=a.w,this.check()}},{key:"fromMatrix3",value:function(a){return Sl(this,a),this.check()}},{key:"fromAxisRotation",value:function(a,i){return xl(this,a,i),this.check()}},{key:"identity",value:function(){return Qy(this),this.check()}},{key:"setAxisAngle",value:function(a,i){return this.fromAxisRotation(a,i)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(a){this[0]=ie(a)}},{key:"y",get:function(){return this[1]},set:function(a){this[1]=ie(a)}},{key:"z",get:function(){return this[2]},set:function(a){this[2]=ie(a)}},{key:"w",get:function(){return this[3]},set:function(a){this[3]=ie(a)}},{key:"len",value:function(){return u0(this)}},{key:"lengthSquared",value:function(){return f0(this)}},{key:"dot",value:function(a){return o0(this,a)}},{key:"rotationTo",value:function(a,i){return c0(this,a,i),this.check()}},{key:"add",value:function(a){return a0(this,this,a),this.check()}},{key:"calculateW",value:function(){return r0(this,this),this.check()}},{key:"conjugate",value:function(){return n0(this,this),this.check()}},{key:"invert",value:function(){return t0(this,this),this.check()}},{key:"lerp",value:function(a,i,o){return o===void 0?this.lerp(this,a,i):(s0(this,a,i,o),this.check())}},{key:"multiplyRight",value:function(a){return El(this,this,a),this.check()}},{key:"multiplyLeft",value:function(a){return El(this,a,this),this.check()}},{key:"normalize",value:function(){var a=this.len(),i=a>0?1/a:0;return this[0]=this[0]*i,this[1]=this[1]*i,this[2]=this[2]*i,this[3]=this[3]*i,a===0&&(this[3]=1),this.check()}},{key:"rotateX",value:function(a){return $y(this,this,a),this.check()}},{key:"rotateY",value:function(a){return Zy(this,this,a),this.check()}},{key:"rotateZ",value:function(a){return e0(this,this,a),this.check()}},{key:"scale",value:function(a){return i0(this,this,a),this.check()}},{key:"slerp",value:function(a,i,o){var s,u,f;switch(arguments.length){case 1:var l=a.start;s=l===void 0?hO:l,u=a.target,f=a.ratio;break;case 2:s=this,u=a,f=i;break;default:s=a,u=i,f=o}return Ha(this,s,u,f),this.check()}},{key:"transformVector4",value:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Ny;return Qv(i,a,this),St(i,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(a,i){return this.setAxisAngle(a,i)}},{key:"premultiply",value:function(a){return this.multiplyLeft(a)}},{key:"multiply",value:function(a){return this.multiplyRight(a)}}]),e}(qn);var zr={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};var h0=m(K()),d0=m(V()),p0=m(z()),Je=m(W()),wl=m(J()),za=function(){function r(t){(0,d0.default)(this,r),(0,Je.default)(this,"index",void 0),(0,Je.default)(this,"isVisible",void 0),(0,Je.default)(this,"isSelected",void 0),(0,Je.default)(this,"parent",void 0),(0,Je.default)(this,"children",void 0),(0,Je.default)(this,"content",void 0),(0,Je.default)(this,"state",void 0),(0,Je.default)(this,"layers",void 0),(0,Je.default)(this,"id",void 0),(0,Je.default)(this,"bbox",void 0),(0,Je.default)(this,"zoom",void 0),(0,Je.default)(this,"userData",void 0),(0,Je.default)(this,"_abortController",void 0),(0,Je.default)(this,"_loader",void 0),(0,Je.default)(this,"_loaderId",void 0),(0,Je.default)(this,"_isLoaded",void 0),(0,Je.default)(this,"_isCancelled",void 0),(0,Je.default)(this,"_needsReload",void 0),this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}return(0,p0.default)(r,[{key:"data",get:function(){var e=this;return this.isLoading&&this._loader?this._loader.then(function(){return e.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 e=this.content?this.content.byteLength:0;return Number.isFinite(e)||console.error("byteLength not defined in tile data"),e}},{key:"_loadData",value:function(){var t=(0,h0.default)(wl.default.mark(function n(a){var i,o,s,u,f,l,c,h,d,p,v,y,A,_;return wl.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return i=a.getData,o=a.requestScheduler,s=a.onLoad,u=a.onError,f=this.index,l=this.id,c=this.bbox,h=this.userData,d=this.zoom,p=this._loaderId,this._abortController=new AbortController,v=this._abortController.signal,x.next=7,o.scheduleRequest(this,function(C){return C.isSelected?1:-1});case 7:if(y=x.sent,y){x.next=11;break}return this._isCancelled=!0,x.abrupt("return");case 11:if(!this._isCancelled){x.next=14;break}return y.done(),x.abrupt("return");case 14:return A=null,x.prev=15,x.next=18,i({index:f,id:l,bbox:c,userData:h,zoom:d,signal:v});case 18:A=x.sent,x.next=24;break;case 21:x.prev=21,x.t0=x.catch(15),_=x.t0||!0;case 24:return x.prev=24,y.done(),x.finish(24);case 27:if(p===this._loaderId){x.next=29;break}return x.abrupt("return");case 29:if(this._loader=void 0,this.content=A,!(this._isCancelled&&!A)){x.next=34;break}return this._isLoaded=!1,x.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,_?u(_,this):s(this);case 37:case"end":return x.stop()}},n,this,[[15,21,24,27]])}));function e(n){return t.apply(this,arguments)}return e}()},{key:"loadData",value:function(e){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(e),this._loader}},{key:"setNeedsReload",value:function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}},{key:"abort",value:function(){var e;this.isLoaded||(this._isCancelled=!0,(e=this._abortController)===null||e===void 0||e.abort())}}]),r}();var an=m(ge()),qa=m(lr());var Dl=m(ge()),L0=m(V()),k0=m(z()),nn=m(W()),Ja=m(Ur());var ke={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};function ar(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function T0(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function ir(r,t,e){return t&&T0(r.prototype,t),e&&T0(r,e),r}function q(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var x0=new w,bO=new w,Do=function(){function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],n=arguments.length>2?arguments[2]:void 0;ar(this,r),q(this,"center",void 0),q(this,"halfDiagonal",void 0),q(this,"minimum",void 0),q(this,"maximum",void 0),n=n||x0.copy(t).add(e).scale(.5),this.center=new w(n),this.halfDiagonal=new w(e).subtract(this.center),this.minimum=new w(t),this.maximum=new w(e)}return ir(r,[{key:"clone",value:function(){return new r(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}},{key:"transform",value:function(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}},{key:"intersectPlane",value:function(e){var n=this.halfDiagonal,a=bO.from(e.normal),i=n.x*Math.abs(a.x)+n.y*Math.abs(a.y)+n.z*Math.abs(a.z),o=this.center.dot(a)+e.distance;return o-i>0?ke.INSIDE:o+i<0?ke.OUTSIDE:ke.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var n=x0.from(e).subtract(this.center),a=this.halfDiagonal,i=0,o;return o=Math.abs(n.x)-a.x,o>0&&(i+=o*o),o=Math.abs(n.y)-a.y,o>0&&(i+=o*o),o=Math.abs(n.z)-a.z,o>0&&(i+=o*o),i}}]),r}();var Wa=new w,E0=new w,Ct=function(){function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ar(this,r),q(this,"center",void 0),q(this,"radius",void 0),this.radius=-0,this.center=new w,this.fromCenterRadius(t,e)}return ir(r,[{key:"fromCenterRadius",value:function(e,n){return this.center.from(e),this.radius=n,this}},{key:"fromCornerPoints",value:function(e,n){return n=Wa.from(n),this.center=new w().from(e).add(n).scale(.5),this.radius=this.center.distance(n),this}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}},{key:"clone",value:function(){return new r(this.center,this.radius)}},{key:"union",value:function(e){var n=this.center,a=this.radius,i=e.center,o=e.radius,s=Wa.copy(i).subtract(n),u=s.magnitude();if(a>=u+o)return this.clone();if(o>=u+a)return e.clone();var f=(a+u+o)*.5;return E0.copy(s).scale((-a+f)/u).add(n),this.center.copy(E0),this.radius=f,this}},{key:"expand",value:function(e){var n=Wa.from(e),a=n.subtract(this.center).magnitude();return a>this.radius&&(this.radius=a),this}},{key:"transform",value:function(e){this.center.transform(e);var n=tg(Wa,e);return this.radius=Math.max(n[0],Math.max(n[1],n[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(e){var n=this.distanceTo(e);return n*n}},{key:"distanceTo",value:function(e){var n=Wa.from(e),a=n.subtract(this.center);return Math.max(0,a.len()-this.radius)}},{key:"intersectPlane",value:function(e){var n=this.center,a=this.radius,i=e.normal,o=i.dot(n)+e.distance;return o<-a?ke.OUTSIDE:o<a?ke.INTERSECTING:ke.INSIDE}}]),r}();function Kn(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function Cl(r){if(Array.isArray(r))return Kn(r)}function Bl(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Ml(r,t){if(r){if(typeof r=="string")return Kn(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Kn(r,t)}}function Ol(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bt(r){return Cl(r)||Bl(r)||Ml(r)||Ol()}var _O=new w,TO=new w,Go=new w,Uo=new w,No=new w,xO=new w,EO=new w,rt={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},tn=function(){function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0,0,0,0,0,0,0];ar(this,r),q(this,"center",void 0),q(this,"halfAxes",void 0),this.center=new w().from(t),this.halfAxes=new ve(e)}return ir(r,[{key:"halfSize",get:function(){var e=this.halfAxes.getColumn(0),n=this.halfAxes.getColumn(1),a=this.halfAxes.getColumn(2);return[new w(e).len(),new w(n).len(),new w(a).len()]}},{key:"quaternion",get:function(){var e=this.halfAxes.getColumn(0),n=this.halfAxes.getColumn(1),a=this.halfAxes.getColumn(2),i=new w(e).normalize(),o=new w(n).normalize(),s=new w(a).normalize();return new wt().fromMatrix3(new ve([].concat(Bt(i),Bt(o),Bt(s))))}},{key:"fromCenterHalfSizeQuaternion",value:function(e,n,a){var i=new wt(a),o=new ve().fromQuaternion(i);return o[0]=o[0]*n[0],o[1]=o[1]*n[0],o[2]=o[2]*n[0],o[3]=o[3]*n[1],o[4]=o[4]*n[1],o[5]=o[5]*n[1],o[6]=o[6]*n[2],o[7]=o[7]*n[2],o[8]=o[8]*n[2],this.center=new w().from(e),this.halfAxes=o,this}},{key:"clone",value:function(){return new r(this.center,this.halfAxes)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}},{key:"getBoundingSphere",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Ct,n=this.halfAxes,a=n.getColumn(0,Go),i=n.getColumn(1,Uo),o=n.getColumn(2,No),s=_O.copy(a).add(i).add(o);return e.center.copy(this.center),e.radius=s.magnitude(),e}},{key:"intersectPlane",value:function(e){var n=this.center,a=e.normal,i=this.halfAxes,o=a.x,s=a.y,u=a.z,f=Math.abs(o*i[rt.COLUMN0ROW0]+s*i[rt.COLUMN0ROW1]+u*i[rt.COLUMN0ROW2])+Math.abs(o*i[rt.COLUMN1ROW0]+s*i[rt.COLUMN1ROW1]+u*i[rt.COLUMN1ROW2])+Math.abs(o*i[rt.COLUMN2ROW0]+s*i[rt.COLUMN2ROW1]+u*i[rt.COLUMN2ROW2]),l=a.dot(n)+e.distance;return l<=-f?ke.OUTSIDE:l>=f?ke.INSIDE:ke.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var n=TO.from(e).subtract(this.center),a=this.halfAxes,i=a.getColumn(0,Go),o=a.getColumn(1,Uo),s=a.getColumn(2,No),u=i.magnitude(),f=o.magnitude(),l=s.magnitude();i.normalize(),o.normalize(),s.normalize();var c=0,h;return h=Math.abs(n.dot(i))-u,h>0&&(c+=h*h),h=Math.abs(n.dot(o))-f,h>0&&(c+=h*h),h=Math.abs(n.dot(s))-l,h>0&&(c+=h*h),c}},{key:"computePlaneDistances",value:function(e,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[-0,-0],i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=this.center,u=this.halfAxes,f=u.getColumn(0,Go),l=u.getColumn(1,Uo),c=u.getColumn(2,No),h=xO.copy(f).add(l).add(c).add(s),d=EO.copy(h).subtract(e),p=n.dot(d);return i=Math.min(p,i),o=Math.max(p,o),h.copy(s).add(f).add(l).subtract(c),d.copy(h).subtract(e),p=n.dot(d),i=Math.min(p,i),o=Math.max(p,o),h.copy(s).add(f).subtract(l).add(c),d.copy(h).subtract(e),p=n.dot(d),i=Math.min(p,i),o=Math.max(p,o),h.copy(s).add(f).subtract(l).subtract(c),d.copy(h).subtract(e),p=n.dot(d),i=Math.min(p,i),o=Math.max(p,o),s.copy(h).subtract(f).add(l).add(c),d.copy(h).subtract(e),p=n.dot(d),i=Math.min(p,i),o=Math.max(p,o),s.copy(h).subtract(f).add(l).subtract(c),d.copy(h).subtract(e),p=n.dot(d),i=Math.min(p,i),o=Math.max(p,o),s.copy(h).subtract(f).subtract(l).add(c),d.copy(h).subtract(e),p=n.dot(d),i=Math.min(p,i),o=Math.max(p,o),s.copy(h).subtract(f).subtract(l).subtract(c),d.copy(h).subtract(e),p=n.dot(d),i=Math.min(p,i),o=Math.max(p,o),a[0]=i,a[1]=o,a}},{key:"transform",value:function(e){this.center.transformAsPoint(e);var n=this.halfAxes.getColumn(0,Go);n.transformAsPoint(e);var a=this.halfAxes.getColumn(1,Uo);a.transformAsPoint(e);var i=this.halfAxes.getColumn(2,No);return i.transformAsPoint(e),this.halfAxes=new ve([].concat(Bt(n),Bt(a),Bt(i))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),r}();var S0=new w,w0=new w,De=function(){function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,1],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ar(this,r),q(this,"normal",void 0),q(this,"distance",void 0),this.normal=new w,this.distance=-0,this.fromNormalDistance(t,e)}return ir(r,[{key:"fromNormalDistance",value:function(e,n){return ue(Number.isFinite(n)),this.normal.from(e).normalize(),this.distance=n,this}},{key:"fromPointNormal",value:function(e,n){e=S0.from(e),this.normal.from(n).normalize();var a=-this.normal.dot(e);return this.distance=a,this}},{key:"fromCoefficients",value:function(e,n,a,i){return this.normal.set(e,n,a),ue(We(this.normal.len(),1)),this.distance=i,this}},{key:"clone",value:function(){return new r(this.normal,this.distance)}},{key:"equals",value:function(e){return We(this.distance,e.distance)&&We(this.normal,e.normal)}},{key:"getPointDistance",value:function(e){return this.normal.dot(e)+this.distance}},{key:"transform",value:function(e){var n=w0.copy(this.normal).transformAsVector(e).normalize(),a=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(a,n)}},{key:"projectPointOntoPlane",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];e=S0.from(e);var a=this.getPointDistance(e),i=w0.copy(this.normal).scale(a);return e.subtract(i).to(n)}}]),r}();function C0(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=SO(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
12
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function SO(r,t){if(r){if(typeof r=="string")return B0(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return B0(r,t)}}function B0(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var M0=[new w([1,0,0]),new w([0,1,0]),new w([0,0,1])],O0=new w,wO=new w,UV=new De(new w(1,0,0),0),cr=function(){function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];ar(this,r),q(this,"planes",void 0),this.planes=t}return ir(r,[{key:"fromBoundingSphere",value:function(e){this.planes.length=2*M0.length;var n=e.center,a=e.radius,i=0,o=C0(M0),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,f=this.planes[i],l=this.planes[i+1];f||(f=this.planes[i]=new De),l||(l=this.planes[i+1]=new De);var c=O0.copy(u).scale(-a).add(n),h=-u.dot(c);f.fromPointNormal(c,u);var d=O0.copy(u).scale(a).add(n),p=wO.copy(u).negate(),v=-p.dot(d);l.fromPointNormal(d,p),i+=2}}catch(y){o.e(y)}finally{o.f()}return this}},{key:"computeVisibility",value:function(e){var n=ke.INSIDE,a=C0(this.planes),i;try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e.intersectPlane(o);switch(s){case ke.OUTSIDE:return ke.OUTSIDE;case ke.INTERSECTING:n=ke.INTERSECTING;break;default:}}}catch(u){a.e(u)}finally{a.f()}return n}},{key:"computeVisibilityWithPlaneMask",value:function(e,n){if(ue(Number.isFinite(n),"parentPlaneMask is required."),n===r.MASK_OUTSIDE||n===r.MASK_INSIDE)return n;for(var a=r.MASK_INSIDE,i=this.planes,o=0;o<this.planes.length;++o){var s=o<31?1<<o:0;if(!(o<31&&!(n&s))){var u=i[o],f=e.intersectPlane(u);if(f===ke.OUTSIDE)return r.MASK_OUTSIDE;f===ke.INTERSECTING&&(a|=s)}}return a}}]),r}();q(cr,"MASK_OUTSIDE",4294967295);q(cr,"MASK_INSIDE",0);q(cr,"MASK_INDETERMINATE",2147483647);var CO=new w,BO=new w,MO=new w,OO=new w,PO=new w,Pl=function(){function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ar(this,r),q(this,"left",void 0),q(this,"_left",void 0),q(this,"right",void 0),q(this,"_right",void 0),q(this,"top",void 0),q(this,"_top",void 0),q(this,"bottom",void 0),q(this,"_bottom",void 0),q(this,"near",void 0),q(this,"_near",void 0),q(this,"far",void 0),q(this,"_far",void 0),q(this,"_cullingVolume",new cr([new De,new De,new De,new De,new De,new De])),q(this,"_perspectiveMatrix",new Z),q(this,"_infinitePerspective",new Z);var e=t.near,n=e===void 0?1:e,a=t.far,i=a===void 0?5e8:a;this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=n,this._near=n,this.far=i,this._far=i}return ir(r,[{key:"clone",value:function(){return new r({right:this.right,left:this.left,top:this.top,bottom:this.bottom,near:this.near,far:this.far})}},{key:"equals",value:function(e){return e&&e instanceof r&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far}},{key:"projectionMatrix",get:function(){return this._update(),this._perspectiveMatrix}},{key:"infiniteProjectionMatrix",get:function(){return this._update(),this._infinitePerspective}},{key:"computeCullingVolume",value:function(e,n,a){ue(e,"position is required."),ue(n,"direction is required."),ue(a,"up is required.");var i=this._cullingVolume.planes;a=CO.copy(a).normalize();var o=BO.copy(n).cross(a).normalize(),s=MO.copy(n).multiplyByScalar(this.near).add(e),u=OO.copy(n).multiplyByScalar(this.far).add(e),f=PO;return f.copy(o).multiplyByScalar(this.left).add(s).subtract(e).cross(a),i[0].fromPointNormal(e,f),f.copy(o).multiplyByScalar(this.right).add(s).subtract(e).cross(a).negate(),i[1].fromPointNormal(e,f),f.copy(a).multiplyByScalar(this.bottom).add(s).subtract(e).cross(o).negate(),i[2].fromPointNormal(e,f),f.copy(a).multiplyByScalar(this.top).add(s).subtract(e).cross(o),i[3].fromPointNormal(e,f),f=new w().copy(n),i[4].fromPointNormal(s,f),f.negate(),i[5].fromPointNormal(u,f),this._cullingVolume}},{key:"getPixelDimensions",value:function(e,n,a,i){this._update(),ue(Number.isFinite(e)&&Number.isFinite(n)),ue(e>0),ue(n>0),ue(a>0),ue(i);var o=1/this.near,s=this.top*o,u=2*a*s/n;s=this.right*o;var f=2*a*s/e;return i.x=f,i.y=u,i}},{key:"_update",value:function(){ue(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 e=this.top,n=this.bottom,a=this.right,i=this.left,o=this.near,s=this.far;(e!==this._top||n!==this._bottom||i!==this._left||a!==this._right||o!==this._near||s!==this._far)&&(ue(this.near>0&&this.near<this.far,"near must be greater than zero and less than far."),this._left=i,this._right=a,this._top=e,this._bottom=n,this._near=o,this._far=s,this._perspectiveMatrix=new Z().frustum({left:i,right:a,bottom:n,top:e,near:o,far:s}),this._infinitePerspective=new Z().frustum({left:i,right:a,bottom:n,top:e,near:o,far:1/0}))}}]),r}();var IO=function(t){return t!==null&&typeof t<"u"},RO=function(){function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ar(this,r),q(this,"_offCenterFrustum",new Pl),q(this,"fov",void 0),q(this,"_fov",void 0),q(this,"_fovy",void 0),q(this,"_sseDenominator",void 0),q(this,"aspectRatio",void 0),q(this,"_aspectRatio",void 0),q(this,"near",void 0),q(this,"_near",void 0),q(this,"far",void 0),q(this,"_far",void 0),q(this,"xOffset",void 0),q(this,"_xOffset",void 0),q(this,"yOffset",void 0),q(this,"_yOffset",void 0);var e=t.fov,n=t.aspectRatio,a=t.near,i=a===void 0?1:a,o=t.far,s=o===void 0?5e8:o,u=t.xOffset,f=u===void 0?0:u,l=t.yOffset,c=l===void 0?0:l;this.fov=e,this.aspectRatio=n,this.near=i,this.far=s,this.xOffset=f,this.yOffset=c}return ir(r,[{key:"clone",value:function(){return new r({aspectRatio:this.aspectRatio,fov:this.fov,near:this.near,far:this.far})}},{key:"equals",value:function(e){return!IO(e)||!(e instanceof r)?!1:(this._update(),e._update(),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this.near===e.near&&this.far===e.far&&this._offCenterFrustum.equals(e._offCenterFrustum))}},{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}},{key:"computeCullingVolume",value:function(e,n,a){return this._update(),this._offCenterFrustum.computeCullingVolume(e,n,a)}},{key:"getPixelDimensions",value:function(e,n,a,i){return this._update(),this._offCenterFrustum.getPixelDimensions(e,n,a,i||new rn)}},{key:"_update",value:function(){ue(Number.isFinite(this.fov)&&Number.isFinite(this.aspectRatio)&&Number.isFinite(this.near)&&Number.isFinite(this.far));var e=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)&&(ue(this.fov>=0&&this.fov<Math.PI),ue(this.aspectRatio>0),ue(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,e.top=this.near*Math.tan(.5*this._fovy),e.bottom=-e.top,e.right=this.aspectRatio*e.top,e.left=-e.right,e.near=this.near,e.far=this.far,e.right+=this.xOffset,e.left+=this.xOffset,e.top+=this.yOffset,e.bottom+=this.yOffset)}}]),r}();var tH=new w,nH=new w,aH=new w,iH=new w,oH=new w,sH=new w,uH=new w,fH=new w,lH=new w,cH=new w,hH=new w,dH=new w,pH=4/3*Math.PI;var Wr=new ve,FO=new ve,LO=new ve,jo=new ve,P0=new ve;function Vo(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=zr.EPSILON20,n=10,a=0,i=0,o=FO,s=LO;o.identity(),s.copy(r);for(var u=e*kO(s);i<n&&DO(s)>u;)GO(s,jo),P0.copy(jo).transpose(),s.multiplyRight(jo),s.multiplyLeft(P0),o.multiplyRight(jo),++a>2&&(++i,a=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function kO(r){for(var t=0,e=0;e<9;++e){var n=r[e];t+=n*n}return Math.sqrt(t)}var Il=[1,0,0],Rl=[2,2,1];function DO(r){for(var t=0,e=0;e<3;++e){var n=r[Wr.getElementIndex(Rl[e],Il[e])];t+=2*n*n}return Math.sqrt(t)}function GO(r,t){for(var e=zr.EPSILON15,n=0,a=1,i=0;i<3;++i){var o=Math.abs(r[Wr.getElementIndex(Rl[i],Il[i])]);o>n&&(a=i,n=o)}var s=Il[a],u=Rl[a],f=1,l=0;if(Math.abs(r[Wr.getElementIndex(u,s)])>e){var c=r[Wr.getElementIndex(u,u)],h=r[Wr.getElementIndex(s,s)],d=r[Wr.getElementIndex(u,s)],p=(c-h)/2/d,v;p<0?v=-1/(-p+Math.sqrt(1+p*p)):v=1/(p+Math.sqrt(1+p*p)),f=1/Math.sqrt(1+v*v),l=v*f}return ve.IDENTITY.to(t),t[Wr.getElementIndex(s,s)]=t[Wr.getElementIndex(u,u)]=f,t[Wr.getElementIndex(u,s)]=l,t[Wr.getElementIndex(s,u)]=-l,t}function Fl(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=UO(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
13
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function UO(r,t){if(r){if(typeof r=="string")return I0(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return I0(r,t)}}function I0(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var Mt=new w,NO=new w,jO=new w,VO=new w,HO=new w,zO=new ve,WO={diagonal:new ve,unitary:new ve};function Ll(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new tn;if(!r||r.length===0)return t.halfAxes=new ve([0,0,0,0,0,0,0,0,0]),t.center=new w,t;var e=r.length,n=new w(0,0,0),a=Fl(r),i;try{for(a.s();!(i=a.n()).done;){var o=i.value;n.add(o)}}catch(j){a.e(j)}finally{a.f()}var s=1/e;n.multiplyByScalar(s);var u=0,f=0,l=0,c=0,h=0,d=0,p=Fl(r),v;try{for(p.s();!(v=p.n()).done;){var y=v.value,A=Mt.copy(y).subtract(n);u+=A.x*A.x,f+=A.x*A.y,l+=A.x*A.z,c+=A.y*A.y,h+=A.y*A.z,d+=A.z*A.z}}catch(j){p.e(j)}finally{p.f()}u*=s,f*=s,l*=s,c*=s,h*=s,d*=s;var _=zO;_[0]=u,_[1]=f,_[2]=l,_[3]=f,_[4]=c,_[5]=h,_[6]=l,_[7]=h,_[8]=d;var E=Vo(_,WO),x=E.unitary,C=t.halfAxes.copy(x),P=C.getColumn(0,jO),L=C.getColumn(1,VO),M=C.getColumn(2,HO),S=-Number.MAX_VALUE,b=-Number.MAX_VALUE,R=-Number.MAX_VALUE,F=Number.MAX_VALUE,N=Number.MAX_VALUE,k=Number.MAX_VALUE,B=Fl(r),O;try{for(B.s();!(O=B.n()).done;){var I=O.value;Mt.copy(I),S=Math.max(Mt.dot(P),S),b=Math.max(Mt.dot(L),b),R=Math.max(Mt.dot(M),R),F=Math.min(Mt.dot(P),F),N=Math.min(Mt.dot(L),N),k=Math.min(Mt.dot(M),k)}}catch(j){B.e(j)}finally{B.f()}P=P.multiplyByScalar(.5*(F+S)),L=L.multiplyByScalar(.5*(N+b)),M=M.multiplyByScalar(.5*(k+R)),t.center.copy(P).add(L).add(M);var U=NO.set(S-F,b-N,R-k).multiplyByScalar(.5),D=new ve([U[0],0,0,0,U[1],0,0,0,U[2]]);return t.halfAxes.multiplyRight(D),t}function kl(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=JO(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function JO(r,t){if(r){if(typeof r=="string")return R0(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return R0(r,t)}}function R0(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var Yn=512,F0=3,D0=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],G0=D0.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),qO=G0.concat([[.25,.5],[.75,.5]]),XO=function(){function r(t,e,n){(0,L0.default)(this,r),(0,nn.default)(this,"x",void 0),(0,nn.default)(this,"y",void 0),(0,nn.default)(this,"z",void 0),(0,nn.default)(this,"childVisible",void 0),(0,nn.default)(this,"selected",void 0),(0,nn.default)(this,"_children",void 0),this.x=t,this.y=e,this.z=n}return(0,k0.default)(r,[{key:"children",get:function(){if(!this._children){var e=this.x*2,n=this.y*2,a=this.z+1;this._children=[new r(e,n,a),new r(e,n+1,a),new r(e+1,n,a),new r(e+1,n+1,a)]}return this._children}},{key:"update",value:function(e){var n=e.viewport,a=e.cullingVolume,i=e.elevationBounds,o=e.minZ,s=e.maxZ,u=e.bounds,f=e.offset,l=e.project,c=this.getBoundingVolume(i,f,l);if(u&&!this.insideBounds(u))return!1;var h=a.computeVisibility(c);if(h<0)return!1;if(!this.childVisible){var d=this.z;if(d<s&&d>=o){var p=c.distanceTo(n.cameraPosition)*n.scale/n.height;d+=Math.floor(Math.log2(p))}if(d>=s)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var v=kl(this.children),y;try{for(v.s();!(y=v.n()).done;){var A=y.value;A.update(e)}}catch(_){v.e(_)}finally{v.f()}return!0}},{key:"getSelected",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(this.selected&&e.push(this),this._children){var n=kl(this._children),a;try{for(n.s();!(a=n.n()).done;){var i=a.value;i.getSelected(e)}}catch(o){n.e(o)}finally{n.f()}}return e}},{key:"insideBounds",value:function(e){var n=(0,Dl.default)(e,4),a=n[0],i=n[1],o=n[2],s=n[3],u=Math.pow(2,this.z),f=Yn/u;return this.x*f<o&&this.y*f<s&&(this.x+1)*f>a&&(this.y+1)*f>i}},{key:"getBoundingVolume",value:function(e,n,a){if(a){var i=this.z<1?qO:this.z<2?G0:D0,o=[],s=kl(i),u;try{for(s.s();!(u=s.n()).done;){var f=u.value,l=Ho(this.x+f[0],this.y+f[1],this.z);l[2]=e[0],o.push(a(l)),e[0]!==e[1]&&(l[2]=e[1],o.push(a(l)))}}catch(v){s.e(v)}finally{s.f()}return Ll(o)}var c=Math.pow(2,this.z),h=Yn/c,d=this.x*h+n*Yn,p=Yn-(this.y+1)*h;return new Do([d,p,e[0]],[d+h,p+h,e[1]])}}]),r}();function U0(r,t,e,n){var a=r instanceof Ja._GlobeViewport&&r.resolution?r.projectPosition:null,i=Object.values(r.getFrustumPlanes()).map(function(C){var P=C.normal,L=C.distance;return new De(P.clone().negate(),L)}),o=new cr(i),s=r.distanceScales.unitsPerMeter[2],u=e&&e[0]*s||0,f=e&&e[1]*s||0,l=r instanceof Ja.WebMercatorViewport&&r.pitch<=60?t:0;if(n){var c=n,h=(0,Dl.default)(c,4),d=h[0],p=h[1],v=h[2],y=h[3],A=gr([d,y]),_=gr([v,p]);n=[A[0],Yn-A[1],_[0],Yn-_[1]]}var E=new XO(0,0,0),x={viewport:r,project:a,cullingVolume:o,elevationBounds:[u,f],minZ:l,maxZ:t,bounds:n,offset:0};if(E.update(x),r instanceof Ja.WebMercatorViewport&&r.subViewports&&r.subViewports.length>1){for(x.offset=-1;E.update(x)&&!(--x.offset<-F0););for(x.offset=1;E.update(x)&&!(++x.offset>F0););}return E.getSelected()}var tt=512,KO=[-1/0,-1/0,1/0,1/0],Qn={type:"url",value:null,validate:function(t,e){return e.optional&&t===null||typeof t=="string"||Array.isArray(t)&&t.every(function(n){return typeof n=="string"})},equals:function(t,e){if(t===e)return!0;if(!Array.isArray(t)||!Array.isArray(e))return!1;var n=t.length;if(n!==e.length)return!1;for(var a=0;a<n;a++)if(t[a]!==e[a])return!1;return!0}};function j0(r,t){var e=[t.transformAsPoint([r[0],r[1]]),t.transformAsPoint([r[2],r[1]]),t.transformAsPoint([r[0],r[3]]),t.transformAsPoint([r[2],r[3]])],n=[Math.min.apply(Math,(0,qa.default)(e.map(function(a){return a[0]}))),Math.min.apply(Math,(0,qa.default)(e.map(function(a){return a[1]}))),Math.max.apply(Math,(0,qa.default)(e.map(function(a){return a[0]}))),Math.max.apply(Math,(0,qa.default)(e.map(function(a){return a[1]})))];return n}function YO(r){return Math.abs(r.split("").reduce(function(t,e){return(t<<5)-t+e.charCodeAt(0)|0},0))}function Jr(r,t){if(!r||!r.length)return null;var e=t.index,n=t.id;if(Array.isArray(r)){var a=YO(n)%r.length;r=r[a]}for(var i=r,o=0,s=Object.keys(e);o<s.length;o++){var u=s[o],f=new RegExp("{".concat(u,"}"),"g");i=i.replace(f,String(e[u]))}return Number.isInteger(e.y)&&Number.isInteger(e.z)&&(i=i.replace(/\{-y\}/g,String(Math.pow(2,e.z)-e.y-1))),i}function QO(r,t,e){var n;if(t&&t.length===2){var a=(0,an.default)(t,2),i=a[0],o=a[1],s=r.getBounds({z:i}),u=r.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=r.getBounds();return r.isGeospatial?[Math.max(n[0],e[0]),Math.max(n[1],e[1]),Math.min(n[2],e[2]),Math.min(n[3],e[3])]:[Math.max(Math.min(n[0],e[2]),e[0]),Math.max(Math.min(n[1],e[3]),e[1]),Math.min(Math.max(n[2],e[0]),e[2]),Math.min(Math.max(n[3],e[1]),e[3])]}function V0(r){var t=r.viewport,e=r.z,n=e===void 0?0:e,a=r.cullRect,i=t.subViewports||[t];return i.map(function(o){return Gl(o,n,a)})}function Gl(r,t,e){if(!Array.isArray(t)){var n=e.x-r.x,a=e.y-r.y,i=e.width,o=e.height,s={targetZ:t},u=r.unproject([n,a],s),f=r.unproject([n+i,a],s),l=r.unproject([n,a+o],s),c=r.unproject([n+i,a+o],s);return[Math.min(u[0],f[0],l[0],c[0]),Math.min(u[1],f[1],l[1],c[1]),Math.max(u[0],f[0],l[0],c[0]),Math.max(u[1],f[1],l[1],c[1])]}var h=Gl(r,t[0],e),d=Gl(r,t[1],e);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 $O(r,t,e){if(e){var n=j0(r,e).map(function(a){return a*t/tt});return n}return r.map(function(a){return a*t/tt})}function Ul(r,t){return Math.pow(2,r)*tt/t}function Ho(r,t,e){var n=Ul(e,tt),a=r/n*360-180,i=Math.PI-2*Math.PI*t/n,o=180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)));return[a,o]}function N0(r,t,e,n){var a=Ul(e,n);return[r/a*tt,t/a*tt]}function Nl(r,t,e,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:tt;if(r.isGeospatial){var i=Ho(t,e,n),o=(0,an.default)(i,2),s=o[0],u=o[1],f=Ho(t+1,e+1,n),l=(0,an.default)(f,2),c=l[0],h=l[1];return{west:s,north:u,east:c,south:h}}var d=N0(t,e,n,a),p=(0,an.default)(d,2),v=p[0],y=p[1],A=N0(t+1,e+1,n,a),_=(0,an.default)(A,2),E=_[0],x=_[1];return{left:v,top:y,right:E,bottom:x}}function ZO(r,t,e,n,a){for(var i=QO(r,null,n),o=Ul(t,e),s=$O(i,o,a),u=(0,an.default)(s,4),f=u[0],l=u[1],c=u[2],h=u[3],d=[],p=Math.floor(f);p<c;p++)for(var v=Math.floor(l);v<h;v++)d.push({x:p,y:v,z:t});return d}function jl(r){var t=r.viewport,e=r.maxZoom,n=r.minZoom,a=r.zRange,i=r.extent,o=r.tileSize,s=o===void 0?tt:o,u=r.modelMatrix,f=r.modelMatrixInverse,l=r.zoomOffset,c=l===void 0?0:l,h=t.isGeospatial?Math.round(t.zoom+Math.log2(tt/s))+c:Math.ceil(t.zoom)+c;if(typeof n=="number"&&Number.isFinite(n)&&h<n){if(!i)return[];h=n}typeof e=="number"&&Number.isFinite(e)&&h>e&&(h=e);var d=i;return u&&f&&i&&!t.isGeospatial&&(d=j0(i,u)),t.isGeospatial?U0(t,h,a,i):ZO(t,h,s,d||KO,f)}function Vl(r){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(r)}function Hl(r){return Number.isFinite(r.west)&&Number.isFinite(r.north)&&Number.isFinite(r.east)&&Number.isFinite(r.south)}function H0(r){var t={},e;return function(n){for(var a in n)if(!eP(n[a],t[a])){e=r(n),t=n;break}return e}}function eP(r,t){if(r===t)return!0;if(Array.isArray(r)){var e=r.length;if(!t||t.length!==e)return!1;for(var n=0;n<e;n++)if(r[n]!==t[n])return!1;return!0}return!1}var Xa;function Ke(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=rP(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
15
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function rP(r,t){if(r){if(typeof r=="string")return z0(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return z0(r,t)}}function z0(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function W0(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function J0(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?W0(Object(e),!0).forEach(function(n){(0,Ge.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):W0(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var q0=1,zo=2,tP="never",nP="no-overlap",Ka="best-available",aP=5,iP=(Xa={},(0,Ge.default)(Xa,Ka,sP),(0,Ge.default)(Xa,nP,uP),(0,Ge.default)(Xa,tP,function(){}),Xa),oP={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(){}},Ya=function(){function r(t){var e=this;(0,X0.default)(this,r),(0,Ge.default)(this,"opts",void 0),(0,Ge.default)(this,"_requestScheduler",void 0),(0,Ge.default)(this,"_cache",void 0),(0,Ge.default)(this,"_dirty",void 0),(0,Ge.default)(this,"_tiles",void 0),(0,Ge.default)(this,"_cacheByteSize",void 0),(0,Ge.default)(this,"_viewport",void 0),(0,Ge.default)(this,"_zRange",void 0),(0,Ge.default)(this,"_selectedTiles",void 0),(0,Ge.default)(this,"_frameNumber",void 0),(0,Ge.default)(this,"_modelMatrix",void 0),(0,Ge.default)(this,"_modelMatrixInverse",void 0),(0,Ge.default)(this,"_maxZoom",void 0),(0,Ge.default)(this,"_minZoom",void 0),(0,Ge.default)(this,"onTileLoad",void 0),(0,Ge.default)(this,"_getCullBounds",H0(V0)),this.opts=J0(J0({},oP),t),this.onTileLoad=function(n){var a,i;(a=(i=e.opts).onTileLoad)===null||a===void 0||a.call(i,n),e.opts.maxCacheByteSize&&(e._cacheByteSize+=n.byteLength,e._resizeCache())},this._requestScheduler=new ja({maxRequests:t.maxRequests,throttleRequests:Boolean(t.maxRequests&&t.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 Z,this._modelMatrixInverse=new Z,this.setOptions(t)}return(0,K0.default)(r,[{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(e){return e.isLoaded})}},{key:"needsReload",get:function(){return this._selectedTiles!==null&&this._selectedTiles.some(function(e){return e.needsReload})}},{key:"setOptions",value:function(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom))}},{key:"finalize",value:function(){var e=Ke(this._cache.values()),n;try{for(e.s();!(n=e.n()).done;){var a=n.value;a.isLoading&&a.abort()}}catch(i){e.e(i)}finally{e.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null}},{key:"reloadAll",value:function(){var e=Ke(this._cache.keys()),n;try{for(e.s();!(n=e.n()).done;){var a=n.value,i=this._cache.get(a);!this._selectedTiles||!this._selectedTiles.includes(i)?this._cache.delete(a):i.setNeedsReload()}}catch(o){e.e(o)}finally{e.f()}}},{key:"update",value:function(e){var n=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=a.zRange,o=a.modelMatrix,s=new Z(o),u=!s.equals(this._modelMatrix);if(!this._viewport||!e.equals(this._viewport)||!We(this._zRange,i)||u){u&&(this._modelMatrixInverse=s.clone().invert(),this._modelMatrix=s),this._viewport=e,this._zRange=i;var f=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:i,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=f.map(function(c){return n._getTile(c,!0)}),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(function(c){return n._getTile(c.index,!0)}));var l=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),l&&this._frameNumber++,this._frameNumber}},{key:"isTileVisible",value:function(e,n){if(!e.isVisible)return!1;if(n&&this._viewport){var a=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:n}),i=e.bbox,o=Ke(a),s;try{for(o.s();!(s=o.n()).done;){var u=(0,zl.default)(s.value,4),f=u[0],l=u[1],c=u[2],h=u[3],d=void 0;if("west"in i)d=i.west<c&&i.east>f&&i.south<h&&i.north>l;else{var p=Math.min(i.top,i.bottom),v=Math.max(i.top,i.bottom);d=i.left<c&&i.right>f&&p<h&&v>l}if(d)return!0}}catch(y){o.e(y)}finally{o.f()}return!1}return!0}},{key:"getTileIndices",value:function(e){var n=e.viewport,a=e.maxZoom,i=e.minZoom,o=e.zRange,s=e.modelMatrix,u=e.modelMatrixInverse,f=this.opts,l=f.tileSize,c=f.extent,h=f.zoomOffset;return jl({viewport:n,maxZoom:a,minZoom:i,zRange:o,tileSize:l,extent:c,modelMatrix:s,modelMatrixInverse:u,zoomOffset:h})}},{key:"getTileId",value:function(e){return"".concat(e.x,"-").concat(e.y,"-").concat(e.z)}},{key:"getTileZoom",value:function(e){return e.z}},{key:"getTileMetadata",value:function(e){var n=this.opts.tileSize;return{bbox:Nl(this._viewport,e.x,e.y,e.z,n)}}},{key:"getParentIndex",value:function(e){var n=Math.floor(e.x/2),a=Math.floor(e.y/2),i=e.z-1;return{x:n,y:a,z:i}}},{key:"updateTileStates",value:function(){var e=this.opts.refinementStrategy||Ka,n=new Array(this._cache.size),a=0,i=Ke(this._cache.values()),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;n[a++]=s.isVisible,s.isSelected=!1,s.isVisible=!1}}catch(p){i.e(p)}finally{i.f()}var u=Ke(this._selectedTiles),f;try{for(u.s();!(f=u.n()).done;){var l=f.value;l.isSelected=!0,l.isVisible=!0}}catch(p){u.e(p)}finally{u.f()}(typeof e=="function"?e:iP[e])(Array.from(this._cache.values())),a=0;var c=Ke(this._cache.values()),h;try{for(c.s();!(h=c.n()).done;){var d=h.value;if(n[a++]!==d.isVisible)return!0}}catch(p){c.e(p)}finally{c.f()}return!1}},{key:"_pruneRequests",value:function(){var e=this.opts.maxRequests,n=e===void 0?0:e,a=[],i=0,o=Ke(this._cache.values()),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;u.isLoading&&(i++,!u.isSelected&&!u.isVisible&&a.push(u))}}catch(l){o.e(l)}finally{o.f()}for(;n>0&&i>n&&a.length>0;){var f=a.shift();f.abort(),i--}}},{key:"_rebuildTree",value:function(){var e=this._cache,n=Ke(e.values()),a;try{for(n.s();!(a=n.n()).done;){var i=a.value;i.parent=null,i.children&&(i.children.length=0)}}catch(l){n.e(l)}finally{n.f()}var o=Ke(e.values()),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,f=this._getNearestAncestor(u);u.parent=f,f!=null&&f.children&&f.children.push(u)}}catch(l){o.e(l)}finally{o.f()}}},{key:"_resizeCache",value:function(){var e=this._cache,n=this.opts,a=n.maxCacheSize||(n.maxCacheByteSize?1/0:aP*this.selectedTiles.length),i=n.maxCacheByteSize||1/0,o=e.size>a||this._cacheByteSize>i;if(o){var s=Ke(e),u;try{for(s.s();!(u=s.n()).done;){var f=(0,zl.default)(u.value,2),l=f[0],c=f[1];if(!c.isVisible&&!c.isSelected){var h,d;this._cacheByteSize-=n.maxCacheByteSize?c.byteLength:0,e.delete(l),(h=(d=this.opts).onTileUnload)===null||h===void 0||h.call(d,c)}if(e.size<=a&&this._cacheByteSize<=i)break}}catch(p){s.e(p)}finally{s.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort(function(p,v){return p.zoom-v.zoom}),this._dirty=!1)}},{key:"_getTile",value:function(e,n){var a=this.getTileId(e),i=this._cache.get(a),o=!1;return!i&&n?(i=new za(e),Object.assign(i,this.getTileMetadata(i.index)),Object.assign(i,{id:a,zoom:this.getTileZoom(i.index)}),o=!0,this._cache.set(a,i),this._dirty=!0):i&&i.needsReload&&(o=!0),i&&o&&i.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),i}},{key:"_getNearestAncestor",value:function(e){for(var n=this._minZoom,a=n===void 0?0:n,i=e.index;this.getTileZoom(i)>a;){i=this.getParentIndex(i);var o=this._getTile(i);if(o)return o}return null}}]),r}();function sP(r){var t=Ke(r),e;try{for(t.s();!(e=t.n()).done;){var n=e.value;n.state=0}}catch(l){t.e(l)}finally{t.f()}var a=Ke(r),i;try{for(a.s();!(i=a.n()).done;){var o=i.value;o.isSelected&&!Y0(o)&&Wl(o)}}catch(l){a.e(l)}finally{a.f()}var s=Ke(r),u;try{for(s.s();!(u=s.n()).done;){var f=u.value;f.isVisible=Boolean(f.state&zo)}}catch(l){s.e(l)}finally{s.f()}}function uP(r){var t=Ke(r),e;try{for(t.s();!(e=t.n()).done;){var n=e.value;n.state=0}}catch(p){t.e(p)}finally{t.f()}var a=Ke(r),i;try{for(a.s();!(i=a.n()).done;){var o=i.value;o.isSelected&&Y0(o)}}catch(p){a.e(p)}finally{a.f()}var s=Array.from(r).sort(function(p,v){return p.zoom-v.zoom}),u=Ke(s),f;try{for(u.s();!(f=u.n()).done;){var l=f.value;if(l.isVisible=Boolean(l.state&zo),l.children&&(l.isVisible||l.state&q0)){var c=Ke(l.children),h;try{for(c.s();!(h=c.n()).done;){var d=h.value;d.state=q0}}catch(p){c.e(p)}finally{c.f()}}else l.isSelected&&Wl(l)}}catch(p){u.e(p)}finally{u.f()}}function Y0(r){for(var t=r;t;){if(t.isLoaded||t.content)return t.state|=zo,!0;t=t.parent}return!1}function Wl(r){var t=Ke(r.children),e;try{for(t.s();!(e=t.n()).done;){var n=e.value;n.isLoaded||n.content?n.state|=zo:Wl(n)}}catch(a){t.e(a)}finally{t.f()}}function Q0(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function Jl(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Q0(Object(e),!0).forEach(function(n){(0,Wo.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):Q0(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function fP(r){var t=lP();return function(){var n=(0,ql.default)(r),a;if(t){var i=(0,ql.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,r1.default)(this,a)}}function lP(){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}}var cP={TilesetClass:Ya,data:{type:"data",value:[]},dataComparator:Qn.equals,renderSubLayers:{type:"function",value:function(t){return new t1.GeoJsonLayer(t)},compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:function(t){},compare:!1},onTileUnload:{type:"function",value:function(t){},compare:!1},onTileError:{type:"function",value:function(t){return console.error(t)},compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:Ka,zRange:null,maxRequests:6,zoomOffset:0},nt=function(r){(0,e1.default)(e,r);var t=fP(e);function e(){return(0,$0.default)(this,e),t.apply(this,arguments)}return(0,Z0.default)(e,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var a,i;(a=this.state)===null||a===void 0||(i=a.tileset)===null||i===void 0||i.finalize()}},{key:"isLoaded",get:function(){var a,i;return(a=this.state)===null||a===void 0||(i=a.tileset)===null||i===void 0?void 0:i.selectedTiles.every(function(o){return o.isLoaded&&o.layers&&o.layers.every(function(s){return s.isLoaded})})}},{key:"shouldUpdateState",value:function(a){var i=a.changeFlags;return i.somethingChanged}},{key:"updateState",value:function(a){var i=a.changeFlags,o=this.state.tileset,s=i.propsOrDataChanged||i.updateTriggersChanged,u=i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getTileData);o?s&&(o.setOptions(this._getTilesetOptions()),u?o.reloadAll():this.state.tileset.tiles.forEach(function(f){f.layers=null})):(o=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:o})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(){var a=this.props,i=a.tileSize,o=a.maxCacheSize,s=a.maxCacheByteSize,u=a.refinementStrategy,f=a.extent,l=a.maxZoom,c=a.minZoom,h=a.maxRequests,d=a.zoomOffset;return{maxCacheSize:o,maxCacheByteSize:s,maxZoom:l,minZoom:c,tileSize:i,refinementStrategy:u,extent:f,maxRequests:h,zoomOffset:d,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}},{key:"_updateTileset",value:function(){var a=this.state.tileset,i=this.props,o=i.zRange,s=i.modelMatrix,u=a.update(this.context.viewport,{zRange:o,modelMatrix:s}),f=a.isLoaded,l=this.state.isLoaded!==f,c=this.state.frameNumber!==u;f&&(l||c)&&this._onViewportLoad(),c&&this.setState({frameNumber:u}),this.state.isLoaded=f}},{key:"_onViewportLoad",value:function(){var a=this.state.tileset,i=this.props.onViewportLoad;i&&i(a.selectedTiles)}},{key:"_onTileLoad",value:function(a){this.props.onTileLoad(a),a.layers=null,this.setNeedsUpdate()}},{key:"_onTileError",value:function(a,i){this.props.onTileError(a),i.layers=null,this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(a){this.props.onTileUnload(a)}},{key:"getTileData",value:function(a){var i=this.props,o=i.data,s=i.getTileData,u=i.fetch,f=a.signal;return a.url=typeof o=="string"||Array.isArray(o)?Jr(o,a):null,s?s(a):u&&a.url?u(a.url,{propName:"data",layer:this,signal:f}):null}},{key:"renderSubLayers",value:function(a){return this.props.renderSubLayers(a)}},{key:"getSubLayerPropsByTile",value:function(a){return null}},{key:"getPickingInfo",value:function(a){var i=a.info,o=a.sourceLayer;return i.picked&&(i.tile=o.props.tile),i}},{key:"_updateAutoHighlight",value:function(a){a.sourceLayer&&a.sourceLayer.updateAutoHighlight(a)}},{key:"renderLayers",value:function(){var a=this;return this.state.tileset.tiles.map(function(i){var o=a.getSubLayerPropsByTile(i);if(!(!i.isLoaded&&!i.content))if(i.layers)o&&i.layers[0]&&Object.keys(o).some(function(u){return i.layers[0].props[u]!==o[u]})&&(i.layers=i.layers.map(function(u){return u.clone(o)}));else{var s=a.renderSubLayers(Jl(Jl({},a.props),{},{id:"".concat(a.id,"-").concat(i.id),data:i.content,_offset:0,tile:i}));i.layers=(0,Jo._flatten)(s,Boolean).map(function(u){return u.clone(Jl({tile:i},o))})}return i.layers})}},{key:"filterSubLayer",value:function(a){var i=a.layer,o=a.cullRect,s=i.props.tile;return this.state.tileset.isTileVisible(s,o)}}]),e}(Jo.CompositeLayer);(0,Wo.default)(nt,"defaultProps",cP);(0,Wo.default)(nt,"layerName","TileLayer");var s1=m(V()),u1=m(z()),Ko=m($n()),f1=m(Ie()),l1=m(Fe()),Zn=m(Be()),Yo=m(W()),c1=m(Dr());function i1(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function o1(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?i1(Object(e),!0).forEach(function(n){(0,Yo.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):i1(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function mP(r){var t=vP();return function(){var n=(0,Zn.default)(r),a;if(t){var i=(0,Zn.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,l1.default)(this,a)}}function vP(){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}}var gP={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}}},Qo=function(r){(0,f1.default)(e,r);var t=mP(e);function e(){return(0,s1.default)(this,e),t.apply(this,arguments)}return(0,u1.default)(e,[{key:"getShaders",value:function(){var a=(0,Ko.default)((0,Zn.default)(e.prototype),"getShaders",this).call(this);return a.inject={"vs:#decl":`uniform float trailLength;
16
+ attribute float instanceTimestamps;
17
+ attribute float instanceNextTimestamps;
18
+ varying float vTime;
19
+ `,"vs:#main-end":`vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;
20
+ `,"fs:#decl":`uniform bool fadeTrail;
21
+ uniform float trailLength;
22
+ uniform float currentTime;
23
+ varying float vTime;
24
+ `,"fs:#main-start":`if(vTime > currentTime || (fadeTrail && (vTime < currentTime - trailLength))) {
25
+ discard;
26
+ }
27
+ `,"fs:DECKGL_FILTER_COLOR":`if(fadeTrail) {
28
+ color.a *= 1.0 - (currentTime - vTime) / trailLength;
29
+ }
30
+ `},a}},{key:"initializeState",value:function(){(0,Ko.default)((0,Zn.default)(e.prototype),"initializeState",this).call(this);var a=this.getAttributeManager();a.addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}},{key:"draw",value:function(a){var i=this.props,o=i.fadeTrail,s=i.trailLength,u=i.currentTime;a.uniforms=o1(o1({},a.uniforms),{},{fadeTrail:o,trailLength:s,currentTime:u}),(0,Ko.default)((0,Zn.default)(e.prototype),"draw",this).call(this,a)}}]),e}(c1.PathLayer);(0,Yo.default)(Qo,"layerName","TripsLayer");(0,Yo.default)(Qo,"defaultProps",gP);var S1=m(V()),w1=m(z()),C1=m(Ie()),B1=m(Fe()),Ql=m(Be()),$l=m(W()),M1=m(Xl()),O1=m(Ur());var v1=m(V()),g1=m(z()),y1=m(Br()),A1=m(Ie()),b1=m(Fe()),Kl=m(Be()),ea=m(W()),_1=m(Re()),Qa=m(ge()),Ze=m(Xl());var Zo=m(Ur()),$a=m(Dr());function yP(r){var t=AP();return function(){var n=(0,Kl.default)(r),a;if(t){var i=(0,Kl.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,b1.default)(this,a)}}function AP(){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 d1(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function $o(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?d1(Object(e),!0).forEach(function(n){(0,ea.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):d1(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function Yl(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=bP(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
31
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function bP(r,t){if(r){if(typeof r=="string")return p1(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return p1(r,t)}}function p1(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var _P=10;function T1(r,t){t=t===void 0?r[0][0]:t;var e=Yl(r),n;try{for(e.s();!(n=e.n()).done;){var a=n.value,i=a[0]-t;i>180?a[0]-=360:i<-180&&(a[0]+=360)}}catch(o){e.e(o)}finally{e.f()}}function TP(r,t,e){var n=(0,Ze.h3ToGeo)(r),a=(0,Qa.default)(n,2),i=a[0],o=a[1],s=t.length;T1(t,o);for(var u=t[0]===t[s-1]?s-1:s,f=0;f<u;f++)t[f][0]=Et(o,t[f][0],e),t[f][1]=Et(i,t[f][1],e)}function xP(r,t,e){var n=r(t,e),a=(0,Ze.h3ToGeo)(n),i=(0,Qa.default)(a,2),o=i[0],s=i[1];return[s,o]}function m1(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,e=(0,Ze.h3ToGeoBoundary)(r,!0);return t!==1?TP(r,e,t):T1(e),e}function EP(r){var t=new Float64Array(r.length*2),e=0,n=Yl(r),a;try{for(n.s();!(a=n.n()).done;){var i=a.value;t[e++]=i[0],t[e++]=i[1]}}catch(o){n.e(o)}finally{n.f()}return t}function SP(r,t){var e;return r==null?e=t:(0,_1.default)(r)==="object"?e=$o($o({},r),{},{coverage:t}):e={getHexagon:r,coverage:t},e}var wP=$o($o({},$a.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}),on=function(r){(0,A1.default)(e,r);var t=yP(e);function e(){var n;(0,v1.default)(this,e);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n=t.call.apply(t,[this].concat(i)),(0,ea.default)((0,y1.default)(n),"state",void 0),n}return(0,g1.default)(e,[{key:"initializeState",value:function(){e._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}},{key:"shouldUpdateState",value:function(a){var i=a.changeFlags;return this._shouldUseHighPrecision()?i.propsOrDataChanged:i.somethingChanged}},{key:"updateState",value:function(a){var i=a.props,o=a.changeFlags;if(i.highPrecision!==!0&&(o.dataChanged||o.updateTriggersChanged&&o.updateTriggersChanged.getHexagon)){var s=this._calculateH3DataProps();this.setState(s)}this._updateVertices(this.context.viewport)}},{key:"_calculateH3DataProps",value:function(){var a=-1,i=!1,o=!1,s=(0,Zo.createIterable)(this.props.data),u=s.iterable,f=s.objectInfo,l=Yl(u),c;try{for(l.s();!(c=l.n()).done;){var h=c.value;f.index++;var d=this.props.getHexagon(h,f),p=(0,Ze.h3GetResolution)(d);if(a<0){if(a=p,!this.props.highPrecision)break}else if(a!==p){o=!0;break}if((0,Ze.h3IsPentagon)(d)){i=!0;break}}}catch(v){l.e(v)}finally{l.f()}return{resolution:a,edgeLengthKM:a>=0?(0,Ze.edgeLength)(a,"km"):0,hasMultipleRes:o,hasPentagon:i}}},{key:"_shouldUseHighPrecision",value:function(){if(this.props.highPrecision==="auto"){var a=this.state,i=a.resolution,o=a.hasPentagon,s=a.hasMultipleRes,u=this.context.viewport;return Boolean(u?.resolution)||s||o||i>=0&&i<=5}return this.props.highPrecision}},{key:"_updateVertices",value:function(a){if(!this._shouldUseHighPrecision()){var i=this.state,o=i.resolution,s=i.edgeLengthKM,u=i.centerHex;if(!(o<0)){var f=this.props.centerHexagon||(0,Ze.geoToH3)(a.latitude,a.longitude,o);if(u!==f){if(u){var l=(0,Ze.h3Distance)(u,f);if(l>=0&&l*s<_P)return}var c=a.distanceScales.unitsPerMeter,h=m1(f),d=(0,Ze.h3ToGeo)(f),p=(0,Qa.default)(d,2),v=p[0],y=p[1],A=a.projectFlat([y,v]),_=(0,Qa.default)(A,2),E=_[0],x=_[1];h=h.map(function(C){var P=a.projectFlat(C);return[(P[0]-E)/c[0],(P[1]-x)/c[1]]}),this.setState({centerHex:f,vertices:h})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var a=this.props,i=a.elevationScale,o=a.material,s=a.coverage,u=a.extruded,f=a.wireframe,l=a.stroked,c=a.filled,h=a.lineWidthUnits,d=a.lineWidthScale,p=a.lineWidthMinPixels,v=a.lineWidthMaxPixels,y=a.getFillColor,A=a.getElevation,_=a.getLineColor,E=a.getLineWidth,x=a.transitions,C=a.updateTriggers;return{elevationScale:i,extruded:u,coverage:s,wireframe:f,stroked:l,filled:c,lineWidthUnits:h,lineWidthScale:d,lineWidthMinPixels:p,lineWidthMaxPixels:v,material:o,getElevation:A,getFillColor:y,getLineColor:_,getLineWidth:E,transitions:x,updateTriggers:{getFillColor:C.getFillColor,getElevation:C.getElevation,getLineColor:C.getLineColor,getLineWidth:C.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var a=this.props,i=a.data,o=a.getHexagon,s=a.updateTriggers,u=a.coverage,f=this.getSubLayerClass("hexagon-cell-hifi",$a.PolygonLayer),l=this._getForwardProps();return l.updateTriggers.getPolygon=SP(s.getHexagon,u),new f(l,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:l.updateTriggers}),{data:i,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(h,d){var p=o(h,d);return EP(m1(p,u))}})}},{key:"_renderColumnLayer",value:function(){var a=this.props,i=a.data,o=a.getHexagon,s=a.updateTriggers,u=this.getSubLayerClass("hexagon-cell",$a.ColumnLayer),f=this._getForwardProps();return f.updateTriggers.getPosition=s.getHexagon,new u(f,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:f.updateTriggers}),{data:i,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:xP.bind(null,o)})}}]),e}(Zo.CompositeLayer);(0,ea.default)(on,"defaultProps",wP);(0,ea.default)(on,"layerName","H3HexagonLayer");(0,ea.default)(on,"_checkH3Lib",function(){});function x1(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=CP(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function CP(r,t){if(r){if(typeof r=="string")return E1(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return E1(r,t)}}function E1(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function BP(r){var t=MP();return function(){var n=(0,Ql.default)(r),a;if(t){var i=(0,Ql.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,B1.default)(this,a)}}function MP(){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}}var OP={getHexagons:{type:"accessor",value:function(t){return t.hexagons}}},es=function(r){(0,C1.default)(e,r);var t=BP(e);function e(){return(0,S1.default)(this,e),t.apply(this,arguments)}return(0,w1.default)(e,[{key:"initializeState",value:function(){on._checkH3Lib()}},{key:"updateState",value:function(a){var i=a.props,o=a.changeFlags;if(o.dataChanged||o.updateTriggersChanged&&o.updateTriggersChanged.getHexagons){var s=i.data,u=i.getHexagons,f=[],l=(0,O1.createIterable)(s),c=l.iterable,h=l.objectInfo,d=x1(c),p;try{for(d.s();!(p=d.n()).done;){var v=p.value;h.index++;var y=u(v,h),A=(0,M1.h3SetToMultiPolygon)(y,!0),_=x1(A),E;try{for(_.s();!(E=_.n()).done;){var x=E.value;f.push(this.getSubLayerRow({polygon:x},v,h.index))}}catch(C){_.e(C)}finally{_.f()}}}catch(C){d.e(C)}finally{d.f()}this.setState({polygons:f})}}},{key:"indexToBounds",value:function(){return{data:this.state.polygons,getPolygon:function(i){return i.polygon}}}}]),e}(Tr);(0,$l.default)(es,"layerName","H3ClusterLayer");(0,$l.default)(es,"defaultProps",OP);var Fw=m(K()),Lw=m(V()),kw=m(z()),Dw=m(Br()),Gw=m(Ie()),Uw=m(Fe()),mm=m(Be()),Di=m(W()),vm=m(J()),Nw=m(Zl()),Ht=m(Ur()),jw=m(Dr()),Vw=m(rs());var Ub=m(V()),Nb=m(z()),sa=m($n()),jb=m(Ie()),Vb=m(Fe()),kt=m(Be()),xs=m(W());var os=m(Re()),Za=m(lr()),q1=m(W()),X1=m(V()),K1=m(z());var R1=m(Re());var ts=m(Re());function ec(r){if(typeof window<"u"&&(0,ts.default)(window.process)==="object"&&window.process.type==="renderer"||typeof process<"u"&&(0,ts.default)(process.versions)==="object"&&Boolean(process.versions.electron))return!0;var t=(typeof navigator>"u"?"undefined":(0,ts.default)(navigator))==="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,e=r||t;return!!(e&&e.indexOf("Electron")>=0)}function or(){var r=(typeof process>"u"?"undefined":(0,R1.default)(process))==="object"&&String(process)==="[object process]"&&!process.browser;return!r||ec()}var F1=m(Re()),Ot={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":(0,F1.default)(process))==="object"&&process};var PP=Ot.self||Ot.window||Ot.global,ra=Ot.window||Ot.self||Ot.global,IP=Ot.document||{},sn=Ot.process||{};var ns="8.9.0-beta.1",A5=or();var L1=m(V()),k1=m(z());function RP(r){try{var t=window[r],e="__storage_test__";return t.setItem(e,e),t.removeItem(e),t}catch{return null}}var D1=function(){function r(t){(0,L1.default)(this,r);var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";g(this,"storage",void 0),g(this,"id",void 0),g(this,"config",{}),this.storage=RP(n),this.id=t,this.config={},Object.assign(this.config,e),this._loadConfiguration()}return(0,k1.default)(r,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var n=JSON.stringify(this.config);this.storage.setItem(this.id,n)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var n=this.storage.getItem(this.id);e=n?JSON.parse(n):{}}return Object.assign(this.config,e),this}}]),r}();function G1(r){var t;return r<10?t="".concat(r.toFixed(2),"ms"):r<100?t="".concat(r.toFixed(1),"ms"):r<1e3?t="".concat(r.toFixed(0),"ms"):t="".concat((r/1e3).toFixed(2),"s"),t}function U1(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,e=Math.max(t-r.length,0);return"".concat(" ".repeat(e)).concat(r)}function as(r,t,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,a=r.src.replace(/\(/g,"%28").replace(/\)/g,"%29");r.width>n&&(e=Math.min(e,n/r.width));var i=r.width*e,o=r.height*e,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(i/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(a,");"),"background-size:".concat(i,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var is;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(is||(is={}));function N1(r){return typeof r=="string"?is[r.toUpperCase()]||is.WHITE:r}function j1(r,t,e){return!or&&typeof r=="string"&&(t&&(t=N1(t),r="\x1B[".concat(t,"m").concat(r,"\x1B[39m")),e&&(t=N1(e),r="\x1B[".concat(e+10,"m").concat(r,"\x1B[49m"))),r}function FP(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=LP(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function LP(r,t){if(r){if(typeof r=="string")return V1(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return V1(r,t)}}function V1(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function H1(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],e=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(e),a=FP(n),i;try{var o=function(){var u=i.value;typeof r[u]=="function"&&(t.find(function(f){return u===f})||(r[u]=r[u].bind(r)))};for(a.s();!(i=a.n()).done;)o()}catch(s){a.e(s)}finally{a.f()}}function ta(r,t){if(!r)throw new Error(t||"Assertion failed")}function un(){var r;if(or&&"performance"in ra){var t,e;r=ra===null||ra===void 0||(t=ra.performance)===null||t===void 0||(e=t.now)===null||e===void 0?void 0:e.call(t)}else if("hrtime"in sn){var n,a=sn===null||sn===void 0||(n=sn.hrtime)===null||n===void 0?void 0:n.call(sn);r=a[0]*1e3+a[1]/1e6}else r=Date.now();return r}var na={debug:or&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},kP={enabled:!0,level:0};function xr(){}var z1={},W1={once:!0},qr=function(){function r(){(0,X1.default)(this,r);var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""},e=t.id;g(this,"id",void 0),g(this,"VERSION",ns),g(this,"_startTs",un()),g(this,"_deltaTs",un()),g(this,"_storage",void 0),g(this,"userData",{}),g(this,"LOG_THROTTLE_TIMEOUT",0),this.id=e,this._storage=new D1("__probe-".concat(this.id,"__"),kP),this.userData={},this.timeStamp("".concat(this.id," started")),H1(this),Object.seal(this)}return(0,K1.default)(r,[{key:"level",get:function(){return this.getLevel()},set:function(e){this.setLevel(e)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((un()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((un()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(e){this.level=e}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({level:e}),this}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,n){this._storage.updateConfiguration((0,q1.default)({},e,n))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(e,n){ta(e,n)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,na.warn,arguments,W1)}},{key:"error",value:function(e){return this._getLogFunction(0,e,na.error,arguments)}},{key:"deprecated",value:function(e,n){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(n,"` instead"))}},{key:"removed",value:function(e,n){return this.error("`".concat(e,"` has been removed. Use `").concat(n,"` instead"))}},{key:"probe",value:function(e,n){return this._getLogFunction(e,n,na.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,n){return this._getLogFunction(e,n,na.debug,arguments)}},{key:"info",value:function(e,n){return this._getLogFunction(e,n,console.info,arguments)}},{key:"once",value:function(e,n){for(var a=arguments.length,i=new Array(a>2?a-2:0),o=2;o<a;o++)i[o-2]=arguments[o];return this._getLogFunction(e,n,na.debug||na.info,arguments,W1)}},{key:"table",value:function(e,n,a){return n?this._getLogFunction(e,n,console.table||xr,a&&[a],{tag:NP(n)}):xr}},{key:"image",value:function(e){var n=e.logLevel,a=e.priority,i=e.image,o=e.message,s=o===void 0?"":o,u=e.scale,f=u===void 0?1:u;return this._shouldLog(n||a)?or?UP({image:i,message:s,scale:f}):GP({image:i,message:s,scale:f}):xr}},{key:"time",value:function(e,n){return this._getLogFunction(e,n,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,n){return this._getLogFunction(e,n,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,n){return this._getLogFunction(e,n,console.timeStamp||xr)}},{key:"group",value:function(e,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=J1({logLevel:e,message:n,opts:a}),o=a.collapsed;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}},{key:"groupCollapsed",value:function(e,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(e,n,Object.assign({},a,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||xr)}},{key:"withGroup",value:function(e,n,a){this.group(e,n)();try{a()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=Y1(e)}},{key:"_getLogFunction",value:function(e,n,a,i,o){if(this._shouldLog(e)){var s;o=J1({logLevel:e,message:n,args:i,opts:o}),a=a||o.method,ta(a),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=un();var u=o.tag||o.message;if(o.once)if(!z1[u])z1[u]=un();else return xr;return n=DP(this.id,o.message,o),(s=a).bind.apply(s,[console,n].concat((0,Za.default)(o.args)))}return xr}}]),r}();g(qr,"VERSION",ns);function Y1(r){if(!r)return 0;var t;switch((0,os.default)(r)){case"number":t=r;break;case"object":t=r.logLevel||r.priority||0;break;default:return 0}return ta(Number.isFinite(t)&&t>=0),t}function J1(r){var t=r.logLevel,e=r.message;r.logLevel=Y1(t);for(var n=r.args?Array.from(r.args):[];n.length&&n.shift()!==e;);switch((0,os.default)(t)){case"string":case"function":e!==void 0&&n.unshift(e),r.message=t;break;case"object":Object.assign(r,t);break;default:}typeof r.message=="function"&&(r.message=r.message());var a=(0,os.default)(r.message);return ta(a==="string"||a==="object"),Object.assign(r,{args:n},r.opts)}function DP(r,t,e){if(typeof t=="string"){var n=e.time?U1(G1(e.total)):"";t=e.time?"".concat(r,": ").concat(n," ").concat(t):"".concat(r,": ").concat(t),t=j1(t,e.color,e.background)}return t}function GP(r){var t=r.image,e=r.message,n=e===void 0?"":e,a=r.scale,i=a===void 0?1:a,o=null;try{o=module.require("asciify-image")}catch{}return o?function(){return o(t,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then(function(s){return console.log(s)})}:xr}function UP(r){var t=r.image,e=r.message,n=e===void 0?"":e,a=r.scale,i=a===void 0?1:a;if(typeof t=="string"){var o=new Image;return o.onload=function(){var l,c=as(o,n,i);(l=console).log.apply(l,(0,Za.default)(c))},o.src=t,xr}var s=t.nodeName||"";if(s.toLowerCase()==="img"){var u;return(u=console).log.apply(u,(0,Za.default)(as(t,n,i))),xr}if(s.toLowerCase()==="canvas"){var f=new Image;return f.onload=function(){var l;return(l=console).log.apply(l,(0,Za.default)(as(f,n,i)))},f.src=t.toDataURL(),xr}return xr}function NP(r){for(var t in r)for(var e in r[t])return e||"untitled";return"empty"}var q5=new qr({id:"@probe.gl/log"});var oe=new qr({id:"luma.gl"});function Ue(r,t){if(!r)throw new Error(t||"luma.gl: assertion failed.")}var jP="Invalid WebGLRenderingContext";var VP="Requires WebGL2";function ss(r){return typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&r instanceof WebGL2RenderingContext?!0:Boolean(r&&Number.isFinite(r._version))}function ce(r){return typeof WebGL2RenderingContext<"u"&&r instanceof WebGL2RenderingContext?!0:Boolean(r&&r._version===2)}function rc(r){return ce(r)?r:null}function ei(r){return Ue(ss(r),jP),r}function Ye(r){return Ue(ce(r),VP),r}var ri={};function HP(r){globalThis.console&&globalThis.console.error&&globalThis.console.error(r)}function zP(r){globalThis.console&&globalThis.console.log&&globalThis.console.log(r)}function WP(r,t){ri[r]=!0,t!==void 0&&HP(t)}function JP(r){var t=r.getError;r.getError=function(){var n;do n=t.apply(r),n!==0&&(ri[n]=!0);while(n!==0);for(n in ri)if(ri[n])return delete ri[n],parseInt(n,10);return 0}}var ti=function r(t){var e=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 a=new r.VertexAttrib(e);this.attribs[n]=a}this.maxAttrib=0};ti.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()};ti.VertexAttrib.prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var fn=function(t){var e=this;this.gl=t,JP(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(i){return i===e.VERTEX_ARRAY_BINDING_OES?e.currentVertexArrayObject===e.defaultVertexArrayObject?null:e.currentVertexArrayObject:n.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(i){var o=e.currentVertexArrayObject;o.maxAttrib=Math.max(o.maxAttrib,i);var s=o.attribs[i];return s.enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(i){var o=e.currentVertexArrayObject;o.maxAttrib=Math.max(o.maxAttrib,i);var s=o.attribs[i];return s.enabled=!1,n.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(i,o){switch(i){case 34962:e.currentArrayBuffer=o;break;case 34963:e.currentVertexArrayObject.elementArrayBuffer=o;break;default:}return n.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(i,o){var s=e.currentVertexArrayObject,u=s.attribs[i];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(i,o,s,u,f,l){var c=e.currentVertexArrayObject;c.maxAttrib=Math.max(c.maxAttrib,i);var h=c.attribs[i];return h.buffer=e.currentArrayBuffer,h.size=o,h.type=s,h.normalized=u,h.stride=f,h.offset=l,h.recache(),n.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",function(){zP("OESVertexArrayObject emulation library context restored"),e.reset_()},!0),this.reset_()};fn.prototype.VERTEX_ARRAY_BINDING_OES=34229;fn.prototype.reset_=function(){var t=this.vertexArrayObjects!==void 0;if(t)for(var e=0;e<this.vertexArrayObjects.length;++e)this.vertexArrayObjects.isAlive=!1;var n=this.gl;this.maxVertexAttribs=n.getParameter(34921),this.defaultVertexArrayObject=new ti(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)};fn.prototype.createVertexArrayOES=function(){var t=new ti(this);return this.vertexArrayObjects.push(t),t};fn.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)};fn.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof ti&&t.hasBeenBound&&t.ext===this)};fn.prototype.bindVertexArrayOES=function(t){var e=this.gl;if(t&&!t.isAlive){WP(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");return}var n=this.original,a=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(a!==i){(!a||i.elementArrayBuffer!==a.elementArrayBuffer)&&n.bindBuffer.call(e,34963,i.elementArrayBuffer);for(var o=this.currentArrayBuffer,s=Math.max(a?a.maxAttrib:0,i.maxAttrib),u=0;u<=s;u++){var f=i.attribs[u],l=a?a.attribs[u]:null;if((!a||f.enabled!==l.enabled)&&(f.enabled?n.enableVertexAttribArray.call(e,u):n.disableVertexAttribArray.call(e,u)),f.enabled){var c=!1;(!a||f.buffer!==l.buffer)&&(o!==f.buffer&&(n.bindBuffer.call(e,34962,f.buffer),o=f.buffer),c=!0),(c||f.cached!==l.cached)&&n.vertexAttribPointer.call(e,u,f.size,f.type,f.normalized,f.stride,f.offset)}}this.currentArrayBuffer!==o&&n.bindBuffer.call(e,34962,this.currentArrayBuffer)}};function Q1(r){if(typeof r.createVertexArray!="function"){var t=r.getSupportedExtensions;r.getSupportedExtensions=function(){var a=t.call(this)||[];return a.indexOf("OES_vertex_array_object")<0&&a.push("OES_vertex_array_object"),a};var e=r.getExtension;r.getExtension=function(a){var i=e.call(this,a);return i||(a!=="OES_vertex_array_object"?null:(r.__OESVertexArrayObject||(this.__OESVertexArrayObject=new fn(this)),this.__OESVertexArrayObject))}}}var ni=m(W());var ae=m(W());var re,$1="OES_element_index",Z1="WEBGL_draw_buffers",qP="EXT_disjoint_timer_query",XP="EXT_disjoint_timer_query_webgl2",KP="EXT_texture_filter_anisotropic",eA="WEBGL_debug_renderer_info",YP=35723,QP=4352,$P=36795,ZP=34047,eI=37445,rI=37446,Te=function(t){return ce(t)?void 0:0},tI=(re={},(0,ae.default)(re,3074,function(t){return ce(t)?void 0:36064}),(0,ae.default)(re,YP,function(r){return ce(r)?void 0:QP}),(0,ae.default)(re,35977,Te),(0,ae.default)(re,32937,Te),(0,ae.default)(re,$P,function(r,t){var e=ce(r)?r.getExtension(XP):r.getExtension(qP);return e&&e.GPU_DISJOINT_EXT?t(e.GPU_DISJOINT_EXT):0}),(0,ae.default)(re,eI,function(r,t){var e=r.getExtension(eA);return t(e&&e.UNMASKED_VENDOR_WEBGL||7936)}),(0,ae.default)(re,rI,function(r,t){var e=r.getExtension(eA);return t(e&&e.UNMASKED_RENDERER_WEBGL||7937)}),(0,ae.default)(re,ZP,function(r,t){var e=r.luma.extensions[KP];return e?t(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),(0,ae.default)(re,32883,Te),(0,ae.default)(re,35071,Te),(0,ae.default)(re,37447,Te),(0,ae.default)(re,36063,function(t,e){if(!ce(t)){var n=t.getExtension(Z1);return n?e(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),(0,ae.default)(re,35379,Te),(0,ae.default)(re,35374,Te),(0,ae.default)(re,35377,Te),(0,ae.default)(re,34852,function(t){if(!ce(t)){var e=t.getExtension(Z1);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}}),(0,ae.default)(re,36203,function(t){return t.getExtension($1)?2147483647:65535}),(0,ae.default)(re,33001,function(t){return t.getExtension($1)?16777216:65535}),(0,ae.default)(re,33e3,function(t){return 16777216}),(0,ae.default)(re,37157,Te),(0,ae.default)(re,35373,Te),(0,ae.default)(re,35657,Te),(0,ae.default)(re,36183,Te),(0,ae.default)(re,37137,Te),(0,ae.default)(re,34045,Te),(0,ae.default)(re,35978,Te),(0,ae.default)(re,35979,Te),(0,ae.default)(re,35968,Te),(0,ae.default)(re,35376,Te),(0,ae.default)(re,35375,Te),(0,ae.default)(re,35659,Te),(0,ae.default)(re,37154,Te),(0,ae.default)(re,35371,Te),(0,ae.default)(re,35658,Te),(0,ae.default)(re,35076,Te),(0,ae.default)(re,35077,Te),(0,ae.default)(re,35380,Te),re);function rA(r,t,e){var n=tI[e],a=typeof n=="function"?n(r,t,e):n,i=a!==void 0?a:t(e);return i}var aa,nI="OES_vertex_array_object",tA="ANGLE_instanced_arrays",aI="WEBGL_draw_buffers",iI="EXT_disjoint_timer_query",oI="EXT_texture_filter_anisotropic",sI="VertexArray requires WebGL2 or OES_vertex_array_object extension";function uI(r,t){return{webgl2:ce(r),ext:r.getExtension(t)}}var tc=(aa={},(0,ni.default)(aa,nI,{meta:{suffix:"OES"},createVertexArray:function(){Ue(!1,sI)},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),(0,ni.default)(aa,tA,{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(t,e){Ue(e===0,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),(0,ni.default)(aa,aI,{meta:{suffix:"WEBGL"},drawBuffers:function(){Ue(!1)}}),(0,ni.default)(aa,iI,{meta:{suffix:"EXT"},createQuery:function(){Ue(!1)},deleteQuery:function(){Ue(!1)},beginQuery:function(){Ue(!1)},endQuery:function(){},getQuery:function(t,e){return this.getQueryObject(t,e)},getQueryParameter:function(t,e){return this.getQueryObject(t,e)},getQueryObject:function(){}}),aa),us={readBuffer:function(t,e,n){ce(t)&&e(n)},getVertexAttrib:function(t,e,n,a){var i=uI(t,tA),o=i.webgl2,s=i.ext,u;switch(a){case 35069:u=o?void 0:!1;break;case 35070:u=!o&&!s?0:void 0;break;default:}return u!==void 0?u:e(n,a)},getProgramParameter:function(t,e,n,a){if(!ce(t))switch(a){case 35967:return 35981;case 35971:return 0;case 35382:return 0;default:}return e(n,a)},getInternalformatParameter:function(t,e,n,a,i){if(!ce(t))switch(i){case 32937:return new Int32Array([0]);default:}return t.getInternalformatParameter(n,a,i)},getTexParameter:function(t,e,n,a){switch(a){case 34046:var i=t.luma.extensions,o=i[oI];a=o&&o.TEXTURE_MAX_ANISOTROPY_EXT||34046;break;default:}return e(n,a)},getParameter:rA,hint:function(t,e,n,a){return e(n,a)}};function aA(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=fI(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}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 i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function fI(r,t){if(r){if(typeof r=="string")return nA(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return nA(r,t)}}function nA(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function iA(r){r.luma=r.luma||{};var t=r.luma;return t.polyfilled||(Q1(r),lI(r),hI(r,tc),cI(r,{target:t,target2:r}),t.polyfilled=!0),r}globalThis.polyfillContext=iA;function lI(r){r.luma.extensions={};var t=r.getSupportedExtensions()||[],e=aA(t),n;try{for(e.s();!(n=e.n()).done;){var a=n.value;r.luma[a]=r.getExtension(a)}}catch(i){e.e(i)}finally{e.f()}}function cI(r,t){var e=t.target,n=t.target2;Object.keys(us).forEach(function(a){if(typeof us[a]=="function"){var i=r[a]?r[a].bind(r):function(){},o=us[a].bind(null,r,i);e[a]=o,n[a]=o}})}function hI(r,t){var e=aA(Object.getOwnPropertyNames(t)),n;try{for(e.s();!(n=e.n()).done;){var a=n.value;a!=="overrides"&&dI(r,{extension:a,target:r.luma,target2:r})}}catch(i){e.e(i)}finally{e.f()}}function dI(r,t){var e=t.extension,n=t.target,a=t.target2,i=tc[e];Ue(i);for(var o=i.meta,s=o===void 0?{}:o,u=s.suffix,f=u===void 0?"":u,l=r.getExtension(e),c=function(){var v=d[h],y="".concat(v).concat(f),A=null;v==="meta"||typeof r[v]=="function"||(l&&typeof l[y]=="function"?A=function(){return l[y].apply(l,arguments)}:typeof i[v]=="function"&&(A=i[v].bind(n))),A&&(n[v]=A,a[v]=A)},h=0,d=Object.keys(i);h<d.length;h++)c()}var fs=m(ge()),Me=m(lr()),T=m(W());var H,G,Er,ls=(H={},(0,T.default)(H,3042,!1),(0,T.default)(H,32773,new Float32Array([0,0,0,0])),(0,T.default)(H,32777,32774),(0,T.default)(H,34877,32774),(0,T.default)(H,32969,1),(0,T.default)(H,32968,0),(0,T.default)(H,32971,1),(0,T.default)(H,32970,0),(0,T.default)(H,3106,new Float32Array([0,0,0,0])),(0,T.default)(H,3107,[!0,!0,!0,!0]),(0,T.default)(H,2884,!1),(0,T.default)(H,2885,1029),(0,T.default)(H,2929,!1),(0,T.default)(H,2931,1),(0,T.default)(H,2932,513),(0,T.default)(H,2928,new Float32Array([0,1])),(0,T.default)(H,2930,!0),(0,T.default)(H,3024,!0),(0,T.default)(H,36006,null),(0,T.default)(H,2886,2305),(0,T.default)(H,33170,4352),(0,T.default)(H,2849,1),(0,T.default)(H,32823,!1),(0,T.default)(H,32824,0),(0,T.default)(H,10752,0),(0,T.default)(H,32938,1),(0,T.default)(H,32939,!1),(0,T.default)(H,3089,!1),(0,T.default)(H,3088,new Int32Array([0,0,1024,1024])),(0,T.default)(H,2960,!1),(0,T.default)(H,2961,0),(0,T.default)(H,2968,4294967295),(0,T.default)(H,36005,4294967295),(0,T.default)(H,2962,519),(0,T.default)(H,2967,0),(0,T.default)(H,2963,4294967295),(0,T.default)(H,34816,519),(0,T.default)(H,36003,0),(0,T.default)(H,36004,4294967295),(0,T.default)(H,2964,7680),(0,T.default)(H,2965,7680),(0,T.default)(H,2966,7680),(0,T.default)(H,34817,7680),(0,T.default)(H,34818,7680),(0,T.default)(H,34819,7680),(0,T.default)(H,2978,[0,0,1024,1024]),(0,T.default)(H,3333,4),(0,T.default)(H,3317,4),(0,T.default)(H,37440,!1),(0,T.default)(H,37441,!1),(0,T.default)(H,37443,37444),(0,T.default)(H,35723,4352),(0,T.default)(H,36010,null),(0,T.default)(H,35977,!1),(0,T.default)(H,3330,0),(0,T.default)(H,3332,0),(0,T.default)(H,3331,0),(0,T.default)(H,3314,0),(0,T.default)(H,32878,0),(0,T.default)(H,3316,0),(0,T.default)(H,3315,0),(0,T.default)(H,32877,0),H),Pt=function(t,e,n){return e?t.enable(n):t.disable(n)},oA=function(t,e,n){return t.hint(n,e)},yr=function(t,e,n){return t.pixelStorei(n,e)},pI=function(t,e){var n=ce(t)?36009:36160;return t.bindFramebuffer(n,e)},mI=function(t,e){return t.bindFramebuffer(36008,e)};function ai(r){return Array.isArray(r)||ArrayBuffer.isView(r)}var sA=(G={},(0,T.default)(G,3042,Pt),(0,T.default)(G,32773,function(t,e){return t.blendColor.apply(t,(0,Me.default)(e))}),(0,T.default)(G,32777,"blendEquation"),(0,T.default)(G,34877,"blendEquation"),(0,T.default)(G,32969,"blendFunc"),(0,T.default)(G,32968,"blendFunc"),(0,T.default)(G,32971,"blendFunc"),(0,T.default)(G,32970,"blendFunc"),(0,T.default)(G,3106,function(t,e){return t.clearColor.apply(t,(0,Me.default)(e))}),(0,T.default)(G,3107,function(t,e){return t.colorMask.apply(t,(0,Me.default)(e))}),(0,T.default)(G,2884,Pt),(0,T.default)(G,2885,function(t,e){return t.cullFace(e)}),(0,T.default)(G,2929,Pt),(0,T.default)(G,2931,function(t,e){return t.clearDepth(e)}),(0,T.default)(G,2932,function(t,e){return t.depthFunc(e)}),(0,T.default)(G,2928,function(t,e){return t.depthRange.apply(t,(0,Me.default)(e))}),(0,T.default)(G,2930,function(t,e){return t.depthMask(e)}),(0,T.default)(G,3024,Pt),(0,T.default)(G,35723,oA),(0,T.default)(G,36006,pI),(0,T.default)(G,2886,function(t,e){return t.frontFace(e)}),(0,T.default)(G,33170,oA),(0,T.default)(G,2849,function(t,e){return t.lineWidth(e)}),(0,T.default)(G,32823,Pt),(0,T.default)(G,32824,"polygonOffset"),(0,T.default)(G,10752,"polygonOffset"),(0,T.default)(G,35977,Pt),(0,T.default)(G,32938,"sampleCoverage"),(0,T.default)(G,32939,"sampleCoverage"),(0,T.default)(G,3089,Pt),(0,T.default)(G,3088,function(t,e){return t.scissor.apply(t,(0,Me.default)(e))}),(0,T.default)(G,2960,Pt),(0,T.default)(G,2961,function(t,e){return t.clearStencil(e)}),(0,T.default)(G,2968,function(t,e){return t.stencilMaskSeparate(1028,e)}),(0,T.default)(G,36005,function(t,e){return t.stencilMaskSeparate(1029,e)}),(0,T.default)(G,2962,"stencilFuncFront"),(0,T.default)(G,2967,"stencilFuncFront"),(0,T.default)(G,2963,"stencilFuncFront"),(0,T.default)(G,34816,"stencilFuncBack"),(0,T.default)(G,36003,"stencilFuncBack"),(0,T.default)(G,36004,"stencilFuncBack"),(0,T.default)(G,2964,"stencilOpFront"),(0,T.default)(G,2965,"stencilOpFront"),(0,T.default)(G,2966,"stencilOpFront"),(0,T.default)(G,34817,"stencilOpBack"),(0,T.default)(G,34818,"stencilOpBack"),(0,T.default)(G,34819,"stencilOpBack"),(0,T.default)(G,2978,function(t,e){return t.viewport.apply(t,(0,Me.default)(e))}),(0,T.default)(G,3333,yr),(0,T.default)(G,3317,yr),(0,T.default)(G,37440,yr),(0,T.default)(G,37441,yr),(0,T.default)(G,37443,yr),(0,T.default)(G,3330,yr),(0,T.default)(G,3332,yr),(0,T.default)(G,3331,yr),(0,T.default)(G,36010,mI),(0,T.default)(G,3314,yr),(0,T.default)(G,32878,yr),(0,T.default)(G,3316,yr),(0,T.default)(G,3315,yr),(0,T.default)(G,32877,yr),(0,T.default)(G,"framebuffer",function(t,e){var n=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,n)}),(0,T.default)(G,"blend",function(t,e){return e?t.enable(3042):t.disable(3042)}),(0,T.default)(G,"blendColor",function(t,e){return t.blendColor.apply(t,(0,Me.default)(e))}),(0,T.default)(G,"blendEquation",function(t,e){e=ai(e)?e:[e,e],t.blendEquationSeparate.apply(t,(0,Me.default)(e))}),(0,T.default)(G,"blendFunc",function(t,e){e=ai(e)&&e.length===2?[].concat((0,Me.default)(e),(0,Me.default)(e)):e,t.blendFuncSeparate.apply(t,(0,Me.default)(e))}),(0,T.default)(G,"clearColor",function(t,e){return t.clearColor.apply(t,(0,Me.default)(e))}),(0,T.default)(G,"clearDepth",function(t,e){return t.clearDepth(e)}),(0,T.default)(G,"clearStencil",function(t,e){return t.clearStencil(e)}),(0,T.default)(G,"colorMask",function(t,e){return t.colorMask.apply(t,(0,Me.default)(e))}),(0,T.default)(G,"cull",function(t,e){return e?t.enable(2884):t.disable(2884)}),(0,T.default)(G,"cullFace",function(t,e){return t.cullFace(e)}),(0,T.default)(G,"depthTest",function(t,e){return e?t.enable(2929):t.disable(2929)}),(0,T.default)(G,"depthFunc",function(t,e){return t.depthFunc(e)}),(0,T.default)(G,"depthMask",function(t,e){return t.depthMask(e)}),(0,T.default)(G,"depthRange",function(t,e){return t.depthRange.apply(t,(0,Me.default)(e))}),(0,T.default)(G,"dither",function(t,e){return e?t.enable(3024):t.disable(3024)}),(0,T.default)(G,"derivativeHint",function(t,e){t.hint(35723,e)}),(0,T.default)(G,"frontFace",function(t,e){return t.frontFace(e)}),(0,T.default)(G,"mipmapHint",function(t,e){return t.hint(33170,e)}),(0,T.default)(G,"lineWidth",function(t,e){return t.lineWidth(e)}),(0,T.default)(G,"polygonOffsetFill",function(t,e){return e?t.enable(32823):t.disable(32823)}),(0,T.default)(G,"polygonOffset",function(t,e){return t.polygonOffset.apply(t,(0,Me.default)(e))}),(0,T.default)(G,"sampleCoverage",function(t,e){return t.sampleCoverage.apply(t,(0,Me.default)(e))}),(0,T.default)(G,"scissorTest",function(t,e){return e?t.enable(3089):t.disable(3089)}),(0,T.default)(G,"scissor",function(t,e){return t.scissor.apply(t,(0,Me.default)(e))}),(0,T.default)(G,"stencilTest",function(t,e){return e?t.enable(2960):t.disable(2960)}),(0,T.default)(G,"stencilMask",function(t,e){e=ai(e)?e:[e,e];var n=e,a=(0,fs.default)(n,2),i=a[0],o=a[1];t.stencilMaskSeparate(1028,i),t.stencilMaskSeparate(1029,o)}),(0,T.default)(G,"stencilFunc",function(t,e){e=ai(e)&&e.length===3?[].concat((0,Me.default)(e),(0,Me.default)(e)):e;var n=e,a=(0,fs.default)(n,6),i=a[0],o=a[1],s=a[2],u=a[3],f=a[4],l=a[5];t.stencilFuncSeparate(1028,i,o,s),t.stencilFuncSeparate(1029,u,f,l)}),(0,T.default)(G,"stencilOp",function(t,e){e=ai(e)&&e.length===3?[].concat((0,Me.default)(e),(0,Me.default)(e)):e;var n=e,a=(0,fs.default)(n,6),i=a[0],o=a[1],s=a[2],u=a[3],f=a[4],l=a[5];t.stencilOpSeparate(1028,i,o,s),t.stencilOpSeparate(1029,u,f,l)}),(0,T.default)(G,"viewport",function(t,e){return t.viewport.apply(t,(0,Me.default)(e))}),G);function Le(r,t,e){return t[r]!==void 0?t[r]:e[r]}var uA={blendEquation:function(t,e,n){return t.blendEquationSeparate(Le(32777,e,n),Le(34877,e,n))},blendFunc:function(t,e,n){return t.blendFuncSeparate(Le(32969,e,n),Le(32968,e,n),Le(32971,e,n),Le(32970,e,n))},polygonOffset:function(t,e,n){return t.polygonOffset(Le(32824,e,n),Le(10752,e,n))},sampleCoverage:function(t,e,n){return t.sampleCoverage(Le(32938,e,n),Le(32939,e,n))},stencilFuncFront:function(t,e,n){return t.stencilFuncSeparate(1028,Le(2962,e,n),Le(2967,e,n),Le(2963,e,n))},stencilFuncBack:function(t,e,n){return t.stencilFuncSeparate(1029,Le(34816,e,n),Le(36003,e,n),Le(36004,e,n))},stencilOpFront:function(t,e,n){return t.stencilOpSeparate(1028,Le(2964,e,n),Le(2965,e,n),Le(2966,e,n))},stencilOpBack:function(t,e,n){return t.stencilOpSeparate(1029,Le(34817,e,n),Le(34818,e,n),Le(34819,e,n))}},nc={enable:function(t,e){return t((0,T.default)({},e,!0))},disable:function(t,e){return t((0,T.default)({},e,!1))},pixelStorei:function(t,e,n){return t((0,T.default)({},e,n))},hint:function(t,e,n){return t((0,T.default)({},e,n))},bindFramebuffer:function(t,e,n){var a;switch(e){case 36160:return t((a={},(0,T.default)(a,36006,n),(0,T.default)(a,36010,n),a));case 36009:return t((0,T.default)({},36006,n));case 36008:return t((0,T.default)({},36010,n));default:return null}},blendColor:function(t,e,n,a,i){return t((0,T.default)({},32773,new Float32Array([e,n,a,i])))},blendEquation:function(t,e){var n;return t((n={},(0,T.default)(n,32777,e),(0,T.default)(n,34877,e),n))},blendEquationSeparate:function(t,e,n){var a;return t((a={},(0,T.default)(a,32777,e),(0,T.default)(a,34877,n),a))},blendFunc:function(t,e,n){var a;return t((a={},(0,T.default)(a,32969,e),(0,T.default)(a,32968,n),(0,T.default)(a,32971,e),(0,T.default)(a,32970,n),a))},blendFuncSeparate:function(t,e,n,a,i){var o;return t((o={},(0,T.default)(o,32969,e),(0,T.default)(o,32968,n),(0,T.default)(o,32971,a),(0,T.default)(o,32970,i),o))},clearColor:function(t,e,n,a,i){return t((0,T.default)({},3106,new Float32Array([e,n,a,i])))},clearDepth:function(t,e){return t((0,T.default)({},2931,e))},clearStencil:function(t,e){return t((0,T.default)({},2961,e))},colorMask:function(t,e,n,a,i){return t((0,T.default)({},3107,[e,n,a,i]))},cullFace:function(t,e){return t((0,T.default)({},2885,e))},depthFunc:function(t,e){return t((0,T.default)({},2932,e))},depthRange:function(t,e,n){return t((0,T.default)({},2928,new Float32Array([e,n])))},depthMask:function(t,e){return t((0,T.default)({},2930,e))},frontFace:function(t,e){return t((0,T.default)({},2886,e))},lineWidth:function(t,e){return t((0,T.default)({},2849,e))},polygonOffset:function(t,e,n){var a;return t((a={},(0,T.default)(a,32824,e),(0,T.default)(a,10752,n),a))},sampleCoverage:function(t,e,n){var a;return t((a={},(0,T.default)(a,32938,e),(0,T.default)(a,32939,n),a))},scissor:function(t,e,n,a,i){return t((0,T.default)({},3088,new Int32Array([e,n,a,i])))},stencilMask:function(t,e){var n;return t((n={},(0,T.default)(n,2968,e),(0,T.default)(n,36005,e),n))},stencilMaskSeparate:function(t,e,n){return t((0,T.default)({},e===1028?2968:36005,n))},stencilFunc:function(t,e,n,a){var i;return t((i={},(0,T.default)(i,2962,e),(0,T.default)(i,2967,n),(0,T.default)(i,2963,a),(0,T.default)(i,34816,e),(0,T.default)(i,36003,n),(0,T.default)(i,36004,a),i))},stencilFuncSeparate:function(t,e,n,a,i){var o;return t((o={},(0,T.default)(o,e===1028?2962:34816,n),(0,T.default)(o,e===1028?2967:36003,a),(0,T.default)(o,e===1028?2963:36004,i),o))},stencilOp:function(t,e,n,a){var i;return t((i={},(0,T.default)(i,2964,e),(0,T.default)(i,2965,n),(0,T.default)(i,2966,a),(0,T.default)(i,34817,e),(0,T.default)(i,34818,n),(0,T.default)(i,34819,a),i))},stencilOpSeparate:function(t,e,n,a,i){var o;return t((o={},(0,T.default)(o,e===1028?2964:34817,n),(0,T.default)(o,e===1028?2965:34818,a),(0,T.default)(o,e===1028?2966:34819,i),o))},viewport:function(t,e,n,a,i){return t((0,T.default)({},2978,[e,n,a,i]))}},Xr=function(t,e){return t.isEnabled(e)},ac=(Er={},(0,T.default)(Er,3042,Xr),(0,T.default)(Er,2884,Xr),(0,T.default)(Er,2929,Xr),(0,T.default)(Er,3024,Xr),(0,T.default)(Er,32823,Xr),(0,T.default)(Er,32926,Xr),(0,T.default)(Er,32928,Xr),(0,T.default)(Er,3089,Xr),(0,T.default)(Er,2960,Xr),(0,T.default)(Er,35977,Xr),Er);var cA=m(V()),hA=m(z());function ic(r){for(var t in r)return!1;return!0}function fA(r,t){if(r===t)return!0;var e=Array.isArray(r)||ArrayBuffer.isView(r),n=Array.isArray(t)||ArrayBuffer.isView(t);if(e&&n&&r.length===t.length){for(var a=0;a<r.length;++a)if(r[a]!==t[a])return!1;return!0}return!1}function lA(r,t){var e=r[t].bind(r);r[t]=function(){var a=arguments.length<=0?void 0:arguments[0];return a in r.state.cache&&r.state.enable?r.state.cache[a]:e.apply(void 0,arguments)},Object.defineProperty(r[t],"name",{value:"".concat(t,"-from-cache"),configurable:!1})}function vI(r,t,e){var n=r[t].bind(r);r[t]=function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];var u=e.apply(void 0,[r.state._updateCache].concat(o)),f=u.valueChanged,l=u.oldValue;return f&&n.apply(void 0,o),l},Object.defineProperty(r[t],"name",{value:"".concat(t,"-to-cache"),configurable:!1})}function gI(r){var t=r.useProgram.bind(r);r.useProgram=function(n){r.state.program!==n&&(t(n),r.state.program=n)}}var yI=function(){function r(t){(0,cA.default)(this,r);var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.copyState,a=n===void 0?!1:n,i=e.log,o=i===void 0?function(){}:i;this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=a?uc(t):Object.assign({},ls),this.log=o,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return(0,hA.default)(r,[{key:"push",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.stateStack.push({})}},{key:"pop",value:function(){Ue(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];hs(this.gl,e),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var n=!1,a,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var o in e){Ue(o!==void 0);var s=e[o],u=this.cache[o];fA(s,u)||(n=!0,a=u,i&&!(o in i)&&(i[o]=u),this.cache[o]=s)}return{valueChanged:n,oldValue:a}}}]),r}();function oc(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t.enable,n=e===void 0?!0:e,a=t.copyState;if(Ue(a!==void 0),!r.state){var i=globalThis.polyfillContext;i&&i(r),r.state=new yI(r,{copyState:a}),gI(r);for(var o in nc){var s=nc[o];vI(r,o,s)}lA(r,"getParameter"),lA(r,"isEnabled")}return r.state.enable=n,r}function sc(r){r.state||oc(r,{copyState:!1}),r.state.push()}function cs(r){Ue(r.state),r.state.pop()}function AI(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=bI(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}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 i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function bI(r,t){if(r){if(typeof r=="string")return dA(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return dA(r,t)}}function dA(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function hs(r,t){if(Ue(ss(r),"setParameters requires a WebGL context"),!ic(t)){var e={};for(var n in t){var a=Number(n),i=sA[n];i&&(typeof i=="string"?e[i]=!0:i(r,t[n],a))}var o=r.state&&r.state.cache;if(o)for(var s in e){var u=uA[s];u(r,t,o)}}}function uc(r,t){if(t=t||ls,typeof t=="number"){var e=t,n=ac[e];return n?n(r,e):r.getParameter(e)}var a=Array.isArray(t)?t:Object.keys(t),i={},o=AI(a),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,f=ac[u];i[u]=f?f(r,Number(u)):r.getParameter(Number(u))}}catch(l){o.e(l)}finally{o.f()}return i}function at(r,t,e){if(ic(t))return e(r);var n=t.nocatch,a=n===void 0?!0:n;sc(r),hs(r,t);var i;if(a)i=e(r),cs(r);else try{i=e(r)}finally{cs(r)}return i}var Fz=or();var pA=m(V()),mA=m(z());var ii="8.5.16",_I="set luma.log.level=1 (or higher) to trace rendering",fc=function(){function r(){(0,pA.default)(this,r),this.stats=new Map}return(0,mA.default)(r,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new $t({id:e})),this.stats.get(e)}}]),r}(),ia=new fc;if(globalThis.luma&&globalThis.luma.VERSION!==ii)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(ii));globalThis.luma||(or()&&oe.log(1,"luma.gl ".concat(ii," - ").concat(_I))(),globalThis.luma=globalThis.luma||{VERSION:ii,version:ii,log:oe,stats:ia,globals:{modules:{},nodeIO:{}}});var eW=globalThis.luma;var xb=m(W());var WA=m(V()),JA=m(z()),qA=m(Br()),XA=m(Ie()),KA=m(Fe()),vc=m(Be());var UA=m(ge()),NA=m(V()),jA=m(z()),VA=m(Ie()),HA=m(Fe()),pc=m(Be());var yA=m(V()),AA=m(z());function Y(r,t){if(!r)throw new Error(t||"luma.gl: assertion failed.")}function ds(r,t){if(typeof t!="string")return t;var e=Number(t);if(!isNaN(e))return e;t=t.replace(/^.*\./,"");var n=r[t];return Y(n!==void 0,"Accessing undefined constant GL.".concat(t)),n}function ln(r,t){t=Number(t);for(var e in r)if(r[e]===t)return"GL.".concat(e);return String(t)}var lc={};function ps(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";lc[r]=lc[r]||1;var t=lc[r]++;return"".concat(r,"-").concat(t)}function cc(r){return Y(typeof r=="number","Input must be a number"),r&&(r&r-1)===0}function vA(r,t,e,n){var a="See luma.gl ".concat(e," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),i=Object.getPrototypeOf(r);n.forEach(function(o){i.methodName||(i[o]=function(){throw oe.removed("Calling removed method ".concat(t,".").concat(o,": "),a)(),new Error(o)})})}function TI(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=xI(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
36
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function xI(r,t){if(r){if(typeof r=="string")return gA(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return gA(r,t)}}function gA(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var oa="Resource subclass must define virtual methods",It=function(r){function t(e){(0,yA.default)(this,t);var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ei(e);var a=n.id,i=n.userData,o=i===void 0?{}:i;this.gl=e,this.gl2=e,this.id=a||ps(this[Symbol.toStringTag]),this.userData=o,this._bound=!1,this._handle=n.handle,this._handle===void 0&&(this._handle=this._createHandle()),this.byteLength=0,this._initStats(),this._addStats()}return(0,AA.default)(t,[{key:r,get:function(){return"Resource"}},{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}},{key:"handle",get:function(){return this._handle}},{key:"delete",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=n.deleteChildren,i=a===void 0?!1:a,o=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,o&&i&&o.filter(Boolean).forEach(function(s){return s.delete()}),this}},{key:"bind",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof n!="function")return this._bindHandle(n),this;var a;return this._bound?a=n():(this._bindHandle(this.handle),this._bound=!0,a=n(),this._bound=!1,this._bindHandle(null)),a}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};n=ds(this.gl,n),Y(n);var i=this.constructor.PARAMETERS||{},o=i[n];if(o){var s=ce(this.gl),u=(!("webgl2"in o)||s)&&(!("extension"in o)||this.gl.getExtension(o.extension));if(!u){var f=o.webgl1,l="webgl2"in o?o.webgl2:o.webgl1,c=s?l:f;return c}}return this._getParameter(n,a)}},{key:"getParameters",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=n.parameters,i=n.keys,o=this.constructor.PARAMETERS||{},s=ce(this.gl),u={},f=a||Object.keys(o),l=TI(f),c;try{for(l.s();!(c=l.n()).done;){var h=c.value,d=o[h],p=d&&(!("webgl2"in d)||s)&&(!("extension"in d)||this.gl.getExtension(d.extension));if(p){var v=i?ln(this.gl,h):h;u[v]=this.getParameter(h,n),i&&d.type==="GLenum"&&(u[v]=ln(this.gl,u[v]))}}}catch(y){l.e(y)}finally{l.f()}return u}},{key:"setParameter",value:function(n,a){n=ds(this.gl,n),Y(n);var i=this.constructor.PARAMETERS||{},o=i[n];if(o){var s=ce(this.gl),u=(!("webgl2"in o)||s)&&(!("extension"in o)||this.gl.getExtension(o.extension));if(!u)throw new Error("Parameter not available on this platform");o.type==="GLenum"&&(a=ds(a))}return this._setParameter(n,a),this}},{key:"setParameters",value:function(n){for(var a in n)this.setParameter(a,n[a]);return this}},{key:"stubRemovedMethods",value:function(n,a,i){return vA(this,n,a,i)}},{key:"initialize",value:function(n){}},{key:"_createHandle",value:function(){throw new Error(oa)}},{key:"_deleteHandle",value:function(){throw new Error(oa)}},{key:"_bindHandle",value:function(n){throw new Error(oa)}},{key:"_getOptsFromHandle",value:function(){throw new Error(oa)}},{key:"_getParameter",value:function(n,a){throw new Error(oa)}},{key:"_setParameter",value:function(n,a){throw new Error(oa)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_initStats",value:function(){this.gl.stats=this.gl.stats||new fc}},{key:"_addStats",value:function(){var n=this[Symbol.toStringTag],a=ia.get("Resource Counts");a.get("Resources Created").incrementCount(),a.get("".concat(n,"s Created")).incrementCount(),a.get("".concat(n,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var n=this[Symbol.toStringTag],a=ia.get("Resource Counts");a.get("".concat(n,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag];this._doTrackAllocatedMemory(n,a),this._doTrackAllocatedMemory(n,a,this.gl.stats.get("Memory Usage"))}},{key:"_doTrackAllocatedMemory",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ia.get("Memory Usage");i.get("GPU Memory").addCount(n),i.get("".concat(a," Memory")).addCount(n),this.byteLength=n}},{key:"_trackDeallocatedMemory",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag];this._doTrackDeallocatedMemory(n),this._doTrackDeallocatedMemory(n,this.gl.stats.get("Memory Usage"))}},{key:"_doTrackDeallocatedMemory",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ia.get("Memory Usage");a.get("GPU Memory").subtractCount(this.byteLength),a.get("".concat(n," Memory")).subtractCount(this.byteLength),this.byteLength=0}}]),t}(Symbol.toStringTag);var CA=m(V()),BA=m(z()),MA=m(Br()),OA=m(Ie()),PA=m(Fe()),hc=m(Be());var xA=m(bA()),EA=m(V()),SA=m(z());var wI="Failed to deduce GL constant from typed array";function oi(r){var t=ArrayBuffer.isView(r)?r.constructor:r;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(wI)}}function Rt(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t.clamped,n=e===void 0?!0:e;switch(r){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 _A(r){var t=r.data,e=r.width,n=r.height,a=r.bytesPerPixel,i=a===void 0?4:a,o=r.temp,s=e*i;o=o||new Uint8Array(s);for(var u=0;u<n/2;++u){var f=u*s,l=(n-u-1)*s;o.set(t.subarray(f,f+s)),t.copyWithin(f,l,l+s),t.set(o,l)}}function TA(r){for(var t=r.data,e=r.width,n=r.height,a=Math.round(e/2),i=Math.round(n/2),o=new Uint8Array(a*i*4),s=0;s<i;s++)for(var u=0;u<a;u++)for(var f=0;f<4;f++)o[(s*a+u)*4+f]=t[(s*2*e+u*2)*4+f];return{data:o,width:a,height:i}}function si(r,t,e){var n=e.removedProps,a=n===void 0?{}:n,i=e.deprecatedProps,o=i===void 0?{}:i,s=e.replacedProps,u=s===void 0?{}:s;for(var f in a)if(f in t){var l=a[f],c=l?"".concat(r,".").concat(a[f]):"N/A";oe.removed("".concat(r,".").concat(f),c)()}for(var h in o)if(h in t){var d=o[h];oe.deprecated("".concat(r,".").concat(h),"".concat(r,".").concat(d))()}var p=null;for(var v in u)if(v in t){var y=u[v];oe.deprecated("".concat(r,".").concat(v),"".concat(r,".").concat(y))(),p=p||Object.assign({},t),p[y]=t[v],delete p[v]}return p||t}var CI={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},BI={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},cn=function(){function r(){var t=this;(0,EA.default)(this,r);for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];n.forEach(function(i){return t._assign(i)}),Object.freeze(this)}return(0,SA.default)(r,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"BYTES_PER_ELEMENT",get:function(){return r.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return r.getBytesPerVertex(this)}},{key:"_assign",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e=si("Accessor",e,BI),e.type!==void 0&&(this.type=e.type,(e.type===5124||e.type===5125)&&(this.integer=!0)),e.size!==void 0&&(this.size=e.size),e.offset!==void 0&&(this.offset=e.offset),e.stride!==void 0&&(this.stride=e.stride),e.normalized!==void 0&&(this.normalized=e.normalized),e.integer!==void 0&&(this.integer=e.integer),e.divisor!==void 0&&(this.divisor=e.divisor),e.buffer!==void 0&&(this.buffer=e.buffer),e.index!==void 0&&(typeof e.index=="boolean"?this.index=e.index?1:0:this.index=e.index),e.instanced!==void 0&&(this.divisor=e.instanced?1:0),e.isInstanced!==void 0&&(this.divisor=e.isInstanced?1:0),this}}],[{key:"getBytesPerElement",value:function(e){var n=Rt(e.type||5126);return n.BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(e){Y(e.size);var n=Rt(e.type||5126);return n.BYTES_PER_ELEMENT*e.size}},{key:"resolve",value:function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return(0,xA.default)(r,[CI].concat(n))}}]),r}();function MI(r){var t=OI();return function(){var n=(0,hc.default)(r),a;if(t){var i=(0,hc.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,PA.default)(this,a)}}function OI(){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}}var wA=10,IA={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"},PI={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:IA},II={removedProps:IA},dc=function(r,t){(0,OA.default)(n,r);var e=MI(n);function n(a){var i;(0,CA.default)(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=e.call(this,a,o),i.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),i.target=o.target||(i.gl.webgl2?36662:34962),i.initialize(o),Object.seal((0,MA.default)(i)),i}return(0,BA.default)(n,[{key:t,get:function(){return"Buffer"}},{key:"getElementCount",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/cn.getBytesPerElement(i))}},{key:"getVertexCount",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/cn.getBytesPerVertex(i))}},{key:"initialize",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ArrayBuffer.isView(i)&&(i={data:i}),Number.isFinite(i)&&(i={byteLength:i}),i=si("Buffer",i,PI),this.usage=i.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},i,i.accessor)),i.data?this._setData(i.data,i.offset,i.byteLength):this._setByteLength(i.byteLength||0),this}},{key:"setProps",value:function(i){return i=si("Buffer",i,II),"accessor"in i&&this.setAccessor(i.accessor),this}},{key:"setAccessor",value:function(i){return i=Object.assign({},i),delete i.buffer,this.accessor=new cn(i),this}},{key:"reallocate",value:function(i){return i>this.byteLength?(this._setByteLength(i),!0):(this.bytesUsed=i,!1)}},{key:"setData",value:function(i){return this.initialize(i)}},{key:"subData",value:function(i){ArrayBuffer.isView(i)&&(i={data:i});var o=i,s=o.data,u=o.offset,f=u===void 0?0:u,l=o.srcOffset,c=l===void 0?0:l,h=i.byteLength||i.length;Y(s);var d=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(d,this.handle),c!==0||h!==void 0?(Ye(this.gl),this.gl.bufferSubData(this.target,f,s,c,h)):this.gl.bufferSubData(d,f,s),this.gl.bindBuffer(d,null),this.debugData=null,this._inferType(s),this}},{key:"copyData",value:function(i){var o=i.sourceBuffer,s=i.readOffset,u=s===void 0?0:s,f=i.writeOffset,l=f===void 0?0:f,c=i.size,h=this.gl;return Ye(h),h.bindBuffer(36662,o.handle),h.bindBuffer(36663,this.handle),h.copyBufferSubData(36662,36663,u,l,c),h.bindBuffer(36662,null),h.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=i.dstData,s=o===void 0?null:o,u=i.srcByteOffset,f=u===void 0?0:u,l=i.dstOffset,c=l===void 0?0:l,h=i.length,d=h===void 0?0:h;Ye(this.gl);var p=Rt(this.accessor.type||5126,{clamped:!1}),v=this._getAvailableElementCount(f),y=c,A,_;s?(_=s.length,A=_-y):(A=Math.min(v,d||v),_=y+A);var E=Math.min(v,A);return d=d||E,Y(d<=E),s=s||new p(_),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,f,s,c,d),this.gl.bindBuffer(36662,null),s}},{key:"bind",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=i.target,s=o===void 0?this.target:o,u=i.index,f=u===void 0?this.accessor&&this.accessor.index:u,l=i.offset,c=l===void 0?0:l,h=i.size;return s===35345||s===35982?h!==void 0?this.gl.bindBufferRange(s,f,this.handle,c,h):(Y(c===0),this.gl.bindBufferBase(s,f,this.handle)):this.gl.bindBuffer(s,this.handle),this}},{key:"unbind",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=i.target,s=o===void 0?this.target:o,u=i.index,f=u===void 0?this.accessor&&this.accessor.index:u,l=s===35345||s===35982;return l?this.gl.bindBufferBase(s,f,null):this.gl.bindBuffer(s,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(wA,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:i.byteLength+o;Y(ArrayBuffer.isView(i)),this._trackDeallocatedMemory();var u=this._getTarget();this.gl.bindBuffer(u,this.handle),this.gl.bufferData(u,s,this.usage),this.gl.bufferSubData(u,o,i),this.gl.bindBuffer(u,null),this.debugData=i.slice(0,wA),this.bytesUsed=s,this._trackAllocatedMemory(s);var f=oi(i);return Y(f),this.setAccessor(new cn(this.accessor,{type:f})),this}},{key:"_setByteLength",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.usage;Y(i>=0),this._trackDeallocatedMemory();var s=i;i===0&&(s=new Float32Array(0));var u=this._getTarget();return this.gl.bindBuffer(u,this.handle),this.gl.bufferData(u,s,o),this.gl.bindBuffer(u,null),this.usage=o,this.debugData=null,this.bytesUsed=i,this._trackAllocatedMemory(i),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(i){var o=Rt(this.accessor.type||5126,{clamped:!1}),s=i/o.BYTES_PER_ELEMENT;return this.getElementCount()-s}},{key:"_inferType",value:function(i){this.accessor.type||this.setAccessor(new cn(this.accessor,{type:oi(i)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(i){this.gl.bindBuffer(this.target,this.handle);var o=this.gl.getBufferParameter(this.target,i);return this.gl.bindBuffer(this.target,null),o}},{key:"type",get:function(){return oe.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return oe.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(i){return oe.deprecated("setByteLength","reallocate")(),this.reallocate(i)}},{key:"updateAccessor",value:function(i){return oe.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new cn(this.accessor,i),this}}]),n}(It,Symbol.toStringTag);var de=m(W());var Ir,sr,Kr,gs=(Ir={},(0,de.default)(Ir,6407,{dataFormat:6407,types:[5121,33635]}),(0,de.default)(Ir,6408,{dataFormat:6408,types:[5121,32819,32820]}),(0,de.default)(Ir,6406,{dataFormat:6406,types:[5121]}),(0,de.default)(Ir,6409,{dataFormat:6409,types:[5121]}),(0,de.default)(Ir,6410,{dataFormat:6410,types:[5121]}),(0,de.default)(Ir,33326,{dataFormat:6403,types:[5126],gl2:!0}),(0,de.default)(Ir,33328,{dataFormat:33319,types:[5126],gl2:!0}),(0,de.default)(Ir,34837,{dataFormat:6407,types:[5126],gl2:!0}),(0,de.default)(Ir,34836,{dataFormat:6408,types:[5126],gl2:!0}),Ir),RA=(sr={},(0,de.default)(sr,6403,1),(0,de.default)(sr,36244,1),(0,de.default)(sr,33319,2),(0,de.default)(sr,33320,2),(0,de.default)(sr,6407,3),(0,de.default)(sr,36248,3),(0,de.default)(sr,6408,4),(0,de.default)(sr,36249,4),(0,de.default)(sr,6402,1),(0,de.default)(sr,34041,1),(0,de.default)(sr,6406,1),(0,de.default)(sr,6409,1),(0,de.default)(sr,6410,2),sr),FA=(Kr={},(0,de.default)(Kr,5126,4),(0,de.default)(Kr,5125,4),(0,de.default)(Kr,5124,4),(0,de.default)(Kr,5123,2),(0,de.default)(Kr,5122,2),(0,de.default)(Kr,5131,2),(0,de.default)(Kr,5120,1),(0,de.default)(Kr,5121,1),Kr);function LA(r,t){var e=gs[t];if(!e)return!1;if(e.gl1===void 0&&e.gl2===void 0)return!0;var n=ce(r)&&e.gl2||e.gl1;return typeof n=="string"?r.getExtension(n):n}function kA(r,t){var e=gs[t];switch(e&&e.types[0]){case 5126:return r.getExtension("OES_texture_float_linear");case 5131:return r.getExtension("OES_texture_half_float_linear");default:return!0}}function RI(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=FI(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}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 i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function FI(r,t){if(r){if(typeof r=="string")return DA(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return DA(r,t)}}function DA(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function LI(r){var t=kI();return function(){var n=(0,pc.default)(r),a;if(t){var i=(0,pc.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,HA.default)(this,a)}}function kI(){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}}var DI=[9729,9728],GA=globalThis.WebGLBuffer||function(){},mc=function(r,t){(0,VA.default)(n,r);var e=LI(n);function n(a,i){var o;(0,NA.default)(this,n);var s=i.id,u=s===void 0?ps("texture"):s,f=i.handle,l=i.target;return o=e.call(this,a,{id:u,handle:f}),o.target=l,o.textureUnit=void 0,o.loaded=!1,o.width=void 0,o.height=void 0,o.depth=void 0,o.format=void 0,o.type=void 0,o.dataFormat=void 0,o.border=void 0,o.textureUnit=void 0,o.mipmaps=void 0,o}return(0,jA.default)(n,[{key:t,get:function(){return"Texture"}},{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.data;if(s instanceof Promise)return s.then(function(U){return i.initialize(Object.assign({},o,{pixels:U,data:U}))}),this;var u=typeof HTMLVideoElement<"u"&&s instanceof HTMLVideoElement;if(u&&s.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,s.addEventListener("loadeddata",function(){return i.initialize(o)}),this;var f=o.pixels,l=f===void 0?null:f,c=o.format,h=c===void 0?6408:c,d=o.border,p=d===void 0?0:d,v=o.recreate,y=v===void 0?!1:v,A=o.parameters,_=A===void 0?{}:A,E=o.pixelStore,x=E===void 0?{}:E,C=o.textureUnit,P=C===void 0?void 0:C;s||(s=l);var L=o.width,M=o.height,S=o.dataFormat,b=o.type,R=o.compressed,F=R===void 0?!1:R,N=o.mipmaps,k=N===void 0?!0:N,B=o.depth,O=B===void 0?0:B,I=this._deduceParameters({format:h,type:b,dataFormat:S,compressed:F,data:s,width:L,height:M});return L=I.width,M=I.height,F=I.compressed,S=I.dataFormat,b=I.type,this.width=L,this.height=M,this.depth=O,this.format=h,this.type=b,this.dataFormat=S,this.border=p,this.textureUnit=P,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),k&&this._isNPOT()&&(oe.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),k=!1,this._updateForNPOT(_)),this.mipmaps=k,this.setImageData({data:s,width:L,height:M,depth:O,format:h,type:b,dataFormat:S,border:p,mipmaps:k,parameters:x,compressed:F}),k&&this.generateMipmap(),this.setParameters(_),y&&(this.data=s),u&&(this._video={video:s,parameters:_,lastTime:s.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?s.currentTime:-1}),this}},{key:"update",value:function(){if(this._video){var i=this._video,o=i.video,s=i.parameters,u=i.lastTime;if(u===o.currentTime||o.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:o,parameters:s}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=o.currentTime}}},{key:"resize",value:function(i){var o=i.height,s=i.width,u=i.mipmaps,f=u===void 0?!1:u;return s!==this.width||o!==this.height?this.initialize({width:s,height:o,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:f}):this}},{key:"generateMipmap",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._isNPOT()?(oe.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),at(this.gl,o,function(){i.gl.generateMipmap(i.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(i){this._trackDeallocatedMemory("Texture");var o=i.target,s=o===void 0?this.target:o,u=i.pixels,f=u===void 0?null:u,l=i.level,c=l===void 0?0:l,h=i.format,d=h===void 0?this.format:h,p=i.border,v=p===void 0?this.border:p,y=i.offset,A=y===void 0?0:y,_=i.parameters,E=_===void 0?{}:_,x=i.data,C=x===void 0?null:x,P=i.type,L=P===void 0?this.type:P,M=i.width,S=M===void 0?this.width:M,b=i.height,R=b===void 0?this.height:b,F=i.dataFormat,N=F===void 0?this.dataFormat:F,k=i.compressed,B=k===void 0?!1:k;C||(C=f);var O=this._deduceParameters({format:d,type:L,dataFormat:N,compressed:B,data:C,width:S,height:R});L=O.type,N=O.dataFormat,B=O.compressed,S=O.width,R=O.height;var I=this.gl;I.bindTexture(this.target,this.handle);var U=null,D=this._getDataType({data:C,compressed:B});C=D.data,U=D.dataType;var j,X=0;if(at(this.gl,E,function(){switch(U){case"null":I.texImage2D(s,c,d,S,R,v,N,L,C);break;case"typed-array":I.texImage2D(s,c,d,S,R,v,N,L,C,A);break;case"buffer":j=Ye(I),j.bindBuffer(35052,C.handle||C),j.texImage2D(s,c,d,S,R,v,N,L,A),j.bindBuffer(35052,null);break;case"browser-object":ce(I)?I.texImage2D(s,c,d,S,R,v,N,L,C):I.texImage2D(s,c,d,N,L,C);break;case"compressed":var Ee=RI(C.entries()),rr;try{for(Ee.s();!(rr=Ee.n()).done;){var Ne=(0,UA.default)(rr.value,2),yt=Ne[0],_r=Ne[1];I.compressedTexImage2D(s,yt,_r.format,_r.width,_r.height,v,_r.data),X+=_r.levelSize}}catch(kn){Ee.e(kn)}finally{Ee.f()}break;default:Y(!1,"Unknown image data type")}}),U==="compressed")this._trackAllocatedMemory(X,"Texture");else if(C&&C.byteLength)this._trackAllocatedMemory(C.byteLength,"Texture");else{var te=RA[this.dataFormat]||4,Pe=FA[this.type]||1;this._trackAllocatedMemory(this.width*this.height*te*Pe,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(i){var o=this,s=i.target,u=s===void 0?this.target:s,f=i.pixels,l=f===void 0?null:f,c=i.data,h=c===void 0?null:c,d=i.x,p=d===void 0?0:d,v=i.y,y=v===void 0?0:v,A=i.width,_=A===void 0?this.width:A,E=i.height,x=E===void 0?this.height:E,C=i.level,P=C===void 0?0:C,L=i.format,M=L===void 0?this.format:L,S=i.type,b=S===void 0?this.type:S,R=i.dataFormat,F=R===void 0?this.dataFormat:R,N=i.compressed,k=N===void 0?!1:N,B=i.offset,O=B===void 0?0:B,I=i.border,U=I===void 0?this.border:I,D=i.parameters,j=D===void 0?{}:D,X=this._deduceParameters({format:M,type:b,dataFormat:F,compressed:k,data:h,width:_,height:x});if(b=X.type,F=X.dataFormat,k=X.compressed,_=X.width,x=X.height,Y(this.depth===0,"texSubImage not supported for 3D textures"),h||(h=l),h&&h.data){var te=h;h=te.data,_=te.shape[0],x=te.shape[1]}h instanceof dc&&(h=h.handle),this.gl.bindTexture(this.target,this.handle),at(this.gl,j,function(){if(k)o.gl.compressedTexSubImage2D(u,P,p,y,_,x,M,h);else if(h===null)o.gl.texSubImage2D(u,P,p,y,_,x,F,b,null);else if(ArrayBuffer.isView(h))o.gl.texSubImage2D(u,P,p,y,_,x,F,b,h,O);else if(h instanceof GA){var Pe=Ye(o.gl);Pe.bindBuffer(35052,h),Pe.texSubImage2D(u,P,p,y,_,x,F,b,O),Pe.bindBuffer(35052,null)}else if(ce(o.gl)){var Ee=Ye(o.gl);Ee.texSubImage2D(u,P,p,y,_,x,F,b,h)}else o.gl.texSubImage2D(u,P,p,y,F,b,h)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return oe.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,o=this.gl;return i!==void 0&&(this.textureUnit=i,o.activeTexture(33984+i)),o.bindTexture(this.target,this.handle),i}},{key:"unbind",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,o=this.gl;return i!==void 0&&(this.textureUnit=i,o.activeTexture(33984+i)),o.bindTexture(this.target,null),i}},{key:"_getDataType",value:function(i){var o=i.data,s=i.compressed,u=s===void 0?!1:s;return u?{data:o,dataType:"compressed"}:o===null?{data:o,dataType:"null"}:ArrayBuffer.isView(o)?{data:o,dataType:"typed-array"}:o instanceof dc?{data:o.handle,dataType:"buffer"}:o instanceof GA?{data:o,dataType:"buffer"}:{data:o,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(i){var o=i.format,s=i.data,u=i.width,f=i.height,l=i.dataFormat,c=i.type,h=i.compressed,d=gs[o];l=l||d&&d.dataFormat,c=c||d&&d.types[0],h=h||d&&d.compressed;var p=this._deduceImageSize(s,u,f);return u=p.width,f=p.height,{dataFormat:l,type:c,compressed:h,width:u,height:f,format:o,data:s}}},{key:"_deduceImageSize",value:function(i,o,s){var u;return typeof ImageData<"u"&&i instanceof ImageData?u={width:i.width,height:i.height}:typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement?u={width:i.naturalWidth,height:i.naturalHeight}:typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement?u={width:i.width,height:i.height}:typeof ImageBitmap<"u"&&i instanceof ImageBitmap?u={width:i.width,height:i.height}:typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement?u={width:i.videoWidth,height:i.videoHeight}:i?u={width:o,height:s}:u={width:o>=0?o:1,height:s>=0?s:1},Y(u,"Could not deduced texture size"),Y(o===void 0||u.width===o,"Deduced texture width does not match supplied width"),Y(s===void 0||u.height===s,"Deduced texture height does not match supplied height"),u}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(i){switch(i){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var o=this.gl.getTexParameter(this.target,i);return this.gl.bindTexture(this.target,null),o}}},{key:"_setParameter",value:function(i,o){switch(this.gl.bindTexture(this.target,this.handle),o=this._getNPOTParam(i,o),i){case 33082:case 33083:this.gl.texParameterf(this.handle,i,o);break;case 4096:case 4097:Y(!1);break;default:this.gl.texParameteri(this.target,i,o);break}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return ce(this.gl)||!this.width||!this.height?!1:!cc(this.width)||!cc(this.height)}},{key:"_updateForNPOT",value:function(i){i[this.gl.TEXTURE_MIN_FILTER]===void 0&&(i[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),i[this.gl.TEXTURE_WRAP_S]===void 0&&(i[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),i[this.gl.TEXTURE_WRAP_T]===void 0&&(i[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(i,o){if(this._isNPOT())switch(i){case 10241:DI.indexOf(o)===-1&&(o=9729);break;case 10242:case 10243:o!==33071&&(o=33071);break;default:break}return o}}],[{key:"isSupported",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.format,u=o.linearFiltering,f=!0;return s&&(f=f&&LA(i,s),f=f&&(!u||kA(i,s))),f}}]),n}(It,Symbol.toStringTag);var GI="";function zA(r,t){return Y(typeof r=="string"),r=GI+r,new Promise(function(e,n){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(){return n(new Error("Could not load image ".concat(r,".")))},a.crossOrigin=t&&t.crossOrigin||"anonymous",a.src=r}catch(i){n(i)}})}function UI(r){var t=NI();return function(){var n=(0,vc.default)(r),a;if(t){var i=(0,vc.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,KA.default)(this,a)}}function NI(){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}}var hn=function(r,t){(0,XA.default)(n,r);var e=UI(n);function n(a){var i;(0,WA.default)(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ei(a),(o instanceof Promise||typeof o=="string")&&(o={data:o}),typeof o.data=="string"&&(o=Object.assign({},o,{data:zA(o.data)})),i=e.call(this,a,Object.assign({},o,{target:3553})),i.initialize(o),Object.seal((0,qA.default)(i)),i}return(0,JA.default)(n,[{key:t,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(i,o){return mc.isSupported(i,o)}}]),n}(mc,Symbol.toStringTag);var fi=m(W()),vb=m(ge()),gb=m(V()),yb=m(z()),Ab=m(Br()),bb=m($n()),_b=m(Ie()),Tb=m(Fe()),bs=m(Be());var YA=m(V()),QA=m(z()),$A=m(Br()),ZA=m(Ie()),eb=m(Fe()),yc=m(Be());var ee=m(W()),Q,dn="EXT_color_buffer_float",gc=(Q={},(0,ee.default)(Q,33189,{bpp:2}),(0,ee.default)(Q,33190,{gl2:!0,bpp:3}),(0,ee.default)(Q,36012,{gl2:!0,bpp:4}),(0,ee.default)(Q,36168,{bpp:1}),(0,ee.default)(Q,34041,{bpp:4}),(0,ee.default)(Q,35056,{gl2:!0,bpp:4}),(0,ee.default)(Q,36013,{gl2:!0,bpp:5}),(0,ee.default)(Q,32854,{bpp:2}),(0,ee.default)(Q,36194,{bpp:2}),(0,ee.default)(Q,32855,{bpp:2}),(0,ee.default)(Q,33321,{gl2:!0,bpp:1}),(0,ee.default)(Q,33330,{gl2:!0,bpp:1}),(0,ee.default)(Q,33329,{gl2:!0,bpp:1}),(0,ee.default)(Q,33332,{gl2:!0,bpp:2}),(0,ee.default)(Q,33331,{gl2:!0,bpp:2}),(0,ee.default)(Q,33334,{gl2:!0,bpp:4}),(0,ee.default)(Q,33333,{gl2:!0,bpp:4}),(0,ee.default)(Q,33323,{gl2:!0,bpp:2}),(0,ee.default)(Q,33336,{gl2:!0,bpp:2}),(0,ee.default)(Q,33335,{gl2:!0,bpp:2}),(0,ee.default)(Q,33338,{gl2:!0,bpp:4}),(0,ee.default)(Q,33337,{gl2:!0,bpp:4}),(0,ee.default)(Q,33340,{gl2:!0,bpp:8}),(0,ee.default)(Q,33339,{gl2:!0,bpp:8}),(0,ee.default)(Q,32849,{gl2:!0,bpp:3}),(0,ee.default)(Q,32856,{gl2:!0,bpp:4}),(0,ee.default)(Q,32857,{gl2:!0,bpp:4}),(0,ee.default)(Q,36220,{gl2:!0,bpp:4}),(0,ee.default)(Q,36238,{gl2:!0,bpp:4}),(0,ee.default)(Q,36975,{gl2:!0,bpp:4}),(0,ee.default)(Q,36214,{gl2:!0,bpp:8}),(0,ee.default)(Q,36232,{gl2:!0,bpp:8}),(0,ee.default)(Q,36226,{gl2:!0,bpp:16}),(0,ee.default)(Q,36208,{gl2:!0,bpp:16}),(0,ee.default)(Q,33325,{gl2:dn,bpp:2}),(0,ee.default)(Q,33327,{gl2:dn,bpp:4}),(0,ee.default)(Q,34842,{gl2:dn,bpp:8}),(0,ee.default)(Q,33326,{gl2:dn,bpp:4}),(0,ee.default)(Q,33328,{gl2:dn,bpp:8}),(0,ee.default)(Q,34836,{gl2:dn,bpp:16}),(0,ee.default)(Q,35898,{gl2:dn,bpp:4}),Q);function jI(r){var t=VI();return function(){var n=(0,yc.default)(r),a;if(t){var i=(0,yc.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,eb.default)(this,a)}}function VI(){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 HI(r,t,e){var n=e[t];if(!n)return!1;var a=ce(r)&&n.gl2||n.gl1;return typeof a=="string"?r.getExtension(a):a}var ui=function(r,t){(0,ZA.default)(n,r);var e=jI(n);function n(a){var i;(0,YA.default)(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=e.call(this,a,o),i.initialize(o),Object.seal((0,$A.default)(i)),i}return(0,QA.default)(n,[{key:t,get:function(){return"Renderbuffer"}},{key:"initialize",value:function(i){var o=i.format,s=i.width,u=s===void 0?1:s,f=i.height,l=f===void 0?1:f,c=i.samples,h=c===void 0?0:c;return Y(o,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),h!==0&&ce(this.gl)?this.gl.renderbufferStorageMultisample(36161,h,o,u,l):this.gl.renderbufferStorage(36161,o,u,l),this.format=o,this.width=u,this.height=l,this.samples=h,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*gc[this.format].bpp),this}},{key:"resize",value:function(i){var o=i.width,s=i.height;return o!==this.width||s!==this.height?this.initialize({width:o,height:s,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(i){this.gl.bindRenderbuffer(36161,i)}},{key:"_syncHandle",value:function(i){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(i){this.gl.bindRenderbuffer(36161,this.handle);var o=this.gl.getRenderbufferParameter(36161,i);return o}}],[{key:"isSupported",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{format:null},s=o.format;return!s||HI(i,s,gc)}},{key:"getSamplesForFormat",value:function(i,o){var s=o.format;return i.getInternalformatParameter(36161,s,32937)}}]),n}(It,Symbol.toStringTag);var ib=m(ge());var zI=256,WI=1024,JI=16384,rb=6144,tb=6145,nb=6146,ab=34041,ob="clear: bad arguments";function sb(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t.framebuffer,n=e===void 0?null:e,a=t.color,i=a===void 0?null:a,o=t.depth,s=o===void 0?null:o,u=t.stencil,f=u===void 0?null:u,l={};n&&(l.framebuffer=n);var c=0;i&&(c|=JI,i!==!0&&(l.clearColor=i)),s&&(c|=zI,s!==!0&&(l.clearDepth=s)),f&&(c|=WI,s!==!0&&(l.clearStencil=s)),Y(c!==0,ob),at(r,l,function(){r.clear(c)})}function ub(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t.framebuffer,n=e===void 0?null:e,a=t.buffer,i=a===void 0?rb:a,o=t.drawBuffer,s=o===void 0?0:o,u=t.value,f=u===void 0?[0,0,0,0]:u;Ye(r),at(r,{framebuffer:n},function(){switch(i){case rb:switch(f.constructor){case Int32Array:r.clearBufferiv(i,s,f);break;case Uint32Array:r.clearBufferuiv(i,s,f);break;case Float32Array:default:r.clearBufferfv(i,s,f)}break;case tb:r.clearBufferfv(tb,0,[f]);break;case nb:r.clearBufferiv(nb,0,[f]);break;case ab:var l=(0,ib.default)(f,2),c=l[0],h=l[1];r.clearBufferfi(ab,0,c,h);break;default:Y(!1,ob)}})}function fb(r){switch(r){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 Y(!1),0}}function qI(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t.sourceX,n=e===void 0?0:e,a=t.sourceY,i=a===void 0?0:a,o=t.sourceFormat,s=o===void 0?6408:o,u=t.sourceAttachment,f=u===void 0?36064:u,l=t.target,c=l===void 0?null:l,h=t.sourceWidth,d=t.sourceHeight,p=t.sourceType,v=XI(r),y=v.framebuffer,A=v.deleteFramebuffer;Y(y);var _=y.gl,E=y.handle,x=y.attachments;h=h||y.width,d=d||y.height,f===36064&&E===null&&(f=1028),Y(x[f]),p=p||x[f].type,c=KI(c,p,s,h,d),p=p||oi(c);var C=_.bindFramebuffer(36160,E);return _.readPixels(n,i,h,d,s,p,c),_.bindFramebuffer(36160,C||null),A&&y.delete(),c}function Ac(r){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t.sourceAttachment,n=e===void 0?36064:e,a=t.targetMaxHeight,i=a===void 0?Number.MAX_SAFE_INTEGER:a,o=qI(r,{sourceAttachment:n}),s=r.width,u=r.height;u>i;){var f=TA({data:o,width:s,height:u});o=f.data,s=f.width,u=f.height}_A({data:o,width:s,height:u});var l=document.createElement("canvas");l.width=s,l.height=u;var c=l.getContext("2d"),h=c.createImageData(s,u);return h.data.set(o),c.putImageData(h,0,0),l.toDataURL()}function XI(r){return r instanceof Ft?{framebuffer:r,deleteFramebuffer:!1}:{framebuffer:lb(r),deleteFramebuffer:!0}}function KI(r,t,e,n,a){if(r)return r;t=t||5121;var i=Rt(t,{clamped:!1}),o=fb(e);return new i(n*a*o)}var we=m(W());var Se,xe={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 YI(r){var t=new hn(r,{format:6408,type:5126,dataFormat:6408}),e=new Ft(r,{id:"test-framebuffer",check:!1,attachments:(0,we.default)({},36064,t)}),n=e.getStatus();return t.delete(),e.delete(),n===36053}var bc=(Se={},(0,we.default)(Se,xe.WEBGL2,[!1,!0]),(0,we.default)(Se,xe.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),(0,we.default)(Se,xe.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),(0,we.default)(Se,xe.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),(0,we.default)(Se,xe.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),(0,we.default)(Se,xe.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),(0,we.default)(Se,xe.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),(0,we.default)(Se,xe.FLOAT_BLEND,["EXT_float_blend"]),(0,we.default)(Se,xe.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),(0,we.default)(Se,xe.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),(0,we.default)(Se,xe.TEXTURE_FLOAT,["OES_texture_float",!0]),(0,we.default)(Se,xe.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),(0,we.default)(Se,xe.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),(0,we.default)(Se,xe.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),(0,we.default)(Se,xe.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),(0,we.default)(Se,xe.COLOR_ATTACHMENT_RGBA32F,[YI,"EXT_color_buffer_float"]),(0,we.default)(Se,xe.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),(0,we.default)(Se,xe.COLOR_ATTACHMENT_HALF_FLOAT,["EXT_color_buffer_half_float"]),(0,we.default)(Se,xe.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),(0,we.default)(Se,xe.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),(0,we.default)(Se,xe.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),(0,we.default)(Se,xe.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),Se);function QI(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=$I(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
38
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function $I(r,t){if(r){if(typeof r=="string")return cb(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return cb(r,t)}}function cb(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var ZI=2;function ys(r,t){return _c(r,t)}function _c(r,t){return t=Array.isArray(t)?t:[t],t.every(function(e){return hb(r,e)})}function As(r){r.luma=r.luma||{},r.luma.caps=r.luma.caps||{};for(var t in bc)r.luma.caps[t]===void 0&&(r.luma.caps[t]=hb(r,t));return r.luma.caps}function hb(r,t){return r.luma=r.luma||{},r.luma.caps=r.luma.caps||{},r.luma.caps[t]===void 0&&(r.luma.caps[t]=e3(r,t)),r.luma.caps[t]||oe.log(ZI,"Feature: ".concat(t," not supported"))(),r.luma.caps[t]}function e3(r,t){var e=bc[t];Y(e,t);var n,a=ce(r)&&e[1]||e[0];if(typeof a=="function")n=a(r);else if(Array.isArray(a)){n=!0;var i=QI(a),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;n=n&&Boolean(r.getExtension(s))}}catch(u){i.e(u)}finally{i.f()}}else typeof a=="string"?n=Boolean(r.getExtension(a)):typeof a=="boolean"?n=a:Y(!1);return n}function db(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=r3(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
39
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function r3(r,t){if(r){if(typeof r=="string")return pb(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return pb(r,t)}}function pb(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function t3(r){var t=n3();return function(){var n=(0,bs.default)(r),a;if(t){var i=(0,bs.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,Tb.default)(this,a)}}function n3(){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}}var mb="Multiple render targets not supported",Ft=function(r,t){(0,_b.default)(n,r);var e=t3(n);function n(a){var i;(0,gb.default)(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=e.call(this,a,o),i.width=null,i.height=null,i.attachments={},i.readBuffer=36064,i.drawBuffers=[36064],i.ownResources=[],i.initialize(o),Object.seal((0,Ab.default)(i)),i}return(0,yb.default)(n,[{key:t,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var i=Ye(this.gl);return i.getParameter(i.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var i=Ye(this.gl);return i.getParameter(i.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}},{key:"initialize",value:function(i){var o=i.width,s=o===void 0?1:o,u=i.height,f=u===void 0?1:u,l=i.attachments,c=l===void 0?null:l,h=i.color,d=h===void 0?!0:h,p=i.depth,v=p===void 0?!0:p,y=i.stencil,A=y===void 0?!1:y,_=i.check,E=_===void 0?!0:_,x=i.readBuffer,C=x===void 0?void 0:x,P=i.drawBuffers,L=P===void 0?void 0:P;if(Y(s>=0&&f>=0,"Width and height need to be integers"),this.width=s,this.height=f,c)for(var M in c){var S=c[M],b=Array.isArray(S)?S[0]:S;b.resize({width:s,height:f})}else c=this._createDefaultAttachments(d,v,A,s,f);this.update({clearAttachments:!0,attachments:c,readBuffer:C,drawBuffers:L}),c&&E&&this.checkStatus()}},{key:"delete",value:function(){var i=db(this.ownResources),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.delete()}}catch(u){i.e(u)}finally{i.f()}return(0,bb.default)((0,bs.default)(n.prototype),"delete",this).call(this),this}},{key:"update",value:function(i){var o=i.attachments,s=o===void 0?{}:o,u=i.readBuffer,f=i.drawBuffers,l=i.clearAttachments,c=l===void 0?!1:l,h=i.resizeAttachments,d=h===void 0?!0:h;this.attach(s,{clearAttachments:c,resizeAttachments:d});var p=this.gl,v=p.bindFramebuffer(36160,this.handle);return u&&this._setReadBuffer(u),f&&this._setDrawBuffers(f),p.bindFramebuffer(36160,v||null),this}},{key:"resize",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=i.width,s=i.height;if(this.handle===null)return Y(o===void 0&&s===void 0),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;o===void 0&&(o=this.gl.drawingBufferWidth),s===void 0&&(s=this.gl.drawingBufferHeight),o!==this.width&&s!==this.height&&oe.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(o,"x").concat(s))();for(var u in this.attachments)this.attachments[u].resize({width:o,height:s});return this.width=o,this.height=s,this}},{key:"attach",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=s.clearAttachments,f=u===void 0?!1:u,l=s.resizeAttachments,c=l===void 0?!0:l,h={};f&&Object.keys(this.attachments).forEach(function(M){h[M]=null}),Object.assign(h,i);var d=this.gl.bindFramebuffer(36160,this.handle);for(var p in h){Y(p!==void 0,"Misspelled framebuffer binding point?");var v=Number(p),y=h[v],A=y;if(!A)this._unattach(v);else if(A instanceof ui)this._attachRenderbuffer({attachment:v,renderbuffer:A});else if(Array.isArray(y)){var _=(0,vb.default)(y,3),E=_[0],x=_[1],C=x===void 0?0:x,P=_[2],L=P===void 0?0:P;A=E,this._attachTexture({attachment:v,texture:E,layer:C,level:L})}else this._attachTexture({attachment:v,texture:A,layer:0,level:0});c&&A&&A.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,d||null),Object.assign(this.attachments,i),Object.keys(this.attachments).filter(function(M){return!o.attachments[M]}).forEach(function(M){delete o.attachments[M]})}},{key:"checkStatus",value:function(){var i=this.gl,o=this.getStatus();if(o!==36053)throw new Error(i3(o));return this}},{key:"getStatus",value:function(){var i=this.gl,o=i.bindFramebuffer(36160,this.handle),s=i.checkFramebufferStatus(36160);return i.bindFramebuffer(36160,o||null),s}},{key:"clear",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.color,u=o.depth,f=o.stencil,l=o.drawBuffers,c=l===void 0?[]:l,h=this.gl.bindFramebuffer(36160,this.handle);return(s||u||f)&&sb(this.gl,{color:s,depth:u,stencil:f}),c.forEach(function(d,p){ub(i.gl,{drawBuffer:p,value:d})}),this.gl.bindFramebuffer(36160,h||null),this}},{key:"readPixels",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return oe.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return oe.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return oe.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return oe.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return oe.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return oe.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(i){var o=i.attachments,s=o===void 0?[]:o,u=i.x,f=u===void 0?0:u,l=i.y,c=l===void 0?0:l,h=i.width,d=i.height,p=Ye(this.gl),v=p.bindFramebuffer(36008,this.handle),y=f===0&&c===0&&h===void 0&&d===void 0;return y?p.invalidateFramebuffer(36008,s):p.invalidateFramebuffer(36008,s,f,c,h,d),p.bindFramebuffer(36008,v),this}},{key:"getAttachmentParameter",value:function(i,o,s){var u=this._getAttachmentParameterFallback(o);return u===null&&(this.gl.bindFramebuffer(36160,this.handle),u=this.gl.getFramebufferAttachmentParameter(36160,i,o),this.gl.bindFramebuffer(36160,null)),s&&u>1e3&&(u=ln(this.gl,u)),u}},{key:"getAttachmentParameters",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:36064,o=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],u={},f=db(s),l;try{for(f.s();!(l=f.n()).done;){var c=l.value,h=o?ln(this.gl,c):c;u[h]=this.getAttachmentParameter(i,c,o)}}catch(d){f.e(d)}finally{f.f()}return u}},{key:"getParameters",value:function(){for(var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,o=Object.keys(this.attachments),s={},u=0,f=o;u<f.length;u++){var l=f[u],c=Number(l),h=i?ln(this.gl,c):c;s[h]=this.getAttachmentParameters(c,i)}return s}},{key:"show",value:function(){return typeof window<"u"&&window.open(Ac(this),"luma-debug-texture"),this}},{key:"log",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(i>oe.level||typeof window>"u")return this;o=o||"Framebuffer ".concat(this.id);var s=Ac(this,{targetMaxHeight:100});return oe.image({logLevel:i,message:o,image:s},o)(),this}},{key:"bind",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=i.target,s=o===void 0?36160:o;return this.gl.bindFramebuffer(s,this.handle),this}},{key:"unbind",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=i.target,s=o===void 0?36160:o;return this.gl.bindFramebuffer(s,null),this}},{key:"_createDefaultAttachments",value:function(i,o,s,u,f){var l=null;if(i){var c;l=l||{},l[36064]=new hn(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:u,height:f,mipmaps:!1,parameters:(c={},(0,fi.default)(c,10241,9729),(0,fi.default)(c,10240,9729),(0,fi.default)(c,10242,33071),(0,fi.default)(c,10243,33071),c)}),this.ownResources.push(l[36064])}return o&&s?(l=l||{},l[33306]=new ui(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:u,height:111}),this.ownResources.push(l[33306])):o?(l=l||{},l[36096]=new ui(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:u,height:f}),this.ownResources.push(l[36096])):s&&Y(!1),l}},{key:"_unattach",value:function(i){var o=this.attachments[i];o&&(o instanceof ui?this.gl.framebufferRenderbuffer(36160,i,36161,null):this.gl.framebufferTexture2D(36160,i,3553,null,0),delete this.attachments[i])}},{key:"_attachRenderbuffer",value:function(i){var o=i.attachment,s=o===void 0?36064:o,u=i.renderbuffer,f=this.gl;f.framebufferRenderbuffer(36160,s,36161,u.handle),this.attachments[s]=u}},{key:"_attachTexture",value:function(i){var o=i.attachment,s=o===void 0?36064:o,u=i.texture,f=i.layer,l=i.level,c=this.gl;switch(c.bindTexture(u.target,u.handle),u.target){case 35866:case 32879:var h=Ye(c);h.framebufferTextureLayer(36160,s,u.target,l,f);break;case 34067:var d=a3(f);c.framebufferTexture2D(36160,s,d,u.handle,l);break;case 3553:c.framebufferTexture2D(36160,s,3553,u.handle,l);break;default:Y(!1,"Illegal texture type")}c.bindTexture(u.target,null),this.attachments[s]=u}},{key:"_setReadBuffer",value:function(i){var o=rc(this.gl);o?o.readBuffer(i):Y(i===36064||i===1029,mb),this.readBuffer=i}},{key:"_setDrawBuffers",value:function(i){var o=this.gl,s=Ye(o);if(s)s.drawBuffers(i);else{var u=o.getExtension("WEBGL_draw_buffers");u?u.drawBuffersWEBGL(i):Y(i.length===1&&(i[0]===36064||i[0]===1029),mb)}this.drawBuffers=i}},{key:"_getAttachmentParameterFallback",value:function(i){var o=As(this.gl);switch(i){case 36052:return o.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return o.WEBGL2?null:8;case 33297:return o.WEBGL2?null:5125;case 33296:return!o.WEBGL2&&!o.EXT_sRGB?9729:null;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(i){return this.gl.bindFramebuffer(36160,i)}}],[{key:"isSupported",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.colorBufferFloat,u=o.colorBufferHalfFloat,f=!0;return s&&(f=Boolean(i.getExtension("EXT_color_buffer_float")||i.getExtension("WEBGL_color_buffer_float")||i.getExtension("OES_texture_float"))),u&&(f=f&&Boolean(i.getExtension("EXT_color_buffer_float")||i.getExtension("EXT_color_buffer_half_float"))),f}},{key:"getDefaultFramebuffer",value:function(i){return i.luma=i.luma||{},i.luma.defaultFramebuffer=i.luma.defaultFramebuffer||new n(i,{id:"default-framebuffer",handle:null,attachments:{}}),i.luma.defaultFramebuffer}}]),n}(It,Symbol.toStringTag);function a3(r){return r<34069?r+34069:r}function i3(r){var t=Ft.STATUS||{};return t[r]||"Framebuffer error ".concat(r)}var o3=[36049,36048,33296,33298,33299,33300,33301,33302,33303];Ft.ATTACHMENT_PARAMETERS=o3;function lb(r,t){var e=r.gl,n=r.width,a=r.height,i=r.id,o=new Ft(e,Object.assign({},t,{id:"framebuffer-for-".concat(i),width:n,height:a,attachments:(0,xb.default)({},36064,r)}));return o}var Eb="3.3.0-alpha.10";var Ib=m(K()),kc=m(J());var s3=globalThis._parseImageNode,Tc=typeof Image<"u",xc=typeof ImageBitmap<"u",u3=Boolean(s3),Ec=Pr?!0:u3;function Sb(r){switch(r){case"auto":return xc||Tc||Ec;case"imagebitmap":return xc;case"image":return Tc;case"data":return Ec;default:throw new Error("@loaders.gl/images: image ".concat(r," not supported in this environment"))}}function wb(){if(xc)return"imagebitmap";if(Tc)return"image";if(Ec)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}var Cb=m(Re());function f3(r){var t=l3(r);if(!t)throw new Error("Not an image");return t}function Bb(r){switch(f3(r)){case"data":return r;case"image":case"imagebitmap":var t=document.createElement("canvas"),e=t.getContext("2d");if(!e)throw new Error("getImageData");return t.width=r.width,t.height=r.height,e.drawImage(r,0,0),e.getImageData(0,0,r.width,r.height);default:throw new Error("getImageData")}}function l3(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&r instanceof Image?"image":r&&(0,Cb.default)(r)==="object"&&r.data&&r.width&&r.height?"data":null}var Bc=m(K()),li=m(J());var c3=/^data:image\/svg\+xml/,h3=/\.svg((\?|#).*)?$/;function _s(r){return r&&(c3.test(r)||h3.test(r))}function Mb(r,t){if(_s(t)){var e=new TextDecoder,n=e.decode(r);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}var a="data:image/svg+xml;base64,".concat(btoa(n));return a}return Sc(r,t)}function Sc(r,t){if(_s(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(r)])}function ci(r,t,e){return wc.apply(this,arguments)}function wc(){return wc=(0,Bc.default)(li.default.mark(function r(t,e,n){var a,i,o;return li.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=Mb(t,n),i=self.URL||self.webkitURL,o=typeof a!="string"&&i.createObjectURL(a),u.prev=3,u.next=6,d3(o||a,e);case 6:return u.abrupt("return",u.sent);case 7:return u.prev=7,o&&i.revokeObjectURL(o),u.finish(7);case 10:case"end":return u.stop()}},r,null,[[3,,7,10]])})),wc.apply(this,arguments)}function d3(r,t){return Cc.apply(this,arguments)}function Cc(){return Cc=(0,Bc.default)(li.default.mark(function r(t,e){var n;return li.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(n=new Image,n.src=t,!(e.image&&e.image.decode&&n.decode)){i.next=6;break}return i.next=5,n.decode();case 5:return i.abrupt("return",n);case 6:return i.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 i.abrupt("return",i.sent);case 9:case"end":return i.stop()}},r)})),Cc.apply(this,arguments)}var Pc=m(K()),hi=m(J());var p3={},Ob=!0;function Ic(r,t,e){return Mc.apply(this,arguments)}function Mc(){return Mc=(0,Pc.default)(hi.default.mark(function r(t,e,n){var a,i,o;return hi.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!_s(n)){u.next=7;break}return u.next=3,ci(t,e,n);case 3:i=u.sent,a=i,u.next=8;break;case 7:a=Sc(t,n);case 8:return o=e&&e.imagebitmap,u.next=11,m3(a,o);case 11:return u.abrupt("return",u.sent);case 12:case"end":return u.stop()}},r)})),Mc.apply(this,arguments)}function m3(r){return Oc.apply(this,arguments)}function Oc(){return Oc=(0,Pc.default)(hi.default.mark(function r(t){var e,n=arguments;return hi.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(e=n.length>1&&n[1]!==void 0?n[1]:null,(v3(e)||!Ob)&&(e=null),!e){i.next=13;break}return i.prev=3,i.next=6,createImageBitmap(t,e);case 6:return i.abrupt("return",i.sent);case 9:i.prev=9,i.t0=i.catch(3),console.warn(i.t0),Ob=!1;case 13:return i.next=15,createImageBitmap(t);case 15:return i.abrupt("return",i.sent);case 16:case"end":return i.stop()}},r,null,[[3,9]])})),Oc.apply(this,arguments)}function v3(r){for(var t in r||p3)return!1;return!0}var Pb=m(K()),Rc=m(J());var Yr=!1,di=!0;function pn(r){var t=pi(r);return g3(t)||b3(t)||y3(t)||A3(t)}function g3(r){var t=pi(r),e=t.byteLength>=24&&t.getUint32(0,Yr)===2303741511;return e?{mimeType:"image/png",width:t.getUint32(16,Yr),height:t.getUint32(20,Yr)}:null}function y3(r){var t=pi(r),e=t.byteLength>=10&&t.getUint32(0,Yr)===1195984440;return e?{mimeType:"image/gif",width:t.getUint16(6,di),height:t.getUint16(8,di)}:null}function A3(r){var t=pi(r),e=t.byteLength>=14&&t.getUint16(0,Yr)===16973&&t.getUint32(2,di)===t.byteLength;return e?{mimeType:"image/bmp",width:t.getUint32(18,di),height:t.getUint32(22,di)}:null}function b3(r){var t=pi(r),e=t.byteLength>=3&&t.getUint16(0,Yr)===65496&&t.getUint8(2)===255;if(!e)return null;for(var n=_3(),a=n.tableMarkers,i=n.sofMarkers,o=2;o+9<t.byteLength;){var s=t.getUint16(o,Yr);if(i.has(s))return{mimeType:"image/jpeg",height:t.getUint16(o+5,Yr),width:t.getUint16(o+7,Yr)};if(!a.has(s))return null;o+=2,o+=t.getUint16(o,Yr)}return null}function _3(){for(var r=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)r.add(t);var e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:r,sofMarkers:e}}function pi(r){if(r instanceof DataView)return r;if(ArrayBuffer.isView(r))return new DataView(r.buffer);if(r instanceof ArrayBuffer)return new DataView(r);throw new Error("toDataView")}function Lc(r,t){return Fc.apply(this,arguments)}function Fc(){return Fc=(0,Pb.default)(Rc.default.mark(function r(t,e){var n,a,i;return Rc.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=pn(t)||{},a=n.mimeType,i=globalThis._parseImageNode,$(i),s.next=5,i(t,a);case 5:return s.abrupt("return",s.sent);case 6:case"end":return s.stop()}},r)})),Fc.apply(this,arguments)}function Gc(r,t,e){return Dc.apply(this,arguments)}function Dc(){return Dc=(0,Ib.default)(kc.default.mark(function r(t,e,n){var a,i,o,s,u,f;return kc.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:e=e||{},a=e.image||{},i=a.type||"auto",o=n||{},s=o.url,u=T3(i),c.t0=u,c.next=c.t0==="imagebitmap"?8:c.t0==="image"?12:c.t0==="data"?16:20;break;case 8:return c.next=10,Ic(t,e,s);case 10:return f=c.sent,c.abrupt("break",21);case 12:return c.next=14,ci(t,e,s);case 14:return f=c.sent,c.abrupt("break",21);case 16:return c.next=18,Lc(t,e);case 18:return f=c.sent,c.abrupt("break",21);case 20:$(!1);case 21:return i==="data"&&(f=Bb(f)),c.abrupt("return",f);case 23:case"end":return c.stop()}},r)})),Dc.apply(this,arguments)}function T3(r){switch(r){case"auto":case"data":return wb();default:return Sb(r),r}}var x3=["png","jpg","jpeg","gif","webp","bmp","ico","svg"],E3=["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],S3={image:{type:"auto",decode:!0}},Uc={id:"image",module:"images",name:"Images",version:Eb,mimeTypes:E3,extensions:x3,parse:Gc,tests:[function(r){return Boolean(pn(new DataView(r)))}],options:S3};var w3=["image/png","image/jpeg","image/gif"],Nc={};function jc(r){return Nc[r]===void 0&&(Nc[r]=C3(r)),Nc[r]}function C3(r){switch(r){case"image/webp":return B3();case"image/svg":return Pr;default:if(!Pr){var t=globalThis._parseImageNode;return Boolean(t)&&w3.includes(r)}return!0}}function B3(){if(!Pr)return!1;try{var r=document.createElement("canvas");return r.toDataURL("image/webp").indexOf("data:image/webp")===0}catch{return!1}}var Ts=m(W()),Fb=m(V()),Lb=m(z());function Rb(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function Vc(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Rb(Object(e),!0).forEach(function(n){(0,Ts.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):Rb(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var Hc=function(){function r(t,e){(0,Fb.default)(this,r);var n=e.attributes,a=e.material,i=e.pbrDebug,o=e.imageBasedLightingEnvironment,s=e.lights,u=e.useTangents;this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},ys(t,xe.GLSL_TEXTURE_LOD)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],o&&(this.uniforms.u_DiffuseEnvSampler=o.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=o.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=o.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),i&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(n.NORMAL,"HAS_NORMALS"),this.defineIfPresent(n.TANGENT&&u,"HAS_TANGENTS"),this.defineIfPresent(n.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(o,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(i,"PBR_DEBUG"),a&&this.parseMaterial(a)}return(0,Lb.default)(r,[{key:"defineIfPresent",value:function(e,n){e&&(this.defines[n]=1)}},{key:"parseTexture",value:function(e,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},o=e.texture.source.image,s,u={};o.compressed?(s=o,u=(0,Ts.default)({},this.gl.TEXTURE_MIN_FILTER,o.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):s={data:o};var f=new hn(this.gl,Vc({id:e.name||e.id,parameters:Vc(Vc({},i),u),pixelStore:(0,Ts.default)({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},s));this.uniforms[n]=f,this.defineIfPresent(a,a),this.generatedTextures.push(f)}},{key:"parsePbrMetallicRoughness",value:function(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var n=e.metallicFactor,a=n===void 0?1:n,i=e.roughnessFactor,o=i===void 0?1:i;this.uniforms.u_MetallicRoughnessValues=[a,o]}},{key:"parseMaterial",value:function(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var n=e.normalTexture.scale,a=n===void 0?1:n;this.uniforms.u_NormalScale=a}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var i=e.occlusionTexture.strength,o=i===void 0?1:i;this.uniforms.u_OcclusionStrength=o}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),e.alphaMode==="MASK"){var s=e.alphaCutoff,u=s===void 0?.5:s;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=u}else e.alphaMode==="BLEND"&&(oe.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]}))}},{key:"delete",value:function(){this.generatedTextures.forEach(function(e){return e.delete()})}}]),r}();var Es=m(Zl()),Hb=m(rs());var kb=`#version 300 es
40
+ #define SHADER_NAME simple-mesh-layer-vs
41
+ uniform float sizeScale;
42
+ uniform bool composeModelMatrix;
43
+ uniform bool pickFeatureIds;
44
+ in vec3 positions;
45
+ in vec3 normals;
46
+ in vec3 colors;
47
+ in vec2 texCoords;
48
+ in vec4 uvRegions;
49
+ in vec3 featureIdsPickingColors;
50
+ in vec4 instanceColors;
51
+ in vec3 instancePickingColors;
52
+ in mat3 instanceModelMatrix;
53
+ out vec2 vTexCoord;
54
+ out vec3 cameraPosition;
55
+ out vec3 normals_commonspace;
56
+ out vec4 position_commonspace;
57
+ out vec4 vColor;
58
+
59
+ vec2 applyUVRegion(vec2 uv) {
60
+ #ifdef HAS_UV_REGIONS
61
+ return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;
62
+ #else
63
+ return uv;
64
+ #endif
65
+ }
66
+
67
+ void main(void) {
68
+ vec2 uv = applyUVRegion(texCoords);
69
+ geometry.uv = uv;
70
+
71
+ if (pickFeatureIds) {
72
+ geometry.pickingColor = featureIdsPickingColors;
73
+ } else {
74
+ geometry.pickingColor = instancePickingColors;
75
+ }
76
+
77
+ vTexCoord = uv;
78
+ cameraPosition = project_uCameraPosition;
79
+ vColor = vec4(colors * instanceColors.rgb, instanceColors.a);
80
+
81
+ vec3 pos = (instanceModelMatrix * positions) * sizeScale;
82
+ vec3 projectedPosition = project_position(positions);
83
+ position_commonspace = vec4(projectedPosition, 1.0);
84
+ gl_Position = project_common_position_to_clipspace(position_commonspace);
85
+
86
+ geometry.position = position_commonspace;
87
+ normals_commonspace = project_normal(instanceModelMatrix * normals);
88
+ geometry.normal = normals_commonspace;
89
+
90
+ DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
91
+
92
+ #ifdef MODULE_PBR
93
+ pbr_vPosition = geometry.position.xyz;
94
+ #ifdef HAS_NORMALS
95
+ pbr_vNormal = geometry.normal;
96
+ #endif
97
+
98
+ #ifdef HAS_UV
99
+ pbr_vUV = uv;
100
+ #else
101
+ pbr_vUV = vec2(0., 0.);
102
+ #endif
103
+ geometry.uv = pbr_vUV;
104
+ #endif
105
+
106
+ DECKGL_FILTER_COLOR(vColor, geometry);
107
+ }
108
+ `;var Db=`#version 300 es
109
+ #define SHADER_NAME simple-mesh-layer-fs
110
+
111
+ precision highp float;
112
+
113
+ uniform bool hasTexture;
114
+ uniform sampler2D sampler;
115
+ uniform bool flatShading;
116
+ uniform float opacity;
117
+
118
+ in vec2 vTexCoord;
119
+ in vec3 cameraPosition;
120
+ in vec3 normals_commonspace;
121
+ in vec4 position_commonspace;
122
+ in vec4 vColor;
123
+
124
+ out vec4 fragColor;
125
+
126
+ void main(void) {
127
+
128
+ #ifdef MODULE_PBR
129
+
130
+ fragColor = vColor * pbr_filterColor(vec4(0));
131
+ geometry.uv = pbr_vUV;
132
+ fragColor.a *= opacity;
133
+
134
+ #else
135
+
136
+ geometry.uv = vTexCoord;
137
+
138
+ vec3 normal;
139
+ if (flatShading) {
140
+ #ifdef DERIVATIVES_AVAILABLE
141
+ normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));
142
+ #else
143
+ normal = vec3(0.0, 0.0, 1.0);
144
+ #endif
145
+ } else {
146
+ normal = normals_commonspace;
147
+ }
148
+
149
+ vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;
150
+ vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
151
+ fragColor = vec4(lightColor, color.a * opacity);
152
+
153
+ #endif
154
+
155
+ DECKGL_FILTER_COLOR(fragColor, geometry);
156
+ }
157
+ `;function Gb(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function Lt(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Gb(Object(e),!0).forEach(function(n){(0,xs.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):Gb(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function M3(r){var t=O3();return function(){var n=(0,kt.default)(r),a;if(t){var i=(0,kt.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,Vb.default)(this,a)}}function O3(){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 P3(r){var t=r.COLOR_0||r.colors;t||(r.colors={constant:!0,value:new Float32Array([1,1,1])})}var I3={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}},Ss=function(r){(0,jb.default)(e,r);var t=M3(e);function e(){return(0,Ub.default)(this,e),t.apply(this,arguments)}return(0,Nb.default)(e,[{key:"getShaders",value:function(){var a=(0,sa.default)((0,kt.default)(e.prototype),"getShaders",this).call(this),i=a.modules;return i.push(Es.pbr),Lt(Lt({},a),{},{vs:kb,fs:Db})}},{key:"initializeState",value:function(){var a=this.props.featureIds;(0,sa.default)((0,kt.default)(e.prototype),"initializeState",this).call(this);var i=this.getAttributeManager();a&&i.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(a){(0,sa.default)((0,kt.default)(e.prototype),"updateState",this).call(this,a);var i=a.props,o=a.oldProps;i.pbrMaterial!==o.pbrMaterial&&this.updatePbrMaterialUniforms(i.pbrMaterial)}},{key:"draw",value:function(a){var i=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(i)}),(0,sa.default)((0,kt.default)(e.prototype),"draw",this).call(this,a))}},{key:"getModel",value:function(a){var i=this.props,o=i.id,s=i.pbrMaterial,u=this.parseMaterial(s,a);this.setState({materialParser:u});var f=this.getShaders();P3(a.attributes);var l=new Es.Model(this.context.gl,Lt(Lt({},this.getShaders()),{},{id:o,geometry:a,defines:Lt(Lt(Lt({},f.defines),u?.defines),{},{HAS_UV_REGIONS:a.attributes.uvRegions}),parameters:u?.parameters,isInstanced:!0}));return l}},{key:"updatePbrMaterialUniforms",value:function(a){var i=this.state.model;if(i){var o=this.props.mesh,s=this.parseMaterial(a,o);this.setState({materialParser:s}),i.setUniforms(s.uniforms)}}},{key:"parseMaterial",value:function(a,i){var o,s=Boolean(a.pbrMetallicRoughness&&a.pbrMetallicRoughness.baseColorTexture);return(o=this.state.materialParser)===null||o===void 0||o.delete(),new Hc(this.context.gl,{attributes:{NORMAL:i.attributes.normals,TEXCOORD_0:i.attributes.texCoords},material:Lt({unlit:s},a),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}},{key:"calculateFeatureIdsPickingColors",value:function(a){for(var i=this.props.featureIds,o=new Uint8ClampedArray(i.length*a.size),s=[],u=0;u<i.length;u++)this.encodePickingColor(i[u],s),o[u*3]=s[0],o[u*3+1]=s[1],o[u*3+2]=s[2];a.value=o}},{key:"finalizeState",value:function(a){var i;(0,sa.default)((0,kt.default)(e.prototype),"finalizeState",this).call(this,a),(i=this.state.materialParser)===null||i===void 0||i.delete(),this.setState({materialParser:null})}}]),e}(Hb.SimpleMeshLayer);(0,xs.default)(Ss,"layerName","MeshLayer");(0,xs.default)(Ss,"defaultProps",I3);var Yb=m(K()),$c=m(J());var vi=m(K()),it=m(J());var zc=m(Re()),R3=function(t){return typeof t=="boolean"},mi=function(t){return typeof t=="function"},ua=function(t){return t!==null&&(0,zc.default)(t)==="object"},Wc=function(t){return ua(t)&&t.constructor==={}.constructor};var zb=function(t){return t&&typeof t[Symbol.iterator]=="function"},Wb=function(t){return t&&typeof t[Symbol.asyncIterator]=="function"};var Rr=function(t){return typeof Response<"u"&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json};var Fr=function(t){return typeof Blob<"u"&&t instanceof Blob},Jb=function(t){return t&&(0,zc.default)(t)==="object"&&t.isBuffer};var F3=function(t){return typeof ReadableStream<"u"&&t instanceof ReadableStream||ua(t)&&mi(t.tee)&&mi(t.cancel)&&mi(t.getReader)};var L3=function(t){return ua(t)&&mi(t.read)&&mi(t.pipe)&&R3(t.readable)},ws=function(t){return F3(t)||L3(t)};var k3=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,D3=/^([-\w.]+\/[-\w.+]+)/;function qb(r){var t=D3.exec(r);return t?t[1]:r}function Jc(r){var t=k3.exec(r);return t?t[1]:""}var G3=/\?.*/;function mn(r){if(Rr(r)){var t=qc(r.url||""),e=r.headers.get("content-type")||"";return{url:t,type:qb(e)||Jc(t)}}return Fr(r)?{url:qc(r.name||""),type:r.type||""}:typeof r=="string"?{url:qc(r),type:Jc(r)}:{url:"",type:""}}function Xb(r){return Rr(r)?r.headers["content-length"]||-1:Fr(r)?r.size:typeof r=="string"?r.length:r instanceof ArrayBuffer||ArrayBuffer.isView(r)?r.byteLength:-1}function qc(r){return r.replace(G3,"")}function Cs(r){return Xc.apply(this,arguments)}function Xc(){return Xc=(0,vi.default)(it.default.mark(function r(t){var e,n,a,i,o,s,u;return it.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!Rr(t)){l.next=2;break}return l.abrupt("return",t);case 2:return e={},n=Xb(t),n>=0&&(e["content-length"]=String(n)),a=mn(t),i=a.url,o=a.type,o&&(e["content-type"]=o),l.next=9,N3(t);case 9:return s=l.sent,s&&(e["x-first-bytes"]=s),typeof t=="string"&&(t=new TextEncoder().encode(t)),u=new Response(t,{headers:e}),Object.defineProperty(u,"url",{value:i}),l.abrupt("return",u);case 15:case"end":return l.stop()}},r)})),Xc.apply(this,arguments)}function Kb(r){return Kc.apply(this,arguments)}function Kc(){return Kc=(0,vi.default)(it.default.mark(function r(t){var e;return it.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(t.ok){a.next=5;break}return a.next=3,U3(t);case 3:throw e=a.sent,new Error(e);case 5:case"end":return a.stop()}},r)})),Kc.apply(this,arguments)}function U3(r){return Yc.apply(this,arguments)}function Yc(){return Yc=(0,vi.default)(it.default.mark(function r(t){var e,n,a;return it.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(e="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): "),o.prev=1,n=t.headers.get("Content-Type"),a=t.statusText,!n.includes("application/json")){o.next=11;break}return o.t0=a,o.t1=" ",o.next=9,t.text();case 9:o.t2=o.sent,a=o.t0+=o.t1.concat.call(o.t1,o.t2);case 11:e+=a,e=e.length>60?"".concat(e.slice(0,60),"..."):e,o.next=17;break;case 15:o.prev=15,o.t3=o.catch(1);case 17:return o.abrupt("return",e);case 18:case"end":return o.stop()}},r,null,[[1,15]])})),Yc.apply(this,arguments)}function N3(r){return Qc.apply(this,arguments)}function Qc(){return Qc=(0,vi.default)(it.default.mark(function r(t){var e,n,a,i;return it.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(e=5,typeof t!="string"){s.next=3;break}return s.abrupt("return","data:,".concat(t.slice(0,e)));case 3:if(!(t instanceof Blob)){s.next=8;break}return n=t.slice(0,5),s.next=7,new Promise(function(u){var f=new FileReader;f.onload=function(l){var c;return u(l==null||(c=l.target)===null||c===void 0?void 0:c.result)},f.readAsDataURL(n)});case 7:return s.abrupt("return",s.sent);case 8:if(!(t instanceof ArrayBuffer)){s.next=12;break}return a=t.slice(0,e),i=j3(a),s.abrupt("return","data:base64,".concat(i));case 12:return s.abrupt("return",null);case 13:case"end":return s.stop()}},r)})),Qc.apply(this,arguments)}function j3(r){for(var t="",e=new Uint8Array(r),n=0;n<e.byteLength;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function eh(r,t){return Zc.apply(this,arguments)}function Zc(){return Zc=(0,Yb.default)($c.default.mark(function r(t,e){var n;return $c.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(typeof t!="string"){i.next=7;break}return t=ll(t),n=e,e!=null&&e.fetch&&typeof e?.fetch!="function"&&(n=e.fetch),i.next=6,fetch(t,n);case 6:return i.abrupt("return",i.sent);case 7:return i.next=9,Cs(t);case 9:return i.abrupt("return",i.sent);case 10:case"end":return i.stop()}},r)})),Zc.apply(this,arguments)}var a_=m(W());var rh=m(V()),th=m(z());var nh=new qr({id:"loaders.gl"}),Qb=function(){function r(){(0,rh.default)(this,r)}return(0,th.default)(r,[{key:"log",value:function(){return function(){}}},{key:"info",value:function(){return function(){}}},{key:"warn",value:function(){return function(){}}},{key:"error",value:function(){return function(){}}}]),r}(),$b=function(){function r(){(0,rh.default)(this,r),g(this,"console",void 0),this.console=console}return(0,th.default)(r,[{key:"log",value:function(){for(var e,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return(e=this.console.log).bind.apply(e,[this.console].concat(a))}},{key:"info",value:function(){for(var e,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return(e=this.console.info).bind.apply(e,[this.console].concat(a))}},{key:"warn",value:function(){for(var e,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return(e=this.console.warn).bind.apply(e,[this.console].concat(a))}},{key:"error",value:function(){for(var e,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return(e=this.console.error).bind.apply(e,[this.console].concat(a))}}]),r}();var ah={fetch:null,mimeType:void 0,nothrow:!1,log:new $b,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Pr,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Zb={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function i_(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=V3(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
158
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function V3(r,t){if(r){if(typeof r=="string")return e_(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return e_(r,t)}}function e_(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function r_(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function Bs(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?r_(Object(e),!0).forEach(function(n){(0,a_.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):r_(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function ih(){globalThis.loaders=globalThis.loaders||{};var r=globalThis.loaders;return r._state=r._state||{},r._state}var o_=function(){var t=ih();return t.globalOptions=t.globalOptions||Bs({},ah),t.globalOptions};function s_(r,t,e,n){return e=e||[],e=Array.isArray(e)?e:[e],H3(r,e),W3(t,r,n)}function Ms(r,t){var e=o_(),n=r||e;return typeof n.fetch=="function"?n.fetch:ua(n.fetch)?function(a){return eh(a,n)}:t!=null&&t.fetch?t?.fetch:eh}function H3(r,t){t_(r,null,ah,Zb,t);var e=i_(t),n;try{for(e.s();!(n=e.n()).done;){var a=n.value,i=r&&r[a.id]||{},o=a.options&&a.options[a.id]||{},s=a.deprecatedOptions&&a.deprecatedOptions[a.id]||{};t_(i,a.id,o,s,t)}}catch(u){e.e(u)}finally{e.f()}}function t_(r,t,e,n,a){var i=t||"Top level",o=t?"".concat(t,"."):"";for(var s in r){var u=!t&&ua(r[s]),f=s==="baseUri"&&!t,l=s==="workerUrl"&&t;if(!(s in e)&&!f&&!l){if(s in n)nh.warn("".concat(i," loader option '").concat(o).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!u){var c=z3(s,a);nh.warn("".concat(i," loader option '").concat(o).concat(s,"' not recognized. ").concat(c))()}}}}function z3(r,t){var e=r.toLowerCase(),n="",a=i_(t),i;try{for(a.s();!(i=a.n()).done;){var o=i.value;for(var s in o.options){if(r===s)return"Did you mean '".concat(o.id,".").concat(s,"'?");var u=s.toLowerCase(),f=e.startsWith(u)||u.startsWith(e);f&&(n=n||"Did you mean '".concat(o.id,".").concat(s,"'?"))}}}catch(l){a.e(l)}finally{a.f()}return n}function W3(r,t,e){var n=r.options||{},a=Bs({},n);return J3(a,e),a.log===null&&(a.log=new Qb),n_(a,o_()),n_(a,t),a}function n_(r,t){for(var e in t)if(e in t){var n=t[e];Wc(n)&&Wc(r[e])?r[e]=Bs(Bs({},r[e]),t[e]):r[e]=t[e]}}function J3(r,t){t&&!("baseUri"in r)&&(r.baseUri=t)}var f_=m(W());function u_(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function Os(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?u_(Object(e),!0).forEach(function(n){(0,f_.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):u_(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function gi(r){var t;if(!r)return!1;Array.isArray(r)&&(r=r[0]);var e=Array.isArray((t=r)===null||t===void 0?void 0:t.extensions);return e}function oh(r){var t,e;$(r,"null loader"),$(gi(r),"invalid loader");var n;return Array.isArray(r)&&(n=r[1],r=r[0],r=Os(Os({},r),{},{options:Os(Os({},r.options),n)})),((t=r)!==null&&t!==void 0&&t.parseTextSync||(e=r)!==null&&e!==void 0&&e.parseText)&&(r.text=!0),r.text||(r.binary=!0),r}var q3=function(){var t=ih();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function l_(){return q3()}var g_=m(W()),y_=m(Re()),A_=m(lr()),b_=m(K()),uh=m(J());var c_=new qr({id:"loaders.gl"});function h_(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function d_(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?h_(Object(e),!0).forEach(function(n){(0,g_.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):h_(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function yi(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=X3(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
159
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function X3(r,t){if(r){if(typeof r=="string")return p_(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return p_(r,t)}}function p_(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var K3=/\.([^.]+)$/;function __(r){return fh.apply(this,arguments)}function fh(){return fh=(0,b_.default)(uh.default.mark(function r(t){var e,n,a,i,o=arguments;return uh.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(e=o.length>1&&o[1]!==void 0?o[1]:[],n=o.length>2?o[2]:void 0,a=o.length>3?o[3]:void 0,T_(t)){u.next=5;break}return u.abrupt("return",null);case 5:if(i=m_(t,e,d_(d_({},n),{},{nothrow:!0}),a),!i){u.next=8;break}return u.abrupt("return",i);case 8:if(!Fr(t)){u.next=13;break}return u.next=11,t.slice(0,10).arrayBuffer();case 11:t=u.sent,i=m_(t,e,n,a);case 13:if(!(!i&&!(n!=null&&n.nothrow))){u.next=15;break}throw new Error(x_(t));case 15:return u.abrupt("return",i);case 16:case"end":return u.stop()}},r)})),fh.apply(this,arguments)}function m_(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!T_(r))return null;if(t&&!Array.isArray(t))return oh(t);var a=[];if(t&&(a=a.concat(t)),!(e!=null&&e.ignoreRegisteredLoaders)){var i;(i=a).push.apply(i,(0,A_.default)(l_()))}Q3(a);var o=Y3(r,a,e,n);if(!o&&!(e!=null&&e.nothrow))throw new Error(x_(r));return o}function Y3(r,t,e,n){var a=mn(r),i=a.url,o=a.type,s=i||n?.url,u=null,f="";if(e!=null&&e.mimeType&&(u=sh(t,e?.mimeType),f="match forced by supplied MIME type ".concat(e?.mimeType)),u=u||$3(t,s),f=f||(u?"matched url ".concat(s):""),u=u||sh(t,o),f=f||(u?"matched MIME type ".concat(o):""),u=u||eR(t,r),f=f||(u?"matched initial data ".concat(E_(r)):""),u=u||sh(t,e?.fallbackMimeType),f=f||(u?"matched fallback MIME type ".concat(o):""),f){var l;c_.log(1,"selectLoader selected ".concat((l=u)===null||l===void 0?void 0:l.name,": ").concat(f,"."))}return u}function T_(r){return!(r instanceof Response&&r.status===204)}function x_(r){var t=mn(r),e=t.url,n=t.type,a="No valid loader found (";a+=e?"".concat(xt.filename(e),", "):"no url provided, ",a+="MIME type: ".concat(n?'"'.concat(n,'"'):"not provided",", ");var i=r?E_(r):"";return a+=i?' first bytes: "'.concat(i,'"'):"first bytes: not available",a+=")",a}function Q3(r){var t=yi(r),e;try{for(t.s();!(e=t.n()).done;){var n=e.value;oh(n)}}catch(a){t.e(a)}finally{t.f()}}function $3(r,t){var e=t&&K3.exec(t),n=e&&e[1];return n?Z3(r,n):null}function Z3(r,t){t=t.toLowerCase();var e=yi(r),n;try{for(e.s();!(n=e.n()).done;){var a=n.value,i=yi(a.extensions),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;if(s.toLowerCase()===t)return a}}catch(u){i.e(u)}finally{i.f()}}}catch(u){e.e(u)}finally{e.f()}return null}function sh(r,t){var e=yi(r),n;try{for(e.s();!(n=e.n()).done;){var a=n.value;if(a.mimeTypes&&a.mimeTypes.includes(t)||t==="application/x.".concat(a.id))return a}}catch(i){e.e(i)}finally{e.f()}return null}function eR(r,t){if(!t)return null;var e=yi(r),n;try{for(e.s();!(n=e.n()).done;){var a=n.value;if(typeof t=="string"){if(rR(t,a))return a}else if(ArrayBuffer.isView(t)){if(v_(t.buffer,t.byteOffset,a))return a}else if(t instanceof ArrayBuffer){var i=0;if(v_(t,i,a))return a}}}catch(o){e.e(o)}finally{e.f()}return null}function rR(r,t){if(t.testText)return t.testText(r);var e=Array.isArray(t.tests)?t.tests:[t.tests];return e.some(function(n){return r.startsWith(n)})}function v_(r,t,e){var n=Array.isArray(e.tests)?e.tests:[e.tests];return n.some(function(a){return tR(r,t,e,a)})}function tR(r,t,e,n){if(n instanceof ArrayBuffer)return rl(n,r,n.byteLength);switch((0,y_.default)(n)){case"function":return n(r,e);case"string":var a=lh(r,t,n.length);return n===a;default:return!1}}function E_(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5;if(typeof r=="string")return r.slice(0,t);if(ArrayBuffer.isView(r))return lh(r.buffer,r.byteOffset,t);if(r instanceof ArrayBuffer){var e=0;return lh(r,e,t)}return""}function lh(r,t,e){if(r.byteLength<t+e)return"";for(var n=new DataView(r),a="",i=0;i<e;i++)a+=String.fromCharCode(n.getUint8(t+i));return a}var D_=m(Re()),wh=m(K()),bi=m(J());var O_=m(K()),_h=m(J());var ch=m(J()),nR=ch.default.mark(hh),aR=256*1024;function hh(r,t){var e,n,a,i,o;return ch.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:e=t?.chunkSize||aR,n=0,a=new TextEncoder;case 3:if(!(n<r.length)){u.next=11;break}return i=Math.min(r.length-n,e),o=r.slice(n,n+i),n+=i,u.next=9,a.encode(o);case 9:u.next=3;break;case 11:case"end":return u.stop()}},nR)}var dh=m(J()),iR=dh.default.mark(ph),oR=256*1024;function ph(r){var t,e,n,a,i,o,s,u,f=arguments;return dh.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:t=f.length>1&&f[1]!==void 0?f[1]:{},e=t.chunkSize,n=e===void 0?oR:e,a=0;case 3:if(!(a<r.byteLength)){c.next=14;break}return i=Math.min(r.byteLength-a,n),o=new ArrayBuffer(i),s=new Uint8Array(r,a,i),u=new Uint8Array(o),u.set(s),a+=i,c.next=12,o;case 12:c.next=3;break;case 14:case"end":return c.stop()}},iR)}var S_=m(il()),w_=m(ol()),mh=m(J()),sR=1024*1024;function C_(r,t){return vh.apply(this,arguments)}function vh(){return vh=(0,w_.default)(mh.default.mark(function r(t,e){var n,a,i,o;return mh.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:n=e?.chunkSize||sR,a=0;case 2:if(!(a<t.size)){u.next=12;break}return i=a+n,u.next=6,(0,S_.default)(t.slice(a,i).arrayBuffer());case 6:return o=u.sent,a=i,u.next=10,o;case 10:u.next=2;break;case 12:case"end":return u.stop()}},r)})),vh.apply(this,arguments)}var B_=m(Vf()),Ps=m(il()),Ah=m(ol()),Ai=m(J());function bh(r,t){return Pr?uR(r,t):fR(r,t)}function uR(r,t){return gh.apply(this,arguments)}function gh(){return gh=(0,Ah.default)(Ai.default.mark(function r(t,e){var n,a,i,o,s,u;return Ai.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:n=t.getReader(),l.prev=1;case 2:return i=a||n.read(),e!=null&&e._streamReadAhead&&(a=n.read()),l.next=7,(0,Ps.default)(i);case 7:if(o=l.sent,s=o.done,u=o.value,!s){l.next=12;break}return l.abrupt("return");case 12:return l.next=14,Eo(u);case 14:l.next=2;break;case 16:l.next=21;break;case 18:l.prev=18,l.t0=l.catch(1),n.releaseLock();case 21:case"end":return l.stop()}},r,null,[[1,18]])})),gh.apply(this,arguments)}function fR(r,t){return yh.apply(this,arguments)}function yh(){return yh=(0,Ah.default)(Ai.default.mark(function r(t,e){var n,a,i,o,s,u;return Ai.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:n=!1,a=!1,l.prev=2,o=(0,B_.default)(t);case 4:return l.next=6,(0,Ps.default)(o.next());case 6:if(!(n=!(s=l.sent).done)){l.next=13;break}return u=s.value,l.next=10,Eo(u);case 10:n=!1,l.next=4;break;case 13:l.next=19;break;case 15:l.prev=15,l.t0=l.catch(2),a=!0,i=l.t0;case 19:if(l.prev=19,l.prev=20,!(n&&o.return!=null)){l.next=24;break}return l.next=24,(0,Ps.default)(o.return());case 24:if(l.prev=24,!a){l.next=27;break}throw i;case 27:return l.finish(24);case 28:return l.finish(19);case 29:case"end":return l.stop()}},r,null,[[2,15,19,29],[20,,24,28]])})),yh.apply(this,arguments)}function M_(r,t){if(typeof r=="string")return hh(r,t);if(r instanceof ArrayBuffer)return ph(r,t);if(Fr(r))return C_(r,t);if(ws(r))return bh(r,t);if(Rr(r)){var e=r;return bh(e.body,t)}throw new Error("makeIterator")}var P_="Cannot convert supplied data type";function lR(r,t,e){if(t.text&&typeof r=="string")return r;if(Jb(r)&&(r=r.buffer),r instanceof ArrayBuffer){var n=r;if(t.text&&!t.binary){var a=new TextDecoder("utf8");return a.decode(n)}return n}if(ArrayBuffer.isView(r)){if(t.text&&!t.binary){var i=new TextDecoder("utf8");return i.decode(r)}var o=r.buffer,s=r.byteLength||r.length;return(r.byteOffset!==0||s!==o.byteLength)&&(o=o.slice(r.byteOffset,r.byteOffset+s)),o}throw new Error(P_)}function I_(r,t,e){return Th.apply(this,arguments)}function Th(){return Th=(0,O_.default)(_h.default.mark(function r(t,e,n){var a,i;return _h.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(a=t instanceof ArrayBuffer||ArrayBuffer.isView(t),!(typeof t=="string"||a)){s.next=3;break}return s.abrupt("return",lR(t,e,n));case 3:if(!Fr(t)){s.next=7;break}return s.next=6,Cs(t);case 6:t=s.sent;case 7:if(!Rr(t)){s.next=21;break}return i=t,s.next=11,Kb(i);case 11:if(!e.binary){s.next=17;break}return s.next=14,i.arrayBuffer();case 14:s.t0=s.sent,s.next=20;break;case 17:return s.next=19,i.text();case 19:s.t0=s.sent;case 20:return s.abrupt("return",s.t0);case 21:if(ws(t)&&(t=M_(t,n)),!(zb(t)||Wb(t))){s.next=24;break}return s.abrupt("return",fl(t));case 24:throw new Error(P_);case 25:case"end":return s.stop()}},r)})),Th.apply(this,arguments)}var xh=m(lr()),F_=m(W());function R_(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function cR(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?R_(Object(e),!0).forEach(function(n){(0,F_.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):R_(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function L_(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(e)return e;var n=cR({fetch:Ms(t,r)},r);return Array.isArray(n.loaders)||(n.loaders=null),n}function k_(r,t){if(!t&&r&&!Array.isArray(r))return r;var e;if(r&&(e=Array.isArray(r)?r:[r]),t&&t.loaders){var n=Array.isArray(t.loaders)?t.loaders:[t.loaders];e=e?[].concat((0,xh.default)(e),(0,xh.default)(n)):n}return e&&e.length?e:null}function Is(r,t,e,n){return Eh.apply(this,arguments)}function Eh(){return Eh=(0,wh.default)(bi.default.mark(function r(t,e,n,a){var i,o,s,u,f;return bi.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return Xe(!a||(0,D_.default)(a)==="object"),e&&!Array.isArray(e)&&!gi(e)&&(a=void 0,n=e,e=void 0),c.next=4,t;case 4:return t=c.sent,n=n||{},i=mn(t),o=i.url,s=e,u=k_(s,a),c.next=11,__(t,u,n);case 11:if(f=c.sent,f){c.next=14;break}return c.abrupt("return",null);case 14:return n=s_(n,f,u,o),a=L_({url:o,parse:Is,loaders:u},n,a),c.next=18,hR(f,t,n,a);case 18:return c.abrupt("return",c.sent);case 19:case"end":return c.stop()}},r)})),Eh.apply(this,arguments)}function hR(r,t,e,n){return Sh.apply(this,arguments)}function Sh(){return Sh=(0,wh.default)(bi.default.mark(function r(t,e,n,a){var i,o,s,u,f,l,c,h;return bi.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return Hf(t),Rr(e)&&(i=e,o=i.ok,s=i.redirected,u=i.status,f=i.statusText,l=i.type,c=i.url,h=Object.fromEntries(i.headers.entries()),a.response={headers:h,ok:o,redirected:s,status:u,statusText:f,type:l,url:c}),p.next=4,I_(e,t,n);case 4:if(e=p.sent,!(t.parseTextSync&&typeof e=="string")){p.next=8;break}return n.dataType="text",p.abrupt("return",t.parseTextSync(e,n,a,t));case 8:if(!Qf(t,n)){p.next=12;break}return p.next=11,$f(t,e,n,a,Is);case 11:return p.abrupt("return",p.sent);case 12:if(!(t.parseText&&typeof e=="string")){p.next=16;break}return p.next=15,t.parseText(e,n,a,t);case 15:return p.abrupt("return",p.sent);case 16:if(!t.parse){p.next=20;break}return p.next=19,t.parse(e,n,a,t);case 19:return p.abrupt("return",p.sent);case 20:throw Xe(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"));case 22:case"end":return p.stop()}},r)})),Sh.apply(this,arguments)}var G_=m(K()),Ch=m(J());function Lr(r,t,e,n){return Bh.apply(this,arguments)}function Bh(){return Bh=(0,G_.default)(Ch.default.mark(function r(t,e,n,a){var i,o;return Ch.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!Array.isArray(e)&&!gi(e)&&(a=void 0,n=e,e=void 0),i=Ms(n),o=t,typeof t!="string"){u.next=7;break}return u.next=6,i(t);case 6:o=u.sent;case 7:if(!Fr(t)){u.next=11;break}return u.next=10,i(t);case 10:o=u.sent;case 11:return u.next=13,Is(o,e,n);case 13:return u.abrupt("return",u.sent);case 14:case"end":return u.stop()}},r)})),Bh.apply(this,arguments)}var td=m(ge()),Ws=m(K()),ux=m(W()),fx=m(V()),lx=m(z()),yn=m(J());function Mh(r){if(Array.isArray(r))return r}function Oh(r,t){var e=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(e!=null){var n=[],a=!0,i=!1,o,s;try{for(e=e.call(r);!(a=(o=e.next()).done)&&(n.push(o.value),!(t&&n.length===t));a=!0);}catch(u){i=!0,s=u}finally{try{!a&&e.return!=null&&e.return()}finally{if(i)throw s}}return n}}function Rs(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function Ph(r,t){if(r){if(typeof r=="string")return Rs(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Rs(r,t)}}function Ih(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
160
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rh(r,t){return Mh(r)||Oh(r,t)||Ph(r,t)||Ih()}function Fh(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function U_(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Lh(r,t,e){return t&&U_(r.prototype,t),e&&U_(r,e),r}function Sr(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var ot=6378137,st=6378137,ut=6356752314245179e-9,dR={radii:[ot,st,ut],radiiSquared:[ot*ot,st*st,ut*ut],oneOverRadii:[1/ot,1/st,1/ut],oneOverRadiiSquared:[1/(ot*ot),1/(st*st),1/(ut*ut)],maximumRadius:Math.max(ot,st,ut),centerToleranceSquared:.1};function Fs(r){return r}var iX=new w;function pR(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fs;return"longitude"in r?(t[0]=e(r.longitude),t[1]=e(r.latitude),t[2]=r.height):"x"in r?(t[0]=e(r.x),t[1]=e(r.y),t[2]=r.z):(t[0]=e(r[0]),t[1]=e(r[1]),t[2]=r[2]),t}function N_(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return pR(r,t,Ae._cartographicRadians?Fs:dl)}function mR(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fs;return"longitude"in t?(t.longitude=e(r[0]),t.latitude=e(r[1]),t.height=r[2]):"x"in t?(t.x=e(r[0]),t.y=e(r[1]),t.z=r[2]):(t[0]=e(r[0]),t[1]=e(r[1]),t[2]=r[2]),t}function j_(r,t){return mR(r,t,Ae._cartographicRadians?Fs:pl)}var fa=new w,vR=new w,gR=new w;function kh(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=t.oneOverRadii,a=t.oneOverRadiiSquared,i=t.centerToleranceSquared;fa.from(r);var o=fa.x,s=fa.y,u=fa.z,f=n.x,l=n.y,c=n.z,h=o*o*f*f,d=s*s*l*l,p=u*u*c*c,v=h+d+p,y=Math.sqrt(1/v);if(Number.isFinite(y)){var A=vR;if(A.copy(r).scale(y),v<i)return A.to(e);var _=a.x,E=a.y,x=a.z,C=gR;C.set(A.x*_*2,A.y*E*2,A.z*x*2);var P=(1-y)*fa.len()/(.5*C.len()),L=0,M,S,b,R;do{P-=L,M=1/(1+P*_),S=1/(1+P*E),b=1/(1+P*x);var F=M*M,N=S*S,k=b*b,B=F*M,O=N*S,I=k*b;R=h*F+d*N+p*k-1;var U=h*B*_+d*O*E+p*I*x,D=-2*U;L=R/D}while(Math.abs(R)>zr.EPSILON12);return fa.scale([M,S,b]).to(e)}}var V_=1e-14,yR=new w,H_={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"}},Dh={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},ft={east:new w,north:new w,up:new w,west:new w,south:new w,down:new w},AR=new w,bR=new w,_R=new w;function Ls(r,t,e,n,a,i){var o=H_[t]&&H_[t][e];ue(o&&(!n||n===o));var s,u,f,l=yR.copy(a),c=We(l.x,0,V_)&&We(l.y,0,V_);if(c){var h=Math.sign(l.z);s=AR.fromArray(Dh[t]),t!=="east"&&t!=="west"&&s.scale(h),u=bR.fromArray(Dh[e]),e!=="east"&&e!=="west"&&u.scale(h),f=_R.fromArray(Dh[n]),n!=="east"&&n!=="west"&&f.scale(h)}else{var d=ft.up,p=ft.east,v=ft.north;p.set(-l.y,l.x,0).normalize(),r.geodeticSurfaceNormal(l,d),v.copy(d).cross(p);var y=ft.down,A=ft.west,_=ft.south;y.copy(d).scale(-1),A.copy(p).scale(-1),_.copy(v).scale(-1),s=ft[t],u=ft[e],f=ft[n]}return i[0]=s.x,i[1]=s.y,i[2]=s.z,i[3]=0,i[4]=u.x,i[5]=u.y,i[6]=u.z,i[7]=0,i[8]=f.x,i[9]=f.y,i[10]=f.z,i[11]=0,i[12]=l.x,i[13]=l.y,i[14]=l.z,i[15]=1,i}var ks=new w,z_=new w,TR=new w,kr=new w,xR=new w,Ds=new w;var be=function(){function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Fh(this,r),Sr(this,"radii",void 0),Sr(this,"radiiSquared",void 0),Sr(this,"radiiToTheFourth",void 0),Sr(this,"oneOverRadii",void 0),Sr(this,"oneOverRadiiSquared",void 0),Sr(this,"minimumRadius",void 0),Sr(this,"maximumRadius",void 0),Sr(this,"centerToleranceSquared",zr.EPSILON1),Sr(this,"squaredXOverSquaredZ",void 0),ue(t>=0),ue(e>=0),ue(n>=0),this.radii=new w(t,e,n),this.radiiSquared=new w(t*t,e*e,n*n),this.radiiToTheFourth=new w(t*t*t*t,e*e*e*e,n*n*n*n),this.oneOverRadii=new w(t===0?0:1/t,e===0?0:1/e,n===0?0:1/n),this.oneOverRadiiSquared=new w(t===0?0:1/(t*t),e===0?0:1/(e*e),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,e,n),this.maximumRadius=Math.max(t,e,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return Lh(r,[{key:"equals",value:function(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],a=z_,i=TR,o=Rh(e,3),s=o[2];this.geodeticSurfaceNormalCartographic(e,a),i.copy(this.radiiSquared).scale(a);var u=Math.sqrt(a.dot(i));return i.scale(1/u),a.scale(s),i.add(a),i.to(n)}},{key:"cartesianToCartographic",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];Ds.from(e);var a=this.scaleToGeodeticSurface(Ds,kr);if(a){var i=this.geodeticSurfaceNormal(a,z_),o=xR;o.copy(Ds).subtract(a);var s=Math.atan2(i.y,i.x),u=Math.asin(i.z),f=Math.sign(Oa(o,Ds))*Ef(o);return j_([s,u,f],n)}}},{key:"eastNorthUpToFixedFrame",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Z;return Ls(this,"east","north","up",e,n)}},{key:"localFrameToFixedFrame",value:function(e,n,a,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new Z;return Ls(this,e,n,a,i,o)}},{key:"geocentricSurfaceNormal",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return ks.from(e).normalize().to(n)}},{key:"geodeticSurfaceNormalCartographic",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],a=N_(e),i=a[0],o=a[1],s=Math.cos(o);return ks.set(s*Math.cos(i),s*Math.sin(i),Math.sin(o)).normalize(),ks.to(n)}},{key:"geodeticSurfaceNormal",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return ks.from(e).scale(this.oneOverRadiiSquared).normalize().to(n)}},{key:"scaleToGeodeticSurface",value:function(e,n){return kh(e,this,n)}},{key:"scaleToGeocentricSurface",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];kr.from(e);var a=kr.x,i=kr.y,o=kr.z,s=this.oneOverRadiiSquared,u=1/Math.sqrt(a*a*s.x+i*i*s.y+o*o*s.z);return kr.multiplyScalar(u).to(n)}},{key:"transformPositionToScaledSpace",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return kr.from(e).scale(this.oneOverRadii).to(n)}},{key:"transformPositionFromScaledSpace",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return kr.from(e).scale(this.radii).to(n)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0,0];ue(We(this.radii.x,this.radii.y,zr.EPSILON15)),ue(this.radii.z>0),kr.from(e);var i=kr.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-n))return kr.set(0,0,i).to(a)}}]),r}();Sr(be,"WGS84",new be(ot,st,ut));var Y_=m(V()),Q_=m(z());var q_=m(V()),X_=m(z());var W_=m(V());var J_=function r(t,e,n){(0,W_.default)(this,r),g(this,"item",void 0),g(this,"previous",void 0),g(this,"next",void 0),this.item=t,this.previous=e,this.next=n};var K_=function(){function r(){(0,q_.default)(this,r),g(this,"head",null),g(this,"tail",null),g(this,"_length",0)}return(0,X_.default)(r,[{key:"length",get:function(){return this._length}},{key:"add",value:function(e){var n=new J_(e,this.tail,null);return this.tail?(this.tail.next=n,this.tail=n):(this.head=n,this.tail=n),++this._length,n}},{key:"remove",value:function(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}},{key:"splice",value:function(e,n){e!==n&&(this.remove(n),this._insert(e,n))}},{key:"_insert",value:function(e,n){var a=e.next;e.next=n,this.tail===e?this.tail=n:a.previous=n,n.next=a,n.previous=e,++this._length}}]),r}();function Gh(r){return r!=null}var $_=function(){function r(){(0,Y_.default)(this,r),g(this,"_list",void 0),g(this,"_sentinel",void 0),g(this,"_trimTiles",void 0),this._list=new K_,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return(0,Q_.default)(r,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(e){var n=e._cacheNode;Gh(n)&&this._list.splice(this._sentinel,n)}},{key:"add",value:function(e,n,a){Gh(n._cacheNode)||(n._cacheNode=this._list.add(n),a&&a(e,n))}},{key:"unloadTile",value:function(e,n,a){var i=n._cacheNode;Gh(i)&&(this._list.remove(i),n._cacheNode=void 0,a&&a(e,n))}},{key:"unloadTiles",value:function(e,n){var a=this._trimTiles;this._trimTiles=!1;for(var i=this._list,o=e.maximumMemoryUsage*1024*1024,s=this._sentinel,u=i.head;u!==s&&(e.gpuMemoryUsageInBytes>o||a);){var f=u.item;u=u.next,this.unloadTile(e,f,n)}}},{key:"trim",value:function(){this._trimTiles=!0}}]),r}();function Z_(r,t){$(r),$(t);var e=t.rtcCenter,n=t.gltfUpAxis,a=r.computedTransform,i=r.boundingVolume.center,o=new Z(a);switch(e&&o.translate(e),n){case"Z":break;case"Y":var s=new Z().rotateX(Math.PI/2);o=o.multiplyRight(s);break;case"X":var u=new Z().rotateY(-Math.PI/2);o=o.multiplyRight(u);break;default:break}t.isQuantized&&o.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);var f=new w(i);t.cartesianModelMatrix=o,t.cartesianOrigin=f;var l=be.WGS84.cartesianToCartographic(f,new w),c=be.WGS84.eastNorthUpToFixedFrame(f),h=c.invert();t.cartographicModelMatrix=h.multiplyRight(o),t.cartographicOrigin=l,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}var Nh=m(ge());function ER(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=SR(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
161
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function SR(r,t){if(r){if(typeof r=="string")return eT(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return eT(r,t)}}function eT(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var rT=new w,Uh=new w,jh=new cr([new De,new De,new De,new De,new De,new De]);function nT(r,t){var e=r.cameraDirection,n=r.cameraUp,a=r.height,i=r.distanceScales.metersPerUnit,o=Gs(r,r.center),s=be.WGS84.eastNorthUpToFixedFrame(o),u=r.unprojectPosition(r.cameraPosition),f=be.WGS84.cartographicToCartesian(u,new w),l=new w(s.transformAsVector(new w(e).scale(i))).normalize(),c=new w(s.transformAsVector(new w(n).scale(i))).normalize();wR(r);var h=r.constructor,d=r.longitude,p=r.latitude,v=r.width,y=r.bearing,A=r.zoom,_=new h({longitude:d,latitude:p,height:a,width:v,bearing:y,zoom:A,pitch:0});return{camera:{position:f,direction:l,up:c},viewport:r,topDownViewport:_,height:a,cullingVolume:jh,frameNumber:t,sseDenominator:1.15}}function aT(r,t,e){if(e===0||r.length<=e)return[r,[]];var n=[],a=t.viewport,i=a.longitude,o=a.latitude,s=ER(r.entries()),u;try{for(s.s();!(u=s.n()).done;){var f=(0,Nh.default)(u.value,2),l=f[0],c=f[1],h=(0,Nh.default)(c.header.mbs,2),d=h[0],p=h[1],v=Math.abs(i-d),y=Math.abs(o-p),A=Math.sqrt(y*y+v*v);n.push([l,A])}}catch(L){s.e(L)}finally{s.f()}for(var _=n.sort(function(L,M){return L[1]-M[1]}),E=[],x=0;x<e;x++)E.push(r[_[x][0]]);for(var C=[],P=e;P<_.length;P++)C.push(r[_[P][0]]);return[E,C]}function wR(r){var t=r.getFrustumPlanes(),e=tT(t.near,r.cameraPosition),n=Gs(r,e),a=Gs(r,r.cameraPosition,Uh),i=0;jh.planes[i++].fromPointNormal(n,rT.copy(n).subtract(a));for(var o in t)if(o!=="near"){var s=t[o],u=tT(s,e,Uh),f=Gs(r,u,Uh);jh.planes[i++].fromPointNormal(f,rT.copy(n).subtract(f))}}function tT(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new w,n=r.normal.dot(t);return e.copy(r.normal).scale(r.distance-n).add(t),e}function Gs(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new w,n=r.unprojectPosition(t);return be.WGS84.cartographicToCartesian(n,e)}var oT=m(ge());var CR=6378137,BR=6378137,Vh=6356752314245179e-9,iT=new w;function sT(r,t){if(r instanceof tn){var e=r.halfAxes,n=MR(e);return Math.log2(Vh/(n+t[2]))}else if(r instanceof Ct){var a=r.radius;return Math.log2(Vh/(a+t[2]))}else if(r.width&&r.height){var i=r.width,o=r.height,s=Math.log2(CR/i),u=Math.log2(BR/o);return(s+u)/2}return 1}function Hh(r,t,e){var n=be.WGS84.cartographicToCartesian([r.xmax,r.ymax,r.zmax],new w),a=Math.sqrt(Math.pow(n[0]-e[0],2)+Math.pow(n[1]-e[1],2)+Math.pow(n[2]-e[2],2));return Math.log2(Vh/(a+t[2]))}function uT(r,t,e){var n=(0,oT.default)(r,4),a=n[0],i=n[1],o=n[2],s=n[3];return Hh({xmin:a,xmax:o,ymin:i,ymax:s,zmin:0,zmax:0},t,e)}function MR(r){r.getColumn(0,iT);var t=r.getColumn(1),e=r.getColumn(2),n=iT.add(t).add(e),a=n.len();return a}var Kh=m(W()),MT=m(K()),OT=m(V()),PT=m(z()),Xh=m(J());var ur={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},hr={ADD:1,REPLACE:2},lt={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},er={I3S:"I3S",TILES3D:"TILES3D"},vn={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},fT={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};var gn=m(lr()),cT=m(ge());function hT(r){return r!=null}var OR=new w,PR=new w,IR=new w;function Us(r,t,e){if($(r,"3D Tile: boundingVolume must be defined"),r.box)return RR(r.box,t,e);if(r.region){var n=(0,cT.default)(r.region,6),a=n[0],i=n[1],o=n[2],s=n[3],u=n[4],f=n[5],l=be.WGS84.cartographicToCartesian([en(a),en(s),u],PR),c=be.WGS84.cartographicToCartesian([en(o),en(i),f],IR),h=new w().addVectors(l,c).multiplyScalar(.5),d=new w().subVectors(l,c).len()/2;return lT([h[0],h[1],h[2],d],new Z)}if(r.sphere)return lT(r.sphere,t,e);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function RR(r,t,e){var n=new w(r[0],r[1],r[2]);t.transform(n,n);var a=[];if(r.length===10){var i=r.slice(3,6),o=new wt;o.fromArray(r,6);var s=new w([1,0,0]),u=new w([0,1,0]),f=new w([0,0,1]);s.transformByQuaternion(o),s.scale(i[0]),u.transformByQuaternion(o),u.scale(i[1]),f.transformByQuaternion(o),f.scale(i[2]),a=[].concat((0,gn.default)(s.toArray()),(0,gn.default)(u.toArray()),(0,gn.default)(f.toArray()))}else a=[].concat((0,gn.default)(r.slice(3,6)),(0,gn.default)(r.slice(6,9)),(0,gn.default)(r.slice(9,12)));var l=t.transformAsVector(a.slice(0,3)),c=t.transformAsVector(a.slice(3,6)),h=t.transformAsVector(a.slice(6,9)),d=new ve([l[0],l[1],l[2],c[0],c[1],c[2],h[0],h[1],h[2]]);return hT(e)?(e.center=n,e.halfAxes=d,e):new tn(n,d)}function lT(r,t,e){var n=new w(r[0],r[1],r[2]);t.transform(n,n);var a=t.getScale(OR),i=Math.max(Math.max(a[0],a[1]),a[2]),o=r[3]*i;return hT(e)?(e.center=n,e.radius=o,e):new Ct(n,o)}var $X=new w,ZX=new w,eK=new Z,rK=new w,tK=new w,nK=new w;function FR(r,t){var e=r*t;return 1-Math.exp(-(e*e))}function LR(r,t){if(r.dynamicScreenSpaceError&&r.dynamicScreenSpaceErrorComputedDensity){var e=r.dynamicScreenSpaceErrorComputedDensity,n=r.dynamicScreenSpaceErrorFactor,a=FR(t,e)*n;return a}return 0}function dT(r,t,e){var n=r.tileset,a=r.parent&&r.parent.lodMetricValue||r.lodMetricValue,i=e?a:r.lodMetricValue;if(i===0)return 0;var o=Math.max(r._distanceToCamera,1e-7),s=t.height,u=t.sseDenominator,f=n.options.viewDistanceScale,l=i*s*(f||1)/(o*u);return l-=LR(n,o),l}var gT=m(lr());var zh=new w,pT=new w,Dt=new w,mT=new w,kR=new w,Wh=new Z,vT=new Z;function yT(r,t){if(r.lodMetricValue===0||isNaN(r.lodMetricValue))return"DIG";var e=2*Jh(r,t);return e<2?"OUT":!r.header.children||e<=r.lodMetricValue?"DRAW":r.header.children?"DIG":"OUT"}function Jh(r,t){var e=t.topDownViewport,n=r.header.mbs[1],a=r.header.mbs[0],i=r.header.mbs[2],o=r.header.mbs[3],s=(0,gT.default)(r.boundingVolume.center),u=e.unprojectPosition(e.cameraPosition);be.WGS84.cartographicToCartesian(u,zh),pT.copy(zh).subtract(s).normalize(),be.WGS84.eastNorthUpToFixedFrame(s,Wh),vT.copy(Wh).invert(),Dt.copy(zh).transform(vT);var f=Math.sqrt(Dt[0]*Dt[0]+Dt[1]*Dt[1]),l=f*f/Dt[2];mT.copy([Dt[0],Dt[1],l]);var c=mT.transform(Wh),h=c.subtract(s).normalize(),d=pT.cross(h).normalize().scale(o),p=d.add(s),v=be.WGS84.cartesianToCartographic(p),y=e.project([a,n,i]),A=e.project(v),_=kR.copy(y).subtract(A).magnitude();return _}function AT(r){return{assetGltfUpAxis:r.asset&&r.asset.gltfUpAxis||"Y"}}var ET=m(W()),ST=m(V()),wT=m(z());var bT=m(V()),_T=m(z());var qh=function(){function r(){(0,bT.default)(this,r);var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;g(this,"_map",new Map),g(this,"_array",void 0),g(this,"_length",void 0),this._array=new Array(t),this._length=t}return(0,_T.default)(r,[{key:"length",get:function(){return this._length},set:function(e){this._length=e,e>this._array.length&&(this._array.length=e)}},{key:"values",get:function(){return this._array}},{key:"get",value:function(e){return $(e<this._array.length),this._array[e]}},{key:"set",value:function(e,n){$(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=n,this._map.set(n,e)}},{key:"delete",value:function(e){var n=this._map.get(e);n>=0&&(this._array.splice(n,1),this._map.delete(e),this.length--)}},{key:"peek",value:function(){return this._array[this._length-1]}},{key:"push",value:function(e){if(!this._map.has(e)){var n=this.length++;this._array[n]=e,this._map.set(e,n)}}},{key:"pop",value:function(){var e=this._array[--this.length];return this._map.delete(e),e}},{key:"reserve",value:function(e){$(e>=0),e>this._array.length&&(this._array.length=e)}},{key:"resize",value:function(e){$(e>=0),this.length=e}},{key:"trim",value:function(e){e==null&&(e=this.length),this._array.length=e}},{key:"reset",value:function(){this._array=[],this._map=new Map,this._length=0}},{key:"find",value:function(e){return this._map.has(e)}}]),r}();function Ns(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=DR(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
162
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function DR(r,t){if(r){if(typeof r=="string")return TT(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return TT(r,t)}}function TT(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function xT(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function js(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?xT(Object(e),!0).forEach(function(n){(0,ET.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):xT(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var GR={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},Gt=function(){function r(t){(0,ST.default)(this,r),g(this,"options",void 0),g(this,"root",void 0),g(this,"requestedTiles",void 0),g(this,"selectedTiles",void 0),g(this,"emptyTiles",void 0),g(this,"lastUpdate",new Date().getTime()),g(this,"updateDebounceTime",1e3),g(this,"_traversalStack",void 0),g(this,"_emptyTraversalStack",void 0),g(this,"_frameNumber",void 0),this.options=js(js({},GR),t),this._traversalStack=new qh,this._emptyTraversalStack=new qh,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}return(0,wT.default)(r,[{key:"traversalFinished",value:function(e){return!0}},{key:"traverse",value:function(e,n,a){this.root=e,this.options=js(js({},this.options),a),this.reset(),this.updateTile(e,n),this._frameNumber=n.frameNumber,this.executeTraversal(e,n)}},{key:"reset",value:function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}},{key:"executeTraversal",value:function(e,n){var a=this._traversalStack;for(e._selectionDepth=1,a.push(e);a.length>0;){var i=a.pop(),o=!1;this.canTraverse(i,n)&&(this.updateChildTiles(i,n),o=this.updateAndPushChildren(i,n,a,i.hasRenderContent?i._selectionDepth+1:i._selectionDepth));var s=i.parent,u=Boolean(!s||s._shouldRefine),f=!o;i.hasRenderContent?i.refine===hr.ADD?(this.loadTile(i,n),this.selectTile(i,n)):i.refine===hr.REPLACE&&(this.loadTile(i,n),f&&this.selectTile(i,n)):(this.emptyTiles[i.id]=i,this.loadTile(i,n),f&&this.selectTile(i,n)),this.touchTile(i,n),i._shouldRefine=o&&u}var l=new Date().getTime();(this.traversalFinished(n)||l-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=l,this.options.onTraversalEnd(n))}},{key:"updateChildTiles",value:function(e,n){var a=e.children,i=Ns(a),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;this.updateTile(s,n)}}catch(u){i.e(u)}finally{i.f()}return!0}},{key:"updateAndPushChildren",value:function(e,n,a,i){var o=this.options,s=o.loadSiblings,u=o.skipLevelOfDetail,f=e.children;f.sort(this.compareDistanceToCamera.bind(this));var l=e.refine===hr.REPLACE&&e.hasRenderContent&&!u,c=!1,h=!0,d=Ns(f),p;try{for(d.s();!(p=d.n()).done;){var v=p.value;if(v._selectionDepth=i,v.isVisibleAndInRequestVolume?(a.find(v)&&a.delete(v),a.push(v),c=!0):(l||s)&&(this.loadTile(v,n),this.touchTile(v,n)),l){var y=void 0;if(v._inRequestVolume?v.hasRenderContent?y=v.contentAvailable:y=this.executeEmptyTraversal(v,n):y=!1,h=h&&y,!h)return!1}}}catch(A){d.e(A)}finally{d.f()}return c||(h=!1),h}},{key:"updateTile",value:function(e,n){this.updateTileVisibility(e,n)}},{key:"selectTile",value:function(e,n){this.shouldSelectTile(e)&&(e._selectedFrame=n.frameNumber,this.selectedTiles[e.id]=e)}},{key:"loadTile",value:function(e,n){this.shouldLoadTile(e)&&(e._requestedFrame=n.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}},{key:"touchTile",value:function(e,n){e.tileset._cache.touch(e),e._touchedFrame=n.frameNumber}},{key:"canTraverse",value:function(e,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return e.hasChildren?e.hasTilesetContent?!e.contentExpired:!i&&!e.isVisibleAndInRequestVolume?!1:this.shouldRefine(e,n,a):!1}},{key:"shouldLoadTile",value:function(e){return e.hasUnloadedContent||e.contentExpired}},{key:"shouldSelectTile",value:function(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}},{key:"shouldRefine",value:function(e,n,a){var i=e._screenSpaceError;return a&&(i=e.getScreenSpaceError(n,!0)),i>this.options.maximumScreenSpaceError}},{key:"updateTileVisibility",value:function(e,n){var a=[];if(this.options.viewportTraversersMap)for(var i in this.options.viewportTraversersMap){var o=this.options.viewportTraversersMap[i];o===n.viewport.id&&a.push(i)}else a.push(n.viewport.id);e.updateVisibility(n,a)}},{key:"compareDistanceToCamera",value:function(e,n){return e._distanceToCamera-n._distanceToCamera}},{key:"anyChildrenVisible",value:function(e,n){var a=!1,i=Ns(e.children),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.updateVisibility(n),a=a||s.isVisibleAndInRequestVolume}}catch(u){i.e(u)}finally{i.f()}return a}},{key:"executeEmptyTraversal",value:function(e,n){var a=!0,i=this._emptyTraversalStack;for(i.push(e);i.length>0&&a;){var o=i.pop();this.updateTile(o,n),o.isVisibleAndInRequestVolume||this.loadTile(o,n),this.touchTile(o,n);var s=!o.hasRenderContent&&this.canTraverse(o,n,!1,!0);if(s){var u=o.children,f=Ns(u),l;try{for(f.s();!(l=f.n()).done;){var c=l.value;i.find(c)&&i.delete(c),i.push(c)}}catch(h){f.e(h)}finally{f.f()}}else o.contentAvailable||(a=!1)}return a}}]),r}();function CT(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function la(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?CT(Object(e),!0).forEach(function(n){(0,Kh.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):CT(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var BT=new w;function UR(r){return r!=null}var _i=function(){function r(t,e,n){(0,OT.default)(this,r);var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";g(this,"tileset",void 0),g(this,"header",void 0),g(this,"id",void 0),g(this,"url",void 0),g(this,"parent",void 0),g(this,"refine",void 0),g(this,"type",void 0),g(this,"contentUrl",void 0),g(this,"lodMetricType",void 0),g(this,"lodMetricValue",void 0),g(this,"boundingVolume",void 0),g(this,"content",void 0),g(this,"contentState",void 0),g(this,"gpuMemoryUsageInBytes",void 0),g(this,"children",void 0),g(this,"depth",void 0),g(this,"viewportIds",void 0),g(this,"transform",void 0),g(this,"extensions",void 0),g(this,"implicitTiling",void 0),g(this,"userData",void 0),g(this,"computedTransform",void 0),g(this,"hasEmptyContent",void 0),g(this,"hasTilesetContent",void 0),g(this,"traverser",void 0),g(this,"_cacheNode",void 0),g(this,"_frameNumber",void 0),g(this,"_lodJudge",void 0),g(this,"_expireDate",void 0),g(this,"_expiredContent",void 0),g(this,"_shouldRefine",void 0),g(this,"_distanceToCamera",void 0),g(this,"_centerZDepth",void 0),g(this,"_screenSpaceError",void 0),g(this,"_visibilityPlaneMask",void 0),g(this,"_visible",void 0),g(this,"_inRequestVolume",void 0),g(this,"_stackLength",void 0),g(this,"_selectionDepth",void 0),g(this,"_touchedFrame",void 0),g(this,"_visitedFrame",void 0),g(this,"_selectedFrame",void 0),g(this,"_requestedFrame",void 0),g(this,"_priority",void 0),g(this,"_contentBoundingVolume",void 0),g(this,"_viewerRequestVolume",void 0),g(this,"_initialTransform",void 0),this.header=e,this.tileset=t,this.id=a||e.id,this.url=e.url,this.parent=n,this.refine=this._getRefine(e.refine),this.type=e.type,this.contentUrl=e.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=ur.UNLOADED,this.gpuMemoryUsageInBytes=0,this.children=[],this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.depth=0,this.viewportIds=[],this.userData={},this.extensions=null,this._priority=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._screenSpaceError=0,this._cacheNode=null,this._frameNumber=null,this._cacheNode=null,this.traverser=new Gt({}),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._initialTransform=new Z,this.transform=new Z,this._initializeLodMetric(e),this._initializeTransforms(e),this._initializeBoundingVolumes(e),this._initializeContent(e),this._initializeRenderingState(e),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,this.implicitTiling=null,Object.seal(this)}return(0,PT.default)(r,[{key:"destroy",value:function(){this.header=null}},{key:"isDestroyed",value:function(){return this.header===null}},{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===ur.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===ur.UNLOADED}},{key:"contentExpired",get:function(){return this.contentState===ur.EXPIRED}},{key:"contentFailed",get:function(){return this.contentState===ur.FAILED}},{key:"distanceToCamera",get:function(){return this._distanceToCamera}},{key:"screenSpaceError",get:function(){return this._screenSpaceError}},{key:"getScreenSpaceError",value:function(e,n){switch(this.tileset.type){case er.I3S:return Jh(this,e);case er.TILES3D:return dT(this,e,n);default:throw new Error("Unsupported tileset type")}}},{key:"unselect",value:function(){this._selectedFrame=0}},{key:"_getPriority",value:function(){var e=this.tileset._traverser,n=e.options.skipLevelOfDetail,a=this.refine===hr.ADD||n;if(a&&!this.isVisible&&this._visible!==void 0||this.tileset._frameNumber-this._touchedFrame>=1||this.contentState===ur.UNLOADED)return-1;var i=this.parent,o=i&&(!a||this._screenSpaceError===0||i.hasTilesetContent),s=o?i._screenSpaceError:this._screenSpaceError,u=e.root?e.root._screenSpaceError:0;return Math.max(u-s,0)}},{key:"loadContent",value:function(){var t=(0,MT.default)(Xh.default.mark(function n(){var a,i,o,s,u;return Xh.default.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=ur.LOADING,l.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));case 9:if(i=l.sent,i){l.next=13;break}return this.contentState=ur.UNLOADED,l.abrupt("return",!1);case 13:return l.prev=13,o=this.tileset.getTileUrl(this.contentUrl),s=this.tileset.loader,u=la(la({},this.tileset.loadOptions),{},(0,Kh.default)({},s.id,la(la({},this.tileset.loadOptions[s.id]),{},{isTileset:this.type==="json"},this._getLoaderSpecificOptions(s.id)))),l.next=19,Lr(o,s,u);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=ur.READY,this._onContentLoaded(),l.abrupt("return",!0);case 29:throw l.prev=29,l.t0=l.catch(13),this.contentState=ur.FAILED,l.t0;case 33:return l.prev=33,i.done(),l.finish(33);case 36:case"end":return l.stop()}},n,this,[[13,29,33,36]])}));function e(){return t.apply(this,arguments)}return e}()},{key:"unloadContent",value: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=ur.UNLOADED,!0}},{key:"updateVisibility",value:function(e,n){if(this._frameNumber!==e.frameNumber){var a=this.parent,i=a?a._visibilityPlaneMask:cr.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){var o=a?a.computedTransform:this.tileset.modelMatrix;this._updateTransform(o)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,i),this._visible=this._visibilityPlaneMask!==cr.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=n}}},{key:"visibility",value:function(e,n){var a=e.cullingVolume,i=this.boundingVolume;return a.computeVisibilityWithPlaneMask(i,n)}},{key:"contentVisibility",value:function(){return!0}},{key:"distanceToTile",value:function(e){var n=this.boundingVolume;return Math.sqrt(Math.max(n.distanceSquaredTo(e.camera.position),0))}},{key:"cameraSpaceZDepth",value:function(e){var n=e.camera,a=this.boundingVolume;return BT.subVectors(a.center,n.position),n.direction.dot(BT)}},{key:"insideViewerRequestVolume",value:function(e){var n=this._viewerRequestVolume;return!n||n.distanceSquaredTo(e.camera.position)<=0}},{key:"updateExpiration",value:function(){if(UR(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){var e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=ur.EXPIRED,this._expiredContent=this.content)}}},{key:"extras",get:function(){return this.header.extras}},{key:"_initializeLodMetric",value:function(e){"lodMetricType"in e?this.lodMetricType=e.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 e?this.lodMetricValue=e.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}},{key:"_initializeTransforms",value:function(e){this.transform=e.transform?new Z(e.transform):new Z;var n=this.parent,a=this.tileset,i=n&&n.computedTransform?n.computedTransform.clone():a.modelMatrix.clone();this.computedTransform=new Z(i).multiplyRight(this.transform);var o=n&&n._initialTransform?n._initialTransform.clone():new Z;this._initialTransform=new Z(o).multiplyRight(this.transform)}},{key:"_initializeBoundingVolumes",value:function(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}},{key:"_initializeContent",value:function(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=ur.UNLOADED,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}},{key:"_initializeRenderingState",value:function(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=cr.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}},{key:"_getRefine",value:function(e){return e||this.parent&&this.parent.refine||hr.REPLACE}},{key:"_isTileset",value:function(){return this.contentUrl.indexOf(".json")!==-1}},{key:"_onContentLoaded",value:function(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0;break;default:}this._isTileset()&&(this.hasTilesetContent=!0)}},{key:"_updateBoundingVolume",value:function(e){this.boundingVolume=Us(e.boundingVolume,this.computedTransform,this.boundingVolume);var n=e.content;n&&(n.boundingVolume&&(this._contentBoundingVolume=Us(n.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=Us(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Z,n=e.clone().multiplyRight(this.transform),a=!n.equals(this.computedTransform);a&&(this.computedTransform=n,this._updateBoundingVolume(this.header))}},{key:"_getLoaderSpecificOptions",value:function(e){switch(e){case"i3s":return la(la({},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 AT(this.tileset.tileset)}}}]),r}();var IT=m(V()),RT=m(z()),FT=m($n()),LT=m(Ie()),kT=m(Fe()),Vs=m(Be());function NR(r){var t=jR();return function(){var n=(0,Vs.default)(r),a;if(t){var i=(0,Vs.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,kT.default)(this,a)}}function jR(){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}}var DT=function(r){(0,LT.default)(e,r);var t=NR(e);function e(){return(0,IT.default)(this,e),t.apply(this,arguments)}return(0,RT.default)(e,[{key:"compareDistanceToCamera",value:function(a,i){return i._distanceToCamera===0&&a._distanceToCamera===0?i._centerZDepth-a._centerZDepth:i._distanceToCamera-a._distanceToCamera}},{key:"updateTileVisibility",value:function(a,i){if((0,FT.default)((0,Vs.default)(e.prototype),"updateTileVisibility",this).call(this,a,i),!!a.isVisibleAndInRequestVolume){var o=a.children.length>0;if(a.hasTilesetContent&&o){var s=a.children[0];this.updateTileVisibility(s,i),a._visible=s._visible;return}if(this.meetsScreenSpaceErrorEarly(a,i)){a._visible=!1;return}var u=a.refine===hr.REPLACE,f=a._optimChildrenWithinParent===fT.USE_OPTIMIZATION;if(u&&f&&o&&!this.anyChildrenVisible(a,i)){a._visible=!1;return}}}},{key:"meetsScreenSpaceErrorEarly",value:function(a,i){var o=a.parent;return!o||o.hasTilesetContent||o.refine!==hr.ADD?!1:!this.shouldRefine(a,i,!0)}}]),e}(Gt);var JT=m(W()),qT=m(K()),XT=m(V()),KT=m(z()),YT=m(Br()),QT=m(Ie()),$T=m(Fe()),Qh=m(Be()),$h=m(J());var jT=m(V()),VT=m(z());var GT=m(V()),UT=m(z());var NT=function(){function r(){(0,GT.default)(this,r),g(this,"frameNumberMap",new Map)}return(0,UT.default)(r,[{key:"register",value:function(e,n){var a=this.frameNumberMap.get(e)||new Map,i=a.get(n)||0;a.set(n,i+1),this.frameNumberMap.set(e,a)}},{key:"deregister",value:function(e,n){var a=this.frameNumberMap.get(e);if(a){var i=a.get(n)||1;a.set(n,i-1)}}},{key:"isZero",value:function(e,n){var a,i=((a=this.frameNumberMap.get(e))===null||a===void 0?void 0:a.get(n))||0;return i===0}}]),r}();var Yh={REQUESTED:"REQUESTED",COMPLETED:"COMPLETED",ERROR:"ERROR"},HT=function(){function r(){(0,jT.default)(this,r),g(this,"_statusMap",void 0),g(this,"pendingTilesRegister",new NT),this._statusMap={}}return(0,VT.default)(r,[{key:"add",value:function(e,n,a,i){var o=this;if(!this._statusMap[n]){var s=i.frameNumber,u=i.viewport.id;this._statusMap[n]={request:e,callback:a,key:n,frameState:i,status:Yh.REQUESTED},this.pendingTilesRegister.register(u,s),e().then(function(f){o._statusMap[n].status=Yh.COMPLETED;var l=o._statusMap[n].frameState,c=l.frameNumber,h=l.viewport.id;o.pendingTilesRegister.deregister(h,c),o._statusMap[n].callback(f,i)}).catch(function(f){o._statusMap[n].status=Yh.ERROR;var l=o._statusMap[n].frameState,c=l.frameNumber,h=l.viewport.id;o.pendingTilesRegister.deregister(h,c),a(f)})}}},{key:"update",value:function(e,n){if(this._statusMap[e]){var a=this._statusMap[e].frameState,i=a.frameNumber,o=a.viewport.id;this.pendingTilesRegister.deregister(o,i);var s=n.frameNumber,u=n.viewport.id;this.pendingTilesRegister.register(u,s),this._statusMap[e].frameState=n}}},{key:"find",value:function(e){return this._statusMap[e]}},{key:"hasPendingTiles",value:function(e,n){return!this.pendingTilesRegister.isZero(e,n)}}]),r}();function zT(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function Hs(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?zT(Object(e),!0).forEach(function(n){(0,JT.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):zT(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function VR(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=HR(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
163
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function HR(r,t){if(r){if(typeof r=="string")return WT(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return WT(r,t)}}function WT(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function zR(r){var t=WR();return function(){var n=(0,Qh.default)(r),a;if(t){var i=(0,Qh.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,$T.default)(this,a)}}function WR(){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}}var ZT=function(r){(0,QT.default)(e,r);var t=zR(e);function e(n){var a;return(0,XT.default)(this,e),a=t.call(this,n),g((0,YT.default)(a),"_tileManager",void 0),a._tileManager=new HT,a}return(0,KT.default)(e,[{key:"traversalFinished",value:function(a){return!this._tileManager.hasPendingTiles(a.viewport.id,this._frameNumber||0)}},{key:"shouldRefine",value:function(a,i){return a._lodJudge=yT(a,i),a._lodJudge==="DIG"}},{key:"updateChildTiles",value:function(a,i){var o=this,s=a.header.children||[],u=a.children,f=a.tileset,l=VR(s),c;try{var h=function(){var p=c.value,v="".concat(p.id,"-").concat(i.viewport.id),y=u&&u.find(function(E){return E.id===v});if(y)y&&o.updateTile(y,i);else{var A=function(){return o._loadTile(p.id,f)},_=o._tileManager.find(v);_?o._tileManager.update(v,i):(f.tileset.nodePages&&(A=function(){return f.tileset.nodePagesTile.formTileFromNodePages(p.id)}),o._tileManager.add(A,v,function(E){return o._onTileLoad(E,a,v)},i))}};for(l.s();!(c=l.n()).done;)h()}catch(d){l.e(d)}finally{l.f()}return!1}},{key:"_loadTile",value:function(){var n=(0,qT.default)($h.default.mark(function i(o,s){var u,f,l;return $h.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return u=s.loader,f=s.getTileUrl("".concat(s.url,"/nodes/").concat(o)),l=Hs(Hs({},s.loadOptions),{},{i3s:Hs(Hs({},s.loadOptions.i3s),{},{isTileHeader:!0})}),h.next=5,Lr(f,u,l);case 5:return h.abrupt("return",h.sent);case 6:case"end":return h.stop()}},i)}));function a(i,o){return n.apply(this,arguments)}return a}()},{key:"_onTileLoad",value:function(a,i,o){var s=new _i(i.tileset,a,i,o);i.children.push(s);var u=this._tileManager.find(s.id).frameState;this.updateTile(s,u),this._frameNumber===u.frameNumber&&(this.traversalFinished(u)||new Date().getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(s,u)}}]),e}(Gt);function ct(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=JR(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
164
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function JR(r,t){if(r){if(typeof r=="string")return ex(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ex(r,t)}}function ex(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function rx(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function ca(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?rx(Object(e),!0).forEach(function(n){(0,ux.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):rx(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var qR={description:"",ellipsoid:be.WGS84,modelMatrix:new Z,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:{}},zs="Tiles In Tileset(s)",Zh="Tiles In Memory",tx="Tiles In View",nx="Tiles To Render",ax="Tiles Loaded",ed="Tiles Loading",ix="Tiles Unloaded",ox="Failed Tile Loads",sx="Points/Vertices",rd="Tile Memory Use",nd=function(){function r(t,e){(0,fx.default)(this,r),g(this,"options",void 0),g(this,"loadOptions",void 0),g(this,"type",void 0),g(this,"tileset",void 0),g(this,"loader",void 0),g(this,"url",void 0),g(this,"basePath",void 0),g(this,"modelMatrix",void 0),g(this,"ellipsoid",void 0),g(this,"lodMetricType",void 0),g(this,"lodMetricValue",void 0),g(this,"refine",void 0),g(this,"root",void 0),g(this,"roots",void 0),g(this,"asset",void 0),g(this,"description",void 0),g(this,"properties",void 0),g(this,"extras",void 0),g(this,"attributions",void 0),g(this,"credits",void 0),g(this,"stats",void 0),g(this,"contentFormats",{draco:!1,meshopt:!1,dds:!1,ktx2:!1}),g(this,"traverseCounter",void 0),g(this,"geometricError",void 0),g(this,"selectedTiles",void 0),g(this,"updatePromise",null),g(this,"tilesetInitializationPromise",void 0),g(this,"cartographicCenter",void 0),g(this,"cartesianCenter",void 0),g(this,"zoom",void 0),g(this,"boundingVolume",void 0),g(this,"gpuMemoryUsageInBytes",void 0),g(this,"dynamicScreenSpaceErrorComputedDensity",void 0),g(this,"_traverser",void 0),g(this,"_cache",void 0),g(this,"_requestScheduler",void 0),g(this,"_frameNumber",void 0),g(this,"_queryParamsString",void 0),g(this,"_queryParams",void 0),g(this,"_extensionsUsed",void 0),g(this,"_tiles",void 0),g(this,"_pendingCount",void 0),g(this,"lastUpdatedVieports",void 0),g(this,"_requestedTiles",void 0),g(this,"_emptyTiles",void 0),g(this,"frameStateData",void 0),g(this,"maximumMemoryUsage",void 0),$(t),this.options=ca(ca({},qR),e),this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||xt.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new $_,this._requestScheduler=new ja({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new $t({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this.tilesetInitializationPromise=this._initializeTileSet(t)}return(0,lx.default)(r,[{key:"destroy",value:function(){this._destroy()}},{key:"isLoaded",value:function(){return this._pendingCount===0&&this._frameNumber!==0&&this._requestedTiles.length===0}},{key:"tiles",get:function(){return Object.values(this._tiles)}},{key:"frameNumber",get:function(){return this._frameNumber}},{key:"queryParams",get:function(){return this._queryParamsString||(this._queryParamsString=XR(this._queryParams)),this._queryParamsString}},{key:"setProps",value:function(e){this.options=ca(ca({},this.options),e)}},{key:"setOptions",value:function(e){this.options=ca(ca({},this.options),e)}},{key:"getTileUrl",value:function(e){var n=e.startsWith("data:");return n?e:"".concat(e).concat(this.queryParams)}},{key:"hasExtension",value:function(e){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(e)>-1)}},{key:"update",value:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.tilesetInitializationPromise.then(function(){!n&&e.lastUpdatedVieports?n=e.lastUpdatedVieports:e.lastUpdatedVieports=n,n&&e.doUpdate(n)})}},{key:"selectTiles",value:function(){var t=(0,Ws.default)(yn.default.mark(function n(){var a=this,i,o=arguments;return yn.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return i=o.length>0&&o[0]!==void 0?o[0]:null,u.next=3,this.tilesetInitializationPromise;case 3:return i&&(this.lastUpdatedVieports=i),this.updatePromise||(this.updatePromise=new Promise(function(f){setTimeout(function(){a.lastUpdatedVieports&&a.doUpdate(a.lastUpdatedVieports),f(a._frameNumber),a.updatePromise=null},a.options.debounceTime)})),u.abrupt("return",this.updatePromise);case 6:case"end":return u.stop()}},n,this)}));function e(){return t.apply(this,arguments)}return e}()},{key:"doUpdate",value:function(e){if(!("loadTiles"in this.options&&!this.options.loadTiles)&&!(this.traverseCounter>0)){var n=e instanceof Array?e:[e];this._cache.reset(),this._frameNumber++,this.traverseCounter=n.length;var a=[],i=ct(n),o;try{for(i.s();!(o=i.n()).done;){var s=o.value,u=s.id;this._needTraverse(u)?a.push(u):this.traverseCounter--}}catch(p){i.e(p)}finally{i.f()}var f=ct(n),l;try{for(f.s();!(l=f.n()).done;){var c=l.value,h=c.id;if(this.roots[h]||(this.roots[h]=this._initializeTileHeaders(this.tileset,null)),!!a.includes(h)){var d=nT(c,this._frameNumber);this._traverser.traverse(this.roots[h],d,this.options)}}}catch(p){f.e(p)}finally{f.f()}}}},{key:"_needTraverse",value:function(e){var n=e;return this.options.viewportTraversersMap&&(n=this.options.viewportTraversersMap[e]),n===e}},{key:"_onTraversalEnd",value:function(e){var n=e.viewport.id;this.frameStateData[n]||(this.frameStateData[n]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});var a=this.frameStateData[n],i=Object.values(this._traverser.selectedTiles),o=aT(i,e,this.options.maximumTilesSelected),s=(0,td.default)(o,2),u=s[0],f=s[1];a.selectedTiles=u;var l=ct(f),c;try{for(l.s();!(c=l.n()).done;){var h=c.value;h.unselect()}}catch(d){l.e(d)}finally{l.f()}a._requestedTiles=Object.values(this._traverser.requestedTiles),a._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,!(this.traverseCounter>0)&&this._updateTiles()}},{key:"_updateTiles",value:function(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(var e in this.frameStateData){var n=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(n.selectedTiles),this._requestedTiles=this._requestedTiles.concat(n._requestedTiles),this._emptyTiles=this._emptyTiles.concat(n._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);var a=ct(this.selectedTiles),i;try{for(a.s();!(i=a.n()).done;){var o=i.value;this._tiles[o.id]=o}}catch(s){a.e(s)}finally{a.f()}this._loadTiles(),this._unloadTiles(),this._updateStats()}},{key:"_tilesChanged",value:function(e,n){if(e.length!==n.length)return!0;var a=new Set(e.map(function(s){return s.id})),i=new Set(n.map(function(s){return s.id})),o=e.filter(function(s){return!i.has(s.id)}).length>0;return o=o||n.filter(function(s){return!a.has(s.id)}).length>0,o}},{key:"_loadTiles",value:function(){var e=ct(this._requestedTiles),n;try{for(e.s();!(n=e.n()).done;){var a=n.value;a.contentUnloaded&&this._loadTile(a)}}catch(i){e.e(i)}finally{e.f()}}},{key:"_unloadTiles",value:function(){this._cache.unloadTiles(this,function(e,n){return e._unloadTile(n)})}},{key:"_updateStats",value:function(){var e=0,n=0,a=ct(this.selectedTiles),i;try{for(a.s();!(i=a.n()).done;){var o=i.value;o.contentAvailable&&o.content&&(e++,o.content.pointCount?n+=o.content.pointCount:n+=o.content.vertexCount)}}catch(s){a.e(s)}finally{a.f()}this.stats.get(tx).count=this.selectedTiles.length,this.stats.get(nx).count=e,this.stats.get(sx).count=n}},{key:"_initializeTileSet",value:function(){var t=(0,Ws.default)(yn.default.mark(function n(a){return yn.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(this.type!==er.I3S){o.next=5;break}return this.calculateViewPropsI3S(),o.next=4,a.root;case 4:a.root=o.sent;case 5:this.root=this._initializeTileHeaders(a,null),this.type===er.TILES3D&&(this._initializeTiles3DTileset(a),this.calculateViewPropsTiles3D()),this.type===er.I3S&&this._initializeI3STileset();case 8:case"end":return o.stop()}},n,this)}));function e(n){return t.apply(this,arguments)}return e}()},{key:"calculateViewPropsI3S",value:function(){var e,n=this.tileset.fullExtent;if(n){var a=n.xmin,i=n.xmax,o=n.ymin,s=n.ymax,u=n.zmin,f=n.zmax;this.cartographicCenter=new w(a+(i-a)/2,o+(s-o)/2,u+(f-u)/2),this.cartesianCenter=be.WGS84.cartographicToCartesian(this.cartographicCenter,new w),this.zoom=Hh(n,this.cartographicCenter,this.cartesianCenter);return}var l=(e=this.tileset.store)===null||e===void 0?void 0:e.extent;if(l){var c=(0,td.default)(l,4),h=c[0],d=c[1],p=c[2],v=c[3];this.cartographicCenter=new w(h+(p-h)/2,d+(v-d)/2,0),this.cartesianCenter=be.WGS84.cartographicToCartesian(this.cartographicCenter,new w),this.zoom=uT(l,this.cartographicCenter,this.cartesianCenter);return}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new w,this.zoom=1}},{key:"calculateViewPropsTiles3D",value:function(){var e=this.root;$(e);var n=e.boundingVolume.center;if(!n){console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new w,this.zoom=1;return}n[0]!==0||n[1]!==0||n[2]!==0?this.cartographicCenter=be.WGS84.cartesianToCartographic(n,new w):this.cartographicCenter=new w(0,0,-be.WGS84.radii[0]),this.cartesianCenter=n,this.zoom=sT(e.boundingVolume,this.cartographicCenter)}},{key:"_initializeStats",value:function(){this.stats.get(zs),this.stats.get(ed),this.stats.get(Zh),this.stats.get(tx),this.stats.get(nx),this.stats.get(ax),this.stats.get(ix),this.stats.get(ox),this.stats.get(sx),this.stats.get(rd,"memory")}},{key:"_initializeTileHeaders",value:function(e,n){var a=new _i(this,e.root,n);if(n&&(n.children.push(a),a.depth=n.depth+1),this.type===er.TILES3D){var i=[];for(i.push(a);i.length>0;){var o=i.pop();this.stats.get(zs).incrementCount();var s=o.header.children||[],u=ct(s),f;try{for(u.s();!(f=u.n()).done;){var l=f.value,c=new _i(this,l,o);o.children.push(c),c.depth=o.depth+1,i.push(c)}}catch(h){u.e(h)}finally{u.f()}}}return a}},{key:"_initializeTraverser",value:function(){var e,n=this.type;switch(n){case er.TILES3D:e=DT;break;case er.I3S:e=ZT;break;default:e=Gt}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(e){this._destroySubtree(e)}},{key:"_loadTile",value:function(){var t=(0,Ws.default)(yn.default.mark(function n(a){var i;return yn.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,this._onStartTileLoading(),s.next=4,a.loadContent();case 4:i=s.sent,s.next=10;break;case 7:s.prev=7,s.t0=s.catch(0),this._onTileLoadError(a,s.t0);case 10:return s.prev=10,this._onEndTileLoading(),this._onTileLoad(a,i),s.finish(10);case 14:case"end":return s.stop()}},n,this,[[0,7,10,14]])}));function e(n){return t.apply(this,arguments)}return e}()},{key:"_onTileLoadError",value:function(e,n){this.stats.get(ox).incrementCount();var a=n.message||n.toString(),i=e.url;console.error("A 3D tile failed to load: ".concat(e.url," ").concat(a)),this.options.onTileError(e,a,i)}},{key:"_onTileLoad",value:function(e,n){if(n){if(this.type===er.I3S){var a,i,o=((a=this.tileset)===null||a===void 0||(i=a.nodePagesTile)===null||i===void 0?void 0:i.nodesInNodePages)||0;this.stats.get(zs).reset(),this.stats.get(zs).addCount(o)}e&&e.content&&Z_(e,e.content),this.updateContentTypes(e),this._addTileToCache(e),this.options.onTileLoad(e)}}},{key:"updateContentTypes",value:function(e){if(this.type===er.I3S)switch(e.header.isDracoGeometry&&(this.contentFormats.draco=!0),e.header.textureFormat){case"dds":this.contentFormats.dds=!0;break;case"ktx2":this.contentFormats.ktx2=!0;break;default:}else if(this.type===er.TILES3D){var n,a=((n=e.content)===null||n===void 0?void 0:n.gltf)||{},i=a.extensionsRemoved,o=i===void 0?[]:i;o.includes("KHR_draco_mesh_compression")&&(this.contentFormats.draco=!0),o.includes("EXT_meshopt_compression")&&(this.contentFormats.meshopt=!0),o.includes("KHR_texture_basisu")&&(this.contentFormats.ktx2=!0)}}},{key:"_onStartTileLoading",value:function(){this._pendingCount++,this.stats.get(ed).incrementCount()}},{key:"_onEndTileLoading",value:function(){this._pendingCount--,this.stats.get(ed).decrementCount()}},{key:"_addTileToCache",value:function(e){this._cache.add(this,e,function(n){return n._updateCacheStats(e)})}},{key:"_updateCacheStats",value:function(e){this.stats.get(ax).incrementCount(),this.stats.get(Zh).incrementCount(),this.gpuMemoryUsageInBytes+=e.content.byteLength||0,this.stats.get(rd).count=this.gpuMemoryUsageInBytes}},{key:"_unloadTile",value:function(e){this.gpuMemoryUsageInBytes-=e.content&&e.content.byteLength||0,this.stats.get(Zh).decrementCount(),this.stats.get(ix).incrementCount(),this.stats.get(rd).count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}},{key:"_destroy",value:function(){var e=[];for(this.root&&e.push(this.root);e.length>0;){var n=e.pop(),a=ct(n.children),i;try{for(a.s();!(i=a.n()).done;){var o=i.value;e.push(o)}}catch(s){a.e(s)}finally{a.f()}this._destroyTile(n)}this.root=null}},{key:"_destroySubtree",value:function(e){var n=e,a=[];for(a.push(n);a.length>0;){e=a.pop();var i=ct(e.children),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;a.push(s)}}catch(u){i.e(u)}finally{i.f()}e!==n&&this._destroyTile(e)}n.children=[]}},{key:"_destroyTile",value:function(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}},{key:"_initializeTiles3DTileset",value:function(e){if(this.asset=e.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=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed,this.extras=e.extras}},{key:"_initializeI3STileset",value:function(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}]),r}();function XR(r){for(var t=[],e=0,n=Object.keys(r);e<n.length;e++){var a=n[e];t.push("".concat(a,"=").concat(r[a]))}switch(t.length){case 0:return"";case 1:return"?".concat(t[0]);default:return"?".concat(t.join("&"))}}var Eu=m(K()),Pn=m(J());var Js="3.3.0-alpha.10";var xw=m(K()),Xp=m(J());var An={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},sY=Object.keys(An);function ad(r,t,e){$(r instanceof ArrayBuffer);var n=new TextDecoder("utf8"),a=new Uint8Array(r,t,e),i=n.decode(a);return i}function cx(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=new DataView(r);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)))}var DE=m(W()),uu=m(K()),Tn=m(J());var vE=m(K()),gE=m(W()),gd=m(J());var dx=m(Re());var hx="3.3.0-alpha.10";var KR={draco:{decoderType:(typeof WebAssembly>"u"?"undefined":(0,dx.default)(WebAssembly))==="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},px={name:"Draco",id:tr?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:hx,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:KR};var hd=m(lr()),aE=m(ge()),iE=m(W()),oE=m(V()),sE=m(z());function bn(r){for(var t=1/0,e=1/0,n=1/0,a=-1/0,i=-1/0,o=-1/0,s=r.POSITION?r.POSITION.value:[],u=s&&s.length,f=0;f<u;f+=3){var l=s[f],c=s[f+1],h=s[f+2];t=l<t?l:t,e=c<e?c:e,n=h<n?h:n,a=l>a?l:a,i=c>i?c:i,o=h>o?h:o}return[[t,e,n],[a,i,o]]}var id=m(lr()),yx=m(V()),Ax=m(z());function mx(r,t){if(!r)throw new Error(t||"loader assertion failed.")}function od(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=YR(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
165
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function YR(r,t){if(r){if(typeof r=="string")return vx(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return vx(r,t)}}function vx(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var Ti=function(){function r(t,e){(0,yx.default)(this,r),g(this,"fields",void 0),g(this,"metadata",void 0),mx(Array.isArray(t)),QR(t),this.fields=t,this.metadata=e||new Map}return(0,Ax.default)(r,[{key:"compareTo",value:function(e){if(this.metadata!==e.metadata||this.fields.length!==e.fields.length)return!1;for(var n=0;n<this.fields.length;++n)if(!this.fields[n].compareTo(e.fields[n]))return!1;return!0}},{key:"select",value:function(){for(var e=Object.create(null),n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];for(var o=0,s=a;o<s.length;o++){var u=s[o];e[u]=!0}var f=this.fields.filter(function(l){return e[l.name]});return new r(f,this.metadata)}},{key:"selectAt",value:function(){for(var e=this,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var o=a.map(function(s){return e.fields[s]}).filter(Boolean);return new r(o,this.metadata)}},{key:"assign",value:function(e){var n,a=this.metadata;if(e instanceof r){var i=e;n=i.fields,a=gx(gx(new Map,this.metadata),i.metadata)}else n=e;var o=Object.create(null),s=od(this.fields),u;try{for(s.s();!(u=s.n()).done;){var f=u.value;o[f.name]=f}}catch(p){s.e(p)}finally{s.f()}var l=od(n),c;try{for(l.s();!(c=l.n()).done;){var h=c.value;o[h.name]=h}}catch(p){l.e(p)}finally{l.f()}var d=Object.values(o);return new r(d,a)}}]),r}();function QR(r){var t={},e=od(r),n;try{for(e.s();!(n=e.n()).done;){var a=n.value;t[a.name]&&console.warn("Schema: duplicated field name",a.name,a),t[a.name]=!0}}catch(i){e.e(i)}finally{e.f()}}function gx(r,t){return new Map([].concat((0,id.default)(r||new Map),(0,id.default)(t||new Map)))}var bx=m(V()),_x=m(z());var xi=function(){function r(t,e){(0,bx.default)(this,r);var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map;g(this,"name",void 0),g(this,"type",void 0),g(this,"nullable",void 0),g(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=n,this.metadata=a}return(0,_x.default)(r,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new r(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}]),r}();var Ar=m(Br()),le=m(Ie()),Tx=m(Fe()),sd=m(Be()),se=m(V()),dr=m(z());var fe;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth"})(fe||(fe={}));function he(r){var t=$R();return function(){var n=(0,sd.default)(r),a;if(t){var i=(0,sd.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,Tx.default)(this,a)}}function $R(){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}}var xx,Ex,Sx,wx,Cx,Bx,Mx,Ox,pr=function(){function r(){(0,se.default)(this,r)}return(0,dr.default)(r,[{key:"typeId",get:function(){return fe.NONE}},{key:"compareTo",value:function(e){return this===e}}],[{key:"isNull",value:function(e){return e&&e.typeId===fe.Null}},{key:"isInt",value:function(e){return e&&e.typeId===fe.Int}},{key:"isFloat",value:function(e){return e&&e.typeId===fe.Float}},{key:"isBinary",value:function(e){return e&&e.typeId===fe.Binary}},{key:"isUtf8",value:function(e){return e&&e.typeId===fe.Utf8}},{key:"isBool",value:function(e){return e&&e.typeId===fe.Bool}},{key:"isDecimal",value:function(e){return e&&e.typeId===fe.Decimal}},{key:"isDate",value:function(e){return e&&e.typeId===fe.Date}},{key:"isTime",value:function(e){return e&&e.typeId===fe.Time}},{key:"isTimestamp",value:function(e){return e&&e.typeId===fe.Timestamp}},{key:"isInterval",value:function(e){return e&&e.typeId===fe.Interval}},{key:"isList",value:function(e){return e&&e.typeId===fe.List}},{key:"isStruct",value:function(e){return e&&e.typeId===fe.Struct}},{key:"isUnion",value:function(e){return e&&e.typeId===fe.Union}},{key:"isFixedSizeBinary",value:function(e){return e&&e.typeId===fe.FixedSizeBinary}},{key:"isFixedSizeList",value:function(e){return e&&e.typeId===fe.FixedSizeList}},{key:"isMap",value:function(e){return e&&e.typeId===fe.Map}},{key:"isDictionary",value:function(e){return e&&e.typeId===fe.Dictionary}}]),r}(),Px=function(r,t){(0,le.default)(n,r);var e=he(n);function n(){return(0,se.default)(this,n),e.apply(this,arguments)}return(0,dr.default)(n,[{key:"typeId",get:function(){return fe.Null}},{key:t,get:function(){return"Null"}},{key:"toString",value:function(){return"Null"}}]),n}(pr,Symbol.toStringTag),Ix=function(r,t){(0,le.default)(n,r);var e=he(n);function n(){return(0,se.default)(this,n),e.apply(this,arguments)}return(0,dr.default)(n,[{key:"typeId",get:function(){return fe.Bool}},{key:t,get:function(){return"Bool"}},{key:"toString",value:function(){return"Bool"}}]),n}(pr,Symbol.toStringTag);xx=Symbol.toStringTag;var Qr=function(r,t){(0,le.default)(n,r);var e=he(n);function n(a,i){var o;return(0,se.default)(this,n),o=e.call(this),g((0,Ar.default)(o),"isSigned",void 0),g((0,Ar.default)(o),"bitWidth",void 0),o.isSigned=a,o.bitWidth=i,o}return(0,dr.default)(n,[{key:"typeId",get:function(){return fe.Int}},{key:t,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),n}(pr,xx),qs=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,!0,8)}return e}(Qr),Xs=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,!0,16)}return e}(Qr),Ks=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,!0,32)}return e}(Qr),Rx=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,!0,64)}return e}(Qr),Ys=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,!1,8)}return e}(Qr),Qs=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,!1,16)}return e}(Qr),$s=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,!1,32)}return e}(Qr),Fx=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,!1,64)}return e}(Qr),ud={HALF:16,SINGLE:32,DOUBLE:64};Ex=Symbol.toStringTag;var Ei=function(r,t){(0,le.default)(n,r);var e=he(n);function n(a){var i;return(0,se.default)(this,n),i=e.call(this),g((0,Ar.default)(i),"precision",void 0),i.precision=a,i}return(0,dr.default)(n,[{key:"typeId",get:function(){return fe.Float}},{key:t,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),n}(pr,Ex),Lx=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,ud.HALF)}return e}(Ei),Zs=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,ud.SINGLE)}return e}(Ei),eu=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,ud.DOUBLE)}return e}(Ei),kx=function(r,t){(0,le.default)(n,r);var e=he(n);function n(){return(0,se.default)(this,n),e.call(this)}return(0,dr.default)(n,[{key:"typeId",get:function(){return fe.Binary}},{key:"toString",value:function(){return"Binary"}},{key:t,get:function(){return"Binary"}}]),n}(pr,Symbol.toStringTag),Dx=function(r,t){(0,le.default)(n,r);var e=he(n);function n(){return(0,se.default)(this,n),e.apply(this,arguments)}return(0,dr.default)(n,[{key:"typeId",get:function(){return fe.Utf8}},{key:t,get:function(){return"Utf8"}},{key:"toString",value:function(){return"Utf8"}}]),n}(pr,Symbol.toStringTag),fd={DAY:0,MILLISECOND:1};Sx=Symbol.toStringTag;var ru=function(r,t){(0,le.default)(n,r);var e=he(n);function n(a){var i;return(0,se.default)(this,n),i=e.call(this),g((0,Ar.default)(i),"unit",void 0),i.unit=a,i}return(0,dr.default)(n,[{key:"typeId",get:function(){return fe.Date}},{key:t,get:function(){return"Date"}},{key:"toString",value:function(){return"Date".concat((this.unit+1)*32,"<").concat(fd[this.unit],">")}}]),n}(pr,Sx),Gx=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,fd.DAY)}return e}(ru),Ux=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,fd.MILLISECOND)}return e}(ru),Ut={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9};wx=Symbol.toStringTag;var tu=function(r,t){(0,le.default)(n,r);var e=he(n);function n(a,i){var o;return(0,se.default)(this,n),o=e.call(this),g((0,Ar.default)(o),"unit",void 0),g((0,Ar.default)(o),"bitWidth",void 0),o.unit=a,o.bitWidth=i,o}return(0,dr.default)(n,[{key:"typeId",get:function(){return fe.Time}},{key:"toString",value:function(){return"Time".concat(this.bitWidth,"<").concat(Ut[this.unit],">")}},{key:t,get:function(){return"Time"}}]),n}(pr,wx),Nx=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,Ut.SECOND,32)}return e}(tu),jx=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,Ut.MILLISECOND,32)}return e}(tu);Cx=Symbol.toStringTag;var ha=function(r,t){(0,le.default)(n,r);var e=he(n);function n(a){var i;(0,se.default)(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return i=e.call(this),g((0,Ar.default)(i),"unit",void 0),g((0,Ar.default)(i),"timezone",void 0),i.unit=a,i.timezone=o,i}return(0,dr.default)(n,[{key:"typeId",get:function(){return fe.Timestamp}},{key:t,get:function(){return"Timestamp"}},{key:"toString",value:function(){return"Timestamp<".concat(Ut[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}}]),n}(pr,Cx),Vx=function(r){(0,le.default)(e,r);var t=he(e);function e(){(0,se.default)(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return t.call(this,Ut.SECOND,n)}return e}(ha),Hx=function(r){(0,le.default)(e,r);var t=he(e);function e(){(0,se.default)(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return t.call(this,Ut.MILLISECOND,n)}return e}(ha),zx=function(r){(0,le.default)(e,r);var t=he(e);function e(){(0,se.default)(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return t.call(this,Ut.MICROSECOND,n)}return e}(ha),Wx=function(r){(0,le.default)(e,r);var t=he(e);function e(){(0,se.default)(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return t.call(this,Ut.NANOSECOND,n)}return e}(ha),ld={DAY_TIME:0,YEAR_MONTH:1};Bx=Symbol.toStringTag;var nu=function(r,t){(0,le.default)(n,r);var e=he(n);function n(a){var i;return(0,se.default)(this,n),i=e.call(this),g((0,Ar.default)(i),"unit",void 0),i.unit=a,i}return(0,dr.default)(n,[{key:"typeId",get:function(){return fe.Interval}},{key:t,get:function(){return"Interval"}},{key:"toString",value:function(){return"Interval<".concat(ld[this.unit],">")}}]),n}(pr,Bx),Jx=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,ld.DAY_TIME)}return e}(nu),qx=function(r){(0,le.default)(e,r);var t=he(e);function e(){return(0,se.default)(this,e),t.call(this,ld.YEAR_MONTH)}return e}(nu);Mx=Symbol.toStringTag;var au=function(r,t){(0,le.default)(n,r);var e=he(n);function n(a,i){var o;return(0,se.default)(this,n),o=e.call(this),g((0,Ar.default)(o),"listSize",void 0),g((0,Ar.default)(o),"children",void 0),o.listSize=a,o.children=[i],o}return(0,dr.default)(n,[{key:"typeId",get:function(){return fe.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:t,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}]),n}(pr,Mx);Ox=Symbol.toStringTag;var Xx=function(r,t){(0,le.default)(n,r);var e=he(n);function n(a){var i;return(0,se.default)(this,n),i=e.call(this),g((0,Ar.default)(i),"children",void 0),i.children=a,i}return(0,dr.default)(n,[{key:"typeId",get:function(){return fe.Struct}},{key:"toString",value:function(){return"Struct<{".concat(this.children.map(function(i){return"".concat(i.name,":").concat(i.type)}).join(", "),"}>")}},{key:t,get:function(){return"Struct"}}]),n}(pr,Ox);function Kx(r){switch(r.constructor){case Int8Array:return new qs;case Uint8Array:return new Ys;case Int16Array:return new Xs;case Uint16Array:return new Qs;case Int32Array:return new Ks;case Uint32Array:return new $s;case Float32Array:return new Zs;case Float64Array:return new eu;default:throw new Error("array type not supported")}}function cd(r,t,e){var n=Kx(t.value),a=e||Yx(t),i=new xi(r,new au(t.size,new xi("value",n)),!1,a);return i}function Yx(r){var t=new Map;return"byteOffset"in r&&t.set("byteOffset",r.byteOffset.toString(10)),"byteStride"in r&&t.set("byteStride",r.byteStride.toString(10)),"normalized"in r&&t.set("normalized",r.normalized.toString()),t}function $x(r,t,e){var n=Zx(t.metadata),a=[],i=ZR(t.attributes);for(var o in r){var s=r[o],u=Qx(o,s,i[o]);a.push(u)}if(e){var f=Qx("indices",e);a.push(f)}return new Ti(a,n)}function ZR(r){var t={};for(var e in r){var n=r[e];t[n.name||"undefined"]=n}return t}function Qx(r,t,e){var n=e?Zx(e.metadata):void 0,a=cd(r,t,n);return a}function Zx(r){var t=new Map;for(var e in r)t.set("".concat(e,".string"),JSON.stringify(r[e]));return t}function eF(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=rF(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
166
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function rF(r,t){if(r){if(typeof r=="string")return eE(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return eE(r,t)}}function eE(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function rE(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function tE(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?rE(Object(e),!0).forEach(function(n){(0,iE.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):rE(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var nE={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},tF={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},nF=4,uE=function(){function r(t){(0,oE.default)(this,r),g(this,"draco",void 0),g(this,"decoder",void 0),g(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return(0,sE.default)(r,[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=new this.draco.DecoderBuffer;a.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(n);var i=this.decoder.GetEncodedGeometryType(a),o=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var s;switch(i){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeBufferToMesh(a,o);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeBufferToPointCloud(a,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!o.ptr){var u="DRACO decompression failed: ".concat(s.error_msg());throw new Error(u)}var f=this._getDracoLoaderData(o,i,n),l=this._getMeshData(o,f,n),c=bn(l.attributes),h=$x(l.attributes,f,l.indices),d=tE(tE({loader:"draco",loaderData:f,header:{vertexCount:o.num_points(),boundingBox:c}},l),{},{schema:h});return d}finally{this.draco.destroy(a),o&&this.draco.destroy(o)}}},{key:"_getDracoLoaderData",value:function(e,n,a){var i=this._getTopLevelMetadata(e),o=this._getDracoAttributes(e,a);return{geometry_type:n,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:i,attributes:o}}},{key:"_getDracoAttributes",value:function(e,n){for(var a={},i=0;i<e.num_attributes();i++){var o=this.decoder.GetAttribute(e,i),s=this._getAttributeMetadata(e,i);a[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:i,metadata:s};var u=this._getQuantizationTransform(o,n);u&&(a[o.unique_id()].quantization_transform=u);var f=this._getOctahedronTransform(o,n);f&&(a[o.unique_id()].octahedron_transform=f)}return a}},{key:"_getMeshData",value:function(e,n,a){var i=this._getMeshAttributes(n,e,a),o=i.POSITION;if(!o)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(a.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:i,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:i,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:i}}},{key:"_getMeshAttributes",value:function(e,n,a){for(var i={},o=0,s=Object.values(e.attributes);o<s.length;o++){var u=s[o],f=this._deduceAttributeName(u,a);u.name=f;var l=this._getAttributeValues(n,u),c=l.value,h=l.size;i[f]={value:c,size:h,byteOffset:u.byte_offset,byteStride:u.byte_stride,normalized:u.normalized}}return i}},{key:"_getTriangleListIndices",value:function(e){var n=e.num_faces(),a=n*3,i=a*nF,o=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(e,i,o),new Uint32Array(this.draco.HEAPF32.buffer,o,a).slice()}finally{this.draco._free(o)}}},{key:"_getTriangleStripIndices",value:function(e){var n=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,n),oF(n)}finally{this.draco.destroy(n)}}},{key:"_getAttributeValues",value:function(e,n){var a=tF[n.data_type],i=n.num_components,o=e.num_points(),s=o*i,u=s*a.BYTES_PER_ELEMENT,f=aF(this.draco,a),l,c=this.draco._malloc(u);try{var h=this.decoder.GetAttribute(e,n.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,h,f,u,c),l=new a(this.draco.HEAPF32.buffer,c,s).slice()}finally{this.draco._free(c)}return{value:l,size:i}}},{key:"_deduceAttributeName",value:function(e,n){for(var a=e.unique_id,i=0,o=Object.entries(n.extraAttributes||{});i<o.length;i++){var s=(0,aE.default)(o[i],2),u=s[0],f=s[1];if(f===a)return u}var l=e.attribute_type;for(var c in nE){var h=this.draco[c];if(h===l)return nE[c]}var d=n.attributeNameEntry||"name";return e.metadata[d]?e.metadata[d].string:"CUSTOM_ATTRIBUTE_".concat(a)}},{key:"_getTopLevelMetadata",value:function(e){var n=this.decoder.GetMetadata(e);return this._getDracoMetadata(n)}},{key:"_getAttributeMetadata",value:function(e,n){var a=this.decoder.GetAttributeMetadata(e,n);return this._getDracoMetadata(a)}},{key:"_getDracoMetadata",value:function(e){if(!e||!e.ptr)return{};for(var n={},a=this.metadataQuerier.NumEntries(e),i=0;i<a;i++){var o=this.metadataQuerier.GetEntryName(e,i);n[o]=this._getDracoMetadataField(e,o)}return n}},{key:"_getDracoMetadataField",value:function(e,n){var a=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,n,a);var i=iF(a);return{int:this.metadataQuerier.GetIntEntry(e,n),string:this.metadataQuerier.GetStringEntry(e,n),double:this.metadataQuerier.GetDoubleEntry(e,n),intArray:i}}finally{this.draco.destroy(a)}}},{key:"_disableAttributeTransforms",value:function(e){var n=e.quantizedAttributes,a=n===void 0?[]:n,i=e.octahedronAttributes,o=i===void 0?[]:i,s=[].concat((0,hd.default)(a),(0,hd.default)(o)),u=eF(s),f;try{for(u.s();!(f=u.n()).done;){var l=f.value;this.decoder.SkipAttributeTransform(this.draco[l])}}catch(c){u.e(c)}finally{u.f()}}},{key:"_getQuantizationTransform",value:function(e,n){var a=this,i=n.quantizedAttributes,o=i===void 0?[]:i,s=e.attribute_type(),u=o.map(function(l){return a.decoder[l]}).includes(s);if(u){var f=new this.draco.AttributeQuantizationTransform;try{if(f.InitFromAttribute(e))return{quantization_bits:f.quantization_bits(),range:f.range(),min_values:new Float32Array([1,2,3]).map(function(l){return f.min_value(l)})}}finally{this.draco.destroy(f)}}return null}},{key:"_getOctahedronTransform",value:function(e,n){var a=this,i=n.octahedronAttributes,o=i===void 0?[]:i,s=e.attribute_type(),u=o.map(function(l){return a.decoder[l]}).includes(s);if(u){var f=new this.draco.AttributeQuantizationTransform;try{if(f.InitFromAttribute(e))return{quantization_bits:f.quantization_bits()}}finally{this.draco.destroy(f)}}return null}}]),r}();function aF(r,t){switch(t){case Float32Array:return r.DT_FLOAT32;case Int8Array:return r.DT_INT8;case Int16Array:return r.DT_INT16;case Int32Array:return r.DT_INT32;case Uint8Array:return r.DT_UINT8;case Uint16Array:return r.DT_UINT16;case Uint32Array:return r.DT_UINT32;default:return r.DT_INVALID}}function iF(r){for(var t=r.size(),e=new Int32Array(t),n=0;n<t;n++)e[n]=r.GetValue(n);return e}function oF(r){for(var t=r.size(),e=new Int32Array(t),n=0;n<t;n++)e[n]=r.GetValue(n);return e}var cE=m(ge()),hE=m(W()),md=m(K()),wi=m(J());function fE(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function lE(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?fE(Object(e),!0).forEach(function(n){(0,hE.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):fE(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var sF="1.5.5",uF="1.4.1",vd="https://www.gstatic.com/draco/versioned/decoders/".concat(sF),fF="".concat(vd,"/draco_decoder.js"),lF="".concat(vd,"/draco_wasm_wrapper.js"),cF="".concat(vd,"/draco_decoder.wasm"),KY="https://raw.githubusercontent.com/google/draco/".concat(uF,"/javascript/draco_encoder.js"),Si;function dE(r){return dd.apply(this,arguments)}function dd(){return dd=(0,md.default)(wi.default.mark(function r(t){var e;return wi.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e=t.modules||{},e.draco3d?Si=Si||e.draco3d.createDecoderModule({}).then(function(i){return{draco:i}}):Si=Si||hF(t),a.next=4,Si;case 4:return a.abrupt("return",a.sent);case 5:case"end":return a.stop()}},r)})),dd.apply(this,arguments)}function hF(r){return pd.apply(this,arguments)}function pd(){return pd=(0,md.default)(wi.default.mark(function r(t){var e,n,a,i;return wi.default.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,Hr(fF,"draco",t);case 5:return e=s.sent,s.abrupt("break",21);case 7:return s.t1=Promise,s.next=10,Hr(lF,"draco",t);case 10:return s.t2=s.sent,s.next=13,Hr(cF,"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:a=s.sent,i=(0,cE.default)(a,2),e=i[0],n=i[1];case 21:return e=e||globalThis.DracoDecoderModule,s.next=24,dF(e,n);case 24:return s.abrupt("return",s.sent);case 25:case"end":return s.stop()}},r)})),pd.apply(this,arguments)}function dF(r,t){var e={};return t&&(e.wasmBinary=t),new Promise(function(n){r(lE(lE({},e),{},{onModuleLoaded:function(i){return n({draco:i})}}))})}function pE(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function mE(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?pE(Object(e),!0).forEach(function(n){(0,gE.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):pE(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var iu=mE(mE({},px),{},{parse:pF});function pF(r,t){return yd.apply(this,arguments)}function yd(){return yd=(0,vE.default)(gd.default.mark(function r(t,e){var n,a,i;return gd.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,dE(e);case 2:return n=s.sent,a=n.draco,i=new uE(a),s.prev=5,s.abrupt("return",i.parseSync(t,e?.draco));case 7:return s.prev=7,i.destroy(),s.finish(7);case 10:case"end":return s.stop()}},r,null,[[5,,7,10]])})),yd.apply(this,arguments)}var yE=m(V()),AE=m(z()),ht=m(W());var $r,Ad=($r={},(0,ht.default)($r,5130,Float64Array),(0,ht.default)($r,5126,Float32Array),(0,ht.default)($r,5123,Uint16Array),(0,ht.default)($r,5125,Uint32Array),(0,ht.default)($r,5121,Uint8Array),(0,ht.default)($r,5120,Int8Array),(0,ht.default)($r,5122,Int16Array),(0,ht.default)($r,5124,Int32Array),$r),mF={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",Nt=function(){function r(){(0,yE.default)(this,r)}return(0,AE.default)(r,null,[{key:"fromTypedArray",value:function(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(var n in Ad){var a=Ad[n];if(a===e)return n}throw new Error(bd)}},{key:"fromName",value:function(e){var n=mF[e];if(!n)throw new Error(bd);return n}},{key:"getArrayType",value:function(e){switch(e){case 33635:case 32819:case 32820:return Uint16Array;default:var n=Ad[e];if(!n)throw new Error(bd);return n}}},{key:"getByteSize",value:function(e){var n=r.getArrayType(e);return n.BYTES_PER_ELEMENT}},{key:"validate",value:function(e){return Boolean(r.getArrayType(e))}},{key:"createTypedArray",value:function(e,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;i===void 0&&(i=(n.byteLength-a)/r.getByteSize(e));var o=r.getArrayType(e);return new o(n,a,i)}}]),r}();function bE(r,t){if(!r)throw new Error("math.gl assertion failed. ".concat(t))}function _d(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],e=r>>11&31,n=r>>5&63,a=r&31;return t[0]=e<<3,t[1]=n<<2,t[2]=a<<3,t}var oQ=1/256;var sQ=new rn,uQ=new w,fQ=new rn,lQ=new rn,cQ=new Uint8Array(1);function _E(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:255;return wo(r,0,t)/t*2-1}function TE(r){return r<0?-1:1}function xE(r,t,e,n){if(bE(n),r<0||r>e||t<0||t>e)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(e));if(n.x=_E(r,e),n.y=_E(t,e),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var a=n.x;n.x=(1-Math.abs(n.y))*TE(a),n.y=(1-Math.abs(a))*TE(n.y)}return n.normalize()}function Td(r,t,e){return xE(r,t,255,e)}var EE=m(V()),SE=m(z());var da=function(){function r(t,e){(0,EE.default)(this,r),g(this,"json",void 0),g(this,"buffer",void 0),g(this,"featuresLength",0),g(this,"_cachedTypedArrays",{}),this.json=t,this.buffer=e}return(0,SE.default)(r,[{key:"getExtension",value:function(e){return this.json.extensions&&this.json.extensions[e]}},{key:"hasProperty",value:function(e){return Boolean(this.json[e])}},{key:"getGlobalProperty",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5125,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=this.json[e];return i&&Number.isFinite(i.byteOffset)?this._getTypedArrayFromBinary(e,n,a,1,i.byteOffset):i}},{key:"getPropertyArray",value:function(e,n,a){var i=this.json[e];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(n=Nt.fromName(i.componentType)),this._getTypedArrayFromBinary(e,n,a,this.featuresLength,i.byteOffset)):this._getTypedArrayFromArray(e,n,i)}},{key:"getProperty",value:function(e,n,a,i,o){var s=this.json[e];if(!s)return s;var u=this.getPropertyArray(e,n,a);if(a===1)return u[i];for(var f=0;f<a;++f)o[f]=u[a*i+f];return o}},{key:"_getTypedArrayFromBinary",value:function(e,n,a,i,o){var s=this._cachedTypedArrays,u=s[e];return u||(u=Nt.createTypedArray(n,this.buffer.buffer,this.buffer.byteOffset+o,i*a),s[e]=u),u}},{key:"_getTypedArrayFromArray",value:function(e,n,a){var i=this._cachedTypedArrays,o=i[e];return o||(o=Nt.createTypedArray(n,a),i[e]=o),o}}]),r}();var ME=m(lr()),OE=m(V()),PE=m(z());var vF={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},gF={SCALAR:function(t,e){return t[e]},VEC2:function(t,e){return[t[2*e+0],t[2*e+1]]},VEC3:function(t,e){return[t[3*e+0],t[3*e+1],t[3*e+2]]},VEC4:function(t,e){return[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]]},MAT2:function(t,e){return[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]]},MAT3:function(t,e){return[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]]},MAT4:function(t,e){return[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]}},yF={SCALAR:function(t,e,n){e[n]=t},VEC2:function(t,e,n){e[2*n+0]=t[0],e[2*n+1]=t[1]},VEC3:function(t,e,n){e[3*n+0]=t[0],e[3*n+1]=t[1],e[3*n+2]=t[2]},VEC4:function(t,e,n){e[4*n+0]=t[0],e[4*n+1]=t[1],e[4*n+2]=t[2],e[4*n+3]=t[3]},MAT2:function(t,e,n){e[4*n+0]=t[0],e[4*n+1]=t[1],e[4*n+2]=t[2],e[4*n+3]=t[3]},MAT3:function(t,e,n){e[9*n+0]=t[0],e[9*n+1]=t[1],e[9*n+2]=t[2],e[9*n+3]=t[3],e[9*n+4]=t[4],e[9*n+5]=t[5],e[9*n+6]=t[6],e[9*n+7]=t[7],e[9*n+8]=t[8],e[9*n+9]=t[9]},MAT4:function(t,e,n){e[16*n+0]=t[0],e[16*n+1]=t[1],e[16*n+2]=t[2],e[16*n+3]=t[3],e[16*n+4]=t[4],e[16*n+5]=t[5],e[16*n+6]=t[6],e[16*n+7]=t[7],e[16*n+8]=t[8],e[16*n+9]=t[9],e[16*n+10]=t[10],e[16*n+11]=t[11],e[16*n+12]=t[12],e[16*n+13]=t[13],e[16*n+14]=t[14],e[16*n+15]=t[15]}};function wE(r,t,e,n){var a=r.componentType;$(r.componentType);var i=typeof a=="string"?Nt.fromName(a):a,o=vF[r.type],s=gF[r.type],u=yF[r.type];e+=r.byteOffset;var f=Nt.createTypedArray(i,t,e,o*n);return{values:f,type:i,size:o,unpacker:s,packer:u}}var Zr=function(t){return t!==void 0};function CE(r,t,e){if(!t)return null;var n=r.getExtension("3DTILES_batch_table_hierarchy"),a=t.HIERARCHY;return a&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=a,n=a),n?AF(n,e):null}function AF(r,t){var e,n,a,i=r.instancesLength,o=r.classes,s=r.classIds,u=r.parentCounts,f=r.parentIds,l=i;Zr(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,5123),s.type=AttributeType.SCALAR,a=getBinaryAccessor(s),s=a.createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,i));var c;if(Zr(u))for(Zr(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,5123),u.type=AttributeType.SCALAR,a=getBinaryAccessor(u),u=a.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,i)),c=new Uint16Array(i),l=0,e=0;e<i;++e)c[e]=l,l+=u[e];Zr(f)&&Zr(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,5123),f.type=AttributeType.SCALAR,a=getBinaryAccessor(f),f=a.createArrayBufferView(t.buffer,t.byteOffset+f.byteOffset,l));var h=o.length;for(e=0;e<h;++e){var d=o[e].length,p=o[e].instances,v=getBinaryProperties(d,p,t);o[e].instances=combine(v,p)}var y=new Array(h).fill(0),A=new Uint16Array(i);for(e=0;e<i;++e)n=s[e],A[e]=y[n],++y[n];var _={classes:o,classIds:s,classIndexes:A,parentCounts:u,parentIndexes:c,parentIds:f};return TF(_),_}function pa(r,t,e){if(r){var n=r.parentCounts,a=r.parentIds;return a?e(r,t):n>0?bF(r,t,e):_F(r,t,e)}}function bF(r,t,e){var n=r.classIds,a=r.parentCounts,i=r.parentIds,o=r.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);var f=++marker,l=scratchStack;for(l.length=0,l.push(t);l.length>0;)if(t=l.pop(),u[t]!==f){u[t]=f;var c=e(r,t);if(Zr(c))return c;for(var h=a[t],d=o[t],p=0;p<h;++p){var v=i[d+p];v!==t&&l.push(v)}}return null}function _F(r,t,e){for(var n=!0;n;){var a=e(r,t);if(Zr(a))return a;var i=r.parentIds[t];n=i!==t,t=i}throw new Error("traverseHierarchySingleParent")}function TF(r){for(var t=[],e=r.classIds,n=e.length,a=0;a<n;++a)BE(r,a,stack)}function BE(r,t,e){var n=r.parentCounts,a=r.parentIds,i=r.parentIndexes,o=r.classIds,s=o.length;if(Zr(a)){assert(t<s,"Parent index ".concat(t," exceeds the total number of instances: ").concat(s)),assert(e.indexOf(t)===-1,"Circular dependency detected in the batch table hierarchy."),e.push(t);for(var u=Zr(n)?n[t]:1,f=Zr(n)?i[t]:t,l=0;l<u;++l){var c=a[f+l];c!==t&&BE(r,c,e)}e.pop(t)}}function mr(r){return r!=null}var ou=function(t,e){return t},xF={HIERARCHY:!0,extensions:!0,extras:!0},su=function(){function r(t,e,n){(0,OE.default)(this,r);var a,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};g(this,"json",void 0),g(this,"binary",void 0),g(this,"featureCount",void 0),g(this,"_extensions",void 0),g(this,"_properties",void 0),g(this,"_binaryProperties",void 0),g(this,"_hierarchy",void 0),$(n>=0),this.json=t||{},this.binary=e,this.featureCount=n,this._extensions=((a=this.json)===null||a===void 0?void 0:a.extensions)||{},this._properties={};for(var o in this.json)xF[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=CE(this,this.json,this.binary))}return(0,PE.default)(r,[{key:"getExtension",value:function(e){return this.json&&this.json.extensions&&this.json.extensions[e]}},{key:"memorySizeInBytes",value:function(){return 0}},{key:"isClass",value:function(e,n){if(this._checkBatchId(e),$(typeof n=="string",n),this._hierarchy){var a=pa(this._hierarchy,e,function(i,o){var s=i.classIds[o],u=i.classes[s];return u.name===n});return mr(a)}return!1}},{key:"isExactClass",value:function(e,n){return $(typeof n=="string",n),this.getExactClassName(e)===n}},{key:"getExactClassName",value:function(e){if(this._checkBatchId(e),this._hierarchy){var n=this._hierarchy.classIds[e],a=this._hierarchy.classes[n];return a.name}}},{key:"hasProperty",value:function(e,n){return this._checkBatchId(e),$(typeof n=="string",n),mr(this._properties[n])||this._hasPropertyInHierarchy(e,n)}},{key:"getPropertyNames",value:function(e,n){var a;this._checkBatchId(e),n=mr(n)?n:[],n.length=0;var i=Object.keys(this._properties);return(a=n).push.apply(a,(0,ME.default)(i)),this._hierarchy&&this._getPropertyNamesInHierarchy(e,n),n}},{key:"getProperty",value:function(e,n){if(this._checkBatchId(e),$(typeof n=="string",n),this._binaryProperties){var a=this._binaryProperties[n];if(mr(a))return this._getBinaryProperty(a,e)}var i=this._properties[n];if(mr(i))return ou(i[e],!0);if(this._hierarchy){var o=this._getHierarchyProperty(e,n);if(mr(o))return o}}},{key:"setProperty",value:function(e,n,a){var i=this.featureCount;if(this._checkBatchId(e),$(typeof n=="string",n),this._binaryProperties){var o=this._binaryProperties[n];if(o){this._setBinaryProperty(o,e,a);return}}if(!(this._hierarchy&&this._setHierarchyProperty(this,e,n,a))){var s=this._properties[n];mr(s)||(this._properties[n]=new Array(i),s=this._properties[n]),s[e]=ou(a,!0)}}},{key:"_checkBatchId",value:function(e){var n=e>=0&&e<this.featureCount;if(!n)throw new Error("batchId not in range [0, featureCount - 1].")}},{key:"_getBinaryProperty",value:function(e,n){return e.unpack(e.typedArray,n)}},{key:"_setBinaryProperty",value:function(e,n,a){e.pack(a,e.typedArray,n)}},{key:"_initializeBinaryProperties",value:function(){var e=null;for(var n in this._properties){var a=this._properties[n],i=this._initializeBinaryProperty(n,a);i&&(e=e||{},e[n]=i)}return e}},{key:"_initializeBinaryProperty",value:function(e,n){if("byteOffset"in n){var a=n;$(this.binary,"Property ".concat(e," requires a batch table binary.")),$(a.type,"Property ".concat(e," requires a type."));var i=wE(a,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:i.values,componentCount:i.size,unpack:i.unpacker,pack:i.packer}}return null}},{key:"_hasPropertyInHierarchy",value:function(e,n){if(!this._hierarchy)return!1;var a=pa(this._hierarchy,e,function(i,o){var s=i.classIds[o],u=i.classes[s].instances;return mr(u[n])});return mr(a)}},{key:"_getPropertyNamesInHierarchy",value:function(e,n){pa(this._hierarchy,e,function(a,i){var o=a.classIds[i],s=a.classes[o].instances;for(var u in s)s.hasOwnProperty(u)&&n.indexOf(u)===-1&&n.push(u)})}},{key:"_getHierarchyProperty",value:function(e,n){var a=this;return pa(this._hierarchy,e,function(i,o){var s=i.classIds[o],u=i.classes[s],f=i.classIndexes[o],l=u.instances[n];return mr(l)?mr(l.typedArray)?a._getBinaryProperty(l,f):ou(l[f],!0):null})}},{key:"_setHierarchyProperty",value:function(e,n,a,i){var o=this,s=pa(this._hierarchy,n,function(u,f){var l=u.classIds[f],c=u.classes[l],h=u.classIndexes[f],d=c.instances[a];return mr(d)?($(f===n,'Inherited property "'.concat(a,'" is read-only.')),mr(d.typedArray)?o._setBinaryProperty(d,h,i):d[h]=ou(i,!0),!0):!1});return mr(s)}}]),r}();var xd=4;function jt(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=new DataView(t);if(r.magic=n.getUint32(e,!0),e+=xd,r.version=n.getUint32(e,!0),e+=xd,r.byteLength=n.getUint32(e,!0),e+=xd,r.version!==1)throw new Error("3D Tile Version ".concat(r.version," not supported"));return e}var ma=4,IE="b3dm tile in legacy format.";function va(r,t,e){var n=new DataView(t),a;r.header=r.header||{};var i=n.getUint32(e,!0);e+=ma;var o=n.getUint32(e,!0);e+=ma;var s=n.getUint32(e,!0);e+=ma;var u=n.getUint32(e,!0);return e+=ma,s>=570425344?(e-=ma*2,a=i,s=o,u=0,i=0,o=0,console.warn(IE)):u>=570425344&&(e-=ma,a=s,s=i,u=o,i=0,o=0,console.warn(IE)),r.header.featureTableJsonByteLength=i,r.header.featureTableBinaryByteLength=o,r.header.batchTableJsonByteLength=s,r.header.batchTableBinaryByteLength=u,r.header.batchLength=a,e}function ga(r,t,e,n){return e=EF(r,t,e,n),e=SF(r,t,e,n),e}function EF(r,t,e,n){var a=r.header,i=a.featureTableJsonByteLength,o=a.featureTableBinaryByteLength,s=a.batchLength;if(r.featureTableJson={BATCH_LENGTH:s||0},i>0){var u=ad(t,e,i);r.featureTableJson=JSON.parse(u)}return e+=i,r.featureTableBinary=new Uint8Array(t,e,o),e+=o,e}function SF(r,t,e,n){var a=r.header,i=a.batchTableJsonByteLength,o=a.batchTableBinaryByteLength;if(i>0){var s=ad(t,e,i);r.batchTableJson=JSON.parse(s),e+=i,o>0&&(r.batchTableBinary=new Uint8Array(t,e,o),r.batchTableBinary=new Uint8Array(r.batchTableBinary),e+=o)}return e}function Ed(r,t,e){if(!t&&(!r||!r.batchIds||!e))return null;var n=r.batchIds,a=r.isRGB565,i=r.pointCount;if(n&&e){for(var o=new Uint8ClampedArray(i*3),s=0;s<i;s++){var u=n[s],f=e.getProperty(u,"dimensions"),l=f.map(function(p){return p*255});o[s*3]=l[0],o[s*3+1]=l[1],o[s*3+2]=l[2]}return{type:5121,value:o,size:3,normalized:!0}}if(a){for(var c=new Uint8ClampedArray(i*3),h=0;h<i;h++){var d=_d(t[h]);c[h*3]=d[0],c[h*3+1]=d[1],c[h*3+2]=d[2]}return{type:5121,value:c,size:3,normalized:!0}}return t&&t.length===i*3?{type:5121,value:t,size:3,normalized:!0}:{type:5121,value:t,size:4,normalized:!0}}var RE=new w;function FE(r,t){if(!t)return null;if(r.isOctEncoded16P){for(var e=new Float32Array(r.pointsLength*3),n=0;n<r.pointsLength;n++)Td(t[n*2],t[n*2+1],RE),RE.toArray(e,n*3);return{type:5126,size:2,value:e}}return{type:5126,size:2,value:t}}function LE(r,t,e){return r.isQuantized?e["3d-tiles"]&&e["3d-tiles"].decodeQuantizedPositions?(r.isQuantized=!1,wF(r,t)):{type:5123,value:t,size:3,normalized:!0}:t}function wF(r,t){for(var e=new w,n=new Float32Array(r.pointCount*3),a=0;a<r.pointCount;a++)e.set(t[a*3],t[a*3+1],t[a*3+2]).scale(1/r.quantizedRange).multiply(r.quantizedVolumeScale).add(r.quantizedVolumeOffset).toArray(n,a*3);return n}function kE(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function _n(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?kE(Object(e),!0).forEach(function(n){(0,DE.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):kE(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function GE(r,t,e,n,a){return Sd.apply(this,arguments)}function Sd(){return Sd=(0,uu.default)(Tn.default.mark(function r(t,e,n,a,i){var o,s,u;return Tn.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=jt(t,e,n),n=va(t,e,n),n=ga(t,e,n,a),CF(t),o=BF(t),s=o.featureTable,u=o.batchTable,l.next=7,RF(t,s,u,a,i);case 7:return MF(t,s,a),OF(t,s,u),PF(t,s),l.abrupt("return",n);case 11:case"end":return l.stop()}},r)})),Sd.apply(this,arguments)}function CF(r){r.attributes={positions:null,colors:null,normals:null,batchIds:null},r.isQuantized=!1,r.isTranslucent=!1,r.isRGB565=!1,r.isOctEncoded16P=!1}function BF(r){var t=new da(r.featureTableJson,r.featureTableBinary),e=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(e))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=e,r.featuresLength=e,r.pointsLength=e,r.pointCount=e,r.rtcCenter=t.getGlobalProperty("RTC_CENTER",5126,3);var n=IF(r,t);return{featureTable:t,batchTable:n}}function MF(r,t,e){if(!r.attributes.positions){if(t.hasProperty("POSITION"))r.attributes.positions=t.getPropertyArray("POSITION",5126,3);else if(t.hasProperty("POSITION_QUANTIZED")){var n=t.getPropertyArray("POSITION_QUANTIZED",5123,3);if(r.isQuantized=!0,r.quantizedRange=(1<<16)-1,r.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3),!r.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(r.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3),!r.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");r.attributes.positions=LE(r,n,e)}}if(!r.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function OF(r,t,e){if(!r.attributes.colors){var n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",5121,4),r.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",5121,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",5123,1),r.isRGB565=!0),r.attributes.colors=Ed(r,n,e)}t.hasProperty("CONSTANT_RGBA")&&(r.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",5121,4))}function PF(r,t){if(!r.attributes.normals){var e=null;t.hasProperty("NORMAL")?e=t.getPropertyArray("NORMAL",5126,3):t.hasProperty("NORMAL_OCT16P")&&(e=t.getPropertyArray("NORMAL_OCT16P",5121,2),r.isOctEncoded16P=!0),r.attributes.normals=FE(r,e)}}function IF(r,t){var e=null;if(!r.batchIds&&t.hasProperty("BATCH_ID")&&(r.batchIds=t.getPropertyArray("BATCH_ID",5123,1),r.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 a=r.batchTableJson,i=r.batchTableBinary;e=new su(a,i,n)}return e}function RF(r,t,e,n,a){return wd.apply(this,arguments)}function wd(){return wd=(0,uu.default)(Tn.default.mark(function r(t,e,n,a,i){var o,s,u,f,l,c,h,d;return Tn.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(f=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"],f&&(u=f.properties),l=e.getExtension("3DTILES_draco_point_compression"),!l){v.next=15;break}if(s=l.properties,c=l.byteOffset,h=l.byteLength,!(!s||!Number.isFinite(c)||!h)){v.next=9;break}throw new Error("Draco properties, byteOffset, and byteLength must be defined");case 9:o=t.featureTableBinary.slice(c,c+h),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){v.next=17;break}return v.abrupt("return",!0);case 17:return d={buffer:o,properties:_n(_n({},s),u),featureTableProperties:s,batchTableProperties:u,dequantizeInShader:!1},v.next=20,FF(t,d,a,i);case 20:return v.abrupt("return",v.sent);case 21:case"end":return v.stop()}},r)})),wd.apply(this,arguments)}function FF(r,t,e,n){return Cd.apply(this,arguments)}function Cd(){return Cd=(0,uu.default)(Tn.default.mark(function r(t,e,n,a){var i,o,s,u,f,l,c,h,d,p,v,y,A,_,E;return Tn.default.wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return i=a.parse,o=_n(_n({},n),{},{draco:_n(_n({},n.draco),{},{extraAttributes:e.batchTableProperties||{}})}),delete o["3d-tiles"],C.next=5,i(e.buffer,iu,o);case 5:if(s=C.sent,u=s.attributes.POSITION&&s.attributes.POSITION.value,f=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,l=s.attributes.NORMAL&&s.attributes.NORMAL.value,c=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,h=u&&s.attributes.POSITION.value.quantization,d=l&&s.attributes.NORMAL.value.quantization,h&&(p=s.POSITION.data.quantization,v=p.range,t.quantizedVolumeScale=new w(v,v,v),t.quantizedVolumeOffset=new w(p.minValues),t.quantizedRange=(1<<p.quantizationBits)-1,t.isQuantizedDraco=!0),d&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0),y={},e.batchTableProperties)for(A=0,_=Object.keys(e.batchTableProperties);A<_.length;A++)E=_[A],s.attributes[E]&&s.attributes[E].value&&(y[E.toLowerCase()]=s.attributes[E].value);t.attributes=_n({positions:u,colors:Ed(t,f,void 0),normals:l,batchIds:c},y);case 17:case"end":return C.stop()}},r)})),Cd.apply(this,arguments)}var mw=m(K()),Np=m(J());var pw=m(K()),Gp=m(J());var hw=m(W()),dw=m(K()),kp=m(J());var UE="3.3.0-alpha.10";var Li=m(K()),mt=m(J());var NE="3.3.0-alpha.10";var oS=m(W());var rS=m(Re()),tS=m(K()),Gd=m(J());var Fd=m(ge()),Ci=m(K()),dt=m(J());var jE="3.3.0-alpha.10",LF="https://unpkg.com/@loaders.gl/textures@".concat(jE,"/dist/libs/basis_encoder.wasm"),kF="https://unpkg.com/@loaders.gl/textures@".concat(jE,"/dist/libs/basis_encoder.js"),Bd;function Ld(r){return Od.apply(this,arguments)}function Od(){return Od=(0,Ci.default)(dt.default.mark(function r(t){var e;return dt.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(e=t.modules||{},!e.basis){a.next=3;break}return a.abrupt("return",e.basis);case 3:return Bd=Bd||DF(t),a.next=6,Bd;case 6:return a.abrupt("return",a.sent);case 7:case"end":return a.stop()}},r)})),Od.apply(this,arguments)}function DF(r){return Pd.apply(this,arguments)}function Pd(){return Pd=(0,Ci.default)(dt.default.mark(function r(t){var e,n,a,i;return dt.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return e=null,n=null,s.t0=Promise,s.next=5,Hr("basis_transcoder.js","textures",t);case 5:return s.t1=s.sent,s.next=8,Hr("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 a=s.sent,i=(0,Fd.default)(a,2),e=i[0],n=i[1],e=e||globalThis.BASIS,s.next=19,GF(e,n);case 19:return s.abrupt("return",s.sent);case 20:case"end":return s.stop()}},r)})),Pd.apply(this,arguments)}function GF(r,t){var e={};return t&&(e.wasmBinary=t),new Promise(function(n){r(e).then(function(a){var i=a.BasisFile,o=a.initializeBasis;o(),n({BasisFile:i})})})}var Md;function kd(r){return Id.apply(this,arguments)}function Id(){return Id=(0,Ci.default)(dt.default.mark(function r(t){var e;return dt.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(e=t.modules||{},!e.basisEncoder){a.next=3;break}return a.abrupt("return",e.basisEncoder);case 3:return Md=Md||UF(t),a.next=6,Md;case 6:return a.abrupt("return",a.sent);case 7:case"end":return a.stop()}},r)})),Id.apply(this,arguments)}function UF(r){return Rd.apply(this,arguments)}function Rd(){return Rd=(0,Ci.default)(dt.default.mark(function r(t){var e,n,a,i;return dt.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return e=null,n=null,s.t0=Promise,s.next=5,Hr(kF,"textures",t);case 5:return s.t1=s.sent,s.next=8,Hr(LF,"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 a=s.sent,i=(0,Fd.default)(a,2),e=i[0],n=i[1],e=e||globalThis.BASIS,s.next=19,NF(e,n);case 19:return s.abrupt("return",s.sent);case 20:case"end":return s.stop()}},r)})),Rd.apply(this,arguments)}function NF(r,t){var e={};return t&&(e.wasmBinary=t),new Promise(function(n){r(e).then(function(a){var i=a.BasisFile,o=a.KTX2File,s=a.initializeBasis,u=a.BasisEncoder;s(),n({BasisFile:i,KTX2File:o,BasisEncoder:u})})})}var xn={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 jF(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=VF(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
167
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function VF(r,t){if(r){if(typeof r=="string")return VE(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return VE(r,t)}}function VE(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var HF=["","WEBKIT_","MOZ_"],HE={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"},fu=null;function zE(r){if(!fu){r=r||zF()||void 0,fu=new Set;var t=jF(HF),e;try{for(t.s();!(e=t.n()).done;){var n=e.value;for(var a in HE)if(r&&r.getExtension("".concat(n).concat(a))){var i=HE[a];fu.add(i)}}}catch(o){t.e(o)}finally{t.f()}}return fu}function zF(){try{var r=document.createElement("canvas");return r.getContext("webgl")}catch{return null}}var g$=new Uint8Array([0]);var WE,JE,qE,XE,KE,YE,QE,$E;(function(r){r[r.NONE=0]="NONE",r[r.BASISLZ=1]="BASISLZ",r[r.ZSTD=2]="ZSTD",r[r.ZLIB=3]="ZLIB"})(WE||(WE={})),function(r){r[r.BASICFORMAT=0]="BASICFORMAT"}(JE||(JE={})),function(r){r[r.UNSPECIFIED=0]="UNSPECIFIED",r[r.ETC1S=163]="ETC1S",r[r.UASTC=166]="UASTC"}(qE||(qE={})),function(r){r[r.UNSPECIFIED=0]="UNSPECIFIED",r[r.SRGB=1]="SRGB"}(XE||(XE={})),function(r){r[r.UNSPECIFIED=0]="UNSPECIFIED",r[r.LINEAR=1]="LINEAR",r[r.SRGB=2]="SRGB",r[r.ITU=3]="ITU",r[r.NTSC=4]="NTSC",r[r.SLOG=5]="SLOG",r[r.SLOG2=6]="SLOG2"}(KE||(KE={})),function(r){r[r.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",r[r.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(YE||(YE={})),function(r){r[r.RGB=0]="RGB",r[r.RRR=3]="RRR",r[r.GGG=4]="GGG",r[r.AAA=15]="AAA"}(QE||(QE={})),function(r){r[r.RGB=0]="RGB",r[r.RGBA=3]="RGBA",r[r.RRR=4]="RRR",r[r.RRRG=5]="RRRG"}($E||($E={}));var br=[171,75,84,88,32,50,48,187,13,10,26,10];function ZE(r){var t=new Uint8Array(r),e=t.byteLength<br.length||t[0]!==br[0]||t[1]!==br[1]||t[2]!==br[2]||t[3]!==br[3]||t[4]!==br[4]||t[5]!==br[5]||t[6]!==br[6]||t[7]!==br[7]||t[8]!==br[8]||t[9]!==br[9]||t[10]!==br[10]||t[11]!==br[11];return!e}var WF={etc1:{basisFormat:0,compressed:!0,format:xn.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:xn.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:xn.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:xn.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:xn.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:xn.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 Nd(r,t){return Ud.apply(this,arguments)}function Ud(){return Ud=(0,tS.default)(Gd.default.mark(function r(t,e){var n,a,i,o,s,u;return Gd.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(e.basis.containerFormat!=="auto"){l.next=11;break}if(!ZE(t)){l.next=6;break}return l.next=4,kd(e);case 4:return n=l.sent,l.abrupt("return",eS(n.KTX2File,t,e));case 6:return l.next=8,Ld(e);case 8:return a=l.sent,i=a.BasisFile,l.abrupt("return",Dd(i,t,e));case 11:l.t0=e.basis.module,l.next=l.t0==="encoder"?14:(l.t0==="transcoder",22);break;case 14:return l.next=16,kd(e);case 16:o=l.sent,l.t1=e.basis.containerFormat,l.next=l.t1==="ktx2"?20:(l.t1==="basis",21);break;case 20:return l.abrupt("return",eS(o.KTX2File,t,e));case 21:return l.abrupt("return",Dd(o.BasisFile,t,e));case 22:return l.next=24,Ld(e);case 24:return s=l.sent,u=s.BasisFile,l.abrupt("return",Dd(u,t,e));case 27:case"end":return l.stop()}},r)})),Ud.apply(this,arguments)}function Dd(r,t,e){var n=new r(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");for(var a=n.getNumImages(),i=[],o=0;o<a;o++){for(var s=n.getNumLevels(o),u=[],f=0;f<s;f++)u.push(JF(n,o,f,e));i.push(u)}return i}finally{n.close(),n.delete()}}function JF(r,t,e,n){var a=r.getImageWidth(t,e),i=r.getImageHeight(t,e),o=r.getHasAlpha(),s=nS(n,o),u=s.compressed,f=s.format,l=s.basisFormat,c=r.getImageTranscodedSizeInBytes(t,e,l),h=new Uint8Array(c);if(!r.transcodeImage(h,t,e,l,0,0))throw new Error("failed to start Basis transcoding");return{width:a,height:i,data:h,compressed:u,format:f,hasAlpha:o}}function eS(r,t,e){var n=new r(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");for(var a=n.getLevels(),i=[],o=0;o<a;o++){i.push(qF(n,o,e));break}return[i]}finally{n.close(),n.delete()}}function qF(r,t,e){var n=r.getImageLevelInfo(t,0,0),a=n.alphaFlag,i=n.height,o=n.width,s=nS(e,a),u=s.compressed,f=s.format,l=s.basisFormat,c=r.getImageTranscodedSizeInBytes(t,0,0,l),h=new Uint8Array(c);if(!r.transcodeImage(h,t,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:i,data:h,compressed:u,hasAlpha:a,format:f}}function nS(r,t){var e=r&&r.basis&&r.basis.format;return e==="auto"&&(e=lu()),(0,rS.default)(e)==="object"&&(e=t?e.alpha:e.noAlpha),e=e.toLowerCase(),WF[e]}function lu(){var r=zE();return r.has("astc")?"astc-4x4":r.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:r.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:r.has("etc1")?"etc1":r.has("etc2")?"etc2":"rgb565"}function aS(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function iS(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?aS(Object(e),!0).forEach(function(n){(0,oS.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):aS(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var sS={name:"Basis",id:tr?"basis":"basis-nodejs",module:"textures",version:NE,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=iS(iS({},sS),{},{parse:Nd});function qe(r,t){if(!r)throw new Error(t||"assert failed: gltf")}function Vd(r,t){var e=r.startsWith("data:")||r.startsWith("http:")||r.startsWith("https:");if(e)return r;var n=t.baseUri||t.uri;if(!n)throw new Error("'baseUri' must be provided to resolve relative url ".concat(r));return n.substr(0,n.lastIndexOf("/")+1)+r}function uS(r,t,e){var n=r.bufferViews[e];qe(n);var a=n.buffer,i=t[a];qe(i);var o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}var VS=m(K()),Sp=m(J());var Qd={};Cr(Qd,{decode:()=>mL,name:()=>pL});var Kd=m(K()),Bi=m(J());var dS=m(Re()),pS=m(W()),mS=m(V()),vS=m(z());var fS=["SCALAR","VEC2","VEC3","VEC4"],XF=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],KF=new Map(XF),YF={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},QF={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},$F={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function cu(r){var t=fS[r-1];return t||fS[0]}function hu(r){var t=KF.get(r.constructor);if(!t)throw new Error("Illegal typed array");return t}function ya(r,t){var e=$F[r.componentType],n=YF[r.type],a=QF[r.componentType],i=r.count*n,o=r.count*n*a;return qe(o>=0&&o<=t.byteLength),{ArrayType:e,length:i,byteLength:o}}function lS(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=ZF(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
168
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function ZF(r,t){if(r){if(typeof r=="string")return cS(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return cS(r,t)}}function cS(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function hS(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function eL(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?hS(Object(e),!0).forEach(function(n){(0,pS.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):hS(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var rL={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},Ce=function(){function r(t){(0,mS.default)(this,r),g(this,"gltf",void 0),g(this,"sourceBuffers",void 0),g(this,"byteLength",void 0),this.gltf=t||{json:eL({},rL),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]])}return(0,vS.default)(r,[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(e){var n=this.json[e];return n}},{key:"getExtraData",value:function(e){var n=this.json.extras||{};return n[e]}},{key:"getExtension",value:function(e){var n=this.getUsedExtensions().find(function(i){return i===e}),a=this.json.extensions||{};return n?a[e]||!0:null}},{key:"getRequiredExtension",value:function(e){var n=this.getRequiredExtensions().find(function(a){return a===e});return n?this.getExtension(e):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getRemovedExtensions",value:function(){return this.json.extensionsRemoved||[]}},{key:"getObjectExtension",value:function(e,n){var a=e.extensions||{};return a[n]}},{key:"getScene",value:function(e){return this.getObject("scenes",e)}},{key:"getNode",value:function(e){return this.getObject("nodes",e)}},{key:"getSkin",value:function(e){return this.getObject("skins",e)}},{key:"getMesh",value:function(e){return this.getObject("meshes",e)}},{key:"getMaterial",value:function(e){return this.getObject("materials",e)}},{key:"getAccessor",value:function(e){return this.getObject("accessors",e)}},{key:"getTexture",value:function(e){return this.getObject("textures",e)}},{key:"getSampler",value:function(e){return this.getObject("samplers",e)}},{key:"getImage",value:function(e){return this.getObject("images",e)}},{key:"getBufferView",value:function(e){return this.getObject("bufferViews",e)}},{key:"getBuffer",value:function(e){return this.getObject("buffers",e)}},{key:"getObject",value:function(e,n){if((0,dS.default)(n)==="object")return n;var a=this.json[e]&&this.json[e][n];if(!a)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(n,"]"));return a}},{key:"getTypedArrayForBufferView",value:function(e){e=this.getBufferView(e);var n=e.buffer,a=this.gltf.buffers[n];qe(a);var i=(e.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,i,e.byteLength)}},{key:"getTypedArrayForAccessor",value:function(e){e=this.getAccessor(e);var n=this.getBufferView(e.bufferView),a=this.getBuffer(n.buffer),i=a.data,o=ya(e,n),s=o.ArrayType,u=o.length,f=n.byteOffset+e.byteOffset;return new s(i,f,u)}},{key:"getTypedArrayForImageData",value:function(e){e=this.getAccessor(e);var n=this.getBufferView(e.bufferView),a=this.getBuffer(n.buffer),i=a.data,o=n.byteOffset||0;return new Uint8Array(i,o,n.byteLength)}},{key:"addApplicationData",value:function(e,n){return this.json[e]=n,this}},{key:"addExtraData",value:function(e,n){return this.json.extras=this.json.extras||{},this.json.extras[e]=n,this}},{key:"addObjectExtension",value:function(e,n,a){return e.extensions=e.extensions||{},e.extensions[n]=a,this.registerUsedExtension(n),this}},{key:"setObjectExtension",value:function(e,n,a){var i=e.extensions||{};i[n]=a}},{key:"removeObjectExtension",value:function(e,n){var a=e.extensions||{},i=a[n];return delete a[n],i}},{key:"addExtension",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return qe(n),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=n,this.registerUsedExtension(e),n}},{key:"addRequiredExtension",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return qe(n),this.addExtension(e,n),this.registerRequiredExtension(e),n}},{key:"registerUsedExtension",value:function(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(function(n){return n===e})||this.json.extensionsUsed.push(e)}},{key:"registerRequiredExtension",value:function(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(function(n){return n===e})||this.json.extensionsRequired.push(e)}},{key:"removeExtension",value:function(e){if(this.getExtension(e)){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e],Array.isArray(this.json.extensionsRemoved)||(this.json.extensionsRemoved=[]);var n=this.json.extensionsRemoved;n.includes(e)||n.push(e)}}},{key:"setDefaultScene",value:function(e){this.json.scene=e}},{key:"addScene",value:function(e){var n=e.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:n}),this.json.scenes.length-1}},{key:"addNode",value:function(e){var n=e.meshIndex,a=e.matrix;this.json.nodes=this.json.nodes||[];var i={mesh:n};return a&&(i.matrix=a),this.json.nodes.push(i),this.json.nodes.length-1}},{key:"addMesh",value:function(e){var n=e.attributes,a=e.indices,i=e.material,o=e.mode,s=o===void 0?4:o,u=this._addAttributes(n),f={primitives:[{attributes:u,mode:s}]};if(a){var l=this._addIndices(a);f.primitives[0].indices=l}return Number.isFinite(i)&&(f.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(f),this.json.meshes.length-1}},{key:"addPointCloud",value:function(e){var n=this._addAttributes(e),a={primitives:[{attributes:n,mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}},{key:"addImage",value:function(e,n){var a=pn(e),i=n||a?.mimeType,o=this.addBufferView(e),s={bufferView:o,mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(s),this.json.images.length-1}},{key:"addBufferView",value:function(e){var n=e.byteLength;qe(Number.isFinite(n)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var a={buffer:0,byteOffset:this.byteLength,byteLength:n};return this.byteLength+=Tt(n,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(e,n){var a={bufferView:e,type:cu(n.size),componentType:n.componentType,count:n.count,max:n.max,min:n.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(a),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{size:3},a=this.addBufferView(e),i={min:n.min,max:n.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(e,n.size));var o={size:n.size,componentType:hu(e),count:Math.round(e.length/n.size),min:i.min,max:i.max};return this.addAccessor(a,Object.assign(o,n))}},{key:"addTexture",value:function(e){var n=e.imageIndex,a={source:n};return this.json.textures=this.json.textures||[],this.json.textures.push(a),this.json.textures.length-1}},{key:"addMaterial",value:function(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var e,n;this.gltf.buffers=[];var a=this.byteLength,i=new ArrayBuffer(a),o=new Uint8Array(i),s=0,u=lS(this.sourceBuffers||[]),f;try{for(u.s();!(f=u.n()).done;){var l=f.value;s=nl(l,o,s)}}catch(c){u.e(c)}finally{u.f()}(e=this.json)!==null&&e!==void 0&&(n=e.buffers)!==null&&n!==void 0&&n[0]?this.json.buffers[0].byteLength=a:this.json.buffers=[{byteLength:a}],this.gltf.binary=i,this.sourceBuffers=[i]}},{key:"_removeStringFromArray",value:function(e,n){for(var a=!0;a;){var i=e.indexOf(n);i>-1?e.splice(i,1):a=!1}}},{key:"_addAttributes",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n={};for(var a in e){var i=e[a],o=this._getGltfAttributeName(a),s=this.addBinaryBuffer(i.value,i);n[o]=s}return n}},{key:"_addIndices",value:function(e){return this.addBinaryBuffer(e,{size:1})}},{key:"_getGltfAttributeName",value:function(e){switch(e.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 e}}},{key:"_getAccessorMinMax",value:function(e,n){var a={min:null,max:null};if(e.length<n)return a;a.min=[],a.max=[];var i=e.subarray(0,n),o=lS(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;a.min.push(u),a.max.push(u)}}catch(c){o.e(c)}finally{o.f()}for(var f=n;f<e.length;f+=n)for(var l=0;l<n;l++)a.min[0+l]=Math.min(a.min[0+l],e[f+l]),a.max[0+l]=Math.max(a.max[0+l],e[f+l]);return a}}]),r}();var du=m(K()),gS=m(Re()),En=m(J()),J$=(typeof WebAssembly>"u"?"undefined":(0,gS.default)(WebAssembly))!=="object",tL="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",nL="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",aL=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]),iL=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]),oL={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},sL={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function yS(r,t,e,n,a){return zd.apply(this,arguments)}function zd(){return zd=(0,du.default)(En.default.mark(function r(t,e,n,a,i){var o,s,u=arguments;return En.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return o=u.length>5&&u[5]!==void 0?u[5]:"NONE",l.next=3,uL();case 3:s=l.sent,cL(s,s.exports[sL[i]],t,e,n,a,s.exports[oL[o||"NONE"]]);case 5:case"end":return l.stop()}},r)})),zd.apply(this,arguments)}var Hd;function uL(){return Wd.apply(this,arguments)}function Wd(){return Wd=(0,du.default)(En.default.mark(function r(){return En.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return Hd||(Hd=fL()),e.abrupt("return",Hd);case 2:case"end":return e.stop()}},r)})),Wd.apply(this,arguments)}function fL(){return Jd.apply(this,arguments)}function Jd(){return Jd=(0,du.default)(En.default.mark(function r(){var t,e;return En.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t=tL,WebAssembly.validate(aL)&&(t=nL,console.log("Warning: meshopt_decoder is using experimental SIMD support")),a.next=4,WebAssembly.instantiate(lL(t),{});case 4:return e=a.sent,a.next=7,e.instance.exports.__wasm_call_ctors();case 7:return a.abrupt("return",e.instance);case 8:case"end":return a.stop()}},r)})),Jd.apply(this,arguments)}function lL(r){for(var t=new Uint8Array(r.length),e=0;e<r.length;++e){var n=r.charCodeAt(e);t[e]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}for(var a=0,i=0;i<r.length;++i)t[a++]=t[i]<60?iL[t[i]]:(t[i]-60)*64+t[++i];return t.buffer.slice(0,a)}function cL(r,t,e,n,a,i,o){var s=r.exports.sbrk,u=n+3&-4,f=s(u*a),l=s(i.length),c=new Uint8Array(r.exports.memory.buffer);c.set(i,l);var h=t(f,n,a,l,i.length);if(h===0&&o&&o(f,u,a),e.set(c.subarray(f,f+n*a)),s(f-s(0)),h!==0)throw new Error("Malformed buffer data: ".concat(h))}function hL(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=dL(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
169
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function dL(r,t){if(r){if(typeof r=="string")return AS(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return AS(r,t)}}function AS(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var Yd="EXT_meshopt_compression",pL=Yd;function mL(r,t){return qd.apply(this,arguments)}function qd(){return qd=(0,Kd.default)(Bi.default.mark(function r(t,e){var n,a,i,o,s,u;return Bi.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(a=new Ce(t),e!=null&&(n=e.gltf)!==null&&n!==void 0&&n.decompressMeshes){l.next=3;break}return l.abrupt("return");case 3:i=[],o=hL(t.json.bufferViews||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,i.push(vL(a,u))}catch(c){o.e(c)}finally{o.f()}return l.next=8,Promise.all(i);case 8:a.removeExtension(Yd);case 9:case"end":return l.stop()}},r)})),qd.apply(this,arguments)}function vL(r,t){return Xd.apply(this,arguments)}function Xd(){return Xd=(0,Kd.default)(Bi.default.mark(function r(t,e){var n,a,i,o,s,u,f,l,c,h,d,p,v,y;return Bi.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(n=t.getObjectExtension(e,Yd),!n){_.next=9;break}return a=n.byteOffset,i=a===void 0?0:a,o=n.byteLength,s=o===void 0?0:o,u=n.byteStride,f=n.count,l=n.mode,c=n.filter,h=c===void 0?"NONE":c,d=n.buffer,p=t.gltf.buffers[d],v=new Uint8Array(p.arrayBuffer,p.byteOffset+i,s),y=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength),_.next=8,yS(y,f,u,v,l,h);case 8:return _.abrupt("return",y);case 9:return _.abrupt("return",null);case 10:case"end":return _.stop()}},r)})),Xd.apply(this,arguments)}var $d={};Cr($d,{name:()=>AL,preprocess:()=>bL});function gL(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=yL(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
170
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function yL(r,t){if(r){if(typeof r=="string")return bS(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return bS(r,t)}}function bS(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var Aa="EXT_texture_webp",AL=Aa;function bL(r,t){var e=new Ce(r);if(!jc("image/webp")){if(e.getRequiredExtensions().includes(Aa))throw new Error("gltf: Required extension ".concat(Aa," not supported by browser"));return}var n=e.json,a=gL(n.textures||[]),i;try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e.getObjectExtension(o,Aa);s&&(o.source=s.source),e.removeObjectExtension(o,Aa)}}catch(u){a.e(u)}finally{a.f()}e.removeExtension(Aa)}var Zd={};Cr(Zd,{name:()=>xL,preprocess:()=>EL});function _L(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=TL(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
171
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function TL(r,t){if(r){if(typeof r=="string")return _S(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return _S(r,t)}}function _S(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var pu="KHR_texture_basisu",xL=pu;function EL(r,t){var e=new Ce(r),n=e.json,a=_L(n.textures||[]),i;try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e.getObjectExtension(o,pu);s&&(o.source=s.source),e.removeObjectExtension(o,pu)}}catch(u){a.e(u)}finally{a.f()}e.removeExtension(pu)}var op={};Cr(op,{decode:()=>IL,encode:()=>RL,name:()=>OL,preprocess:()=>PL});var SS=m(ge()),np=m(W()),ap=m(K()),Sn=m(J());function TS(r){var t={};for(var e in r){var n=r[e];if(e!=="indices"){var a=ep(n);t[e]=a}}return t}function ep(r){var t=SL(r),e=t.buffer,n=t.size,a=t.count,i={value:e,size:n,byteOffset:0,count:a,type:cu(n),componentType:hu(e)};return i}function SL(r){var t=r,e=1,n=0;return r&&r.value&&(t=r.value,e=r.size||1),t&&(ArrayBuffer.isView(t)||(t=wL(t,Float32Array)),n=t.length/e),{buffer:t,size:e,count:n}}function wL(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return r?Array.isArray(r)?new t(r):e&&!(r instanceof t)?new t(r):r:null}function xS(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function CL(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?xS(Object(e),!0).forEach(function(n){(0,np.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):xS(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var BL=Sn.default.mark(ip);function Mi(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=ML(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
172
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function ML(r,t){if(r){if(typeof r=="string")return ES(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ES(r,t)}}function ES(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var wn="KHR_draco_mesh_compression",OL=wn;function PL(r,t,e){var n=new Ce(r),a=Mi(ip(n)),i;try{for(a.s();!(i=a.n()).done;){var o=i.value;n.getObjectExtension(o,wn)}}catch(s){a.e(s)}finally{a.f()}}function IL(r,t,e){return rp.apply(this,arguments)}function rp(){return rp=(0,ap.default)(Sn.default.mark(function r(t,e,n){var a,i,o,s,u,f;return Sn.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(e!=null&&(a=e.gltf)!==null&&a!==void 0&&a.decompressMeshes){c.next=2;break}return c.abrupt("return");case 2:i=new Ce(t),o=[],s=Mi(ip(i));try{for(s.s();!(u=s.n()).done;)f=u.value,i.getObjectExtension(f,wn)&&o.push(FL(i,f,e,n))}catch(h){s.e(h)}finally{s.f()}return c.next=8,Promise.all(o);case 8:i.removeExtension(wn);case 9:case"end":return c.stop()}},r)})),rp.apply(this,arguments)}function RL(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=new Ce(r),n=Mi(e.json.meshes||[]),a;try{for(n.s();!(a=n.n()).done;){var i=a.value;LL(i,t),e.addRequiredExtension(wn)}}catch(o){n.e(o)}finally{n.f()}}function FL(r,t,e,n){return tp.apply(this,arguments)}function tp(){return tp=(0,ap.default)(Sn.default.mark(function r(t,e,n,a){var i,o,s,u,f,l,c,h,d,p,v,y,A,_;return Sn.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(i=t.getObjectExtension(e,wn),i){x.next=3;break}return x.abrupt("return");case 3:return o=t.getTypedArrayForBufferView(i.bufferView),s=Qt(o.buffer,o.byteOffset),u=a.parse,f=CL({},n),delete f["3d-tiles"],x.next=10,u(s,iu,f,a);case 10:for(l=x.sent,c=TS(l.attributes),h=0,d=Object.entries(c);h<d.length;h++)p=(0,SS.default)(d[h],2),v=p[0],y=p[1],v in e.attributes&&(A=e.attributes[v],_=t.getAccessor(A),_!=null&&_.min&&_!==null&&_!==void 0&&_.max&&(y.min=_.min,y.max=_.max));e.attributes=c,l.indices&&(e.indices=ep(l.indices)),kL(e);case 16:case"end":return x.stop()}},r)})),tp.apply(this,arguments)}function LL(r,t){var e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:4,a=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!a.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var o=a.DracoWriter.encodeSync({attributes:r}),s=i==null||(e=i.parseSync)===null||e===void 0?void 0:e.call(i,{attributes:r}),u=a._addFauxAttributes(s.attributes),f=a.addBufferView(o),l={primitives:[{attributes:u,mode:n,extensions:(0,np.default)({},wn,{bufferView:f,attributes:u})}]};return l}function kL(r){if(!r.attributes&&Object.keys(r.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function ip(r){var t,e,n,a,i,o;return Sn.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:t=Mi(r.json.meshes||[]),u.prev=1,t.s();case 3:if((e=t.n()).done){u.next=24;break}n=e.value,a=Mi(n.primitives),u.prev=6,a.s();case 8:if((i=a.n()).done){u.next=14;break}return o=i.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),a.e(u.t0);case 19:return u.prev=19,a.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()}},BL,null,[[1,26,29,32],[6,16,19,22]])}var lp={};Cr(lp,{decode:()=>jL,name:()=>GL});var OS=m(ge()),PS=m(K()),sp=m(J());var wS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},CS={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};function BS(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=DL(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
173
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function DL(r,t){if(r){if(typeof r=="string")return MS(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return MS(r,t)}}function MS(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var fp="KHR_texture_transform",GL=fp,mu=new w,UL=new ve,NL=new ve;function jL(r,t){return up.apply(this,arguments)}function up(){return up=(0,PS.default)(sp.default.mark(function r(t,e){var n,a,i,o;return sp.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(n=new Ce(t),a=n.getExtension(fp),a){u.next=4;break}return u.abrupt("return");case 4:for(i=t.json.materials||[],o=0;o<i.length;o++)VL(o,t);case 6:case"end":return u.stop()}},r)})),up.apply(this,arguments)}function VL(r,t){var e,n,a,i=[],o=(e=t.json.materials)===null||e===void 0?void 0:e[r],s=o==null||(n=o.pbrMetallicRoughness)===null||n===void 0?void 0:n.baseColorTexture;s&&Oi(t,r,s,i);var u=o?.emissiveTexture;u&&Oi(t,r,u,i);var f=o?.normalTexture;f&&Oi(t,r,f,i);var l=o?.occlusionTexture;l&&Oi(t,r,l,i);var c=o==null||(a=o.pbrMetallicRoughness)===null||a===void 0?void 0:a.metallicRoughnessTexture;c&&Oi(t,r,c,i)}function Oi(r,t,e,n){var a=HL(e,n);if(a){var i=r.json.meshes||[],o=BS(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,f=BS(u.primitives),l;try{for(f.s();!(l=f.n()).done;){var c=l.value,h=c.material;Number.isFinite(h)&&t===h&&zL(r,c,a)}}catch(d){f.e(d)}finally{f.f()}}}catch(d){o.e(d)}finally{o.f()}}}function HL(r,t){var e,n=(e=r.extensions)===null||e===void 0?void 0:e[fp],a=r.texCoord,i=a===void 0?0:a,o=n.texCoord,s=o===void 0?i:o,u=t.findIndex(function(l){var c=(0,OS.default)(l,2),h=c[0],d=c[1];return h===i&&d===s})!==-1;if(!u){var f=qL(n);return i!==s&&(r.texCoord=s),t.push([i,s]),{originalTexCoord:i,texCoord:s,matrix:f}}return null}function zL(r,t,e){var n=e.originalTexCoord,a=e.texCoord,i=e.matrix,o=t.attributes["TEXCOORD_".concat(n)];if(Number.isFinite(o)){var s,u=(s=r.json.accessors)===null||s===void 0?void 0:s[o];if(u&&u.bufferView){var f,l=(f=r.json.bufferViews)===null||f===void 0?void 0:f[u.bufferView];if(l){for(var c=r.buffers[l.buffer],h=c.arrayBuffer,d=c.byteOffset,p=(d||0)+(u.byteOffset||0)+(l.byteOffset||0),v=ya(u,l),y=v.ArrayType,A=v.length,_=CS[u.componentType],E=wS[u.type],x=l.byteStride||_*E,C=new Float32Array(A),P=0;P<u.count;P++){var L=new y(h,p+P*x,2);mu.set(L[0],L[1],1),mu.transformByMatrix3(i),C.set([mu[0],mu[1]],P*E)}n===a?WL(u,l,r.buffers,C):JL(a,u,t,r,C)}}}}function WL(r,t,e,n){r.componentType=5126,e.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=e.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function JL(r,t,e,n,a){n.buffers.push({arrayBuffer:a.buffer,byteOffset:0,byteLength:a.buffer.byteLength});var i=n.json.bufferViews;if(i){i.push({buffer:n.buffers.length-1,byteLength:a.buffer.byteLength,byteOffset:0});var o=n.json.accessors;o&&(o.push({bufferView:i?.length-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),e.attributes["TEXCOORD_".concat(r)]=o.length-1)}}function qL(r){var t=r.offset,e=t===void 0?[0,0]:t,n=r.rotation,a=n===void 0?0:n,i=r.scale,o=i===void 0?[1,1]:i,s=new ve().set(1,0,0,0,1,0,e[0],e[1],1),u=UL.set(Math.cos(a),Math.sin(a),0,-Math.sin(a),Math.cos(a),0,0,0,1),f=NL.set(o[0],0,0,0,o[1],0,0,0,1);return s.multiplyRight(u).multiplyRight(f)}var pp={};Cr(pp,{decode:()=>YL,encode:()=>QL,name:()=>KL});var dp=m(K()),Pi=m(J());function RS(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=XL(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
174
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function XL(r,t){if(r){if(typeof r=="string")return IS(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return IS(r,t)}}function IS(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var Cn="KHR_lights_punctual",KL=Cn;function YL(r){return cp.apply(this,arguments)}function cp(){return cp=(0,dp.default)(Pi.default.mark(function r(t){var e,n,a,i,o,s,u;return Pi.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:e=new Ce(t),n=e.json,a=e.getExtension(Cn),a&&(e.json.lights=a.lights,e.removeExtension(Cn)),i=RS(n.nodes||[]);try{for(i.s();!(o=i.n()).done;)s=o.value,u=e.getObjectExtension(s,Cn),u&&(s.light=u.light),e.removeObjectExtension(s,Cn)}catch(c){i.e(c)}finally{i.f()}case 6:case"end":return l.stop()}},r)})),cp.apply(this,arguments)}function QL(r){return hp.apply(this,arguments)}function hp(){return hp=(0,dp.default)(Pi.default.mark(function r(t){var e,n,a,i,o,s,u;return Pi.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(e=new Ce(t),n=e.json,n.lights&&(a=e.addExtension(Cn),qe(!a.lights),a.lights=n.lights,delete n.lights),e.json.lights){i=RS(e.json.lights);try{for(i.s();!(o=i.n()).done;)s=o.value,u=s.node,e.addObjectExtension(u,Cn,s)}catch(c){i.e(c)}finally{i.f()}delete e.json.lights}case 4:case"end":return l.stop()}},r)})),hp.apply(this,arguments)}var gp={};Cr(gp,{decode:()=>ek,encode:()=>rk,name:()=>ZL});var LS=m(K()),mp=m(J());function kS(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=$L(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
175
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function $L(r,t){if(r){if(typeof r=="string")return FS(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return FS(r,t)}}function FS(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var Ii="KHR_materials_unlit",ZL=Ii;function ek(r){return vp.apply(this,arguments)}function vp(){return vp=(0,LS.default)(mp.default.mark(function r(t){var e,n,a,i,o,s;return mp.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:e=new Ce(t),n=e.json,a=kS(n.materials||[]);try{for(a.s();!(i=a.n()).done;)o=i.value,s=o.extensions&&o.extensions.KHR_materials_unlit,s&&(o.unlit=!0),e.removeObjectExtension(o,Ii)}catch(l){a.e(l)}finally{a.f()}e.removeExtension(Ii);case 5:case"end":return f.stop()}},r)})),vp.apply(this,arguments)}function rk(r){var t=new Ce(r),e=t.json;if(t.materials){var n=kS(e.materials||[]),a;try{for(n.s();!(a=n.n()).done;){var i=a.value;i.unlit&&(delete i.unlit,t.addObjectExtension(i,Ii,{}),t.addExtension(Ii))}}catch(o){n.e(o)}finally{n.f()}}}var _p={};Cr(_p,{decode:()=>ik,encode:()=>ok,name:()=>ak});var GS=m(Re()),bp=m(K()),Fi=m(J());function tk(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=nk(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
176
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function nk(r,t){if(r){if(typeof r=="string")return DS(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return DS(r,t)}}function DS(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var Ri="KHR_techniques_webgl",ak=Ri;function ik(r){return yp.apply(this,arguments)}function yp(){return yp=(0,bp.default)(Fi.default.mark(function r(t){var e,n,a,i,o,s,u,f;return Fi.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(e=new Ce(t),n=e.json,a=e.getExtension(Ri),a){i=sk(a,e),o=tk(n.materials||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,f=e.getObjectExtension(u,Ri),f&&(u.technique=Object.assign({},f,i[f.technique]),u.technique.values=uk(u.technique,e)),e.removeObjectExtension(u,Ri)}catch(h){o.e(h)}finally{o.f()}e.removeExtension(Ri)}case 4:case"end":return c.stop()}},r)})),yp.apply(this,arguments)}function ok(r,t){return Ap.apply(this,arguments)}function Ap(){return Ap=(0,bp.default)(Fi.default.mark(function r(t,e){return Fi.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:case"end":return a.stop()}},r)})),Ap.apply(this,arguments)}function sk(r,t){var e=r.programs,n=e===void 0?[]:e,a=r.shaders,i=a===void 0?[]:a,o=r.techniques,s=o===void 0?[]:o,u=new TextDecoder;return i.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=i[f.fragmentShader],f.vertexShader=i[f.vertexShader]}),s.forEach(function(f){f.program=n[f.program]}),s}function uk(r,t){var e=Object.assign({},r.values);return Object.keys(r.uniforms||{}).forEach(function(n){r.uniforms[n].value&&!(n in e)&&(e[n]=r.uniforms[n].value)}),Object.keys(e).forEach(function(n){(0,GS.default)(e[n])==="object"&&e[n].index!==void 0&&(e[n].texture=t.getTexture(e[n].index))}),e}var Ep={};Cr(Ep,{decode:()=>lk,name:()=>fk});var US=m(K()),Tp=m(J());var NS="EXT_feature_metadata",fk=NS;function lk(r){return xp.apply(this,arguments)}function xp(){return xp=(0,US.default)(Tp.default.mark(function r(t){var e;return Tp.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:e=new Ce(t),ck(e);case 2:case"end":return a.stop()}},r)})),xp.apply(this,arguments)}function ck(r){var t,e=r.getExtension(NS),n=e==null||(t=e.schema)===null||t===void 0?void 0:t.classes,a=e?.featureTables,i=e?.featureTextures;if(i&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.'),n&&a)for(var o in n){var s=n[o],u=pk(a,o);u&&hk(r,u,s)}}function hk(r,t,e){for(var n in e.properties){var a,i=e.properties[n],o=t==null||(a=t.properties)===null||a===void 0?void 0:a[n],s=t.count;if(o){var u=dk(r,i,s,o);o.data=u}}}function dk(r,t,e,n){var a=n.bufferView,i=r.getTypedArrayForBufferView(a);switch(t.type){case"STRING":{var o=n.stringOffsetBufferView,s=r.getTypedArrayForBufferView(o);i=mk(i,s,e);break}default:}return i}function pk(r,t){for(var e in r){var n=r[e];if(n.class===t)return n}return null}function mk(r,t,e){for(var n=[],a=new TextDecoder("utf8"),i=0,o=4,s=0;s<e;s++){var u=t[(s+1)*o]-t[s*o],f=r.subarray(i,u+i),l=a.decode(f);n.push(l),i+=u}return n}function HS(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=vk(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
177
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function vk(r,t){if(r){if(typeof r=="string")return jS(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return jS(r,t)}}function jS(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var zS=[Qd,$d,Zd,op,pp,gp,_p,lp,Ep];function WS(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2?arguments[2]:void 0,n=zS.filter(function(u){return qS(u.name,t)}),a=HS(n),i;try{for(a.s();!(i=a.n()).done;){var o=i.value,s;(s=o.preprocess)===null||s===void 0||s.call(o,r,t,e)}}catch(u){a.e(u)}finally{a.f()}}function JS(r){return wp.apply(this,arguments)}function wp(){return wp=(0,VS.default)(Sp.default.mark(function r(t){var e,n,a,i,o,s,u,f=arguments;return Sp.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:e=f.length>1&&f[1]!==void 0?f[1]:{},n=f.length>2?f[2]:void 0,a=zS.filter(function(h){return qS(h.name,e)}),i=HS(a),c.prev=4,i.s();case 6:if((o=i.n()).done){c.next=12;break}return s=o.value,c.next=10,(u=s.decode)===null||u===void 0?void 0:u.call(s,t,e,n);case 10:c.next=6;break;case 12:c.next=17;break;case 14:c.prev=14,c.t0=c.catch(4),i.e(c.t0);case 17:return c.prev=17,i.f(),c.finish(17);case 20:case"end":return c.stop()}},r,null,[[4,14,17,20]])})),wp.apply(this,arguments)}function qS(r,t){var e,n=(t==null||(e=t.gltf)===null||e===void 0?void 0:e.excludeExtensions)||{},a=r in n&&!n[r];return!a}var $S=m(V()),ZS=m(z());function gk(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=yk(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
178
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function yk(r,t){if(r){if(typeof r=="string")return XS(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return XS(r,t)}}function XS(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var Cp="KHR_binary_glTF";function KS(r){var t=new Ce(r),e=t.json,n=gk(e.images||[]),a;try{for(n.s();!(a=n.n()).done;){var i=a.value,o=t.getObjectExtension(i,Cp);o&&Object.assign(i,o),t.removeObjectExtension(i,Cp)}}catch(s){n.e(s)}finally{n.f()}e.buffers&&e.buffers[0]&&delete e.buffers[0].uri,t.removeExtension(Cp)}function Vt(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=bk(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
179
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function bk(r,t){if(r){if(typeof r=="string")return YS(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return YS(r,t)}}function YS(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var QS={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},_k={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Tk=function(){function r(){(0,$S.default)(this,r),g(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),g(this,"json",void 0)}return(0,ZS.default)(r,[{key:"normalize",value:function(e,n){this.json=e.json;var a=e.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(!n.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),KS(e),this._convertObjectIdsToArrayIndices(a),this._updateObjects(a),this._updateMaterial(a)}},{key:"_addAsset",value:function(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(e){for(var n in QS)this._convertTopLevelObjectToArray(e,n)}},{key:"_convertTopLevelObjectToArray",value:function(e,n){var a=e[n];if(!(!a||Array.isArray(a))){e[n]=[];for(var i in a){var o=a[i];o.id=o.id||i;var s=e[n].length;e[n].push(o),this.idToIndexMap[n][i]=s}}}},{key:"_convertObjectIdsToArrayIndices",value:function(e){for(var n in QS)this._convertIdsToIndices(e,n);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));var a=Vt(e.textures),i;try{for(a.s();!(i=a.n()).done;){var o=i.value;this._convertTextureIds(o)}}catch(y){a.e(y)}finally{a.f()}var s=Vt(e.meshes),u;try{for(s.s();!(u=s.n()).done;){var f=u.value;this._convertMeshIds(f)}}catch(y){s.e(y)}finally{s.f()}var l=Vt(e.nodes),c;try{for(l.s();!(c=l.n()).done;){var h=c.value;this._convertNodeIds(h)}}catch(y){l.e(y)}finally{l.f()}var d=Vt(e.scenes),p;try{for(d.s();!(p=d.n()).done;){var v=p.value;this._convertSceneIds(v)}}catch(y){d.e(y)}finally{d.f()}}},{key:"_convertTextureIds",value:function(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}},{key:"_convertMeshIds",value:function(e){var n=Vt(e.primitives),a;try{for(n.s();!(a=n.n()).done;){var i=a.value,o=i.attributes,s=i.indices,u=i.material;for(var f in o)o[f]=this._convertIdToIndex(o[f],"accessor");s&&(i.indices=this._convertIdToIndex(s,"accessor")),u&&(i.material=this._convertIdToIndex(u,"material"))}}catch(l){n.e(l)}finally{n.f()}}},{key:"_convertNodeIds",value:function(e){var n=this;e.children&&(e.children=e.children.map(function(a){return n._convertIdToIndex(a,"node")})),e.meshes&&(e.meshes=e.meshes.map(function(a){return n._convertIdToIndex(a,"mesh")}))}},{key:"_convertSceneIds",value:function(e){var n=this;e.nodes&&(e.nodes=e.nodes.map(function(a){return n._convertIdToIndex(a,"node")}))}},{key:"_convertIdsToIndices",value:function(e,n){e[n]||(console.warn("gltf v1: json doesn't contain attribute ".concat(n)),e[n]=[]);var a=Vt(e[n]),i;try{for(a.s();!(i=a.n()).done;){var o=i.value;for(var s in o){var u=o[s],f=this._convertIdToIndex(u,s);o[s]=f}}}catch(l){a.e(l)}finally{a.f()}}},{key:"_convertIdToIndex",value:function(e,n){var a=_k[n];if(a in this.idToIndexMap){var i=this.idToIndexMap[a][e];if(!Number.isFinite(i))throw new Error("gltf v1: failed to resolve ".concat(n," with id ").concat(e));return i}return e}},{key:"_updateObjects",value:function(e){var n=Vt(this.json.buffers),a;try{for(n.s();!(a=n.n()).done;){var i=a.value;delete i.type}}catch(o){n.e(o)}finally{n.f()}}},{key:"_updateMaterial",value:function(e){var n=Vt(e.materials),a;try{var i=function(){var l=a.value;l.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var c=((o=l.values)===null||o===void 0?void 0:o.tex)||((s=l.values)===null||s===void 0?void 0:s.texture2d_0)||((u=l.values)===null||u===void 0?void 0:u.diffuseTex),h=e.textures.findIndex(function(d){return d.id===c});h!==-1&&(l.pbrMetallicRoughness.baseColorTexture={index:h})};for(n.s();!(a=n.n()).done;){var o,s,u;i()}}catch(f){n.e(f)}finally{n.f()}}}]),r}();function ew(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Tk().normalize(r,t)}var tw=m(Re()),nw=m(V()),aw=m(z()),_a=m(W());var ba;function rw(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function pt(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?rw(Object(e),!0).forEach(function(n){(0,_a.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):rw(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var xk={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ek={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},wr={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Sk={magFilter:wr.TEXTURE_MAG_FILTER,minFilter:wr.TEXTURE_MIN_FILTER,wrapS:wr.TEXTURE_WRAP_S,wrapT:wr.TEXTURE_WRAP_T},wk=(ba={},(0,_a.default)(ba,wr.TEXTURE_MAG_FILTER,wr.LINEAR),(0,_a.default)(ba,wr.TEXTURE_MIN_FILTER,wr.NEAREST_MIPMAP_LINEAR),(0,_a.default)(ba,wr.TEXTURE_WRAP_S,wr.REPEAT),(0,_a.default)(ba,wr.TEXTURE_WRAP_T,wr.REPEAT),ba);function Ck(r){return Ek[r]}function Bk(r){return xk[r]}var Mk=function(){function r(){(0,nw.default)(this,r),g(this,"baseUri",""),g(this,"json",{}),g(this,"buffers",[]),g(this,"images",[])}return(0,aw.default)(r,[{key:"postProcess",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=e.json,i=e.buffers,o=i===void 0?[]:i,s=e.images,u=s===void 0?[]:s,f=e.baseUri,l=f===void 0?"":f;return qe(a),this.baseUri=l,this.json=a,this.buffers=o,this.images=u,this._resolveTree(this.json,n),this.json}},{key:"_resolveTree",value:function(e){var n=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e.bufferViews&&(e.bufferViews=e.bufferViews.map(function(i,o){return n._resolveBufferView(i,o)})),e.images&&(e.images=e.images.map(function(i,o){return n._resolveImage(i,o)})),e.samplers&&(e.samplers=e.samplers.map(function(i,o){return n._resolveSampler(i,o)})),e.textures&&(e.textures=e.textures.map(function(i,o){return n._resolveTexture(i,o)})),e.accessors&&(e.accessors=e.accessors.map(function(i,o){return n._resolveAccessor(i,o)})),e.materials&&(e.materials=e.materials.map(function(i,o){return n._resolveMaterial(i,o)})),e.meshes&&(e.meshes=e.meshes.map(function(i,o){return n._resolveMesh(i,o)})),e.nodes&&(e.nodes=e.nodes.map(function(i,o){return n._resolveNode(i,o)})),e.skins&&(e.skins=e.skins.map(function(i,o){return n._resolveSkin(i,o)})),e.scenes&&(e.scenes=e.scenes.map(function(i,o){return n._resolveScene(i,o)})),e.scene!==void 0&&(e.scene=e.scenes[this.json.scene])}},{key:"getScene",value:function(e){return this._get("scenes",e)}},{key:"getNode",value:function(e){return this._get("nodes",e)}},{key:"getSkin",value:function(e){return this._get("skins",e)}},{key:"getMesh",value:function(e){return this._get("meshes",e)}},{key:"getMaterial",value:function(e){return this._get("materials",e)}},{key:"getAccessor",value:function(e){return this._get("accessors",e)}},{key:"getCamera",value:function(e){return null}},{key:"getTexture",value:function(e){return this._get("textures",e)}},{key:"getSampler",value:function(e){return this._get("samplers",e)}},{key:"getImage",value:function(e){return this._get("images",e)}},{key:"getBufferView",value:function(e){return this._get("bufferViews",e)}},{key:"getBuffer",value:function(e){return this._get("buffers",e)}},{key:"_get",value:function(e,n){if((0,tw.default)(n)==="object")return n;var a=this.json[e]&&this.json[e][n];return a||console.warn("glTF file error: Could not find ".concat(e,"[").concat(n,"]")),a}},{key:"_resolveScene",value:function(e,n){var a=this;return e.id=e.id||"scene-".concat(n),e.nodes=(e.nodes||[]).map(function(i){return a.getNode(i)}),e}},{key:"_resolveNode",value:function(e,n){var a=this;return e.id=e.id||"node-".concat(n),e.children&&(e.children=e.children.map(function(i){return a.getNode(i)})),e.mesh!==void 0?e.mesh=this.getMesh(e.mesh):e.meshes!==void 0&&e.meshes.length&&(e.mesh=e.meshes.reduce(function(i,o){var s=a.getMesh(o);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),e.camera!==void 0&&(e.camera=this.getCamera(e.camera)),e.skin!==void 0&&(e.skin=this.getSkin(e.skin)),e}},{key:"_resolveSkin",value:function(e,n){return e.id=e.id||"skin-".concat(n),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}},{key:"_resolveMesh",value:function(e,n){var a=this;return e.id=e.id||"mesh-".concat(n),e.primitives&&(e.primitives=e.primitives.map(function(i){i=pt({},i);var o=i.attributes;i.attributes={};for(var s in o)i.attributes[s]=a.getAccessor(o[s]);return i.indices!==void 0&&(i.indices=a.getAccessor(i.indices)),i.material!==void 0&&(i.material=a.getMaterial(i.material)),i})),e}},{key:"_resolveMaterial",value:function(e,n){if(e.id=e.id||"material-".concat(n),e.normalTexture&&(e.normalTexture=pt({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=pt({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=pt({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=pt({},e.pbrMetallicRoughness);var a=e.pbrMetallicRoughness;a.baseColorTexture&&(a.baseColorTexture=pt({},a.baseColorTexture),a.baseColorTexture.texture=this.getTexture(a.baseColorTexture.index)),a.metallicRoughnessTexture&&(a.metallicRoughnessTexture=pt({},a.metallicRoughnessTexture),a.metallicRoughnessTexture.texture=this.getTexture(a.metallicRoughnessTexture.index))}return e}},{key:"_resolveAccessor",value:function(e,n){if(e.id=e.id||"accessor-".concat(n),e.bufferView!==void 0&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=Ck(e.componentType),e.components=Bk(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var a=e.bufferView.buffer,i=ya(e,e.bufferView),o=i.ArrayType,s=i.byteLength,u=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+a.byteOffset,f=a.arrayBuffer.slice(u,u+s);e.bufferView.byteStride&&(f=this._getValueFromInterleavedBuffer(a,u,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new o(f)}return e}},{key:"_getValueFromInterleavedBuffer",value:function(e,n,a,i,o){for(var s=new Uint8Array(o*i),u=0;u<o;u++){var f=n+u*a;s.set(new Uint8Array(e.arrayBuffer.slice(f,f+i)),u*i)}return s.buffer}},{key:"_resolveTexture",value:function(e,n){return e.id=e.id||"texture-".concat(n),e.sampler="sampler"in e?this.getSampler(e.sampler):wk,e.source=this.getImage(e.source),e}},{key:"_resolveSampler",value:function(e,n){e.id=e.id||"sampler-".concat(n),e.parameters={};for(var a in e){var i=this._enumSamplerParameter(a);i!==void 0&&(e.parameters[i]=e[a])}return e}},{key:"_enumSamplerParameter",value:function(e){return Sk[e]}},{key:"_resolveImage",value:function(e,n){e.id=e.id||"image-".concat(n),e.bufferView!==void 0&&(e.bufferView=this.getBufferView(e.bufferView));var a=this.images[n];return a&&(e.image=a),e}},{key:"_resolveBufferView",value:function(e,n){var a=e.buffer,i=pt(pt({id:"bufferView-".concat(n)},e),{},{buffer:this.buffers[a]}),o=this.buffers[a].arrayBuffer,s=this.buffers[a].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),i.data=new Uint8Array(o,s,e.byteLength),i}},{key:"_resolveCamera",value:function(e,n){return e.id=e.id||"camera-".concat(n),e.perspective,e.orthographic,e}}]),r}();function iw(r,t){return new Mk().postProcess(r,t)}var ow=1735152710,Op=12,vu=8,Ok=1313821514,Pk=5130562,Ik=0,Rk=1,Fk=0,Ta=!0;function Lk(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;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)))}function sw(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=new DataView(r),a=e.magic,i=a===void 0?ow:a,o=n.getUint32(t,!1);return o===i||o===ow}function Pp(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=new DataView(t),i=Lk(a,e+0),o=a.getUint32(e+4,Ta),s=a.getUint32(e+8,Ta);switch(Object.assign(r,{header:{byteOffset:e,byteLength:s,hasBinChunk:!1},type:i,version:o,json:{},binChunks:[]}),e+=Op,r.version){case 1:return kk(r,a,e);case 2:return Dk(r,a,e,n={});default:throw new Error("Invalid GLB version ".concat(r.version,". Only supports v1 and v2."))}}function kk(r,t,e){$(r.header.byteLength>Op+vu);var n=t.getUint32(e+0,Ta),a=t.getUint32(e+4,Ta);return e+=vu,$(a===Fk),Bp(r,t,e,n),e+=n,e+=Mp(r,t,e,r.header.byteLength),e}function Dk(r,t,e,n){return $(r.header.byteLength>Op+vu),Gk(r,t,e,n),e+r.header.byteLength}function Gk(r,t,e,n){for(;e+8<=r.header.byteLength;){var a=t.getUint32(e+0,Ta),i=t.getUint32(e+4,Ta);switch(e+=vu,i){case Ok:Bp(r,t,e,a);break;case Pk:Mp(r,t,e,a);break;case Ik:n.strict||Bp(r,t,e,a);break;case Rk:n.strict||Mp(r,t,e,a);break;default:break}e+=Tt(a,4)}return e}function Bp(r,t,e,n){var a=new Uint8Array(t.buffer,e,n),i=new TextDecoder("utf8"),o=i.decode(a);return r.json=JSON.parse(o),Tt(n,4)}function Mp(r,t,e,n){return r.header.hasBinChunk=!0,r.binChunks.push({byteOffset:e,byteLength:n,arrayBuffer:t.buffer}),Tt(n,4)}function fw(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=Uk(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
180
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Uk(r,t){if(r){if(typeof r=="string")return uw(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return uw(r,t)}}function uw(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function lw(r,t){return Ip.apply(this,arguments)}function Ip(){return Ip=(0,Li.default)(mt.default.mark(function r(t,e){var n,a,i,o,s,u,f,l,c,h,d=arguments;return mt.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(s=d.length>2&&d[2]!==void 0?d[2]:0,u=d.length>3?d[3]:void 0,f=d.length>4?d[4]:void 0,Nk(t,e,s,u),ew(t,{normalize:u==null||(n=u.gltf)===null||n===void 0?void 0:n.normalize}),WS(t,u,f),l=[],!(u!=null&&(a=u.gltf)!==null&&a!==void 0&&a.loadBuffers&&t.json.buffers)){v.next=10;break}return v.next=10,jk(t,u,f);case 10:return u!=null&&(i=u.gltf)!==null&&i!==void 0&&i.loadImages&&(c=Vk(t,u,f),l.push(c)),h=JS(t,u,f),l.push(h),v.next=15,Promise.all(l);case 15:return v.abrupt("return",u!=null&&(o=u.gltf)!==null&&o!==void 0&&o.postProcess?iw(t,u):t);case 16:case"end":return v.stop()}},r)})),Ip.apply(this,arguments)}function Nk(r,t,e,n){if(n.uri&&(r.baseUri=n.uri),t instanceof ArrayBuffer&&!sw(t,e,n)){var a=new TextDecoder;t=a.decode(t)}if(typeof t=="string")r.json=Zf(t);else if(t instanceof ArrayBuffer){var i={};e=Pp(i,t,e,n.glb),qe(i.type==="glTF","Invalid GLB magic string ".concat(i.type)),r._glb=i,r.json=i.json}else qe(!1,"GLTF: must be ArrayBuffer or string");var o=r.json.buffers||[];if(r.buffers=new Array(o.length).fill(null),r._glb&&r._glb.header.hasBinChunk){var s=r._glb.binChunks;r.buffers[0]={arrayBuffer:s[0].arrayBuffer,byteOffset:s[0].byteOffset,byteLength:s[0].byteLength}}var u=r.json.images||[];r.images=new Array(u.length).fill({})}function jk(r,t,e){return Rp.apply(this,arguments)}function Rp(){return Rp=(0,Li.default)(mt.default.mark(function r(t,e,n){var a,i,o,s,u,f,l,c,h;return mt.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:a=t.json.buffers||[],i=0;case 2:if(!(i<a.length)){p.next=22;break}if(o=a[i],!o.uri){p.next=18;break}return f=n.fetch,qe(f),l=Vd(o.uri,e),p.next=10,n==null||(s=n.fetch)===null||s===void 0?void 0:s.call(n,l);case 10:return c=p.sent,p.next=13,c==null||(u=c.arrayBuffer)===null||u===void 0?void 0:u.call(c);case 13:h=p.sent,t.buffers[i]={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength},delete o.uri,p.next=19;break;case 18:t.buffers[i]===null&&(t.buffers[i]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength});case 19:++i,p.next=2;break;case 22:case"end":return p.stop()}},r)})),Rp.apply(this,arguments)}function Vk(r,t,e){return Fp.apply(this,arguments)}function Fp(){return Fp=(0,Li.default)(mt.default.mark(function r(t,e,n){var a,i,o,s,u,f;return mt.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:a=Hk(t),i=t.json.images||[],o=[],s=fw(a);try{for(s.s();!(u=s.n()).done;)f=u.value,o.push(zk(t,i[f],f,e,n))}catch(h){s.e(h)}finally{s.f()}return c.next=7,Promise.all(o);case 7:return c.abrupt("return",c.sent);case 8:case"end":return c.stop()}},r)})),Fp.apply(this,arguments)}function Hk(r){var t=new Set,e=r.json.textures||[],n=fw(e),a;try{for(n.s();!(a=n.n()).done;){var i=a.value;i.source!==void 0&&t.add(i.source)}}catch(o){n.e(o)}finally{n.f()}return Array.from(t).sort()}function zk(r,t,e,n,a){return Lp.apply(this,arguments)}function Lp(){return Lp=(0,Li.default)(mt.default.mark(function r(t,e,n,a,i){var o,s,u,f,l,c,h;return mt.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(o=i.fetch,s=i.parse,!(e.uri&&!e.hasOwnProperty("bufferView"))){p.next=10;break}return f=Vd(e.uri,a),p.next=5,o(f);case 5:return l=p.sent,p.next=8,l.arrayBuffer();case 8:u=p.sent,e.bufferView={data:u};case 10:return Number.isFinite(e.bufferView)&&(c=uS(t.json,t.buffers,e.bufferView),u=Qt(c.buffer,c.byteOffset,c.byteLength)),qe(u,"glTF image has no data"),p.next=14,s(u,[Uc,jd],{mimeType:e.mimeType,basis:a.basis||{format:lu()}},i);case 14:h=p.sent,h&&h[0]&&(h={compressed:!0,mipmaps:!1,width:h[0].width,height:h[0].height,data:h[0]}),t.images=t.images||[],t.images[n]=h;case 18:case"end":return p.stop()}},r)})),Lp.apply(this,arguments)}function cw(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function gu(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?cw(Object(e),!0).forEach(function(n){(0,hw.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):cw(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var Bn={name:"glTF",id:"gltf",module:"gltf",version:UE,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:Wk,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 Wk(r){return Dp.apply(this,arguments)}function Dp(){return Dp=(0,dw.default)(kp.default.mark(function r(t){var e,n,a,i,o,s,u=arguments;return kp.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return e=u.length>1&&u[1]!==void 0?u[1]:{},n=u.length>2?u[2]:void 0,e=gu(gu({},Bn.options),e),e.gltf=gu(gu({},Bn.options.gltf),e.gltf),a=e,i=a.byteOffset,o=i===void 0?0:i,s={},l.next=8,lw(s,t,o,e,n);case 8:return l.abrupt("return",l.sent);case 9:case"end":return l.stop()}},r)})),Dp.apply(this,arguments)}var yu={URI:0,EMBEDDED:1};function Au(r,t,e,n){r.rotateYtoZ=!0;var a=r.byteOffset+r.byteLength-e;if(a===0)throw new Error("glTF byte length must be greater than 0.");return r.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",r.gltfArrayBuffer=Qt(t,e,a),r.gltfByteOffset=0,r.gltfByteLength=a,e%4===0||console.warn("".concat(r.type,": embedded glb is not aligned to a 4-byte boundary.")),r.byteOffset+r.byteLength}function bu(r,t,e,n){return Up.apply(this,arguments)}function Up(){return Up=(0,pw.default)(Gp.default.mark(function r(t,e,n,a){var i,o,s;return Gp.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(i=n["3d-tiles"]||{},Jk(t,e,n),!i.loadGLTF){f.next=16;break}if(o=a.parse,s=a.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=16;break}return f.next=12,o(t.gltfArrayBuffer,Bn,n,a);case 12:t.gltf=f.sent,delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;case 16:case"end":return f.stop()}},r)})),Up.apply(this,arguments)}function Jk(r,t,e){switch(t){case yu.URI:var n=new Uint8Array(r.gltfArrayBuffer,r.gltfByteOffset),a=new TextDecoder,i=a.decode(n);r.gltfUrl=i.replace(/[\s\0]+$/,""),delete r.gltfArrayBuffer,delete r.gltfByteOffset,delete r.gltfByteLength;break;case yu.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}function vw(r,t,e,n,a){return jp.apply(this,arguments)}function jp(){return jp=(0,mw.default)(Np.default.mark(function r(t,e,n,a,i){var o,s;return Np.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return n=qk(t,e,n,a,i),f.next=3,bu(t,yu.EMBEDDED,a,i);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()}},r)})),jp.apply(this,arguments)}function qk(r,t,e,n,a){e=jt(r,t,e),e=va(r,t,e),e=ga(r,t,e,n),e=Au(r,t,e,n);var i=new da(r.featureTableJson,r.featureTableBinary);return r.rtcCenter=i.getGlobalProperty("RTC_CENTER",5126,3),e}var gw=m(K()),Vp=m(J());function yw(r,t,e,n,a){return Hp.apply(this,arguments)}function Hp(){return Hp=(0,gw.default)(Vp.default.mark(function r(t,e,n,a,i){return Vp.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=Xk(t,e,n,a,i),s.next=3,bu(t,t.gltfFormat,a,i);case 3:return s.abrupt("return",n);case 4:case"end":return s.stop()}},r)})),Hp.apply(this,arguments)}function Xk(r,t,e,n,a){if(e=jt(r,t,e),r.version!==1)throw new Error("Instanced 3D Model version ".concat(r.version," is not supported"));e=va(r,t,e);var i=new DataView(t);if(r.gltfFormat=i.getUint32(e,!0),e+=4,e=ga(r,t,e,n),e=Au(r,t,e,n),r.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var o=new da(r.featureTableJson,r.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");r.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),r.rtcCenter=o.getGlobalProperty("RTC_CENTER",5126,3);var u=new su(r.batchTableJson,r.batchTableBinary,s);return Kk(r,o,u,s),e}function Kk(r,t,e,n){for(var a={instances:new Array(n),batchTable:r._batchTable,cull:!1,url:void 0,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,forwardAxis:[1,0,0]},i=a.instances,o=new w,s=new w,u=new w,f=new w,l=new ve,c=new wt,h=new w,d={},p=new Z,v=[],y=[],A=new w,_=new w,E=0;E<n;E++){var x=void 0;if(t.hasProperty("POSITION"))x=t.getProperty("POSITION",5126,3,E,o);else if(t.hasProperty("POSITION_QUANTIZED")){x=t.getProperty("POSITION_QUANTIZED",5123,3,E,o);var C=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3,A);if(!C)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var P=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3,_);if(!P)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var L=65535,M=0;M<3;M++)x[M]=x[M]/L*P[M]+C[M]}if(!x)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(x),d.translation=o,r.normalUp=t.getProperty("NORMAL_UP",5126,3,E,v),r.normalRight=t.getProperty("NORMAL_RIGHT",5126,3,E,y);var S=!1;if(r.normalUp){if(!r.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");r.hasCustomOrientation=!0}else{if(r.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",5123,2,v),r.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",5123,2,y),r.octNormalUp)throw r.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");r.eastNorthUp?(be.WGS84.eastNorthUpToFixedFrame(o,p),p.getRotationMatrix3(l)):l.identity()}S&&(f.copy(s).cross(u).normalize(),l.setColumn(0,s),l.setColumn(1,u),l.setColumn(2,f)),c.fromMatrix3(l),d.rotation=c,h.set(1,1,1);var b=t.getProperty("SCALE",5126,1,E);Number.isFinite(b)&&h.multiplyByScalar(b);var R=t.getProperty("SCALE_NON_UNIFORM",5126,3,E,v);R&&h.scale(R),d.scale=h;var F=t.getProperty("BATCH_ID",5123,1,E);F===void 0&&(F=E);var N=new Z().fromQuaternion(d.rotation);p.identity(),p.translate(d.translation),p.multiplyRight(N),p.scale(d.scale);var k=p.clone();i[E]={modelMatrix:k,batchId:F}}r.instances=i}var Aw=m(K()),zp=m(J());function bw(r,t,e,n,a,i){return Wp.apply(this,arguments)}function Wp(){return Wp=(0,Aw.default)(zp.default.mark(function r(t,e,n,a,i,o){var s,u;return zp.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:n=jt(t,e,n),s=new DataView(e),t.tilesLength=s.getUint32(n,!0),n+=4,t.tiles=[];case 5:if(!(t.tiles.length<t.tilesLength&&t.byteLength-n>12)){l.next=13;break}return u={},t.tiles.push(u),l.next=10,o(e,n,a,i,u);case 10:n=l.sent,l.next=5;break;case 13:return l.abrupt("return",n);case 14:case"end":return l.stop()}},r)})),Wp.apply(this,arguments)}var _w=m(K()),Jp=m(J());function Tw(r,t,e,n){return qp.apply(this,arguments)}function qp(){return qp=(0,_w.default)(Jp.default.mark(function r(t,e,n,a){var i;return Jp.default.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",i=a.parse,s.next=5,i(e,Bn,n,a);case 5:t.gltf=s.sent;case 6:case"end":return s.stop()}},r)})),qp.apply(this,arguments)}function Yp(r){return Kp.apply(this,arguments)}function Kp(){return Kp=(0,xw.default)(Xp.default.mark(function r(t){var e,n,a,i,o=arguments;return Xp.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:e=o.length>1&&o[1]!==void 0?o[1]:0,n=o.length>2?o[2]:void 0,a=o.length>3?o[3]:void 0,i=o.length>4&&o[4]!==void 0?o[4]:{},i.byteOffset=e,i.type=cx(t,e),u.t0=i.type,u.next=u.t0===An.COMPOSITE?9:u.t0===An.BATCHED_3D_MODEL?12:u.t0===An.GLTF?15:u.t0===An.INSTANCED_3D_MODEL?18:u.t0===An.POINT_CLOUD?21:24;break;case 9:return u.next=11,bw(i,t,e,n,a,Yp);case 11:return u.abrupt("return",u.sent);case 12:return u.next=14,vw(i,t,e,n,a);case 14:return u.abrupt("return",u.sent);case 15:return u.next=17,Tw(i,t,n,a);case 17:return u.abrupt("return",u.sent);case 18:return u.next=20,yw(i,t,e,n,a);case 20:return u.abrupt("return",u.sent);case 21:return u.next=23,GE(i,t,e,n,a);case 23:return u.abrupt("return",u.sent);case 24:throw new Error("3DTileLoader: unknown type ".concat(i.type));case 25:case"end":return u.stop()}},r)})),Kp.apply(this,arguments)}var xu=m(K()),On=m(J());var em=m(K()),ki=m(J()),Yk=1952609651,Qk=1;function rm(r,t,e){return $p.apply(this,arguments)}function $p(){return $p=(0,em.default)(ki.default.mark(function r(t,e,n){var a,i,o,s,u,f,l,c,h;return ki.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(a=new Uint32Array(t.slice(0,4)),a[0]===Yk){p.next=3;break}throw new Error("Wrong subtree file magic number");case 3:if(i=new Uint32Array(t.slice(4,8)),i[0]===Qk){p.next=6;break}throw new Error("Wrong subtree file verson, must be 1");case 6:if(o=Ew(t.slice(8,16)),s=new Uint8Array(t,24,o),u=new TextDecoder("utf8"),f=u.decode(s),l=JSON.parse(f),c=Ew(t.slice(16,24)),h=new ArrayBuffer(0),c&&(h=t.slice(24+o)),!("bufferView"in l.tileAvailability)){p.next=18;break}return p.next=17,Qp(l,"tileAvailability",h,n);case 17:l.tileAvailability.explicitBitstream=p.sent;case 18:if(!("bufferView"in l.contentAvailability)){p.next=22;break}return p.next=21,Qp(l,"contentAvailability",h,n);case 21:l.contentAvailability.explicitBitstream=p.sent;case 22:if(!("bufferView"in l.childSubtreeAvailability)){p.next=26;break}return p.next=25,Qp(l,"childSubtreeAvailability",h,n);case 25:l.childSubtreeAvailability.explicitBitstream=p.sent;case 26:return p.abrupt("return",l);case 27:case"end":return p.stop()}},r)})),$p.apply(this,arguments)}function $k(r,t){var e=t.startsWith("http");if(e){var n=new URL(r,t);return decodeURI(n.toString())}var a="http://".concat(t),i=new URL(r,a);return"/".concat(i.host).concat(i.pathname)}function Qp(r,t,e,n){return Zp.apply(this,arguments)}function Zp(){return Zp=(0,em.default)(ki.default.mark(function r(t,e,n,a){var i,o,s,u,f,l;return ki.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(i=t[e].bufferView,o=t.bufferViews[i],s=t.buffers[o.buffer],!(!(a!=null&&a.url)||!a.fetch)){h.next=5;break}throw new Error("Url is not provided");case 5:if(a.fetch){h.next=7;break}throw new Error("fetch is not provided");case 7:if(!s.uri){h.next=16;break}return u=$k(s.uri,a?.url),h.next=11,a.fetch(u);case 11:return f=h.sent,h.next=14,f.arrayBuffer();case 14:return l=h.sent,h.abrupt("return",new Uint8Array(l,o.byteOffset,o.byteLength));case 16:return h.abrupt("return",new Uint8Array(n,o.byteOffset,o.byteLength));case 17:case"end":return h.stop()}},r)})),Zp.apply(this,arguments)}function Ew(r){var t=new DataView(r),e=t.getUint32(0,!0),n=t.getUint32(4,!0);return e+Math.pow(2,32)*n}var _u={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Js,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:rm,options:{}};var Sw=m(ge()),ww=m(K()),nm=m(J());var Zk=4,eD=8,rD={QUADTREE:Zk,OCTREE:eD};function im(r){return am.apply(this,arguments)}function am(){return am=(0,ww.default)(nm.default.mark(function r(t){var e,n,a,i,o,s,u,f,l,c,h,d,p,v,y,A,_,E,x,C,P,L,M,S,b,R,F,N,k,B,O,I,U,D,j,X,te,Pe,Ee,rr,Ne,yt,_r,kn;return nm.default.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:if(e=t.options,n=t.parentData,a=n===void 0?{mortonIndex:0,x:0,y:0,z:0}:n,i=t.childIndex,o=i===void 0?0:i,s=t.globalData,u=s===void 0?{level:0,mortonIndex:0,x:0,y:0,z:0}:s,f=t.subtree,l=t.level,c=l===void 0?0:l,h=e.subdivisionScheme,d=e.subtreeLevels,p=e.maximumLevel,v=e.contentUrlTemplate,y=e.subtreesUriTemplate,A=e.basePath,_={children:[],lodMetricValue:0,contentUrl:""},E=rD[h],x=o&1,C=o>>1&1,P=o>>2&1,L=(Math.pow(E,c)-1)/(E-1),M=Mn(a.mortonIndex,o),S=L+M,b=Mn(a.x,x),R=Mn(a.y,C),F=Mn(a.z,P),N=!1,c+1>d&&(N=tm(f.childSubtreeAvailability,M)),k=Mn(u.x,b),B=Mn(u.y,R),O=Mn(u.z,F),I=c+u.level,!N){vr.next=38;break}return U="".concat(A,"/").concat(y),D=Tu(U,I,k,B,O),vr.next=25,Lr(D,_u);case 25:j=vr.sent,f=j,u.mortonIndex=M,u.x=b,u.y=R,u.z=F,u.level=c,M=0,S=0,b=0,R=0,F=0,c=0;case 38:if(X=tm(f.tileAvailability,S),!(!X||c>p)){vr.next=41;break}return vr.abrupt("return",_);case 41:te=tm(f.contentAvailability,S),te&&(_.contentUrl=Tu(v,I,k,B,O)),Pe=c+1,Ee={mortonIndex:M,x:b,y:R,z:F},rr=0;case 46:if(!(rr<E)){vr.next=54;break}return vr.next=49,im({subtree:f,options:e,parentData:Ee,childIndex:rr,level:Pe,globalData:u});case 49:Ne=vr.sent,(Ne.contentUrl||Ne.children.length)&&(yt=I+1,_r={childTileX:b,childTileY:R,childTileZ:F},kn=tD(Ne,yt,_r,e),_.children.push(kn));case 51:rr++,vr.next=46;break;case 54:return vr.abrupt("return",_);case 55:case"end":return vr.stop()}},r)})),am.apply(this,arguments)}function tm(r,t){return"constant"in r?Boolean(r.constant):r.explicitBitstream?iD(t,r.explicitBitstream):!1}function tD(r,t,e,n){var a=n.basePath,i=n.refine,o=n.getRefine,s=n.lodMetricType,u=n.getTileType,f=n.rootLodMetricValue,l=n.rootBoundingVolume,c=r.contentUrl&&r.contentUrl.replace("".concat(a,"/"),""),h=f/Math.pow(2,t),d=nD(t,l,e);return{children:r.children,contentUrl:r.contentUrl,content:{uri:c},id:r.contentUrl,refine:o(i),type:u(r),lodMetricType:s,lodMetricValue:h,geometricError:h,transform:r.transform,boundingVolume:d}}function nD(r,t,e){if(t.region){var n=e.childTileX,a=e.childTileY,i=e.childTileZ,o=(0,Sw.default)(t.region,6),s=o[0],u=o[1],f=o[2],l=o[3],c=o[4],h=o[5],d=Math.pow(2,r),p=(f-s)/d,v=(l-u)/d,y=(h-c)/d,A=s+p*n,_=s+p*(n+1),E=u+v*a,x=u+v*(a+1),C=c+y*i,P=c+y*(i+1);return{region:[A,E,_,x,C,P]}}return console.warn("Unsupported bounding volume type: ",t),null}function Mn(r,t){return parseInt(r.toString(2)+t.toString(2),2)}function Tu(r,t,e,n,a){var i=aD({level:t,x:e,y:n,z:a});return r.replace(/{level}|{x}|{y}|{z}/gi,function(o){return i[o]})}function aD(r){var t={};for(var e in r)t["{".concat(e,"}")]=r[e];return t}function iD(r,t){var e=Math.floor(r/8),n=r%8,a=t[e]>>n&1;return a===1}function oD(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=sD(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
181
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function sD(r,t){if(r){if(typeof r=="string")return Cw(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Cw(r,t)}}function Cw(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function lm(r){if(!r.contentUrl)return lt.EMPTY;var t=r.contentUrl,e=t.split(".").pop();switch(e){case"pnts":return lt.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return lt.SCENEGRAPH;default:return e}}function cm(r){switch(r){case"REPLACE":case"replace":return hr.REPLACE;case"ADD":case"add":return hr.ADD;default:return r}}function om(r,t){var e=/^[a-z][0-9a-z+.-]*:/i;if(e.test(t)){var n=new URL(r,"".concat(t,"/"));return decodeURI(n.toString())}else if(r.startsWith("/"))return r;return"".concat(t,"/").concat(r)}function Bw(r,t){if(!r)return null;if(r.content){var e=r.content.uri||r.content.url;r.contentUrl=om(e,t.basePath)}return r.id=r.contentUrl,r.lodMetricType=vn.GEOMETRIC_ERROR,r.lodMetricValue=r.geometricError,r.transformMatrix=r.transform,r.type=lm(r),r.refine=cm(r.refine),r}function Pw(r,t){return sm.apply(this,arguments)}function sm(){return sm=(0,xu.default)(On.default.mark(function r(t,e){var n,a,i,o,s,u,f,l,c,h;return On.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(n=t.basePath,i=Ow(t?.root),!(i&&t.root)){p.next=8;break}return p.next=5,Mw(t.root,t,i,e);case 5:a=p.sent,p.next=9;break;case 8:a=Bw(t.root,t);case 9:o=[],o.push(a);case 11:if(!(o.length>0)){p.next=40;break}s=o.pop()||{},u=s.children||[],f=oD(u),p.prev=15,f.s();case 17:if((l=f.n()).done){p.next=30;break}if(c=l.value,h=Ow(c),!h){p.next=26;break}return p.next=23,Mw(c,t,h,e);case 23:c=p.sent,p.next=27;break;case 26:Bw(c,{basePath:n});case 27:o.push(c);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",a);case 41:case"end":return p.stop()}},r,null,[[15,32,35,38]])})),sm.apply(this,arguments)}function Mw(r,t,e,n){return um.apply(this,arguments)}function um(){return um=(0,xu.default)(On.default.mark(function r(t,e,n,a){var i,o,s,u,f,l,c,h,d,p,v,y,A,_;return On.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return o=e.basePath,s=n.subdivisionScheme,u=n.maximumLevel,f=n.subtreeLevels,l=n.subtrees.uri,c=Tu(l,0,0,0,0),h=om(c,o),x.next=6,Lr(h,_u,a);case 6:return d=x.sent,p=om(t.content.uri,o),v=e==null||(i=e.root)===null||i===void 0?void 0:i.refine,y=t.geometricError,A=t.boundingVolume,_={contentUrlTemplate:p,subtreesUriTemplate:l,subdivisionScheme:s,subtreeLevels:f,maximumLevel:u,refine:v,basePath:o,lodMetricType:vn.GEOMETRIC_ERROR,rootLodMetricValue:y,rootBoundingVolume:A,getTileType:lm,getRefine:cm},x.next=14,uD(t,d,_);case 14:return x.abrupt("return",x.sent);case 15:case"end":return x.stop()}},r)})),um.apply(this,arguments)}function uD(r,t,e){return fm.apply(this,arguments)}function fm(){return fm=(0,xu.default)(On.default.mark(function r(t,e,n){var a,i,o;return On.default.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=vn.GEOMETRIC_ERROR,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,u.next=7,im({subtree:e,options:n});case 7:return a=u.sent,i=a.children,o=a.contentUrl,o&&(t.contentUrl=o,t.content={uri:o.replace("".concat(n.basePath,"/"),"")}),t.refine=cm(t.refine),t.type=lm(t),t.children=i,t.id=t.contentUrl,u.abrupt("return",t);case 16:case"end":return u.stop()}},r)})),fm.apply(this,arguments)}function Ow(r){var t;return(r==null||(t=r.extensions)===null||t===void 0?void 0:t["3DTILES_implicit_tiling"])||r?.implicitTiling}var Su={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Js,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:hD,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function fD(r){return xt.dirname(r.url)}function lD(r,t,e){return hm.apply(this,arguments)}function hm(){return hm=(0,Eu.default)(Pn.default.mark(function r(t,e,n){var a,i;return Pn.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return a={content:{featureIds:null}},i=0,s.next=4,Yp(t,i,e,n,a.content);case 4:return s.abrupt("return",a.content);case 5:case"end":return s.stop()}},r)})),hm.apply(this,arguments)}function cD(r,t,e){return dm.apply(this,arguments)}function dm(){return dm=(0,Eu.default)(Pn.default.mark(function r(t,e,n){var a,i;return Pn.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return i=JSON.parse(new TextDecoder().decode(t)),i.loader=e.loader||Su,i.url=n.url,i.basePath=fD(i),s.next=6,Pw(i,e);case 6:return i.root=s.sent,i.type=er.TILES3D,i.lodMetricType=vn.GEOMETRIC_ERROR,i.lodMetricValue=((a=i.root)===null||a===void 0?void 0:a.lodMetricValue)||0,s.abrupt("return",i);case 11:case"end":return s.stop()}},r)})),dm.apply(this,arguments)}function hD(r,t,e){return pm.apply(this,arguments)}function pm(){return pm=(0,Eu.default)(Pn.default.mark(function r(t,e,n){var a,i;return Pn.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(a=e["3d-tiles"]||{},a.isTileset==="auto"?i=n.url&&n.url.indexOf(".json")!==-1:i=a.isTileset,!i){s.next=8;break}return s.next=5,cD(t,e,n);case 5:t=s.sent,s.next=11;break;case 8:return s.next=10,lD(t,e,n);case 10:t=s.sent;case 11:return s.abrupt("return",t);case 12:case"end":return s.stop()}},r)})),pm.apply(this,arguments)}function Iw(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function xa(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Iw(Object(e),!0).forEach(function(n){(0,Di.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):Iw(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function dD(r){var t=pD();return function(){var n=(0,mm.default)(r),a;if(t){var i=(0,mm.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,Uw.default)(this,a)}}function pD(){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}}var Rw=[0],mD={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:Su,onTilesetLoad:{type:"function",value:function(t){},compare:!1},onTileLoad:{type:"function",value:function(t){},compare:!1},onTileUnload:{type:"function",value:function(t){},compare:!1},onTileError:{type:"function",value:function(t,e,n){},compare:!1},_getMeshColor:{type:"function",value:function(t){return[255,255,255]},compare:!1}},wu=function(r){(0,Gw.default)(e,r);var t=dD(e);function e(){var n;(0,Lw.default)(this,e);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n=t.call.apply(t,[this].concat(i)),(0,Di.default)((0,Dw.default)(n),"state",void 0),n}return(0,kw.default)(e,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&Ht.log.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}},{key:"isLoaded",get:function(){var a=this.state.tileset3d;return a!==null&&a.isLoaded()}},{key:"shouldUpdateState",value:function(a){var i=a.changeFlags;return i.somethingChanged}},{key:"updateState",value:function(a){var i=a.props,o=a.oldProps,s=a.changeFlags;if(i.data&&i.data!==o.data&&this._loadTileset(i.data),s.viewportChanged){var u=this.state.activeViewports,f=Object.keys(u).length;f&&(this._updateTileset(u),this.state.lastUpdatedViewports=u,this.state.activeViewports={})}if(s.propsChanged){var l=this.state.layerMap;for(var c in l)l[c].needsUpdate=!0}}},{key:"activateViewport",value:function(a){var i=this.state,o=i.activeViewports,s=i.lastUpdatedViewports;this.internalState.viewport=a,o[a.id]=a;var u=s?.[a.id];(!u||!a.equals(u))&&(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}},{key:"getPickingInfo",value:function(a){var i=a.info,o=a.sourceLayer,s=this.state.layerMap,u=o&&o.id;if(u){var f=u.substring(this.id.length+1),l=f.substring(f.indexOf("-")+1);i.object=s[l]&&s[l].tile}return i}},{key:"filterSubLayer",value:function(a){var i=a.layer,o=a.viewport,s=i.props,u=s.tile,f=o.id;return u.selected&&u.viewportIds.includes(f)}},{key:"_updateAutoHighlight",value:function(a){a.sourceLayer&&a.sourceLayer.updateAutoHighlight(a)}},{key:"_loadTileset",value:function(){var n=(0,Fw.default)(vm.default.mark(function i(o){var s,u,f,l,c,h,d;return vm.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(s=this.props.loadOptions,u=s===void 0?{}:s,f=this.props.loader||this.props.loaders,Array.isArray(f)&&(f=f[0]),l={loadOptions:xa({},u)},!f.preload){v.next=10;break}return v.next=7,f.preload(o,u);case 7:c=v.sent,c.headers&&(l.loadOptions.fetch=xa(xa({},l.loadOptions.fetch),{},{headers:c.headers})),Object.assign(l,c);case 10:return v.next=12,Lr(o,f,l.loadOptions);case 12:h=v.sent,d=new nd(h,xa({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError},l)),this.setState({tileset3d:d,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(d);case 17:case"end":return v.stop()}},i,this)}));function a(i){return n.apply(this,arguments)}return a}()},{key:"_onTileLoad",value:function(a){var i=this.state.lastUpdatedViewports;this.props.onTileLoad(a),this._updateTileset(i),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(a){delete this.state.layerMap[a.id],this.props.onTileUnload(a)}},{key:"_updateTileset",value:function(a){var i=this;if(a){var o=this.state.tileset3d,s=this.context.timeline,u=Object.keys(a).length;!s||!u||!o||o.selectTiles(Object.values(a)).then(function(f){var l=i.state.frameNumber!==f;l&&i.setState({frameNumber:f})})}}},{key:"_getSubLayer",value:function(a,i){if(!a.content)return null;switch(a.type){case lt.POINTCLOUD:return this._makePointCloudLayer(a,i);case lt.SCENEGRAPH:return this._make3DModelLayer(a);case lt.MESH:return this._makeSimpleMeshLayer(a,i);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(a.content.type))}}},{key:"_makePointCloudLayer",value:function(a,i){var o=a.content,s=o.attributes,u=o.pointCount,f=o.constantRGBA,l=o.cartographicOrigin,c=o.modelMatrix,h=s.positions,d=s.normals,p=s.colors;if(!h)return null;var v=i&&i.props.data||{header:{vertexCount:u},attributes:{POSITION:h,NORMAL:d,COLOR_0:p}},y=this.props,A=y.pointSize,_=y.getPointColor,E=this.getSubLayerClass("pointcloud",jw.PointCloudLayer);return new E({pointSize:A},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(a.id),tile:a,data:v,coordinateSystem:Ht.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:l,modelMatrix:c,getColor:f||_,_offset:0})}},{key:"_make3DModelLayer",value:function(a){var i=a.content,o=i.gltf,s=i.instances,u=i.cartographicOrigin,f=i.modelMatrix,l=this.getSubLayerClass("scenegraph",Vw.ScenegraphLayer);return new l({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(a.id),tile:a,data:s||Rw,scenegraph:o,coordinateSystem:Ht.COORDINATE_SYSTEM.METER_OFFSETS,coordinateOrigin:u,modelMatrix:f,getTransformMatrix:function(h){return h.modelMatrix},getPosition:[0,0,0],_offset:0})}},{key:"_makeSimpleMeshLayer",value:function(a,i){var o=a.content,s=o.attributes,u=o.indices,f=o.modelMatrix,l=o.cartographicOrigin,c=o.coordinateSystem,h=c===void 0?Ht.COORDINATE_SYSTEM.METER_OFFSETS:c,d=o.material,p=o.featureIds,v=this.props._getMeshColor,y=i&&i.props.mesh||new Nw.Geometry({drawMode:4,attributes:vD(s),indices:u}),A=this.getSubLayerClass("mesh",Ss);return new A(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(a.id),tile:a,mesh:y,data:Rw,getColor:v(a),pbrMaterial:d,modelMatrix:f,coordinateOrigin:l,coordinateSystem:h,featureIds:p,_offset:0})}},{key:"renderLayers",value:function(){var a=this,i=this.state,o=i.tileset3d,s=i.layerMap;return o?o.tiles.map(function(u){var f=s[u.id]=s[u.id]||{tile:u},l=f.layer;return u.selected&&(l?f.needsUpdate&&(l=a._getSubLayer(u,l),f.needsUpdate=!1):l=a._getSubLayer(u)),f.layer=l,l}).filter(Boolean):null}}]),e}(Ht.CompositeLayer);(0,Di.default)(wu,"defaultProps",mD);(0,Di.default)(wu,"layerName","Tile3DLayer");function vD(r){var t={};return t.positions=xa(xa({},r.positions),{},{value:new Float32Array(r.positions.value)}),r.normals&&(t.normals=r.normals),r.texCoords&&(t.texCoords=r.texCoords),r.colors&&(t.colors=r.colors),r.uvRegions&&(t.uvRegions=r.uvRegions),t}var Em=m(lr()),uC=m(ge()),fC=m(V()),lC=m(z()),cC=m(Br()),hC=m(Ie()),dC=m(Fe()),Sm=m(Be()),ji=m(W()),Fu=m(Ur()),wm=m(rs()),pC=m(Ur());var nC=m(K()),aC=m(W()),xm=m(J());var Ww=m(ge());var zw=m(ge());function gD(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=yD(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
182
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function yD(r,t){if(r){if(typeof r=="string")return Hw(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Hw(r,t)}}function Hw(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var AD=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 gm(r){return r>>1^-(r&1)}function bD(r){var t=0,e={},n=gD(AD),a;try{for(n.s();!(a=n.n()).done;){var i=(0,zw.default)(a.value,2),o=i[0],s=i[1],u=s===8?r.getFloat64:r.getFloat32;e[o]=u.call(r,t,!0),t+=s}}catch(f){n.e(f)}finally{n.f()}return{header:e,headerEndPosition:t}}function _D(r,t){var e=t,n=3,a=r.getUint32(e,!0),i=new Uint16Array(a*n);e+=Uint32Array.BYTES_PER_ELEMENT;for(var o=Uint16Array.BYTES_PER_ELEMENT,s=a*o,u=e,f=u+s,l=f+s,c=0,h=0,d=0,p=0;p<a;p++)c+=gm(r.getUint16(u+o*p,!0)),h+=gm(r.getUint16(f+o*p,!0)),d+=gm(r.getUint16(l+o*p,!0)),i[p]=c,i[p+a]=h,i[p+a*2]=d;return e+=s*3,{vertexData:i,vertexDataEndPosition:e}}function Gi(r,t,e,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i;if(n===2?i=new Uint16Array(r,t,e):i=new Uint32Array(r,t,e),!a)return i;for(var o=0,s=0;s<i.length;++s){var u=i[s];i[s]=o-u,u===0&&++o}return i}function TD(r,t,e){var n=e,a=3,i=t.length/a,o=i>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%o!==0&&(n+=o-n%o);var s=r.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var u=s*3,f=Gi(r.buffer,n,u,o);return n+=u*o,{triangleIndicesEndPosition:n,triangleIndices:f}}function xD(r,t,e){var n=e,a=3,i=t.length/a,o=i>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,s=r.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var u=Gi(r.buffer,n,s,o,!1);n+=s*o;var f=r.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var l=Gi(r.buffer,n,f,o,!1);n+=f*o;var c=r.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var h=Gi(r.buffer,n,c,o,!1);n+=c*o;var d=r.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var p=Gi(r.buffer,n,d,o,!1);return n+=d*o,{edgeIndicesEndPosition:n,westIndices:u,southIndices:l,eastIndices:h,northIndices:p}}function ED(r){return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}function SD(r){return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)}function wD(r,t){var e={};if(r.byteLength<=t)return{extensions:e,extensionsEndPosition:t};for(var n=t;n<r.byteLength;){var a=r.getUint8(n,!0);n+=Uint8Array.BYTES_PER_ELEMENT;var i=r.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var o=new DataView(r.buffer,n,i);switch(a){case 1:{e.vertexNormals=ED(o);break}case 2:{e.waterMask=SD(o);break}default:}n+=i}return{extensions:e,extensionsEndPosition:n}}var In={header:0,vertices:1,triangleIndices:2,edgeIndices:3,extensions:4},CD={maxDecodingStep:In.extensions};function ym(r,t){var e=Object.assign({},CD,t),n=new DataView(r),a=bD(n),i=a.header,o=a.headerEndPosition;if(e.maxDecodingStep<In.vertices)return{header:i};var s=_D(n,o),u=s.vertexData,f=s.vertexDataEndPosition;if(e.maxDecodingStep<In.triangleIndices)return{header:i,vertexData:u};var l=TD(n,u,f),c=l.triangleIndices,h=l.triangleIndicesEndPosition;if(e.maxDecodingStep<In.edgeIndices)return{header:i,vertexData:u,triangleIndices:c};var d=xD(n,u,h),p=d.westIndices,v=d.southIndices,y=d.eastIndices,A=d.northIndices,_=d.edgeIndicesEndPosition;if(e.maxDecodingStep<In.extensions)return{header:i,vertexData:u,triangleIndices:c,westIndices:p,northIndices:A,eastIndices:y,southIndices:v};var E=wD(n,_),x=E.extensions;return{header:i,vertexData:u,triangleIndices:c,westIndices:p,northIndices:A,eastIndices:y,southIndices:v,extensions:x}}var Ui=m(lr());function Cu(r,t,e,n){for(var a=n?MD(n,r.POSITION.value):BD(t),i=new r.POSITION.value.constructor(a.length*6),o=new r.TEXCOORD_0.value.constructor(a.length*4),s=new t.constructor(a.length*6),u=0;u<a.length;u++){var f=a[u];OD({edge:f,edgeIndex:u,attributes:r,skirtHeight:e,newPosition:i,newTexcoord0:o,newTriangles:s})}r.POSITION.value=Ga(r.POSITION.value,i),r.TEXCOORD_0.value=Ga(r.TEXCOORD_0.value,o);var l=t instanceof Array?t.concat(s):Ga(t,s);return{attributes:r,triangles:l}}function BD(r){for(var t=[],e=0;e<r.length;e+=3)t.push([r[e],r[e+1]]),t.push([r[e+1],r[e+2]]),t.push([r[e+2],r[e]]);t.sort(function(s,u){return Math.min.apply(Math,(0,Ui.default)(s))-Math.min.apply(Math,(0,Ui.default)(u))||Math.max.apply(Math,(0,Ui.default)(s))-Math.max.apply(Math,(0,Ui.default)(u))});for(var n=[],a=0;a<t.length;){var i,o;t[a][0]===((i=t[a+1])===null||i===void 0?void 0:i[1])&&t[a][1]===((o=t[a+1])===null||o===void 0?void 0:o[0])?a+=2:(n.push(t[a]),a++)}return n}function MD(r,t){r.westIndices.sort(function(o,s){return t[3*o+1]-t[3*s+1]}),r.eastIndices.sort(function(o,s){return t[3*s+1]-t[3*o+1]}),r.southIndices.sort(function(o,s){return t[3*s]-t[3*o]}),r.northIndices.sort(function(o,s){return t[3*o]-t[3*s]});var e=[];for(var n in r)for(var a=r[n],i=0;i<a.length-1;i++)e.push([a[i],a[i+1]]);return e}function OD(r){var t=r.edge,e=r.edgeIndex,n=r.attributes,a=r.skirtHeight,i=r.newPosition,o=r.newTexcoord0,s=r.newTriangles,u=n.POSITION.value.length,f=e*2,l=e*2+1;i.set(n.POSITION.value.subarray(t[0]*3,t[0]*3+3),f*3),i[f*3+2]=i[f*3+2]-a,i.set(n.POSITION.value.subarray(t[1]*3,t[1]*3+3),l*3),i[l*3+2]=i[l*3+2]-a,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),l*2);var c=e*2*3;s[c]=t[0],s[c+1]=u/3+l,s[c+2]=t[1],s[c+3]=u/3+l,s[c+4]=t[0],s[c+5]=u/3+f}function PD(r,t,e){for(var n=t.minHeight,a=t.maxHeight,i=e||[0,0,1,1],o=(0,Ww.default)(i,4),s=o[0],u=o[1],f=o[2],l=o[3],c=f-s,h=l-u,d=a-n,p=r.length/3,v=new Float32Array(p*3),y=new Float32Array(p*2),A=0;A<p;A++){var _=r[A]/32767,E=r[A+p]/32767,x=r[A+p*2]/32767;v[3*A+0]=_*c+s,v[3*A+1]=E*h+u,v[3*A+2]=x*d+n,y[2*A+0]=_,y[2*A+1]=E}return{POSITION:{value:v,size:3},TEXCOORD_0:{value:y,size:2}}}function ID(r,t){if(!r)return null;var e=t.bounds,n=ym(r,In.triangleIndices),a=n.header,i=n.vertexData,o=n.triangleIndices,s=n.westIndices,u=n.northIndices,f=n.eastIndices,l=n.southIndices,c=o,h=PD(i,a,e),d=bn(h);if(t.skirtHeight){var p=Cu(h,c,t.skirtHeight,{westIndices:s,northIndices:u,eastIndices:f,southIndices:l}),v=p.attributes,y=p.triangles;h=v,c=y}return{loaderData:{header:{}},header:{vertexCount:c.length,boundingBox:d},mode:4,indices:{value:c,size:1},attributes:h}}function Bu(r,t){return ID(r,t["quantized-mesh"])}var $w=m(W()),Zw=m(K()),eC=m(ge()),bm=m(J());var Ni=class{constructor(t=257){this.gridSize=t;let e=t-1;if(e&e-1)throw new Error(`Expected grid size to be 2^n+1, got ${t}.`);this.numTriangles=e*e*2-2,this.numParentTriangles=this.numTriangles-e*e,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(this.numTriangles*4);for(let n=0;n<this.numTriangles;n++){let a=n+2,i=0,o=0,s=0,u=0,f=0,l=0;for(a&1?s=u=f=e:i=o=l=e;(a>>=1)>1;){let h=i+s>>1,d=o+u>>1;a&1?(s=i,u=o,i=f,o=l):(i=s,o=u,s=f,u=l),f=h,l=d}let c=n*4;this.coords[c+0]=i,this.coords[c+1]=o,this.coords[c+2]=s,this.coords[c+3]=u}}createTile(t){return new Am(t,this)}},Am=class{constructor(t,e){let n=e.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=e,this.errors=new Float32Array(t.length),this.update()}update(){let{numTriangles:t,numParentTriangles:e,coords:n,gridSize:a}=this.martini,{terrain:i,errors:o}=this;for(let s=t-1;s>=0;s--){let u=s*4,f=n[u+0],l=n[u+1],c=n[u+2],h=n[u+3],d=f+c>>1,p=l+h>>1,v=d+p-l,y=p+f-d,A=(i[l*a+f]+i[h*a+c])/2,_=p*a+d,E=Math.abs(A-i[_]);if(o[_]=Math.max(o[_],E),s<e){let x=(l+y>>1)*a+(f+v>>1),C=(h+y>>1)*a+(c+v>>1);o[_]=Math.max(o[_],o[x],o[C])}}}getMesh(t=0){let{gridSize:e,indices:n}=this.martini,{errors:a}=this,i=0,o=0,s=e-1;n.fill(0);function u(d,p,v,y,A,_){let E=d+v>>1,x=p+y>>1;Math.abs(d-A)+Math.abs(p-_)>1&&a[x*e+E]>t?(u(A,_,d,p,E,x),u(v,y,A,_,E,x)):(n[p*e+d]=n[p*e+d]||++i,n[y*e+v]=n[y*e+v]||++i,n[_*e+A]=n[_*e+A]||++i,o++)}u(0,0,s,s,s,0),u(s,s,0,0,0,s);let f=new Uint16Array(i*2),l=new Uint32Array(o*3),c=0;function h(d,p,v,y,A,_){let E=d+v>>1,x=p+y>>1;if(Math.abs(d-A)+Math.abs(p-_)>1&&a[x*e+E]>t)h(A,_,d,p,E,x),h(v,y,A,_,E,x);else{let C=n[p*e+d]-1,P=n[y*e+v]-1,L=n[_*e+A]-1;f[2*C]=d,f[2*C+1]=p,f[2*P]=v,f[2*P+1]=y,f[2*L]=A,f[2*L+1]=_,l[c++]=C,l[c++]=P,l[c++]=L}}return h(0,0,s,s,s,0),h(s,s,0,0,0,s),{vertices:f,triangles:l}}};var Jw=m(V()),qw=m(z()),Xw=function(){function r(t,e){(0,Jw.default)(this,r);var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;this.data=t,this.width=e,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;var a=e-1,i=n-1,o=this._addPoint(0,0),s=this._addPoint(a,0),u=this._addPoint(0,i),f=this._addPoint(a,i),l=this._addTriangle(f,o,u,-1,-1,-1);this._addTriangle(o,f,s,l,-1,-1),this._flush()}return(0,qw.default)(r,[{key:"run",value:function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.getMaxError()>e;)this.refine()}},{key:"refine",value:function(){this._step(),this._flush()}},{key:"getMaxError",value:function(){return this._errors[0]}},{key:"getRMSD",value:function(){return this._rmsSum>0?Math.sqrt(this._rmsSum/(this.width*this.height)):0}},{key:"heightAt",value:function(e,n){return this.data[this.width*n+e]}},{key:"_flush",value:function(){for(var e=this.coords,n=0;n<this._pendingLen;n++){var a=this._pending[n],i=2*this.triangles[a*3+0],o=2*this.triangles[a*3+1],s=2*this.triangles[a*3+2];this._findCandidate(e[i],e[i+1],e[o],e[o+1],e[s],e[s+1],a)}this._pendingLen=0}},{key:"_findCandidate",value:function(e,n,a,i,o,s,u){for(var f=Math.min(e,a,o),l=Math.min(n,i,s),c=Math.max(e,a,o),h=Math.max(n,i,s),d=Rn(a,i,o,s,f,l),p=Rn(o,s,e,n,f,l),v=Rn(e,n,a,i,f,l),y=i-n,A=e-a,_=s-i,E=a-o,x=n-s,C=o-e,P=Rn(e,n,a,i,o,s),L=this.heightAt(e,n)/P,M=this.heightAt(a,i)/P,S=this.heightAt(o,s)/P,b=0,R=0,F=0,N=0,k=l;k<=h;k++){var B=0;d<0&&_!==0&&(B=Math.max(B,Math.floor(-d/_))),p<0&&x!==0&&(B=Math.max(B,Math.floor(-p/x))),v<0&&y!==0&&(B=Math.max(B,Math.floor(-v/y)));for(var O=d+_*B,I=p+x*B,U=v+y*B,D=!1,j=f+B;j<=c;j++){if(O>=0&&I>=0&&U>=0){D=!0;var X=L*O+M*I+S*U,te=Math.abs(X-this.heightAt(j,k));N+=te*te,te>b&&(b=te,R=j,F=k)}else if(D)break;O+=_,I+=x,U+=y}d+=E,p+=C,v+=A}(R===e&&F===n||R===a&&F===i||R===o&&F===s)&&(b=0),this._candidates[2*u]=R,this._candidates[2*u+1]=F,this._rms[u]=N,this._queuePush(u,b,N)}},{key:"_step",value:function(){var e=this._queuePop(),n=e*3+0,a=e*3+1,i=e*3+2,o=this.triangles[n],s=this.triangles[a],u=this.triangles[i],f=this.coords[2*o],l=this.coords[2*o+1],c=this.coords[2*s],h=this.coords[2*s+1],d=this.coords[2*u],p=this.coords[2*u+1],v=this._candidates[2*e],y=this._candidates[2*e+1],A=this._addPoint(v,y);if(Rn(f,l,c,h,v,y)===0)this._handleCollinear(A,n);else if(Rn(c,h,d,p,v,y)===0)this._handleCollinear(A,a);else if(Rn(d,p,f,l,v,y)===0)this._handleCollinear(A,i);else{var _=this._halfedges[n],E=this._halfedges[a],x=this._halfedges[i],C=this._addTriangle(o,s,A,_,-1,-1,n),P=this._addTriangle(s,u,A,E,-1,C+1),L=this._addTriangle(u,o,A,x,C+2,P+1);this._legalize(C),this._legalize(P),this._legalize(L)}}},{key:"_addPoint",value:function(e,n){var a=this.coords.length>>1;return this.coords.push(e,n),a}},{key:"_addTriangle",value:function(e,n,a,i,o,s){var u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this.triangles.length,f=u/3;return this.triangles[u+0]=e,this.triangles[u+1]=n,this.triangles[u+2]=a,this._halfedges[u+0]=i,this._halfedges[u+1]=o,this._halfedges[u+2]=s,i>=0&&(this._halfedges[i]=u+0),o>=0&&(this._halfedges[o]=u+1),s>=0&&(this._halfedges[s]=u+2),this._candidates[2*f+0]=0,this._candidates[2*f+1]=0,this._queueIndices[f]=-1,this._rms[f]=0,this._pending[this._pendingLen++]=f,u}},{key:"_legalize",value:function(e){var n=this._halfedges[e];if(!(n<0)){var a=e-e%3,i=n-n%3,o=a+(e+1)%3,s=a+(e+2)%3,u=i+(n+2)%3,f=i+(n+1)%3,l=this.triangles[s],c=this.triangles[e],h=this.triangles[o],d=this.triangles[u],p=this.coords;if(RD(p[2*l],p[2*l+1],p[2*c],p[2*c+1],p[2*h],p[2*h+1],p[2*d],p[2*d+1])){var v=this._halfedges[o],y=this._halfedges[s],A=this._halfedges[u],_=this._halfedges[f];this._queueRemove(a/3),this._queueRemove(i/3);var E=this._addTriangle(l,d,h,-1,A,v,a),x=this._addTriangle(d,l,c,E,y,_,i);this._legalize(E+1),this._legalize(x+2)}}}},{key:"_handleCollinear",value:function(e,n){var a=n-n%3,i=a+(n+1)%3,o=a+(n+2)%3,s=this.triangles[o],u=this.triangles[n],f=this.triangles[i],l=this._halfedges[i],c=this._halfedges[o],h=this._halfedges[n];if(h<0){var d=this._addTriangle(e,s,u,-1,c,-1,a),p=this._addTriangle(s,e,f,d,-1,l);this._legalize(d+1),this._legalize(p+2);return}var v=h-h%3,y=v+(h+2)%3,A=v+(h+1)%3,_=this.triangles[y],E=this._halfedges[y],x=this._halfedges[A];this._queueRemove(v/3);var C=this._addTriangle(s,u,e,c,-1,-1,a),P=this._addTriangle(u,_,e,x,-1,C+1,v),L=this._addTriangle(_,f,e,E,-1,P+1),M=this._addTriangle(f,s,e,l,C+2,L+1);this._legalize(C),this._legalize(P),this._legalize(L),this._legalize(M)}},{key:"_queuePush",value:function(e,n,a){var i=this._queue.length;this._queueIndices[e]=i,this._queue.push(e),this._errors.push(n),this._rmsSum+=a,this._queueUp(i)}},{key:"_queuePop",value:function(){var e=this._queue.length-1;return this._queueSwap(0,e),this._queueDown(0,e),this._queuePopBack()}},{key:"_queuePopBack",value:function(){var e=this._queue.pop();return this._errors.pop(),this._rmsSum-=this._rms[e],this._queueIndices[e]=-1,e}},{key:"_queueRemove",value:function(e){var n=this._queueIndices[e];if(n<0){var a=this._pending.indexOf(e);if(a!==-1)this._pending[a]=this._pending[--this._pendingLen];else throw new Error("Broken triangulation (something went wrong).");return}var i=this._queue.length-1;i!==n&&(this._queueSwap(n,i),this._queueDown(n,i)||this._queueUp(n)),this._queuePopBack()}},{key:"_queueLess",value:function(e,n){return this._errors[e]>this._errors[n]}},{key:"_queueSwap",value:function(e,n){var a=this._queue[e],i=this._queue[n];this._queue[e]=i,this._queue[n]=a,this._queueIndices[a]=n,this._queueIndices[i]=e;var o=this._errors[e];this._errors[e]=this._errors[n],this._errors[n]=o}},{key:"_queueUp",value:function(e){for(var n=e;;){var a=n-1>>1;if(a===n||!this._queueLess(n,a))break;this._queueSwap(a,n),n=a}}},{key:"_queueDown",value:function(e,n){for(var a=e;;){var i=2*a+1;if(i>=n||i<0)break;var o=i+1,s=i;if(o<n&&this._queueLess(o,i)&&(s=o),!this._queueLess(s,a))break;this._queueSwap(a,s),a=s}return a>e}}]),r}();function Rn(r,t,e,n,a,i){return(e-a)*(t-i)-(n-i)*(r-a)}function RD(r,t,e,n,a,i,o,s){var u=r-o,f=t-s,l=e-o,c=n-s,h=a-o,d=i-s,p=u*u+f*f,v=l*l+c*c,y=h*h+d*d;return u*(c*y-v*d)-f*(l*y-v*h)+p*(l*d-c*h)<0}function Kw(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function Mu(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Kw(Object(e),!0).forEach(function(n){(0,$w.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):Kw(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function Ou(r,t,e,n,a){for(var i=n.rScaler,o=n.bScaler,s=n.gScaler,u=n.offset,f=new Float32Array((t+1)*(e+1)),l=0,c=0;c<e;c++)for(var h=0;h<t;h++,l++){var d=l*4,p=r[d+0],v=r[d+1],y=r[d+2];f[l+c]=p*i+v*s+y*o+u}if(a==="martini"){for(var A=(t+1)*t,_=0;_<t;_++,A++)f[A]=f[A-t-1];for(var E=e,x=0;x<e+1;x++,E+=e+1)f[E]=f[E-1]}return f}function FD(r,t,e,n,a){for(var i=e+1,o=r.length/2,s=new Float32Array(o*3),u=new Float32Array(o*2),f=a||[0,0,e,n],l=(0,eC.default)(f,4),c=l[0],h=l[1],d=l[2],p=l[3],v=(d-c)/e,y=(p-h)/n,A=0;A<o;A++){var _=r[A*2],E=r[A*2+1],x=E*i+_;s[3*A+0]=_*v+c,s[3*A+1]=-E*y+p,s[3*A+2]=t[x],u[2*A+0]=_/e,u[2*A+1]=E/n}return{POSITION:{value:s,size:3},TEXCOORD_0:{value:u,size:2}}}function LD(r,t){if(r===null)return null;var e=t.meshMaxError,n=t.bounds,a=t.elevationDecoder,i=r.data,o=r.width,s=r.height,u,f;switch(t.tesselator){case"martini":u=Ou(i,o,s,a,t.tesselator),f=Yw(e,o,u);break;case"delatin":u=Ou(i,o,s,a,t.tesselator),f=Qw(e,o,s,u);break;default:o===s&&!(s&o-1)?(u=Ou(i,o,s,a,"martini"),f=Yw(e,o,u)):(u=Ou(i,o,s,a,"delatin"),f=Qw(e,o,s,u));break}var l=f,c=l.vertices,h=f,d=h.triangles,p=FD(c,u,o,s,n),v=bn(p);if(t.skirtHeight){var y=Cu(p,d,t.skirtHeight),A=y.attributes,_=y.triangles;p=A,d=_}return{loaderData:{header:{}},header:{vertexCount:d.length,boundingBox:v},mode:4,indices:{value:Uint32Array.from(d),size:1},attributes:p}}function Yw(r,t,e){var n=t+1,a=new Ni(n),i=a.createTile(e),o=i.getMesh(r),s=o.vertices,u=o.triangles;return{vertices:s,triangles:u}}function Qw(r,t,e,n){var a=new Xw(n,t+1,e+1);a.run(r);var i=a.coords,o=a.triangles,s=i;return{vertices:s,triangles:o}}function Tm(r,t,e){return _m.apply(this,arguments)}function _m(){return _m=(0,Zw.default)(bm.default.mark(function r(t,e,n){var a,i;return bm.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return a=Mu(Mu({},e),{},{mimeType:"application/x.image",image:Mu(Mu({},e.image),{},{type:"data"})}),s.next=3,n.parse(t,a);case 3:return i=s.sent,s.abrupt("return",LD(i,e.terrain));case 5:case"end":return s.stop()}},r)})),_m.apply(this,arguments)}var Pu="3.3.0-alpha.10";var Iu={name:"Terrain",id:"terrain",module:"terrain",version:Pu,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 rC={name:"Quantized Mesh",id:"quantized-mesh",module:"terrain",version:Pu,worker:!0,extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{bounds:[0,0,1,1],skirtHeight:null}}};function tC(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function Ru(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?tC(Object(e),!0).forEach(function(n){(0,aC.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):tC(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var fre=Ru(Ru({},Iu),{},{parse:Tm});var lre=Ru(Ru({},rC),{},{parseSync:Bu,parse:function(){var r=(0,nC.default)(xm.default.mark(function e(n,a){return xm.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Bu(n,a));case 1:case"end":return o.stop()}},e)}));function t(e,n){return r.apply(this,arguments)}return t}()});function kD(r){var t=DD();return function(){var n=(0,Sm.default)(r),a;if(t){var i=(0,Sm.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,dC.default)(this,a)}}function DD(){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 iC(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function zt(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?iC(Object(e),!0).forEach(function(n){(0,ji.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):iC(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var oC=[1],GD=zt(zt({},nt.defaultProps),{},{elevationData:Qn,texture:zt(zt({},Qn),{},{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:{type:"string",value:null},wireframe:!1,material:!0,loaders:[Iu]});function sC(r){return Array.isArray(r)?r.join(";"):r||""}var Lu=function(r){(0,hC.default)(e,r);var t=kD(e);function e(){var n;(0,fC.default)(this,e);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n=t.call.apply(t,[this].concat(i)),(0,ji.default)((0,cC.default)(n),"state",void 0),n}return(0,lC.default)(e,[{key:"updateState",value:function(a){var i=a.props,o=a.oldProps,s=i.elevationData!==o.elevationData;if(s){var u=i.elevationData,f=u&&(Array.isArray(u)||u.includes("{x}")&&u.includes("{y}"));this.setState({isTiled:f})}var l=s||i.meshMaxError!==o.meshMaxError||i.elevationDecoder!==o.elevationDecoder||i.bounds!==o.bounds;if(!this.state.isTiled&&l){var c=this.loadTerrain(i);this.setState({terrain:c})}i.workerUrl&&Fu.log.removed("workerUrl","loadOptions.terrain.workerUrl")()}},{key:"loadTerrain",value:function(a){var i,o=a.elevationData,s=a.bounds,u=a.elevationDecoder,f=a.meshMaxError,l=a.signal;if(!o)return null;var c=this.getLoadOptions();c=zt(zt({},c),{},{terrain:zt(zt({skirtHeight:this.state.isTiled?f*2:0},(i=c)===null||i===void 0?void 0:i.terrain),{},{bounds:s,meshMaxError:f,elevationDecoder:u})});var h=this.props.fetch;return h(o,{propName:"elevationData",layer:this,loadOptions:c,signal:l})}},{key:"getTiledTerrainData",value:function(a){var i=this.props,o=i.elevationData,s=i.fetch,u=i.texture,f=i.elevationDecoder,l=i.meshMaxError,c=this.context.viewport,h=Jr(o,a),d=u&&Jr(u,a),p=a.signal,v=[0,0],y=[0,0];if(c.isGeospatial){var A=a.bbox;v=c.projectFlat([A.west,A.south]),y=c.projectFlat([A.east,A.north])}else{var _=a.bbox;v=[_.left,_.bottom],y=[_.right,_.top]}var E=[v[0],v[1],y[0],y[1]],x=this.loadTerrain({elevationData:h,bounds:E,elevationDecoder:f,meshMaxError:l,signal:p}),C=d?s(d,{propName:"texture",layer:this,loaders:[],signal:p}).catch(function(P){return null}):Promise.resolve(null);return Promise.all([x,C])}},{key:"renderSubLayers",value:function(a){var i=this.getSubLayerClass("mesh",wm.SimpleMeshLayer),o=this.props,s=o.color,u=o.wireframe,f=o.material,l=a.data;if(!l)return null;var c=(0,uC.default)(l,2),h=c[0],d=c[1];return new i(a,{data:oC,mesh:h,texture:d,_instanced:!1,coordinateSystem:pC.COORDINATE_SYSTEM.CARTESIAN,getPosition:function(v){return[0,0,0]},getColor:s,wireframe:u,material:f})}},{key:"onViewportLoad",value:function(a){if(a){var i=this.state.zRange,o=a.map(function(f){return f.content}).filter(Boolean).map(function(f){var l=f[0].header.boundingBox;return l.map(function(c){return c[2]})});if(o.length!==0){var s=Math.min.apply(Math,(0,Em.default)(o.map(function(f){return f[0]}))),u=Math.max.apply(Math,(0,Em.default)(o.map(function(f){return f[1]})));(!i||s<i[0]||u>i[1])&&this.setState({zRange:[s,u]})}}}},{key:"renderLayers",value:function(){var a=this.props,i=a.color,o=a.material,s=a.elevationData,u=a.texture,f=a.wireframe,l=a.meshMaxError,c=a.elevationDecoder,h=a.tileSize,d=a.maxZoom,p=a.minZoom,v=a.extent,y=a.maxRequests,A=a.onTileLoad,_=a.onTileUnload,E=a.onTileError,x=a.maxCacheSize,C=a.maxCacheByteSize,P=a.refinementStrategy;if(this.state.isTiled)return new nt(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:sC(s),texture:sC(u),meshMaxError:l,elevationDecoder:c}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:h,maxZoom:d,minZoom:p,extent:v,maxRequests:y,onTileLoad:A,onTileUnload:_,onTileError:E,maxCacheSize:x,maxCacheByteSize:C,refinementStrategy:P});var L=this.getSubLayerClass("mesh",wm.SimpleMeshLayer);return new L(this.getSubLayerProps({id:"mesh"}),{data:oC,mesh:this.state.terrain,texture:u,_instanced:!1,getPosition:function(S){return[0,0,0]},getColor:i,material:o,wireframe:f})}}]),e}(Fu.CompositeLayer);(0,ji.default)(Lu,"defaultProps",GD);(0,ji.default)(Lu,"layerName","TerrainLayer");var GB=m(lr()),UB=m(K()),NB=m(V()),jB=m(z()),Jt=m($n()),VB=m(Ie()),HB=m(Fe()),et=m(Be()),qu=m(W()),Qm=m(J()),Xu=m(Ur()),$m=m(Dr()),zB=m(vC());var TB=m(K()),xB=m(W()),Wm=m(J());var AB=m(ge());var PC=m(W());var bC=m(V()),_C=m(z());function Cm(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=gC(r,e);return n!==t?(UD(r,e),!0):!1}function gC(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Math.sign(vt(r,t))}function vt(r){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t.start,n=e===void 0?0:e,a=t.end,i=a===void 0?r.length:a,o=t.size||2,s=0,u=n,f=i-o;u<i;u+=o)s+=(r[u]-r[f])*(r[u+1]+r[f+1]),f=u;return s/2}function Bm(r,t){for(var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=e.start,a=n===void 0?0:n,i=e.end,o=i===void 0?r.length:i,s=e.size,u=s===void 0?2:s,f=e.isClosed,l=(o-a)/u,c=0;c<l-1;++c)t(r[a+c*u],r[a+c*u+1],r[a+(c+1)*u],r[a+(c+1)*u+1],c,c+1);var h=a+(l-1)*u,d=f||We(r[a],r[h])&&We(r[a+1],r[h+1]);d||t(r[h],r[h+1],r[a],r[a+1],l-1,0)}function UD(r,t){for(var e=t.start,n=e===void 0?0:e,a=t.end,i=a===void 0?r.length:a,o=t.size,s=o===void 0?2:o,u=(i-n)/s,f=Math.floor(u/2),l=0;l<f;++l)for(var c=n+l*s,h=n+(u-1-l)*s,d=0;d<s;++d){var p=r[c+d];r[c+d]=r[h+d],r[h+d]=p}}function yC(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=ND(r,e);return n!==t?(r.reverse(),!0):!1}function ND(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Math.sign(Mm(r,t))}function Mm(r){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t.start,n=e===void 0?0:e,a=t.end,i=a===void 0?r.length:a,o=0,s=n,u=i-1;s<i;++s)o+=(r[s][0]-r[u][0])*(r[s][1]+r[u][1]),u=s;return o/2}function AC(r,t){for(var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=e.start,a=n===void 0?0:n,i=e.end,o=i===void 0?r.length:i,s=e.isClosed,u=a;u<o-1;++u)t(r[u],r[u+1],u,u+1);var f=s||We(r[o-1],r[0]);f||t(r[o-1],r[0],o-1,0)}var TC=function(){function r(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,bC.default)(this,r),g(this,"points",void 0),g(this,"isFlatArray",void 0),g(this,"options",void 0),this.points=t,this.isFlatArray=!nr(t[0]),this.options={start:e.start||0,end:e.end||t.length,size:e.size||2,isClosed:e.isClosed},Object.freeze(this)}return(0,_C.default)(r,[{key:"getSignedArea",value:function(){return this.isFlatArray?vt(this.points,this.options):Mm(this.points,this.options)}},{key:"getArea",value:function(){return Math.abs(this.getSignedArea())}},{key:"getWindingDirection",value:function(){return Math.sign(this.getSignedArea())}},{key:"forEachSegment",value:function(e){this.isFlatArray?Bm(this.points,function(n,a,i,o,s,u){e([n,a],[i,o],s,u)},this.options):AC(this.points,e,this.options)}},{key:"modifyWindingDirection",value:function(e){return this.isFlatArray?Cm(this.points,e,this.options):yC(this.points,e,this.options)}}]),r}();function Im(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2,n=arguments.length>3?arguments[3]:void 0,a=t&&t.length,i=a?t[0]*e:r.length,o=EC(r,0,i,e,!0,n&&n[0]),s=[];if(!o||o.next===o.prev)return s;var u,f,l,c,h,d,p;if(a&&(o=WD(r,t,o,e,n)),r.length>80*e){c=f=r[0],h=l=r[1];for(var v=e;v<i;v+=e)d=r[v],p=r[v+1],d<c&&(c=d),p<h&&(h=p),d>f&&(f=d),p>l&&(l=p);u=Math.max(f-c,l-h),u=u!==0?1/u:0}return Vi(o,s,e,c,h,u),s}function EC(r,t,e,n,a,i){var o,s;if(i===void 0&&(i=vt(r,{start:t,end:e,size:n})),a===i<0)for(o=t;o<e;o+=n)s=xC(o,r[o],r[o+1],s);else for(o=e-n;o>=t;o-=n)s=xC(o,r[o],r[o+1],s);return s&&Gu(s,s.next)&&(zi(s),s=s.next),s}function Wt(r,t){if(!r)return r;t||(t=r);var e=r,n;do if(n=!1,!e.steiner&&(Gu(e,e.next)||Oe(e.prev,e,e.next)===0)){if(zi(e),e=t=e.prev,e===e.next)break;n=!0}else e=e.next;while(n||e!==t);return t}function Vi(r,t,e,n,a,i,o){if(r){!o&&i&&YD(r,n,a,i);for(var s=r,u,f;r.prev!==r.next;){if(u=r.prev,f=r.next,i?VD(r,n,a,i):jD(r)){t.push(u.i/e),t.push(r.i/e),t.push(f.i/e),zi(r),r=f.next,s=f.next;continue}if(r=f,r===s){o?o===1?(r=HD(Wt(r),t,e),Vi(r,t,e,n,a,i,2)):o===2&&zD(r,t,e,n,a,i):Vi(Wt(r),t,e,n,a,i,1);break}}}}function jD(r){var t=r.prev,e=r,n=r.next;if(Oe(t,e,n)>=0)return!1;for(var a=r.next.next;a!==r.prev;){if(Ea(t.x,t.y,e.x,e.y,n.x,n.y,a.x,a.y)&&Oe(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function VD(r,t,e,n){var a=r.prev,i=r,o=r.next;if(Oe(a,i,o)>=0)return!1;for(var s=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,u=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,f=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,c=Om(s,u,t,e,n),h=Om(f,l,t,e,n),d=r.prevZ,p=r.nextZ;d&&d.z>=c&&p&&p.z<=h;){if(d!==r.prev&&d!==r.next&&Ea(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&Oe(d.prev,d,d.next)>=0||(d=d.prevZ,p!==r.prev&&p!==r.next&&Ea(a.x,a.y,i.x,i.y,o.x,o.y,p.x,p.y)&&Oe(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;d&&d.z>=c;){if(d!==r.prev&&d!==r.next&&Ea(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&Oe(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==r.prev&&p!==r.next&&Ea(a.x,a.y,i.x,i.y,o.x,o.y,p.x,p.y)&&Oe(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function HD(r,t,e){var n=r;do{var a=n.prev,i=n.next.next;!Gu(a,i)&&SC(a,n,n.next,i)&&Hi(a,i)&&Hi(i,a)&&(t.push(a.i/e),t.push(n.i/e),t.push(i.i/e),zi(n),zi(n.next),n=r=i),n=n.next}while(n!==r);return Wt(n)}function zD(r,t,e,n,a,i){var o=r;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&ZD(o,s)){var u=wC(o,s);o=Wt(o,o.next),u=Wt(u,u.next),Vi(o,t,e,n,a,i),Vi(u,t,e,n,a,i);return}s=s.next}o=o.next}while(o!==r)}function WD(r,t,e,n,a){var i=[],o,s,u,f,l;for(o=0,s=t.length;o<s;o++)u=t[o]*n,f=o<s-1?t[o+1]*n:r.length,l=EC(r,u,f,n,!1,a&&a[o+1]),l===l.next&&(l.steiner=!0),i.push($D(l));for(i.sort(JD),o=0;o<i.length;o++)qD(i[o],e),e=Wt(e,e.next);return e}function JD(r,t){return r.x-t.x}function qD(r,t){if(t=XD(r,t),t){var e=wC(t,r);Wt(t,t.next),Wt(e,e.next)}}function XD(r,t){var e=t,n=r.x,a=r.y,i=-1/0,o;do{if(a<=e.y&&a>=e.next.y&&e.next.y!==e.y){var s=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(s<=n&&s>i){if(i=s,s===n){if(a===e.y)return e;if(a===e.next.y)return e.next}o=e.x<e.next.x?e:e.next}}e=e.next}while(e!==t);if(!o)return null;if(n===i)return o;var u=o,f=o.x,l=o.y,c=1/0,h;e=o;do n>=e.x&&e.x>=f&&n!==e.x&&Ea(a<l?n:i,a,f,l,a<l?i:n,a,e.x,e.y)&&(h=Math.abs(a-e.y)/(n-e.x),Hi(e,r)&&(h<c||h===c&&(e.x>o.x||e.x===o.x&&KD(o,e)))&&(o=e,c=h)),e=e.next;while(e!==u);return o}function KD(r,t){return Oe(r.prev,r,t.prev)<0&&Oe(t.next,r,r.next)<0}function YD(r,t,e,n){var a=r;do a.z===null&&(a.z=Om(a.x,a.y,t,e,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==r);a.prevZ.nextZ=null,a.prevZ=null,QD(a)}function QD(r){var t,e,n=1,a,i,o,s,u,f;do{for(i=r,r=null,f=null,a=0;i;){for(a++,s=i,o=0,e=0;e<n&&(o++,s=s.nextZ,!!s);e++);for(u=n;o>0||u>0&&s;)o!==0&&(u===0||!s||i.z<=s.z)?(t=i,i=i.nextZ,o--):(t=s,s=s.nextZ,u--),f?f.nextZ=t:r=t,t.prevZ=f,f=t;i=s}f.nextZ=null,n*=2}while(a>1);return r}function Om(r,t,e,n,a){return r=32767*(r-e)*a,t=32767*(t-n)*a,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function $D(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function Ea(r,t,e,n,a,i,o,s){return(a-o)*(t-s)-(r-o)*(i-s)>=0&&(r-o)*(n-s)-(e-o)*(t-s)>=0&&(e-o)*(i-s)-(a-o)*(n-s)>=0}function ZD(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!eG(r,t)&&(Hi(r,t)&&Hi(t,r)&&rG(r,t)&&(Oe(r.prev,r,t.prev)||Oe(r,t.prev,t))||Gu(r,t)&&Oe(r.prev,r,r.next)>0&&Oe(t.prev,t,t.next)>0)}function Oe(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function Gu(r,t){return r.x===t.x&&r.y===t.y}function SC(r,t,e,n){var a=Du(Oe(r,t,e)),i=Du(Oe(r,t,n)),o=Du(Oe(e,n,r)),s=Du(Oe(e,n,t));return!!(a!==i&&o!==s||a===0&&ku(r,e,t)||i===0&&ku(r,n,t)||o===0&&ku(e,r,n)||s===0&&ku(e,t,n))}function ku(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function Du(r){return r>0?1:r<0?-1:0}function eG(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&SC(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function Hi(r,t){return Oe(r.prev,r,r.next)<0?Oe(r,t,r.next)>=0&&Oe(r,r.prev,t)>=0:Oe(r,t,r.prev)<0||Oe(r,r.next,t)<0}function rG(r,t){var e=r,n=!1,a=(r.x+t.x)/2,i=(r.y+t.y)/2;do e.y>i!=e.next.y>i&&e.next.y!==e.y&&a<(e.next.x-e.x)*(i-e.y)/(e.next.y-e.y)+e.x&&(n=!n),e=e.next;while(e!==r);return n}function wC(r,t){var e=new Pm(r.i,r.x,r.y),n=new Pm(t.i,t.x,t.y),a=r.next,i=t.prev;return r.next=t,t.prev=r,e.next=a,a.prev=e,n.next=e,e.prev=n,i.next=n,n.prev=i,n}function xC(r,t,e,n){var a=new Pm(r,t,e);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function zi(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Pm(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Lm(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=iG(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
183
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function iG(r,t){if(r){if(typeof r=="string")return MC(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return MC(r,t)}}function MC(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function OC(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function Fn(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?OC(Object(e),!0).forEach(function(n){(0,PC.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):OC(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function km(r,t,e){var n=oG(r),a=Object.keys(n).filter(function(i){return n[i]!==Array});return sG(r,Fn({propArrayTypes:n},t),{numericPropKeys:e&&e.numericPropKeys||a,PositionDataType:e?e.PositionDataType:Float32Array})}function oG(r){var t={},e=Lm(r),n;try{for(e.s();!(n=e.n()).done;){var a=n.value;if(a.properties)for(var i in a.properties){var o=a.properties[i];t[i]=dG(o,t[i])}}}catch(s){e.e(s)}finally{e.f()}return t}function sG(r,t,e){for(var n=t.pointPositionsCount,a=t.pointFeaturesCount,i=t.linePositionsCount,o=t.linePathsCount,s=t.lineFeaturesCount,u=t.polygonPositionsCount,f=t.polygonObjectsCount,l=t.polygonRingsCount,c=t.polygonFeaturesCount,h=t.propArrayTypes,d=t.coordLength,p=e.numericPropKeys,v=p===void 0?[]:p,y=e.PositionDataType,A=y===void 0?Float32Array:y,_=r[0]&&("id"in r[0]),E=r.length>65535?Uint32Array:Uint16Array,x={type:"Point",positions:new A(n*d),globalFeatureIds:new E(n),featureIds:a>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},C={type:"LineString",pathIndices:i>65535?new Uint32Array(o+1):new Uint16Array(o+1),positions:new A(i*d),globalFeatureIds:new E(i),featureIds:s>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:[],fields:[]},P={type:"Polygon",polygonIndices:u>65535?new Uint32Array(f+1):new Uint16Array(f+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),positions:new A(u*d),triangles:[],globalFeatureIds:new E(u),featureIds:c>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]},L=0,M=[x,C,P];L<M.length;L++){var S=M[L],b=Lm(v),R;try{for(b.s();!(R=b.n()).done;){var F=R.value,N=h[F];S.numericProps[F]=new N(S.positions.length/d)}}catch(j){b.e(j)}finally{b.f()}}C.pathIndices[o]=i,P.polygonIndices[f]=u,P.primitivePolygonIndices[l]=u;var k={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},B=Lm(r),O;try{for(B.s();!(O=B.n()).done;){var I=O.value,U=I.geometry,D=I.properties||{};switch(U.type){case"Point":uG(U,x,k,d,D),x.properties.push(Fm(D,v)),_&&x.fields.push({id:I.id}),k.pointFeature++;break;case"LineString":fG(U,C,k,d,D),C.properties.push(Fm(D,v)),_&&C.fields.push({id:I.id}),k.lineFeature++;break;case"Polygon":lG(U,P,k,d,D),P.properties.push(Fm(D,v)),_&&P.fields.push({id:I.id}),k.polygonFeature++;break;default:throw new Error("Invalid geometry type")}k.feature++}}catch(j){B.e(j)}finally{B.f()}return hG(x,C,P,d)}function uG(r,t,e,n,a){t.positions.set(r.data,e.pointPosition*n);var i=r.data.length/n;Dm(t,a,e.pointPosition,i),t.globalFeatureIds.fill(e.feature,e.pointPosition,e.pointPosition+i),t.featureIds.fill(e.pointFeature,e.pointPosition,e.pointPosition+i),e.pointPosition+=i}function fG(r,t,e,n,a){t.positions.set(r.data,e.linePosition*n);var i=r.data.length/n;Dm(t,a,e.linePosition,i),t.globalFeatureIds.fill(e.feature,e.linePosition,e.linePosition+i),t.featureIds.fill(e.lineFeature,e.linePosition,e.linePosition+i);for(var o=0,s=r.indices.length;o<s;++o){var u=r.indices[o],f=o===s-1?r.data.length:r.indices[o+1];t.pathIndices[e.linePath++]=e.linePosition,e.linePosition+=(f-u)/n}}function lG(r,t,e,n,a){t.positions.set(r.data,e.polygonPosition*n);var i=r.data.length/n;Dm(t,a,e.polygonPosition,i),t.globalFeatureIds.fill(e.feature,e.polygonPosition,e.polygonPosition+i),t.featureIds.fill(e.polygonFeature,e.polygonPosition,e.polygonPosition+i);for(var o=0,s=r.indices.length;o<s;++o){var u=e.polygonPosition;t.polygonIndices[e.polygonObject++]=u;for(var f=r.areas[o],l=r.indices[o],c=r.indices[o+1],h=0,d=l.length;h<d;++h){var p=l[h],v=h===d-1?c===void 0?r.data.length:c[0]:l[h+1];t.primitivePolygonIndices[e.polygonRing++]=e.polygonPosition,e.polygonPosition+=(v-p)/n}var y=e.polygonPosition;cG(t,f,l,{startPosition:u,endPosition:y,coordLength:n})}}function cG(r,t,e,n){for(var a=n.startPosition,i=n.endPosition,o=n.coordLength,s=a*o,u=i*o,f=r.positions.subarray(s,u),l=e[0],c=e.slice(1).map(function(v){return(v-l)/o}),h=Im(f,c,o,t),d=0,p=h.length;d<p;++d)r.triangles.push(a+h[d])}function Rm(r,t){var e={};for(var n in r)e[n]={value:r[n],size:t};return e}function hG(r,t,e,n){return{points:Fn(Fn({},r),{},{positions:{value:r.positions,size:n},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:Rm(r.numericProps,1)}),lines:Fn(Fn({},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:Rm(t.numericProps,1)}),polygons:Fn(Fn({},e),{},{positions:{value:e.positions,size:n},polygonIndices:{value:e.polygonIndices,size:1},primitivePolygonIndices:{value:e.primitivePolygonIndices,size:1},triangles:{value:new Uint32Array(e.triangles),size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:Rm(e.numericProps,1)})}}function Dm(r,t,e,n){for(var a in r.numericProps)if(a in t){var i=t[a];r.numericProps[a].fill(i,e,e+n)}}function Fm(r,t){var e={};for(var n in r)t.includes(n)||(e[n]=r[n]);return e}function dG(r,t){return t===Array||!Number.isFinite(r)?Array:t===Float64Array||Math.fround(r)!==r?Float64Array:Float32Array}var FC=m(W());function IC(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function pG(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?IC(Object(e),!0).forEach(function(n){(0,FC.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):IC(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function LC(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=mG(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
184
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function mG(r,t){if(r){if(typeof r=="string")return RC(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return RC(r,t)}}function RC(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function ju(r,t){var e=t?.globalFeatureId;return e!==void 0?vG(r,e):gG(r,t?.type)}function vG(r,t){var e=DC(r),n=LC(e),a;try{for(n.s();!(a=n.n()).done;){for(var i=a.value,o=0,s=i.featureIds.value[0],u=0;u<i.featureIds.value.length;u++){var f=i.featureIds.value[u];if(f!==s){if(t===i.globalFeatureIds.value[o])return Uu(i,o,u);o=u,s=f}}if(t===i.globalFeatureIds.value[o])return Uu(i,o,i.featureIds.value.length)}}catch(l){n.e(l)}finally{n.f()}throw new Error("featureId:".concat(t," not found"))}function gG(r,t){var e=DC(r,t);return yG(e)}function kC(r,t,e){switch(r.type){case"Point":return TG(r,t,e);case"LineString":return _G(r,t,e);case"Polygon":return GC(r,t,e);default:var n=r;throw new Error("Unsupported geometry type: ".concat(n?.type))}}function DC(r,t){var e=Boolean(r.points||r.lines||r.polygons);if(!e)return r.type=t||xG(r),[r];var n=[];return r.points&&(r.points.type="Point",n.push(r.points)),r.lines&&(r.lines.type="LineString",n.push(r.lines)),r.polygons&&(r.polygons.type="Polygon",n.push(r.polygons)),n}function yG(r){var t=[],e=LC(r),n;try{for(e.s();!(n=e.n()).done;){var a=n.value;if(a.featureIds.value.length!==0){for(var i=0,o=a.featureIds.value[0],s=0;s<a.featureIds.value.length;s++){var u=a.featureIds.value[s];u!==o&&(t.push(Uu(a,i,s)),i=s,o=u)}t.push(Uu(a,i,a.featureIds.value.length))}}}catch(f){e.e(f)}finally{e.f()}return t}function Uu(r,t,e){var n=kC(r,t,e),a=bG(r,t,e),i=AG(r,t,e);return pG({type:"Feature",geometry:n,properties:a},i)}function AG(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2?arguments[2]:void 0;return r.fields&&r.fields[r.featureIds.value[t]]}function bG(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2?arguments[2]:void 0,n=Object.assign({},r.properties[r.featureIds.value[t]]);for(var a in r.numericProps)n[a]=r.numericProps[a].value[t];return n}function GC(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,n=r.positions,a=r.polygonIndices.value.filter(function(A){return A>=t&&A<=e}),i=r.primitivePolygonIndices.value.filter(function(A){return A>=t&&A<=e}),o=a.length>2;if(!o){for(var s=[],u=0;u<i.length-1;u++){var f=i[u],l=i[u+1],c=Nu(n,f,l);s.push(c)}return{type:"Polygon",coordinates:s}}for(var h=[],d=0;d<a.length-1;d++){var p=a[d],v=a[d+1],y=GC(r,p,v).coordinates;h.push(y)}return{type:"MultiPolygon",coordinates:h}}function _G(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,n=r.positions,a=r.pathIndices.value.filter(function(l){return l>=t&&l<=e}),i=a.length>2;if(!i){var o=Nu(n,a[0],a[1]);return{type:"LineString",coordinates:o}}for(var s=[],u=0;u<a.length-1;u++){var f=Nu(n,a[u],a[u+1]);s.push(f)}return{type:"MultiLineString",coordinates:s}}function TG(r,t,e){var n=r.positions,a=Nu(n,t,e),i=a.length>1;return i?{type:"MultiPoint",coordinates:a}:{type:"Point",coordinates:a[0]}}function Nu(r,t,e){t=t||0,e=e||r.value.length/r.size;for(var n=[],a=t;a<e;a++){for(var i=Array(),o=a*r.size;o<(a+1)*r.size;o++)i.push(Number(r.value[o]));n.push(i)}return n}function xG(r){return r.pathIndices?"LineString":r.polygonIndices?"Polygon":"Point"}var zm=m(WC());var eB=m(V());var QC=m(V()),$C=m(z());var XC=m(V()),KC=m(z());function JC(r){var t=r.length;if(t<=1)return[r];for(var e=[],n,a,i=0;i<t;i++){var o=jG(r[i]);o!==0&&(a===void 0&&(a=o<0),a===o<0?(n&&e.push(n),n=[r[i]]):n&&n.push(r[i]))}return n&&e.push(n),e}function jG(r){for(var t=0,e=0,n=r.length-1,a,i;e<r.length;n=e++)a=r[e],i=r[n],t+=(i[0]-a[0])*(a[1]+i[1]);return t}function qC(r,t,e){t&&e&&(r===1?t.id=e.readVarint():r===2?VG(e,t):r===3?t.type=e.readVarint():r===4&&(t._geometry=e.pos))}function VG(r,t){for(var e=r.readVarint()+r.pos;r.pos<e;){var n=t._keys[r.readVarint()],a=t._values[r.readVarint()];t.properties[n]=a}}var YC=function(){function r(t,e,n,a,i){(0,XC.default)(this,r),g(this,"properties",void 0),g(this,"extent",void 0),g(this,"type",void 0),g(this,"id",void 0),g(this,"_pbf",void 0),g(this,"_geometry",void 0),g(this,"_keys",void 0),g(this,"_values",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=a,this._values=i,t.readFields(qC,this,e)}return(0,KC.default)(r,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry;for(var n=e.readVarint()+e.pos,a=1,i=0,o=0,s=0,u=[],f;e.pos<n;){if(i<=0){var l=e.readVarint();a=l&7,i=l>>3}if(i--,a===1||a===2)o+=e.readSVarint(),s+=e.readSVarint(),a===1&&(f&&u.push(f),f=[]),f&&f.push([o,s]);else if(a===7)f&&f.push(f[0].slice());else throw new Error("unknown command ".concat(a))}return f&&u.push(f),u}},{key:"bbox",value:function(){var e=this._pbf;e.pos=this._geometry;for(var n=e.readVarint()+e.pos,a=1,i=0,o=0,s=0,u=1/0,f=-1/0,l=1/0,c=-1/0;e.pos<n;){if(i<=0){var h=e.readVarint();a=h&7,i=h>>3}if(i--,a===1||a===2)o+=e.readSVarint(),s+=e.readSVarint(),o<u&&(u=o),o>f&&(f=o),s<l&&(l=s),s>c&&(c=s);else if(a!==7)throw new Error("unknown command ".concat(a))}return[u,l,f,c]}},{key:"_toGeoJSON",value:function(e){var n=this.loadGeometry(),a=r.types[this.type],i,o;switch(this.type){case 1:var s=[];for(i=0;i<n.length;i++)s[i]=n[i][0];n=s,e(n,this);break;case 2:for(i=0;i<n.length;i++)e(n[i],this);break;case 3:for(n=JC(n),i=0;i<n.length;i++)for(o=0;o<n[i].length;o++)e(n[i][o],this);break}n.length===1?n=n[0]:a="Multi".concat(a);var u={type:"Feature",geometry:{type:a,coordinates:n},properties:this.properties};return this.id!==null&&(u.id=this.id),u}},{key:"toGeoJSON",value:function(e){if(typeof e=="function")return this._toGeoJSON(e);var n=e.x,a=e.y,i=e.z,o=this.extent*Math.pow(2,i),s=this.extent*n,u=this.extent*a;function f(l){for(var c=0;c<l.length;c++){var h=l[c];h[0]=(h[0]+s)*360/o-180;var d=180-(h[1]+u)*360/o;h[1]=360/Math.PI*Math.atan(Math.exp(d*Math.PI/180))-90}}return this._toGeoJSON(f)}}],[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),r}();var ZC=function(){function r(t,e){(0,QC.default)(this,r),g(this,"version",void 0),g(this,"name",void 0),g(this,"extent",void 0),g(this,"length",void 0),g(this,"_pbf",void 0),g(this,"_keys",void 0),g(this,"_values",void 0),g(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(HG,this,e),this.length=this._features.length}return(0,$C.default)(r,[{key:"feature",value:function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var n=this._pbf.readVarint()+this._pbf.pos;return new YC(this._pbf,n,this.extent,this._keys,this._values)}}]),r}();function HG(r,t,e){t&&e&&(r===15?t.version=e.readVarint():r===1?t.name=e.readString():r===5?t.extent=e.readVarint():r===2?t._features.push(e.pos):r===3?t._keys.push(e.readString()):r===4&&t._values.push(zG(e)))}function zG(r){for(var t=null,e=r.readVarint()+r.pos;r.pos<e;){var n=r.readVarint()>>3;t=n===1?r.readString():n===2?r.readFloat():n===3?r.readDouble():n===4?r.readVarint64():n===5?r.readVarint():n===6?r.readSVarint():n===7?r.readBoolean():null}return t}var rB=function r(t,e){(0,eB.default)(this,r),g(this,"layers",void 0),this.layers=t.readFields(WG,{},e)};function WG(r,t,e){if(r===3&&e){var n=new ZC(e,e.readVarint()+e.pos);n.length&&t&&(t[n.name]=n)}}var vB=m(V());var dB=m(V()),pB=m(z());var fB=m(W()),lB=m(V()),cB=m(z());function tB(r){var t=r.indices.length,e="Polygon";if(t<=1)return{type:e,data:r.data,areas:[[vt(r.data)]],indices:[r.indices]};for(var n=[],a=[],i=[],o=[],s,u=0,f,l=0,c;l<t;l++){c=r.indices[l]-u,f=r.indices[l+1]-u||r.data.length;var h=r.data.slice(c,f),d=vt(h);if(d===0){var p=r.data.slice(0,c),v=r.data.slice(f);r.data=p.concat(v),u+=f-c;continue}s===void 0&&(s=d<0),s===d<0?(o.length&&(n.push(i),a.push(o)),o=[c],i=[d]):(i.push(d),o.push(c))}return i&&n.push(i),o.length&&a.push(o),{type:e,areas:n,indices:a,data:r.data}}function nB(r,t,e,n){for(var a=0,i=r.length;a<i;a+=2){r[a]=(r[a]+t)*360/n-180;var o=180-(r[a+1]+e)*360/n;r[a+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}function aB(r,t,e){t&&e&&(r===1?t.id=e.readVarint():r===2?JG(e,t):r===3?t.type=e.readVarint():r===4&&(t._geometry=e.pos))}function JG(r,t){for(var e=r.readVarint()+r.pos;r.pos<e;){var n=t._keys[r.readVarint()],a=t._values[r.readVarint()];t.properties[n]=a}}function qG(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=XG(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
185
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function XG(r,t){if(r){if(typeof r=="string")return iB(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return iB(r,t)}}function iB(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function oB(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function sB(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?oB(Object(e),!0).forEach(function(n){(0,fB.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):oB(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var uB,Ln,Nm,zu,jm,Vm,Wi;var hB=function(){function r(t,e,n,a,i,o){(0,lB.default)(this,r),g(this,"properties",void 0),g(this,"extent",void 0),g(this,"type",void 0),g(this,"id",void 0),g(this,"_pbf",void 0),g(this,"_geometry",void 0),g(this,"_keys",void 0),g(this,"_values",void 0),g(this,"_geometryInfo",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=a,this._values=i,this._geometryInfo=o,t.readFields(aB,this,e)}return(0,cB.default)(r,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry,uB=e.readVarint()+e.pos,Ln=1,zu=0,jm=0,Vm=0,Wi=0;for(var n=[],a=[];e.pos<uB;)if(zu<=0&&(Nm=e.readVarint(),Ln=Nm&7,zu=Nm>>3),zu--,Ln===1||Ln===2)jm+=e.readSVarint(),Vm+=e.readSVarint(),Ln===1&&n.push(Wi),a.push(jm,Vm),Wi+=2;else if(Ln===7){if(Wi>0){var i=n[n.length-1];a.push(a[i],a[i+1]),Wi+=2}}else throw new Error("unknown command ".concat(Ln));return{data:a,indices:n}}},{key:"_toBinaryCoordinates",value:function(e){var n=this.loadGeometry(),a;e(n.data,this);var i=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=n.indices.length,a=sB({type:"Point"},n);break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=n.indices.length,this._geometryInfo.linePositionsCount+=n.data.length/i,a=sB({type:"LineString"},n);break;case 3:a=tB(n),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=a.indices.length;var o=qG(a.indices),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;this._geometryInfo.polygonRingsCount+=u.length}}catch(l){o.e(l)}finally{o.f()}this._geometryInfo.polygonPositionsCount+=a.data.length/i;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}var f={type:"Feature",geometry:a,properties:this.properties};return this.id!==null&&(f.id=this.id),f}},{key:"toBinaryCoordinates",value:function(e){if(typeof e=="function")return this._toBinaryCoordinates(e);var n=e.x,a=e.y,i=e.z,o=this.extent*Math.pow(2,i),s=this.extent*n,u=this.extent*a;return this._toBinaryCoordinates(function(f){return nB(f,s,u,o)})}}]),r}();var mB=function(){function r(t,e){(0,dB.default)(this,r),g(this,"version",void 0),g(this,"name",void 0),g(this,"extent",void 0),g(this,"length",void 0),g(this,"_pbf",void 0),g(this,"_keys",void 0),g(this,"_values",void 0),g(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(KG,this,e),this.length=this._features.length}return(0,pB.default)(r,[{key:"feature",value:function(e,n){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var a=this._pbf.readVarint()+this._pbf.pos;return new hB(this._pbf,a,this.extent,this._keys,this._values,n)}}]),r}();function KG(r,t,e){t&&e&&(r===15?t.version=e.readVarint():r===1?t.name=e.readString():r===5?t.extent=e.readVarint():r===2?t._features.push(e.pos):r===3?t._keys.push(e.readString()):r===4&&t._values.push(YG(e)))}function YG(r){for(var t=null,e=r.readVarint()+r.pos;r.pos<e;){var n=r.readVarint()>>3;t=n===1?r.readString():n===2?r.readFloat():n===3?r.readDouble():n===4?r.readVarint64():n===5?r.readVarint():n===6?r.readSVarint():n===7?r.readBoolean():null}return t}var gB=function r(t,e){(0,vB.default)(this,r),g(this,"layers",void 0),this.layers=t.readFields(QG,{},e)};function QG(r,t,e){if(r===3&&e){var n=new mB(e,e.readVarint()+e.pos);n.length&&t&&(t[n.name]=n)}}function Wu(r,t){var e,n,a=ZG(t),i=(t==null||(e=t.gis)===null||e===void 0?void 0:e.format)||(t==null||(n=t.mvt)===null||n===void 0?void 0:n.shape);switch(i){case"columnar-table":return{shape:"columnar-table",data:Hm(r,a)};case"geojson-row-table":{var o={shape:"geojson-row-table",data:yB(r,a)};return o}case"geojson":return yB(r,a);case"binary-geometry":return Hm(r,a);case"binary":return Hm(r,a);default:throw new Error(i)}}function Hm(r,t){var e=$G(r,t),n=(0,AB.default)(e,2),a=n[0],i=n[1],o=km(a,i);return o.byteLength=r.byteLength,o}function $G(r,t){var e=[],n={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(r.byteLength<=0)return[e,n];var a=new gB(new zm.default(r)),i=t&&Array.isArray(t.layers)?t.layers:Object.keys(a.layers);return i.forEach(function(o){var s=a.layers[o];if(s)for(var u=0;u<s.length;u++){var f=s.feature(u,n),l=rU(f,t,o);e.push(l)}}),[e,n]}function yB(r,t){if(r.byteLength<=0)return[];var e=[],n=new rB(new zm.default(r)),a=Array.isArray(t.layers)?t.layers:Object.keys(n.layers);return a.forEach(function(i){var o=n.layers[i];if(o)for(var s=0;s<o.length;s++){var u=o.feature(s),f=eU(u,t,i);e.push(f)}}),e}function ZG(r){var t;if(!(r!=null&&r.mvt))throw new Error("mvt options required");var e=((t=r.mvt)===null||t===void 0?void 0:t.coordinates)==="wgs84",n=r.mvt.tileIndex,a=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(e&&!a)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return r.mvt}function eU(r,t,e){var n=r.toGeoJSON(t.coordinates==="wgs84"?t.tileIndex:tU);return t.layerProperty&&(n.properties[t.layerProperty]=e),n}function rU(r,t,e){var n=r.toBinaryCoordinates(t.coordinates==="wgs84"?t.tileIndex:nU);return t.layerProperty&&n.properties&&(n.properties[t.layerProperty]=e),n}function tU(r,t){for(var e=t.extent,n=0;n<r.length;n++){var a=r[n];a[0]/=e,a[1]/=e}}function nU(r,t){for(var e=t.extent,n=0,a=r.length;n<a;++n)r[n]/=e}function bB(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function _B(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?bB(Object(e),!0).forEach(function(n){(0,xB.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):bB(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var aU="3.3.0-alpha.10",iU={mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}},Ju={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:aU,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:iU},oU=_B(_B({},Ju),{},{parse:function(){var r=(0,TB.default)(Wm.default.mark(function e(n,a){return Wm.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Wu(n,a));case 1:case"end":return o.stop()}},e)}));function t(e,n){return r.apply(this,arguments)}return t}(),parseSync:Wu,binary:!0});var wB=m(W()),Jm=m(ge());function EB(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function SB(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?EB(Object(e),!0).forEach(function(n){(0,wB.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):EB(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var sU={Point:CB,MultiPoint:uU,LineString:BB,MultiLineString:fU,Polygon:MB,MultiPolygon:lU};function CB(r,t,e){var n=(0,Jm.default)(r,2),a=n[0],i=n[1],o=(0,Jm.default)(t,2),s=o[0],u=o[1],f=Et(s[0],u[0],a),l=Et(s[1],u[1],i);return e.unprojectFlat([f,l])}function qm(r,t,e){return r.map(function(n){return CB(n,t,e)})}function uU(r,t,e){return qm(r,t,e)}function BB(r,t,e){return qm(r,t,e)}function fU(r,t,e){return r.map(function(n){return BB(n,t,e)})}function MB(r,t,e){return r.map(function(n){return qm(n,t,e)})}function lU(r,t,e){return r.map(function(n){return MB(n,t,e)})}function OB(r,t,e){var n=e.projectFlat([t.west,t.north]),a=e.projectFlat([t.east,t.south]),i=[n,a];return SB(SB({},r),{},{coordinates:sU[r.type](r.coordinates,i,e)})}function cU(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=hU(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
186
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function hU(r,t){if(r){if(typeof r=="string")return PB(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return PB(r,t)}}function PB(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var dU=["points","lines","polygons"];function Xm(r,t,e,n){var a=cU(dU),i;try{for(a.s();!(i=a.n()).done;){var o=i.value,s=r[o]&&pU(r[o],t,e,n);if(s>=0)return s}}catch(u){a.e(u)}finally{a.f()}return-1}function pU(r,t,e,n){var a=r.featureIds.value;if(!a.length)return-1;var i=0,o=a[a.length-1]+1;if(n){var s=mU(r,n);if(s)i=s[0],o=s[1]+1;else return-1}var u=-1;if(t in r.numericProps){var f=r.numericProps[t].value.findIndex(function(l,c){return l===e&&a[c]>=i&&a[c]<o});return f>=0?r.globalFeatureIds.value[f]:-1}else t?u=IB(r.properties,function(l){return l[t]===e},i,o):r.fields&&(u=IB(r.fields,function(l){return l.id===e},i,o));return u>=0?vU(r,u):-1}function mU(r,t){if(!r.__layers){for(var e={},n=r.properties,a=0;a<n.length;a++){var i=n[a],o=i.layerName;o&&(e[o]?e[o][1]=a:e[o]=[a,a])}r.__layers=e}return r.__layers[t]}function vU(r,t){if(!r.__ids){for(var e=[],n=r.featureIds.value,a=r.globalFeatureIds.value,i=0;i<n.length;i++)e[n[i]]=a[i];r.__ids=e}return r.__ids[t]}function IB(r,t,e,n){for(var a=e;a<n;a++)if(t(r[a],a))return a;return-1}function gU(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=yU(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
187
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var f=e.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function yU(r,t){if(r){if(typeof r=="string")return RB(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return RB(r,t)}}function RB(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function AU(r){var t=bU();return function(){var n=(0,et.default)(r),a;if(t){var i=(0,et.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,HB.default)(this,a)}}function bU(){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 FB(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,n)}return e}function qt(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?FB(Object(e),!0).forEach(function(n){(0,qu.default)(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):FB(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var Km=512,_U=qt(qt({},$m.GeoJsonLayer.defaultProps),{},{onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[Ju],binary:!0}),Ku=function(r){(0,VB.default)(e,r);var t=AU(e);function e(){return(0,NB.default)(this,e),t.apply(this,arguments)}return(0,jB.default)(e,[{key:"initializeState",value:function(){(0,Jt.default)((0,et.default)(e.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})}},{key:"isLoaded",get:function(){return this.state&&this.state.data&&this.state.tileset&&(0,Jt.default)((0,et.default)(e.prototype),"isLoaded",this)}},{key:"updateState",value:function(a){var i,o=a.props,s=a.oldProps,u=a.context,f=a.changeFlags;f.dataChanged&&this._updateTileData(),(i=this.state)!==null&&i!==void 0&&i.data&&((0,Jt.default)((0,et.default)(e.prototype),"updateState",this).call(this,{props:o,oldProps:s,context:u,changeFlags:f}),this._setWGS84PropertyForTiles());var l=o.highlightColor;l!==s.highlightColor&&Array.isArray(l)&&this.setState({highlightColor:l})}},{key:"_updateTileData",value:function(){var n=(0,UB.default)(Qm.default.mark(function i(){var o,s,u,f,l;return Qm.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(o=this.props.data,s=null,!(typeof o=="string"&&!Vl(o))){h.next=18;break}return u=this.props,f=u.onDataLoad,l=u.fetch,this.setState({data:null,tileJSON:null}),h.prev=5,h.next=8,l(o,{propName:"data",layer:this,loaders:[]});case 8:s=h.sent,h.next=15;break;case 11:h.prev=11,h.t0=h.catch(5),this.raiseError(h.t0,"loading TileJSON"),o=null;case 15:f&&f(s,{propName:"data",layer:this}),h.next=19;break;case 18:o.tilejson&&(s=o);case 19:s&&(o=s.tiles),this.setState({data:o,tileJSON:s});case 21:case"end":return h.stop()}},i,this,[[5,11]])}));function a(){return n.apply(this,arguments)}return a}()},{key:"_getTilesetOptions",value:function(){var a=(0,Jt.default)((0,et.default)(e.prototype),"_getTilesetOptions",this).call(this),i=this.state.tileJSON,o=this.props,s=o.minZoom,u=o.maxZoom;return i&&(Number.isFinite(i.minzoom)&&i.minzoom>s&&(a.minZoom=i.minzoom),Number.isFinite(i.maxzoom)&&(!Number.isFinite(u)||i.maxzoom<u)&&(a.maxZoom=i.maxzoom)),a}},{key:"renderLayers",value:function(){var a;return(a=this.state)!==null&&a!==void 0&&a.data?(0,Jt.default)((0,et.default)(e.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(a){var i,o=this.state,s=o.data,u=o.binary,f=a.index,l=a.signal,c=Jr(s,a);if(!c)return Promise.reject("Invalid URL");var h=this.getLoadOptions(),d=this.props.fetch;return h=qt(qt({},h),{},{mimeType:"application/x-protobuf",mvt:qt(qt({},(i=h)===null||i===void 0?void 0:i.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:f}),gis:u?{format:"binary"}:{}}),d(c,{propName:"data",layer:this,loadOptions:h,signal:l})}},{key:"renderSubLayers",value:function(a){var i=a.tile.index,o=i.x,s=i.y,u=i.z,f=Math.pow(2,u),l=Km/f,c=-l,h=Km*o/f,d=Km*(1-s/f),p=new Z().scale([l,c,1]);a.autoHighlight=!1,this.context.viewport.resolution||(a.modelMatrix=p,a.coordinateOrigin=[h,d,0],a.coordinateSystem=Xu.COORDINATE_SYSTEM.CARTESIAN,a.extensions=[].concat((0,GB.default)(a.extensions||[]),[new zB.ClipExtension]));var v=(0,Jt.default)((0,et.default)(e.prototype),"renderSubLayers",this).call(this,a);return this.state.binary&&!(v instanceof $m.GeoJsonLayer)&&Xu.log.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),v}},{key:"_updateAutoHighlight",value:function(a){var i=this.props.uniqueIdProperty,o=this.state,s=o.hoveredFeatureId,u=o.hoveredFeatureLayerName,f=a.object,l,c;f&&(l=Ym(f,i),c=LB(f));var h=this.props.highlightColor;typeof h=="function"&&(h=h(a)),(s!==l||u!==c)&&this.setState({highlightColor:h,hoveredFeatureId:l,hoveredFeatureLayerName:c})}},{key:"getPickingInfo",value:function(a){var i=(0,Jt.default)((0,et.default)(e.prototype),"getPickingInfo",this).call(this,a),o=Boolean(this.context.viewport.resolution);if(this.state.binary&&i.index!==-1){var s=a.sourceLayer.props.data;i.object=ju(s,{globalFeatureId:i.index})}return i.object&&!o&&(i.object=DB(i.object,i.tile.bbox,this.context.viewport)),i}},{key:"getSubLayerPropsByTile",value:function(a){return{highlightedObjectIndex:this.getHighlightedObjectIndex(a),highlightColor:this.state.highlightColor}}},{key:"getHighlightedObjectIndex",value:function(a){var i=this.state,o=i.hoveredFeatureId,s=i.hoveredFeatureLayerName,u=i.binary,f=this.props,l=f.uniqueIdProperty,c=f.highlightedFeatureId,h=a.content,d=kB(c),p=kB(o)||d;if(!p)return-1;var v=d?c:o;return Array.isArray(h)?h.findIndex(function(y){var A=Ym(y,l)===v,_=d||LB(y)===s;return A&&_}):h&&u?Xm(h,l,v,d?"":s):-1}},{key:"_pickObjects",value:function(a){var i=this.context,o=i.deck,s=i.viewport,u=s.width,f=s.height,l=s.x,c=s.y,h=[this.id];return o.pickObjects({x:l,y:c,width:u,height:f,layerIds:h,maxObjects:a})}},{key:"getRenderedFeatures",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,i=this._pickObjects(a),o=new Set,s=[],u=gU(i),f;try{for(u.s();!(f=u.n()).done;){var l=f.value,c=Ym(l.object,this.props.uniqueIdProperty);c===void 0?s.push(l.object):o.has(c)||(o.add(c),s.push(l.object))}}catch(h){u.e(h)}finally{u.f()}return s}},{key:"_setWGS84PropertyForTiles",value:function(){var a=this,i="dataInWGS84",o=this.state.tileset;o.selectedTiles.forEach(function(s){s.hasOwnProperty(i)||Object.defineProperty(s,i,{get:function(){if(!s.content)return null;if(a.state.binary&&Array.isArray(s.content)&&!s.content.length)return[];var f=s.bbox;if(s._contentWGS84===void 0&&Hl(f)){var l=a.state.binary?ju(s.content):s.content;s._contentWGS84=l.map(function(c){return DB(c,f,a.context.viewport)})}return s._contentWGS84}})})}}]),e}(nt);(0,qu.default)(Ku,"layerName","MVTLayer");(0,qu.default)(Ku,"defaultProps",_U);function Ym(r,t){if(r.properties&&t)return r.properties[t];if("id"in r)return r.id}function LB(r){var t;return((t=r.properties)===null||t===void 0?void 0:t.layerName)||null}function kB(r){return r!=null&&r!==""}function DB(r,t,e){var n=qt(qt({},r),{},{geometry:{type:r.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){var i=OB(r.geometry,t,e);return i.coordinates}}),n}var KB=m(V()),YB=m(z()),QB=m(Ie()),$B=m(Fe()),Zm=m(Be()),ev=m(W());var JB=m(ge()),WB="0123456789bcdefghjkmnpqrstuvwxyz",qB={};for(Ji=0;Ji<WB.length;Ji++)qB[WB.charAt(Ji)]=Ji;var Ji,TU=-90,xU=90,EU=-180,SU=180;function wU(r){for(var t=!0,e=xU,n=TU,a=SU,i=EU,o,s=0,u=0,f=r.length;u<f;u++){var l=r[u].toLowerCase();s=qB[l];for(var c=4;c>=0;c--){var h=s>>c&1;t?(o=(a+i)/2,h===1?i=o:a=o):(o=(e+n)/2,h===1?n=o:e=o),t=!t}}return[n,i,e,a]}function XB(r){var t=wU(r),e=(0,JB.default)(t,4),n=e[0],a=e[1],i=e[2],o=e[3];return[o,i,o,n,a,n,a,i,o,i]}function CU(r){var t=BU();return function(){var n=(0,Zm.default)(r),a;if(t){var i=(0,Zm.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,$B.default)(this,a)}}function BU(){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}}var MU={getGeohash:{type:"accessor",value:function(t){return t.geohash}}},Yu=function(r){(0,QB.default)(e,r);var t=CU(e);function e(){return(0,KB.default)(this,e),t.apply(this,arguments)}return(0,YB.default)(e,[{key:"indexToBounds",value:function(){var a=this.props,i=a.data,o=a.getGeohash;return{data:i,_normalize:!1,positionFormat:"XY",getPolygon:function(u,f){return XB(o(u,f))}}}}]),e}(Tr);(0,ev.default)(Yu,"layerName","GeohashLayer");(0,ev.default)(Yu,"defaultProps",MU);return a2(qi);})();