@arcgis/core 5.2.0-next.20 → 5.2.0-next.22

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 (271) hide show
  1. package/Graphic.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0eb0ce43b4813cae968f.js +2 -0
  4. package/assets/esri/core/workers/chunks/{2dbd88566abac030e965.js → 162dada6a199d1efdf86.js} +2 -2
  5. package/assets/esri/core/workers/chunks/1a4bec464daa9662ab2a.js +1 -0
  6. package/assets/esri/core/workers/chunks/{b375abfb2a2d9c63e20a.js → 2255a21c7b959f04d941.js} +1 -1
  7. package/assets/esri/core/workers/chunks/292498a9c7d462d215c6.js +1 -0
  8. package/assets/esri/core/workers/chunks/2ef80e003b4f0393ac2e.js +1 -0
  9. package/assets/esri/core/workers/chunks/{4517630bf869205bab87.js → 38a76bc4ef5c10ab0488.js} +1 -1
  10. package/assets/esri/core/workers/chunks/3b4fc67f6cb7393fbd97.js +1 -0
  11. package/assets/esri/core/workers/chunks/{8ce4fe00328173224ed2.js → 44e32ed3a570593a7245.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{db26cf2c2735183294b8.js → 50345dfc00380b158c96.js} +1 -1
  13. package/assets/esri/core/workers/chunks/5468a65698931603656d.js +1 -0
  14. package/assets/esri/core/workers/chunks/5b42f8aa0247adc2d065.js +1 -0
  15. package/assets/esri/core/workers/chunks/{d7acbc2ddff4cee8a465.js → 5ee887fc6e1e0e70e02f.js} +1 -1
  16. package/assets/esri/core/workers/chunks/66c2cfe11161d5dc989a.js +1 -0
  17. package/assets/esri/core/workers/chunks/6c0c77de1934f35dc45f.js +1 -0
  18. package/assets/esri/core/workers/chunks/{f7f820483e45c05ab9e4.js → 75df436e6e9773bdcfc2.js} +1 -1
  19. package/assets/esri/core/workers/chunks/780519b60aa674a61a74.js +1 -0
  20. package/assets/esri/core/workers/chunks/{a2247f4c3116efb16c4f.js → 7e23de8d9b2d938808f6.js} +1 -1
  21. package/assets/esri/core/workers/chunks/7fc8516111bd869256fc.js +1 -0
  22. package/assets/esri/core/workers/chunks/8579eba21f40630d073d.js +1 -0
  23. package/assets/esri/core/workers/chunks/{72edd08a2ff08970ba38.js → 87011d2fe14c54e296af.js} +1 -1
  24. package/assets/esri/core/workers/chunks/928b18e13e015330d44b.js +1 -0
  25. package/assets/esri/core/workers/chunks/93b40245378ced43ca08.js +1 -0
  26. package/assets/esri/core/workers/chunks/9434c76ad39c936dba90.js +1 -0
  27. package/assets/esri/core/workers/chunks/98dfe31e8ed9b522eaff.js +1 -0
  28. package/assets/esri/core/workers/chunks/{4104a0585969f8cd524c.js → a40ede4d3375184f21fe.js} +1 -1
  29. package/assets/esri/core/workers/chunks/a533d066cac26124c5ce.js +1 -0
  30. package/assets/esri/core/workers/chunks/a536904fe6f3b16fdbdc.js +1 -0
  31. package/assets/esri/core/workers/chunks/a54773c9bbc751619b3f.js +2 -0
  32. package/assets/esri/core/workers/chunks/a8167ab9fd846d699be5.js +1 -0
  33. package/assets/esri/core/workers/chunks/{dd0c1cf921369e2bc48b.js → a90619adff41658f8057.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{ac16016964be3b684e98.js → aded4e704e09a28edc8f.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{eccbddaec4be44c86f79.js → b0b3c67b7d37bd854d95.js} +2 -2
  36. package/assets/esri/core/workers/chunks/b419fd36337e76e2d4a3.js +680 -0
  37. package/assets/esri/core/workers/chunks/{05d597dd117766beadd8.js → b91a15522692781560b4.js} +1 -1
  38. package/assets/esri/core/workers/chunks/be4275a4b8977ec3eb61.js +1 -0
  39. package/assets/esri/core/workers/chunks/{e8d65900eefff1152207.js → c593539c2cce7a2b9d44.js} +1 -1
  40. package/assets/esri/core/workers/chunks/c86d388d216adbb15a05.js +1 -0
  41. package/assets/esri/core/workers/chunks/{0b522e05668bef729b1b.js → ceb5bd9f2afaa2ea0808.js} +1 -1
  42. package/assets/esri/core/workers/chunks/d07068c44d560e4ce02e.js +1 -0
  43. package/assets/esri/core/workers/chunks/{595bc41ff36c77324d01.js → d4e0346209fabc58f929.js} +9 -9
  44. package/assets/esri/core/workers/chunks/{5809e70a8e57e9b05959.js → dd795c95cdc3812b5b49.js} +1 -1
  45. package/assets/esri/core/workers/chunks/e29c8c10331edfa83277.js +1 -0
  46. package/assets/esri/core/workers/chunks/{44b30bce8e9a75b9e1b3.js → ef94d25d1cceb25ea9fe.js} +2 -2
  47. package/assets/esri/core/workers/chunks/f02a9408ba3893484c6c.js +1 -0
  48. package/assets/esri/core/workers/chunks/f7344d855f1092383abe.js +1 -0
  49. package/assets/esri/core/workers/chunks/{5f63077ec5ba3560491b.js → fb9f8b6cc2b4ae5b60df.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{ecbf84a1f42e6188faab.js → fd629872b5c07853f695.js} +1 -1
  51. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  52. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -1
  53. package/assets/esri/themes/dark/main.css +1 -1
  54. package/assets/esri/themes/light/main.css +1 -1
  55. package/assets/esri/themes/light/view.css +1 -1
  56. package/chunks/GaussianSplat.glsl.js +4 -4
  57. package/chunks/GaussianSplatShadow.glsl.js +1 -1
  58. package/chunks/Pattern.glsl.js +17 -17
  59. package/chunks/RibbonLine.glsl.js +45 -43
  60. package/chunks/bundle2.js +1 -1
  61. package/config.js +1 -1
  62. package/core/date.js +1 -1
  63. package/form/FormTemplate.d.ts +15 -20
  64. package/form/elements/AttachmentElement.d.ts +38 -11
  65. package/form/elements/Element.d.ts +9 -6
  66. package/form/elements/FieldElement.d.ts +0 -1
  67. package/form/elements/GroupElement.d.ts +4 -6
  68. package/form/elements/RelationshipElement.d.ts +8 -8
  69. package/form/elements/inputs/attachments/AttachmentInput.d.ts +34 -18
  70. package/form/elements/inputs/attachments/AudioInput.d.ts +4 -3
  71. package/form/elements/inputs/attachments/DocumentInput.d.ts +2 -6
  72. package/form/elements/inputs/attachments/ImageInput.d.ts +4 -3
  73. package/form/elements/inputs/attachments/Input.d.ts +6 -3
  74. package/form/elements/inputs/attachments/SignatureInput.d.ts +3 -3
  75. package/form/elements/inputs/attachments/VideoInput.d.ts +4 -3
  76. package/form/elements.d.ts +6 -12
  77. package/form/types.d.ts +0 -4
  78. package/geometry/support/geometryUtils.js +1 -1
  79. package/geometry/support/intersects.js +1 -1
  80. package/geometry/support/intersectsBase.js +1 -1
  81. package/kernel.js +1 -1
  82. package/layers/AnnotationFeatureLayer.d.ts +44 -0
  83. package/layers/AnnotationFeatureLayer.js +1 -1
  84. package/layers/DimensionFeatureLayer.d.ts +40 -0
  85. package/layers/DimensionFeatureLayer.js +1 -1
  86. package/layers/DimensionLayer.d.ts +1 -0
  87. package/layers/FeatureLayer.js +1 -1
  88. package/layers/IntegratedMesh3DTilesLayer.d.ts +9 -1
  89. package/layers/OrientedImageryLayer.js +1 -1
  90. package/layers/ParquetLayer.d.ts +6 -10
  91. package/layers/ParquetLayer.js +1 -1
  92. package/layers/graphics/data/attributeSupport.js +1 -1
  93. package/layers/graphics/data/queryValidationUtils.js +1 -1
  94. package/layers/graphics/sources/ParquetSource.js +1 -1
  95. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  96. package/layers/graphics/sources/geojson/geojson.js +1 -1
  97. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  98. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
  99. package/layers/graphics/sources/parquet/fileProviderChangedError.js +2 -0
  100. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  101. package/layers/mixins/ArcGISImageService.js +1 -1
  102. package/layers/mixins/EditBusLayer.js +1 -1
  103. package/layers/orientedImagery/core/utils.js +1 -1
  104. package/layers/raster/datasets/WCSRaster.js +1 -1
  105. package/layers/support/AnnotationFeatureSublayer.d.ts +5 -3
  106. package/layers/support/RasterBandInfo.js +1 -1
  107. package/layers/support/SymbolLayerDrawing.js +1 -1
  108. package/layers/types.d.ts +1 -0
  109. package/package.json +2 -2
  110. package/rest/support/AttachmentQuery.d.ts +13 -1
  111. package/rest/support/AttachmentQuery.js +1 -1
  112. package/rest/support/OutDistance.d.ts +5 -1
  113. package/rest/support/PrintParameters.d.ts +2 -1
  114. package/rest/support/Query.d.ts +2 -0
  115. package/support/basemapUtils.js +1 -1
  116. package/support/revision.js +1 -1
  117. package/symbols/SimpleMarkerSymbol.d.ts +2 -2
  118. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  119. package/views/2d/engine/AFeatureContainer.js +1 -1
  120. package/views/2d/engine/transitions/FadeTransition.js +1 -1
  121. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  122. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  123. package/views/2d/engine/webgl/TileCpuState.js +1 -1
  124. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  125. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  126. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  127. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  128. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  129. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  130. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  131. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  132. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  133. package/views/2d/layers/LayerView2D.js +1 -1
  134. package/views/2d/layers/MediaLayerView2D.js +1 -1
  135. package/views/2d/layers/features/FeatureContainer.js +1 -1
  136. package/views/2d/layers/features/RenderState.js +1 -1
  137. package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
  138. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  139. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
  140. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
  141. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  142. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  143. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  144. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  145. package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
  146. package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
  147. package/views/3d/analysis/LineOfSight/LineOfSightDrawToolRenderer.js +1 -1
  148. package/views/3d/analysis/LineOfSight/LineOfSightInteractionVisuals.js +2 -0
  149. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
  150. package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
  151. package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
  152. package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
  153. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  154. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  155. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  156. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  157. package/views/3d/layers/GaussianSplatLayerViewPerformanceInfo.js +1 -1
  158. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  159. package/views/3d/layers/graphics/Graphics3DPathSymbolLayerConstants.js +1 -1
  160. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  161. package/views/3d/state/utils/navigationUtils.js +1 -1
  162. package/views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js +1 -1
  163. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  164. package/views/3d/support/gaussianSplatting/GaussianSplatHeaderTexture.js +2 -0
  165. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  166. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  167. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +11 -11
  168. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +6 -9
  169. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +46 -46
  170. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +46 -18
  171. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +22 -22
  172. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +4 -4
  173. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js +13 -12
  174. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
  175. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  176. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  177. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  178. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  179. package/views/3d/webgl-engine/lib/GaussianSplatShadowRenderNode.js +1 -1
  180. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  181. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  182. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  183. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  184. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  185. package/views/3d/webgl-engine/lib/PathVertexInfo.js +1 -1
  186. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  187. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  188. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferUtils.js +1 -1
  189. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
  190. package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
  191. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  192. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  193. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  194. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
  195. package/views/3d/webgl-engine/shaders/PatternTextureBuffer.glsl.js +1 -1
  196. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  197. package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +1 -1
  198. package/views/3d/webgl-engine/shaders/RibbonLineTextureBuffer.glsl.js +2 -0
  199. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +10 -10
  200. package/views/View2D.d.ts +2 -2
  201. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  202. package/views/layers/AnnotationFeatureLayerView.d.ts +9 -1
  203. package/views/layers/DimensionFeatureLayerView.d.ts +9 -1
  204. package/views/layers/FeatureLikeLayerView.js +1 -1
  205. package/views/webgl/ShaderBuilder.js +1 -1
  206. package/widgets/BasemapGallery.js +1 -1
  207. package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
  208. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  209. package/widgets/BatchAttributeForm/css.js +1 -1
  210. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  211. package/widgets/BatchAttributeForm.js +1 -1
  212. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  213. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  214. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  215. package/widgets/Editor/UpdateWorkflow.js +1 -1
  216. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  217. package/widgets/Editor/types.d.ts +12 -0
  218. package/widgets/Editor/workflowUtils.js +1 -1
  219. package/widgets/Editor.js +1 -1
  220. package/widgets/FeatureForm/FeatureFormViewModel.d.ts +16 -12
  221. package/widgets/FeatureForm.d.ts +14 -16
  222. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  223. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  224. package/widgets/FeatureTable/Grid/types.d.ts +20 -0
  225. package/widgets/FeatureTable.d.ts +14 -2
  226. package/widgets/FeatureTable.js +1 -1
  227. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  228. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  229. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  230. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  231. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  232. package/widgets/OrientedImageryViewer/constants.js +1 -1
  233. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  234. package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
  235. package/widgets/OrientedImageryViewer/support/panConstraint.js +2 -0
  236. package/widgets/OrientedImageryViewer.js +1 -1
  237. package/widgets/Print/CustomTemplate.d.ts +7 -0
  238. package/widgets/Search/LayerSearchSource.d.ts +3 -0
  239. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  240. package/assets/esri/core/workers/chunks/0a259137932211b80f0e.js +0 -1
  241. package/assets/esri/core/workers/chunks/26aa8190ac439f634c5b.js +0 -1
  242. package/assets/esri/core/workers/chunks/3192586ec7fc73ed1165.js +0 -1
  243. package/assets/esri/core/workers/chunks/35a508a9311689d8df52.js +0 -1
  244. package/assets/esri/core/workers/chunks/3e89f487c5851c954d8b.js +0 -1
  245. package/assets/esri/core/workers/chunks/4fdd38d7362bf09a994b.js +0 -1
  246. package/assets/esri/core/workers/chunks/501fa9b029df2e7b73c3.js +0 -2
  247. package/assets/esri/core/workers/chunks/5216dd0544e901039c84.js +0 -1
  248. package/assets/esri/core/workers/chunks/5f0bc019add4aff3130c.js +0 -1
  249. package/assets/esri/core/workers/chunks/630ad47857de3cf726d1.js +0 -1
  250. package/assets/esri/core/workers/chunks/6ac09f4e85c664a17365.js +0 -1
  251. package/assets/esri/core/workers/chunks/6e8b9c03240ec372b587.js +0 -1
  252. package/assets/esri/core/workers/chunks/74922daaedb479ec6f03.js +0 -1
  253. package/assets/esri/core/workers/chunks/764c8ba14ab74b66b391.js +0 -1
  254. package/assets/esri/core/workers/chunks/7ee76504e7fea389a1c9.js +0 -1
  255. package/assets/esri/core/workers/chunks/912a8743a02f467b63b0.js +0 -2
  256. package/assets/esri/core/workers/chunks/9def4619d102f1d41578.js +0 -1
  257. package/assets/esri/core/workers/chunks/a0876a52a3c2ad849370.js +0 -1
  258. package/assets/esri/core/workers/chunks/a3c5b754a6fa0f4250bf.js +0 -1
  259. package/assets/esri/core/workers/chunks/a98905bf6050ad3b8721.js +0 -633
  260. package/assets/esri/core/workers/chunks/bf67e0f6064fb9d94ac8.js +0 -1
  261. package/assets/esri/core/workers/chunks/c9e5d3f496cefb8e3934.js +0 -1
  262. package/assets/esri/core/workers/chunks/cd892f429d5ffe8de99e.js +0 -1
  263. package/assets/esri/core/workers/chunks/d34d41a350facfa9b7c0.js +0 -1
  264. package/assets/esri/core/workers/chunks/d5a0e3a73df827dc7b06.js +0 -1
  265. package/assets/esri/core/workers/chunks/e5471373f89fd7cb9844.js +0 -1
  266. package/assets/esri/core/workers/chunks/ff00ac01f0baaecaa890.js +0 -1
  267. /package/assets/esri/core/workers/chunks/{912a8743a02f467b63b0.js.LICENSE.txt → 0eb0ce43b4813cae968f.js.LICENSE.txt} +0 -0
  268. /package/assets/esri/core/workers/chunks/{2dbd88566abac030e965.js.LICENSE.txt → 162dada6a199d1efdf86.js.LICENSE.txt} +0 -0
  269. /package/assets/esri/core/workers/chunks/{44b30bce8e9a75b9e1b3.js.LICENSE.txt → a54773c9bbc751619b3f.js.LICENSE.txt} +0 -0
  270. /package/assets/esri/core/workers/chunks/{eccbddaec4be44c86f79.js.LICENSE.txt → b0b3c67b7d37bd854d95.js.LICENSE.txt} +0 -0
  271. /package/assets/esri/core/workers/chunks/{501fa9b029df2e7b73c3.js.LICENSE.txt → ef94d25d1cceb25ea9fe.js.LICENSE.txt} +0 -0
@@ -0,0 +1,680 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[118],{72091(e,t,i){i.d(t,{H:()=>g,b:()=>p});var r=i(6733),n=i(29236),s=i(68259),o=i(20304),a=i(31821),l=i(93588),c=i(63761),u=i(9273),h=i(34053),d=i(14113);function p(){const e=new d.N5;e.include(r.Q);const{fragment:t}=e;return t.uniforms.add(new c.N("blurInput",e=>e.highlightBlurTexture),new s.t("blurSize",e=>e.blurSize),new u.R("highlightTexture",e=>e.highlightTexture),new c.N("highlightOptionsTexture",e=>e.highlightOptionsTexture),new l.c("highlightLevel",e=>e.highlightLevel),new o.m("occludedIntensityFactor",e=>e.occludedFactor)),t.constants.add("inner","float",1-(h.o-h.b)/h.o),e.include(n.y),t.main.add(a.H`vec2 highlightTextureSize = vec2(textureSize(highlightTexture,0));
2
+ vec2 uv = sUV;
3
+ vec2 center = texture(blurInput, uv).rg;
4
+ vec2 blurredHighlightValue = (vOutlinePossible == 0.0)
5
+ ? center
6
+ : center * 0.204164
7
+ + texture(blurInput, uv + blurSize * 1.407333).rg * 0.304005
8
+ + texture(blurInput, uv - blurSize * 1.407333).rg * 0.304005
9
+ + texture(blurInput, uv + blurSize * 3.294215).rg * 0.093913
10
+ + texture(blurInput, uv - blurSize * 3.294215).rg * 0.093913;
11
+ float highlightIntensity = blurredHighlightValue.r;
12
+ float occlusionWeight = blurredHighlightValue.g;
13
+ if (highlightIntensity <= 0.01) {
14
+ discard;
15
+ }
16
+ vec4 fillColor = texelFetch(highlightOptionsTexture, ivec2(highlightLevel, 0), 0);
17
+ vec4 outlineColor = texelFetch(highlightOptionsTexture, ivec2(highlightLevel, 1), 0);
18
+ uvec2 centerTexel = texelFetch(highlightTexture, ivec2(uv * highlightTextureSize), 0).rg;
19
+ uint centerBits = readLevelBits(centerTexel, highlightLevel);
20
+ bool centerFilled = (centerBits & 1u) == 1u;
21
+ bool centerOccluded = (centerBits & 3u) == 3u;
22
+ bool occluded = centerOccluded || (0.5 * highlightIntensity < occlusionWeight);
23
+ float occlusionFactor = occluded ? occludedIntensityFactor : 1.0;
24
+ float outlineFactor = centerFilled ? 1.0 : smoothstep(0.0, inner, highlightIntensity);
25
+ float fillFactor = centerFilled ? 1.0 : 0.0;
26
+ vec4 baseColor = mix(outlineColor, fillColor, fillFactor);
27
+ float intensity = baseColor.a * occlusionFactor * outlineFactor;
28
+ fragColor = vec4(baseColor.rgb, intensity);`),e}const g=Object.freeze(Object.defineProperty({__proto__:null,build:p},Symbol.toStringTag,{value:"Module"}))},28476(e,t,i){i.d(t,{H:()=>u,a:()=>d,b:()=>h});var r=i(48163),n=i(6733),s=i(68259),o=i(31821),a=i(15976),l=i(65786),c=i(14113);class u extends l.Y{constructor(){super(...arguments),this.blurSize=(0,r.vt)()}}function h(){const e=new c.N5;return e.include(n.Q),e.outputs.add("fragHighlight","vec2",0),e.fragment.uniforms.add(new s.t("blurSize",e=>e.blurSize),new a.o("blurInput",e=>e.blurInput)).main.add(o.H`vec2 highlightTextureSize = vec2(textureSize(blurInput,0));
29
+ vec2 center = texture(blurInput, sUV).rg;
30
+ if (vOutlinePossible == 0.0) {
31
+ fragHighlight = center;
32
+ } else {
33
+ vec2 sum = center * 0.204164;
34
+ sum += texture(blurInput, sUV + blurSize * 1.407333).rg * 0.304005;
35
+ sum += texture(blurInput, sUV - blurSize * 1.407333).rg * 0.304005;
36
+ sum += texture(blurInput, sUV + blurSize * 3.294215).rg * 0.093913;
37
+ sum += texture(blurInput, sUV - blurSize * 3.294215).rg * 0.093913;
38
+ fragHighlight = sum;
39
+ }`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,HighlightBlurDrawParameters:u,build:h},Symbol.toStringTag,{value:"Module"}))},34053(e,t,i){i.d(t,{H:()=>l,a:()=>p,b:()=>d,c:()=>c,g:()=>u,o:()=>h});var r=i(82048),n=i(31821),s=i(9273),o=i(65786),a=i(14113);class l extends o.Y{}function c(){const e=new a.N5,{outputs:t,fragment:i}=e;return e.include(r.c),i.uniforms.add(new s.R("highlightTexture",e=>e.highlightTexture)),i.constants.add("outlineWidth","int",Math.ceil(h)),i.constants.add("cellSize","int",u),t.add("fragGrid","uvec2"),i.main.add(n.H`ivec2 inputTextureSize = textureSize(highlightTexture, 0);
40
+ ivec2 cellBottomLeftCornerInput = ivec2(ivec2(floor(gl_FragCoord.xy) * vec2(cellSize)));
41
+ ivec2 coordMid = cellBottomLeftCornerInput + ivec2(cellSize >> 1);
42
+ uvec2 centreTexel = texelFetch(highlightTexture, coordMid, 0).rg & uvec2(0x55u);
43
+ float marginSquare = float(outlineWidth*outlineWidth);
44
+ uvec2 outputValue = centreTexel & uvec2(0x55u);
45
+ for(int y = -outlineWidth; y <= cellSize + outlineWidth; y+=2) {
46
+ int dy = y < 0 ? -y : y > cellSize ? y-cellSize : 0;
47
+ int xMargin = dy > 0 ? int(ceil(sqrt(marginSquare - float(dy*dy)))) : outlineWidth;
48
+ for(int x = -xMargin; x <= cellSize + xMargin; x+=2) {
49
+ ivec2 coord = cellBottomLeftCornerInput + ivec2(x, y);
50
+ uvec2[4] texels = uvec2[4] (
51
+ texelFetch(highlightTexture,coord+ivec2(0,0),0).rg & uvec2(0x55u),
52
+ texelFetch(highlightTexture,coord+ivec2(1,0),0).rg & uvec2(0x55u),
53
+ texelFetch(highlightTexture,coord+ivec2(0,1),0).rg & uvec2(0x55u),
54
+ texelFetch(highlightTexture,coord+ivec2(1,1),0).rg & uvec2(0x55u)
55
+ );
56
+ if (texels[0] == texels[1] && texels[1] == texels[2] && texels[2] == texels[3] && texels[3] == centreTexel) {
57
+ continue;
58
+ }
59
+ for (int i=0; i<4; ++i){
60
+ outputValue |= ((texels[i] ^ centreTexel) << 1);
61
+ outputValue |= texels[i];
62
+ }
63
+ }
64
+ }
65
+ fragGrid = outputValue;`),e}const u=32,h=9,d=.4,p=Object.freeze(Object.defineProperty({__proto__:null,HighlightDownsampleDrawParameters:l,blurSize:d,build:c,gridCellPixelSize:u,outlineSize:h},Symbol.toStringTag,{value:"Module"}))},16824(e,t,i){i.d(t,{H:()=>u,b:()=>c});var r=i(6733),n=i(29236),s=i(31821),o=i(93588),a=i(9273),l=i(14113);function c(){const e=new l.N5;e.include(r.Q),e.include(n.y);const{fragment:t}=e;return e.outputs.add("fragSingleHighlight","vec2",0),t.uniforms.add(new a.R("highlightTexture",e=>e.highlightTexture),new o.c("highlightLevel",e=>e.highlightLevel)),t.main.add(s.H`ivec2 iuv = ivec2(gl_FragCoord.xy);
66
+ uvec2 inputTexel = texelFetch(highlightTexture, iuv, 0).rg;
67
+ uint bits = readLevelBits(inputTexel, highlightLevel);
68
+ bool hasHighlight = (bits & 1u) == 1u;
69
+ bool hasOccluded = (bits & 2u) == 2u;
70
+ fragSingleHighlight = vec2(hasHighlight ? 1.0 : 0.0, hasOccluded ? 1.0 : 0.0);`),e}const u=Object.freeze(Object.defineProperty({__proto__:null,build:c},Symbol.toStringTag,{value:"Module"}))},80583(e,t,i){i.d(t,{O:()=>u,a:()=>d,b:()=>h});var r=i(82048),n=i(20304),s=i(31821),o=i(93588),a=i(63761),l=i(65786),c=i(14113);class u extends l.Y{constructor(){super(...arguments),this.overlayIndex=0,this.opacity=1}}function h(){const e=new c.N5;return e.include(r.c),e.fragment.uniforms.add(new a.N("tex",e=>e.texture)),e.fragment.uniforms.add(new o.c("overlayIdx",e=>e.overlayIndex)),e.fragment.uniforms.add(new n.m("opacity",e=>e.opacity)),e.fragment.main.add(s.H`vec2 overlayUV = overlayIdx == 0 ? vec2(uv.x * 0.5, uv.y) : vec2(uv.x * 0.5 + 0.5, uv.y);
71
+ fragColor = texture(tex, overlayUV) * opacity;`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,OverlayCompositingPassParameters:u,build:h},Symbol.toStringTag,{value:"Module"}))},32565(e,t,i){i.d(t,{R:()=>E,b:()=>A,r:()=>T});var r=i(34711),n=i(36782),s=i(84652),o=i(2923),a=i(28974),l=i(89786),c=i(82094),u=i(63365),h=i(66269),d=i(77949),p=i(77108),g=i(14314),f=i(71988),m=i(33094),v=i(20304),x=i(31821),y=i(58029),_=i(26934),b=i(54073),S=i(39122),w=i(11435),C=i(14113);const T=1;function A(e){const t=new C.N5,{attributes:i,varyings:T,vertex:A,fragment:E}=t,{applyMarkerOffset:R,draped:O,output:M,capType:L,stippleEnabled:P,falloffEnabled:I,roundJoins:D,wireframe:F,innerColorEnabled:N,hasAnimation:z,hasScreenSizePerspective:H,worldSizedImagePattern:V}=e,W=(0,w.W)().createBuilder(t,e);A.inputs.add("position",()=>W.getTextureAttribute("position")),E.include(l.p),t.include(s.s,e),t.include(o.q,e),t.include(n.g,e),t.include(b.Q,e);const j=R&&!O;j&&(A.uniforms.add(new v.m("markerScale",e=>e.markerScale)),t.include(a.r,{space:2,hasScreenSizePerspective:H})),(0,d.NB)(A,e),A.uniforms.add(new y.F("inverseProjectionMatrix",e=>e.camera.inverseProjectionMatrix),new p.E("nearFar",e=>e.camera.nearFar),new v.m("miterLimit",e=>"miter"!==e.join?0:e.miterLimit),new g.I("viewport",e=>e.camera.fullViewport)),A.constants.add("LARGE_HALF_FLOAT","float",65500),A.constants.add("EPS","float",.001),A.constants.add("NUM_JOIN_SUBDIVISIONS","float",e.numJoinSubdivisions),i.add("textureElementIndex","uint"),i.add("previousDelta","vec4"),i.add("nextDelta","vec4"),i.add("lineParameters","vec2"),i.add("u0","float"),T.add("vColor","vec4"),T.add("vpos","vec3",{invariant:!0}),T.add("vLineDistance","float"),T.add("vLineWidth","float"),P||(T.add("vIsInsideJoin","int"),T.add("vStretchFactor","float"),T.add("vJoinCenterLineSDFs","vec2"),T.add("vSubdivisionFactor","float"));const U=P;U&&T.add("vLineSizeInv","float");const B=2===L,$=P&&B,Z=I||$;Z&&T.add("vLineDistanceNorm","float"),B&&(T.add("vSegmentSDF","float"),T.add("vReverseSegmentSDF","float")),A.code.add(x.H`vec3 perpendicular(vec3 v) {
72
+ return vec3(v.y, -v.x, 0.0);
73
+ }
74
+ float interp(float ncp, vec4 a, vec4 b) {
75
+ return (-ncp - a.z) / (b.z - a.z);
76
+ }
77
+ vec3 rotateZ(vec3 v, float a) {
78
+ float s = sin(a);
79
+ float c = cos(a);
80
+ mat2 m = mat2(c, -s, s, c);
81
+ return vec3(m * v.xy, v.z);
82
+ }`),A.code.add(x.H`vec4 projectAndScale(vec4 pos) {
83
+ vec4 posNdc = proj * pos;
84
+ posNdc.xy *= viewport.zw / posNdc.w;
85
+ posNdc.z /= posNdc.w;
86
+ return posNdc;
87
+ }`),A.code.add(x.H`void clip(
88
+ inout vec4 pos,
89
+ inout vec4 prev,
90
+ inout vec4 next,
91
+ bool isStartVertex
92
+ ) {
93
+ float vnp = nearFar[0] * 0.99;
94
+ if (pos.z > -nearFar[0]) {
95
+ if (!isStartVertex) {
96
+ if (prev.z < -nearFar[0]) {
97
+ pos = mix(prev, pos, interp(vnp, prev, pos));
98
+ next = pos;
99
+ } else {
100
+ pos = vec4(0.0, 0.0, 0.0, 1.0);
101
+ }
102
+ } else {
103
+ if (next.z < -nearFar[0]) {
104
+ pos = mix(pos, next, interp(vnp, pos, next));
105
+ prev = pos;
106
+ } else {
107
+ pos = vec4(0.0, 0.0, 0.0, 1.0);
108
+ }
109
+ }
110
+ } else {
111
+ if (prev.z > -nearFar[0]) {
112
+ prev = mix(pos, prev, interp(vnp, pos, prev));
113
+ }
114
+ if (next.z > -nearFar[0]) {
115
+ next = mix(next, pos, interp(vnp, next, pos));
116
+ }
117
+ }
118
+ }`),(0,d.Nz)(A),A.constants.add("aaWidth","float",P?0:1).main.add(x.H`
119
+ vec3 position = ${W.getTextureAttribute("position")};
120
+
121
+ // unpack values from vertex type
122
+ bool isStartVertex = abs(abs(lineParameters.y) - 3.0) == 1.0;
123
+ vec3 prevPosition = position + previousDelta.xyz * previousDelta.w;
124
+ vec3 nextPosition = position + nextDelta.xyz * nextDelta.w;
125
+
126
+ float coverage = 1.0;
127
+
128
+ // Check for special value of lineParameters.y which is used by the Renderer when graphics are removed before the
129
+ // VBO is recompacted. If this is the case, then we just project outside of clip space.
130
+ if (lineParameters.y == 0.0) {
131
+ gl_Position = ${c.Z};
132
+ }
133
+ else {
134
+ vec4 pos = view * vec4(position, 1.0);
135
+ vec4 prev = view * vec4(prevPosition, 1.0);
136
+ vec4 next = view * vec4(nextPosition, 1.0);
137
+
138
+ bool isJoin = abs(lineParameters.y) < 3.0;
139
+ `),j&&A.main.add(x.H`vec4 other = isStartVertex ? next : prev;
140
+ bool markersHidden = areWorldMarkersHidden(pos.xyz, other.xyz);
141
+ if (!isJoin && !markersHidden) {
142
+ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
143
+ }`),t.include(h.F),A.main.add(x.H`
144
+ clip(pos, prev, next, isStartVertex);
145
+
146
+ vec3 clippedPos = pos.xyz;
147
+ vec3 clippedCenter = mix(pos.xyz, isStartVertex ? next.xyz : prev.xyz, 0.5);
148
+
149
+ pos = projectAndScale(pos);
150
+ next = projectAndScale(next);
151
+ prev = projectAndScale(prev);
152
+
153
+ vec3 left = (pos.xyz - prev.xyz);
154
+ vec3 right = (next.xyz - pos.xyz);
155
+
156
+ float leftLen = length(left);
157
+ float rightLen = length(right);
158
+
159
+ float lineSize = getSize(${(0,x.If)(H,"clippedPos")});
160
+ ${(0,x.If)(P&&H,"float patternLineSize = getSize(clippedCenter);")}
161
+ ${(0,x.If)(P&&!H,"float patternLineSize = lineSize;")}
162
+
163
+ ${(0,x.If)(V,x.H`
164
+ lineSize += aaWidth;
165
+ float lineWidth = lineSize * pixelRatio * worldToScreenRatio;
166
+ if (lineWidth < 1.0) {
167
+ coverage = lineWidth;
168
+ lineWidth = 1.0;
169
+ }
170
+ `,x.H`
171
+ if (lineSize < 1.0) {
172
+ coverage = lineSize; // convert sub-pixel coverage to alpha
173
+ lineSize = 1.0;
174
+ }
175
+
176
+ lineSize += aaWidth;
177
+ float lineWidth = lineSize * pixelRatio;
178
+ `)}
179
+
180
+ vLineWidth = noPerspectiveWrite(lineWidth, pos.w);
181
+ ${U?x.H`vLineSizeInv = noPerspectiveWrite(1.0 / lineSize, pos.w);`:""}
182
+ `),(P||B)&&A.main.add(x.H`
183
+ float isEndVertex = float(!isStartVertex);
184
+ vec3 segmentOrigin = mix(pos.xyz, prev.xyz, isEndVertex);
185
+ vec3 segment = mix(right, left, isEndVertex);
186
+ ${B?x.H`vec3 segmentEnd = mix(next.xyz, pos.xyz, isEndVertex);`:""}
187
+ `),A.main.add(x.H`left = (leftLen > EPS) ? left/leftLen : vec3(0.0, 0.0, 0.0);
188
+ right = (rightLen > EPS) ? right/rightLen : vec3(0.0, 0.0, 0.0);
189
+ vec3 segmentDirection = isStartVertex ? right : left;
190
+ vec3 capDisplacementDir = vec3(0.0, 0.0, 0.0);
191
+ vec3 joinDisplacementDir = vec3(0.0, 0.0, 0.0);
192
+ float displacementLen = lineWidth;
193
+ float miterDisplacementLen = lineWidth;
194
+ float innerDisplacementLen = lineWidth;`),P||A.main.add(x.H`vIsInsideJoin = 0;
195
+ vStretchFactor = 1.0;
196
+ vSubdivisionFactor = 0.0;
197
+ vJoinCenterLineSDFs = vec2(LARGE_HALF_FLOAT);`),A.main.add(x.H`float subdivisionFactor = 0.0;
198
+ bool isOutside = false;
199
+ if (isJoin) {
200
+ isOutside = (left.x * right.y - left.y * right.x) * lineParameters.y > 0.0;
201
+ vec3 joinDirection = normalize(left + right);
202
+ joinDisplacementDir = perpendicular(joinDirection);
203
+ if (leftLen > EPS && rightLen > EPS) {
204
+ float nDotSeg = dot(joinDisplacementDir, left);
205
+ displacementLen /= length(nDotSeg * left - joinDisplacementDir);
206
+ miterDisplacementLen = displacementLen;
207
+ innerDisplacementLen = min(displacementLen, min(leftLen, rightLen)/abs(nDotSeg));
208
+ if (!isOutside) {
209
+ displacementLen = innerDisplacementLen;
210
+ }
211
+ }
212
+ subdivisionFactor = lineParameters.x;`),P||A.main.add(x.H`if(subdivisionFactor > 0.0) {
213
+ vIsInsideJoin = 1;
214
+ }
215
+ vSubdivisionFactor = isOutside ? subdivisionFactor : 0.5;
216
+ if (miterDisplacementLen > miterLimit * lineWidth) {
217
+ vec2 leftScreenDir = left.xy;
218
+ vec2 rightScreenDir = right.xy;
219
+ float leftScreenLen = length(leftScreenDir);
220
+ float rightScreenLen = length(rightScreenDir);
221
+ if (leftScreenLen > EPS && rightScreenLen > EPS) {
222
+ leftScreenDir /= leftScreenLen;
223
+ rightScreenDir /= rightScreenLen;
224
+ float theta = acos(clamp(dot(leftScreenDir, rightScreenDir), -1.0, 1.0));
225
+ float subdividedTriangleHeight = (innerDisplacementLen + lineWidth) * cos(theta / (2.0 + 2.0 * NUM_JOIN_SUBDIVISIONS));
226
+ float bevelTriangleHeight = innerDisplacementLen + lineWidth * cos(theta * 0.5);
227
+ float triangleHeight = NUM_JOIN_SUBDIVISIONS > 0.0 ? subdividedTriangleHeight : bevelTriangleHeight;
228
+ vStretchFactor = noPerspectiveWrite(max(triangleHeight / (2.0 * lineWidth), 1.0), pos.w);
229
+ }
230
+ }`),A.main.add(x.H`if (isOutside && (displacementLen > miterLimit * lineWidth)) {`),D?A.main.add(x.H`
231
+ vec3 startDir = leftLen < EPS ? right : left;
232
+ startDir = perpendicular(startDir);
233
+
234
+ vec3 endDir = rightLen < EPS ? left : right;
235
+ endDir = perpendicular(endDir);
236
+
237
+ float factor = ${P?x.H`min(1.0, subdivisionFactor * ((NUM_JOIN_SUBDIVISIONS + 1.0) / NUM_JOIN_SUBDIVISIONS))`:x.H`subdivisionFactor`};
238
+
239
+ float rotationAngle = acos(clamp(dot(startDir.xy, endDir.xy), -1.0, 1.0));
240
+ joinDisplacementDir = rotateZ(startDir, -sign(lineParameters.y) * factor * rotationAngle);
241
+ `):A.main.add(x.H`
242
+ vec3 startDir = perpendicular(leftLen < EPS ? right : left);
243
+ vec3 endDir = perpendicular(rightLen < EPS ? left : right);
244
+
245
+ ${(0,x.If)(P,x.H`joinDisplacementDir = (isStartVertex || subdivisionFactor > 0.0) ? endDir : startDir;`,x.H`joinDisplacementDir = mix(startDir, endDir, subdivisionFactor);`)}
246
+ `);const k=0!==L;return A.main.add(x.H`
247
+ displacementLen = lineWidth;
248
+ }
249
+ } else {
250
+ // CAP handling ---------------------------------------------------
251
+ joinDisplacementDir = isStartVertex ? right : left;
252
+ joinDisplacementDir = perpendicular(joinDisplacementDir);
253
+
254
+ ${k?x.H`capDisplacementDir = vec3((isStartVertex ? -right : left).xy, 0.0);`:""}
255
+ }
256
+ `),A.main.add(x.H`
257
+ // Displacement (in pixels) caused by join/or cap
258
+ vec2 dposXY = (joinDisplacementDir.xy * sign(lineParameters.y) + capDisplacementDir.xy) * displacementLen;
259
+
260
+ /**
261
+ * To prevent z-fighting between layers, we also adjust the z value.
262
+ * We want to ensure that the orientation of the final triangles is the same, regardless of the line width.
263
+ * To do so, the below formula projects the xy displacement onto the original segment direction
264
+ * to find the z-offset necessary so the triangle orientation is independent of the width.
265
+ */
266
+ float dposZ = dot(dposXY, segmentDirection.xy) / dot(segmentDirection.xy, segmentDirection.xy) * segmentDirection.z;
267
+ vec3 dpos = vec3(dposXY, dposZ);
268
+
269
+ float lineDistNorm = noPerspectiveWrite(sign(lineParameters.y), pos.w);
270
+
271
+ vLineDistance = lineWidth * lineDistNorm;
272
+ ${Z?x.H`vLineDistanceNorm = lineDistNorm;`:""}
273
+
274
+ pos.xyz += dpos;
275
+ `),P||A.main.add(x.H`if (isJoin) {
276
+ vec2 joinCenterToVertex = dposXY;
277
+ vec2 leftCenterlineDir = left.xy;
278
+ vec2 rightCenterlineDir = right.xy;
279
+ float leftCenterlineLen = length(leftCenterlineDir);
280
+ float rightCenterlineLen = length(rightCenterlineDir);
281
+ leftCenterlineDir = leftCenterlineLen > EPS ? leftCenterlineDir / leftCenterlineLen : vec2(1.0, 0.0);
282
+ rightCenterlineDir = rightCenterlineLen > EPS ? rightCenterlineDir / rightCenterlineLen : leftCenterlineDir;
283
+ vJoinCenterLineSDFs = noPerspectiveWrite(
284
+ vec2(
285
+ dot(vec2(rightCenterlineDir.y, -rightCenterlineDir.x), joinCenterToVertex),
286
+ dot(vec2(leftCenterlineDir.y, -leftCenterlineDir.x), joinCenterToVertex)
287
+ ),
288
+ pos.w
289
+ );
290
+ }`),B&&A.main.add(x.H`vec2 segmentDir = normalize(segment.xy);
291
+ vSegmentSDF = noPerspectiveWrite((isJoin && isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentOrigin.xy, segmentDir)), pos.w);
292
+ vReverseSegmentSDF = noPerspectiveWrite((isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd.xy, -segmentDir)), pos.w);`),P&&(O?A.uniforms.add(new m.U("worldToScreenRatio",e=>1/e.screenToPCSRatio)):A.main.add(x.H`vec3 segmentCenter = mix((nextPosition + position) * 0.5, (position + prevPosition) * 0.5, isEndVertex);
293
+ float worldToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),A.main.add(x.H`float segmentLengthScreenDouble = length(segment.xy);
294
+ float segmentLengthScreen = segmentLengthScreenDouble * 0.5;
295
+ float discreteWorldToScreenRatio = discretizeWorldToScreenRatio(worldToScreenRatio);
296
+ float segmentLengthRender = length(mix(nextPosition - position, position - prevPosition, isEndVertex));
297
+ vStipplePatternStretch = worldToScreenRatio / discreteWorldToScreenRatio;`),O?A.main.add(x.H`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteWorldToScreenRatio / worldToScreenRatio;
298
+ float startPseudoScreen = u0 * discreteWorldToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):A.main.add(x.H`float startPseudoScreen = mix(u0, u0 - segmentLengthRender, isEndVertex) * discreteWorldToScreenRatio;
299
+ float segmentLengthPseudoScreen = segmentLengthRender * discreteWorldToScreenRatio;`),A.uniforms.add(new v.m("stipplePatternPixelSize",e=>(0,o.h)(e))),A.main.add(x.H`
300
+ float patternLength = patternLineSize * stipplePatternPixelSize;
301
+
302
+ ${(0,x.If)(V,x.H`
303
+ float uu = mix(u0, u0 - segmentLengthRender, isEndVertex);
304
+ vStippleDistanceLimits = vec2(uu, uu + segmentLengthRender);
305
+ vStipplePatternStretch = 1.0;
306
+
307
+ // The v-coordinate used in case of an image pattern.
308
+ bool isLeft = sign(lineParameters.y) < 0.0;
309
+ vStippleV = isLeft ? 0.0 : 1.0;
310
+ `,x.H`
311
+ // Compute the coordinates at both start and end of the line segment, because we need both to clamp to in the
312
+ // fragment shader
313
+ vStippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, segmentLengthScreen, patternLength);
314
+ `)}
315
+
316
+ vStippleDistance = mix(vStippleDistanceLimits.x, vStippleDistanceLimits.y, isEndVertex);
317
+
318
+ // Adjust the coordinate to the displaced position (the pattern is shortened/overextended on the in/outside of
319
+ // joins)
320
+ if (segmentLengthScreenDouble >= EPS) {
321
+ // Project the actual vertex position onto the line segment. Note that the resulting factor is within [0..1]
322
+ // at the original vertex positions, and slightly outside of that range at the displaced positions
323
+ vec3 stippleDisplacement = pos.xyz - segmentOrigin;
324
+ float stippleDisplacementFactor = dot(segment.xy, stippleDisplacement.xy) / (segmentLengthScreenDouble * segmentLengthScreenDouble);
325
+
326
+ // Apply this offset to the actual vertex coordinate (can be screen or pseudo-screen space)
327
+ vStippleDistance += (stippleDisplacementFactor - isEndVertex) * (vStippleDistanceLimits.y - vStippleDistanceLimits.x);
328
+ }
329
+
330
+ // Cancel out perspective correct interpolation because we want this length the really represent the screen
331
+ // distance
332
+ vStippleDistanceLimits = noPerspectiveWrite(vStippleDistanceLimits, pos.w);
333
+ vStippleDistance = noPerspectiveWrite(vStippleDistance, pos.w);
334
+
335
+ // Disable stipple distance limits on caps
336
+ vStippleDistanceLimits = isJoin ?
337
+ vStippleDistanceLimits :
338
+ isStartVertex ?
339
+ vec2(-1e34, vStippleDistanceLimits.y) :
340
+ vec2(vStippleDistanceLimits.x, 1e34);
341
+ `)),A.main.add(x.H`
342
+ // Convert back into NDC
343
+ pos.xy = (pos.xy / viewport.zw) * pos.w;
344
+ pos.z = pos.z * pos.w;
345
+
346
+ vColor = getColor();
347
+ vColor.a = noPerspectiveWrite(vColor.a * coverage, pos.w);
348
+
349
+ ${F&&!O?"pos.z -= EPS * pos.w;":""}
350
+
351
+ // transform final position to camera space for slicing
352
+ vpos = (inverseProjectionMatrix * pos).xyz;
353
+ gl_Position = pos;
354
+ forwardObjectAndLayerIdColor();
355
+ }`),t.fragment.include(r.HQ,e),t.include(S.D,e),E.include(u.a),E.main.add(x.H`discardBySlice(vpos);`),t.include(h.m),E.include(_.Q),E.main.add(x.H`
356
+ float lineWidth = noPerspectiveRead(vLineWidth);
357
+ float lineDistance = noPerspectiveRead(vLineDistance);
358
+ ${(0,x.If)(Z,x.H`float lineDistanceNorm = noPerspectiveRead(vLineDistanceNorm);`)}
359
+ `),F?E.main.add(x.H`vec4 finalColor = vec4(1.0, 0.0, 1.0, 1.0);`):(B&&E.main.add(x.H`float sdf = noPerspectiveRead(min(vSegmentSDF, vReverseSegmentSDF));
360
+ vec2 fragmentPosition = vec2(min(sdf, 0.0), lineDistance);
361
+ float fragmentRadius = length(fragmentPosition);
362
+ float fragmentCapSDF = (fragmentRadius - lineWidth) * 0.5;
363
+ float capCoverage = clamp(0.5 - fragmentCapSDF, 0.0, 1.0);
364
+ if (capCoverage < alphaCutoff) {
365
+ discard;
366
+ }`),$?E.main.add(x.H`vec2 stipplePosition = vec2(
367
+ min(getStippleSDF() * 2.0 - 1.0, 0.0),
368
+ lineDistanceNorm
369
+ );
370
+ float stippleRadius = length(stipplePosition * lineWidth);
371
+ float stippleCapSDF = (stippleRadius - lineWidth) * 0.5;
372
+ float stippleCoverage = clamp(0.5 - stippleCapSDF, 0.0, 1.0);
373
+ float stippleAlpha = step(alphaCutoff, stippleCoverage);`):E.main.add(x.H`float stippleAlpha = getStippleAlpha(lineWidth);`),11!==M&&E.main.add(x.H`discardByStippleAlpha(stippleAlpha, alphaCutoff);`),t.include(h.m),E.uniforms.add(new f.E("intrinsicColor",e=>e.color)).main.add(x.H`vec4 color = intrinsicColor * vColor;
374
+ color.a = noPerspectiveRead(color.a);`),N&&E.uniforms.add(new f.E("innerColor",e=>e.innerColor??e.color),new v.m("innerWidth",(e,t)=>e.innerWidth*t.camera.pixelRatio)).main.add(x.H`float distToInner = abs(lineDistance) - innerWidth;
375
+ float innerAA = clamp(0.5 - distToInner, 0.0, 1.0);
376
+ float innerAlpha = innerColor.a + color.a * (1.0 - innerColor.a);
377
+ color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`),E.main.add(x.H`vec4 finalColor = blendStipple(color, stippleAlpha);`),I&&(E.uniforms.add(new v.m("falloff",e=>e.falloff)),E.main.add(x.H`finalColor.a *= pow(max(0.0, 1.0 - abs(lineDistanceNorm)), falloff);`)),P||E.main.add(x.H`float stretchFactor = vIsInsideJoin == 1 ? noPerspectiveRead(vStretchFactor) : 1.0;
378
+ float featherWidth = 2.0;
379
+ float featherStartDistance = max(lineWidth - featherWidth / stretchFactor, 0.0);
380
+ float straightFeatherStartDistance = max(lineWidth - featherWidth, 0.0);
381
+ float value = abs(lineDistance);
382
+ float feather = (value - featherStartDistance) / (lineWidth - featherStartDistance);
383
+ vec2 joinCenterSDFs = noPerspectiveRead(vJoinCenterLineSDFs);
384
+ float joinCenterDistance = abs(vSubdivisionFactor > 0.5 ? joinCenterSDFs.x : joinCenterSDFs.y);
385
+ float straightFeather = (joinCenterDistance - straightFeatherStartDistance) / (lineWidth - straightFeatherStartDistance);
386
+ feather = vIsInsideJoin == 1 ? max(feather, straightFeather) : feather;
387
+ finalColor.a *= 1.0 - clamp(feather, 0.0, 1.0);`),z&&E.main.add("finalColor = animate(finalColor);")),E.main.add(x.H`outputColorHighlightOLID(applySlice(finalColor, vpos), finalColor.rgb);`),t}const E=Object.freeze(Object.defineProperty({__proto__:null,build:A,ribbonlineNumRoundJoinSubdivisions:T},Symbol.toStringTag,{value:"Module"}))},92942(e,t,i){i.d(t,{T:()=>u,a:()=>d,b:()=>h});var r=i(51850),n=i(82048),s=i(33079),o=i(31821),a=i(63761),l=i(65786),c=i(14113);class u extends l.Y{constructor(){super(...arguments),this.color=(0,r.fA)(1,1,1)}}function h(){const e=new c.N5;return e.include(n.c),e.fragment.uniforms.add(new a.N("tex",e=>e.texture),new s.t("uColor",e=>e.color)).main.add(o.H`vec4 texColor = texture(tex, uv);
388
+ fragColor = texColor * vec4(uColor, 1.0);`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,TexturePassParameters:u,build:h},Symbol.toStringTag,{value:"Module"}))},83349(e,t,i){function r(e,t,i){i=i||2;var r,s,a,l,c,u,d,p=t&&t.length,g=p?t[0]*i:e.length,f=n(e,0,g,i,!0),m=[];if(!f||f.next===f.prev)return m;if(p&&(f=h(e,t,f,i)),e.length>80*i){r=a=e[0],s=l=e[1];for(var v=i;v<g;v+=i)(c=e[v])<r&&(r=c),(u=e[v+1])<s&&(s=u),c>a&&(a=c),u>l&&(l=u);d=0!==(d=Math.max(a-r,l-s))?1/d:0}return o(f,m,i,r,s,d),m}function n(e,t,i,r,n){var s,o;if(n===L(e,t,i,r)>0)for(s=t;s<i;s+=r)o=R(s,e[s],e[s+1],o);else for(s=i-r;s>=t;s-=r)o=R(s,e[s],e[s+1],o);if(o&&S(o,o.next)){var a=o.next;O(o),o=a}return o}function s(e,t){if(!e)return e;t||(t=e);var i,r=e;do{if(i=!1,r.steiner||!S(r,r.next)&&0!==b(r.prev,r,r.next))r=r.next;else{var n=r.prev;if(O(r),(r=t=n)===r.next)break;i=!0}}while(i||r!==t);return t}function o(e,t,i,r,n,h,d){if(e){!d&&h&&m(e,r,n,h);for(var p,g,f=e;e.prev!==e.next;)if(p=e.prev,g=e.next,h?l(e,r,n,h):a(e))t.push(p.i/i),t.push(e.i/i),t.push(g.i/i),O(e),e=g.next,f=g.next;else if((e=g)===f){d?1===d?o(e=c(s(e),t,i),t,i,r,n,h,2):2===d&&u(e,t,i,r,n,h):o(s(e),t,i,r,n,h,1);break}}}function a(e){var t=e.prev,i=e,r=e.next;if(b(t,i,r)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(y(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&b(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function l(e,t,i,r){var n=e.prev,s=e,o=e.next;if(b(n,s,o)>=0)return!1;for(var a=n.x<s.x?n.x<o.x?n.x:o.x:s.x<o.x?s.x:o.x,l=n.y<s.y?n.y<o.y?n.y:o.y:s.y<o.y?s.y:o.y,c=n.x>s.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,u=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,h=v(a,l,t,i,r),d=v(c,u,t,i,r),p=e.prevZ,g=e.nextZ;p&&p.z>=h&&g&&g.z<=d;){if(p!==e.prev&&p!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,g!==e.prev&&g!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,g.x,g.y)&&b(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;g&&g.z<=d;){if(g!==e.prev&&g!==e.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,g.x,g.y)&&b(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function c(e,t,i){var r=e;do{var n=r.prev,o=r.next.next;!S(n,o)&&w(n,r,r.next,o)&&A(n,o)&&A(o,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(o.i/i),O(r),O(r.next),r=e=o),r=r.next}while(r!==e);return s(r)}function u(e,t,i,r,n,a){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&_(l,c)){var u=E(l,c);return l=s(l,l.next),u=s(u,u.next),o(l,t,i,r,n,a),void o(u,t,i,r,n,a)}c=c.next}l=l.next}while(l!==e)}function h(e,t,i,r){var o,a,l,c=[];for(o=0,a=t.length;o<a;o++)(l=n(e,t[o]*r,o<a-1?t[o+1]*r:e.length,r,!1))===l.next&&(l.steiner=!0),c.push(x(l));for(c.sort(d),o=0;o<c.length;o++)i=s(i=g(c[o],i),i.next);return i}function d(e,t){return e.x-t.x}function p(e){if(e.next.prev===e)return e;let t=e;for(;;){const i=t.next;if(i.prev===t||i===t||i===e)break;t=i}return t}function g(e,t){var i=function(e,t){var i,r=t,n=e.x,s=e.y,o=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var a=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>o){if(o=a,a===n){if(s===r.y)return r;if(s===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!i)return null;if(n===o)return i;var l,c=i,u=i.x,h=i.y,d=1/0;r=i;do{n>=r.x&&r.x>=u&&n!==r.x&&y(s<h?n:o,s,u,h,s<h?o:n,s,r.x,r.y)&&(l=Math.abs(s-r.y)/(n-r.x),A(r,e)&&(l<d||l===d&&(r.x>i.x||r.x===i.x&&f(i,r)))&&(i=r,d=l)),r=r.next}while(r!==c);return i}(e,t);if(!i)return t;var r=E(i,e),n=s(i,i.next);let o=p(r);return s(o,o.next),n=p(n),p(t===i?n:t)}function f(e,t){return b(e.prev,e,t.prev)<0&&b(t.next,e,e.next)<0}function m(e,t,i,r){var n=e;do{null===n.z&&(n.z=v(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,i,r,n,s,o,a,l,c=1;do{for(i=e,e=null,s=null,o=0;i;){for(o++,r=i,a=0,t=0;t<c&&(a++,r=r.nextZ);t++);for(l=c;a>0||l>0&&r;)0!==a&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;i=r}s.nextZ=null,c*=2}while(o>1)}(n)}function v(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function x(e){var t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function y(e,t,i,r,n,s,o,a){return(n-o)*(t-a)-(e-o)*(s-a)>=0&&(e-o)*(r-a)-(i-o)*(t-a)>=0&&(i-o)*(s-a)-(n-o)*(r-a)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&w(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(A(e,t)&&A(t,e)&&function(e,t){var i=e,r=!1,n=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==e);return r}(e,t)&&(b(e.prev,e,t.prev)||b(e,t.prev,t))||S(e,t)&&b(e.prev,e,e.next)>0&&b(t.prev,t,t.next)>0)}function b(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function w(e,t,i,r){var n=T(b(e,t,i)),s=T(b(e,t,r)),o=T(b(i,r,e)),a=T(b(i,r,t));return n!==s&&o!==a||!(0!==n||!C(e,i,t))||!(0!==s||!C(e,r,t))||!(0!==o||!C(i,e,r))||!(0!==a||!C(i,t,r))}function C(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function T(e){return e>0?1:e<0?-1:0}function A(e,t){return b(e.prev,e,e.next)<0?b(e,t,e.next)>=0&&b(e,e.prev,t)>=0:b(e,t,e.prev)<0||b(e,e.next,t)<0}function E(e,t){var i=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),n=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function R(e,t,i,r){var n=new M(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L(e,t,i,r){for(var n=0,s=t,o=i-r;s<i;s+=r)n+=(e[o]-e[s])*(e[s+1]+e[o+1]),o=s;return n}i.d(t,{e:()=>r}),r.deviation=function(e,t,i,r){var n=t&&t.length,s=n?t[0]*i:e.length,o=Math.abs(L(e,0,s,i));if(n)for(var a=0,l=t.length;a<l;a++){var c=t[a]*i,u=a<l-1?t[a+1]*i:e.length;o-=Math.abs(L(e,c,u,i))}var h=0;for(a=0;a<r.length;a+=3){var d=r[a]*i,p=r[a+1]*i,g=r[a+2]*i;h+=Math.abs((e[d]-e[g])*(e[p+1]-e[d+1])-(e[d]-e[p])*(e[g+1]-e[d+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},r.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var s=0;s<e[n].length;s++)for(var o=0;o<t;o++)i.vertices.push(e[n][s][o]);n>0&&(r+=e[n-1].length,i.holes.push(r))}return i}},21287(e,t,i){i.d(t,{M5:()=>h,eV:()=>u});var r=i(11254),n=i(49186),s=i(17676),o=i(84952),a=i(26306);let l=null,c=!0;function u(e,t,i,r){if(!t||!i)throw new Error("Cannot construct image data without dimensions");if(c)try{return new ImageData(e,t,i)}catch(e){c=!1}const n=function(e,t,i){return i||(l||(l=document.createElement("canvas"),l.width=1,l.height=1),i=l),i.getContext("2d").createImageData(e,t)}(t,i,r);return n.data.set(e,0),n}async function h(e,t){const{arrayBuffer:l,mediaType:c}=await async function(e,t){const i=(0,o.r$)(e);if(i?.isBase64)return{arrayBuffer:(0,a.M)(i.data),mediaType:i.mediaType};const n=await(0,r.A)(e,{responseType:"array-buffer",...t});return{arrayBuffer:n.data,mediaType:n.getHeader?.("Content-Type")??""}}(e,t),u="image/png"===c;if("image/gif"===c){const{isAnimatedGIF:e,parseGif:r}=await i.e(820).then(i.bind(i,10820));if(e(l))return r(l,t)}if(u){const{isAnimatedPNG:e,parseApng:r}=await i.e(2390).then(i.bind(i,22390));if(e(l))return r(l,t)}return async function(e,t){const i=window.URL.createObjectURL(e);try{const{data:e}=await(0,r.A)(i,{...t,responseType:"image"});return e}catch(e){if(!(0,s.zf)(e))throw new n.A("invalid-image",`Could not fetch requested image at ${i}`);throw e}finally{window.URL.revokeObjectURL(i)}}(new Blob([l],{type:c}),t)}},83300(e,t,i){i.r(t),i.d(t,{default:()=>Oe});var r=i(5482),n=i(69540),s=i(92474),o=i(53966),a=i(61893),l=i(17676),c=i(36708),u=i(91429),h=i(51850),d=i(91075),p=i(86738),g=i(39829),f=i(70328),m=i(24770),v=i(16939),x=i(49186);const y="Expected location to be a Point instance";class _ extends x.A{constructor(){super("invalid-input:location",y)}}var b=i(95696),S=i(18251),w=i(73836),C=i(1193),T=i(27615),A=i(35522),E=i(65806);function R(e,t){switch(e.type){case"georeferenced":return t.isGeographic;case"local":return t.isGeographic||t.isWebMercator}}var O=i(22141),M=i(72258);const L=()=>o.A.getLogger("esri.geometry.support.meshUtils.centerAt");const P=(0,h.vt)(),I=(0,h.vt)(),D=(0,h.vt)();var F=i(9093),N=i(5443),z=i(91218),H=i(98764),V=i(48353),W=i(9762),j=i(4197),U=i(73354);const B=(0,F.vt)(),$=(0,j.jh)(24);var Z=i(84952);function k(e){const t=(0,Z.nM)(e.url);return i=>{const r=(0,Z.V1)(i,t,t),n=r?r.replace(/^ *\.\//,""):null;return(n?e.files.get(n):null)??i}}async function G(e,t){switch(e.type){case"client":return Array.isArray(e.files)?function(e){if(!e.length)throw new x.A("mesh-load-external:missing-assets","There must be at least one file to load");return ee(e.map(e=>({name:e.name,mimeType:e.type,source:q(e)})))}(e.files):q(e.files);case"service":return async function(e,t){if(!e.length)throw new x.A("mesh-load-external:missing-assets","There must be at least one file to load");const i=await(0,l.nA)(e.map(async e=>{const i=await async function(e,t){const{parts:i,assetMimeType:r,assetName:n}=e;if(1===i.length)return new te(i[0].partUrl);const s=await e.toBlob(t);return(0,l.Te)(t),te.fromBlob(s,ie(n,r))}(e);return(0,l.Te)(t),{name:e.assetName,mimeType:e.assetMimeType,source:i}}));if((0,l.G4)(t))throw i.forEach(e=>e.source.dispose()),(0,l.NK)();return ee(i)}(e.assets,t);default:throw new x.A("mesh-load-external:invalid-source","Invalid source type")}}function q(e){return te.fromBlob(e,ie(e.name,e.type))}const Y=/^model\/gltf\+json$/,Q=/^model\/gltf-binary$/,X=/\.gltf$/i,K=/\.glb$/i;function J({mimeType:e,source:t,name:i}){return Y.test(e)||X.test(i)?{url:t.url,type:"gltf"}:Q.test(e)||K.test(i)?{url:t.url,type:"glb"}:null}function ee(e){const t=new Map;let i=null,r=null;for(const n of e){const{source:e,name:s}=n;i??=J(n),"ESRI3DO_NORM.glb"===s&&(r=J(n)),t.set(s,e.url),e.files.forEach((e,i)=>t.set(i,e))}const n=r??i;if(null==n)throw new x.A("mesh-load-external:missing-files","Missing files to load external mesh source");return new te(n.url,()=>e.forEach(({source:e})=>e.dispose()),t,n.type)}class te{constructor(e,t=()=>{},i=new Map,r){this.url=e,this.dispose=t,this.files=i,this.type=r}static fromBlob(e,t){const i=URL.createObjectURL(e);return new te(i,()=>URL.revokeObjectURL(i),void 0,t)}}function ie(e,t){return Y.test(t)||X.test(e)?"gltf":Q.test(t)||X.test(e)?"glb":void 0}var re=i(66895),ne=i(29461),se=i(15070),oe=i(77690),ae=i(29242),le=i(58083),ce=i(67026),ue=i(82534);const he=()=>o.A.getLogger("esri.geometry.support.meshUtils.rotate");function de(e,t,i,r=h.uY){if(null!=e){(0,le.$0)(me,(0,m.$I)(t),(0,m.yo)(t));for(let t=0;t<e.length;t+=i){for(let i=0;i<3;i++)pe[i]=e[t+i]-r[i];(0,A.Z0)(pe,pe,me);for(let i=0;i<3;i++)e[t+i]=pe[i]+r[i]}}}const pe=(0,h.vt)(),ge=(0,F.vt)(),fe=(0,m.vt)(),me=(0,F.vt)(),ve=(0,ae.vt)(),xe=(0,h.vt)(),ye=(0,ue.vt)(),_e=()=>o.A.getLogger("esri.geometry.support.meshUtils.scale");function be(e,t,i=h.uY){if(e)for(let r=0;r<e.length;r+=3){for(let t=0;t<3;t++)Se[t]=e[r+t]-i[t];(0,A.hs)(Se,Se,t);for(let t=0;t<3;t++)e[r+t]=Se[t]+i[t]}}const Se=(0,h.vt)(),we=(0,h.vt)(),Ce=(0,F.vt)(),Te=(0,h.vt)();var Ae,Ee=i(65801);const Re={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:b.A,local:S.default}};let Oe=Ae=class extends((0,n.OU)((0,s.WV)((0,a.g)(d.A)))){constructor(e){super(e),this.components=null,this.vertexSpace=new b.A,this.transform=null,this.metadata=new ne.O,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new C.default,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when(()=>{this.addHandles((0,c.wB)(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,i=this;return function(e){const{spatialReference:t,vertexSpace:i,untransformedBounds:r}=e,n=(0,f.gE)(r,$);if((0,T.Hq)(i)&&e.transform&&(0,U.a)(n,n,e.transform.localMatrix),"georeferenced"===i.type){const e=i.origin;return e&&(0,U.t)(n,n,e),(0,f.w1)((0,f.vY)(n),t)}const s=(0,H.lO)(t),o=i.origin;if(!(0,z.canProjectWithoutEngine)(s,t)){const[e,i,r]=o;return new N.A({xmin:e,ymin:i,zmin:r,xmax:e,ymax:i,zmax:r,spatialReference:t})}return(0,V.l)(t,o,B,s),(0,U.a)(n,n,B),(0,W.projectBuffer)(n,s,0,n,t,0),(0,f.w1)((0,f.vY)(n),t)}({get transform(){return i.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?(0,f.vt)(f.v_):(0,f.vY)(e)}get origin(){const e=(0,T.MW)(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:i}=this._transformedExtent;return new p.A({x:t.x,y:t.y,z:i,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(v.default.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}o.A.getLogger(this).error("removeComponent()","Provided component is not part of the list of components")}}rotate(e,t,i,r){return(0,m.AU)(e,t,i,Me),function(e,t,i){if(!e.vertexAttributes?.position||0===t[3])return;const{spatialReference:r,vertexSpace:n}=e,s=i?.origin??e.origin;(0,T.CK)(e)?function(e,t,i){e.transform??=new w.A;const{vertexSpace:r,transform:n,spatialReference:s}=e,[o,a,l]=r.origin,c=new p.A({x:o,y:a,z:l,spatialReference:s}),u=pe;if(c.equals(i))(0,A.hZ)(u,0,0,0);else if(!(0,M.p5)(u,i,e))return void(0,O.CN)(he(),i.spatialReference,s,O.JP);(0,ce.x8)(ye,(0,m.yo)(t),(0,m.$I)(t));const d=(0,le.O7)(ge,ye,h.uY,h.Un,u),{localMatrix:g}=n,f=(0,le.lw)(ge,d,g);n.scale=(0,le.X_)((0,h.vt)(),f),(0,le.hs)(f,f,(0,A.DI)(pe,n.scale));const v=n.rotationAxis;n.rotation=(0,m.ui)(f),0===n.rotationAngle&&(n.rotationAxis=v),n.translation=(0,le.sC)((0,h.vt)(),f)}(e,t,s):R(n,r)?function(e,t,i){const r=e.spatialReference,n=(0,H.lO)(r),s=xe;if(!(0,E.g)(i,s,n)&&((0,O.CN)(he(),i.spatialReference,n,"Falling back to mesh origin"),!(0,E.g)(e.origin,s,n)))return void(0,O.CN)(he(),e.origin.spatialReference,n);const o=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,c=new Float64Array(o.length),u=null!=a?new Float32Array(a.length):null,h=null!=l?new Float32Array(l.length):null;(0,V.l)(n,s,me,n),(0,oe.z0)(ve,me);const d=fe;(0,A.ei)((0,m.yo)(fe),(0,m.yo)(t),ve),d[3]=t[3],!(0,O.gr)(o,r,c,n)||null!=a&&null!=u&&!(0,O.X4)(a,o,r,c,n,u)||null!=l&&null!=h&&!(0,O.xA)(l,o,r,c,n,h)?(0,O.CN)(he(),r,n):(de(c,d,3,s),!(0,O.$5)(c,n,o,r)||null!=a&&null!=u&&(de(u,d,3),!(0,O.si)(u,o,r,c,n,a))||null!=l&&null!=h&&(de(h,d,4),!(0,O.Mv)(h,o,r,c,n,l))?(0,O.CN)(he(),n,r):e.vertexAttributesChanged())}(e,t,s):function(e,t,i){const r=xe;if(!(0,E.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(he(),i.spatialReference,e.spatialReference,O.JP)}de(e.vertexAttributes.position,t,3,r),de(e.vertexAttributes.normal,t,3),de(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}(e,t,s)}(this,Me,r),this}offset(e,t,i){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:n}=this,s=n?.position;if(!s)return this;if((0,T.Hq)(r)){const[n,s,o]=r.origin;r.origin=(0,h.fA)(n+e,s+t,o+i)}else{for(let r=0;r<s.length;r+=3)s[r]+=e,s[r+1]+=t,s[r+2]+=i;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(function(e,t,i){if(!e.vertexAttributes?.position)return;const{vertexSpace:r,spatialReference:n}=e,s=i?.origin??e.origin;(0,T.CK)(e)?function(e,t,i){e.transform??=new w.A;const{vertexSpace:r,transform:n,spatialReference:s}=e,[o,a,l]=r.origin,c=new p.A({x:o,y:a,z:l,spatialReference:s}),u=Se;if(c.equals(i))(0,A.hZ)(u,0,0,0);else if(!(0,M.p5)(u,i,e))return void(0,O.CN)(_e(),i.spatialReference,s,O.JP);const d=(0,A.hZ)(we,t,t,t),g=(0,le.O7)(Ce,ue.zK,h.uY,d,u),{localMatrix:f}=n,v=(0,le.lw)(Ce,g,f);n.scale=(0,le.X_)((0,h.vt)(),v),(0,le.hs)(v,v,(0,A.DI)(Se,n.scale));const x=n.rotationAxis;n.rotation=(0,m.ui)(v),0===n.rotationAngle&&(n.rotationAxis=x),n.translation=(0,le.sC)((0,h.vt)(),v)}(e,t,s):R(r,n)?function(e,t,i){const r=e.spatialReference,n=(0,H.lO)(r),s=Te;if(!(0,E.g)(i,s,n)&&((0,O.CN)(_e(),i.spatialReference,n,"Falling back to mesh origin"),!(0,E.g)(e.origin,s,n)))return void(0,O.CN)(_e(),e.origin.spatialReference,n);const o=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,c=new Float64Array(o.length),u=null!=a?new Float32Array(a.length):null,h=null!=l?new Float32Array(l.length):null;!(0,O.gr)(o,r,c,n)||null!=a&&null!=u&&!(0,O.X4)(a,o,r,c,n,u)||null!=l&&null!=h&&!(0,O.xA)(l,o,r,c,n,h)?(0,O.CN)(_e(),r,n):(be(c,t,s),!(0,O.$5)(c,n,o,r)||null!=a&&null!=u&&!(0,O.si)(u,o,r,c,n,a)||null!=l&&null!=h&&!(0,O.Mv)(h,o,r,c,n,l)?(0,O.CN)(_e(),n,r):e.vertexAttributesChanged())}(e,t,s):function(e,t,i){const r=Te;if(!(0,E.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(_e(),i.spatialReference,e.spatialReference,O.JP)}be(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}(e,t,s)}(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(function(e,t,i){if(!e.vertexAttributes?.position)return;const{vertexSpace:r}=e,n=i?.origin??e.origin;(0,T.Hq)(r)?function(e,t,i){const{vertexSpace:r}=e;if(!(0,T.Hq)(r))return;const n=I,s=P;if(!(0,E.g)(t,s,e.spatialReference))return void(0,O.CN)(L(),t.spatialReference,e.spatialReference,O.JP);if(!(0,E.g)(i,n,e.spatialReference))return void(0,O.CN)(L(),i.spatialReference,e.spatialReference,O.JP);const o=(0,A.Re)(D,s,n);r.origin=(0,A.WQ)((0,h.vt)(),r.origin,o)}(e,t,n):R(r,n.spatialReference)?function(e,t,i){const r=(0,h.fA)(i.x,i.y,i.z??0),n=(0,M.UR)(e,new S.default({origin:r}));if(!n)return;const s=(0,h.fA)(t.x,t.y,t.z??0),o=(0,M.UR)({vertexAttributes:n,spatialReference:e.spatialReference,vertexSpace:new S.default({origin:s})},b.A.absolute);if(!o)return;const{position:a,normal:l,tangent:c}=o;e.vertexAttributes.position=a,e.vertexAttributes.normal=l,e.vertexAttributes.tangent=c,e.vertexAttributesChanged()}(e,t,n):function(e,t,i){const r=I,n=P;if((0,E.g)(t,n,e.spatialReference)){if(!(0,E.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(L(),i.spatialReference,e.spatialReference,O.JP)}(function(e,t,i){if(e)for(let r=0;r<e.length;r+=3)for(let n=0;n<3;n++)e[r+n]+=t[n]-i[n]})(e.vertexAttributes.position,n,r),e.vertexAttributesChanged()}else(0,O.CN)(L(),t.spatialReference,e.spatialReference,O.JP)}(e,t,n)}(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(async function(e,t,r){switch(t.source.type){case"client":case"service":return async function(e,t,r){const{source:n}=t,{loadGLTFMesh:s}=await(0,l.qr)(i.e(5841).then(i.bind(i,35841)),r),o=await G(n,r);(0,l.Te)(r);const a=s(new p.A({x:0,y:0,z:0,spatialReference:e.spatialReference}),o.url,{resolveFile:k(o),signal:r?.signal,expectedType:o.type,unitConversionDisabled:t.unitConversionDisabled});a.then(()=>o.dispose(),()=>o.dispose());const{mesh:{vertexAttributes:c,components:u},meta:{isDracoDecompressed:h}}=await a;if(h)throw new x.A("mesh-load-external:draco-not-supported","The provided mesh uses Draco compression which is not supported.");e.vertexAttributes=c,e.components=u}(e,t,r);case"loadable":return t.source.load(e,r);default:t.source}}(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(e){return super.clone((0,re.WO)((0,re.QN)(e)))}cloneShallow(){return new Ae({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([i.e(4038).then(i.bind(i,84038)),this.load(e)]);return(0,l.Te)(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce((e,t)=>e+t.memoryUsage,this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(o.A.getLogger(this).error(e,"Mesh must be loaded before applying operations"),!1)}static createBox(e,t){if(!(e instanceof p.A))return o.A.getLogger(this.prototype).error(".createBox()",y),null;const i=new Ae((0,se.UG)((0,se.H8)(),e,t));return t?.imageFace&&"all"!==t.imageFace?(0,se.bQ)(i,t.imageFace):i}static createSphere(e,t){return e instanceof p.A?new Ae((0,se.UG)((0,se.Dk)(t?.densificationFactor||0),e,t)):(o.A.getLogger(this.prototype).error(".createSphere()",y),null)}static createCylinder(e,t){return e instanceof p.A?new Ae((0,se.UG)((0,se.ai)(t?.densificationFactor||0),e,t)):(o.A.getLogger(this.prototype).error(".createCylinder()",y),null)}static createPlane(e,t){if(!(e instanceof p.A))return o.A.getLogger(this.prototype).error(".createPlane()",y),null;const i=t?.facing??"up",r=(0,se.uF)(i,t?.size);return new Ae((0,se.UG)((0,se.Uh)(i),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof g.A))return o.A.getLogger(this.prototype).error(".createFromPolygon()","Expected polygon to be a Polygon instance"),null;const i=(0,Ee.uM)(e,{method:"earcut"}),r=(0,l.$X)(i)?null:i,n=r?.positions??[],s=r?.polygonIndices??[];return new Ae({vertexAttributes:new C.default({position:n}),components:[new v.default({faces:s,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new b.A})}static async createFromGLTF(e,t,r){if(!(e instanceof p.A)){const e=new _;throw o.A.getLogger(this.prototype).error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:n}=await(0,l.qr)(i.e(5841).then(i.bind(i,35841)),r);return new Ae((await n(e,t,r)).mesh)}};(0,r.Cg)([(0,u.MZ)({type:[v.default],json:{write:!0}})],Oe.prototype,"components",void 0),(0,r.Cg)([(0,u.MZ)({nonNullable:!0,types:Re,constructOnly:!0,json:{write:!0},clonable:(e,t)=>(0,re.o2)(t)?.vertexSpace??e.clone(t)})],Oe.prototype,"vertexSpace",void 0),(0,r.Cg)([(0,u.MZ)({type:w.A,clonable:(e,t)=>{const i=(0,re.o2)(t);return i&&"transform"in i?i.transform:e?.clone()??e},json:{write:!0}})],Oe.prototype,"transform",void 0),(0,r.Cg)([(0,u.MZ)({constructOnly:!0,type:ne.O,clonable:(e,t)=>(0,re.o2)(t)?.metadata??e.clone()})],Oe.prototype,"metadata",void 0),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"hasExtent",null),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"_transformedExtent",null),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"_untransformedBounds",null),(0,r.Cg)([(0,u.MZ)()],Oe.prototype,"origin",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1}})],Oe.prototype,"extent",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Oe.prototype,"hasZ",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Oe.prototype,"hasM",void 0),(0,r.Cg)([(0,u.MZ)({type:C.default,nonNullable:!0,json:{write:!0},clonable:(e,t)=>(0,re.o2)(t)?.vertexAttributes??e.clone(t)})],Oe.prototype,"vertexAttributes",void 0),Oe=Ae=(0,r.Cg)([(0,u.$K)("esri.geometry.Mesh")],Oe);const Me=(0,m.vt)()},15585(e,t,i){i.d(t,{If:()=>p,O5:()=>v,O9:()=>f,QT:()=>m,l3:()=>g});var r=i(5482),n=i(2741),s=i(49186),o=i(44208),a=i(34727);let l=null,c=null,u=null,h=null;const d=(new Float32Array(0),new Uint32Array(0),new Uint32Array(0),new Uint32Array(0),{vertices:new Float64Array(0),indices:new Uint32Array(0),outlineIndices:new Uint32Array(0),outlineRingLengths:new Uint32Array(0),vertexCount:0,indexCount:0,outlineIndexCount:0,outlineRingCount:0});async function p(){return l??=async function(){const e=await i.e(2997).then(i.bind(i,42997)),t=await e.default({locateFile:e=>(0,n.s)(`esri/core/libs/libtess/${e}`)});u=t}(),l}async function g(){return c??=async function(){const e=await i.e(9134).then(i.bind(i,99134)),t=await e.default({locateFile:e=>(0,n.s)(`esri/core/libs/libtess/${e}`)});h=t}(),c}function f(){return null!==h}function m(e,t,i=2){const n={stack:[],error:void 0,hasError:!1};try{const a=u;if(!a)throw new s.A("libtess:not-loaded","libtessF32 not loaded");const l=(0,r.mS)(n,b.from(a,e),!1),c=(0,r.mS)(n,w.from(a,t),!1),h=e.length/i*4,d=(0,r.mS)(n,new b(a,h*i),!1),p=a.triangulate(l.ptr,c.ptr,c.size,i,d.ptr,h);if((0,o.A)("esri-tessellation-debug")){const e=a.getError();0!==e&&console.warn("libtess:triangulation",C(e))}return{buffer:d.slice(0,p*i),vertexCount:p}}catch(e){n.error=e,n.hasError=!0}finally{(0,r.hk)(n)}}function v(e,t,i=2,n=!0){const l={stack:[],error:void 0,hasError:!1};try{const c=h;if(!c)throw new s.A("libtess:not-loaded","libtessF64 not loaded");const u=(0,r.mS)(l,S.from(c,e),!1),p=(0,r.mS)(l,w.from(c,t),!1),g=(0,r.mS)(l,new w(c,1),!1),f=(0,r.mS)(l,new w(c,1),!1),m=(0,r.mS)(l,new w(c,1),!1),v=(0,r.mS)(l,new w(c,1),!1),{maxVertexCount:x,maxIndexCount:y,maxOutlineIndexCount:b,maxOutlineRingCount:T}=function(e,t){const i=e.reduce((e,t)=>e+t,0),r=e.length,n=Math.max(0,e.length-1),s=Math.max(0,i+2*n-2),o=Math.max(0,Math.ceil(2*i)),l=Math.max(0,Math.ceil(3*s*2)),c=(0,a.mP)(l,3),u=i>0?Math.max(2,Math.ceil(.25*i)):0,h=i>0?Math.max(1,Math.ceil(u/3)):0;return{maxVertexCount:o,maxIndexCount:c,maxOutlineIndexCount:t?Math.max(0,i+r+u):0,maxOutlineRingCount:t?Math.max(0,r+h):0}}(t,n);let A=0,E=0,R=0,O=0,M=0;{const e={stack:[],error:void 0,hasError:!1};try{const t=(0,r.mS)(e,new S(c,x*i),!1),s=(0,r.mS)(e,new w(c,y),!1),o=(0,r.mS)(e,n?new w(c,b):null,!1),a=(0,r.mS)(e,n?new w(c,T):null,!1);if(c.triangulateIndexed(u.ptr,p.ptr,p.size,i,t.ptr,x,i,s.ptr,y,g.ptr,f.ptr,o?.ptr??0,b,a?.ptr??0,T,m.ptr,v.ptr),M=c.getError(),A=_(c)[g.ptr/Int32Array.BYTES_PER_ELEMENT],E=_(c)[f.ptr/Int32Array.BYTES_PER_ELEMENT],R=_(c)[m.ptr/Int32Array.BYTES_PER_ELEMENT],O=_(c)[v.ptr/Int32Array.BYTES_PER_ELEMENT],0===M){const e=t.slice(0,A*i);return{vertices:e,indices:s.slice(0,E),outlineIndices:n&&o?o.slice(0,R):d.outlineIndices,outlineRingLengths:n&&a?a.slice(0,O):d.outlineRingLengths,vertexCount:A,indexCount:E,outlineIndexCount:n?R:0,outlineRingCount:n?O:0}}}catch(t){e.error=t,e.hasError=!0}finally{(0,r.hk)(e)}}if(100903!==M)return(0,o.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",C(M)),d;const L=(0,r.mS)(l,new S(c,A*i),!1),P=(0,r.mS)(l,new w(c,E),!1),I=(0,r.mS)(l,n?new w(c,R):null,!1),D=(0,r.mS)(l,n?new w(c,O):null,!1);if(c.triangulateIndexed(u.ptr,p.ptr,p.size,i,L.ptr,A,i,P.ptr,E,g.ptr,f.ptr,I?.ptr??0,n?R:0,D?.ptr??0,n?O:0,m.ptr,v.ptr),M=c.getError(),0!==M)return(0,o.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",C(M)),d;const F=_(c)[g.ptr/Int32Array.BYTES_PER_ELEMENT],N=_(c)[f.ptr/Int32Array.BYTES_PER_ELEMENT],z=_(c)[m.ptr/Int32Array.BYTES_PER_ELEMENT],H=_(c)[v.ptr/Int32Array.BYTES_PER_ELEMENT],V=L.slice(0,F*i);return{vertices:V,indices:P.slice(0,N),outlineIndices:n&&I?I.slice(0,z):d.outlineIndices,outlineRingLengths:n&&D?D.slice(0,H):d.outlineRingLengths,vertexCount:F,indexCount:N,outlineIndexCount:n?z:0,outlineRingCount:n?H:0}}catch(e){l.error=e,l.hasError=!0}finally{(0,r.hk)(l)}}function x(e){return e.HEAPF64}function y(e){return e.HEAPF32}function _(e){return e.HEAP32}class b{static from(e,t){const i=new b(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateCoordinateArray(t)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float32Array.BYTES_PER_ELEMENT}set(e){y(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return y(this._libtess).slice(i+e,i+t)}}class S{static from(e,t){const i=new S(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateCoordinateArray(t)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float64Array.BYTES_PER_ELEMENT}set(e){x(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return x(this._libtess).slice(i+e,i+t)}}class w{static from(e,t){const i=new w(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateLengthsArray(t)}destroy(){this._libtess.destroyLengthsArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Int32Array.BYTES_PER_ELEMENT}set(e){_(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return function(e){const t=_(e);return new Uint32Array(t.buffer,t.byteOffset,t.length)}(this._libtess).slice(i+e,i+t)}}function C(e){switch(e){case 100903:return"Insufficient output buffer";case 100902:return"Out of memory";case 100151:return"Missing begin polygon";case 100152:return"Missing begin contour";case 100153:return"Missing end polygon";case 100154:return"Missing end countour";case 100155:return"Coordinates too large";case 100156:return"Missing combine callback";default:return`Unknown: ${e}`}}},16939(e,t,i){i.r(t),i.d(t,{default:()=>p});var r,n=i(5482),s=i(69540),o=i(25482),a=i(53966),l=i(91429),c=i(56507),u=i(19211),h=i(80882),d=i(31199);let p=r=class extends((0,s.OU)(o.o)){static from(e){return(0,c.PZ)(r,e)}constructor(e){super(e),this.material=null,this.name=void 0,this.shading="source",this.trustSourceNormals=!1}get faces(){return this._get("faces")??null}set faces(e){this._set("faces",(0,d.b)(e,Uint32Array,[Uint16Array],{loggerTag:".faces=",stride:3},a.A.getLogger(this)))}castMaterial(e){return(0,c.PZ)(e&&"object"==typeof e&&("metallic"in e||"roughness"in e||"metallicRoughnessTexture"in e)?h.A:u.default,e)}get memoryUsage(){let e=0;return null!=this.faces&&(e+=this.faces.byteLength),null!=this.material&&(e+=this.material.memoryUsage),e}};(0,n.Cg)([(0,l.MZ)({json:{write:d.B}})],p.prototype,"faces",null),(0,n.Cg)([(0,l.MZ)({type:u.default,json:{write:!0}})],p.prototype,"material",void 0),(0,n.Cg)([(0,l.wg)("material")],p.prototype,"castMaterial",null),(0,n.Cg)([(0,l.MZ)({json:{write:!0}})],p.prototype,"name",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],p.prototype,"shading",void 0),(0,n.Cg)([(0,l.MZ)({type:Boolean})],p.prototype,"trustSourceNormals",void 0),p=r=(0,n.Cg)([(0,l.$K)("esri.geometry.support.MeshComponent")],p)},95696(e,t,i){i.d(t,{A:()=>c});var r,n=i(5482),s=i(69540),o=i(25482),a=i(91429),l=i(93223);let c=class extends((0,s.OU)(o.o)){static{r=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new r}};(0,n.Cg)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],c.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],c.prototype,"origin",void 0),c=r=(0,n.Cg)([(0,a.$K)("esri.geometry.support.MeshGeoreferencedVertexSpace")],c)},18251(e,t,i){i.r(t),i.d(t,{default:()=>c});var r=i(5482),n=i(69540),s=i(25482),o=i(91429),a=i(51850),l=i(93223);let c=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.type="local",this.origin=(0,a.vt)()}};(0,r.Cg)([(0,l.e)({local:"local"},{readOnly:!0})],c.prototype,"type",void 0),(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],c.prototype,"origin",void 0),c=(0,r.Cg)([(0,o.$K)("esri.geometry.support.MeshLocalVertexSpace")],c)},19211(e,t,i){i.r(t),i.d(t,{default:()=>h});var r=i(5482),n=i(68197),s=i(69540),o=i(25482),a=i(91429),l=i(35063),c=i(51147),u=i(66895);let h=class extends((0,s.OU)(o.o)){constructor(e){super(e),this.color=null,this.colorTextureTransform=null,this.normalTextureTransform=void 0,this.alphaMode="auto",this.alphaCutoff=.5,this.doubleSided=!0}get colorTexture(){return this._get("colorTexture")}set colorTexture(e){this._set("colorTexture",null==e?null:l.default.from(e))}get normalTexture(){return this._get("normalTexture")}set normalTexture(e){this._set("normalTexture",null==e?null:l.default.from(e))}clone(e){const t=(0,u.hz)(e),i=t?.materialMap?.get(this);if(i)return i;const r=super.clone((0,u.QN)(e));return t?.materialMap?.set(this,r),r}get memoryUsage(){return this.getMemoryUsage()}getMemoryUsage(){let e=0;return e+=null!=this.color?16:0,null!=this.colorTexture&&(e+=this.colorTexture.memoryUsage),e+=null!=this.colorTextureTransform?20:0,null!=this.normalTexture&&(e+=this.normalTexture.memoryUsage),e+=null!=this.normalTextureTransform?20:0,e}};(0,r.Cg)([(0,a.MZ)({type:n.A,json:{write:!0}})],h.prototype,"color",void 0),(0,r.Cg)([(0,a.MZ)({type:l.default,json:{write:!0},value:null})],h.prototype,"colorTexture",null),(0,r.Cg)([(0,a.MZ)({type:c.A,json:{write:!0}})],h.prototype,"colorTextureTransform",void 0),(0,r.Cg)([(0,a.MZ)({type:l.default,json:{write:!0},value:null})],h.prototype,"normalTexture",null),(0,r.Cg)([(0,a.MZ)({type:c.A,json:{write:!0}})],h.prototype,"normalTextureTransform",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],h.prototype,"alphaMode",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],h.prototype,"alphaCutoff",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],h.prototype,"doubleSided",void 0),h=(0,r.Cg)([(0,a.$K)("esri.geometry.support.MeshMaterial")],h)},80882(e,t,i){i.d(t,{A:()=>c});var r=i(5482),n=i(68197),s=i(91429),o=i(19211),a=i(35063),l=i(51147);let c=class extends o.default{constructor(e){super(e),this.emissiveColor=null,this.emissiveStrength=null,this.emissiveTextureTransform=void 0,this.occlusionTextureTransform=void 0,this.metallic=1,this.roughness=1,this.metallicRoughnessTextureTransform=void 0}get emissiveTexture(){return this._get("emissiveTexture")}set emissiveTexture(e){this._set("emissiveTexture",null==e?null:a.default.from(e))}get occlusionTexture(){return this._get("occlusionTexture")}set occlusionTexture(e){this._set("occlusionTexture",null==e?null:a.default.from(e))}get metallicRoughnessTexture(){return this._get("metallicRoughnessTexture")}set metallicRoughnessTexture(e){this._set("metallicRoughnessTexture",null==e?null:a.default.from(e))}getMemoryUsage(){let e=super.getMemoryUsage();return e+=null!=this.emissiveColor?16:0,null!=this.emissiveTexture&&(e+=this.emissiveTexture.memoryUsage),e+=null!=this.emissiveTextureTransform?20:0,null!=this.occlusionTexture&&(e+=this.occlusionTexture.memoryUsage),e+=null!=this.occlusionTextureTransform?20:0,null!=this.metallicRoughnessTexture&&(e+=this.metallicRoughnessTexture.memoryUsage),e+=null!=this.metallicRoughnessTextureTransform?20:0,e}};(0,r.Cg)([(0,s.MZ)({type:n.A,json:{write:!0}})],c.prototype,"emissiveColor",void 0),(0,r.Cg)([(0,s.MZ)({json:{write:!0}})],c.prototype,"emissiveStrength",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"emissiveTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"emissiveTextureTransform",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"occlusionTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"occlusionTextureTransform",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],c.prototype,"metallic",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],c.prototype,"roughness",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"metallicRoughnessTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"metallicRoughnessTextureTransform",void 0),c=(0,r.Cg)([(0,s.$K)("esri.geometry.support.MeshMaterialMetallicRoughness")],c)},35063(e,t,i){i.r(t),i.d(t,{default:()=>m});var r,n=i(5482),s=i(69540),o=i(21287),a=i(25482),l=i(91429),c=i(56507),u=i(66895),h=i(97159),d=i(43937),p=i(36005);const g=new WeakMap;let f=0,m=class extends((0,s.OU)(a.o)){static{r=this}constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,i,r){if(e instanceof HTMLImageElement){const n={type:"image-element",src:(0,h.t)(e.src,r),crossOrigin:e.crossOrigin};t[i]=n}else if(e instanceof HTMLCanvasElement){const r={type:"canvas-element",imageData:v(e.getContext("2d").getImageData(0,0,e.width,e.height))};t[i]=r}else if(e instanceof HTMLVideoElement){const n={type:"video-element",src:(0,h.t)(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[i]=n}else if(e instanceof ImageData){const r={type:"image-data",imageData:v(e)};t[i]=r}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=x(e.imageData),i=document.createElement("canvas");return i.width=t.width,i.height=t.height,i.getContext("2d").putImageData(t,0,0),i}case"image-data":return x(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const{data:e,url:t}=this,i=e=>e?.toLowerCase().endsWith(".png")||e?.toLocaleLowerCase().startsWith("data:image/png;");return e instanceof HTMLCanvasElement?y(e.getContext("2d").getImageData(0,0,e.width,e.height)):e instanceof ImageData?y(e):!(!t||!i(t))||!!(e instanceof HTMLImageElement&&i(e.src))}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e="string"==typeof this.wrap?this.wrap:"object"==typeof this.wrap?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(t="")=>`d:${t},t:${this.transparent},w:${e}`;return null!=this.url?t(this.url):null!=this.data?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(g.has(this.data)||g.set(this.data,++f),t(g.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=null!=this.url?this.url.length:0,null!=this.data){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(e){const t=(0,u.$N)(e),i=t?.textureMap?.get(this);if(i)return i;const r=super.clone(e);return t?.textureMap?.set(this,r),r}static from(e){return"string"==typeof e?new r({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new r({data:e}):(0,c.PZ)(r,e)}};function v(e){let t="";for(let i=0;i<e.data.length;i++)t+=String.fromCharCode(e.data[i]);return{data:btoa(t),width:e.width,height:e.height}}function x(e){const t=atob(e.data),i=new Uint8ClampedArray(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return(0,o.eV)(i,e.width,e.height)}function y(e){for(let t=3;t<e.data.length;t+=4)if(255!==e.data[t])return!0;return!1}(0,n.Cg)([(0,l.MZ)({type:String,json:{write:h.w}})],m.prototype,"url",null),(0,n.Cg)([(0,l.MZ)({clonable:"reference",json:{write:{overridePolicy(){return{enabled:!this.url}}}}})],m.prototype,"data",null),(0,n.Cg)([(0,d.K)("data")],m.prototype,"writeData",null),(0,n.Cg)([(0,p.w)("data")],m.prototype,"readData",null),(0,n.Cg)([(0,l.MZ)({type:Boolean,json:{write:{overridePolicy(){return{enabled:this._isOverridden("transparent")}}}}})],m.prototype,"transparent",null),(0,n.Cg)([(0,l.MZ)({json:{write:!0}})],m.prototype,"wrap",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],m.prototype,"contentHash",null),m=r=(0,n.Cg)([(0,l.$K)("esri.geometry.support.MeshTexture")],m)},51147(e,t,i){i.d(t,{A:()=>a});var r=i(5482),n=i(69540),s=i(25482),o=i(91429);let a=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.offset=[0,0],this.rotation=0,this.scale=[1,1]}};(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],a.prototype,"offset",void 0),(0,r.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],a.prototype,"rotation",void 0),(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],a.prototype,"scale",void 0),a=(0,r.Cg)([(0,o.$K)("esri.geometry.support.MeshTextureTransform")],a)},1193(e,t,i){i.r(t),i.d(t,{default:()=>h});var r,n=i(5482),s=i(69540),o=i(25482),a=i(4718),l=i(53966),c=i(91429),u=i(31199);let h=r=class extends((0,s.OU)(o.o)){constructor(e){super(e),this.color=null,this.position=new Float64Array(0),this.uv=null,this.normal=null,this.tangent=null}castColor(e){return(0,u.b)(e,Uint8Array,[Uint8ClampedArray],{loggerTag:".color=",stride:4},l.A.getLogger(this))}castPosition(e){return e&&e instanceof Float32Array&&l.A.getLogger(this).warn(".position=","Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array"),(0,u.b)(e,Float64Array,[Float32Array],{loggerTag:".position=",stride:3},l.A.getLogger(this))}castUv(e){return(0,u.b)(e,Float32Array,[Float64Array],{loggerTag:".uv=",stride:2},l.A.getLogger(this))}castNormal(e){return(0,u.b)(e,Float32Array,[Float64Array],{loggerTag:".normal=",stride:3},l.A.getLogger(this))}castTangent(e){return(0,u.b)(e,Float32Array,[Float64Array],{loggerTag:".tangent=",stride:4},l.A.getLogger(this))}clonePositional(){const e={position:(0,a.o8)(this.position),normal:(0,a.o8)(this.normal),tangent:(0,a.o8)(this.tangent),uv:this.uv,color:this.color};return new r(e)}get usedMemory(){return this.position.byteLength+(this.uv?.byteLength??0)+(this.normal?.byteLength??0)+(this.tangent?.byteLength??0)+(this.color?.byteLength??0)}};(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"color",void 0),(0,n.Cg)([(0,c.wg)("color")],h.prototype,"castColor",null),(0,n.Cg)([(0,c.MZ)({nonNullable:!0,json:{write:u.B}})],h.prototype,"position",void 0),(0,n.Cg)([(0,c.wg)("position")],h.prototype,"castPosition",null),(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"uv",void 0),(0,n.Cg)([(0,c.wg)("uv")],h.prototype,"castUv",null),(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"normal",void 0),(0,n.Cg)([(0,c.wg)("normal")],h.prototype,"castNormal",null),(0,n.Cg)([(0,c.MZ)({json:{write:u.B}})],h.prototype,"tangent",void 0),(0,n.Cg)([(0,c.wg)("tangent")],h.prototype,"castTangent",null),h=r=(0,n.Cg)([(0,c.$K)("esri.geometry.support.MeshVertexAttributes")],h)},31199(e,t,i){function r(e,t,i,r){const{loggerTag:n,stride:s}=t;return e.length%s!==0?(r.error(n,`Invalid array length, expected a multiple of ${s}`),new i([])):e}function n(e,t,i,n,s){if(!e)return e;if(e instanceof t)return r(e,n,t,s);for(const o of i)if(e instanceof o)return r(new t(e),n,t,s);if(Array.isArray(e))return r(new t(e),n,t,s);{const r=i.map(e=>`'${e.name}'`);return s.error(`Failed to set property, expected one of ${r}, but got ${e.constructor.name}`),new t([])}}function s(e,t,i){t[i]=function(e){const t=new Array(e.length);for(let i=0;i<e.length;i++)t[i]=e[i];return t}(e)}i.d(t,{B:()=>s,b:()=>n})},40118(e,t,i){i.d(t,{H5:()=>h,wh:()=>c,createWithExternalSource:()=>u});var r=i(49186),n=(i(17676),i(83300)),s=(i(16939),i(95696),i(73836)),o=(i(1193),i(27615));i(53966),i(35522),i(51850),i(66895),i(72258);var a=i(29461),l=i(15070);function c(e,t){return new n.default((0,l.UG)((0,l.Dk)(t?.densificationFactor||0),e,t))}function u(e,t,i){const r=i?.extent??null,{spatialReference:l}=e,c=i?.transform?.clone()??new s.A,u=(0,o.TE)(e,i),h=i?.unitConversionDisabled,d={source:t,extent:r,unitConversionDisabled:h},p=new a.O;return p.externalSources.push(d),new n.default({metadata:p,transform:c,vertexSpace:u,spatialReference:l})}function h(e,t){const{spatialReference:i}=e,a=t?.transform?.clone()??new s.A,l=(0,o.TE)(e,t),c=new n.default({transform:a,vertexSpace:l,spatialReference:i});return c.addResolvingPromise(Promise.reject(new r.A("mesh-incomplete","Mesh resources are not complete"))),c}i(65801)},63579(e,t,i){i.d(t,{Bq:()=>l,Qp:()=>a,WN:()=>m,dK:()=>v,eN:()=>p,fH:()=>f,in:()=>g,yr:()=>c});var r=i(11254),n=i(4576),s=i(17676),o=i(20557);class a{constructor(e,t,i){this.assetName=e,this.assetMimeType=t,this.parts=i}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&(0,n.aI)(this.parts,e.parts,(e,t)=>e.equals(t))}isOnService(e){return this.parts.every(t=>t.isOnService(e))}makeHash(){let e="";for(const t of this.parts)e+=t.partHash;return e}async toBlob(e){const{parts:t}=this;if(1===t.length)return t[0].toBlob(e);const i=await Promise.all(t.map(t=>t.toBlob(e)));return(0,s.Te)(e),new Blob(i)}}class l{constructor(e,t){this.partUrl=e,this.partHash=t}equals(e){return this===e||this.partUrl===e.partUrl&&this.partHash===e.partHash}isOnService(e){return this.partUrl.startsWith(`${e.path}/assets/`)}async toBlob(e){const{data:t}=await(0,r.A)(this.partUrl,{responseType:"blob"});return(0,s.Te)(e),t}}function c(e){return function(e){switch(e?.type){case"client":return Array.isArray(e.files)?e.files.some(d):d(e.files);case"service":return e.assets.some(d);case"loadable":return!0;default:return!1}}(e?.source)}const u=/^(model\/gltf\+json)|(model\/gltf-binary)$/,h=/\.(gltf|glb)/i;function d(e){if(e instanceof File){const{type:t,name:i}=e;return u.test(t)||h.test(i)}return u.test(e.assetMimeType)||h.test(e.assetName)}function p(e,t){if(!e)return!1;const{source:i}=e;return function(e,t){return"service"===e.type&&e.assets.every(e=>e.isOnService(t))}(i,t)}function g(e,t){if(e===t)return!0;const{source:i}=e,{source:r}=t;if(i===r)return!0;if("service"===i.type&&"service"===r.type){if(i.assets.length!==r.assets.length)return!1;const e=(e,t)=>e.assetName<t.assetName?-1:e.assetName>t.assetName?1:0,t=[...i.assets].sort(e),n=[...r.assets].sort(e);for(let e=0;e<t.length;++e)if(!t[e].equals(n[e]))return!1;return!0}return!1}function f(e,t){return e instanceof File?(0,o.rq)(e,t):(0,o.z$)(e.assetMimeType,e.assetName,t)}function m(e){switch(e.type){case"client":return Array.isArray(e.files)?e.files:[e.files];case"service":return e.assets;case"loadable":return}}function v(e){return!!e.original}},29461(e,t,i){i.d(t,{O:()=>c});var r=i(5482),n=i(69540),s=i(7762),o=i(36708),a=i(91429),l=i(63579);let c=class extends n.Pw{constructor(e){super(e),this.externalSources=new s.A,this._explicitDisplaySource=null,this.addHandles((0,o.on)(()=>this.externalSources,"after-remove",({item:e})=>{e===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(null!=e&&!(0,l.yr)(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!(0,l.in)(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>(0,l.eN)(t,e))}get _implicitDisplaySource(){return this.externalSources.find(l.yr)}};(0,r.Cg)([(0,a.MZ)()],c.prototype,"externalSources",void 0),(0,r.Cg)([(0,a.MZ)()],c.prototype,"displaySource",null),(0,r.Cg)([(0,a.MZ)()],c.prototype,"_implicitDisplaySource",null),(0,r.Cg)([(0,a.MZ)()],c.prototype,"_explicitDisplaySource",void 0),c=(0,r.Cg)([(0,a.$K)("esri.geometry.support.meshUtils.Metadata")],c)},66895(e,t,i){i.d(t,{$N:()=>u,Lz:()=>s,QN:()=>h,WO:()=>l,hz:()=>a,o2:()=>n});const r=Symbol("meshContext");function n(e){return e&&"object"==typeof e&&r in e?e[r]:void 0}function s(e,t){const i=n(e);return{...e,[r]:{...i,...t}}}const o=Symbol("meshMaterialContext");function a(e){return e&&"object"==typeof e&&o in e?e[o]:void 0}function l(e){const t=a(e);if(t?.materialMap)return e;const i={materialMap:new Map};return{...e,[o]:i}}const c=Symbol("meshTextureContext");function u(e){return e&&"object"==typeof e&&c in e?e[c]:void 0}function h(e){const t=u(e);if(t?.textureMap)return e;const i={textureMap:new Map};return{...e,[c]:i}}},15070(e,t,i){i.d(t,{Dk:()=>d,H8:()=>u,UG:()=>v,Uh:()=>f,ai:()=>p,bQ:()=>h,uF:()=>g});var r=i(29242),n=i(35522),s=i(51850),o=i(16939),a=i(1193),l=i(27615),c=i(72258);function u(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:i}=x,r=4*e.length,n=new Float64Array(3*r),s=new Float32Array(3*r),o=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let l=0,c=0,u=0,h=0;for(let r=0;r<e.length;r++){const d=e[r],p=l/3;for(const e of t)a[h++]=p+e;const g=d.corners;for(let e=0;e<4;e++){const t=g[e];let r=0;o[u++]=.25*i[e][0]+d.uvOrigin[0],o[u++]=d.uvOrigin[1]-.25*i[e][1];for(let e=0;e<3;e++)0!==d.axis[e]?(n[l++]=.5*d.axis[e],s[c++]=d.axis[e]):(n[l++]=.5*t[r++],s[c++]=0)}}return{position:n,normal:s,uv:o,faces:a}}function h(e,t){const i=e.components[0],r=i.faces,n=y[t],s=6*n,a=new Array(6),l=new Array(r.length-6);let c=0,u=0;for(let e=0;e<r.length;e++)e>=s&&e<s+6?a[c++]=r[e]:l[u++]=r[e];if(null!=e.vertexAttributes.uv){const t=new Float32Array(e.vertexAttributes.uv),i=4*n*2,r=[0,1,1,1,1,0,0,0];for(let e=0;e<r.length;e++)t[i+e]=r[e];e.vertexAttributes.uv=t}return e.components=[new o.default({faces:a,material:i.material}),new o.default({faces:l})],e}function d(e=0){const t=Math.round(8*2**e),i=2*t,r=(t-1)*(i+1)+2*i,n=new Float64Array(3*r),s=new Float32Array(3*r),o=new Float32Array(2*r),a=new Uint32Array((t-1)*i*2*3);let l=0,c=0,u=0,h=0;for(let e=0;e<=t;e++){const r=e/t*Math.PI+.5*Math.PI,d=Math.cos(r),p=Math.sin(r);_[2]=p;const g=0===e||e===t,f=g?i-1:i;for(let r=0;r<=f;r++){const p=r/f*2*Math.PI;_[0]=-Math.sin(p)*d,_[1]=Math.cos(p)*d;for(let e=0;e<3;e++)n[l]=.5*_[e],s[l]=_[e],++l;o[c++]=(r+(g?.5:0))/i,o[c++]=e/t,0!==e&&r!==i&&(e!==t&&(a[u++]=h,a[u++]=h+1,a[u++]=h-i),1!==e&&(a[u++]=h,a[u++]=h-i,a[u++]=h-i-1)),h++}}return{position:n,normal:s,uv:o,faces:a}}function p(e=0){const t=Math.round(16*2**e),i=4*(t+1)+2*t,r=new Float64Array(3*i),n=new Float32Array(3*i),s=new Float32Array(2*i),o=new Uint32Array(4*t*3);let a=0,l=0,c=0,u=0,h=0;for(let e=0;e<=5;e++){const i=0===e||5===e,d=e<=1||e>=4,p=2===e||4===e,g=i?t-1:t;for(let f=0;f<=g;f++){const m=f/g*2*Math.PI,v=i?0:.5;_[0]=v*Math.sin(m),_[1]=v*-Math.cos(m),_[2]=e<=2?.5:-.5;for(let t=0;t<3;t++)r[a++]=_[t],n[l++]=d?2===t?e<=1?1:-1:0:2===t?0:_[t]/v;s[c++]=(f+(i?.5:0))/t,s[c++]=e<=1?1*e/3:e<=3?1*(e-2)/3+1/3:1*(e-4)/3+2/3,p||0===e||f===t||(5!==e&&(o[u++]=h,o[u++]=h+1,o[u++]=h-t),1!==e&&(o[u++]=h,o[u++]=h-t,o[u++]=h-t-1)),h++}}return{position:r,normal:n,uv:s,faces:o}}function g(e,t){const i="number"==typeof t?t:null!=t?t.width:1,r="number"==typeof t?t:null!=t?t.height:1;switch(e){case"up":case"down":return{width:i,depth:r};case"north":case"south":return{width:i,height:r};case"east":case"west":return{depth:i,height:r}}}function f(e){const t=m.facingAxisOrderSwap[e],i=m.position,r=m.normal,n=new Float64Array(i.length),s=new Float32Array(r.length);let o=0;for(let e=0;e<4;e++){const e=o;for(let a=0;a<3;a++){const l=t[a],c=Math.abs(l)-1,u=l>=0?1:-1;n[o]=i[e+c]*u,s[o]=r[e+c]*u,o++}}return{position:n,normal:s,uv:new Float32Array(m.uv),faces:new Uint32Array(m.faces),isPlane:!0}}const m={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[3,1,2],west:[-3,-1,2],north:[-1,3,2],south:[1,-3,2],up:[1,2,3],down:[1,-2,-3]}};function v(e,t,i){e.isPlane||function(e){for(let t=0;t<e.position.length;t+=3)e.position[t+2]+=.5}(e),function(e,t){if(null!=t){b[0]=t[0],b[4]=t[1],b[8]=t[2];for(let t=0;t<e.position.length;t+=3){for(let i=0;i<3;i++)_[i]=e.position[t+i];(0,n.ei)(_,_,b);for(let i=0;i<3;i++)e.position[t+i]=_[i]}if(t[0]!==t[1]||t[1]!==t[2]){b[0]=1/t[0],b[4]=1/t[1],b[8]=1/t[2];for(let t=0;t<e.normal.length;t+=3){for(let i=0;i<3;i++)_[i]=e.normal[t+i];(0,n.ei)(_,_,b),(0,n.S8)(_,_);for(let i=0;i<3;i++)e.normal[t+i]=_[i]}}}}(e,function(e,t,i){const r=(0,c.xK)(t,i);if(null==e&&1===r)return null;if(null==e)return[r,r,r];if("number"==typeof e){const t=e*r;return[t,t,t]}return[null!=e.width?e.width*r:r,null!=e.depth?e.depth*r:r,null!=e.height?e.height*r:r]}(i?.size,i?.unit,t.spatialReference));const r=(0,l.TE)(t,i),s=t.spatialReference.isGeographic?(0,l.TE)(t):r,u=(0,c.UR)({vertexAttributes:e,vertexSpace:s,spatialReference:t.spatialReference},r,{allowBufferReuse:!0});return{vertexAttributes:new a.default({...u,uv:e.uv}),vertexSpace:r,components:[new o.default({faces:e.faces,material:i?.material||null})],spatialReference:t.spatialReference}}const x={faceDescriptions:[{axis:[0,-1,0],uvOrigin:[0,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[1,0,0],uvOrigin:[.25,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,1,0],uvOrigin:[.5,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[-1,0,0],uvOrigin:[.75,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[0,0,1],uvOrigin:[0,.375],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,0,-1],uvOrigin:[0,.875],corners:[[-1,1],[1,1],[1,-1],[-1,-1]]}],uvScales:[[0,0],[1,0],[1,1],[0,1]],faceVertexOffsets:[0,1,2,0,2,3]},y={south:0,east:1,north:2,west:3,up:4,down:5},_=(0,s.vt)(),b=(0,r.vt)()},22141(e,t,i){i.d(t,{$5:()=>w,CN:()=>y,JP:()=>x,KM:()=>T,Mv:()=>E,X4:()=>_,gr:()=>S,qs:()=>C,si:()=>b,xA:()=>A});var r=i(34727),n=i(77690),s=i(29242),o=i(58083),a=i(9093),l=i(35522),c=i(51850),u=i(73941),h=i(48353),d=i(9762),p=(i(79258),i(21325)),g=i(28735),f=i(13030),m=i(73354),v=i(50867);const x="Projection may be possible after calling projection.load().";function y(e,t,i,r){e.error(`Failed to project from (wkid:${t.wkid}) to (wkid:${i.wkid}).${r?" ":""}${r}`)}function _(e,t,i,r,n,s){return O(0,f.xs.fromTypedArray(e),0,f.Xm.fromTypedArray(t),i,f.Xm.fromTypedArray(r),n,f.xs.fromTypedArray(s))?s:null}function b(e,t,i,r,n,s){return O(1,f.xs.fromTypedArray(e),0,f.Xm.fromTypedArray(t),i,f.Xm.fromTypedArray(r),n,f.xs.fromTypedArray(s))?s:null}function S(e,t,i,r){return(0,d.projectBuffer)(e,t,0,i,r,0)?i:null}function w(e,t,i,r){return(0,d.projectBuffer)(e,t,0,i,r,0)?i:null}function C(e,t,i){return(0,n.Ge)(I,i),(0,m.b)(t,e,I),(0,r.or)(I)&&(0,m.n)(t,t),t}function T(e,t,i){return(0,n.z0)(I,i),(0,v.t)(t,e,I),(0,r.or)(I)&&(0,m.n)(t,t,4),t}function A(e,t,i,r,n,s){if(!O(0,f.xs.fromTypedArray(e,4*Float32Array.BYTES_PER_ELEMENT),1,f.Xm.fromTypedArray(t),i,f.Xm.fromTypedArray(r),n,f.xs.fromTypedArray(s,4*Float32Array.BYTES_PER_ELEMENT)))return null;for(let t=3;t<e.length;t+=4)s[t]=e[t];return s}function E(e,t,i,r,n,s){if(!O(1,f.xs.fromTypedArray(e,16),1,f.Xm.fromTypedArray(t),i,f.Xm.fromTypedArray(r),n,f.xs.fromTypedArray(s,16)))return null;for(let t=3;t<e.length;t+=4)s[t]=e[t];return s}function R(e,t,i,r,s){switch((0,h.l)(r,i,P,r),1===e&&(0,o.B8)(P,P),t){case 0:return(0,n.Ge)(s,P);case 1:return(0,n.z0)(s,P)}}function O(e,t,i,r,n,s,o,a){if(!t)return;const c=r.count;if(function(e){return e.isWGS84||(0,p.x1)(e)||(0,u.q8)(e)||(0,u.KQ)(e)}(n))for(let r=0;r<c;r++)s.getVec(r,M),t.getVec(r,L),(0,l.ei)(L,L,R(e,i,M,o,I)),a.setVec(r,L);else for(let n=0;n<c;n++){s.getVec(n,M),t.getVec(n,L);const c=(0,g.jg)(r.get(n,1));let u=Math.cos(c);1===i!=(0===e)&&(u=1/u),R(e,i,M,o,I),0===e?(I[0]*=u,I[1]*=u,I[2]*=u,I[3]*=u,I[4]*=u,I[5]*=u):(I[0]*=u,I[3]*=u,I[6]*=u,I[1]*=u,I[4]*=u,I[7]*=u),(0,l.ei)(L,L,I),(0,l.S8)(L,L),a.setVec(n,L)}return a}const M=(0,c.vt)(),L=(0,c.vt)(),P=(0,a.vt)(),I=(0,s.vt)()},72258(e,t,i){i.d(t,{UR:()=>b,p5:()=>_,xK:()=>E});var r=i(53966),n=i(34727),s=i(86211),o=i(77690),a=i(29242),l=i(58083),c=i(9093),u=i(35522),h=i(51850),d=i(73941),p=i(98764),g=i(48353),f=i(65806),m=i(27615),v=i(73354),x=i(22141);const y=()=>r.A.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function _(e,t,{vertexSpace:i,spatialReference:r}){if("georeferenced"===i.type){const n=e;if(!(0,f.g)(t,n,r))return!1;const{origin:s}=i;return(0,u.Re)(e,n,s),!0}const n=(0,p.lO)(r),s=e;if(!(0,f.g)(t,s,n))return!1;const{origin:o}=i,a=P;if(!(0,g.l)(r,o,a,n))return!1;const c=(0,l.B8)(P,a);return null!=c&&((0,u.Z0)(e,s,c),!0)}function b(e,t,i){const{vertexSpace:r,transform:n,vertexAttributes:s}=e,a=(0,m.Hq)(r)?n:null,h=T(e.spatialReference,i,3);if((0,m.yJ)(r,t)&&(!a||(0,l.t2)(a.localMatrix,c.zK))&&A(h)){const{position:e,normal:t,tangent:r}=s,n=i?.allowBufferReuse;return{position:n?e:e.slice(),normal:n?t:t?.slice(),tangent:n?r:r?.slice()}}switch(e.vertexSpace.type){case"local":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:i},{origin:r},n,s){const o=S(t,s);if(!(0,g.l)(t,r,R,o))return(0,x.CN)(y(),t,o),null;if(i&&(0,l.lw)(R,R,i.localMatrix),!(0,g.l)(t,n,O,o))return(0,x.CN)(y(),o,t),null;(0,l.B8)(O,O);const a=(0,l.lw)(R,O,R);return C(a,t,s,3),w(e,a)}(e,e.vertexSpace,t.origin,i):function({spatialReference:e,vertexAttributes:t,transform:i},{origin:r},n,s){const o=S(e,s);if(!(0,g.l)(e,r,R,o))return(0,x.CN)(y(),e,o),null;i&&(0,l.lw)(R,R,i.localMatrix),C(R,e,s,1);const a=new Float64Array(t.position.length),c=function(e,t,i,r,n){(0,v.a)(r,e,t);const s=new Float64Array(e.length);return(0,x.$5)(r,n,s,i)?s:((0,x.CN)(y(),n,i),null)}(t.position,R,e,a,o);if(!c)return null;const h=function(e,t,i,r,n,s){if(null==n)return null;const o=new Float32Array(n.length);return(0,x.qs)(n,o,s),(0,x.si)(o,e,t,i,r,o)?o:((0,x.CN)(y(),r,t),null)}(c,e,a,o,t.normal,R);if(t.normal&&!h)return null;const d=function(e,t,i,r,n,s){if(null==n)return null;const o=new Float32Array(n.length);return(0,x.KM)(n,o,s),(0,x.Mv)(o,e,t,i,r,o)?o:((0,x.CN)(y(),r,t),null)}(c,e,a,o,t.tangent,R);if(t.tangent&&!d)return null;if(n){const e=(0,u.ze)(L,n);(0,v.t)(c,c,e)}return{position:c,normal:h,tangent:d}}(e,e.vertexSpace,t.origin,i);case"georeferenced":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:i},{origin:r},n,s){const a=S(t,s);if(!(0,g.l)(t,n,R,a))return(0,x.CN)(y(),t,a),null;const c=1/T(t,s,2);(0,l.hs)(R,R,[c,c,c]);const u=(0,l.B8)(O,R),{position:h,normal:d,tangent:p}=function(e,t,i){if(!t)return e;if(!i){const{position:i,normal:r,tangent:n}=e;return{position:(0,v.t)(new Float64Array(i.length),i,t),tangent:n,normal:r}}const r=w(e,i.localMatrix);return(0,v.t)(r.position,r.position,t),r}(e,r,i),f=new Float64Array(h.length),m=function(e,t,i,r,n){const s=(0,x.gr)(e,t,r,n);if(!s)return(0,x.CN)(y(),t,n),null;const o=new Float64Array(s.length);return(0,v.a)(o,s,i),o}(h,t,u,f,a);if(!m)return null;const _=(0,o.Ge)(M,u),b=function(e,t,i,r,n,s,o){if(null==e)return null;const a=o??new Float32Array(e.length);return(0,x.X4)(e,t,i,r,n,a)?((0,v.b)(a,a,s),a):((0,x.CN)(y(),i,n),null)}(d,h,t,f,a,_,d!==e.normal?d:void 0);if(!b&&d)return null;const C=function(e,t,i,r,n,s,o){if(null==e)return null;const a=o??new Float32Array(e.length);return(0,x.xA)(e,t,i,r,n,a)?((0,v.b)(a,a,s,4),a):((0,x.CN)(y(),i,n),null)}(p,h,t,f,a,_,p!==e.tangent?p:void 0);return!C&&p?null:{position:m,normal:b,tangent:C}}(e,e.vertexSpace,t.origin,i):function({vertexAttributes:e,transform:t,spatialReference:i},{origin:r},n,s){const o=T(i,s,3),a=r||!A(o)?(0,l.C)(R,t?.localMatrix??c.zK):null;a&&C(a,i,s,3);const{position:h,normal:d,tangent:p}=a?w(e,a):e,g=s?.allowBufferReuse,f=g?h:new Float64Array(h.length);let m=h;if(r&&(m=(0,v.t)(f,m,r)),n){const e=(0,u.ze)(L,n);m=(0,v.t)(f,m,e)}return{position:m!==e.position||g?m:m.slice(),normal:d!==e.normal||g?d:d?.slice(),tangent:p!==e.tangent||g?p:p?.slice()}}(e,e.vertexSpace,t.origin,i)}}function S(e,t){return t?.useEllipsoid&&(0,d.B3)(e)?p.Y0:(0,p.lO)(e)}function w(e,t){const i=new Float64Array(e.position.length);(0,v.a)(i,e.position,t);const r=e.normal?new Float32Array(e.normal.length):null,n=e.tangent?new Float32Array(e.tangent.length):null;return r&&e.normal&&(0,x.qs)(e.normal,r,t),n&&e.tangent&&(0,x.KM)(e.tangent,n,t),{position:i,normal:r,tangent:n}}function C(e,t,i,r){const n=T(t,i,r);A(n)||(0,l.hs)(e,e,[n,n,n])}function T(e,t,i){const r=!!(1&i),n=!!(2&i),s=t?.sourceUnit,o=t?.targetUnit;if(!s&&!o)return 1;let a=E(s,e);r||!s||A(a)||(y().warn("source unit conversion not supported"),a=1);let l=1/E(o,e);return n||!o||A(l)||(y().warn("target unit conversion not supported"),l=1),a*l}function A(e){return(0,n.Io)(e,1)}function E(e,t){if(null==e)return 1;const i=(0,s.KX)(t);return 1/(0,s.oU)(i,"meters",e)}const R=(0,c.vt)(),O=(0,c.vt)(),M=(0,a.vt)(),L=(0,h.vt)(),P=(0,c.vt)()},27615(e,t,i){i.d(t,{CK:()=>l,Hq:()=>a,MW:()=>c,TE:()=>u,yJ:()=>h});var r=i(35522),n=i(86738),s=i(95696),o=i(18251);function a(e){return null!=e.origin}function l(e){return a(e.vertexSpace)}function c(e,t){if(!a(e))return null;const[i,r,s]=e.origin;return new n.A({x:i,y:r,z:s,spatialReference:t})}function u(e,t){const{x:i,y:r,z:n,spatialReference:a}=e,l=[i,r,n??0];return"local"===(t?.vertexSpace??function(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}(a))?new o.default({origin:l}):new s.A({origin:l})}function h(e,t){return e.type===t.type&&(e.origin===t.origin||null!=e.origin&&null!=t.origin&&(0,r.t2)(e.origin,t.origin))}},65801(e,t,i){i.d(t,{uM:()=>zr});var r=i(17676),n=i(9762),s=i(4197),o=i(58083),a=i(9093),l=i(51850);i(48353),(0,a.vt)(),new class{constructor(){this.verticalDistanceToGround=0,this.sampledElevation=0,this.z=0}},(0,l.vt)();var c=i(44208),u=i(53966),h=i(62788),d=i(95488),p=i(83349),g=i(15585),f=i(95108),m=i(97146),v=i(34727),x=i(86211),y=i(35522),_=i(27921);const b=(0,_.vt)();function S(e,t,i){if(!t)return 2;const r=e.map(e=>{const r=M(e,t);return r<3?2:function(e,t,i){const r=function(e,t,i,r){const n=(e=>!Array.isArray(e[0]))(t)?(e,i)=>t[3*e+i]:(e,i)=>t[e][i],s=(0,x.GA)(r)/(0,x.G9)(r);return(0,_.lU)(e,(e,t)=>(0,y.hZ)(e,n(t,0)*s,n(t,1)*s,n(t,2)),i)}(b,e,t,i)?(0,_.Qj)(b):[0,0,1];return Math.abs(r[2])>Math.cos((0,v.kU)(80))?2:Math.abs(r[1])>Math.abs(r[0])?1:0}(e,r,i)}),n=r[0];return r.every(e=>e===n)?n:2}function w(e,t,i){if(!t)return!(0,f.$3)(e);if(e.length<3)return!1;switch(i){case 0:return!(0,f.$3)(e,1,2);case 1:return!(0,f.$3)(e,0,2);case 2:return!(0,f.$3)(e,0,1)}}const C=new d.I;function T(e,t){if(!(0,g.O9)())return L("libtess-not-loaded");const i=null!=t.outlines,{positions:r,mergedPathLengths:n}=function(e){const t=function(e){const t=e.reduce((e,t)=>e+t.pathLengths.length,0),i=new Array(t);let r=0;for(let t=0;t<e.length;t++){const n=e[t].pathLengths;for(let e=0;e<n.length;e++)i[r++]=n[e]}return i}(e.polygons),i=3*e.polygonVertexCount;return i===e.positions.length?{positions:e.positions,mergedPathLengths:t}:{positions:(0,s.l5)(e.positions,0,i),mergedPathLengths:t}}(e),{vertices:o,indices:a,outlineIndices:l,outlineRingLengths:c}=(0,g.O5)(r,n,3,i);if(o.length%3!=0)return L("positions-not-multiple-of-3");const{positions:u,outlineIndexBuffer:h,mergedOutlineRingLengths:d}=i?function(e,t,i,r,n){const o=e.polygonVertexCount,a=t?.filter(e=>e.index>=o)??[];if(0===a.length)return{positions:i,outlineIndexBuffer:r,mergedOutlineRingLengths:n};const l=3*o,c=(0,s.l5)(e.positions,l,e.positions.length-l),u=(0,s.yH)(i,c),h=i.length/3,d=a.map(e=>({index:h+e.index-o,count:e.count})),{outlineIndexBuffer:p,outlineRingLengths:g}=E(d,u);return{positions:u,outlineIndexBuffer:(0,m.lC)(r,p,u.length/3),mergedOutlineRingLengths:(0,m.lC)(n,g,n.length+g.length)}}(e,t.outlines,o,l,c):{positions:o,outlineIndexBuffer:void 0,mergedOutlineRingLengths:void 0};return{succeeded:!0,positions:u,indices:a,outlineIndexBuffer:h,outlineRingLengths:d,vertexCount:u.length/3,method:"libtess"}}function A(e,t,i){for(let r=0;r<e.length;r+=3){const n=e[r+t];e[r+t]=e[r+i],e[r+i]=n}}function E(e,t){const i=(0,m.my)(e.length);let r=0;for(let n=0;n<e.length;n++){const s=e[n],o=s.count;if(o<=0){i[n]=0;continue}const a=3*s.index,l=3*(s.index+o-1),c=o>1&&t[a]===t[l]&&t[a+1]===t[l+1]&&t[a+2]===t[l+2]?o-1:o,u=c>0?c+1:0;i[n]=u,r+=u}const n=(0,m.my)(r,t.length/3);let s=0;for(let t=0;t<e.length;t++){const r=i[t];if(0===r)continue;const o=e[t].index,a=r-1;for(let e=0;e<a;e++)n[s++]=o+e;n[s++]=o}return{outlineIndexBuffer:n,outlineRingLengths:i}}function R(e,{index:t,count:i}){return(0,s.l5)(e,3*t,3*i)}function O(e,t,i,r,n,s){let o=s?e.length-1:0;const a=s?-1:1;i*=3;for(let s=0;s<r;++s){const r=e[o];t[i++]=r[0],t[i++]=r[1],t[i++]=n&&null!=r[2]?r[2]:0,o+=a}return i/3}function M(e,t){return function(e,t){const i=e.length;if(i<2)return!1;const r=e[0],n=e[i-1];return r[0]===n[0]&&r[1]===n[1]&&(!t||r[2]===n[2])}(e,t)?e.length-1:e.length}function L(e){return{succeeded:!1,message:e}}var P=i(5482),I=i(4576),D=i(65529),F=i(91869),N=i(97768),z=i(15142),H=i(36708),V=i(3483),W=i(91429),j=i(26857),U=i(78955),B=i(19419);class ${constructor(e,t){this.vec3=e,this.id=t}}function Z(e,t,i,r){return new $((0,l.fA)(e,t,i),r)}class k{constructor(){this._extent=(0,B.vt)(),this.resolution=0,this.renderLocalOrigin=Z(0,0,0,"O"),this.pixelRatio=1,this.mapUnitsPerPixel=1,this.canvasGeometries=new G}get extent(){return this._extent}setExtent(e){(0,U.C)(this._extent,e)}setupGeometryViews(e){if(this._setupGeometryView(),!e)return;const t=.001*e.range;if(this._extent[0]-t<=e.min){const t=this.canvasGeometries.extents[this.canvasGeometries.numViews++];(0,B.cY)(this._extent,e.range,0,t)}if(this._extent[2]+t>=e.max){const t=this.canvasGeometries.extents[this.canvasGeometries.numViews++];(0,B.cY)(this._extent,-e.range,0,t)}}_setupGeometryView(){this.canvasGeometries.numViews=1,(0,B.C)(this.canvasGeometries.extents[0],this._extent)}hasSomeSizedView(){for(let e=0;e<this.canvasGeometries.numViews;e++){const t=this.canvasGeometries.extents[e];if(t[0]!==t[2]&&t[1]!==t[3])return!0}return!1}}class G{constructor(){this.extents=[(0,B.vt)(),(0,B.vt)(),(0,B.vt)()],this.numViews=0}}class q{constructor(e,t,i){this._fbos=e,this._format=t,this._name=i}get valid(){return null!=this._handle?.getTexture()}dispose(){this._handle=(0,N.Gz)(this._handle)}get texture(){return this._handle?.getTexture()}ensureFramebuffer(e,t){this._handle&&this._handle.fbo?.width===e&&this._handle.fbo?.height===t||(this._handle?.release(),this._handle=this._fbos.acquire(e,t,this._name,this._format))}bind(e){e.bindFramebuffer(this._handle?.fbo)}generateMipMap(){this._handle?.getTexture()?.descriptor?.hasMipmap&&this._handle?.getTexture()?.generateMipmap()}}var Y=i(16943);class Q{constructor(e,t,i,r,n=1,s=6){this.output=i,this.content=r,this.redrawOnRequest=n,this.fbo=new q(e,s,t)}handleRenderRequest(e){return 1===e||e===this.redrawOnRequest}get valid(){return this.fbo.valid}}class X{constructor(e){const t=[new Q(e,"overlay color",0,0),new Q(e,"overlay IM color",0,1),new Q(e,"overlay highlight",10,2,1,3),new Q(e,"overlay water",4,3,0),new Q(e,"overlay occluded",0,4)];(0,Y.E)()&&t.push(new Q(e,"overlay olid",11,5,1,5)),this.targets=t}getTexture(e){return this.targets[e]?.fbo.texture}dispose(e){if(0!==e)for(const e of this.targets)e.fbo.dispose();else this.targets[3].fbo.dispose()}computeValidity(){return this.targets.reduce((e,t,i)=>t.valid?e|=1<<i:e,0)}}var K=i(91712),J=i(69622);class ee extends J.A{precompile(e){return!!this.acquireTechniques(e)}get usedMemory(){return 0}get renderOccludedFlags(){return 1}get testsTransparentRenderOrder(){return 0}get isDecoration(){return!1}get readyToRun(){return!1}get numGeometries(){return 0}get hasOccludees(){return!1}get emissions(){return 0}forEachGeometry(e){}}class te extends ee{}var ie=i(37585),re=i(2016),ne=i(78607),se=i(13840),oe=i(98958),ae=i(72091),le=i(41976),ce=i(90644);let ue=class extends oe.w{constructor(e,t){super(e,t,le.wR),this.shader=new se.r(ae.H,()=>i.e(785).then(i.bind(i,13166)))}initializePipeline(){return(0,ce.Ey)({blending:ce.T8,colorWrite:ce.kn})}};ue=(0,P.Cg)([(0,W.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightApplyTechnique")],ue);var he=i(28476);let de=class extends oe.w{constructor(e,t){super(e,t,le.wR),this.shader=new se.r(he.a,()=>i.e(6027).then(i.bind(i,76027)))}initializePipeline(){return(0,ce.Ey)({colorWrite:ce.kn})}};de=(0,P.Cg)([(0,W.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightBlurTechnique")],de);var pe=i(34053);let ge=class extends oe.w{constructor(){super(...arguments),this.shader=new se.r(pe.a,()=>i.e(9438).then(i.bind(i,29438)))}initializePipeline(){return(0,ce.Ey)({colorWrite:ce.kn})}};ge=(0,P.Cg)([(0,W.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightDownsampleTechnique")],ge);var fe=i(68197);new fe.A("cyan"),new fe.A("black"),new fe.A("yellow");var me=i(65786);class ve extends me.Y{constructor(){super(...arguments),this.occludedFactor=.25,this.verticalCellCount=0,this.horizontalCellCount=0,this.highlightLevel=0,this.pixelRatio=1}}var xe=i(16824);let ye=class extends oe.w{constructor(e,t){super(e,t,le.wR),this.shader=new se.r(xe.H,()=>i.e(1011).then(i.bind(i,51011)))}initializePipeline(){return(0,ce.Ey)({colorWrite:ce.kn})}};ye=(0,P.Cg)([(0,W.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightToSingleTechnique")],ye);var _e=i(79785);class be extends _e.Z{}var Se=i(48852),we=i(63907),Ce=i(21231),Te=i(67171),Ae=i(66289);let Ee=class extends ne.A{constructor(){super(...arguments),this.produces=re.OG.HIGHLIGHT_COLOR,this.consumes={required:[re.OG.HIGHLIGHT_COLOR,"highlights"]},this._downsampleDrawParameters=new pe.H,this._passParameters=new ve,this._highlightBlurDrawParameters=new he.H,this._grid=new Re}initialize(){this.addHandles([(0,H.wB)(()=>this._updateOptionsTexture(),()=>{},H.Vh)])}destroy(){this._grid.coverage=(0,N.Gz)(this._grid.coverage),this._grid.vao=(0,N.WD)(this._grid.vao),this._passParameters.highlightOptionsTexture=(0,N.Gz)(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new Te.R(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new Ce.A(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(function(e){const t=new Uint8Array(128);let i=0;for(const r of e){const e=4*i,n=4*i+64;++i;const{color:s}=r,o=r.haloColor??s;t[e+0]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=r.fillOpacity*s.a*255,t[n+0]=o.r,t[n+1]=o.g,t[n+2]=o.b,t[n+3]=r.haloOpacity*o.a*255}return t}(this.view.state.highlights)),this.requestRender(1)}render(e){const t=e.find(({name:e})=>e===re.OG.HIGHLIGHT_COLOR),{techniques:i,bindParameters:r,fboCache:n,_passParameters:s,renderingContext:o}=this;if(!r.decorations)return t;const a=i.getCompiled(ge),l=i.getCompiled(ye),c=i.getCompiled(de),u=i.getCompiled(ue);if(!(a&&u&&c&&l))return this.requestRender(1),t;const h=e.find(({name:e})=>"highlights"===e).getTexture();s.highlightTexture=h;const d=this._prepareAndDownSample(h),{width:p,height:g}=h.descriptor;s.highlightTexture=h;const{camera:f}=r,{fullWidth:m,fullHeight:v,pixelRatio:x,fullViewport:y}=f,_=Math.ceil(m/x),b=Math.ceil(v/x),{_highlightBlurDrawParameters:S}=this,w=this.view.stage.renderView.renderer,{highlights:C}=r;for(let e=0;e<C.length;++e){const{name:i}=C[e];if(!w.hasHighlight(i))continue;s.highlightLevel=e,o.setClearColor(0,0,0,0);const a=n.acquire(p,g,"single highlight",2);o.bindFramebuffer(a.fbo),o.setViewport(0,0,p,g),o.clear(16384),o.bindTechnique(l,r,s),this._renderGrid(d),S.blurInput=a.getTexture(),(0,ie.hZ)(S.blurSize,1/_,0);const h=n.acquire(_,b,"single highlight blur",2);o.unbindTexture(h.fbo?.colorTexture),o.bindFramebuffer(h.fbo),o.setViewport(0,0,_,b),o.clear(16384),o.bindTechnique(c,r,s,S),this._renderGrid(d),a.release(),(0,ie.hZ)(S.blurSize,0,1/b),s.highlightBlurTexture=h.getTexture(),o.bindFramebuffer(t.fbo),o.setDrawBuffers([we.r6]),o.setViewport4fv(y),o.bindTechnique(u,r,s,S),this._renderGrid(d),h.release()}return s.coverageTexture=s.highlightTexture=null,t}_prepareAndDownSample(e){this._gridUpdateResources(e);const t=this.techniques.get(ge),i=this._gridComputeCoverage(t,e),{horizontalCellCount:r,verticalCellCount:n}=i,s=this._passParameters;return s.horizontalCellCount=r,s.verticalCellCount=n,s.coverageTexture=i.coverage?.getTexture(),i}_renderGrid(e){const t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(we.WR.TRIANGLES,6,we.pe.UNSIGNED_BYTE,0,t)}_gridUpdateResources(e){const t=this._grid,{width:i,height:r}=e.descriptor;if(t.horizontalCellCount=Math.ceil(i/pe.g),t.verticalCellCount=Math.ceil(r/pe.g),t.vao)return;const n=this.renderingContext,s=Se.g.createIndex(n,35044,Me);t.vao=new be(n,new Ae.R(n,le.wR),s)}_gridComputeCoverage(e,t){const i=this.renderingContext,r=this._grid,n=t.descriptor,s=Math.ceil(n.width/pe.g),o=Math.ceil(n.height/pe.g);this._downsampleDrawParameters.input=t;const{highlights:a}=this.bindParameters;r.coverage?.release();const l=this.fboCache.acquire(s,o,"highlight coverage",a.length>Le?3:1);return r.coverage=l,i.bindFramebuffer(l.fbo),i.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),i.setViewport(0,0,s,o),i.screen.draw(),r}get test(){}};(0,P.Cg)([(0,W.MZ)()],Ee.prototype,"produces",void 0),(0,P.Cg)([(0,W.MZ)()],Ee.prototype,"consumes",void 0),Ee=(0,P.Cg)([(0,W.$K)("esri.views.3d.webgl-engine.effects.highlight.Highlight")],Ee);class Re{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}let Oe=0;const Me=new Uint8Array([0,1,2,2,1,3]),Le=4;class Pe{constructor(e,t,i){this.material=e,this.techniques=t,this.textures=i}}var Ie=i(620);class De{constructor(e,t,i,r){this._textures=e,this._techniques=t,this.materialChanged=i,this.requestRender=r,this._id2glMaterialRef=new Map}dispose(){this._textures.destroy()}acquire(e,t,i){this._ownMaterial(e);const r=e.produces.get(t);if(!r?.(i))return null;let n=this._id2glMaterialRef.get(e.id);if(null==n){const t=e.createGLMaterial(new Pe(e,this._techniques,this._textures));n=new Fe(t),this._id2glMaterialRef.set(e.id,n)}return n.ref(),n.glMaterial}release(e){const t=this._id2glMaterialRef.get(e.id);null!=t&&(t.unref(),t.referenced||((0,N.WD)(t.glMaterial),this._id2glMaterialRef.delete(e.id)))}_ownMaterial(e){e.repository&&e.repository!==this&&u.A.getLogger("esri.views.3d.webgl-engine.lib.GLMaterialRepository").error("Material is already owned by a different material repository"),e.repository=this}}class Fe{constructor(e){this.glMaterial=e,this._refCnt=0}ref(){++this._refCnt}unref(){--this._refCnt,(0,Ie.vA)(this._refCnt>=0)}get referenced(){return this._refCnt>0}}var Ne=i(24326),ze=i(91829),He=i(46610),Ve=i(16613),We=i(94008),je=i(32728),Ue=i(17478);function Be(e,t){return null==e&&(e=[]),e.push(t),e}function $e(e,t){if(null==e)return null;const i=e.filter(e=>e!==t);return 0===i.length?null:i}i(28449),(0,l.vt)(),new Float32Array(6);class Ze{constructor(e={}){this.id=(0,Ne.c)(),this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=e.castShadow??!0,this.usesVerticalDistanceToGround=e.usesVerticalDistanceToGround??!1,this.graphicUid=e.graphicUid,this.layerViewUid=e.layerViewUid,e.isElevationSource&&(this.lastValidElevationBB=new ke),this._geometries=e.geometries?Array.from(e.geometries):[]}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(e){(0,Ie.vA)(null==this._layer||null==e,"Object3D can only be added to a single Layer"),this._layer=e}addGeometry(e){e.visible=this._visible,this._geometries.push(e);for(const t of this._highlightIds)e.addHighlight(t);this._emit("geometryAdded",{object:this,geometry:e}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(e){const t=this._geometries.splice(e,1)[0];if(t){for(const e of this._highlightIds)t.removeHighlight(e);this._emit("geometryRemoved",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(e,t,i=!1){this._emit("attributesChanged",{object:this,geometry:e,attribute:t,sync:i}),function(e){return"position"===e}(t)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(e){if(this._visible!==e){this._visible=e;for(const e of this._geometries)e.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const e=new Ue.p;for(const t of this._geometries)t.occludees=Be(t.occludees,e);return this._emit("occlusionChanged",this),e}removeOcclude(e){for(const t of this._geometries)t.occludees=$e(t.occludees,e);this._emit("occlusionChanged",this)}highlight(e){const t=new Ue.h(e);for(const e of this._geometries)e.addHighlight(t);return this._emit("highlightChanged",this),this._highlightIds.add(t),t}removeHighlight(e){this._highlightIds.delete(e);for(const t of this._geometries)t.removeHighlight(e);this._emit("highlightChanged",this)}removeStateID(e){0===e.channel?this.removeHighlight(e):this.removeOcclude(e)}getCombinedStaticTransformation(e,t){return(0,o.lw)(t,this.transformation,e.transformation)}getCombinedShaderTransformation(e,t=(0,a.vt)()){return(0,o.lw)(t,this.effectiveTransformation,e.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=new Ge,this._validateBoundingVolume(this._bvWorldSpace,0)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=new Ge,this._validateBoundingVolume(this._bvObjectSpace,1)),this._bvObjectSpace}_validateBoundingVolume(e,t){const i=1===t;for(const t of this._geometries){const r=t.boundingInfo;r&&qe(r,e,i?t.transformation:this.getCombinedShaderTransformation(t))}(0,y.Cc)(e.bounds.center,e.min,e.max,.5);for(const t of this._geometries){const r=t.boundingInfo;if(null==r)continue;const n=i?t.transformation:this.getCombinedShaderTransformation(t),s=(0,je.hG)(n);(0,y.Z0)(Ke,r.center,n);const o=(0,y.Io)(Ke,e.bounds.center),a=r.radius*s;e.bounds.radius=Math.max(e.bounds.radius,o+a)}}_invalidateBoundingVolume(){const e=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this.layer&&e&&this.layer.notifyObjectBBChanged(this,e)}_emit(e,t){this.layer?.events.emit(e,t)}get geometries(){return this._geometries}get transformation(){return this._transformation??a.zK}set transformation(e){this._transformation=(0,o.C)(this._transformation??(0,a.vt)(),e),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(e){this._shaderTransformation=e?(0,o.C)(this._shaderTransformation??(0,a.vt)(),e):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}get test(){}}class ke{constructor(){this._data=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]}get min(){return(0,l.fA)(this._data[0],this._data[1],this._data[2])}get max(){return(0,l.fA)(this._data[3],this._data[4],this._data[5])}minWith(e){const{_data:t}=this;t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2])}maxWith(e){const{_data:t}=this;t[3]=Math.max(t[3],e[0]),t[4]=Math.max(t[4],e[1]),t[5]=Math.max(t[5],e[2])}assignMinMax(e,t){for(let i=0;i<3;++i)this._data[0+i]=e[i],this._data[3+i]=t[i]}isEmpty(){return this._data[3]<this._data[0]&&this._data[4]<this._data[1]&&this._data[5]<this._data[2]}}class Ge extends ke{constructor(){super(...arguments),this.bounds=new We.iy}}function qe(e,t,i){const r=e.bbMin,n=e.bbMax;if((0,o.tZ)(i)){const e=(0,y.hZ)(Ye,i[12],i[13],i[14]);return(0,y.WQ)(Qe,r,e),(0,y.WQ)(Xe,n,e),t.minWith(Qe),void t.maxWith(Xe)}if((0,y.Z0)(Qe,r,i),(0,y.t2)(r,n))return t.minWith(Qe),void t.maxWith(Qe);(0,y.Z0)(Xe,n,i),t.minWith(Qe),t.minWith(Xe),t.maxWith(Qe),t.maxWith(Xe);for(let e=0;e<3;++e)(0,y.C)(Qe,r),(0,y.C)(Xe,n),Qe[e]=n[e],Xe[e]=r[e],(0,y.Z0)(Qe,Qe,i),(0,y.Z0)(Xe,Xe,i),t.minWith(Qe),t.minWith(Xe),t.maxWith(Qe),t.maxWith(Xe)}const Ye=(0,l.vt)(),Qe=(0,l.vt)(),Xe=(0,l.vt)(),Ke=(0,l.vt)();var Je=i(21818),et=i(71511);const tt=["layerObjectAdded","layerObjectRemoved","layerObjectsAdded","layerObjectsRemoved","transformationChanged","shaderTransformationChanged","visibilityChanged","occlusionChanged","highlightChanged","geometryAdded","geometryRemoved","attributesChanged"];var it=i(78230);class rt{constructor(e,t,i=""){this.stage=e,this.apiLayerViewUid=i,this.id=(0,Ne.c)(),this.events=new D.bk,this.visible=!0,this.sliceable=!1,this._objectsAdded=new Array,this._handles=new et.A,this._objects=new Map,this._pickable=!0,this.visible=t?.visible??!0,this._pickable=t?.pickable??!0,this.updatePolicy=t?.updatePolicy??0,e.addLayer(this);for(const t of tt)this._handles.add(this.events.on(t,i=>e.handleEvent(t,i)))}destroy(){this._handles.size&&(this._handles.destroy(),this.stage.removeLayer(this),this.invalidateSpatialQueryAccelerator())}get objects(){return this._objects}getObject(e){return(0,Je.z)(this._objects.get(e))}set pickable(e){this._pickable=e}get pickable(){return this._pickable&&this.visible}add(e){this._objects.set(e.id,e),e.layer=this,this.events.emit("layerObjectAdded",e),null!=this._octree&&this._objectsAdded.push(e)}remove(e){this._objects.delete(e.id)&&(this.events.emit("layerObjectRemoved",e),e.layer=null,null!=this._octree&&((0,I.Xy)(this._objectsAdded,e)||this._octree.remove([e])))}addMany(e){for(const t of e)this._objects.set(t.id,t),t.layer=this;this.events.emit("layerObjectsAdded",e),null!=this._octree&&this._objectsAdded.push(...e)}removeMany(e){const t=new Array;for(const i of e)this._objects.delete(i.id)&&t.push(i);if(0!==t.length&&(this.events.emit("layerObjectsRemoved",t),t.forEach(e=>e.layer=null),null!=this._octree)){for(let e=0;e<t.length;)(0,I.Xy)(this._objectsAdded,t[e])?(t[e]=t[t.length-1],t.length-=1):++e;this._octree.remove(t)}}commit(){this.stage.commitLayer(this)}sync(){1!==this.updatePolicy&&this.stage.syncLayer(this.id)}notifyObjectBBChanged(e,t){null==this._octree||this._objectsAdded.includes(e)||this._octree.update(e,t)}getSpatialQueryAccelerator(){return null==this._octree&&this._objects.size>50?(this._octree=new it.x(e=>e.boundingVolumeWorldSpace.bounds),this._octree.add(this._objects.values())):null!=this._octree&&this._objectsAdded.length>0&&(this._octree.add(this._objectsAdded),this._objectsAdded.length=0),this._octree}invalidateSpatialQueryAccelerator(){this._octree=(0,N.pR)(this._octree),this._objectsAdded.length=0}get test(){}}var nt=i(90629),st=i(78659),ot=i(20498),at=i(11964),lt=i(13030),ct=i(49255),ut=i(92130),ht=i(11725),dt=i(77194),pt=i(96095),gt=i(35622),ft=i(59907),mt=i(32565),vt=i(7298),xt=i(4431),yt=i(33524),_t=i(56133),bt=i(33442);let St=class extends oe.w{constructor(e,t){super(e,t,(0,xt.U)((0,vt.bP)(t))),this.shader=new se.r(mt.R,()=>i.e(2059).then(i.bind(i,92059))),this.ignoreUnused=!0,this.primitiveType=t.wireframe?we.WR.LINES:we.WR.TRIANGLE_STRIP}_makePipelineState(e,t){const{output:i,hasOccludees:r}=e;return(0,ce.Ey)({blending:(0,yt.Yf)(i,!1,e.emissionDimmingPass),depthTest:(0,yt.mt)(i),depthWrite:(0,yt.z5)(e),colorWrite:ce.kn,stencilWrite:r?_t.v0:null,stencilTest:r?t?_t.Ax:_t.cP:null,polygonOffset:(0,bt.Tk)(e)})}initializePipeline(e){if(e.occluder){const{hasOccludees:t}=e;this._occluderPipelineTransparent=(0,ce.Ey)({blending:ce.T8,polygonOffset:(0,bt.Tk)(e),depthTest:_t.sf,depthWrite:null,colorWrite:ce.kn,stencilWrite:null,stencilTest:t?_t.Q0:null}),this._occluderPipelineOpaque=(0,ce.Ey)({blending:ce.T8,polygonOffset:(0,bt.Tk)(e),depthTest:t?_t.sf:_t.m,depthWrite:null,colorWrite:ce.kn,stencilWrite:t?_t.r8:null,stencilTest:t?_t.iB:null}),this._occluderPipelineMaskWrite=(0,ce.Ey)({blending:null,polygonOffset:(0,bt.Tk)(e),depthTest:_t.m,depthWrite:null,colorWrite:null,stencilWrite:t?_t.v0:null,stencilTest:t?_t.Ax:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t,i){if(i)return this._occludeePipeline;switch(e.occluder){case 11:return this._occluderPipelineTransparent??super.getPipeline(e,t,i);case 10:return this._occluderPipelineOpaque??super.getPipeline(e,t,i);default:e.occluder;case void 0:case null:return this._occluderPipelineMaskWrite??super.getPipeline(e,t,i)}}};St=(0,P.Cg)([(0,W.$K)("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],St);var wt=i(51976),Ct=i(47724);class Tt extends Ct.L{constructor(e){super(),this.spherical=e,this.capType=0,this.emissionSource=0,this.animation=2,this.polygonOffsetIndex=0,this.writeDepth=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stipplePreferContinuous=!0,this.numJoinSubdivisions=1,this.roundJoins=!1,this.applyMarkerOffset=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.hasOccludees=!1,this.occluder=!1,this.wireframe=!1,this.hasScreenSizePerspective=!1,this.worldSizedImagePattern=!1,this.textureCoordinateType=0,this.hasVVInstancing=!1,this.hasSliceTranslatedView=!0,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1}get hasAnimation(){return 0!==this.animation}}(0,P.Cg)([(0,wt.W)({count:3})],Tt.prototype,"capType",void 0),(0,P.Cg)([(0,wt.W)({count:8})],Tt.prototype,"emissionSource",void 0),(0,P.Cg)([(0,wt.W)({count:4})],Tt.prototype,"animation",void 0),(0,P.Cg)([(0,wt.W)({count:16})],Tt.prototype,"polygonOffsetIndex",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"writeDepth",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"draped",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"stippleEnabled",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"stippleOffColorEnabled",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"stipplePreferContinuous",void 0),(0,P.Cg)([(0,wt.W)({count:8})],Tt.prototype,"numJoinSubdivisions",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"roundJoins",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"applyMarkerOffset",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"hasVVSize",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"hasVVColor",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"hasVVOpacity",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"falloffEnabled",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"innerColorEnabled",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"hasOccludees",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"occluder",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"wireframe",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"hasScreenSizePerspective",void 0),(0,P.Cg)([(0,wt.W)()],Tt.prototype,"worldSizedImagePattern",void 0);var At=i(49788);class Et extends ht.i{constructor(e,t){super(e,Ot),this.produces=new Map([[2,e=>(0,ct.Ex)(e)||(0,ct._o)(e)&&8===this.parameters.renderOccluded],[3,e=>(0,ct.eh)(e)],[10,e=>(0,ct.gr)(e)&&8===this.parameters.renderOccluded],[11,e=>(0,ct.gr)(e)&&8===this.parameters.renderOccluded],[4,e=>(0,ct._o)(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>(0,ct._o)(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>(0,ct.i3)(e)]]),this._configuration=new Tt(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=It(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&function(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSizedImagePattern=r}get visible(){return this.parameters.color[3]>=At.Q||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>At.Q}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectDraped({attributes:e,screenToWorldRatio:t},i,r,n,s){if(!i.options.selectionMode)return;const o=e.get("size");let a=this.parameters.width;if(this.parameters.vvSize){const t=e.get("sizeFeatureAttribute").data[0];Number.isNaN(t)?a*=this.parameters.vvSize.fallback[0]:a*=(0,v.qE)(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(a*=o.data[0]);const l=r[0],c=r[1],u=(a/2+4)*t;let h=Number.MAX_VALUE,d=0;const p=e.get("position").data,g=Pt(this.parameters,e)?p.length-2:p.length-5;for(let e=0;e<g;e+=3){const t=p[e],i=p[e+1],r=(e+3)%p.length,n=l-t,s=c-i,o=p[r]-t,a=p[r+1]-i,u=(0,v.qE)((o*n+a*s)/(o*o+a*a),0,1),g=o*u-n,f=a*u-s,m=g*g+f*f;m<h&&(h=m,d=e/3)}h<u*u&&n(s.distance,s.normal,d)}intersect(e,t,i,r,n,s){const{options:o,camera:a,rayBegin:l,rayEnd:c}=i;if(!o.selectionMode||!e.visible||!a)return;if(!(0,Ie.zH)(t))return void u.A.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const h=e.attributes,d=h.get("position").data;let p=this.parameters.width;if(this.parameters.vvSize){const e=h.get("sizeFeatureAttribute").data[0];Number.isNaN(e)||(p*=(0,v.qE)(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else h.has("size")&&(p*=h.get("size").data[0]);const g=Ut;(0,ie.C)(g,i.point);const f=p*a.pixelRatio,m=4*a.pixelRatio,x=f/2+m;(0,y.hZ)(Jt[0],g[0]-x,g[1]+x,0),(0,y.hZ)(Jt[1],g[0]+x,g[1]+x,0),(0,y.hZ)(Jt[2],g[0]+x,g[1]-x,0),(0,y.hZ)(Jt[3],g[0]-x,g[1]-x,0);for(let e=0;e<4;e++)if(!a.unprojectFromRenderScreen(Jt[e],ei[e]))return;(0,_.Cr)(a.eye,ei[0],ei[1],ti),(0,_.Cr)(a.eye,ei[1],ei[2],ii),(0,_.Cr)(a.eye,ei[2],ei[3],ri),(0,_.Cr)(a.eye,ei[3],ei[0],ni);let b=Number.MAX_VALUE,S=0;const w=Pt(this.parameters,h)?d.length-2:d.length-5;for(let e=0;e<w;e+=3){Ft[0]=d[e]+t[12],Ft[1]=d[e+1]+t[13],Ft[2]=d[e+2]+t[14];const i=(e+3)%d.length;if(Nt[0]=d[i]+t[12],Nt[1]=d[i+1]+t[13],Nt[2]=d[i+2]+t[14],(0,_.mN)(ti,Ft)<0&&(0,_.mN)(ti,Nt)<0||(0,_.mN)(ii,Ft)<0&&(0,_.mN)(ii,Nt)<0||(0,_.mN)(ri,Ft)<0&&(0,_.mN)(ri,Nt)<0||(0,_.mN)(ni,Ft)<0&&(0,_.mN)(ni,Nt)<0)continue;const r=a.projectToRenderScreen(Ft,Bt),n=a.projectToRenderScreen(Nt,$t);if(null==r||null==n)continue;if(r[2]<0&&n[2]>0){(0,y.Re)(Wt,Ft,Nt);const e=a.frustum,t=-(0,_.mN)(e[4],Ft)/(0,y.Om)(Wt,(0,_.Qj)(e[4]));if((0,y.hs)(Wt,Wt,t),(0,y.WQ)(Ft,Ft,Wt),!a.projectToRenderScreen(Ft,r))continue}else if(r[2]>0&&n[2]<0){(0,y.Re)(Wt,Nt,Ft);const e=a.frustum,t=-(0,_.mN)(e[4],Nt)/(0,y.Om)(Wt,(0,_.Qj)(e[4]));if((0,y.hs)(Wt,Wt,t),(0,y.WQ)(Nt,Nt,Wt),!a.projectToRenderScreen(Nt,n))continue}else if(r[2]<0&&n[2]<0)continue;r[2]=0,n[2]=0;const s=(0,at.Cr)(r,n,Gt),o=(0,at.kb)(s,g);if(!(o>=b)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(s,Ft,Nt,g,a,p,m);if(o>=e*e)continue}b=o,(0,y.C)(Zt,Ft),(0,y.C)(kt,Nt),S=e/3}}if(b<x*x){let e=Number.MAX_VALUE;if((0,at.ld)((0,at.Cr)(Zt,kt,Gt),(0,at.Cr)(l,c,qt),jt)){(0,y.Re)(jt,jt,l);const t=(0,y.Bw)(jt);(0,y.hs)(jt,jt,1/t),e=t/(0,y.Io)(l,c)}s(e,jt,S)}}createBufferWriter(){return new Mt((0,vt.bP)(this.parameters),(0,vt.qB)(this.parameters),this.parameters)}createGLMaterial(e){return new Rt(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:(0,st.y)(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,n,s,o){const a=(0,at.G1)(e,r);(0,y.Cc)(zt,t,i,a),(0,y.Z0)(Ht,zt,n.viewMatrix);const l=(0,y.Bw)(Ht),c=this.computeCameraAbsCosAngle(zt,n,this._configuration.spherical);return Dt.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Dt.apply(s)*n.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,i){return i?(0,y.S8)(jt,e):(0,y.hZ)(jt,0,0,1),(0,y.Re)(Vt,e,t.eye),(0,y.S8)(Vt,Vt),Math.abs((0,y.Om)(jt,Vt))}}class Rt extends ut.A{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(St,e)}}class Ot extends gt.S{constructor(){super(...arguments),this._width=0,this.color=ze.Un,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=(0,st.Kp)(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=(0,st.Kp)(0),this.endTime=(0,st.Kp)(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return(0,pt.sL)(this.stipplePattern)&&null!=this.stippleTexture}}class Mt{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=It(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return Pt(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3}elementCount(e){const t=e.get("position").indices.length/2+1,i=this._isClosed(e);let r=i?2:4;return r+=((i?t:t-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),r+=2,this._parameters.wireframe&&(r=2+4*(r-2)),r}write(e,t,i,r,n,s){const{buffer:o,offset:a}=n,{layout:l,textureBufferLayout:c}=this,u=i.get("position"),h=u.indices,d=u.data.length/3,p=d,g=i.get("distanceToStart")?.data;h&&h.length!==2*(d-1)&&console.warn("RibbonLineMaterial does not support indices");const f=o.getField("textureElementIndex",lt.P);(0,Ie.vA)(null!=f,"Missing texture buffer index field"),(0,Ie.vA)(null!==s,"Expected texture buffer target"),(0,Ie.vA)(null!==c,"Expected valid textureBufferLayout");const{textureBufferRange:m,offset:v}=s;(0,Ie.vA)(null!=m,"Using a texture layout, but the texture range for this instance was not provided");const x=m.from;(0,Ie.vA)(m.numElements===p,"Expected number of elements in TextureBuffer to equal number of points");const{buffer:_}=s,b=_.getField("position",lt.xs);(0,Ie.vA)(null!==b,"Expected valid position field in texture buffer");const S=l.fields.has("sizeFeatureAttribute");let w=1,C=null;if(S){const e=i.get("sizeFeatureAttribute");1===e.data.length?w=e.data[0]:C=e.data}else w=i.get("size")?.data[0]??1;let T=[1,1,1,1],A=0,E=null;const R=l.fields.has("colorFeatureAttribute");if(R){const e=i.get("colorFeatureAttribute");1===e.data.length?A=e.data[0]:E=e.data}else T=i.get("color")?.data??T;const O=i.get("timeStamps")?.data,M=O&&l.fields.has("timeStamps"),L=l.fields.has("opacityFeatureAttribute");let P=0,I=null;if(L){const e=i.get("opacityFeatureAttribute");1===e.data.length?P=e.data[0]:I=e.data}const D=new Float32Array(o.buffer),F=(0,ot.Bg)(o.buffer),N=new Uint8Array(o.buffer),z=new Uint32Array(o.buffer),H=l.stride/4;let V=a*H;const W=V;let j=0;const B=g?(e,t,i)=>j=g[i]:(e,t,i)=>j+=(0,y.Io)(e,t),$=D.BYTES_PER_ELEMENT/F.BYTES_PER_ELEMENT,Z=4/$,k=(0,Y.E)(),G=(e,t,i,n,s,o,a,l)=>{const c=a;z[V]=x+c,V++,b.setVec(v+c,t),(0,ft.Wu)(e,t,F,V*$),V+=Z,(0,ft.Wu)(i,t,F,V*$),V+=Z,D[V++]=l;let u=V*$;if(F[u++]=s,F[u++]=o,V=Math.ceil(u/$),R)D[V]=E?.[a]??A;else{const e=Math.min(4*a,T.length-4),t=4*V;N[t]=255*T[e],N[t+1]=255*T[e+1],N[t+2]=255*T[e+2],N[t+3]=255*T[e+3]}if(V++,D[V++]=C?.[a]??w,L&&(D[V++]=I?.[a]??P),k){let e=4*V;r?(N[e++]=r[0],N[e++]=r[1],N[e++]=r[2],N[e++]=r[3]):(N[e++]=0,N[e++]=0,N[e++]=0,N[e++]=0),V=Math.ceil(.25*e)}M&&(u=V*$,F[u++]=n[0],F[u++]=n[1],F[u++]=n[2],F[u++]=n[3],V=Math.ceil(u/$))};V+=H,(0,y.hZ)(Qt,u.data[0],u.data[1],u.data[2]),M&&(0,U.hZ)(Kt,O[0],O[1],O[2],O[3]),e&&(0,y.Z0)(Qt,Qt,e);const q=this._isClosed(i);if(q){const t=u.data.length-3;(0,y.hZ)(Yt,u.data[t],u.data[t+1],u.data[t+2]),e&&(0,y.Z0)(Yt,Yt,e)}else(0,y.hZ)(Xt,u.data[3],u.data[4],u.data[5]),e&&(0,y.Z0)(Xt,Xt,e),G(Qt,Qt,Xt,Kt,1,-4,0,0),G(Qt,Qt,Xt,Kt,1,4,0,0),(0,y.C)(Yt,Qt),(0,y.C)(Qt,Xt),M&&(0,U.hZ)(Kt,O[4],O[5],O[6],O[7]);const Q=q?0:1,X=q?d:d-1;for(let t=Q;t<X;t++){const i=(t+1)%d*3;(0,y.hZ)(Xt,u.data[i],u.data[i+1],u.data[i+2]),e&&(0,y.Z0)(Xt,Xt,e),B(Yt,Qt,t),G(Yt,Qt,Xt,Kt,0,-1,t,j),G(Yt,Qt,Xt,Kt,0,1,t,j);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const i=(e+1)/(r+1);G(Yt,Qt,Xt,Kt,i,-1,t,j),G(Yt,Qt,Xt,Kt,i,1,t,j)}if(G(Yt,Qt,Xt,Kt,1,-2,t,j),G(Yt,Qt,Xt,Kt,1,2,t,j),(0,y.C)(Yt,Qt),(0,y.C)(Qt,Xt),M){const e=(t+1)%d*4;(0,U.hZ)(Kt,O[e],O[e+1],O[e+2],O[e+3])}}q?((0,y.hZ)(Xt,u.data[3],u.data[4],u.data[5]),e&&(0,y.Z0)(Xt,Xt,e),j=B(Yt,Qt,X),G(Yt,Qt,Xt,Kt,0,-1,Q,j),G(Yt,Qt,Xt,Kt,0,1,Q,j)):(j=B(Yt,Qt,X),G(Yt,Qt,Qt,Kt,0,-5,X,j),G(Yt,Qt,Qt,Kt,0,5,X,j)),Lt(D,W+H,D,W,H),V=Lt(D,V-H,D,V,H),this._parameters.wireframe&&this._addWireframeVertices(o,W,V,H)}_addWireframeVertices(e,t,i,r){const n=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),s=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),o=r*Float32Array.BYTES_PER_ELEMENT;let a=0;const l=e=>a=Lt(s,e,n,a,o);for(let e=0;e<=s.length-4*o;e+=2*o)l(e),l(e+2*o),l(e+1*o),l(e+2*o),l(e+1*o),l(e+3*o)}}function Lt(e,t,i,r,n){for(let s=0;s<n;s++)i[r++]=e[t++];return r}function Pt(e,t){return!!e.isClosed&&t.get("position").indices.length>2}function It(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return mt.r+i}}const Dt=new dt.PS,Ft=(0,l.vt)(),Nt=(0,l.vt)(),zt=(0,l.vt)(),Ht=(0,l.vt)(),Vt=(0,l.vt)(),Wt=(0,l.vt)(),jt=(0,l.vt)(),Ut=(0,l.vt)(),Bt=(0,nt.r_)(),$t=(0,nt.r_)(),Zt=(0,l.vt)(),kt=(0,l.vt)(),Gt=(0,at.vt)(),qt=(0,at.vt)(),Yt=(0,l.vt)(),Qt=(0,l.vt)(),Xt=(0,l.vt)(),Kt=(0,ze.vt)(),Jt=[(0,nt.r_)(),(0,nt.r_)(),(0,nt.r_)(),(0,nt.r_)()],ei=[(0,l.vt)(),(0,l.vt)(),(0,l.vt)(),(0,l.vt)()],ti=(0,_.vt)(),ii=(0,_.vt)(),ri=(0,_.vt)(),ni=(0,_.vt)();class si{constructor(e){this._originSR=e,this._rootOriginId="root/"+(0,Ne.c)(),this._origins=new Map,this._objects=new Map,this._gridSize=5e5,this._originSR?.isGeographic&&(this._gridSize/=(0,x.GA)(this._originSR)),this._baselineDistance=.5*this._gridSize;const t=this._baselineDistance*ai;this._baselineObjectSize=t/li}getOrigin(e){const t=this._origins.get(this._rootOriginId);if(null==t){const t=null;if(null!=t)return this._origins.set(this._rootOriginId,Z(t[0],t[1],t[2],this._rootOriginId)),this.getOrigin(e);const i=Z(e[0]+Math.random()-.5,e[1]+Math.random()-.5,e[2]+Math.random()-.5,this._rootOriginId);return this._origins.set(this._rootOriginId,i),i}const i=this._gridSize,r=Math.round(e[0]/i),n=Math.round(e[1]/i),s=Math.round(e[2]/i),o=`${r}/${n}/${s}`;let a=this._origins.get(o);const l=.5*i;if((0,y.Re)(oi,e,t.vec3),oi[0]=Math.abs(oi[0]),oi[1]=Math.abs(oi[1]),oi[2]=Math.abs(oi[2]),oi[0]<l&&oi[1]<l&&oi[2]<l){if(a){const t=Math.max(...oi);if((0,y.Re)(oi,e,a.vec3),oi[0]=Math.abs(oi[0]),oi[1]=Math.abs(oi[1]),oi[2]=Math.abs(oi[2]),Math.max(...oi)<t)return a}return t}return a||(a=Z(r*i,n*i,s*i,o),this._origins.set(o,a)),a}needsOriginUpdate(e,t,i){const r=(0,y.Io)(e.vec3,t),n=Math.max(1,i/this._baselineObjectSize);return r>this._baselineDistance*n}_drawOriginBox(e,t=(0,ze.fA)(1,1,0,1)){const i=window.view,r=i.stage,s=t.toString();if(!this._objects.has(s)){this._material=new Et({width:2,color:t},!1);const e=new rt(r,{pickable:!1}),i=new Ze({castShadow:!1});e.add(i),this._objects.set(s,i)}const o=this._objects.get(s),a=[0,1,5,4,0,2,1,7,6,2,0,1,3,7,5,4,6,2,0],l=a.length,c=new Array(3*l),u=new Array,h=.5*this._gridSize;for(let t=0;t<l;t++)c[3*t]=e[0]+(1&a[t]?h:-h),c[3*t+1]=e[1]+(2&a[t]?h:-h),c[3*t+2]=e[2]+(4&a[t]?h:-h),t>0&&u.push(t-1,t);(0,n.projectBuffer)(c,this._originSR,0,c,i.renderSpatialReference,0,l);const d=new Ve.V(this._material,[["position",new He.n(c,u,3,!0)]],null,2);o.addGeometry(d)}get test(){}}const oi=(0,l.vt)(),ai=2**-23,li=.05;var ci,ui=i(44794),hi=i(48163),di=i(24770),pi=i(79258),gi=i(25482),fi=i(93223);let mi=ci=class extends gi.o{constructor(e){super(e),this.type="cloudy",this.cloudCover=.5,this.fogOpacity=0}clone(){return new ci({cloudCover:this.cloudCover})}};(0,P.Cg)([(0,fi.e)({cloudy:"cloudy"}),(0,W.MZ)({json:{write:{isRequired:!0}}})],mi.prototype,"type",void 0),(0,P.Cg)([(0,W.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],mi.prototype,"cloudCover",void 0),mi=ci=(0,P.Cg)([(0,W.$K)("esri.views.3d.environment.CloudyWeather")],mi);const vi=mi;var xi;let yi=class extends gi.o{static{xi=this}constructor(e){super(e),this.type="foggy",this.fogStrength=.5}clone(){return new xi({fogStrength:this.fogStrength})}get fogOpacity(){return(0,v.Cc)(xi.minFogOpacity,xi.maxFogOpacity,this.fogStrength**3)}static{this.minFogOpacity=3e-5}static{this.maxFogOpacity=.005}};(0,P.Cg)([(0,fi.e)({foggy:"foggy"}),(0,W.MZ)({json:{write:{isRequired:!0}}})],yi.prototype,"type",void 0),(0,P.Cg)([(0,W.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],yi.prototype,"fogStrength",void 0),yi=xi=(0,P.Cg)([(0,W.$K)("esri.views.3d.environment.FoggyWeather")],yi);const _i=yi;var bi;let Si=class extends gi.o{static{bi=this}constructor(e){super(e),this.type="rainy",this.cloudCover=.5,this.precipitation=.5}clone(){return new bi({cloudCover:this.cloudCover,precipitation:this.precipitation})}get fogOpacity(){return(0,v.Cc)(bi.minFogOpacity,bi.maxFogOpacity,this.precipitation**3)}static{this.minFogOpacity=4e-6}static{this.maxFogOpacity=2e-4}};(0,P.Cg)([(0,fi.e)({rainy:"rainy"}),(0,W.MZ)({json:{write:{isRequired:!0}}})],Si.prototype,"type",void 0),(0,P.Cg)([(0,W.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Si.prototype,"cloudCover",void 0),(0,P.Cg)([(0,W.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Si.prototype,"precipitation",void 0),Si=bi=(0,P.Cg)([(0,W.$K)("esri.views.3d.environment.RainyWeather")],Si);const wi=Si;var Ci;let Ti=Ci=class extends gi.o{constructor(e){super(e),this.type="snowy",this.cloudCover=.5,this.precipitation=.5,this.snowCover="disabled"}clone(){return new Ci({cloudCover:this.cloudCover,precipitation:this.precipitation,snowCover:this.snowCover})}get fogOpacity(){return(0,v.Cc)(wi.minFogOpacity,wi.maxFogOpacity,this.precipitation**3)}};(0,P.Cg)([(0,fi.e)({snowy:"snowy"}),(0,W.MZ)({json:{write:{isRequired:!0}}})],Ti.prototype,"type",void 0),(0,P.Cg)([(0,W.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ti.prototype,"cloudCover",void 0),(0,P.Cg)([(0,W.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ti.prototype,"precipitation",void 0),(0,P.Cg)([(0,W.MZ)({type:["enabled","disabled"],nonNullable:!0,json:{write:!0}})],Ti.prototype,"snowCover",void 0),Ti=Ci=(0,P.Cg)([(0,W.$K)("esri.views.3d.environment.SnowyWeather")],Ti);const Ai=Ti;var Ei;let Ri=Ei=class extends gi.o{constructor(e){super(e),this.type="sunny",this.cloudCover=.5,this.fogOpacity=0}clone(){return new Ei({cloudCover:this.cloudCover})}};(0,P.Cg)([(0,fi.e)({sunny:"sunny"}),(0,W.MZ)({json:{write:{isRequired:!0}}})],Ri.prototype,"type",void 0),(0,P.Cg)([(0,W.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ri.prototype,"cloudCover",void 0),Ri=Ei=(0,P.Cg)([(0,W.$K)("esri.views.3d.environment.SunnyWeather")],Ri);const Oi={key:"type",base:Ri,typeMap:{sunny:Ri,cloudy:vi,rainy:wi,snowy:Ai,foggy:_i}};Object.keys(Oi.typeMap);class Mi{constructor(){this.startTime=0,this._data=(0,ui.v)(null),this.coverage=0,this.absorption=0,this._readChannels=0,this.parallax=new Li,this.parallaxNew=new Li,this._anchorPoint=(0,l.vt)(),this._fadeState=(0,ui.v)(0),this._fadeFactor=(0,ui.v)(1)}get data(){return this._data.value}set data(e){this._data.value=e}get readChannels(){return this._readChannels}get fadeState(){return this._fadeState.value}get fadeFactor(){return this._fadeFactor.value}get opacity(){switch(this.fadeState){case 0:return 0;case 4:return 1-this.fadeFactor;case 1:return this.fadeFactor;case 2:case 3:return 1}}fade(e,t,i){this.isFading&&this.fadeFactor<1&&(this._fadeFactor.value=i?(0,v.qE)((t-this.startTime)/(Fi*i),0,1):1,1===this.fadeFactor&&this._endFade()),this._evaluateState(e,t),this._updateParallax(e)}_evaluateState(e,t){const i=e.relativeElevation,r=this._updateAnchorPoint(e);(Math.abs(i)>17e3||r>zi)&&this.opacity>0?this._startFade(0,t):this.isFading||(Math.abs(i)>1e4||r>Ni*zi?this.opacity>0&&this._startFade(4,t):function(e){return null!=e&&!e.readyToRun}(this.data)&&(0===this.opacity?this._startFade(1,t):2===this.data.state&&(2===this.fadeState?this._startFade(3,t):this._startFade(2,t))))}_updateParallax(e){const t=(0,y.m3)(e.eye);this.parallax.radiusCurvatureCorrection=.84*Math.sqrt(Math.max(t-pi.$O.radius*pi.$O.radius,0))/Math.sqrt(t),(0,di.Cr)(Pi,this.parallax.anchorPoint,Ii),(0,o.e$)(this.parallax.transform,a.zK,Ii[3],(0,di.yo)(Ii)),(0,di.Cr)(Pi,this.parallaxNew.anchorPoint,Ii),(0,o.e$)(this.parallaxNew.transform,a.zK,Ii[3],(0,di.yo)(Ii))}_updateAnchorPoint(e){return(0,y.S8)(this._anchorPoint,e.eye),(0,y.hs)(this._anchorPoint,this._anchorPoint,pi.$O.radius),0===this.fadeState&&2===this.data?.state?((0,y.C)(this.parallax.anchorPoint,this._anchorPoint),0):(0,y.Bw)((0,y.Re)(Di,this.parallax.anchorPoint,this._anchorPoint))}requestFade(){this._fadeFactor.value=0}_startFade(e,t){switch(this._fadeState.value=e,this.startTime=t,e){case 3:this.requestFade(),this._switchReadChannels(),(0,y.C)(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 1:this.requestFade(),this._switchReadChannels(),(0,y.C)(this.parallax.anchorPoint,this._anchorPoint),(0,y.C)(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 4:this.requestFade();break;case 2:this._switchReadChannels(),(0,y.C)(this.parallax.anchorPoint,this._anchorPoint),(0,y.C)(this.parallaxNew.anchorPoint,this._anchorPoint),this._endFade();break;case 0:this._endFade()}}_endFade(){switch(this._fadeFactor.value=1,this.data&&2!==this.data.state&&(this.data.state=0),this.fadeState){case 3:(0,y.C)(this.parallax.anchorPoint,this.parallaxNew.anchorPoint),this._fadeState.value=2;break;case 1:this._fadeState.value=2;break;case 4:this._fadeState.value=0;break;case 2:case 0:break;default:this.fadeState}}_switchReadChannels(){2===this.data?.state&&(this._readChannels=1-this._readChannels,this.data.state=3)}get isFading(){return 4===this.fadeState||1===this.fadeState||3===this.fadeState}}class Li{constructor(){this.anchorPoint=(0,l.vt)(),this.radiusCurvatureCorrection=0,this.transform=(0,a.vt)()}}const Pi=(0,l.fA)(0,0,1),Ii=(0,di.vt)(),Di=(0,l.vt)(),Fi=1.25,Ni=.5,zi=2e5;class Hi{constructor(){this.lastFrameCamera=new K.A,this.matrix=(0,a.vt)(),this.viewMatrix=(0,a.vt)()}}class Vi{constructor(){this.enabled=!1,this.fadeFactor=1}}var Wi=i(57226);class ji{constructor(e,t){this._rctx=e,this.shadowMap=t,this._output=0,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.emissions=0,this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=(0,ui.v)(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this._camera=new K.A,this._inverseViewport=(0,hi.vt)(),this._oldLighting=new Wi.TA,this._newLighting=new Wi.TA,this._fadedLighting=new Wi.TA,this._lighting=this._newLighting,this.screenSpaceReflections=new Vi,this.reprojection=new Hi,this.highlights=new Array,this.highlightMixOrigin=(0,hi.vt)(),this.highlightMixTexture=null,this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new Mi,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=(0,N.Gz)(this.depth),this.shadowMap?.dispose()}get output(){return this._output}set output(e){this._output!==e&&(this._output=e,this._rctx.resetDrawBuffers(e))}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return 1===this.emissions||3===this.emissions}get hasTransparentEmission(){return 2===this.emissions||3===this.emissions}get camera(){return this._camera}set camera(e){this._camera=e,this._inverseViewport[0]=1/e.fullViewport[2],this._inverseViewport[1]=1/e.fullViewport[3]}get enableOITOffset(){return 1===this.output&&this.camera.relativeElevation<5e5}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(e,t,i,r){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=i,this._newLighting.set(e),this._oldLighting.updateLegacy(),1===r&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return(0,ct._o)(this.output)&&this.screenSpaceReflections.enabled&&null!=this.reprojection.lastFrameColor}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(e){e&&(e.name="geometry depth"),this._depth=e}get occluder(){return 10===this.slot||11===this.slot?this.slot:null}}class Ui{constructor(e,t,i){this.rctx=e,this.techniques=i,this.renderOccludedMask=Bi,this.time=(0,st.l5)(0),this.bind=new ji(e,t),this.bind.alignPixelEnabled=!0}destroy(){this.bind.destroy()}get output(){return this.bind.output}}const Bi=13;var $i=i(29242);let Zi=class extends K.A{constructor(){super(...arguments),this._projectionMatrix=(0,a.vt)()}get projectionMatrix(){return this._projectionMatrix}};(0,P.Cg)([(0,W.MZ)()],Zi.prototype,"_projectionMatrix",void 0),(0,P.Cg)([(0,W.MZ)({readOnly:!0})],Zi.prototype,"projectionMatrix",null),Zi=(0,P.Cg)([(0,W.$K)("esri.views.3d.webgl-engine.lib.CascadeCamera")],Zi);var ki=i(78988);class Gi{constructor(){this.camera=new Zi,this.lightMat=(0,a.vt)()}}class qi{constructor(){this.maxNumCascadesHighQuality=4,this.maxNumCascadesLowQuality=4,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.splitSchemeLambda=0}}class Yi{constructor(e,t){this._fbos=e,this._viewingMode=t,this._enabled=!1,this._outputs=new Array,this._textureHeight=0,this._numCascades=1,this.settings=new qi,this._projectionView=(0,a.vt)(),this._projectionViewInverse=(0,a.vt)(),this._modelViewLight=(0,a.vt)(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=(0,ze.vt)(),this._cascades=[new Gi,new Gi,new Gi,new Gi],this._lastOrigin=null,this._maxTextureWidth=Math.min((0,c.A)("esri-mobile")?4096:16384,e.rctx.parameters.maxTextureSize)}dispose(){this.enabled=!1}disposeOutputs(){this._handle=(0,N.Gz)(this._handle),this._outputs.forEach(e=>e?.release()),this._outputs.length=0}disposeOutput(e){this._outputs[e]=(0,N.Gz)(this._outputs[e])}set maxCascades(e){this.settings.maxNumCascadesHighQuality=(0,v.qE)(Math.floor(e),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(e){this._enabled=e,e||this.disposeOutputs()}get enabled(){return this._enabled}get ready(){return!!this.getOutput(5)||!!this.getOutput(7)}get renderTarget(){return this._handle}get cascades(){for(let e=0;e<this._numCascades;++e)sr[e]=this._cascades[e];return sr.length=this._numCascades,sr}start(e,t,i,r,n){(0,Ie.vA)(this.enabled);const{near:s,far:o}=function(e){let{near:t,far:i}=e;return t<2&&(t=2),i<2&&(i=2),t>=i&&(t=2,i=4),{near:t,far:i}}(i);this._computeCascadeDistances(s,o,r),this._textureHeight=this._computeTextureHeight(e,n,r),this._setupMatrices(e,t);const{viewMatrix:a,projectionMatrix:l}=e;for(let e=0;e<this._numCascades;++e)this._constructCascade(e,l,a,t);this._lastOrigin=null,this.clear()}getShadowMapMatrices(e){if(!this._lastOrigin||!(0,y.t2)(e,this._lastOrigin)){this._lastOrigin=this._lastOrigin||(0,l.vt)(),(0,y.C)(this._lastOrigin,e);for(let t=0;t<this._numCascades;++t){(0,o.Tl)(or,this._cascades[t].lightMat,e);for(let e=0;e<16;++e)ar[16*t+e]=or[e]}}return ar}finish(e){(0,Ie.vA)(this.enabled),this._outputs[e]?.release(),this._outputs[e]=this._handle,this._handle?.setName(6===e?"shadow map highlight":"shadow map excluding highlight"),this._handle=null}getOutput(e){return this.enabled?this._outputs[e]?.getTexture(we.nI):null}clear(){this._ensureFbo(),this.bindFramebuffer(),this._fbos.rctx.clear(256)}_computeTextureHeight({pixelRatio:e,fullWidth:t,fullHeight:i},r,n){const s=Math.min(window.devicePixelRatio,r)/e,o=n?this.settings.textureSizeModHighQuality:this.settings.textureSizeModLowQuality;return(0,ki.Mv)(Math.max(t,i)*s*o,this._maxTextureWidth/this._numCascades)}_ensureFbo(){this._handle?.fbo?.width===this._textureWidth&&this._handle?.fbo.height===this._textureHeight||(this._handle?.release(),this._handle=this._fbos.acquire(this._textureWidth,this._textureHeight,"shadow map",13),this._handle.getTexture(we.nI)?.setShadowFiltering(!0))}bindFramebuffer(){this._fbos.rctx.bindFramebuffer(this._handle?.fbo)}_constructCascade(e,t,i,r){const n=this._cascades[e],s=-this._cascadeDistances[e],a=-this._cascadeDistances[e+1],l=(t[10]*s+t[14])/Math.abs(t[11]*s+t[15]),c=(t[10]*a+t[14])/Math.abs(t[11]*a+t[15]);(0,Ie.vA)(l<c);for(let e=0;e<8;++e){(0,U.hZ)(Xi,e%4==0||e%4==3?-1:1,e%4==0||e%4==1?-1:1,e<4?l:c,1);const t=Ki[e];(0,U.Z0)(t,Xi,this._projectionViewInverse),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3]}(0,y.ze)(nr,Ki[0]),n.camera.viewMatrix=(0,o.Tl)(Qi,this._modelViewLight,nr);for(let e=0;e<8;++e)(0,y.Z0)(Ki[e],Ki[e],n.camera.viewMatrix);let u=Ki[0][2],h=Ki[0][2];for(let e=1;e<8;++e)u=Math.min(u,Ki[e][2]),h=Math.max(h,Ki[e][2]);u-=200,h+=200,n.camera.near=-h,n.camera.far=-u,function(e,t,i,r,n){const s=1/Ki[0][3],o=1/Ki[4][3];(0,Ie.vA)(s<o);let a=s+Math.sqrt(s*o);const l=Math.sin((0,v.XM)(e[2]*t[0]+e[6]*t[1]+e[10]*t[2]));a/=l,function(e,t,i,r,n,s,o,a){(0,ie.hZ)(lr,0,0);for(let t=0;t<4;++t)(0,ie.WQ)(lr,lr,e[t]);(0,ie.hs)(lr,lr,.25),(0,ie.hZ)(cr,0,0);for(let t=4;t<8;++t)(0,ie.WQ)(cr,cr,e[t]);(0,ie.hs)(cr,cr,.25),(0,ie.Cc)(ur[0],e[4],e[5],.5),(0,ie.Cc)(ur[1],e[5],e[6],.5),(0,ie.Cc)(ur[2],e[6],e[7],.5),(0,ie.Cc)(ur[3],e[7],e[4],.5);let l=0,c=(0,ie.hG)(ur[0],lr);for(let e=1;e<4;++e){const t=(0,ie.hG)(ur[e],lr);t<c&&(c=t,l=e)}(0,ie.Re)(hr,ur[l],e[l+4]);const u=hr[0];let h,d;hr[0]=-hr[1],hr[1]=u,(0,ie.Re)(dr,cr,lr),(0,ie.Om)(dr,hr)<0&&(0,ie.ze)(hr,hr),(0,ie.Cc)(hr,hr,dr,i),(0,ie.S8)(hr,hr),h=d=(0,ie.Om)((0,ie.Re)(pr,e[0],lr),hr);for(let t=1;t<8;++t){const i=(0,ie.Om)((0,ie.Re)(pr,e[t],lr),hr);i<h?h=i:i>d&&(d=i)}(0,ie.C)(r,lr),(0,ie.hs)(pr,hr,h-t),(0,ie.WQ)(r,r,pr);let p=-1,g=1,f=0,m=0;for(let t=0;t<8;++t){(0,ie.Re)(gr,e[t],r),(0,ie.S8)(gr,gr);const i=hr[0]*gr[1]-hr[1]*gr[0];i>0?i>p&&(p=i,f=t):i<g&&(g=i,m=t)}(0,Ie.MX)(p>0,"leftArea"),(0,Ie.MX)(g<0,"rightArea"),(0,ie.hs)(fr,hr,h),(0,ie.WQ)(fr,fr,lr),(0,ie.hs)(mr,hr,d),(0,ie.WQ)(mr,mr,lr),vr[0]=-hr[1],vr[1]=hr[0];const v=(0,Ie.L)(r,e[m],mr,(0,ie.WQ)(pr,mr,vr),1,n),x=(0,Ie.L)(r,e[f],mr,pr,1,s),y=(0,Ie.L)(r,e[f],fr,(0,ie.WQ)(pr,fr,vr),1,o),_=(0,Ie.L)(r,e[m],fr,pr,1,a);(0,Ie.MX)(v,"rayRay"),(0,Ie.MX)(x,"rayRay"),(0,Ie.MX)(y,"rayRay"),(0,Ie.MX)(_,"rayRay")}(Ki,a,l,Ji,er,tr,ir,rr),function(e,t,i,r,n){(0,ie.Re)(br,i,r),(0,ie.hs)(br,br,.5),Sr[0]=br[0],Sr[1]=br[1],Sr[2]=0,Sr[3]=br[1],Sr[4]=-br[0],Sr[5]=0,Sr[6]=br[0]*br[0]+br[1]*br[1],Sr[7]=br[0]*br[1]-br[1]*br[0],Sr[8]=1,Sr[xr(0,2)]=-(0,ie.Om)(_r(Sr,0),e),Sr[xr(1,2)]=-(0,ie.Om)(_r(Sr,1),e);let s=(0,ie.Om)(_r(Sr,0),i)+Sr[xr(0,2)],o=(0,ie.Om)(_r(Sr,1),i)+Sr[xr(1,2)],a=(0,ie.Om)(_r(Sr,0),r)+Sr[xr(0,2)],l=(0,ie.Om)(_r(Sr,1),r)+Sr[xr(1,2)];s=-(s+a)/(o+l),Sr[xr(0,0)]+=Sr[xr(1,0)]*s,Sr[xr(0,1)]+=Sr[xr(1,1)]*s,Sr[xr(0,2)]+=Sr[xr(1,2)]*s,s=1/((0,ie.Om)(_r(Sr,0),i)+Sr[xr(0,2)]),o=1/((0,ie.Om)(_r(Sr,1),i)+Sr[xr(1,2)]),Sr[xr(0,0)]*=s,Sr[xr(0,1)]*=s,Sr[xr(0,2)]*=s,Sr[xr(1,0)]*=o,Sr[xr(1,1)]*=o,Sr[xr(1,2)]*=o,Sr[xr(2,0)]=Sr[xr(1,0)],Sr[xr(2,1)]=Sr[xr(1,1)],Sr[xr(2,2)]=Sr[xr(1,2)],Sr[xr(1,2)]+=1,s=(0,ie.Om)(_r(Sr,1),t)+Sr[xr(1,2)],o=(0,ie.Om)(_r(Sr,2),t)+Sr[xr(2,2)],a=(0,ie.Om)(_r(Sr,1),i)+Sr[xr(1,2)],l=(0,ie.Om)(_r(Sr,2),i)+Sr[xr(2,2)],s=-.5*(s/o+a/l),Sr[xr(1,0)]+=Sr[xr(2,0)]*s,Sr[xr(1,1)]+=Sr[xr(2,1)]*s,Sr[xr(1,2)]+=Sr[xr(2,2)]*s,s=(0,ie.Om)(_r(Sr,1),t)+Sr[xr(1,2)],o=(0,ie.Om)(_r(Sr,2),t)+Sr[xr(2,2)],a=-o/s,Sr[xr(1,0)]*=a,Sr[xr(1,1)]*=a,Sr[xr(1,2)]*=a,n[0]=Sr[0],n[1]=Sr[1],n[2]=0,n[3]=Sr[2],n[4]=Sr[3],n[5]=Sr[4],n[6]=0,n[7]=Sr[5],n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=Sr[6],n[13]=Sr[7],n[14]=0,n[15]=Sr[8]}(Ji,er,ir,rr,n.projectionMatrix),n.projectionMatrix[10]=2/(i-r),n.projectionMatrix[14]=-(i+r)/(i-r)}(i,r,u,h,n.camera),(0,o.lw)(n.lightMat,n.camera.projectionMatrix,n.camera.viewMatrix);const d=this._textureHeight;n.camera.viewport=[e*d,0,d,d]}_setupMatrices(e,t){(0,o.lw)(this._projectionView,e.projectionMatrix,e.viewMatrix),(0,o.B8)(this._projectionViewInverse,this._projectionView);const i=1===this._viewingMode?e.eye:(0,y.hZ)(nr,0,0,1);(0,o.t5)(this._modelViewLight,[0,0,0],[-t[0],-t[1],-t[2]],i)}_computeCascadeDistances(e,t,i){const r=i?this.settings.maxNumCascadesHighQuality:this.settings.maxNumCascadesLowQuality;this._numCascades=Math.min(1+Math.floor((0,Ie.kL)(t/e,4)),r);const n=(t-e)/this._numCascades,s=(t/e)**(1/this._numCascades);let o=e,a=e;for(let e=0;e<this._numCascades+1;++e)this._cascadeDistances[e]=(0,v.Cc)(o,a,this.settings.splitSchemeLambda),o*=s,a+=n}get _textureWidth(){return this._textureHeight*this._numCascades}get numCascades(){return this._numCascades}get cascadeDistances(){return(0,U.hZ)(this._usedCascadeDistances,this._cascadeDistances[0],this._numCascades>1?this._cascadeDistances[1]:1/0,this._numCascades>2?this._cascadeDistances[2]:1/0,this._numCascades>3?this._cascadeDistances[3]:1/0)}get test(){}}const Qi=(0,a.vt)(),Xi=(0,ze.vt)(),Ki=[];for(let e=0;e<8;++e)Ki.push((0,ze.vt)());const Ji=(0,hi.vt)(),er=(0,hi.vt)(),tr=(0,hi.vt)(),ir=(0,hi.vt)(),rr=(0,hi.vt)(),nr=(0,l.vt)(),sr=[],or=(0,a.vt)(),ar=a.zK.concat(a.zK,a.zK,a.zK),lr=(0,hi.vt)(),cr=(0,hi.vt)(),ur=[(0,hi.vt)(),(0,hi.vt)(),(0,hi.vt)(),(0,hi.vt)()],hr=(0,hi.vt)(),dr=(0,hi.vt)(),pr=(0,hi.vt)(),gr=(0,hi.vt)(),fr=(0,hi.vt)(),mr=(0,hi.vt)(),vr=(0,hi.vt)();function xr(e,t){return 3*t+e}const yr=(0,hi.vt)();function _r(e,t){return(0,ie.hZ)(yr,e[t],e[t+3]),yr}const br=(0,hi.vt)(),Sr=(0,$i.vt)();var wr=i(92942);let Cr=class extends oe.w{constructor(){super(...arguments),this.shader=new se.r(wr.a,()=>i.e(959).then(i.bind(i,959)))}initializePipeline(e){return e.hasAlpha?(0,ce.Ey)({blending:ce.T8,colorWrite:ce.kn}):(0,ce.Ey)({colorWrite:ce.kn})}};Cr=(0,P.Cg)([(0,W.$K)("esri.views.3d.webgl-engine.lib.TextureTechnique")],Cr);class Tr extends wt.K{constructor(){super(...arguments),this.hasAlpha=!1}}(0,P.Cg)([(0,wt.W)()],Tr.prototype,"hasAlpha",void 0);var Ar=i(75497),Er=i(80583);let Rr=class extends oe.w{constructor(){super(...arguments),this.shader=new se.r(Er.a,()=>i.e(4849).then(i.bind(i,64849))),this.ignoreUnused=!0}};Rr=(0,P.Cg)([(0,W.$K)("esri.views.3d.webgl-engine.shaders.OverlayCompositingTechnique")],Rr);var Or=i(92359);let Mr=class extends te{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new Er.O,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new z.A,this._passParameters=new wr.T,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new K.A,this.events=new D.bk,this.longitudeCyclical=null,this.produces=new Map([[18,e=>10!==e||this.hasHighlights],[19,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;const{state:t,stage:i}=e.parent.view,r=i.renderer.fboCache,n=i.renderView.renderingContext,s=i.renderView.techniques;this._renderContext=new Ui(n,new Yi(r,t.viewingMode),s)}initialize(){const e=this._view,t=e.stage.renderView.waterTextures;this.addHandles([(0,H.wB)(()=>t.updating,()=>this.events.emit("content-changed"),H.pc),(0,H.wB)(()=>this._spatialReference,e=>this._localOriginFactory=new si(e),H.pc),(0,H.on)(()=>e.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0),(0,H.wB)(()=>function(e){let t=0;for(const i of e){const{name:e}=i;t+=e.length;const{color:r,fillOpacity:n,haloColor:s,haloOpacity:o}=i;t+=r.r+r.g+r.b+r.a+n,t+=s?s.r+s.g+s.b+s.a+o:0}const i=e.at(0);if(i){const{shadowOpacity:e,shadowDifference:r,shadowColor:n}=i;t+=e+r+n.r+n.g+n.b+n.a}return Oe+++(t>=0?0:1)}(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,H.Vh),(0,H.wB)(()=>e.state.highlights,e=>{this._bindParameters.highlights=e},H.Vh),e.resourceController.scheduler.registerTask(Or.W6.OVERLAY_RENDERER,this)]);const i=this._camera;i.near=1,i.far=1e4,i.relativeElevation=null,this._bindParameters.slot=18,this._bindParameters.camera=i,this._bindParameters.updateLighting(new Ar.$p((0,l.S)()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=(0,N.WD)(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const t=new De(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._pluginContext={...e,materials:t},this._techniques.precompile(Rr)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||(0,F.Bs)(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const t of this._renderers.values()){const i=t.getMaterialRenderer(e);if(i)return i}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),(0,I.Am)(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,t){const i=this._renderers.get(e);null!=i&&i.destroy(),this._renderers.set(e,t),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles((0,H.wB)(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e)}removeDrapeSourceRenderer(e){if(null==e)return;const t=this._renderers.get(e);null!=t&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),t.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&(0,V.bw)(e,e=>1===e.drapeTargetType)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=(0,V.bw)(e,e=>1===e.drapeSourceType),this._hasDrapedRasterSource=(0,V.bw)(e,e=>0===e.drapeSourceType),this._hasDrapedFlowSource=(0,V.bw)(e,e=>2===e.drapeSourceType)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,t,i=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new X(this._stage.renderer.fboCache),this._overlays=[new k,new k]),this.ensureDrapeTargets(e),this.ensureDrapeSources(t),this._bindParameters.overlayStretch=i}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit("textures-disposed")}_useOverlayColorInsteadOfColorNoRasterImage(e){return 1===e&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){const t=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(t?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(()=>!0,e)}_onMaterialOrContentChanged(){this.renderOccludedFlags=(0,F.Bs)(this._renderers,e=>e.hasOccluders)?Ir:1}_processDrapeSources(e,t){let i=!1;for(const[r,n]of this._renderers){if(t?.done)break;(r.destroyed||e(r))&&n.commitChanges()&&(i=!0,t?.madeProgress())}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,i=!0,this._updateSortedDrapeSourceRenderers(),t?.madeProgress()),t&&this.compact(t),i&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this._onMaterialOrContentChanged(),this.hasHighlights=(0,F.Bs)(this._renderers,e=>e.hasHighlights),this.events.emit("content-changed"))}compact(e){let t=!1;for(const i of this._renderers.values()){if(e.done)break;t=i.compact(e)||t}return t&&this.notifyChange("updating"),t}hasHighlight(e){return(0,F.Bs)(this._renderers,t=>t.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(e=>1===e.updatePolicy)}get isEmpty(){return!j.b.OVERLAY_DRAW_DEBUG_TEXTURE&&(0,F.mt)(this._renderers,e=>e.isEmpty)}get hasWater(){const e=(0,F.Bs)(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}renders(e){if(j.b.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==e&&2!==e)return!0;if(!this._overlays)return!1;const t=this._overlays[0];for(const e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);if(!t.hasSomeSizedView())return!1;const i=this._setOutput(this._renderTargets?.targets.find(t=>t.content===e)?.output??0);++this._techniques.precompiling;const r=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(i),r}_setOutput(e){const t=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=4===e?19:18,t}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:this._renderTargets?.getTexture(0)?1:0}updateAnimation(e){let t=!1;return this._renderers.forEach(i=>t=i.updateAnimation(e)||t),t&&this.parent.requestRender(0),t}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;const t=this._bindParameters;t.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const e of this._renderTargets.targets){if(1===e.content&&!this._needsColorWithoutRasterImage)continue;const{output:i}=e;this._setOutput(i),10===i&&(t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null);const r=this._renderContext.renderOccludedMask;4===e.content&&(this._renderContext.renderOccludedMask=Ir),this._sortedRenderers.forAll(({drapeSource:t,renderer:i})=>{1===e.content&&0===t.drapeSourceType||4===e.content&&i.hasOnlyOccluders||i.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=r,t.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,t){if(!this._overlays||!this._renderTargets)return;for(const e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;const i=this.allSourcesOccluders;for(const e of this._renderTargets.targets){if((0!==e.content||!this._hasDrapedFlowSource)&&!e.handleRenderRequest(t)||1===e.content&&!this._needsColorWithoutRasterImage||4===e.content&&i)continue;const r=this._drawTarget(0,e),n=this._drawTarget(1,e);(r||n)&&e.fbo.generateMipMap()}}_drawTarget(e,t){const i=this._overlays[e],r=i.canvasGeometries;if(0===r.numViews)return!1;const n=this._view.state.contentPixelRatio;this._screenToWorldRatio=n*i.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:s,content:o}=t;if(this.isEmpty||4===s&&!this.hasWater||!i.hasSomeSizedView())return!1;const{_rctx:a,_camera:l,_renderContext:c,_bindParameters:u}=this;if(l.pixelRatio=i.pixelRatio*n,this._setOutput(s),u.screenToWorldRatio=this._screenToWorldRatio,u.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,4===o&&(c.renderOccludedMask=Ir),!this.renders(o))return c.renderOccludedMask=Bi,!1;const{resolution:h}=i,d=0===e,p=d?0:h;if(a.setViewport(p,0,h,h),this._bindTargetFBO(t),d&&(10===s?a.gl.clearBufferuiv(a.gl.COLOR,0,[0,0,0,0]):(a.setClearColor(0,0,0,0),a.clear(16384))),j.b.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==o&&2!==o){this._techniques.precompile(Cr,Dr);const t=this._techniques.get(Cr,Dr);for(let n=0;n<r.numViews;n++)this._setViewParameters(r.extents[n],i),this._ensureDebugPatternResources(i.resolution,Pr[e]),a.bindTechnique(t,u,this._passParameters),a.screen.draw()}if(10===s){const{fboCache:i}=this._stage.renderer,r=this._resolution;this._bindTargetFBO(t),function(e,t,i,r,n,s,o=0){const{highlights:a}=n,l=a.length>1?t.acquire(i,r,"highlight mix",a.length>Le?3:1):null,{gl:c}=e;if(l){const t=e.boundFramebuffer;e.bindFramebuffer(l.fbo),c.clearBufferuiv(c.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const u=l?.getTexture();n.highlightMixTexture=u,(0,ie.hZ)(n.highlightMixOrigin,o,0),a.forEach((t,a)=>{if(a>0){const t=Ce.A.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(u,t),e.setActiveTexture(t),c.copyTexSubImage2D(3553,0,0,0,o,0,i,r),e.bindTexture(null,t)}e.clear(256),n.highlightLevel=a,s()}),n.highlightLevel=null,n.highlightMixTexture=null,l?.release()}(a,i,r,r,u,()=>this._renderAllGeometry(e,t),p)}else this._renderAllGeometry(e,t);return a.bindFramebuffer(null),c.renderOccludedMask=Bi,!0}get allSourcesOccluders(){return(0,F.mt)(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,t){const i=this._overlays[e],r=i.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:n,renderer:s})=>{if(1===t.content&&0===n.drapeSourceType)return;const{fullOpacity:o}=n,a=null!=o&&o<1&&0===t.output&&this._bindTemporaryFBO();for(let e=0;e<r.numViews;e++)this._setViewParameters(r.extents[e],i),s.render(this._renderContext);if(a){this._bindTargetFBO(t),this._overlayParameters.texture=a.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;const i=this._techniques.get(Rr);this._rctx.bindTechnique(i,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),a.release()}})}_bindTargetFBO(e){const t=this._resolution,i=2*t;e.fbo.ensureFramebuffer(i,t),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){const e=this._resolution,t=2*e,i=this._stage.renderer.fboCache,r=i.acquire(t,e,"overlay tmp");return i.rctx.bindFramebuffer(r.fbo),i.rctx.clear(16384),r}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,t,i,r){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let n=0;for(const{renderer:s}of this._sortedRenderers)n=s.intersect?.(e,t,i,r,n)??n}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers.map(e=>e.uid),t=e.length;this._renderers.forEach((i,r)=>{const n=e.indexOf(r.layer?.uid),s=n>=0,o=r.renderGroup??(s?0:1),a=r.drapeSourcePriorityOffset??0,l=t*o+(s?n:0)+a;this._sortedRenderers.push(new Lr(r,i,l))}),this._sortedRenderers.sort((e,t)=>e.index-t.index)}_setViewParameters(e,t){const i=this._camera;i.viewport=[0,0,t.resolution,t.resolution],(0,o.v3)(i.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],i.near,i.far),(0,o.kN)(i.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,t){if((0,y.hZ)(this._passParameters.color,t[0],t[1],t[2]),this._passParameters.texture)return;const i=new Uint8Array(e*e*4);let r=0;for(let t=0;t<e;t++)for(let n=0;n<e;n++){const s=Math.floor(n/10),o=Math.floor(t/10);s<2||o<2||10*s>e-20||10*o>e-20?(i[r++]=255,i[r++]=255,i[r++]=255,i[r++]=255):(i[r++]=255,i[r++]=255,i[r++]=255,i[r++]=1&s&&1&o?1&n^1&t?0:255:1&s^1&o?0:128)}const n=new Te.R(e);n.samplingMode=9728,this._passParameters.texture=new Ce.A(this._rctx,n,i)}get test(){}};(0,P.Cg)([(0,W.MZ)()],Mr.prototype,"hasHighlights",void 0),(0,P.Cg)([(0,W.MZ)()],Mr.prototype,"renderOccludedFlags",void 0),(0,P.Cg)([(0,W.MZ)()],Mr.prototype,"_sortedDrapeSourceRenderersDirty",void 0),(0,P.Cg)([(0,W.MZ)({constructOnly:!0})],Mr.prototype,"parent",void 0),(0,P.Cg)([(0,W.MZ)({readOnly:!0})],Mr.prototype,"_techniques",null),(0,P.Cg)([(0,W.MZ)({type:Boolean,readOnly:!0})],Mr.prototype,"updating",null),(0,P.Cg)([(0,W.MZ)()],Mr.prototype,"isEmpty",null),Mr=(0,P.Cg)([(0,W.$K)("esri.views.3d.terrain.OverlayRenderer")],Mr);class Lr{constructor(e,t,i){this.drapeSource=e,this.renderer=t,this.index=i}}const Pr=[[1,.5,.5],[.5,.5,1]],Ir=4,Dr=new Tr;Dr.hasAlpha=!0;class Fr{constructor(e,t,i,r){this.positions=e,this.polygonIndices=t,this.outline=i,this.projectionSuccess=r,this.count=e.length/3}get vertexCount(){return this.positions.length/3}get polygonIndexCount(){return this.polygonIndices.length}get outlineIndexCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let i=0;i<e.outlineIndices.length;i++)t+=Vr(e.outlineIndices[i]);return t}get outlineSegmentCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let i=0;i<e.outlineIndices.length;i++)t+=Vr(e.outlineIndices[i]);return t}}class Nr extends Fr{}function zr(e,t){const{projectIfNearlyVertical:i=!1,outlineOutput:n="none",method:o}=t??{},a="tessellated-indices"===n,l=S(e.rings,!!e.hasZ,e.spatialReference),c=function(e,t){const{hasZ:i,ccwRingsAsHoles:r,spatialReference:n}=t,o=t.axis??S(e,i,n),a=e.length,l=[],c=[],u=[],h=[],d=e.reduce((e,t)=>e+t.length,0);let p=0;const g=(0,s.jh)(3*d);let f=0;const m=r&&e[0]&&w(e[0],i,o);for(let t=a-1;t>=0;t--){const n=e[t],s=M(n,i);if(s<3){s>1&&h.push(n);continue}const a=!!r&&w(n,i,o);if(m?!a:a)l[p++]=n;else{let e=n.length;for(let t=0;t<p;++t)e+=l[t].length;const t={index:f,pathLengths:new Array(p+1),count:e,holeIndices:new Array(p)};t.pathLengths[0]=n.length,n.length>0&&u.push({index:f,count:n.length}),f=O(n,g,f,n.length,i,m);for(let e=0;e<p;++e){const r=l[e];t.holeIndices[e]=f,t.pathLengths[e+1]=r.length,r.length>0&&u.push({index:f,count:r.length}),f=O(r,g,f,r.length,i,m)}p=0,t.count>0&&c.push(t)}}const v=f;for(const e of h)u.push({index:f,count:e.length}),f=O(e,g,f,e.length,i,m);return{positions:3*f===g.length?g:(0,s.l5)(g,0,3*f),polygonVertexCount:v,polygons:c,outlines:u}}(e.rings,{hasZ:!!e.hasZ,ccwRingsAsHoles:!0,spatialReference:e.spatialReference,axis:l}),u=function(e,t){const i=function(e,t){const i={method:t?.method??"auto",projectionAxis:t?.projectionAxis??void 0,outlines:t?.outlines??void 0},{projectionAxis:r}=i,n=null!=r&&2!==r;n&&A(e.positions,r,2);const s=function(e,t){if("libtess"===t.method)return T(e,t);const i=Array();let r=0;for(const n of e.polygons){const s=R(e.positions,n),o=(n.holeIndices??[]).map(e=>e-n.index),a=o.length>0?o:null,l=(0,p.e)(s,a,3),c=p.e.deviation(s,o,3,l);if("auto"===t.method&&c>1e-5)return T(e,t);for(let e=0;e<l.length;e++)i.push(l[e]+n.index);r=Math.max(r,c)}const{outlineIndexBuffer:n,outlineRingLengths:s}=null!=t.outlines?E(t.outlines,e.positions):{outlineIndexBuffer:void 0,outlineRingLengths:void 0};return{succeeded:!0,positions:e.positions,indices:(0,m.uW)(i),outlineIndexBuffer:n,outlineRingLengths:s,vertexCount:e.positions.length/3,method:"earcut",deviation:r}}(e,i);if(n){const t=s.succeeded?s.positions:null;null!=t&&t!==e.positions&&A(t,2,r),A(e.positions,2,r)}return s}(e,t);return i.succeeded?i:"libtess-not-loaded"===i.message?((0,h.gc)(C),async function(){try{await(0,g.l3)(),C.notify()}catch(e){throw e}}()):i}(c,{projectionAxis:i?l:void 0,outlines:a?c.outlines:void 0,method:o});if((0,r.$X)(u))return u;if(!u.succeeded)return null;let d={output:"none"};if("vertex-data"===n){const e=u.positions!==c.positions?c.positions:c.positions.slice();d={output:"vertex-data",outlines:Hr(c.outlines,e)}}else"tessellated-indices"===n&&(d=function(e){const{outlineIndexBuffer:t,outlineRingLengths:i}=e;if(null==t||null==i)return{output:"none"};const r=new Array(i.length);let n=0;for(let e=0;e<i.length;e++){const s=i[e],o=t.slice(n,n+s);r[e]=o,n+=s}return{output:"tessellated-indices",outlineIndices:r}}(u));return new Nr(u.positions,u.indices,d,!0)}function Hr(e,t,i=null){return e.filter(({count:e})=>e>1).map(({index:e,count:r})=>{const n=3*e,o=3*r;return null!=i?new jr(e,r,(0,s.l5)(t,n,o),(0,s.l5)(i,n,o)):new Wr(e,r,(0,s.l5)(t,n,o))})}function Vr(e,t=0,i=e.length){return i>1&&e[t]===e[t+i-1]?i-1:i}class Wr{constructor(e,t,i){this.index=e,this.count=t,this.position=i}}class jr extends Wr{constructor(e,t,i,r){super(e,t,i),this.mapPositions=r}}},6733(e,t,i){i.d(t,{Q:()=>h});var r=i(37585),n=i(48163),s=i(31821),o=i(74333);class a extends o.n{constructor(e,t){super(e,"ivec2",1,(i,r,n)=>i.setUniform2iv(e,t(r,n)))}}var l=i(93588),c=i(9273),u=i(34053);function h(e){const{vertex:t}=e;t.uniforms.add(new c.R("coverageTexture",e=>e.coverageTexture),new a("highlightRenderCellCount",e=>(0,r.hZ)(d,e.horizontalCellCount,e.verticalCellCount)),new a("highlightTextureResolution",({highlightTexture:e})=>(0,r.hZ)(d,e.descriptor.width,e.descriptor.height)),new l.c("highlightLevel",e=>e.highlightLevel)).constants.add("cellSize","int",u.g),e.varyings.add("sUV","vec2"),e.varyings.add("vOutlinePossible","float"),t.code.add(s.H`const ivec2 cellVertices[4] = ivec2[4](ivec2(0,0), ivec2(1,0), ivec2(0,1), ivec2(1,1));`),t.main.add(s.H`int cellIndex = gl_InstanceID;
389
+ int cellX = cellIndex % highlightRenderCellCount[0];
390
+ int cellY = (cellIndex - cellX) / highlightRenderCellCount[0];
391
+ ivec2 cellPos = ivec2(cellX, cellY);
392
+ uvec2 covTexel = texelFetch(coverageTexture, cellPos, 0).rg;
393
+ int channelIndex = (highlightLevel >> 2) & 3;
394
+ uint channelValue = covTexel[channelIndex];
395
+ int highlightIndex = (highlightLevel & 3) << 1;
396
+ bool covered = ((channelValue >> highlightIndex) & 1u) == 1u;
397
+ if (!covered) {
398
+ gl_Position = vec4(0.0);
399
+ return;
400
+ }
401
+ vOutlinePossible = (((channelValue >> highlightIndex) & 2u) == 2u) ? 1.0 : 0.0;
402
+ ivec2 iPosInCell = cellVertices[gl_VertexID];
403
+ vec2 sPos = vec2(cellPos * cellSize + iPosInCell * (cellSize));
404
+ vec2 vPos = sPos / vec2(highlightTextureResolution);
405
+ sUV = vPos;
406
+ gl_Position = vec4(2.0 * vPos - vec2(1.0), 0.0, 1.0);`)}const d=(0,n.vt)()},84652(e,t,i){i.d(t,{s:()=>p});var r=i(58083),n=i(9093),s=i(43259),o=i(52587),a=i(77949),l=i(33079),c=i(20304),u=i(44887),h=i(31821),d=i(97102);function p(e,t){const{vertex:i,attributes:n}=e;i.uniforms.add(new c.m("intrinsicWidth",e=>e.width));const{hasScreenSizePerspective:p,spherical:f}=t;p?(e.include(o.Y6,t),(0,o.pM)(i),(0,a.yu)(i,t),i.uniforms.add(new d.S("inverseViewMatrix",(e,t)=>(0,r.B8)(g,(0,r.Tl)(g,t.camera.viewMatrix,e.origin)))),i.code.add(h.H`
407
+ float applyLineSizeScreenSizePerspective(float size, vec3 pos) {
408
+ vec3 worldPos = (inverseViewMatrix * vec4(pos, 1)).xyz;
409
+ vec3 groundUp = ${f?h.H`normalize(worldPos + localOrigin)`:h.H`vec3(0.0, 0.0, 1.0)`};
410
+ float absCosAngle = abs(dot(groundUp, normalize(worldPos - cameraPosition)));
411
+
412
+ return screenSizePerspectiveScaleFloat(size, absCosAngle, length(pos), screenSizePerspective);
413
+ }
414
+ `)):i.code.add(h.H`float applyLineSizeScreenSizePerspective(float size, vec3 pos) {
415
+ return size;
416
+ }`),t.hasVVSize?(n.add("sizeFeatureAttribute","float"),i.uniforms.add(new l.t("vvSizeMinSize",e=>e.vvSize.minSize),new l.t("vvSizeMaxSize",e=>e.vvSize.maxSize),new l.t("vvSizeOffset",e=>e.vvSize.offset),new l.t("vvSizeFactor",e=>e.vvSize.factor),new l.t("vvSizeFallback",e=>e.vvSize.fallback)),i.code.add(h.H`
417
+ float getSize(${(0,h.If)(p,"vec3 pos")}) {
418
+ float size = isnan(sizeFeatureAttribute)
419
+ ? vvSizeFallback.x
420
+ : intrinsicWidth * clamp(vvSizeOffset + sizeFeatureAttribute * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).x;
421
+
422
+ return ${(0,h.If)(p,"applyLineSizeScreenSizePerspective(size, pos)","size")};
423
+ }
424
+ `)):(n.add("size","float"),i.code.add(h.H`
425
+ float getSize(${(0,h.If)(p,"vec3 pos")}) {
426
+ float fullSize = intrinsicWidth * size;
427
+ return ${(0,h.If)(p,"applyLineSizeScreenSizePerspective(fullSize, pos)","fullSize")};
428
+ }
429
+ `)),t.hasVVOpacity?(n.add("opacityFeatureAttribute","float"),i.constants.add("vvOpacityNumber","int",8),i.uniforms.add(new u.x("vvOpacityValues",8,e=>e.vvOpacity.values),new u.x("vvOpacityOpacities",8,e=>e.vvOpacity.opacityValues),new c.m("vvOpacityFallback",e=>e.vvOpacity.fallback,{supportsNaN:!0})),i.code.add(h.H`
430
+ float interpolateOpacity(float value) {
431
+ if (value <= vvOpacityValues[0]) {
432
+ return vvOpacityOpacities[0];
433
+ }
434
+
435
+ for (int i = 1; i < vvOpacityNumber; ++i) {
436
+ if (vvOpacityValues[i] >= value) {
437
+ float f = (value - vvOpacityValues[i-1]) / (vvOpacityValues[i] - vvOpacityValues[i-1]);
438
+ return mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f);
439
+ }
440
+ }
441
+
442
+ return vvOpacityOpacities[vvOpacityNumber - 1];
443
+ }
444
+
445
+ vec4 applyOpacity(vec4 color) {
446
+ if (isnan(opacityFeatureAttribute)) {
447
+ // If there is a color vv then it will already have taken care of applying the fallback
448
+ return ${(0,h.If)(t.hasVVColor,"color","vec4(color.rgb, vvOpacityFallback)")};
449
+ }
450
+
451
+ return vec4(color.rgb, interpolateOpacity(opacityFeatureAttribute));
452
+ }
453
+ `)):i.code.add(h.H`vec4 applyOpacity(vec4 color) {
454
+ return color;
455
+ }`),t.hasVVColor?(e.include(s.A,t),n.add("colorFeatureAttribute","float"),i.code.add(h.H`vec4 getColor() {
456
+ vec4 color = interpolateVVColor(colorFeatureAttribute);
457
+ if (isnan(color.r)) {
458
+ return vec4(0);
459
+ }
460
+ return applyOpacity(color);
461
+ }`)):(n.add("color","vec4"),i.code.add(h.H`vec4 getColor() {
462
+ return applyOpacity(color);
463
+ }`))}const g=(0,n.vt)()},2923(e,t,i){i.d(t,{q:()=>m,h:()=>v});var r=i(27950),n=i(66269),s=i(77949),o=i(71988),a=i(33094),l=i(20304),c=i(31821),u=i(63761),h=i(96095);function d(e){if(null==e)return 1;const t=function(e){return e.pattern.map(t=>Math.round(t*e.pixelRatio))}(e);return Math.floor(t.reduce((e,t)=>e+t))}i(63907),i(21231),i(67171);var p=i(78955),g=i(91829);const f=(0,g.vt)();function m(e,t){if(!t.stippleEnabled)return void e.fragment.code.add(c.H`float getStippleAlpha(float lineWidth) { return 1.0; }
464
+ void discardByStippleAlpha(float stippleAlpha, float threshold) {}
465
+ vec4 blendStipple(vec4 color, float stippleAlpha) { return color; }`);const i=!(t.draped&&t.stipplePreferContinuous),{vertex:h,fragment:d}=e;t.draped||((0,s.yu)(h,t),h.uniforms.add(new a.U("worldToScreenPerDistanceRatio",({camera:e})=>1/e.perScreenPixelRatio)).code.add(c.H`float computeWorldToScreenRatio(vec3 segmentCenter) {
466
+ float segmentDistanceToCamera = length(segmentCenter - cameraPosition);
467
+ return worldToScreenPerDistanceRatio / segmentDistanceToCamera;
468
+ }`)),e.varyings.add("vStippleDistance","float"),e.varyings.add("vStippleDistanceLimits","vec2"),e.varyings.add("vStipplePatternStretch","float"),h.code.add(c.H`
469
+ float discretizeWorldToScreenRatio(float worldToScreenRatio) {
470
+ float step = ${c.H.float(x)};
471
+
472
+ float discreteWorldToScreenRatio = log(worldToScreenRatio);
473
+ discreteWorldToScreenRatio = ceil(discreteWorldToScreenRatio / step) * step;
474
+ discreteWorldToScreenRatio = exp(discreteWorldToScreenRatio);
475
+ return discreteWorldToScreenRatio;
476
+ }
477
+ `),(0,s.Nz)(h),h.code.add(c.H`
478
+ vec2 computeStippleDistanceLimits(float startPseudoScreen, float segmentLengthPseudoScreen, float segmentLengthScreen, float patternLength) {
479
+
480
+ // First check if the segment is long enough to support fully screen space patterns.
481
+ // Force sparse mode for segments that are very large in screen space even if it is not allowed,
482
+ // to avoid imprecision from calculating with large floats.
483
+ if (segmentLengthPseudoScreen >= ${i?"patternLength":"1e4"}) {
484
+ // Round the screen length to get an integer number of pattern repetitions (minimum 1).
485
+ float repetitions = segmentLengthScreen / (patternLength * pixelRatio);
486
+ float flooredRepetitions = max(1.0, floor(repetitions + 0.5));
487
+ float segmentLengthScreenRounded = flooredRepetitions * patternLength;
488
+
489
+ float stretch = repetitions / flooredRepetitions;
490
+
491
+ // We need to impose a lower bound on the stretch factor to prevent the dots from merging together when there is only 1 repetition.
492
+ // 0.75 is the lowest possible stretch value for flooredRepetitions > 1, so it makes sense as lower bound.
493
+ vStipplePatternStretch = max(0.75, stretch);
494
+
495
+ return vec2(0.0, segmentLengthScreenRounded);
496
+ }
497
+ return vec2(startPseudoScreen, startPseudoScreen + segmentLengthPseudoScreen);
498
+ }
499
+ `),d.uniforms.add(new u.N("stipplePatternTexture",e=>e.stippleTexture),new l.m("stipplePatternPixelSizeInv",e=>1/v(e))),t.stippleOffColorEnabled&&d.uniforms.add(new o.E("stippleOffColor",e=>{return null==(t=e.stippleOffColor)?g.uY:4===t.length?t:(0,p.hZ)(f,t[0],t[1],t[2],1);var t})),e.include(n.m),t.worldSizedImagePattern?(e.varyings.add("vStippleV","float"),e.fragment.include(r.N),d.code.add(c.H`vec4 getStippleColor(out bool isClamped) {
500
+ vec2 aaCorrectedLimits = vStippleDistanceLimits + vec2(1.0, -1.0) / gl_FragCoord.w;
501
+ isClamped = vStippleDistance < aaCorrectedLimits.x || vStippleDistance > aaCorrectedLimits.y;
502
+ float u = vStippleDistance * stipplePatternPixelSizeInv;
503
+ float v = vStippleV == -1.0 ? 0.5 : vStippleV;
504
+ return texture(stipplePatternTexture, vec2(u, v));
505
+ }
506
+ vec4 getStippleColor() {
507
+ bool ignored;
508
+ return getStippleColor(ignored);
509
+ }
510
+ float getStippleSDF() {
511
+ vec4 color = getStippleColor();
512
+ return color.a == 0.0 ? -0.5 : 0.5;
513
+ }
514
+ float getStippleAlpha(float lineWidth) {
515
+ return getStippleColor().a;
516
+ }
517
+ vec4 blendStipple(vec4 color, float stippleAlpha) {
518
+ vec4 stippleColor = getStippleColor();
519
+ int mixMode = 1;
520
+ vec3 col = mixExternalColor(color.rgb, vec3(1.0), stippleColor.rgb, mixMode);
521
+ float opacity = mixExternalOpacity(color.a, 1.0, stippleColor.a, mixMode);
522
+ return vec4(col, opacity);
523
+ }`)):d.code.add(c.H`
524
+ float getStippleSDF(out bool isClamped) {
525
+ float stippleDistanceClamped = noPerspectiveRead(clamp(vStippleDistance, vStippleDistanceLimits.x, vStippleDistanceLimits.y));
526
+ float lineSizeInv = noPerspectiveRead(vLineSizeInv);
527
+
528
+ vec2 aaCorrectedLimits = vStippleDistanceLimits + vec2(1.0, -1.0) / gl_FragCoord.w;
529
+ isClamped = vStippleDistance < aaCorrectedLimits.x || vStippleDistance > aaCorrectedLimits.y;
530
+
531
+ float u = stippleDistanceClamped * stipplePatternPixelSizeInv * lineSizeInv;
532
+ u = fract(u);
533
+
534
+ float sdf = texture(stipplePatternTexture, vec2(u, 0.5)).r;
535
+
536
+ return (sdf - 0.5) * vStipplePatternStretch + 0.5;
537
+ }
538
+
539
+ float getStippleSDF() {
540
+ bool ignored;
541
+ return getStippleSDF(ignored);
542
+ }
543
+
544
+ float getStippleAlpha(float lineWidth) {
545
+ bool isClamped;
546
+ float stippleSDF = getStippleSDF(isClamped);
547
+ float antiAliasedResult = clamp(stippleSDF * lineWidth + 0.5, 0.0, 1.0);
548
+ return isClamped ? floor(antiAliasedResult + 0.5) : antiAliasedResult;
549
+ }
550
+
551
+ vec4 blendStipple(vec4 color, float stippleAlpha) {
552
+ return ${t.stippleOffColorEnabled?"mix(color, stippleOffColor, stippleAlpha)":"vec4(color.rgb, color.a * stippleAlpha)"};
553
+ }
554
+ `),d.code.add(c.H`
555
+ void discardByStippleAlpha(float stippleAlpha, float threshold) {
556
+ ${(0,c.If)(!t.stippleOffColorEnabled,"if (stippleAlpha < threshold) { discard; }")}
557
+ }
558
+ `)}function v(e){const t=e.stipplePattern;return(0,h.sL)(t)?t.length:t?d(t)/t.pixelRatio:1}const x=.4},28974(e,t,i){i.d(t,{r:()=>a});var r=i(91829);i(18845),i(63907);(0,r.CN)(.25,.25,.75,.75),i(21231),i(67171);var n=i(77949),s=i(33094),o=i(31821);function a(e,t){const i=e.vertex,r=t.hasScreenSizePerspective;(0,n.Nz)(i),null==i.uniforms.get("markerScale")&&i.constants.add("markerScale","float",1),i.constants.add("markerSizePerLineWidth","float",10).code.add(o.H`
559
+ float getLineWidth(${(0,o.If)(r,"vec3 pos")}) {
560
+ return max(getSize(${(0,o.If)(r,"pos")}), 1.0) * pixelRatio;
561
+ }
562
+
563
+ float getScreenMarkerSize(float lineWidth) {
564
+ return markerScale * markerSizePerLineWidth * lineWidth;
565
+ }
566
+ `),2===t.space&&(i.constants.add("maxSegmentLengthFraction","float",.45),i.uniforms.add(new s.U("perRenderPixelRatio",e=>e.camera.perRenderPixelRatio)),i.code.add(o.H`
567
+ bool areWorldMarkersHidden(vec3 pos, vec3 other) {
568
+ vec3 midPoint = mix(pos, other, 0.5);
569
+ float distanceToCamera = length(midPoint);
570
+ float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
571
+ float worldMarkerSize = getScreenMarkerSize(getLineWidth(${(0,o.If)(r,"pos")})) * screenToWorldRatio;
572
+ float segmentLen = length(pos - other);
573
+ return worldMarkerSize > maxSegmentLengthFraction * segmentLen;
574
+ }
575
+
576
+ float getWorldMarkerSize(vec3 pos) {
577
+ float distanceToCamera = length(pos);
578
+ float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
579
+ return getScreenMarkerSize(getLineWidth(${(0,o.If)(r,"pos")})) * screenToWorldRatio;
580
+ }
581
+ `))}},82094(e,t,i){i.d(t,{Z:()=>r});const r=i(31821).H`vec4(0.0, 0.0, 2.0, 1.0)`},66269(e,t,i){function r(e){e.vertex.code.add("#define noPerspectiveWrite(x, w) (x * w)")}function n(e){e.fragment.code.add("#define noPerspectiveRead(x) (x * gl_FragCoord.w)")}i.d(t,{F:()=>r,m:()=>n})},9273(e,t,i){i.d(t,{R:()=>n});var r=i(74333);class n extends r.n{constructor(e,t){super(e,"usampler2D",1,(i,r,n)=>i.bindTexture(e,t(r,n)))}}},78230(e,t,i){i.d(t,{x:()=>h});var r=i(93687),n=i(15142),s=i(35522),o=i(51850),a=i(82919),l=i(71351),c=i(94008),u=i(620);class h{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(e,t){this.objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new d,this._objectCount=0,t&&(void 0!==t.maximumObjectsPerNode&&(this._maximumObjectsPerNode=t.maximumObjectsPerNode),void 0!==t.maximumDepth&&(this._maximumDepth=t.maximumDepth))}destroy(){this._degenerateObjects.clear(),d.clearPool(),R[0]=null,I.prune(),H.prune()}add(e){const t=Array.from(e);this._grow(t);const i=d.acquire();for(const e of t)++this._objectCount,this._isDegenerate(e)?this._degenerateObjects.add(e):(i.init(this._root),this._add(e,i));d.release(i)}remove(e,t=null){this._objectCount-=e.length;const i=d.acquire();for(const r of e){const e=t??this.objectToBoundingSphere(r);C(e.radius)?(i.init(this._root),f(r,e,i)):this._degenerateObjects.delete(r)}d.release(i),this._shrink()}update(e,t){if(!C(t.radius)&&this._isDegenerate(e))return;const i=function(e){return R[0]=e,R}(e);this.remove(i,t),this.add(i)}forEachAlongRay(e,t,i){const r=(0,l.LV)(e,t);p(this._root,e=>{if(!function(e,t){return _(t.bounds.center,2*-t.halfSize,L),_(t.bounds.center,2*t.halfSize,P),(0,u.O_)(e.origin,e.direction,L,P)}(r,e))return!1;const t=e.node;return t.terminals.forAll(e=>{this._intersectsObject(r,e)&&i(e)}),null!==t.residents&&t.residents.forAll(e=>{this._intersectsObject(r,e)&&i(e)}),!0})}forEachAlongRayWithVerticalOffset(e,t,i,r){const n=(0,l.LV)(e,t);p(this._root,e=>{if(!function(e,t,i){return _(t.bounds.center,2*-t.halfSize,L),_(t.bounds.center,2*t.halfSize,P),i.applyToMinMax(L,P),(0,u.O_)(e.origin,e.direction,L,P)}(n,e,r))return!1;const t=e.node;return t.terminals.forAll(e=>{this._intersectsObjectWithOffset(n,e,r)&&i(e)}),null!==t.residents&&t.residents.forAll(e=>{this._intersectsObjectWithOffset(n,e,r)&&i(e)}),!0})}forEach(e){p(this._root,t=>{const i=t.node;return i.terminals.forAll(e),null!==i.residents&&i.residents.forAll(e),!0}),this._degenerateObjects.forEach(e)}forEachDegenerateObject(e){this._degenerateObjects.forEach(e)}findClosest(e,t,i,r=()=>!0,n=1/0){let o=1/0,l=1/0,c=null;const u=S(e,t),h=s=>{if(--n,!r(s))return;const u=this.objectToBoundingSphere(s);if(!(0,a.m7)(i,u))return;const h=w(e,t,u.center),d=h-u.radius,p=h+u.radius;d<o&&(o=d,l=p,c=s)};return g(this._root,r=>{if(n<=0||!(0,a.m7)(i,r.bounds))return!1;if((0,s.hs)(M,u,r.halfSize),(0,s.WQ)(M,M,r.bounds.center),w(e,t,M)>l)return!1;const o=r.node;return o.terminals.forAll(e=>h(e)),null!==o.residents&&o.residents.forAll(e=>h(e)),!0},e,t),c}forEachInDepthRange(e,t,i,r,n,o,l){let c=-1/0,u=1/0;const h={setRange:e=>{1===i?(c=Math.max(c,e.near),u=Math.min(u,e.far)):(c=Math.max(c,-e.far),u=Math.min(u,-e.near))}};h.setRange(r);const d=w(t,i,e),p=S(t,i),f=S(t,-i),m=e=>{if(!l(e))return;const r=this.objectToBoundingSphere(e),s=w(t,i,r.center)-d,p=s-r.radius,g=s+r.radius;p>u||g<c||!(0,a.m7)(o,r)||n(e,h)};g(this._root,e=>{if(!(0,a.m7)(o,e.bounds))return!1;if((0,s.hs)(M,p,e.halfSize),(0,s.WQ)(M,M,e.bounds.center),w(t,i,M)-d>u)return!1;if((0,s.hs)(M,f,e.halfSize),(0,s.WQ)(M,M,e.bounds.center),w(t,i,M)-d<c)return!1;const r=e.node;return r.terminals.forAll(e=>m(e)),null!==r.residents&&r.residents.forAll(e=>m(e)),!0},t,i)}forEachNode(e){p(this._root,t=>e(t.node,t.bounds,t.halfSize,t.depth))}forEachNeighbor(e,t){const i=t.radius,r=t.center,n=t=>{const n=this.objectToBoundingSphere(t),o=n.radius,a=i+o;return!((0,s.hG)(n.center,r)-a*a<=0)||e(t)};let o=!0;const a=e=>{o&&(o=n(e))};p(this._root,e=>{const t=e.bounds.radius,n=i+t;if((0,s.hG)(e.bounds.center,r)-n*n>0)return!1;const l=e.node;return l.terminals.forAll(a),o&&null!==l.residents&&l.residents.forAll(a),o}),o&&this.forEachDegenerateObject(a)}_intersectsObject(e,t){const i=this.objectToBoundingSphere(t);return!(i.radius>0)||i.intersectRay(e)}_intersectsObjectWithOffset(e,t,i){const r=this.objectToBoundingSphere(t);return!(r.radius>0)||i.applyToBoundingSphere(r).intersectRay(e)}_add(e,t){t.advanceTo(this.objectToBoundingSphere(e))?t.node.terminals.push(e):(t.node.residents.push(e),t.node.residents.length>this._maximumObjectsPerNode&&t.depth<this._maximumDepth&&this._split(t))}_split(e){const t=e.node.residents;e.node.residents=null;for(let i=0;i<t.length;i++){const r=d.acquire().init(e);this._add(t.at(i),r),d.release(r)}}_grow(e){if(b(e,e=>this.objectToBoundingSphere(e),D),C(D.radius)&&!this._fitsInsideTree(D))if(v(this._root.node))this._root.bounds.copyFrom(D),this._root.halfSize=1.25*this._root.bounds.radius,this._root.updateBoundsRadiusFromHalfSize();else{const e=this._rootBoundsForRootAsSubNode(D);this._placingRootViolatesMaxDepth(e)?this._rebuildTree(D,e):this._growRootAsSubNode(e),d.release(e)}}_rebuildTree(e,t){F.center=t.bounds.center,F.radius=t.halfSize,b([e,F],e=>e,N);const i=d.acquire().init(this._root);this._root.initFrom(null,N,N.radius),this._root.increaseHalfSize(1.25),p(i,e=>(this.add(e.node.terminals.data),null!==e.node.residents&&this.add(e.node.residents.data),!0)),d.release(i)}_placingRootViolatesMaxDepth(e){const t=Math.log(e.halfSize/this._root.halfSize)*Math.LOG2E;let i=0;return p(this._root,e=>(i=Math.max(i,e.depth),i+t<=this._maximumDepth)),i+t>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const t=e.radius,i=e.center;let r=-1/0;const n=this._root.bounds.center,s=this._root.halfSize;for(let e=0;e<3;e++){const o=n[e]-s-(i[e]-t),a=i[e]+t-(n[e]+s),l=Math.max(0,Math.ceil(o/(2*s))),c=Math.max(0,Math.ceil(a/(2*s)))+1,u=2**Math.ceil(Math.log(l+c)*Math.LOG2E);r=Math.max(r,u),z[e].min=l,z[e].max=c}for(let e=0;e<3;e++){let t=z[e].min,i=z[e].max;const o=(r-(t+i))/2;t+=Math.ceil(o),i+=Math.floor(o);const a=n[e]-s-t*s*2;O.center[e]=a+(i+t)*s}const o=r*s;return O.radius=o*E,d.acquire().initFrom(null,O,o,0)}_growRootAsSubNode(e){const t=this._root.node;D.center=this._root.bounds.center,D.radius=this._root.halfSize,this._root.init(e),e.advanceTo(D,null,!0),e.node.children=t.children,e.node.residents=t.residents,e.node.terminals=t.terminals}_shrink(){for(;;){const e=this._findShrinkIndex();if(-1===e)break;this._root.advance(e),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let e=null;const t=this._root.node.children;let i=0,r=0;for(;r<t.length&&null==e;)i=r++,e=t[i];for(;r<t.length;)if(t[r++])return-1;return i}_isDegenerate(e){return!C(this.objectToBoundingSphere(e).radius)}_fitsInsideTree(e){const t=this._root.bounds,i=this._root.halfSize;return e.radius<=i&&e.center[0]>=t.center[0]-i&&e.center[0]<=t.center[0]+i&&e.center[1]>=t.center[1]-i&&e.center[1]<=t.center[1]+i&&e.center[2]>=t.center[2]-i&&e.center[2]<=t.center[2]+i}_nodeToJSON(e){const t=e.children.map(e=>e?this._nodeToJSON(e):null),i=e.residents?.map(e=>this.objectToBoundingSphere(e)),r=e.terminals?.map(e=>this.objectToBoundingSphere(e));return{children:t,residents:i,terminals:r}}}class d{constructor(){this.bounds=new c.iy,this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(e,t,i,r=this.depth){return this.node=null!=e?e:d.createEmptyNode(),t&&this.bounds.copyFrom(t),this.halfSize=i,this.depth=r,this}increaseHalfSize(e){this.halfSize*=e,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds.radius=this.halfSize*E}advance(e){let t=this.node.children[e];t||(t=d.createEmptyNode(),this.node.children[e]=t),this.node=t,this.halfSize/=2,this.depth++;const i=T[e];return this.bounds.center[0]+=i[0]*this.halfSize,this.bounds.center[1]+=i[1]*this.halfSize,this.bounds.center[2]+=i[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(e,t,i=!1){for(;;){if(this.isTerminalFor(e))return t?.(this,-1),!0;if(this.isLeaf()){if(!i)return t?.(this,-1),!1;this.node.residents=null}const r=this._childIndex(e);t?.(this,r),this.advance(r)}}isLeaf(){return null!=this.node.residents}isTerminalFor(e){return e.radius>this.halfSize/2}_childIndex(e){const t=this.bounds.center;return(t[0]<e.center[0]?1:0)+(t[1]<e.center[1]?2:0)+(t[2]<e.center[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new n.A({shrink:!0}),residents:new n.A({shrink:!0})}}static{this._pool=new r.A(()=>new d)}static acquire(){return d._pool.acquire()}static release(e){d._pool.release(e)}static clearPool(){d._pool.prune()}}function p(e,t){let i=d.acquire().init(e);const r=[i];for(;0!==r.length;){if(i=r.pop(),t(i)&&!i.isLeaf())for(let e=0;e<i.node.children.length;e++)i.node.children[e]&&r.push(d.acquire().init(i).advance(e));d.release(i)}}function g(e,t,i,r=1){let n=d.acquire().init(e);const s=[n];for(function(e,t,i){if(!H.length)for(let e=0;e<8;++e)H.push({index:0,distance:0});for(let i=0;i<8;++i){const r=T[i];H.data[i].index=i,H.data[i].distance=w(e,t,r)}H.sort((e,t)=>e.distance-t.distance);for(let e=0;e<8;++e)i[e]=H.data[e].index}(i,r,V);0!==s.length;){if(n=s.pop(),t(n)&&!n.isLeaf())for(let e=7;e>=0;--e){const t=V[e];n.node.children[t]&&s.push(d.acquire().init(n).advance(t))}d.release(n)}}function f(e,t,i){I.clear();const r=i.advanceTo(t,(e,t)=>{I.push(e.node),I.push(t)})?i.node.terminals:i.node.residents;if(r.removeUnordered(e),0===r.length)for(let e=I.length-2;e>=0&&m(I.data[e],I.data[e+1]);e-=2);}function m(e,t){return t>=0&&(e.children[t]=null),!!v(e)&&(null===e.residents&&(e.residents=new n.A({shrink:!0})),!0)}function v(e){if(0!==e.terminals.length)return!1;if(null!==e.residents)return 0===e.residents.length;for(let t=0;t<e.children.length;t++)if(e.children[t])return!1;return!0}function x(e,t){e[0]=Math.min(e[0],t.center[0]-t.radius),e[1]=Math.min(e[1],t.center[1]-t.radius),e[2]=Math.min(e[2],t.center[2]-t.radius)}function y(e,t){e[0]=Math.max(e[0],t.center[0]+t.radius),e[1]=Math.max(e[1],t.center[1]+t.radius),e[2]=Math.max(e[2],t.center[2]+t.radius)}function _(e,t,i){i[0]=e[0]+t,i[1]=e[1]+t,i[2]=e[2]+t}function b(e,t,i){L[0]=1/0,L[1]=1/0,L[2]=1/0,P[0]=-1/0,P[1]=-1/0,P[2]=-1/0;for(const i of e){const e=t(i);C(e.radius)&&(x(L,e),y(P,e))}(0,s.Cc)(i.center,L,P,.5),i.radius=Math.max(P[0]-L[0],P[1]-L[1],P[2]-L[2])/2}function S(e,t){let i,r=1/0;for(let n=0;n<8;++n){const s=w(e,t,A[n]);s<r&&(r=s,i=A[n])}return i}function w(e,t,i){return t*(e[0]*i[0]+e[1]*i[1]+e[2]*i[2])}function C(e){return!isNaN(e)&&e!==-1/0&&e!==1/0&&e>0}const T=[(0,o.fA)(-1,-1,-1),(0,o.fA)(1,-1,-1),(0,o.fA)(-1,1,-1),(0,o.fA)(1,1,-1),(0,o.fA)(-1,-1,1),(0,o.fA)(1,-1,1),(0,o.fA)(-1,1,1),(0,o.fA)(1,1,1)],A=[(0,o.fA)(-1,-1,-1),(0,o.fA)(-1,-1,1),(0,o.fA)(-1,1,-1),(0,o.fA)(-1,1,1),(0,o.fA)(1,-1,-1),(0,o.fA)(1,-1,1),(0,o.fA)(1,1,-1),(0,o.fA)(1,1,1)],E=Math.sqrt(3),R=[null],O=new c.iy,M=(0,o.vt)(),L=(0,o.vt)(),P=(0,o.vt)(),I=new n.A,D=new c.iy,F=new c.iy,N=new c.iy,z=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],H=new n.A,V=[0,0,0,0,0,0,0,0]},52728(e,t,i){i.d(t,{m:()=>m});var r=i(63907);class n{constructor(e){this.internalFormat=e,this.channelByteStride=4,this.dataType=r.ld.UNSIGNED_INT,this.elementArrayConstructor=Uint32Array,this.pixelFormat=o[e],this.channels=s[this.pixelFormat],this.byteStride=this.channelByteStride*this.channels}}const s={36244:1,33320:2,36249:4},o={[r.H0.R32UI]:36244,[r.H0.RG32UI]:33320,[r.H0.RGBA32UI]:36249},a=[new n(r.H0.RGBA32UI),new n(r.H0.RG32UI),new n(r.H0.R32UI)];function l(e){let t=1/0,i=null;for(const r of a){const n=r.byteStride,s=(n-e%n)%n;s<t&&(t=s,i=r)}return i??a[2]}var c=i(20498),u=i(13030),h=i(90239);class d{constructor(e,t,i){this.elementCount=e,this.elementType=t,this.bufferViewConstructor=i,this.byteSize=function(e){return(0,h.GJ)(e.ElementType)*e.ElementCount}(i)}}const p={u8:new d(1,"uint",u.SL),vec4u8:new d(4,"uint",u.XP),unorm8:new d(1,"float",u.dy),vec4unorm8:new d(4,"float",u.td),snorm16:new d(1,"float",u.Qy),vec2snorm16:new d(2,"float",u.ES),f16:new d(1,"float",c.SX?u.XW:u.Y$),vec4f16:new d(4,"float",c.SX?u.jz:u.Eq),f32:new d(1,"float",u.Y$),vec2f32:new d(2,"float",u.gH),vec3f32:new d(3,"float",u.xs),vec4f32:new d(4,"float",u.Eq),mat3f32:new d(9,"float",u.jZ)};class g{constructor(e,t,i,r){this._declaration=e,this._byteOffset=t,this._creationInfo=r,this._startTexel=Math.floor(t/i);const n=r.byteSize;this._numTexels=Math.ceil((t+n)/i)-this._startTexel,this._texelByteStride=i}get name(){return this._declaration.name}get fieldType(){return this._declaration.type}get byteOffset(){return this._byteOffset}get startTexel(){return this._startTexel}get numTexels(){return this._numTexels}get texelByteStride(){return this._texelByteStride}get elementType(){return this._creationInfo.elementType}get elementCount(){return this._creationInfo.elementCount}get byteSize(){return this._creationInfo.byteSize}get bufferViewConstructor(){return this._creationInfo.bufferViewConstructor}}class f{constructor(e,t,i,r=0){this.layout=e,this.byteOffset=r,this._bufferViews=new Map,this.buffer="number"==typeof t?new ArrayBuffer(t*e.byteStride):t,this.texelElementBuffer=new i(this.buffer,r);const n=this._bufferViews;for(const[e,t]of this.layout.fields)n.set(e,new t.bufferViewConstructor(this.buffer,r+t.byteOffset,this.layout.byteStride))}get stride(){return this.layout.byteStride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(e,t){const i=this._bufferViews.get(e);return null!=i&&i.elementCount===t.ElementCount&&i.elementType===t.ElementType?i:null}get usedMemory(){return this.byteLength}}class m{constructor(e){this._fields=new Map;let t=0;const i=[];for(let r=0;r<e.length;++r){const n=e[r],{type:s}=n,o=p[s];i.push({declaration:n,byteOffset:t,creationInfo:o}),t+=o.byteSize}this.texelFormatInfo=l(t);const{texelByteStride:r}=this;t=Math.ceil(t/r)*r;const n=t,s=this._fields;for(const{declaration:e,byteOffset:t,creationInfo:n}of i)s.set(e.name,new g(e,t,r,n));this.byteStride=n,this.texelStride=Math.ceil(n/r)}get texelByteStride(){return this.texelFormatInfo.byteStride}get texelElementArrayConstructor(){return this.texelFormatInfo.elementArrayConstructor}get stride(){return this.byteStride}get fields(){return this._fields}createBuffer(e){return new f(this,e,this.texelElementArrayConstructor)}createView(e,t){return new f(this,e,this.texelElementArrayConstructor,t)}}},96095(e,t,i){i.d(t,{sL:()=>r}),i(13069);function r(e){return null!=e&&"image"in e}},54073(e,t,i){i.d(t,{Q:()=>h});var r=i(37585),n=i(48163),s=i(78659);const o=(0,s.Kp)(1),a=(0,s.Kp)(1);var l=i(47286),c=i(20304),u=i(31821);function h(e,t){const{hasAnimation:i,animation:n}=t;if(!i)return;const{attributes:s,varyings:h,vertex:p,fragment:g}=e;s.add("timeStamps","vec4"),h.add("vTimeStamp","float"),h.add("vFirstTime","float"),h.add("vLastTime","float"),h.add("vTransitionType","float"),p.main.add(u.H`vTimeStamp = timeStamps.x;
582
+ vFirstTime = timeStamps.y;
583
+ vLastTime = timeStamps.z;
584
+ vTransitionType = timeStamps.w;`),3===n&&g.constants.add("decayRate","float",2.3),g.code.add(u.H`
585
+ float getTrailOpacity(float x) {
586
+ if (x < 0.0) {
587
+ return 0.0;
588
+ }
589
+
590
+ ${function(e){switch(e){case 2:return"return x >= 0.0 && x <= 1.0 ? 1.0 : 0.0;";case 3:return"float cutOff = exp(-decayRate);\n return (exp(-decayRate * x) - cutOff) / (1.0 - cutOff);";default:return"return 1.0;"}}(n)}
591
+ }`),g.uniforms.add(new c.m("timeElapsed",e=>e.timeElapsed),new c.m("trailLength",e=>e.trailLength),new c.m("speed",e=>e.animationSpeed),new l.G("startEndTime",e=>(0,r.hZ)(d,e.startTime,e.endTime))),g.constants.add("fadeInTime","float",a),g.constants.add("fadeOutTime","float",o),g.constants.add("incomingTransition","int",0),g.constants.add("outgoingTransition","int",2),g.code.add(u.H`float fadeIn(float x) {
592
+ return smoothstep(0.0, fadeInTime, x);
593
+ }
594
+ float fadeOut(float x) {
595
+ return isinf(fadeOutTime) ? 1.0 : smoothstep(fadeOutTime, 0.0, x);
596
+ }
597
+ void updateAlphaIf(inout float alpha, bool condition, float newAlpha) {
598
+ alpha = condition ? min(alpha, newAlpha) : alpha;
599
+ }
600
+ vec4 animate(vec4 color) {
601
+ float startTime = startEndTime[0];
602
+ float endTime = startEndTime[1];
603
+ float totalTime = vLastTime - vFirstTime;
604
+ float actualFadeOutTime = min(fadeOutTime * speed, trailLength);
605
+ float longStreamlineThreshold = (fadeInTime + 1.0) * speed + actualFadeOutTime;
606
+ bool longStreamline = totalTime > longStreamlineThreshold;
607
+ float totalTimeWithFadeOut = longStreamline && actualFadeOutTime != trailLength ? totalTime : totalTime + actualFadeOutTime;
608
+ float fadeOutStartTime = longStreamline ? totalTime - actualFadeOutTime : totalTime;
609
+ float originTime = -vFirstTime;
610
+ float actualEndTime = int(vTransitionType) == outgoingTransition ? min(endTime, startTime + vLastTime / speed) : endTime;
611
+ vec4 animatedColor = color;
612
+ if (speed == 0.0) {
613
+ float alpha = getTrailOpacity((totalTimeWithFadeOut - (vTimeStamp - vFirstTime)) / trailLength);
614
+ updateAlphaIf(alpha, !isinf(actualEndTime), fadeOut(timeElapsed - actualEndTime));
615
+ updateAlphaIf(alpha, true, fadeIn(timeElapsed - startTime));
616
+ animatedColor.a *= alpha;
617
+ return animatedColor;
618
+ }
619
+ float relativeStartTime = mod(startTime, totalTimeWithFadeOut);
620
+ float shiftedTimeElapsed = timeElapsed - relativeStartTime + originTime;
621
+ float headRelativeToFirst = mod(shiftedTimeElapsed * speed, totalTimeWithFadeOut);
622
+ float vRelativeToHead = headRelativeToFirst - originTime - vTimeStamp;
623
+ float vAbsoluteTime = timeElapsed - vRelativeToHead / speed;
624
+ if (startTime > timeElapsed) {
625
+ return vec4(0.0);
626
+ }
627
+ float alpha = getTrailOpacity(vRelativeToHead / trailLength);
628
+ updateAlphaIf(alpha, true, fadeIn(timeElapsed - startTime));
629
+ updateAlphaIf(alpha, !isinf(actualEndTime), fadeOut(timeElapsed - actualEndTime));
630
+ updateAlphaIf(alpha, int(vTransitionType) != incomingTransition, step(startTime, vAbsoluteTime));
631
+ updateAlphaIf(alpha, headRelativeToFirst > fadeOutStartTime, fadeOut((headRelativeToFirst - fadeOutStartTime) / speed));
632
+ alpha *= fadeIn(vTimeStamp - vFirstTime);
633
+ animatedColor.a *= alpha;
634
+ return animatedColor;
635
+ }`)}const d=(0,n.vt)()},7298(e,t,i){i.d(t,{bP:()=>s,hl:()=>o,qB:()=>a});var r=i(1843),n=i(16943);function s(e){const t=(0,r.BP)().u32("textureElementIndex",{integer:!0}).vec4f16("previousDelta").vec4f16("nextDelta").f32("u0").vec2f16("lineParameters");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f32("size"),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),(0,n.E)()&&t.vec4u8("olidColor"),e.hasAnimation&&t.vec4f16("timeStamps"),t}const o=new(i(52728).m)([{type:"vec3f32",name:"position"}]);function a(e){return o}},11435(e,t,i){i.d(t,{W:()=>H});var r=i(24326),n=i(5482),s=i(34275),o=i(20498),a=i(33094),l=i(31821),c=i(51976);function u(e){switch(e.elementType){case"float":switch(e.elementCount){case 1:return l.H`float`;case 2:return l.H`vec2`;case 3:return l.H`vec3`;case 4:return l.H`vec4`;case 9:return l.H`mat3`;default:e.elementCount}break;case"int":switch(e.elementCount){case 1:return l.H`int`;case 2:return l.H`ivec2`;case 3:return l.H`ivec3`;case 4:return l.H`ivec4`;case 9:throw new Error("Invalid element count 9 for type int");default:e.elementCount}break;case"uint":switch(e.elementCount){case 1:return l.H`uint`;case 2:return l.H`uvec2`;case 3:return l.H`uvec3`;case 4:return l.H`uvec4`;case 9:throw new Error("Invalid element count 9 for type uint");default:e.elementCount}break;default:e.elementType}throw new Error("unsupported field")}const h=new a.U("constNaN",()=>NaN,{supportsNaN:!0});class d extends c.K{constructor(e){super(),this.supportNaN=e}}function p(e,t){const i=t?.supportNaN;i&&(e.uniforms.add(h),e.code.add(l.H`bool bitsEncodeFloat16NaN(highp uint bits) {
636
+ const highp uint nanExponent = 0x00007c00u;
637
+ highp uint exponent = bits & nanExponent;
638
+ highp uint mantissa = bits & 0x000003ffu;
639
+ return exponent == nanExponent && mantissa != 0u;
640
+ }`)),e.code.add(l.H`
641
+ mediump float unpackHalf1x16(highp uint bits) {
642
+ ${(0,l.If)(i,l.H`
643
+ if (bitsEncodeFloat16NaN(bits)) {
644
+ return constNaN;
645
+ }`)}
646
+ return unpackHalf2x16(bits).x;
647
+ }`),e.code.add(l.H`
648
+ mediump vec2 unpackHalf2x16NaNSupport(highp uint bits) {
649
+ vec2 result = unpackHalf2x16(bits);
650
+ ${(0,l.If)(i,l.H`
651
+ if (bitsEncodeFloat16NaN(bits)) {
652
+ result.x = constNaN;
653
+ }
654
+ if (bitsEncodeFloat16NaN(bits >> ${l.H.uint(C[2])})) {
655
+ result.y = constNaN;
656
+ }
657
+ `)}
658
+ return result;
659
+ }`)}function g(e,t){const i=t?.supportNaN;i&&(e.uniforms.add(h),e.code.add(l.H`bool bitsEncodeFloat32NaN(highp uint bits) {
660
+ const highp uint nanExponent = 0x7f800000u;
661
+ highp uint exponent = bits & nanExponent;
662
+ highp uint mantissa = bits & 0x007fffffu;
663
+ return exponent == nanExponent && mantissa != 0u;
664
+ }`)),e.code.add(l.H`
665
+ highp float unpackFloat1x32(highp uint bits) {
666
+ ${(0,l.If)(i,l.H`
667
+ if (bitsEncodeFloat32NaN(bits)) {
668
+ return constNaN;
669
+ }`)}
670
+ return uintBitsToFloat(bits);
671
+ }`)}function f(e){e.code.add(l.H`mediump int unpackInt1x16(highp uint bits) {
672
+ highp uint signExtendedBits = (bits & 0x8000u) != 0u ? (bits | 0xffff0000u) : bits;
673
+ return int(signExtendedBits);
674
+ }`)}function m(e,t){const{fieldType:i}=e;return`${(0,S[i])(function(e,t){const{byteOffset:i,byteSize:r}=e,n=t.channelByteStride,s=t.byteStride,o=Math.ceil(r/w),a=A[t.channels],c=new Array;for(let e=0;e<o;++e){const t=e*w,o=i+t,u=r-t,h=Math.min(u,w);let d=0;const p=new Array;for(;d<h;){const e=o+d,t=Math.floor(e/s),i=e%s,r=Math.floor(i/n),c=i%n,u=n-c,g=h-d,f=Math.min(u,g),m=l.H`texel${l.H.int(t)}${a[r]}`,v=4===f?"":l.H` & ${l.H.hexuint(T[f])}`,x=0===c?"":l.H` >> ${l.H.uint(C[c])}`,y=l.H`((${m}${x})${v})`,_=0===d?"":l.H` << ${l.H.uint(C[d])}`,b=l.H`(${y})${_}`;p.push(b),d+=f}c.push(l.H`(${p.join(" | ")})`)}return c}(e,t))}`}function v(e,t){const i=[];for(const t of e){const e=l.H`unpackFloat1x32(${t})`;i.push(e)}return i.join(t)}(0,n.Cg)([(0,c.W)()],d.prototype,"supportNaN",void 0);const x=e=>l.H`${e[0]}`,y=e=>{const t=e[0],i=l.H`uvec4(${l.H.uint(C[0])}, ${l.H.uint(C[1])}, ${l.H.uint(C[2])}, ${l.H.uint(C[3])})`,r=l.H`uvec4(${l.H.hexuint(T[1])})`;return l.H`((uvec4(${t}) >> ${i}) & ${r})`},_=e=>l.H`unpackFloat1x32(${e[0]})`,b=e=>l.H`vec4(${v(e,", ")})`,S={u8:x,unorm8:e=>l.H`(float(${x(e)})/${l.H.float(s.DW)})`,vec4unorm8:e=>l.H`(vec4(${y(e)})/${l.H.float(s.DW)})`,snorm16:e=>l.H`unpackSnorm2x16(${e[0]}).x`,vec2snorm16:e=>l.H`unpackSnorm2x16(${e[0]})`,f16:o.SX?e=>l.H`unpackHalf1x16(${e[0]})`:_,vec4f16:o.SX?e=>l.H`vec4(unpackHalf2x16NaNSupport(${e[0]}), unpackHalf2x16NaNSupport(${e[1]}))`:b,f32:_,vec4u8:y,vec2f32:e=>l.H`vec2(${v(e,", ")})`,vec3f32:e=>l.H`vec3(${v(e,", ")})`,vec4f32:b,mat3f32:e=>l.H`mat3(${v(e,",\n")})`},w=4,C=[0,8,16,24],T=[0,255,65535,16777215,4294967295],A={1:[l.H``],2:[l.H`.x`,l.H`.y`],4:[l.H`.x`,l.H`.y`,l.H`.z`,l.H`.w`]};var E=i(620),R=i(14113);const O=new d(!0),M=new d(!1);class L{constructor(e,t){this._shader=e,this._namespace=t,this._used=new Map}getItemSuffix(e){return 0===e?"":`${e<0?"Minus":"Plus"}${Math.abs(e)}`}getItemDataName(e=0){return`${this._namespace}ItemData${this.getItemSuffix(e)}`}getStructName(e=0){return`${this._namespace}TextureBackedBufferItemData${this.getItemSuffix(e)}`}getFetchName(e=0){return`${this._namespace}fetchTextureBackedBufferItemData${this.getItemSuffix(e)}`}getStrideName(){return`${this._namespace}tbbStride`}getTextureAttribute(e,t=0){const i=this._used,r=this.getItemDataName(t);let n=i.get(t);return null==n&&(n=new Set,i.set(t,n)),n.add(e),l.H`${r}.${e}`}generateVertexCode(e){const{_shader:t,_used:i}=this,r=new R.Cy(t.vertex);for(const t of i.keys())this._generateFetchFunction(t,r,e);return r.generateSource()}generateVertexMainCode(e){const{_shader:t,_used:i}=this,r=new R.Cy(t.vertex);for(const t of i.keys())this._generateFetchFunctionCall(t,r,e);return r.generateSource()}_generateFetchFunctionCall(e,t,i){const{itemIndexExpression:r}=i,n=this._used.get(e);if(null==n||0===n.size)return;const s=this.getItemDataName(e),o=this.getFetchName(e);t.add(l.H`${s} = ${o}(${r});`)}_getIndexOffset(e=0){return 0===e?l.H``:l.H`${e<0?"-":"+"}${l.H.uint(Math.abs(e))}`}_generateFetchFunction(e,t,i){const{bufferUniform:r,layout:n}=i,{texelFormatInfo:s}=n,o=this._used.get(e);if(null==o||0===o.size)return;const a=this.getStrideName(),c=this.getStructName(e),h=this.getItemDataName(e),d=this.getFetchName(e),p=this._getIndexOffset(e),g=new Array;for(const e of n.fields.values())o.has(e.name)&&g.push(e);if(0===g.length)return;const f=[];for(let e=0;e<n.texelStride;++e)f.push(!1);for(const e of g)for(let t=0;t<e.numTexels;++t)f[e.startTexel+t]=!0;t.add(l.H`
675
+ struct ${c} {`);for(const e of g)t.add(l.H`\t${u(e)} ${e.name};`);t.add(l.H`};`),t.add(l.H`\n${c} ${d}( highp uint baseIndex ) {
676
+ ${c} itemData;
677
+ highp uint index = (baseIndex${p}) * ${a};
678
+ highp uint rowWidth = uint(textureSize(${r.name}, 0).x);
679
+ int coordX = int(index % rowWidth);
680
+ int coordY = int(index / rowWidth);\n`);const v=P[s.channels],x=I[s.channels];for(let e=0;e<f.length;++e)!1!==f[e]&&t.add(l.H`highp ${v} texel${l.H.int(e)} = texelFetch(${r.name}, ivec2(coordX + ${l.H.int(e)}, coordY), 0)${x};`);for(const e of g)t.add(l.H`itemData.${e.name} = ${m(e,s)};`);t.add(l.H`return itemData;\n}`),t.add(l.H`${c} ${h};`)}}const P={1:l.H`uint`,2:l.H`uvec2`,4:l.H`uvec4`},I={1:l.H`.x`,2:l.H`.xy`,4:""};var D=i(74333);class F extends D.n{constructor(e,t){super(e,"usampler2D",2,(i,r,n)=>i.bindTexture(e,t(r,n)))}}var N=i(7298);const z=new class{constructor(e){this._parameters=e,this.moduleId=(0,r.c)(),this.namespace=`_tbb_${this.moduleId}_`}createBuilder(e,t){let i=null;const r=e=>{i=this._buildTextureBackedBufferShaderCode(e)};return t?e.include(r,t):e.include(r),(0,E.vA)(null!=i,"Valid builder expected."),i}_buildTextureBackedBufferShaderCode(e){const{namespace:t,_parameters:i}=this,{bufferUniform:r,layout:n}=i,s=i.enableNaNSupport?O:M,{vertex:o}=e,a=new L(e,t);o.include(g,s),o.include(p,s),o.include(f);const l=a.getStrideName(),c=a.getStructName(),u=a.getFetchName(),h=a.getItemDataName();for(const e of[l,c,u,h])(0,E.vA)(e.length<1024,"Identifiers do not have a valid length");return o.constants.add(l,"uint",n.texelStride),o.uniforms.add(r),o.code.add(()=>a.generateVertexCode(i)),o.main.add(()=>a.generateVertexMainCode(i)),a}}({layout:N.hl,itemIndexExpression:"textureElementIndex",bufferUniform:new F("componentTextureBuffer",e=>e.textureBuffer)});function H(e){return z}},92359(e,t,i){i.d(t,{nu:()=>h,W6:()=>c}),i(4576),i(71511),i(44208),i(53966);var r=i(17676),n=(i(36708),i(44794),i(78659)),s=i(5482),o=i(69622),a=i(91429);let l=class extends o.A{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,s.Cg)([(0,a.MZ)()],l.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,s.Cg)([(0,a.MZ)()],l.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),l=(0,s.Cg)([(0,a.$K)("esri.views.support.debugFlags")],l),new l,i(49186),Symbol("Yield");const c={RESOURCE_CONTROLLER_IMMEDIATE:"immediate",RESOURCE_CONTROLLER:"schedule",SLIDE:"slide",STREAM_DATA_LOADER:"stream loader",ELEVATION_QUERY:"elevation query",TERRAIN_SURFACE:"terrain",SURFACE_GEOMETRY_UPDATES:"surface geometry updates",LOD_RENDERER:"LoD renderer",GRAPHICS_CORE:"Graphics3D",I3S:"I3S",LYR3D:"Lyr3D",TILES3D:"3DTiles",POINT_CLOUD_LAYER:"point cloud",FEATURE_TILE_FETCHER:"feature fetcher",STREAM_CONTROLLER:"stream controller",OCCLUSION_QUERY:"occlusion query",OVERLAY:"overlay",OVERLAY_RENDERER:"overlay renderer",STAGE:"stage",GRAPHICS_DECONFLICTOR:"graphics deconflictor",FILTER_VISIBILITY:"graphics filter visibility",SCALE_VISIBILITY:"graphics scale visibility",FRUSTUM_VISIBILITY:"graphics frustum visibility",POINT_OF_INTEREST_FREQUENT:"POI frequent",POINT_OF_INTEREST_INFREQUENT:"POI infrequent",LABELER:"labeler",FEATURE_QUERY_ENGINE:"feature query",FEATURE_TILE_TREE:"feature tile tree",FEATURE_TILE_TREE_ACTIVE:"fast feature tile tree",ELEVATION_ALIGNMENT:"elevation alignment",ELEVATION_ALIGNMENT_SCENE:"elevation alignment scene",TEXT_TEXTURE_ATLAS:"text texture atlas",TEXTURE_UNLOAD:"texture unload",LINE_OF_SIGHT_TOOL:"line of sight tool",LINE_OF_SIGHT_TOOL_INTERACTIVE:"interactive line of sight tool",VOLUME_MEASUREMENT:"volume measurement",ELEVATION_PROFILE:"elevation profile",SNAPPING:"snapping",SHADOW_ACCUMULATOR:"shadow accumulator",CLOUDS_GENERATOR:"clouds generator",FLOW_GENERATOR:"flow generator",GAUSSIAN_SPLAT_SORTING:"gaussian splat sorting",GAUSSIAN_SPLAT_TEXTURE_ATLAS:"gaussian splat texture atlas",MAPVIEW_FETCH_QUEUE:"mapview fetch queue",MAPVIEW_LAYERVIEW_UPDATE:"mapview layerview update",MAPVIEW_VECTOR_TILE_PARSING_QUEUE:"mapview vector tile parsing queue",NONE:0,TEST_PRIO:1};new Map([[c.RESOURCE_CONTROLLER_IMMEDIATE,0],[c.RESOURCE_CONTROLLER,4],[c.SLIDE,0],[c.STREAM_DATA_LOADER,0],[c.ELEVATION_QUERY,0],[c.TERRAIN_SURFACE,1],[c.SURFACE_GEOMETRY_UPDATES,1],[c.LOD_RENDERER,2],[c.GRAPHICS_CORE,2],[c.I3S,2],[c.LYR3D,2],[c.TILES3D,3],[c.POINT_CLOUD_LAYER,2],[c.FEATURE_TILE_FETCHER,2],[c.STREAM_CONTROLLER,2],[c.CLOUDS_GENERATOR,2],[c.OCCLUSION_QUERY,2],[c.OVERLAY,4],[c.OVERLAY_RENDERER,4],[c.STAGE,4],[c.GRAPHICS_DECONFLICTOR,4],[c.FILTER_VISIBILITY,4],[c.SCALE_VISIBILITY,4],[c.FRUSTUM_VISIBILITY,4],[c.POINT_OF_INTEREST_FREQUENT,6],[c.POINT_OF_INTEREST_INFREQUENT,30],[c.LABELER,8],[c.FEATURE_QUERY_ENGINE,8],[c.FEATURE_TILE_TREE,16],[c.FEATURE_TILE_TREE_ACTIVE,0],[c.ELEVATION_ALIGNMENT,12],[c.ELEVATION_ALIGNMENT_SCENE,14],[c.TEXT_TEXTURE_ATLAS,12],[c.TEXTURE_UNLOAD,12],[c.LINE_OF_SIGHT_TOOL,16],[c.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[c.VOLUME_MEASUREMENT,4],[c.SNAPPING,0],[c.SHADOW_ACCUMULATOR,30],[c.FLOW_GENERATOR,12],[c.GAUSSIAN_SPLAT_SORTING,2],[c.GAUSSIAN_SPLAT_TEXTURE_ATLAS,12],[c.MAPVIEW_FETCH_QUEUE,0],[c.MAPVIEW_LAYERVIEW_UPDATE,2],[c.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,0]]),(0,n.l5)(6.5),(0,n.l5)(1),(0,n.l5)(30),(0,n.l5)(1e3/30),(0,n.l5)(100);const u=new class{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}};u.enabled=!1;const h=new class{remove(){}processQueue(){}schedule(e,t,i){try{if((0,r.G4)(t)){const e=(0,r.NK)();return i?Promise.resolve(i(e)):Promise.reject(e)}return(0,r.z7)(e(u))}catch(e){return Promise.reject(e)}}reschedule(e,t,i){return this.schedule(e,t,i)}async scheduleGenerator(e,t,i){if((0,r.G4)(t)){const e=(0,r.NK)();if(i)return i(e);throw e}const n=e(u);for(;;){const e=n.next(u),s=(0,r.$X)(e)?await e:e;if((0,r.G4)(t)){const e=(0,r.NK)();if(i){const t=i(e),s=n.return(null);return(0,r.$X)(s)&&await(0,r.QZ)(s),t}const t=n.throw(e);throw(0,r.$X)(t)&&await(0,r.QZ)(t),e}if(s.done)return s.value}}}}}]);