@arcgis/core 4.31.0-next.20240708 → 4.31.0-next.20240710

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 (239) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{0975e54c50383375cc09.js → 14cf7411e8318a1bccb9.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{71852b8437ec66b9ef06.js → 2123ab24163a532ebc8d.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{c91b3800cf3891bf2d59.js → 252ff37bf5e12dae0b18.js} +1 -1
  5. package/assets/esri/core/workers/chunks/2799007b5f3f4a2e364c.js +51 -0
  6. package/assets/esri/core/workers/chunks/{ff5e6d823d512f87a527.js → 2dddb8a989b9c96572fe.js} +1 -1
  7. package/assets/esri/core/workers/chunks/34b5bab6239c7277f854.js +1 -0
  8. package/assets/esri/core/workers/chunks/543f9db420c99d429637.js +1 -0
  9. package/assets/esri/core/workers/chunks/{5089a12084a8a8fb93d8.js → 61e5179fb49866241128.js} +1 -1
  10. package/assets/esri/core/workers/chunks/632e3ba2b8a881df29a0.js +1 -0
  11. package/assets/esri/core/workers/chunks/63eb1cc923bb8dcb3cb3.js +1 -0
  12. package/assets/esri/core/workers/chunks/{380e2654bc7e07163df0.js → 725a0eae5248a933db05.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{1cc4a89c96a36d6b3d52.js → 7767559d56d16b644655.js} +1 -1
  14. package/assets/esri/core/workers/chunks/7baf288a07401f9e972d.js +1 -0
  15. package/assets/esri/core/workers/chunks/{43e83f4d827f59ff556a.js → 8087288f00dfdcc479b9.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{a5fbe1c95e49093e5af4.js → 8cce4b218568638e6e64.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{c7e2a97cb7bcd153bcef.js → 8e326def543268f8a08e.js} +1 -1
  18. package/assets/esri/core/workers/chunks/92cb45b18e151db007dc.js +1 -0
  19. package/assets/esri/core/workers/chunks/b2e8cc76381077b78d4c.js +1 -0
  20. package/assets/esri/core/workers/chunks/b6a8132708afcd988fa9.js +1 -0
  21. package/assets/esri/core/workers/chunks/{b4d850e82a8ae902d684.js → c44cc686774ff53c0a94.js} +1 -1
  22. package/assets/esri/core/workers/chunks/c52701477405c1fb2072.js +1 -0
  23. package/assets/esri/core/workers/chunks/{9ed11b9202013ca001ee.js → cfc2a1858a8bbb284979.js} +2 -2
  24. package/assets/esri/core/workers/chunks/{9ed11b9202013ca001ee.js.LICENSE.txt → cfc2a1858a8bbb284979.js.LICENSE.txt} +1 -1
  25. package/assets/esri/core/workers/chunks/d9863289c69d2550cd49.js +1 -0
  26. package/assets/esri/core/workers/chunks/e1f4df3a5b0b31521b3c.js +1 -0
  27. package/assets/esri/core/workers/chunks/ee72a006e25e94a4cd4a.js +1039 -0
  28. package/assets/esri/core/workers/chunks/{61505947371cebab9cbe.js → fdebfe55cd097714ec11.js} +1 -1
  29. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +13 -18
  30. package/assets/esri/themes/dark/main.css +1 -1
  31. package/assets/esri/themes/light/main.css +1 -1
  32. package/assets/esri/themes/light/view.css +1 -1
  33. package/chunks/AtmosphereCompositing.glsl.js +6 -9
  34. package/chunks/BlendLayers.glsl.js +1 -7
  35. package/chunks/BlendWeights.glsl.js +81 -86
  36. package/chunks/Blur.glsl.js +1 -3
  37. package/chunks/ChapmanAtmosphere.glsl.js +3 -8
  38. package/chunks/CheckerBoard.glsl.js +3 -9
  39. package/chunks/Clouds.glsl.js +21 -10
  40. package/chunks/CloudsComposition.glsl.js +3 -7
  41. package/chunks/ColorMaterial.glsl.js +3 -9
  42. package/chunks/ComponentShader.glsl.js +41 -75
  43. package/chunks/Compositing.glsl.js +5 -7
  44. package/chunks/DefaultMaterial.glsl.js +68 -73
  45. package/chunks/EdgeDetect.glsl.js +29 -39
  46. package/chunks/EdgeShader.glsl.js +37 -60
  47. package/chunks/Fog.glsl.js +4 -9
  48. package/chunks/HUDCompositing.glsl.js +1 -3
  49. package/chunks/HUDMaterial.glsl.js +11 -20
  50. package/chunks/Heatmap.glsl.js +3 -11
  51. package/chunks/HeatmapDensity.glsl.js +12 -15
  52. package/chunks/HighlightApply.glsl.js +130 -174
  53. package/chunks/HighlightDownsample.glsl.js +29 -32
  54. package/chunks/ImageMaterial.glsl.js +11 -21
  55. package/chunks/LaserlinePath.glsl.js +6 -10
  56. package/chunks/Laserlines.glsl.js +8 -20
  57. package/chunks/LineCallout.glsl.js +91 -108
  58. package/chunks/LineMarker.glsl.js +62 -53
  59. package/chunks/Magnifier.glsl.js +4 -9
  60. package/chunks/MeasurementArrow.glsl.js +9 -15
  61. package/chunks/NativeLine.glsl.js +8 -12
  62. package/chunks/NoiseTextureAtlas.glsl.js +89 -86
  63. package/chunks/OITCompositing.glsl.js +8 -12
  64. package/chunks/OverlayCompositing.glsl.js +2 -4
  65. package/chunks/Path.glsl.js +31 -55
  66. package/chunks/Pattern.glsl.js +16 -20
  67. package/chunks/PointRenderer.glsl.js +39 -48
  68. package/chunks/Precipitation.glsl.js +22 -39
  69. package/chunks/RasterColorizer.glsl.js +25 -33
  70. package/chunks/RealisticTree.glsl.js +53 -65
  71. package/chunks/RibbonLine.glsl.js +31 -36
  72. package/chunks/SSAO.glsl.js +7 -10
  73. package/chunks/SSAOBlur.glsl.js +10 -14
  74. package/chunks/ShadedColorMaterial.glsl.js +12 -15
  75. package/chunks/ShadowCastAccumulate.glsl.js +6 -8
  76. package/chunks/ShadowCastVisualize.glsl.js +12 -18
  77. package/chunks/ShadowHighlight.glsl.js +49 -51
  78. package/chunks/SimpleAtmosphere.glsl.js +4 -13
  79. package/chunks/SlicePlaneMaterial.glsl.js +3 -7
  80. package/chunks/Stars.glsl.js +3 -7
  81. package/chunks/Terrain.glsl.js +20 -61
  82. package/chunks/TextureOnly.glsl.js +2 -4
  83. package/chunks/Viewshed.glsl.js +20 -38
  84. package/chunks/WaterSurface.glsl.js +34 -60
  85. package/core/accessorSupport/tracking.js +1 -1
  86. package/core/workers/registry.js +1 -1
  87. package/geometry/Circle.js +1 -1
  88. package/geometry/Polygon.js +1 -1
  89. package/geometry/Polyline.js +1 -1
  90. package/geometry/support/geodesicUtils.js +1 -1
  91. package/interfaces.d.ts +34 -4
  92. package/layers/WCSLayer.js +1 -1
  93. package/layers/mixins/ArcGISImageService.js +1 -1
  94. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  95. package/layers/support/SubtypeSublayer.js +1 -1
  96. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  97. package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
  98. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  99. package/package.json +3 -3
  100. package/support/revision.js +1 -1
  101. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  102. package/views/2d/engine/flow/styles/Particles.js +1 -1
  103. package/views/2d/engine/flow/styles/Streamlines.js +1 -1
  104. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  105. package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
  106. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  107. package/views/2d/engine/webgl/BitBlitRenderer.js +1 -1
  108. package/views/2d/engine/webgl/DefaultVertexAttributeLayouts.js +1 -1
  109. package/views/2d/engine/webgl/Mesh2D.js +1 -1
  110. package/views/2d/engine/webgl/Overlay.js +1 -1
  111. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  112. package/views/2d/engine/webgl/Utils.js +1 -1
  113. package/views/2d/engine/webgl/VertexStream.js +1 -1
  114. package/views/2d/engine/webgl/brushes/WGLBrushStencil.js +1 -1
  115. package/views/2d/engine/webgl/brushes/WGLBrushTileDebugInfo.js +1 -1
  116. package/views/2d/engine/webgl/brushes/WGLBrushVTLBackground.js +1 -1
  117. package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
  118. package/views/2d/engine/webgl/effects/highlight/HighlightRenderer.js +1 -1
  119. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  120. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  121. package/views/2d/engine/webgl/shaderGraph/ShaderBuilder2D.js +1 -1
  122. package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
  123. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  124. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  125. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  126. package/views/2d/layers/support/DebugOverlay.js +1 -1
  127. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  128. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  129. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  130. package/views/3d/environment/LocalAtmosphere.js +1 -1
  131. package/views/3d/environment/MarsAtmosphere.js +1 -1
  132. package/views/3d/environment/Precipitation.js +1 -1
  133. package/views/3d/environment/Stars.js +1 -1
  134. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  135. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  136. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  137. package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils.js +1 -1
  138. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  139. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  140. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  141. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  142. package/views/3d/layers/StreamLayerView3D.js +1 -1
  143. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  144. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  145. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +5 -0
  146. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +5 -0
  147. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +5 -0
  148. package/views/3d/layers/graphics/pipeline/PBFPointFeaturesView.js +5 -0
  149. package/views/3d/layers/graphics/pipeline/TestSymbol.js +5 -0
  150. package/views/3d/layers/graphics/pipeline/Tile.js +5 -0
  151. package/views/3d/layers/graphics/pipeline/Tile3DFetcher.js +5 -0
  152. package/views/3d/layers/graphics/pipeline/Tile3DProcessor.js +5 -0
  153. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  154. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  155. package/views/3d/layers/support/projectExtentUtils.js +1 -1
  156. package/views/3d/terrain/OverlayRenderer.js +1 -1
  157. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  158. package/views/3d/terrain/PatchRenderData.js +1 -1
  159. package/views/3d/terrain/TerrainRenderer.js +1 -1
  160. package/views/3d/terrain/TileCompositor.js +1 -1
  161. package/views/3d/webgl/ManagedFBObject.js +1 -1
  162. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  163. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  164. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  165. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js +3 -5
  166. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +3 -3
  167. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +29 -59
  168. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +6 -12
  169. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +11 -11
  170. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +1 -1
  171. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +4 -7
  172. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +1 -1
  173. package/views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js +6 -6
  174. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +4 -4
  175. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -4
  176. package/views/3d/webgl-engine/core/shaderLibrary/util/LocalFromScreenSpace.glsl.js +2 -2
  177. package/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js +1 -1
  178. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  179. package/views/3d/webgl-engine/effects/ScreenSpaceGeometry.js +1 -1
  180. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  181. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  182. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  183. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  184. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  185. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  186. package/views/3d/webgl-engine/effects/magnifier/MagnifierRenderNode.js +1 -1
  187. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  188. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  189. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  190. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  191. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  192. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  193. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  194. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  195. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  196. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  197. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  198. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  199. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  200. package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
  201. package/views/3d/webgl-engine/materials/DrawParameters.js +1 -1
  202. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  203. package/views/3d/webgl-engine/materials/renderers/VaoCache.js +1 -1
  204. package/views/3d/webgl-engine/shaders/Heatmap.glsl.js +1 -1
  205. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  206. package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +1 -1
  207. package/views/SceneView.js +1 -1
  208. package/views/draw/support/Box.js +1 -1
  209. package/views/interactive/tooltip/Tooltip.js +1 -1
  210. package/views/interactive/tooltip/fields/fields.js +1 -1
  211. package/views/webgl/RenderingContext.js +1 -1
  212. package/views/webgl/Util.js +1 -1
  213. package/views/webgl/VertexArrayObject.js +1 -1
  214. package/views/webgl/enums.js +1 -1
  215. package/views/webgl/heatmapTextureUtils.js +1 -1
  216. package/views/webgl/testDoublePrecisionArithmetic.js +1 -1
  217. package/views/webgl/testFloatBufferBlend.js +1 -1
  218. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  219. package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
  220. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  221. package/widgets/Feature/support/relatedFeatureUtils.js +1 -1
  222. package/widgets/FeatureForm.js +1 -1
  223. package/widgets/OrientedImageryViewer/constants.js +1 -1
  224. package/widgets/OrientedImageryViewer.js +1 -1
  225. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  226. package/widgets/UtilityNetworkTrace.js +1 -1
  227. package/widgets/support/TimezonePicker.js +1 -1
  228. package/assets/esri/core/workers/chunks/0cb2eb96ffb1dbed00eb.js +0 -1
  229. package/assets/esri/core/workers/chunks/0d6ed27fc9948f4ea061.js +0 -1
  230. package/assets/esri/core/workers/chunks/225b947ba4b2fcfd5630.js +0 -1
  231. package/assets/esri/core/workers/chunks/7c7c3068da3bf7467685.js +0 -1
  232. package/assets/esri/core/workers/chunks/812e18c65aa6e398c338.js +0 -1
  233. package/assets/esri/core/workers/chunks/85e5cdd723f68dec8c25.js +0 -1
  234. package/assets/esri/core/workers/chunks/a7e2ca5ede46395f0787.js +0 -1
  235. package/assets/esri/core/workers/chunks/aed0db145187d9eb52f2.js +0 -51
  236. package/assets/esri/core/workers/chunks/cf9a32a03b3d3b66effb.js +0 -1
  237. package/assets/esri/core/workers/chunks/d85c51abde781660b1f5.js +0 -1
  238. package/assets/esri/core/workers/chunks/e840e54455eb500b501d.js +0 -1098
  239. package/assets/esri/core/workers/chunks/fec53ce15ae52f8cb802.js +0 -1
@@ -1,1098 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5268],{28491:(e,t,r)=>{r.d(t,{D:()=>G,b:()=>V});var o=r(46686),i=r(32680),n=r(49255),a=r(76591),s=r(76597),l=r(82991),c=r(96336),d=r(10764),u=r(39014),h=r(53466),m=r(92700),f=r(72824),p=r(54154),v=r(9169),g=r(77695),_=r(3452),x=r(8881),T=r(98619),b=r(51343),y=r(62602),A=r(22393),E=r(59469),S=r(25618),M=r(51406),w=r(986),C=r(35093),O=r(11955),R=r(27950),I=r(20693),N=r(33079),P=r(71988),L=r(20304),H=r(2597),D=r(85977),B=r(63761),F=r(46540),z=r(60517);function V(e){const t=new D.N5,{vertex:r,fragment:V,varyings:G}=t;if((0,I.NB)(r,e),t.include(d.I),G.add("vpos","vec3"),t.include(w.A,e),t.include(l.BK,e),t.include(p.G,e),t.include(M.q2,e),e.output===n.V.Color){t.include(M.Sx,e),t.include(M.MU,e),t.include(M.O1,e),t.include(M.QM,e),(0,I.yu)(r,e),t.include(c.Y,e),t.include(s.d,e);const n=e.normalType===c.W.Attribute||e.normalType===c.W.Compressed;n&&e.offsetBackfaces&&t.include(i.M),t.include(g.W,e),t.include(f.Mh,e),e.instancedColor&&t.attributes.add(F.r.INSTANCECOLOR,"vec4"),G.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(o.oD,e),t.include(u.K,e),t.include(m.c,e),r.uniforms.add(new P.E("externalColor",(e=>e.externalColor))),G.add("vcolorExt","vec4"),e.multipassEnabled&&G.add("depth","float"),r.code.add(H.H`
2
- void main(void) {
3
- forwardNormalizedVertexColor();
4
- vcolorExt = externalColor;
5
- ${e.instancedColor?"vcolorExt *= instanceColor * 0.003921568627451;":""}
6
- vcolorExt *= vvColor();
7
- vcolorExt *= getSymbolColor();
8
- forwardColorMixMode();
9
-
10
- if (vcolorExt.a < ${H.H.float(C.Q)}) {
11
- gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
12
- } else {
13
- vpos = getVertexInLocalOriginSpace();
14
- vPositionLocal = vpos - view[3].xyz;
15
- vpos = subtractOrigin(vpos);
16
- ${n?H.H`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));`:""}
17
- vpos = addVerticalOffset(vpos, localOrigin);
18
- ${e.hasVertexTangents?"vTangent = dpTransformVertexTangent(tangent);":""}
19
- gl_Position = transformPosition(proj, view, vpos);
20
- ${n&&e.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
21
- }
22
-
23
- ${e.multipassEnabled?"depth = (view * vec4(vpos, 1.0)).z;":""}
24
- forwardLinearDepth();
25
- forwardTextureCoordinates();
26
- forwardColorUV();
27
- forwardNormalUV();
28
- forwardEmissiveUV();
29
- forwardOcclusionUV();
30
- forwardMetallicRoughnessUV();
31
- }
32
- `),t.include(x.kA,e),t.include(_.n,e),t.include(O.S,e),t.include(e.instancedDoublePrecision?S.G:S.Bz,e),t.include(b.Q,e),t.include(a.HQ,e),t.include(z.z,e),(0,I.yu)(V,e),V.uniforms.add(r.uniforms.get("localOrigin"),new N.t("ambient",(e=>e.ambient)),new N.t("diffuse",(e=>e.diffuse)),new L.m("opacity",(e=>e.opacity)),new L.m("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&V.uniforms.add(new B.N("tex",(e=>e.texture))),t.include(E._Z,e),t.include(A.c,e),V.include(R.N),t.include(y.r,e),(0,x.a8)(V),(0,x.eU)(V),(0,T.O4)(V),V.code.add(H.H`
33
- void main() {
34
- discardBySlice(vpos);
35
- ${e.multipassEnabled?"terrainDepthTest(depth);":""}
36
- ${e.hasColorTexture?H.H`
37
- vec4 texColor = texture(tex, ${e.hasColorTextureTransform?H.H`colorUV`:H.H`vuv0`});
38
- ${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
39
- discardOrAdjustAlpha(texColor);`:H.H`vec4 texColor = vec4(1.0);`}
40
- shadingParams.viewDirection = normalize(vpos - cameraPosition);
41
- ${e.normalType===c.W.ScreenDerivative?H.H`
42
- vec3 normal = screenDerivativeNormal(vPositionLocal);`:H.H`
43
- shadingParams.normalView = vNormalWorld;
44
- vec3 normal = shadingNormal(shadingParams);`}
45
- ${e.pbrMode===E.A9.Normal?"applyPBRFactors();":""}
46
- float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
47
-
48
- vec3 posWorld = vpos + localOrigin;
49
-
50
- float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
51
- float shadow = ${e.receiveShadows?"readShadowMap(vpos, linearDepth)":e.spherical?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
52
-
53
- vec3 matColor = max(ambient, diffuse);
54
- ${e.hasVertexColors?H.H`
55
- vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
56
- float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:H.H`
57
- vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
58
- float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
59
- ${e.hasNormalTexture?H.H`
60
- mat3 tangentSpace = ${e.hasVertexTangents?"computeTangentSpace(normal);":"computeTangentSpace(normal, vpos, vuv0);"}
61
- vec3 shadingNormal = computeTextureNormal(tangentSpace, ${e.hasNormalTextureTransform?H.H`normalUV`:"vuv0"});`:H.H`vec3 shadingNormal = normal;`}
62
- vec3 normalGround = ${e.spherical?H.H`normalize(posWorld);`:H.H`vec3(0.0, 0.0, 1.0);`}
63
-
64
- ${e.snowCover?H.H`
65
- float snow = smoothstep(0.5, 0.55, dot(normal, normalGround));
66
- albedo = mix(albedo, vec3(1), snow);
67
- shadingNormal = mix(shadingNormal, normal, snow);
68
- ssao = mix(ssao, 1.0, snow);`:""}
69
-
70
- vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
71
-
72
- ${e.pbrMode===E.A9.Normal||e.pbrMode===E.A9.Schematic?H.H`
73
- float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
74
- ${e.snowCover?H.H`
75
- mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);
76
- emission = mix(emission, vec3(0.0), snow);`:""}
77
-
78
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:H.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
79
- vec4 finalColor = vec4(shadedColor, opacity_);
80
- outputColorHighlightOID(finalColor, vpos);
81
- }
82
- `)}return t.include(v.E,e),t}const G=Object.freeze(Object.defineProperty({__proto__:null,build:V},Symbol.toStringTag,{value:"Module"}))},57323:(e,t,r)=>{r.d(t,{R:()=>B,b:()=>D});var o=r(46686),i=r(32680),n=r(49255),a=r(76591),s=r(76597),l=r(82991),c=r(96336),d=r(10764),u=r(39014),h=r(53466),m=r(92700),f=r(54154),p=r(9169),v=r(3452),g=r(8881),_=r(98619),x=r(51343),T=r(22393),b=r(59469),y=r(25618),A=r(986),E=r(35093),S=r(11955),M=r(27950),w=r(20693),C=r(33079),O=r(71988),R=r(20304),I=r(2597),N=r(85977),P=r(63761),L=r(46540),H=r(60517);function D(e){const t=new N.N5,{vertex:r,fragment:D,varyings:B}=t;return(0,w.NB)(r,e),t.include(d.I),B.add("vpos","vec3"),t.include(A.A,e),t.include(l.BK,e),t.include(f.G,e),e.output===n.V.Color&&((0,w.yu)(t.vertex,e),t.include(c.Y,e),t.include(s.d,e),e.offsetBackfaces&&t.include(i.M),e.instancedColor&&t.attributes.add(L.r.INSTANCECOLOR,"vec4"),B.add("vNormalWorld","vec3"),B.add("localvpos","vec3"),e.multipassEnabled&&B.add("depth","float"),t.include(h.U,e),t.include(o.oD,e),t.include(u.K,e),t.include(m.c,e),r.uniforms.add(new O.E("externalColor",(e=>e.externalColor))),B.add("vcolorExt","vec4"),r.code.add(I.H`
83
- void main(void) {
84
- forwardNormalizedVertexColor();
85
- vcolorExt = externalColor;
86
- ${e.instancedColor?"vcolorExt *= instanceColor * 0.003921568627451;":""}
87
- vcolorExt *= vvColor();
88
- vcolorExt *= getSymbolColor();
89
- forwardColorMixMode();
90
-
91
- if (vcolorExt.a < ${I.H.float(E.Q)}) {
92
- gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
93
- } else {
94
- vpos = getVertexInLocalOriginSpace();
95
- localvpos = vpos - view[3].xyz;
96
- vpos = subtractOrigin(vpos);
97
- vNormalWorld = dpNormal(vvLocalNormal(normalModel()));
98
- vpos = addVerticalOffset(vpos, localOrigin);
99
- gl_Position = transformPosition(proj, view, vpos);
100
- ${e.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
101
- }
102
- ${e.multipassEnabled?I.H`depth = (view * vec4(vpos, 1.0)).z;`:""}
103
- forwardLinearDepth();
104
- forwardTextureCoordinates();
105
- }
106
- `)),e.output===n.V.Color&&(t.include(g.kA,e),t.include(v.n,e),t.include(S.S,e),t.include(e.instancedDoublePrecision?y.G:y.Bz,e),t.include(x.Q,e),t.include(a.HQ,e),t.include(H.z,e),(0,w.yu)(t.fragment,e),(0,_.Gc)(D),(0,g.a8)(D),(0,g.eU)(D),D.uniforms.add(r.uniforms.get("localOrigin"),r.uniforms.get("view"),new C.t("ambient",(e=>e.ambient)),new C.t("diffuse",(e=>e.diffuse)),new R.m("opacity",(e=>e.opacity)),new R.m("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&D.uniforms.add(new P.N("tex",(e=>e.texture))),t.include(b._Z,e),t.include(T.c,e),D.include(M.N),(0,_.O4)(D),D.code.add(I.H`
107
- void main() {
108
- discardBySlice(vpos);
109
- ${e.multipassEnabled?I.H`terrainDepthTest(depth);`:""}
110
- ${e.hasColorTexture?I.H`
111
- vec4 texColor = texture(tex, ${e.hasColorTextureTransform?I.H`colorUV`:I.H`vuv0`});
112
- ${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
113
- discardOrAdjustAlpha(texColor);`:I.H`vec4 texColor = vec4(1.0);`}
114
- vec3 viewDirection = normalize(vpos - cameraPosition);
115
- ${e.pbrMode===b.A9.Normal?"applyPBRFactors();":""}
116
- float ssao = evaluateAmbientOcclusionInverse();
117
- ssao *= getBakedOcclusion();
118
-
119
- float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
120
- vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
121
- ${e.receiveShadows?"float shadow = readShadowMap(vpos, linearDepth);":e.spherical?"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow = 0.0;"}
122
- vec3 matColor = max(ambient, diffuse);
123
- ${e.hasVertexColors?I.H`
124
- vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
125
- float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:I.H`
126
- vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
127
- float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
128
- ${e.snowCover?I.H`albedo = mix(albedo, vec3(1), 0.9);`:I.H``}
129
- ${I.H`
130
- vec3 shadingNormal = normalize(vNormalWorld);
131
- albedo *= 1.2;
132
- vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
133
- float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
134
- float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0);
135
- float treeRadialFalloff = vColor.r;
136
- float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
137
- additionalLight += backLightFactor * mainLightIntensity;`}
138
- ${e.pbrMode===b.A9.Normal||e.pbrMode===b.A9.Schematic?e.spherical?I.H`vec3 normalGround = normalize(vpos + localOrigin);`:I.H`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:I.H``}
139
- ${e.pbrMode===b.A9.Normal||e.pbrMode===b.A9.Schematic?I.H`
140
- float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
141
- ${e.snowCover?I.H`
142
- mrr = vec3(0.0, 1.0, 0.04);
143
- emission = vec3(0.0);`:""}
144
-
145
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:I.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
146
- vec4 finalColor = vec4(shadedColor, opacity_);
147
- outputColorHighlightOID(finalColor, vpos);
148
- }
149
- `)),t.include(p.E,e),t}const B=Object.freeze(Object.defineProperty({__proto__:null,build:D},Symbol.toStringTag,{value:"Module"}))},15581:(e,t,r)=>{r.d(t,{S:()=>g,b:()=>f,g:()=>p});var o=r(37585),i=r(48163),n=r(82048),a=r(52540),s=r(34845),l=r(47286),c=r(20304),d=r(2597),u=r(85977),h=r(63761);const m=16;function f(){const e=new u.N5,t=e.fragment;return e.include(n.c),e.include(s.Ir),t.include(a.E),t.uniforms.add(new c.m("radius",((e,t)=>p(t.camera)))).code.add(d.H`vec3 sphere[16] = vec3[16](
150
- vec3(0.186937, 0.0, 0.0),
151
- vec3(0.700542, 0.0, 0.0),
152
- vec3(-0.864858, -0.481795, -0.111713),
153
- vec3(-0.624773, 0.102853, -0.730153),
154
- vec3(-0.387172, 0.260319, 0.007229),
155
- vec3(-0.222367, -0.642631, -0.707697),
156
- vec3(-0.01336, -0.014956, 0.169662),
157
- vec3(0.122575, 0.1544, -0.456944),
158
- vec3(-0.177141, 0.85997, -0.42346),
159
- vec3(-0.131631, 0.814545, 0.524355),
160
- vec3(-0.779469, 0.007991, 0.624833),
161
- vec3(0.308092, 0.209288,0.35969),
162
- vec3(0.359331, -0.184533, -0.377458),
163
- vec3(0.192633, -0.482999, -0.065284),
164
- vec3(0.233538, 0.293706, -0.055139),
165
- vec3(0.417709, -0.386701, 0.442449)
166
- );
167
- float fallOffFunction(float vv, float vn, float bias) {
168
- float f = max(radius * radius - vv, 0.0);
169
- return f * f * f * max(vn - bias, 0.0);
170
- }`),t.code.add(d.H`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) {
171
- vec3 v = Q - C;
172
- float vv = dot(v, v);
173
- float vn = dot(normalize(v), n_C);
174
- return fallOffFunction(vv, vn, 0.1);
175
- }`),t.uniforms.add(new h.N("normalMap",(e=>e.normalTexture)),new h.N("depthMap",(e=>e.depthTexture)),new c.m("projScale",(e=>e.projScale)),new h.N("rnm",(e=>e.noiseTexture)),new l.G("rnmScale",((e,t)=>(0,o.hZ)(v,t.camera.fullWidth/e.noiseTexture.descriptor.width,t.camera.fullHeight/e.noiseTexture.descriptor.height))),new c.m("intensity",(e=>e.intensity)),new l.G("screenSize",((e,t)=>(0,o.hZ)(v,t.camera.fullWidth,t.camera.fullHeight)))),e.outputs.add("fragOcclusion","float"),t.code.add(d.H`
176
- void main(void) {
177
- float depth = depthFromTexture(depthMap, uv);
178
-
179
- // Early out if depth is out of range, such as in the sky
180
- if (depth >= 1.0 || depth <= 0.0) {
181
- fragOcclusion = 1.0;
182
- return;
183
- }
184
-
185
- // get the normal of current fragment
186
- vec4 norm4 = texture(normalMap, uv);
187
- if(norm4.a != 1.0) {
188
- fragOcclusion = 1.0;
189
- return;
190
- }
191
- vec3 norm = vec3(-1.0) + 2.0 * norm4.xyz;
192
-
193
- float currentPixelDepth = linearizeDepth(depth);
194
- vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth);
195
-
196
- float sum = 0.0;
197
- vec3 tapPixelPos;
198
-
199
- vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0);
200
-
201
- // note: the factor 2.0 should not be necessary, but makes ssao much nicer.
202
- // bug or deviation from CE somewhere else?
203
- float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y);
204
-
205
- for(int i = 0; i < ${d.H.int(m)}; ++i) {
206
- vec2 unitOffset = reflect(sphere[i], fres).xy;
207
- vec2 offset = vec2(-unitOffset * radius * ps);
208
-
209
- // don't use current or very nearby samples
210
- if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){
211
- continue;
212
- }
213
-
214
- vec2 tc = vec2(gl_FragCoord.xy + offset);
215
- if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue;
216
- vec2 tcTap = tc / screenSize;
217
- float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap);
218
-
219
- tapPixelPos = reconstructPosition(tc, occluderFragmentDepth);
220
-
221
- sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos);
222
- }
223
-
224
- // output the result
225
- float A = max(1.0 - sum * intensity / float(${d.H.int(m)}), 0.0);
226
-
227
- // Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2
228
- A = (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2;
229
-
230
- fragOcclusion = A;
231
- }
232
- `),e}function p(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const v=(0,i.vt)(),g=Object.freeze(Object.defineProperty({__proto__:null,build:f,getRadius:p},Symbol.toStringTag,{value:"Module"}))},95774:(e,t,r)=>{r.d(t,{S:()=>f,b:()=>m});var o=r(38954),i=r(82048),n=r(52540),a=r(68259),s=r(20304),l=r(2597),c=r(85977),d=r(15976),u=r(63761);const h=4;function m(){const e=new c.N5,t=e.fragment;e.include(i.c);const r=(h+1)/2,m=1/(2*r*r);return t.include(n.E),t.uniforms.add(new u.N("depthMap",(e=>e.depthTexture)),new d.o("tex",(e=>e.colorTexture)),new a.t("blurSize",(e=>e.blurSize)),new s.m("projScale",((e,t)=>{const r=(0,o.p)(t.camera.eye,t.camera.center);return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale}))),t.code.add(l.H`
233
- void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
234
- float c = texture(tex, uv).r;
235
- float d = linearDepthFromTexture(depthMap, uv);
236
-
237
- float ddiff = d - center_d;
238
-
239
- float w = exp(-r * r * ${l.H.float(m)} - ddiff * ddiff * sharpness);
240
- wTotal += w;
241
- bTotal += w * c;
242
- }
243
- `),e.outputs.add("fragBlur","float"),t.code.add(l.H`
244
- void main(void) {
245
- float b = 0.0;
246
- float w_total = 0.0;
247
-
248
- float center_d = linearDepthFromTexture(depthMap, uv);
249
-
250
- float sharpness = -0.05 * projScale / center_d;
251
- for (int r = -${l.H.int(h)}; r <= ${l.H.int(h)}; ++r) {
252
- float rf = float(r);
253
- vec2 uvOffset = uv + rf * blurSize;
254
- blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
255
- }
256
-
257
- fragBlur = b / w_total;
258
- }
259
- `),e}const f=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}))},76412:(e,t,r)=>{r.d(t,{c:()=>p,d:()=>_,f:()=>b,g:()=>T,h:()=>x,k:()=>M,o:()=>P}),r(44208),r(53966);var o=r(34727),i=r(58083),n=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(34304),d=r(88582),u=r(71351),h=r(44280),m=r(32114);const f=p();function p(){return(0,l.vt)()}const v=s.e,g=s.e;function _(e,t){return(0,s.c)(t,e)}function x(e){return e[3]}function T(e){return e}function b(e,t,r,o){return(0,l.fA)(e,t,r,o)}function y(e,t,r){if(null==t)return!1;if(!E(e,t,A))return!1;let{t0:o,t1:i}=A;if((o<0||i<o&&i>0)&&(o=i),o<0)return!1;if(r){const{origin:e,direction:i}=t;r[0]=e[0]+i[0]*o,r[1]=e[1]+i[1]*o,r[2]=e[2]+i[2]*o}return!0}const A={t0:0,t1:0};function E(e,t,r){const{origin:o,direction:i}=t,n=S;n[0]=o[0]-e[0],n[1]=o[1]-e[1],n[2]=o[2]-e[2];const a=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(0===a)return!1;const s=2*(i[0]*n[0]+i[1]*n[1]+i[2]*n[2]),l=s*s-4*a*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-e[3]*e[3]);if(l<0)return!1;const c=Math.sqrt(l);return r.t0=(-s-c)/(2*a),r.t1=(-s+c)/(2*a),!0}const S=(0,a.vt)();function M(e,t){return y(e,t,null)}function w(e,t,r){const o=m.rq.get(),a=m.Rc.get();(0,n.b)(o,t.origin,t.direction);const s=x(e);(0,n.b)(r,o,t.origin),(0,n.j)(r,r,1/(0,n.l)(r)*s);const l=O(e,t.origin),c=(0,h.g7)(t.origin,r);return(0,i.$0)(a,c+l,o),(0,n.h)(r,r,a),r}function C(e,t,r){const o=(0,n.f)(m.rq.get(),t,e),i=(0,n.j)(m.rq.get(),o,e[3]/(0,n.l)(o));return(0,n.g)(r,i,e)}function O(e,t){const r=(0,n.f)(m.rq.get(),t,e),i=(0,n.l)(r),a=x(e),s=a+Math.abs(a-i);return(0,o.XM)(a/s)}const R=(0,a.vt)();function I(e,t,r,i){const a=(0,n.f)(R,t,e);switch(r){case d._.X:{const e=(0,o.jU)(a,R)[2];return(0,n.s)(i,-Math.sin(e),Math.cos(e),0)}case d._.Y:{const e=(0,o.jU)(a,R),t=e[1],r=e[2],s=Math.sin(t);return(0,n.s)(i,-s*Math.cos(r),-s*Math.sin(r),Math.cos(t))}case d._.Z:return(0,n.n)(i,a);default:return}}function N(e,t){const r=(0,n.f)(L,t,e);return(0,n.l)(r)-e[3]}function P(e,t){const r=(0,n.a)(e,t),o=x(e);return r<=o*o}const L=(0,a.vt)(),H=p();Object.freeze(Object.defineProperty({__proto__:null,NullSphere:f,altitudeAt:N,angleToSilhouette:O,axisAt:I,cameraFrustumCoverage:function(e,t,r,o){const i=x(e),n=i*i,a=t+.5*Math.PI,s=r*r+n-2*Math.cos(a)*r*i,l=Math.sqrt(s),c=s-n;if(c<=0)return.5;const d=Math.sqrt(c),u=Math.acos(d/l)-Math.asin(i/(l/Math.sin(a)));return Math.min(1,(u+.5*o)/o)},clear:function(e){e[0]=e[1]=e[2]=e[3]=0},closestPoint:function(e,t,r){return y(e,t,r)?r:((0,u.oC)(t,e,r),C(e,r,r))},closestPointOnSilhouette:w,containsPoint:P,copy:_,create:p,distanceToSilhouette:function(e,t){const r=(0,n.f)(m.rq.get(),t,e),o=(0,n.q)(r),i=e[3]*e[3];return Math.sqrt(Math.abs(o-i))},elevate:function(e,t,r){return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2]),r[3]=e[3]+t,r},equals:g,exactEquals:v,fromCenterAndRadius:function(e,t){return(0,l.fA)(e[0],e[1],e[2],t)},fromRadius:function(e,t){return e[0]=e[1]=e[2]=0,e[3]=t,e},fromValues:b,getCenter:T,getExtent:function(e,t){return t},getRadius:x,intersectLine:function(e,t,r){const o=(0,u.Cr)(t,r);if(!E(e,o,A))return[];const{origin:i,direction:s}=o,{t0:l,t1:d}=A,h=t=>{const r=(0,a.vt)();return(0,n.r)(r,i,s,t),C(e,r,r)};return Math.abs(l-d)<(0,c.FD)()?[h(l)]:[h(l),h(d)]},intersectRay:y,intersectRayClosestSilhouette:function(e,t,r){if(y(e,t,r))return r;const o=w(e,t,m.rq.get());return(0,n.g)(r,t.origin,(0,n.j)(m.rq.get(),t.direction,(0,n.p)(t.origin,o)/(0,n.l)(t.direction))),r},intersectsRay:M,projectPoint:C,setAltitudeAt:function(e,t,r,o){const i=N(e,t),a=I(e,t,d._.Z,L),s=(0,n.j)(L,a,r-i);return(0,n.g)(o,t,s)},setExtent:function(e,t,r){return e!==r&&_(e,r),r},tmpSphere:H,union:function(e,t,r=(0,l.vt)()){const o=(0,n.p)(e,t),i=e[3],a=t[3];return o+a<i?((0,s.c)(r,e),r):o+i<a?((0,s.c)(r,t),r):((0,n.o)(r,e,t,(o+a-i)/(2*o)),r[3]=(o+i+a)/2,r)},wrap:function(e){return e}},Symbol.toStringTag,{value:"Module"}))},43609:(e,t,r)=>{r.d(t,{a:()=>n,f:()=>a,n:()=>i});var o=r(34275);function i(e,t){n(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r=2,i=r){const n=t.length/2;let a=0,s=0;if((0,o.cy)(t)||(0,o.dk)(t)){for(let o=0;o<n;++o)e[a]=t[s],e[a+1]=t[s+1],a+=r,s+=i;return}const l=(0,o.a3)(t);if((0,o.JI)(t))for(let o=0;o<n;++o)e[a]=Math.max(t[s]/l,-1),e[a+1]=Math.max(t[s+1]/l,-1),a+=r,s+=i;else for(let o=0;o<n;++o)e[a]=t[s]/l,e[a+1]=t[s+1]/l,a+=r,s+=i}function a(e,t,r,o){const i=e.typedBuffer,n=e.typedBufferStride,a=o?.count??e.count;let s=(o?.dstIndex??0)*n;for(let e=0;e<a;++e)i[s]=t,i[s+1]=r,s+=n}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:n,normalizeIntegerBufferView:i},Symbol.toStringTag,{value:"Module"}))},73354:(e,t,r)=>{function o(e,t,r){i(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function i(e,t,r,o=3,i=o){if(e.length/o!==Math.ceil(t.length/i))return e;const n=e.length/o,a=r[0],s=r[1],l=r[2],c=r[4],d=r[5],u=r[6],h=r[8],m=r[9],f=r[10],p=r[12],v=r[13],g=r[14];let _=0,x=0;for(let r=0;r<n;r++){const r=t[_],n=t[_+1],T=t[_+2];e[x]=a*r+c*n+h*T+p,e[x+1]=s*r+d*n+m*T+v,e[x+2]=l*r+u*n+f*T+g,_+=i,x+=o}return e}function n(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,o=3,i=o){if(e.length/o!==Math.ceil(t.length/i))return;const n=e.length/o,a=r[0],s=r[1],l=r[2],c=r[3],d=r[4],u=r[5],h=r[6],m=r[7],f=r[8];let p=0,v=0;for(let r=0;r<n;r++){const r=t[p],n=t[p+1],g=t[p+2];e[v]=a*r+c*n+h*g,e[v+1]=s*r+d*n+m*g,e[v+2]=l*r+u*n+f*g,p+=i,v+=o}}function s(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function l(e,t,r,o=3,i=o){const n=Math.min(e.length/o,t.length/i);let a=0,s=0;for(let l=0;l<n;l++)e[s]=r*t[a],e[s+1]=r*t[a+1],e[s+2]=r*t[a+2],a+=i,s+=o;return e}function c(e,t,r,o=3,i=o){const n=e.length/o;if(n!==Math.ceil(t.length/i))return e;let a=0,s=0;for(let l=0;l<n;l++)e[s]=t[a]+r[0],e[s+1]=t[a+1]+r[1],e[s+2]=t[a+2]+r[2],a+=i,s+=o;return e}function d(e,t){u(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r=3,o=r){const i=Math.min(e.length/r,t.length/o);let n=0,a=0;for(let s=0;s<i;s++){const i=t[n],s=t[n+1],l=t[n+2],c=i*i+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*i,e[a+1]=t*s,e[a+2]=t*l}n+=o,a+=r}}r.d(t,{a:()=>i,b:()=>c,c:()=>n,d:()=>o,e:()=>d,f:()=>l,n:()=>u,s:()=>s,t:()=>a}),r(44208),r(53966),Object.freeze(Object.defineProperty({__proto__:null,normalize:u,normalizeView:d,scale:l,scaleView:s,shiftRight:function(e,t,r){const o=Math.min(e.count,t.count),i=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<o;e++)i[c]=a[l]>>r,i[c+1]=a[l+1]>>r,i[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:a,transformMat3View:n,transformMat4:i,transformMat4View:o,translate:c},Symbol.toStringTag,{value:"Module"}))},51737:(e,t,r)=>{function o(e,t){i(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function i(e,t,r=3,o=r){const i=t.length/o;let n=0,a=0;for(let s=0;s<i;++s)e[n]=t[a],e[n+1]=t[a+1],e[n+2]=t[a+2],n+=r,a+=o}function n(e,t,r,o,i){const n=e.typedBuffer,a=e.typedBufferStride,s=i?.count??e.count;let l=(i?.dstIndex??0)*a;for(let e=0;e<s;++e)n[l]=t,n[l+1]=r,n[l+2]=o,l+=a}r.d(t,{a:()=>o,c:()=>i,f:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,copy:i,copyView:o,fill:n},Symbol.toStringTag,{value:"Module"}))},65686:(e,t,r)=>{r.d(t,{a:()=>i,b:()=>l,n:()=>a,s:()=>s,t:()=>n}),r(44208);var o=r(53966);function i(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=4,i=o){if(e.length/o!=t.length/i)return;const n=e.length/o,a=r[0],s=r[1],l=r[2],c=r[3],d=r[4],u=r[5],h=r[6],m=r[7],f=r[8];let p=0,v=0;for(let r=0;r<n;r++){const r=t[p],n=t[p+1],g=t[p+2],_=t[p+3];e[v]=a*r+c*n+h*g,e[v+1]=s*r+d*n+m*g,e[v+2]=l*r+u*n+f*g,e[v+3]=_,p+=i,v+=o}}function a(e,t){const r=Math.min(e.count,t.count),o=e.typedBuffer,i=e.typedBufferStride,n=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*i,r=e*a,s=n[r],l=n[r+1],c=n[r+2],d=s*s+l*l+c*c;if(d>0){const e=1/Math.sqrt(d);o[t]=e*s,o[t+1]=e*l,o[t+2]=e*c}}}function s(e,t,r){l(e.typedBuffer,t,r,e.typedBufferStride)}function l(e,t,r,o=4){const i=Math.min(e.length/o,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<i;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],e[l+3]=r*n[s+3],s+=a,l+=o}Object.freeze(Object.defineProperty({__proto__:null,normalize:a,scale:l,scaleView:s,transformMat3:n,transformMat3View:i,transformMat4:function(e,t,r,i=4,n=i){if(e.length/i!=t.length/n)return void o.A.getLogger("esri.views.3d.support.buffer.math").error("source and destination buffers need to have the same number of elements");const a=e.length/i,s=r[0],l=r[1],c=r[2],d=r[3],u=r[4],h=r[5],m=r[6],f=r[7],p=r[8],v=r[9],g=r[10],_=r[11],x=r[12],T=r[13],b=r[14],y=r[15];let A=0,E=0;for(let r=0;r<a;r++){const r=t[A],o=t[A+1],a=t[A+2],S=t[A+3];e[E]=s*r+u*o+p*a+x*S,e[E+1]=l*r+h*o+v*a+T*S,e[E+2]=c*r+m*o+g*a+b*S,e[E+3]=d*r+f*o+_*a+y*S,A+=n,E+=i}},transformMat4View:function(e,t,r){if(e.count!==t.count)return;const o=e.count,i=r[0],n=r[1],a=r[2],s=r[3],l=r[4],c=r[5],d=r[6],u=r[7],h=r[8],m=r[9],f=r[10],p=r[11],v=r[12],g=r[13],_=r[14],x=r[15],T=e.typedBuffer,b=e.typedBufferStride,y=t.typedBuffer,A=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*b,r=e*A,o=y[r],E=y[r+1],S=y[r+2],M=y[r+3];T[t]=i*o+l*E+h*S+v*M,T[t+1]=n*o+c*E+m*S+g*M,T[t+2]=a*o+d*E+f*S+_*M,T[t+3]=s*o+u*E+p*S+x*M}}},Symbol.toStringTag,{value:"Module"}))},78358:(e,t,r)=>{function o(e,t){i(e.typedBuffer,t,e.typedBufferStride)}function i(e,t,r=4){const o=t.typedBuffer,i=t.typedBufferStride,n=t.count;let a=0,s=0;for(let t=0;t<n;++t)e[a]=o[s],e[a+1]=o[s+1],e[a+2]=o[s+2],e[a+3]=o[s+3],a+=r,s+=i}function n(e,t,r,o,i,n){const a=e.typedBuffer,s=e.typedBufferStride,l=n?.count??e.count;let c=(n?.dstIndex??0)*s;for(let e=0;e<l;++e)a[c]=t,a[c+1]=r,a[c+2]=o,a[c+3]=i,c+=s}r.d(t,{a:()=>i,c:()=>o,f:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,copy:i,copyView:o,fill:n},Symbol.toStringTag,{value:"Module"}))},4341:(e,t,r)=>{r.d(t,{I:()=>i});var o=r(26390);class i{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,o.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*n);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,n));e++)this._items.push(this._allocator())}}const n=1024},46140:(e,t,r)=>{r.d(t,{R:()=>i});var o=r(49186);let i=class e{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}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new o.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[i,n]=t.split("."),a=/^\s*\d+\s*$/;if(!i?.match||!a.test(i))throw new o.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!n?.match||!a.test(n))throw new o.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(i,10),l=parseInt(n,10);return new e(s,l,r)}}},61473:(e,t,r)=>{function o(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function i(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||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}r.d(t,{EM:()=>i,b5:()=>o});const n=/^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$/,n,a,/^jsapps\.esri\.com$/,s,l]},11964:(e,t,r)=>{r.d(t,{Cr:()=>c,H6:()=>h,_I:()=>u,kb:()=>d,vt:()=>l});var o=r(34727),i=r(4341),n=r(38954),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,r=l()){return(0,n.c)(r.origin,e),(0,n.f)(r.vector,t,e),r}function d(e,t){const r=(0,n.f)(s.rq.get(),t,e.origin),i=(0,n.m)(e.vector,r),a=(0,n.m)(e.vector,e.vector),l=(0,o.qE)(i/a,0,1),c=(0,n.f)(s.rq.get(),(0,n.j)(s.rq.get(),e.vector,l),r);return(0,n.m)(c,c)}function u(e,t,r){return h(e,t,0,1,r)}function h(e,t,r,i,a){const{vector:l,origin:c}=e,d=(0,n.f)(s.rq.get(),t,c),u=(0,n.m)(l,d)/(0,n.q)(l);return(0,n.j)(a,l,(0,o.qE)(u,r,i)),(0,n.g)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)(),new i.I((()=>l()))},71351:(e,t,r)=>{r.d(t,{Cr:()=>d,LV:()=>c,kb:()=>u,oC:()=>h,vt:()=>s}),r(4576);var o=r(4341),i=r(38954),n=r(51850),a=r(32114);function s(e){return e?l((0,n.o8)(e.origin),(0,n.o8)(e.direction)):l((0,n.vt)(),(0,n.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 d(e,t,r=s()){return(0,i.c)(r.origin,e),(0,i.f)(r.direction,t,e),r}function u(e,t){const r=(0,i.b)(a.rq.get(),(0,i.n)(a.rq.get(),e.direction),(0,i.f)(a.rq.get(),t,e.origin));return(0,i.m)(r,r)}function h(e,t,r){const o=(0,i.m)(e.direction,(0,i.f)(r,t,e.origin));return(0,i.g)(r,e.origin,(0,i.j)(r,e.direction,o)),r}const m=new o.I((()=>s()));(0,n.vt)()},21015:(e,t,r)=>{r.d(t,{R:()=>l});var o=r(78888),i=r(60999),n=r(49186),a=r(74887),s=r(84952);class l{constructor(e){this._streamDataRequester=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("binary",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){if(null==this._streamDataRequester)return(await(0,o.A)(t,{responseType:c[e]})).data;const s=await(0,i.Ke)(this._streamDataRequester.request(t,e,r));if(!0===s.ok)return s.value;throw(0,a.QP)(s.error),new n.A("",`Request for resource failed: ${s.error}`)}}const c={image:"image",binary:"array-buffer",json:"json","image+type":void 0}},84498:(e,t,r)=>{r.d(t,{x:()=>a});var o=r(34275),i=r(97146),n=r(63907);function a(e,t){switch(t){case n.WR.TRIANGLES:return"number"==typeof(r=e)?(0,i.tM)(r):(0,o.mg)(r)?new Uint16Array(r):r;case n.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,o=(0,i.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(o[e++]=t,o[e++]=t+1,o[e++]=t+2):(o[e++]=t+1,o[e++]=t,o[e++]=t+2)}else{let t=0;for(let i=0;i<r;i+=1)i%2==0?(o[t++]=e[i],o[t++]=e[i+1],o[t++]=e[i+2]):(o[t++]=e[i+1],o[t++]=e[i],o[t++]=e[i+2])}return o}(e);case n.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,o=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)o[e++]=0,o[e++]=t+1,o[e++]=t+2;return o}const i=e[0];let n=e[1],a=0;for(let t=0;t<r;++t){const r=e[t+2];o[a++]=i,o[a++]=n,o[a++]=r,n=r}return o}(e)}var r}},51530:(e,t,r)=>{r.d(t,{KB:()=>s,Xi:()=>n,pn:()=>l,x3:()=>a});var o=r(44208),i=r(89192);class n{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding=i.JS.KTX2_ENCODING}}function a(e){return"encoded-mesh-texture"===e?.type}async function s(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function l(e,t){if(t===i.JS.KTX2_ENCODING)return new n(e);const r=new Blob([e],{type:t}),a=URL.createObjectURL(r),s=new Image;if((0,o.A)("esri-iPhone"))return new Promise(((e,t)=>{const r=()=>{i(),e(s)},o=e=>{i(),t(e)},i=()=>{URL.revokeObjectURL(a),s.removeEventListener("load",r),s.removeEventListener("error",o)};s.addEventListener("load",r),s.addEventListener("error",o),s.src=a}));try{s.src=a,await s.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(a),s}},55268:(e,t,r)=>{r.d(t,{fetch:()=>Sr});var o=r(61473),i=r(34727),n=r(77690),a=r(29242),s=r(58083),l=r(9093),c=r(48163),d=r(38954),u=r(51850),h=r(70328),m=r(11868),f=r(13030),p=r(73354),v=r(65686),g=r(43609),_=r(51737),x=r(78358),T=r(21015),b=r(84498),y=r(51530),A=r(88340);function E(e){if(null==e)return null;const t=null!=e.offset?e.offset:A.uY,r=null!=e.rotation?e.rotation:0,o=null!=e.scale?e.scale:A.Un,i=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.fA)(o[0],0,0,0,o[1],0,0,0,1),c=(0,a.vt)();return(0,n.lw)(c,s,l),(0,n.lw)(c,i,c),c}class S{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class M{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new S,this.numberOfVertices=0}}var w=r(78888),C=r(60999),O=r(86805),R=r(49186),I=r(53966);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const o=this._outer.get(e);o?o.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))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}forAll(e){for(const t of this._outer.values())for(const r of t.values())e(r)}}var P=r(74887),L=r(46140),H=r(97146);async function D(e,t){const{data:r}=await(0,w.A)(e,{responseType:"image",...t});return r}var B=r(46610),F=r(89192),z=r(34275);function V(e){if(e.length<z.y9)return Array.from(e);if((0,z.cy)(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.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var G=r(3694),U=r(620);class W{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,U.vA)(e.length>=1),(0,U.vA)(3===r.size||4===r.size);const{data:o,size:i,indices:n}=r;(0,U.vA)(n.length%this._numIndexPerPrimitive==0),(0,U.vA)(n.length>=e.length*this._numIndexPerPrimitive);const a=e.length;let s=i*n[this._numIndexPerPrimitive*e[0]];j.clear(),j.push(s);const l=(0,u.fA)(o[s],o[s+1],o[s+2]),c=(0,u.o8)(l);for(let t=0;t<a;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=i*n[r+e],j.push(s);let t=o[s];l[0]=Math.min(t,l[0]),c[0]=Math.max(t,c[0]),t=o[s+1],l[1]=Math.min(t,l[1]),c[1]=Math.max(t,c[1]),t=o[s+2],l[2]=Math.min(t,l[2]),c[2]=Math.max(t,c[2])}}this.bbMin=l,this.bbMax=c;const h=(0,d.o)((0,u.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(c[0]-l[0],c[1]-l[1]),c[2]-l[2]);let m=this.radius*this.radius;for(let e=0;e<j.length;++e){s=j.at(e);const t=o[s]-h[0],r=o[s+1]-h[1],i=o[s+2]-h[2],n=t*t+r*r+i*i;if(n<=m)continue;const a=Math.sqrt(n),l=.5*(a-this.radius);this.radius=this.radius+l,m=this.radius*this.radius;const c=l/a;h[0]+=t*c,h[1]+=r*c,h[2]+=i*c}this.center=h,j.clear()}getChildren(){if(this._children||(0,d.a)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,d.o)((0,u.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),o=new Array(8);for(let e=0;e<8;++e)o[e]=0;const{data:i,size:n,indices:a}=this.position;for(let s=0;s<t;++s){let t=0;const l=this._numIndexPerPrimitive*this.primitiveIndices[s];let c=n*a[l],d=i[c],u=i[c+1],h=i[c+2];for(let e=1;e<this._numIndexPerPrimitive;++e){c=n*a[l+e];const t=i[c],r=i[c+1],o=i[c+2];t<d&&(d=t),r<u&&(u=r),o<h&&(h=o)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[s]=t,++o[t]}let s=0;for(let e=0;e<8;++e)o[e]>0&&++s;if(s<2)return;const l=new Array(8);for(let e=0;e<8;++e)l[e]=o[e]>0?new Uint32Array(o[e]):void 0;for(let e=0;e<8;++e)o[e]=0;for(let e=0;e<t;++e){const t=r[e];l[t][o[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==l[e]&&this._children.push(new W(l[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){j.prune()}}const j=new G.A({deallocator:null});var q=r(69720),k=r(96672),$=r(4341),Y=r(11964);function X(e,t,r){return(0,d.f)(Z,t,e),(0,d.f)(J,r,e),.5*(0,d.l)((0,d.b)(Z,Z,J))}r(32114),new $.I(Y.vt),new $.I((()=>{return e?{p0:(0,u.o8)(e.p0),p1:(0,u.o8)(e.p1),p2:(0,u.o8)(e.p2)}:{p0:(0,u.vt)(),p1:(0,u.vt)(),p2:(0,u.vt)()};var e}));const Z=(0,u.vt)(),J=(0,u.vt)(),K=(0,u.vt)(),Q=(0,u.vt)(),ee=(0,u.vt)(),te=(0,u.vt)();var re=r(24326);class oe{constructor(e){this.channel=e,this.id=(0,re.c)()}}var ie=r(46540);r(28449),(0,u.vt)(),new Float32Array(6);class ne extends q.J{constructor(e,t,r=null,o=k.X.Mesh,i=null,n=-1){super(),this.material=e,this.mapPositions=r,this.type=o,this.objectAndLayerIdColor=i,this.edgeIndicesLength=n,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,H.Dg)(r.indices)}),e===ie.r.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new ne(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);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}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:V(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r&&this._attributes.set(e,{...r,exclusive:!0,data:t})}get indexCount(){const e=this._attributes.values().next().value.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===k.X.Mesh?this._computeAttachmentOriginTriangles(e):this.type===k.X.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,d.h)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:o,indices:i}=e;(0,d.s)(t,0,0,0),(0,d.s)(te,0,0,0);let n=0,a=0;for(let e=0;e<i.length-2;e+=3){const s=i[e]*r,l=i[e+1]*r,c=i[e+2]*r;(0,d.s)(K,o[s],o[s+1],o[s+2]),(0,d.s)(Q,o[l],o[l+1],o[l+2]),(0,d.s)(ee,o[c],o[c+1],o[c+2]);const u=X(K,Q,ee);u?((0,d.g)(K,K,Q),(0,d.g)(K,K,ee),(0,d.j)(K,K,1/3*u),(0,d.g)(t,t,K),n+=u):((0,d.g)(te,te,K),(0,d.g)(te,te,Q),(0,d.g)(te,te,ee),a+=3)}return!(0===a&&0===n||(0!==n?((0,d.j)(t,t,1/n),0):0===a||((0,d.j)(t,te,1/a),0)))}(this.attributes.get(ie.r.POSITION),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(ie.r.POSITION);return function(e,t,r){if(!e)return!1;(0,d.s)(r,0,0,0),(0,d.s)(te,0,0,0);let o=0,i=0;const{size:n,data:a,indices:s}=e,l=s.length-1,c=l+(t?2:0);for(let e=0;e<c;e+=2){const t=e<l?e+1:0,c=s[e<l?e:l]*n,u=s[t]*n;K[0]=a[c],K[1]=a[c+1],K[2]=a[c+2],Q[0]=a[u],Q[1]=a[u+1],Q[2]=a[u+2],(0,d.j)(K,(0,d.g)(K,K,Q),.5);const h=(0,d.F)(K,Q);h>0?((0,d.g)(r,r,(0,d.j)(K,K,h)),o+=h):0===o&&((0,d.g)(te,te,K),i++)}return 0!==o?((0,d.j)(r,r,1/o),!0):0!==i&&((0,d.j)(r,te,1/i),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:o,indices:i}=e;(0,d.s)(t,0,0,0);let n=-1,a=0;for(let e=0;e<i.length;e++){const s=i[e]*r;n!==s&&(t[0]+=o[s],t[1]+=o[s+1],t[2]+=o[s+2],a++),n=s}return a>1&&(0,d.j)(t,t,1/a),a>0}(this.attributes.get(ie.r.POSITION),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(ie.r.POSITION);if(!e||0===e.indices.length)return null;const t=this.type===k.X.Mesh?3:1;(0,U.vA)(e.indices.length%t==0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,H.tM)(e.indices.length/t);return new W(r,t,e)}get transformation(){return this._transformation??l.zK}set transformation(e){this._transformation=e&&e!==l.zK?(0,l.o8)(e):null}addHighlight(){const e=new oe(F.Mg.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}var ae=r(44208),se=r(65529),le=r(97768),ce=r(84952),de=r(56058),ue=r(2741);let he;var me,fe;(fe=me||(me={}))[fe.ETC1_RGB=0]="ETC1_RGB",fe[fe.ETC2_RGBA=1]="ETC2_RGBA",fe[fe.BC1_RGB=2]="BC1_RGB",fe[fe.BC3_RGBA=3]="BC3_RGBA",fe[fe.BC4_R=4]="BC4_R",fe[fe.BC5_RG=5]="BC5_RG",fe[fe.BC7_M6_RGB=6]="BC7_M6_RGB",fe[fe.BC7_M5_RGBA=7]="BC7_M5_RGBA",fe[fe.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",fe[fe.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",fe[fe.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",fe[fe.ATC_RGB=11]="ATC_RGB",fe[fe.ATC_RGBA=12]="ATC_RGBA",fe[fe.FXT1_RGB=17]="FXT1_RGB",fe[fe.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",fe[fe.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",fe[fe.ETC2_EAC_R11=20]="ETC2_EAC_R11",fe[fe.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",fe[fe.RGBA32=13]="RGBA32",fe[fe.RGB565=14]="RGB565",fe[fe.BGR565=15]="BGR565",fe[fe.RGBA4444=16]="RGBA4444";var pe=r(63907),ve=r(21231),ge=r(42293);let _e=null,xe=null;async function Te(){return null==xe&&(he??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,ue.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),xe=he,_e=await xe),xe}function be(e,t,r,o,i){const n=(0,ge.IB)(t?pe.CQ.COMPRESSED_RGBA8_ETC2_EAC:pe.CQ.COMPRESSED_RGB8_ETC2),a=i&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*o*n*a)}function ye(e){return e.getNumImages()>=1&&!e.isUASTC()}function Ae(e){return e.getFaces()>=1&&e.isETC1S()}function Ee(e,t,r,o,i,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?o?[me.ETC2_RGBA,pe.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[me.ETC1_RGB,pe.CQ.COMPRESSED_RGB8_ETC2]:c?o?[me.BC3_RGBA,pe.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[me.BC1_RGB,pe.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[me.RGBA32,pe.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.width=i,t.height=n,new ve.g(e,t,{type:"compressed",levels:m})}const Se=()=>I.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function Me(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const we=Me("DXT1"),Ce=Me("DXT3"),Oe=Me("DXT5");function Re(e,t,r){if(e instanceof ImageData)return Re(Ie(e),t,r);const o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(e,0,0,o.width,o.height),o}function Ie(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new R.A("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}var Ne,Pe,Le=r(67171);class He extends q.J{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=k.X.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new se.A,this._parameters={...Be,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,ce.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,ce.DB)(e.src)||(0,ce.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new Le.R;return t.wrapMode=this._parameters.wrap??pe.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,z.mw)(e)||(0,z.mg)(e))return t.encoding===F.JS.KTX2_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.KTX2File(new Uint8Array(e)),o=Ae(r)?be(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),o}(e,!!t.mipmap):t.encoding===F.JS.BASIS_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.BasisFile(new Uint8Array(e)),o=ye(r)?be(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),o}(e,!!t.mipmap):e.byteLength;const{width:r,height:o}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?De(e):t;return(t.mipmap?4/3:1)*r*o*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new ve.g(e,this._createDescriptor(e),null),this._glTexture):(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.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.DDS_ENCODING?this._loadFromDDSData(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,z.mg)(t)?this._loadFromPixelData(e,t):(0,z.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<Ne.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const o=function(e,t){const r=new Int32Array(e,0,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 o=r[21];let i,n;switch(o){case we:i=8,n=pe.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ce:i=16,n=pe.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Oe:i=16,n=pe.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)}(o)),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,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*i,u=new Uint8Array(e,m,h),f.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:n,width:c,height:d}}(r,t.hasMipmap??!1);if(null==o)throw new Error("DDS texture data is null");const{textureData:i,internalFormat:n,width:a,height:s}=o;return t.samplingMode=i.levels.length>1?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new ve.g(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await Te());const o=new _e.KTX2File(new Uint8Array(r));if(!Ae(o))return null;o.startTranscoding();const i=Ee(e,t,o.getLevels(),o.getHasAlpha(),o.getWidth(),o.getHeight(),((e,t)=>o.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>o.transcodeImage(r,e,0,0,t,0,-1,-1)));return o.close(),o.delete(),i}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await Te());const o=new _e.BasisFile(new Uint8Array(r));if(!ye(o))return null;o.startTranscoding();const i=Ee(e,t,o.getNumLevels(0),o.getHasAlpha(),o.getImageWidth(0,0),o.getImageHeight(0,0),((e,t)=>o.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>o.transcodeImage(r,0,e,t,0,0)));return o.close(),o.delete(),i}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,U.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?pe.Ab.LUMINANCE:3===this._parameters.components?pe.Ab.RGB:pe.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new ve.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const o=await D(t,{signal:r});return(0,P.Te)(r),this._loadFromImage(e,o)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const o=await(0,de.Sx)(t,t.src,!1,r);return(0,P.Te)(r),this._loadFromImage(e,o)}))}_loadFromVideoElement(e,t){return t.readyState>=Ne.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((o,i)=>{const n=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,le.xt)(l)},a=()=>{t.readyState>=Ne.HAVE_CURRENT_DATA&&(n(),o(this._loadFromImage(e,t)))},s=e=>{n(),i(e||new R.A("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,P.u7)(r,(()=>s((0,P.NK)())))}))))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:t}=e.parameters;r=this._parameters.downsampleUncompressed?function(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?Ie(e):e;let o=e.width,i=e.height;do{o=Math.ceil(o/2),i=Math.ceil(i/2),r=o*i}while(r>1048576||null!=t&&(o>t||i>t));return Re(e,o,i)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const o=t/r;return Re(e,Math.round(e.width*o),Math.round(e.height*o))}(r,t)}const o=De(r);this._parameters.width=o.width,this._parameters.height=o.height;const i=this._createDescriptor(e);return i.pixelFormat=3===this._parameters.components?pe.Ab.RGB:pe.Ab.RGBA,i.width=o.width,i.height=o.height,this._glTexture=new ve.g(e,i,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const o=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(o,o),r}unload(){if(this._glTexture=(0,le.WD)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function De(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(Pe=Ne||(Ne={}))[Pe.HAVE_NOTHING=0]="HAVE_NOTHING",Pe[Pe.HAVE_METADATA=1]="HAVE_METADATA",Pe[Pe.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Pe[Pe.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Pe[Pe.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const Be={wrap:{s:pe.pF.REPEAT,t:pe.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Fe=r(24151),ze=r(1843),Ve=r(49255),Ge=r(96336),Ue=r(62602),We=r(59469),je=r(35093),qe=r(25634),ke=r(14903),$e=r(14327),Ye=r(90644);const Xe=(0,Ye.p3)(pe.dn.SRC_ALPHA,pe.dn.ONE,pe.dn.ONE_MINUS_SRC_ALPHA,pe.dn.ONE_MINUS_SRC_ALPHA),Ze=(0,Ye.p3)(pe.dn.ONE,pe.dn.ZERO,pe.dn.ONE,pe.dn.ONE_MINUS_SRC_ALPHA);function Je(e){switch(e){case $e.y.NONE:return Xe;case $e.y.ColorAlpha:return Ze;case $e.y.FrontFace:case $e.y.COUNT:return null}}const Ke={factor:-1,units:-2};function Qe(e,t=pe.MT.LESS){return e===$e.y.NONE||e===$e.y.FrontFace?t:pe.MT.LEQUAL}function et(e){return e===$e.y.ColorAlpha?{buffers:[pe.Nm.COLOR_ATTACHMENT0,pe.Nm.COLOR_ATTACHMENT1]}:null}class tt{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const rt=(0,h.vt)();function ot(e,t,r,o,i,n){if(!e.visible)return;const a=(0,d.z)(vt,o,r),s=(e,t,r)=>{n(e,r,t,!1)},l=new tt(!1,t.options.normalRequired);if(e.boundingInfo){(0,U.vA)(e.type===k.X.Mesh);const o=t.tolerance;nt(e.boundingInfo,r,a,o,i,l,s)}else{const t=e.attributes.get(ie.r.POSITION),o=t.indices;!function(e,t,r,o,i,n,a,s,l,c){const u=t,h=gt,m=Math.abs(u[0]),f=Math.abs(u[1]),p=Math.abs(u[2]),v=m>=f?m>=p?0:2:f>=p?1:2,g=v,_=u[g]<0?2:1,x=(v+_)%3,T=(v+(3-_))%3,b=u[x]/u[g],y=u[T]/u[g],A=1/u[g],E=st,S=lt,M=ct,{normalRequired:w}=l;for(let t=r;t<o;++t){const r=3*t,o=a*i[r];(0,d.s)(h[0],n[o+0],n[o+1],n[o+2]);const l=a*i[r+1];(0,d.s)(h[1],n[l+0],n[l+1],n[l+2]);const u=a*i[r+2];(0,d.s)(h[2],n[u+0],n[u+1],n[u+2]),s&&((0,d.c)(h[0],s.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,d.c)(h[1],s.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,d.c)(h[2],s.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,d.z)(E,h[0],e),(0,d.z)(S,h[1],e),(0,d.z)(M,h[2],e);const m=E[x]-b*E[g],f=E[T]-y*E[g],p=S[x]-b*S[g],v=S[T]-y*S[g],_=M[x]-b*M[g],C=M[T]-y*M[g],O=_*v-C*p,R=m*C-f*_,I=p*f-v*m;if((O<0||R<0||I<0)&&(O>0||R>0||I>0))continue;const N=O+R+I;if(0===N)continue;const P=O*(A*E[g])+R*(A*S[g])+I*(A*M[g]);if(P*Math.sign(N)<0)continue;const L=P/N;L>=0&&c(L,t,w?ut(h):null)}}(r,a,0,o.length/3,o,t.data,t.stride,i,l,s)}}const it=(0,u.vt)();function nt(e,t,r,o,i,n,a){if(null==e)return;const s=function(e,t){return(0,d.s)(t,1/e[0],1/e[1],1/e[2])}(r,it);if((0,h.Ne)(rt,e.bbMin),(0,h.vI)(rt,e.bbMax),null!=i&&i.applyToAabb(rt),function(e,t,r,o){return function(e,t,r,o,i){const n=(e[0]-o-t[0])*r[0],a=(e[3]+o-t[0])*r[0];let s=Math.min(n,a),l=Math.max(n,a);const c=(e[1]-o-t[1])*r[1],d=(e[4]+o-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-o-t[2])*r[2],h=(e[5]+o-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,o)}(rt,t,s,o)){const{primitiveIndices:s,position:l}=e,c=s?s.length:l.indices.length/3;if(c>ft){const s=e.getChildren();if(void 0!==s){for(const e of s)nt(e,t,r,o,i,n,a);return}}!function(e,t,r,o,i,n,a,s,l,c,d){const u=e[0],h=e[1],m=e[2],f=t[0],p=t[1],v=t[2],{normalRequired:g}=c;for(let e=0;e<o;++e){const t=s[e],r=3*t,o=a*i[r];let c=n[o],_=n[o+1],x=n[o+2];const T=a*i[r+1];let b=n[T],y=n[T+1],A=n[T+2];const E=a*i[r+2];let S=n[E],M=n[E+1],w=n[E+2];null!=l&&([c,_,x]=l.applyToVertex(c,_,x,e),[b,y,A]=l.applyToVertex(b,y,A,e),[S,M,w]=l.applyToVertex(S,M,w,e));const C=b-c,O=y-_,R=A-x,I=S-c,N=M-_,P=w-x,L=p*P-N*v,H=v*I-P*f,D=f*N-I*p,B=C*L+O*H+R*D;if(Math.abs(B)<=pt)continue;const F=u-c,z=h-_,V=m-x,G=F*L+z*H+V*D;if(B>0){if(G<0||G>B)continue}else if(G>0||G<B)continue;const U=z*R-O*V,W=V*C-R*F,j=F*O-C*z,q=f*U+p*W+v*j;if(B>0){if(q<0||G+q>B)continue}else if(q>0||G+q<B)continue;const k=(I*U+N*W+P*j)/B;k>=0&&d(k,t,g?dt(C,O,R,I,N,P,at):null)}}(t,r,0,c,l.indices,l.data,l.stride,s,i,n,a)}}const at=(0,u.vt)();const st=(0,u.vt)(),lt=(0,u.vt)(),ct=(0,u.vt)();function dt(e,t,r,o,i,n,a){return(0,d.s)(ht,e,t,r),(0,d.s)(mt,o,i,n),(0,d.b)(a,ht,mt),(0,d.n)(a,a),a}function ut(e){return(0,d.z)(ht,e[1],e[0]),(0,d.z)(mt,e[2],e[0]),(0,d.b)(at,ht,mt),(0,d.n)(at,at),at}const ht=(0,u.vt)(),mt=(0,u.vt)(),ft=1e3,pt=1e-7,vt=(0,u.vt)(),gt=[(0,u.vt)(),(0,u.vt)(),(0,u.vt)()];var _t,xt;(xt=_t||(_t={}))[xt.INTEGRATED_MESH=0]="INTEGRATED_MESH",xt[xt.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",xt[xt.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",xt[xt.OPAQUE_NO_SSAO_DEPTH=3]="OPAQUE_NO_SSAO_DEPTH",xt[xt.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",xt[xt.TRANSPARENT_NO_SSAO_DEPTH=5]="TRANSPARENT_NO_SSAO_DEPTH",xt[xt.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",xt[xt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=7]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",xt[xt.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",xt[xt.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",xt[xt.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",xt[xt.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",xt[xt.OPAQUE_ENVIRONMENT=12]="OPAQUE_ENVIRONMENT",xt[xt.TRANSPARENT_ENVIRONMENT=13]="TRANSPARENT_ENVIRONMENT",xt[xt.HUD_MATERIAL=14]="HUD_MATERIAL",xt[xt.LABEL_MATERIAL=15]="LABEL_MATERIAL",xt[xt.LINE_CALLOUTS=16]="LINE_CALLOUTS",xt[xt.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",xt[xt.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",xt[xt.DRAPED_WATER=19]="DRAPED_WATER",xt[xt.VIEWSHED=20]="VIEWSHED",xt[xt.VOXEL=21]="VOXEL",xt[xt.MAX_SLOTS=22]="MAX_SLOTS";var Tt=r(76412),bt=r(57005);const yt=new class{constructor(e=0){this.offset=e,this.sphere=(0,Tt.c)(),this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const o=this.objectTransform.transform,i=(0,d.s)(At,e,t,r),n=(0,d.h)(i,i,o),a=this.offset/(0,d.l)(n);(0,d.r)(n,n,n,a);const s=this.objectTransform.inverse;return(0,d.h)(this.tmpVertex,n,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,d.l)(e);(0,d.r)(e,e,e,r);const o=this.offset/(0,d.l)(t);(0,d.r)(t,t,t,o)}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=(0,d.l)((0,Tt.g)(e)),r=this.offset/t;return(0,d.r)((0,Tt.g)(this.sphere),(0,Tt.g)(e),(0,Tt.g)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,u.vt)(),this._tmpMbs=(0,Tt.c)(),this._tmpObb=new bt.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,d.l)(e)}applyToVertex(e,t,r){const o=(0,d.s)(At,e,t,r),i=(0,d.s)(Et,e,t,r+this.componentLocalOriginLength),n=this._totalOffset/(0,d.l)(i);return(0,d.r)(this._tmpVertex,o,i,n),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],o=e[1],i=e[2]+t,n=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(o),d=Math.abs(i),u=Math.abs(n),h=Math.abs(a),m=Math.abs(s),f=.5*(1+Math.sign(r*n))*Math.min(l,u),p=.5*(1+Math.sign(o*a))*Math.min(c,h),v=.5*(1+Math.sign(i*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,m),T=Math.sqrt(f*f+p*p+v*v),b=Math.sign(l+r),y=Math.sign(c+o),A=Math.sign(d+i),E=Math.sign(u+n),S=Math.sign(h+a),M=Math.sign(m+s),w=this._totalOffset;if(T<w)return e[0]-=(1-b)*w,e[1]-=(1-y)*w,e[2]-=(1-A)*w,e[3]+=E*w,e[4]+=S*w,e[5]+=M*w,e;const C=w/Math.sqrt(g*g+_*_+x*x),O=w/T,R=O-C,I=-R;return e[0]+=r*(b*I+O),e[1]+=o*(y*I+O),e[2]+=i*(A*I+O),e[3]+=n*(E*R+C),e[4]+=a*(S*R+C),e[5]+=s*(M*R+C),e}applyToMbs(e){const t=(0,d.l)((0,Tt.g)(e)),r=this._totalOffset/t;return(0,d.r)((0,Tt.g)(this._tmpMbs),(0,Tt.g)(e),(0,Tt.g)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,bt.gm)(e,this._totalOffset,this._totalOffset,Fe.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const o=(0,d.s)(At,e,t,r),i=(0,d.g)(Et,o,this.localOrigin),n=this.offset/(0,d.l)(i);return(0,d.r)(this.tmpVertex,o,i,n),this.tmpVertex}applyToAabb(e){const t=St,r=Mt,o=wt;for(let i=0;i<3;++i)t[i]=e[0+i]+this.localOrigin[i],r[i]=e[3+i]+this.localOrigin[i],o[i]=t[i];const i=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=i[t],e[t+3]=i[t];const n=t=>{const r=this.applyToVertex(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 i=0;i<3;++i)o[i]=e&1<<i?r[i]:t[i];n(o)}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(!(a&e)){for(let i=0;i<3;++i)o[i]=a&1<<i?0:e&1<<i?t[i]:r[i];n(o)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const At=(0,u.vt)(),Et=(0,u.vt)(),St=(0,u.vt)(),Mt=(0,u.vt)(),wt=(0,u.vt)();function Ct(e,t,r){const{data:o,indices:i}=e,n=t.typedBuffer,a=t.typedBufferStride,s=i.length;r*=a;for(let e=0;e<s;++e){const t=2*i[e];n[r]=o[t],n[r+1]=o[t+1],r+=a}}function Ot(e,t,r,o){const{data:i,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,null==o||1===o)for(let e=0;e<l;++e){const t=3*n[e];a[r]=i[t],a[r+1]=i[t+1],a[r+2]=i[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*n[e];for(let e=0;e<o;++e)a[r]=i[t],a[r+1]=i[t+1],a[r+2]=i[t+2],r+=s}}function Rt(e,t,r,o=1){const{data:i,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,1===o)for(let e=0;e<l;++e){const t=4*n[e];a[r]=i[t],a[r+1]=i[t+1],a[r+2]=i[t+2],a[r+3]=i[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*n[e];for(let e=0;e<o;++e)a[r]=i[t],a[r+1]=i[t+1],a[r+2]=i[t+2],a[r+3]=i[t+3],r+=s}}function It(e,t,r,o,i=1){const n=t.typedBuffer,a=t.typedBufferStride;if(o*=a,1===i)for(let t=0;t<r;++t)n[o]=e[0],n[o+1]=e[1],n[o+2]=e[2],n[o+3]=e[3],o+=a;else for(let t=0;t<r;++t)for(let t=0;t<i;++t)n[o]=e[0],n[o+1]=e[1],n[o+2]=e[2],n[o+3]=e[3],o+=a}function Nt(e,t,r,o,i,n){switch(e){case ie.r.POSITION:{(0,U.vA)(3===t.size);const o=i.getField(e,f.xs);(0,U.vA)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,o,i=1){if(!t)return void Ot(e,r,o,i);const{data:n,indices:a}=e,l=r.typedBuffer,c=r.typedBufferStride,d=a.length,u=t[0],h=t[1],m=t[2],f=t[4],p=t[5],v=t[6],g=t[8],_=t[9],x=t[10],T=t[12],b=t[13],y=t[14];o*=c;let A=0,E=0,S=0;const M=(0,s.tZ)(t)?e=>{A=n[e]+T,E=n[e+1]+b,S=n[e+2]+y}:e=>{const t=n[e],r=n[e+1],o=n[e+2];A=u*t+f*r+g*o+T,E=h*t+p*r+_*o+b,S=m*t+v*r+x*o+y};if(1===i)for(let e=0;e<d;++e)M(3*a[e]),l[o]=A,l[o+1]=E,l[o+2]=S,o+=c;else for(let e=0;e<d;++e){M(3*a[e]);for(let e=0;e<i;++e)l[o]=A,l[o+1]=E,l[o+2]=S,o+=c}}(t,r,o,n);break}case ie.r.NORMAL:{(0,U.vA)(3===t.size);const r=i.getField(e,f.xs);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,o,i=1){if(!t)return void Ot(e,r,o,i);const{data:n,indices:a}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=a.length,h=l[0],m=l[1],f=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),y=1e-6,A=1-y;o*=d;let E=0,S=0,M=0;const w=(0,s.tZ)(l)?e=>{E=n[e],S=n[e+1],M=n[e+2]}:e=>{const t=n[e],r=n[e+1],o=n[e+2];E=h*t+p*r+_*o,S=m*t+v*r+x*o,M=f*t+g*r+T*o};if(1===i)if(b)for(let e=0;e<u;++e){w(3*a[e]);const t=E*E+S*S+M*M;if(t<A&&t>y){const e=1/Math.sqrt(t);c[o]=E*e,c[o+1]=S*e,c[o+2]=M*e}else c[o]=E,c[o+1]=S,c[o+2]=M;o+=d}else for(let e=0;e<u;++e)w(3*a[e]),c[o]=E,c[o+1]=S,c[o+2]=M,o+=d;else for(let e=0;e<u;++e){if(w(3*a[e]),b){const e=E*E+S*S+M*M;if(e<A&&e>y){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}for(let e=0;e<i;++e)c[o]=E,c[o+1]=S,c[o+2]=M,o+=d}}(t,o,r,n);break}case ie.r.NORMALCOMPRESSED:{(0,U.vA)(2===t.size);const r=i.getField(e,f.mJ);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Ct(t,r,n);break}case ie.r.UV0:{(0,U.vA)(2===t.size);const r=i.getField(e,f.gH);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Ct(t,r,n);break}case ie.r.COLOR:case ie.r.SYMBOLCOLOR:{const r=i.getField(e,f.XP);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,o,i=1){const{data:n,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(o*=l,t!==n.length||4!==t)if(1!==i)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<i;++e)s[o]=n[t],s[o+1]=n[t+1],s[o+2]=n[t+2],s[o+3]=255,o+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<i;++e)s[o]=n[t],s[o+1]=n[t+1],s[o+2]=n[t+2],s[o+3]=n[t+3],o+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[o]=n[t],s[o+1]=n[t+1],s[o+2]=n[t+2],s[o+3]=n[t+3],o+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[o]=n[t],s[o+1]=n[t+1],s[o+2]=n[t+2],s[o+3]=255,o+=l}}else{s[o]=n[0],s[o+1]=n[1],s[o+2]=n[2],s[o+3]=n[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[o/=4];o+=t;const d=c*i;for(let r=1;r<d;++r)e[o]=a,o+=t}}(t,t.size,r,n);break}case ie.r.COLORFEATUREATTRIBUTE:{const r=i.getField(e,f.Y$);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:o,indices:i}=e,n=t.typedBuffer,a=t.typedBufferStride,s=i.length,l=o[0];r*=a;for(let e=0;e<s;++e)n[r]=l,r+=a}(t,r,n);break}case ie.r.TANGENT:{(0,U.vA)(4===t.size);const o=i.getField(e,f.Eq);(0,U.vA)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,o,i=1){if(!t)return void Rt(e,r,o,i);const{data:n,indices:a}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=a.length,h=l[0],m=l[1],f=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),y=1e-6,A=1-y;if(o*=d,1===i)for(let e=0;e<u;++e){const t=4*a[e],r=n[t],i=n[t+1],s=n[t+2],l=n[t+3];let u=h*r+p*i+_*s,E=m*r+v*i+x*s,S=f*r+g*i+T*s;if(b){const e=u*u+E*E+S*S;if(e<A&&e>y){const t=1/Math.sqrt(e);u*=t,E*=t,S*=t}}c[o]=u,c[o+1]=E,c[o+2]=S,c[o+3]=l,o+=d}else for(let e=0;e<u;++e){const t=4*a[e],r=n[t],s=n[t+1],l=n[t+2],u=n[t+3];let E=h*r+p*s+_*l,S=m*r+v*s+x*l,M=f*r+g*s+T*l;if(b){const e=E*E+S*S+M*M;if(e<A&&e>y){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}for(let e=0;e<i;++e)c[o]=E,c[o+1]=S,c[o+2]=M,c[o+3]=u,o+=d}}(t,r,o,n);break}case ie.r.PROFILERIGHT:case ie.r.PROFILEUP:case ie.r.PROFILEVERTEXANDNORMAL:case ie.r.FEATUREVALUE:{(0,U.vA)(4===t.size);const r=i.getField(e,f.Eq);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Rt(t,r,n)}}}class Pt{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(ie.r.POSITION).indices.length}write(e,t,r,o,i){!function(e,t,r,o,i,n){for(const a of t.fields.keys()){const t=e.attributes.get(a),s=t?.indices;if(t&&s)Nt(a,t,r,o,i,n);else if(a===ie.r.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(ie.r.POSITION)?.indices;if(t){const r=t.length,o=i.getField(a,f.XP);It(e.objectAndLayerIdColor,o,r,n)}}}}(r,this.vertexBufferLayout,e,t,o,i)}}var Lt=r(13752),Ht=r(91829),Dt=r(53466),Bt=r(72824),Ft=r(97220),zt=r(84867),Vt=r(39341),Gt=r(34886);pe.MT.LESS,pe.MT.ALWAYS;const Ut={mask:255},Wt={function:{func:pe.MT.ALWAYS,ref:F.dd.OutlineVisualElementMask,mask:F.dd.OutlineVisualElementMask},operation:{fail:pe.eA.KEEP,zFail:pe.eA.KEEP,zPass:pe.eA.ZERO}},jt={function:{func:pe.MT.ALWAYS,ref:F.dd.OutlineVisualElementMask,mask:F.dd.OutlineVisualElementMask},operation:{fail:pe.eA.KEEP,zFail:pe.eA.KEEP,zPass:pe.eA.REPLACE}};pe.MT.EQUAL,F.dd.OutlineVisualElementMask,F.dd.OutlineVisualElementMask,pe.eA.KEEP,pe.eA.KEEP,pe.eA.KEEP,pe.MT.NOTEQUAL,F.dd.OutlineVisualElementMask,F.dd.OutlineVisualElementMask,pe.eA.KEEP,pe.eA.KEEP,pe.eA.KEEP;const qt=[1,1,.5],kt=[0,.6,.2],$t=[0,1,.2];var Yt=r(28491);class Xt extends Bt.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,u.ci)(qt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=F.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,u.fA)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Ge.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,u.fA)(.2,.2,.2),this.diffuse=(0,u.fA)(.8,.8,.8),this.externalColor=(0,Ht.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,u.vt)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=F.it.Less,this.textureAlphaMode=F.sf.Blend,this.textureAlphaCutoff=je.Q,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=ke.m$.Occlude,this.isDecoration=!1}}Bt.gy;class Zt extends zt.w{initializeConfiguration(e,t){t.spherical=e.viewingMode===Fe.RT.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?Dt.q.Default:Dt.q.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Zt.shader)}_initializeProgram(e,t){return new Gt.B(e.rctx,t.get().build(this.configuration),Vt.D)}_makePipeline(e,t){const r=this.configuration,o=e===$e.y.NONE,i=e===$e.y.FrontFace;return(0,Ye.Ey)({blending:r.output===Ve.V.Color&&r.transparent?Je(e):null,culling:Kt(r)?(0,Ye.Xt)(r.cullFace):null,depthTest:{func:Qe(e,Jt(r.customDepthTest))},depthWrite:(o||i)&&r.writeDepth?Ye.kn:null,drawBuffers:r.output===Ve.V.Depth?{buffers:[pe.Hr.NONE]}:et(e),colorWrite:Ye.wE,stencilWrite:r.hasOccludees?Ut:null,stencilTest:r.hasOccludees?t?jt:Wt:null,polygonOffset:o||i?null:(n=r.enableOffset,n?Ke:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Jt(e){return e===F.it.Lequal?pe.MT.LEQUAL:pe.MT.LESS}function Kt(e){return e.cullFace!==F.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Zt.shader=new Ft.$(Yt.D,(()=>r.e(5141).then(r.bind(r,5141))));var Qt=r(90237),er=r(99769),tr=r(82991),rr=r(46263);class or extends tr.nW{}(0,Qt._)([(0,er.W)({constValue:!0})],or.prototype,"hasSliceHighlight",void 0),(0,Qt._)([(0,er.W)({constValue:!1})],or.prototype,"hasSliceInVertexProgram",void 0),(0,Qt._)([(0,er.W)({constValue:rr.c.Pass})],or.prototype,"pbrTextureBindType",void 0);class ir extends or{constructor(){super(...arguments),this.output=Ve.V.Color,this.alphaDiscardMode=F.sf.Opaque,this.doubleSidedMode=Ue.W.None,this.pbrMode=We.A9.Disabled,this.cullFace=F.s2.None,this.transparencyPassType=$e.y.NONE,this.normalType=Ge.W.Attribute,this.textureCoordinateType=Dt.q.None,this.customDepthTest=F.it.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,Qt._)([(0,er.W)({count:Ve.V.COUNT})],ir.prototype,"output",void 0),(0,Qt._)([(0,er.W)({count:F.sf.COUNT})],ir.prototype,"alphaDiscardMode",void 0),(0,Qt._)([(0,er.W)({count:Ue.W.COUNT})],ir.prototype,"doubleSidedMode",void 0),(0,Qt._)([(0,er.W)({count:We.A9.COUNT})],ir.prototype,"pbrMode",void 0),(0,Qt._)([(0,er.W)({count:F.s2.COUNT})],ir.prototype,"cullFace",void 0),(0,Qt._)([(0,er.W)({count:$e.y.COUNT})],ir.prototype,"transparencyPassType",void 0),(0,Qt._)([(0,er.W)({count:Ge.W.COUNT})],ir.prototype,"normalType",void 0),(0,Qt._)([(0,er.W)({count:Dt.q.COUNT})],ir.prototype,"textureCoordinateType",void 0),(0,Qt._)([(0,er.W)({count:F.it.COUNT})],ir.prototype,"customDepthTest",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"spherical",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasVertexColors",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasSymbolColors",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasVerticalOffset",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasSlicePlane",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasSliceHighlight",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasColorTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasMetallicRoughnessTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasEmissionTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasOcclusionTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasNormalTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasScreenSizePerspective",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasVertexTangents",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasOccludees",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"multipassEnabled",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasModelTransformation",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"offsetBackfaces",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"vvSize",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"vvColor",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"receiveShadows",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"receiveAmbientOcclusion",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"textureAlphaPremultiplied",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"instanced",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"instancedColor",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"instancedDoublePrecision",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"writeDepth",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"transparent",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"enableOffset",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"cullAboveGround",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"snowCover",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasColorTextureTransform",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasEmissionTextureTransform",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasNormalTextureTransform",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasOcclusionTextureTransform",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Qt._)([(0,er.W)({constValue:!0})],ir.prototype,"discardTransparentFragments",void 0),(0,Qt._)([(0,er.W)({constValue:!1})],ir.prototype,"occlusionPass",void 0),(0,Qt._)([(0,er.W)({constValue:!0})],ir.prototype,"hasVvInstancing",void 0),(0,Qt._)([(0,er.W)({constValue:!1})],ir.prototype,"useCustomDTRExponentForWater",void 0),(0,Qt._)([(0,er.W)({constValue:!1})],ir.prototype,"supportsTextureAtlas",void 0),(0,Qt._)([(0,er.W)({constValue:!0})],ir.prototype,"useFillLights",void 0);var nr=r(57323);class ar extends Zt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Ge.W.Attribute,t.doubleSidedMode=Ue.W.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,ar.shader)}}ar.shader=new Ft.$(nr.R,(()=>r.e(9933).then(r.bind(r,39933))));class sr extends ke.im{constructor(e){super(e,cr),this._configuration=new ir,this.supportsEdges=!0,this.produces=new Map([[_t.OPAQUE_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&!this.parameters.transparent],[_t.TRANSPARENT_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[_t.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,ze.BP)().vec3f(ie.r.POSITION);return e.normalType===Ge.W.Compressed?t.vec2i16(ie.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(ie.r.NORMAL),e.hasVertexTangents&&t.vec4f(ie.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(ie.r.UV0),e.hasVertexColors&&t.vec4u8(ie.r.COLOR),e.hasSymbolColors&&t.vec4u8(ie.r.SYMBOLCOLOR),(0,ae.A)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(ie.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Ve.V.Shadow&&e!==Ve.V.ShadowExcludeHighlight&&e!==Ve.V.ShadowHighlight||this.parameters.castShadows}get visible(){const e=this.parameters;if(e.layerOpacity<je.Q)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:o,vvColor:i}=e,n=t||i||o,a="replace"===e.colorMixMode,s=e.opacity>=je.Q;if(r&&n)return a||s;const l=e.externalColor&&e.externalColor[3]>=je.Q;return r?a?l:s:n?a||s:a?l:s}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?F.s2.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e===Ve.V.Color&&(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ue.W.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ue.W.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ue.W.WindingOrder:Ue.W.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=this.parameters.receiveAmbientOcclusion&&null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?We.A9.Schematic:We.A9.Normal:We.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,o,i,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,d.s)(pr,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case Fe.RT.Global:n=(0,d.n)(mr,pr);break;case Fe.RT.Local:n=(0,d.c)(mr,hr)}let a=0;const s=(0,d.f)(vr,pr,e.eye),l=(0,d.l)(s),c=(0,d.j)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,d.m)(n,c)),a+=(0,Lt.kE)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,d.j)(n,n,a),(0,d.t)(fr,n,r.transform.inverseRotation),o=(0,d.f)(dr,o,fr),i=(0,d.f)(ur,i,fr)}var a;ot(e,r,o,i,null!=(a=r.verticalOffset)?(yt.offset=a,yt):null,n)}createGLMaterial(e){return new lr(e)}createBufferWriter(){return new Pt(this._vertexBufferLayout)}}class lr extends qe.m{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===Ve.V.Color&&(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,d.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?ar:Zt,e)}}class cr extends Xt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}}const dr=(0,u.vt)(),ur=(0,u.vt)(),hr=(0,u.fA)(0,0,1),mr=(0,u.vt)(),fr=(0,u.vt)(),pr=(0,u.vt)(),vr=(0,u.vt)(),gr=()=>I.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function _r(e){throw new R.A("",`Request for object resource failed: ${e}`)}function xr(e){const t=e.params,r=t.topology;let o=!0;switch(t.vertexAttributes||(gr().warn("Geometry must specify vertex attributes"),o=!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&&(gr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),o=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(gr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),o=!1)):(gr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),o=!1)}}else gr().warn("Indexed geometries must specify faces"),o=!1;break}default:gr().warn(`Unsupported topology '${r}'`),o=!1}e.params.material||(gr().warn("Geometry requires material"),o=!1);const i=e.params.vertexAttributes;for(const e in i)i[e].values||(gr().warn("Geometries with externally defined attributes are not yet supported"),o=!1);return o}function Tr(e){const t=(0,h.Ie)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,h.iT)(t,r.bbMin),(0,h.iT)(t,r.bbMax))})),t}function br(e){switch(e){case"mask":return F.sf.Mask;case"maskAndTransparency":return F.sf.MaskBlend;case"none":return F.sf.Opaque;default:return F.sf.Blend}}function yr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Ar=new L.R(1,2,"wosr");var Er=r(61765);async function Sr(e,t){const a=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}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,o.EM)(e));if("wosr"===a.fileType){const e=await(t.cache?t.cache.loadWOSR(a.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const o=await(0,C.Ke)(t.request(e,"json",r));if(!0===o.ok)return o.value;(0,P.QP)(o.error),_r(o.error.details.url)}(e,r,t);const o=await(0,C.Ke)((0,w.A)(e,t));if(!0===o.ok)return o.value.data;(0,P.QP)(o.error),_r(o.error)}(e,t),o=await async function(e,t){const r=new Array;for(const o in e){const i=e[o],n=i.images[0].data;if(!n){gr().warn("Externally referenced texture data is not yet supported");continue}const a=i.encoding+";base64,"+n,s="/textureDefinitions/"+o,l="rgba"===i.channels?i.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:pe.pF.REPEAT,t:pe.pF.REPEAT},preMultiplyAlpha:br(l)!==F.sf.Opaque},d=t?.disableTextures?Promise.resolve(null):D(a,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const o=await Promise.all(r),i={};for(const e of o)i[e.refId]=e;return i}(r.textureDefinitions??{},t);let i=0;for(const e in o)if(o.hasOwnProperty(e)){const t=o[e];i+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:o,size:i+(0,O.iL)(r)}}(a.url,t)),{engineResources:r,referenceBoundingBox:o}=function(e,t){const r=new Array,o=new Array,i=new Array,n=new N,a=e.resource,s=L.R.parse(a.version||"1.0","wosr");Ar.validate(s);const l=a.model.name,c=a.model.geometries,d=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(!xr(a))continue;const s=yr(a),l=a.params.vertexAttributes,p=[],v=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},g=l[ie.r.POSITION],_=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,o=v(e)??(0,H.tM)(_);p.push([e,new B.n(r,o,t.valuesPerElement,!0)])}const x=s.texture,T=h&&h[x];if(T&&!f.has(x)){const{image:e,parameters:t}=T,r=new He(e,t);o.push(r),f.set(x,r)}const b=f.get(x),y=b?b.id:void 0,A=s.material;let E=n.get(A,x);if(null==E){const e=d[A.substring(A.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=T&&T.alphaChannelUsage,o=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,i=T?br(T.alphaChannelUsage):void 0,a={ambient:(0,u.ci)(e.diffuse),diffuse:(0,u.ci)(e.diffuse),opacity:1-(e.transparency||0),transparent:o,textureAlphaMode:i,textureAlphaCutoff:.33,textureId:y,initTextureTransparent:!0,doubleSided:!0,cullFace:F.s2.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:T?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(a,t.materialParameters),E=new sr(a),n.set(A,x,E)}i.push(E);const S=new ne(E,p);m+=p.find((e=>e[0]===ie.r.POSITION))?.[1]?.indices.length??0,r.push(S)}return{engineResources:[{name:l,stageResources:{textures:o,materials:i,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Tr(r)}}(e,t);return{lods:r,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}let A;if(t.cache)A=await t.cache.loadGLTF(a.url,t,!!t.usePBR);else{const{loadGLTF:e}=await r.e(4399).then(r.bind(r,4399));A=await e(new T.R(t.streamDataRequester),a.url,t,t.usePBR)}const S=A.model.meta?.ESRI_proxyEllipsoid,R=A.meta.isEsriSymbolResource&&null!=S&&"EsriRealisticTreesStyle"===A.meta.ESRI_webstyle;R&&!A.customMeta.esriTreeRendering&&(A.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];for(const i of o.parts){const o=i.attributes.normal;if(null==o)return;const n=i.attributes.position,a=n.count,c=(0,u.vt)(),h=(0,u.vt)(),m=(0,u.vt)(),p=new Uint8Array(4*a),v=new Float64Array(3*a),g=(0,s.B8)((0,l.vt)(),i.transform);let _=0,x=0;for(let s=0;s<a;s++){n.getVec(s,h),o.getVec(s,c),(0,d.h)(h,h,i.transform),(0,d.f)(m,h,t.center),(0,d.D)(m,m,t.radius);const a=m[2],l=(0,d.l)(m),u=Math.min(.45+.55*l*l,1);(0,d.D)(m,m,t.radius),null!==g&&(0,d.h)(m,m,g),(0,d.n)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.o)(m,m,c,a>-1?.2:Math.min(-4*a-3.8,1)),v[_]=m[0],v[_+1]=m[1],v[_+2]=m[2],_+=3,p[x]=255*u,p[x+1]=255*u,p[x+2]=255*u,p[x+3]=255,x+=4}i.attributes.normal=new f.xs(v),i.attributes.color=new f.XP(p)}}}(A,S));const I=!!t.usePBR,z=A.meta.isEsriSymbolResource?{usePBR:I,isSchematic:!1,treeRendering:R,mrrFactors:[...$t]}:{usePBR:I,isSchematic:!1,treeRendering:!1,mrrFactors:[...qt]},V={...t.materialParameters,treeRendering:R},{engineResources:G,referenceBoundingBox:U}=function(e,t,r,o){const a=e.model,s=new Array,l=new Map,T=new Map,A=a.lods.length,S=(0,h.Ie)();return a.lods.forEach(((e,w)=>{const C=!0===o.skipHighLods&&(A>1&&0===w||A>3&&1===w)||!1===o.skipHighLods&&null!=o.singleLodIndex&&w!==o.singleLodIndex;if(C&&0!==w)return;const O=new M(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const o=C?new sr({}):function(e,t,r,o,i,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),l=e.materials.get(t.material),h=null!=t.attributes.texCoord0,m=null!=t.attributes.normal;if(null==l)return null;const f=function(e){switch(e){case"BLEND":return F.sf.Blend;case"MASK":return F.sf.Mask;case"OPAQUE":case null:case void 0:return F.sf.Opaque}}(l.alphaMode);if(!n.has(s)){if(h){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const o=e.textures.get(t);if(null!=o){const e=o.data;a.set(t,new He((0,y.x3)(e)?e.data:e,{...o.parameters,preMultiplyAlpha:!(0,y.x3)(e)&&r,encoding:(0,y.x3)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(l.textureColor,f!==F.sf.Opaque),t(l.textureNormal),t(l.textureOcclusion),t(l.textureEmissive),t(l.textureMetallicRoughness)}const r=l.color[0]**(1/Er.T),p=l.color[1]**(1/Er.T),v=l.color[2]**(1/Er.T),g=l.emissiveFactor[0]**(1/Er.T),_=l.emissiveFactor[1]**(1/Er.T),x=l.emissiveFactor[2]**(1/Er.T),T=null!=l.textureColor&&h?a.get(l.textureColor):null,b=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:i,emissiveFactor:n,occlusionTexture:a}){return null==e&&null==t&&null==i&&(null==n||(0,d.e)(n,u.uY))&&null==a&&(null==o||1===o)&&(null==r||1===r)}({normalTexture:l.textureNormal,metallicRoughnessTexture:l.textureMetallicRoughness,metallicFactor:l.metallicFactor,roughnessFactor:l.roughnessFactor,emissiveTexture:l.textureEmissive,emissiveFactor:l.emissiveFactor,occlusionTexture:l.textureOcclusion}),A=null!=l.normalTextureTransform?.scale?l.normalTextureTransform?.scale:c.Un;n.set(s,new sr({...o,transparent:f===F.sf.Blend,customDepthTest:F.it.Lequal,textureAlphaMode:f,textureAlphaCutoff:l.alphaCutoff,diffuse:[r,p,v],ambient:[r,p,v],opacity:l.opacity,doubleSided:l.doubleSided,doubleSidedType:"winding-order",cullFace:l.doubleSided?F.s2.None:F.s2.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:m?Ge.W.Attribute:Ge.W.ScreenDerivative,castShadows:!0,receiveShadows:l.receiveShadows,receiveAmbientOcclusion:l.receiveAmbientOcclustion,textureId:null!=T?T.id:void 0,colorMixMode:l.colorMixMode,normalTextureId:null!=l.textureNormal&&h?a.get(l.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=l.textureOcclusion&&h?a.get(l.textureOcclusion).id:void 0,emissiveTextureId:null!=l.textureEmissive&&h?a.get(l.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=l.textureMetallicRoughness&&h?a.get(l.textureMetallicRoughness).id:void 0,emissiveFactor:[g,_,x],mrrFactors:b?[...kt]:[l.metallicFactor,l.roughnessFactor,o.mrrFactors[2]],isSchematic:b,colorTextureTransformMatrix:E(l.colorTextureTransform),normalTextureTransformMatrix:E(l.normalTextureTransform),scale:[A[0],A[1]],occlusionTextureTransformMatrix:E(l.occlusionTextureTransform),emissiveTextureTransformMatrix:E(l.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:E(l.metallicRoughnessTextureTransform),...i}))}const p=n.get(s);if(r.stageResources.materials.push(p),h){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(l.textureColor),e(l.textureNormal),e(l.textureOcclusion),e(l.textureEmissive),e(l.textureMetallicRoughness)}return p}(a,e,O,t,r,l,T),{geometry:s,vertexCount:A}=function(e,t){const r=e.attributes.position.count,o=(0,b.x)(e.indices||r,e.primitiveType),a=(0,m.oe)(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,p.a)(a,s,e.transform,3,l);const c=[[ie.r.POSITION,new B.n(a,o,3,!0)]];if(null!=e.attributes.normal){const t=(0,m.oe)(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.normal;(0,n.Ge)(Mr,e.transform),(0,p.t)(t,a,Mr,3,s),(0,i.or)(Mr)&&(0,p.n)(t,t),c.push([ie.r.NORMAL,new B.n(t,o,3,!0)])}if(null!=e.attributes.tangent){const t=(0,m.oe)(4*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.tangent;(0,n.z0)(Mr,e.transform),(0,v.t)(t,a,Mr,4,s),(0,i.or)(Mr)&&(0,p.n)(t,t,4),c.push([ie.r.TANGENT,new B.n(t,o,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,m.oe)(2*r),{typedBuffer:i,typedBufferStride:n}=e.attributes.texCoord0;(0,g.a)(t,i,2,n),c.push([ie.r.UV0,new B.n(t,o,2,!0)])}const d=e.attributes.color;if(null!=d){const t=new Uint8Array(4*r);4===d.elementCount?d instanceof f.Eq?(0,v.b)(t,d,255):d instanceof f.XP?(0,x.a)(t,d):d instanceof f.Uz&&(0,v.b)(t,d,1/256):(t.fill(255),d instanceof f.xs?(0,p.f)(t,d.typedBuffer,255,4,d.typedBufferStride):e.attributes.color instanceof f.eI?(0,_.c)(t,d.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof f.nS&&(0,p.f)(t,d.typedBuffer,1/256,4,d.typedBufferStride)),c.push([ie.r.COLOR,new B.n(t,o,4,!0)])}return{geometry:new ne(t,c),vertexCount:r}}(e,null!=o?o:new sr({})),M=s.boundingInfo;null!=M&&0===w&&((0,h.iT)(S,M.bbMin),(0,h.iT)(S,M.bbMax)),null!=o&&(O.stageResources.geometries.push(s),O.numberOfVertices+=A)})),C||s.push(O)})),{engineResources:s,referenceBoundingBox:S}}(A,z,V,t.skipHighLods&&null==a.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:a.specifiedLodIndex});return{lods:G,referenceBoundingBox:U,isEsriSymbolResource:A.meta.isEsriSymbolResource,isWosr:!1}}const Mr=(0,a.vt)()},66104:(e,t,r)=>{var o,i;r.d(t,{k5:()=>o}),r(34727),(i=o||(o={}))[i.Multiply=1]="Multiply",i[i.Ignore=2]="Ignore",i[i.Replace=3]="Replace",i[i.Tint=4]="Tint"},42583:(e,t,r)=>{r.d(t,{A:()=>n});var o=r(66104),i=r(2597);function n(e){e.vertex.code.add(i.H`
260
- vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {
261
- float symbolAlpha = 0.0;
262
-
263
- const float maxTint = 85.0;
264
- const float maxReplace = 170.0;
265
- const float scaleAlpha = 3.0;
266
-
267
- if (symbolColor.a > maxReplace) {
268
- colorMixMode = ${i.H.int(o.k5.Multiply)};
269
- symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace);
270
- } else if (symbolColor.a > maxTint) {
271
- colorMixMode = ${i.H.int(o.k5.Replace)};
272
- symbolAlpha = scaleAlpha * (symbolColor.a - maxTint);
273
- } else if (symbolColor.a > 0.0) {
274
- colorMixMode = ${i.H.int(o.k5.Tint)};
275
- symbolAlpha = scaleAlpha * symbolColor.a;
276
- } else {
277
- colorMixMode = ${i.H.int(o.k5.Multiply)};
278
- symbolAlpha = 0.0;
279
- }
280
-
281
- return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha);
282
- }
283
- `)}},46686:(e,t,r)=>{r.d(t,{i$:()=>c,oD:()=>d,xJ:()=>l});var o=r(49255),i=r(33752),n=r(47286),a=r(2597);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.G("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
284
- return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
285
- }`)}function d(e,t){const{vertex:r}=e;switch(t.output){case o.V.Color:if(t.receiveShadows)return s(e),void r.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case o.V.Shadow:case o.V.ShadowHighlight:case o.V.ShadowExcludeHighlight:case o.V.ViewshedShadow:return e.include(i.em,t),s(e),l(e),c(e),void r.code.add(a.H`void forwardLinearDepth() {
286
- linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
287
- }`)}r.code.add(a.H`void forwardLinearDepth() {}`)}},32680:(e,t,r)=>{r.d(t,{M:()=>i});var o=r(2597);function i(e){e.vertex.code.add(o.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
288
- vec3 camToVert = posWorld - camPosWorld;
289
- bool isBackface = dot(camToVert, normalWorld) > 0.0;
290
- if (isBackface) {
291
- posClip.z += 0.0000003 * posClip.w;
292
- }
293
- return posClip;
294
- }`)}},82048:(e,t,r)=>{r.d(t,{c:()=>n});var o=r(2597),i=r(46540);function n(e,t=!0){e.attributes.add(i.r.POSITION,"vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.code.add(o.H`
295
- void main(void) {
296
- gl_Position = vec4(position, 0.0, 1.0);
297
- ${t?o.H`uv = position * 0.5 + vec2(0.5);`:""}
298
- }
299
- `)}},49255:(e,t,r)=>{var o;function i(e){return e===o.Shadow||e===o.ShadowHighlight||e===o.ShadowExcludeHighlight||e===o.ViewshedShadow}function n(e){return function(e){return function(e){return s(e)||a(e)}(e)||l(e)}(e)||e===o.Normal}function a(e){return e===o.Highlight||e===o.ObjectAndLayerIdColor}function s(e){return e===o.Color}function l(e){return e===o.Depth}r.d(t,{PJ:()=>i,V:()=>o,XY:()=>n}),function(e){e[e.Color=0]="Color",e[e.Depth=1]="Depth",e[e.Normal=2]="Normal",e[e.Shadow=3]="Shadow",e[e.ShadowHighlight=4]="ShadowHighlight",e[e.ShadowExcludeHighlight=5]="ShadowExcludeHighlight",e[e.ViewshedShadow=6]="ViewshedShadow",e[e.Highlight=7]="Highlight",e[e.ObjectAndLayerIdColor=8]="ObjectAndLayerIdColor",e[e.COUNT=9]="COUNT"}(o||(o={}))},76591:(e,t,r)=>{r.d(t,{HQ:()=>c});var o=r(58083),i=r(9093),n=r(38954),a=r(51850),s=r(40710),l=(r(33079),r(2597));function c(e,t){!function(e,t,...r){if(!t.hasSlicePlane){const r=l.H`#define rejectBySlice(_pos_) false
300
- #define discardBySlice(_pos_) {}
301
- #define highlightSlice(_color_, _pos_) (_color_)`;return t.hasSliceInVertexProgram&&e.vertex.code.add(r),void e.fragment.code.add(r)}t.hasSliceInVertexProgram&&e.vertex.uniforms.add(...r),e.fragment.uniforms.add(...r);const o=l.H`struct SliceFactors {
302
- float front;
303
- float side0;
304
- float side1;
305
- float side2;
306
- float side3;
307
- };
308
- SliceFactors calculateSliceFactors(vec3 pos) {
309
- vec3 rel = pos - slicePlaneOrigin;
310
- vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);
311
- float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);
312
- float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);
313
- float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);
314
- float basis1Dot = dot(slicePlaneBasis1, rel);
315
- float basis2Dot = dot(slicePlaneBasis2, rel);
316
- return SliceFactors(
317
- dot(slicePlaneNormal, pos) + slicePlaneW,
318
- -basis1Dot - basis1Len2,
319
- basis1Dot - basis1Len2,
320
- -basis2Dot - basis2Len2,
321
- basis2Dot - basis2Len2
322
- );
323
- }
324
- bool sliceByFactors(SliceFactors factors) {
325
- return factors.front < 0.0
326
- && factors.side0 < 0.0
327
- && factors.side1 < 0.0
328
- && factors.side2 < 0.0
329
- && factors.side3 < 0.0;
330
- }
331
- bool sliceEnabled() {
332
- return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
333
- }
334
- bool sliceByPlane(vec3 pos) {
335
- return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
336
- }
337
- #define rejectBySlice(_pos_) sliceByPlane(_pos_)
338
- #define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`,i=l.H`vec4 applySliceHighlight(vec4 color, vec3 pos) {
339
- SliceFactors factors = calculateSliceFactors(pos);
340
- const float HIGHLIGHT_WIDTH = 1.0;
341
- const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3);
342
- factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front);
343
- factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0);
344
- factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1);
345
- factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2);
346
- factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3);
347
- if (sliceByFactors(factors)) {
348
- return color;
349
- }
350
- float highlightFactor = (1.0 - step(0.5, factors.front))
351
- * (1.0 - step(0.5, factors.side0))
352
- * (1.0 - step(0.5, factors.side1))
353
- * (1.0 - step(0.5, factors.side2))
354
- * (1.0 - step(0.5, factors.side3));
355
- return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a);
356
- }`,n=t.hasSliceHighlight?l.H`
357
- ${i}
358
- #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
359
- `:l.H`#define highlightSlice(_color_, _pos_) (_color_)`;t.hasSliceInVertexProgram&&e.vertex.code.add(o),e.fragment.code.add(o),e.fragment.code.add(n)}(e,t,new s.W("slicePlaneOrigin",((e,r)=>function(e,t,r){if(null==r.slicePlane)return a.uY;const o=d(e,t,r),i=u(o,r.slicePlane),s=h(e,o,r);return null!=s?(0,n.h)(p,i,s):i}(t,e,r))),new s.W("slicePlaneBasis1",((e,r)=>m(t,e,r,r.slicePlane?.basis1))),new s.W("slicePlaneBasis2",((e,r)=>m(t,e,r,r.slicePlane?.basis2))))}function d(e,t,r){return e.instancedDoublePrecision?(0,n.s)(f,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function u(e,t){return null!=e?(0,n.f)(p,t.origin,e):t.origin}function h(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,o.Tl)(g,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function m(e,t,r,o){if(null==o||null==r.slicePlane)return a.uY;const i=d(e,t,r),s=u(i,r.slicePlane),l=h(e,i,r);return null!=l?((0,n.g)(v,o,s),(0,n.h)(p,s,l),(0,n.h)(v,v,l),(0,n.f)(v,v,p)):o}l.Y;const f=(0,a.vt)(),p=(0,a.vt)(),v=(0,a.vt)(),g=(0,i.vt)()},76597:(e,t,r)=>{r.d(t,{d:()=>n});var o=r(46686),i=r(2597);function n(e){(0,o.i$)(e),e.vertex.code.add(i.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
360
- vec4 eye = view * vec4(pos, 1.0);
361
- depth = calculateLinearDepth(nearFar,eye.z);
362
- return proj * eye;
363
- }`),e.vertex.code.add(i.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
364
- return proj * (view * vec4(pos, 1.0));
365
- }`)}},82991:(e,t,r)=>{r.d(t,{BK:()=>b,nW:()=>x});var o=r(90237),i=r(77690),n=r(29242),a=r(9093),s=r(38954),l=r(51850),c=r(49255),d=r(26425),u=r(20693),h=r(40710),m=r(2597),f=r(35644),p=r(40095),v=r(99769),g=r(46540),_=r(28449);class x extends v.K{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}(0,o._)([(0,v.W)()],x.prototype,"instancedDoublePrecision",void 0),(0,o._)([(0,v.W)()],x.prototype,"hasModelTransformation",void 0),m.Y;const T=(0,n.vt)();function b(e,t){const r=t.hasModelTransformation,o=t.instancedDoublePrecision;r&&(e.vertex.uniforms.add(new p.X("model",(e=>e.modelTransformation??a.zK))),e.vertex.uniforms.add(new f.k("normalLocalOriginFromModel",(e=>((0,i.Ge)(T,e.modelTransformation??a.zK),T))))),t.instanced&&o&&(e.attributes.add(g.r.INSTANCEMODELORIGINHI,"vec3"),e.attributes.add(g.r.INSTANCEMODELORIGINLO,"vec3"),e.attributes.add(g.r.INSTANCEMODEL,"mat3"),e.attributes.add(g.r.INSTANCEMODELNORMAL,"mat3"));const n=e.vertex;o&&(n.include(d.u,t),n.uniforms.add(new h.W("viewOriginHi",((e,t)=>(0,_.Zo)((0,s.s)(y,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),y))),new h.W("viewOriginLo",((e,t)=>(0,_.jA)((0,s.s)(y,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),y))))),n.code.add(m.H`
366
- vec3 getVertexInLocalOriginSpace() {
367
- return ${r?o?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":o?"instanceModel * localPosition().xyz":"localPosition().xyz"};
368
- }
369
-
370
- vec3 subtractOrigin(vec3 _pos) {
371
- ${o?m.H`
372
- // Negated inputs are intentionally the first two arguments. The other way around the obfuscation in dpAdd() stopped
373
- // working for macOS 14+ and iOS 17+.
374
- // Issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280
375
- vec3 originDelta = dpAdd(-instanceModelOriginHi, -instanceModelOriginLo, viewOriginHi, viewOriginLo);
376
- return _pos - originDelta;`:"return vpos;"}
377
- }
378
- `),n.code.add(m.H`
379
- vec3 dpNormal(vec4 _normal) {
380
- return normalize(${r?o?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":o?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
381
- }
382
- `),t.output===c.V.Normal&&((0,u.S7)(n),n.code.add(m.H`
383
- vec3 dpNormalView(vec4 _normal) {
384
- return normalize((viewNormal * ${r?o?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":o?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz);
385
- }
386
- `)),t.hasVertexTangents&&n.code.add(m.H`
387
- vec4 dpTransformVertexTangent(vec4 _tangent) {
388
- ${r?o?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":o?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
389
- }`)}const y=(0,l.vt)()},96336:(e,t,r)=>{r.d(t,{W:()=>o,Y:()=>l});var o,i,n=r(21818),a=r(2597),s=r(46540);function l(e,t){switch(t.normalType){case o.Compressed:e.attributes.add(s.r.NORMALCOMPRESSED,"vec2"),e.vertex.code.add(a.H`vec3 decompressNormal(vec2 normal) {
390
- float z = 1.0 - abs(normal.x) - abs(normal.y);
391
- return vec3(normal + sign(normal) * min(z, 0.0), z);
392
- }
393
- vec3 normalModel() {
394
- return decompressNormal(normalCompressed);
395
- }`);break;case o.Attribute:e.attributes.add(s.r.NORMAL,"vec3"),e.vertex.code.add(a.H`vec3 normalModel() {
396
- return normal;
397
- }`);break;case o.ScreenDerivative:e.fragment.code.add(a.H`vec3 screenDerivativeNormal(vec3 positionView) {
398
- return normalize(cross(dFdx(positionView), dFdy(positionView)));
399
- }`);break;default:(0,n.Xb)(t.normalType);case o.COUNT:case o.Ground:}}(i=o||(o={}))[i.Attribute=0]="Attribute",i[i.Compressed=1]="Compressed",i[i.Ground=2]="Ground",i[i.ScreenDerivative=3]="ScreenDerivative",i[i.COUNT=4]="COUNT"},10764:(e,t,r)=>{r.d(t,{I:()=>n});var o=r(2597),i=r(46540);function n(e){e.attributes.add(i.r.POSITION,"vec3"),e.vertex.code.add(o.H`vec3 positionModel() { return position; }`)}},39014:(e,t,r)=>{r.d(t,{K:()=>l});var o=r(42583),i=r(93588),n=r(2597),a=r(46540),s=r(13752);function l(e,t){t.hasSymbolColors?(e.include(o.A),e.attributes.add(a.r.SYMBOLCOLOR,"vec4"),e.varyings.add("colorMixMode","mediump float"),e.vertex.code.add(n.H`int symbolColorMixMode;
400
- vec4 getSymbolColor() {
401
- return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451;
402
- }
403
- void forwardColorMixMode() {
404
- colorMixMode = float(symbolColorMixMode) + 0.5;
405
- }`)):(e.fragment.uniforms.add(new i.c("colorMixMode",(e=>s.Um[e.colorMixMode]))),e.vertex.code.add(n.H`vec4 getSymbolColor() { return vec4(1.0); }
406
- void forwardColorMixMode() {}`))}},53466:(e,t,r)=>{r.d(t,{U:()=>l,q:()=>o});var o,i,n=r(21818),a=r(2597),s=r(46540);function l(e,t){switch(t.textureCoordinateType){case o.Default:return e.attributes.add(s.r.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(a.H`void forwardTextureCoordinates() {
407
- vuv0 = uv0;
408
- }`);case o.Compressed:return e.attributes.add(s.r.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(a.H`vec2 getUV0() {
409
- return uv0 / 16384.0;
410
- }
411
- void forwardTextureCoordinates() {
412
- vuv0 = getUV0();
413
- }`);case o.Atlas:return e.attributes.add(s.r.UV0,"vec2"),e.varyings.add("vuv0","vec2"),e.attributes.add(s.r.UVREGION,"vec4"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(a.H`void forwardTextureCoordinates() {
414
- vuv0 = uv0;
415
- vuvRegion = uvRegion;
416
- }`);default:(0,n.Xb)(t.textureCoordinateType);case o.None:return void e.vertex.code.add(a.H`void forwardTextureCoordinates() {}`);case o.COUNT:return}}(i=o||(o={}))[i.None=0]="None",i[i.Default=1]="Default",i[i.Atlas=2]="Atlas",i[i.Compressed=3]="Compressed",i[i.COUNT=4]="COUNT"},92700:(e,t,r)=>{r.d(t,{c:()=>n});var o=r(2597),i=r(46540);function n(e,t){t.hasVertexColors?(e.attributes.add(i.r.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(o.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(o.H`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(o.H`void forwardVertexColor() {}
417
- void forwardNormalizedVertexColor() {}`)}},72824:(e,t,r)=>{r.d(t,{Mh:()=>u,Zo:()=>h,gy:()=>m});var o=r(21818),i=r(29242),n=r(91829),a=r(96336),s=r(33752),l=r(2597),c=r(98353),d=r(35644);function u(e,t){switch(t.normalType){case a.W.Attribute:case a.W.Compressed:e.include(a.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new c.h("transformNormalGlobalFromModel",(e=>e.transformNormalGlobalFromModel)),new d.k("transformNormalViewFromGlobal",(e=>e.transformNormalViewFromGlobal))),e.vertex.code.add(l.H`void forwardNormal() {
418
- vNormalWorld = transformNormalGlobalFromModel * normalModel();
419
- vNormalView = transformNormalViewFromGlobal * vNormalWorld;
420
- }`);break;case a.W.Ground:e.include(s.em,t),e.varyings.add("vNormalWorld","vec3"),e.vertex.code.add(l.H`
421
- void forwardNormal() {
422
- vNormalWorld = ${t.spherical?l.H`normalize(vPositionWorldCameraRelative);`:l.H`vec3(0.0, 0.0, 1.0);`}
423
- }
424
- `);break;case a.W.ScreenDerivative:e.vertex.code.add(l.H`void forwardNormal() {}`);break;default:(0,o.Xb)(t.normalType);case a.W.COUNT:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,i.vt)()}}class m extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,i.vt)(),this.toMapSpace=(0,n.vt)()}}},33752:(e,t,r)=>{r.d(t,{EM:()=>v,dO:()=>p,em:()=>f});var o=r(29242),i=r(9093),n=r(51850),a=r(10764),s=r(26425),l=r(40710),c=r(33079),d=r(2597),u=r(98353),h=r(35644),m=r(40095);function f(e,t){e.include(a.I);const r=e.vertex;r.include(s.u,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add(new c.t("transformWorldFromViewTH",(e=>e.transformWorldFromViewTH)),new c.t("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL)),new h.k("transformViewFromCameraRelativeRS",(e=>e.transformViewFromCameraRelativeRS)),new m.X("transformProjFromView",(e=>e.transformProjFromView)),new u.h("transformWorldFromModelRS",(e=>e.transformWorldFromModelRS)),new l.W("transformWorldFromModelTH",(e=>e.transformWorldFromModelTH)),new l.W("transformWorldFromModelTL",(e=>e.transformWorldFromModelTL))),r.code.add(d.H`vec3 positionWorldCameraRelative() {
425
- vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
426
- vec3 transform_CameraRelativeFromModel = dpAdd(
427
- transformWorldFromModelTL,
428
- transformWorldFromModelTH,
429
- -transformWorldFromViewTL,
430
- -transformWorldFromViewTH
431
- );
432
- return transform_CameraRelativeFromModel + rotatedModelPosition;
433
- }`),r.code.add(d.H`
434
- void forwardPosition(float fOffset) {
435
- vPositionWorldCameraRelative = positionWorldCameraRelative();
436
- if (fOffset != 0.0) {
437
- vPositionWorldCameraRelative += fOffset * ${t.spherical?d.H`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:d.H`vec3(0.0, 0.0, 1.0)`};
438
- }
439
-
440
- vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
441
- gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
442
- }
443
- `),e.fragment.uniforms.add(new c.t("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL))),r.code.add(d.H`vec3 positionWorld() {
444
- return transformWorldFromViewTL + vPositionWorldCameraRelative;
445
- }`),e.fragment.code.add(d.H`vec3 positionWorld() {
446
- return transformWorldFromViewTL + vPositionWorldCameraRelative;
447
- }`)}class p extends d.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,n.vt)(),this.transformWorldFromViewTL=(0,n.vt)(),this.transformViewFromCameraRelativeRS=(0,o.vt)(),this.transformProjFromView=(0,i.vt)()}}class v extends d.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,o.vt)(),this.transformWorldFromModelTH=(0,n.vt)(),this.transformWorldFromModelTL=(0,n.vt)()}}},99208:(e,t,r)=>{r.d(t,{r:()=>s});var o=r(21818),i=r(53466),n=r(2597);function a(e){e.fragment.code.add(n.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
448
- vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
449
- vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
450
- float maxdUV = 0.125;
451
- vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
452
- vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
453
- return textureGrad(tex, uvAtlas, dUVdx, dUVdy);
454
- }`)}function s(e,t){switch(e.include(i.U,t),t.textureCoordinateType){case i.q.Default:case i.q.Compressed:return void e.fragment.code.add(n.H`vec4 textureLookup(sampler2D tex, vec2 uv) {
455
- return texture(tex, uv);
456
- }`);case i.q.Atlas:return e.include(a),void e.fragment.code.add(n.H`vec4 textureLookup(sampler2D tex, vec2 uv) {
457
- return textureAtlasLookup(tex, uv, vuvRegion);
458
- }`);default:(0,o.Xb)(t.textureCoordinateType);case i.q.None:case i.q.COUNT:return}}},54154:(e,t,r)=>{r.d(t,{G:()=>m});var o=r(87317),i=r(91829),n=r(38954),a=r(51850),s=r(33079),l=r(2597);function c(e){e.vertex.code.add(l.H`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
459
- return absCosAngle * absCosAngle * absCosAngle;
460
- }`),e.vertex.code.add(l.H`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) {
461
- return vec3(
462
- min(params.x / (distanceToCamera - params.y), 1.0),
463
- screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
464
- params.z
465
- );
466
- }`),e.vertex.code.add(l.H`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) {
467
- return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
468
- }`),e.vertex.code.add(l.H`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) {
469
- return applyScreenSizePerspectiveScaleFactorFloat(
470
- size,
471
- screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
472
- );
473
- }`),e.vertex.code.add(l.H`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) {
474
- return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
475
- }`),e.vertex.code.add(l.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
476
- return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
477
- }`)}const d=(0,a.vt)();var u=r(20693),h=r(71988);function m(e,t){const r=e.vertex;t.hasVerticalOffset?(function(e){e.uniforms.add(new h.E("verticalOffset",((e,t)=>{const{minWorldLength:r,maxWorldLength:i,screenLength:n}=e.verticalOffset,a=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),s=t.camera.pixelRatio||1;return(0,o.s)(f,n*s,a,r,i)})))}(r),t.hasScreenSizePerspective&&(e.include(c),function(e){e.uniforms.add(new s.t("screenSizePerspectiveAlignment",(e=>function(e){return(0,n.s)(d,e.parameters.divisor,e.parameters.offset,e.minScaleFactor)}(e.screenSizePerspectiveAlignment||e.screenSizePerspective))))}(r),(0,u.yu)(e.vertex,t)),r.code.add(l.H`
478
- vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
479
- float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
480
- ${t.spherical?l.H`vec3 worldNormal = normalize(worldPos + localOrigin);`:l.H`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
481
- ${t.hasScreenSizePerspective?l.H`
482
- float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
483
- float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:l.H`
484
- float verticalOffsetScreenHeight = verticalOffset.x;`}
485
- // Screen sized offset in world space, used for example for line callouts
486
- float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
487
- return worldNormal * worldOffset;
488
- }
489
-
490
- vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
491
- return worldPos + calculateVerticalOffset(worldPos, localOrigin);
492
- }
493
- `)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const f=(0,i.vt)()},9169:(e,t,r)=>{r.d(t,{E:()=>b});var o=r(46686),i=r(49255),n=r(76591),a=r(76597),s=r(96336),l=r(2597),c=r(46540);function d(e,t){const r=t.output===i.V.ObjectAndLayerIdColor,o=t.objectAndLayerIdColorInstanced;r&&(e.varyings.add("objectAndLayerIdColorVarying","vec4"),o?e.attributes.add(c.r.INSTANCEOBJECTANDLAYERIDCOLOR,"vec4"):e.attributes.add(c.r.OBJECTANDLAYERIDCOLOR,"vec4")),e.vertex.code.add(l.H`
494
- void forwardObjectAndLayerIdColor() {
495
- ${r?o?l.H`objectAndLayerIdColorVarying = instanceObjectAndLayerIdColor * 0.003921568627451;`:l.H`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;`:l.H``} }`),e.fragment.code.add(l.H`
496
- void outputObjectAndLayerIdColor() {
497
- ${r?l.H`fragColor = objectAndLayerIdColorVarying;`:l.H``} }`)}var u=r(53466),h=r(72824),m=r(80730);function f(e,t){switch(t.output){case i.V.Shadow:case i.V.ShadowHighlight:case i.V.ShadowExcludeHighlight:case i.V.ViewshedShadow:e.fragment.include(m.U),e.fragment.code.add(l.H`float _calculateFragDepth(const in float depth) {
498
- const float SLOPE_SCALE = 2.0;
499
- const float BIAS = 20.0 * .000015259;
500
- float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
501
- return depth + SLOPE_SCALE * m + BIAS;
502
- }
503
- void outputDepth(float _linearDepth) {
504
- fragColor = floatToRgba4(_calculateFragDepth(_linearDepth));
505
- }`)}}var p=r(76662),v=r(986),g=r(11955),_=r(20693),x=r(63761),T=r(89192);function b(e,t){const{vertex:r,fragment:c}=e,m=t.hasColorTexture&&t.alphaDiscardMode!==T.sf.Opaque;switch(t.output){case i.V.Depth:(0,_.NB)(r,t),e.include(a.d,t),e.include(n.HQ,t),e.include(u.U,t),m&&c.uniforms.add(new x.N("tex",(e=>e.texture))),r.code.add(l.H`void main(void) {
506
- vpos = getVertexInLocalOriginSpace();
507
- vpos = subtractOrigin(vpos);
508
- vpos = addVerticalOffset(vpos, localOrigin);
509
- gl_Position = transformPosition(proj, view, vpos);
510
- forwardTextureCoordinates();
511
- }`),e.include(g.S,t),c.code.add(l.H`
512
- void main(void) {
513
- discardBySlice(vpos);
514
- ${m?l.H`
515
- vec4 texColor = texture(tex, ${t.hasColorTextureTransform?l.H`colorUV`:l.H`vuv0`});
516
- discardOrAdjustAlpha(texColor);`:""}
517
- }
518
- `);break;case i.V.Shadow:case i.V.ShadowHighlight:case i.V.ShadowExcludeHighlight:case i.V.ViewshedShadow:case i.V.ObjectAndLayerIdColor:(0,_.NB)(r,t),e.include(a.d,t),e.include(u.U,t),e.include(v.A,t),e.include(f,t),e.include(n.HQ,t),e.include(d,t),(0,o.xJ)(e),e.varyings.add("depth","float"),m&&c.uniforms.add(new x.N("tex",(e=>e.texture))),r.code.add(l.H`void main(void) {
519
- vpos = getVertexInLocalOriginSpace();
520
- vpos = subtractOrigin(vpos);
521
- vpos = addVerticalOffset(vpos, localOrigin);
522
- gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
523
- forwardTextureCoordinates();
524
- forwardObjectAndLayerIdColor();
525
- }`),e.include(g.S,t),c.code.add(l.H`
526
- void main(void) {
527
- discardBySlice(vpos);
528
- ${m?l.H`
529
- vec4 texColor = texture(tex, ${t.hasColorTextureTransform?l.H`colorUV`:l.H`vuv0`});
530
- discardOrAdjustAlpha(texColor);`:""}
531
- ${t.output===i.V.ObjectAndLayerIdColor?l.H`outputObjectAndLayerIdColor();`:l.H`outputDepth(depth);`}
532
- }
533
- `);break;case i.V.Normal:{(0,_.NB)(r,t),e.include(a.d,t),e.include(s.Y,t),e.include(h.Mh,t),e.include(u.U,t),e.include(v.A,t),m&&c.uniforms.add(new x.N("tex",(e=>e.texture))),t.normalType===s.W.ScreenDerivative&&e.varyings.add("vPositionView","vec3");const o=t.normalType===s.W.Attribute||t.normalType===s.W.Compressed;r.code.add(l.H`
534
- void main(void) {
535
- vpos = getVertexInLocalOriginSpace();
536
-
537
- ${o?l.H`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:l.H`
538
- // Get vertex position in camera space for screen-space derivative normals
539
- vPositionView = (view * vec4(vpos, 1.0)).xyz;
540
- `}
541
- vpos = subtractOrigin(vpos);
542
- vpos = addVerticalOffset(vpos, localOrigin);
543
- gl_Position = transformPosition(proj, view, vpos);
544
- forwardTextureCoordinates();
545
- }
546
- `),e.include(n.HQ,t),e.include(g.S,t),c.code.add(l.H`
547
- void main() {
548
- discardBySlice(vpos);
549
- ${m?l.H`
550
- vec4 texColor = texture(tex, ${t.hasColorTextureTransform?l.H`colorUV`:l.H`vuv0`});
551
- discardOrAdjustAlpha(texColor);`:""}
552
-
553
- ${t.normalType===s.W.ScreenDerivative?l.H`vec3 normal = screenDerivativeNormal(vPositionView);`:l.H`
554
- vec3 normal = normalize(vNormalWorld);
555
- if (gl_FrontFacing == false){
556
- normal = -normal;
557
- }`}
558
- fragColor = vec4(0.5 + 0.5 * normal, 1.0);
559
- }
560
- `);break}case i.V.Highlight:(0,_.NB)(r,t),e.include(a.d,t),e.include(u.U,t),e.include(v.A,t),m&&c.uniforms.add(new x.N("tex",(e=>e.texture))),r.code.add(l.H`void main(void) {
561
- vpos = getVertexInLocalOriginSpace();
562
- vpos = subtractOrigin(vpos);
563
- vpos = addVerticalOffset(vpos, localOrigin);
564
- gl_Position = transformPosition(proj, view, vpos);
565
- forwardTextureCoordinates();
566
- }`),e.include(n.HQ,t),e.include(g.S,t),e.include(p.Q,t),c.code.add(l.H`
567
- void main() {
568
- discardBySlice(vpos);
569
- ${m?l.H`
570
- vec4 texColor = texture(tex, ${t.hasColorTextureTransform?l.H`colorUV`:l.H`vuv0`});
571
- discardOrAdjustAlpha(texColor);`:""}
572
- outputHighlight();
573
- }
574
- `)}}},76662:(e,t,r)=>{r.d(t,{Q:()=>a});var o=r(93588),i=r(2597),n=r(63761);function a(e){e.fragment.uniforms.add(new n.N("depthTexture",((e,t)=>t.mainDepth))),e.fragment.uniforms.add(new n.N("highlightTexture",((e,t)=>t.highlightTexture))),e.fragment.uniforms.add(new o.c("highlightLevel",((e,t)=>t.highlightLevel))),e.fragment.code.add(i.H`void outputHighlightNet(bool occluded) {
575
- int ll = highlightLevel & 3;
576
- int newI = 0;
577
- newI |= 1 << (ll*2);
578
- if (occluded) { newI |= 2 << (ll*2); }
579
- vec4 prevHighlight = texelFetch(highlightTexture, ivec2(gl_FragCoord.xy), 0);
580
- int li = (highlightLevel >> 2) & 3;
581
- int prevI = int(prevHighlight[li] * 255.0);
582
- int cI = newI | prevI;
583
- float cf = float(cI) / 255.0;
584
- vec4 combinedHighlight = prevHighlight;
585
- combinedHighlight[li] = cf;
586
- fragColor = combinedHighlight;
587
- }
588
- void outputHighlight() {
589
- float sceneDepth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x;
590
- bool occluded = gl_FragCoord.z > sceneDepth + 5e-5;
591
- outputHighlightNet(occluded);
592
- }`)}},52540:(e,t,r)=>{r.d(t,{E:()=>s});var o=r(37585),i=r(48163),n=(r(26835),r(47286)),a=r(2597);function s(e){e.uniforms.add(new n.G("zProjectionMap",((e,t)=>function(e){const t=e.projectionMatrix;return(0,o.hZ)(l,t[14],t[10])}(t.camera)))),e.code.add(a.H`float linearizeDepth(float depth) {
593
- float depthNdc = depth * 2.0 - 1.0;
594
- float c1 = zProjectionMap[0];
595
- float c2 = zProjectionMap[1];
596
- return -(c1 / (depthNdc + c2 + 1e-7));
597
- }`),e.code.add(a.H`float depthFromTexture(sampler2D depthTexture, vec2 uv) {
598
- ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0)));
599
- float depth = texelFetch(depthTexture, iuv, 0).r;
600
- return depth;
601
- }`),e.code.add(a.H`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) {
602
- return linearizeDepth(depthFromTexture(depthTexture, uv));
603
- }`)}const l=(0,i.vt)()},77695:(e,t,r)=>{r.d(t,{W:()=>p});var o=r(29242),i=r(48163),n=r(53466),a=r(99208),s=r(62602),l=r(47286),c=r(2597),d=r(35644),u=r(15976),h=r(63761),m=r(46263),f=r(46540);function p(e,t){const r=e.fragment;t.hasVertexTangents?(e.attributes.add(f.r.TANGENT,"vec4"),e.varyings.add("vTangent","vec4"),t.doubleSidedMode===s.W.WindingOrder?r.code.add(c.H`mat3 computeTangentSpace(vec3 normal) {
604
- float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
605
- vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
606
- vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
607
- return mat3(tangent, bitangent, normal);
608
- }`):r.code.add(c.H`mat3 computeTangentSpace(vec3 normal) {
609
- float tangentHeadedness = vTangent.w;
610
- vec3 tangent = normalize(vTangent.xyz);
611
- vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
612
- return mat3(tangent, bitangent, normal);
613
- }`)):r.code.add(c.H`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {
614
- vec3 Q1 = dFdx(pos);
615
- vec3 Q2 = dFdy(pos);
616
- vec2 stx = dFdx(st);
617
- vec2 sty = dFdy(st);
618
- float det = stx.t * sty.s - sty.t * stx.s;
619
- vec3 T = stx.t * Q2 - sty.t * Q1;
620
- T = T - normal * dot(normal, T);
621
- T *= inversesqrt(max(dot(T,T), 1.e-10));
622
- vec3 B = sign(det) * cross(normal, T);
623
- return mat3(T, B, normal);
624
- }`),t.textureCoordinateType!==n.q.None&&(e.include(a.r,t),r.uniforms.add(t.pbrTextureBindType===m.c.Pass?new h.N("normalTexture",(e=>e.textureNormal)):new u.o("normalTexture",(e=>e.textureNormal))),t.hasNormalTextureTransform&&(r.uniforms.add(new l.G("scale",(e=>e.scale??i.Un))),r.uniforms.add(new d.k("normalTextureTransformMatrix",(e=>e.normalTextureTransformMatrix??o.zK)))),r.code.add(c.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
625
- vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),t.hasNormalTextureTransform&&r.code.add(c.H`mat3 normalTextureRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0,
626
- normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
627
- 0.0, 0.0, 0.0 );
628
- rawNormal.xy = (normalTextureRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(c.H`return tangentSpace * rawNormal;
629
- }`))}},3452:(e,t,r)=>{r.d(t,{n:()=>G});var o,i,n,a=r(2597),s=r(63761),l=r(90237),c=r(34727),d=r(97768),u=r(36708),h=r(78659),m=r(10107),f=(r(44208),r(53966),r(87811),r(40608)),p=r(37585);(n=o||(o={}))[n.RED=0]="RED",n[n.RG=1]="RG",n[n.RGBA4=2]="RGBA4",n[n.RGBA=3]="RGBA",n[n.RGBA_MIPMAP=4]="RGBA_MIPMAP",n[n.R16F=5]="R16F",n[n.RGBA16F=6]="RGBA16F",function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH16_BUFFER=1]="DEPTH16_BUFFER"}(i||(i={}));var v=r(69622),g=r(49186),_=r(89192);let x=class extends v.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._context=null,this._dirty=!0}initialize(){this.addHandles([(0,u.wB)((()=>this.view.ready),(e=>{e&&this.view._stage?.renderer.addRenderNode(this)}),u.Vh)])}destroy(){this.view._stage?.renderer?.removeRenderNode(this)}render(){throw new g.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}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view._stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){e===_.C7.UPDATE&&this.view._stage?.renderView.requestRender(e),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._context.bindParameters}get renderingContext(){return this.view._stage.renderView.renderingContext}updateAnimation(){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e,t){this._context=t,this._frameBuffer=e.find((({name:e})=>e===this.produces));try{return this.render(e)}finally{this._frameBuffer=null}}};(0,l._)([(0,m.MZ)({constructOnly:!0})],x.prototype,"view",void 0),(0,l._)([(0,m.MZ)({constructOnly:!0})],x.prototype,"consumes",void 0),(0,l._)([(0,m.MZ)()],x.prototype,"produces",void 0),x=(0,l._)([(0,f.$)("esri.views.3d.webgl.RenderNode")],x);const T=x;var b=r(97220),y=r(84867),A=r(39341),E=r(34886),S=r(95774),M=r(90644);class w extends y.w{initializeProgram(e){return new E.B(e.rctx,w.shader.get().build(),A.D)}initializePipeline(){return(0,M.Ey)({colorWrite:M.wE})}}w.shader=new b.$(S.S,(()=>r.e(9384).then(r.bind(r,59384))));var C=r(48163);class O extends a.Y{constructor(){super(...arguments),this.projScale=1}}class R extends O{constructor(){super(...arguments),this.intensity=1}}class I extends a.Y{}class N extends I{constructor(){super(...arguments),this.blurSize=(0,C.vt)()}}var P=r(15581);class L extends y.w{initializeProgram(e){return new E.B(e.rctx,L.shader.get().build(),A.D)}initializePipeline(){return(0,M.Ey)({colorWrite:M.wE})}}L.shader=new b.$(P.S,(()=>r.e(191).then(r.bind(r,90191))));var H=r(63907),D=r(21231),B=r(67171);const F=2;let z=class extends T{constructor(e){super(e),this.consumes={required:["normals"]},this.produces="ssao",this.isEnabled=()=>!1,this._enableTime=(0,h.l5)(0),this._passParameters=new R,this._drawParameters=new N}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 B.R;t.wrapMode=H.pF.CLAMP_TO_EDGE,t.pixelFormat=H.Ab.RGB,t.wrapMode=H.pF.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new D.g(this.renderingContext,t,e),this._ssaoTechnique=this.techniques.acquire(L),this._blurTechnique=this.techniques.acquire(w),this.addHandles((0,u.wB)((()=>this.isEnabled()),(()=>this._enableTime=(0,h.l5)(0))))}destroy(){this._passParameters.noiseTexture=(0,d.WD)(this._passParameters.noiseTexture),this._blurTechnique.release(),this._ssaoTechnique.release()}render(e){const t=this.bindParameters,r=e.find((({name:e})=>"normals"===e)),i=r?.getTexture(),n=r?.getTexture(H.nI),a=this.fboCache,s=t.camera,l=s.fullViewport[2],d=s.fullViewport[3],u=Math.round(l/F),m=Math.round(d/F);if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=(0,h.l5)(performance.now()),this.requestRender(),a.acquire(u,m,"ssao",o.RED);0===this._enableTime&&(this._enableTime=(0,h.l5)(performance.now()));const f=this.renderingContext,v=this.view.qualitySettings.fadeDuration,g=s.relativeElevation,x=(0,c.qE)((5e5-g)/2e5,0,1),T=v>0?Math.min(v,performance.now()-this._enableTime)/v:1,b=T*x;this._passParameters.normalTexture=i,this._passParameters.depthTexture=n,this._passParameters.projScale=1/s.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*V/(0,P.g)(s)**6*b;const y=a.acquire(l,d,"ssao input",o.RG);f.unbindTexture(y.fbo.colorTexture),f.bindFramebuffer(y.fbo),f.setViewport(0,0,l,d),f.bindTechnique(this._ssaoTechnique,t,this._passParameters,this._drawParameters),f.screen.draw();const A=a.acquire(u,m,"ssao blur",o.RED);f.unbindTexture(A.fbo.colorTexture),f.bindFramebuffer(A.fbo),this._drawParameters.colorTexture=y.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,0,F/d),f.bindTechnique(this._blurTechnique,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,m),f.screen.draw(),y.release();const E=a.acquire(u,m,"ssao",o.RED);return f.unbindTexture(E.fbo.colorTexture),f.bindFramebuffer(E.fbo),f.setViewport(0,0,l,d),f.setClearColor(1,1,1,0),f.clear(H.hn.COLOR_BUFFER_BIT),this._drawParameters.colorTexture=A.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,F/l,0),f.bindTechnique(this._blurTechnique,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,m),f.screen.draw(),f.setViewport4fv(s.fullViewport),A.release(),T<1&&this.requestRender(_.C7.UPDATE),E}};(0,l._)([(0,m.MZ)()],z.prototype,"consumes",void 0),(0,l._)([(0,m.MZ)()],z.prototype,"produces",void 0),(0,l._)([(0,m.MZ)({constructOnly:!0})],z.prototype,"techniques",void 0),(0,l._)([(0,m.MZ)({constructOnly:!0})],z.prototype,"isEnabled",void 0),z=(0,l._)([(0,f.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],z);const V=.5;function G(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new s.N("ssaoTex",((e,t)=>t.ssao?.getTexture()))),r.constants.add("blurSizePixelsInverse","float",1/F),r.code.add(a.H`float evaluateAmbientOcclusionInverse() {
630
- vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
631
- return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
632
- }
633
- float evaluateAmbientOcclusion() {
634
- return 1.0 - evaluateAmbientOcclusionInverse();
635
- }`)):r.code.add(a.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
636
- float evaluateAmbientOcclusion() { return 0.0; }`)}},8881:(e,t,r)=>{r.d(t,{kA:()=>M,a8:()=>E,eU:()=>S});var o=r(21818),i=r(38954),n=r(51850),a=r(87317),s=r(91829),l=r(59469),c=r(33079),d=r(71988),u=r(2597);function h(e,t){const r=e.fragment,o=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===o?(r.uniforms.add(new c.t("lightingAmbientSH0",((e,t)=>(0,i.s)(m,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
637
- vec3 ambientLight = 0.282095 * lightingAmbientSH0;
638
- return ambientLight * (1.0 - ambientOcclusion);
639
- }`)):1===o?(r.uniforms.add(new d.E("lightingAmbientSH_R",((e,t)=>(0,a.s)(f,t.lighting.sh.r[0],t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3]))),new d.E("lightingAmbientSH_G",((e,t)=>(0,a.s)(f,t.lighting.sh.g[0],t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3]))),new d.E("lightingAmbientSH_B",((e,t)=>(0,a.s)(f,t.lighting.sh.b[0],t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
640
- vec4 sh0 = vec4(
641
- 0.282095,
642
- 0.488603 * normal.x,
643
- 0.488603 * normal.z,
644
- 0.488603 * normal.y
645
- );
646
- vec3 ambientLight = vec3(
647
- dot(lightingAmbientSH_R, sh0),
648
- dot(lightingAmbientSH_G, sh0),
649
- dot(lightingAmbientSH_B, sh0)
650
- );
651
- return ambientLight * (1.0 - ambientOcclusion);
652
- }`)):2===o&&(r.uniforms.add(new c.t("lightingAmbientSH0",((e,t)=>(0,i.s)(m,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0]))),new d.E("lightingAmbientSH_R1",((e,t)=>(0,a.s)(f,t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3],t.lighting.sh.r[4]))),new d.E("lightingAmbientSH_G1",((e,t)=>(0,a.s)(f,t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3],t.lighting.sh.g[4]))),new d.E("lightingAmbientSH_B1",((e,t)=>(0,a.s)(f,t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3],t.lighting.sh.b[4]))),new d.E("lightingAmbientSH_R2",((e,t)=>(0,a.s)(f,t.lighting.sh.r[5],t.lighting.sh.r[6],t.lighting.sh.r[7],t.lighting.sh.r[8]))),new d.E("lightingAmbientSH_G2",((e,t)=>(0,a.s)(f,t.lighting.sh.g[5],t.lighting.sh.g[6],t.lighting.sh.g[7],t.lighting.sh.g[8]))),new d.E("lightingAmbientSH_B2",((e,t)=>(0,a.s)(f,t.lighting.sh.b[5],t.lighting.sh.b[6],t.lighting.sh.b[7],t.lighting.sh.b[8])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
653
- vec3 ambientLight = 0.282095 * lightingAmbientSH0;
654
- vec4 sh1 = vec4(
655
- 0.488603 * normal.x,
656
- 0.488603 * normal.z,
657
- 0.488603 * normal.y,
658
- 1.092548 * normal.x * normal.y
659
- );
660
- vec4 sh2 = vec4(
661
- 1.092548 * normal.y * normal.z,
662
- 0.315392 * (3.0 * normal.z * normal.z - 1.0),
663
- 1.092548 * normal.x * normal.z,
664
- 0.546274 * (normal.x * normal.x - normal.y * normal.y)
665
- );
666
- ambientLight += vec3(
667
- dot(lightingAmbientSH_R1, sh1),
668
- dot(lightingAmbientSH_G1, sh1),
669
- dot(lightingAmbientSH_B1, sh1)
670
- );
671
- ambientLight += vec3(
672
- dot(lightingAmbientSH_R2, sh2),
673
- dot(lightingAmbientSH_G2, sh2),
674
- dot(lightingAmbientSH_B2, sh2)
675
- );
676
- return ambientLight * (1.0 - ambientOcclusion);
677
- }`),t.pbrMode!==l.A9.Normal&&t.pbrMode!==l.A9.Schematic||r.code.add(u.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
678
- vec3 calculateAmbientRadiance(float ambientOcclusion)
679
- {
680
- vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
681
- return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
682
- }`))}const m=(0,n.vt)(),f=(0,s.vt)();var p=r(3452),v=r(98619),g=r(22393),_=r(89786),x=r(39589),T=r(46263);class b extends x.n{constructor(e,t){super(e,"bool",T.c.Pass,((r,o,i)=>r.setUniform1b(e,t(o,i))))}}var y=r(20304);r(34727),(0,n.vt)();const A=.4;function E(e){e.constants.add("ambientBoostFactor","float",A)}function S(e){e.uniforms.add(new y.m("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)))}function M(e,t){const r=e.fragment;switch(e.include(p.n,t),t.pbrMode!==l.A9.Disabled&&e.include(g.c,t),e.include(h,t),e.include(_.p),r.code.add(u.H`
683
- const float GAMMA_SRGB = 2.1;
684
- const float INV_GAMMA_SRGB = 0.4761904;
685
- ${t.pbrMode===l.A9.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
686
- `),E(r),S(r),(0,v.Gc)(r),r.code.add(u.H`
687
- float additionalDirectedAmbientLight(vec3 vPosWorld) {
688
- float vndl = dot(${t.spherical?u.H`normalize(vPosWorld)`:u.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
689
- return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
690
- }
691
- `),(0,v.O4)(r),r.code.add(u.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
692
- float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
693
- return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
694
- }`),t.pbrMode){case l.A9.Disabled:case l.A9.WaterOnIntegratedMesh:case l.A9.Water:e.include(v.qU),r.code.add(u.H`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight)
695
- {
696
- vec3 mainLighting = evaluateMainLighting(normalWorld, shadow);
697
- vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
698
- vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
699
- vec3 totalLight = mainLighting + ambientLighting + additionalLight;
700
- totalLight = min(totalLight, vec3(PI));
701
- vec3 outColor = vec3((albedoLinear / PI) * totalLight);
702
- return pow(outColor, vec3(INV_GAMMA_SRGB));
703
- }`);break;case l.A9.Normal:case l.A9.Schematic:r.code.add(u.H`const float fillLightIntensity = 0.25;
704
- const float horizonLightDiffusion = 0.4;
705
- const float additionalAmbientIrradianceFactor = 0.02;
706
- vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance)
707
- {
708
- vec3 viewDirection = -viewDir;
709
- vec3 h = normalize(viewDirection + mainLightDirection);
710
- PBRShadingInfo inputs;
711
- inputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
712
- inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0);
713
- inputs.NdotH = clamp(dot(normal, h), 0.0, 1.0);
714
- inputs.VdotH = clamp(dot(viewDirection, h), 0.0, 1.0);
715
- inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0);
716
- vec3 reflectedView = normalize(reflect(viewDirection, normal));
717
- inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0);
718
- inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
719
- inputs.ssao = ssao;
720
- inputs.metalness = mrr[0];
721
- inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(u.H`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
722
- inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
723
- inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new b("hasFillLights",((e,t)=>t.enableFillLights))):r.constants.add("hasFillLights","bool",!1),r.code.add(u.H`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]);
724
- ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
725
- inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
726
- vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * mainLightIntensity;
727
- vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
728
- vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
729
- inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
730
- inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add(new y.m("lightingSpecularStrength",((e,t)=>t.lighting.mainLight.specularStrength)),new y.m("lightingEnvironmentStrength",((e,t)=>t.lighting.mainLight.environmentStrength))),r.code.add(u.H`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView;
731
- vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
732
- inputs.NdotH_Horizon = dot(normal, horizonRingH);
733
- vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow);
734
- vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity;
735
- vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight;
736
- float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0));
737
- inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
738
- inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
739
- inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(u.H`
740
- vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
741
- vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
742
- vec3 emissionComponent = _emission == vec3(0.0) ? _emission : pow(_emission, vec3(GAMMA_SRGB));
743
- vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
744
- ${t.pbrMode!==l.A9.Schematic||t.hasColorTexture?u.H`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`:u.H`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`}
745
- return outColor;
746
- }
747
- `);break;case l.A9.Simplified:case l.A9.TerrainWithWater:e.include(v.qU),r.code.add(u.H`const float roughnessTerrain = 0.5;
748
- const float specularityTerrain = 0.5;
749
- const vec3 fresnelReflectionTerrain = vec3(0.04);
750
- vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) {
751
- vec3 viewDirection = -vd;
752
- vec3 h = normalize(viewDirection + mainLightDirection);
753
- float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0);
754
- float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0);
755
- float NdotH = clamp(dot(n, h), 0.0, 1.0);
756
- float NdotNG = clamp(dot(n, nup), -1.0, 1.0);
757
- vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB));
758
- float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2];
759
- vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain;
760
- vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0));
761
- vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity;
762
- vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al;
763
- vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent;
764
- vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5;
765
- vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI;
766
- vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity;
767
- vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV);
768
- vec3 specularColor = f0 * dfg.x + f90 * dfg.y;
769
- vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent;
770
- vec3 outColorLinear = outDiffColor + specularComponent;
771
- vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB));
772
- return outColor;
773
- }`);break;default:(0,o.Xb)(t.pbrMode);case l.A9.COUNT:}}(0,n.vt)()},98619:(e,t,r)=>{r.d(t,{Gc:()=>n,O4:()=>a,qU:()=>s});var o=r(33079),i=r(2597);function n(e){e.uniforms.add(new o.t("mainLightDirection",((e,t)=>t.lighting.mainLight.direction)))}function a(e){e.uniforms.add(new o.t("mainLightIntensity",((e,t)=>t.lighting.mainLight.intensity)))}function s(e){n(e.fragment),a(e.fragment),e.fragment.code.add(i.H`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) {
774
- float dotVal = clamp(dot(normal_global, mainLightDirection), 0.0, 1.0);
775
- return mainLightIntensity * ((1.0 - shadowing) * dotVal);
776
- }`)}},51343:(e,t,r)=>{r.d(t,{Q:()=>a});var o=r(52540),i=r(2597),n=r(63761);function a(e,t){if(!t.multipassEnabled)return;e.fragment.include(o.E),e.fragment.uniforms.add(new n.N("terrainDepthTexture",((e,t)=>t.multipassTerrain.depth?.attachment)));const r=t.occlusionPass;e.fragment.code.add(i.H`
777
- ${r?"bool":"void"} terrainDepthTest(float fragmentDepth) {
778
- float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r;
779
- float linearDepth = linearizeDepth(depth);
780
- ${r?i.H`return fragmentDepth < linearDepth && depth < 1.0;`:i.H`
781
- if(fragmentDepth ${t.cullAboveGround?">":"<="} linearDepth){
782
- discard;
783
- }`}
784
- }`)}},62602:(e,t,r)=>{r.d(t,{W:()=>o,r:()=>s});var o,i,n=r(21818),a=r(2597);function s(e,t){const r=e.fragment;switch(r.code.add(a.H`struct ShadingNormalParameters {
785
- vec3 normalView;
786
- vec3 viewDirection;
787
- } shadingParams;`),t.doubleSidedMode){case o.None:r.code.add(a.H`vec3 shadingNormal(ShadingNormalParameters params) {
788
- return normalize(params.normalView);
789
- }`);break;case o.View:r.code.add(a.H`vec3 shadingNormal(ShadingNormalParameters params) {
790
- return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView);
791
- }`);break;case o.WindingOrder:r.code.add(a.H`vec3 shadingNormal(ShadingNormalParameters params) {
792
- return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView);
793
- }`);break;default:(0,n.Xb)(t.doubleSidedMode);case o.COUNT:}}(i=o||(o={}))[i.None=0]="None",i[i.View=1]="View",i[i.WindingOrder=2]="WindingOrder",i[i.COUNT=3]="COUNT"},22393:(e,t,r)=>{r.d(t,{c:()=>s});var o=r(2597);function i(e){const t=e.fragment.code;t.add(o.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)
794
- {
795
- return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
796
- }`),t.add(o.H`float integratedRadiance(float cosTheta2, float roughness)
797
- {
798
- return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
799
- }`),t.add(o.H`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness)
800
- {
801
- float cosTheta2 = 1.0 - RdotNG * RdotNG;
802
- float intRadTheta = integratedRadiance(cosTheta2, roughness);
803
- float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
804
- float sky = 2.0 - ground;
805
- return (ground * ambientGround + sky * ambientSky) * 0.5;
806
- }`)}var n=r(59469),a=r(89786);function s(e,t){const r=e.fragment.code;e.include(a.p),t.pbrMode!==n.A9.Normal&&t.pbrMode!==n.A9.Schematic&&t.pbrMode!==n.A9.Simplified&&t.pbrMode!==n.A9.TerrainWithWater||(r.add(o.H`float normalDistribution(float NdotH, float roughness)
807
- {
808
- float a = NdotH * roughness;
809
- float b = roughness / (1.0 - NdotH * NdotH + a * a);
810
- return b * b * INV_PI;
811
- }`),r.add(o.H`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
812
- const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040);
813
- const vec2 c2 = vec2(-1.04, 1.04);
814
- vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
815
- vec4 r = roughness * c0 + c1;
816
- float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
817
- return c2 * a004 + r.zw;
818
- }`)),t.pbrMode!==n.A9.Normal&&t.pbrMode!==n.A9.Schematic||(e.include(i),r.add(o.H`struct PBRShadingInfo
819
- {
820
- float NdotL;
821
- float NdotV;
822
- float NdotH;
823
- float VdotH;
824
- float LdotH;
825
- float NdotNG;
826
- float RdotNG;
827
- float NdotAmbDir;
828
- float NdotH_Horizon;
829
- vec3 skyRadianceToSurface;
830
- vec3 groundRadianceToSurface;
831
- vec3 skyIrradianceToSurface;
832
- vec3 groundIrradianceToSurface;
833
- float averageAmbientRadiance;
834
- float ssao;
835
- vec3 albedoLinear;
836
- vec3 f0;
837
- vec3 f90;
838
- vec3 diffuseColor;
839
- float metalness;
840
- float roughness;
841
- };`),r.add(o.H`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
842
- vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG);
843
- vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness);
844
- vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;
845
- vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);
846
- vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
847
- vec3 specularComponent = specularColor * indirectSpecular;
848
- return (diffuseComponent + specularComponent);
849
- }`),r.add(o.H`float gamutMapChanel(float x, vec2 p){
850
- return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
851
- }`),r.add(o.H`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){
852
- vec3 outColor;
853
- vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance));
854
- outColor.x = gamutMapChanel(inColor.x, p) ;
855
- outColor.y = gamutMapChanel(inColor.y, p) ;
856
- outColor.z = gamutMapChanel(inColor.z, p) ;
857
- return outColor;
858
- }`))}},59469:(e,t,r)=>{r.d(t,{A9:()=>o,_Z:()=>h});var o,i,n=r(99208),a=r(40710),s=r(33079),l=r(2597),c=r(15976),d=r(63761),u=r(46263);function h(e,t){const r=e.fragment,i=t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture;if(t.pbrMode===o.Normal&&i&&e.include(n.r,t),t.pbrMode!==o.Schematic)if(t.pbrMode!==o.Disabled){if(t.pbrMode===o.Normal){r.code.add(l.H`vec3 mrr;
859
- vec3 emission;
860
- float occlusion;`);const e=t.pbrTextureBindType;t.hasMetallicRoughnessTexture&&(r.uniforms.add(e===u.c.Pass?new d.N("texMetallicRoughness",(e=>e.textureMetallicRoughness)):new c.o("texMetallicRoughness",(e=>e.textureMetallicRoughness))),r.code.add(l.H`void applyMetallnessAndRoughness(vec2 uv) {
861
- vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
862
- mrr[0] *= metallicRoughness.b;
863
- mrr[1] *= metallicRoughness.g;
864
- }`)),t.hasEmissionTexture&&(r.uniforms.add(e===u.c.Pass?new d.N("texEmission",(e=>e.textureEmissive)):new c.o("texEmission",(e=>e.textureEmissive))),r.code.add(l.H`void applyEmission(vec2 uv) {
865
- emission *= textureLookup(texEmission, uv).rgb;
866
- }`)),t.hasOcclusionTexture?(r.uniforms.add(e===u.c.Pass?new d.N("texOcclusion",(e=>e.textureOcclusion)):new c.o("texOcclusion",(e=>e.textureOcclusion))),r.code.add(l.H`void applyOcclusion(vec2 uv) {
867
- occlusion *= textureLookup(texOcclusion, uv).r;
868
- }
869
- float getBakedOcclusion() {
870
- return occlusion;
871
- }`)):r.code.add(l.H`float getBakedOcclusion() { return 1.0; }`),e===u.c.Pass?r.uniforms.add(new s.t("emissionFactor",(e=>e.emissiveFactor)),new s.t("mrrFactors",(e=>e.mrrFactors))):r.uniforms.add(new a.W("emissionFactor",(e=>e.emissiveFactor)),new a.W("mrrFactors",(e=>e.mrrFactors))),r.code.add(l.H`
872
- void applyPBRFactors() {
873
- mrr = mrrFactors;
874
- emission = emissionFactor;
875
- occlusion = 1.0;
876
-
877
- ${t.hasMetallicRoughnessTexture?l.H`applyMetallnessAndRoughness(${t.hasMetallicRoughnessTextureTransform?l.H`metallicRoughnessUV`:"vuv0"});`:""}
878
-
879
- ${t.hasEmissionTexture?l.H`applyEmission(${t.hasEmissiveTextureTransform?l.H`emissiveUV`:"vuv0"});`:""}
880
-
881
- ${t.hasOcclusionTexture?l.H`applyOcclusion(${t.hasOcclusionTextureTransform?l.H`occlusionUV`:"vuv0"});`:""}
882
- }
883
- `)}}else r.code.add(l.H`float getBakedOcclusion() { return 1.0; }`);else r.code.add(l.H`vec3 mrr = vec3(0.0, 0.6, 0.2);
884
- vec3 emission = vec3(0.0);
885
- float occlusion = 1.0;
886
- void applyPBRFactors() {}
887
- float getBakedOcclusion() { return 1.0; }`)}r(25634),(i=o||(o={}))[i.Disabled=0]="Disabled",i[i.Normal=1]="Normal",i[i.Schematic=2]="Schematic",i[i.Water=3]="Water",i[i.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",i[i.Simplified=5]="Simplified",i[i.TerrainWithWater=6]="TerrainWithWater",i[i.COUNT=7]="COUNT"},89786:(e,t,r)=>{function o(e){const t=3.141592653589793,r=.3183098861837907;e.vertex.constants.add("PI","float",t),e.fragment.constants.add("PI","float",t),e.fragment.constants.add("LIGHT_NORMALIZATION","float",r),e.fragment.constants.add("INV_PI","float",r),e.fragment.constants.add("HALF_PI","float",1.570796326794897),e.fragment.constants.add("TWO_PI","float",6.28318530717958)}r.d(t,{p:()=>o})},25618:(e,t,r)=>{r.d(t,{Bz:()=>m,G:()=>h}),r(9093),r(51850);var o=r(80730),i=r(71988),n=r(93588),a=r(2597),s=r(39589),l=r(46263);class c extends s.n{constructor(e,t,r){super(e,"mat4",l.c.Draw,((r,o,i,n)=>r.setUniformMatrix4fv(e,t(o,i,n))),r)}}class d extends s.n{constructor(e,t,r){super(e,"mat4",l.c.Pass,((r,o,i)=>r.setUniformMatrix4fv(e,t(o,i))),r)}}var u=r(63761);function h(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new d("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),f(e))}function m(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new c("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),f(e))}function f(e){const t=e.fragment;t.include(o.U),t.uniforms.add(new u.N("shadowMap",((e,t)=>t.shadowMap.depthTexture)),new n.c("numCascades",((e,t)=>t.shadowMap.numCascades)),new i.E("cascadeDistances",((e,t)=>t.shadowMap.cascadeDistances))),t.code.add(a.H`int chooseCascade(float depth, out mat4 mat) {
888
- vec4 distance = cascadeDistances;
889
- int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
890
- mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
891
- return i;
892
- }
893
- vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
894
- vec4 lv = mat * vec4(_vpos, 1.0);
895
- lv.xy /= lv.w;
896
- return 0.5 * lv.xyz + vec3(0.5);
897
- }
898
- vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) {
899
- float xScale = float(textureSize.y) / float(textureSize.x);
900
- return vec2((float(i) + lvpos.x) * xScale, lvpos.y);
901
- }
902
- float readShadowMapDepth(ivec2 uv, sampler2D _depthTex) {
903
- return rgba4ToFloat(texelFetch(_depthTex, uv, 0));
904
- }
905
- float posIsInShadow(ivec2 uv, vec3 lvpos, sampler2D _depthTex) {
906
- return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0;
907
- }
908
- float filterShadow(vec2 uv, vec3 lvpos, ivec2 texSize, sampler2D _depthTex) {
909
- vec2 st = fract(uv * vec2(texSize) + vec2(0.5));
910
- ivec2 base = ivec2(uv * vec2(texSize) - vec2(0.5));
911
- float s00 = posIsInShadow(ivec2(base.x, base.y), lvpos, _depthTex);
912
- float s10 = posIsInShadow(ivec2(base.x + 1, base.y), lvpos, _depthTex);
913
- float s11 = posIsInShadow(ivec2(base.x + 1, base.y + 1), lvpos, _depthTex);
914
- float s01 = posIsInShadow(ivec2(base.x, base.y + 1), lvpos, _depthTex);
915
- return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);
916
- }
917
- float readShadowMap(const in vec3 _vpos, float _linearDepth) {
918
- mat4 mat;
919
- int i = chooseCascade(_linearDepth, mat);
920
- if (i >= numCascades) { return 0.0; }
921
- vec3 lvpos = lightSpacePosition(_vpos, mat);
922
- if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }
923
- ivec2 size = textureSize(shadowMap, 0);
924
- vec2 uv = cascadeCoordinates(i, size, lvpos);
925
- return filterShadow(uv, lvpos, size, shadowMap);
926
- }`)}a.Y,a.Y},51406:(e,t,r)=>{r.d(t,{MU:()=>c,O1:()=>d,QM:()=>u,Sx:()=>l,q2:()=>s});var o=r(29242),i=r(53466),n=r(2597),a=r(35644);function s(e,t){t.hasColorTextureTransform?(e.vertex.uniforms.add(new a.k("colorTextureTransformMatrix",(e=>e.colorTextureTransformMatrix??o.zK))),e.varyings.add("colorUV","vec2"),e.vertex.code.add(n.H`void forwardColorUV(){
927
- colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
928
- }`)):e.vertex.code.add(n.H`void forwardColorUV(){}`)}function l(e,t){t.hasNormalTextureTransform&&t.textureCoordinateType!==i.q.None?(e.vertex.uniforms.add(new a.k("normalTextureTransformMatrix",(e=>e.normalTextureTransformMatrix??o.zK))),e.varyings.add("normalUV","vec2"),e.vertex.code.add(n.H`void forwardNormalUV(){
929
- normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
930
- }`)):e.vertex.code.add(n.H`void forwardNormalUV(){}`)}function c(e,t){t.hasEmissionTextureTransform&&t.textureCoordinateType!==i.q.None?(e.vertex.uniforms.add(new a.k("emissiveTextureTransformMatrix",(e=>e.emissiveTextureTransformMatrix??o.zK))),e.varyings.add("emissiveUV","vec2"),e.vertex.code.add(n.H`void forwardEmissiveUV(){
931
- emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
932
- }`)):e.vertex.code.add(n.H`void forwardEmissiveUV(){}`)}function d(e,t){t.hasOcclusionTextureTransform&&t.textureCoordinateType!==i.q.None?(e.vertex.uniforms.add(new a.k("occlusionTextureTransformMatrix",(e=>e.occlusionTextureTransformMatrix??o.zK))),e.varyings.add("occlusionUV","vec2"),e.vertex.code.add(n.H`void forwardOcclusionUV(){
933
- occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
934
- }`)):e.vertex.code.add(n.H`void forwardOcclusionUV(){}`)}function u(e,t){t.hasMetallicRoughnessTextureTransform&&t.textureCoordinateType!==i.q.None?(e.vertex.uniforms.add(new a.k("metallicRoughnessTextureTransformMatrix",(e=>e.metallicRoughnessTextureTransformMatrix??o.zK))),e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.code.add(n.H`void forwardMetallicRoughnessUV(){
935
- metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
936
- }`)):e.vertex.code.add(n.H`void forwardMetallicRoughnessUV(){}`)}},986:(e,t,r)=>{r.d(t,{A:()=>y});var o=r(33079),i=r(39589),n=r(46263);class a extends i.n{constructor(e,t,r){super(e,"vec4",n.c.Pass,((r,o,i)=>r.setUniform4fv(e,t(o,i))),r)}}class s extends i.n{constructor(e,t,r){super(e,"float",n.c.Pass,((r,o,i)=>r.setUniform1fv(e,t(o,i))),r)}}var l=r(2597),c=r(35644),d=r(46540),u=(r(44208),r(34727),r(77690),r(29242),r(58083),r(9093)),h=(r(38954),r(51850)),m=(r(31756),r(90237)),f=r(69622),p=r(10107),v=(r(53966),r(87811),r(40608));let g=class extends f.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.TESTS_DISABLE_OPTIMIZATIONS=!1,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.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}};var _,x,T;(0,m._)([(0,p.MZ)()],g.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"LABELS_SHOW_BORDER",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"TEXT_SHOW_BASELINE",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"TEXT_SHOW_BORDER",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"SHOW_POI",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,m._)([(0,p.MZ)()],g.prototype,"LINE_WIREFRAMES",void 0),g=(0,m._)([(0,v.$)("esri.views.3d.support.debugFlags")],g),new g,(T=_||(_={}))[T.Undefined=0]="Undefined",T[T.DefinedSize=1]="DefinedSize",T[T.DefinedScale=2]="DefinedScale",function(e){e[e.Undefined=0]="Undefined",e[e.DefinedAngle=1]="DefinedAngle"}(x||(x={})),l.Y,(0,u.vt)(),(0,h.vt)(),(0,u.vt)(),r(14903);const b=8;function y(e,t){const{vertex:r,attributes:i}=e;t.hasVvInstancing&&(t.vvSize||t.vvColor)&&i.add(d.r.INSTANCEFEATUREATTRIBUTE,"vec4"),t.vvSize?(r.uniforms.add(new o.t("vvSizeMinSize",(e=>e.vvSize.minSize))),r.uniforms.add(new o.t("vvSizeMaxSize",(e=>e.vvSize.maxSize))),r.uniforms.add(new o.t("vvSizeOffset",(e=>e.vvSize.offset))),r.uniforms.add(new o.t("vvSizeFactor",(e=>e.vvSize.factor))),r.uniforms.add(new c.k("vvSymbolRotationMatrix",(e=>e.vvSymbolRotationMatrix))),r.uniforms.add(new o.t("vvSymbolAnchor",(e=>e.vvSymbolAnchor))),r.code.add(l.H`vec3 vvScale(vec4 _featureAttribute) {
937
- return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);
938
- }
939
- vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
940
- return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
941
- }`),r.code.add(l.H`
942
- const float eps = 1.192092896e-07;
943
- vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
944
- vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize);
945
- return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0);
946
- }
947
-
948
- ${t.hasVvInstancing?l.H`
949
- vec4 vvLocalNormal(vec3 _normal) {
950
- return vvTransformNormal(_normal, instanceFeatureAttribute);
951
- }
952
-
953
- vec4 localPosition() {
954
- return vvTransformPosition(position, instanceFeatureAttribute);
955
- }`:""}
956
- `)):r.code.add(l.H`vec4 localPosition() { return vec4(position, 1.0); }
957
- vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),t.vvColor?(r.constants.add("vvColorNumber","int",b),r.uniforms.add(new s("vvColorValues",(e=>e.vvColor.values),b),new a("vvColorColors",(e=>e.vvColor.colors),b)),r.code.add(l.H`
958
- vec4 interpolateVVColor(float value) {
959
- if (value <= vvColorValues[0]) {
960
- return vvColorColors[0];
961
- }
962
-
963
- for (int i = 1; i < vvColorNumber; ++i) {
964
- if (vvColorValues[i] >= value) {
965
- float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
966
- return mix(vvColorColors[i-1], vvColorColors[i], f);
967
- }
968
- }
969
- return vvColorColors[vvColorNumber - 1];
970
- }
971
-
972
- vec4 vvGetColor(vec4 featureAttribute) {
973
- return interpolateVVColor(featureAttribute.y);
974
- }
975
-
976
- ${t.hasVvInstancing?l.H`
977
- vec4 vvColor() {
978
- return vvGetColor(instanceFeatureAttribute);
979
- }`:"vec4 vvColor() { return vec4(1.0); }"}
980
- `)):r.code.add(l.H`vec4 vvColor() { return vec4(1.0); }`)}},35093:(e,t,r)=>{r.d(t,{Q:()=>o});const o=1/256},34845:(e,t,r)=>{r.d(t,{Ir:()=>d});var o=r(37585),i=r(48163),n=r(87317),a=r(91829),s=r(47286),l=r(71988),c=r(2597);function d(e){e.fragment.uniforms.add(new l.E("projInfo",((e,t)=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,n.s)(u,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,n.s)(u,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(t.camera)))),e.fragment.uniforms.add(new s.G("zScale",((e,t)=>function(e){return 0===e.projectionMatrix[11]?(0,o.hZ)(h,0,1):(0,o.hZ)(h,1,0)}(t.camera)))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
981
- return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
982
- }`)}const u=(0,a.vt)(),h=(0,i.vt)()},63365:(e,t,r)=>{r.d(t,{a:()=>i});var o=r(2597);function i(e){e.code.add(o.H`vec4 premultiplyAlpha(vec4 v) {
983
- return vec4(v.rgb * v.a, v.a);
984
- }
985
- vec3 rgb2hsv(vec3 c) {
986
- vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
987
- vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
988
- vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
989
- float d = q.x - min(q.w, q.y);
990
- float e = 1.0e-10;
991
- return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);
992
- }
993
- vec3 hsv2rgb(vec3 c) {
994
- vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
995
- vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
996
- return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
997
- }
998
- float rgb2v(vec3 c) {
999
- return max(c.x, max(c.y, c.z));
1000
- }`)}},11955:(e,t,r)=>{r.d(t,{S:()=>l});var o=r(35093),i=r(39589);r(46263),i.n;var n=r(20304),a=r(2597),s=r(89192);function l(e,t){!function(e,t,r){const i=e.fragment;switch(t.alphaDiscardMode){case s.sf.Blend:e.fragment.code.add(a.H`
1001
- #define discardOrAdjustAlpha(color) { if (color.a < ${a.H.float(o.Q)}) { discard; } }
1002
- `);break;case s.sf.Opaque:i.code.add(a.H`void discardOrAdjustAlpha(inout vec4 color) {
1003
- color.a = 1.0;
1004
- }`);break;case s.sf.Mask:i.uniforms.add(r).code.add(a.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case s.sf.MaskBlend:i.uniforms.add(r).code.add(a.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}(e,t,new n.m("textureAlphaCutoff",(e=>e.textureAlphaCutoff)))}},26425:(e,t,r)=>{r.d(t,{u:()=>i});var o=r(2597);function i({code:e},t){t.doublePrecisionRequiresObfuscation?e.add(o.H`vec3 dpPlusFrc(vec3 a, vec3 b) {
1005
- return mix(a, a + b, vec3(notEqual(b, vec3(0))));
1006
- }
1007
- vec3 dpMinusFrc(vec3 a, vec3 b) {
1008
- return mix(vec3(0), a - b, vec3(notEqual(a, b)));
1009
- }
1010
- vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
1011
- vec3 t1 = dpPlusFrc(hiA, hiB);
1012
- vec3 e = dpMinusFrc(t1, hiA);
1013
- vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB;
1014
- return t1 + t2;
1015
- }`):e.add(o.H`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
1016
- vec3 t1 = hiA + hiB;
1017
- vec3 e = t1 - hiA;
1018
- vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB;
1019
- return t1 + t2;
1020
- }`)}},27950:(e,t,r)=>{r.d(t,{N:()=>a});var o=r(66104),i=r(63365),n=r(2597);function a(e){e.include(i.a),e.code.add(n.H`
1021
- vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
1022
- // workaround for artifacts in OSX using Intel Iris Pro
1023
- // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
1024
- vec3 internalMixed = internalColor * textureColor;
1025
- vec3 allMixed = internalMixed * externalColor;
1026
-
1027
- if (mode == ${n.H.int(o.k5.Multiply)}) {
1028
- return allMixed;
1029
- }
1030
- if (mode == ${n.H.int(o.k5.Ignore)}) {
1031
- return internalMixed;
1032
- }
1033
- if (mode == ${n.H.int(o.k5.Replace)}) {
1034
- return externalColor;
1035
- }
1036
-
1037
- // tint (or something invalid)
1038
- float vIn = rgb2v(internalMixed);
1039
- vec3 hsvTint = rgb2hsv(externalColor);
1040
- vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);
1041
- return hsv2rgb(hsvOut);
1042
- }
1043
-
1044
- float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
1045
- // workaround for artifacts in OSX using Intel Iris Pro
1046
- // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
1047
- float internalMixed = internalOpacity * textureOpacity;
1048
- float allMixed = internalMixed * externalOpacity;
1049
-
1050
- if (mode == ${n.H.int(o.k5.Ignore)}) {
1051
- return internalMixed;
1052
- }
1053
- if (mode == ${n.H.int(o.k5.Replace)}) {
1054
- return externalOpacity;
1055
- }
1056
-
1057
- // multiply or tint (or something invalid)
1058
- return allMixed;
1059
- }
1060
- `)}},80730:(e,t,r)=>{r.d(t,{U:()=>i});var o=r(2597);function i(e){e.code.add(o.H`const float MAX_RGBA4_FLOAT =
1061
- 15.0 / 16.0 +
1062
- 15.0 / 16.0 / 16.0 +
1063
- 15.0 / 16.0 / 16.0 / 16.0 +
1064
- 15.0 / 16.0 / 16.0 / 16.0 / 16.0;
1065
- const vec4 FIXED_POINT_FACTORS_RGBA4 = vec4(1.0, 16.0, 16.0 * 16.0, 16.0 * 16.0 * 16.0);
1066
- vec4 floatToRgba4(const float value) {
1067
- float valueInValidDomain = clamp(value, 0.0, MAX_RGBA4_FLOAT);
1068
- vec4 fixedPointU4 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS_RGBA4) * 16.0);
1069
- const float toU4AsFloat = 1.0 / 15.0;
1070
- return fixedPointU4 * toU4AsFloat;
1071
- }
1072
- const vec4 RGBA4_2_FLOAT_FACTORS = vec4(
1073
- 15.0 / (16.0),
1074
- 15.0 / (16.0 * 16.0),
1075
- 15.0 / (16.0 * 16.0 * 16.0),
1076
- 15.0 / (16.0 * 16.0 * 16.0 * 16.0)
1077
- );
1078
- float rgba4ToFloat(vec4 rgba) {
1079
- return dot(rgba, RGBA4_2_FLOAT_FACTORS);
1080
- }`)}},26835:(e,t,r)=>{r(2597)},20693:(e,t,r)=>{r.d(t,{yu:()=>m,NB:()=>f,S7:()=>g});var o=r(58083),i=r(9093),n=r(38954),a=r(51850),s=r(40710),l=r(33079),c=(r(20304),r(39589)),d=r(46263);class u extends c.n{constructor(e,t){super(e,"mat4",d.c.Draw,((r,o,i)=>r.setUniformMatrix4fv(e,t(o,i))))}}var h=r(40095);function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new s.W("cameraPosition",((e,t)=>(0,n.s)(v,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new h.X("proj",((e,t)=>t.camera.projectionMatrix)),new u("view",((e,t)=>(0,o.Tl)(p,t.camera.viewMatrix,e.origin))),new s.W("localOrigin",(e=>e.origin)));const r=e=>(0,n.s)(v,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new h.X("proj",((e,t)=>t.camera.projectionMatrix)),new h.X("view",((e,t)=>(0,o.Tl)(p,t.camera.viewMatrix,r(t)))),new l.t("localOrigin",((e,t)=>r(t))))}const p=(0,i.vt)(),v=(0,a.vt)();function g(e){e.uniforms.add(new h.X("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec2",i.c.Draw,((r,o,i,n)=>r.setUniform2fv(e,t(o,i,n))))}}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec2",i.c.Pass,((r,o,i)=>r.setUniform2fv(e,t(o,i))))}}},40710:(e,t,r)=>{r.d(t,{W:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec3",i.c.Draw,((r,o,i,n)=>r.setUniform3fv(e,t(o,i,n))))}}},33079:(e,t,r)=>{r.d(t,{t:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec3",i.c.Pass,((r,o,i)=>r.setUniform3fv(e,t(o,i))))}}},71988:(e,t,r)=>{r.d(t,{E:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec4",i.c.Pass,((r,o,i)=>r.setUniform4fv(e,t(o,i))))}}},20304:(e,t,r)=>{r.d(t,{m:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"float",i.c.Pass,((r,o,i)=>r.setUniform1f(e,t(o,i))))}}},93588:(e,t,r)=>{r.d(t,{c:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"int",i.c.Pass,((r,o,i)=>r.setUniform1i(e,t(o,i))))}}},98353:(e,t,r)=>{r.d(t,{h:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"mat3",i.c.Draw,((r,o,i)=>r.setUniformMatrix3fv(e,t(o,i))))}}},35644:(e,t,r)=>{r.d(t,{k:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"mat3",i.c.Pass,((r,o,i)=>r.setUniformMatrix3fv(e,t(o,i))))}}},40095:(e,t,r)=>{r.d(t,{X:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"mat4",i.c.Pass,((r,o,i)=>r.setUniformMatrix4fv(e,t(o,i))))}}},85977:(e,t,r)=>{r.d(t,{N5:()=>l});var o=r(49186),i=(r(44208),r(53966)),n=r(46263),a=r(620);class s{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 l extends s{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.extensions=new f,this.constants=new v,this.outputs=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),o=this.varyings.generateSource(e),i="vertex"===e?this.vertex:this.fragment,n=i.uniforms.generateSource(),a=i.code.generateSource(),s="vertex"===e?_:g,l=this.constants.generateSource().concat(i.constants.generateSource()),c=this.outputs.generateSource(e);return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${n.join("\n")}\n\n${r.join("\n")}\n\n${o.join("\n")}\n\n${c.join("\n")}\n\n${a.join("\n")}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),o=r.length;return(t,i)=>{for(let n=0;n<o;++n)r[n](e,t,i)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),o=r.length;return(t,i,n)=>{for(let a=0;a<o;++a)r[a](e,t,i,n)}}}class c{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 o.A(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else i.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder").error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends s{constructor(){super(...arguments),this.uniforms=new c(this),this.code=new d(this),this.constants=new v}get builder(){return this}}class h{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]};`))}}class m{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,a.vA)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,o)=>t.push("vertex"===e?`out ${r} ${o};`:`in ${r} ${o};`))),t}}class f{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?f.ALLOWLIST_VERTEX:f.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}f.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],f.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=new Map}add(e,t,r=0){const o=this._entries.get(r);o?(0,a.vA)(o.name===e&&o.type===t,`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}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}}p.DEFAULT_TYPE="vec4",p.DEFAULT_NAME="fragColor";class v{constructor(){this._entries=new Set}add(e,t,r){let o="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":o=v._numberToFloatStr(r);break;case"int":o=v._numberToIntStr(r);break;case"bool":o=r.toString();break;case"vec2":o=`vec2(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])})`;break;case"vec3":o=`vec3(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])})`;break;case"vec4":o=`vec4(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])}, ${v._numberToFloatStr(r[3])})`;break;case"ivec2":o=`ivec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"ivec3":o=`ivec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"ivec4":o=`ivec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":o=`${t}(${Array.prototype.map.call(r,(e=>v._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${o};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",_="precision highp float;\nprecision highp sampler2D;"},15976:(e,t,r)=>{r.d(t,{o:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Draw,((r,o,i)=>r.bindTexture(e,t(o,i))))}}},63761:(e,t,r)=>{r.d(t,{N:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Pass,((r,o,i)=>r.bindTexture(e,t(o,i))))}}},39589:(e,t,r)=>{r.d(t,{n:()=>i});var o=r(46263);class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={[o.c.Pass]:null,[o.c.Draw]:null},i)switch(r){case o.c.Pass:this.bind[o.c.Pass]=i;break;case o.c.Draw:this.bind[o.c.Draw]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},2597:(e,t,r)=>{r.d(t,{H:()=>i,Y:()=>o});const o=class{};function i(e,...t){let r="";for(let o=0;o<t.length;o++)r+=e[o]+t[o];return r+=e[e.length-1],r}var n;(n=i||(i={})).int=function(e){return Math.round(e).toString()},n.float=function(e){return e.toPrecision(8)}},97220:(e,t,r)=>{r.d(t,{$:()=>o});class o{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},84867:(e,t,r)=>{r.d(t,{w:()=>n});var o=r(97768),i=r(63907);class n{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}destroy(){this._program=(0,o.WD)(this._program),this._pipeline=this._configuration=null}reload(e){(0,o.WD)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return i.WR.TRIANGLES}getPipeline(e,t,r){return this._pipeline}initializeConfiguration(e,t){}}},99769:(e,t,r)=>{r.d(t,{K:()=>n,W:()=>a});var o=r(49186),i=r(2597);class n extends i.Y{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function a(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,n=e.count||2,a=Math.ceil(Math.log2(n)),s=t._parameterBits??[0];let l=0;for(;s[l]+a>16;)l++,l>=s.length&&s.push(0);t._parameterBits=s;const c=s[l],d=(1<<a)-1<<c;s[l]+=a,Object.defineProperty(t,r,{get(){return this[i]},set(t){if(this[i]!==t)if(this[i]=t,this._keyDirty=!0,this._parameterBits[l]=this._parameterBits[l]&~d|+t<<c&d,"number"==typeof t){if(null==e.count)throw new o.A(`Configuration value for ${r} must provide a count option`)}else if("boolean"!=typeof t)throw new o.A(`Configuration value for ${r} must be boolean or number, got ${typeof t}`)}})}}}},69720:(e,t,r)=>{r.d(t,{J:()=>i});var o=r(24326);class i{constructor(){this.id=(0,o.c)()}}},96672:(e,t,r)=>{var o;r.d(t,{X:()=>o}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(o||(o={}))},39341:(e,t,r)=>{r.d(t,{D:()=>i});var o=r(46540);const i=new Map([[o.r.POSITION,0],[o.r.NORMAL,1],[o.r.NORMALCOMPRESSED,1],[o.r.UV0,2],[o.r.COLOR,3],[o.r.COLORFEATUREATTRIBUTE,3],[o.r.SIZE,4],[o.r.TANGENT,4],[o.r.CENTEROFFSETANDDISTANCE,5],[o.r.SYMBOLCOLOR,5],[o.r.FEATUREATTRIBUTE,6],[o.r.INSTANCEFEATUREATTRIBUTE,6],[o.r.INSTANCECOLOR,7],[o.r.OBJECTANDLAYERIDCOLOR,7],[o.r.INSTANCEOBJECTANDLAYERIDCOLOR,7],[o.r.INSTANCEMODEL,8],[o.r.INSTANCEMODELNORMAL,12],[o.r.INSTANCEMODELORIGINHI,11],[o.r.INSTANCEMODELORIGINLO,15]])},25634:(e,t,r)=>{r.d(t,{m:()=>l});var o=r(97768),i=r(74887),n=r(2597),a=r(89192);class s{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){this._techniques.release(this._technique)}get technique(){return this._technique}get _stippleTextures(){return this._techniques.constructionContext.stippleTextures}get _markerTextures(){return this._techniques.constructionContext.markerTextures}ensureTechnique(e,t){return this._technique=this._techniques.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return a.Am.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),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(){this._texture=(0,o.Gz)(this._texture),this._textureNormal=(0,o.Gz)(this._textureNormal),this._textureEmissive=(0,o.Gz)(this._textureEmissive),this._textureOcclusion=(0,o.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,o.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?a.Am.LOADED:a.Am.LOADING}get textureBindParameters(){return new c(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,o.Gz)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,i.$X)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,o.Gz)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends n.Y{constructor(e=null,t=null,r=null,o=null,i=null,n,a){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=o,this.textureMetallicRoughness=i,this.scale=n,this.normalTextureTransformMatrix=a}}},14903:(e,t,r)=>{r.d(t,{im:()=>h,m$:()=>o});var o,i,n=r(51850),a=r(2597),s=r(89192),l=r(69720),c=r(96672),d=r(39341),u=r(13752);class h extends l.J{constructor(e,t){super(),this.type=c.X.Material,this.supportsEdges=!1,this._renderPriority=0,this._vertexAttributeLocations=d.D,this._pp0=(0,n.fA)(0,0,1),this._pp1=(0,n.fA)(0,0,0),this._parameters=new t,(0,u.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,u.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.bindParameters.decorations===s.ID.ON)&&!!(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())}get vertexAttributeLocations(){return this._vertexAttributeLocations}parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.visible&&this.parameters.renderOccluded===e}intersectDraped(e,t,r,o,i,n){return this._pp0[0]=this._pp1[0]=o[0],this._pp0[1]=this._pp1[1]=o[1],this.intersect(e,t,r,this._pp0,this._pp1,i)}}(i=o||(o={}))[i.None=0]="None",i[i.Occlude=1]="Occlude",i[i.Transparent=2]="Transparent",i[i.OccludeAndTransparent=4]="OccludeAndTransparent",i[i.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",i[i.Opaque=16]="Opaque",a.Y},34886:(e,t,r)=>{r.d(t,{B:()=>n});var o=r(3694),i=r(94656);class n{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new o.A({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this),this._fragmentUniforms=(0,i.en)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(null==t?.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),this._fragmentUniforms?.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}},14327:(e,t,r)=>{var o;r.d(t,{y:()=>o}),function(e){e[e.ColorAlpha=0]="ColorAlpha",e[e.FrontFace=1]="FrontFace",e[e.NONE=2]="NONE",e[e.COUNT=3]="COUNT"}(o||(o={}))},89192:(e,t,r)=>{var o,i,n,a,s,l,c,d,u;r.d(t,{Am:()=>a,C7:()=>n,ID:()=>d,JS:()=>u,Mg:()=>l,dd:()=>s,it:()=>i,s2:()=>o,sf:()=>c}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(o||(o={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(i||(i={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(n||(n={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(l||(l={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(c||(c={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(d||(d={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(u||(u={}))},61765:(e,t,r)=>{r.d(t,{T:()=>o});const o=2.1},13752:(e,t,r)=>{r.d(t,{Um:()=>X,MB:()=>Y,kE:()=>$});var o=r(4576),i=r(34727),n=(r(44208),r(53966)),a=r(4341),s=r(58083),l=r(9093),c=r(38954),d=r(51850),u=r(19419),h=r(88582),m=r(11964),f=r(240),p=r(71351),v=r(44280),g=r(32114);const _=()=>n.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function x(e=B){return{plane:(0,f.vt)(e.plane),origin:(0,d.o8)(e.origin),basis1:(0,d.o8)(e.basis1),basis2:(0,d.o8)(e.basis2)}}function T(e,t=x()){return b(e.origin,e.basis1,e.basis2,t)}function b(e,t,r,o=x()){return(0,c.c)(o.origin,e),(0,c.c)(o.basis1,t),(0,c.c)(o.basis2,r),y(o),function(e,t){Math.abs((0,c.m)(e.basis1,e.basis2)/((0,c.l)(e.basis1)*(0,c.l)(e.basis2)))>1e-6&&_().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,c.m)(e.basis1,N(e)))>1e-6&&_().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,c.m)(N(e),e.origin)-e.plane[3])>1e-6&&_().warn(t,"Plane offset is not consistent with plane origin")}(o,"fromValues()"),o}function y(e){(0,f.mR)(e.basis2,e.basis1,e.origin,e.plane)}function A(e,t,r){e!==r&&T(e,r);const o=(0,c.j)(g.rq.get(),N(e),t);return(0,c.g)(r.origin,r.origin,o),r.plane[3]-=t,r}function E(e,t=x()){const r=(e[2]-e[0])/2,o=(e[3]-e[1])/2;return(0,c.s)(t.origin,e[0]+r,e[1]+o,0),(0,c.s)(t.basis1,r,0,0),(0,c.s)(t.basis2,0,o,0),(0,f.fA)(0,0,1,0,t.plane),t}function S(e,t,r){return!!(0,f.Ui)(e.plane,t,r)&&P(e,r)}function M(e,t,r){const o=F.get();D(e,t,o,F.get());let n=Number.POSITIVE_INFINITY;for(const a of U){const s=H(e,a,z.get()),l=g.rq.get();if((0,f.T7)(o,s,l)){const e=(0,c.E)(g.rq.get(),t.origin,l),o=Math.abs((0,i.XM)((0,c.m)(t.direction,e)));o<n&&(n=o,(0,c.c)(r,l))}}return n===Number.POSITIVE_INFINITY?w(e,t,r):r}function w(e,t,r){if(S(e,t,r))return r;const o=F.get(),i=F.get();D(e,t,o,i);let n=Number.POSITIVE_INFINITY;for(const a of U){const s=H(e,a,z.get()),l=g.rq.get();if((0,f.gv)(o,s,l)){const e=(0,p.kb)(t,l);if(!(0,f.Tj)(i,l))continue;e<n&&(n=e,(0,c.c)(r,l))}}return R(e,t.origin)<n&&C(e,t.origin,r),r}function C(e,t,r){const o=(0,f._I)(e.plane,t,g.rq.get()),i=(0,m.H6)(L(e,e.basis1),o,-1,1,g.rq.get()),n=(0,m.H6)(L(e,e.basis2),o,-1,1,g.rq.get());return(0,c.f)(r,(0,c.g)(g.rq.get(),i,n),e.origin),r}function O(e,t,r){const{origin:o,basis1:i,basis2:n}=e,a=(0,c.f)(g.rq.get(),t,o),s=(0,v.gr)(i,a),l=(0,v.gr)(n,a),d=(0,v.gr)(N(e),a);return(0,c.s)(r,s,l,d)}function R(e,t){const r=O(e,t,g.rq.get()),{basis1:o,basis2:i}=e,n=(0,c.l)(o),a=(0,c.l)(i),s=Math.max(Math.abs(r[0])-n,0),l=Math.max(Math.abs(r[1])-a,0),d=r[2];return s*s+l*l+d*d}function I(e,t){const r=-e.plane[3];return(0,v.gr)(N(e),t)-r}function N(e){return(0,f.Qj)(e.plane)}function P(e,t){const r=(0,c.f)(g.rq.get(),t,e.origin),o=(0,c.q)(e.basis1),i=(0,c.q)(e.basis2),n=(0,c.m)(e.basis1,r),a=(0,c.m)(e.basis2,r);return-n-o<0&&n-o<0&&-a-i<0&&a-i<0}function L(e,t){const r=z.get();return(0,c.c)(r.origin,e.origin),(0,c.c)(r.vector,t),r}function H(e,t,r){const{basis1:o,basis2:i,origin:n}=e,a=(0,c.j)(g.rq.get(),o,t.origin[0]),s=(0,c.j)(g.rq.get(),i,t.origin[1]);(0,c.g)(r.origin,a,s),(0,c.g)(r.origin,r.origin,n);const l=(0,c.j)(g.rq.get(),o,t.direction[0]),d=(0,c.j)(g.rq.get(),i,t.direction[1]);return(0,c.j)(r.vector,(0,c.g)(l,l,d),2),r}function D(e,t,r,o){const i=N(e);(0,f.mR)(i,t.direction,t.origin,r),(0,f.mR)((0,f.Qj)(r),i,t.origin,o)}const B={plane:(0,f.vt)(),origin:(0,d.fA)(0,0,0),basis1:(0,d.fA)(1,0,0),basis2:(0,d.fA)(0,1,0)},F=new a.I(f.vt),z=new a.I(m.vt),V=(0,d.vt)(),G=new a.I((()=>x())),U=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],W=(0,l.vt)(),j=(0,l.vt)();Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:class{constructor(){this.plane=(0,f.vt)(),this.origin=(0,d.vt)(),this.basis1=(0,d.vt)(),this.basis2=(0,d.vt)()}},altitudeAt:I,axisAt:function(e,t,r,o){return function(e,t,r){switch(t){case h._.X:(0,c.c)(r,e.basis1),(0,c.n)(r,r);break;case h._.Y:(0,c.c)(r,e.basis2),(0,c.n)(r,r);break;case h._.Z:(0,c.c)(r,N(e))}return r}(e,r,o)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:w,closestPointOnSilhouette:M,copy:T,copyWithoutVerify:function(e,t){(0,c.c)(t.origin,e.origin),(0,c.c)(t.basis1,e.basis1),(0,c.c)(t.basis2,e.basis2),(0,f.C)(t.plane,e.plane)},create:x,distance:function(e,t){return Math.sqrt(R(e,t))},distance2:R,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const o of U){const i=H(e,o,z.get()),n=(0,m.kb)(i,t);n>r&&(r=n)}return Math.sqrt(r)},elevate:A,equals:function(e,t){return(0,c.e)(e.basis1,t.basis1)&&(0,c.e)(e.basis2,t.basis2)&&(0,c.e)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,f.Tj)(e.plane,t)&&P(e,t)},fromAABoundingRect:E,fromValues:b,getExtent:function(e,t){const r=e.basis1[0],o=e.basis2[1],[i,n]=e.origin;return(0,u.fA)(i-r,n-o,i+o,n+o,t)},intersectRay:S,intersectRayClosestSilhouette:function(e,t,r){if(S(e,t,r))return r;const o=M(e,t,g.rq.get());return(0,c.g)(r,t.origin,(0,c.j)(g.rq.get(),t.direction,(0,c.p)(t.origin,o)/(0,c.l)(t.direction))),r},normal:N,projectPoint:C,projectPointLocal:O,rotate:function(e,t,r,o){return e!==o&&T(e,o),(0,s.$0)(j,t,r),(0,c.h)(o.basis1,e.basis1,j),(0,c.h)(o.basis2,e.basis2,j),y(o),o},setAltitudeAt:function(e,t,r,o){const i=I(e,t),n=(0,c.j)(V,N(e),r-i);return(0,c.g)(o,t,n),o},setExtent:function(e,t,r){return E(t,r),A(r,I(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&T(e,r),(0,s.B8)(W,t),(0,s.mg)(W,W),(0,c.h)(r.basis1,e.basis1,W),(0,c.h)(r.basis2,e.basis2,W),(0,c.h)((0,f.Qj)(r.plane),(0,f.Qj)(e.plane),W),(0,c.h)(r.origin,e.origin,t),(0,f.mP)(r.plane,r.plane,r.origin),r},up:B,updateUnboundedPlane:y,wrap:function(e,t,r){const o=G.get();return o.origin=e,o.basis1=t,o.basis2=r,o.plane=(0,f.LV)(0,0,0,0),y(o),o}},Symbol.toStringTag,{value:"Module"}));var q=r(76412);r(24151),(0,i.kU)(10),(0,i.kU)(12),(0,i.kU)(70),(0,i.kU)(40);const k={scale:0,factor:0,minScaleFactor:0};function $(e,t,r,o,n){let a=(r.screenLength||0)*e.pixelRatio;null!=n&&(a=function(e,t,r,o){return function(e,t){return(0,i.Cc)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}(e,function(e,t,r){const o=r.parameters;return k.scale=Math.min(o.divisor/(t-o.offset),1),k.factor=function(e){return Math.abs(e*e*e)}(e),k}(t,r,o))}(a,o,t,n));const s=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,i.qE)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function Y(e,t){let r=!1;for(const i in t){const n=t[i];void 0!==n&&(Array.isArray(n)?Array.isArray(e[i])&&(0,o.aI)(n,e[i])||(e[i]=n.slice(),r=!0):e[i]!==n&&(r=!0,e[i]=n))}return r}(0,q.c)();const X={multiply:1,ignore:2,replace:3,tint:4}},60517:(e,t,r)=>{r.d(t,{z:()=>c});var o=r(49255),i=r(76662),n=r(35093),a=r(63365),s=r(2597),l=r(14327);function c(e,t){e.include(i.Q,t),e.fragment.include(a.a);const r=t.output===o.V.Highlight,c=t.output===o.V.ObjectAndLayerIdColor,d=t.output===o.V.Color&&t.transparencyPassType===l.y.ColorAlpha,u=t.discardTransparentFragments;d&&(e.outputs.add("fragColor","vec4",0),e.outputs.add("fragAlpha","float",1)),e.fragment.code.add(s.H`
1081
- void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition) {
1082
- ${c?s.H`finalColor.a = 1.0;`:""}
1083
-
1084
- ${u?s.H`
1085
- if (finalColor.a < ${s.H.float(n.Q)}){
1086
- discard;
1087
- return;
1088
- }`:""}
1089
-
1090
- finalColor = highlightSlice(finalColor, vWorldPosition);
1091
- ${d?s.H`
1092
- fragColor = premultiplyAlpha(finalColor);
1093
- fragAlpha = finalColor.a;
1094
- `:s.H`fragColor = finalColor;`}
1095
- ${r?s.H`outputHighlight();`:""};
1096
- ${c?s.H`outputObjectAndLayerIdColor();`:""}
1097
- }
1098
- `)}},28449:(e,t,r)=>{function o(e,t){const r=e.length;for(let o=0;o<r;++o)n[0]=e[o],t[o]=n[0];return t}function i(e,t){const r=e.length;for(let o=0;o<r;++o)n[0]=e[o],n[1]=e[o]-n[0],t[o]=n[1];return t}r.d(t,{Zo:()=>o,jA:()=>i});const n=new Float32Array(2)},90644:(e,t,r)=>{r.d(t,{Ey:()=>T,Xt:()=>l,kn:()=>c,p3:()=>n,wE:()=>d});var o=r(89192),i=r(63907);function n(e,t,r,o,n=i.Tb.ADD,a=i.Tb.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:o,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const a={face:i.Y7.BACK,mode:i.Ac.CCW},s={face:i.Y7.FRONT,mode:i.Ac.CCW},l=e=>e===o.s2.Back?a:e===o.s2.Front?s:null,c={zNear:0,zFar:1},d={r:!0,g:!0,b:!0,a:!0};function u(e){return A.intern(e)}function h(e){return S.intern(e)}function m(e){return w.intern(e)}function f(e){return O.intern(e)}function p(e){return I.intern(e)}function v(e){return P.intern(e)}function g(e){return H.intern(e)}function _(e){return B.intern(e)}function x(e){return z.intern(e)}function T(e){return G.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 y(e){return"["+e.join(",")+"]"}const A=new b(E,(e=>({__tag:"Blending",...e})));function E(e){return e?y([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 S=new b(M,(e=>({__tag:"Culling",...e})));function M(e){return e?y([e.face,e.mode]):null}const w=new b(C,(e=>({__tag:"PolygonOffset",...e})));function C(e){return e?y([e.factor,e.units]):null}const O=new b(R,(e=>({__tag:"DepthTest",...e})));function R(e){return e?y([e.func]):null}const I=new b(N,(e=>({__tag:"StencilTest",...e})));function N(e){return e?y([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const P=new b(L,(e=>({__tag:"DepthWrite",...e})));function L(e){return e?y([e.zNear,e.zFar]):null}const H=new b(D,(e=>({__tag:"ColorWrite",...e})));function D(e){return e?y([e.r,e.g,e.b,e.a]):null}const B=new b(F,(e=>({__tag:"StencilWrite",...e})));function F(e){return e?y([e.mask]):null}const z=new b(V,(e=>({__tag:"DrawBuffers",...e})));function V(e){return e?y(e.buffers):null}const G=new b((function(e){return e?y([E(e.blending),M(e.culling),C(e.polygonOffset),R(e.depthTest),N(e.stencilTest),L(e.depthWrite),D(e.colorWrite),F(e.stencilWrite),V(e.drawBuffers)]):null}),(e=>({blending:u(e.blending),culling:h(e.culling),polygonOffset:m(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:p(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:g(e.colorWrite),stencilWrite:_(e.stencilWrite),drawBuffers:x(e.drawBuffers)})))}}]);