@arcgis/core 4.27.0-next.20230321 → 4.27.0-next.20230323

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 (267) hide show
  1. package/analysis/LineOfSightAnalysisObserver.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/02b6227c156ee0d8eb66.js +1 -0
  4. package/assets/esri/core/workers/chunks/{7e0c65aa61c2ff0c3504.js → 1c98b92933a48cf96c1e.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{a27951dbe83c63f9d01a.js → 26bc91a9d9d7345a3eba.js} +1 -1
  6. package/assets/esri/core/workers/chunks/321f272d4c7ed6b0cb46.js +1 -0
  7. package/assets/esri/core/workers/chunks/{a09cc8e2ff43fe4afa04.js → 375628de4cfc71cb41c1.js} +1 -1
  8. package/assets/esri/core/workers/chunks/47bd558e2ce89f47f908.js +1 -0
  9. package/assets/esri/core/workers/chunks/4cb62855bb1ae608bfde.js +1 -0
  10. package/assets/esri/core/workers/chunks/4f0c2b6b200bf8222fd7.js +1 -0
  11. package/assets/esri/core/workers/chunks/5252f3cc244204edc299.js +1 -0
  12. package/assets/esri/core/workers/chunks/6f952a6464cf9e62dbac.js +1098 -0
  13. package/assets/esri/core/workers/chunks/76d6c1fc25f02bcf258e.js +1 -0
  14. package/assets/esri/core/workers/chunks/{d6ec7682de8fad9718e9.js → 77dccfaf1f9e778973b3.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{c5d872adce711ec61ede.js → 8980c5dc389c27368b73.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{6acaf28cba5d49a98fb6.js → 91b292f310f06a0cbf72.js} +1 -1
  17. package/assets/esri/core/workers/chunks/9bac27976e7a71268b7b.js +1 -0
  18. package/assets/esri/core/workers/chunks/{ff9efa829497557ec26a.js → aa4640a0207e0be224e2.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{81a6f4b43e047c3395c0.js → aebc5091bd4159197ce0.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{c8cd3fde6d8d43ddb954.js → b6cdf4daf07d9e55f61e.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{6b14673a4afd6ef81487.js → c76cabd2d2510a653dff.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{4be7647605300e07e843.js → c90fff7e28ba5b443b11.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{e637e47000f4dc48054d.js → cc7f4fd20443a2acf0f1.js} +1 -1
  24. package/assets/esri/core/workers/chunks/d19e9fab4f4fb765c6a3.js +1 -0
  25. package/assets/esri/core/workers/chunks/d9ef4891c8b0bdd90f5b.js +1 -0
  26. package/assets/esri/core/workers/chunks/{d92d6a43270fb0d366b4.js → de4f5c48efbcee82c3c1.js} +1 -1
  27. package/assets/esri/core/workers/chunks/f6e7948075b3742b4ef9.js +1 -0
  28. package/assets/esri/core/workers/chunks/{32f9b488915a4a8864e5.js → f8b9e0c1671e55b61904.js} +1 -1
  29. package/assets/esri/views/3d/analysis/Slice/images/heading-rotate.ts.svg +7 -28
  30. package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.svg +11 -0
  31. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList.json +1 -1
  32. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ar.json +1 -1
  33. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bg.json +1 -1
  34. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bs.json +1 -1
  35. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ca.json +1 -1
  36. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_cs.json +1 -1
  37. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_da.json +1 -1
  38. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_de.json +1 -1
  39. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_el.json +1 -1
  40. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_en.json +1 -1
  41. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_es.json +1 -1
  42. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_et.json +1 -1
  43. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fi.json +1 -1
  44. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fr.json +1 -1
  45. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_he.json +1 -1
  46. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hr.json +1 -1
  47. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hu.json +1 -1
  48. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_id.json +1 -1
  49. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_it.json +1 -1
  50. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ja.json +1 -1
  51. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ko.json +1 -1
  52. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lt.json +1 -1
  53. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lv.json +1 -1
  54. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nb.json +1 -1
  55. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nl.json +1 -1
  56. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pl.json +1 -1
  57. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-BR.json +1 -1
  58. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-PT.json +1 -1
  59. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ro.json +1 -1
  60. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ru.json +1 -1
  61. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sk.json +1 -1
  62. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sl.json +1 -1
  63. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sr.json +1 -1
  64. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sv.json +1 -1
  65. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_th.json +1 -1
  66. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_tr.json +1 -1
  67. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_uk.json +1 -1
  68. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_vi.json +1 -1
  69. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-CN.json +1 -1
  70. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-HK.json +1 -1
  71. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-TW.json +1 -1
  72. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  73. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  74. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  75. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  76. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  77. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  78. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  79. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  80. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  81. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  82. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  83. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  84. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  85. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  86. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  87. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  88. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  89. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  90. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  91. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  92. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  93. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  94. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  95. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  96. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  97. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  98. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  99. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  100. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  101. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  102. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  103. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  104. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  105. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  106. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  107. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  108. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  109. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  110. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  111. package/assets/esri/widgets/LayerList/t9n/LayerList.json +1 -1
  112. package/assets/esri/widgets/LayerList/t9n/LayerList_ar.json +1 -1
  113. package/assets/esri/widgets/LayerList/t9n/LayerList_bg.json +1 -1
  114. package/assets/esri/widgets/LayerList/t9n/LayerList_bs.json +1 -1
  115. package/assets/esri/widgets/LayerList/t9n/LayerList_ca.json +1 -1
  116. package/assets/esri/widgets/LayerList/t9n/LayerList_cs.json +1 -1
  117. package/assets/esri/widgets/LayerList/t9n/LayerList_da.json +1 -1
  118. package/assets/esri/widgets/LayerList/t9n/LayerList_de.json +1 -1
  119. package/assets/esri/widgets/LayerList/t9n/LayerList_el.json +1 -1
  120. package/assets/esri/widgets/LayerList/t9n/LayerList_en.json +1 -1
  121. package/assets/esri/widgets/LayerList/t9n/LayerList_es.json +1 -1
  122. package/assets/esri/widgets/LayerList/t9n/LayerList_et.json +1 -1
  123. package/assets/esri/widgets/LayerList/t9n/LayerList_fi.json +1 -1
  124. package/assets/esri/widgets/LayerList/t9n/LayerList_fr.json +1 -1
  125. package/assets/esri/widgets/LayerList/t9n/LayerList_he.json +1 -1
  126. package/assets/esri/widgets/LayerList/t9n/LayerList_hr.json +1 -1
  127. package/assets/esri/widgets/LayerList/t9n/LayerList_hu.json +1 -1
  128. package/assets/esri/widgets/LayerList/t9n/LayerList_id.json +1 -1
  129. package/assets/esri/widgets/LayerList/t9n/LayerList_it.json +1 -1
  130. package/assets/esri/widgets/LayerList/t9n/LayerList_ja.json +1 -1
  131. package/assets/esri/widgets/LayerList/t9n/LayerList_ko.json +1 -1
  132. package/assets/esri/widgets/LayerList/t9n/LayerList_lt.json +1 -1
  133. package/assets/esri/widgets/LayerList/t9n/LayerList_lv.json +1 -1
  134. package/assets/esri/widgets/LayerList/t9n/LayerList_nb.json +1 -1
  135. package/assets/esri/widgets/LayerList/t9n/LayerList_nl.json +1 -1
  136. package/assets/esri/widgets/LayerList/t9n/LayerList_pl.json +1 -1
  137. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-BR.json +1 -1
  138. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-PT.json +1 -1
  139. package/assets/esri/widgets/LayerList/t9n/LayerList_ro.json +1 -1
  140. package/assets/esri/widgets/LayerList/t9n/LayerList_ru.json +1 -1
  141. package/assets/esri/widgets/LayerList/t9n/LayerList_sk.json +1 -1
  142. package/assets/esri/widgets/LayerList/t9n/LayerList_sl.json +1 -1
  143. package/assets/esri/widgets/LayerList/t9n/LayerList_sr.json +1 -1
  144. package/assets/esri/widgets/LayerList/t9n/LayerList_sv.json +1 -1
  145. package/assets/esri/widgets/LayerList/t9n/LayerList_th.json +1 -1
  146. package/assets/esri/widgets/LayerList/t9n/LayerList_tr.json +1 -1
  147. package/assets/esri/widgets/LayerList/t9n/LayerList_uk.json +1 -1
  148. package/assets/esri/widgets/LayerList/t9n/LayerList_vi.json +1 -1
  149. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-CN.json +1 -1
  150. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-HK.json +1 -1
  151. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-TW.json +1 -1
  152. package/chunks/ComponentShader.glsl.js +1 -1
  153. package/chunks/DefaultMaterial.glsl.js +4 -4
  154. package/chunks/vec42.js +1 -1
  155. package/core/Loadable.js +1 -1
  156. package/core/accessorSupport/Property.js +1 -1
  157. package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
  158. package/core/analysisThemeUtils.js +1 -1
  159. package/core/maybe.js +1 -1
  160. package/geometry/support/buffer/math/vec4.js +1 -1
  161. package/interfaces.d.ts +1 -1
  162. package/layers/IntegratedMeshLayer.js +1 -1
  163. package/layers/LineOfSightLayer.js +1 -1
  164. package/layers/SceneLayer.js +1 -1
  165. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  166. package/layers/mixins/ImageryTileMixin.js +1 -1
  167. package/layers/mixins/RefreshableLayer.js +1 -1
  168. package/layers/support/SceneFilter.js +1 -1
  169. package/layers/support/SceneModifications.js +1 -1
  170. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  171. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  172. package/package.json +1 -1
  173. package/portal/PortalItemResource.js +1 -1
  174. package/portal/support/resourceUtils.js +1 -1
  175. package/support/revision.js +1 -1
  176. package/symbols/support/utils.js +1 -1
  177. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  178. package/views/2d/viewpointUtils.js +1 -1
  179. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  180. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  181. package/views/3d/analysis/Dimension/settings.js +1 -1
  182. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  183. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  184. package/views/3d/analysis/Slice/images/Factory.js +1 -1
  185. package/views/3d/analysis/Slice/images/generateTextures.js +1 -1
  186. package/views/3d/analysis/Slice/images/heading-rotate-svg.js +1 -1
  187. package/views/3d/analysis/Slice/images/tilt-rotate-svg.js +5 -0
  188. package/views/3d/analysis/Slice/settings.js +5 -0
  189. package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
  190. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  191. package/views/3d/environment/Stars.js +1 -1
  192. package/views/3d/interactive/Manipulator3D.js +1 -1
  193. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  194. package/views/3d/interactive/manipulatorUtils.js +1 -1
  195. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  196. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  197. package/views/3d/layers/PointCloudWorker.js +1 -1
  198. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  199. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  200. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  201. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  202. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  203. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  204. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  205. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  206. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  207. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  208. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  209. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  210. package/views/3d/layers/i3s/PointCloudRendererUtil.js +1 -1
  211. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  212. package/views/3d/layers/i3s/PointGraphic.js +1 -1
  213. package/views/3d/state/ViewState.js +1 -1
  214. package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
  215. package/views/3d/terrain/GeometryState.js +1 -1
  216. package/views/3d/terrain/PatchGeometry.js +1 -1
  217. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  218. package/views/3d/terrain/TileAgent.js +1 -1
  219. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  220. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  221. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  222. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +6 -5
  223. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +1 -1
  224. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +11 -11
  225. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +1 -1
  226. package/views/3d/webgl-engine/lib/AnimationTimeStep.js +1 -1
  227. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  228. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  229. package/views/3d/webgl-engine/lib/Normals.js +5 -0
  230. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  231. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  232. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  233. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  234. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  235. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  236. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  237. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  238. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  239. package/views/LayerViewManager.js +1 -1
  240. package/views/SceneView.js +1 -1
  241. package/views/draw/support/Reshape.js +1 -1
  242. package/views/layers/SceneLayerView.js +1 -1
  243. package/views/support/colorUtils.js +1 -1
  244. package/views/webgl/ShaderTranspiler.js +1 -1
  245. package/widgets/BasemapLayerList.js +1 -1
  246. package/widgets/Daylight/DaylightViewModel.js +1 -1
  247. package/widgets/Expand.js +1 -1
  248. package/widgets/FeatureForm/FieldInput.js +1 -1
  249. package/widgets/LayerList.js +1 -1
  250. package/widgets/Search.js +1 -1
  251. package/widgets/Sketch/SketchViewModel.js +1 -1
  252. package/assets/esri/core/workers/chunks/0487ab23a20ec356ab4c.js +0 -1
  253. package/assets/esri/core/workers/chunks/29ee4f14602caf6967e4.js +0 -1
  254. package/assets/esri/core/workers/chunks/2c0775541cfec9d43acb.js +0 -1
  255. package/assets/esri/core/workers/chunks/4879164b48da9ad4547a.js +0 -1
  256. package/assets/esri/core/workers/chunks/69060e5cffc19e76062a.js +0 -1
  257. package/assets/esri/core/workers/chunks/87edeb09a948122fa030.js +0 -1
  258. package/assets/esri/core/workers/chunks/92951b85676df776961f.js +0 -1100
  259. package/assets/esri/core/workers/chunks/a71a5c8a9aa302bf6f01.js +0 -1
  260. package/assets/esri/core/workers/chunks/ad5c61daaed286c74982.js +0 -1
  261. package/assets/esri/core/workers/chunks/bc002e4dff8859571a7a.js +0 -1
  262. package/assets/esri/core/workers/chunks/ef2d3e84cd58df5f80af.js +0 -1
  263. package/assets/esri/core/workers/chunks/fec5e55e0fbf1710e22d.js +0 -1
  264. package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.svg +0 -80
  265. package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.png +0 -0
  266. package/views/3d/analysis/Slice/images/tilt-rotate-png.js +0 -5
  267. package/views/3d/webgl-engine/core/shaderLibrary/util/DecodeNormal.glsl.js +0 -8
@@ -0,0 +1,1098 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4815],{32078:(e,t,r)=>{r.d(t,{D:()=>W,b:()=>G});var i=r(13598),o=r(1391),n=r(62707),a=r(55039),s=r(51546),l=r(77171),c=r(47624),d=r(60624),u=r(37099),h=r(76056),f=r(135),m=r(11317),p=r(15719),_=r(92555),g=r(89136),v=r(15817),T=r(72160),x=r(89753),b=r(5802),E=r(42001),A=r(19419),S=r(26322),w=r(85504),R=r(22539),y=r(57806),C=r(92302),O=r(96310),M=r(85787),P=r(90692),N=r(93669),I=r(172),L=r(71250),D=r(21437),H=r(74709),F=r(8319),B=r(33680),U=r(98069),V=r(93144),z=r(35065);function G(e){const t=new B.kG,{vertex:r,fragment:G,varyings:W}=t;if((0,N.Sv)(r,e),t.include(u.f),W.add("vpos","vec3"),t.include(C.k,e),t.include(c.f,e),t.include(_.L,e),e.hasColorTextureTransform&&t.include(y.av),e.output===a.H.Color||e.output===a.H.Alpha){e.hasNormalTextureTransform&&t.include(y.NI),e.hasEmissionTextureTransform&&t.include(y.R5),e.hasOcclusionTextureTransform&&t.include(y.jF),e.hasMetallicRoughnessTextureTransform&&t.include(y.DT),(0,N.hY)(r,e),t.include(d.O,e),t.include(l.w,e);const a=e.normalType===d.r.Attribute||e.normalType===d.r.CompressedAttribute;a&&e.offsetBackfaces&&t.include(n.w),t.include(v.Q,e),t.include(p.Bb,e),e.instancedColor&&t.attributes.add(z.T.INSTANCECOLOR,"vec4"),W.add("vPositionLocal","vec3"),t.include(f.D,e),t.include(o.qj,e),t.include(h.R,e),t.include(m.c,e),r.uniforms.add(new L.N("externalColor",(e=>e.externalColor))),W.add("vcolorExt","vec4"),e.hasMultipassTerrain&&W.add("depth","float"),e.hasModelTransformation&&r.uniforms.add(new F.g("model",(e=>null!=e.modelTransformation?e.modelTransformation:i.I))),r.code.add(H.H`
2
+ void main(void) {
3
+ forwardNormalizedVertexColor();
4
+ vcolorExt = externalColor;
5
+ ${e.instancedColor?"vcolorExt *= instanceColor;":""}
6
+ vcolorExt *= vvColor();
7
+ vcolorExt *= getSymbolColor();
8
+ forwardColorMixMode();
9
+
10
+ if (vcolorExt.a < ${H.H.float(O.b)}) {
11
+ gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
12
+ } else {
13
+ vpos = calculateVPos();
14
+ vPositionLocal = vpos - view[3].xyz;
15
+ vpos = subtractOrigin(vpos);
16
+ ${a?H.H`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));`:""}
17
+ vpos = addVerticalOffset(vpos, localOrigin);
18
+ ${e.hasVertexTangents?"vTangent = dpTransformVertexTangent(tangent);":""}
19
+ gl_Position = transformPosition(proj, view, ${e.hasModelTransformation?"model,":""} vpos);
20
+ ${a&&e.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
21
+ }
22
+
23
+ ${e.hasMultipassTerrain?"depth = (view * vec4(vpos, 1.0)).z;":""}
24
+ forwardLinearDepth();
25
+ forwardTextureCoordinates();
26
+ ${e.hasColorTextureTransform?H.H`forwardColorUV();`:""}
27
+ ${e.hasNormalTextureTransform?H.H`forwardNormalUV();`:""}
28
+ ${e.hasEmissionTextureTransform?H.H`forwardEmissiveUV();`:""}
29
+ ${e.hasOcclusionTextureTransform?H.H`forwardOcclusionUV();`:""}
30
+ ${e.hasMetallicRoughnessTextureTransform?H.H`forwardMetallicRoughnessUV();`:""}
31
+ }
32
+ `)}return e.output===a.H.Alpha&&(t.include(s.f5,e),t.include(M.z,e),t.include(E.l,e),G.uniforms.add([new D.p("opacity",(e=>e.opacity)),new D.p("layerOpacity",(e=>e.layerOpacity))]),e.hasColorTexture&&G.uniforms.add(new U.A("tex",(e=>e.texture))),G.include(P.y),G.code.add(H.H`
33
+ void main() {
34
+ discardBySlice(vpos);
35
+ ${e.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, 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
+ ${e.hasVertexColors?H.H`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:H.H`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
41
+ fragColor = vec4(opacity_);
42
+ }
43
+ `)),e.output===a.H.Color&&(t.include(s.f5,e),t.include(x.XP,e),t.include(T.K,e),t.include(M.z,e),t.include(e.instancedDoublePrecision?R.hb:R.XE,e),t.include(E.l,e),(0,N.hY)(G,e),G.uniforms.add([r.uniforms.get("localOrigin"),new I.J("ambient",(e=>e.ambient)),new I.J("diffuse",(e=>e.diffuse)),new D.p("opacity",(e=>e.opacity)),new D.p("layerOpacity",(e=>e.layerOpacity))]),e.hasColorTexture&&G.uniforms.add(new U.A("tex",(e=>e.texture))),t.include(w.jV,e),t.include(S.T,e),G.include(P.y),t.include(A.k,e),(0,x.PN)(G),(0,x.sC)(G),(0,b.F1)(G),G.code.add(H.H`
44
+ void main() {
45
+ discardBySlice(vpos);
46
+ ${e.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""}
47
+ ${e.hasColorTexture?H.H`
48
+ vec4 texColor = texture(tex, ${e.hasColorTextureTransform?H.H`colorUV`:H.H`vuv0`});
49
+ ${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
50
+ discardOrAdjustAlpha(texColor);`:H.H`vec4 texColor = vec4(1.0);`}
51
+ shadingParams.viewDirection = normalize(vpos - cameraPosition);
52
+ ${e.normalType===d.r.ScreenDerivative?H.H`
53
+ vec3 normal = screenDerivativeNormal(vPositionLocal);`:H.H`
54
+ shadingParams.normalView = vNormalWorld;
55
+ vec3 normal = shadingNormal(shadingParams);`}
56
+ ${e.pbrMode===w.f7.Normal?"applyPBRFactors();":""}
57
+ float ssao = evaluateAmbientOcclusionInverse();
58
+ ssao *= getBakedOcclusion();
59
+
60
+ vec3 posWorld = vpos + localOrigin;
61
+
62
+ float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
63
+ float shadow = ${e.receiveShadows?"readShadowMap(vpos, linearDepth)":e.spherical?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
64
+
65
+ vec3 matColor = max(ambient, diffuse);
66
+ ${e.hasVertexColors?H.H`
67
+ vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
68
+ float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:H.H`
69
+ vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
70
+ float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
71
+ ${e.hasNormalTexture?H.H`
72
+ mat3 tangentSpace = ${e.hasVertexTangents?"computeTangentSpace(normal);":"computeTangentSpace(normal, vpos, vuv0);"}
73
+ vec3 shadingNormal = computeTextureNormal(tangentSpace, ${e.hasNormalTextureTransform?H.H`normalUV`:"vuv0"});`:H.H`vec3 shadingNormal = normal;`}
74
+ vec3 normalGround = ${e.spherical?H.H`normalize(posWorld);`:H.H`vec3(0.0, 0.0, 1.0);`}
75
+
76
+ ${e.snowCover?H.H`
77
+ float snow = smoothstep(0.5, 0.55, dot(normal, normalGround));
78
+ albedo = mix(albedo, vec3(1), snow);
79
+ shadingNormal = mix(shadingNormal, normal, snow);
80
+ ssao = mix(ssao, 1.0, snow);`:""}
81
+
82
+ vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
83
+
84
+ ${e.pbrMode===w.f7.Normal||e.pbrMode===w.f7.Schematic?H.H`
85
+ float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
86
+ ${e.snowCover?H.H`
87
+ mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);
88
+ emission = mix(emission, vec3(0.0), snow);`:""}
89
+
90
+ 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);`}
91
+ fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
92
+ ${e.transparencyPassType===V.A.Color?H.H`fragColor = premultiplyAlpha(fragColor);`:""}
93
+ }
94
+ `)),t.include(g.s,e),t}const W=Object.freeze(Object.defineProperty({__proto__:null,build:G},Symbol.toStringTag,{value:"Module"}))},41846:(e,t,r)=>{r.d(t,{R:()=>F,b:()=>H});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),d=r(37099),u=r(76056),h=r(135),f=r(11317),m=r(92555),p=r(89136),_=r(72160),g=r(89753),v=r(5802),T=r(42001),x=r(26322),b=r(85504),E=r(22539),A=r(92302),S=r(96310),w=r(85787),R=r(90692),y=r(93669),C=r(172),O=r(71250),M=r(21437),P=r(74709),N=r(33680),I=r(98069),L=r(93144),D=r(35065);function H(e){const t=new N.kG,{vertex:r,fragment:H,varyings:F}=t;return(0,y.Sv)(r,e),t.include(d.f),F.add("vpos","vec3"),t.include(A.k,e),t.include(l.f,e),t.include(m.L,e),e.output!==n.H.Color&&e.output!==n.H.Alpha||((0,y.hY)(t.vertex,e),t.include(c.O,e),t.include(s.w,e),e.offsetBackfaces&&t.include(o.w),e.instancedColor&&t.attributes.add(D.T.INSTANCECOLOR,"vec4"),F.add("vNormalWorld","vec3"),F.add("localvpos","vec3"),e.hasMultipassTerrain&&F.add("depth","float"),t.include(h.D,e),t.include(i.qj,e),t.include(u.R,e),t.include(f.c,e),r.uniforms.add(new O.N("externalColor",(e=>e.externalColor))),F.add("vcolorExt","vec4"),r.code.add(P.H`
95
+ void main(void) {
96
+ forwardNormalizedVertexColor();
97
+ vcolorExt = externalColor;
98
+ ${e.instancedColor?"vcolorExt *= instanceColor;":""}
99
+ vcolorExt *= vvColor();
100
+ vcolorExt *= getSymbolColor();
101
+ forwardColorMixMode();
102
+
103
+ if (vcolorExt.a < ${P.H.float(S.b)}) {
104
+ gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
105
+ } else {
106
+ vpos = calculateVPos();
107
+ localvpos = vpos - view[3].xyz;
108
+ vpos = subtractOrigin(vpos);
109
+ vNormalWorld = dpNormal(vvLocalNormal(normalModel()));
110
+ vpos = addVerticalOffset(vpos, localOrigin);
111
+ gl_Position = transformPosition(proj, view, vpos);
112
+ ${e.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
113
+ }
114
+ ${e.hasMultipassTerrain?P.H`depth = (view * vec4(vpos, 1.0)).z;`:""}
115
+ forwardLinearDepth();
116
+ forwardTextureCoordinates();
117
+ }
118
+ `)),e.output===n.H.Alpha&&(t.include(a.f5,e),t.include(w.z,e),t.include(T.l,e),H.uniforms.add([new M.p("opacity",(e=>e.opacity)),new M.p("layerOpacity",(e=>e.layerOpacity))]),e.hasColorTexture&&H.uniforms.add(new I.A("tex",(e=>e.texture))),H.include(R.y),H.code.add(P.H`
119
+ void main() {
120
+ discardBySlice(vpos);
121
+ ${e.hasMultipassTerrain?P.H`terrainDepthTest(gl_FragCoord, depth);`:""}
122
+ ${e.hasColorTexture?P.H`
123
+ vec4 texColor = texture(tex, ${e.hasColorTextureTransform?P.H`colorUV`:P.H`vuv0`});
124
+ ${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
125
+ discardOrAdjustAlpha(texColor);`:P.H`vec4 texColor = vec4(1.0);`}
126
+ ${e.hasVertexColors?P.H`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:P.H`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
127
+
128
+ fragColor = vec4(opacity_);
129
+ }
130
+ `)),e.output===n.H.Color&&(t.include(a.f5,e),t.include(g.XP,e),t.include(_.K,e),t.include(w.z,e),t.include(e.instancedDoublePrecision?E.hb:E.XE,e),t.include(T.l,e),(0,y.hY)(t.fragment,e),(0,v.Pe)(H),(0,g.PN)(H),(0,g.sC)(H),H.uniforms.add([r.uniforms.get("localOrigin"),r.uniforms.get("view"),new C.J("ambient",(e=>e.ambient)),new C.J("diffuse",(e=>e.diffuse)),new M.p("opacity",(e=>e.opacity)),new M.p("layerOpacity",(e=>e.layerOpacity))]),e.hasColorTexture&&H.uniforms.add(new I.A("tex",(e=>e.texture))),t.include(b.jV,e),t.include(x.T,e),H.include(R.y),(0,v.F1)(H),H.code.add(P.H`
131
+ void main() {
132
+ discardBySlice(vpos);
133
+ ${e.hasMultipassTerrain?P.H`terrainDepthTest(gl_FragCoord, depth);`:""}
134
+ ${e.hasColorTexture?P.H`
135
+ vec4 texColor = texture(tex, ${e.hasColorTextureTransform?P.H`colorUV`:P.H`vuv0`});
136
+ ${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
137
+ discardOrAdjustAlpha(texColor);`:P.H`vec4 texColor = vec4(1.0);`}
138
+ vec3 viewDirection = normalize(vpos - cameraPosition);
139
+ ${e.pbrMode===b.f7.Normal?"applyPBRFactors();":""}
140
+ float ssao = evaluateAmbientOcclusionInverse();
141
+ ssao *= getBakedOcclusion();
142
+
143
+ float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
144
+ vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
145
+ ${e.receiveShadows?"float shadow = readShadowMap(vpos, linearDepth);":e.spherical?"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow = 0.0;"}
146
+ vec3 matColor = max(ambient, diffuse);
147
+ ${e.hasVertexColors?P.H`
148
+ vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
149
+ float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:P.H`
150
+ vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
151
+ float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
152
+ ${e.snowCover?P.H`albedo = mix(albedo, vec3(1), 0.9);`:P.H``}
153
+ ${P.H`
154
+ vec3 shadingNormal = normalize(vNormalWorld);
155
+ albedo *= 1.2;
156
+ vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
157
+ float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
158
+ float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0);
159
+ float treeRadialFalloff = vColor.r;
160
+ float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
161
+ additionalLight += backLightFactor * mainLightIntensity;`}
162
+ ${e.pbrMode===b.f7.Normal||e.pbrMode===b.f7.Schematic?e.spherical?P.H`vec3 normalGround = normalize(vpos + localOrigin);`:P.H`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:P.H``}
163
+ ${e.pbrMode===b.f7.Normal||e.pbrMode===b.f7.Schematic?P.H`
164
+ float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
165
+ ${e.snowCover?P.H`
166
+ mrr = vec3(0.0, 1.0, 0.04);
167
+ emission = vec3(0.0);`:""}
168
+
169
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:P.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
170
+ fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
171
+ ${e.transparencyPassType===L.A.Color?P.H`fragColor = premultiplyAlpha(fragColor);`:P.H``}
172
+ }
173
+ `)),t.include(p.s,e),t}const F=Object.freeze(Object.defineProperty({__proto__:null,build:H},Symbol.toStringTag,{value:"Module"}))},25377:(e,t,r)=>{r.d(t,{S:()=>g,b:()=>m,g:()=>p});var i=r(4307),o=r(97323),n=r(51666),a=r(5543),s=r(20787),l=r(19693),c=r(21437),d=r(74709),u=r(33680),h=r(98069);const f=16;function m(){const e=new u.kG,t=e.fragment;return e.include(n.k),t.include(a.S),e.include(s.G),t.uniforms.add(new c.p("radius",((e,t)=>p(t.camera)))),t.code.add(d.H`vec3 sphere[16];
174
+ void fillSphere() {
175
+ sphere[0] = vec3(0.186937, 0.0, 0.0);
176
+ sphere[1] = vec3(0.700542, 0.0, 0.0);
177
+ sphere[2] = vec3(-0.864858, -0.481795, -0.111713);
178
+ sphere[3] = vec3(-0.624773, 0.102853, -0.730153);
179
+ sphere[4] = vec3(-0.387172, 0.260319, 0.007229);
180
+ sphere[5] = vec3(-0.222367, -0.642631, -0.707697);
181
+ sphere[6] = vec3(-0.01336, -0.014956, 0.169662);
182
+ sphere[7] = vec3(0.122575, 0.1544, -0.456944);
183
+ sphere[8] = vec3(-0.177141, 0.85997, -0.42346);
184
+ sphere[9] = vec3(-0.131631, 0.814545, 0.524355);
185
+ sphere[10] = vec3(-0.779469, 0.007991, 0.624833);
186
+ sphere[11] = vec3(0.308092, 0.209288,0.35969);
187
+ sphere[12] = vec3(0.359331, -0.184533, -0.377458);
188
+ sphere[13] = vec3(0.192633, -0.482999, -0.065284);
189
+ sphere[14] = vec3(0.233538, 0.293706, -0.055139);
190
+ sphere[15] = vec3(0.417709, -0.386701, 0.442449);
191
+ }
192
+ float fallOffFunction(float vv, float vn, float bias) {
193
+ float f = max(radius * radius - vv, 0.0);
194
+ return f * f * f * max(vn - bias, 0.0);
195
+ }`),t.code.add(d.H`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) {
196
+ vec3 v = Q - C;
197
+ float vv = dot(v, v);
198
+ float vn = dot(normalize(v), n_C);
199
+ return fallOffFunction(vv, vn, 0.1);
200
+ }`),t.uniforms.add([new l.A("nearFar",((e,t)=>t.camera.nearFar)),new h.A("normalMap",(e=>e.normalTexture)),new h.A("depthMap",(e=>e.depthTexture)),new l.A("zScale",((e,t)=>(0,s.R)(t))),new c.p("projScale",(e=>e.projScale)),new h.A("rnm",(e=>e.noiseTexture)),new l.A("rnmScale",((e,t)=>(0,i.s)(_,t.camera.fullWidth/e.noiseTexture.descriptor.width,t.camera.fullHeight/e.noiseTexture.descriptor.height))),new c.p("intensity",(e=>e.intensity)),new l.A("screenSize",((e,t)=>(0,i.s)(_,t.camera.fullWidth,t.camera.fullHeight)))]),t.code.add(d.H`
201
+ void main(void) {
202
+ fillSphere();
203
+ vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0);
204
+ float currentPixelDepth = linearDepthFromTexture(depthMap, uv, nearFar);
205
+
206
+ if (-currentPixelDepth>nearFar.y || -currentPixelDepth<nearFar.x) {
207
+ fragColor = vec4(0);
208
+ return;
209
+ }
210
+
211
+ vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy,currentPixelDepth);
212
+
213
+ // get the normal of current fragment
214
+ vec4 norm4 = texture(normalMap, uv);
215
+ vec3 norm = vec3(-1.0) + 2.0 * norm4.xyz;
216
+ bool isTerrain = norm4.w < 0.5;
217
+
218
+ float sum = 0.0;
219
+ vec3 tapPixelPos;
220
+
221
+ // note: the factor 2.0 should not be necessary, but makes ssao much nicer.
222
+ // bug or deviation from CE somewhere else?
223
+ float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y);
224
+
225
+ for(int i = 0; i < ${d.H.int(f)}; ++i) {
226
+ vec2 unitOffset = reflect(sphere[i], fres).xy;
227
+ vec2 offset = vec2(-unitOffset * radius * ps);
228
+
229
+ //don't use current or very nearby samples
230
+ if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){
231
+ continue;
232
+ }
233
+
234
+ vec2 tc = vec2(gl_FragCoord.xy + offset);
235
+ if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue;
236
+ vec2 tcTap = tc / screenSize;
237
+ float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap, nearFar);
238
+
239
+ if (isTerrain) {
240
+ if (texture(normalMap, tcTap).w < 0.5) {
241
+ continue;
242
+ }
243
+ }
244
+
245
+ tapPixelPos = reconstructPosition(tc, occluderFragmentDepth);
246
+
247
+ sum+= aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos);
248
+ }
249
+
250
+ // output the result
251
+ float A = max(1.0 - sum * intensity / float(${d.H.int(f)}), 0.0);
252
+
253
+ // Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2
254
+ A = (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2;
255
+ fragColor = vec4(A);
256
+ }
257
+ `),e}function p(e){return Math.max(10,20*e.computeRenderPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const _=(0,o.a)(),g=Object.freeze(Object.defineProperty({__proto__:null,build:m,getRadius:p},Symbol.toStringTag,{value:"Module"}))},59915:(e,t,r)=>{r.d(t,{S:()=>p,b:()=>m});var i=r(17896),o=r(51666),n=r(5543),a=r(98925),s=r(19693),l=r(21437),c=r(74709),d=r(33680),u=r(16374),h=r(98069);const f=4;function m(){const e=new d.kG,t=e.fragment;e.include(o.k);const r=(f+1)/2,m=1/(2*r*r);return t.include(n.S),t.uniforms.add([new h.A("depthMap",(e=>e.depthTexture)),new u.R("tex",(e=>e.colorTexture)),new a.q("blurSize",(e=>e.blurSize)),new l.p("projScale",((e,t)=>{const r=(0,i.i)(t.camera.eye,t.camera.center);return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),new s.A("nearFar",((e,t)=>t.camera.nearFar))]),t.code.add(c.H`
258
+ void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
259
+ float c = texture(tex, uv).r;
260
+ float d = linearDepthFromTexture(depthMap, uv, nearFar);
261
+
262
+ float ddiff = d - center_d;
263
+
264
+ float w = exp(-r * r * ${c.H.float(m)} - ddiff * ddiff * sharpness);
265
+ wTotal += w;
266
+ bTotal += w * c;
267
+ }
268
+ `),t.code.add(c.H`
269
+ void main(void) {
270
+ float b = 0.0;
271
+ float w_total = 0.0;
272
+
273
+ float center_d = linearDepthFromTexture(depthMap, uv, nearFar);
274
+
275
+ float sharpness = -0.05 * projScale / center_d;
276
+ for (int r = -${c.H.int(f)}; r <= ${c.H.int(f)}; ++r) {
277
+ float rf = float(r);
278
+ vec2 uvOffset = uv + rf * blurSize;
279
+ blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
280
+ }
281
+
282
+ fragColor = vec4(b / w_total);
283
+ }
284
+ `),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,n,a,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=n,c[6]=a,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>d,Z:()=>c,c:()=>i,f:()=>o});const c=n(),d=a(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:u,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>a,c:()=>o,d:()=>d,e:()=>l,n:()=>u,s:()=>c,t:()=>n});var i=r(72220);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return i.c.error("source and destination buffers need to have the same number of elements"),e;const a=e.length/o,s=r[0],l=r[1],c=r[2],d=r[4],u=r[5],h=r[6],f=r[8],m=r[9],p=r[10],_=r[12],g=r[13],v=r[14];let T=0,x=0;for(let r=0;r<a;r++){const r=t[T],i=t[T+1],a=t[T+2];e[x]=s*r+d*i+f*a+_,e[x+1]=l*r+u*i+m*a+g,e[x+2]=c*r+h*i+p*a+v,T+=n,x+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return void i.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,s=r[0],l=r[1],c=r[2],d=r[3],u=r[4],h=r[5],f=r[6],m=r[7],p=r[8];let _=0,g=0;for(let r=0;r<a;r++){const r=t[_],i=t[_+1],a=t[_+2];e[g]=s*r+d*i+f*a,e[g+1]=l*r+u*i+m*a,e[g+2]=c*r+h*i+p*a,_+=n,g+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],s+=a,l+=i}function d(e,t){u(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:u,normalizeView:d,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(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,{XO:()=>i,pJ:()=>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]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>d,zk:()=>c});var i=r(22021),o=r(22807),n=r(17896),a=r(65617),s=r(12981);function l(e){return e?{origin:(0,a.a)(e.origin),vector:(0,a.a)(e.vector)}:{origin:(0,a.c)(),vector:(0,a.c)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.b)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,o,a){const{vector:l,origin:c}=e,d=(0,n.b)(s.WM.get(),t,c),u=(0,n.e)(l,d)/(0,n.p)(l);return(0,n.g)(a,l,(0,i.uZ)(u,0,1)),(0,n.a)(a,a,e.origin)}(e,t,0,0,r)}(0,a.c)(),(0,a.c)(),new o.x((()=>l()))},14815:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>Rr,gltfToEngineResources:()=>Cr,parseUrl:()=>yr});var i=r(32243),o=r(21787),n=r(46521),a=r(52138),s=r(13598),l=r(17896),c=r(65617),d=r(60437),u=r(1533);function h(e,t=!1){return e<=u.DB?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var f=r(56481),m=r(20773),p=r(11077),_=r(10816),g=r(56067),v=r(75488),T=r(40270),x=r(91695),b=r(91911),E=r(15317),A=r(14682),S=r(1265);function w(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.O,n=(0,A.f)(1,0,0,0,1,0,t[0],t[1],1),a=(0,A.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,A.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,A.c)();return(0,o.m)(l,a,s),(0,o.m)(l,n,l),l}class R{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class y{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new R,this.numberOfVertices=0}}var C=r(3172),O=r(66643),M=r(43090),P=r(20102),N=r(92604);class I{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 i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var L=r(95330),D=r(23670);async function H(e,t){const{data:r}=await(0,C.default)(e,{responseType:"image",...t});return r}var F=r(51417),B=r(47026),U=r(24882);function V(e){if(e.length<u.DB)return Array.from(e);if((0,u.kJ)(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,u.Uc)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var z=r(44553),G=r(11726);class W{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this._children=void 0,(0,G.hu)(e.length>=1),(0,G.hu)(r.length%this._numIndexPerPrimitive==0),(0,G.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,G.hu)(3===i.size||4===i.size);const{data:o,size:n}=i,a=e.length;let s=n*r[this._numIndexPerPrimitive*e[0]];k.clear(),k.push(s);const d=(0,c.f)(o[s],o[s+1],o[s+2]),u=(0,c.a)(d);for(let t=0;t<a;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=n*r[i+e],k.push(s);let t=o[s];d[0]=Math.min(t,d[0]),u[0]=Math.max(t,u[0]),t=o[s+1],d[1]=Math.min(t,d[1]),u[1]=Math.max(t,u[1]),t=o[s+2],d[2]=Math.min(t,d[2]),u[2]=Math.max(t,u[2])}}this.bbMin=d,this.bbMax=u;const h=(0,l.h)((0,c.c)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(u[0]-d[0],u[1]-d[1]),u[2]-d[2]);let f=this.radius*this.radius;for(let e=0;e<k.length;++e){s=k.getItemAt(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<=f)continue;const a=Math.sqrt(n),l=.5*(a-this.radius);this.radius=this.radius+l,f=this.radius*this.radius;const c=l/a;h[0]+=t*c,h[1]+=r*c,h[2]+=i*c}this.center=h,k.clear()}getChildren(){if(this._children||(0,l.d)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,l.h)((0,c.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:o,size:n}=this.position;for(let a=0;a<t;++a){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=n*this.indices[s],c=o[l],d=o[l+1],u=o[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=n*this.indices[s+e];const t=o[l],r=o[l+1],i=o[l+2];t<c&&(c=t),r<d&&(d=r),i<u&&(u=i)}c<e[0]&&(t|=1),d<e[1]&&(t|=2),u<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==s[e]&&this._children.push(new W(s[e],this._numIndexPerPrimitive,this.indices,this.position));return this._children}static prune(){k.prune()}}const k=new z.Z({deallocator:null});var $=r(17662),q=r(4726),j=r(22807),X=r(16996);function Y(e,t,r){return(0,l.b)(J,t,e),(0,l.b)(K,r,e),(0,l.l)((0,l.f)(J,J,K))/2}r(12981),new j.x(X.Ue),new j.x((()=>{return e?{p0:(0,c.a)(e.p0),p1:(0,c.a)(e.p1),p2:(0,c.a)(e.p2)}:{p0:(0,c.c)(),p1:(0,c.c)(),p2:(0,c.c)()};var e}));const J=(0,c.c)(),K=(0,c.c)(),Z=(0,c.c)(),Q=(0,c.c)(),ee=(0,c.c)(),te=(0,c.c)();var re=r(99001);class ie{constructor(e){this.channel=e,this.id=(0,re.D)()}}var oe=r(35065);r(9820),(0,c.c)(),new Float32Array(6);class ne extends $.c{constructor(e,t,r=[],i=null,o=q.U.Mesh,n=null,a=-1){super(),this.material=e,this.mapPositions=i,this.type=o,this.objectAndLayerIdColor=n,this.edgeIndicesLength=a,this.visible=!0,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[e,r]of t)r&&this._vertexAttributes.set(e,{...r});if(null==r||0===r.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,U.KF)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,t]of r)t&&(this._indices.set(e,(0,U.mi)(t)),e===oe.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}instantiate(e={}){const t=new ne(e.material||this.material,[],void 0,this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._vertexAttributes.forEach(((e,r)=>{e.exclusive=!1,t._vertexAttributes.set(r,e)})),this._indices.forEach(((e,r)=>t._indices.set(r,e))),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){let t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:V(t.data)},this._vertexAttributes.set(e,t)),t}setAttributeData(e,t){const r=this._vertexAttributes.get(e);r&&this._vertexAttributes.set(e,{...r,exclusive:!0,data:t})}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?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===q.U.Mesh?this._computeAttachmentOriginTriangles(e):this.type===q.U.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,l.m)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(oe.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,l.s)(r,0,0,0),(0,l.s)(te,0,0,0);let n=0,a=0;for(let e=0;e<t.length-2;e+=3){const s=t[e]*i,c=t[e+1]*i,d=t[e+2]*i;(0,l.s)(Z,o[s],o[s+1],o[s+2]),(0,l.s)(Q,o[c],o[c+1],o[c+2]),(0,l.s)(ee,o[d],o[d+1],o[d+2]);const u=Y(Z,Q,ee);u?((0,l.a)(Z,Z,Q),(0,l.a)(Z,Z,ee),(0,l.g)(Z,Z,1/3*u),(0,l.a)(r,r,Z),n+=u):((0,l.a)(te,te,Z),(0,l.a)(te,te,Q),(0,l.a)(te,te,ee),a+=3)}return!(0===a&&0===n||(0!==n?((0,l.g)(r,r,1/n),0):0===a||((0,l.g)(r,te,1/a),0)))}(this.vertexAttributes.get(oe.T.POSITION),t,e)}_computeAttachmentOriginLines(e){const t=this.vertexAttributes.get(oe.T.POSITION),r=this.indices.get(oe.T.POSITION);return function(e,t,r,i){if(!e)return!1;(0,l.s)(i,0,0,0),(0,l.s)(te,0,0,0);let o=0,n=0;const{size:a,data:s}=e,c=t?t.length-1:s.length/a-1,d=c+(r?2:0);for(let e=0;e<d;e+=2){const r=e<c?e:c,d=e<c?e+1:0,u=(t?t[r]:r)*a,h=(t?t[d]:d)*a;Z[0]=s[u],Z[1]=s[u+1],Z[2]=s[u+2],Q[0]=s[h],Q[1]=s[h+1],Q[2]=s[h+2],(0,l.g)(Z,(0,l.a)(Z,Z,Q),.5);const f=(0,l.j)(Z,Q);f>0?((0,l.a)(i,i,(0,l.g)(Z,Z,f)),o+=f):0===o&&((0,l.a)(te,te,Z),n++)}return 0!==o?((0,l.g)(i,i,1/o),!0):0!==n&&((0,l.g)(i,te,1/n),!0)}(t,r,r&&function(e,t,r){return!(!("isClosed"in e)||!e.isClosed)&&(r?r.length>2:t.data.length>6)}(this.material.parameters,t,r),e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(oe.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,l.s)(r,0,0,0);let n=-1,a=0;for(let e=0;e<t.length;e++){const s=t[e]*i;n!==s&&(r[0]+=o[s],r[1]+=o[s+1],r[2]+=o[s+2],a++),n=s}return a>1&&(0,l.g)(r,r,1/a),a>0}(this.vertexAttributes.get(oe.T.POSITION),t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(oe.T.POSITION),t=this.vertexAttributes.get(oe.T.POSITION);if(!e||0===e.length||!t)return null;const r=this.type===q.U.Mesh?3:1;(0,G.hu)(e.length%r==0,"Indexing error: "+e.length+" not divisible by "+r);const i=(0,U.KF)(e.length/r);return new W(i,r,e,t)}get transformation(){return this._transformation??s.I}set transformation(e){this._transformation=e&&e!==s.I?(0,s.b)(e):null}get shaderTransformation(){return null!=this._shaderTransformer?this._shaderTransformer(this.transformation):this.transformation}get shaderTransformer(){return this._shaderTransformer}set shaderTransformer(e){this._shaderTransformer=e}get hasVolatileTransformation(){return null!=this._shaderTransformer}addHighlight(){const e=new ie(B.V_.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(74085),se=r(32448),le=r(22021),ce=r(70586),de=r(17452),ue=r(85958),he=r(88669),fe=r(51666),me=r(71250),pe=r(74709),_e=r(33680),ge=r(98069);class ve extends pe.K{constructor(){super(...arguments),this.color=(0,he.f)(1,1,1,1)}}Object.freeze(Object.defineProperty({__proto__:null,TextureOnlyPassParameters:ve,build:function(){const e=new _e.kG;return e.include(fe.k),e.fragment.uniforms.add([new ge.A("tex",(e=>e.texture)),new me.N("uColor",(e=>e.color))]),e.fragment.code.add(pe.H`void main() {
285
+ vec4 texColor = texture(tex, uv);
286
+ fragColor = texColor * uColor;
287
+ }`),e}},Symbol.toStringTag,{value:"Module"}));var Te=r(99880);let xe;var be,Ee;(Ee=be||(be={}))[Ee.ETC1_RGB=0]="ETC1_RGB",Ee[Ee.ETC2_RGBA=1]="ETC2_RGBA",Ee[Ee.BC1_RGB=2]="BC1_RGB",Ee[Ee.BC3_RGBA=3]="BC3_RGBA",Ee[Ee.BC4_R=4]="BC4_R",Ee[Ee.BC5_RG=5]="BC5_RG",Ee[Ee.BC7_M6_RGB=6]="BC7_M6_RGB",Ee[Ee.BC7_M5_RGBA=7]="BC7_M5_RGBA",Ee[Ee.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",Ee[Ee.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",Ee[Ee.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",Ee[Ee.ATC_RGB=11]="ATC_RGB",Ee[Ee.ATC_RGBA=12]="ATC_RGBA",Ee[Ee.FXT1_RGB=17]="FXT1_RGB",Ee[Ee.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",Ee[Ee.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",Ee[Ee.ETC2_EAC_R11=20]="ETC2_EAC_R11",Ee[Ee.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",Ee[Ee.RGBA32=13]="RGBA32",Ee[Ee.RGB565=14]="RGB565",Ee[Ee.BGR565=15]="BGR565",Ee[Ee.RGBA4444=16]="RGBA4444";var Ae=r(35371),Se=r(75656),we=r(45762);let Re=null,ye=null;async function Ce(){return null==ye&&(ye=function(){if(null==xe){const e=e=>(0,Te.V)(`esri/libs/basisu/${e}`);xe=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return xe}(),Re=await ye),ye}function Oe(e,t,r,i,o){const n=(0,we.RG)(t?Ae.q_.COMPRESSED_RGBA8_ETC2_EAC:Ae.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function Me(e){return e.getNumImages()>=1&&!e.isUASTC()}function Pe(e){return e.getFaces()>=1&&e.isETC1S()}function Ne(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[be.ETC2_RGBA,Ae.q_.COMPRESSED_RGBA8_ETC2_EAC]:[be.ETC1_RGB,Ae.q_.COMPRESSED_RGB8_ETC2]:c?i?[be.BC3_RGBA,Ae.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[be.BC1_RGB,Ae.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[be.RGBA32,Ae.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(a(e,d))),s(e,d,f[e]);const m=f.length>1,p=m?Ae.cw.LINEAR_MIPMAP_LINEAR:Ae.cw.LINEAR,_={...t,samplingMode:p,hasMipmap:m,internalFormat:u,width:o,height:n};return new Se.x(e,_,{type:"compressed",levels:f})}const Ie=N.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),Le=542327876,De=131072,He=4;function Fe(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Be=Fe("DXT1"),Ue=Fe("DXT3"),Ve=Fe("DXT5"),ze=31,Ge=0,We=1,ke=2,$e=3,qe=4,je=7,Xe=20,Ye=21;var Je,Ke,Ze=r(89917),Qe=r(54738),et=r(33696);class tt extends $.c{constructor(e,t){super(),this._data=e,this.type=q.U.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new se.Z,this._passParameters=new ve,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:Ae.e8.REPEAT,t:Ae.e8.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||B.CE.STRETCH,this.estimatedTexMemRequired=tt._estimateTexMemRequired(this._data,this.params),this._startPreload()}_startPreload(){const e=this._data;null!=e&&(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,de.jc)(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,de.HK)(e.src)||(0,de.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if(null==e)return 0;if((0,u.eP)(e)||(0,u.lq)(e))return t.encoding===B.Ti.KTX2_ENCODING?function(e,t){if(null==Re)return e.byteLength;const r=new Re.KTX2File(new Uint8Array(e)),i=Pe(r)?Oe(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===B.Ti.BASIS_ENCODING?function(e,t){if(null==Re)return e.byteLength;const r=new Re.BasisFile(new Uint8Array(e)),i=Me(r)?Oe(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?tt._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this._data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){return{target:Ae.No.TEXTURE_2D,pixelFormat:Ae.VI.RGBA,dataType:Ae.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?Ae.cw.LINEAR_MIPMAP_LINEAR:Ae.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:this.params.maxAnisotropy??(this.params.mipmap?e.parameters.maxMaxAnisotropy:1)}}get glTexture(){return this._glTexture}load(e,t){if(null!=this._glTexture)return this._glTexture;if(null!=this._loadingPromise)return this._loadingPromise;const r=this._data;return null==r?(this._glTexture=new Se.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof r?this._loadFromURL(e,t,r):r instanceof Image?this._loadFromImageElement(e,t,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,t,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r,t):((0,u.eP)(r)||(0,u.lq)(r))&&this.params.encoding===B.Ti.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,r)):((0,u.eP)(r)||(0,u.lq)(r))&&this.params.encoding===B.Ti.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,r)):((0,u.eP)(r)||(0,u.lq)(r))&&this.params.encoding===B.Ti.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,r)):(0,u.lq)(r)?this._loadFromPixelData(e,r):(0,u.eP)(r)?this._loadFromPixelData(e,new Uint8Array(r)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e,t,r){if(!(this._data instanceof HTMLVideoElement)||null==this._glTexture)return r;if(this._data.readyState<Je.HAVE_CURRENT_DATA||r===this._data.currentTime)return r;if(null!=this._powerOfTwoStretchInfo){const{framebuffer:r,vao:i,sourceTexture:o}=this._powerOfTwoStretchInfo;o.setData(this._data),this._drawStretchedTexture(e,t,r,i,o,this._glTexture)}else{const{videoWidth:e,videoHeight:t}=this._data,{width:r,height:i}=this._glTexture.descriptor;e!==r||t!==i?this._glTexture.updateData(0,0,0,Math.min(e,r),Math.min(t,i),this._data):this._glTexture.setData(this._data)}return this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.params.updateCallback&&this.params.updateCallback(),this._data.currentTime}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const{textureData:i,internalFormat:o,width:n,height:a}=(0,ce.s3)(function(e,t){const r=new Int32Array(e,0,ze);if(r[Ge]!==Le)return Ie.error("Invalid magic number in DDS header"),null;if(!(r[Xe]&He))return Ie.error("Unsupported format, must contain a FourCC code"),null;const i=r[Ye];let o,n;switch(i){case Be:o=8,n=Ae.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ue:o=16,n=Ae.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Ve:o=16,n=Ae.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Ie.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[qe],l=r[$e];0==(3&s)&&0==(3&l)||(Ie.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;r[ke]&De&&!1!==t&&(a=Math.max(1,r[je])),1===a||(0,le.wt)(s)&&(0,le.wt)(l)||(Ie.warn("Ignoring mipmaps of non power of two sized compressed texture."),a=1);let f=r[We]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,f,h),m.push(u),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:n,width:c,height:d}}(r,t.hasMipmap??!1));return t.samplingMode=i.levels.length>1?Ae.cw.LINEAR_MIPMAP_LINEAR:Ae.cw.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=o,t.width=n,t.height=a,new Se.x(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==Re&&(Re=await Ce());const i=new Re.KTX2File(new Uint8Array(r));if(!Pe(i))return null;i.startTranscoding();const o=Ne(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==Re&&(Re=await Ce());const i=new Re.BasisFile(new Uint8Array(r));if(!Me(i))return null;i.startTranscoding();const o=Ne(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,G.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?Ae.VI.LUMINANCE:3===this.params.components?Ae.VI.RGB:Ae.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new Se.x(e,r,t),this._glTexture}_loadFromURL(e,t,r){return this._loadAsync((async i=>{const o=await H(r,{signal:i});return(0,L.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromImageElement(e,t,r){return r.complete?this._loadFromImage(e,r,t):this._loadAsync((async i=>{const o=await(0,ue.fY)(r,r.src,!1,i);return(0,L.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromVideoElement(e,t,r){return r.readyState>=Je.HAVE_CURRENT_DATA?this._loadFromImage(e,r,t):this._loadFromVideoElementAsync(e,t,r)}_loadFromVideoElementAsync(e,t,r){return this._loadAsync((i=>new Promise(((o,n)=>{const a=()=>{r.removeEventListener("loadeddata",s),r.removeEventListener("error",l),(0,ce.hw)(c)},s=()=>{r.readyState>=Je.HAVE_CURRENT_DATA&&(a(),o(this._loadFromImage(e,r,t)))},l=e=>{a(),n(e||new P.Z("Failed to load video"))};r.addEventListener("loadeddata",s),r.addEventListener("error",l);const c=(0,L.fu)(i,(()=>l((0,L.zE)())))}))))}_loadFromImage(e,t,r){const i=tt._getDataDimensions(t);this.params.width=i.width,this.params.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this.params.components?Ae.VI.RGB:Ae.VI.RGBA,!this._requiresPowerOfTwo(e,o)||(0,le.wt)(i.width)&&(0,le.wt)(i.height)?(o.width=i.width,o.height=i.height,this._glTexture=new Se.x(e,o,t),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(e,t,i,o,r),this._glTexture)}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}_requiresPowerOfTwo(e,t){const r=Ae.e8.CLAMP_TO_EDGE,i="number"==typeof t.wrapMode?t.wrapMode===r:t.wrapMode.s===r&&t.wrapMode.t===r;return e.type===Qe.zO.WEBGL1&&(t.hasMipmap||!i)}_makePowerOfTwoTexture(e,t,r,i,o){const{width:n,height:a}=r,s=(0,le.Sf)(n),l=(0,le.Sf)(a);let c;switch(i.width=s,i.height=l,this.params.powerOfTwoResizeMode){case B.CE.PAD:i.textureCoordinateScaleFactor=[n/s,a/l],c=new Se.x(e,i),c.updateData(0,0,0,n,a,t);break;case B.CE.STRETCH:case null:case void 0:c=this._stretchToPowerOfTwo(e,t,i,o());break;default:(0,ae.Bg)(this.params.powerOfTwoResizeMode)}return i.hasMipmap&&c.generateMipmap(),c}_stretchToPowerOfTwo(e,t,r,i){const o=new Se.x(e,r),n=new et.X(e,{colorTarget:Ae.Lm.TEXTURE,depthStencilTarget:Ae.OU.NONE},o),a=new Se.x(e,{target:Ae.No.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:Ae.Br.UNSIGNED_BYTE,wrapMode:Ae.e8.CLAMP_TO_EDGE,samplingMode:Ae.cw.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},t),s=(0,Ze.ow)(e),l=e.getBoundFramebufferObject();return this._drawStretchedTexture(e,i,n,s,a,o),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:s,sourceTexture:a,framebuffer:n}:(s.dispose(!0),a.dispose(),n.detachColorTexture(),n.dispose()),e.bindFramebuffer(l),o}_drawStretchedTexture(e,t,r,i,o,n){this._passParameters.texture=o,e.bindFramebuffer(r);const a=e.getViewport();e.setViewport(0,0,n.descriptor.width,n.descriptor.height),e.bindTechnique(t,this._passParameters,null),e.bindVAO(i),e.drawArrays(Ae.MX.TRIANGLE_STRIP,0,(0,we._V)(i,"geometry")),e.bindFramebuffer(null),e.setViewport(a.x,a.y,a.width,a.height),this._passParameters.texture=null}unload(){if(null!=this._powerOfTwoStretchInfo){const{framebuffer:e,vao:t,sourceTexture:r}=this._powerOfTwoStretchInfo;t.dispose(!0),r.dispose(),e.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if(null!=this._glTexture&&(this._glTexture.dispose(),this._glTexture=null),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}(Ke=Je||(Je={}))[Ke.HAVE_NOTHING=0]="HAVE_NOTHING",Ke[Ke.HAVE_METADATA=1]="HAVE_METADATA",Ke[Ke.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Ke[Ke.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Ke[Ke.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var rt=r(80442),it=r(64822),ot=r(65576),nt=r(55039),at=r(60624),st=r(19419),lt=r(85504),ct=r(60537),dt=r(82791),ut=r(93144),ht=r(27097);const ft=(0,ht.wK)(Ae.zi.SRC_ALPHA,Ae.zi.ONE,Ae.zi.ONE_MINUS_SRC_ALPHA,Ae.zi.ONE_MINUS_SRC_ALPHA),mt=(0,ht.if)(Ae.zi.ONE,Ae.zi.ONE),pt=(0,ht.if)(Ae.zi.ZERO,Ae.zi.ONE_MINUS_SRC_ALPHA);function _t(e){return e===ut.A.FrontFace?null:e===ut.A.Alpha?pt:mt}const gt={factor:-1,units:-2};function vt(e,t=Ae.wb.LESS){return e===ut.A.NONE||e===ut.A.FrontFace?t:Ae.wb.LEQUAL}var Tt,xt;(xt=Tt||(Tt={}))[xt.INTEGRATED_MESH=0]="INTEGRATED_MESH",xt[xt.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",xt[xt.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",xt[xt.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",xt[xt.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",xt[xt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",xt[xt.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",xt[xt.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",xt[xt.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",xt[xt.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",xt[xt.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",xt[xt.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",xt[xt.LASERLINES=12]="LASERLINES",xt[xt.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",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.VOXEL=20]="VOXEL",xt[xt.MAX_SLOTS=21]="MAX_SLOTS";var bt=r(51305),Et=r(94961),At=r(72119),St=r(29268);const wt=(0,c.c)(),Rt=(0,c.c)(),yt=(0,c.c)(),Ct=new class{constructor(e=0){this.offset=e,this.sphere=(0,St.c)(),this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let o=i[0]*e+i[4]*t+i[8]*r+i[12],n=i[1]*e+i[5]*t+i[9]*r+i[13],a=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(o*o+n*n+a*a);o+=o*s,n+=n*s,a+=a*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*o+l[4]*n+l[8]*a+l[12],this.tmpVertex[1]=l[1]*o+l[5]*n+l[9]*a+l[13],this.tmpVertex[2]=l[2]*o+l[6]*n+l[10]*a+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}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=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,c.c)(),this._mbs=(0,St.c)(),this._obb={center:(0,c.c)(),halfSize:(0,At.c)(),quaternion:null},this._totalOffset=0,this._offset=0,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=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,o=t,n=r+this.componentLocalOriginLength,a=this._totalOffset/Math.sqrt(i*i+o*o+n*n);return this._tmpVertex[0]=e+i*a,this._tmpVertex[1]=t+o*a,this._tmpVertex[2]=r+n*a,this._tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,o=e[3],n=e[4],a=e[5]+this.componentLocalOriginLength,s=t*o<0?0:Math.min(Math.abs(t),Math.abs(o)),l=r*n<0?0:Math.min(Math.abs(r),Math.abs(n)),c=i*a<0?0:Math.min(Math.abs(i),Math.abs(a)),d=Math.sqrt(s*s+l*l+c*c);if(d<this._totalOffset)return e[0]-=t<0?this._totalOffset:0,e[1]-=r<0?this._totalOffset:0,e[2]-=i<0?this._totalOffset:0,e[3]+=o>0?this._totalOffset:0,e[4]+=n>0?this._totalOffset:0,e[5]+=a>0?this._totalOffset:0,e;const u=Math.max(Math.abs(t),Math.abs(o)),h=Math.max(Math.abs(r),Math.abs(n)),f=Math.max(Math.abs(i),Math.abs(a)),m=Math.sqrt(u*u+h*h+f*f),p=this._totalOffset/m,_=this._totalOffset/d;return e[0]+=t*(t>0?p:_),e[1]+=r*(r>0?p:_),e[2]+=i*(i>0?p:_),e[3]+=o*(o<0?p:_),e[4]+=n*(n<0?p:_),e[5]+=a*(a<0?p:_),e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this._totalOffset/t;return this._mbs[0]=e[0]+e[0]*r,this._mbs[1]=e[1]+e[1]*r,this._mbs[2]=e[2]+e[2]*r,this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){const t=e.center,r=this._totalOffset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this._obb.center[0]=t[0]+t[0]*r,this._obb.center[1]=t[1]+t[1]*r,this._obb.center[2]=t[2]+t[2]*r,(0,l.q)(this._obb.halfSize,e.halfSize,e.quaternion),(0,l.a)(this._obb.halfSize,this._obb.halfSize,e.center);const i=this._totalOffset/Math.sqrt(this._obb.halfSize[0]*this._obb.halfSize[0]+this._obb.halfSize[1]*this._obb.halfSize[1]+this._obb.halfSize[2]*this._obb.halfSize[2]);return this._obb.halfSize[0]+=this._obb.halfSize[0]*i,this._obb.halfSize[1]+=this._obb.halfSize[1]*i,this._obb.halfSize[2]+=this._obb.halfSize[2]*i,(0,l.b)(this._obb.halfSize,this._obb.halfSize,e.center),(0,bt.c)(Ot,e.quaternion),(0,l.q)(this._obb.halfSize,this._obb.halfSize,Ot),this._obb.halfSize[0]*=this._obb.halfSize[0]<0?-1:1,this._obb.halfSize[1]*=this._obb.halfSize[1]<0?-1:1,this._obb.halfSize[2]*=this._obb.halfSize[2]<0?-1:1,this._obb.quaternion=e.quaternion,this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],o=t+this.localOrigin[1],n=r+this.localOrigin[2],a=this.offset/Math.sqrt(i*i+o*o+n*n);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+o*a,this.tmpVertex[2]=r+n*a,this.tmpVertex}applyToAabb(e){for(let t=0;t<3;++t)wt[t]=e[0+t]+this.localOrigin[t],Rt[t]=e[3+t]+this.localOrigin[t],yt[t]=wt[t];const t=this.applyToVertex(wt[0],wt[1],wt[2]);for(let r=0;r<3;++r)e[r]=t[r],e[r+3]=t[r];const r=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 t=0;t<3;++t)yt[t]=0==(e&1<<t)?wt[t]:Rt[t];r(yt)}let i=0;for(let e=0;e<3;++e)wt[e]*Rt[e]<0&&(i|=1<<e);if(0!==i&&7!==i)for(let e=0;e<8;++e)if(0==(i&e)){for(let t=0;t<3;++t)i[t]?yt[t]=0:yt[t]=0!=(e&1<<t)?wt[t]:Rt[t];r(yt)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Ot=(0,Et.a)();function Mt(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length;i*=n;for(let r=0;r<a;++r){const a=2*e[r];o[i]=t[a],o[i+1]=t[a+1],i+=n}}function Pt(e,t,r,i,o){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],i+=a}}function Nt(e,t,r,i,o=1){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===o)for(let r=0;r<s;++r){const o=4*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],n[i+3]=t[o+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],n[i+3]=t[s+3],i+=a}}function It(e,t,r,i,o,n=1){if(!r)return void Pt(e,t,i,o,n);const s=i.typedBuffer,l=i.typedBufferStride,c=e.length,d=r[0],u=r[1],h=r[2],f=r[4],m=r[5],p=r[6],_=r[8],g=r[9],v=r[10],T=r[12],x=r[13],b=r[14];o*=l;let E=0,A=0,S=0;const w=(0,a.y)(r)?e=>{E=t[e]+T,A=t[e+1]+x,S=t[e+2]+b}:e=>{const r=t[e],i=t[e+1],o=t[e+2];E=d*r+f*i+_*o+T,A=u*r+m*i+g*o+x,S=h*r+p*i+v*o+b};if(1===n)for(let t=0;t<c;++t)w(3*e[t]),s[o]=E,s[o+1]=A,s[o+2]=S,o+=l;else for(let t=0;t<c;++t){w(3*e[t]);for(let e=0;e<n;++e)s[o]=E,s[o+1]=A,s[o+2]=S,o+=l}}function Lt(e,t,r,i,o,n=1){if(!r)return void Pt(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=s[0],h=s[1],f=s[2],m=s[4],p=s[5],_=s[6],g=s[8],v=s[9],T=s[10],x=!(0,a.z)(s),b=1e-6,E=1-b;o*=c;let A=0,S=0,w=0;const R=(0,a.y)(s)?e=>{A=t[e],S=t[e+1],w=t[e+2]}:e=>{const r=t[e],i=t[e+1],o=t[e+2];A=u*r+m*i+g*o,S=h*r+p*i+v*o,w=f*r+_*i+T*o};if(1===n)if(x)for(let t=0;t<d;++t){R(3*e[t]);const r=A*A+S*S+w*w;if(r<E&&r>b){const e=1/Math.sqrt(r);l[o]=A*e,l[o+1]=S*e,l[o+2]=w*e}else l[o]=A,l[o+1]=S,l[o+2]=w;o+=c}else for(let t=0;t<d;++t)R(3*e[t]),l[o]=A,l[o+1]=S,l[o+2]=w,o+=c;else for(let t=0;t<d;++t){if(R(3*e[t]),x){const e=A*A+S*S+w*w;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,w*=t}}for(let e=0;e<n;++e)l[o]=A,l[o+1]=S,l[o+2]=w,o+=c}}function Dt(e,t,r,i,o,n=1){if(!r)return void Nt(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=s[0],h=s[1],f=s[2],m=s[4],p=s[5],_=s[6],g=s[8],v=s[9],T=s[10],x=!(0,a.z)(s),b=1e-6,E=1-b;if(o*=c,1===n)for(let r=0;r<d;++r){const i=4*e[r],n=t[i],a=t[i+1],s=t[i+2],d=t[i+3];let A=u*n+m*a+g*s,S=h*n+p*a+v*s,w=f*n+_*a+T*s;if(x){const e=A*A+S*S+w*w;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,w*=t}}l[o]=A,l[o+1]=S,l[o+2]=w,l[o+3]=d,o+=c}else for(let r=0;r<d;++r){const i=4*e[r],a=t[i],s=t[i+1],d=t[i+2],A=t[i+3];let S=u*a+m*s+g*d,w=h*a+p*s+v*d,R=f*a+_*s+T*d;if(x){const e=S*S+w*w+R*R;if(e<E&&e>b){const t=1/Math.sqrt(e);S*=t,w*=t,R*=t}}for(let e=0;e<n;++e)l[o]=S,l[o+1]=w,l[o+2]=R,l[o+3]=A,o+=c}}function Ht(e,t,r,i,o,n=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,r!==t.length||4!==r)if(1!==n)if(4!==r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}else for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else{if(4===r){for(let r=0;r<l;++r){const i=4*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}return}for(let r=0;r<l;++r){const i=3*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}else{a[o]=t[0],a[o+1]=t[1],a[o+2]=t[2],a[o+3]=t[3];const e=new Uint32Array(i.typedBuffer.buffer,i.start),r=s/4,c=e[o/=4];o+=r;const d=l*n;for(let t=1;t<d;++t)e[o]=c,o+=r}}function Ft(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length,s=t[0];i*=n;for(let e=0;e<a;++e)o[i]=s,i+=n}function Bt(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}class Ut{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(oe.T.POSITION).length}write(e,t,r,i,o){!function(e,t,r,i,o,n){for(const a of t.fields.keys()){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)switch(a){case oe.T.POSITION:{(0,G.hu)(3===t.size);const e=o.getField(a,f.ct);(0,G.hu)(!!e,`No buffer view for ${a}`),e&&It(s,t.data,r,e,n);break}case oe.T.NORMAL:{(0,G.hu)(3===t.size);const e=o.getField(a,f.ct);(0,G.hu)(!!e,`No buffer view for ${a}`),e&&Lt(s,t.data,i,e,n);break}case oe.T.NORMALCOMPRESSED:{(0,G.hu)(2===t.size);const e=o.getField(a,f.or);(0,G.hu)(!!e,`No buffer view for ${a}`),e&&Mt(s,t.data,e,n);break}case oe.T.UV0:{(0,G.hu)(2===t.size);const e=o.getField(a,f.Eu);(0,G.hu)(!!e,`No buffer view for ${a}`),e&&Mt(s,t.data,e,n);break}case oe.T.COLOR:case oe.T.SYMBOLCOLOR:{const e=o.getField(a,f.mc);(0,G.hu)(!!e,`No buffer view for ${a}`),(0,G.hu)(3===t.size||4===t.size),!e||3!==t.size&&4!==t.size||Ht(s,t.data,t.size,e,n);break}case oe.T.COLORFEATUREATTRIBUTE:{const e=o.getField(a,f.ly);(0,G.hu)(!!e,`No buffer view for ${a}`),(0,G.hu)(1===t.size),e&&1===t.size&&Ft(s,t.data,e,n);break}case oe.T.TANGENT:{(0,G.hu)(4===t.size);const e=o.getField(a,f.ek);(0,G.hu)(!!e,`No buffer view for ${a}`),e&&Dt(s,t.data,i,e,n);break}case oe.T.PROFILERIGHT:case oe.T.PROFILEUP:case oe.T.PROFILEVERTEXANDNORMAL:case oe.T.FEATUREVALUE:{(0,G.hu)(4===t.size);const e=o.getField(a,f.ek);(0,G.hu)(!!e,`No buffer view for ${a}`),e&&Nt(s,t.data,e,n)}}else if(a===oe.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(oe.T.POSITION);if((0,G.hu)(!!t,`No buffer view for ${a}`),t){const r=t.length,i=o.getField(a,f.mc);Bt(e.objectAndLayerIdColor,i,r,n)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var Vt=r(57790),zt=r(135),Gt=r(15719),Wt=r(96310),kt=r(78869),$t=r(14589),qt=r(83475),jt=r(59377);Ae.wb.LESS,Ae.wb.ALWAYS;const Xt={mask:255},Yt={function:{func:Ae.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:Ae.xS.KEEP,zFail:Ae.xS.KEEP,zPass:Ae.xS.ZERO}},Jt={function:{func:Ae.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:Ae.xS.KEEP,zFail:Ae.xS.KEEP,zPass:Ae.xS.REPLACE}};Ae.wb.EQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,Ae.xS.KEEP,Ae.xS.KEEP,Ae.xS.KEEP,Ae.wb.NOTEQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,Ae.xS.KEEP,Ae.xS.KEEP,Ae.xS.KEEP;var Kt=r(32078);class Zt extends Gt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.f)(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=B.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=at.r.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.f)(.2,.2,.2),this.diffuse=(0,c.f)(.8,.8,.8),this.externalColor=(0,he.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.c)(),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.transparent=!1,this.writeDepth=!0,this.customDepthTest=B.Gv.Less,this.textureAlphaMode=B.JJ.Blend,this.textureAlphaCutoff=Wt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=dt.yD.Occlude}}class Qt extends $t.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===it.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?zt.N.Default:zt.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Qt.shader)}_initializeProgram(e,t){return new jt.$(e.rctx,t.get().build(this.configuration),qt.i)}_convertDepthTestFunction(e){return e===B.Gv.Lequal?Ae.wb.LEQUAL:Ae.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===ut.A.NONE,o=e===ut.A.FrontFace;return(0,ht.sm)({blending:r.output!==nt.H.Color&&r.output!==nt.H.Alpha||!r.transparent?null:i?ft:_t(e),culling:er(r)?(0,ht.zp)(r.cullFace):null,depthTest:{func:vt(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?ht.LZ:null,colorWrite:ht.BK,stencilWrite:r.hasOccludees?Xt:null,stencilTest:r.hasOccludees?t?Jt:Yt:null,polygonOffset:i||o?null:(n=r.enableOffset,n?gt:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function er(e){return e.cullFace!==B.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Qt.shader=new kt.J(Kt.D,(()=>r.e(9291).then(r.bind(r,79291))));var tr=r(43697),rr=r(51354),ir=r(67498);class or extends rr.m{}(0,tr._)([(0,rr.o)({constValue:!0})],or.prototype,"hasSliceHighlight",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],or.prototype,"hasSliceInVertexProgram",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],or.prototype,"instancedDoublePrecision",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],or.prototype,"hasModelTransformation",void 0),(0,tr._)([(0,rr.o)({constValue:ir.P.Pass})],or.prototype,"pbrTextureBindType",void 0);class nr extends or{constructor(){super(...arguments),this.output=nt.H.Color,this.alphaDiscardMode=B.JJ.Opaque,this.doubleSidedMode=st.q.None,this.pbrMode=lt.f7.Disabled,this.cullFace=B.Vr.None,this.transparencyPassType=ut.A.NONE,this.normalType=at.r.Attribute,this.textureCoordinateType=zt.N.None,this.customDepthTest=B.Gv.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.hasMultipassTerrain=!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,tr._)([(0,rr.o)({count:nt.H.COUNT})],nr.prototype,"output",void 0),(0,tr._)([(0,rr.o)({count:B.JJ.COUNT})],nr.prototype,"alphaDiscardMode",void 0),(0,tr._)([(0,rr.o)({count:st.q.COUNT})],nr.prototype,"doubleSidedMode",void 0),(0,tr._)([(0,rr.o)({count:lt.f7.COUNT})],nr.prototype,"pbrMode",void 0),(0,tr._)([(0,rr.o)({count:B.Vr.COUNT})],nr.prototype,"cullFace",void 0),(0,tr._)([(0,rr.o)({count:ut.A.COUNT})],nr.prototype,"transparencyPassType",void 0),(0,tr._)([(0,rr.o)({count:at.r.COUNT})],nr.prototype,"normalType",void 0),(0,tr._)([(0,rr.o)({count:zt.N.COUNT})],nr.prototype,"textureCoordinateType",void 0),(0,tr._)([(0,rr.o)({count:B.Gv.COUNT})],nr.prototype,"customDepthTest",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"spherical",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasVertexColors",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasSymbolColors",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasVerticalOffset",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasSlicePlane",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasSliceHighlight",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasColorTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasMetallicRoughnessTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasEmissionTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasOcclusionTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasNormalTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasScreenSizePerspective",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasVertexTangents",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasOccludees",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasMultipassTerrain",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasModelTransformation",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"offsetBackfaces",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"vvSize",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"vvColor",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"receiveShadows",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"receiveAmbientOcclusion",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"textureAlphaPremultiplied",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"instanced",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"instancedColor",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"objectAndLayerIdColorInstanced",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"instancedDoublePrecision",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"writeDepth",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"transparent",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"enableOffset",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"cullAboveGround",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"snowCover",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasColorTextureTransform",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasEmissionTextureTransform",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasNormalTextureTransform",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasOcclusionTextureTransform",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,tr._)([(0,rr.o)({constValue:!0})],nr.prototype,"hasVvInstancing",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],nr.prototype,"useCustomDTRExponentForWater",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],nr.prototype,"supportsTextureAtlas",void 0),(0,tr._)([(0,rr.o)({constValue:!0})],nr.prototype,"useFillLights",void 0);var ar=r(41846);class sr extends Qt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=at.r.Attribute,t.doubleSidedMode=st.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,sr.shader)}}sr.shader=new kt.J(ar.R,(()=>r.e(8096).then(r.bind(r,38096))));class lr extends dt.F5{constructor(e){super(e,dr),this.supportsEdges=!0,this._configuration=new nr,this._vertexBufferLayout=function(e){const t=(0,ot.U$)().vec3f(oe.T.POSITION);return e.normalType===at.r.CompressedAttribute?t.vec2i16(oe.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(oe.T.NORMAL),e.hasVertexTangents&&t.vec4f(oe.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(oe.T.UV0),e.hasVertexColors&&t.vec4u8(oe.T.COLOR),e.hasSymbolColors&&t.vec4u8(oe.T.SYMBOLCOLOR),(0,rt.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(oe.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==nt.H.Shadow&&e!==nt.H.ShadowExcludeHighlight&&e!==nt.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,n="replace"===e.colorMixMode,a=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?n||a:r?n?s:a:l?n||a:n?s:a}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?B.Vr.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==nt.H.Color&&e!==nt.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=st.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?st.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?st.q.WindingOrder:st.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!t.ssaoHelper.active&&this.parameters.receiveSSAO,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?lt.f7.Schematic:lt.f7.Normal:lt.f7.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,i,o,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(_r,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case it.JY.Global:n=(0,l.n)(mr,_r);break;case it.JY.Local:n=(0,l.c)(mr,fr)}let a=0;const s=(0,l.b)(gr,_r,e.eye),c=(0,l.l)(s),d=(0,l.g)(s,s,1/c);let u=null;this.parameters.screenSizePerspective&&(u=(0,l.e)(n,d)),a+=(0,Vt.Hx)(e,c,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,l.g)(n,n,a),(0,l.t)(pr,n,r.transform.inverseRotation),i=(0,l.b)(ur,i,pr),o=(0,l.b)(hr,o,pr)}(0,Vt.Bw)(e,r,i,o,function(e){return null!=e?(Ct.offset=e,Ct):null}(r.verticalOffset),n)}requiresSlot(e,t){return!(t!==nt.H.Color&&t!==nt.H.Alpha&&t!==nt.H.Depth&&t!==nt.H.Normal&&t!==nt.H.Shadow&&t!==nt.H.ShadowHighlight&&t!==nt.H.ShadowExcludeHighlight&&t!==nt.H.Highlight&&t!==nt.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?Tt.TRANSPARENT_MATERIAL:Tt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Tt.OPAQUE_MATERIAL)&&e!==Tt.DRAPED_MATERIAL)}createGLMaterial(e){return new cr(e)}createBufferWriter(){return new Ut(this._vertexBufferLayout)}}class cr extends ct.F{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!==nt.H.Color&&this._output!==nt.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?sr:Qt,e)}}const dr=new class extends Zt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},ur=(0,c.c)(),hr=(0,c.c)(),fr=(0,c.f)(0,0,1),mr=(0,c.c)(),pr=(0,c.c)(),_r=(0,c.c)(),gr=(0,c.c)(),vr=N.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Tr(e){throw new P.Z("",`Request for object resource failed: ${e}`)}function xr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(vr.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(vr.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(vr.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(vr.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else vr.warn("Indexed geometries must specify faces"),i=!1;break}default:vr.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(vr.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(vr.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function br(e){const t=(0,d.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,d.pp)(t,r.bbMin),(0,d.pp)(t,r.bbMax))})),t}function Er(e){switch(e){case"mask":return B.JJ.Mask;case"maskAndTransparency":return B.JJ.MaskBlend;case"none":return B.JJ.Opaque;default:return B.JJ.Blend}}function Ar(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Sr=new D.G(1,2,"wosr");var wr=r(57758);async function Rr(e,t){const r=yr((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=null!=t&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,O.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,L.r9)(i.error),Tr(i.error.details.url)}(e,r,t);const i=await(0,O.q6)((0,C.default)(e,t));if(!0===i.ok)return i.value.data;(0,L.r9)(i.error),Tr(i.error)}(e,t),i=await async function(e,t){const r=[];for(const i in e){const o=e[i],n=o.images[0].data;if(!n){vr.warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:Ae.e8.REPEAT,t:Ae.e8.REPEAT},preMultiplyAlpha:Er(l)!==B.JJ.Opaque},d=null!=t&&t.disableTextures?Promise.resolve(null):H(a,t);r.push(d.then((e=>({refId:s,image:e,params:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,M.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new I,a=e.resource,s=D.G.parse(a.version||"1.0","wosr");Sr.validate(s);const l=a.model.name,d=a.model.geometries,u=a.materialDefinitions??{},h=e.textures;let f=0;const m=new Map;for(let e=0;e<d.length;e++){const a=d[e];if(!xr(a))continue;const s=Ar(a),l=a.params.vertexAttributes,p=[];for(const e in l){const t=l[e],r=t.values;p.push([e,new F.a(r,t.valuesPerElement,!0)])}const _=[];if("PerAttributeArray"!==a.params.topology){const e=a.params.faces;for(const t in e)_.push([t,e[t].values])}const g=s.texture,v=h&&h[g];if(v&&!m.has(g)){const{image:e,params:t}=v,r=new tt(e,t);i.push(r),m.set(g,r)}const T=m.get(g),x=T?T.id:void 0,b=s.material;let E=n.get(b,g);if(null==E){const e=u[b.substring(b.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=v&&v.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=v?Er(v.alphaChannelUsage):void 0,a={ambient:(0,c.d)(e.diffuse),diffuse:(0,c.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:B.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!v&&!!v.params.preMultiplyAlpha};null!=t&&t.materialParamsMixin&&Object.assign(a,t.materialParamsMixin),E=new lr(a),n.set(b,g,E)}o.push(E);const A=new ne(E,p,_);f+=_.position?_.position.length:0,r.push(A)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:f,lodThreshold:null}],referenceBoundingBox:br(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const o=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.Q)(new T.C(t.streamDataRequester),r.url,t,t.usePBR)),n=o.model.meta?.ESRI_proxyEllipsoid,d=o.meta.isEsriSymbolResource&&null!=n&&o.meta.uri.includes("/RealisticTrees/");d&&!o.customMeta.esriTreeRendering&&(o.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,d=n.count,u=(0,c.c)(),h=(0,c.c)(),m=(0,c.c)(),p=new Uint8Array(4*d),_=new Float64Array(3*d),g=(0,a.a)((0,s.c)(),o.transform);let v=0,T=0;for(let a=0;a<d;a++){n.getVec(a,h),i.getVec(a,u),(0,l.m)(h,h,o.transform),(0,l.b)(m,h,t.center),(0,l.D)(m,m,t.radius);const s=m[2],c=(0,l.l)(m),d=Math.min(.45+.55*c*c,1);(0,l.D)(m,m,t.radius),null!==g&&(0,l.m)(m,m,g),(0,l.n)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.h)(m,m,u,s>-1?.2:Math.min(-4*s-3.8,1)),_[v]=m[0],_[v+1]=m[1],_[v+2]=m[2],v+=3,p[T]=255*d,p[T+1]=255*d,p[T+2]=255*d,p[T+3]=255,T+=4}o.attributes.normal=new f.ct(_),o.attributes.color=new f.mc(p)}}}(o,n));const u=!!t.usePBR,h=o.meta.isEsriSymbolResource?{usePBR:u,isSchematic:!1,treeRendering:d,mrrFactors:[0,1,.2]}:{usePBR:u,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},m={...t.materialParamsMixin,treeRendering:d},{engineResources:p,referenceBoundingBox:_}=Cr(o,h,m,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:p,referenceBoundingBox:_,isEsriSymbolResource:o.meta.isEsriSymbolResource,isWosr:!1}}function yr(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}}function Cr(e,t,r,i){const n=e.model,a=new Array,s=new Map,l=new Map,c=n.lods.length,u=(0,d.cS)();return n.lods.forEach(((e,T)=>{const x=!0===i.skipHighLods&&(c>1&&0===T||c>3&&1===T)||!1===i.skipHighLods&&null!=i.singleLodIndex&&T!==i.singleLodIndex;if(x&&0!==T)return;const A=new y(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=x?new lr({}):function(e,t,r,i,o,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),c=null!=t.attributes.texCoord0,d=null!=t.attributes.normal;if(null==l)return null;const u=function(e){switch(e){case"BLEND":return B.JJ.Blend;case"MASK":return B.JJ.Mask;case"OPAQUE":case null:case void 0:return B.JJ.Opaque}}(l.alphaMode);if(!n.has(s)){if(c){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new tt((0,E.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,E.$A)(e)&&r,encoding:(0,E.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(l.textureColor,u!==B.JJ.Opaque),t(l.textureNormal),t(l.textureOcclusion),t(l.textureEmissive),t(l.textureMetallicRoughness)}const r=l.color[0]**(1/wr.K),h=l.color[1]**(1/wr.K),f=l.color[2]**(1/wr.K),m=l.emissiveFactor[0]**(1/wr.K),p=l.emissiveFactor[1]**(1/wr.K),_=l.emissiveFactor[2]**(1/wr.K),g=null!=l.textureColor&&c?a.get(l.textureColor):null;n.set(s,new lr({...i,transparent:u===B.JJ.Blend,customDepthTest:B.Gv.Lequal,textureAlphaMode:u,textureAlphaCutoff:l.alphaCutoff,diffuse:[r,h,f],ambient:[r,h,f],opacity:l.opacity,doubleSided:l.doubleSided,doubleSidedType:"winding-order",cullFace:l.doubleSided?B.Vr.None:B.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:d?at.r.Attribute:at.r.ScreenDerivative,castShadows:!0,receiveSSAO:!0,textureId:null!=g?g.id:void 0,colorMixMode:l.colorMixMode,normalTextureId:null!=l.textureNormal&&c?a.get(l.textureNormal).id:void 0,textureAlphaPremultiplied:null!=g&&!!g.params.preMultiplyAlpha,occlusionTextureId:null!=l.textureOcclusion&&c?a.get(l.textureOcclusion).id:void 0,emissiveTextureId:null!=l.textureEmissive&&c?a.get(l.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=l.textureMetallicRoughness&&c?a.get(l.textureMetallicRoughness).id:void 0,emissiveFactor:[m,p,_],mrrFactors:[l.metallicFactor,l.roughnessFactor,i.mrrFactors[2]],isSchematic:!1,colorTextureTransformMatrix:w(l.colorTextureTransform),normalTextureTransformMatrix:w(l.normalTextureTransform),occlusionTextureTransformMatrix:w(l.occlusionTextureTransform),emissiveTextureTransformMatrix:w(l.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:w(l.metallicRoughnessTextureTransform),...o}))}const h=n.get(s);if(r.stageResources.materials.push(h),c){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 h}(n,e,A,t,r,s,l),{geometry:a,vertexCount:c}=function(e,t){const r=e.attributes.position.count,i=(0,b.p)(e.indices||r,e.primitiveType),n=h(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,m.t)(n,a,e.transform,3,s);const l=[[oe.T.POSITION,new F.a(n,3,!0)]],c=[[oe.T.POSITION,i]];if(null!=e.attributes.normal){const t=h(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,o.b)(Or,e.transform),(0,m.a)(t,n,Or,3,a),l.push([oe.T.NORMAL,new F.a(t,3,!0)]),c.push([oe.T.NORMAL,i])}if(null!=e.attributes.tangent){const t=h(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,o.b)(Or,e.transform),(0,p.t)(t,n,Or,4,a),l.push([oe.T.TANGENT,new F.a(t,4,!0)]),c.push([oe.T.TANGENT,i])}if(null!=e.attributes.texCoord0){const t=h(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,_.n)(t,o,2,n),l.push([oe.T.UV0,new F.a(t,2,!0)]),c.push([oe.T.UV0,i])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof f.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof f.mc?(0,v.c)(t,e.attributes.color):e.attributes.color instanceof f.v6&&(0,p.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof f.ct?(0,m.s)(t,e.attributes.color,255,4):e.attributes.color instanceof f.ne?(0,g.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof f.mw&&(0,m.s)(t,e.attributes.color,1/256,4)),l.push([oe.T.COLOR,new F.a(t,4,!0)]),c.push([oe.T.COLOR,i])}return{geometry:new ne(t,l,c),vertexCount:r}}(e,null!=i?i:new lr({})),S=a.boundingInfo;null!=S&&0===T&&((0,d.pp)(u,S.bbMin),(0,d.pp)(u,S.bbMax)),null!=i&&(A.stageResources.geometries.push(a),A.numberOfVertices+=c)})),x||a.push(A)})),{engineResources:a,referenceBoundingBox:u}}const Or=(0,n.c)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>d});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
288
+ return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
289
+ }`)}function d(e,t){const{vertex:r}=e;switch(t.output){case i.H.Color:if(t.receiveShadows)return s(e),void r.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.H.Depth:case i.H.Shadow:case i.H.ShadowHighlight:case i.H.ShadowExcludeHighlight:return e.include(o.up,t),s(e),l(e),c(e),void r.code.add(a.H`void forwardLinearDepth() {
290
+ linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
291
+ }`)}r.code.add(a.H`void forwardLinearDepth() {}`)}},62707:(e,t,r)=>{r.d(t,{w:()=>o});var i=r(74709);function o(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
292
+ vec3 camToVert = posWorld - camPosWorld;
293
+ bool isBackface = dot(camToVert, normalWorld) > 0.0;
294
+ if (isBackface) {
295
+ posClip.z += 0.0000003 * posClip.w;
296
+ }
297
+ return posClip;
298
+ }`)}},51666:(e,t,r)=>{r.d(t,{k:()=>n});var i=r(74709),o=r(35065);function n(e,t=!0){e.attributes.add(o.T.POSITION,"vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.code.add(i.H`
299
+ void main(void) {
300
+ gl_Position = vec4(position, 0.0, 1.0);
301
+ ${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
302
+ }
303
+ `)}},55039:(e,t,r)=>{var i;r.d(t,{H:()=>i}),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.Highlight=6]="Highlight",e[e.Alpha=7]="Alpha",e[e.ObjectAndLayerIdColor=8]="ObjectAndLayerIdColor",e[e.COUNT=9]="COUNT"}(i||(i={}))},51546:(e,t,r)=>{r.d(t,{f5:()=>c});var i=r(52138),o=r(13598),n=r(17896),a=r(65617),s=r(70582),l=(r(172),r(74709));function c(e,t){!function(e,t,r){if(!t.hasSlicePlane){const r=l.H`#define rejectBySlice(_pos_) false
304
+ #define discardBySlice(_pos_) {}
305
+ #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 i=l.H`struct SliceFactors {
306
+ float front;
307
+ float side0;
308
+ float side1;
309
+ float side2;
310
+ float side3;
311
+ };
312
+ SliceFactors calculateSliceFactors(vec3 pos) {
313
+ vec3 rel = pos - slicePlaneOrigin;
314
+ vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);
315
+ float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);
316
+ float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);
317
+ float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);
318
+ float basis1Dot = dot(slicePlaneBasis1, rel);
319
+ float basis2Dot = dot(slicePlaneBasis2, rel);
320
+ return SliceFactors(
321
+ dot(slicePlaneNormal, pos) + slicePlaneW,
322
+ -basis1Dot - basis1Len2,
323
+ basis1Dot - basis1Len2,
324
+ -basis2Dot - basis2Len2,
325
+ basis2Dot - basis2Len2
326
+ );
327
+ }
328
+ bool sliceByFactors(SliceFactors factors) {
329
+ return factors.front < 0.0
330
+ && factors.side0 < 0.0
331
+ && factors.side1 < 0.0
332
+ && factors.side2 < 0.0
333
+ && factors.side3 < 0.0;
334
+ }
335
+ bool sliceEnabled() {
336
+ return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
337
+ }
338
+ bool sliceByPlane(vec3 pos) {
339
+ return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
340
+ }
341
+ #define rejectBySlice(_pos_) sliceByPlane(_pos_)
342
+ #define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`,o=l.H`vec4 applySliceHighlight(vec4 color, vec3 pos) {
343
+ SliceFactors factors = calculateSliceFactors(pos);
344
+ const float HIGHLIGHT_WIDTH = 1.0;
345
+ const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3);
346
+ factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front);
347
+ factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0);
348
+ factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1);
349
+ factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2);
350
+ factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3);
351
+ if (sliceByFactors(factors)) {
352
+ return color;
353
+ }
354
+ float highlightFactor = (1.0 - step(0.5, factors.front))
355
+ * (1.0 - step(0.5, factors.side0))
356
+ * (1.0 - step(0.5, factors.side1))
357
+ * (1.0 - step(0.5, factors.side2))
358
+ * (1.0 - step(0.5, factors.side3));
359
+ return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a);
360
+ }`,n=t.hasSliceHighlight?l.H`
361
+ ${o}
362
+ #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
363
+ `:l.H`#define highlightSlice(_color_, _pos_) (_color_)`;t.hasSliceInVertexProgram&&e.vertex.code.add(i),e.fragment.code.add(i),e.fragment.code.add(n)}(e,t,[new s.B("slicePlaneOrigin",((e,r)=>function(e,t,r){if(null==r.slicePlane)return a.Z;const i=d(e,t,r),o=u(i,r.slicePlane),s=h(e,i,r);return null!=s?(0,n.m)(p,o,s):o}(t,e,r))),new s.B("slicePlaneBasis1",((e,r)=>f(t,e,r,r.slicePlane?.basis1))),new s.B("slicePlaneBasis2",((e,r)=>f(t,e,r,r.slicePlane?.basis2)))])}function d(e,t,r){return e.instancedDoublePrecision?(0,n.s)(m,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function u(e,t){return null!=e?(0,n.b)(p,t.origin,e):t.origin}function h(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,i.w)(g,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function f(e,t,r,i){if(null==i||null==r.slicePlane)return a.Z;const o=d(e,t,r),s=u(o,r.slicePlane),l=h(e,o,r);return null!=l?((0,n.a)(_,i,s),(0,n.m)(p,s,l),(0,n.m)(_,_,l),(0,n.b)(_,_,p)):i}const m=(0,a.c)(),p=(0,a.c)(),_=(0,a.c)(),g=(0,o.c)()},77171:(e,t,r)=>{r.d(t,{w:()=>n});var i=r(1391),o=r(74709);function n(e,t){if((0,i.bA)(e),t.hasModelTransformation)return e.vertex.code.add(o.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, mat4 model, vec3 pos, vec2 nearFar, out float depth) {
364
+ vec4 eye = view * (model * vec4(pos, 1.0));
365
+ depth = calculateLinearDepth(nearFar, eye.z);
366
+ return proj * eye;
367
+ }`),void e.vertex.code.add(o.H`vec4 transformPosition(mat4 proj, mat4 view, mat4 model, vec3 pos) {
368
+ return proj * (view * (model * vec4(pos, 1.0)));
369
+ }`);e.vertex.code.add(o.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
370
+ vec4 eye = view * vec4(pos, 1.0);
371
+ depth = calculateLinearDepth(nearFar,eye.z);
372
+ return proj * eye;
373
+ }`),e.vertex.code.add(o.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
374
+ return proj * (view * vec4(pos, 1.0));
375
+ }`)}},47624:(e,t,r)=>{r.d(t,{f:()=>p});var i=r(43697),o=r(17896),n=r(65617),a=r(55039),s=r(89243),l=r(93669),c=r(70582),d=r(74709),u=r(51354),h=r(35065),f=r(9820);class m extends u.m{constructor(){super(...arguments),this.instancedDoublePrecision=!1}}function p(e,t){t.instanced&&t.instancedDoublePrecision&&(e.attributes.add(h.T.MODELORIGINHI,"vec3"),e.attributes.add(h.T.MODELORIGINLO,"vec3"),e.attributes.add(h.T.MODEL,"mat3"),e.attributes.add(h.T.MODELNORMAL,"mat3"));const r=e.vertex;t.instancedDoublePrecision&&(r.include(s.$,t),r.uniforms.add(new c.B("viewOriginHi",((e,t)=>(0,f.U8)((0,o.s)(_,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),_)))),r.uniforms.add(new c.B("viewOriginLo",((e,t)=>(0,f.GB)((0,o.s)(_,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),_))))),r.code.add(d.H`
376
+ vec3 calculateVPos() {
377
+ ${t.instancedDoublePrecision?"return model * localPosition().xyz;":"return localPosition().xyz;"}
378
+ }
379
+ `),r.code.add(d.H`
380
+ vec3 subtractOrigin(vec3 _pos) {
381
+ ${t.instancedDoublePrecision?d.H`
382
+ vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -modelOriginHi, -modelOriginLo);
383
+ return _pos - originDelta;`:"return vpos;"}
384
+ }
385
+ `),r.code.add(d.H`
386
+ vec3 dpNormal(vec4 _normal) {
387
+ ${t.instancedDoublePrecision?"return normalize(modelNormal * _normal.xyz);":"return normalize(_normal.xyz);"}
388
+ }
389
+ `),t.output===a.H.Normal&&((0,l._8)(r),r.code.add(d.H`
390
+ vec3 dpNormalView(vec4 _normal) {
391
+ ${t.instancedDoublePrecision?"return normalize((viewNormal * vec4(modelNormal * _normal.xyz, 1.0)).xyz);":"return normalize((viewNormal * _normal).xyz);"}
392
+ }
393
+ `)),t.hasVertexTangents&&r.code.add(d.H`
394
+ vec4 dpTransformVertexTangent(vec4 _tangent) {
395
+ ${t.instancedDoublePrecision?"return vec4(modelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
396
+
397
+ }
398
+ `)}(0,i._)([(0,u.o)()],m.prototype,"instancedDoublePrecision",void 0);const _=(0,n.c)()},60624:(e,t,r)=>{r.d(t,{O:()=>l,r:()=>i});var i,o,n=r(74085),a=r(74709),s=r(35065);function l(e,t){switch(t.normalType){case i.CompressedAttribute:e.attributes.add(s.T.NORMALCOMPRESSED,"vec2"),e.vertex.code.add(a.H`vec3 normalModel() {
399
+ float z = 1.0 - abs(normalCompressed.x) - abs(normalCompressed.y);
400
+ return vec3(normalCompressed + sign(normalCompressed) * min(z, 0.0), z);
401
+ }`);break;case i.Attribute:e.attributes.add(s.T.NORMAL,"vec3"),e.vertex.code.add(a.H`vec3 normalModel() {
402
+ return normal;
403
+ }`);break;case i.ScreenDerivative:e.fragment.code.add(a.H`vec3 screenDerivativeNormal(vec3 positionView) {
404
+ return normalize(cross(dFdx(positionView), dFdy(positionView)));
405
+ }`);break;default:(0,n.Bg)(t.normalType);case i.COUNT:case i.Ground:}}(o=i||(i={}))[o.Attribute=0]="Attribute",o[o.CompressedAttribute=1]="CompressedAttribute",o[o.Ground=2]="Ground",o[o.ScreenDerivative=3]="ScreenDerivative",o[o.COUNT=4]="COUNT"},37099:(e,t,r)=>{r.d(t,{f:()=>n});var i=r(74709),o=r(35065);function n(e){e.attributes.add(o.T.POSITION,"vec3"),e.vertex.code.add(i.H`vec3 positionModel() { return position; }`)}},76056:(e,t,r)=>{r.d(t,{R:()=>c});var i=r(6206),o=r(74709);function n(e){e.vertex.code.add(o.H`
406
+ vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {
407
+ float symbolAlpha = 0.0;
408
+
409
+ const float maxTint = 85.0;
410
+ const float maxReplace = 170.0;
411
+ const float scaleAlpha = 3.0;
412
+
413
+ if (symbolColor.a > maxReplace) {
414
+ colorMixMode = ${o.H.int(i.a9.Multiply)};
415
+ symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace);
416
+ } else if (symbolColor.a > maxTint) {
417
+ colorMixMode = ${o.H.int(i.a9.Replace)};
418
+ symbolAlpha = scaleAlpha * (symbolColor.a - maxTint);
419
+ } else if (symbolColor.a > 0.0) {
420
+ colorMixMode = ${o.H.int(i.a9.Tint)};
421
+ symbolAlpha = scaleAlpha * symbolColor.a;
422
+ } else {
423
+ colorMixMode = ${o.H.int(i.a9.Multiply)};
424
+ symbolAlpha = 0.0;
425
+ }
426
+
427
+ return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha);
428
+ }
429
+ `)}var a=r(15736),s=r(35065),l=r(57790);function c(e,t){t.hasSymbolColors?(e.include(n),e.attributes.add(s.T.SYMBOLCOLOR,"vec4"),e.varyings.add("colorMixMode","mediump float"),e.vertex.code.add(o.H`int symbolColorMixMode;
430
+ vec4 getSymbolColor() {
431
+ return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451;
432
+ }
433
+ void forwardColorMixMode() {
434
+ colorMixMode = float(symbolColorMixMode) + 0.5;
435
+ }`)):(e.fragment.uniforms.add(new a._("colorMixMode",(e=>l.FZ[e.colorMixMode]))),e.vertex.code.add(o.H`vec4 getSymbolColor() { return vec4(1.0); }
436
+ void forwardColorMixMode() {}`))}},135:(e,t,r)=>{r.d(t,{D:()=>l,N:()=>i});var i,o,n=r(74085),a=r(74709),s=r(35065);function l(e,t){switch(t.textureCoordinateType){case i.Default:return e.attributes.add(s.T.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(a.H`void forwardTextureCoordinates() {
437
+ vuv0 = uv0;
438
+ }`);case i.Compressed:return e.attributes.add(s.T.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(a.H`vec2 getUV0() {
439
+ return uv0 / 16384.0;
440
+ }
441
+ void forwardTextureCoordinates() {
442
+ vuv0 = getUV0();
443
+ }`);case i.Atlas:return e.attributes.add(s.T.UV0,"vec2"),e.varyings.add("vuv0","vec2"),e.attributes.add(s.T.UVREGION,"vec4"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(a.H`void forwardTextureCoordinates() {
444
+ vuv0 = uv0;
445
+ vuvRegion = uvRegion;
446
+ }`);default:(0,n.Bg)(t.textureCoordinateType);case i.None:return void e.vertex.code.add(a.H`void forwardTextureCoordinates() {}`);case i.COUNT:return}}(o=i||(i={}))[o.None=0]="None",o[o.Default=1]="Default",o[o.Atlas=2]="Atlas",o[o.Compressed=3]="Compressed",o[o.COUNT=4]="COUNT"},11317:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(74709),o=r(35065);function n(e,t){t.hasVertexColors?(e.attributes.add(o.T.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(i.H`void forwardVertexColor() {}
447
+ void forwardNormalizedVertexColor() {}`)}},15719:(e,t,r)=>{r.d(t,{Bb:()=>d,d4:()=>u});var i=r(74085),o=r(46521),n=(r(88669),r(60624)),a=r(2095),s=r(74709),l=r(52114),c=r(19850);function d(e,t){switch(t.normalType){case n.r.Attribute:case n.r.CompressedAttribute:e.include(n.O,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add([new l.j("transformNormalGlobalFromModel",(e=>e.transformNormalGlobalFromModel)),new c.c("transformNormalViewFromGlobal",(e=>e.transformNormalViewFromGlobal))]),e.vertex.code.add(s.H`void forwardNormal() {
448
+ vNormalWorld = transformNormalGlobalFromModel * normalModel();
449
+ vNormalView = transformNormalViewFromGlobal * vNormalWorld;
450
+ }`);break;case n.r.Ground:e.include(a.up,t),e.varyings.add("vNormalWorld","vec3"),e.vertex.code.add(s.H`
451
+ void forwardNormal() {
452
+ vNormalWorld = ${t.spherical?s.H`normalize(vPositionWorldCameraRelative);`:s.H`vec3(0.0, 0.0, 1.0);`}
453
+ }
454
+ `);break;case n.r.ScreenDerivative:e.vertex.code.add(s.H`void forwardNormal() {}`);break;default:(0,i.Bg)(t.normalType);case n.r.COUNT:}}class u extends a.su{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.c)()}}},2095:(e,t,r)=>{r.d(t,{su:()=>p,up:()=>m});var i=r(46521),o=r(13598),n=(r(72119),r(65617)),a=r(37099),s=r(89243),l=r(70582),c=r(172),d=r(74709),u=r(52114),h=r(19850),f=r(8319);function m(e,t){e.include(a.f);const r=e.vertex;r.include(s.$,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add([new c.J("transformWorldFromViewTH",(e=>e.transformWorldFromViewTH)),new c.J("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL)),new h.c("transformViewFromCameraRelativeRS",(e=>e.transformViewFromCameraRelativeRS)),new f.g("transformProjFromView",(e=>e.transformProjFromView)),new u.j("transformWorldFromModelRS",(e=>e.transformWorldFromModelRS)),new l.B("transformWorldFromModelTH",(e=>e.transformWorldFromModelTH)),new l.B("transformWorldFromModelTL",(e=>e.transformWorldFromModelTL))]),r.code.add(d.H`vec3 positionWorldCameraRelative() {
455
+ vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
456
+ vec3 transform_CameraRelativeFromModel = dpAdd(
457
+ transformWorldFromModelTL,
458
+ transformWorldFromModelTH,
459
+ -transformWorldFromViewTL,
460
+ -transformWorldFromViewTH
461
+ );
462
+ return transform_CameraRelativeFromModel + rotatedModelPosition;
463
+ }`),r.code.add(d.H`
464
+ void forwardPosition(float fOffset) {
465
+ vPositionWorldCameraRelative = positionWorldCameraRelative();
466
+ if (fOffset != 0.0) {
467
+ vPositionWorldCameraRelative += fOffset * ${t.spherical?d.H`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:d.H`vec3(0.0, 0.0, 1.0)`};
468
+ }
469
+
470
+ vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
471
+ gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
472
+ }
473
+ `),e.fragment.uniforms.add(new c.J("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL))),r.code.add(d.H`vec3 positionWorld() {
474
+ return transformWorldFromViewTL + vPositionWorldCameraRelative;
475
+ }`),e.fragment.code.add(d.H`vec3 positionWorld() {
476
+ return transformWorldFromViewTL + vPositionWorldCameraRelative;
477
+ }`)}class p extends d.K{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,n.c)(),this.transformWorldFromViewTL=(0,n.c)(),this.transformViewFromCameraRelativeRS=(0,i.c)(),this.transformProjFromView=(0,o.c)()}}},91982:(e,t,r)=>{r.d(t,{i:()=>s});var i=r(74085),o=r(135),n=r(74709);function a(e){e.fragment.code.add(n.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
478
+ vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
479
+ vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
480
+ float maxdUV = 0.125;
481
+ vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
482
+ vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
483
+ return textureGrad(tex, uvAtlas, dUVdx, dUVdy);
484
+ }`)}function s(e,t){switch(e.include(o.D,t),t.textureCoordinateType){case o.N.Default:case o.N.Compressed:return void e.fragment.code.add(n.H`vec4 textureLookup(sampler2D tex, vec2 uv) {
485
+ return texture(tex, uv);
486
+ }`);case o.N.Atlas:return e.include(a),void e.fragment.code.add(n.H`vec4 textureLookup(sampler2D tex, vec2 uv) {
487
+ return textureAtlasLookup(tex, uv, vuvRegion);
488
+ }`);default:(0,i.Bg)(t.textureCoordinateType);case o.N.None:case o.N.COUNT:return}}},92555:(e,t,r)=>{r.d(t,{L:()=>d});var i=r(98766),o=r(88669),n=r(71250),a=r(74709);function s(e){e.vertex.code.add(a.H`float screenSizePerspectiveMinSize(float size, vec4 factor) {
489
+ float nonZeroSize = 1.0 - step(size, 0.0);
490
+ return (
491
+ factor.z * (
492
+ 1.0 +
493
+ nonZeroSize *
494
+ 2.0 * factor.w / (
495
+ size + (1.0 - nonZeroSize)
496
+ )
497
+ )
498
+ );
499
+ }`),e.vertex.code.add(a.H`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
500
+ return absCosAngle * absCosAngle * absCosAngle;
501
+ }`),e.vertex.code.add(a.H`vec4 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec4 params) {
502
+ return vec4(
503
+ min(params.x / (distanceToCamera - params.y), 1.0),
504
+ screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
505
+ params.z,
506
+ params.w
507
+ );
508
+ }`),e.vertex.code.add(a.H`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec4 factor) {
509
+ return max(mix(size * factor.x, size, factor.y), screenSizePerspectiveMinSize(size, factor));
510
+ }`),e.vertex.code.add(a.H`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec4 params) {
511
+ return applyScreenSizePerspectiveScaleFactorFloat(
512
+ size,
513
+ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
514
+ );
515
+ }`),e.vertex.code.add(a.H`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec4 factor) {
516
+ return mix(size * clamp(factor.x, screenSizePerspectiveMinSize(size.y, factor) / max(1e-5, size.y), 1.0), size, factor.y);
517
+ }`),e.vertex.code.add(a.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec4 params) {
518
+ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
519
+ }`)}const l=(0,o.c)();var c=r(93669);function d(e,t){const r=e.vertex;t.hasVerticalOffset?(function(e){e.uniforms.add(new n.N("verticalOffset",((e,t)=>{const{minWorldLength:r,maxWorldLength:o,screenLength:n}=e.verticalOffset,a=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),s=t.camera.pixelRatio||1;return(0,i.s)(u,n*s,a,r,o)})))}(r),t.hasScreenSizePerspective&&(e.include(s),function(e){e.uniforms.add(new n.N("screenSizePerspectiveAlignment",(e=>function(e){return(0,i.s)(l,e.parameters.divisor,e.parameters.offset,e.parameters.minPixelSize,e.paddingPixelsOverride)}(e.screenSizePerspectiveAlignment||e.screenSizePerspective))))}(r),(0,c.hY)(e.vertex,t)),r.code.add(a.H`
520
+ vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
521
+ float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
522
+ ${t.spherical?a.H`vec3 worldNormal = normalize(worldPos + localOrigin);`:a.H`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
523
+ ${t.hasScreenSizePerspective?a.H`
524
+ float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
525
+ float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:a.H`
526
+ float verticalOffsetScreenHeight = verticalOffset.x;`}
527
+ // Screen sized offset in world space, used for example for line callouts
528
+ float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
529
+ return worldNormal * worldOffset;
530
+ }
531
+
532
+ vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
533
+ return worldPos + calculateVerticalOffset(worldPos, localOrigin);
534
+ }
535
+ `)):r.code.add(a.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const u=(0,o.c)()},89136:(e,t,r)=>{r.d(t,{s:()=>R});var i=r(13598),o=r(1391),n=r(55039),a=r(51546),s=r(77171),l=r(60624),c=r(74709),d=r(35065);function u(e,t){const r=t.output===n.H.ObjectAndLayerIdColor,i=t.objectAndLayerIdColorInstanced;r&&(e.varyings.add("objectAndLayerIdColorVarying","vec4"),i?e.attributes.add(d.T.OBJECTANDLAYERIDCOLOR_INSTANCED,"vec4"):e.attributes.add(d.T.OBJECTANDLAYERIDCOLOR,"vec4")),e.vertex.code.add(c.H`
536
+ void forwardObjectAndLayerIdColor() {
537
+ ${r?i?c.H`objectAndLayerIdColorVarying = objectAndLayerIdColor_instanced * 0.003921568627451;`:c.H`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;`:c.H``} }`),e.fragment.code.add(c.H`
538
+ void outputObjectAndLayerIdColor() {
539
+ ${r?c.H`fragColor = objectAndLayerIdColorVarying;`:c.H``} }`)}var h=r(135),f=r(15719),m=r(20285);function p(e,t){switch(e.fragment.include(m.n),t.output){case n.H.Shadow:case n.H.ShadowHighlight:case n.H.ShadowExcludeHighlight:e.fragment.code.add(c.H`float _calculateFragDepth(const in float depth) {
540
+ const float SLOPE_SCALE = 2.0;
541
+ const float BIAS = 20.0 * .000015259;
542
+ float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
543
+ float result = depth + SLOPE_SCALE * m + BIAS;
544
+ return clamp(result, .0, .999999);
545
+ }
546
+ void outputDepth(float _linearDepth) {
547
+ fragColor = float2rgba(_calculateFragDepth(_linearDepth));
548
+ }`);break;case n.H.Depth:e.fragment.code.add(c.H`void outputDepth(float _linearDepth) {
549
+ fragColor = float2rgba(_linearDepth);
550
+ }`)}}var _=r(88669),g=r(98069);const v=(0,_.f)(1,1,0,1),T=(0,_.f)(1,0,1,1);function x(e){e.fragment.uniforms.add(new g.A("depthTex",((e,t)=>t.highlightDepthTexture))),e.fragment.constants.add("occludedHighlightFlag","vec4",v).add("unoccludedHighlightFlag","vec4",T),e.fragment.code.add(c.H`void outputHighlight() {
551
+ float sceneDepth = float(texelFetch(depthTex, ivec2(gl_FragCoord.xy), 0).x);
552
+ if (gl_FragCoord.z > sceneDepth + 5e-7) {
553
+ fragColor = occludedHighlightFlag;
554
+ } else {
555
+ fragColor = unoccludedHighlightFlag;
556
+ }
557
+ }`)}var b=r(92302),E=r(85787),A=r(93669),S=r(8319),w=r(47026);function R(e,t){const{vertex:r,fragment:d}=e,m=t.hasModelTransformation;m&&r.uniforms.add(new S.g("model",(e=>null!=e.modelTransformation?e.modelTransformation:i.I)));const _=t.hasColorTexture&&t.alphaDiscardMode!==w.JJ.Opaque;switch(t.output){case n.H.Depth:case n.H.Shadow:case n.H.ShadowHighlight:case n.H.ShadowExcludeHighlight:case n.H.ObjectAndLayerIdColor:(0,A.Sv)(r,t),e.include(s.w,t),e.include(h.D,t),e.include(b.k,t),e.include(p,t),e.include(a.f5,t),e.include(u,t),(0,o.Zu)(e),e.varyings.add("depth","float"),_&&d.uniforms.add(new g.A("tex",(e=>e.texture))),r.code.add(c.H`
558
+ void main(void) {
559
+ vpos = calculateVPos();
560
+ vpos = subtractOrigin(vpos);
561
+ vpos = addVerticalOffset(vpos, localOrigin);
562
+ gl_Position = transformPositionWithDepth(proj, view, ${m?"model,":""} vpos, nearFar, depth);
563
+ forwardTextureCoordinates();
564
+ forwardObjectAndLayerIdColor();
565
+ }
566
+ `),e.include(E.z,t),d.code.add(c.H`
567
+ void main(void) {
568
+ discardBySlice(vpos);
569
+ ${_?c.H`
570
+ vec4 texColor = texture(tex, ${t.hasColorTextureTransform?c.H`colorUV`:c.H`vuv0`});
571
+ discardOrAdjustAlpha(texColor);`:""}
572
+ ${t.output===n.H.ObjectAndLayerIdColor?c.H`outputObjectAndLayerIdColor();`:c.H`outputDepth(depth);`}
573
+ }
574
+ `);break;case n.H.Normal:{(0,A.Sv)(r,t),e.include(s.w,t),e.include(l.O,t),e.include(f.Bb,t),e.include(h.D,t),e.include(b.k,t),_&&d.uniforms.add(new g.A("tex",(e=>e.texture))),t.normalType===l.r.ScreenDerivative&&e.varyings.add("vPositionView","vec3");const i=t.normalType===l.r.Attribute||t.normalType===l.r.CompressedAttribute;r.code.add(c.H`
575
+ void main(void) {
576
+ vpos = calculateVPos();
577
+
578
+ ${i?c.H`
579
+ vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:c.H`
580
+ // Get vertex position in camera space for screen-space derivative normals
581
+ vPositionView = (view * (${m?"model *":""} vec4(vpos, 1.0))).xyz;
582
+ `}
583
+ vpos = subtractOrigin(vpos);
584
+ vpos = addVerticalOffset(vpos, localOrigin);
585
+ gl_Position = transformPosition(proj, view, ${m?"model,":""} vpos);
586
+ forwardTextureCoordinates();
587
+ }
588
+ `),e.include(a.f5,t),e.include(E.z,t),d.code.add(c.H`
589
+ void main() {
590
+ discardBySlice(vpos);
591
+ ${_?c.H`
592
+ vec4 texColor = texture(tex, ${t.hasColorTextureTransform?c.H`colorUV`:c.H`vuv0`});
593
+ discardOrAdjustAlpha(texColor);`:""}
594
+
595
+ ${t.normalType===l.r.ScreenDerivative?c.H`vec3 normal = screenDerivativeNormal(vPositionView);`:c.H`
596
+ vec3 normal = normalize(vNormalWorld);
597
+ if (gl_FrontFacing == false){
598
+ normal = -normal;
599
+ }`}
600
+ fragColor = vec4(0.5 + 0.5 * normal, 1.0);
601
+ }
602
+ `);break}case n.H.Highlight:(0,A.Sv)(r,t),e.include(s.w,t),e.include(h.D,t),e.include(b.k,t),_&&d.uniforms.add(new g.A("tex",(e=>e.texture))),r.code.add(c.H`
603
+ void main(void) {
604
+ vpos = calculateVPos();
605
+ vpos = subtractOrigin(vpos);
606
+ vpos = addVerticalOffset(vpos, localOrigin);
607
+ gl_Position = transformPosition(proj, view, ${m?"model,":""} vpos);
608
+ forwardTextureCoordinates();
609
+ }
610
+ `),e.include(a.f5,t),e.include(E.z,t),e.include(x,t),d.code.add(c.H`
611
+ void main() {
612
+ discardBySlice(vpos);
613
+ ${_?c.H`
614
+ vec4 texColor = texture(tex, ${t.hasColorTextureTransform?c.H`colorUV`:c.H`vuv0`});
615
+ discardOrAdjustAlpha(texColor);`:""}
616
+ outputHighlight();
617
+ }
618
+ `)}}},5543:(e,t,r)=>{r.d(t,{S:()=>n});var i=r(20285),o=r(74709);function n(e){e.include(i.n),e.code.add(o.H`float linearDepthFromFloat(float depth, vec2 nearFar) {
619
+ return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);
620
+ }
621
+ float linearDepthFromTexture(sampler2D depthTex, vec2 uv, vec2 nearFar) {
622
+ return linearDepthFromFloat(rgba2float(texture(depthTex, uv)), nearFar);
623
+ }`)}},15817:(e,t,r)=>{r.d(t,{Q:()=>u});var i=r(135),o=r(91982),n=r(19419),a=r(74709),s=r(16374),l=r(98069),c=r(67498),d=r(35065);function u(e,t){const r=e.fragment;t.hasVertexTangents?(e.attributes.add(d.T.TANGENT,"vec4"),e.varyings.add("vTangent","vec4"),t.doubleSidedMode===n.q.WindingOrder?r.code.add(a.H`mat3 computeTangentSpace(vec3 normal) {
624
+ float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
625
+ vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
626
+ vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
627
+ return mat3(tangent, bitangent, normal);
628
+ }`):r.code.add(a.H`mat3 computeTangentSpace(vec3 normal) {
629
+ float tangentHeadedness = vTangent.w;
630
+ vec3 tangent = normalize(vTangent.xyz);
631
+ vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
632
+ return mat3(tangent, bitangent, normal);
633
+ }`)):r.code.add(a.H`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {
634
+ vec3 Q1 = dFdx(pos);
635
+ vec3 Q2 = dFdy(pos);
636
+ vec2 stx = dFdx(st);
637
+ vec2 sty = dFdy(st);
638
+ float det = stx.t * sty.s - sty.t * stx.s;
639
+ vec3 T = stx.t * Q2 - sty.t * Q1;
640
+ T = T - normal * dot(normal, T);
641
+ T *= inversesqrt(max(dot(T,T), 1.e-10));
642
+ vec3 B = sign(det) * cross(normal, T);
643
+ return mat3(T, B, normal);
644
+ }`),t.textureCoordinateType!==i.N.None&&(e.include(o.i,t),r.uniforms.add(t.pbrTextureBindType===c.P.Pass?new l.A("normalTexture",(e=>e.textureNormal)):new s.R("normalTexture",(e=>e.textureNormal))),r.code.add(a.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
645
+ vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;
646
+ return tangentSpace * rawNormal;
647
+ }`))}},72160:(e,t,r)=>{r.d(t,{K:()=>p});var i=r(74709),o=r(98069),n=(r(4307),r(89917),r(78869)),a=r(14589),s=r(83475),l=r(59377),c=r(59915),d=r(27097);class u extends a.A{initializeProgram(e){return new l.$(e.rctx,u.shader.get().build(),s.i)}initializePipeline(){return(0,d.sm)({colorWrite:d.BK})}}u.shader=new n.J(c.S,(()=>r.e(8092).then(r.bind(r,88092))));var h=r(25377);class f extends a.A{initializeProgram(e){return new l.$(e.rctx,f.shader.get().build(),s.i)}initializePipeline(){return(0,d.sm)({colorWrite:d.BK})}}f.shader=new n.J(h.S,(()=>r.e(9243).then(r.bind(r,49243)))),r(97323),r(35371),r(33696),r(75656),r(45762);const m=2;function p(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new o.A("ssaoTex",((e,t)=>t.ssaoHelper.colorTexture))),r.constants.add("blurSizePixelsInverse","float",1/m),r.code.add(i.H`float evaluateAmbientOcclusionInverse() {
648
+ vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
649
+ return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).a;
650
+ }
651
+ float evaluateAmbientOcclusion() {
652
+ return 1.0 - evaluateAmbientOcclusionInverse();
653
+ }`)):r.code.add(i.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
654
+ float evaluateAmbientOcclusion() { return 0.0; }`)}},89753:(e,t,r)=>{r.d(t,{XP:()=>R,PN:()=>S,sC:()=>w});var i=r(74085),o=r(17896),n=r(65617),a=r(98766),s=r(88669),l=r(85504),c=r(172),d=r(71250),u=r(74709);function h(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new c.J("lightingAmbientSH0",((e,t)=>(0,o.s)(f,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) {
655
+ vec3 ambientLight = 0.282095 * lightingAmbientSH0;
656
+ return ambientLight * (1.0 - ambientOcclusion);
657
+ }`)):1===i?(r.uniforms.add([new d.N("lightingAmbientSH_R",((e,t)=>(0,a.s)(m,t.lighting.sh.r[0],t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3]))),new d.N("lightingAmbientSH_G",((e,t)=>(0,a.s)(m,t.lighting.sh.g[0],t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3]))),new d.N("lightingAmbientSH_B",((e,t)=>(0,a.s)(m,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) {
658
+ vec4 sh0 = vec4(
659
+ 0.282095,
660
+ 0.488603 * normal.x,
661
+ 0.488603 * normal.z,
662
+ 0.488603 * normal.y
663
+ );
664
+ vec3 ambientLight = vec3(
665
+ dot(lightingAmbientSH_R, sh0),
666
+ dot(lightingAmbientSH_G, sh0),
667
+ dot(lightingAmbientSH_B, sh0)
668
+ );
669
+ return ambientLight * (1.0 - ambientOcclusion);
670
+ }`)):2===i&&(r.uniforms.add([new c.J("lightingAmbientSH0",((e,t)=>(0,o.s)(f,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0]))),new d.N("lightingAmbientSH_R1",((e,t)=>(0,a.s)(m,t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3],t.lighting.sh.r[4]))),new d.N("lightingAmbientSH_G1",((e,t)=>(0,a.s)(m,t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3],t.lighting.sh.g[4]))),new d.N("lightingAmbientSH_B1",((e,t)=>(0,a.s)(m,t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3],t.lighting.sh.b[4]))),new d.N("lightingAmbientSH_R2",((e,t)=>(0,a.s)(m,t.lighting.sh.r[5],t.lighting.sh.r[6],t.lighting.sh.r[7],t.lighting.sh.r[8]))),new d.N("lightingAmbientSH_G2",((e,t)=>(0,a.s)(m,t.lighting.sh.g[5],t.lighting.sh.g[6],t.lighting.sh.g[7],t.lighting.sh.g[8]))),new d.N("lightingAmbientSH_B2",((e,t)=>(0,a.s)(m,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) {
671
+ vec3 ambientLight = 0.282095 * lightingAmbientSH0;
672
+ vec4 sh1 = vec4(
673
+ 0.488603 * normal.x,
674
+ 0.488603 * normal.z,
675
+ 0.488603 * normal.y,
676
+ 1.092548 * normal.x * normal.y
677
+ );
678
+ vec4 sh2 = vec4(
679
+ 1.092548 * normal.y * normal.z,
680
+ 0.315392 * (3.0 * normal.z * normal.z - 1.0),
681
+ 1.092548 * normal.x * normal.z,
682
+ 0.546274 * (normal.x * normal.x - normal.y * normal.y)
683
+ );
684
+ ambientLight += vec3(
685
+ dot(lightingAmbientSH_R1, sh1),
686
+ dot(lightingAmbientSH_G1, sh1),
687
+ dot(lightingAmbientSH_B1, sh1)
688
+ );
689
+ ambientLight += vec3(
690
+ dot(lightingAmbientSH_R2, sh2),
691
+ dot(lightingAmbientSH_G2, sh2),
692
+ dot(lightingAmbientSH_B2, sh2)
693
+ );
694
+ return ambientLight * (1.0 - ambientOcclusion);
695
+ }`),t.pbrMode!==l.f7.Normal&&t.pbrMode!==l.f7.Schematic||r.code.add(u.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
696
+ vec3 calculateAmbientRadiance(float ambientOcclusion)
697
+ {
698
+ vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
699
+ return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
700
+ }`))}const f=(0,n.c)(),m=(0,s.c)();var p=r(72160),_=r(5802),g=r(26322),v=r(27754),T=r(79884),x=r(67498);class b extends T.x{constructor(e,t){super(e,"bool",x.P.Pass,((r,i,o)=>r.setUniform1b(e,t(i,o))))}}var E=r(21437);r(22021),(0,n.c)();const A=.4;function S(e){e.constants.add("ambientBoostFactor","float",A)}function w(e){e.uniforms.add(new E.p("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)))}function R(e,t){const r=e.fragment;switch(e.include(p.K,t),t.pbrMode!==l.f7.Disabled&&e.include(g.T,t),e.include(h,t),e.include(v.e),r.code.add(u.H`
701
+ const float GAMMA_SRGB = 2.1;
702
+ const float INV_GAMMA_SRGB = 0.4761904;
703
+ ${t.pbrMode===l.f7.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
704
+ `),S(r),w(r),(0,_.Pe)(r),r.code.add(u.H`
705
+ float additionalDirectedAmbientLight(vec3 vPosWorld) {
706
+ float vndl = dot(${t.spherical?u.H`normalize(vPosWorld)`:u.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
707
+ return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
708
+ }
709
+ `),(0,_.F1)(r),r.code.add(u.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
710
+ float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
711
+ return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
712
+ }`),t.pbrMode){case l.f7.Disabled:case l.f7.WaterOnIntegratedMesh:case l.f7.Water:e.include(_.kR),r.code.add(u.H`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight)
713
+ {
714
+ vec3 mainLighting = evaluateMainLighting(normalWorld, shadow);
715
+ vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
716
+ vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
717
+ vec3 totalLight = mainLighting + ambientLighting + additionalLight;
718
+ totalLight = min(totalLight, vec3(PI));
719
+ vec3 outColor = vec3((albedoLinear / PI) * totalLight);
720
+ return pow(outColor, vec3(INV_GAMMA_SRGB));
721
+ }`);break;case l.f7.Normal:case l.f7.Schematic:r.code.add(u.H`const float fillLightIntensity = 0.25;
722
+ const float horizonLightDiffusion = 0.4;
723
+ const float additionalAmbientIrradianceFactor = 0.02;
724
+ vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance)
725
+ {
726
+ vec3 viewDirection = -viewDir;
727
+ vec3 h = normalize(viewDirection + mainLightDirection);
728
+ PBRShadingInfo inputs;
729
+ inputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
730
+ inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0);
731
+ inputs.NdotH = clamp(dot(normal, h), 0.0, 1.0);
732
+ inputs.VdotH = clamp(dot(viewDirection, h), 0.0, 1.0);
733
+ inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0);
734
+ vec3 reflectedView = normalize(reflect(viewDirection, normal));
735
+ inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0);
736
+ inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
737
+ inputs.ssao = ssao;
738
+ inputs.metalness = mrr[0];
739
+ 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;
740
+ inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
741
+ 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]);
742
+ ambientDir = ambientDir != vec3(0.0)? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
743
+ inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
744
+ vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * mainLightIntensity;
745
+ vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
746
+ vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
747
+ inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
748
+ inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add([new E.p("lightingSpecularStrength",((e,t)=>t.lighting.mainLight.specularStrength)),new E.p("lightingEnvironmentStrength",((e,t)=>t.lighting.mainLight.environmentStrength))]),r.code.add(u.H`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView;
749
+ vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
750
+ inputs.NdotH_Horizon = dot(normal, horizonRingH);
751
+ vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow);
752
+ vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity;
753
+ vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight;
754
+ inputs.skyRadianceToSurface = ambientLightRadianceComponent + mainLightRadianceComponent + horizonLightRadianceComponent;
755
+ inputs.groundRadianceToSurface = GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) + mainLightRadianceComponent;
756
+ inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(u.H`
757
+ vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
758
+ vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
759
+ vec3 emissionComponent = pow(_emission, vec3(GAMMA_SRGB));
760
+ vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
761
+ ${t.pbrMode===l.f7.Schematic?u.H`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:u.H`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`}
762
+ return outColor;
763
+ }
764
+ `);break;case l.f7.Terrain:case l.f7.TerrainWithWater:e.include(_.kR),r.code.add(u.H`const float roughnessTerrain = 0.5;
765
+ const float specularityTerrain = 0.5;
766
+ const vec3 fresnelReflectionTerrain = vec3(0.04);
767
+ vec3 evaluateTerrainLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) {
768
+ vec3 viewDirection = -vd;
769
+ vec3 h = normalize(viewDirection + mainLightDirection);
770
+ float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0);
771
+ float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0);
772
+ float NdotH = clamp(dot(n, h), 0.0, 1.0);
773
+ float NdotNG = clamp(dot(n, nup), -1.0, 1.0);
774
+ vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB));
775
+ float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2];
776
+ vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain;
777
+ vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0));
778
+ vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity;
779
+ vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al;
780
+ vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent;
781
+ vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5;
782
+ vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI;
783
+ vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity;
784
+ vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV);
785
+ vec3 specularColor = f0 * dfg.x + f90 * dfg.y;
786
+ vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent;
787
+ vec3 outColorLinear = outDiffColor + specularComponent;
788
+ vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB));
789
+ return outColor;
790
+ }`);break;default:(0,i.Bg)(t.pbrMode);case l.f7.COUNT:}}(0,n.c)()},5802:(e,t,r)=>{r.d(t,{F1:()=>a,Pe:()=>n,kR:()=>s});var i=r(172),o=r(74709);function n(e){e.uniforms.add(new i.J("mainLightDirection",((e,t)=>t.lighting.mainLight.direction)))}function a(e){e.uniforms.add(new i.J("mainLightIntensity",((e,t)=>t.lighting.mainLight.intensity)))}function s(e){n(e.fragment),a(e.fragment),e.fragment.code.add(o.H`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) {
791
+ float dotVal = clamp(dot(normal_global, mainLightDirection), 0.0, 1.0);
792
+ return mainLightIntensity * ((1.0 - shadowing) * dotVal);
793
+ }`)}},42001:(e,t,r)=>{r.d(t,{l:()=>s});var i=r(5543),o=r(19693),n=r(74709),a=r(98069);function s(e,t){t.hasMultipassTerrain&&(e.fragment.include(i.S),e.fragment.uniforms.add(new a.A("terrainDepthTexture",((e,t)=>t.multipassTerrain.linearDepthTexture))),e.fragment.uniforms.add(new o.A("nearFar",((e,t)=>t.camera.nearFar))),e.fragment.uniforms.add(new o.A("inverseViewport",((e,t)=>t.inverseViewport))),e.fragment.code.add(n.H`
794
+ void terrainDepthTest(vec4 fragCoord, float fragmentDepth){
795
+ float terrainDepth = linearDepthFromTexture(terrainDepthTexture, fragCoord.xy * inverseViewport, nearFar);
796
+ if(fragmentDepth ${t.cullAboveGround?">":"<="} terrainDepth){
797
+ discard;
798
+ }
799
+ }
800
+ `))}},19419:(e,t,r)=>{r.d(t,{k:()=>s,q:()=>i});var i,o,n=r(74085),a=r(74709);function s(e,t){const r=e.fragment;switch(r.code.add(a.H`struct ShadingNormalParameters {
801
+ vec3 normalView;
802
+ vec3 viewDirection;
803
+ } shadingParams;`),t.doubleSidedMode){case i.None:r.code.add(a.H`vec3 shadingNormal(ShadingNormalParameters params) {
804
+ return normalize(params.normalView);
805
+ }`);break;case i.View:r.code.add(a.H`vec3 shadingNormal(ShadingNormalParameters params) {
806
+ return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView);
807
+ }`);break;case i.WindingOrder:r.code.add(a.H`vec3 shadingNormal(ShadingNormalParameters params) {
808
+ return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView);
809
+ }`);break;default:(0,n.Bg)(t.doubleSidedMode);case i.COUNT:}}(o=i||(i={}))[o.None=0]="None",o[o.View=1]="View",o[o.WindingOrder=2]="WindingOrder",o[o.COUNT=3]="COUNT"},26322:(e,t,r)=>{r.d(t,{T:()=>s});var i=r(74709);function o(e){const t=e.fragment.code;t.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)
810
+ {
811
+ return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
812
+ }`),t.add(i.H`float integratedRadiance(float cosTheta2, float roughness)
813
+ {
814
+ return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
815
+ }`),t.add(i.H`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness)
816
+ {
817
+ float cosTheta2 = 1.0 - RdotNG * RdotNG;
818
+ float intRadTheta = integratedRadiance(cosTheta2, roughness);
819
+ float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
820
+ float sky = 2.0 - ground;
821
+ return (ground * ambientGround + sky * ambientSky) * 0.5;
822
+ }`)}var n=r(85504),a=r(27754);function s(e,t){const r=e.fragment.code;e.include(a.e),t.pbrMode!==n.f7.Normal&&t.pbrMode!==n.f7.Schematic&&t.pbrMode!==n.f7.Terrain&&t.pbrMode!==n.f7.TerrainWithWater||(r.add(i.H`float normalDistribution(float NdotH, float roughness)
823
+ {
824
+ float a = NdotH * roughness;
825
+ float b = roughness / (1.0 - NdotH * NdotH + a * a);
826
+ return b * b * INV_PI;
827
+ }`),r.add(i.H`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
828
+ const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040);
829
+ const vec2 c2 = vec2(-1.04, 1.04);
830
+ vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
831
+ vec4 r = roughness * c0 + c1;
832
+ float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
833
+ return c2 * a004 + r.zw;
834
+ }`)),t.pbrMode!==n.f7.Normal&&t.pbrMode!==n.f7.Schematic||(e.include(o),r.add(i.H`struct PBRShadingInfo
835
+ {
836
+ float NdotL;
837
+ float NdotV;
838
+ float NdotH;
839
+ float VdotH;
840
+ float LdotH;
841
+ float NdotNG;
842
+ float RdotNG;
843
+ float NdotAmbDir;
844
+ float NdotH_Horizon;
845
+ vec3 skyRadianceToSurface;
846
+ vec3 groundRadianceToSurface;
847
+ vec3 skyIrradianceToSurface;
848
+ vec3 groundIrradianceToSurface;
849
+ float averageAmbientRadiance;
850
+ float ssao;
851
+ vec3 albedoLinear;
852
+ vec3 f0;
853
+ vec3 f90;
854
+ vec3 diffuseColor;
855
+ float metalness;
856
+ float roughness;
857
+ };`),r.add(i.H`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
858
+ vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG);
859
+ vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness);
860
+ vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;
861
+ vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);
862
+ vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
863
+ vec3 specularComponent = specularColor * indirectSpecular;
864
+ return (diffuseComponent + specularComponent);
865
+ }`),r.add(i.H`float gamutMapChanel(float x, vec2 p){
866
+ return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
867
+ }`),r.add(i.H`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){
868
+ vec3 outColor;
869
+ vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance));
870
+ outColor.x = gamutMapChanel(inColor.x, p) ;
871
+ outColor.y = gamutMapChanel(inColor.y, p) ;
872
+ outColor.z = gamutMapChanel(inColor.z, p) ;
873
+ return outColor;
874
+ }`))}},85504:(e,t,r)=>{r.d(t,{f7:()=>i,jV:()=>f});var i,o,n=r(72119),a=r(91982),s=r(70582),l=r(172),c=r(74709),d=r(16374),u=r(98069),h=r(67498);function f(e,t){const r=e.fragment,o=t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture;if(t.pbrMode===i.Normal&&o&&e.include(a.i,t),t.pbrMode!==i.Schematic)if(t.pbrMode!==i.Disabled){if(t.pbrMode===i.Normal){r.code.add(c.H`vec3 mrr;
875
+ vec3 emission;
876
+ float occlusion;`);const e=t.pbrTextureBindType;t.hasMetallicRoughnessTexture&&(r.uniforms.add(e===h.P.Pass?new u.A("texMetallicRoughness",(e=>e.textureMetallicRoughness)):new d.R("texMetallicRoughness",(e=>e.textureMetallicRoughness))),r.code.add(c.H`void applyMetallnessAndRoughness(vec2 uv) {
877
+ vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
878
+ mrr[0] *= metallicRoughness.b;
879
+ mrr[1] *= metallicRoughness.g;
880
+ }`)),t.hasEmissionTexture&&(r.uniforms.add(e===h.P.Pass?new u.A("texEmission",(e=>e.textureEmissive)):new d.R("texEmission",(e=>e.textureEmissive))),r.code.add(c.H`void applyEmission(vec2 uv) {
881
+ emission *= textureLookup(texEmission, uv).rgb;
882
+ }`)),t.hasOcclusionTexture?(r.uniforms.add(e===h.P.Pass?new u.A("texOcclusion",(e=>e.textureOcclusion)):new d.R("texOcclusion",(e=>e.textureOcclusion))),r.code.add(c.H`void applyOcclusion(vec2 uv) {
883
+ occlusion *= textureLookup(texOcclusion, uv).r;
884
+ }
885
+ float getBakedOcclusion() {
886
+ return occlusion;
887
+ }`)):r.code.add(c.H`float getBakedOcclusion() { return 1.0; }`),r.uniforms.add(e===h.P.Pass?[new l.J("emissionFactor",(e=>e.emissiveFactor)),new l.J("mrrFactors",(e=>e.mrrFactors))]:[new s.B("emissionFactor",(e=>e.emissiveFactor)),new s.B("mrrFactors",(e=>e.mrrFactors))]),r.code.add(c.H`
888
+ void applyPBRFactors() {
889
+ mrr = mrrFactors;
890
+ emission = emissionFactor;
891
+ occlusion = 1.0;
892
+
893
+ ${t.hasMetallicRoughnessTexture?c.H`applyMetallnessAndRoughness(${t.hasMetallicRoughnessTextureTransform?c.H`metallicRoughnessUV`:"vuv0"});`:""}
894
+
895
+ ${t.hasEmissionTexture?c.H`applyEmission(${t.hasEmissiveTextureTransform?c.H`emissiveUV`:"vuv0"});`:""}
896
+
897
+ ${t.hasOcclusionTexture?c.H`applyOcclusion(${t.hasOcclusionTextureTransform?c.H`occlusionUV`:"vuv0"});`:""}
898
+ }
899
+ `)}}else r.code.add(c.H`float getBakedOcclusion() { return 1.0; }`);else r.code.add(c.H`vec3 mrr = vec3(0.0, 0.6, 0.2);
900
+ vec3 emission = vec3(0.0);
901
+ float occlusion = 1.0;
902
+ void applyPBRFactors() {}
903
+ float getBakedOcclusion() { return 1.0; }`)}r(60537),(0,n.f)(0,.6,.2),(o=i||(i={}))[o.Disabled=0]="Disabled",o[o.Normal=1]="Normal",o[o.Schematic=2]="Schematic",o[o.Water=3]="Water",o[o.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",o[o.Terrain=5]="Terrain",o[o.TerrainWithWater=6]="TerrainWithWater",o[o.COUNT=7]="COUNT"},27754:(e,t,r)=>{r.d(t,{e:()=>o});var i=r(74709);function o(e){e.vertex.code.add(i.H`const float PI = 3.141592653589793;`),e.fragment.code.add(i.H`const float PI = 3.141592653589793;
904
+ const float LIGHT_NORMALIZATION = 1.0 / PI;
905
+ const float INV_PI = 0.3183098861837907;
906
+ const float HALF_PI = 1.570796326794897;`)}},22539:(e,t,r)=>{r.d(t,{XE:()=>f,hb:()=>h}),r(65617);var i=r(20285),o=r(71250),n=r(15736),a=r(74709),s=r(79884),l=r(67498);class c extends s.x{constructor(e,t,r){super(e,"mat4",l.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))),r)}}class d extends s.x{constructor(e,t,r){super(e,"mat4",l.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))),r)}}var u=r(98069);function h(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new d("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),m(e))}function f(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new c("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),m(e))}function m(e){const t=e.fragment;t.include(i.n),t.uniforms.add([new u.A("shadowMapTex",((e,t)=>t.shadowMap.depthTexture)),new n._("numCascades",((e,t)=>t.shadowMap.numCascades)),new o.N("cascadeDistances",((e,t)=>t.shadowMap.cascadeDistances))]),t.code.add(a.H`int chooseCascade(float depth, out mat4 mat) {
907
+ vec4 distance = cascadeDistances;
908
+ int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
909
+ mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
910
+ return i;
911
+ }
912
+ vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
913
+ vec4 lv = mat * vec4(_vpos, 1.0);
914
+ lv.xy /= lv.w;
915
+ return 0.5 * lv.xyz + vec3(0.5);
916
+ }
917
+ vec2 cascadeCoordinates(int i, vec3 lvpos) {
918
+ return vec2(float(i - 2 * (i / 2)) * 0.5, float(i / 2) * 0.5) + 0.5 * lvpos.xy;
919
+ }
920
+ float readShadowMapDepth(vec2 uv, sampler2D _depthTex) {
921
+ return rgba2float(texture(_depthTex, uv));
922
+ }
923
+ float posIsInShadow(vec2 uv, vec3 lvpos, sampler2D _depthTex) {
924
+ return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0;
925
+ }
926
+ float filterShadow(vec2 uv, vec3 lvpos, float texSize, sampler2D _depthTex) {
927
+ float halfPixelSize = 0.5 / texSize;
928
+ vec2 st = fract((vec2(halfPixelSize) + uv) * texSize);
929
+ float s00 = posIsInShadow(uv + vec2(-halfPixelSize, -halfPixelSize), lvpos, _depthTex);
930
+ float s10 = posIsInShadow(uv + vec2(halfPixelSize, -halfPixelSize), lvpos, _depthTex);
931
+ float s11 = posIsInShadow(uv + vec2(halfPixelSize, halfPixelSize), lvpos, _depthTex);
932
+ float s01 = posIsInShadow(uv + vec2(-halfPixelSize, halfPixelSize), lvpos, _depthTex);
933
+ return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);
934
+ }
935
+ float readShadowMap(const in vec3 _vpos, float _linearDepth) {
936
+ mat4 mat;
937
+ int i = chooseCascade(_linearDepth, mat);
938
+ if (i >= numCascades) { return 0.0; }
939
+ vec3 lvpos = lightSpacePosition(_vpos, mat);
940
+ if (lvpos.z >= 1.0) { return 0.0; }
941
+ if (lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }
942
+ vec2 uv = cascadeCoordinates(i, lvpos);
943
+ return filterShadow(uv, lvpos, float(textureSize(shadowMapTex, 0).x), shadowMapTex);
944
+ }`)}},57806:(e,t,r)=>{r.d(t,{DT:()=>d,NI:()=>s,R5:()=>l,av:()=>a,jF:()=>c});var i=r(14682),o=r(74709),n=r(19850);function a(e){e.vertex.uniforms.add(new n.c("colorTextureTransformMatrix",(e=>null!=e.colorTextureTransformMatrix?e.colorTextureTransformMatrix:(0,i.c)()))),e.varyings.add("colorUV","vec2"),e.vertex.code.add(o.H`void forwardColorUV(){
945
+ colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
946
+ }`)}function s(e){e.vertex.uniforms.add(new n.c("normalTextureTransformMatrix",(e=>null!=e.normalTextureTransformMatrix?e.normalTextureTransformMatrix:(0,i.c)()))),e.varyings.add("normalUV","vec2"),e.vertex.code.add(o.H`void forwardNormalUV(){
947
+ normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
948
+ }`)}function l(e){e.vertex.uniforms.add(new n.c("emissiveTextureTransformMatrix",(e=>null!=e.emissiveTextureTransformMatrix?e.emissiveTextureTransformMatrix:(0,i.c)()))),e.varyings.add("emissiveUV","vec2"),e.vertex.code.add(o.H`void forwardEmissiveUV(){
949
+ emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
950
+ }`)}function c(e){e.vertex.uniforms.add(new n.c("occlusionTextureTransformMatrix",(e=>null!=e.occlusionTextureTransformMatrix?e.occlusionTextureTransformMatrix:(0,i.c)()))),e.varyings.add("occlusionUV","vec2"),e.vertex.code.add(o.H`void forwardOcclusionUV(){
951
+ occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
952
+ }`)}function d(e){e.vertex.uniforms.add(new n.c("metallicRoughnessTextureTransformMatrix",(e=>null!=e.metallicRoughnessTextureTransformMatrix?e.metallicRoughnessTextureTransformMatrix:(0,i.c)()))),e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.code.add(o.H`void forwardMetallicRoughnessUV(){
953
+ metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
954
+ }`)}},92302:(e,t,r)=>{r.d(t,{k:()=>E});var i=r(172),o=r(79884),n=r(67498);class a extends o.x{constructor(e,t,r){super(e,"vec4",n.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))),r)}}class s extends o.x{constructor(e,t,r){super(e,"float",n.P.Pass,((r,i,o)=>r.setUniform1fv(e,t(i,o))),r)}}var l=r(74709),c=r(19850),d=r(35065),u=(r(80442),r(22021),r(21787),r(46521),r(52138),r(13598)),h=(r(17896),r(65617)),f=(r(99282),r(43697)),m=r(15923),p=r(5600),_=(r(75215),r(67676),r(52011));let g=class extends m.Z{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 v,T,x;(0,f._)([(0,p.Cb)()],g.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"LABELS_SHOW_BORDER",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"TEXT_SHOW_BASELINE",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"TEXT_SHOW_BORDER",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"SHOW_POI",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,f._)([(0,p.Cb)()],g.prototype,"LINE_WIREFRAMES",void 0),g=(0,f._)([(0,_.j)("esri.views.3d.support.DebugFlags")],g),new g,(x=v||(v={}))[x.Undefined=0]="Undefined",x[x.DefinedSize=1]="DefinedSize",x[x.DefinedScale=2]="DefinedScale",function(e){e[e.Undefined=0]="Undefined",e[e.DefinedAngle=1]="DefinedAngle"}(T||(T={})),(0,u.c)(),(0,h.c)(),(0,u.c)(),r(82791);const b=8;function E(e,t){const{vertex:r,attributes:o}=e;t.hasVvInstancing&&(t.vvSize||t.vvColor)&&o.add(d.T.INSTANCEFEATUREATTRIBUTE,"vec4"),t.vvSize?(r.uniforms.add(new i.J("vvSizeMinSize",(e=>e.vvSize.minSize))),r.uniforms.add(new i.J("vvSizeMaxSize",(e=>e.vvSize.maxSize))),r.uniforms.add(new i.J("vvSizeOffset",(e=>e.vvSize.offset))),r.uniforms.add(new i.J("vvSizeFactor",(e=>e.vvSize.factor))),r.uniforms.add(new c.c("vvSymbolRotationMatrix",(e=>e.vvSymbolRotationMatrix))),r.uniforms.add(new i.J("vvSymbolAnchor",(e=>e.vvSymbolAnchor))),r.code.add(l.H`vec3 vvScale(vec4 _featureAttribute) {
955
+ return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);
956
+ }
957
+ vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
958
+ return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
959
+ }`),r.code.add(l.H`
960
+ const float eps = 1.192092896e-07;
961
+ vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
962
+ vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize);
963
+ return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0);
964
+ }
965
+
966
+ ${t.hasVvInstancing?l.H`
967
+ vec4 vvLocalNormal(vec3 _normal) {
968
+ return vvTransformNormal(_normal, instanceFeatureAttribute);
969
+ }
970
+
971
+ vec4 localPosition() {
972
+ return vvTransformPosition(position, instanceFeatureAttribute);
973
+ }`:""}
974
+ `)):r.code.add(l.H`vec4 localPosition() { return vec4(position, 1.0); }
975
+ 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`
976
+ vec4 interpolateVVColor(float value) {
977
+ if (value <= vvColorValues[0]) {
978
+ return vvColorColors[0];
979
+ }
980
+
981
+ for (int i = 1; i < vvColorNumber; ++i) {
982
+ if (vvColorValues[i] >= value) {
983
+ float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
984
+ return mix(vvColorColors[i-1], vvColorColors[i], f);
985
+ }
986
+ }
987
+ return vvColorColors[vvColorNumber - 1];
988
+ }
989
+
990
+ vec4 vvGetColor(vec4 featureAttribute) {
991
+ return interpolateVVColor(featureAttribute.y);
992
+ }
993
+
994
+ ${t.hasVvInstancing?l.H`
995
+ vec4 vvColor() {
996
+ return vvGetColor(instanceFeatureAttribute);
997
+ }`:"vec4 vvColor() { return vec4(1.0); }"}
998
+ `)):r.code.add(l.H`vec4 vvColor() { return vec4(1.0); }`)}},96310:(e,t,r)=>{r.d(t,{F:()=>i,b:()=>o});const i=.1,o=.001},85787:(e,t,r)=>{r.d(t,{z:()=>l});var i=r(96310),o=r(74709);function n(e){e.fragment.code.add(o.H`
999
+ #define discardOrAdjustAlpha(color) { if (color.a < ${o.H.float(i.b)}) { discard; } }
1000
+ `)}r(79884),r(67498);var a=r(21437),s=r(47026);function l(e,t){!function(e,t,r){const i=e.fragment;switch(t.alphaDiscardMode!==s.JJ.Mask&&t.alphaDiscardMode!==s.JJ.MaskBlend||i.uniforms.add(r),t.alphaDiscardMode){case s.JJ.Blend:return e.include(n);case s.JJ.Opaque:i.code.add(o.H`void discardOrAdjustAlpha(inout vec4 color) {
1001
+ color.a = 1.0;
1002
+ }`);break;case s.JJ.Mask:i.code.add(o.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case s.JJ.MaskBlend:e.fragment.code.add(o.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}(e,t,new a.p("textureAlphaCutoff",(e=>e.textureAlphaCutoff)))}},20787:(e,t,r)=>{r.d(t,{G:()=>d,R:()=>h});var i=r(4307),o=r(97323),n=r(98766),a=r(88669),s=r(19693),l=r(71250),c=r(74709);function d(e){e.fragment.uniforms.add(new l.N("projInfo",((e,t)=>function(e){const t=e.camera.projectionMatrix;return 0===t[11]?(0,n.s)(u,2/(e.camera.fullWidth*t[0]),2/(e.camera.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,n.s)(u,-2/(e.camera.fullWidth*t[0]),-2/(e.camera.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(t)))),e.fragment.uniforms.add(new s.A("zScale",((e,t)=>h(t)))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
1003
+ return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
1004
+ }`)}const u=(0,a.c)();function h(e){return 0===e.camera.projectionMatrix[11]?(0,i.s)(f,0,1):(0,i.s)(f,1,0)}const f=(0,o.a)()},89243:(e,t,r)=>{r.d(t,{$:()=>o});var i=r(74709);function o({code:e},t){t.doublePrecisionRequiresObfuscation?e.add(i.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(i.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
+ }`)}},90692:(e,t,r)=>{r.d(t,{y:()=>a});var i=r(6206),o=r(74709);function n(e){e.code.add(o.H`vec4 premultiplyAlpha(vec4 v) {
1021
+ return vec4(v.rgb * v.a, v.a);
1022
+ }
1023
+ vec3 rgb2hsv(vec3 c) {
1024
+ vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
1025
+ vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
1026
+ vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
1027
+ float d = q.x - min(q.w, q.y);
1028
+ float e = 1.0e-10;
1029
+ return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);
1030
+ }
1031
+ vec3 hsv2rgb(vec3 c) {
1032
+ vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
1033
+ vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
1034
+ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
1035
+ }
1036
+ float rgb2v(vec3 c) {
1037
+ return max(c.x, max(c.y, c.z));
1038
+ }`)}function a(e){e.include(n),e.code.add(o.H`
1039
+ vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
1040
+ // workaround for artifacts in OSX using Intel Iris Pro
1041
+ // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
1042
+ vec3 internalMixed = internalColor * textureColor;
1043
+ vec3 allMixed = internalMixed * externalColor;
1044
+
1045
+ if (mode == ${o.H.int(i.a9.Multiply)}) {
1046
+ return allMixed;
1047
+ }
1048
+ if (mode == ${o.H.int(i.a9.Ignore)}) {
1049
+ return internalMixed;
1050
+ }
1051
+ if (mode == ${o.H.int(i.a9.Replace)}) {
1052
+ return externalColor;
1053
+ }
1054
+
1055
+ // tint (or something invalid)
1056
+ float vIn = rgb2v(internalMixed);
1057
+ vec3 hsvTint = rgb2hsv(externalColor);
1058
+ vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);
1059
+ return hsv2rgb(hsvOut);
1060
+ }
1061
+
1062
+ float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
1063
+ // workaround for artifacts in OSX using Intel Iris Pro
1064
+ // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
1065
+ float internalMixed = internalOpacity * textureOpacity;
1066
+ float allMixed = internalMixed * externalOpacity;
1067
+
1068
+ if (mode == ${o.H.int(i.a9.Ignore)}) {
1069
+ return internalMixed;
1070
+ }
1071
+ if (mode == ${o.H.int(i.a9.Replace)}) {
1072
+ return externalOpacity;
1073
+ }
1074
+
1075
+ // multiply or tint (or something invalid)
1076
+ return allMixed;
1077
+ }
1078
+ `)}},20285:(e,t,r)=>{r.d(t,{n:()=>o});var i=r(74709);function o(e){e.code.add(i.H`const float MAX_RGBA_FLOAT =
1079
+ 255.0 / 256.0 +
1080
+ 255.0 / 256.0 / 256.0 +
1081
+ 255.0 / 256.0 / 256.0 / 256.0 +
1082
+ 255.0 / 256.0 / 256.0 / 256.0 / 256.0;
1083
+ const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0);
1084
+ vec4 float2rgba(const float value) {
1085
+ float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT);
1086
+ vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0);
1087
+ const float toU8AsFloat = 1.0 / 255.0;
1088
+ return fixedPointU8 * toU8AsFloat;
1089
+ }
1090
+ const vec4 RGBA_2_FLOAT_FACTORS = vec4(
1091
+ 255.0 / (256.0),
1092
+ 255.0 / (256.0 * 256.0),
1093
+ 255.0 / (256.0 * 256.0 * 256.0),
1094
+ 255.0 / (256.0 * 256.0 * 256.0 * 256.0)
1095
+ );
1096
+ float rgba2float(vec4 rgba) {
1097
+ return dot(rgba, RGBA_2_FLOAT_FACTORS);
1098
+ }`)}},93669:(e,t,r)=>{r.d(t,{hY:()=>f,Sv:()=>m,_8:()=>g});var i=r(52138),o=r(10937),n=r(17896),a=r(65617),s=r(70582),l=r(172),c=r(79884),d=r(67498);class u extends c.x{constructor(e,t){super(e,"mat4",d.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(8319);function f(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,n.s)(_,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function m(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add([new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new u("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,e.origin))),new s.B("localOrigin",(e=>e.origin))]);const r=e=>(0,n.s)(_,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add([new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new h.g("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,r(t)))),new l.J("localOrigin",((e,t)=>r(t)))])}const p=(0,o.c)(),_=(0,a.c)();function g(e){e.uniforms.add(new h.g("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},98925:(e,t,r)=>{r.d(t,{q:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Draw,((r,i,o,n)=>r.setUniform2fv(e,t(i,o,n))))}}},19693:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Draw,((r,i,o,n)=>r.setUniform3fv(e,t(i,o,n))))}}},172:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec4",o.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"float",o.P.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"int",o.P.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat4",o.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},33680:(e,t,r)=>{r.d(t,{kG:()=>l});var i=r(20102),o=r(92604),n=r(11726);const a=o.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){a.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else 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 f,this.extensions=new m,this.constants=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),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s="vertex"===e?g:_,l=this.constants.generateSource().concat(o.constants.generateSource());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${i.join("\n")}\n\n${a.join("\n")}`}generateBind(e,t){const r=new Map;this.vertex.uniforms.entries.forEach((t=>{const i=t.bind[e];null!=i&&r.set(t.name,i)})),this.fragment.uniforms.entries.forEach((t=>{const i=t.bind[e];null!=i&&r.set(t.name,i)}));const i=Array.from(r.values()),o=i.length;return(e,r,n)=>{for(let a=0;a<o;++a)i[a](t,e,r,n)}}}class c{constructor(){this._entries=new Map}add(e){if(!Array.isArray(e))return this._add(e);for(const t of e)this._add(t)}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else a.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(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class u extends s{constructor(){super(...arguments),this.uniforms=new c,this.code=new d,this.constants=new p}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 f{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,n.hu)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push("vertex"===e?`out ${r} ${i};`:`in ${r} ${i};`))),t}}class m{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?m.ALLOWLIST_VERTEX:m.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}m.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],m.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=p._numberToFloatStr(r);break;case"int":i=p._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])}, ${p._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])}, ${p._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>p._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),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 _="#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\n\nout vec4 fragColor;",g="precision highp float;\nprecision highp sampler2D;"},16374:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},98069:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},79884:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(67498);class o{constructor(e,t,r,o,n=null){this.name=e,this.type=t,this.arraySize=n,this.bind={[i.P.Pass]:null,[i.P.Draw]:null},null!=r&&null!=o&&(this.bind[r]=o)}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>o,K:()=>i});const i=class{};function o(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}var n;(n=o||(o={})).int=function(e){return Math.round(e).toString()},n.float=function(e){return e.toPrecision(8)}},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},78869:(e,t,r)=>{r.d(t,{J:()=>i});class i{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},14589:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(70586),o=r(35371);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.rctx.capabilities)}destroy(){this._program=(0,i.M2)(this._program),this._pipeline=this._configuration=null}reload(e){(0,i.M2)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return o.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}},51354:(e,t,r)=>{r.d(t,{m:()=>o,o:()=>n});var i=r(74709);class o extends i.K{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 n(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,o=e.count||2,n=Math.ceil(Math.log2(o)),a=t._parameterBits??[0];let s=0;for(;a[s]+n>16;)s++,s>=a.length&&a.push(0);t._parameterBits=a;const l=a[s],c=(1<<n)-1<<l;a[s]+=n,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw new Error("Configuration value for "+r+" must be boolean or number, got "+typeof e)}})}}}},17662:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(99001);class o{constructor(){this.id=(0,i.D)()}unload(){}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),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"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(35065);const o=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.NORMALCOMPRESSED,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.COLORFEATUREATTRIBUTE,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.INSTANCECOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR_INSTANCED,7],[i.T.MODEL,8],[i.T.MODELNORMAL,12],[i.T.MODELORIGINHI,11],[i.T.MODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>l});var i=r(70586),o=r(95330),n=r(74709),a=r(47026);class s{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}ensureTechnique(e,t){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return a.Rw.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,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,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?a.Rw.LOADED:a.Rw.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,i.RY)(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._textureRepository.acquire(e);if((0,o.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends n.K{constructor(e=null,t=null,r=null,i=null,o=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o}}},82791:(e,t,r)=>{r.d(t,{F5:()=>d,yD:()=>i});var i,o,n=r(65617),a=(r(74709),r(17662)),s=r(4726),l=r(83475),c=r(57790);class d extends a.c{constructor(e,t){super(),this.type=s.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=l.i,this._pp0=(0,n.f)(0,0,1),this._pp1=(0,n.f)(0,0,0),this._parameters=(0,c.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,c.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){null!=this.repository&&this.repository.materialChanged(this)}intersectDraped(e,t,r,i,o,n){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque"},59377:(e,t,r)=>{r.d(t,{$:()=>a});var i=r(44553),o=r(67498),n=r(49300);class a{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new i.Z({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.generateBind(o.P.Pass,this),this.bindDraw=t.generateBind(o.P.Draw,this),this._fragmentUniforms=(0,n.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}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.setUniform3iv(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||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)})),null!=this._fragmentUniforms&&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)}}},93144:(e,t,r)=>{var i;r.d(t,{A:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},89917:(e,t,r)=>{r.d(t,{ow:()=>_});var i=r(83475),o=r(35065),n=r(35371),a=r(21968);new a.G(o.T.POSITION,3,n.g.FLOAT,0,12),new a.G(o.T.POSITION,3,n.g.FLOAT,0,20),new a.G(o.T.UV0,2,n.g.FLOAT,12,20),new a.G(o.T.POSITION,3,n.g.FLOAT,0,32),new a.G(o.T.NORMAL,3,n.g.FLOAT,12,32),new a.G(o.T.UV0,2,n.g.FLOAT,24,32),new a.G(o.T.POSITION,3,n.g.FLOAT,0,16),new a.G(o.T.COLOR,4,n.g.UNSIGNED_BYTE,12,16);const s=[new a.G(o.T.POSITION,2,n.g.FLOAT,0,8)],l=[new a.G(o.T.POSITION,2,n.g.FLOAT,0,16),new a.G(o.T.UV0,2,n.g.FLOAT,8,16)];var c=r(92604),d=r(70586),u=r(45762);const h=c.Z.getLogger("esri.views.webgl.VertexArrayObject");let f=class{constructor(e,t,r,i,o=null){this._context=e,this._locations=t,this._layout=r,this._buffers=i,this._indexBuffer=o,this._glName=null,this._initialized=!1,e.instanceCounter.increment(n._g.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((e,t)=>e+this._buffers[t].size),null!=this._indexBuffer?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(this._context){if(this._glName){const e=this._context?.capabilities?.vao;e?(e.deleteVertexArray(this._glName),this._glName=null):h.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const e in this._buffers)this._buffers[e]?.dispose(),delete this._buffers[e];this._indexBuffer=(0,d.M2)(this._indexBuffer)}this._context.instanceCounter.decrement(n._g.VertexArrayObject,this),this._context=(0,d.wN)(this._context)}else(this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&h.warn("Leaked WebGL VAO")}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||h.error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const r in e){const i=e[r];i||h.error("Vertex buffer is uninitialized!");const o=t[r];o||h.error("Vertex element descriptor is empty!"),(0,u.XP)(this._context,this._locations,i,o)}null!=r&&(this._context.capabilities.vao?i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:t}=this;e||h.error("Vertex buffer dictionary is empty!");for(const r in e){const i=e[r];i||h.error("Vertex buffer is uninitialized!");const o=t[r];(0,u.UF)(this._context,this._locations,i,o)}null!=this._indexBuffer&&this._context.unbindBuffer(this._indexBuffer.bufferType)}};class m extends f{}var p=r(63587);function _(e,t=s,r=i.i,o=-1,a=1){let c=null;return c=t===l?new Float32Array([o,o,0,0,a,o,1,0,o,a,0,1,a,a,1,1]):new Float32Array([o,o,a,o,o,a,a,a]),new m(e,r,{geometry:t},{geometry:p.f.createVertex(e,n.l1.STATIC_DRAW,c)})}r(75656)},57790:(e,t,r)=>{r.d(t,{FZ:()=>R,Uf:()=>A,Bw:()=>m,LO:()=>S,Hx:()=>E});var i=r(67676),o=r(22021),n=r(17896),a=r(65617),s=r(60437),l=r(4726);function c(e,t,r,i){return function(e,t){return Math.max((0,o.t7)(e*t.scale,e,t.factor),function(e,t){return 0===e?t.minPixelSize:t.minPixelSize*(1+2*t.paddingPixels/e)}(e,t))}(e,function(e,t,r){const i=r.parameters,o=r.paddingPixelsOverride;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d.minPixelSize=i.minPixelSize,d.paddingPixels=o,d}(t,r,i))}r(64822),(0,o.Vl)(10),(0,o.Vl)(12),(0,o.Vl)(70),(0,o.Vl)(40);const d={scale:0,factor:0,minPixelSize:0,paddingPixels:0};var u=r(11726),h=r(35065);const f=(0,s.Ue)();function m(e,t,r,i,o,n){if(e.visible)if(e.boundingInfo){(0,u.hu)(e.type===l.U.Mesh);const a=t.tolerance;_(e.boundingInfo,r,i,a,o,n)}else{const t=e.indices.get(h.T.POSITION),a=e.vertexAttributes.get(h.T.POSITION);v(r,i,0,t.length/3,t,a,void 0,o,n)}}const p=(0,a.c)();function _(e,t,r,i,o,a){if(null==e)return;const l=function(e,t,r){return(0,n.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,p);if((0,s.op)(f,e.bbMin),(0,s.Tn)(f,e.bbMax),null!=o&&o.applyToAabb(f),function(e,t,r,i){return function(e,t,r,i,o){const n=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(n,a),l=Math.max(n,a);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-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]-i-t[2])*r[2],h=(e[5]+i-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,i)}(f,t,l,i)){const{primitiveIndices:n,indices:s,position:l}=e,c=n?n.length:s.length/3;if(c>y){const n=e.getChildren();if(void 0!==n){for(const e of n)_(e,t,r,i,o,a);return}}v(t,r,0,c,s,l,n,o,a)}}const g=(0,a.c)();function v(e,t,r,i,o,n,a,s,l){if(a)return function(e,t,r,i,o,n,a,s,l){const{data:c,stride:d}=n,u=e[0],h=e[1],f=e[2],m=t[0]-u,p=t[1]-h,_=t[2]-f;for(let e=r;e<i;++e){const t=a[e];let r=3*t,i=d*o[r++],n=c[i++],v=c[i++],T=c[i];i=d*o[r++];let x=c[i++],E=c[i++],A=c[i];i=d*o[r];let S=c[i++],w=c[i++],R=c[i];null!=s&&([n,v,T]=s.applyToVertex(n,v,T,e),[x,E,A]=s.applyToVertex(x,E,A,e),[S,w,R]=s.applyToVertex(S,w,R,e));const y=x-n,C=E-v,O=A-T,M=S-n,P=w-v,N=R-T,I=p*N-P*_,L=_*M-N*m,D=m*P-M*p,H=y*I+C*L+O*D;if(Math.abs(H)<=Number.EPSILON)continue;const F=u-n,B=h-v,U=f-T,V=F*I+B*L+U*D;if(H>0){if(V<0||V>H)continue}else if(V>0||V<H)continue;const z=B*O-C*U,G=U*y-O*F,W=F*C-y*B,k=m*z+p*G+_*W;if(H>0){if(k<0||V+k>H)continue}else if(k>0||V+k<H)continue;const $=(M*z+P*G+N*W)/H;$>=0&&l($,b(y,C,O,M,P,N,g),t,!1)}}(e,t,r,i,o,n,a,s,l);const{data:c,stride:d}=n,u=e[0],h=e[1],f=e[2],m=t[0]-u,p=t[1]-h,_=t[2]-f;for(let e=r,t=3*r;e<i;++e){let r=d*o[t++],i=c[r++],n=c[r++],a=c[r];r=d*o[t++];let v=c[r++],T=c[r++],x=c[r];r=d*o[t++];let E=c[r++],A=c[r++],S=c[r];null!=s&&([i,n,a]=s.applyToVertex(i,n,a,e),[v,T,x]=s.applyToVertex(v,T,x,e),[E,A,S]=s.applyToVertex(E,A,S,e));const w=v-i,R=T-n,y=x-a,C=E-i,O=A-n,M=S-a,P=p*M-O*_,N=_*C-M*m,I=m*O-C*p,L=w*P+R*N+y*I;if(Math.abs(L)<=Number.EPSILON)continue;const D=u-i,H=h-n,F=f-a,B=D*P+H*N+F*I;if(L>0){if(B<0||B>L)continue}else if(B>0||B<L)continue;const U=H*y-R*F,V=F*w-y*D,z=D*R-w*H,G=m*U+p*V+_*z;if(L>0){if(G<0||B+G>L)continue}else if(G>0||B+G<L)continue;const W=(C*U+O*V+M*z)/L;W>=0&&l(W,b(w,R,y,C,O,M,g),e,!1)}}const T=(0,a.c)(),x=(0,a.c)();function b(e,t,r,i,o,a,s){return(0,n.s)(T,e,t,r),(0,n.s)(x,i,o,a),(0,n.f)(s,T,x),(0,n.n)(s,s),s}function E(e,t,r,i,n){let a=(r.screenLength||0)*e.pixelRatio;null!=n&&(a=c(a,i,t,n));const s=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.uZ)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function A(e,t){const r=t?A(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=w(i)),null==i&&t in r||(r[t]=i)}return r}function S(e,t){let r=!1;for(const o in t){const n=t[o];void 0!==n&&(Array.isArray(n)?null===e[o]?(e[o]=n.slice(),r=!0):(0,i.Vx)(e[o],n)&&(r=!0):e[o]!==n&&(r=!0,e[o]=n))}return r}function w(e){const t=[];return e.forEach((e=>t.push(e))),t}const R={multiply:1,ignore:2,replace:3,tint:4},y=1e3},63587:(e,t,r)=>{r.d(t,{f:()=>u});var i=r(67676),o=r(92604),n=r(70586),a=r(1533),s=r(49300),l=r(54738),c=r(35371);const d=o.Z.getLogger("esri.views.webgl.BufferObject");class u{static createIndex(e,t,r){return new u(e,c.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new u(e,c.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==l.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new u(e,c.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=c.l1.STREAM_READ,r){if(e.type!==l.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new u(e,c.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=c.l1.STREAM_DRAW,r){if(e.type!==l.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new u(e,c.w0.PIXEL_UNPACK_BUFFER,t,r)}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(c._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,s.zu)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===c.w0.ELEMENT_ARRAY_BUFFER?this._indexType===c.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===c.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===c.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(c._g.BufferObject,this),this._context=(0,n.wN)(this._context)):this._glName&&d.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&d.error("Buffer size needs to be positive!"),this.bufferType===c.w0.ELEMENT_ARRAY_BUFFER&&null!=t)switch(this._indexType=t,t){case c.g.UNSIGNED_SHORT:e*=2;break;case c.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===c.w0.ELEMENT_ARRAY_BUFFER&&((0,a.Uc)(e)&&(t/=2,this._indexType=c.g.UNSIGNED_SHORT),(0,a.ZY)(e)&&(t/=4,this._indexType=c.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,s.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.byteSize)&&d.error("offset is out of range!"),r>=i&&d.error("end must be bigger than start!"),(t+(i-r))*e.BYTES_PER_ELEMENT>this.byteSize&&d.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===l.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,s.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,o){if(this._context.type!==l.zO.WEBGL2)return void d.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||o<0)return void d.error("Problem getting subdata: offset and length were less than zero!");const n=function(e){return(0,i.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(n*((r??0)+(o??0))>e.byteLength)return void d.error("Problem getting subdata: offset and length exceeded destination size!");t+n*(o??0)>this.byteSize&&d.warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;this._context.bindBuffer(this,c.w0.COPY_READ_BUFFER),a.getBufferSubData(c.w0.COPY_READ_BUFFER,t,e,r,o),this._context.unbindBuffer(c.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===l.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):d.error("Get buffer subdata is supported in WebGL2 only!")}}},33696:(e,t,r)=>{r.d(t,{X:()=>h});var i=r(92604),o=r(63587),n=r(49300),a=r(54738),s=r(35371),l=r(70586);class c{constructor(e,t){this._context=e,this._desc=t,this.type="renderbuffer",this._context.instanceCounter.increment(s._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:l}=t;if(l){if(this._context.type!==a.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}resize(e,t){const r=this._desc;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(s._g.Renderbuffer,this),this._context=(0,l.wN)(this._context))}}var d=r(75656),u=r(45762);class h{constructor(e,t,r=null,i=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._depthStencilTexture=null,this._initialized=!1,this._desc={...t},e.instanceCounter.increment(s._g.FramebufferObject,this),null!=r){Array.isArray(r)||(r=[r]);for(let e=0;e<r.length;++e){const t=r[e],i=s.VY.COLOR_ATTACHMENT0+e;let o;p(t)?(f(t)?(o=t.descriptor,this._colorAttachments.set(i,t)):(o=t,this._colorAttachments.set(i,new d.x(this._context,o))),_(o,this._desc)):(m(t)?(o=t.descriptor,this._colorAttachments.set(i,t)):(o=t,this._colorAttachments.set(i,new c(this._context,o))),g(o,this._desc)),this._validateColorAttachmentPoint(i)}}if(null!=i){let e,t;if(p(i))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),f(i)?(t=i.descriptor,this._depthStencilTexture=i):(t=i,this._depthStencilTexture=new d.x(this._context,t)),_(t,this._desc);else{m(i)?(t=i.descriptor,e=i):(t=i,e=new c(this._context,t));const r=this._desc.depthStencilTarget??s.OU.DEPTH_STENCIL_RENDER_BUFFER;r===s.OU.STENCIL_RENDER_BUFFER?this._stencilAttachment=e:r===s.OU.DEPTH_RENDER_BUFFER||r===s.OU.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=e:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),this._desc.depthStencilTarget=r,g(t,this._desc)}}}dispose(){if(!this._desc)return;const e=this._context.getBoundFramebufferObject();this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(s._g.FramebufferObject,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const e=this._colorAttachments.get(s.VY.COLOR_ATTACHMENT0);return e&&f(e)?e:null}get colorAttachment(){return this._colorAttachments.get(s.VY.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width??0}get height(){return this._desc.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+(0,u.un)(r)),0)+(0,u.un)(this.depthStencilAttachment)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&f(t)?t:null}attachColorTexture(e,t=s.VY.COLOR_ATTACHMENT0){e&&(this._validateColorAttachmentPoint(t),_(e.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e))}detachColorTexture(e=s.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(f(t)){const r=t;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),r}}setColorTextureTarget(e,t=s.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);f(r)&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencilTexture(e){if(null==e)return;const t=e.descriptor;t.pixelFormat!==s.VI.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==s.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),_(t,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==s.OU.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=s.OU.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,s.Lu)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,s.Lu)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(t.internalFormat!==s.Tg.DEPTH_STENCIL&&t.internalFormat!==s.Tg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),g(t,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=t.internalFormat===s.Tg.DEPTH_STENCIL?s.OU.DEPTH_STENCIL_RENDER_BUFFER:s.OU.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._desc.depthStencilTarget===s.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(s.qi.FRAMEBUFFER,r,t.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,t=this._depthAttachment;if(t&&this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===s.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(s.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}return this._depthAttachment=null,t}detachAll(){this._colorAttachments.forEach(((e,t)=>this._detachColorAttachment(t))),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const l=this._desc,c=a.descriptor;a.descriptor.target!==s.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==l?.width||null==l?.height||null==c?.width||null==c?.height||e+r>l.width||t+i>l.height||o+r>c.width||n+i>c.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const u=this._context,h=u.bindTexture(a,d.x.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(d.x.TEXTURE_UNIT_FOR_UPDATES),u.bindFramebuffer(this),u.gl.copyTexSubImage2D(s.No.TEXTURE_2D,0,o,n,e,t,r,i),u.bindTexture(h,d.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,l,c,d){if(this._context.type!==a.zO.WEBGL2)return(0,n.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,l,c,d);const u=this._context.gl,h=o.f.createPixelPack(this._context,s.l1.STREAM_READ,d.byteLength);this._context.bindBuffer(h),this._context.bindFramebuffer(this),u.readPixels(e,t,r,i,l,c,0),this._context.unbindBuffer(s.w0.PIXEL_PACK_BUFFER),await h.getSubDataAsync(d),h.dispose()}resize(e,t){const r=this._desc;if(r.width!==e||r.height!==t){if(r.width=e,r.height=t,!this._initialized)return this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,t));this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(e,t):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,t),this._stencilAttachment&&this._stencilAttachment.resize(e,t)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=s.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=this._context,i=t.createFramebuffer(),o=this._desc,a=o.colorTarget??s.Lm.RENDER_BUFFER,l=o.width??1,u=o.height??1;if(t.bindFramebuffer(e,i),0===this._colorAttachments.size)if(a===s.Lm.TEXTURE||a===s.Lm.CUBEMAP)this._colorAttachments.set(s.VY.COLOR_ATTACHMENT0,function(e,t,r){return new d.x(e,{target:r,pixelFormat:s.VI.RGBA,dataType:s.Br.UNSIGNED_BYTE,samplingMode:s.cw.NEAREST,wrapMode:s.e8.CLAMP_TO_EDGE,width:t.width,height:t.height})}(r,o,this.descriptor.colorTarget===s.Lm.CUBEMAP?s.No.TEXTURE_CUBE_MAP:s.No.TEXTURE_2D));else{const e=new c(r,{internalFormat:s.lP.RGBA4,width:l,height:u});this._colorAttachments.set(s.VY.COLOR_ATTACHMENT0,e)}this._colorAttachments.forEach(((r,i)=>{r&&(f(r)?this._framebufferTexture2D(r.glName,i,v(r),e):t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,r.glName))}));const h=o.depthStencilTarget??s.OU.NONE;switch(h){case s.OU.DEPTH_RENDER_BUFFER:case s.OU.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new c(r,{internalFormat:o.depthStencilTarget===s.OU.DEPTH_RENDER_BUFFER?s.Tg.DEPTH_COMPONENT16:s.Tg.DEPTH_STENCIL,width:l,height:u}));const i=h===s.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,this._depthAttachment.glName);break}case s.OU.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new c(r,{internalFormat:s.Tg.STENCIL_INDEX8,width:l,height:u})),t.framebufferRenderbuffer(e,t.STENCIL_ATTACHMENT,t.RENDERBUFFER,this._stencilAttachment.glName);break;case s.OU.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){r.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const e={target:s.No.TEXTURE_2D,pixelFormat:s.VI.DEPTH_STENCIL,dataType:s.Br.UNSIGNED_INT_24_8,samplingMode:s.cw.NEAREST,wrapMode:s.e8.CLAMP_TO_EDGE,width:l,height:u};this._depthStencilTexture=new d.x(r,e)}this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,v(this._depthStencilTexture),e)}(0,n.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=i,this._initialized=!0}_framebufferTexture2D(e,t=s.VY.COLOR_ATTACHMENT0,r=s.No.TEXTURE_2D,i=s.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_detachColorAttachment(e){(0,n.hZ)()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const t=this._context.gl,r=this._colorAttachments.get(e);return f(r)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)):this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer(s.qi.FRAMEBUFFER,e,t.RENDERBUFFER,null)),this._colorAttachments.delete(e),r}_disposeColorAttachments(){this._colorAttachments.forEach(((e,t)=>{this._detachColorAttachment(t),e.dispose()})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===s.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(s.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(s.qi.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(e){if(-1===h._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;h._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else h._MAX_COLOR_ATTACHMENTS=1}const t=e-s.VY.COLOR_ATTACHMENT0;t+1>h._MAX_COLOR_ATTACHMENTS&&i.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${h._MAX_COLOR_ATTACHMENTS} color attachments`)}}function f(e){return null!=e&&"type"in e&&"texture"===e.type}function m(e){return null!=e&&"type"in e&&"renderbuffer"===e.type}function p(e){return f(e)||null!=e&&"pixelFormat"in e}function _(e,t){e.target!==s.No.TEXTURE_2D&&e.target!==s.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function g(e,t){void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function v(e){return e.descriptor.target===s.No.TEXTURE_CUBE_MAP?s.No.TEXTURE_CUBE_MAP_POSITIVE_X:s.No.TEXTURE_2D}h._MAX_COLOR_ATTACHMENTS=-1},75656:(e,t,r)=>{r.d(t,{x:()=>l}),r(80442);var i=r(22021),o=r(49300),n=r(54738),a=r(35371);const s={target:a.No.TEXTURE_2D,samplingMode:a.cw.LINEAR,wrapMode:a.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1};let l=class{constructor(e,t,r=null){this._context=e,this.type="texture",this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(a._g.Texture,this),this._descriptor={...s,...t};for(const e in s)void 0===this._descriptor[e]&&(this._descriptor[e]=s[e]);if(e.type!==n.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),u(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===a.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(a._g.Texture,this))}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===a.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=a.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=a.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const i=this._descriptor,n=t??i.target,s=u(n);null===e&&(i.width=i.width||4,i.height=i.height||4,s&&(i.depth=i.depth??1));const f=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),l._validateTexture(this._context,i),this._configurePixelStorage(),(0,o.zu)(r);const m=i.pixelFormat;let p=i.internalFormat??this._deriveInternalFormat(m,i.dataType);if(d(e)){let t=e.width,a=e.height;const l=1;e instanceof HTMLVideoElement&&(t=e.videoWidth,a=e.videoHeight),i.width&&i.height,s&&i.depth,i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,p,i.hasMipmap,t,a,l),this._texImage(n,0,p,t,a,l,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap(),void 0===i.width&&(i.width=t),void 0===i.height&&(i.height=a),s&&void 0===i.depth&&(i.depth=l)}else{const{width:t,height:l,depth:d}=i;if(null==t||null==l)throw new Error("Width and height must be specified!");if(s&&null==d)throw new Error("Depth must be specified!");if(i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,p,i.hasMipmap,t,l,d),r.DEPTH24_STENCIL8&&p===r.DEPTH_STENCIL&&(p=r.DEPTH24_STENCIL8),c(e)){const o=e.levels,s=h(n,t,l,d),c=Math.min(s-1,o.length-1);null!=this._context.gl2?r.texParameteri(i.target,this._context.gl2.TEXTURE_MAX_LEVEL,c):i.hasMipmap=i.hasMipmap&&s===o.length;const u=p;if(!function(e){return e in a.q_}(u))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const a=o[Math.min(e,o.length-1)];this._compressedTexImage(n,e,u,t,r,i,a)}),c)}else null!=e?(this._texImage(n,0,p,t,l,d,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((e,t,i,a)=>{this._texImage(n,e,p,t,i,a,null),(0,o.zu)(r)}))}l._applySamplingMode(r,this._descriptor),l._applyWrapMode(r,this._descriptor),l._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,o.zu)(r),this._context.bindTexture(f,l.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,i,o,n,a=0){n||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const s=this._context.gl,u=this._descriptor,{pixelFormat:h,dataType:f,target:m,isImmutable:p}=u,_=u.internalFormat??this._deriveInternalFormat(h,f);if(p&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const g=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES,!0);if((t<0||r<0||i>u.width||o>u.height||t+i>u.width||r+o>u.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),a){if(null==this._context.gl2)return void console.error("Webgl2 must be enabled to use dataRowOffset!");s.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,a)}if(d(n)?null!=this._context.gl2?this._context.gl2.texSubImage2D(m,e,t,r,i,o,h,f,n):s.texSubImage2D(m,e,t,r,h,f,n):c(n)?s.compressedTexSubImage2D(m,e,t,r,i,o,_,n.levels[e]):s.texSubImage2D(m,e,t,r,i,o,h,f,n),a){if(null==this._context.gl2)return void console.error("Webgl2 must be enabled to use dataRowOffset!");s.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,0)}this._context.bindTexture(g,l.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,i,o,n,a,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const d=this._context.gl2;if(null==d)throw new Error("3D textures are not supported in WebGL1");const h=this._descriptor,{pixelFormat:f,dataType:m,isImmutable:p,target:_}=h,g=h.internalFormat??this._deriveInternalFormat(f,m);if(p&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");u(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const v=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||i<0||o>h.width||n>h.height||a>h.depth||t+o>h.width||r+n>h.height||i+a>h.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),c(s))s=s.levels[e],d.compressedTexSubImage3D(_,e,t,r,i,o,n,a,g,s);else{const l=s;d.texSubImage3D(_,e,t,r,i,o,n,a,f,m,l)}this._context.bindTexture(v,l.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,l._validateTexture(this._context,e)}e.samplingMode===a.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=a.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===a.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=a.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,l.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,l._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(l._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(l._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===n.zO.WEBGL1)return e;switch(t){case a.Br.FLOAT:switch(e){case a.VI.RGBA:return a.lP.RGBA32F;case a.VI.RGB:return a.lP.RGB32F;default:throw new Error("Unable to derive format")}case a.Br.UNSIGNED_BYTE:switch(e){case a.VI.RGBA:return a.lP.RGBA8;case a.VI.RGB:return a.lP.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,i,o,n){const s=this._context.gl2;if(null==s)throw new Error("Immutable textures are not supported in WebGL1");if(!function(e){return e in a.lP}(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?h(e,i,o,n):1;if(u(e)){if(null==n)throw new Error("Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,i,o,n)}else s.texStorage2D(e,l,t,i,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,o,a,s){const l=this._context.gl;let c=null;const h=this._context.type===n.zO.WEBGL2,f=u(e),{isImmutable:m,pixelFormat:p,dataType:_}=this._descriptor;if(h&&(c=l),h||!d(s))if(m){if(null!=s){const r=s;if(f){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,i,o,a,p,_,r)}else l.texSubImage2D(e,t,0,0,i,o,p,_,r)}}else{const n=s;if(f){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,i,o,a,0,p,_,n)}else l.texImage2D(e,t,r,i,o,0,p,_,n)}else l.texImage2D(e,0,r,p,_,s)}_compressedTexImage(e,t,r,i,o,a,s){const l=this._context.gl;let c=null;const d=u(e),h=this._descriptor.isImmutable;if(d){if(this._context.type!==n.zO.WEBGL2)throw new Error("3D textures are not supported in WebGL1");c=l}if(h){if(null!=s)if(d){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,i,o,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,i,o,r,s)}else if(d){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,i,o,a,0,s)}else l.compressedTexImage2D(e,t,r,i,o,0,s)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:o,hasMipmap:n,target:s}=this._descriptor;const l=s===a.No.TEXTURE_3D;if(null==r||null==i||l&&null==o)throw new Error("Missing texture dimensions for mipmap calculation");for(let a=0;e(a,r,i,o),n&&(1!==r||1!==i||l&&1!==o)&&!(a>=t);++a)r=Math.max(1,r>>1),i=Math.max(1,i>>1),l&&(o=Math.max(1,o>>1))}static _validateTexture(e,t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=e.type===n.zO.WEBGL2,o=null!=t.width&&(0,i.wt)(t.width)&&null!=t.height&&(0,i.wt)(t.height);r||!t.isImmutable&&!u(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||o||("number"==typeof t.wrapMode?t.wrapMode!==a.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===a.e8.CLAMP_TO_EDGE&&t.wrapMode.t===a.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let r=t.samplingMode,i=t.samplingMode;r===a.cw.LINEAR_MIPMAP_NEAREST||r===a.cw.LINEAR_MIPMAP_LINEAR?(r=a.cw.LINEAR,t.hasMipmap||(i=a.cw.LINEAR)):r!==a.cw.NEAREST_MIPMAP_NEAREST&&r!==a.cw.NEAREST_MIPMAP_LINEAR||(r=a.cw.NEAREST,t.hasMipmap||(i=a.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};function c(e){return null!=e&&"type"in e&&"compressed"===e.type}function d(e){return null!=e&&!c(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function u(e){return e===a.No.TEXTURE_3D||e===a.No.TEXTURE_2D_ARRAY}function h(e,t,r,i=1){let o=Math.max(t,r);return e===a.No.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}l.TEXTURE_UNIT_FOR_UPDATES=0},45762:(e,t,r)=>{r.d(t,{RG:()=>s,UF:()=>a,XP:()=>n,_V:()=>o,un:()=>l}),r(80442);var i=r(35371);function o(e,t){return e.vertexBuffers[t].size/function(e){return e[0].stride}(e.layout[t])}function n(e,t,r,i,o=0){const n=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);void 0===r&&console.error(`There is no location for vertex attribute '${e.name}' defined.`);const i=o*e.stride;if(e.count<=4)n.vertexAttribPointer(r,e.count,e.type,e.normalized,e.stride,e.offset+i),n.enableVertexAttribArray(r),e.divisor>0&&a&&a.vertexAttribDivisor(r,e.divisor);else if(9===e.count)for(let t=0;t<3;t++)n.vertexAttribPointer(r+t,3,e.type,e.normalized,e.stride,e.offset+12*t+i),n.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else if(16===e.count)for(let t=0;t<4;t++)n.vertexAttribPointer(r+t,4,e.type,e.normalized,e.stride,e.offset+16*t+i),n.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else console.error("Unsupported vertex attribute element count: "+e.count)}}function a(e,t,r,o){const n=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of o){const r=t.get(e.name);if(e.count<=4)n.disableVertexAttribArray(r),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r,0);else if(9===e.count)for(let t=0;t<3;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r+t,0);else if(16===e.count)for(let t=0;t<4;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r+t,0);else console.error("Unsupported vertex attribute element count: "+e.count)}e.unbindBuffer(i.w0.ARRAY_BUFFER)}function s(e){switch(e){case i.VI.ALPHA:case i.VI.LUMINANCE:case i.VI.RED:case i.VI.RED_INTEGER:case i.lP.R8:case i.lP.R8I:case i.lP.R8UI:case i.lP.R8_SNORM:case i.Tg.STENCIL_INDEX8:return 1;case i.VI.LUMINANCE_ALPHA:case i.VI.RG:case i.VI.RG_INTEGER:case i.lP.RGBA4:case i.lP.R16F:case i.lP.R16I:case i.lP.R16UI:case i.lP.RG8:case i.lP.RG8I:case i.lP.RG8UI:case i.lP.RG8_SNORM:case i.lP.RGB565:case i.lP.RGB5_A1:case i.Tg.DEPTH_COMPONENT16:return 2;case i.VI.DEPTH_COMPONENT:case i.VI.RGB:case i.VI.RGB_INTEGER:case i.lP.RGB8:case i.lP.RGB8I:case i.lP.RGB8UI:case i.lP.RGB8_SNORM:case i.lP.SRGB8:case i.Tg.DEPTH_COMPONENT24:return 3;case i.VI.DEPTH_STENCIL:case i.VI.RGBA:case i.VI.RGBA_INTEGER:case i.lP.RGBA8:case i.lP.R32F:case i.lP.R11F_G11F_B10F:case i.lP.RG16F:case i.lP.R32I:case i.lP.R32UI:case i.lP.RG16I:case i.lP.RG16UI:case i.lP.RGBA8I:case i.lP.RGBA8UI:case i.lP.RGBA8_SNORM:case i.lP.SRGB8_ALPHA8:case i.lP.RGB9_E5:case i.lP.RGB10_A2UI:case i.lP.RGB10_A2:case i.Tg.DEPTH_STENCIL:case i.Tg.DEPTH_COMPONENT32F:case i.Tg.DEPTH24_STENCIL8:return 4;case i.Tg.DEPTH32F_STENCIL8:return 5;case i.lP.RGB16F:case i.lP.RGB16I:case i.lP.RGB16UI:return 6;case i.lP.RG32F:case i.lP.RG32I:case i.lP.RG32UI:case i.lP.RGBA16F:case i.lP.RGBA16I:case i.lP.RGBA16UI:return 8;case i.lP.RGB32F:case i.lP.RGB32I:case i.lP.RGB32UI:return 12;case i.lP.RGBA32F:case i.lP.RGBA32I:case i.lP.RGBA32UI:return 16;case i.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.q_.COMPRESSED_R11_EAC:case i.q_.COMPRESSED_SIGNED_R11_EAC:case i.q_.COMPRESSED_RGB8_ETC2:case i.q_.COMPRESSED_SRGB8_ETC2:case i.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.q_.COMPRESSED_RG11_EAC:case i.q_.COMPRESSED_SIGNED_RG11_EAC:case i.q_.COMPRESSED_RGBA8_ETC2_EAC:case i.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function l(e){if(null==e)return 0;if("descriptor"in e)return e.glName?l(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return s(t)*i*r}},49300:(e,t,r)=>{r.d(t,{hZ:()=>s,zu:()=>l});var i=r(20102),o=r(80442);const n=r(92604).Z.getLogger("esri.views.webgl.checkWebGLError"),a=!!(0,o.Z)("enable-feature:webgl-debug");function s(){return a}function l(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),o=(new Error).stack;n.error(new i.Z("webgl-error","WebGL error occured",{message:r,stack:o}))}}}},54738:(e,t,r)=>{r.d(t,{Sh:()=>n,kr:()=>a,zO:()=>i});var i,o=r(80442);function n(e){const t=(0,o.Z)("esri-force-webgl");if(t===i.WEBGL1||t===i.WEBGL2)return[t];switch(e){case"2d":return(0,o.Z)("mac")&&(0,o.Z)("chrome")?[i.WEBGL1,i.WEBGL2]:[i.WEBGL2,i.WEBGL1];case"3d":return[i.WEBGL2,i.WEBGL1]}}function a(e,t,r={}){const o=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let n=null;for(const t of o){try{n=e.getContext(t,r)}catch(e){}if(n)break}return n}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(i||(i={}))},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],t[i]=n[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],n[1]=e[i]-n[0],t[i]=n[1];return t}r.d(t,{GB:()=>o,U8:()=>i});const n=new Float32Array(2)},27097:(e,t,r)=>{r.d(t,{BK:()=>u,LZ:()=>d,if:()=>n,sm:()=>x,wK:()=>a,zp:()=>c});var i=r(47026),o=r(35371);function n(e,t,r=o.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function a(e,t,r,i,n=o.db.ADD,a=o.db.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const s={face:o.LR.BACK,mode:o.Wf.CCW},l={face:o.LR.FRONT,mode:o.Wf.CCW},c=e=>e===i.Vr.Back?s:e===i.Vr.Front?l:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function h(e){return A.intern(e)}function f(e){return w.intern(e)}function m(e){return y.intern(e)}function p(e){return O.intern(e)}function _(e){return P.intern(e)}function g(e){return I.intern(e)}function v(e){return D.intern(e)}function T(e){return F.intern(e)}function x(e){return U.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 E(e){return"["+e.join(",")+"]"}const A=new b(S,(e=>({__tag:"Blending",...e})));function S(e){return e?E([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 w=new b(R,(e=>({__tag:"Culling",...e})));function R(e){return e?E([e.face,e.mode]):null}const y=new b(C,(e=>({__tag:"PolygonOffset",...e})));function C(e){return e?E([e.factor,e.units]):null}const O=new b(M,(e=>({__tag:"DepthTest",...e})));function M(e){return e?E([e.func]):null}const P=new b(N,(e=>({__tag:"StencilTest",...e})));function N(e){return e?E([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const I=new b(L,(e=>({__tag:"DepthWrite",...e})));function L(e){return e?E([e.zNear,e.zFar]):null}const D=new b(H,(e=>({__tag:"ColorWrite",...e})));function H(e){return e?E([e.r,e.g,e.b,e.a]):null}const F=new b(B,(e=>({__tag:"StencilWrite",...e})));function B(e){return e?E([e.mask]):null}const U=new b((function(e){return e?E([S(e.blending),R(e.culling),C(e.polygonOffset),M(e.depthTest),N(e.stencilTest),L(e.depthWrite),H(e.colorWrite),B(e.stencilWrite)]):null}),(e=>({blending:h(e.blending),culling:f(e.culling),polygonOffset:m(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:_(e.stencilTest),depthWrite:g(e.depthWrite),colorWrite:v(e.colorWrite),stencilWrite:T(e.stencilWrite)})))}}]);