@arcgis/core 5.2.0-next.76 → 5.2.0-next.78

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 (175) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{dbdd96e558936955acdb.js → 040a73b2a23577e1eabd.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{bad2c7219e95750906e1.js → 05663093b1d2a268b953.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{755b2d883fba90c4e688.js → 06c8547521ce9c97b258.js} +2 -2
  5. package/assets/esri/core/workers/chunks/{a014c17fc210620da738.js → 17e9324a02b69733307a.js} +2 -2
  6. package/assets/esri/core/workers/chunks/29a20a37e7837142fa6b.js +2 -0
  7. package/assets/esri/core/workers/chunks/{4945d6b0ca1812864185.js → 385b23d4bd5275031fb6.js} +1 -1
  8. package/assets/esri/core/workers/chunks/3958d92c737b3a2a3bc2.js +1 -0
  9. package/assets/esri/core/workers/chunks/{9c3e6325dc60bcaf44d7.js → 4115bab15c19b4f5ae08.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{ff578f0ca68d652fece5.js → 57e26a86d46e02c89c4f.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{8b980c6b92cc4ea68ede.js → 81cd0cb9ae1371765d32.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{de927b1460bc384f5b87.js → 83556c9f6f85c2a46779.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{f4aa6e90200f61e623e5.js → 8762da315cf5086167c3.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{46e56fac44e0fd26ba1d.js → 95956d62591d689f1135.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{9e2e4d197a7a57c2a691.js → ac2ba5c3d613d7d5183a.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{94b9a61b4dbb83425a78.js → b2812279662f1a5f8d06.js} +1 -1
  17. package/assets/esri/core/workers/chunks/b82763e9401b16121f8d.js +2 -0
  18. package/assets/esri/core/workers/chunks/{83e54166ba634ec2bd89.js → c69cf08da4e4c2c824ee.js} +10 -10
  19. package/assets/esri/core/workers/chunks/{6c740c411b085d2d08c4.js → cd74de12005834244a47.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{6e45ecf359bce3417f5d.js → ef803fb25741e9f2a0a1.js} +1 -1
  21. package/assets/esri/core/workers/chunks/f3bbebedad51f776bb98.js +1 -0
  22. package/assets/esri/core/workers/chunks/{a91c1d782346a9c7e1ef.js → f703bc002c732d1c045d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/fdd4f78facec6387cdb0.js +1 -0
  24. package/assets/esri/core/workers/chunks/ffd5285c7b2c83208f87.js +2 -0
  25. package/config.js +1 -1
  26. package/geometry/support/webMercatorUtils.d.ts +38 -14
  27. package/kernel.js +1 -1
  28. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  29. package/layers/VectorTileLayer.d.ts +40 -22
  30. package/layers/mixins/RasterJobHandlerMixin.js +1 -1
  31. package/layers/support/RasterJobHandler.js +1 -1
  32. package/layers/video/VideoController.js +1 -1
  33. package/package.json +4 -4
  34. package/support/revision.js +1 -1
  35. package/views/2d/engine/BitmapTile.js +1 -1
  36. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  37. package/views/2d/engine/flow/styles/Particles.js +1 -1
  38. package/views/2d/engine/flow/styles/Streamlines.js +1 -1
  39. package/views/2d/engine/imagery/RasterTile.js +1 -1
  40. package/views/2d/engine/imagery/RasterVFTile.js +1 -1
  41. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  42. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  43. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  44. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  45. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  46. package/views/2d/engine/webgl/Painter.js +1 -1
  47. package/views/2d/engine/webgl/RenderingDevice.js +1 -1
  48. package/views/2d/engine/webgl/TileContainer.js +1 -1
  49. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  50. package/views/2d/engine/webgl/normalizedTileUtils.js +1 -1
  51. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  52. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  53. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  54. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
  55. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
  56. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  57. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  58. package/views/2d/engine/webgl/shaderGraph/techniques/bitmap/BitmapTechnique.js +1 -1
  59. package/views/2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js +1 -1
  60. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
  61. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  62. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  63. package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
  64. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  65. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  66. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
  67. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  68. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
  69. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  70. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  71. package/views/2d/engine/webgl/shaderGraph/techniques/flow/FlowTechnique.js +1 -1
  72. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  73. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  74. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  75. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
  76. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  77. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  78. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  79. package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
  80. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
  81. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  82. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  83. package/views/2d/engine/webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js +1 -1
  84. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  85. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
  86. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js +1 -1
  87. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
  88. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
  89. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
  90. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
  91. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
  92. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  93. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  94. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
  95. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
  96. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/Tile.js +1 -1
  97. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js +1 -1
  98. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileInfo.js +1 -1
  99. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js +1 -1
  100. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js +1 -1
  101. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  102. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
  103. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/MagDirShader.js +1 -1
  104. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/ScalarShader.js +1 -1
  105. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderBackground.js +1 -1
  106. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderCircle.js +1 -1
  107. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +1 -1
  108. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderIcon.js +1 -1
  109. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +1 -1
  110. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderOutline.js +1 -1
  111. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderText.js +1 -1
  112. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  113. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  114. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
  115. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileStencilTechnique.js +1 -1
  116. package/views/2d/engine/webgl/shaderGraph/techniques/utility/DebugOverlayTechnique.js +1 -1
  117. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
  118. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
  119. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  120. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
  121. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
  122. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  123. package/views/2d/layers/MediaLayerView2D.js +1 -1
  124. package/views/2d/layers/TileLayerView2D.js +1 -1
  125. package/views/2d/layers/support/DisplayGL.js +1 -1
  126. package/views/3d/GroundView3D.js +1 -1
  127. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  128. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  129. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  130. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  131. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  132. package/views/3d/state/HUDOccludedFragmentOpacity.js +1 -1
  133. package/views/3d/state/ViewState.js +1 -1
  134. package/views/3d/state/ViewStateManager.js +1 -1
  135. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  136. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  137. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  138. package/views/3d/terrain/OverlayManager.js +1 -1
  139. package/views/3d/terrain/PatchRenderDataWaterproofness.js +1 -1
  140. package/views/3d/terrain/TerrainRenderer.js +1 -1
  141. package/views/3d/terrain/TerrainSurface.js +1 -1
  142. package/views/3d/terrain/TerrainWaterproofnessDiagnostics.js +2 -0
  143. package/views/3d/terrain/TileCompositor.js +1 -1
  144. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  145. package/views/3d/webgl-engine/parts/Model.js +1 -1
  146. package/views/VideoView.js +1 -1
  147. package/views/support/waitForResources.js +1 -1
  148. package/views/webgl/RenderingContext.js +1 -1
  149. package/views/webgl/UniformBufferLayout.js +1 -1
  150. package/views/webgl/UniformBufferObject.js +1 -1
  151. package/widgets/Feature/FeatureViewModel.d.ts +4 -3
  152. package/widgets/Feature/FeatureViewModel.js +1 -1
  153. package/widgets/Feature.js +1 -1
  154. package/widgets/Features/FeaturesViewModel.d.ts +4 -2
  155. package/widgets/Features/FeaturesViewModel.js +1 -1
  156. package/widgets/Features.js +1 -1
  157. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  158. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  159. package/widgets/Popup/PopupViewModel.d.ts +1 -0
  160. package/widgets/Popup/PopupViewModel.js +1 -1
  161. package/widgets/Popup.js +1 -1
  162. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  163. package/assets/esri/core/workers/chunks/0502641d9a214b37ff29.js +0 -1
  164. package/assets/esri/core/workers/chunks/4f8ce5887102971bfa34.js +0 -2
  165. package/assets/esri/core/workers/chunks/532e3a59888e4cc13bd3.js +0 -2
  166. package/assets/esri/core/workers/chunks/a19be304219808268039.js +0 -2
  167. package/assets/esri/core/workers/chunks/b950ddafba8125c84a5b.js +0 -1
  168. package/assets/esri/core/workers/chunks/de9a1cce70581920f248.js +0 -1
  169. package/views/2d/engine/webgl/shaderGraph/types.js +0 -2
  170. package/views/2d/engine/webgl/shaderGraph/uniformBufferUtils.js +0 -2
  171. /package/assets/esri/core/workers/chunks/{755b2d883fba90c4e688.js.LICENSE.txt → 06c8547521ce9c97b258.js.LICENSE.txt} +0 -0
  172. /package/assets/esri/core/workers/chunks/{a014c17fc210620da738.js.LICENSE.txt → 17e9324a02b69733307a.js.LICENSE.txt} +0 -0
  173. /package/assets/esri/core/workers/chunks/{4f8ce5887102971bfa34.js.LICENSE.txt → 29a20a37e7837142fa6b.js.LICENSE.txt} +0 -0
  174. /package/assets/esri/core/workers/chunks/{a19be304219808268039.js.LICENSE.txt → b82763e9401b16121f8d.js.LICENSE.txt} +0 -0
  175. /package/assets/esri/core/workers/chunks/{532e3a59888e4cc13bd3.js.LICENSE.txt → ffd5285c7b2c83208f87.js.LICENSE.txt} +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3354,5907],{28491(e,t,r){r.d(t,{b:()=>F});var i=r(32680),n=r(49255),o=r(34711),a=r(76597),s=r(72722),l=r(96336),c=r(53466),u=r(72824),h=r(54154),d=r(9169),m=r(12696),f=r(77695),p=r(72233),g=r(42594),v=r(98619),x=r(62602),_=r(22393),y=r(59469),b=r(32482),w=r(51406),M=r(91899),S=r(58614),T=r(20693),C=r(33079),E=r(31821),I=r(63761),A=r(27832),P=r(47630),O=r(14113);function F(e){const t=new O.N5,{attributes:r,vertex:F,fragment:D,varyings:R}=t,{output:B,normalType:N,offsetBackfaces:z,spherical:H,snowCover:L,pbrMode:j,textureAlphaPremultiplied:W,instancedDoublePrecision:U,hasVertexColors:V,hasVertexTangents:G,hasColorTexture:k,hasNormalTexture:$,hasNormalTextureTransform:Z,hasColorTextureTransform:q}=e;if((0,T.NB)(F,e),r.add("position","vec3"),F.inputs.add("position",()=>"position"),R.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(s.B,e),t.include(h.Ge,e),t.include(w.q2,e),!(0,n._o)(B))return t.include(d.E,e),t;t.include(w.Sx,e),t.include(w.MU,e),t.include(w.O1,e),t.include(w.QM,e),(0,T.yu)(F,e),t.include(l.Y,e),t.include(a.d);const Y=0===N||1===N;return Y&&z&&t.include(i.M),t.include(f.J,e),t.include(u.Mh,e),R.add("vPositionLocal","vec3"),t.include(c.U,e),t.include(m.F,e),t.include(U?b.QH:b.LA,e),F.main.add(E.H`
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3354,5907],{28491(e,t,r){r.d(t,{b:()=>F});var i=r(32680),n=r(49255),o=r(34711),a=r(76597),s=r(72722),l=r(96336),c=r(53466),u=r(72824),h=r(54154),d=r(9169),m=r(12696),f=r(77695),p=r(72233),g=r(42594),v=r(98619),x=r(62602),_=r(22393),y=r(59469),b=r(32482),w=r(51406),M=r(91899),S=r(58614),T=r(20693),C=r(33079),E=r(31821),I=r(63761),A=r(27832),O=r(47630),P=r(14113);function F(e){const t=new P.N5,{attributes:r,vertex:F,fragment:D,varyings:R}=t,{output:B,normalType:N,offsetBackfaces:z,spherical:H,snowCover:L,pbrMode:j,textureAlphaPremultiplied:W,instancedDoublePrecision:U,hasVertexColors:V,hasVertexTangents:G,hasColorTexture:k,hasNormalTexture:$,hasNormalTextureTransform:Z,hasColorTextureTransform:q}=e;if((0,T.NB)(F,e),r.add("position","vec3"),F.inputs.add("position",()=>"position"),R.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(s.B,e),t.include(h.Ge,e),t.include(w.q2,e),!(0,n._o)(B))return t.include(d.E,e),t;t.include(w.Sx,e),t.include(w.MU,e),t.include(w.O1,e),t.include(w.QM,e),(0,T.yu)(F,e),t.include(l.Y,e),t.include(a.d);const Y=0===N||1===N;return Y&&z&&t.include(i.M),t.include(f.J,e),t.include(u.Mh,e),R.add("vPositionLocal","vec3"),t.include(c.U,e),t.include(m.F,e),t.include(U?b.QH:b.LA,e),F.main.add(E.H`
2
2
  forwardDefaultMaterialExternalColor();
3
3
 
4
4
  vpos = getVertexInLocalOriginSpace();
@@ -21,7 +21,7 @@
21
21
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
22
22
  }
23
23
  forwardLinearDepthToReadShadowMap();
24
- `),D.include(g.kA,e),D.include(p.n,e),t.include(S.SS,e),D.include(o.HQ,e),t.include(P.D,e),(0,T.yu)(D,e),D.uniforms.add(F.uniforms.get("localOrigin"),new C.t("ambient",e=>e.ambient),new C.t("diffuse",e=>e.diffuse)),k&&D.uniforms.add(new I.N("tex",e=>e.texture)),t.include(y._,e),D.include(_.c,e),t.include(x.r,e),D.include(A.b,e),(0,g.a8)(D),(0,g.eU)(D),(0,v.O4)(D),D.main.add(E.H`
24
+ `),D.include(g.kA,e),D.include(p.n,e),t.include(S.SS,e),D.include(o.HQ,e),t.include(O.D,e),(0,T.yu)(D,e),D.uniforms.add(F.uniforms.get("localOrigin"),new C.t("ambient",e=>e.ambient),new C.t("diffuse",e=>e.diffuse)),k&&D.uniforms.add(new I.N("tex",e=>e.texture)),t.include(y._,e),D.include(_.c,e),t.include(x.r,e),D.include(A.b,e),(0,g.a8)(D),(0,g.eU)(D),(0,v.O4)(D),D.main.add(E.H`
25
25
  discardBySlice(vpos);
26
26
  ${k?E.H`
27
27
  vec4 texColor = texture(tex, ${q?"colorUV":"vuv0"});
@@ -498,7 +498,7 @@
498
498
  ) / jointBilateralWeightSum;
499
499
  }
500
500
  `),e.outputs.add("fragColor","vec4",0),e.outputs.add("fragWeight","vec2",1),t.main.add(l.H`sampleJointBilateralUpscale(uv, fragColor, fragWeight);
501
- fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const g=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationUpscaleDrawParameters:f,build:p},Symbol.toStringTag,{value:"Module"}));r.d(t,["a",0,g])},57323(e,t,r){r.d(t,{b:()=>A});var i=r(32680),n=r(49255),o=r(34711),a=r(76597),s=r(72722),l=r(96336),c=r(53466),u=r(54154),h=r(9169),d=r(12696),m=r(72233),f=r(42594),p=r(98619),g=r(22393),v=r(59469),x=r(32482),_=r(51406),y=r(91899),b=r(58614),w=r(20693),M=r(33079),S=r(31821),T=r(63761),C=r(27832),E=r(47630),I=r(14113);function A(e){const t=new I.N5,{attributes:r,vertex:A,fragment:P,varyings:O}=t,{output:F,offsetBackfaces:D,pbrMode:R,snowCover:B,spherical:N}=e,z=1===R||2===R;if((0,w.NB)(A,e),r.add("position","vec3"),A.inputs.add("position",()=>"position"),O.add("vpos","vec3",{invariant:!0}),t.include(y.A,e),t.include(s.B,e),t.include(u.Ge,e),t.include(_.q2,e),!(0,n._o)(F))return t.include(h.E,e),t;t.include(_.MU,e),(0,w.yu)(t.vertex,e),t.include(l.Y,e),t.include(a.d),D&&t.include(i.M),O.add("vNormalWorld","vec3"),O.add("localvpos","vec3",{invariant:!0}),t.include(c.U,e),t.include(d.F,e),t.include(e.instancedDoublePrecision?x.QH:x.LA,e),A.main.add(S.H`
501
+ fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const g=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationUpscaleDrawParameters:f,build:p},Symbol.toStringTag,{value:"Module"}));r.d(t,["a",0,g])},57323(e,t,r){r.d(t,{b:()=>A});var i=r(32680),n=r(49255),o=r(34711),a=r(76597),s=r(72722),l=r(96336),c=r(53466),u=r(54154),h=r(9169),d=r(12696),m=r(72233),f=r(42594),p=r(98619),g=r(22393),v=r(59469),x=r(32482),_=r(51406),y=r(91899),b=r(58614),w=r(20693),M=r(33079),S=r(31821),T=r(63761),C=r(27832),E=r(47630),I=r(14113);function A(e){const t=new I.N5,{attributes:r,vertex:A,fragment:O,varyings:P}=t,{output:F,offsetBackfaces:D,pbrMode:R,snowCover:B,spherical:N}=e,z=1===R||2===R;if((0,w.NB)(A,e),r.add("position","vec3"),A.inputs.add("position",()=>"position"),P.add("vpos","vec3",{invariant:!0}),t.include(y.A,e),t.include(s.B,e),t.include(u.Ge,e),t.include(_.q2,e),!(0,n._o)(F))return t.include(h.E,e),t;t.include(_.MU,e),(0,w.yu)(t.vertex,e),t.include(l.Y,e),t.include(a.d),D&&t.include(i.M),P.add("vNormalWorld","vec3"),P.add("localvpos","vec3",{invariant:!0}),t.include(c.U,e),t.include(d.F,e),t.include(e.instancedDoublePrecision?x.QH:x.LA,e),A.main.add(S.H`
502
502
  forwardDefaultMaterialExternalColor();
503
503
 
504
504
  vpos = getVertexInLocalOriginSpace();
@@ -516,7 +516,7 @@ fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const g=Obje
516
516
 
517
517
  gl_Position = shouldCullByOpacity() ? vec4(1e38, 1e38, 1e38, 1.0) :
518
518
  ${(0,S.If)(D,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
519
- `);const{hasColorTexture:H,hasColorTextureTransform:L}=e;return P.include(f.kA,e),P.include(m.n,e),t.include(b.SS,e),P.include(o.HQ,e),t.include(E.D,e),(0,w.yu)(P,e),(0,p.Gc)(P),(0,f.a8)(P),(0,f.eU)(P),P.uniforms.add(A.uniforms.get("localOrigin"),A.uniforms.get("view"),new M.t("ambient",e=>e.ambient),new M.t("diffuse",e=>e.diffuse)),H&&P.uniforms.add(new T.N("tex",e=>e.texture)),t.include(v._,e),P.include(g.c,e),P.include(C.b,e),(0,p.O4)(P),P.main.add(S.H`
519
+ `);const{hasColorTexture:H,hasColorTextureTransform:L}=e;return O.include(f.kA,e),O.include(m.n,e),t.include(b.SS,e),O.include(o.HQ,e),t.include(E.D,e),(0,w.yu)(O,e),(0,p.Gc)(O),(0,f.a8)(O),(0,f.eU)(O),O.uniforms.add(A.uniforms.get("localOrigin"),A.uniforms.get("view"),new M.t("ambient",e=>e.ambient),new M.t("diffuse",e=>e.diffuse)),H&&O.uniforms.add(new T.N("tex",e=>e.texture)),t.include(v._,e),O.include(g.c,e),O.include(C.b,e),(0,p.O4)(O),O.main.add(S.H`
520
520
  discardBySlice(vpos);
521
521
  vec4 texColor = ${H?`texture(tex, ${L?"colorUV":"vuv0"})`:" vec4(1.0)"};
522
522
  ${(0,S.If)(H,`${(0,S.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
@@ -554,7 +554,7 @@ fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const g=Obje
554
554
  ${(0,S.If)(B,"mrr = applySnowToMRR(mrr, snow);")}
555
555
  vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, groundNormal, mrr, additionalAmbientIrradiance);`:S.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
556
556
  vec4 finalColor = vec4(shadedColor, opacity_);
557
- outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${(0,S.If)(B,", 1.0")});`),t}const P=Object.freeze(Object.defineProperty({__proto__:null,build:A},Symbol.toStringTag,{value:"Module"}));r.d(t,["R",0,P])},15581(e,t,r){r.d(t,{b:()=>g,g:()=>v});var i=r(37585),n=r(48163),o=r(82048),a=r(52540),s=r(65261),l=r(34845),c=r(77108),u=r(47286),h=r(33094),d=r(20304),m=r(31821),f=r(63761),p=r(14113);function g(){const e=new p.N5,t=e.fragment;return e.include(o.c),e.include(l.Ir),t.include(a.E),t.include(s.C),t.uniforms.add(new h.U("radius",e=>v(e.camera))).code.add(m.H`vec3 sphere[16] = vec3[16](
557
+ outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${(0,S.If)(B,", 1.0")});`),t}const O=Object.freeze(Object.defineProperty({__proto__:null,build:A},Symbol.toStringTag,{value:"Module"}));r.d(t,["R",0,O])},15581(e,t,r){r.d(t,{b:()=>g,g:()=>v});var i=r(37585),n=r(48163),o=r(82048),a=r(52540),s=r(65261),l=r(34845),c=r(77108),u=r(47286),h=r(33094),d=r(20304),m=r(31821),f=r(63761),p=r(14113);function g(){const e=new p.N5,t=e.fragment;return e.include(o.c),e.include(l.Ir),t.include(a.E),t.include(s.C),t.uniforms.add(new h.U("radius",e=>v(e.camera))).code.add(m.H`vec3 sphere[16] = vec3[16](
558
558
  vec3(0.186937, 0.0, 0.0),
559
559
  vec3(0.700542, 0.0, 0.0),
560
560
  vec3(-0.864858, -0.481795, -0.111713),
@@ -659,7 +659,7 @@ return fallOffFunction(vv, vn, 0.1);
659
659
  vec2 uvOffset = uv + rf * blurSize;
660
660
  blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
661
661
  }
662
- fragBlur = b / w_total;`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}));r.d(t,["S",0,d])},43609(e,t,r){r.d(t,{a:()=>o,f:()=>a,n:()=>n});var i=r(34275);function n(e,t){o(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r=2,n=r){const o=t.length/2;let a=0,s=0;if(!(0,i.iu)(t)||(0,i.dk)(t)){for(let i=0;i<o;++i)e[a]=t[s],e[a+1]=t[s+1],a+=r,s+=n;return}const l=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<o;++i)e[a]=Math.max(t[s]/l,-1),e[a+1]=Math.max(t[s+1]/l,-1),a+=r,s+=n;else for(let i=0;i<o;++i)e[a]=t[s]/l,e[a+1]=t[s+1]/l,a+=r,s+=n}function a(e,t,r,i){const n=e.typedBuffer,o=e.typedBufferStride,a=i?.count??e.count;let s=(i?.dstIndex??0)*o;for(let e=0;e<a;++e)n[s]=t,n[s+1]=r,s+=o}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:o,normalizeIntegerBufferView:n},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>h,b:()=>s,c:()=>n,d:()=>a,e:()=>d,f:()=>u,l:()=>c,n:()=>m,t:()=>o}),r(44208);var i=r(72727);function n(e,t,r){o(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r,n=3,o=n){const a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s),c=r[0],u=r[1],h=r[2],d=r[4],m=r[5],f=r[6],p=r[8],g=r[9],v=r[10],x=r[12],_=r[13],y=r[14];let b=0,w=0;for(let r=0;r<l;r++){const r=t[b],i=t[b+1],a=t[b+2];e[w]=c*r+d*i+p*a+x,e[w+1]=u*r+m*i+g*a+_,e[w+2]=h*r+f*i+v*a+y,b+=o,w+=n}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,n=3,o=n){const a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s),c=r[0],u=r[1],h=r[2],d=r[3],m=r[4],f=r[5],p=r[6],g=r[7],v=r[8];let x=0,_=0;for(let r=0;r<l;r++){const r=t[x],i=t[x+1],a=t[x+2];e[_]=c*r+d*i+p*a,e[_+1]=u*r+m*i+g*a,e[_+2]=h*r+f*i+v*a,x+=o,_+=n}}function l(e,t,r,i=3,n=i){const o=Math.min(e.length/i,t.length/n);let a=0,s=0;for(let l=0;l<o;l++)e[s]=r*t[a],e[s+1]=r*t[a+1],e[s+2]=r*t[a+2],a+=n,s+=i;return e}function c(e,t,r,i){u(e.typedBuffer,t.typedBuffer,r,i,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r,i,n=3,o=n){const a=Math.min(e.length/n,t.length/o);let s=0,l=0;const c=1/2.2;for(let u=0;u<a;u++)e[l]=i*(r*t[s])**c,e[l+1]=i*(r*t[s+1])**c,e[l+2]=i*(r*t[s+2])**c,s+=o,l+=n}function h(e,t,r,n=3,o=n){const a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s);let c=0,u=0;for(let i=0;i<l;i++)e[u]=t[c]+r[0],e[u+1]=t[c+1]+r[1],e[u+2]=t[c+2]+r[2],c+=o,u+=n;return e}function d(e,t){m(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function m(e,t,r=3,i=r){const n=Math.min(e.length/r,t.length/i);let o=0,a=0;for(let s=0;s<n;s++){const n=t[o],s=t[o+1],l=t[o+2],c=n*n+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*n,e[a+1]=t*s,e[a+2]=t*l}o+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:u,linearToSRGBView:c,normalize:m,normalizeView:d,scale:l,scaleView:function(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)n[c]=a[l]>>r,n[c+1]=a[l+1]>>r,n[c+2]=a[l+2]>>r,l+=s,c+=o},transformMat3:s,transformMat3View:a,transformMat4:o,transformMat4View:n,translate:h},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>n});var i=r(34727);class n{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return o(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+a(this.range,e-t,r)}minimalMonotonic(e,t,r){return o(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function o(e,t,r,i,n=0,o=!1){return(i-=n)<t?i+=a(e,t-i):i>r&&(i-=a(e,i-r)),o&&i===r&&(i=t),i+n}function a(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const s=new n(0,2*Math.PI),l=(new n(-Math.PI,Math.PI),new n(0,360));r.d(t,["ie",0,l,"uC",0,s])},4341(e,t,r){r.d(t,{I:()=>n});var i=r(26390);class n{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,i.d)(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*o);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;e<Math.max(8,Math.min(this._items.length,o));e++)this._items.push(this._allocator())}}const o=1024},46140(e,t,r){r.d(t,{A:()=>n});var i=r(49186);class n{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new n(this.major,this.minor,this._context)}static parse(e,t=""){const[r,o]=e.split("."),a=/^\s*\d+\s*$/;if(!r?.match||!a.test(r))throw new i.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!o?.match||!a.test(o))throw new i.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(o,10);return new n(s,l,t)}}},61473(e,t,r){function i(e){return e=e||globalThis.location.hostname,c.some(t=>null!=e?.match(t))}function n(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(o)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}r.d(t,{EM:()=>n,b5:()=>i});const o=/^devext\.arcgis\.com$/,a=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,o,a,/^jsapps\.esri\.com$/,s,l]},88340(e,t,r){function i(){return new Float32Array(2)}function n(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function o(){return i()}function a(){return n(1,1)}function s(){return n(1,0)}function l(){return n(0,1)}r.d(t,{fA:()=>n,vt:()=>i});const c=o(),u=a(),h=s(),d=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:h,UNIT_Y:d,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:n,ones:a,unitX:s,unitY:l,zeros:o},Symbol.toStringTag,{value:"Module"})),r.d(t,["Un",0,u,"uY",0,c])},91829(e,t,r){function i(){return[0,0,0,0]}function n(e,t,r,i){return[e,t,r,i]}function o(){return n(1,1,1,1)}function a(){return n(1,0,0,0)}function s(){return n(0,1,0,0)}function l(){return n(0,0,1,0)}function c(){return n(0,0,0,1)}r.d(t,{_Y:()=>c,fA:()=>n,vt:()=>i});const u=[0,0,0,0],h=o(),d=a(),m=s(),f=l(),p=c();Object.freeze(Object.defineProperty({__proto__:null,ONES:h,UNIT_W:p,UNIT_X:d,UNIT_Y:m,UNIT_Z:f,ZEROS:u,clone:function(e){return[e[0],e[1],e[2],e[3]]},create:i,freeze:function(e,t,r,i){return[e,t,r,i]},fromArray:function(e,t=[0,0,0,0]){const r=Math.min(4,e.length);for(let i=0;i<r;++i)t[i]=e[i];return t},fromValues:n,ones:o,unitW:c,unitX:a,unitY:s,unitZ:l,zeros:function(){return[0,0,0,0]}},Symbol.toStringTag,{value:"Module"})),r.d(t,["Un",0,h,"uY",0,u])},78955(e,t,r){r.d(t,{Bw:()=>g,C:()=>n,Cc:()=>y,LI:()=>d,Om:()=>_,S8:()=>x,T9:()=>h,WQ:()=>a,Z0:()=>b,aI:()=>M,hG:()=>p,hZ:()=>o,hs:()=>m,jk:()=>u,m3:()=>v,t2:()=>w});var i=r(34304);function n(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}function a(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function s(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function l(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function c(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function u(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}function h(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}function d(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}function m(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 f(e,t){const r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],o=t[3]-e[3];return Math.sqrt(r*r+i*i+n*n+o*o)}function p(e,t){const r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],o=t[3]-e[3];return r*r+i*i+n*n+o*o}function g(e){const t=e[0],r=e[1],i=e[2],n=e[3];return Math.sqrt(t*t+r*r+i*i+n*n)}function v(e){const t=e[0],r=e[1],i=e[2],n=e[3];return t*t+r*r+i*i+n*n}function x(e,t){const r=t[0],i=t[1],n=t[2],o=t[3];let a=r*r+i*i+n*n+o*o;return a>0&&(a=1/Math.sqrt(a),e[0]=r*a,e[1]=i*a,e[2]=n*a,e[3]=o*a),e}function _(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function y(e,t,r,i){const n=t[0],o=t[1],a=t[2],s=t[3];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e[2]=a+i*(r[2]-a),e[3]=s+i*(r[3]-s),e}function b(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*a,e[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*a,e[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*a,e[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*a,e}function w(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function M(e,t){const r=e[0],n=e[1],o=e[2],a=e[3],s=t[0],l=t[1],c=t[2],u=t[3],h=(0,i.FD)();return Math.abs(r-s)<=h*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-l)<=h*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-c)<=h*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(a-u)<=h*Math.max(1,Math.abs(a),Math.abs(u))}const S=s,T=l,C=c,E=f,I=p,A=g,P=v;Object.freeze(Object.defineProperty({__proto__:null,add:a,ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},copy:n,copyVec3:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},dist:E,distance:f,div:C,divide:c,dot:_,equals:M,exactEquals:w,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},inverse:function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},len:A,length:g,lerp:y,max:h,min:u,mul:T,multiply:l,negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},normalize:x,random:function(e,t=1){const r=i.Ov;let n,o,a,s,l,c;do{n=2*r()-1,o=2*r()-1,l=n*n+o*o}while(l>=1);do{a=2*r()-1,s=2*r()-1,c=a*a+s*s}while(c>=1);const u=Math.sqrt((1-l)/c);return e[0]=t*n,e[1]=t*o,e[2]=t*a*u,e[3]=t*s*u,e},round:d,scale:m,scaleAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e},set:o,sqrDist:I,sqrLen:P,squaredDistance:p,squaredLength:v,str:function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},sub:S,subtract:s,transformMat4:b,transformQuat:function(e,t,r){const i=t[0],n=t[1],o=t[2],a=r[0],s=r[1],l=r[2],c=r[3],u=c*i+s*o-l*n,h=c*n+l*i-a*o,d=c*o+a*n-s*i,m=-a*i-s*n-l*o;return e[0]=u*c+m*-a+h*-l-d*-s,e[1]=h*c+m*-s+d*-a-u*-l,e[2]=d*c+m*-l+u*-s-h*-a,e[3]=t[3],e}},Symbol.toStringTag,{value:"Module"}))},69397(e,t,r){r.d(t,{Qf:()=>s,Qh:()=>o,lM:()=>n});var i=r(34275);function n(e){if(!e)return 0;let t=c;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r],!1));return t}function o(e){if(!e)return 0;if("number"==typeof e[0])return s(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return l(e,8);let r=u;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=c;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e,t=!0){switch(typeof e){case"object":return t?o(e):c;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(...e){return e.reduce((e,t)=>e+(t?(0,i.iu)(t)?t.byteLength+h:Array.isArray(t)?l(t,16):0:0),0)}function l(e,t){return u+e.length*t}const c=32,u=16,h=145},93146(e,t,r){r.d(t,{z:()=>n});class i{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(async e=>(this.module=e,e))),this._promise}}function n(e){return new i(async()=>{const t=await e();return!1===t.isLoaded?.()&&await t.load(),t})}},65806(e,t,r){r.d(t,{g:()=>a});var i=r(51850),n=r(91218),o=r(9762);function a(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r))return s[0]=e.x,s[1]=e.y,s[2]=e.z??0,(0,o.projectBuffer)(s,e.spatialReference,0,t,r,0);const a=(0,n.tryProject)(e,r,i);return!!a&&(t[0]=a.x,t[1]=a.y,t[2]=a.z??0,!0)}const s=(0,i.vt)()},27993(e,t,r){r.d(t,{F:()=>s});var i=r(91218),n=r(16930),o=r(9762),a=r(65806);function s(e,t,r,n){return!(null==t||null==n||e.length<2)&&((0,i.canProjectWithoutEngine)(t,n)?(0,o.projectBuffer)(e,t,0,r,n,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,a.g)(l,r,n)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:n.A.WGS84,type:"point"}},97146(e,t,r){r.d(t,{Dg:()=>o,lC:()=>s,my:()=>a,tM:()=>h,uW:()=>n});var i=r(34275);function n(e){return o(e,!0)}function o(e,t){if(Array.isArray(e)){if(e.length<1024)return e}else if(e.length<1024)return Array.from(e);let r=!0,n=!0;return e.some((e,t)=>(r=r&&0===e,n=n&&e===t,!r&&!n)),r?function(e){if(1===e)return c;if(e<1024)return new Array(e).fill(0);if(e>m.length){const t=Math.max(2*m.length,e);m=new Uint8Array(t)}return new Uint8Array(m.buffer,0,e)}(e.length):n?h(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(const r of e){if(r>=65536)return(0,i.iu)(e)?e:new Uint32Array(e);r>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function a(e,t=e){return e<=1024?new Array(e):t<=65536?new Uint16Array(e):new Uint32Array(e)}function s(e,t,r){if(0===t.length)return e.slice();if(0===e.length)return t.slice();const i=a(e.length+t.length,r);for(let t=0;t<e.length;++t)i[t]=e[t];for(let r=0;r<t.length;++r)i[e.length+r]=t[r];return i}let l=d(131072);const c=[0],u=(()=>{const e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function h(e){return 1===e?c:e<1024?Array.from(new Uint16Array(u.buffer,0,e)):e<u.length?new Uint16Array(u.buffer,0,e):(e>l.length&&(l=d(Math.max(2*l.length,e))),new Uint32Array(l.buffer,0,e))}function d(e){const t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let m=new Uint8Array(65536)},72727(e,t,r){function i(e,t,r){if(t<=0)return 0;const i=e-r;return i<0?0:Math.floor(i/t)+1}r.d(t,{k:()=>i}),r(53966)},90239(e,t,r){function i(e){switch(e){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}r.d(t,{GJ:()=>i})},82919(e,t,r){r.d(t,{DV:()=>x,C:()=>g,vt:()=>f,Qy:()=>p,ui:()=>v,ST:()=>M,bU:()=>S,pw:()=>w,m7:()=>_,ZU:()=>y,GH:()=>b,c8:()=>C});var i=r(4341),n=r(58083),o=r(35522),a=r(51850),s=r(78955),l=r(91829),c=r(70328),u=r(71351);function h(e){return e?{ray:(0,u.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,u.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>h());var d=r(27921),m=r(32114);function f(e){return e?[(0,d.vt)(e[0]),(0,d.vt)(e[1]),(0,d.vt)(e[2]),(0,d.vt)(e[3]),(0,d.vt)(e[4]),(0,d.vt)(e[5])]:[(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)()]}function p(){return[(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)()]}function g(e,t){for(let r=0;r<E;r++)(0,d.C)(e[r],t[r]);return e}function v(e,t,r,i=O){const a=(0,n.lw)(m.Rc.get(),t,e);(0,n.B8)(a,a);for(let e=0;e<I;++e){const t=(0,s.Z0)(m.Km.get(),A[e],a);(0,o.hZ)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}x(r,i)}function x(e,t){(0,d.Cr)(t[4],t[0],t[3],e[0]),(0,d.Cr)(t[1],t[5],t[6],e[1]),(0,d.Cr)(t[4],t[5],t[1],e[2]),(0,d.Cr)(t[3],t[2],t[6],e[3]),(0,d.Cr)(t[0],t[1],t[2],e[4]),(0,d.Cr)(t[5],t[4],t[7],e[5])}function _(e,t){return y(e,t.center,t.radius)}function y(e,t,r){for(let i=0;i<E;i++){const n=e[i];if(n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]>=r)return!1}return!0}function b(e,t,r){const i=(0,c.gX)(t,F),n=(0,c.VL)(t)/2,a=(0,c.yr)(t)/2,s=(0,c.uJ)(t)/2;return r?function(e,t,r,i,n,a){const s=(0,o.Z0)(D,t,a);for(let t=0;t<E;t++){const o=e[t];if(o[0]*s[0]+o[1]*s[1]+o[2]*s[2]+o[3]-(Math.abs(o[0]*a[0]+o[1]*a[1]+o[2]*a[2])*r+Math.abs(o[0]*a[4]+o[1]*a[5]+o[2]*a[6])*i+Math.abs(o[0]*a[8]+o[1]*a[9]+o[2]*a[10])*n)>0)return!1}return!0}(e,i,n,a,s,r):function(e,t,r,i,n){for(let o=0;o<E;o++){const a=e[o];if(a[0]*t[0]+a[1]*t[1]+a[2]*t[2]+a[3]-(Math.abs(a[0])*r+Math.abs(a[1])*i+Math.abs(a[2])*n)>0)return!1}return!0}(e,i,n,a,s)}function w(e,t){return T(e,function(e,t=h()){return(0,u.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,P.get()))}function M(e,t,r){return T(e,function(e,t,r=h()){const i=(0,o.Bw)(e.vector);return(0,u.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,P.get()))}function S(e,t){for(let r=0;r<E;r++)if((0,d.mN)(e[r],t)>0)return!1;return!0}function T(e,t){for(let r=0;r<E;r++)if(!(0,d.$Q)(e[r],t))return!1;return!0}const C={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},E=6,I=8,A=[(0,l.fA)(-1,-1,-1,1),(0,l.fA)(1,-1,-1,1),(0,l.fA)(1,1,-1,1),(0,l.fA)(-1,1,-1,1),(0,l.fA)(-1,-1,1,1),(0,l.fA)(1,-1,1,1),(0,l.fA)(1,1,1,1),(0,l.fA)(-1,1,1,1)],P=new i.I(h),O=p(),F=(0,a.vt)(),D=(0,a.vt)()},11964(e,t,r){r.d(t,{Cr:()=>u,LV:()=>c,_I:()=>h,vt:()=>l});var i=r(34727),n=r(4341),o=r(35522),a=r(51850),s=r(32114);function l(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function c(e,t){const r=d.get();return r.origin=e,r.vector=t,r}function u(e,t,r=l()){return(0,o.C)(r.origin,e),(0,o.Re)(r.vector,t,e),r}function h(e,t,r){return function(e,t,r,n,a){const{vector:l,origin:c}=e,u=(0,o.Re)(s.rq.get(),t,c),h=(0,o.Om)(l,u)/(0,o.m3)(l);return(0,o.hs)(a,l,(0,i.qE)(h,0,1)),(0,o.WQ)(a,a,e.origin)}(e,t,0,0,r)}(0,a.vt)(),(0,a.vt)();const d=new n.I(()=>l())},52039(e,t,r){r.d(t,{O7:()=>h,el:()=>l});var i=r(69052),n=(r(49186),r(17676)),o=(r(5443),r(39829),r(82799),r(16930)),a=r(93146),s=(r(80754),r(21325));async function l(e,t,r){Array.isArray(e)||(e=[e]),null!=t&&"object"==typeof t&&"authMode"in t&&(r=t);let i=null;for(const t of e)i??=t?.spatialReference;if(!i)return e;const o=(0,s.Vp)(i);if(!o)return e;const[a,l]=o.valid;let h=!1;for(const t of e){if(!t)continue;if("point"===t.type){h||=t.x>=l,h||=t.x<=a;continue}const{extent:e}=t;if(null==e){h=!0;break}h||=e.xmin>=l,h||=e.xmin<=a,h||=e.xmax>=l,h||=e.xmax<=a}if(!h)return e;const[{foldInto360Range:d},m]=await(0,n.qr)(Promise.all([c.getImportPromise(),u.getImportPromise()]),r),f=m.fromSpatialReference(i);return e.map(e=>{if(null==e||"mesh"===e.type)return e;const t=m.fromGeometry(e),r=m.toGeometry(d(t,f),i);return"extent"===e.type&&1===r?.rings.length?r.extent:r})}const c=(0,a.z)(()=>r.e(4144).then(r.bind(r,4144))),u=(0,a.z)(()=>Promise.all([r.e(9187),r.e(8885),r.e(5756),r.e(3299),r.e(1550)]).then(r.bind(r,78125)));function h(e,t,r){const i=(0,s.Vp)(r);if(null==i)return e;const[n,o]=i.valid,a=2*o;let l=0,c=0;t>o?l=Math.ceil(Math.abs(t-o)/a):t<n&&(l=-Math.ceil(Math.abs(t-n)/a)),e>o?c=Math.ceil(Math.abs(e-o)/a):e<n&&(c=-Math.ceil(Math.abs(e-n)/a));let u=e+(l-c)*a;const h=u-t;return h>o?u-=a:h<n&&(u+=a),u}function d(e){const t=(0,s.Vp)(e);if(null==t)return null;const[r,n]=t.valid;return new i.hr(r,n)}const m=d(o.A.WGS84);d(o.A.WebMercator),r.d(t,["Y_",0,m])},80754(e,t,r){r.d(t,{kS:()=>c,kd:()=>l});var i=r(82799),n=r(16930),o=r(60408),a=r(52006);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator}),minus180Line:new i.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.A({paths:[[[180,-180],[180,180]]],spatialReference:n.A.WGS84}),minus180Line:new i.A({paths:[[[-180,-180],[-180,180]]],spatialReference:n.A.WGS84})}};function l(e,t){return Math.ceil((e-t)/(2*t))}function c(e,t){if((0,a.Ed)(e))for(const r of function(e){return(0,o.Bi)(e)?e.curveRings:e.curvePaths}(e))for(const e of r){if((0,a.aO)(e)){const[r,i]=e.c;r[0]+=t,i[0]+=t;continue}if((0,a.FG)(e)){const[r,i]=e.a;r[0]+=t,i[0]+=t;continue}if((0,a.n1)(e)){const[r,i,n]=e.b;r[0]+=t,i[0]+=t,n[0]+=t;continue}e[0]+=t}for(const r of function(e){return(0,o.Bi)(e)?e.rings:e.paths}(e))for(const e of r)e[0]+=t;return e}r.d(t,["j7",0,s])},71351(e,t,r){r.d(t,{C:()=>u,Cr:()=>h,LV:()=>c,fA:()=>d,vt:()=>s}),r(4576);var i=r(4341),n=(r(77690),r(29242)),o=r(35522),a=r(51850);function s(e){return e?l((0,a.o8)(e.origin),(0,a.o8)(e.direction)):l((0,a.vt)(),(0,a.vt)())}function l(e,t){return{origin:e,direction:t}}function c(e,t){const r=m.get();return r.origin=e,r.direction=t,r}function u(e,t=s()){return d(e.origin,e.direction,t)}function h(e,t,r=s()){return(0,o.C)(r.origin,e),(0,o.Re)(r.direction,t,e),r}function d(e,t,r=s()){return(0,o.C)(r.origin,e),(0,o.C)(r.direction,t),r}r(32114);const m=new i.I(()=>s());(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,n.vt)()},94008(e,t,r){r.d(t,{iy:()=>m}),r(44208),r(53966);var i=r(34727),n=r(34304),o=r(58083),a=r(35522),s=r(51850),l=r(91829),c=r(34275);var u=r(71351),h=r(44280),d=r(32114);class m{constructor(e=0,t=0,r=0,i=0){this.radius=i,"number"==typeof e?this._center=(0,s.fA)(e,t,r):function(e){return t=e,(0,c.vZ)(t)&&t.length>=3||function(e){return((0,c.aI)(e)||Array.isArray(e))&&e.length>=3}(e);var t}(e)||function(e){return(t=e)instanceof Float32Array&&t.length>=4||function(e){return Array.isArray(e)&&e.length>=4}(e);var t}(e)?(this._center=(0,s.ci)(e),this.radius=4===e.length?e[3]:t):(this._center=(0,s.o8)(e.center),this.radius=e.radius)}get isValid(){return this.radius>=0}invalidate(){this.radius=-1}get center(){return this._center}set center(e){(0,a.C)(this.center,e)}exactEquals(e){return(0,a.aI)(this._center,e.center)&&this.radius===e.radius}copyFrom(e){return e!==this&&((0,a.C)(this._center,e.center),this.radius=e.radius),this}clone(){return new m(this.center,this.radius)}toVec4(){return(0,l.fA)(this.center[0],this.center[1],this.center[2],this.radius)}contains(e){return(0,a.hG)(this.center,e)<=this.radius**2}intersects(e){const t=this.radius+e.radius;return(0,a.hG)(this.center,e.center)<=t*t}intersectRay(e,t){if(null==e)return!1;if(!this._intersect(e,f))return!1;let{t0:r,t1:i}=f;if((r<0||i<r&&i>0)&&(r=i),r<0)return!1;if(t){const{origin:i,direction:n}=e;t[0]=i[0]+n[0]*r,t[1]=i[1]+n[1]*r,t[2]=i[2]+n[2]*r}return!0}intersectLine(e,t){const r=(0,u.Cr)(e,t);if(!this._intersect(r,f))return[];const{origin:i,direction:o}=r,{t0:l,t1:c}=f,h=e=>{const t=(0,s.vt)();return(0,a.Ln)(t,i,o,e),this.projectPoint(t,t)};return Math.abs(l-c)<(0,n.FD)()?[h(l)]:[h(l),h(c)]}_intersect(e,t){const{origin:r,direction:i}=e,n=p;n[0]=r[0]-this.center[0],n[1]=r[1]-this.center[1],n[2]=r[2]-this.center[2];const o=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(0===o)return!1;const a=2*(i[0]*n[0]+i[1]*n[1]+i[2]*n[2]),s=a*a-4*o*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-this.radius**2);if(s<0)return!1;const l=Math.sqrt(s);return t.t0=(-a-l)/(2*o),t.t1=(-a+l)/(2*o),!0}projectPoint(e,t){const r=(0,a.Re)(d.rq.get(),e,this.center),i=(0,a.hs)(d.rq.get(),r,this.radius/(0,a.Bw)(r));return(0,a.WQ)(t,i,this.center)}closestPointOnSilhouette(e,t){const r=d.rq.get(),i=d.Rc.get();(0,a.$A)(r,e.origin,e.direction),(0,a.$A)(t,r,e.origin),(0,a.hs)(t,t,1/(0,a.Bw)(t)*this.radius);const n=this._angleToSilhouette(e.origin),s=(0,h.g7)(e.origin,t);return(0,o.$0)(i,s+n,r),(0,a.Z0)(t,t,i),t}frustumCoverage(e,t,r){const i=this.radius,n=i*i,o=e+.5*Math.PI,a=t*t+n-2*Math.cos(o)*t*i,s=Math.sqrt(a),l=a-n;if(l<=0)return.5;const c=Math.sqrt(l),u=Math.acos(c/s)-Math.asin(i/(s/Math.sin(o)));return Math.min(1,(u+.5*r)/r)}_angleToSilhouette(e){const t=(0,a.Re)(d.rq.get(),e,this.center),r=(0,a.Bw)(t),n=this.radius,o=n+Math.abs(n-r);return(0,i.XM)(n/o)}union(e){const t=(0,a.Io)(this._center,e.center),r=this.radius,i=e.radius;return t+i<r?this:t+r<i?(this.copyFrom(e),this):((0,a.Cc)(this._center,this._center,e.center,(t+i-r)/(2*t)),this.radius=(t+r+i)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}signedDistanceToPlane(e){const{center:t,radius:r}=this,i=e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3];return i<0?Math.min(i+r,0):Math.max(i-r,0)}}new m;const f={t0:0,t1:0},p=(0,s.vt)();(0,s.vt)(),(0,s.vt)()},48295(e,t,r){r.d(t,{BU:()=>u,Ui:()=>s,cq:()=>c,k3:()=>h,rb:()=>d});var i=r(4341),n=r(35522),o=r(51850),a=r(11964);function s(e,t,r){const i=1e-5,{direction:o,origin:a}=t,{p0:s,p1:l,p2:c}=e,u=l[0]-s[0],h=l[1]-s[1],d=l[2]-s[2],m=c[0]-s[0],f=c[1]-s[1],p=c[2]-s[2],g=o[1]*p-f*o[2],v=o[2]*m-p*o[0],x=o[0]*f-m*o[1],_=u*g+h*v+d*x;if(_>-i&&_<i)return!1;const y=1/_,b=a[0]-s[0],w=a[1]-s[1],M=a[2]-s[2],S=y*(b*g+w*v+M*x);if(S<0||S>1)return!1;const T=w*d-h*M,C=M*u-d*b,E=b*h-u*w,I=y*(o[0]*T+o[1]*C+o[2]*E);return!(I<0||S+I>1||(r&&((0,n.hs)(r,o,y*(m*T+f*C+p*E)),(0,n.WQ)(r,a,r)),0))}function l(e,t,r){const[i,n]=e,[o,a]=t,[s,l]=r;return.5*((o-i)*(l-n)-(a-n)*(s-i))}function c(e,t,r,i,n=0){const o=l(i,e,t),a=l(i,t,r),s=l(i,r,e);return!((o<-n||a<-n||s<-n)&&(o>n||a>n||s>n))}function u(e,t,r){return(0,n.Re)(m,t,e),(0,n.Re)(f,r,e),.5*(0,n.Bw)((0,n.$A)(m,m,f))}function h(e,t,r,i,o){(0,n.jb)(m,i,r),(0,n.jb)(p,o,r),(0,n.jb)(f,t,r);const a=(0,n.Om)(m,f),s=(0,n.Om)(p,f);if(a<=0&&s<=0)return void(0,n.C)(e,r);(0,n.jb)(f,t,i);const l=(0,n.Om)(m,f),c=(0,n.Om)(p,f);if(l>=0&&c<=l)return void(0,n.C)(e,i);const u=a*c-l*s;if(u<=0&&a>=0&&l<=0)return void(0,n.Ln)(e,r,m,a/(a-l));(0,n.jb)(f,t,o);const h=(0,n.Om)(m,f),d=(0,n.Om)(p,f);if(d>=0&&h<=d)return void(0,n.C)(e,o);const g=h*s-a*d;if(g<=0&&s>=0&&d<=0)return void(0,n.Ln)(e,r,p,s/(s-d));const v=l*d-h*c;if(v<=0&&c-l>=0&&h-d>=0)return(0,n.jb)(f,o,i),void(0,n.Ln)(e,i,f,(c-l)/(c-l+(h-d)));const x=1/(v+g+u);(0,n.C)(e,r),(0,n.Ln)(e,e,m,g*x),(0,n.Ln)(e,e,p,u*x)}function d(e,t,r,i){(0,n.jb)(m,r,t),(0,n.jb)(f,i,t),(0,n.$A)(e,m,f);const o=(0,n.Bw)(e);return 0!==o&&((0,n.hs)(e,e,1/o),!0)}r(32114),new i.I(a.vt),new i.I(()=>{return e?{p0:(0,o.o8)(e.p0),p1:(0,o.o8)(e.p1),p2:(0,o.o8)(e.p2)}:{p0:(0,o.vt)(),p1:(0,o.vt)(),p2:(0,o.vt)()};var e});const m=(0,o.vt)(),f=(0,o.vt)(),p=(0,o.vt)()},38969(e,t,r){r.d(t,{i:()=>n});var i=r(37955);function n(e,t){return new Promise((r,n)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",n)))})}},21015(e,t,r){r.d(t,{R:()=>l});var i=r(11254),n=r(60999),o=r(49186),a=r(17676),s=r(84952);class l{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,s.DB)(e)?((0,a.Te)(t),(0,s.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);const s=await(0,n.Ke)((0,i.A)(t,{responseType:e,...r}));if(s.ok)return s.value.data;throw(0,a.QP)(s.error),new o.A("gltf-loader-request-error",`Request for resource failed: ${s.error}`)}}},84498(e,t,r){r.d(t,{x:()=>a});var i=r(34275),n=r(97146),o=r(63907);function a(e,t){switch(t){case o.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,n.tM)(e):(0,i.mg)(e)?new Uint16Array(e):e}(e);case o.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,i=(0,n.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let n=0;n<r;n+=1)n%2==0?(i[t++]=e[n],i[t++]=e[n+1],i[t++]=e[n+2]):(i[t++]=e[n+1],i[t++]=e[n],i[t++]=e[n+2])}return i}(e);case o.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}const n=e[0];let o=e[1],a=0;for(let t=0;t<r;++t){const r=e[t+2];i[a++]=n,i[a++]=o,i[a++]=r,o=r}return i}(e)}}},51530(e,t,r){r.d(t,{KB:()=>a,Xi:()=>n,pn:()=>s,x3:()=>o});var i=r(44208);class n{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function o(e){return"encoded-mesh-texture"===e?.type}async function a(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function s(e,t){if("image/ktx2"===t)return new n(e);const r=new Blob([e],{type:t});let o=URL.createObjectURL(r);switch(t){case"image/jpeg":o+="#.jpg";break;case"image/png":o+="#.png"}const a=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{n(),e(a)},i=e=>{n(),t(e)},n=()=>{URL.revokeObjectURL(o),a.removeEventListener("load",r),a.removeEventListener("error",i)};a.addEventListener("load",r),a.addEventListener("error",i),a.src=o});try{a.src=o,await a.decode()}catch{}return URL.revokeObjectURL(o),a}},55907(e,t,r){r.d(t,{fetch:()=>di});var i=r(40876),n=r(61473),o=r(34727),a=r(77690),s=r(29242),l=r(58083),c=r(9093),u=r(48163),h=r(35522),d=r(51850),m=r(70328);function f(e,t=!1){return e<=1024?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var p=r(13030),g=r(73354),v=r(50867),x=r(43609),_=r(21015),y=r(84498),b=r(51530),w=r(88340);function M(e){if(null==e)return null;const t=null!=e.offset?e.offset:w.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:w.Un,n=(0,s.fA)(1,0,0,0,1,0,t[0],t[1],1),o=(0,s.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,s.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,s.vt)();return(0,a.lw)(c,o,l),(0,a.lw)(c,n,c),c}class S{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class T{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new S,this.numberOfVertices=0}}var C=r(11254),E=r(60999),I=r(49186),A=r(53966),P=r(69397);class O{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(const t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){const r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(const e of this._outer)yield e}*values(){for(const e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(const[e,t]of this._outer)for(const[r,i]of t)yield[e,r,i]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,i)=>e(t,r,i)))}copy(){const e=new O;return this.forAll((t,r,i)=>e.set(r,i,t)),e}}var F=r(17676),D=r(46140),R=r(97146);async function B(e,t){return(await(0,C.A)(e,{responseType:"image",...t})).data}var N=r(46610),z=r(34275),H=r(20498);function L(e){if(e.length<1024)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,z.LW)(e)?(0,H.pX)().from(e):(0,z.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return(0,z.vZ)(e)?Float32Array.from(e):Uint32Array.from(e);default:return Float64Array.from(e)}}var j=r(15142),W=r(94008),U=r(620);class V{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this._readPosition=r,this._children=void 0,(0,U.vA)(e.length>=1);const i=e.length;Z.clear();const n=(0,m.Ie)();for(let o=0;o<i;++o){const i=t*e[o];for(let e=0;e<t;++e){const t=i+e;Z.push(t),(0,m.iT)(n,r(G,t))}}this.box=n;const o=new W.iy,a=(0,m.gX)(n,o.center);let s=.5*Math.max((0,m.VL)(n),(0,m.yr)(n),(0,m.uJ)(n)),l=s*s;for(let e=0;e<Z.length;++e){const t=r(G,Z.at(e)),i=(0,h.Re)(t,t,a),n=(0,h.uE)(i);if(n<=l)continue;const o=Math.sqrt(n),c=.5*(o-s);s+=c,l=s*s,(0,h.Ln)(a,a,i,c/o)}o.radius=s,this.sphere=o,Z.clear()}get children(){if(this._children)return this._children;const e=this.box;if((0,m.TF)(e)<=1)return;const{_readPosition:t,_numIndexPerPrimitive:r,primitiveIndices:i}=this,n=(0,m.gX)(e,G),o=i.length,a=new Uint8Array(o),s=[0,0,0,0,0,0,0,0];for(let e=0;e<o;++e){const o=r*i[e],l=t(k,o);for(let e=1;e<r;++e)(0,h.jk)(l,l,t($,o+e));const c=(l[0]<n[0]?1:0)|(l[1]<n[1]?2:0)|(l[2]<n[2]?4:0);a[e]=c,++s[c]}let l=0;for(let e=0;e<8;++e)s[e]>0&&++l;if(l<2)return;const c=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0];for(let e=0;e<8;++e)s[e]>0&&(c[e]=new Uint32Array(s[e]));s.fill(0);for(let e=0;e<o;++e){const t=a[e];c[t][s[t]++]=i[e]}const u=new Array;for(let e=0;e<8;++e){const i=c[e];void 0!==i&&u.push(new V(i,r,t))}return this._children=u,this._children}static prune(){Z.prune()}}const G=(0,d.vt)(),k=(0,d.vt)(),$=(0,d.vt)(),Z=new j.A({deallocator:null});var q=r(24326);class Y{constructor(e){this.id=(0,q.c)(),this._attributes=new Map;for(const[t,r]of e)this._attributes.set(t,{...r,indices:(0,R.Dg)(r.indices)})}get attributes(){return this._attributes}}var X=r(48295);const K=(0,d.vt)(),J=(0,d.vt)(),Q=(0,d.vt)(),ee=(0,d.vt)();class te{constructor(){this.uid=(0,q.c)()}}class re extends te{constructor(e){super(),this.highlightName=e,this.channel=0}}var ie=r(94656);class ne extends Y{constructor(e,t,r=null,i=0,n=null,o=-1,a,s){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=n,this.edgeIndicesLength=o,this.baseGeometry=a,this.drawIndices=s,this._readPrimitivePosition=null,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,U.vA)((e?.useIndexing??!1)===(null!=s),"Material index requirement and Geometry must match"),this.edgeIndicesLength<0&&(this.edgeIndicesLength=this.indexCount)}get readPrimitivePosition(){return this._readPrimitivePosition??=function(e,t){const{data:r,indices:i,size:n,stride:o}=e;return(0,U.vA)(2===n||3===n||4===n,"Position attribute must have 2, 3 or 4 components"),2===n?null!=t?(e,n)=>{const a=i[t[n]]*o;return e[0]=r[a],e[1]=r[a+1],e[2]=-2,e}:(e,t)=>{const n=i[t]*o;return e[0]=r[n],e[1]=r[n+1],e[2]=-2,e}:null!=t?(e,n)=>{const a=i[t[n]]*o;return e[0]=r[a],e[1]=r[a+1],e[2]=r[a+2],e}:function(e,t,r){return(i,n)=>{const o=t[n]*r;return i[0]=e[o],i[1]=e[o+1],i[2]=e[o+2],i}}(r,i,o)}(this.positionAttribute,this.drawIndices),this._readPrimitivePosition}_invalidateReadPrimitivePosition(){this._readPrimitivePosition=null}instantiate(e={}){const t=new ne(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:L(t.data)},this._attributes.set(e,t),"position"===e&&this._invalidateReadPrimitivePosition()),t}setAttributeData(e,t){const r=this._attributes.get(e);r?(this._attributes.set(e,{...r,exclusive:!0,data:t}),"position"===e&&this._invalidateReadPrimitivePosition()):(0,ie.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get primitivePositionIndices(){return void 0!==this._vertexPositionIndicesCache||(this._vertexPositionIndicesCache=this._computePrimitivePositionIndices()),this._vertexPositionIndicesCache}_computePrimitivePositionIndices(){const{drawIndices:e}=this,t=this.positionAttribute;if(null!=e&&null!=t){const r=new Array;for(const i of e)r.push(t.indices[i]);return r}return t?.indices??null}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this.drawIndices??this.positionAttribute?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!this._calculateAttachmentOrigin(e)&&(null!=this._transformation&&(0,h.Z0)(e,e,this._transformation),!0)}_calculateAttachmentOrigin(e){return 0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e)}_computeAttachmentOriginTriangles(e){return function(e,t,r){if(r<=0)return!1;(0,h.hZ)(e,0,0,0),(0,h.hZ)(ee,0,0,0);let i=0,n=0;for(let o=0;o<r;++o){const r=3*o;t(K,r),t(J,r+1),t(Q,r+2);const a=(0,X.BU)(K,J,Q);a?((0,h.WQ)(K,K,J),(0,h.WQ)(K,K,Q),(0,h.hs)(K,K,1/3*a),(0,h.WQ)(e,e,K),i+=a):((0,h.WQ)(ee,ee,K),(0,h.WQ)(ee,ee,J),(0,h.WQ)(ee,ee,Q),n+=3)}return!(0===n&&0===i||(0!==i?((0,h.hs)(e,e,1/i),0):0===n||((0,h.hs)(e,ee,1/n),0)))}(e,this.readPrimitivePosition,this.indexCount/3)}_computeAttachmentOriginLines(e){const{indexCount:t}=this;return function(e,t,r,i){if(r<=0)return!1;(0,h.hZ)(e,0,0,0),(0,h.hZ)(ee,0,0,0);let n=0,o=0;const a=r-1,s=a+(i?2:0);for(let r=0;r<s;r+=2){const i=r<a?r+1:0;t(K,r<a?r:a),t(J,i),(0,h.hs)(K,(0,h.WQ)(K,K,J),.5);const s=(0,h.xg)(K,J);s>0?((0,h.WQ)(e,e,(0,h.hs)(K,K,s)),n+=s):0===n&&((0,h.WQ)(ee,ee,K),o++)}return 0!==n?((0,h.hs)(e,e,1/n),!0):0!==o&&((0,h.hs)(e,ee,1/o),!0)}(e,this.readPrimitivePosition,t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t>2}(this.material.parameters,t))}_computeAttachmentOriginPoints(e){return function(e,t,r){if(r<=0)return!1;(0,h.hZ)(e,0,0,0);let i=NaN,n=NaN,o=NaN,a=0;for(let s=0;s<r;s++){const r=t(K,s);r[0]===i&&r[1]===n&&r[2]===o||(e[0]+=r[0],e[1]+=r[1],e[2]+=r[2],a++),i=r[0],n=r[1],o=r[2]}return a>1&&(0,h.hs)(e,e,1/a),a>0}(e,this.readPrimitivePosition,this.indexCount)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const e=this.positionAttribute,t=this.indexCount;if(!e||0===t)return null;const r=0===this.type?3:1;(0,U.vA)(t%r===0,"Indexing error: "+t+" not divisible by "+r);const i=(0,R.tM)(t/r);return new V(i,r,this.readPrimitivePosition)}get transformation(){return this._transformation??c.zK}set transformation(e){this._transformation=e&&e!==c.zK?(0,c.o8)(e):null}get highlights(){return this._highlights||oe}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new re(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const oe=new Set;var ae=r(65529),se=r(97768),le=r(84952),ce=r(38969),ue=r(95117),he=r(2741);let de;var me=r(63907),fe=r(25530),pe=r(42293);const ge=()=>A.A.getLogger("esri.views.3d.webgl-engine.lib.BasisUtil");let ve=null,xe=null;async function _e(){return null==xe&&(de??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,he.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),xe=de,ve=await xe),xe}function ye(e,t,r,i,n){const o=(0,pe.MW)(t?me.CQ.COMPRESSED_RGBA8_ETC2_EAC:me.CQ.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function be(e){return e.getNumImages()>=1&&!e.isUASTC()}function we(e){return e.getFaces()>=1&&(e.isETC1S()||e.isUASTC())}function Me(e,t,r,i,n,o,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,h]=l?i?[1,me.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,me.CQ.COMPRESSED_RGB8_ETC2]:c?i?[3,me.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,me.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<d;e++)m.push(new Uint8Array(a(e,u))),s(e,u,m[e]);return t.internalFormat=h,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new fe.A(e,t,{type:"compressed",levels:m})}const Se=()=>A.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function Te(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Ce=Te("DXT1"),Ee=Te("DXT3"),Ie=Te("DXT5");function Ae(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function Pe(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const a=Math.min(Math.sqrt(r/o),i/n);return[Ae(Math.round(e*a),i),Ae(Math.round(t*a),i)]}(e,t);return e.width===r&&e.height===i?e:Oe(e,r,i)}function Oe(e,t,r){if(e instanceof ImageData)return Oe(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new I.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}var Fe=r(67171),De=r(12541);class Re{constructor(e,t){this._data=e,this.id=(0,q.c)(),this.events=new ae.bk,this._parameters={...Ne,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,le.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,ce.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,le.DB)(e.src)||(0,le.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new Fe.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t.isImmutable=!0===this._parameters.immutable&&function(e){return null!=e&&((0,De.tl)(e)||(0,De.tr)(e)||(0,De.CR)(e)||(0,De.QJ)(e))}(this._parameters.internalFormat),t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,z.mw)(e)||(0,z.mg)(e))return"image/ktx2"===t.encoding?function(e,t){if(null==ve)return e.byteLength;const r=new ve.KTX2File(new Uint8Array(e)),i=we(r)?ye(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):"image/x.basis"===t.encoding?function(e,t){if(null==ve)return e.byteLength;const r=new ve.BasisFile(new Uint8Array(e)),i=be(r)?ye(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Be(e):t,n=t.pixelFormat??6408,o=(0,pe.wH)(n);return(t.mipmap?4/3:1)*r*i*o||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const t=this._data;return null==t?(this._texture=new fe.A(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,z.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,z.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):(0,z.mg)(t)&&"image/ktx"===this._parameters.encoding?this._loadFromKTX1(e,t):(0,z.mw)(t)&&"image/ktx"===this._parameters.encoding?this._loadFromKTX1(e,new Uint8Array(t)):((0,z.mw)(t)||(0,z.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,z.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,z.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return Se().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return Se().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case Ce:n=8,o=me.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ee:n=16,o=me.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Ie:n=16,o=me.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Se().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(Se().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,u=l;let h,d;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const f=[];for(let t=0;t<a;++t)d=(s+3>>2)*(l+3>>2)*n,h=new Uint8Array(e.buffer,m,d),f.push(h),m+=d,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:o,width:c,height:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new fe.A(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX1(e,t){return this._texture=function(e,t,r){const i=function(e,t){const r=new Uint32Array(e.buffer,e.byteOffset,16);if(1481919403!==r[0]||3140563232!==r[1]||169478669!==r[2])return ge().error("Invalid magic number in KTX1 header"),null;if(67305985!==r[3]||1!==r[5]||r[7]!==me.CQ.COMPRESSED_RGB8_ETC2||6407!==r[8])return ge().error("Unsupported KTX1 image"),null;const i=r[7];let n=1,o=r[9],a=r[10];if(3&o||3&a)return null;const s=o,l=a;let c,u;!1!==t&&(n=Math.max(1,r[14]));let h=e.byteOffset+64;const d=[];for(let t=0;t<n;++t)u=(e[h]|e[h+1]<<8|e[h+2]<<16|e[h+3]<<24)>>>0,h+=4,c=new Uint8Array(e.buffer,h,u),d.push(c),h+=u,o=Math.max(1,o>>1),a=Math.max(1,a>>1);return{textureData:{type:"compressed",levels:d},internalFormat:i,width:s,height:l}}(r,t.hasMipmap??!1);if(null==i)throw new Error("KTX1 texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new fe.A(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==ve&&(ve=await _e());const i=new ve.KTX2File(new Uint8Array(r));if(!we(i))return null;i.startTranscoding();const n=Me(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==ve&&(ve=await _e());const i=new ve.BasisFile(new Uint8Array(r));if(!be(i))return null;i.startTranscoding();const n=Me(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,U.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new fe.A(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await B(t,{signal:r});return(0,F.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,ue.y)(t,t.src,!1,r);return(0,F.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((i,n)=>{const o=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,se.xt)(l)},a=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(o(),i(this._loadFromImage(e,t)))},s=e=>{o(),n(e||new I.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,F.u7)(r,()=>s((0,F.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=Pe(r,e.parameters));const i=Be(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._texture=new fe.A(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,se.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function Be(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const Ne={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1};var ze=r(49255);class He{constructor(e){this._material=e.material,this._techniques=e.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(t))}ensureResources(e){return 2}}var Le=r(65786);class je extends He{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,e=>this._textureNormal=e),this._acquire(e.emissiveTextureId,e=>this._textureEmissive=e),this._acquire(e.occlusionTextureId,e=>this._textureOcclusion=e),this._acquire(e.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){super.dispose(),this._texture=(0,se.Gz)(this._texture),this._textureNormal=(0,se.Gz)(this._textureNormal),this._textureEmissive=(0,se.Gz)(this._textureEmissive),this._textureOcclusion=(0,se.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,se.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new Ue(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,se.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,F.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,se.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class We extends Le.Y{constructor(e=null){super(),this.textureEmissive=e}}class Ue extends We{constructor(e,t,r,i,n,o,a){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.scale=o,this.normalTextureTransformMatrix=a}}var Ve=r(19245);class Ge{constructor(e,t){this.id=(0,q.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,Ve.MB)(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,Ve.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get emissions(){return 0}getConfiguration(e){return this.updateConfiguration(e),this._configuration}updateConfiguration(e){this._configuration.output=e.output,this._configuration.hasEmission=e.hasEmission&&(0,ze._o)(e.output),this._configuration.hasHighlightMixTexture=10===e.output&&null!=e.highlightMixTexture,this._configuration.useFloatBlend=e.useFloatBlend.value,this._configuration.emissionDimmingPass=e.transparentWithoutDepthEmissionDimmingPass&&(0,ze._o)(e.output)}}Le.Y;class ke{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const $e=(0,m.vt)();function Ze(e,t,r,i,n,o){if(!e.visible)return;const a=(0,h.jb)(ot,i,r),{tolerance:s}=t,l=new ke(s,!1,t.options.normalRequired);if(e.boundingInfo)(0,U.vA)(0===e.type),Ye(e.readPrimitivePosition,e.boundingInfo,r,a,s,n,l,o);else{const t=e.readPrimitivePosition;!function(e,t,r,i,n,o,a,s){const l=t,c=at,u=Math.abs(l[0]),d=Math.abs(l[1]),m=Math.abs(l[2]),f=u>=d?u>=m?0:2:d>=m?1:2,p=f,g=l[p]<0?2:1,v=(f+g)%3,x=(f+(3-g))%3,_=l[v]/l[p],y=l[x]/l[p],b=1/l[p],w=Ke,M=Je,S=Qe,{normalRequired:T}=a;for(let t=r;t<i;++t){const r=3*t;n(c[0],r),n(c[1],r+1),n(c[2],r+2),o&&(o.applyToVertex(c[0],c[0][0],c[0][1],c[0][2],t),o.applyToVertex(c[1],c[1][0],c[1][1],c[1][2],t),o.applyToVertex(c[2],c[2][0],c[2][1],c[2][2],t)),(0,h.jb)(w,c[0],e),(0,h.jb)(M,c[1],e),(0,h.jb)(S,c[2],e);const i=w[v]-_*w[p],a=w[x]-y*w[p],l=M[v]-_*M[p],u=M[x]-y*M[p],d=S[v]-_*S[p],m=S[x]-y*S[p],f=d*u-m*l,g=i*m-a*d,C=l*a-u*i;if((f<0||g<0||C<0)&&(f>0||g>0||C>0))continue;const E=f+g+C;if(0===E)continue;const I=f*(b*w[p])+g*(b*M[p])+C*(b*S[p]);if(I*Math.sign(E)<0)continue;const A=I/E;A>=0&&s(A,A,T?tt(c):null,t)}}(r,a,0,e.faceCount,t,n,l,o)}}const qe=(0,d.vt)();function Ye(e,t,r,i,n,o,a,s){if(null==t)return;const l=function(e,t){return(0,h.hZ)(t,1/e[0],1/e[1],1/e[2])}(i,qe);if((0,m.C)($e,t.box),null!=o&&o.applyToAabb($e),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(u,h)),!(s<0)&&(a=Math.max(a,Math.min(u,h)),!(a>s)&&a<1/0)}(e,t,r,i)}($e,r,l,n)){const{primitiveIndices:l}=t,c=l.length;if(c>1e3){const l=t.children;if(void 0!==l){for(const t of l)Ye(e,t,r,i,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,l){const c=e[0],u=e[1],h=e[2],d=t[0],m=t[1],f=t[2],{normalRequired:p}=s;for(let e=0;e<i;++e){const t=o[e],r=3*t;let[i,s,g]=n(lt,r),[v,x,_]=n(lt,r+1),[y,b,w]=n(lt,r+2);null!=a&&([i,s,g]=a.applyToVertex(st,i,s,g,e),[v,x,_]=a.applyToVertex(st,v,x,_,e),[y,b,w]=a.applyToVertex(st,y,b,w,e));const M=v-i,S=x-s,T=_-g,C=y-i,E=b-s,I=w-g,A=m*I-E*f,P=f*C-I*d,O=d*E-C*m,F=M*A+S*P+T*O,D=F*F;if(D<=nt)continue;const R=c-i,B=u-s,N=h-g,z=(R*A+B*P+N*O)*F;if(z<0||z>D)continue;const H=B*T-S*N,L=N*M-T*R,j=R*S-M*B,W=(d*H+m*L+f*j)*F;if(W<0||z+W>D)continue;const U=(C*H+E*L+I*j)/F;U>=0&&l(U,U,p?et(M,S,T,C,E,I,Xe):null,t)}}(r,i,0,c,e,l,o,a,s)}}const Xe=(0,d.vt)();const Ke=(0,d.vt)(),Je=(0,d.vt)(),Qe=(0,d.vt)();function et(e,t,r,i,n,o,a){return(0,h.hZ)(rt,e,t,r),(0,h.hZ)(it,i,n,o),(0,h.$A)(a,rt,it),(0,h.S8)(a,a),a}function tt(e){return(0,h.jb)(rt,e[1],e[0]),(0,h.jb)(it,e[2],e[0]),(0,h.$A)(Xe,rt,it),(0,h.S8)(Xe,Xe),Xe}const rt=(0,d.vt)(),it=(0,d.vt)(),nt=1e-7*1e-7,ot=(0,d.vt)(),at=[(0,d.vt)(),(0,d.vt)(),(0,d.vt)()],st=(0,d.vt)(),lt=(0,d.vt)();var ct=r(90629),ut=r(82919),ht=r(27921),dt=r(19419),mt=r(11964);function ft(e,t){return e.isRectangle?(0,dt.Uc)(e.bounds,t):function(e,t){return gt(e[0],e[1],t)}(t,e.points)}function pt(e,t,r,i){const n=Math.min(t[0],r[0],i[0]),o=Math.min(t[1],r[1],i[1]),a=Math.max(t[0],r[0],i[0]),s=Math.max(t[1],r[1],i[1]);if(!function(e,t){if(!(0,dt.HY)(e.bounds,t))return!1;if(e.isRectangle)return!0;for(const r of e.points)if((0,dt.Uc)(t,r))return!0;if(function(e,t){const r=e[0],i=e[1],n=e[2],o=e[3];return gt(r,i,t)||gt(n,i,t)||gt(n,o,t)||gt(r,o,t)}(t,e.points))return!0;for(let r=0;r<e.points.length;r++)if(vt(e.points[r],r===e.points.length-1?e.points[0]:e.points[r+1],t))return!0;return!1}(e,(0,dt.fA)(n,o,a,s,Mt)))return!1;if(ft(e,t)||ft(e,r)||ft(e,i))return!0;for(const n of e.points)if((0,X.cq)(t,r,i,n,St))return!0;for(let n=0;n<e.points.length;n++){const o=e.points[n],a=e.points[(n+1)%e.points.length];if(_t(t,r,o,a)||_t(r,i,o,a)||_t(i,t,o,a))return!0}return!1}function gt(e,t,r){let i=!1;for(let n=0,o=r.length-1;n<r.length;o=n++){const a=r[n],s=r[o];a[1]>t!=s[1]>t&&e<(s[0]-a[0])*(t-a[1])/(s[1]-a[1])+a[0]&&(i=!i)}return i}function vt(e,t,r){const i=r[0],n=r[1],o=r[2],a=r[3],s=e[0],l=e[1],c=t[0],u=t[1];return!(s<i&&c<i||s>o&&c>o||l<n&&u<n||l>a&&u>a)&&(!(!(0,dt.Rj)(r,s,l)&&!(0,dt.Rj)(r,c,u))||xt(e,t,i,n,o,n)||xt(e,t,o,n,o,a)||xt(e,t,o,a,i,a)||xt(e,t,i,a,i,n))}function xt(e,t,r,i,n,o){const a=yt(e[0],e[1],t[0],t[1],r,i),s=yt(e[0],e[1],t[0],t[1],n,o),l=yt(r,i,n,o,e[0],e[1]),c=yt(r,i,n,o,t[0],t[1]);return a!==s&&l!==c||0===a&&bt(e,t,r,i)||0===s&&bt(e,t,n,o)||0===l&&wt(r,i,n,o,e[0],e[1])||0===c&&wt(r,i,n,o,t[0],t[1])}function _t(e,t,r,i){return xt(e,t,r[0],r[1],i[0],i[1])}function yt(e,t,r,i,n,o){const a=(i-t)*(n-r)-(r-e)*(o-i);return Math.abs(a)<=St?0:Math.sign(a)}function bt(e,t,r,i){return wt(e[0],e[1],t[0],t[1],r,i)}function wt(e,t,r,i,n,o){return n>=Math.min(e,r)-St&&n<=Math.max(e,r)+St&&o>=Math.min(t,i)-St&&o<=Math.max(t,i)+St}const Mt=(0,dt.vt)(),St=((0,ct.r_)(),(0,ct.r_)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,mt.vt)(),1e-9);class Tt{constructor(e){this.type=e,this.distance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=(0,d.vt)(),this.normal=(0,d.vt)()}reset(){this.distance=Number.POSITIVE_INFINITY,this.hasNormal=!1}update(e,t,r,i){this.distance=e,this.primitiveIndex=t,(0,h.C)(this.point,r),this.hasNormal=null!=i,null!=i&&(0,h.C)(this.normal,i)}updateIfCloserFromValues(e,t,r,i){e<this.distance&&this.update(e,t,r,i)}updateIfCloser(e){const{distance:t,primitiveIndex:r,point:i,normal:n}=e;this.updateIfCloserFromValues(t,r,i,e.hasNormal?n:null)}get valid(){return Number.isFinite(this.distance)}}function Ct(e,t,r,i,n){if(!e.visible||0!==e.type)return null;const o=new Tt(4);let a;a=e.boundingInfo?It(e.readPrimitivePosition,e.boundingInfo,t,r,i,n):Et(t,r,i,0,e.faceCount,e.readPrimitivePosition,n,null,0);for(const e of a)o.updateIfCloser(e);return o.valid?o:null}function*Et(e,t,r,i,n,o,a,s=null,l=0){if(null==e.camera)return;const{camera:c,screenPolygonPrimitiveProcessor:u}=e;for(let e=i;e<n;++e){const i=(s?.[e]??e)+l,n=null==s?i:e,d=3*i;At(Dt[0],o,d+0,a,n,t),At(Dt[1],o,d+1,a,n,t),At(Dt[2],o,d+2,a,n,t);const m=zt;let f;Lt.reset();const p=Rt;for(const e of u.processTriangle(Dt))if(p.length=0,(0,ht.H)(c.frustum[4],e,()=>p.pushNew(),!1),!(p.length<3)){for(let e=0;e<p.length;e++)c.projectToScreen(p.at(e),Bt[e]);Pt(r,Bt,p.length)&&(Ot(c.eye,p,Nt),null==f&&(f=(0,X.rb)(zt,Dt[0],Dt[1],Dt[2])),Lt.updateIfCloserFromValues((0,h.Io)(c.eye,Nt),i,Nt,f?m:null))}Lt.valid&&(yield Lt)}}function*It(e,t,r,i,n,o){let a;if(null!=o?((0,m.C)(Ft,t.box),o.applyToAabb(Ft),a=(0,ut.GH)(n.broadPhaseFrustum,Ft,i)):a=(0,ut.GH)(n.broadPhaseFrustum,t.box,i),!a)return;const{primitiveIndices:s}=t,l=s.length;if(l>1e3){const a=t.children;if(void 0!==a){for(const t of a)yield*It(e,t,r,i,n,o);return}}yield*Et(r,i,n,0,l,e,o,s,0)}function At(e,t,r,i,n,o){const[a,s,l]=t(e,r);null!=i?i.applyToVertex(e,a,s,l,n):(0,h.hZ)(e,a,s,l),o&&(0,h.Z0)(e,e,o)}function Pt(e,t,r){for(let i=1;i<r-1;i++)if(pt(e,t[0],t[i],t[i+1]))return!0;return!1}function Ot(e,t,r){let i=Number.POSITIVE_INFINITY;const n=t.at(0);for(let o=1;o<t.length-1;o++){(0,X.k3)(Ht,e,n,t.at(o),t.at(o+1));const a=(0,h.hG)(e,Ht);a<i&&(i=a,(0,h.C)(r,Ht))}}const Ft=(0,m.vt)(),Dt=[(0,d.vt)(),(0,d.vt)(),(0,d.vt)()],Rt=new j.A({allocator:e=>e??(0,d.vt)()}),Bt=Array.from({length:12},()=>(0,ct.gs)()),Nt=(0,d.vt)(),zt=(0,d.vt)(),Ht=(0,d.vt)(),Lt=new Tt(4);var jt=r(16396);function Wt(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function Ut(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=3*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}}function Vt(e,t,r,i,n=1){const o=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a}function Gt(e,t,r,i,n,o){switch(e){case"position":{(0,U.vA)(3===t.size);const i=n.getField(e,p.xs);(0,U.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void Ut(e,r,i,n);const{data:o,indices:a}=e,s=r.typedBuffer,c=r.typedBufferStride,u=a.length,h=t[0],d=t[1],m=t[2],f=t[4],p=t[5],g=t[6],v=t[8],x=t[9],_=t[10],y=t[12],b=t[13],w=t[14];i*=c;let M=0,S=0,T=0;const C=(0,l.tZ)(t)?e=>{M=o[e]+y,S=o[e+1]+b,T=o[e+2]+w}:e=>{const t=o[e],r=o[e+1],i=o[e+2];M=h*t+f*r+v*i+y,S=d*t+p*r+x*i+b,T=m*t+g*r+_*i+w};if(1===n)for(let e=0;e<u;++e)C(3*a[e]),s[i]=M,s[i+1]=S,s[i+2]=T,i+=c;else for(let e=0;e<u;++e){C(3*a[e]);for(let e=0;e<n;++e)s[i]=M,s[i+1]=S,s[i+2]=T,i+=c}}(t,r,i,o);break}case"normal":{(0,U.vA)(3===t.size);const r=n.getField(e,p.xs);(0,U.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void Ut(e,r,i,n);const{data:o,indices:a}=e,s=t,c=r.typedBuffer,u=r.typedBufferStride,h=a.length,d=s[0],m=s[1],f=s[2],p=s[4],g=s[5],v=s[6],x=s[8],_=s[9],y=s[10],b=!(0,l.ut)(s),w=1e-6,M=1-w;i*=u;let S=0,T=0,C=0;const E=(0,l.tZ)(s)?e=>{S=o[e],T=o[e+1],C=o[e+2]}:e=>{const t=o[e],r=o[e+1],i=o[e+2];S=d*t+p*r+x*i,T=m*t+g*r+_*i,C=f*t+v*r+y*i};if(1===n)if(b)for(let e=0;e<h;++e){E(3*a[e]);const t=S*S+T*T+C*C;if(t<M&&t>w){const e=1/Math.sqrt(t);c[i]=S*e,c[i+1]=T*e,c[i+2]=C*e}else c[i]=S,c[i+1]=T,c[i+2]=C;i+=u}else for(let e=0;e<h;++e)E(3*a[e]),c[i]=S,c[i+1]=T,c[i+2]=C,i+=u;else for(let e=0;e<h;++e){if(E(3*a[e]),b){const e=S*S+T*T+C*C;if(e<M&&e>w){const t=1/Math.sqrt(e);S*=t,T*=t,C*=t}}for(let e=0;e<n;++e)c[i]=S,c[i+1]=T,c[i+2]=C,i+=u}}(t,i,r,o);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,U.vA)(2===t.size);const r=n.getField(e,p.mJ);(0,U.vA)(!!r,`No buffer view for ${e}`),Wt(t,r,o);break}case"uv0":{(0,U.vA)(2===t.size);const r=n.getField(e,p.ZD)??n.getField(e,p.gH);(0,U.vA)(!!r,`No buffer view for ${e}`),Wt(t,r,o);break}case"uvi":{(0,U.vA)(2===t.size);const r=n.getField(e,p.mJ);(0,U.vA)(!!r,`No buffer view for ${e}`),Wt(t,r,o);break}case"color":case"symbolColor":{const r=n.getField(e,p.XP);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(3===t.size||4===t.size),function(e,t,r,i,n=1){const{data:o,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t===o.length&&4===t){s[i]=o[0],s[i+1]=o[1],s[i+2]=o[2],s[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;const u=c*n;for(let r=1;r<u;++r)e[i]=a,i+=t;return}if(1!==n)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}}}(t,t.size,r,o);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=n.getField(e,p.Y$)??n.getField(e,p.Y$);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(1===t.size),function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length,l=i[0];r*=a;for(let e=0;e<s;++e)o[r]=l,r+=a}(t,r,o);break}case"tangent":{(0,U.vA)(4===t.size);const i=n.getField(e,p.Eq);(0,U.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void function(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}}(e,r,i,n);const{data:o,indices:a}=e,s=t,c=r.typedBuffer,u=r.typedBufferStride,h=a.length,d=s[0],m=s[1],f=s[2],p=s[4],g=s[5],v=s[6],x=s[8],_=s[9],y=s[10],b=!(0,l.ut)(s),w=1e-6,M=1-w;if(i*=u,1===n)for(let e=0;e<h;++e){const t=4*a[e],r=o[t],n=o[t+1],s=o[t+2],l=o[t+3];let h=d*r+p*n+x*s,S=m*r+g*n+_*s,T=f*r+v*n+y*s;if(b){const e=h*h+S*S+T*T;if(e<M&&e>w){const t=1/Math.sqrt(e);h*=t,S*=t,T*=t}}c[i]=h,c[i+1]=S,c[i+2]=T,c[i+3]=l,i+=u}else for(let e=0;e<h;++e){const t=4*a[e],r=o[t],s=o[t+1],l=o[t+2],h=o[t+3];let S=d*r+p*s+x*l,T=m*r+g*s+_*l,C=f*r+v*s+y*l;if(b){const e=S*S+T*T+C*C;if(e<M&&e>w){const t=1/Math.sqrt(e);S*=t,T*=t,C*=t}}for(let e=0;e<n;++e)c[i]=S,c[i+1]=T,c[i+2]=C,c[i+3]=h,i+=u}}(t,r,i,o);break}}}(0,d.vt)();class kt{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n){null!=n&&function(e,t,r,i,n,o){const{buffer:a,offset:s}=o;for(const o of r.fields.keys()){const r=e.get(o),l=r?.indices;if(r&&l)Gt(o,r,i,n,a,s);else if("olidColor"===o&&null!=t){const r=e.get("position")?.indices;if(r){const e=r.length;Vt(t,a.getField(o,p.XP),e,s)}}}}(r,i,this.layout,e,t,n)}}const $t=Jt(-1),Zt=Jt(1),qt=$t,Yt=new Array;Yt[0]=null,Yt[1]=Zt,Yt[2]=$t,Yt[3]=Jt(-2),Yt[4]=Jt(-3);const Xt=Yt.map(e=>function(e,t){return t?{factor:e.factor+t.factor,units:e.units+t.units}:e}(qt,e));function Kt({output:e,enableOITOffset:t,polygonOffset:r}){return(0,ze._$)(e)&&t?Xt[r]:Yt[r]}function Jt(e){return{factor:1*e,units:2*e}}Yt[1]=Zt;var Qt=r(5482),er=r(51976),tr=r(34711);class rr extends tr.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,Qt.Cg)([(0,er.W)()],rr.prototype,"hasHighlightMixTexture",void 0),(0,Qt.Cg)([(0,er.W)()],rr.prototype,"emissionDimmingPass",void 0);class ir extends rr{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,Qt.Cg)([(0,er.W)({count:5})],ir.prototype,"polygonOffset",void 0),(0,Qt.Cg)([(0,er.W)()],ir.prototype,"transparent",void 0),(0,Qt.Cg)([(0,er.W)()],ir.prototype,"enableOITOffset",void 0);const nr=new ir,or=2e-5,ar=2e-6,sr=(0,d.vt)();var lr=r(91429),cr=r(91829),ur=r(4431),hr=r(1843),dr=r(72824),mr=r(13840),fr=r(42958),pr=r(16943),gr=r(90644);const vr=(0,gr.p3)(1,0,1,771);function xr(e,t=!1,r=!1){if(r)return gr.uR;switch(e){case 0:return t?gr.RC:gr.T8;case 1:return vr;default:return null}}function _r(e){if(e.draped)return null;switch(e.output){case 0:case 2:default:return e.writeDepth?gr.Uy:null;case 1:return null}}function yr(e,t=513){return{func:(0,ze._$)(e)?515:t}}(0,cr._Y)();const br={mask:255},wr=(0,gr.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),Mr=(0,gr.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681});(0,gr.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),(0,gr.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680}),r(4576),r(66289);var Sr=r(69622),Tr=r(32728);class Cr{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",p.Eq),this.color=e.getField("instanceColor",p.XP),this.olidColor=e.getField("instanceOlidColor",p.XP),this.state=e.getField("state",p.SL),this.lodLevel=e.getField("lodLevel",p.SL)}}let Er=class extends Sr.A{constructor(e,t){super(e),this.events=new ae.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return Ar(Ir.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=Rr,this._buffer=this._layout.createBuffer(this._capacity),this._view=new Cr(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,U.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,U.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=Pr,i=Or;t.localTransform.getMat(e,Fr),t.globalTransform.getMat(e,Dr);const n=(0,l.lw)(Dr,Dr,Fr);(0,h.hZ)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,a.z0)(i,n),t.model.setMat(e,i);const o=(0,Tr.wp)(Pr,n);o.sort(),t.modelScaleFactors.set(e,0,o[1]),t.modelScaleFactors.set(e,1,o[2]),(0,a.B8)(i,i),(0,a.mg)(i,i),t.modelNormal.setMat(e,i),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,Or),r.modelOrigin.getVec(e,Pr),t[0]=Or[0],t[1]=Or[1],t[2]=Or[2],t[3]=0,t[4]=Or[3],t[5]=Or[4],t[6]=Or[5],t[7]=0,t[8]=Or[6],t[9]=Or[7],t[10]=Or[8],t[11]=0,t[12]=Pr[0],t[13]=Pr[1],t[14]=Pr[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Pr,this,e),t*=Math.max(Pr[0],Pr[1],Pr[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Pr,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(Pr[0],Pr[1],Pr[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(Rr,Math.floor(1.5*this._capacity)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new Cr(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,Qt.Cg)([(0,lr.MZ)({constructOnly:!0})],Er.prototype,"shaderTransformation",void 0),(0,Qt.Cg)([(0,lr.MZ)()],Er.prototype,"_size",void 0),(0,Qt.Cg)([(0,lr.MZ)({readOnly:!0})],Er.prototype,"size",null),Er=(0,Qt.Cg)([(0,lr.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],Er);const Ir=(0,hr.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function Ar(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,pr.E)()&&e.vec4u8("instanceOlidColor"),e}const Pr=(0,d.vt)(),Or=(0,s.vt)(),Fr=(0,c.vt)(),Dr=(0,c.vt)(),Rr=64,Br=(0,hr.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var Nr=r(74810),zr=r(28491),Hr=r(49788);class Lr extends dr.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Nr.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=d.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,d.CN)(.2,.2,.2),this.diffuse=(0,d.CN)(.8,.8,.8),this.externalColor=(0,cr.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=Hr.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}dr.gy;let jr=class extends fr.w{constructor(e,t){let i=(0,ur.U)(Vr(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,ur.U)(function(e){return Ar(Br.clone(),e)}(t)))),super(e,t,i),this.shader=new mr.r(zr.D,()=>r.e(5141).then(r.bind(r,5141))),this.ignoreUnused=!0}_makePipeline(e,t){const{output:r,transparent:i,cullFace:n,customDepthTest:o,hasOccludees:a}=e;return(0,gr.Ey)({blending:i?xr(r,!1,e.emissionDimmingPass):null,culling:Ur(e)?(0,gr.Xt)(n):null,depthTest:yr(r,Wr(o)),depthWrite:_r(e),colorWrite:gr.kn,stencilWrite:a?br:null,stencilTest:a?t?Mr:wr:null,polygonOffset:Kt(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,r){return r?this._occludeePipelineState:super.getPipeline(e,t,r)}};function Wr(e){switch(e){case 1:return 515;case 0:case 4:return 513;case 2:return 516;case 3:return 514}}function Ur(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Vr(e){const t=(0,hr.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,pr.E)()&&t.vec4u8("olidColor"),t}jr=(0,Qt.Cg)([(0,lr.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],jr);class Gr extends ir{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1,this.renderOccluded=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}}(0,Qt.Cg)([(0,er.W)({count:4})],Gr.prototype,"alphaDiscardMode",void 0),(0,Qt.Cg)([(0,er.W)({count:3})],Gr.prototype,"doubleSidedMode",void 0),(0,Qt.Cg)([(0,er.W)({count:8})],Gr.prototype,"pbrMode",void 0),(0,Qt.Cg)([(0,er.W)({count:3})],Gr.prototype,"cullFace",void 0),(0,Qt.Cg)([(0,er.W)({count:3})],Gr.prototype,"normalType",void 0),(0,Qt.Cg)([(0,er.W)({count:4})],Gr.prototype,"customDepthTest",void 0),(0,Qt.Cg)([(0,er.W)({count:8})],Gr.prototype,"emissionSource",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasVertexColors",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasSymbolColors",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasVerticalOffset",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasColorTexture",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasMetallicRoughnessTexture",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasOcclusionTexture",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasNormalTexture",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasScreenSizePerspective",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasVertexTangents",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasOccludees",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"instanced",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"instancedDoublePrecision",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasModelTransformation",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"offsetBackfaces",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasVVSize",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasVVColor",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"receiveShadows",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasShadowHighlights",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"receiveAmbientOcclusion",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"receiveGlobalIllumination",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"textureAlphaPremultiplied",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"instancedFeatureAttribute",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"instancedColor",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"writeDepth",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"snowCover",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasColorTextureTransform",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasEmissionTextureTransform",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasNormalTextureTransform",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasOcclusionTextureTransform",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasMetallicRoughnessTextureTransform",void 0);var kr=r(57323);let $r=class extends jr{constructor(){super(...arguments),this.shader=new mr.r(kr.R,()=>r.e(2314).then(r.bind(r,39933)))}};$r=(0,Qt.Cg)([(0,lr.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],$r);class Zr extends er.K{constructor(){super(...arguments),this.receiveShadows=!0}}(0,Qt.Cg)([(0,er.W)()],Zr.prototype,"receiveShadows",void 0);class qr extends Ge{constructor(e,t){super(e,Xr),this.materialType="default",this.supportsEdges=!0,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,e=>(0,ze.uw)(e)&&!this.transparent],[4,e=>(0,ze.uw)(e)&&this.transparent]]),this._layout=Vr(this.parameters),this._configuration=new Gr(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=Hr.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,h.t2)(this.parameters.emissiveBaseColor,d.uY)}get emissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;const{treeRendering:i,doubleSided:n,doubleSidedType:o}=t;r.hasVertexTangents=!i&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=i?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.hasModelTransformation=!i&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=i?2:n&&"normal"===o?1:n&&"winding-order"===o?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,(0,ze._o)(e.output)?(r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=function(e,t){return e.receiveShadows&&null!=t.shadowHighlight?.getTexture()}(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&e.globalIlluminationEnabled):r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=!1,r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.unlit?7:t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersectRay(e,t,r,i,n,o){const a=this._getMaterialVerticalOffset(t,r);null!=a&&(i=(0,h.Re)(Kr,i,a),n=(0,h.Re)(Jr,n,a)),o=function(e,t,r,i){nr.output=t.transparent?1:0,nr.polygonOffset=t.polygonOffset,nr.enableOITOffset=t.enableOITOffset;const n=Kt(nr);if(!n)return e;const o=ar*n.units,a=(0,h.oW)(sr,i,r);return(t,r,i,s)=>{const l=(i?1-Math.abs((0,h.Om)(a,i)):0)*n.factor*or+o;return e(t,r+l,i,s)}}(o,this._configuration,i,n),Ze(e,r,i,n,(0,jt.ou)(r.verticalOffset),o)}intersectScreenPolygon(e,t,r,i){return function(e,t,r){return null==e?null:(e.distance=function(e,t,r,i,n){const o=Kt(r);return o?function({units:e,factor:t},r,i,n){const o=ar*e;return i+((n?1-Math.abs((0,h.Om)(r,n)):0)*t*or+o)}(o,(0,h.oW)(sr,n,i),e,t):e}(e.distance,e.hasNormal?e.normal:null,t,r,e.point),e)}(Ct(e,r,t,i,this._createScreenPolygonVertexDisplacement(t,r)),this._configuration,r.camera.eye)}createGLMaterial(e){return new Yr(e)}createBufferWriter(){return new kt(this._layout)}get transparent(){const{drivenOpacity:e,opacity:t,externalColor:r,layerOpacity:i,texture:n,textureId:o,textureAlphaMode:a,colorMixMode:s}=this.parameters,l=r[3];return e||t<1&&"replace"!==s||l<1&&"ignore"!==s||i<1||(null!=n||null!=o)&&1!==a&&2!==a&&"replace"!==s}_createScreenPolygonVertexDisplacement(e,t){const r=this._getMaterialVerticalOffset(e,t);return null==r?null:{applyToVertex:(e,t,i,n)=>(e[0]=t+r[0],e[1]=i+r[1],e[2]=n+r[2],e),applyToAabb:e=>((0,m.Ne)(e,(0,h.WQ)(ni,(0,m.pg)(e,ni),r)),(0,m.vI)(e,(0,h.WQ)(ni,(0,m.Lu)(e,ni),r)),e)}}_getMaterialVerticalOffset(e,t){if(null==this.parameters.verticalOffset)return null;const r=t.camera;(0,h.hZ)(ti,e[12],e[13],e[14]);let i=null;switch(t.viewingMode){case 1:i=(0,h.S8)(ei,ti);break;case 2:i=(0,h.C)(ei,Qr)}const n=(0,h.Re)(ri,ti,r.eye),o=(0,h.Bw)(n),a=(0,h.hs)(n,n,1/o);let s=null;this.parameters.screenSizePerspective&&(s=(0,h.Om)(i,a));const l=(0,Ve.kE)(r,o,this.parameters.verticalOffset,s??0,this.parameters.screenSizePerspective,null);return(0,h.hs)(i,i,l),(0,h.ei)(ii,i,t.transform.inverseRotation)}}class Yr extends je{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,h.hZ)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?$r:jr,e)}}class Xr extends Lr{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1,this.unlit=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const Kr=(0,d.vt)(),Jr=(0,d.vt)(),Qr=(0,d.fA)(0,0,1),ei=(0,d.vt)(),ti=(0,d.vt)(),ri=(0,d.vt)(),ii=(0,d.vt)(),ni=(0,d.vt)(),oi=()=>A.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class ai{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function si(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(oi().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(oi().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(oi().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(oi().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else oi().warn("Indexed geometries must specify faces"),i=!1;break}default:oi().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(oi().warn("Geometry requires material"),i=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(oi().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function li(e){const t=(0,m.Ie)();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&(0,m.RF)(t,r.box)}),t}function ci(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function ui(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const hi=new D.A(1,2,"wosr");async function di(e,t){const s=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:{fileType:e.match(/(.*\.(json|json\.gz))$/)?"wosr":"unknown",url:e,specifiedLodIndex:null}}((0,n.EM)(e));if("wosr"===s.fileType){const e=await(t.cache?t.cache.loadWOSR(s.url,t):async function(e,t){const r=await async function(e,t){const r=await(0,E.Ke)((0,C.A)(e,t));if(r.ok)return r.value.data;(0,F.QP)(r.error),function(e){throw new I.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const n=e[i],o=n.images[0].data;if(!o){oi().warn("Externally referenced texture data is not yet supported");continue}const a=n.encoding+";base64,"+o,s="/textureDefinitions/"+i,l="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==ci(l)},u=t?.disableTextures?Promise.resolve(null):B(a,t);r.push(u.then(e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l})))}const i=await Promise.all(r),n={};for(const e of i)n[e.refId]=e;return n}(r.textureDefinitions??{},t);let n=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];n+=t?.image?t.image.width*t.image.height*4:0}return new ai(r,i,n+(0,P.Qh)(r))}(s.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){const r=new Array,i=new Array,n=new Array,o=new O,a=e.resource,s=D.A.parse(a.version||"1.0","wosr");hi.validate(s);const l=a.model.name,c=a.model.geometries,u=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<c.length;e++){const a=c[e];if(!si(a))continue;const s=ui(a),l=a.params.vertexAttributes,p=[],g=e=>{if("PerAttributeArray"===a.params.topology)return null;const t=a.params.faces;for(const r in t)if(r===e)return t[r].values;return null},v=l.position,x=v.values.length/v.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=g(e)??(0,R.tM)(x);p.push([e,new N.n(r,i,t.valuesPerElement,!0)])}const _=s.texture,y=h&&h[_];if(y&&!f.has(_)){const{image:e,parameters:t}=y,r=new Re(e,t);i.push(r),f.set(_,r)}const b=f.get(_),w=b?b.id:void 0,M=s.material;let S=o.get(M,_);if(null==S){const e=u[M.slice(M.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=y?ci(y.alphaChannelUsage):void 0,i={ambient:(0,d.ci)(e.diffuse),diffuse:(0,d.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:w,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:y?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(i,t.materialParameters),S=new qr(i,t),o.set(M,_,S)}n.push(S);const T=new ne(S,p);m+=p.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(T)}return{engineResources:[{name:l,stageResources:{textures:i,materials:n,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:li(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}let w;if(t.cache)w=await t.cache.loadGLTF(s.url,t,!!t.usePBR,!!t.useEmissive);else{const{loadGLTF:e}=await r.e(1698).then(r.bind(r,51698));w=await e(new _.R,s.url,t,t.usePBR,t.useEmissive)}const{engineResources:S,referenceBoundingBox:A}=function(e,t,r){const n=e.model,s=e.meta,_=n.meta?.ESRI_proxyEllipsoid,w=s.isEsriSymbolResource&&null!=_&&"EsriRealisticTreesStyle"===s.ESRI_webstyle;w&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const n of i.parts){const i=n.attributes.normal;if(null==i)return;const o=n.attributes.position,a=o.count,s=(0,d.vt)(),u=(0,d.vt)(),m=(0,d.vt)(),f=new Float32Array(4*a),g=new Float32Array(3*a),v=(0,l.B8)((0,c.vt)(),n.transform);let x=0,_=0;for(let l=0;l<a;l++){o.getVec(l,u),i.getVec(l,s),(0,h.Z0)(u,u,n.transform),(0,h.Re)(m,u,t.center),(0,h.Qr)(m,m,t.radius);const a=m[2],c=(0,h.Bw)(m),d=Math.min(.45+.55*c*c,1)**2.2;(0,h.Qr)(m,m,t.radius),null!==v&&(0,h.Z0)(m,m,v),(0,h.S8)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,h.Cc)(m,m,s,a>-1?.2:Math.min(-4*a-3.8,1)),g[x]=m[0],g[x+1]=m[1],g[x+2]=m[2],x+=3,f[_]=d,f[_+1]=d,f[_+2]=d,f[_+3]=1,_+=4}n.attributes.normal=new p.xs(g.buffer),n.attributes.color=new p.Eq(f.buffer)}}}(e,_));const S=!!t.usePBR,C=s.isEsriSymbolResource?{usePBR:S,isSchematic:!1,treeRendering:w,mrrFactors:Nr.SY}:{usePBR:S,isSchematic:!1,treeRendering:!1,mrrFactors:Nr.mb},E={...t.materialParameters,treeRendering:w},I=new Array,A=new Map,P=new Map,O=n.lods.length,F=(0,m.Ie)();return n.lods.forEach((e,s)=>{const l=!0===t.skipHighLods&&(O>1&&0===s||O>3&&1===s)||!1===t.skipHighLods&&null!=r&&s!==r;if(l&&0!==s)return;const c=new T(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const r=l?new qr({},t):function(e,t,r,n,o,a,s,l,c){const h=e.materials.get(t.material);if(null==h)return null;const{normal:m,color:f,texCoord0:p,tangent:g}=t.attributes,v=t.material+(m?"_normal":"")+(f?"_color":"")+(p?"_texCoord0":"")+(g?"_tangent":""),x=null!=t.attributes.texCoord0,_=null!=t.attributes.normal,y=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(h.alphaMode);if(!a.has(v)){if(x){const t=(t,r=!1,i=!1)=>{if(null!=t&&!s.has(t)){const n=e.textures.get(t);if(n){const e=n.data,o=r&&!(0,b.x3)(e)?l.compressionOptions:void 0;s.set(t,new Re((0,b.x3)(e)?e.data:e,{...n.parameters,preMultiplyAlpha:!(0,b.x3)(e)&&i,encoding:(0,b.x3)(e)?e.encoding:void 0,compressionOptions:o}))}}},r=1!==y&&!c;t(h.colorTexture,r,1!==y),t(h.normalTexture),t(h.occlusionTexture,!0),t(h.emissiveTexture),t(h.metallicRoughnessTexture,!0)}const r=(0,i.xV)(h.color[0]),m=(0,i.xV)(h.color[1]),f=(0,i.xV)(h.color[2]),p=null!=h.colorTexture&&x?s.get(h.colorTexture):null,g=(0,Nr.Jr)(h),w=null!=h.normalTextureTransform?.scale?h.normalTextureTransform?.scale:u.Un;a.set(v,new qr({...n,customDepthTest:1,textureAlphaMode:y,textureAlphaCutoff:h.alphaCutoff,diffuse:[r,m,f],ambient:[r,m,f],opacity:"OPAQUE"===h.alphaMode?1:h.opacity,doubleSided:h.doubleSided,doubleSidedType:"winding-order",cullFace:h.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:_?0:2,castShadows:!0,receiveShadows:h.receiveShadows,receiveAmbientOcclusion:h.receiveAmbientOcclusion,unlit:h.unlit,textureId:null!=p?p.id:void 0,colorMixMode:h.colorMixMode,normalTextureId:null!=h.normalTexture&&x?s.get(h.normalTexture).id:void 0,textureAlphaPremultiplied:null!=p&&!!p.parameters.preMultiplyAlpha,occlusionTextureId:null!=h.occlusionTexture&&x?s.get(h.occlusionTexture).id:void 0,emissiveTextureId:null!=h.emissiveTexture&&x&&!h.unlit?s.get(h.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=h.metallicRoughnessTexture&&x?s.get(h.metallicRoughnessTexture).id:void 0,emissiveBaseColor:h.unlit?d.uY:[h.emissiveFactor[0],h.emissiveFactor[1],h.emissiveFactor[2]],emissiveStrengthKHR:null!=h.emissiveStrengthKHR?h.emissiveStrengthKHR:1,emissiveStrengthFromSymbol:null!=o.emissiveStrengthFromSymbol?o.emissiveStrengthFromSymbol:void 0,mrrFactors:g?Nr.Bt:[h.metallicFactor,h.roughnessFactor,n.mrrFactors[2]],isSchematic:g,colorTextureTransformMatrix:M(h.colorTextureTransform),normalTextureTransformMatrix:M(h.normalTextureTransform),scale:[w[0],w[1]],occlusionTextureTransformMatrix:M(h.occlusionTextureTransform),emissiveTextureTransformMatrix:M(h.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:M(h.metallicRoughnessTextureTransform),...o},l))}const w=a.get(v);if(r.stageResources.materials.push(w),x){const e=e=>{null!=e&&r.stageResources.textures.push(s.get(e))};e(h.colorTexture),e(h.normalTexture),e(h.occlusionTexture),e(h.emissiveTexture),e(h.metallicRoughnessTexture)}return w}(n,e,c,C,E,A,P,t,w),{geometry:h,vertexCount:_}=function(e,t){const r=e.attributes.position.count,i=(0,y.x)(e.indices||r,e.primitiveType),n=f(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,g.t)(n,s,e.transform,3,l);const c=[["position",new N.n(n,i,3,!0)]];if(null!=e.attributes.normal){const t=f(3*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.normal;(0,a.Ge)(mi,e.transform),(0,g.b)(t,n,mi,3,s),(0,o.or)(mi)&&(0,g.n)(t,t),c.push(["normal",new N.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=f(4*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.tangent;(0,a.z0)(mi,e.transform),(0,v.t)(t,n,mi,4,s),(0,o.or)(mi)&&(0,g.n)(t,t,4),c.push(["tangent",new N.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=f(2*r),{typedBuffer:n,typedBufferStride:o}=e.attributes.texCoord0;(0,x.a)(t,n,2,o),c.push(["uv0",new N.n(t,i,2,!0)])}const u=e.attributes.color;if(null!=u){const t=new Uint8Array(4*r);4===u.elementCount?u instanceof p.Eq?(0,v.b)(t,u,1,255):(u instanceof p.XP||u instanceof p.Uz)&&(0,v.b)(t,u,1/255,255):(t.fill(255),u instanceof p.xs?(0,g.f)(t,u.typedBuffer,1,255,4,u.typedBufferStride):(e.attributes.color instanceof p.eI||e.attributes.color instanceof p.nS)&&(0,g.f)(t,u.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new N.n(t,i,4,!0)])}return{geometry:new ne(t,c),vertexCount:r}}(e,r??new qr({},t)),S=h.boundingInfo;null!=S&&0===s&&(0,m.RF)(F,S.box),null!=r&&(c.stageResources.geometries.push(h),c.numberOfVertices+=_)}),l||I.push(c)}),{engineResources:I,referenceBoundingBox:F}}(w,t,s.specifiedLodIndex);return{lods:S,referenceBoundingBox:A,isEsriSymbolResource:w.meta.isEsriSymbolResource,isWosr:!1}}const mi=(0,s.vt)()},1843(e,t,r){r.d(t,{BP:()=>h,l5:()=>d});var i=r(20498),n=r(13030),o=r(90239),a=r(4431),s=r(620),l=r(85079);class c{constructor(e,t,r=0){this.layout=e,this.byteOffset=r,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const i=e.fields.get(t);this[t]=new i.constructor(this.buffer,r+i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new c(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:p(e[1].constructor)})))}freeze(){return this}get locations(){return(0,l.Xk)((0,a.U)(this))}vec2f16(e,t){return this._appendField(e,i.SX?n.ZD:n.gH,t),this}vec2f(e,t){return this._appendField(e,n.gH,t),this}vec2f64(e,t){return this._appendField(e,n.si,t),this}vec3f16(e,t){return this._appendField(e,i.SX?n.EC:n.xs,t),this}vec3f(e,t){return this._appendField(e,n.xs,t),this}vec3f64(e,t){return this._appendField(e,n.Xm,t),this}vec4f16(e,t){return this._appendField(e,i.SX?n.jz:n.Eq,t),this}vec4f(e,t){return this._appendField(e,n.Eq,t),this}vec4f64(e,t){return this._appendField(e,n.Aj,t),this}mat3f(e,t){return this._appendField(e,n.jZ,t),this}mat3f64(e,t){return this._appendField(e,n.j0,t),this}mat4f(e,t){return this._appendField(e,n.Sx,t),this}mat4f64(e,t){return this._appendField(e,n.E$,t),this}vec4u8(e,t){return this._appendField(e,n.XP,t),this}f16(e,t){return this._appendField(e,i.SX?n.XW:n.Y$,t),this}f32(e,t){return this._appendField(e,n.Y$,t),this}f64(e,t){return this._appendField(e,n.qB,t),this}u8(e,t){return this._appendField(e,n.SL,t),this}u16(e,t){return this._appendField(e,n.h,t),this}i8(e,t){return this._appendField(e,n.bf,t),this}vec2i8(e,t){return this._appendField(e,n.D6,t),this}vec2i16(e,t){return this._appendField(e,n.mJ,t),this}vec2u8(e,t){return this._appendField(e,n.LC,t),this}vec2u16(e,t){return this._appendField(e,n.Yi,t),this}vec4u16(e,t){return this._appendField(e,n.Uz,t),this}vec4i16(e,t){return this._appendField(e,n.E7,t),this}u32(e,t){return this._appendField(e,n.P,t),this}_appendField(e,t,r){this._fields.has(e)&&(0,s.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._fields.set(e,{constructor:t,size:i,offset:n,optional:r}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach(r=>{const i=(0,o.GJ)(r.constructor.ElementType);e=Math.floor((e+i-1)/i)*i,r.offset=e,e+=r.size,t=Math.max(t,i)}),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new c(this,e)}createView(e,t){return new c(this,e,t)}clone(){const e=new u;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function h(){return new u}class d{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:f(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const m=[n.Y$,n.gH,n.xs,n.Eq,n.jZ,n.Sx,n.qB,n.si,n.Xm,n.Aj,n.j0,n.E$,n.SL,n.LC,n.eI,n.XP,n.h,n.Yi,n.nS,n.Uz,n.P,n.An,n.H$,n.ml,n.bf,n.D6,n.m8,n.TX,n.Qt,n.mJ,n.Vp,n.E7,n.My,n.UL,n.zD,n.Y4];function f(e){return`${e.ElementType}_${e.ElementCount}`}function p(e){return g.get(e)}const g=new Map;m.forEach(e=>g.set(f(e),e))},4431(e,t,r){r.d(t,{U:()=>o});var i=r(63907),n=r(74038);function o(e,t=0){const r=e.stride;return e.fields.entries().map(([e,o])=>{const a=o.constructor.ElementCount,s=function(e){switch(e){case"u8":return i.pe.UNSIGNED_BYTE;case"u16":return i.pe.UNSIGNED_SHORT;case"u32":return i.pe.UNSIGNED_INT;case"i8":return i.pe.BYTE;case"i16":return i.pe.SHORT;case"i32":return i.pe.INT;case"f16":return i.pe.HALF_FLOAT;case"f32":return i.pe.FLOAT;default:throw new Error("BufferType not supported in WebGL")}}(o.constructor.ElementType),l=o.offset,c=o.optional?.glNormalized??!1,u=o.optional?.integer??!1;return new n._(e,a,s,l,r,c,t,u)}).toArray()}},26857(e,t,r){var i=r(5482),n=r(69622),o=r(91429);let a=class extends n.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.UPDATING=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,o.MZ)()],a.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"UPDATING",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),a=(0,i.Cg)([(0,o.$K)("esri.views.3d.support.debugFlags")],a);const s=new a;r.d(t,["b",0,s])},46686(e,t,r){r.d(t,{o:()=>n});var i=r(31821);function n(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(i.H`
662
+ fragBlur = b / w_total;`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}));r.d(t,["S",0,d])},43609(e,t,r){r.d(t,{a:()=>o,f:()=>a,n:()=>n});var i=r(34275);function n(e,t){o(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r=2,n=r){const o=t.length/2;let a=0,s=0;if(!(0,i.iu)(t)||(0,i.dk)(t)){for(let i=0;i<o;++i)e[a]=t[s],e[a+1]=t[s+1],a+=r,s+=n;return}const l=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<o;++i)e[a]=Math.max(t[s]/l,-1),e[a+1]=Math.max(t[s+1]/l,-1),a+=r,s+=n;else for(let i=0;i<o;++i)e[a]=t[s]/l,e[a+1]=t[s+1]/l,a+=r,s+=n}function a(e,t,r,i){const n=e.typedBuffer,o=e.typedBufferStride,a=i?.count??e.count;let s=(i?.dstIndex??0)*o;for(let e=0;e<a;++e)n[s]=t,n[s+1]=r,s+=o}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:o,normalizeIntegerBufferView:n},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>h,b:()=>s,c:()=>n,d:()=>a,e:()=>d,f:()=>u,l:()=>c,n:()=>m,t:()=>o}),r(44208);var i=r(72727);function n(e,t,r){o(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r,n=3,o=n){const a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s),c=r[0],u=r[1],h=r[2],d=r[4],m=r[5],f=r[6],p=r[8],g=r[9],v=r[10],x=r[12],_=r[13],y=r[14];let b=0,w=0;for(let r=0;r<l;r++){const r=t[b],i=t[b+1],a=t[b+2];e[w]=c*r+d*i+p*a+x,e[w+1]=u*r+m*i+g*a+_,e[w+2]=h*r+f*i+v*a+y,b+=o,w+=n}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,n=3,o=n){const a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s),c=r[0],u=r[1],h=r[2],d=r[3],m=r[4],f=r[5],p=r[6],g=r[7],v=r[8];let x=0,_=0;for(let r=0;r<l;r++){const r=t[x],i=t[x+1],a=t[x+2];e[_]=c*r+d*i+p*a,e[_+1]=u*r+m*i+g*a,e[_+2]=h*r+f*i+v*a,x+=o,_+=n}}function l(e,t,r,i=3,n=i){const o=Math.min(e.length/i,t.length/n);let a=0,s=0;for(let l=0;l<o;l++)e[s]=r*t[a],e[s+1]=r*t[a+1],e[s+2]=r*t[a+2],a+=n,s+=i;return e}function c(e,t,r,i){u(e.typedBuffer,t.typedBuffer,r,i,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r,i,n=3,o=n){const a=Math.min(e.length/n,t.length/o);let s=0,l=0;const c=1/2.2;for(let u=0;u<a;u++)e[l]=i*(r*t[s])**c,e[l+1]=i*(r*t[s+1])**c,e[l+2]=i*(r*t[s+2])**c,s+=o,l+=n}function h(e,t,r,n=3,o=n){const a=(0,i.k)(e.length,n,3),s=(0,i.k)(t.length,o,3),l=Math.min(a,s);let c=0,u=0;for(let i=0;i<l;i++)e[u]=t[c]+r[0],e[u+1]=t[c+1]+r[1],e[u+2]=t[c+2]+r[2],c+=o,u+=n;return e}function d(e,t){m(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function m(e,t,r=3,i=r){const n=Math.min(e.length/r,t.length/i);let o=0,a=0;for(let s=0;s<n;s++){const n=t[o],s=t[o+1],l=t[o+2],c=n*n+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*n,e[a+1]=t*s,e[a+2]=t*l}o+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:u,linearToSRGBView:c,normalize:m,normalizeView:d,scale:l,scaleView:function(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)n[c]=a[l]>>r,n[c+1]=a[l+1]>>r,n[c+2]=a[l+2]>>r,l+=s,c+=o},transformMat3:s,transformMat3View:a,transformMat4:o,transformMat4View:n,translate:h},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>n});var i=r(34727);class n{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return o(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+a(this.range,e-t,r)}minimalMonotonic(e,t,r){return o(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function o(e,t,r,i,n=0,o=!1){return(i-=n)<t?i+=a(e,t-i):i>r&&(i-=a(e,i-r)),o&&i===r&&(i=t),i+n}function a(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const s=new n(0,2*Math.PI),l=(new n(-Math.PI,Math.PI),new n(0,360));r.d(t,["ie",0,l,"uC",0,s])},4341(e,t,r){r.d(t,{I:()=>n});var i=r(26390);class n{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,i.d)(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*o);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;e<Math.max(8,Math.min(this._items.length,o));e++)this._items.push(this._allocator())}}const o=1024},46140(e,t,r){r.d(t,{A:()=>n});var i=r(49186);class n{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new n(this.major,this.minor,this._context)}static parse(e,t=""){const[r,o]=e.split("."),a=/^\s*\d+\s*$/;if(!r?.match||!a.test(r))throw new i.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!o?.match||!a.test(o))throw new i.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(o,10);return new n(s,l,t)}}},61473(e,t,r){function i(e){return e=e||globalThis.location.hostname,c.some(t=>null!=e?.match(t))}function n(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(o)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}r.d(t,{EM:()=>n,b5:()=>i});const o=/^devext\.arcgis\.com$/,a=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,o,a,/^jsapps\.esri\.com$/,s,l]},88340(e,t,r){function i(){return new Float32Array(2)}function n(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function o(){return i()}function a(){return n(1,1)}function s(){return n(1,0)}function l(){return n(0,1)}r.d(t,{fA:()=>n,vt:()=>i});const c=o(),u=a(),h=s(),d=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:h,UNIT_Y:d,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:n,ones:a,unitX:s,unitY:l,zeros:o},Symbol.toStringTag,{value:"Module"})),r.d(t,["Un",0,u,"uY",0,c])},91829(e,t,r){function i(){return[0,0,0,0]}function n(e,t,r,i){return[e,t,r,i]}function o(){return n(1,1,1,1)}function a(){return n(1,0,0,0)}function s(){return n(0,1,0,0)}function l(){return n(0,0,1,0)}function c(){return n(0,0,0,1)}r.d(t,{_Y:()=>c,fA:()=>n,vt:()=>i});const u=[0,0,0,0],h=o(),d=a(),m=s(),f=l(),p=c();Object.freeze(Object.defineProperty({__proto__:null,ONES:h,UNIT_W:p,UNIT_X:d,UNIT_Y:m,UNIT_Z:f,ZEROS:u,clone:function(e){return[e[0],e[1],e[2],e[3]]},create:i,freeze:function(e,t,r,i){return[e,t,r,i]},fromArray:function(e,t=[0,0,0,0]){const r=Math.min(4,e.length);for(let i=0;i<r;++i)t[i]=e[i];return t},fromValues:n,ones:o,unitW:c,unitX:a,unitY:s,unitZ:l,zeros:function(){return[0,0,0,0]}},Symbol.toStringTag,{value:"Module"})),r.d(t,["Un",0,h,"uY",0,u])},78955(e,t,r){r.d(t,{Bw:()=>g,C:()=>n,Cc:()=>y,LI:()=>d,Om:()=>_,S8:()=>x,T9:()=>h,WQ:()=>a,Z0:()=>b,aI:()=>M,hG:()=>p,hZ:()=>o,hs:()=>m,jk:()=>u,m3:()=>v,t2:()=>w});var i=r(34304);function n(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}function a(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function s(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function l(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function c(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function u(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}function h(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}function d(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}function m(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 f(e,t){const r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],o=t[3]-e[3];return Math.sqrt(r*r+i*i+n*n+o*o)}function p(e,t){const r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],o=t[3]-e[3];return r*r+i*i+n*n+o*o}function g(e){const t=e[0],r=e[1],i=e[2],n=e[3];return Math.sqrt(t*t+r*r+i*i+n*n)}function v(e){const t=e[0],r=e[1],i=e[2],n=e[3];return t*t+r*r+i*i+n*n}function x(e,t){const r=t[0],i=t[1],n=t[2],o=t[3];let a=r*r+i*i+n*n+o*o;return a>0&&(a=1/Math.sqrt(a),e[0]=r*a,e[1]=i*a,e[2]=n*a,e[3]=o*a),e}function _(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function y(e,t,r,i){const n=t[0],o=t[1],a=t[2],s=t[3];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e[2]=a+i*(r[2]-a),e[3]=s+i*(r[3]-s),e}function b(e,t,r){const i=t[0],n=t[1],o=t[2],a=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*a,e[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*a,e[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*a,e[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*a,e}function w(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function M(e,t){const r=e[0],n=e[1],o=e[2],a=e[3],s=t[0],l=t[1],c=t[2],u=t[3],h=(0,i.FD)();return Math.abs(r-s)<=h*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-l)<=h*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-c)<=h*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(a-u)<=h*Math.max(1,Math.abs(a),Math.abs(u))}const S=s,T=l,C=c,E=f,I=p,A=g,O=v;Object.freeze(Object.defineProperty({__proto__:null,add:a,ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},copy:n,copyVec3:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},dist:E,distance:f,div:C,divide:c,dot:_,equals:M,exactEquals:w,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},inverse:function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},len:A,length:g,lerp:y,max:h,min:u,mul:T,multiply:l,negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},normalize:x,random:function(e,t=1){const r=i.Ov;let n,o,a,s,l,c;do{n=2*r()-1,o=2*r()-1,l=n*n+o*o}while(l>=1);do{a=2*r()-1,s=2*r()-1,c=a*a+s*s}while(c>=1);const u=Math.sqrt((1-l)/c);return e[0]=t*n,e[1]=t*o,e[2]=t*a*u,e[3]=t*s*u,e},round:d,scale:m,scaleAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e},set:o,sqrDist:I,sqrLen:O,squaredDistance:p,squaredLength:v,str:function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},sub:S,subtract:s,transformMat4:b,transformQuat:function(e,t,r){const i=t[0],n=t[1],o=t[2],a=r[0],s=r[1],l=r[2],c=r[3],u=c*i+s*o-l*n,h=c*n+l*i-a*o,d=c*o+a*n-s*i,m=-a*i-s*n-l*o;return e[0]=u*c+m*-a+h*-l-d*-s,e[1]=h*c+m*-s+d*-a-u*-l,e[2]=d*c+m*-l+u*-s-h*-a,e[3]=t[3],e}},Symbol.toStringTag,{value:"Module"}))},69397(e,t,r){r.d(t,{Qf:()=>s,Qh:()=>o,lM:()=>n});var i=r(34275);function n(e){if(!e)return 0;let t=c;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r],!1));return t}function o(e){if(!e)return 0;if("number"==typeof e[0])return s(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return l(e,8);let r=u;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=c;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e,t=!0){switch(typeof e){case"object":return t?o(e):c;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(...e){return e.reduce((e,t)=>e+(t?(0,i.iu)(t)?t.byteLength+h:Array.isArray(t)?l(t,16):0:0),0)}function l(e,t){return u+e.length*t}const c=32,u=16,h=145},93146(e,t,r){r.d(t,{z:()=>n});class i{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(async e=>(this.module=e,e))),this._promise}}function n(e){return new i(async()=>{const t=await e();return!1===t.isLoaded?.()&&await t.load(),t})}},65806(e,t,r){r.d(t,{g:()=>a});var i=r(51850),n=r(91218),o=r(9762);function a(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r))return s[0]=e.x,s[1]=e.y,s[2]=e.z??0,(0,o.projectBuffer)(s,e.spatialReference,0,t,r,0);const a=(0,n.tryProject)(e,r,i);return!!a&&(t[0]=a.x,t[1]=a.y,t[2]=a.z??0,!0)}const s=(0,i.vt)()},27993(e,t,r){r.d(t,{F:()=>s});var i=r(91218),n=r(16930),o=r(9762),a=r(65806);function s(e,t,r,n){return!(null==t||null==n||e.length<2)&&((0,i.canProjectWithoutEngine)(t,n)?(0,o.projectBuffer)(e,t,0,r,n,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,a.g)(l,r,n)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:n.A.WGS84,type:"point"}},97146(e,t,r){r.d(t,{Dg:()=>o,lC:()=>s,my:()=>a,tM:()=>h,uW:()=>n});var i=r(34275);function n(e){return o(e,!0)}function o(e,t){if(Array.isArray(e)){if(e.length<1024)return e}else if(e.length<1024)return Array.from(e);let r=!0,n=!0;return e.some((e,t)=>(r=r&&0===e,n=n&&e===t,!r&&!n)),r?function(e){if(1===e)return c;if(e<1024)return new Array(e).fill(0);if(e>m.length){const t=Math.max(2*m.length,e);m=new Uint8Array(t)}return new Uint8Array(m.buffer,0,e)}(e.length):n?h(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(const r of e){if(r>=65536)return(0,i.iu)(e)?e:new Uint32Array(e);r>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function a(e,t=e){return e<=1024?new Array(e):t<=65536?new Uint16Array(e):new Uint32Array(e)}function s(e,t,r){if(0===t.length)return e.slice();if(0===e.length)return t.slice();const i=a(e.length+t.length,r);for(let t=0;t<e.length;++t)i[t]=e[t];for(let r=0;r<t.length;++r)i[e.length+r]=t[r];return i}let l=d(131072);const c=[0],u=(()=>{const e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function h(e){return 1===e?c:e<1024?Array.from(new Uint16Array(u.buffer,0,e)):e<u.length?new Uint16Array(u.buffer,0,e):(e>l.length&&(l=d(Math.max(2*l.length,e))),new Uint32Array(l.buffer,0,e))}function d(e){const t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let m=new Uint8Array(65536)},72727(e,t,r){function i(e,t,r){if(t<=0)return 0;const i=e-r;return i<0?0:Math.floor(i/t)+1}r.d(t,{k:()=>i}),r(53966)},90239(e,t,r){function i(e){switch(e){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}r.d(t,{GJ:()=>i})},82919(e,t,r){r.d(t,{DV:()=>x,C:()=>g,vt:()=>f,Qy:()=>p,ui:()=>v,ST:()=>M,bU:()=>S,pw:()=>w,m7:()=>_,ZU:()=>y,GH:()=>b,c8:()=>C});var i=r(4341),n=r(58083),o=r(35522),a=r(51850),s=r(78955),l=r(91829),c=r(70328),u=r(71351);function h(e){return e?{ray:(0,u.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,u.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>h());var d=r(27921),m=r(32114);function f(e){return e?[(0,d.vt)(e[0]),(0,d.vt)(e[1]),(0,d.vt)(e[2]),(0,d.vt)(e[3]),(0,d.vt)(e[4]),(0,d.vt)(e[5])]:[(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)()]}function p(){return[(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)()]}function g(e,t){for(let r=0;r<E;r++)(0,d.C)(e[r],t[r]);return e}function v(e,t,r,i=P){const a=(0,n.lw)(m.Rc.get(),t,e);(0,n.B8)(a,a);for(let e=0;e<I;++e){const t=(0,s.Z0)(m.Km.get(),A[e],a);(0,o.hZ)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}x(r,i)}function x(e,t){(0,d.Cr)(t[4],t[0],t[3],e[0]),(0,d.Cr)(t[1],t[5],t[6],e[1]),(0,d.Cr)(t[4],t[5],t[1],e[2]),(0,d.Cr)(t[3],t[2],t[6],e[3]),(0,d.Cr)(t[0],t[1],t[2],e[4]),(0,d.Cr)(t[5],t[4],t[7],e[5])}function _(e,t){return y(e,t.center,t.radius)}function y(e,t,r){for(let i=0;i<E;i++){const n=e[i];if(n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]>=r)return!1}return!0}function b(e,t,r){const i=(0,c.gX)(t,F),n=(0,c.VL)(t)/2,a=(0,c.yr)(t)/2,s=(0,c.uJ)(t)/2;return r?function(e,t,r,i,n,a){const s=(0,o.Z0)(D,t,a);for(let t=0;t<E;t++){const o=e[t];if(o[0]*s[0]+o[1]*s[1]+o[2]*s[2]+o[3]-(Math.abs(o[0]*a[0]+o[1]*a[1]+o[2]*a[2])*r+Math.abs(o[0]*a[4]+o[1]*a[5]+o[2]*a[6])*i+Math.abs(o[0]*a[8]+o[1]*a[9]+o[2]*a[10])*n)>0)return!1}return!0}(e,i,n,a,s,r):function(e,t,r,i,n){for(let o=0;o<E;o++){const a=e[o];if(a[0]*t[0]+a[1]*t[1]+a[2]*t[2]+a[3]-(Math.abs(a[0])*r+Math.abs(a[1])*i+Math.abs(a[2])*n)>0)return!1}return!0}(e,i,n,a,s)}function w(e,t){return T(e,function(e,t=h()){return(0,u.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,O.get()))}function M(e,t,r){return T(e,function(e,t,r=h()){const i=(0,o.Bw)(e.vector);return(0,u.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,O.get()))}function S(e,t){for(let r=0;r<E;r++)if((0,d.mN)(e[r],t)>0)return!1;return!0}function T(e,t){for(let r=0;r<E;r++)if(!(0,d.$Q)(e[r],t))return!1;return!0}const C={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},E=6,I=8,A=[(0,l.fA)(-1,-1,-1,1),(0,l.fA)(1,-1,-1,1),(0,l.fA)(1,1,-1,1),(0,l.fA)(-1,1,-1,1),(0,l.fA)(-1,-1,1,1),(0,l.fA)(1,-1,1,1),(0,l.fA)(1,1,1,1),(0,l.fA)(-1,1,1,1)],O=new i.I(h),P=p(),F=(0,a.vt)(),D=(0,a.vt)()},11964(e,t,r){r.d(t,{Cr:()=>u,LV:()=>c,_I:()=>h,vt:()=>l});var i=r(34727),n=r(4341),o=r(35522),a=r(51850),s=r(32114);function l(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function c(e,t){const r=d.get();return r.origin=e,r.vector=t,r}function u(e,t,r=l()){return(0,o.C)(r.origin,e),(0,o.Re)(r.vector,t,e),r}function h(e,t,r){return function(e,t,r,n,a){const{vector:l,origin:c}=e,u=(0,o.Re)(s.rq.get(),t,c),h=(0,o.Om)(l,u)/(0,o.m3)(l);return(0,o.hs)(a,l,(0,i.qE)(h,0,1)),(0,o.WQ)(a,a,e.origin)}(e,t,0,0,r)}(0,a.vt)(),(0,a.vt)();const d=new n.I(()=>l())},52039(e,t,r){r.d(t,{O7:()=>h,el:()=>l});var i=r(69052),n=(r(49186),r(17676)),o=(r(5443),r(39829),r(82799),r(16930)),a=r(93146),s=(r(80754),r(21325));async function l(e,t,r){Array.isArray(e)||(e=[e]),null!=t&&"object"==typeof t&&"authMode"in t&&(r=t);let i=null;for(const t of e)i??=t?.spatialReference;if(!i)return e;const o=(0,s.Vp)(i);if(!o)return e;const[a,l]=o.valid;let h=!1;for(const t of e){if(!t)continue;if("point"===t.type){h||=t.x>=l,h||=t.x<=a;continue}const{extent:e}=t;if(null==e){h=!0;break}h||=e.xmin>=l,h||=e.xmin<=a,h||=e.xmax>=l,h||=e.xmax<=a}if(!h)return e;const[{foldInto360Range:d},m]=await(0,n.qr)(Promise.all([c.getImportPromise(),u.getImportPromise()]),r),f=m.fromSpatialReference(i);return e.map(e=>{if(null==e||"mesh"===e.type)return e;const t=m.fromGeometry(e),r=m.toGeometry(d(t,f),i);return"extent"===e.type&&1===r?.rings.length?r.extent:r})}const c=(0,a.z)(()=>r.e(4144).then(r.bind(r,4144))),u=(0,a.z)(()=>Promise.all([r.e(9187),r.e(8885),r.e(5756),r.e(3299),r.e(1550)]).then(r.bind(r,78125)));function h(e,t,r){const i=(0,s.Vp)(r);if(null==i)return e;const[n,o]=i.valid,a=2*o;let l=0,c=0;t>o?l=Math.ceil(Math.abs(t-o)/a):t<n&&(l=-Math.ceil(Math.abs(t-n)/a)),e>o?c=Math.ceil(Math.abs(e-o)/a):e<n&&(c=-Math.ceil(Math.abs(e-n)/a));let u=e+(l-c)*a;const h=u-t;return h>o?u-=a:h<n&&(u+=a),u}function d(e){const t=(0,s.Vp)(e);if(null==t)return null;const[r,n]=t.valid;return new i.hr(r,n)}const m=d(o.A.WGS84);d(o.A.WebMercator),r.d(t,["Y_",0,m])},80754(e,t,r){r.d(t,{kS:()=>c,kd:()=>l});var i=r(82799),n=r(16930),o=r(60408),a=r(52006);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator}),minus180Line:new i.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.A({paths:[[[180,-180],[180,180]]],spatialReference:n.A.WGS84}),minus180Line:new i.A({paths:[[[-180,-180],[-180,180]]],spatialReference:n.A.WGS84})}};function l(e,t){return Math.ceil((e-t)/(2*t))}function c(e,t){if((0,a.Ed)(e))for(const r of function(e){return(0,o.Bi)(e)?e.curveRings:e.curvePaths}(e))for(const e of r){if((0,a.aO)(e)){const[r,i]=e.c;r[0]+=t,i[0]+=t;continue}if((0,a.FG)(e)){const[r,i]=e.a;r[0]+=t,i[0]+=t;continue}if((0,a.n1)(e)){const[r,i,n]=e.b;r[0]+=t,i[0]+=t,n[0]+=t;continue}e[0]+=t}for(const r of function(e){return(0,o.Bi)(e)?e.rings:e.paths}(e))for(const e of r)e[0]+=t;return e}r.d(t,["j7",0,s])},71351(e,t,r){r.d(t,{C:()=>u,Cr:()=>h,LV:()=>c,fA:()=>d,vt:()=>s}),r(4576);var i=r(4341),n=(r(77690),r(29242)),o=r(35522),a=r(51850);function s(e){return e?l((0,a.o8)(e.origin),(0,a.o8)(e.direction)):l((0,a.vt)(),(0,a.vt)())}function l(e,t){return{origin:e,direction:t}}function c(e,t){const r=m.get();return r.origin=e,r.direction=t,r}function u(e,t=s()){return d(e.origin,e.direction,t)}function h(e,t,r=s()){return(0,o.C)(r.origin,e),(0,o.Re)(r.direction,t,e),r}function d(e,t,r=s()){return(0,o.C)(r.origin,e),(0,o.C)(r.direction,t),r}r(32114);const m=new i.I(()=>s());(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,n.vt)()},94008(e,t,r){r.d(t,{iy:()=>m}),r(44208),r(53966);var i=r(34727),n=r(34304),o=r(58083),a=r(35522),s=r(51850),l=r(91829),c=r(34275);var u=r(71351),h=r(44280),d=r(32114);class m{constructor(e=0,t=0,r=0,i=0){this.radius=i,"number"==typeof e?this._center=(0,s.fA)(e,t,r):function(e){return t=e,(0,c.vZ)(t)&&t.length>=3||function(e){return((0,c.aI)(e)||Array.isArray(e))&&e.length>=3}(e);var t}(e)||function(e){return(t=e)instanceof Float32Array&&t.length>=4||function(e){return Array.isArray(e)&&e.length>=4}(e);var t}(e)?(this._center=(0,s.ci)(e),this.radius=4===e.length?e[3]:t):(this._center=(0,s.o8)(e.center),this.radius=e.radius)}get isValid(){return this.radius>=0}invalidate(){this.radius=-1}get center(){return this._center}set center(e){(0,a.C)(this.center,e)}exactEquals(e){return(0,a.aI)(this._center,e.center)&&this.radius===e.radius}copyFrom(e){return e!==this&&((0,a.C)(this._center,e.center),this.radius=e.radius),this}clone(){return new m(this.center,this.radius)}toVec4(){return(0,l.fA)(this.center[0],this.center[1],this.center[2],this.radius)}contains(e){return(0,a.hG)(this.center,e)<=this.radius**2}intersects(e){const t=this.radius+e.radius;return(0,a.hG)(this.center,e.center)<=t*t}intersectRay(e,t){if(null==e)return!1;if(!this._intersect(e,f))return!1;let{t0:r,t1:i}=f;if((r<0||i<r&&i>0)&&(r=i),r<0)return!1;if(t){const{origin:i,direction:n}=e;t[0]=i[0]+n[0]*r,t[1]=i[1]+n[1]*r,t[2]=i[2]+n[2]*r}return!0}intersectLine(e,t){const r=(0,u.Cr)(e,t);if(!this._intersect(r,f))return[];const{origin:i,direction:o}=r,{t0:l,t1:c}=f,h=e=>{const t=(0,s.vt)();return(0,a.Ln)(t,i,o,e),this.projectPoint(t,t)};return Math.abs(l-c)<(0,n.FD)()?[h(l)]:[h(l),h(c)]}_intersect(e,t){const{origin:r,direction:i}=e,n=p;n[0]=r[0]-this.center[0],n[1]=r[1]-this.center[1],n[2]=r[2]-this.center[2];const o=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(0===o)return!1;const a=2*(i[0]*n[0]+i[1]*n[1]+i[2]*n[2]),s=a*a-4*o*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-this.radius**2);if(s<0)return!1;const l=Math.sqrt(s);return t.t0=(-a-l)/(2*o),t.t1=(-a+l)/(2*o),!0}projectPoint(e,t){const r=(0,a.Re)(d.rq.get(),e,this.center),i=(0,a.hs)(d.rq.get(),r,this.radius/(0,a.Bw)(r));return(0,a.WQ)(t,i,this.center)}closestPointOnSilhouette(e,t){const r=d.rq.get(),i=d.Rc.get();(0,a.$A)(r,e.origin,e.direction),(0,a.$A)(t,r,e.origin),(0,a.hs)(t,t,1/(0,a.Bw)(t)*this.radius);const n=this._angleToSilhouette(e.origin),s=(0,h.g7)(e.origin,t);return(0,o.$0)(i,s+n,r),(0,a.Z0)(t,t,i),t}frustumCoverage(e,t,r){const i=this.radius,n=i*i,o=e+.5*Math.PI,a=t*t+n-2*Math.cos(o)*t*i,s=Math.sqrt(a),l=a-n;if(l<=0)return.5;const c=Math.sqrt(l),u=Math.acos(c/s)-Math.asin(i/(s/Math.sin(o)));return Math.min(1,(u+.5*r)/r)}_angleToSilhouette(e){const t=(0,a.Re)(d.rq.get(),e,this.center),r=(0,a.Bw)(t),n=this.radius,o=n+Math.abs(n-r);return(0,i.XM)(n/o)}union(e){const t=(0,a.Io)(this._center,e.center),r=this.radius,i=e.radius;return t+i<r?this:t+r<i?(this.copyFrom(e),this):((0,a.Cc)(this._center,this._center,e.center,(t+i-r)/(2*t)),this.radius=(t+r+i)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}signedDistanceToPlane(e){const{center:t,radius:r}=this,i=e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3];return i<0?Math.min(i+r,0):Math.max(i-r,0)}}new m;const f={t0:0,t1:0},p=(0,s.vt)();(0,s.vt)(),(0,s.vt)()},48295(e,t,r){r.d(t,{BU:()=>u,Ui:()=>s,cq:()=>c,k3:()=>h,rb:()=>d});var i=r(4341),n=r(35522),o=r(51850),a=r(11964);function s(e,t,r){const i=1e-5,{direction:o,origin:a}=t,{p0:s,p1:l,p2:c}=e,u=l[0]-s[0],h=l[1]-s[1],d=l[2]-s[2],m=c[0]-s[0],f=c[1]-s[1],p=c[2]-s[2],g=o[1]*p-f*o[2],v=o[2]*m-p*o[0],x=o[0]*f-m*o[1],_=u*g+h*v+d*x;if(_>-i&&_<i)return!1;const y=1/_,b=a[0]-s[0],w=a[1]-s[1],M=a[2]-s[2],S=y*(b*g+w*v+M*x);if(S<0||S>1)return!1;const T=w*d-h*M,C=M*u-d*b,E=b*h-u*w,I=y*(o[0]*T+o[1]*C+o[2]*E);return!(I<0||S+I>1||(r&&((0,n.hs)(r,o,y*(m*T+f*C+p*E)),(0,n.WQ)(r,a,r)),0))}function l(e,t,r){const[i,n]=e,[o,a]=t,[s,l]=r;return.5*((o-i)*(l-n)-(a-n)*(s-i))}function c(e,t,r,i,n=0){const o=l(i,e,t),a=l(i,t,r),s=l(i,r,e);return!((o<-n||a<-n||s<-n)&&(o>n||a>n||s>n))}function u(e,t,r){return(0,n.Re)(m,t,e),(0,n.Re)(f,r,e),.5*(0,n.Bw)((0,n.$A)(m,m,f))}function h(e,t,r,i,o){(0,n.jb)(m,i,r),(0,n.jb)(p,o,r),(0,n.jb)(f,t,r);const a=(0,n.Om)(m,f),s=(0,n.Om)(p,f);if(a<=0&&s<=0)return void(0,n.C)(e,r);(0,n.jb)(f,t,i);const l=(0,n.Om)(m,f),c=(0,n.Om)(p,f);if(l>=0&&c<=l)return void(0,n.C)(e,i);const u=a*c-l*s;if(u<=0&&a>=0&&l<=0)return void(0,n.Ln)(e,r,m,a/(a-l));(0,n.jb)(f,t,o);const h=(0,n.Om)(m,f),d=(0,n.Om)(p,f);if(d>=0&&h<=d)return void(0,n.C)(e,o);const g=h*s-a*d;if(g<=0&&s>=0&&d<=0)return void(0,n.Ln)(e,r,p,s/(s-d));const v=l*d-h*c;if(v<=0&&c-l>=0&&h-d>=0)return(0,n.jb)(f,o,i),void(0,n.Ln)(e,i,f,(c-l)/(c-l+(h-d)));const x=1/(v+g+u);(0,n.C)(e,r),(0,n.Ln)(e,e,m,g*x),(0,n.Ln)(e,e,p,u*x)}function d(e,t,r,i){(0,n.jb)(m,r,t),(0,n.jb)(f,i,t),(0,n.$A)(e,m,f);const o=(0,n.Bw)(e);return 0!==o&&((0,n.hs)(e,e,1/o),!0)}r(32114),new i.I(a.vt),new i.I(()=>{return e?{p0:(0,o.o8)(e.p0),p1:(0,o.o8)(e.p1),p2:(0,o.o8)(e.p2)}:{p0:(0,o.vt)(),p1:(0,o.vt)(),p2:(0,o.vt)()};var e});const m=(0,o.vt)(),f=(0,o.vt)(),p=(0,o.vt)()},38969(e,t,r){r.d(t,{i:()=>n});var i=r(37955);function n(e,t){return new Promise((r,n)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",n)))})}},21015(e,t,r){r.d(t,{R:()=>l});var i=r(11254),n=r(60999),o=r(49186),a=r(17676),s=r(84952);class l{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,s.DB)(e)?((0,a.Te)(t),(0,s.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);const s=await(0,n.Ke)((0,i.A)(t,{responseType:e,...r}));if(s.ok)return s.value.data;throw(0,a.QP)(s.error),new o.A("gltf-loader-request-error",`Request for resource failed: ${s.error}`)}}},84498(e,t,r){r.d(t,{x:()=>a});var i=r(34275),n=r(97146),o=r(63907);function a(e,t){switch(t){case o.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,n.tM)(e):(0,i.mg)(e)?new Uint16Array(e):e}(e);case o.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,i=(0,n.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let n=0;n<r;n+=1)n%2==0?(i[t++]=e[n],i[t++]=e[n+1],i[t++]=e[n+2]):(i[t++]=e[n+1],i[t++]=e[n],i[t++]=e[n+2])}return i}(e);case o.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}const n=e[0];let o=e[1],a=0;for(let t=0;t<r;++t){const r=e[t+2];i[a++]=n,i[a++]=o,i[a++]=r,o=r}return i}(e)}}},51530(e,t,r){r.d(t,{KB:()=>a,Xi:()=>n,pn:()=>s,x3:()=>o});var i=r(44208);class n{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function o(e){return"encoded-mesh-texture"===e?.type}async function a(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function s(e,t){if("image/ktx2"===t)return new n(e);const r=new Blob([e],{type:t});let o=URL.createObjectURL(r);switch(t){case"image/jpeg":o+="#.jpg";break;case"image/png":o+="#.png"}const a=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{n(),e(a)},i=e=>{n(),t(e)},n=()=>{URL.revokeObjectURL(o),a.removeEventListener("load",r),a.removeEventListener("error",i)};a.addEventListener("load",r),a.addEventListener("error",i),a.src=o});try{a.src=o,await a.decode()}catch{}return URL.revokeObjectURL(o),a}},55907(e,t,r){r.d(t,{fetch:()=>di});var i=r(40876),n=r(61473),o=r(34727),a=r(77690),s=r(29242),l=r(58083),c=r(9093),u=r(48163),h=r(35522),d=r(51850),m=r(70328);function f(e,t=!1){return e<=1024?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var p=r(13030),g=r(73354),v=r(50867),x=r(43609),_=r(21015),y=r(84498),b=r(51530),w=r(88340);function M(e){if(null==e)return null;const t=null!=e.offset?e.offset:w.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:w.Un,n=(0,s.fA)(1,0,0,0,1,0,t[0],t[1],1),o=(0,s.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,s.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,s.vt)();return(0,a.lw)(c,o,l),(0,a.lw)(c,n,c),c}class S{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class T{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new S,this.numberOfVertices=0}}var C=r(11254),E=r(60999),I=r(49186),A=r(53966),O=r(69397);class P{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(const t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){const r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(const e of this._outer)yield e}*values(){for(const e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(const[e,t]of this._outer)for(const[r,i]of t)yield[e,r,i]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,i)=>e(t,r,i)))}copy(){const e=new P;return this.forAll((t,r,i)=>e.set(r,i,t)),e}}var F=r(17676),D=r(46140),R=r(97146);async function B(e,t){return(await(0,C.A)(e,{responseType:"image",...t})).data}var N=r(46610),z=r(34275),H=r(20498);function L(e){if(e.length<1024)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,z.LW)(e)?(0,H.pX)().from(e):(0,z.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return(0,z.vZ)(e)?Float32Array.from(e):Uint32Array.from(e);default:return Float64Array.from(e)}}var j=r(15142),W=r(94008),U=r(620);class V{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this._readPosition=r,this._children=void 0,(0,U.vA)(e.length>=1);const i=e.length;Z.clear();const n=(0,m.Ie)();for(let o=0;o<i;++o){const i=t*e[o];for(let e=0;e<t;++e){const t=i+e;Z.push(t),(0,m.iT)(n,r(G,t))}}this.box=n;const o=new W.iy,a=(0,m.gX)(n,o.center);let s=.5*Math.max((0,m.VL)(n),(0,m.yr)(n),(0,m.uJ)(n)),l=s*s;for(let e=0;e<Z.length;++e){const t=r(G,Z.at(e)),i=(0,h.Re)(t,t,a),n=(0,h.uE)(i);if(n<=l)continue;const o=Math.sqrt(n),c=.5*(o-s);s+=c,l=s*s,(0,h.Ln)(a,a,i,c/o)}o.radius=s,this.sphere=o,Z.clear()}get children(){if(this._children)return this._children;const e=this.box;if((0,m.TF)(e)<=1)return;const{_readPosition:t,_numIndexPerPrimitive:r,primitiveIndices:i}=this,n=(0,m.gX)(e,G),o=i.length,a=new Uint8Array(o),s=[0,0,0,0,0,0,0,0];for(let e=0;e<o;++e){const o=r*i[e],l=t(k,o);for(let e=1;e<r;++e)(0,h.jk)(l,l,t($,o+e));const c=(l[0]<n[0]?1:0)|(l[1]<n[1]?2:0)|(l[2]<n[2]?4:0);a[e]=c,++s[c]}let l=0;for(let e=0;e<8;++e)s[e]>0&&++l;if(l<2)return;const c=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0];for(let e=0;e<8;++e)s[e]>0&&(c[e]=new Uint32Array(s[e]));s.fill(0);for(let e=0;e<o;++e){const t=a[e];c[t][s[t]++]=i[e]}const u=new Array;for(let e=0;e<8;++e){const i=c[e];void 0!==i&&u.push(new V(i,r,t))}return this._children=u,this._children}static prune(){Z.prune()}}const G=(0,d.vt)(),k=(0,d.vt)(),$=(0,d.vt)(),Z=new j.A({deallocator:null});var q=r(24326);class Y{constructor(e){this.id=(0,q.c)(),this._attributes=new Map;for(const[t,r]of e)this._attributes.set(t,{...r,indices:(0,R.Dg)(r.indices)})}get attributes(){return this._attributes}}var X=r(48295);const K=(0,d.vt)(),J=(0,d.vt)(),Q=(0,d.vt)(),ee=(0,d.vt)();class te{constructor(){this.uid=(0,q.c)()}}class re extends te{constructor(e){super(),this.highlightName=e,this.channel=0}}var ie=r(94656);class ne extends Y{constructor(e,t,r=null,i=0,n=null,o=-1,a,s){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=n,this.edgeIndicesLength=o,this.baseGeometry=a,this.drawIndices=s,this._readPrimitivePosition=null,this._vertexPositionIndicesCache=void 0,this._transformation=void 0,this.localOrigin=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.occludees=void 0,this.visible=!0,this._boundingInfo=null,(0,U.vA)((e?.useIndexing??!1)===(null!=s),"Material index requirement and Geometry must match"),this.edgeIndicesLength<0&&(this.edgeIndicesLength=this.indexCount)}get readPrimitivePosition(){return this._readPrimitivePosition??=function(e,t){const{data:r,indices:i,size:n,stride:o}=e;return(0,U.vA)(2===n||3===n||4===n,"Position attribute must have 2, 3 or 4 components"),2===n?null!=t?(e,n)=>{const a=i[t[n]]*o;return e[0]=r[a],e[1]=r[a+1],e[2]=-2,e}:(e,t)=>{const n=i[t]*o;return e[0]=r[n],e[1]=r[n+1],e[2]=-2,e}:null!=t?(e,n)=>{const a=i[t[n]]*o;return e[0]=r[a],e[1]=r[a+1],e[2]=r[a+2],e}:function(e,t,r){return(i,n)=>{const o=t[n]*r;return i[0]=e[o],i[1]=e[o+1],i[2]=e[o+2],i}}(r,i,o)}(this.positionAttribute,this.drawIndices),this._readPrimitivePosition}_invalidateReadPrimitivePosition(){this._readPrimitivePosition=null}instantiate(e={}){const t=new ne(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:L(t.data)},this._attributes.set(e,t),"position"===e&&this._invalidateReadPrimitivePosition()),t}setAttributeData(e,t){const r=this._attributes.get(e);r?(this._attributes.set(e,{...r,exclusive:!0,data:t}),"position"===e&&this._invalidateReadPrimitivePosition()):(0,ie.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get primitivePositionIndices(){return void 0!==this._vertexPositionIndicesCache||(this._vertexPositionIndicesCache=this._computePrimitivePositionIndices()),this._vertexPositionIndicesCache}_computePrimitivePositionIndices(){const{drawIndices:e}=this,t=this.positionAttribute;if(null!=e&&null!=t){const r=new Array;for(const i of e)r.push(t.indices[i]);return r}return t?.indices??null}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this.drawIndices??this.positionAttribute?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!this._calculateAttachmentOrigin(e)&&(null!=this._transformation&&(0,h.Z0)(e,e,this._transformation),!0)}_calculateAttachmentOrigin(e){return 0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e)}_computeAttachmentOriginTriangles(e){return function(e,t,r){if(r<=0)return!1;(0,h.hZ)(e,0,0,0),(0,h.hZ)(ee,0,0,0);let i=0,n=0;for(let o=0;o<r;++o){const r=3*o;t(K,r),t(J,r+1),t(Q,r+2);const a=(0,X.BU)(K,J,Q);a?((0,h.WQ)(K,K,J),(0,h.WQ)(K,K,Q),(0,h.hs)(K,K,1/3*a),(0,h.WQ)(e,e,K),i+=a):((0,h.WQ)(ee,ee,K),(0,h.WQ)(ee,ee,J),(0,h.WQ)(ee,ee,Q),n+=3)}return!(0===n&&0===i||(0!==i?((0,h.hs)(e,e,1/i),0):0===n||((0,h.hs)(e,ee,1/n),0)))}(e,this.readPrimitivePosition,this.indexCount/3)}_computeAttachmentOriginLines(e){const{indexCount:t}=this;return function(e,t,r,i){if(r<=0)return!1;(0,h.hZ)(e,0,0,0),(0,h.hZ)(ee,0,0,0);let n=0,o=0;const a=r-1,s=a+(i?2:0);for(let r=0;r<s;r+=2){const i=r<a?r+1:0;t(K,r<a?r:a),t(J,i),(0,h.hs)(K,(0,h.WQ)(K,K,J),.5);const s=(0,h.xg)(K,J);s>0?((0,h.WQ)(e,e,(0,h.hs)(K,K,s)),n+=s):0===n&&((0,h.WQ)(ee,ee,K),o++)}return 0!==n?((0,h.hs)(e,e,1/n),!0):0!==o&&((0,h.hs)(e,ee,1/o),!0)}(e,this.readPrimitivePosition,t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t>2}(this.material.parameters,t))}_computeAttachmentOriginPoints(e){return function(e,t,r){if(r<=0)return!1;(0,h.hZ)(e,0,0,0);let i=NaN,n=NaN,o=NaN,a=0;for(let s=0;s<r;s++){const r=t(K,s);r[0]===i&&r[1]===n&&r[2]===o||(e[0]+=r[0],e[1]+=r[1],e[2]+=r[2],a++),i=r[0],n=r[1],o=r[2]}return a>1&&(0,h.hs)(e,e,1/a),a>0}(e,this.readPrimitivePosition,this.indexCount)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const e=this.positionAttribute,t=this.indexCount;if(!e||0===t)return null;const r=0===this.type?3:1;(0,U.vA)(t%r===0,"Indexing error: "+t+" not divisible by "+r);const i=(0,R.tM)(t/r);return new V(i,r,this.readPrimitivePosition)}get transformation(){return this._transformation??c.zK}set transformation(e){this._transformation=e&&e!==c.zK?(0,c.o8)(e):null}get highlights(){return this._highlights||oe}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new re(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const oe=new Set;var ae=r(65529),se=r(97768),le=r(84952),ce=r(38969),ue=r(95117),he=r(2741);let de;var me=r(63907),fe=r(25530),pe=r(42293);const ge=()=>A.A.getLogger("esri.views.3d.webgl-engine.lib.BasisUtil");let ve=null,xe=null;async function _e(){return null==xe&&(de??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,he.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),xe=de,ve=await xe),xe}function ye(e,t,r,i,n){const o=(0,pe.MW)(t?me.CQ.COMPRESSED_RGBA8_ETC2_EAC:me.CQ.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function be(e){return e.getNumImages()>=1&&!e.isUASTC()}function we(e){return e.getFaces()>=1&&(e.isETC1S()||e.isUASTC())}function Me(e,t,r,i,n,o,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,h]=l?i?[1,me.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,me.CQ.COMPRESSED_RGB8_ETC2]:c?i?[3,me.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,me.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<d;e++)m.push(new Uint8Array(a(e,u))),s(e,u,m[e]);return t.internalFormat=h,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new fe.A(e,t,{type:"compressed",levels:m})}const Se=()=>A.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function Te(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Ce=Te("DXT1"),Ee=Te("DXT3"),Ie=Te("DXT5");function Ae(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function Oe(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const a=Math.min(Math.sqrt(r/o),i/n);return[Ae(Math.round(e*a),i),Ae(Math.round(t*a),i)]}(e,t);return e.width===r&&e.height===i?e:Pe(e,r,i)}function Pe(e,t,r){if(e instanceof ImageData)return Pe(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new I.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}var Fe=r(67171),De=r(12541);class Re{constructor(e,t){this._data=e,this.id=(0,q.c)(),this.events=new ae.bk,this._parameters={...Ne,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,le.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,ce.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,le.DB)(e.src)||(0,le.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new Fe.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t.isImmutable=!0===this._parameters.immutable&&function(e){return null!=e&&((0,De.tl)(e)||(0,De.tr)(e)||(0,De.CR)(e)||(0,De.QJ)(e))}(this._parameters.internalFormat),t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,z.mw)(e)||(0,z.mg)(e))return"image/ktx2"===t.encoding?function(e,t){if(null==ve)return e.byteLength;const r=new ve.KTX2File(new Uint8Array(e)),i=we(r)?ye(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):"image/x.basis"===t.encoding?function(e,t){if(null==ve)return e.byteLength;const r=new ve.BasisFile(new Uint8Array(e)),i=be(r)?ye(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Be(e):t,n=t.pixelFormat??6408,o=(0,pe.wH)(n);return(t.mipmap?4/3:1)*r*i*o||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const t=this._data;return null==t?(this._texture=new fe.A(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,z.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,z.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):(0,z.mg)(t)&&"image/ktx"===this._parameters.encoding?this._loadFromKTX1(e,t):(0,z.mw)(t)&&"image/ktx"===this._parameters.encoding?this._loadFromKTX1(e,new Uint8Array(t)):((0,z.mw)(t)||(0,z.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,z.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,z.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return Se().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return Se().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case Ce:n=8,o=me.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ee:n=16,o=me.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Ie:n=16,o=me.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Se().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(Se().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,u=l;let h,d;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const f=[];for(let t=0;t<a;++t)d=(s+3>>2)*(l+3>>2)*n,h=new Uint8Array(e.buffer,m,d),f.push(h),m+=d,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:o,width:c,height:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new fe.A(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX1(e,t){return this._texture=function(e,t,r){const i=function(e,t){const r=new Uint32Array(e.buffer,e.byteOffset,16);if(1481919403!==r[0]||3140563232!==r[1]||169478669!==r[2])return ge().error("Invalid magic number in KTX1 header"),null;if(67305985!==r[3]||1!==r[5]||r[7]!==me.CQ.COMPRESSED_RGB8_ETC2||6407!==r[8])return ge().error("Unsupported KTX1 image"),null;const i=r[7];let n=1,o=r[9],a=r[10];if(3&o||3&a)return null;const s=o,l=a;let c,u;!1!==t&&(n=Math.max(1,r[14]));let h=e.byteOffset+64;const d=[];for(let t=0;t<n;++t)u=(e[h]|e[h+1]<<8|e[h+2]<<16|e[h+3]<<24)>>>0,h+=4,c=new Uint8Array(e.buffer,h,u),d.push(c),h+=u,o=Math.max(1,o>>1),a=Math.max(1,a>>1);return{textureData:{type:"compressed",levels:d},internalFormat:i,width:s,height:l}}(r,t.hasMipmap??!1);if(null==i)throw new Error("KTX1 texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new fe.A(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==ve&&(ve=await _e());const i=new ve.KTX2File(new Uint8Array(r));if(!we(i))return null;i.startTranscoding();const n=Me(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==ve&&(ve=await _e());const i=new ve.BasisFile(new Uint8Array(r));if(!be(i))return null;i.startTranscoding();const n=Me(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,U.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new fe.A(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await B(t,{signal:r});return(0,F.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,ue.y)(t,t.src,!1,r);return(0,F.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((i,n)=>{const o=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,se.xt)(l)},a=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(o(),i(this._loadFromImage(e,t)))},s=e=>{o(),n(e||new I.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,F.u7)(r,()=>s((0,F.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=Oe(r,e.parameters));const i=Be(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._texture=new fe.A(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,se.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function Be(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const Ne={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1};var ze=r(49255);class He{constructor(e){this._material=e.material,this._techniques=e.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(t))}ensureResources(e){return 2}}var Le=r(65786);class je extends He{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,e=>this._textureNormal=e),this._acquire(e.emissiveTextureId,e=>this._textureEmissive=e),this._acquire(e.occlusionTextureId,e=>this._textureOcclusion=e),this._acquire(e.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){super.dispose(),this._texture=(0,se.Gz)(this._texture),this._textureNormal=(0,se.Gz)(this._textureNormal),this._textureEmissive=(0,se.Gz)(this._textureEmissive),this._textureOcclusion=(0,se.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,se.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new Ue(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,se.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,F.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,se.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class We extends Le.Y{constructor(e=null){super(),this.textureEmissive=e}}class Ue extends We{constructor(e,t,r,i,n,o,a){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.scale=o,this.normalTextureTransformMatrix=a}}var Ve=r(19245);class Ge{constructor(e,t){this.id=(0,q.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,Ve.MB)(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,Ve.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get emissions(){return 0}getConfiguration(e){return this.updateConfiguration(e),this._configuration}updateConfiguration(e){this._configuration.output=e.output,this._configuration.hasEmission=e.hasEmission&&(0,ze._o)(e.output),this._configuration.hasHighlightMixTexture=10===e.output&&null!=e.highlightMixTexture,this._configuration.useFloatBlend=e.useFloatBlend.value,this._configuration.emissionDimmingPass=e.transparentWithoutDepthEmissionDimmingPass&&(0,ze._o)(e.output)}}Le.Y;class ke{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const $e=(0,m.vt)();function Ze(e,t,r,i,n,o){if(!e.visible)return;const a=(0,h.jb)(ot,i,r),{tolerance:s}=t,l=new ke(s,!1,t.options.normalRequired);if(e.boundingInfo)(0,U.vA)(0===e.type),Ye(e.readPrimitivePosition,e.boundingInfo,r,a,s,n,l,o);else{const t=e.readPrimitivePosition;!function(e,t,r,i,n,o,a,s){const l=t,c=at,u=Math.abs(l[0]),d=Math.abs(l[1]),m=Math.abs(l[2]),f=u>=d?u>=m?0:2:d>=m?1:2,p=f,g=l[p]<0?2:1,v=(f+g)%3,x=(f+(3-g))%3,_=l[v]/l[p],y=l[x]/l[p],b=1/l[p],w=Ke,M=Je,S=Qe,{normalRequired:T}=a;for(let t=r;t<i;++t){const r=3*t;n(c[0],r),n(c[1],r+1),n(c[2],r+2),o&&(o.applyToVertex(c[0],c[0][0],c[0][1],c[0][2],t),o.applyToVertex(c[1],c[1][0],c[1][1],c[1][2],t),o.applyToVertex(c[2],c[2][0],c[2][1],c[2][2],t)),(0,h.jb)(w,c[0],e),(0,h.jb)(M,c[1],e),(0,h.jb)(S,c[2],e);const i=w[v]-_*w[p],a=w[x]-y*w[p],l=M[v]-_*M[p],u=M[x]-y*M[p],d=S[v]-_*S[p],m=S[x]-y*S[p],f=d*u-m*l,g=i*m-a*d,C=l*a-u*i;if((f<0||g<0||C<0)&&(f>0||g>0||C>0))continue;const E=f+g+C;if(0===E)continue;const I=f*(b*w[p])+g*(b*M[p])+C*(b*S[p]);if(I*Math.sign(E)<0)continue;const A=I/E;A>=0&&s(A,A,T?tt(c):null,t)}}(r,a,0,e.faceCount,t,n,l,o)}}const qe=(0,d.vt)();function Ye(e,t,r,i,n,o,a,s){if(null==t)return;const l=function(e,t){return(0,h.hZ)(t,1/e[0],1/e[1],1/e[2])}(i,qe);if((0,m.C)($e,t.box),null!=o&&o.applyToAabb($e),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(u,h)),!(s<0)&&(a=Math.max(a,Math.min(u,h)),!(a>s)&&a<1/0)}(e,t,r,i)}($e,r,l,n)){const{primitiveIndices:l}=t,c=l.length;if(c>1e3){const l=t.children;if(void 0!==l){for(const t of l)Ye(e,t,r,i,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,l){const c=e[0],u=e[1],h=e[2],d=t[0],m=t[1],f=t[2],{normalRequired:p}=s;for(let e=0;e<i;++e){const t=o[e],r=3*t;let[i,s,g]=n(lt,r),[v,x,_]=n(lt,r+1),[y,b,w]=n(lt,r+2);null!=a&&([i,s,g]=a.applyToVertex(st,i,s,g,e),[v,x,_]=a.applyToVertex(st,v,x,_,e),[y,b,w]=a.applyToVertex(st,y,b,w,e));const M=v-i,S=x-s,T=_-g,C=y-i,E=b-s,I=w-g,A=m*I-E*f,O=f*C-I*d,P=d*E-C*m,F=M*A+S*O+T*P,D=F*F;if(D<=nt)continue;const R=c-i,B=u-s,N=h-g,z=(R*A+B*O+N*P)*F;if(z<0||z>D)continue;const H=B*T-S*N,L=N*M-T*R,j=R*S-M*B,W=(d*H+m*L+f*j)*F;if(W<0||z+W>D)continue;const U=(C*H+E*L+I*j)/F;U>=0&&l(U,U,p?et(M,S,T,C,E,I,Xe):null,t)}}(r,i,0,c,e,l,o,a,s)}}const Xe=(0,d.vt)();const Ke=(0,d.vt)(),Je=(0,d.vt)(),Qe=(0,d.vt)();function et(e,t,r,i,n,o,a){return(0,h.hZ)(rt,e,t,r),(0,h.hZ)(it,i,n,o),(0,h.$A)(a,rt,it),(0,h.S8)(a,a),a}function tt(e){return(0,h.jb)(rt,e[1],e[0]),(0,h.jb)(it,e[2],e[0]),(0,h.$A)(Xe,rt,it),(0,h.S8)(Xe,Xe),Xe}const rt=(0,d.vt)(),it=(0,d.vt)(),nt=1e-7*1e-7,ot=(0,d.vt)(),at=[(0,d.vt)(),(0,d.vt)(),(0,d.vt)()],st=(0,d.vt)(),lt=(0,d.vt)();var ct=r(90629),ut=r(82919),ht=r(27921),dt=r(19419),mt=r(11964);function ft(e,t){return e.isRectangle?(0,dt.Uc)(e.bounds,t):function(e,t){return gt(e[0],e[1],t)}(t,e.points)}function pt(e,t,r,i){const n=Math.min(t[0],r[0],i[0]),o=Math.min(t[1],r[1],i[1]),a=Math.max(t[0],r[0],i[0]),s=Math.max(t[1],r[1],i[1]);if(!function(e,t){if(!(0,dt.HY)(e.bounds,t))return!1;if(e.isRectangle)return!0;for(const r of e.points)if((0,dt.Uc)(t,r))return!0;if(function(e,t){const r=e[0],i=e[1],n=e[2],o=e[3];return gt(r,i,t)||gt(n,i,t)||gt(n,o,t)||gt(r,o,t)}(t,e.points))return!0;for(let r=0;r<e.points.length;r++)if(vt(e.points[r],r===e.points.length-1?e.points[0]:e.points[r+1],t))return!0;return!1}(e,(0,dt.fA)(n,o,a,s,Mt)))return!1;if(ft(e,t)||ft(e,r)||ft(e,i))return!0;for(const n of e.points)if((0,X.cq)(t,r,i,n,St))return!0;for(let n=0;n<e.points.length;n++){const o=e.points[n],a=e.points[(n+1)%e.points.length];if(_t(t,r,o,a)||_t(r,i,o,a)||_t(i,t,o,a))return!0}return!1}function gt(e,t,r){let i=!1;for(let n=0,o=r.length-1;n<r.length;o=n++){const a=r[n],s=r[o];a[1]>t!=s[1]>t&&e<(s[0]-a[0])*(t-a[1])/(s[1]-a[1])+a[0]&&(i=!i)}return i}function vt(e,t,r){const i=r[0],n=r[1],o=r[2],a=r[3],s=e[0],l=e[1],c=t[0],u=t[1];return!(s<i&&c<i||s>o&&c>o||l<n&&u<n||l>a&&u>a)&&(!(!(0,dt.Rj)(r,s,l)&&!(0,dt.Rj)(r,c,u))||xt(e,t,i,n,o,n)||xt(e,t,o,n,o,a)||xt(e,t,o,a,i,a)||xt(e,t,i,a,i,n))}function xt(e,t,r,i,n,o){const a=yt(e[0],e[1],t[0],t[1],r,i),s=yt(e[0],e[1],t[0],t[1],n,o),l=yt(r,i,n,o,e[0],e[1]),c=yt(r,i,n,o,t[0],t[1]);return a!==s&&l!==c||0===a&&bt(e,t,r,i)||0===s&&bt(e,t,n,o)||0===l&&wt(r,i,n,o,e[0],e[1])||0===c&&wt(r,i,n,o,t[0],t[1])}function _t(e,t,r,i){return xt(e,t,r[0],r[1],i[0],i[1])}function yt(e,t,r,i,n,o){const a=(i-t)*(n-r)-(r-e)*(o-i);return Math.abs(a)<=St?0:Math.sign(a)}function bt(e,t,r,i){return wt(e[0],e[1],t[0],t[1],r,i)}function wt(e,t,r,i,n,o){return n>=Math.min(e,r)-St&&n<=Math.max(e,r)+St&&o>=Math.min(t,i)-St&&o<=Math.max(t,i)+St}const Mt=(0,dt.vt)(),St=((0,ct.r_)(),(0,ct.r_)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,mt.vt)(),1e-9);class Tt{constructor(e){this.type=e,this.distance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=(0,d.vt)(),this.normal=(0,d.vt)()}reset(){this.distance=Number.POSITIVE_INFINITY,this.hasNormal=!1}update(e,t,r,i){this.distance=e,this.primitiveIndex=t,(0,h.C)(this.point,r),this.hasNormal=null!=i,null!=i&&(0,h.C)(this.normal,i)}updateIfCloserFromValues(e,t,r,i){e<this.distance&&this.update(e,t,r,i)}updateIfCloser(e){const{distance:t,primitiveIndex:r,point:i,normal:n}=e;this.updateIfCloserFromValues(t,r,i,e.hasNormal?n:null)}get valid(){return Number.isFinite(this.distance)}}function Ct(e,t,r,i,n){if(!e.visible||0!==e.type)return null;const o=new Tt(4);let a;a=e.boundingInfo?It(e.readPrimitivePosition,e.boundingInfo,t,r,i,n):Et(t,r,i,0,e.faceCount,e.readPrimitivePosition,n,null,0);for(const e of a)o.updateIfCloser(e);return o.valid?o:null}function*Et(e,t,r,i,n,o,a,s=null,l=0){if(null==e.camera)return;const{camera:c,screenPolygonPrimitiveProcessor:u}=e;for(let e=i;e<n;++e){const i=(s?.[e]??e)+l,n=null==s?i:e,d=3*i;At(Dt[0],o,d+0,a,n,t),At(Dt[1],o,d+1,a,n,t),At(Dt[2],o,d+2,a,n,t);const m=zt;let f;Lt.reset();const p=Rt;for(const e of u.processTriangle(Dt))if(p.length=0,(0,ht.H)(c.frustum[4],e,()=>p.pushNew(),!1),!(p.length<3)){for(let e=0;e<p.length;e++)c.projectToScreen(p.at(e),Bt[e]);Ot(r,Bt,p.length)&&(Pt(c.eye,p,Nt),null==f&&(f=(0,X.rb)(zt,Dt[0],Dt[1],Dt[2])),Lt.updateIfCloserFromValues((0,h.Io)(c.eye,Nt),i,Nt,f?m:null))}Lt.valid&&(yield Lt)}}function*It(e,t,r,i,n,o){let a;if(null!=o?((0,m.C)(Ft,t.box),o.applyToAabb(Ft),a=(0,ut.GH)(n.broadPhaseFrustum,Ft,i)):a=(0,ut.GH)(n.broadPhaseFrustum,t.box,i),!a)return;const{primitiveIndices:s}=t,l=s.length;if(l>1e3){const a=t.children;if(void 0!==a){for(const t of a)yield*It(e,t,r,i,n,o);return}}yield*Et(r,i,n,0,l,e,o,s,0)}function At(e,t,r,i,n,o){const[a,s,l]=t(e,r);null!=i?i.applyToVertex(e,a,s,l,n):(0,h.hZ)(e,a,s,l),o&&(0,h.Z0)(e,e,o)}function Ot(e,t,r){for(let i=1;i<r-1;i++)if(pt(e,t[0],t[i],t[i+1]))return!0;return!1}function Pt(e,t,r){let i=Number.POSITIVE_INFINITY;const n=t.at(0);for(let o=1;o<t.length-1;o++){(0,X.k3)(Ht,e,n,t.at(o),t.at(o+1));const a=(0,h.hG)(e,Ht);a<i&&(i=a,(0,h.C)(r,Ht))}}const Ft=(0,m.vt)(),Dt=[(0,d.vt)(),(0,d.vt)(),(0,d.vt)()],Rt=new j.A({allocator:e=>e??(0,d.vt)()}),Bt=Array.from({length:12},()=>(0,ct.gs)()),Nt=(0,d.vt)(),zt=(0,d.vt)(),Ht=(0,d.vt)(),Lt=new Tt(4);var jt=r(16396);function Wt(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function Ut(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=3*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}}function Vt(e,t,r,i,n=1){const o=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a}function Gt(e,t,r,i,n,o){switch(e){case"position":{(0,U.vA)(3===t.size);const i=n.getField(e,p.xs);(0,U.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void Ut(e,r,i,n);const{data:o,indices:a}=e,s=r.typedBuffer,c=r.typedBufferStride,u=a.length,h=t[0],d=t[1],m=t[2],f=t[4],p=t[5],g=t[6],v=t[8],x=t[9],_=t[10],y=t[12],b=t[13],w=t[14];i*=c;let M=0,S=0,T=0;const C=(0,l.tZ)(t)?e=>{M=o[e]+y,S=o[e+1]+b,T=o[e+2]+w}:e=>{const t=o[e],r=o[e+1],i=o[e+2];M=h*t+f*r+v*i+y,S=d*t+p*r+x*i+b,T=m*t+g*r+_*i+w};if(1===n)for(let e=0;e<u;++e)C(3*a[e]),s[i]=M,s[i+1]=S,s[i+2]=T,i+=c;else for(let e=0;e<u;++e){C(3*a[e]);for(let e=0;e<n;++e)s[i]=M,s[i+1]=S,s[i+2]=T,i+=c}}(t,r,i,o);break}case"normal":{(0,U.vA)(3===t.size);const r=n.getField(e,p.xs);(0,U.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void Ut(e,r,i,n);const{data:o,indices:a}=e,s=t,c=r.typedBuffer,u=r.typedBufferStride,h=a.length,d=s[0],m=s[1],f=s[2],p=s[4],g=s[5],v=s[6],x=s[8],_=s[9],y=s[10],b=!(0,l.ut)(s),w=1e-6,M=1-w;i*=u;let S=0,T=0,C=0;const E=(0,l.tZ)(s)?e=>{S=o[e],T=o[e+1],C=o[e+2]}:e=>{const t=o[e],r=o[e+1],i=o[e+2];S=d*t+p*r+x*i,T=m*t+g*r+_*i,C=f*t+v*r+y*i};if(1===n)if(b)for(let e=0;e<h;++e){E(3*a[e]);const t=S*S+T*T+C*C;if(t<M&&t>w){const e=1/Math.sqrt(t);c[i]=S*e,c[i+1]=T*e,c[i+2]=C*e}else c[i]=S,c[i+1]=T,c[i+2]=C;i+=u}else for(let e=0;e<h;++e)E(3*a[e]),c[i]=S,c[i+1]=T,c[i+2]=C,i+=u;else for(let e=0;e<h;++e){if(E(3*a[e]),b){const e=S*S+T*T+C*C;if(e<M&&e>w){const t=1/Math.sqrt(e);S*=t,T*=t,C*=t}}for(let e=0;e<n;++e)c[i]=S,c[i+1]=T,c[i+2]=C,i+=u}}(t,i,r,o);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,U.vA)(2===t.size);const r=n.getField(e,p.mJ);(0,U.vA)(!!r,`No buffer view for ${e}`),Wt(t,r,o);break}case"uv0":{(0,U.vA)(2===t.size);const r=n.getField(e,p.ZD)??n.getField(e,p.gH);(0,U.vA)(!!r,`No buffer view for ${e}`),Wt(t,r,o);break}case"uvi":{(0,U.vA)(2===t.size);const r=n.getField(e,p.mJ);(0,U.vA)(!!r,`No buffer view for ${e}`),Wt(t,r,o);break}case"color":case"symbolColor":{const r=n.getField(e,p.XP);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(3===t.size||4===t.size),function(e,t,r,i,n=1){const{data:o,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t===o.length&&4===t){s[i]=o[0],s[i+1]=o[1],s[i+2]=o[2],s[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;const u=c*n;for(let r=1;r<u;++r)e[i]=a,i+=t;return}if(1!==n)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}}}(t,t.size,r,o);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=n.getField(e,p.Y$)??n.getField(e,p.Y$);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(1===t.size),function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length,l=i[0];r*=a;for(let e=0;e<s;++e)o[r]=l,r+=a}(t,r,o);break}case"tangent":{(0,U.vA)(4===t.size);const i=n.getField(e,p.Eq);(0,U.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void function(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}}(e,r,i,n);const{data:o,indices:a}=e,s=t,c=r.typedBuffer,u=r.typedBufferStride,h=a.length,d=s[0],m=s[1],f=s[2],p=s[4],g=s[5],v=s[6],x=s[8],_=s[9],y=s[10],b=!(0,l.ut)(s),w=1e-6,M=1-w;if(i*=u,1===n)for(let e=0;e<h;++e){const t=4*a[e],r=o[t],n=o[t+1],s=o[t+2],l=o[t+3];let h=d*r+p*n+x*s,S=m*r+g*n+_*s,T=f*r+v*n+y*s;if(b){const e=h*h+S*S+T*T;if(e<M&&e>w){const t=1/Math.sqrt(e);h*=t,S*=t,T*=t}}c[i]=h,c[i+1]=S,c[i+2]=T,c[i+3]=l,i+=u}else for(let e=0;e<h;++e){const t=4*a[e],r=o[t],s=o[t+1],l=o[t+2],h=o[t+3];let S=d*r+p*s+x*l,T=m*r+g*s+_*l,C=f*r+v*s+y*l;if(b){const e=S*S+T*T+C*C;if(e<M&&e>w){const t=1/Math.sqrt(e);S*=t,T*=t,C*=t}}for(let e=0;e<n;++e)c[i]=S,c[i+1]=T,c[i+2]=C,c[i+3]=h,i+=u}}(t,r,i,o);break}}}(0,d.vt)();class kt{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n){null!=n&&function(e,t,r,i,n,o){const{buffer:a,offset:s}=o;for(const o of r.fields.keys()){const r=e.get(o),l=r?.indices;if(r&&l)Gt(o,r,i,n,a,s);else if("olidColor"===o&&null!=t){const r=e.get("position")?.indices;if(r){const e=r.length;Vt(t,a.getField(o,p.XP),e,s)}}}}(r,i,this.layout,e,t,n)}}const $t=Jt(-1),Zt=Jt(1),qt=$t,Yt=new Array;Yt[0]=null,Yt[1]=Zt,Yt[2]=$t,Yt[3]=Jt(-2),Yt[4]=Jt(-3);const Xt=Yt.map(e=>function(e,t){return t?{factor:e.factor+t.factor,units:e.units+t.units}:e}(qt,e));function Kt({output:e,enableOITOffset:t,polygonOffset:r}){return(0,ze._$)(e)&&t?Xt[r]:Yt[r]}function Jt(e){return{factor:1*e,units:2*e}}Yt[1]=Zt;var Qt=r(5482),er=r(51976),tr=r(34711);class rr extends tr.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,Qt.Cg)([(0,er.W)()],rr.prototype,"hasHighlightMixTexture",void 0),(0,Qt.Cg)([(0,er.W)()],rr.prototype,"emissionDimmingPass",void 0);class ir extends rr{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,Qt.Cg)([(0,er.W)({count:5})],ir.prototype,"polygonOffset",void 0),(0,Qt.Cg)([(0,er.W)()],ir.prototype,"transparent",void 0),(0,Qt.Cg)([(0,er.W)()],ir.prototype,"enableOITOffset",void 0);const nr=new ir,or=2e-5,ar=2e-6,sr=(0,d.vt)();var lr=r(91429),cr=r(91829),ur=r(4431),hr=r(1843),dr=r(72824),mr=r(13840),fr=r(42958),pr=r(16943),gr=r(90644);const vr=(0,gr.p3)(1,0,1,771);function xr(e,t=!1,r=!1){if(r)return gr.uR;switch(e){case 0:return t?gr.RC:gr.T8;case 1:return vr;default:return null}}function _r(e){if(e.draped)return null;switch(e.output){case 0:case 2:default:return e.writeDepth?gr.Uy:null;case 1:return null}}function yr(e,t=513){return{func:(0,ze._$)(e)?515:t}}(0,cr._Y)();const br={mask:255},wr=(0,gr.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),Mr=(0,gr.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681});(0,gr.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),(0,gr.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680}),r(4576),r(66289);var Sr=r(69622),Tr=r(32728);class Cr{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",p.Eq),this.color=e.getField("instanceColor",p.XP),this.olidColor=e.getField("instanceOlidColor",p.XP),this.state=e.getField("state",p.SL),this.lodLevel=e.getField("lodLevel",p.SL)}}let Er=class extends Sr.A{constructor(e,t){super(e),this.events=new ae.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return Ar(Ir.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=Rr,this._buffer=this._layout.createBuffer(this._capacity),this._view=new Cr(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,U.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,U.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=Or,i=Pr;t.localTransform.getMat(e,Fr),t.globalTransform.getMat(e,Dr);const n=(0,l.lw)(Dr,Dr,Fr);(0,h.hZ)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,a.z0)(i,n),t.model.setMat(e,i);const o=(0,Tr.wp)(Or,n);o.sort(),t.modelScaleFactors.set(e,0,o[1]),t.modelScaleFactors.set(e,1,o[2]),(0,a.B8)(i,i),(0,a.mg)(i,i),t.modelNormal.setMat(e,i),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,Pr),r.modelOrigin.getVec(e,Or),t[0]=Pr[0],t[1]=Pr[1],t[2]=Pr[2],t[3]=0,t[4]=Pr[3],t[5]=Pr[4],t[6]=Pr[5],t[7]=0,t[8]=Pr[6],t[9]=Pr[7],t[10]=Pr[8],t[11]=0,t[12]=Or[0],t[13]=Or[1],t[14]=Or[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Or,this,e),t*=Math.max(Or[0],Or[1],Or[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Or,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(Or[0],Or[1],Or[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(Rr,Math.floor(1.5*this._capacity)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new Cr(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,Qt.Cg)([(0,lr.MZ)({constructOnly:!0})],Er.prototype,"shaderTransformation",void 0),(0,Qt.Cg)([(0,lr.MZ)()],Er.prototype,"_size",void 0),(0,Qt.Cg)([(0,lr.MZ)({readOnly:!0})],Er.prototype,"size",null),Er=(0,Qt.Cg)([(0,lr.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],Er);const Ir=(0,hr.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function Ar(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,pr.E)()&&e.vec4u8("instanceOlidColor"),e}const Or=(0,d.vt)(),Pr=(0,s.vt)(),Fr=(0,c.vt)(),Dr=(0,c.vt)(),Rr=64,Br=(0,hr.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var Nr=r(74810),zr=r(28491),Hr=r(49788);class Lr extends dr.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Nr.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=d.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,d.CN)(.2,.2,.2),this.diffuse=(0,d.CN)(.8,.8,.8),this.externalColor=(0,cr.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=Hr.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}dr.gy;let jr=class extends fr.w{constructor(e,t){let i=(0,ur.U)(Vr(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,ur.U)(function(e){return Ar(Br.clone(),e)}(t)))),super(e,t,i),this.shader=new mr.r(zr.D,()=>r.e(5141).then(r.bind(r,5141))),this.ignoreUnused=!0}_makePipeline(e,t){const{output:r,transparent:i,cullFace:n,customDepthTest:o,hasOccludees:a}=e;return(0,gr.Ey)({blending:i?xr(r,!1,e.emissionDimmingPass):null,culling:Ur(e)?(0,gr.Xt)(n):null,depthTest:yr(r,Wr(o)),depthWrite:_r(e),colorWrite:gr.kn,stencilWrite:a?br:null,stencilTest:a?t?Mr:wr:null,polygonOffset:Kt(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,r){return r?this._occludeePipelineState:super.getPipeline(e,t,r)}};function Wr(e){switch(e){case 1:return 515;case 0:case 4:return 513;case 2:return 516;case 3:return 514}}function Ur(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Vr(e){const t=(0,hr.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,pr.E)()&&t.vec4u8("olidColor"),t}jr=(0,Qt.Cg)([(0,lr.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],jr);class Gr extends ir{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1,this.renderOccluded=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}}(0,Qt.Cg)([(0,er.W)({count:4})],Gr.prototype,"alphaDiscardMode",void 0),(0,Qt.Cg)([(0,er.W)({count:3})],Gr.prototype,"doubleSidedMode",void 0),(0,Qt.Cg)([(0,er.W)({count:8})],Gr.prototype,"pbrMode",void 0),(0,Qt.Cg)([(0,er.W)({count:3})],Gr.prototype,"cullFace",void 0),(0,Qt.Cg)([(0,er.W)({count:3})],Gr.prototype,"normalType",void 0),(0,Qt.Cg)([(0,er.W)({count:4})],Gr.prototype,"customDepthTest",void 0),(0,Qt.Cg)([(0,er.W)({count:8})],Gr.prototype,"emissionSource",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasVertexColors",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasSymbolColors",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasVerticalOffset",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasColorTexture",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasMetallicRoughnessTexture",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasOcclusionTexture",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasNormalTexture",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasScreenSizePerspective",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasVertexTangents",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasOccludees",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"instanced",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"instancedDoublePrecision",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasModelTransformation",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"offsetBackfaces",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasVVSize",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasVVColor",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"receiveShadows",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasShadowHighlights",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"receiveAmbientOcclusion",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"receiveGlobalIllumination",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"textureAlphaPremultiplied",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"instancedFeatureAttribute",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"instancedColor",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"writeDepth",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"snowCover",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasColorTextureTransform",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasEmissionTextureTransform",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasNormalTextureTransform",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasOcclusionTextureTransform",void 0),(0,Qt.Cg)([(0,er.W)()],Gr.prototype,"hasMetallicRoughnessTextureTransform",void 0);var kr=r(57323);let $r=class extends jr{constructor(){super(...arguments),this.shader=new mr.r(kr.R,()=>r.e(2314).then(r.bind(r,39933)))}};$r=(0,Qt.Cg)([(0,lr.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],$r);class Zr extends er.K{constructor(){super(...arguments),this.receiveShadows=!0}}(0,Qt.Cg)([(0,er.W)()],Zr.prototype,"receiveShadows",void 0);class qr extends Ge{constructor(e,t){super(e,Xr),this.materialType="default",this.supportsEdges=!0,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,e=>(0,ze.uw)(e)&&!this.transparent],[4,e=>(0,ze.uw)(e)&&this.transparent]]),this._layout=Vr(this.parameters),this._configuration=new Gr(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=Hr.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,h.t2)(this.parameters.emissiveBaseColor,d.uY)}get emissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;const{treeRendering:i,doubleSided:n,doubleSidedType:o}=t;r.hasVertexTangents=!i&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=i?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.hasModelTransformation=!i&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=i?2:n&&"normal"===o?1:n&&"winding-order"===o?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,(0,ze._o)(e.output)?(r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=function(e,t){return e.receiveShadows&&null!=t.shadowHighlight?.getTexture()}(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&e.globalIlluminationEnabled):r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=!1,r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.unlit?7:t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersectRay(e,t,r,i,n,o){const a=this._getMaterialVerticalOffset(t,r);null!=a&&(i=(0,h.Re)(Kr,i,a),n=(0,h.Re)(Jr,n,a)),o=function(e,t,r,i){nr.output=t.transparent?1:0,nr.polygonOffset=t.polygonOffset,nr.enableOITOffset=t.enableOITOffset;const n=Kt(nr);if(!n)return e;const o=ar*n.units,a=(0,h.oW)(sr,i,r);return(t,r,i,s)=>{const l=(i?1-Math.abs((0,h.Om)(a,i)):0)*n.factor*or+o;return e(t,r+l,i,s)}}(o,this._configuration,i,n),Ze(e,r,i,n,(0,jt.ou)(r.verticalOffset),o)}intersectScreenPolygon(e,t,r,i){return function(e,t,r){return null==e?null:(e.distance=function(e,t,r,i,n){const o=Kt(r);return o?function({units:e,factor:t},r,i,n){const o=ar*e;return i+((n?1-Math.abs((0,h.Om)(r,n)):0)*t*or+o)}(o,(0,h.oW)(sr,n,i),e,t):e}(e.distance,e.hasNormal?e.normal:null,t,r,e.point),e)}(Ct(e,r,t,i,this._createScreenPolygonVertexDisplacement(t,r)),this._configuration,r.camera.eye)}createGLMaterial(e){return new Yr(e)}createBufferWriter(){return new kt(this._layout)}get transparent(){const{drivenOpacity:e,opacity:t,externalColor:r,layerOpacity:i,texture:n,textureId:o,textureAlphaMode:a,colorMixMode:s}=this.parameters,l=r[3];return e||t<1&&"replace"!==s||l<1&&"ignore"!==s||i<1||(null!=n||null!=o)&&1!==a&&2!==a&&"replace"!==s}_createScreenPolygonVertexDisplacement(e,t){const r=this._getMaterialVerticalOffset(e,t);return null==r?null:{applyToVertex:(e,t,i,n)=>(e[0]=t+r[0],e[1]=i+r[1],e[2]=n+r[2],e),applyToAabb:e=>((0,m.Ne)(e,(0,h.WQ)(ni,(0,m.pg)(e,ni),r)),(0,m.vI)(e,(0,h.WQ)(ni,(0,m.Lu)(e,ni),r)),e)}}_getMaterialVerticalOffset(e,t){if(null==this.parameters.verticalOffset)return null;const r=t.camera;(0,h.hZ)(ti,e[12],e[13],e[14]);let i=null;switch(t.viewingMode){case 1:i=(0,h.S8)(ei,ti);break;case 2:i=(0,h.C)(ei,Qr)}const n=(0,h.Re)(ri,ti,r.eye),o=(0,h.Bw)(n),a=(0,h.hs)(n,n,1/o);let s=null;this.parameters.screenSizePerspective&&(s=(0,h.Om)(i,a));const l=(0,Ve.kE)(r,o,this.parameters.verticalOffset,s??0,this.parameters.screenSizePerspective,null);return(0,h.hs)(i,i,l),(0,h.ei)(ii,i,t.transform.inverseRotation)}}class Yr extends je{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,h.hZ)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?$r:jr,e)}}class Xr extends Lr{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1,this.unlit=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const Kr=(0,d.vt)(),Jr=(0,d.vt)(),Qr=(0,d.fA)(0,0,1),ei=(0,d.vt)(),ti=(0,d.vt)(),ri=(0,d.vt)(),ii=(0,d.vt)(),ni=(0,d.vt)(),oi=()=>A.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class ai{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function si(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(oi().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(oi().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(oi().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(oi().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else oi().warn("Indexed geometries must specify faces"),i=!1;break}default:oi().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(oi().warn("Geometry requires material"),i=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(oi().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function li(e){const t=(0,m.Ie)();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&(0,m.RF)(t,r.box)}),t}function ci(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function ui(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const hi=new D.A(1,2,"wosr");async function di(e,t){const s=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:{fileType:e.match(/(.*\.(json|json\.gz))$/)?"wosr":"unknown",url:e,specifiedLodIndex:null}}((0,n.EM)(e));if("wosr"===s.fileType){const e=await(t.cache?t.cache.loadWOSR(s.url,t):async function(e,t){const r=await async function(e,t){const r=await(0,E.Ke)((0,C.A)(e,t));if(r.ok)return r.value.data;(0,F.QP)(r.error),function(e){throw new I.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const n=e[i],o=n.images[0].data;if(!o){oi().warn("Externally referenced texture data is not yet supported");continue}const a=n.encoding+";base64,"+o,s="/textureDefinitions/"+i,l="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==ci(l)},u=t?.disableTextures?Promise.resolve(null):B(a,t);r.push(u.then(e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l})))}const i=await Promise.all(r),n={};for(const e of i)n[e.refId]=e;return n}(r.textureDefinitions??{},t);let n=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];n+=t?.image?t.image.width*t.image.height*4:0}return new ai(r,i,n+(0,O.Qh)(r))}(s.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){const r=new Array,i=new Array,n=new Array,o=new P,a=e.resource,s=D.A.parse(a.version||"1.0","wosr");hi.validate(s);const l=a.model.name,c=a.model.geometries,u=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<c.length;e++){const a=c[e];if(!si(a))continue;const s=ui(a),l=a.params.vertexAttributes,p=[],g=e=>{if("PerAttributeArray"===a.params.topology)return null;const t=a.params.faces;for(const r in t)if(r===e)return t[r].values;return null},v=l.position,x=v.values.length/v.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=g(e)??(0,R.tM)(x);p.push([e,new N.n(r,i,t.valuesPerElement,!0)])}const _=s.texture,y=h&&h[_];if(y&&!f.has(_)){const{image:e,parameters:t}=y,r=new Re(e,t);i.push(r),f.set(_,r)}const b=f.get(_),w=b?b.id:void 0,M=s.material;let S=o.get(M,_);if(null==S){const e=u[M.slice(M.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=y?ci(y.alphaChannelUsage):void 0,i={ambient:(0,d.ci)(e.diffuse),diffuse:(0,d.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:w,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:y?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(i,t.materialParameters),S=new qr(i,t),o.set(M,_,S)}n.push(S);const T=new ne(S,p);m+=p.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(T)}return{engineResources:[{name:l,stageResources:{textures:i,materials:n,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:li(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}let w;if(t.cache)w=await t.cache.loadGLTF(s.url,t,!!t.usePBR,!!t.useEmissive);else{const{loadGLTF:e}=await r.e(1698).then(r.bind(r,51698));w=await e(new _.R,s.url,t,t.usePBR,t.useEmissive)}const{engineResources:S,referenceBoundingBox:A}=function(e,t,r){const n=e.model,s=e.meta,_=n.meta?.ESRI_proxyEllipsoid,w=s.isEsriSymbolResource&&null!=_&&"EsriRealisticTreesStyle"===s.ESRI_webstyle;w&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const n of i.parts){const i=n.attributes.normal;if(null==i)return;const o=n.attributes.position,a=o.count,s=(0,d.vt)(),u=(0,d.vt)(),m=(0,d.vt)(),f=new Float32Array(4*a),g=new Float32Array(3*a),v=(0,l.B8)((0,c.vt)(),n.transform);let x=0,_=0;for(let l=0;l<a;l++){o.getVec(l,u),i.getVec(l,s),(0,h.Z0)(u,u,n.transform),(0,h.Re)(m,u,t.center),(0,h.Qr)(m,m,t.radius);const a=m[2],c=(0,h.Bw)(m),d=Math.min(.45+.55*c*c,1)**2.2;(0,h.Qr)(m,m,t.radius),null!==v&&(0,h.Z0)(m,m,v),(0,h.S8)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,h.Cc)(m,m,s,a>-1?.2:Math.min(-4*a-3.8,1)),g[x]=m[0],g[x+1]=m[1],g[x+2]=m[2],x+=3,f[_]=d,f[_+1]=d,f[_+2]=d,f[_+3]=1,_+=4}n.attributes.normal=new p.xs(g.buffer),n.attributes.color=new p.Eq(f.buffer)}}}(e,_));const S=!!t.usePBR,C=s.isEsriSymbolResource?{usePBR:S,isSchematic:!1,treeRendering:w,mrrFactors:Nr.SY}:{usePBR:S,isSchematic:!1,treeRendering:!1,mrrFactors:Nr.mb},E={...t.materialParameters,treeRendering:w},I=new Array,A=new Map,O=new Map,P=n.lods.length,F=(0,m.Ie)();return n.lods.forEach((e,s)=>{const l=!0===t.skipHighLods&&(P>1&&0===s||P>3&&1===s)||!1===t.skipHighLods&&null!=r&&s!==r;if(l&&0!==s)return;const c=new T(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const r=l?new qr({},t):function(e,t,r,n,o,a,s,l,c){const h=e.materials.get(t.material);if(null==h)return null;const{normal:m,color:f,texCoord0:p,tangent:g}=t.attributes,v=t.material+(m?"_normal":"")+(f?"_color":"")+(p?"_texCoord0":"")+(g?"_tangent":""),x=null!=t.attributes.texCoord0,_=null!=t.attributes.normal,y=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(h.alphaMode);if(!a.has(v)){if(x){const t=(t,r=!1,i=!1)=>{if(null!=t&&!s.has(t)){const n=e.textures.get(t);if(n){const e=n.data,o=r&&!(0,b.x3)(e)?l.compressionOptions:void 0;s.set(t,new Re((0,b.x3)(e)?e.data:e,{...n.parameters,preMultiplyAlpha:!(0,b.x3)(e)&&i,encoding:(0,b.x3)(e)?e.encoding:void 0,compressionOptions:o}))}}},r=1!==y&&!c;t(h.colorTexture,r,1!==y),t(h.normalTexture),t(h.occlusionTexture,!0),t(h.emissiveTexture),t(h.metallicRoughnessTexture,!0)}const r=(0,i.xV)(h.color[0]),m=(0,i.xV)(h.color[1]),f=(0,i.xV)(h.color[2]),p=null!=h.colorTexture&&x?s.get(h.colorTexture):null,g=(0,Nr.Jr)(h),w=null!=h.normalTextureTransform?.scale?h.normalTextureTransform?.scale:u.Un;a.set(v,new qr({...n,customDepthTest:1,textureAlphaMode:y,textureAlphaCutoff:h.alphaCutoff,diffuse:[r,m,f],ambient:[r,m,f],opacity:"OPAQUE"===h.alphaMode?1:h.opacity,doubleSided:h.doubleSided,doubleSidedType:"winding-order",cullFace:h.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:_?0:2,castShadows:!0,receiveShadows:h.receiveShadows,receiveAmbientOcclusion:h.receiveAmbientOcclusion,unlit:h.unlit,textureId:null!=p?p.id:void 0,colorMixMode:h.colorMixMode,normalTextureId:null!=h.normalTexture&&x?s.get(h.normalTexture).id:void 0,textureAlphaPremultiplied:null!=p&&!!p.parameters.preMultiplyAlpha,occlusionTextureId:null!=h.occlusionTexture&&x?s.get(h.occlusionTexture).id:void 0,emissiveTextureId:null!=h.emissiveTexture&&x&&!h.unlit?s.get(h.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=h.metallicRoughnessTexture&&x?s.get(h.metallicRoughnessTexture).id:void 0,emissiveBaseColor:h.unlit?d.uY:[h.emissiveFactor[0],h.emissiveFactor[1],h.emissiveFactor[2]],emissiveStrengthKHR:null!=h.emissiveStrengthKHR?h.emissiveStrengthKHR:1,emissiveStrengthFromSymbol:null!=o.emissiveStrengthFromSymbol?o.emissiveStrengthFromSymbol:void 0,mrrFactors:g?Nr.Bt:[h.metallicFactor,h.roughnessFactor,n.mrrFactors[2]],isSchematic:g,colorTextureTransformMatrix:M(h.colorTextureTransform),normalTextureTransformMatrix:M(h.normalTextureTransform),scale:[w[0],w[1]],occlusionTextureTransformMatrix:M(h.occlusionTextureTransform),emissiveTextureTransformMatrix:M(h.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:M(h.metallicRoughnessTextureTransform),...o},l))}const w=a.get(v);if(r.stageResources.materials.push(w),x){const e=e=>{null!=e&&r.stageResources.textures.push(s.get(e))};e(h.colorTexture),e(h.normalTexture),e(h.occlusionTexture),e(h.emissiveTexture),e(h.metallicRoughnessTexture)}return w}(n,e,c,C,E,A,O,t,w),{geometry:h,vertexCount:_}=function(e,t){const r=e.attributes.position.count,i=(0,y.x)(e.indices||r,e.primitiveType),n=f(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,g.t)(n,s,e.transform,3,l);const c=[["position",new N.n(n,i,3,!0)]];if(null!=e.attributes.normal){const t=f(3*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.normal;(0,a.Ge)(mi,e.transform),(0,g.b)(t,n,mi,3,s),(0,o.or)(mi)&&(0,g.n)(t,t),c.push(["normal",new N.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=f(4*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.tangent;(0,a.z0)(mi,e.transform),(0,v.t)(t,n,mi,4,s),(0,o.or)(mi)&&(0,g.n)(t,t,4),c.push(["tangent",new N.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=f(2*r),{typedBuffer:n,typedBufferStride:o}=e.attributes.texCoord0;(0,x.a)(t,n,2,o),c.push(["uv0",new N.n(t,i,2,!0)])}const u=e.attributes.color;if(null!=u){const t=new Uint8Array(4*r);4===u.elementCount?u instanceof p.Eq?(0,v.b)(t,u,1,255):(u instanceof p.XP||u instanceof p.Uz)&&(0,v.b)(t,u,1/255,255):(t.fill(255),u instanceof p.xs?(0,g.f)(t,u.typedBuffer,1,255,4,u.typedBufferStride):(e.attributes.color instanceof p.eI||e.attributes.color instanceof p.nS)&&(0,g.f)(t,u.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new N.n(t,i,4,!0)])}return{geometry:new ne(t,c),vertexCount:r}}(e,r??new qr({},t)),S=h.boundingInfo;null!=S&&0===s&&(0,m.RF)(F,S.box),null!=r&&(c.stageResources.geometries.push(h),c.numberOfVertices+=_)}),l||I.push(c)}),{engineResources:I,referenceBoundingBox:F}}(w,t,s.specifiedLodIndex);return{lods:S,referenceBoundingBox:A,isEsriSymbolResource:w.meta.isEsriSymbolResource,isWosr:!1}}const mi=(0,s.vt)()},1843(e,t,r){r.d(t,{BP:()=>h,l5:()=>d});var i=r(20498),n=r(13030),o=r(90239),a=r(4431),s=r(620),l=r(85079);class c{constructor(e,t,r=0){this.layout=e,this.byteOffset=r,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const i=e.fields.get(t);this[t]=new i.constructor(this.buffer,r+i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new c(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:p(e[1].constructor)})))}freeze(){return this}get locations(){return(0,l.Xk)((0,a.U)(this))}vec2f16(e,t){return this._appendField(e,i.SX?n.ZD:n.gH,t),this}vec2f(e,t){return this._appendField(e,n.gH,t),this}vec2f64(e,t){return this._appendField(e,n.si,t),this}vec3f16(e,t){return this._appendField(e,i.SX?n.EC:n.xs,t),this}vec3f(e,t){return this._appendField(e,n.xs,t),this}vec3f64(e,t){return this._appendField(e,n.Xm,t),this}vec4f16(e,t){return this._appendField(e,i.SX?n.jz:n.Eq,t),this}vec4f(e,t){return this._appendField(e,n.Eq,t),this}vec4f64(e,t){return this._appendField(e,n.Aj,t),this}mat3f(e,t){return this._appendField(e,n.jZ,t),this}mat3f64(e,t){return this._appendField(e,n.j0,t),this}mat4f(e,t){return this._appendField(e,n.Sx,t),this}mat4f64(e,t){return this._appendField(e,n.E$,t),this}vec4u8(e,t){return this._appendField(e,n.XP,t),this}f16(e,t){return this._appendField(e,i.SX?n.XW:n.Y$,t),this}f32(e,t){return this._appendField(e,n.Y$,t),this}f64(e,t){return this._appendField(e,n.qB,t),this}u8(e,t){return this._appendField(e,n.SL,t),this}u16(e,t){return this._appendField(e,n.h,t),this}i8(e,t){return this._appendField(e,n.bf,t),this}vec2i8(e,t){return this._appendField(e,n.D6,t),this}vec2i16(e,t){return this._appendField(e,n.mJ,t),this}vec2u8(e,t){return this._appendField(e,n.LC,t),this}vec2u16(e,t){return this._appendField(e,n.Yi,t),this}vec4u16(e,t){return this._appendField(e,n.Uz,t),this}vec4i16(e,t){return this._appendField(e,n.E7,t),this}u32(e,t){return this._appendField(e,n.P,t),this}_appendField(e,t,r){this._fields.has(e)&&(0,s.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._fields.set(e,{constructor:t,size:i,offset:n,optional:r}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach(r=>{const i=(0,o.GJ)(r.constructor.ElementType);e=Math.floor((e+i-1)/i)*i,r.offset=e,e+=r.size,t=Math.max(t,i)}),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new c(this,e)}createView(e,t){return new c(this,e,t)}clone(){const e=new u;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function h(){return new u}class d{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:f(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const m=[n.Y$,n.gH,n.xs,n.Eq,n.jZ,n.Sx,n.qB,n.si,n.Xm,n.Aj,n.j0,n.E$,n.SL,n.LC,n.eI,n.XP,n.h,n.Yi,n.nS,n.Uz,n.P,n.An,n.H$,n.ml,n.bf,n.D6,n.m8,n.TX,n.Qt,n.mJ,n.Vp,n.E7,n.My,n.UL,n.zD,n.Y4];function f(e){return`${e.ElementType}_${e.ElementCount}`}function p(e){return g.get(e)}const g=new Map;m.forEach(e=>g.set(f(e),e))},4431(e,t,r){r.d(t,{U:()=>o});var i=r(63907),n=r(74038);function o(e,t=0){const r=e.stride;return e.fields.entries().map(([e,o])=>{const a=o.constructor.ElementCount,s=function(e){switch(e){case"u8":return i.pe.UNSIGNED_BYTE;case"u16":return i.pe.UNSIGNED_SHORT;case"u32":return i.pe.UNSIGNED_INT;case"i8":return i.pe.BYTE;case"i16":return i.pe.SHORT;case"i32":return i.pe.INT;case"f16":return i.pe.HALF_FLOAT;case"f32":return i.pe.FLOAT;default:throw new Error("BufferType not supported in WebGL")}}(o.constructor.ElementType),l=o.offset,c=o.optional?.glNormalized??!1,u=o.optional?.integer??!1;return new n._(e,a,s,l,r,c,t,u)}).toArray()}},26857(e,t,r){var i=r(5482),n=r(69622),o=r(91429);let a=class extends n.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.UPDATING=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,o.MZ)()],a.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"UPDATING",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),a=(0,i.Cg)([(0,o.$K)("esri.views.3d.support.debugFlags")],a);const s=new a;r.d(t,["b",0,s])},46686(e,t,r){r.d(t,{o:()=>n});var i=r(31821);function n(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(i.H`
663
663
  void forwardLinearDepth(float _linearDepth) { ${(0,i.If)(t,"linearDepth = _linearDepth;")} }
664
664
  `)}},33120(e,t,r){r.d(t,{i$:()=>a,xJ:()=>o}),r(46686),r(28682);var i=r(77108),n=r(31821);function o(e){e.vertex.uniforms.add(new i.E("nearFar",e=>e.camera.nearFar))}function a(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
665
665
  return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
@@ -1043,7 +1043,7 @@ vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),v&&r.code.a
1043
1043
  normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
1044
1044
  0.0, 0.0, 0.0 );
1045
1045
  rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(l.H`return tangentSpace * rawNormal;
1046
- }`))}(e,t)}},72233(e,t,r){r.d(t,{n:()=>O});var i=r(31821),n=r(12791),o=r(5482),a=r(34727),s=r(97768),l=r(36708),c=r(78659),u=r(91429),h=r(37585),d=r(89904),m=r(90119),f=r(15581),p=r(13840),g=r(42958),v=r(95774),x=r(90644);let _=class extends g.w{constructor(){super(...arguments),this.shader=new p.r(v.S,()=>r.e(1285).then(r.bind(r,91285)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};_=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],_);var y=r(48163),b=r(65786);class w extends b.Y{constructor(){super(...arguments),this.projScale=1}}class M extends w{constructor(){super(...arguments),this.intensity=1}}class S extends b.Y{}class T extends S{constructor(){super(...arguments),this.blurSize=(0,y.vt)()}}let C=class extends g.w{constructor(){super(...arguments),this.shader=new p.r(f.S,()=>r.e(6122).then(r.bind(r,86122)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};C=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],C),r(63907);var E=r(25530),I=r(67171);let A=class extends m.A{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=d.OG.AMBIENT_ILLUMINATION,this._enableTime=(0,c.l5)(0),this._passParameters=new M,this._drawParameters=new T}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new I.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new E.A(this.renderingContext,t,e),this.addHandles((0,l.wB)(()=>this.view.stage.renderer.hasAmbientIllumination,()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(33306);if(!r||!i)return;const n=this.techniques.getCompiled(C),o=this.techniques.getCompiled(_);if(!n||!o)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,u=this.bindParameters,m=u.camera,p=m.relativeElevation,g=(0,a.qE)((5e5-p)/2e5,0,1),v=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,x=v*g;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/m.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*P/(0,f.g)(m)**6*x;const y=m.fullViewport[2],b=m.fullViewport[3],w=this.fboCache.acquire(y,b,"ssao input",2);s.bindFramebuffer(w.fbo),s.setViewport(0,0,y,b),s.bindTechnique(n,u,this._passParameters,this._drawParameters),s.screen.draw();const M=Math.round(y/2),S=Math.round(b/2),T=this.fboCache.acquire(M,S,"ssao blur",0);s.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=w.getTexture(),(0,h.hZ)(this._drawParameters.blurSize,0,2/b),s.bindTechnique(o,u,this._passParameters,this._drawParameters),s.setViewport(0,0,M,S),s.screen.draw(),w.release();const E=this.fboCache.acquire(M,S,d.OG.AMBIENT_ILLUMINATION,0);return s.bindFramebuffer(E.fbo),s.setViewport(0,0,y,b),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=T.getTexture(),(0,h.hZ)(this._drawParameters.blurSize,2/y,0),s.bindTechnique(o,u,this._passParameters,this._drawParameters),s.setViewport(0,0,M,S),s.screen.draw(),s.setViewport4fv(m.fullViewport),T.release(),v<1&&this.requestRender(2),E}};(0,o.Cg)([(0,u.MZ)()],A.prototype,"consumes",void 0),(0,o.Cg)([(0,u.MZ)()],A.prototype,"produces",void 0),A=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],A);const P=.5;function O(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",.5),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
1046
+ }`))}(e,t)}},72233(e,t,r){r.d(t,{n:()=>P});var i=r(31821),n=r(12791),o=r(5482),a=r(34727),s=r(97768),l=r(36708),c=r(78659),u=r(91429),h=r(37585),d=r(89904),m=r(90119),f=r(15581),p=r(13840),g=r(42958),v=r(95774),x=r(90644);let _=class extends g.w{constructor(){super(...arguments),this.shader=new p.r(v.S,()=>r.e(1285).then(r.bind(r,91285)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};_=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],_);var y=r(48163),b=r(65786);class w extends b.Y{constructor(){super(...arguments),this.projScale=1}}class M extends w{constructor(){super(...arguments),this.intensity=1}}class S extends b.Y{}class T extends S{constructor(){super(...arguments),this.blurSize=(0,y.vt)()}}let C=class extends g.w{constructor(){super(...arguments),this.shader=new p.r(f.S,()=>r.e(6122).then(r.bind(r,86122)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};C=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],C),r(63907);var E=r(25530),I=r(67171);let A=class extends m.A{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=d.OG.AMBIENT_ILLUMINATION,this._enableTime=(0,c.l5)(0),this._passParameters=new M,this._drawParameters=new T}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new I.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new E.A(this.renderingContext,t,e),this.addHandles((0,l.wB)(()=>this.view.stage.renderer.hasAmbientIllumination,()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(33306);if(!r||!i)return;const n=this.techniques.getCompiled(C),o=this.techniques.getCompiled(_);if(!n||!o)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,u=this.bindParameters,m=u.camera,p=m.relativeElevation,g=(0,a.qE)((5e5-p)/2e5,0,1),v=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,x=v*g;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/m.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*O/(0,f.g)(m)**6*x;const y=m.fullViewport[2],b=m.fullViewport[3],w=this.fboCache.acquire(y,b,"ssao input",2);s.bindFramebuffer(w.fbo),s.setViewport(0,0,y,b),s.bindTechnique(n,u,this._passParameters,this._drawParameters),s.screen.draw();const M=Math.round(y/2),S=Math.round(b/2),T=this.fboCache.acquire(M,S,"ssao blur",0);s.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=w.getTexture(),(0,h.hZ)(this._drawParameters.blurSize,0,2/b),s.bindTechnique(o,u,this._passParameters,this._drawParameters),s.setViewport(0,0,M,S),s.screen.draw(),w.release();const E=this.fboCache.acquire(M,S,d.OG.AMBIENT_ILLUMINATION,0);return s.bindFramebuffer(E.fbo),s.setViewport(0,0,y,b),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=T.getTexture(),(0,h.hZ)(this._drawParameters.blurSize,2/y,0),s.bindTechnique(o,u,this._passParameters,this._drawParameters),s.setViewport(0,0,M,S),s.screen.draw(),s.setViewport4fv(m.fullViewport),T.release(),v<1&&this.requestRender(2),E}};(0,o.Cg)([(0,u.MZ)()],A.prototype,"consumes",void 0),(0,o.Cg)([(0,u.MZ)()],A.prototype,"produces",void 0),A=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],A);const O=.5;function P(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",.5),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
1047
1047
  vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
1048
1048
  return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
1049
1049
  }
@@ -1086,7 +1086,7 @@ vec3 calculateAmbientRadiance()
1086
1086
  {
1087
1087
  vec3 ambientLight = 1.2 * (0.282095 * vec3(shR[0], shG[0], shB[0])) - 0.2;
1088
1088
  return ambientLight *= skyTransmittance;
1089
- }`)}var s=r(72233),l=r(65261),c=r(98619),u=r(22393),h=r(89786),d=r(32976),m=r(12791),f=r(5482),p=r(97768),g=r(36708),v=r(91429),x=r(37585),_=r(89904),y=r(90119),b=r(587),w=r(52516),M=r(13840),S=r(42958),T=r(90644);let C=class extends S.w{constructor(){super(...arguments),this.shader=new M.r(w.a,()=>r.e(2013).then(r.bind(r,42013)))}initializePipeline(){return(0,T.Ey)({colorWrite:T.kn})}};C=(0,f.Cg)([(0,v.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationBlurTechnique")],C);let E=class extends S.w{constructor(){super(...arguments),this.shader=new M.r(b.a,()=>r.e(9794).then(r.bind(r,89794)))}initializePipeline(){return(0,T.Ey)({colorWrite:T.kn})}};E=(0,f.Cg)([(0,v.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationTechnique")],E);var I=r(51976);class A extends I.K{constructor(){super(...arguments),this.hasColor=!0,this.hasEmission=!1,this.rayMarchMaxReach=.5,this.rayMarchMaxSteps=16,this.useProjectedRayLength=!0,this.clampRayToScreen=!1}}(0,f.Cg)([(0,I.W)()],A.prototype,"hasColor",void 0),(0,f.Cg)([(0,I.W)()],A.prototype,"hasEmission",void 0);var P=r(50704);let O=class extends S.w{constructor(){super(...arguments),this.shader=new M.r(P.a,()=>r.e(7891).then(r.bind(r,37891)))}initializePipeline(){return(0,T.Ey)({colorWrite:T.kn})}};O=(0,f.Cg)([(0,v.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationUpscaleTechnique")],O),r(63907);let F=class extends y.A{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=_.OG.AMBIENT_ILLUMINATION,this._passParameters=new b.G,this._drawParameters=new w.G,this._drawParametersUpscale=new P.G,this._maxFrames=256,this._lowQualityResolutionScale=.25,this._configuration=new A,this._lastOutput=null,this._isGlobalIlluminationUpdate=!1,this._resetBuffer=!1}initialize(){this.addHandles((0,g.wB)(()=>this.view.stage.renderer.hasGlobalIllumination,()=>{this._reset(),this._requestRender()},g.pc))}destroy(){this._lastOutput=(0,p.Gz)(this._lastOutput)}resetAccumulatedFrames(){this._isGlobalIlluminationUpdate||!(this._passParameters.accumulatedFrames>100)&&this._configuration.hasEmission||this._reset()}render(e){if(this._passParameters.accumulatedFrames>=this._maxFrames)return this._lastOutput?.retain(),this._lastOutput;const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(33306),n=this._mode;if(!r||!i)return this._emptyOutput;if(0===n)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this._requestRender(),this._emptyOutput;const o=this.bindParameters;this._configuration.hasEmission=!!o.reprojection.lastFrameEmission;const a=this.techniques.getCompiled(E,this._configuration),s=this.techniques.getCompiled(C),l=1===n,c=l?this._lowQualityResolutionScale:1,u=l?this.techniques.getCompiled(O):null;if(!a||!s||l&&!u)return this._requestRender(),this._emptyOutput;const h=this.renderingContext,{camera:d}=o;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=c;const{fullWidth:m,fullHeight:f}=d,p=Math.max(1,Math.floor(m*c)),g=Math.max(1,Math.floor(f*c)),v=this.fboCache.acquire(p,g,"global illumination input").acquireColor(36065,2);h.bindFramebuffer(v.fbo),h.setViewport(0,0,p,g),h.bindTechnique(a,o,this._passParameters,this._drawParameters),h.screen.draw();const y=v.obtainAttachment(36065),b=Math.max(1,Math.round(p/1)),w=Math.max(1,Math.round(g/1)),M=this.fboCache.acquire(b,w,"global illumination blur horizontal");h.bindFramebuffer(M.fbo),this._drawParameters.texture=v.getTexture(),this._drawParameters.weightTexture=y.attachment,(0,x.hZ)(this._drawParameters.blurSize,0,1/g),h.bindTechnique(s,o,this._passParameters,this._drawParameters),h.setViewport(0,0,b,w),h.screen.draw(),v.release();const S=l?"global illumination blur vertical":_.OG.AMBIENT_ILLUMINATION,T=this.fboCache.acquire(b,w,S);h.bindFramebuffer(T.fbo),h.setViewport(0,0,b,w),h.setClearColor(1,1,1,0),h.clear(16384),this._drawParameters.texture=M.getTexture(),this._drawParameters.weightTexture=y.attachment,(0,x.hZ)(this._drawParameters.blurSize,1/b,0),h.bindTechnique(s,o,this._passParameters,this._drawParameters),h.setViewport(0,0,b,w),h.screen.draw(),M.release(),T.attachColor(y,36065),y.release();let I=T;return u&&(I=this.fboCache.acquire(m,f,_.OG.AMBIENT_ILLUMINATION).acquireColor(36065,2),h.bindFramebuffer(I.fbo),h.setViewport(0,0,m,f),h.setClearColor(1,1,1,0),h.clear(16384),this._drawParametersUpscale.colorTexture=T.getTexture(),this._drawParametersUpscale.weightTexture=T.getTexture(36065),h.bindTechnique(u,o,this._passParameters,this._drawParametersUpscale),h.screen.draw(),T.release()),h.setViewport4fv(d.fullViewport),this._passParameters.temporalSampleFrame=(this._passParameters.temporalSampleFrame+1)%64,++this._passParameters.accumulatedFrames,this._storeOutput(I),this._passParameters.accumulatedFrames<this._maxFrames&&this._requestRender(),I}_requestRender(){this._isGlobalIlluminationUpdate=!0,this.requestRender(1),this._isGlobalIlluminationUpdate=!1}_storeOutput(e){this._lastOutput!==e&&(this._lastOutput=(0,p.Gz)(this._lastOutput),this._lastOutput=e,this._lastOutput.retain())}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,i=this.fboCache.acquire(t,r,_.OG.AMBIENT_ILLUMINATION).acquireColor(36065,2);return e.bindFramebuffer(i.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,[0,0,0,1]),e.clearBuffer(1,[0,0,0,0]),i}get _canRender(){const{reprojection:e,hasEmission:t,globalIllumination:r}=this.bindParameters;return!(!e.lastFrameColor||t&&!e.lastFrameEmission||!e.lastFrameDepth||!r||this._resetBuffer)}get _mode(){const{hasGlobalIlluminationHighQuality:e,hasGlobalIllumination:t}=this.view.stage.renderer;return e?2:t?1:0}_reset(){this._passParameters.accumulatedFrames=0,this._lastOutput=(0,p.Gz)(this._lastOutput)}get test(){const e=this;return{passParameters:this._passParameters,configuration:this._configuration,get maxFrames(){return e._maxFrames},set maxFrames(t){e._maxFrames=t},get lowQualityResolutionScale(){return e._lowQualityResolutionScale},set lowQualityResolutionScale(t){e._lowQualityResolutionScale=t},get mode(){return e._mode},restartAccumulation:()=>{this._reset(),this._passParameters.temporalSampleFrame=0,this._resetBuffer=!0,this._requestRender()}}}};function D(e,t){t.receiveGlobalIllumination?(e.uniforms.add(new d.o("hasGlobalIlluminationTexture",e=>null!=e.globalIllumination),new m.x("globalIlluminationTexture",e=>e.globalIllumination?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1),e.code.add(o.H`vec3 readGlobalIlluminationOcclusionInverse() {
1089
+ }`)}var s=r(72233),l=r(65261),c=r(98619),u=r(22393),h=r(89786),d=r(32976),m=r(12791),f=r(5482),p=r(97768),g=r(36708),v=r(91429),x=r(37585),_=r(89904),y=r(90119),b=r(587),w=r(52516),M=r(13840),S=r(42958),T=r(90644);let C=class extends S.w{constructor(){super(...arguments),this.shader=new M.r(w.a,()=>r.e(2013).then(r.bind(r,42013)))}initializePipeline(){return(0,T.Ey)({colorWrite:T.kn})}};C=(0,f.Cg)([(0,v.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationBlurTechnique")],C);let E=class extends S.w{constructor(){super(...arguments),this.shader=new M.r(b.a,()=>r.e(9794).then(r.bind(r,89794)))}initializePipeline(){return(0,T.Ey)({colorWrite:T.kn})}};E=(0,f.Cg)([(0,v.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationTechnique")],E);var I=r(51976);class A extends I.K{constructor(){super(...arguments),this.hasColor=!0,this.hasEmission=!1,this.rayMarchMaxReach=.5,this.rayMarchMaxSteps=16,this.useProjectedRayLength=!0,this.clampRayToScreen=!1}}(0,f.Cg)([(0,I.W)()],A.prototype,"hasColor",void 0),(0,f.Cg)([(0,I.W)()],A.prototype,"hasEmission",void 0);var O=r(50704);let P=class extends S.w{constructor(){super(...arguments),this.shader=new M.r(O.a,()=>r.e(7891).then(r.bind(r,37891)))}initializePipeline(){return(0,T.Ey)({colorWrite:T.kn})}};P=(0,f.Cg)([(0,v.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationUpscaleTechnique")],P),r(63907);let F=class extends y.A{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=_.OG.AMBIENT_ILLUMINATION,this._passParameters=new b.G,this._drawParameters=new w.G,this._drawParametersUpscale=new O.G,this._maxFrames=256,this._lowQualityResolutionScale=.25,this._configuration=new A,this._lastOutput=null,this._isGlobalIlluminationUpdate=!1,this._resetBuffer=!1}initialize(){this.addHandles((0,g.wB)(()=>this.view.stage.renderer.hasGlobalIllumination,()=>{this._reset(),this._requestRender()},g.pc))}destroy(){this._lastOutput=(0,p.Gz)(this._lastOutput)}resetAccumulatedFrames(){this._isGlobalIlluminationUpdate||!(this._passParameters.accumulatedFrames>100)&&this._configuration.hasEmission||this._reset()}render(e){if(this._passParameters.accumulatedFrames>=this._maxFrames)return this._lastOutput?.retain(),this._lastOutput;const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(33306),n=this._mode;if(!r||!i)return this._emptyOutput;if(0===n)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this._requestRender(),this._emptyOutput;const o=this.bindParameters;this._configuration.hasEmission=!!o.reprojection.lastFrameEmission;const a=this.techniques.getCompiled(E,this._configuration),s=this.techniques.getCompiled(C),l=1===n,c=l?this._lowQualityResolutionScale:1,u=l?this.techniques.getCompiled(P):null;if(!a||!s||l&&!u)return this._requestRender(),this._emptyOutput;const h=this.renderingContext,{camera:d}=o;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=c;const{fullWidth:m,fullHeight:f}=d,p=Math.max(1,Math.floor(m*c)),g=Math.max(1,Math.floor(f*c)),v=this.fboCache.acquire(p,g,"global illumination input").acquireColor(36065,2);h.bindFramebuffer(v.fbo),h.setViewport(0,0,p,g),h.bindTechnique(a,o,this._passParameters,this._drawParameters),h.screen.draw();const y=v.obtainAttachment(36065),b=Math.max(1,Math.round(p/1)),w=Math.max(1,Math.round(g/1)),M=this.fboCache.acquire(b,w,"global illumination blur horizontal");h.bindFramebuffer(M.fbo),this._drawParameters.texture=v.getTexture(),this._drawParameters.weightTexture=y.attachment,(0,x.hZ)(this._drawParameters.blurSize,0,1/g),h.bindTechnique(s,o,this._passParameters,this._drawParameters),h.setViewport(0,0,b,w),h.screen.draw(),v.release();const S=l?"global illumination blur vertical":_.OG.AMBIENT_ILLUMINATION,T=this.fboCache.acquire(b,w,S);h.bindFramebuffer(T.fbo),h.setViewport(0,0,b,w),h.setClearColor(1,1,1,0),h.clear(16384),this._drawParameters.texture=M.getTexture(),this._drawParameters.weightTexture=y.attachment,(0,x.hZ)(this._drawParameters.blurSize,1/b,0),h.bindTechnique(s,o,this._passParameters,this._drawParameters),h.setViewport(0,0,b,w),h.screen.draw(),M.release(),T.attachColor(y,36065),y.release();let I=T;return u&&(I=this.fboCache.acquire(m,f,_.OG.AMBIENT_ILLUMINATION).acquireColor(36065,2),h.bindFramebuffer(I.fbo),h.setViewport(0,0,m,f),h.setClearColor(1,1,1,0),h.clear(16384),this._drawParametersUpscale.colorTexture=T.getTexture(),this._drawParametersUpscale.weightTexture=T.getTexture(36065),h.bindTechnique(u,o,this._passParameters,this._drawParametersUpscale),h.screen.draw(),T.release()),h.setViewport4fv(d.fullViewport),this._passParameters.temporalSampleFrame=(this._passParameters.temporalSampleFrame+1)%64,++this._passParameters.accumulatedFrames,this._storeOutput(I),this._passParameters.accumulatedFrames<this._maxFrames&&this._requestRender(),I}_requestRender(){this._isGlobalIlluminationUpdate=!0,this.requestRender(1),this._isGlobalIlluminationUpdate=!1}_storeOutput(e){this._lastOutput!==e&&(this._lastOutput=(0,p.Gz)(this._lastOutput),this._lastOutput=e,this._lastOutput.retain())}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,i=this.fboCache.acquire(t,r,_.OG.AMBIENT_ILLUMINATION).acquireColor(36065,2);return e.bindFramebuffer(i.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,[0,0,0,1]),e.clearBuffer(1,[0,0,0,0]),i}get _canRender(){const{reprojection:e,hasEmission:t,globalIllumination:r}=this.bindParameters;return!(!e.lastFrameColor||t&&!e.lastFrameEmission||!e.lastFrameDepth||!r||this._resetBuffer)}get _mode(){const{hasGlobalIlluminationHighQuality:e,hasGlobalIllumination:t}=this.view.stage.renderer;return e?2:t?1:0}_reset(){this._passParameters.accumulatedFrames=0,this._lastOutput=(0,p.Gz)(this._lastOutput)}get test(){const e=this;return{passParameters:this._passParameters,configuration:this._configuration,get maxFrames(){return e._maxFrames},set maxFrames(t){e._maxFrames=t},get lowQualityResolutionScale(){return e._lowQualityResolutionScale},set lowQualityResolutionScale(t){e._lowQualityResolutionScale=t},get mode(){return e._mode},restartAccumulation:()=>{this._reset(),this._passParameters.temporalSampleFrame=0,this._resetBuffer=!0,this._requestRender()}}}};function D(e,t){t.receiveGlobalIllumination?(e.uniforms.add(new d.o("hasGlobalIlluminationTexture",e=>null!=e.globalIllumination),new m.x("globalIlluminationTexture",e=>e.globalIllumination?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1),e.code.add(o.H`vec3 readGlobalIlluminationOcclusionInverse() {
1090
1090
  if (!hasGlobalIlluminationTexture) {
1091
1091
  return vec3(1.0);
1092
1092
  }
@@ -1702,7 +1702,7 @@ smoothstep(0.0, 0.1, dot(shadingNormal, groundNormal)));
1702
1702
  return snow * snowCover;
1703
1703
  }`),e.code.add(n.H`vec3 applySnowToMRR(vec3 mrr, float snow) {
1704
1704
  return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
1705
- }`))}},49718(e,t,r){r(51850),r(6867).w_},6867(e,t,r){r.d(t,{w_:()=>h});var i=r(58083),n=r(9093),o=r(35522),a=r(51850),s=r(78955),l=r(91829),c=r(71351);class u{constructor(){this.intersector=4}get distance(){return this._distance}get renderDistance(){return this._renderDistance}_init(){this._distance=this._renderDistance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4}_setBase(e,t,r,i=null,n=null,o=null){this.intersector=e,this._distance=r,this._renderDistance=i,this.target=t,this.drapedLayerOrder=n,this.renderPriority=o}}class h extends u{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.hs)(m,this.ray.direction,this.distance),(0,o.Bw)(m))}withinDistance(e){return!!d(this)&&null!=this.distanceInRenderSpace&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!d(this)&&((0,o.hs)(m,this.ray.direction,this.distance),(0,o.WQ)(e,this.ray.origin,m),!0)}getTransformedNormal(e){return(0,o.C)(f,this.normal),f[3]=0,(0,s.Z0)(f,f,this.transformation),(0,o.C)(e,f),(0,o.S8)(e,e)}constructor(e){super(),this.normal=(0,a.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){super._init(),e&&(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,u,h){this._setBase(e,t,r,s,u,h),(0,o.C)(this.normal,l??a.Cb),(0,i.C)(this.transformation,c??n.zK)}copy(e){this._setBase(e.intersector,e.target,e.distance,e.renderDistance,e.drapedLayerOrder,e.renderPriority),(0,c.C)(e.ray,this._ray),(0,o.C)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function d(e){return null!=e?.distance&&null!=e?.renderDistance}const m=(0,a.vt)(),f=(0,l.vt)()},16396(e,t,r){r.d(t,{ou:()=>l}),r(77690),r(29242),r(58083),r(9093);var i=r(35522),n=r(51850),o=r(94008),a=r(57005);const s=new class{constructor(e=0){this.offset=e,this._tmpSphere=new o.iy}applyToVertex(e,t,r,n){const o=this.objectTransform.transform,a=(0,i.hZ)(c,t,r,n),s=(0,i.Z0)(a,a,o),l=this.offset/(0,i.Bw)(s);(0,i.Ln)(s,s,s,l);const u=this.objectTransform.inverse;return(0,i.Z0)(e,s,u),e}applyToMinMax(e,t){const r=this.offset/(0,i.Bw)(e);(0,i.Ln)(e,e,e,r);const n=this.offset/(0,i.Bw)(t);(0,i.Ln)(t,t,t,n)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=e.center,r=(0,i.Bw)(t),n=this.offset/r;return(0,i.Ln)(this._tmpSphere.center,t,t,n),this._tmpSphere.radius=e.radius+e.radius*this.offset/r,this._tmpSphere}};function l(e){return null!=e?(s.offset=e,s):null}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpMbs=new o.iy,this._tmpObb=new a.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,i.Bw)(e)}applyToVertex(e,t,r,n){const o=(0,i.hZ)(c,t,r,n),a=(0,i.hZ)(u,t,r,n+this.componentLocalOriginLength),s=this._totalOffset/(0,i.Bw)(a);return(0,i.Ln)(e,o,a,s),e}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),u=Math.abs(n),h=Math.abs(o),d=Math.abs(a),m=Math.abs(s),f=.5*(1+Math.sign(r*o))*Math.min(l,h),p=.5*(1+Math.sign(i*a))*Math.min(c,d),g=.5*(1+Math.sign(n*s))*Math.min(u,m),v=Math.sqrt(f*f+p*p+g*g),x=Math.sign(l+r),_=Math.sign(c+i),y=Math.sign(u+n),b=Math.sign(h+o),w=Math.sign(d+a),M=Math.sign(m+s),S=this._totalOffset;if(v<S)return e[0]-=(1-x)*S,e[1]-=(1-_)*S,e[2]-=(1-y)*S,e[3]+=b*S,e[4]+=w*S,e[5]+=M*S,e;const T=Math.max(l,h),C=Math.max(c,d),E=Math.max(u,m),I=S/Math.sqrt(T*T+C*C+E*E),A=S/v,P=A-I,O=-P;return e[0]+=r*(x*O+A),e[1]+=i*(_*O+A),e[2]+=n*(y*O+A),e[3]+=o*(b*P+I),e[4]+=a*(w*P+I),e[5]+=s*(M*P+I),e}applyToMbs(e){const t=e.center,r=(0,i.Bw)(t),n=this._totalOffset/r;return(0,i.Ln)(this._tmpMbs.center,t,t,n),this._tmpMbs.radius=e.radius+e.radius*this._totalOffset/r,this._tmpMbs}applyToObb(e){return(0,a.gm)(e,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this._tmpVertex=(0,n.vt)()}applyToVertex(e,t,r,n){const o=(0,i.hZ)(c,t,r,n),a=(0,i.WQ)(u,o,this.localOrigin),s=this.offset/(0,i.Bw)(a);return(0,i.Ln)(e,o,a,s),e}applyToAabb(e){const t=h,r=d,i=m;for(let n=0;n<3;++n)t[n]=e[0+n]+this.localOrigin[n],r[n]=e[3+n]+this.localOrigin[n],i[n]=t[n];const n=this.applyToVertex(this._tmpVertex,t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=n[t],e[t+3]=n[t];const o=t=>{const r=this.applyToVertex(this._tmpVertex,t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let n=0;n<3;++n)i[n]=e&1<<n?r[n]:t[n];o(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0===(a&e)){for(let n=0;n<3;++n)i[n]=a&1<<n?0:e&1<<n?t[n]:r[n];o(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const c=(0,n.vt)(),u=(0,n.vt)(),h=(0,n.vt)(),d=(0,n.vt)(),m=(0,n.vt)()},19245(e,t,r){r.d(t,{Um:()=>l,MB:()=>s,kE:()=>o});var i=r(4576),n=r(34727);r(44208);function o(e,t,r,i,o,a){let s=r.screenLength*e.pixelRatio;null!=o&&(c.update(i,t,o,a),s=c.apply(s));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.qE)(l*t,r.minWorldLength,r.maxWorldLength)}const a=(0,i.VO)();function s(e,t){let r=!1;for(const i in t){const n=t[i];void 0!==n&&(Array.isArray(n)?Array.isArray(e[i])&&a(n,e[i])||(e[i]=n.slice(),r=!0):e[i]!==n&&(r=!0,e[i]=n))}return r}const l={multiply:1,ignore:2,replace:3,tint:4},c=new class{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(e,t,r,i){r?(this._scale=Math.min(r.divisor/(t-r.offset),1),this._angleFactor=function(e){return Math.abs(e)**3}(e),this._minScale=null!=i?Math.min(r.minPixelSize/i,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(e){const{_scale:t,_angleFactor:r,_minScale:i}=this;return e*(0,n.qE)((0,n.Cc)(t,1,r),i,1)}applyVec2(e,t){e[0]=this.apply(t[0]),e[1]=this.apply(t[1])}}},74810(e,t,r){r.d(t,{Jr:()=>o});var i=r(35522),n=r(51850);function o({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.t2)(s,n.uY))&&null==l&&(null==o||1===o)&&(null==r||1===r)}const a=(0,n.CN)(1,1,.5),s=(0,n.CN)(0,.6,.2),l=(0,n.CN)(0,1,.2);r.d(t,["Bt",0,s,"SY",0,l,"mb",0,a])},47630(e,t,r){r.d(t,{D:()=>d});var i=r(49255),n=r(47187),o=r(42593),a=r(63365);function s(e){e.code.add("\n vec3 emissionFilter(in vec3 srcColor, float srcAlpha) {\n vec3 color = min(srcColor + vec3(1.0 - srcAlpha), 1.0);\n float m = max(color.r, max(color.g, color.b));\n return m > 0.0 ? color / m : vec3(1.0);\n }\n ")}var l=r(31821),c=r(26934),u=r(58243),h=r(72458);function d(e,t){e.include(o.Q,t),e.include(n.zp,t);const{fragment:r,outputs:d}=e;r.include(a.a);const{output:m,hasEmission:f,oitPremultipliedAlpha:p,snowCover:g,emissionDimmingPass:v,renderOccluded:x}=t,_=11===m,y=(0,i._$)(m),b=(0,i.Rb)(m),w=(0,i._o)(m)&&!y,M=0!==m||x;let S=0;(w||y)&&d.add("fragColor","vec4",S++),y&&d.add("fragAlpha","float",S++),f&&d.add("fragEmission","vec4",S++),r.include(a.a),r.include(c.Q),r.include(h.O,t),r.include(u.t,t),v&&r.include(s),r.code.add(l.H`
1705
+ }`))}},49718(e,t,r){r(51850),r(6867).w_},6867(e,t,r){r.d(t,{w_:()=>h});var i=r(58083),n=r(9093),o=r(35522),a=r(51850),s=r(78955),l=r(91829),c=r(71351);class u{constructor(){this.intersector=4}get distance(){return this._distance}get renderDistance(){return this._renderDistance}_init(){this._distance=this._renderDistance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4}_setBase(e,t,r,i=null,n=null,o=null){this.intersector=e,this._distance=r,this._renderDistance=i,this.target=t,this.drapedLayerOrder=n,this.renderPriority=o}}class h extends u{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.hs)(m,this.ray.direction,this.distance),(0,o.Bw)(m))}withinDistance(e){return!!d(this)&&null!=this.distanceInRenderSpace&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!d(this)&&((0,o.hs)(m,this.ray.direction,this.distance),(0,o.WQ)(e,this.ray.origin,m),!0)}getTransformedNormal(e){return(0,o.C)(f,this.normal),f[3]=0,(0,s.Z0)(f,f,this.transformation),(0,o.C)(e,f),(0,o.S8)(e,e)}constructor(e){super(),this.normal=(0,a.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){super._init(),e&&(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,u,h){this._setBase(e,t,r,s,u,h),(0,o.C)(this.normal,l??a.Cb),(0,i.C)(this.transformation,c??n.zK)}copy(e){this._setBase(e.intersector,e.target,e.distance,e.renderDistance,e.drapedLayerOrder,e.renderPriority),(0,c.C)(e.ray,this._ray),(0,o.C)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function d(e){return null!=e?.distance&&null!=e?.renderDistance}const m=(0,a.vt)(),f=(0,l.vt)()},16396(e,t,r){r.d(t,{ou:()=>l}),r(77690),r(29242),r(58083),r(9093);var i=r(35522),n=r(51850),o=r(94008),a=r(57005);const s=new class{constructor(e=0){this.offset=e,this._tmpSphere=new o.iy}applyToVertex(e,t,r,n){const o=this.objectTransform.transform,a=(0,i.hZ)(c,t,r,n),s=(0,i.Z0)(a,a,o),l=this.offset/(0,i.Bw)(s);(0,i.Ln)(s,s,s,l);const u=this.objectTransform.inverse;return(0,i.Z0)(e,s,u),e}applyToMinMax(e,t){const r=this.offset/(0,i.Bw)(e);(0,i.Ln)(e,e,e,r);const n=this.offset/(0,i.Bw)(t);(0,i.Ln)(t,t,t,n)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=e.center,r=(0,i.Bw)(t),n=this.offset/r;return(0,i.Ln)(this._tmpSphere.center,t,t,n),this._tmpSphere.radius=e.radius+e.radius*this.offset/r,this._tmpSphere}};function l(e){return null!=e?(s.offset=e,s):null}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpMbs=new o.iy,this._tmpObb=new a.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,i.Bw)(e)}applyToVertex(e,t,r,n){const o=(0,i.hZ)(c,t,r,n),a=(0,i.hZ)(u,t,r,n+this.componentLocalOriginLength),s=this._totalOffset/(0,i.Bw)(a);return(0,i.Ln)(e,o,a,s),e}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),u=Math.abs(n),h=Math.abs(o),d=Math.abs(a),m=Math.abs(s),f=.5*(1+Math.sign(r*o))*Math.min(l,h),p=.5*(1+Math.sign(i*a))*Math.min(c,d),g=.5*(1+Math.sign(n*s))*Math.min(u,m),v=Math.sqrt(f*f+p*p+g*g),x=Math.sign(l+r),_=Math.sign(c+i),y=Math.sign(u+n),b=Math.sign(h+o),w=Math.sign(d+a),M=Math.sign(m+s),S=this._totalOffset;if(v<S)return e[0]-=(1-x)*S,e[1]-=(1-_)*S,e[2]-=(1-y)*S,e[3]+=b*S,e[4]+=w*S,e[5]+=M*S,e;const T=Math.max(l,h),C=Math.max(c,d),E=Math.max(u,m),I=S/Math.sqrt(T*T+C*C+E*E),A=S/v,O=A-I,P=-O;return e[0]+=r*(x*P+A),e[1]+=i*(_*P+A),e[2]+=n*(y*P+A),e[3]+=o*(b*O+I),e[4]+=a*(w*O+I),e[5]+=s*(M*O+I),e}applyToMbs(e){const t=e.center,r=(0,i.Bw)(t),n=this._totalOffset/r;return(0,i.Ln)(this._tmpMbs.center,t,t,n),this._tmpMbs.radius=e.radius+e.radius*this._totalOffset/r,this._tmpMbs}applyToObb(e){return(0,a.gm)(e,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this._tmpVertex=(0,n.vt)()}applyToVertex(e,t,r,n){const o=(0,i.hZ)(c,t,r,n),a=(0,i.WQ)(u,o,this.localOrigin),s=this.offset/(0,i.Bw)(a);return(0,i.Ln)(e,o,a,s),e}applyToAabb(e){const t=h,r=d,i=m;for(let n=0;n<3;++n)t[n]=e[0+n]+this.localOrigin[n],r[n]=e[3+n]+this.localOrigin[n],i[n]=t[n];const n=this.applyToVertex(this._tmpVertex,t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=n[t],e[t+3]=n[t];const o=t=>{const r=this.applyToVertex(this._tmpVertex,t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let n=0;n<3;++n)i[n]=e&1<<n?r[n]:t[n];o(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0===(a&e)){for(let n=0;n<3;++n)i[n]=a&1<<n?0:e&1<<n?t[n]:r[n];o(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const c=(0,n.vt)(),u=(0,n.vt)(),h=(0,n.vt)(),d=(0,n.vt)(),m=(0,n.vt)()},19245(e,t,r){r.d(t,{Um:()=>l,MB:()=>s,kE:()=>o});var i=r(4576),n=r(34727);r(44208);function o(e,t,r,i,o,a){let s=r.screenLength*e.pixelRatio;null!=o&&(c.update(i,t,o,a),s=c.apply(s));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.qE)(l*t,r.minWorldLength,r.maxWorldLength)}const a=(0,i.VO)();function s(e,t){let r=!1;for(const i in t){const n=t[i];void 0!==n&&(Array.isArray(n)?Array.isArray(e[i])&&a(n,e[i])||(e[i]=n.slice(),r=!0):e[i]!==n&&(r=!0,e[i]=n))}return r}const l={multiply:1,ignore:2,replace:3,tint:4},c=new class{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(e,t,r,i){r?(this._scale=Math.min(r.divisor/(t-r.offset),1),this._angleFactor=function(e){return Math.abs(e)**3}(e),this._minScale=null!=i?Math.min(r.minPixelSize/i,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(e){const{_scale:t,_angleFactor:r,_minScale:i}=this;return e*(0,n.qE)((0,n.Cc)(t,1,r),i,1)}applyVec2(e,t){e[0]=this.apply(t[0]),e[1]=this.apply(t[1])}}},74810(e,t,r){r.d(t,{Jr:()=>o});var i=r(35522),n=r(51850);function o({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.t2)(s,n.uY))&&null==l&&(null==o||1===o)&&(null==r||1===r)}const a=(0,n.CN)(1,1,.5),s=(0,n.CN)(0,.6,.2),l=(0,n.CN)(0,1,.2);r.d(t,["Bt",0,s,"SY",0,l,"mb",0,a])},47630(e,t,r){r.d(t,{D:()=>d});var i=r(49255),n=r(47187),o=r(42593),a=r(63365);function s(e){e.code.add("\n vec3 emissionFilter(in vec3 srcColor, float srcAlpha) {\n vec3 color = min(srcColor + vec3(1.0 - srcAlpha), 1.0);\n float m = max(color.r, max(color.g, color.b));\n return m > 0.0 ? color / m : vec3(1.0);\n }\n ")}var l=r(31821),c=r(26934),u=r(58243),h=r(72458);function d(e,t){e.include(o.Q,t),e.include(n.zp,t);const{fragment:r,outputs:d}=e;r.include(a.a);const{output:m,hasEmission:f,oitPremultipliedAlpha:p,snowCover:g,emissionDimmingPass:v,renderOccluded:x}=t,_=11===m,y=(0,i._$)(m),b=(0,i.Rb)(m),w=(0,i._o)(m)&&!y,M=0!==m||x;let S=0;(w||y)&&d.add("fragColor","vec4",S++),y&&d.add("fragAlpha","float",S++),f&&d.add("fragEmission","vec4",S++),r.include(a.a),r.include(c.Q),r.include(h.O,t),r.include(u.t,t),v&&r.include(s),r.code.add(l.H`
1706
1706
  void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${(0,l.If)(g,", float snow")}) {
1707
1707
  ${(0,l.If)(_,"finalColor.a = 1.0;")}
1708
1708
  ${(0,l.If)(M,"if (finalColor.a < alphaCutoff) discard;")}
@@ -1714,4 +1714,4 @@ return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
1714
1714
  calculateOcclusionAndOutputHighlight();
1715
1715
  ${(0,l.If)(_,"outputObjectAndLayerIdColor();")}
1716
1716
  }
1717
- `)}},26934(e,t,r){r.d(t,{Q:()=>n});var i=r(49788);function n(e){e.constants.add("alphaCutoff","float",i.Q),e.constants.add("opacityCutoff","float",i.v)}},58243(e,t,r){function i(e,t){t.useFloatBlend?e.code.add("float ditherNoise(vec4 color) { return 0.0; }"):e.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}r.d(t,{t:()=>i})},72458(e,t,r){r.d(t,{C:()=>o,O:()=>a});var i=r(5482),n=r(51976);class o extends n.K{constructor(){super(...arguments),this.useFloatBlend=!0}}function a(e,t){t.useFloatBlend?(e.constants.add("floatBlendOutputScale","float",1),e.constants.add("floatBlendInputScale","float",1)):(e.constants.add("floatBlendOutputScale","float",1/16),e.constants.add("floatBlendInputScale","float",16)),e.constants.add("maxEmissiveStrength","float",16)}(0,i.Cg)([(0,n.W)()],o.prototype,"useFloatBlend",void 0)},89904(e,t,r){r.d(t,{OG:()=>$e,gP:()=>Ge});var i=r(5482),n=r(69540),o=r(91429);let a=class extends n.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"row",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"column",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"rows",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"columns",void 0),a=(0,i.Cg)([(0,o.$K)("esri.CameraLayout")],a);const s=a;var l=r(69052),c=r(25482),u=r(34727),h=r(56507),d=r(86738),m=r(43937),f=r(36005);let p=class extends((0,n.OU)(c.o)){constructor(...e){super(...e),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new s}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,h.GB)(e.x||0),n.y=(0,h.GB)(e.y||0),n.z=e.hasZ?(0,h.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new d.A;return r.read(e,t),r.x=(0,h.GB)(r.x||0),r.y=(0,h.GB)(r.y||0),r.z=r.hasZ?(0,h.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,i.Cg)([(0,o.MZ)({type:d.A,json:{write:{isRequired:!0}}})],p.prototype,"position",void 0),(0,i.Cg)([(0,m.K)("position")],p.prototype,"writePosition",null),(0,i.Cg)([(0,f.w)("position")],p.prototype,"readPosition",null),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,o.wg)(e=>l.ie.normalize((0,h.GB)(e)))],p.prototype,"heading",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,o.wg)(e=>(0,u.qE)((0,h.GB)(e),-180,180))],p.prototype,"tilt",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,o.wg)(e=>(0,u.qE)((0,h.GB)(e,55),1,170))],p.prototype,"fov",void 0),(0,i.Cg)([(0,o.MZ)({type:s,nonNullable:!0,json:{read:!1,write:!1}})],p.prototype,"layout",void 0),p=(0,i.Cg)([(0,o.$K)("esri.Camera")],p);var g=r(9093),v=r(35522),x=r(51850),_=r(16930),y=(r(48353),r(9762),r(65806)),b=r(27993),w=r(73941),M=(r(19419),r(82919)),S=r(71351),T=r(69622),C=r(53966),E=r(90629),I=r(58083),A=r(37585),P=r(48163),O=r(78955),F=r(91829),D=r(44280);function R(e,t,r){e.worldUpAtPosition(t,B),(0,v.Re)(N,r,t);const i=(0,v.Bw)(N);return 0===i?0:(0,u.XM)((0,v.Om)(N,B)/i)}const B=(0,x.vt)(),N=(0,x.vt)();var z;let H=z=class extends T.A{constructor(e){super(e),this._ray=(0,S.vt)(),this._viewport=(0,F.fA)(0,0,1,1),this._padding=(0,F.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,P.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,g.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,g.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,g.vt)(),this._frustumDirty=!0,this._frustum=(0,M.vt)(),this._fullViewport=(0,F.vt)(),this._fullViewportDirty=!0,this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,x.vt)(),this._up=(0,x.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin,"eye")}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,v.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,I.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get inverseViewMatrix(){return(0,I.Qw)((0,g.vt)(),this.viewMatrix)||this._get("inverseViewMatrix")||(0,g.vt)()}get viewForward(){return this._ensureViewClean(),(0,v.hZ)((0,x.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,v.hZ)((0,x.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,v.hZ)((0,x.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,O.hs)((0,F.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,O.aI)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,O.hs)((0,F.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,O.aI)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewportDirty&&(this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this._viewport[2]+this._padding[1]+this._padding[3],this._fullViewport[3]=this._viewport[3]+this._padding[0]+this._padding[2],this._fullViewportDirty=!1),this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,O.t2)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,O.C)(this._padding,e),this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,I.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,I.B8)((0,g.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,g.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,v.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,I.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,I.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,a=-i/2+this.column*o,s=a+o,l=-r/2+this.row*n,c=l+n,u=(0,I.$h)((0,g.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),h=this._get("projectionMatrix");return h&&(0,I.t2)(h,u)?h:u}copyFrom(e){(0,v.C)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,O.C)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,O.C)(this._padding,e.padding),this.notifyChange("_padding"),this._fullViewportDirty=!0,(0,A.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,I.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,M.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,I.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new z).copyFrom(this)}equals(e){return(0,v.t2)(this.eye,e.eye)&&(0,v.t2)(this.center,e.center)&&(0,v.t2)(this.up,e.up)&&(0,O.t2)(this._viewport,e.viewport)&&(0,O.t2)(this._padding,e.padding)&&(0,A.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}equalsView(e){return(0,v.t2)(this.eye,e.eye)&&(0,v.t2)(this.center,e.center)&&(0,v.t2)(this.up,e.up)&&this._fov===e.fov}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,O.hG)(e.screenPadding,this.screenPadding)>=t||(0,O.hG)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,v.jb)(W,e.eye,e.center),(0,v.jb)(U,this.eye,this.center);const r=(0,v.Om)(W,U),i=(0,v.uE)(W),n=(0,v.uE)(U),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,v.lo)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,D.gr)(this.viewForward,(0,v.Re)(W,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,E.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==L&&(0,v.C)(L,e),L[3]=1,(0,O.Z0)(L,L,this.projectionMatrix);const r=Math.abs(L[3]);(0,v.hs)(L,L,1/r);const i=this.fullViewport;t[0]=(0,u.Cc)(0,i[0]+i[2],.5+.5*L[0]),t[1]=(0,u.Cc)(0,i[1]+i[3],.5+.5*L[1]),t[2]=.5*(L[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;L[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],L[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],L[2]=(2*e[2]-1)*e[3],L[3]=e[3],null!=this.inverseProjectionMatrix&&((0,O.Z0)(L,L,this.inverseProjectionMatrix),t[0]=L[0],t[1]=L[1],t[2]=L[2])}projectToScreen(e,t){return null==this.projectToRenderScreen(e,V)?null:(this.renderToScreen(V,t),t)}projectToRenderScreen(e,t){if(L[0]=e[0],L[1]=e[1],L[2]=e[2],L[3]=1,(0,O.Z0)(L,L,this.viewProjectionMatrix),0===L[3])return null;const r=L;(0,v.hs)(r,r,1/Math.abs(L[3]));const i=this.fullViewport,n=(0,u.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,u.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,V),t)}unprojectFromRenderScreen(e,t){if((0,I.lw)(j,this.projectionMatrix,this.viewMatrix),!(0,I.B8)(j,j))return null;const r=this.fullViewport;return L[0]=2*(e[0]-r[0])/r[2]-1,L[1]=2*(e[1]-r[1])/r[3]-1,L[2]=2*e[2]-1,L[3]=1,(0,O.Z0)(L,L,j),0===L[3]?null:(t[0]=L[0]/L[3],t[1]=L[1]/L[3],t[2]=L[2]/L[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,a=Math.max(n-r/2,0),s=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),u=r-l- -Math.min(this.fullWidth-n-r/2,0),h=i-c- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(u),Math.round(h)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:n,fovY:o}=this,a=Math.abs(Math.PI/2-R(t,r,i));return e.frustumCoverage(a,n,o)}_computeUpGlobal(){(0,v.Re)(W,this.center,this.eye);const e=(0,v.Bw)(this.center);e<1?(0,v.t2)(this._up,x.Cb)&&((0,v.C)(this._up,x.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,v.Om)(W,this.center))>.9999*(0,v.Bw)(W)*e||((0,v.$A)(U,W,this.center),(0,v.$A)(U,U,W),(0,v.S8)(U,U),(0,v.t2)(this._up,U)||((0,v.C)(this._up,U),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,v.oW)(W,this.eye,this.center),Math.abs(W[2])<=.9999&&((0,v.hs)(W,W,W[2]),(0,v.hZ)(W,-W[0],-W[1],1-W[2]),(0,v.S8)(W,W),(0,v.t2)(this._up,W)||((0,v.C)(this._up,W),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,v.t2)(e,t)||((0,v.C)(t,e),this._markViewDirty(),this.notifyChange(r)):C.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,M.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,I.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,i.Cg)([(0,o.MZ)()],H.prototype,"_viewport",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_padding",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_fov",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_nearFar",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_viewDirty",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_viewMatrix",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_pixelRatio",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"pixelRatio",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"row",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"column",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_rows",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"rows",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_columns",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"columns",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"eye",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"center",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_center",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"up",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_up",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"viewMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"inverseViewMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"viewForward",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"viewUp",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"viewRight",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"nearFar",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"near",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"far",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"viewport",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"screenViewport",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"screenPadding",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"x",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"y",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"width",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"height",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"fullWidth",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"fullHeight",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"_aspect",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"padding",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"projectionMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"inverseProjectionMatrix",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"fov",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"fovX",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"fovY",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"viewInverseTransposeMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"_projectionMatrixInternal",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"relativeElevation",void 0),H=z=(0,i.Cg)([(0,o.$K)("esri.views.3d.webgl.RenderCamera")],H);const L=(0,F.vt)(),j=(0,g.vt)(),W=(0,x.vt)(),U=(0,x.vt)(),V=(0,E.r_)();r(49718),r(6867),r(16396),(0,x.vt)(),(0,x.vt)(),(0,x.vt)();var G=r(5443),k=r(39829),$=r(95108);function Z(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return 1===n?1:0;const s=(a[o]-t[o])/(a[r]-t[r]),l=t[o]+s*(i-t[r]);return e[r]=i,e[o]=l,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(Y,t[0],t[0])&&q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(Y,t[r],i)){case 1:q(e,i);break;case 3:q(e,(0,P.o8)(Y));break;case 2:q(e,(0,P.o8)(Y)),q(e,i)}}}}function q(e,t){0!==e.length&&(0,A.aI)(e.at(-1),t)||e.push(t)}const Y=(0,P.vt)();var X=r(11964),K=r(27921);const J=(0,x.vt)(),Q=(0,x.vt)();function ee(){return{direction:(0,x.vt)(),up:(0,x.vt)()}}function te(e,t,r,i,n){let o=(0,v.S8)(J,e),a=(0,v.Om)(o,i);const s=a>0;a=Math.abs(a),a>.99&&(a=Math.abs((0,v.Om)(t,i)),a<.99?((0,v.C)(o,t),s&&(0,v.hs)(o,o,-1)):o=null);let l=0;if(o){(0,v.hs)(Q,i,(0,v.Om)(i,o)),(0,v.Re)(o,o,Q);const e=(0,v.Om)(o,n)/((0,v.Bw)(o)*(0,v.Bw)(n));(0,v.$A)(Q,o,n),l=((0,v.Om)(Q,i)>0?1:-1)*(0,u.KJ)((0,u.XM)(e))}const c=(0,u.KJ)((0,u.XM)(-(0,v.Om)(i,e)/(0,v.Bw)(e)));return r?(r.heading=l,r.tilt=c,r):{heading:l,tilt:c}}function re(e,t,r,i){(0,v.Re)(ie,r,t),(0,K.T7)(i,(0,X.LV)(t,ie),e)||e===r||(0,v.C)(e,r)}const ie=(0,x.vt)(),ne=(0,x.fA)(0,1,0),oe=(0,x.fA)(0,0,1),ae=(0,g.vt)(),se=(0,x.vt)(),le=(0,x.vt)();function ce(e,t,r,i=ee()){const{direction:n,up:o}=i;return(0,I.N9)(ae,-(0,u.kU)(t)),(0,I.eL)(ae,ae,(0,u.kU)(r)),(0,v.Z0)(n,oe,ae),(0,v.hs)(n,n,-1),(0,v.Z0)(o,ne,ae),i}function ue(e,t,r,i,n){const o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,v.Ln)(e,i,o,a)}const he=(0,x.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return te(t,r,i,oe,ne)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=ce(0,r,i),o=(0,x.vt)();return(0,v.hs)(o,n.direction,-t),(0,v.WQ)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,u.kU)(e)},headingTiltToDirectionUp:ce,lookAtTiltToEyeTilt:function(e){return(0,u.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,S.LV)(t.origin,t.direction),n,he)||ue(he,r,i,t.endpoint,n),re(he,a,he,l),s.push((0,P.fA)(he[0],he[1]))}return function(e,t,r){const i=e.map(e=>((0,v.hZ)(he,e[0],e[1],0),t.fromRenderCoords(he,he,r),[he[0],he[1]]));return i.length<=2?new k.A({spatialReference:r}):(i.push(i[0].slice()),(0,$.$3)(i)||i.reverse(),new k.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return Z(r,e,t,0),Z(i,r,t,1),Z(r,i,t,2),Z(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,y.g)(t,se,o),(0,y.g)(t,le,o),se[0]-=r/2,le[0]+=r/2,se[1]-=i/2,le[1]+=i/2,(0,b.F)(se,o,se,a),(0,b.F)(le,o,le,a),n?(n.xmin=se[0],n.ymin=se[1],n.xmax=le[0],n.ymax=le[1],n.spatialReference=a):n=new G.A(se[0],se[1],le[0],le[1],a),n}},Symbol.toStringTag,{value:"Module"}));var de=r(34304),me=r(52039),fe=r(94008),pe=r(28735);class ge{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,M.vt)(),this._points=(0,M.Qy)(),this.lines=new Array(12),this._origin=(0,x.vt)(),this._direction=(0,x.vt)(),this._boundingSphere=new fe.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,x.vt)(),endpoint:null}}update(e){(0,M.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,v.C)(this._origin,e.eye),(0,v.C)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,v.C)(this._points[t],e[t]);(0,M.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,M.m7)(this.frustum,e)}intersectsRay(e){return(0,M.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,M.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,M.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;ve(this.lines[t],e[t],e[r]),ve(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),ve(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){const{origin:e}=this,t=_e;(0,v.S8)(t,this.direction);const r=xe;(0,v.jb)(r,this.points[4],e);const i=.5*(0,v.Om)(r,r)/(0,v.Om)(t,r),n=this._boundingSphere,o=(0,v.Ln)(ye,e,t,i);n.center=o,n.radius=i}static{this.planePointIndices=M.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function ve(e,t,r){e.origin=t,e.endpoint=r,(0,v.oW)(e.direction,t,r)}const xe=(0,x.vt)(),_e=(0,x.vt)(),ye=(0,x.vt)();r(86211);const be=(0,x.fA)(5802e-9,13558e-9,331e-7),we=(0,x.fA)(65e-8*3,5643e-9,255e-9);(0,x.fA)(be[0]+we[0],be[1]+we[1],be[2]+we[2]);class Me{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Me(0,0)}static{this.Infinite=new Me}}(0,x.vt)(),(0,x.vt)(),new fe.iy,(0,S.vt)(),new G.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var Se=r(32728);const Te=(0,x.fA)(0,0,1),Ce=(0,v.S8)((0,x.vt)(),(0,x.fA)(1,1,1)),Ee=(0,g.vt)(),Ie=(0,x.vt)(),Ae=(0,x.vt)();function Pe(e,t,r,i=ee()){(0,v.$A)(Ie,e,Te),0===(0,v.Om)(Ie,Ie)&&(0,v.$A)(Ie,e,Ce),(0,I.$0)(Ee,-(0,u.kU)(t),e),(0,I.e$)(Ee,Ee,-(0,u.kU)(r),Ie);const{up:n,direction:o}=i;return(0,v.$A)(n,Ie,e),(0,v.S8)(n,n),(0,v.Z0)(n,n,Ee),(0,v.S8)(o,e),(0,v.ze)(o,o),(0,v.Z0)(o,o,Ee),i}function Oe(e){const t=e[1];e[1]=-e[2],e[2]=t}function Fe(e,t){const r=Pe(t,e.heading,e.tilt);return e.up=r.up,e}function De(e,t){const{renderCoordsHelper:r,state:i}=e;if(1!==i.viewingMode)return 1;const n=r.getAltitude(t),o=r.referenceEllipsoid.radius,a=1+(0,v.Io)(i.camera.eye,t)/(o+n),s=Math.sqrt(a*a-1),{minCurvature:l,maxCurvature:c,minSamples:h,maxSamples:d}=Be,m=(0,u.qE)((s-l)/(c-l),0,1);return Math.round((0,u.Cc)(h,d,m))}function Re(e,t){const r=[],i=[],n=(0,de.FD)();for(let o=0;o<e.length;o++){const a=e[o],s=o===e.length-1?e[0]:e[o+1],l=(0,X.Cr)(a,s,Ue),c=(0,K.vE)(t,l.origin,l.vector,0,je);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,o,s]=0===c?[1,r,i]:[-1,i,r],l=(0,K.Qj)(t),u=(0,v.Ln)((0,x.vt)(),je,l,e*n),h=(0,v.Ln)((0,x.vt)(),je,l,e*-n);o.push(a),o.push(u),s.push(h)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Be={minCurvature:(0,u.kU)(5),maxCurvature:(0,u.kU)(50),minSamples:1,maxSamples:6},Ne=(0,x.fA)(1,0,0),ze=(0,x.fA)(0,1,0),He=(0,x.vt)(),Le=(0,x.vt)(),je=(0,x.vt)(),We=new fe.iy,Ue=(0,X.vt)(),Ve=(0,F.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Ie,o=Ae;return(0,v.S8)(n,e),(0,v.$A)(Ae,n,Te),0===(0,v.Om)(Ae,Ae)&&(0,v.$A)(Ae,n,Ce),(0,v.$A)(o,Ae,n),te(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,x.vt)(),up:null,tilt:i,heading:r},o=Ie;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const a=t,s=(0,u.kU)(r),l=(0,u.kU)(i),c=Math.sin(s),h=Math.cos(s),d=Math.sin(l),m=Math.cos(l),f=(0,v.Bw)(o);let p;if(Math.abs(l)<1e-8)p=a+f;else{const e=f/d,t=(0,u.YN)(a/e),r=Math.PI-l-t;p=e*Math.sin(r)}const g=m*a,_=a*a*(d*d),y=h*h*_,b=p-g,w=b*b,M=y*(y+w-o[1]*o[1]);if(M<0)return(0,v.hs)(n.eye,o,p/f),n.tilt=0,Fe(n,e);const S=Math.sqrt(M),T=o[1]*b,C=y+w;let E;if(E=h>0?-S+T:S+T,Math.abs(C)<1e-8)return f<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=a):(0,v.hs)(n.eye,o,p/f),n.tilt=0,Oe(n.eye),Fe(n,e);n.eye[1]=E/C;const I=c*c*_,A=d*a,P=h*A*n.eye[1],O=n.eye[1]*n.eye[1],F=1-O,D=Math.sqrt(F),R=y*O+I-2*P*D*b+F*w;return Math.abs(R)<1e-8?((0,v.hs)(n.eye,o,p/f),n.tilt=0,Oe(n.eye),Fe(n,e)):(n.eye[0]=(F*(p*o[0]-g*o[0])-A*D*(o[0]*n.eye[1]*h+o[2]*c))/R,n.eye[2]=(F*(p*o[2]-g*o[2])-A*D*(o[2]*n.eye[1]*h-o[0]*c))/R,(0,v.hs)(n.eye,n.eye,p),Oe(n.eye),Fe(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,u.kU)(e),n=(0,v.Bw)(t);return(0,u.YN)(r/(n/Math.sin(i)))+i},getCurvatureSamples:De,headingTiltToDirectionUp:Pe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,v.Bw)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,u.YN)(r/(n/Math.sin(e)));return(0,u.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new ge(r);i.near=2,n.update(i);const o=r.getAltitude(t),a=e.spatialReference,s=i.eye,l=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return We.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(We,t)}(e),c=De(e,t),h=i.aboveGround,d=n.planes[5],m=[],f=(0,K.O_)(x.uY,Ne,(0,K.vt)()),p=(0,K.O_)(x.uY,ze,(0,K.vt)());(0,O.hZ)(Ve,0,0,0,0);const g=e=>{};for(let e=0;e<4;e++){const t=1===e&&!h||3===e&&h?1-l:0,i=1===e&&h||3===e&&!h?l:1,a=n.lines[e],_=n.lines[3===e?0:e+1];for(let n=0;n<c;n++){const l=n/c,h=0===n?0:(0,u.Cc)(t,i,1===e?1-(1-l)**2:3===e?l**2:l),y=(0,v.Cc)(Le,a.origin,_.origin,h),b=(0,Se.nu)(a.direction,_.direction,h,He);r.intersectManifoldClosestSilhouette((0,S.LV)(y,b),o,je),re(je,s,je,d),m.push((0,x.o8)(je)),0!==m.length&&g((0,v.lo)(m.at(-1),je));const w=((0,K.Tj)(f,je)?1:0)|((0,K.Tj)(p,je)?2:0);Ve[w]=1}}m.length>2&&(0,v.lo)(m[0],m.at(-1));const _=function(e,t,r){const i=2*(0,de.FD)();return e.map(e=>{const n=[];let o=!1;for(const a of e)t.fromRenderCoords(a,je,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,je[1]]),n.push([null,je[1]]),o=!0):n.push([je[0],je[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,$.$3)(n)||n.reverse(),n})}((0,O.m3)(Ve)>1?function(e,t){const r=[];for(const i of e)r.push(...Re(i,t));return r}(Re(m,f),p):[m],r,a);return new k.A({rings:_,spatialReference:a})},toExtent:function(e,t,r,i,n){let o,a,s,c;const h=t.latitude,d=(0,w.tO)(e.spatialReference).radius,m=t.longitude,f=function(e,t,r){const i=t/r,n=(0,u.kU)(e),o=Math.sin(i/2),a=Math.cos(n),s=2*(0,u.YN)(Math.sqrt(o*o/(a*a)));return(0,u.KJ)(s)}(h,r,d)/2;o=m-f,a=m+f;const p=(0,u.kU)(h),g=(1+Math.sin(p))/(1-Math.sin(p)),v=(g+1)*Math.tan(i/d/2),x=v*v;function y(e){const t=Math.PI/2;return(e=l.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(s=1.5*Math.PI-2*Math.atan(.5*(v+Math.sqrt(4*g+x))),c=s+i/d,s=y(s),c=y(c),c<s){const e=c;c=s,s=e}if(s=Math.max((0,u.KJ)(s),-90),c=Math.min((0,u.KJ)(c),90),a=me.Y_.monotonic(o,a),a-o>180){const e=(a-o-180)/2;o+=e,a-=e}const b=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:_.A.WGS84;return n?(n.xmin=o,n.ymin=s,n.xmax=a,n.ymax=c,n.spatialReference=b):n=new G.A(o,s,a,c,b),e.spatialReference&&e.spatialReference.isWebMercator&&(0,pe.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Ge={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},ke=[Ge.FINAL,Ge.COMPOSITE,Ge.OPAQUE,Ge.TRANSPARENT],$e={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GAUSSIAN_SPLAT_DEPTH:"gaussian-depth",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_ACCUMULATION:"shadow-accumulation",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values($e)).concat(ke),(0,x.vt)()},90119(e,t,r){r.d(t,{A:()=>O});var i=r(5482),n=r(69622),o=r(49186),a=r(36708),s=r(10107),l=r(64108),c=r(89904),u=r(44208),h=r(53966),d=(r(17676),r(94656)),m=r(63907);r(93637),r(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,u.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();r(90644);var f=r(25530),p=r(97768),g=r(48852),v=r(42293);const x=!!(0,u.A)("esri-tests-disable-gpu-memory-measurements");class _{constructor(e,t){this._context=e,this._descriptor=t,this.type=2,this._context.instanceCounter.increment(m.vt.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:n,internalFormat:o,multisampled:a}=t;a?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,i,n):r.renderbufferStorage(r.RENDERBUFFER,o,i,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return x?0:(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,v.MW)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m.vt.Renderbuffer,this),this._context=null)}}class y{constructor(e,t,r){if(this._context=e,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,e.instanceCounter.increment(m.vt.FramebufferObject,this),null!=t){const r=function(e,t){return b(t)||w(t)?t:M(t)?new f.A(e,t):function(e){return 3===S(e)||null!=e&&"samples"in e}(t)?new _(e,t):null}(e,t);null!=r&&(this._colorAttachments.set(36064,r),b(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(36064)}if(null!=r)if(function(e){return b(e)||M(e)}(r))this._depthStencilTexture=b(r)?r:new f.A(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=w(r)?r:new _(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}get glName(){return this._glName}get colorTexture(){const e=this._colorAttachments.get(36064);return b(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.height??0}get usedMemory(){return this._colorAttachments.values().reduce((e,t)=>e+t.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(e){this._level!==e&&(this._level=e,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&b(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=36064){if(!e)return;this._validateColorAttachmentPoint(t);const{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=36064){const t=this._colorAttachments.get(e);if(!t)return;const r=b(t);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(r)this._framebufferTexture2D(null,e);else{const t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._glName){const t=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{e.forEach(e=>{b(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=36064,r=0){const i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,r):this._framebufferTexture2D(i.glName,t,e,36160))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041===r||6402===r?34041!==r||i===m.ld.UNSIGNED_INT_24_8?6402!==r||i===m.ld.UNSIGNED_INT||i===m.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,E(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,E(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);const{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._glName){const{_context:t}=this,r=t.boundFramebuffer;t.bindFramebuffer(this);const{gl:i}=t,n=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,n,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){const{_context:t}=this;t.temporaryBindFramebuffer(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,n,o,a){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;3553!==a.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||n+r>s.width||o+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,f.A.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(3553,0,n,o,e,t,r,i),l.bindTexture(c,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,n,o,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,n,o,a)}async readPixelsAsync(e,t,r,i,n,o,a,s){const{gl:l}=this._context,c=g.g.createPixelPack(this._context,35041,a.byteLength);this._context.bindBuffer(c);const u=this._context.boundFramebuffer;this._context.bindFramebuffer(this),l.readPixels(e,t,r,i,n,o,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(u);try{await c.getSubDataAsync(a,void 0,void 0,void 0,s)}finally{c.dispose()}}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};if(T(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._glName&&(T(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),(0,d.en)())){const{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){const{gl:t}=this._context;this._glName?t.bindFramebuffer(e,this._glName):(this._glName&&t.deleteFramebuffer(this._glName),this._glName=t.createFramebuffer(),t.bindFramebuffer(e,this._glName),this._initializeAttachments(e))}_initializeAttachments(e=36160){const{gl:t}=this._context;if(this._colorAttachments.forEach((t,r)=>{if(b(t)){const i=C(t);35866===i?this._framebufferTextureLayer(t.glName,r,e):this._framebufferTexture2D(t.glName,r,i,e)}else if(w(t)){const i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const t=E(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,C(this._depthStencilTexture),e)}(0,d.en)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(e,t=36064,r=3553,i=36160){this._context.gl.framebufferTexture2D(i,t,r,e,this._level)}_framebufferTextureLayer(e,t=36064,r=36160,i=0){this._context.gl.framebufferTextureLayer(r,t,e,this._level,i)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,p.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,E(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,p.WD)(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),T(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){T(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.SB.DEPTH_COMPONENT16:case m.SB.DEPTH_COMPONENT24:case m.SB.DEPTH_COMPONENT32F:return 36096;case m.iE.DEPTH24_STENCIL8:case m.iE.DEPTH32F_STENCIL8:return 33306;case 36168:return 36128;default:return 36064}}_validateColorAttachmentPoint(e){if(-1===y._MAX_COLOR_ATTACHMENTS){const{gl:e}=this._context;y._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}const t=e-36064;t+1>y._MAX_COLOR_ATTACHMENTS&&h.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${y._MAX_COLOR_ATTACHMENTS} color attachments`)}}function b(e){return 1===S(e)}function w(e){return 2===S(e)}function M(e){return 0===S(e)}function S(e){return null!=e&&"type"in e?e.type:null}function T(e,t){const r=Math.max(e.width,e.height);if(r>t){h.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function C(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function E(e){return 6402===e?36096:33306}r(67171),r(21818);var I=r(85079);const A=[new(r(74038)._)("position",2,m.pe.UNSIGNED_SHORT,0,4)];(0,I.Xk)(A),r(66289);const P=new Image;P.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",P.width=5,P.height=5,P.decode();let O=class extends n.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=c.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,a.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},a.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new o.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){var t;e.initializeAndBind(),this.gl.drawBuffers((t=e)?t.colorAttachments.length>0?t.colorAttachments:[0]:[1029])}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}queryDepthRange(e){return null}get input(){return this._frameBuffer}};(0,i.Cg)([(0,s.MZ)({constructOnly:!0})],O.prototype,"view",void 0),(0,i.Cg)([(0,s.MZ)({constructOnly:!0})],O.prototype,"consumes",void 0),(0,i.Cg)([(0,s.MZ)()],O.prototype,"produces",void 0),(0,i.Cg)([(0,s.MZ)({readOnly:!0})],O.prototype,"techniques",null),O=(0,i.Cg)([(0,l.$)("esri.views.3d.webgl.RenderNode")],O)},48852(e,t,r){r.d(t,{g:()=>m});var i=r(4576),n=r(44208),o=r(53966),a=r(17676),s=r(78659),l=r(34275),c=r(94656),u=r(63907);const h=()=>o.A.getLogger("esri.views.webgl.BufferObject"),d=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class m{static createIndex(e,t,r){return new m(e,34963,t,r)}static createUniform(e,t,r){return new m(e,35345,t,r)}static createPixelPack(e,t=35041,r){const i=new m(e,35051,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=35040,r){return new m(e,35052,t,r)}static createTransformFeedback(e,t=35044,r){const i=new m(e,35982,t);return i.setSize(r),i}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,e.instanceCounter.increment(u.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,c.Y2)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case u.pe.UNSIGNED_INT:return this._sizeBytes/4;case u.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case u.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return d?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(u.vt.BufferObject,this),this._context=null):this._glName&&h().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(34963===this.bufferType&&null!=t)switch(this._indexType=t,t){case u.pe.UNSIGNED_SHORT:e*=2;break;case u.pe.UNSIGNED_INT:e*=4;case u.pe.UNSIGNED_BYTE:}this._setBufferData(e)}setData(e){if(!e)return;const t=e.byteLength;34963===this.bufferType&&((0,l.mg)(e)?this._indexType=u.pe.UNSIGNED_BYTE:(0,l.jq)(e)?this._indexType=u.pe.UNSIGNED_SHORT:(0,l.XJ)(e)&&(this._indexType=u.pe.UNSIGNED_INT)),this._setBufferData(t,e)}setIndexType(e){34963===this.bufferType&&(this._indexType=e)}_setBufferData(e,t=null){this._sizeBytes=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,c.Y2)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:o}=this._context;o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r),(0,c.Y2)(o),this._isVAOAware&&this._context.bindVAO(n)}getSubData(e,t=0,r,n){if(r<0||n<0)return;const o=function(e){return(0,i.Xj)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(n??0))>e.byteLength)return;t+o*(n??0)>this.usedMemory&&h().warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),a.getBufferSubData(35982,t,e,r,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),a.getBufferSubData(36662,t,e,r,n),this._context.unbindBuffer(36662))}async getSubDataAsync(e,t=0,r,i,n){if(await this._context.clientWaitAsync((0,s.l5)(10),n),!this._context||!this._glName)throw(0,a.NK)();this.getSubData(e,t,r,i)}}},65786(e,t,r){const i=class{};new i,r.d(t,["Y",0,i])},14113(e,t,r){r.d(t,{N5:()=>s});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new m,this.varyings=new f,this.outputs=new p}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s=n.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?x:v,u=n.constants.generateSource(),h=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${u.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${h.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,n,t)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let a=0;a<i;++a)r[a](e,o,t,n)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(){this._entries=new Map}add(e,t){if(this._entries.has(e))throw new i.A("shaderbuilder:duplicate-input",`Duplicate input for ${e}`);this._entries.set(e,t)}get(e){const t=this._entries.get(e);if(null==t)throw new i.A("shaderbuilder:input-resolver-error",`No resolver for input ${e} found.`);return t()}}class u{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0){const e=[];for(const t of this._bodies)"string"==typeof t?e.push(t):e.push(...t());return[`void main() {\n ${e.join("\n")||""} \n}`]}if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class h{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){const e=[];for(const t of this._entries)"string"==typeof t?e.push(t):e.push(...t());return e}}class d extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new u(this),this.code=new h(this),this.constants=new g(this),this.inputs=new c}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class f{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class g{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=g._numberToFloatStr(r);break;case"int":i=g._numberToIntStr(r);break;case"uint":i=g._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])}, ${g._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${g._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${g._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])}, ${g._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${g._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])}, ${g._numberToUintStr(r[2])}, ${g._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>g._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",x="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},74333(e,t,r){r.d(t,{n:()=>i});class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},85079(e,t,r){r.d(t,{Sk:()=>a,Xk:()=>n,_u:()=>o});var i=r(21818);function n(e){let t=0;return(0,i.z)(new Map(e.map(({name:e,count:r})=>{const i=[e,t];return 16===r?t+=4:9===r?t+=3:++t,i})))}function o(e){const t=new Map;let r=0;return e.forEach(e=>e.forEach(({name:e,count:i})=>{t.set(e,r),16===i?r+=4:9===i?r+=3:++r})),t}function a(e){return o(Array.from(e.values()).map(({layout:e})=>e))}},66289(e,t,r){r.d(t,{R:()=>n});var i=r(48852);class n extends i.g{constructor(e,t,r,i=35044){super(e,34962,i,r),this.layout=t}}},74038(e,t,r){r.d(t,{_:()=>i});class i{constructor(e,t,r,i,n,o=!1,a=0,s=!1){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=a,this.integer=s}}},90644(e,t,r){function i(e,t,r=32774,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,n=32774,o=32774,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}r.d(t,{Ey:()=>y,nk:()=>h,p3:()=>n}),r(4718);const o=i(0,771),a=(i(1,0),i(1,1),i(1,771)),s=n(770,1,771,771),l=n(0,0,768,0),c={face:1029,mode:2305},u={face:1028,mode:2305};function h(e,t,r){return{ref:e,readMask:t,stencilFront:r,stencilBack:r}}function d(e){return M.intern(e)}function m(e){return T.intern(e)}function f(e){return E.intern(e)}function p(e){return A.intern(e)}function g(e){return O.intern(e)}function v(e){return D.intern(e)}function x(e){return B.intern(e)}function _(e){return z.intern(e)}function y(e){return L.intern(e)}class b{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function w(e){return"["+e.join(",")+"]"}const M=new b(S,e=>({__tag:"Blending",...e}));function S(e){return e?w([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const T=new b(C,e=>({__tag:"Culling",...e}));function C(e){return e?w([e.face,e.mode]):null}const E=new b(I,e=>({__tag:"PolygonOffset",...e}));function I(e){return e?w([e.factor,e.units]):null}const A=new b(P,e=>({__tag:"DepthTest",...e}));function P(e){return e?w([e.func]):null}const O=new b(F,e=>({__tag:"StencilTest",...e}));function F(e){return e?w([e.ref,e.readMask,e.stencilFront.compare,e.stencilFront.fail,e.stencilFront.zFail,e.stencilFront.zPass,e.stencilBack.compare,e.stencilBack.fail,e.stencilBack.zFail,e.stencilBack.zPass]):null}const D=new b(R,e=>({__tag:"DepthWrite",...e}));function R(e){return e?w([e.zNear,e.zFar]):null}const B=new b(N,e=>({__tag:"ColorWrite",...e}));function N(e){return e?w([e.r,e.g,e.b,e.a]):null}const z=new b(H,e=>({__tag:"StencilWrite",...e}));function H(e){return e?w([e.mask]):null}const L=new b(function(e){return e?w([S(e.blending),C(e.culling),I(e.polygonOffset),P(e.depthTest),F(e.stencilTest),R(e.depthWrite),N(e.colorWrite),H(e.stencilWrite)]):null},e=>({blending:d(e.blending),culling:m(e.culling),polygonOffset:f(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:g(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:x(e.colorWrite),stencilWrite:_(e.stencilWrite)}));r.d(t,["RC",0,a,"T8",0,s,"Uy",0,{zNear:0,zFar:1},"Xt",0,e=>2===e?c:1===e?u:null,"iD",0,o,"kn",0,{r:!0,g:!0,b:!0,a:!0},"uR",0,l])},49788(e,t,r){const i=1/255.5,n=1-i;r.d(t,["Q",0,i,"v",0,n])}}]);
1717
+ `)}},26934(e,t,r){r.d(t,{Q:()=>n});var i=r(49788);function n(e){e.constants.add("alphaCutoff","float",i.Q),e.constants.add("opacityCutoff","float",i.v)}},58243(e,t,r){function i(e,t){t.useFloatBlend?e.code.add("float ditherNoise(vec4 color) { return 0.0; }"):e.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}r.d(t,{t:()=>i})},72458(e,t,r){r.d(t,{C:()=>o,O:()=>a});var i=r(5482),n=r(51976);class o extends n.K{constructor(){super(...arguments),this.useFloatBlend=!0}}function a(e,t){t.useFloatBlend?(e.constants.add("floatBlendOutputScale","float",1),e.constants.add("floatBlendInputScale","float",1)):(e.constants.add("floatBlendOutputScale","float",1/16),e.constants.add("floatBlendInputScale","float",16)),e.constants.add("maxEmissiveStrength","float",16)}(0,i.Cg)([(0,n.W)()],o.prototype,"useFloatBlend",void 0)},89904(e,t,r){r.d(t,{OG:()=>$e,gP:()=>Ge});var i=r(5482),n=r(69540),o=r(91429);let a=class extends n.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"row",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"column",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"rows",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],a.prototype,"columns",void 0),a=(0,i.Cg)([(0,o.$K)("esri.CameraLayout")],a);const s=a;var l=r(69052),c=r(25482),u=r(34727),h=r(56507),d=r(86738),m=r(43937),f=r(36005);let p=class extends((0,n.OU)(c.o)){constructor(...e){super(...e),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new s}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,h.GB)(e.x||0),n.y=(0,h.GB)(e.y||0),n.z=e.hasZ?(0,h.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new d.A;return r.read(e,t),r.x=(0,h.GB)(r.x||0),r.y=(0,h.GB)(r.y||0),r.z=r.hasZ?(0,h.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,i.Cg)([(0,o.MZ)({type:d.A,json:{write:{isRequired:!0}}})],p.prototype,"position",void 0),(0,i.Cg)([(0,m.K)("position")],p.prototype,"writePosition",null),(0,i.Cg)([(0,f.w)("position")],p.prototype,"readPosition",null),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,o.wg)(e=>l.ie.normalize((0,h.GB)(e)))],p.prototype,"heading",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,o.wg)(e=>(0,u.qE)((0,h.GB)(e),-180,180))],p.prototype,"tilt",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,o.wg)(e=>(0,u.qE)((0,h.GB)(e,55),1,170))],p.prototype,"fov",void 0),(0,i.Cg)([(0,o.MZ)({type:s,nonNullable:!0,json:{read:!1,write:!1}})],p.prototype,"layout",void 0),p=(0,i.Cg)([(0,o.$K)("esri.Camera")],p);var g=r(9093),v=r(35522),x=r(51850),_=r(16930),y=(r(48353),r(9762),r(65806)),b=r(27993),w=r(73941),M=(r(19419),r(82919)),S=r(71351),T=r(69622),C=r(53966),E=r(90629),I=r(58083),A=r(37585),O=r(48163),P=r(78955),F=r(91829),D=r(44280);function R(e,t,r){e.worldUpAtPosition(t,B),(0,v.Re)(N,r,t);const i=(0,v.Bw)(N);return 0===i?0:(0,u.XM)((0,v.Om)(N,B)/i)}const B=(0,x.vt)(),N=(0,x.vt)();var z;let H=z=class extends T.A{constructor(e){super(e),this._ray=(0,S.vt)(),this._viewport=(0,F.fA)(0,0,1,1),this._padding=(0,F.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,O.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,g.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,g.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,g.vt)(),this._frustumDirty=!0,this._frustum=(0,M.vt)(),this._fullViewport=(0,F.vt)(),this._fullViewportDirty=!0,this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,x.vt)(),this._up=(0,x.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin,"eye")}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,v.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,I.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get inverseViewMatrix(){return(0,I.Qw)((0,g.vt)(),this.viewMatrix)||this._get("inverseViewMatrix")||(0,g.vt)()}get viewForward(){return this._ensureViewClean(),(0,v.hZ)((0,x.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,v.hZ)((0,x.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,v.hZ)((0,x.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,P.hs)((0,F.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,P.aI)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,P.hs)((0,F.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,P.aI)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewportDirty&&(this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this._viewport[2]+this._padding[1]+this._padding[3],this._fullViewport[3]=this._viewport[3]+this._padding[0]+this._padding[2],this._fullViewportDirty=!1),this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,P.t2)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,P.C)(this._padding,e),this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,I.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,I.B8)((0,g.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,g.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,v.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,I.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,I.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,a=-i/2+this.column*o,s=a+o,l=-r/2+this.row*n,c=l+n,u=(0,I.$h)((0,g.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),h=this._get("projectionMatrix");return h&&(0,I.t2)(h,u)?h:u}copyFrom(e){(0,v.C)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,P.C)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,P.C)(this._padding,e.padding),this.notifyChange("_padding"),this._fullViewportDirty=!0,(0,A.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,I.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,M.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,I.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new z).copyFrom(this)}equals(e){return(0,v.t2)(this.eye,e.eye)&&(0,v.t2)(this.center,e.center)&&(0,v.t2)(this.up,e.up)&&(0,P.t2)(this._viewport,e.viewport)&&(0,P.t2)(this._padding,e.padding)&&(0,A.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}equalsView(e){return(0,v.t2)(this.eye,e.eye)&&(0,v.t2)(this.center,e.center)&&(0,v.t2)(this.up,e.up)&&this._fov===e.fov}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,P.hG)(e.screenPadding,this.screenPadding)>=t||(0,P.hG)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,v.jb)(W,e.eye,e.center),(0,v.jb)(U,this.eye,this.center);const r=(0,v.Om)(W,U),i=(0,v.uE)(W),n=(0,v.uE)(U),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,v.lo)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,D.gr)(this.viewForward,(0,v.Re)(W,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,E.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==L&&(0,v.C)(L,e),L[3]=1,(0,P.Z0)(L,L,this.projectionMatrix);const r=Math.abs(L[3]);(0,v.hs)(L,L,1/r);const i=this.fullViewport;t[0]=(0,u.Cc)(0,i[0]+i[2],.5+.5*L[0]),t[1]=(0,u.Cc)(0,i[1]+i[3],.5+.5*L[1]),t[2]=.5*(L[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;L[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],L[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],L[2]=(2*e[2]-1)*e[3],L[3]=e[3],null!=this.inverseProjectionMatrix&&((0,P.Z0)(L,L,this.inverseProjectionMatrix),t[0]=L[0],t[1]=L[1],t[2]=L[2])}projectToScreen(e,t){return null==this.projectToRenderScreen(e,V)?null:(this.renderToScreen(V,t),t)}projectToRenderScreen(e,t){if(L[0]=e[0],L[1]=e[1],L[2]=e[2],L[3]=1,(0,P.Z0)(L,L,this.viewProjectionMatrix),0===L[3])return null;const r=L;(0,v.hs)(r,r,1/Math.abs(L[3]));const i=this.fullViewport,n=(0,u.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,u.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,V),t)}unprojectFromRenderScreen(e,t){if((0,I.lw)(j,this.projectionMatrix,this.viewMatrix),!(0,I.B8)(j,j))return null;const r=this.fullViewport;return L[0]=2*(e[0]-r[0])/r[2]-1,L[1]=2*(e[1]-r[1])/r[3]-1,L[2]=2*e[2]-1,L[3]=1,(0,P.Z0)(L,L,j),0===L[3]?null:(t[0]=L[0]/L[3],t[1]=L[1]/L[3],t[2]=L[2]/L[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,a=Math.max(n-r/2,0),s=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),u=r-l- -Math.min(this.fullWidth-n-r/2,0),h=i-c- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(u),Math.round(h)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:n,fovY:o}=this,a=Math.abs(Math.PI/2-R(t,r,i));return e.frustumCoverage(a,n,o)}_computeUpGlobal(){(0,v.Re)(W,this.center,this.eye);const e=(0,v.Bw)(this.center);e<1?(0,v.t2)(this._up,x.Cb)&&((0,v.C)(this._up,x.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,v.Om)(W,this.center))>.9999*(0,v.Bw)(W)*e||((0,v.$A)(U,W,this.center),(0,v.$A)(U,U,W),(0,v.S8)(U,U),(0,v.t2)(this._up,U)||((0,v.C)(this._up,U),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,v.oW)(W,this.eye,this.center),Math.abs(W[2])<=.9999&&((0,v.hs)(W,W,W[2]),(0,v.hZ)(W,-W[0],-W[1],1-W[2]),(0,v.S8)(W,W),(0,v.t2)(this._up,W)||((0,v.C)(this._up,W),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,v.t2)(e,t)||((0,v.C)(t,e),this._markViewDirty(),this.notifyChange(r)):C.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,M.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,I.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,i.Cg)([(0,o.MZ)()],H.prototype,"_viewport",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_padding",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_fov",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_nearFar",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_viewDirty",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_viewMatrix",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_pixelRatio",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"pixelRatio",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"row",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"column",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_rows",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"rows",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_columns",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"columns",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"eye",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"center",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_center",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"up",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"_up",void 0),(0,i.Cg)([(0,o.MZ)()],H.prototype,"viewMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"inverseViewMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"viewForward",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"viewUp",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"viewRight",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"nearFar",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"near",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"far",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"viewport",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"screenViewport",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"screenPadding",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"x",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"y",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"width",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"height",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"fullWidth",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"fullHeight",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"_aspect",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"padding",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"projectionMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"inverseProjectionMatrix",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"fov",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"fovX",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"fovY",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"viewInverseTransposeMatrix",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],H.prototype,"_projectionMatrixInternal",null),(0,i.Cg)([(0,o.MZ)()],H.prototype,"relativeElevation",void 0),H=z=(0,i.Cg)([(0,o.$K)("esri.views.3d.webgl.RenderCamera")],H);const L=(0,F.vt)(),j=(0,g.vt)(),W=(0,x.vt)(),U=(0,x.vt)(),V=(0,E.r_)();r(49718),r(6867),r(16396),(0,x.vt)(),(0,x.vt)(),(0,x.vt)();var G=r(5443),k=r(39829),$=r(95108);function Z(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return 1===n?1:0;const s=(a[o]-t[o])/(a[r]-t[r]),l=t[o]+s*(i-t[r]);return e[r]=i,e[o]=l,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(Y,t[0],t[0])&&q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(Y,t[r],i)){case 1:q(e,i);break;case 3:q(e,(0,O.o8)(Y));break;case 2:q(e,(0,O.o8)(Y)),q(e,i)}}}}function q(e,t){0!==e.length&&(0,A.aI)(e.at(-1),t)||e.push(t)}const Y=(0,O.vt)();var X=r(11964),K=r(27921);const J=(0,x.vt)(),Q=(0,x.vt)();function ee(){return{direction:(0,x.vt)(),up:(0,x.vt)()}}function te(e,t,r,i,n){let o=(0,v.S8)(J,e),a=(0,v.Om)(o,i);const s=a>0;a=Math.abs(a),a>.99&&(a=Math.abs((0,v.Om)(t,i)),a<.99?((0,v.C)(o,t),s&&(0,v.hs)(o,o,-1)):o=null);let l=0;if(o){(0,v.hs)(Q,i,(0,v.Om)(i,o)),(0,v.Re)(o,o,Q);const e=(0,v.Om)(o,n)/((0,v.Bw)(o)*(0,v.Bw)(n));(0,v.$A)(Q,o,n),l=((0,v.Om)(Q,i)>0?1:-1)*(0,u.KJ)((0,u.XM)(e))}const c=(0,u.KJ)((0,u.XM)(-(0,v.Om)(i,e)/(0,v.Bw)(e)));return r?(r.heading=l,r.tilt=c,r):{heading:l,tilt:c}}function re(e,t,r,i){(0,v.Re)(ie,r,t),(0,K.T7)(i,(0,X.LV)(t,ie),e)||e===r||(0,v.C)(e,r)}const ie=(0,x.vt)(),ne=(0,x.fA)(0,1,0),oe=(0,x.fA)(0,0,1),ae=(0,g.vt)(),se=(0,x.vt)(),le=(0,x.vt)();function ce(e,t,r,i=ee()){const{direction:n,up:o}=i;return(0,I.N9)(ae,-(0,u.kU)(t)),(0,I.eL)(ae,ae,(0,u.kU)(r)),(0,v.Z0)(n,oe,ae),(0,v.hs)(n,n,-1),(0,v.Z0)(o,ne,ae),i}function ue(e,t,r,i,n){const o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,v.Ln)(e,i,o,a)}const he=(0,x.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return te(t,r,i,oe,ne)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=ce(0,r,i),o=(0,x.vt)();return(0,v.hs)(o,n.direction,-t),(0,v.WQ)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,u.kU)(e)},headingTiltToDirectionUp:ce,lookAtTiltToEyeTilt:function(e){return(0,u.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,S.LV)(t.origin,t.direction),n,he)||ue(he,r,i,t.endpoint,n),re(he,a,he,l),s.push((0,O.fA)(he[0],he[1]))}return function(e,t,r){const i=e.map(e=>((0,v.hZ)(he,e[0],e[1],0),t.fromRenderCoords(he,he,r),[he[0],he[1]]));return i.length<=2?new k.A({spatialReference:r}):(i.push(i[0].slice()),(0,$.$3)(i)||i.reverse(),new k.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return Z(r,e,t,0),Z(i,r,t,1),Z(r,i,t,2),Z(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,y.g)(t,se,o),(0,y.g)(t,le,o),se[0]-=r/2,le[0]+=r/2,se[1]-=i/2,le[1]+=i/2,(0,b.F)(se,o,se,a),(0,b.F)(le,o,le,a),n?(n.xmin=se[0],n.ymin=se[1],n.xmax=le[0],n.ymax=le[1],n.spatialReference=a):n=new G.A(se[0],se[1],le[0],le[1],a),n}},Symbol.toStringTag,{value:"Module"}));var de=r(34304),me=r(52039),fe=r(94008),pe=r(28735);class ge{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,M.vt)(),this._points=(0,M.Qy)(),this.lines=new Array(12),this._origin=(0,x.vt)(),this._direction=(0,x.vt)(),this._boundingSphere=new fe.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,x.vt)(),endpoint:null}}update(e){(0,M.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,v.C)(this._origin,e.eye),(0,v.C)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,v.C)(this._points[t],e[t]);(0,M.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,M.m7)(this.frustum,e)}intersectsRay(e){return(0,M.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,M.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,M.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;ve(this.lines[t],e[t],e[r]),ve(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),ve(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){const{origin:e}=this,t=_e;(0,v.S8)(t,this.direction);const r=xe;(0,v.jb)(r,this.points[4],e);const i=.5*(0,v.Om)(r,r)/(0,v.Om)(t,r),n=this._boundingSphere,o=(0,v.Ln)(ye,e,t,i);n.center=o,n.radius=i}static{this.planePointIndices=M.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function ve(e,t,r){e.origin=t,e.endpoint=r,(0,v.oW)(e.direction,t,r)}const xe=(0,x.vt)(),_e=(0,x.vt)(),ye=(0,x.vt)();r(86211);const be=(0,x.fA)(5802e-9,13558e-9,331e-7),we=(0,x.fA)(65e-8*3,5643e-9,255e-9);(0,x.fA)(be[0]+we[0],be[1]+we[1],be[2]+we[2]);class Me{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Me(0,0)}static{this.Infinite=new Me}}(0,x.vt)(),(0,x.vt)(),new fe.iy,(0,S.vt)(),new G.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var Se=r(32728);const Te=(0,x.fA)(0,0,1),Ce=(0,v.S8)((0,x.vt)(),(0,x.fA)(1,1,1)),Ee=(0,g.vt)(),Ie=(0,x.vt)(),Ae=(0,x.vt)();function Oe(e,t,r,i=ee()){(0,v.$A)(Ie,e,Te),0===(0,v.Om)(Ie,Ie)&&(0,v.$A)(Ie,e,Ce),(0,I.$0)(Ee,-(0,u.kU)(t),e),(0,I.e$)(Ee,Ee,-(0,u.kU)(r),Ie);const{up:n,direction:o}=i;return(0,v.$A)(n,Ie,e),(0,v.S8)(n,n),(0,v.Z0)(n,n,Ee),(0,v.S8)(o,e),(0,v.ze)(o,o),(0,v.Z0)(o,o,Ee),i}function Pe(e){const t=e[1];e[1]=-e[2],e[2]=t}function Fe(e,t){const r=Oe(t,e.heading,e.tilt);return e.up=r.up,e}function De(e,t){const{renderCoordsHelper:r,state:i}=e;if(1!==i.viewingMode)return 1;const n=r.getAltitude(t),o=r.referenceEllipsoid.radius,a=1+(0,v.Io)(i.camera.eye,t)/(o+n),s=Math.sqrt(a*a-1),{minCurvature:l,maxCurvature:c,minSamples:h,maxSamples:d}=Be,m=(0,u.qE)((s-l)/(c-l),0,1);return Math.round((0,u.Cc)(h,d,m))}function Re(e,t){const r=[],i=[],n=(0,de.FD)();for(let o=0;o<e.length;o++){const a=e[o],s=o===e.length-1?e[0]:e[o+1],l=(0,X.Cr)(a,s,Ue),c=(0,K.vE)(t,l.origin,l.vector,0,je);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,o,s]=0===c?[1,r,i]:[-1,i,r],l=(0,K.Qj)(t),u=(0,v.Ln)((0,x.vt)(),je,l,e*n),h=(0,v.Ln)((0,x.vt)(),je,l,e*-n);o.push(a),o.push(u),s.push(h)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Be={minCurvature:(0,u.kU)(5),maxCurvature:(0,u.kU)(50),minSamples:1,maxSamples:6},Ne=(0,x.fA)(1,0,0),ze=(0,x.fA)(0,1,0),He=(0,x.vt)(),Le=(0,x.vt)(),je=(0,x.vt)(),We=new fe.iy,Ue=(0,X.vt)(),Ve=(0,F.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Ie,o=Ae;return(0,v.S8)(n,e),(0,v.$A)(Ae,n,Te),0===(0,v.Om)(Ae,Ae)&&(0,v.$A)(Ae,n,Ce),(0,v.$A)(o,Ae,n),te(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,x.vt)(),up:null,tilt:i,heading:r},o=Ie;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const a=t,s=(0,u.kU)(r),l=(0,u.kU)(i),c=Math.sin(s),h=Math.cos(s),d=Math.sin(l),m=Math.cos(l),f=(0,v.Bw)(o);let p;if(Math.abs(l)<1e-8)p=a+f;else{const e=f/d,t=(0,u.YN)(a/e),r=Math.PI-l-t;p=e*Math.sin(r)}const g=m*a,_=a*a*(d*d),y=h*h*_,b=p-g,w=b*b,M=y*(y+w-o[1]*o[1]);if(M<0)return(0,v.hs)(n.eye,o,p/f),n.tilt=0,Fe(n,e);const S=Math.sqrt(M),T=o[1]*b,C=y+w;let E;if(E=h>0?-S+T:S+T,Math.abs(C)<1e-8)return f<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=a):(0,v.hs)(n.eye,o,p/f),n.tilt=0,Pe(n.eye),Fe(n,e);n.eye[1]=E/C;const I=c*c*_,A=d*a,O=h*A*n.eye[1],P=n.eye[1]*n.eye[1],F=1-P,D=Math.sqrt(F),R=y*P+I-2*O*D*b+F*w;return Math.abs(R)<1e-8?((0,v.hs)(n.eye,o,p/f),n.tilt=0,Pe(n.eye),Fe(n,e)):(n.eye[0]=(F*(p*o[0]-g*o[0])-A*D*(o[0]*n.eye[1]*h+o[2]*c))/R,n.eye[2]=(F*(p*o[2]-g*o[2])-A*D*(o[2]*n.eye[1]*h-o[0]*c))/R,(0,v.hs)(n.eye,n.eye,p),Pe(n.eye),Fe(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,u.kU)(e),n=(0,v.Bw)(t);return(0,u.YN)(r/(n/Math.sin(i)))+i},getCurvatureSamples:De,headingTiltToDirectionUp:Oe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,v.Bw)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,u.YN)(r/(n/Math.sin(e)));return(0,u.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new ge(r);i.near=2,n.update(i);const o=r.getAltitude(t),a=e.spatialReference,s=i.eye,l=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return We.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(We,t)}(e),c=De(e,t),h=i.aboveGround,d=n.planes[5],m=[],f=(0,K.O_)(x.uY,Ne,(0,K.vt)()),p=(0,K.O_)(x.uY,ze,(0,K.vt)());(0,P.hZ)(Ve,0,0,0,0);const g=e=>{};for(let e=0;e<4;e++){const t=1===e&&!h||3===e&&h?1-l:0,i=1===e&&h||3===e&&!h?l:1,a=n.lines[e],_=n.lines[3===e?0:e+1];for(let n=0;n<c;n++){const l=n/c,h=0===n?0:(0,u.Cc)(t,i,1===e?1-(1-l)**2:3===e?l**2:l),y=(0,v.Cc)(Le,a.origin,_.origin,h),b=(0,Se.nu)(a.direction,_.direction,h,He);r.intersectManifoldClosestSilhouette((0,S.LV)(y,b),o,je),re(je,s,je,d),m.push((0,x.o8)(je)),0!==m.length&&g((0,v.lo)(m.at(-1),je));const w=((0,K.Tj)(f,je)?1:0)|((0,K.Tj)(p,je)?2:0);Ve[w]=1}}m.length>2&&(0,v.lo)(m[0],m.at(-1));const _=function(e,t,r){const i=2*(0,de.FD)();return e.map(e=>{const n=[];let o=!1;for(const a of e)t.fromRenderCoords(a,je,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,je[1]]),n.push([null,je[1]]),o=!0):n.push([je[0],je[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,$.$3)(n)||n.reverse(),n})}((0,P.m3)(Ve)>1?function(e,t){const r=[];for(const i of e)r.push(...Re(i,t));return r}(Re(m,f),p):[m],r,a);return new k.A({rings:_,spatialReference:a})},toExtent:function(e,t,r,i,n){let o,a,s,c;const h=t.latitude,d=(0,w.tO)(e.spatialReference).radius,m=t.longitude,f=function(e,t,r){const i=t/r,n=(0,u.kU)(e),o=Math.sin(i/2),a=Math.cos(n),s=2*(0,u.YN)(Math.sqrt(o*o/(a*a)));return(0,u.KJ)(s)}(h,r,d)/2;o=m-f,a=m+f;const p=(0,u.kU)(h),g=(1+Math.sin(p))/(1-Math.sin(p)),v=(g+1)*Math.tan(i/d/2),x=v*v;function y(e){const t=Math.PI/2;return(e=l.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(s=1.5*Math.PI-2*Math.atan(.5*(v+Math.sqrt(4*g+x))),c=s+i/d,s=y(s),c=y(c),c<s){const e=c;c=s,s=e}if(s=Math.max((0,u.KJ)(s),-90),c=Math.min((0,u.KJ)(c),90),a=me.Y_.monotonic(o,a),a-o>180){const e=(a-o-180)/2;o+=e,a-=e}const b=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:_.A.WGS84;return n?(n.xmin=o,n.ymin=s,n.xmax=a,n.ymax=c,n.spatialReference=b):n=new G.A(o,s,a,c,b),e.spatialReference&&e.spatialReference.isWebMercator&&(0,pe.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Ge={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},ke=[Ge.FINAL,Ge.COMPOSITE,Ge.OPAQUE,Ge.TRANSPARENT],$e={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GAUSSIAN_SPLAT_DEPTH:"gaussian-depth",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_ACCUMULATION:"shadow-accumulation",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values($e)).concat(ke),(0,x.vt)()},90119(e,t,r){r.d(t,{A:()=>P});var i=r(5482),n=r(69622),o=r(49186),a=r(36708),s=r(10107),l=r(64108),c=r(89904),u=r(44208),h=r(53966),d=(r(17676),r(94656)),m=r(63907);r(93637),r(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,u.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();r(90644);var f=r(25530),p=r(97768),g=r(48852),v=r(42293);const x=!!(0,u.A)("esri-tests-disable-gpu-memory-measurements");class _{constructor(e,t){this._context=e,this._descriptor=t,this.type=2,this._context.instanceCounter.increment(m.vt.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:n,internalFormat:o,multisampled:a}=t;a?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,i,n):r.renderbufferStorage(r.RENDERBUFFER,o,i,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return x?0:(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,v.MW)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m.vt.Renderbuffer,this),this._context=null)}}class y{constructor(e,t,r){if(this._context=e,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,e.instanceCounter.increment(m.vt.FramebufferObject,this),null!=t){const r=function(e,t){return b(t)||w(t)?t:M(t)?new f.A(e,t):function(e){return 3===S(e)||null!=e&&"samples"in e}(t)?new _(e,t):null}(e,t);null!=r&&(this._colorAttachments.set(36064,r),b(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(36064)}if(null!=r)if(function(e){return b(e)||M(e)}(r))this._depthStencilTexture=b(r)?r:new f.A(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=w(r)?r:new _(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}get glName(){return this._glName}get colorTexture(){const e=this._colorAttachments.get(36064);return b(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.height??0}get usedMemory(){return this._colorAttachments.values().reduce((e,t)=>e+t.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(e){this._level!==e&&(this._level=e,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&b(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=36064){if(!e)return;this._validateColorAttachmentPoint(t);const{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=36064){const t=this._colorAttachments.get(e);if(!t)return;const r=b(t);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(r)this._framebufferTexture2D(null,e);else{const t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._glName){const t=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{e.forEach(e=>{b(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=36064,r=0){const i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,r):this._framebufferTexture2D(i.glName,t,e,36160))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041===r||6402===r?34041!==r||i===m.ld.UNSIGNED_INT_24_8?6402!==r||i===m.ld.UNSIGNED_INT||i===m.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,E(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,E(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);const{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._glName){const{_context:t}=this,r=t.boundFramebuffer;t.bindFramebuffer(this);const{gl:i}=t,n=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,n,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){const{_context:t}=this;t.temporaryBindFramebuffer(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,n,o,a){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;3553!==a.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||n+r>s.width||o+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,f.A.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(3553,0,n,o,e,t,r,i),l.bindTexture(c,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,n,o,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,n,o,a)}async readPixelsAsync(e,t,r,i,n,o,a,s){const{gl:l}=this._context,c=g.g.createPixelPack(this._context,35041,a.byteLength);this._context.bindBuffer(c);const u=this._context.boundFramebuffer;this._context.bindFramebuffer(this),l.readPixels(e,t,r,i,n,o,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(u);try{await c.getSubDataAsync(a,void 0,void 0,void 0,s)}finally{c.dispose()}}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};if(T(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._glName&&(T(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),(0,d.en)())){const{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){const{gl:t}=this._context;this._glName?t.bindFramebuffer(e,this._glName):(this._glName&&t.deleteFramebuffer(this._glName),this._glName=t.createFramebuffer(),t.bindFramebuffer(e,this._glName),this._initializeAttachments(e))}_initializeAttachments(e=36160){const{gl:t}=this._context;if(this._colorAttachments.forEach((t,r)=>{if(b(t)){const i=C(t);35866===i?this._framebufferTextureLayer(t.glName,r,e):this._framebufferTexture2D(t.glName,r,i,e)}else if(w(t)){const i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const t=E(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,C(this._depthStencilTexture),e)}(0,d.en)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(e,t=36064,r=3553,i=36160){this._context.gl.framebufferTexture2D(i,t,r,e,this._level)}_framebufferTextureLayer(e,t=36064,r=36160,i=0){this._context.gl.framebufferTextureLayer(r,t,e,this._level,i)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,p.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,E(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,p.WD)(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),T(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){T(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.SB.DEPTH_COMPONENT16:case m.SB.DEPTH_COMPONENT24:case m.SB.DEPTH_COMPONENT32F:return 36096;case m.iE.DEPTH24_STENCIL8:case m.iE.DEPTH32F_STENCIL8:return 33306;case 36168:return 36128;default:return 36064}}_validateColorAttachmentPoint(e){if(-1===y._MAX_COLOR_ATTACHMENTS){const{gl:e}=this._context;y._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}const t=e-36064;t+1>y._MAX_COLOR_ATTACHMENTS&&h.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${y._MAX_COLOR_ATTACHMENTS} color attachments`)}}function b(e){return 1===S(e)}function w(e){return 2===S(e)}function M(e){return 0===S(e)}function S(e){return null!=e&&"type"in e?e.type:null}function T(e,t){const r=Math.max(e.width,e.height);if(r>t){h.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function C(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function E(e){return 6402===e?36096:33306}r(67171),r(21818);var I=r(85079);const A=[new(r(74038)._)("position",2,m.pe.UNSIGNED_SHORT,0,4)];(0,I.Xk)(A),r(66289);const O=new Image;O.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",O.width=5,O.height=5,O.decode();let P=class extends n.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=c.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,a.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},a.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new o.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){var t;e.initializeAndBind(),this.gl.drawBuffers((t=e)?t.colorAttachments.length>0?t.colorAttachments:[0]:[1029])}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}queryDepthRange(e){return null}get input(){return this._frameBuffer}};(0,i.Cg)([(0,s.MZ)({constructOnly:!0})],P.prototype,"view",void 0),(0,i.Cg)([(0,s.MZ)({constructOnly:!0})],P.prototype,"consumes",void 0),(0,i.Cg)([(0,s.MZ)()],P.prototype,"produces",void 0),(0,i.Cg)([(0,s.MZ)({readOnly:!0})],P.prototype,"techniques",null),P=(0,i.Cg)([(0,l.$)("esri.views.3d.webgl.RenderNode")],P)},48852(e,t,r){r.d(t,{g:()=>m});var i=r(4576),n=r(44208),o=r(53966),a=r(17676),s=r(78659),l=r(34275),c=r(94656),u=r(63907);const h=()=>o.A.getLogger("esri.views.webgl.BufferObject"),d=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class m{static createIndex(e,t,r){return new m(e,34963,t,r)}static createUniform(e,t,r){return new m(e,35345,t,r)}static createPixelPack(e,t=35041,r){const i=new m(e,35051,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=35040,r){return new m(e,35052,t,r)}static createTransformFeedback(e,t=35044,r){const i=new m(e,35982,t);return i.setSize(r),i}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,e.instanceCounter.increment(u.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,c.Y2)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case u.pe.UNSIGNED_INT:return this._sizeBytes/4;case u.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case u.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return d?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(u.vt.BufferObject,this),this._context=null):this._glName&&h().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(34963===this.bufferType&&null!=t)switch(this._indexType=t,t){case u.pe.UNSIGNED_SHORT:e*=2;break;case u.pe.UNSIGNED_INT:e*=4;case u.pe.UNSIGNED_BYTE:}this._setBufferData(e)}setData(e){if(!e)return;const t=e.byteLength;34963===this.bufferType&&((0,l.mg)(e)?this._indexType=u.pe.UNSIGNED_BYTE:(0,l.jq)(e)?this._indexType=u.pe.UNSIGNED_SHORT:(0,l.XJ)(e)&&(this._indexType=u.pe.UNSIGNED_INT)),this._setBufferData(t,e)}setIndexType(e){34963===this.bufferType&&(this._indexType=e)}_setBufferData(e,t=null){this._sizeBytes=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,c.Y2)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:o}=this._context;o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r),(0,c.Y2)(o),this._isVAOAware&&this._context.bindVAO(n)}getSubData(e,t=0,r,n){if(r<0||n<0)return;const o=function(e){return(0,i.Xj)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(n??0))>e.byteLength)return;t+o*(n??0)>this.usedMemory&&h().warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),a.getBufferSubData(35982,t,e,r,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),a.getBufferSubData(36662,t,e,r,n),this._context.unbindBuffer(36662))}async getSubDataAsync(e,t=0,r,i,n){if(await this._context.clientWaitAsync((0,s.l5)(10),n),!this._context||!this._glName)throw(0,a.NK)();this.getSubData(e,t,r,i)}}},65786(e,t,r){const i=class{};new i,r.d(t,["Y",0,i])},14113(e,t,r){r.d(t,{N5:()=>s});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new m,this.varyings=new f,this.outputs=new p}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s=n.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?x:v,u=n.constants.generateSource(),h=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${u.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${h.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,n,t)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let a=0;a<i;++a)r[a](e,o,t,n)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(){this._entries=new Map}add(e,t){if(this._entries.has(e))throw new i.A("shaderbuilder:duplicate-input",`Duplicate input for ${e}`);this._entries.set(e,t)}get(e){const t=this._entries.get(e);if(null==t)throw new i.A("shaderbuilder:input-resolver-error",`No resolver for input ${e} found.`);return t()}}class u{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0){const e=[];for(const t of this._bodies)"string"==typeof t?e.push(t):e.push(...t());return[`void main() {\n ${e.join("\n")||""} \n}`]}if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class h{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){const e=[];for(const t of this._entries)"string"==typeof t?e.push(t):e.push(...t());return e}}class d extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new u(this),this.code=new h(this),this.constants=new g(this),this.inputs=new c}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class f{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class g{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=g._numberToFloatStr(r);break;case"int":i=g._numberToIntStr(r);break;case"uint":i=g._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])}, ${g._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${g._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${g._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])}, ${g._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${g._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])}, ${g._numberToUintStr(r[2])}, ${g._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>g._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",x="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},74333(e,t,r){r.d(t,{n:()=>i});class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},85079(e,t,r){r.d(t,{Sk:()=>a,Xk:()=>n,_u:()=>o});var i=r(21818);function n(e){let t=0;return(0,i.z)(new Map(e.map(({name:e,count:r})=>{const i=[e,t];return 16===r?t+=4:9===r?t+=3:++t,i})))}function o(e){const t=new Map;let r=0;return e.forEach(e=>e.forEach(({name:e,count:i})=>{t.set(e,r),16===i?r+=4:9===i?r+=3:++r})),t}function a(e){return o(Array.from(e.values()).map(({layout:e})=>e))}},66289(e,t,r){r.d(t,{R:()=>n});var i=r(48852);class n extends i.g{constructor(e,t,r,i=35044){super(e,34962,i,r),this.layout=t}}},74038(e,t,r){r.d(t,{_:()=>i});class i{constructor(e,t,r,i,n,o=!1,a=0,s=!1){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=a,this.integer=s}}},90644(e,t,r){function i(e,t,r=32774,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,n=32774,o=32774,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}r.d(t,{Ey:()=>y,nk:()=>h,p3:()=>n}),r(4718);const o=i(0,771),a=(i(1,0),i(1,1),i(1,771)),s=n(770,1,771,771),l=n(0,0,768,0),c={face:1029,mode:2305},u={face:1028,mode:2305};function h(e,t,r){return{ref:e,readMask:t,stencilFront:r,stencilBack:r}}function d(e){return M.intern(e)}function m(e){return T.intern(e)}function f(e){return E.intern(e)}function p(e){return A.intern(e)}function g(e){return P.intern(e)}function v(e){return D.intern(e)}function x(e){return B.intern(e)}function _(e){return z.intern(e)}function y(e){return L.intern(e)}class b{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function w(e){return"["+e.join(",")+"]"}const M=new b(S,e=>({__tag:"Blending",...e}));function S(e){return e?w([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const T=new b(C,e=>({__tag:"Culling",...e}));function C(e){return e?w([e.face,e.mode]):null}const E=new b(I,e=>({__tag:"PolygonOffset",...e}));function I(e){return e?w([e.factor,e.units]):null}const A=new b(O,e=>({__tag:"DepthTest",...e}));function O(e){return e?w([e.func]):null}const P=new b(F,e=>({__tag:"StencilTest",...e}));function F(e){return e?w([e.ref,e.readMask,e.stencilFront.compare,e.stencilFront.fail,e.stencilFront.zFail,e.stencilFront.zPass,e.stencilBack.compare,e.stencilBack.fail,e.stencilBack.zFail,e.stencilBack.zPass]):null}const D=new b(R,e=>({__tag:"DepthWrite",...e}));function R(e){return e?w([e.zNear,e.zFar]):null}const B=new b(N,e=>({__tag:"ColorWrite",...e}));function N(e){return e?w([e.r,e.g,e.b,e.a]):null}const z=new b(H,e=>({__tag:"StencilWrite",...e}));function H(e){return e?w([e.mask]):null}const L=new b(function(e){return e?w([S(e.blending),C(e.culling),I(e.polygonOffset),O(e.depthTest),F(e.stencilTest),R(e.depthWrite),N(e.colorWrite),H(e.stencilWrite)]):null},e=>({blending:d(e.blending),culling:m(e.culling),polygonOffset:f(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:g(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:x(e.colorWrite),stencilWrite:_(e.stencilWrite)}));r.d(t,["RC",0,a,"T8",0,s,"Uy",0,{zNear:0,zFar:1},"Xt",0,e=>2===e?c:1===e?u:null,"iD",0,o,"kn",0,{r:!0,g:!0,b:!0,a:!0},"uR",0,l])},49788(e,t,r){const i=1/255.5,n=1-i;r.d(t,["Q",0,i,"v",0,n])}}]);