@arcgis/core 4.34.0-next.23 → 4.34.0-next.25

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 (438) hide show
  1. package/Basemap.js +1 -1
  2. package/analysis/VolumeMeasurement/CutFillOptions.d.ts +4 -0
  3. package/analysis/VolumeMeasurement/CutFillOptions.js +1 -1
  4. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  5. package/applications/Components/imageryUtils.d.ts +4 -0
  6. package/applications/Components/imageryUtils.js +5 -0
  7. package/arcade/parser.js +1 -1
  8. package/arcade/validation/arcadeValidator.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/026fbeb0ff5b9e6c74df.js +1 -0
  11. package/assets/esri/core/workers/chunks/{0867aa688fa8938906da.js → 03bef3f4b6b09b1e864b.js} +1 -1
  12. package/assets/esri/core/workers/chunks/06cdbccc9f325dcc303d.js +1 -0
  13. package/assets/esri/core/workers/chunks/07613c89255bdab6b7c6.js +1 -0
  14. package/assets/esri/core/workers/chunks/09618761df5c4fdd52a0.js +1 -0
  15. package/assets/esri/core/workers/chunks/0ae00339991f5387203e.js +1 -0
  16. package/assets/esri/core/workers/chunks/0b4b294f3ce74fde5620.js +1 -0
  17. package/assets/esri/core/workers/chunks/{146520d263b910b5bdc7.js → 0e96a3b7228f1ff8e6c5.js} +1 -1
  18. package/assets/esri/core/workers/chunks/109ef17dd4f9430bb686.js +1 -0
  19. package/assets/esri/core/workers/chunks/1597aca21334cab3b802.js +1 -0
  20. package/assets/esri/core/workers/chunks/196564ad230bef6b59cf.js +1 -0
  21. package/assets/esri/core/workers/chunks/19f8d551cbebc11db1eb.js +1 -0
  22. package/assets/esri/core/workers/chunks/1ceee047e3fa617b0600.js +1 -0
  23. package/assets/esri/core/workers/chunks/1d27701832ea139fcc20.js +1 -0
  24. package/assets/esri/core/workers/chunks/1f296f85becf1ca6714d.js +1 -0
  25. package/assets/esri/core/workers/chunks/1f8d7bd44d53c30df383.js +1 -0
  26. package/assets/esri/core/workers/chunks/1fabb5ec59da698c1618.js +1 -0
  27. package/assets/esri/core/workers/chunks/{919d2fd7ebc0c840a759.js → 219b2911668db120452b.js} +1 -1
  28. package/assets/esri/core/workers/chunks/234cbc290b074eeb5dd6.js +1 -0
  29. package/assets/esri/core/workers/chunks/29ae5723fa35aa73ff9b.js +1 -0
  30. package/assets/esri/core/workers/chunks/2b4b073254fe8b6a081c.js +1 -0
  31. package/assets/esri/core/workers/chunks/30293b88501b5d6162fc.js +1 -0
  32. package/assets/esri/core/workers/chunks/31533f5e8b76b307f61c.js +1 -0
  33. package/assets/esri/core/workers/chunks/347117e61e1c6edd074f.js +1 -0
  34. package/assets/esri/core/workers/chunks/3616eb2607843524483f.js +1 -0
  35. package/assets/esri/core/workers/chunks/36648facd56ee91afc7c.js +1 -0
  36. package/assets/esri/core/workers/chunks/394477e88be0c6790f02.js +1 -0
  37. package/assets/esri/core/workers/chunks/3b80b01551d124534a1b.js +1 -0
  38. package/assets/esri/core/workers/chunks/{89d91ce2f566dd3f57f7.js → 3be9ec0503a669bcfce6.js} +1 -1
  39. package/assets/esri/core/workers/chunks/3c9cf06ac6aa1db6c4f6.js +1 -0
  40. package/assets/esri/core/workers/chunks/40fc7c43feaeef8b814d.js +1 -0
  41. package/assets/esri/core/workers/chunks/42cddc8f8c8d73e22ee2.js +1 -0
  42. package/assets/esri/core/workers/chunks/437a4100a837ee16df7c.js +1 -0
  43. package/assets/esri/core/workers/chunks/{63cc4647b7775ff8aedf.js → 44d28849e59f62616e72.js} +1 -1
  44. package/assets/esri/core/workers/chunks/453e536f566d80a9863b.js +1 -0
  45. package/assets/esri/core/workers/chunks/472c677a74d779ce62d7.js +1 -0
  46. package/assets/esri/core/workers/chunks/4b68b6985430c42316b7.js +1 -0
  47. package/assets/esri/core/workers/chunks/{6bb1ecaa0afc2c7de79e.js → 4cc3eeb0b824c53793d0.js} +1 -1
  48. package/assets/esri/core/workers/chunks/4ce671bc4d36387b55fa.js +1 -0
  49. package/assets/esri/core/workers/chunks/51cfa2f70ec222e1582b.js +1 -0
  50. package/assets/esri/core/workers/chunks/5284d46aecd6fe0345b8.js +1 -0
  51. package/assets/esri/core/workers/chunks/567385709e18ace93b1e.js +1 -0
  52. package/assets/esri/core/workers/chunks/5a9b27f2b343cd5b0852.js +1 -0
  53. package/assets/esri/core/workers/chunks/{4c2f3e43992a918e4c2d.js → 5ef3256c32c4b622bd11.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{5ce62d9fff80d014d186.js → 60aeb7a5ccd8bc71be02.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{55e9b02d70812f7cdac2.js → 63966066a963e9a1fb14.js} +1 -1
  56. package/assets/esri/core/workers/chunks/63f50ff2ae94f684d56b.js +1 -0
  57. package/assets/esri/core/workers/chunks/{8bf04be4052bf148777a.js → 6a1cf6b0ffdf6080b5c4.js} +1 -1
  58. package/assets/esri/core/workers/chunks/6deaa08e3a61a455e564.js +1 -0
  59. package/assets/esri/core/workers/chunks/6e9b4bfe2a1497c96100.js +1 -0
  60. package/assets/esri/core/workers/chunks/6efc3d120c9c2c09cb06.js +1 -0
  61. package/assets/esri/core/workers/chunks/7338ce95bceb2c7fab87.js +1 -0
  62. package/assets/esri/core/workers/chunks/{c64fa94cba71ba2794e2.js → 771012f129890f9a089c.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{d1b363c418a67b087306.js → 780ff9314f26ae62f75f.js} +1 -1
  64. package/assets/esri/core/workers/chunks/820cf4337b248a0cb63c.js +1 -0
  65. package/assets/esri/core/workers/chunks/{b57c0ef7bc57e3c91257.js → 865fccacf44ae5b70eba.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{fedbf639a0788417a70f.js → 86abfce1f2ac93cc4d54.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{c94cc026c4ed330408fb.js → 8894483b91bcda845b6f.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{f050ab9d100012b77bb9.js → 8c5b1114cc2a58305a81.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{6ca764b4baadef5c1515.js → 92737419b66894799a34.js} +1 -1
  70. package/assets/esri/core/workers/chunks/9511e55e4fabb3235eac.js +1 -0
  71. package/assets/esri/core/workers/chunks/{f43110391f124b8a179c.js → 9a78cb291c966f8ddda6.js} +2 -2
  72. package/assets/esri/core/workers/chunks/9f8341caab3b1d02f387.js +1 -0
  73. package/assets/esri/core/workers/chunks/a08d018d8c137fc4ca17.js +1 -0
  74. package/assets/esri/core/workers/chunks/{7051bcc178eb512819f6.js → a55338add265d330124b.js} +1 -1
  75. package/assets/esri/core/workers/chunks/afe4fd3b1b3521712edd.js +1 -0
  76. package/assets/esri/core/workers/chunks/{9991bd3c7991bffd8260.js → b37f3c416cefc1a6ea2c.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{6782114a752b9cc59168.js → b6b8272a74a5c24a6b86.js} +1 -1
  78. package/assets/esri/core/workers/chunks/b9f66d735a7e63417b3d.js +1 -0
  79. package/assets/esri/core/workers/chunks/bb50b4a3af627f91d789.js +1 -0
  80. package/assets/esri/core/workers/chunks/{f42155b7a4e6c5e80757.js → bbc2a4976d044b990193.js} +1 -1
  81. package/assets/esri/core/workers/chunks/bbf2c31d217de1b8ba6e.js +1 -0
  82. package/assets/esri/core/workers/chunks/be3977f7fe0c46a1b493.js +1 -0
  83. package/assets/esri/core/workers/chunks/befba7ceeb26a38732c1.js +1 -0
  84. package/assets/esri/core/workers/chunks/bf3fc71881aa559fc931.js +1 -0
  85. package/assets/esri/core/workers/chunks/c19421707257fc93acb9.js +1 -0
  86. package/assets/esri/core/workers/chunks/c1fb5290e0e259b74389.js +1 -0
  87. package/assets/esri/core/workers/chunks/c361bf4d41a1843d4640.js +1 -0
  88. package/assets/esri/core/workers/chunks/c51099eab5a99c88e5de.js +1 -0
  89. package/assets/esri/core/workers/chunks/c56b05a8be498b6f3ee7.js +1 -0
  90. package/assets/esri/core/workers/chunks/c82e78590c2fabc67609.js +1 -0
  91. package/assets/esri/core/workers/chunks/{cab1a1067f44ce374673.js → c9e580867f7ac17be329.js} +1 -1
  92. package/assets/esri/core/workers/chunks/{92ad9098006568358550.js → cafcb46d723d38b377a9.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{1d75cb1747ffb7b8b050.js → cb81d448ed6bad205346.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{0f6203ae32663b2b52db.js → d08a523b548e892e1222.js} +1 -1
  95. package/assets/esri/core/workers/chunks/d29ae64703a947bfb83b.js +1 -0
  96. package/assets/esri/core/workers/chunks/d2ce360961ca4b58666c.js +1 -0
  97. package/assets/esri/core/workers/chunks/{04c17957c15234ca0321.js → d81260303a11d3fbe940.js} +1 -1
  98. package/assets/esri/core/workers/chunks/de1457b07f4e263f1524.js +1 -0
  99. package/assets/esri/core/workers/chunks/{6bf43bc3714d7b3878fa.js → e547318638c8f496c1a0.js} +1 -1
  100. package/assets/esri/core/workers/chunks/e8e993fb8697b8f3e0c7.js +346 -0
  101. package/assets/esri/core/workers/chunks/{53781ccca16e53d4a8c3.js → f291ccf9da6aa7d7ae23.js} +1 -1
  102. package/assets/esri/core/workers/chunks/f61a8cc7e2b198e521ba.js +1 -0
  103. package/assets/esri/core/workers/chunks/f9442a281cb91c64c7cd.js +1 -0
  104. package/assets/esri/core/workers/chunks/fb785bc38323cce6e549.js +1 -0
  105. package/assets/esri/core/workers/chunks/{c3213b487c11076985af.js → fbf3240b36718fa5dc76.js} +1 -1
  106. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  107. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  108. package/chunks/Bufferer-Dw9Qi4T1.js +1 -1
  109. package/chunks/ComponentShader.glsl.js +36 -36
  110. package/chunks/Envelope.js +1 -1
  111. package/chunks/MultiPathImpl.js +1 -1
  112. package/chunks/OperatorClip.js +1 -1
  113. package/chunks/ProjectionTransformation.js +1 -1
  114. package/chunks/RibbonLine.glsl.js +40 -33
  115. package/chunks/index.js +1 -1
  116. package/chunks/persistableUrlUtils.js +1 -1
  117. package/config.js +1 -1
  118. package/core/AsyncUpdate.js +1 -1
  119. package/core/Clonable.js +1 -1
  120. package/core/Evented.js +1 -1
  121. package/core/Identifiable.js +1 -1
  122. package/core/JSONSupport.js +1 -1
  123. package/core/Loadable.js +1 -1
  124. package/core/MapUtils.js +1 -1
  125. package/core/MemCache.js +1 -1
  126. package/core/MemCachePool.js +1 -1
  127. package/core/MultiOriginJSONSupport.js +1 -1
  128. package/core/ObjectPool.js +1 -1
  129. package/core/Promise.js +1 -1
  130. package/core/ReadOnlyMultiOriginJSONSupport.js +1 -1
  131. package/core/accessorSupport/overrideDefaultsFrom.js +1 -1
  132. package/core/quantity.d.ts +1 -0
  133. package/geometry/operators/gx/operatorOffset.js +1 -1
  134. package/geometry/operators/support/jsonConverter.js +1 -1
  135. package/geometry/support/buffer/BufferPool.js +1 -1
  136. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  137. package/interfaces.d.ts +211 -8
  138. package/kernel.js +1 -1
  139. package/layers/CatalogLayer.js +1 -1
  140. package/layers/FeatureLayer.js +1 -1
  141. package/layers/GeoJSONLayer.js +1 -1
  142. package/layers/SubtypeGroupLayer.js +1 -1
  143. package/layers/knowledgeGraph/KnowledgeGraphSublayerBase.js +1 -1
  144. package/layers/mixins/APIKeyMixin.js +1 -1
  145. package/layers/mixins/ArcGISCachedService.js +1 -1
  146. package/layers/mixins/ArcGISImageService.js +1 -1
  147. package/layers/mixins/ArcGISMapService.js +1 -1
  148. package/layers/mixins/ArcGISService.js +1 -1
  149. package/layers/mixins/BlendLayer.js +1 -1
  150. package/layers/mixins/CustomParametersMixin.js +1 -1
  151. package/layers/mixins/DisplayFilteredLayer.js +1 -1
  152. package/layers/mixins/EditBusLayer.js +1 -1
  153. package/layers/mixins/FeatureEffectLayer.js +1 -1
  154. package/layers/mixins/FeatureLayerBase.js +1 -1
  155. package/layers/mixins/FeatureReductionLayer.js +1 -1
  156. package/layers/mixins/ImageryTileMixin.js +1 -1
  157. package/layers/mixins/OperationalLayer.js +1 -1
  158. package/layers/mixins/OrderedLayer.js +1 -1
  159. package/layers/mixins/PortalLayer.js +1 -1
  160. package/layers/mixins/PublishableLayer.js +1 -1
  161. package/layers/mixins/RasterJobHandlerMixin.js +1 -1
  162. package/layers/mixins/RasterPresetRendererMixin.js +1 -1
  163. package/layers/mixins/RefreshableLayer.js +1 -1
  164. package/layers/mixins/ScaleRangeLayer.js +1 -1
  165. package/layers/mixins/SceneService.js +1 -1
  166. package/layers/mixins/SublayersOwner.js +1 -1
  167. package/layers/mixins/TemporalLayer.js +1 -1
  168. package/layers/mixins/TemporalSceneLayer.js +1 -1
  169. package/layers/mixins/TrackableLayer.js +1 -1
  170. package/layers/ogc/wfsUtils.js +1 -1
  171. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  172. package/layers/orientedImagery/core/bestImageUtils.js +1 -1
  173. package/layers/support/ControlPointsGeoreference.js +1 -1
  174. package/layers/support/PixelBlock.js +1 -1
  175. package/layers/support/RasterJobHandler.js +1 -1
  176. package/layers/support/RasterWorker.js +1 -1
  177. package/layers/support/Sublayer.js +1 -1
  178. package/layers/support/arcgisLayerUrl.js +1 -1
  179. package/layers/support/multiLayerServiceUtils.js +1 -1
  180. package/layers/support/rasterDatasets/pixelReader.js +5 -0
  181. package/layers/support/rasterFormats/pixelRangeUtils.js +1 -1
  182. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  183. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  184. package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
  185. package/layers/video/VideoController.js +1 -1
  186. package/networks/support/UtilityNetworkLookupHelper.js +1 -1
  187. package/package.json +1 -1
  188. package/renderers/mixins/VisualVariablesMixin.js +1 -1
  189. package/renderers/support/DictionaryControlString.js +1 -1
  190. package/rest/support/CameraInfoMixin.js +1 -1
  191. package/rest/support/NormalizationBinParametersMixin.js +1 -1
  192. package/smartMapping/renderers/color.js +1 -1
  193. package/smartMapping/renderers/heatmap.js +1 -1
  194. package/smartMapping/renderers/pieChart.js +1 -1
  195. package/smartMapping/renderers/size.js +1 -1
  196. package/smartMapping/renderers/support/regenerateUtils.js +1 -1
  197. package/smartMapping/renderers/support/rendererUtils.js +1 -1
  198. package/smartMapping/renderers/type.js +1 -1
  199. package/smartMapping/symbology/color.js +1 -1
  200. package/smartMapping/symbology/support/utils.js +1 -1
  201. package/support/LayersMixin.js +1 -1
  202. package/support/TablesMixin.js +1 -1
  203. package/support/revision.js +1 -1
  204. package/symbols/cim/cimAnalyzer.js +1 -1
  205. package/symbols/support/utils.js +1 -1
  206. package/views/2d/engine/ParentChildStage.js +1 -1
  207. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  208. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  209. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterInputEvaluator.js +1 -1
  210. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MultiRasterMixin.js +1 -1
  211. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  212. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  213. package/views/2d/engine/webgl/textureUtils.js +1 -1
  214. package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
  215. package/views/2d/layers/LayerView2D.js +1 -1
  216. package/views/2d/layers/MediaLayerView2D.js +1 -1
  217. package/views/2d/layers/TileLayerView2D.js +1 -1
  218. package/views/2d/layers/features/FeatureContainer.js +1 -1
  219. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  220. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  221. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  222. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  223. package/views/2d/layers/features/support/FeatureFilterEvaluator.js +1 -1
  224. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  225. package/views/2d/layers/support/DebugOverlay.js +1 -1
  226. package/views/3d/analysis/AnalysisView3D.js +1 -1
  227. package/views/3d/analysis/VolumeMeasurement/CutFillVolumeMeasurementController.js +5 -0
  228. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  229. package/views/3d/analysis/images/heading-rotate-svg.js +1 -1
  230. package/views/3d/analysis/images/tilt-rotate-svg.js +1 -1
  231. package/views/3d/glTF/DefaultLoadingContext.js +1 -1
  232. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  233. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  234. package/views/3d/layers/BuildingSublayerView3D.js +1 -1
  235. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  236. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  237. package/views/3d/layers/FlowSubView3D.js +1 -1
  238. package/views/3d/layers/I3SMeshView3D.js +1 -1
  239. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  240. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  241. package/views/3d/layers/LayerView3D.js +1 -1
  242. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  243. package/views/3d/layers/StreamLayerView3D.js +1 -1
  244. package/views/3d/layers/TiledLayerView3D.js +1 -1
  245. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  246. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  247. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  248. package/views/3d/layers/graphics/Labeler.js +1 -1
  249. package/views/3d/layers/graphics/StreamController.js +5 -0
  250. package/views/3d/layers/graphics/StreamGraphics3DGraphicsPipeline.js +1 -1
  251. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  252. package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
  253. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  254. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  255. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  256. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  257. package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
  258. package/views/3d/layers/support/TemporalSceneLayerView.js +1 -1
  259. package/views/3d/layers/support/fetchTile.js +1 -1
  260. package/views/3d/state/ViewStateManager.js +1 -1
  261. package/views/3d/support/MemoryController.js +1 -1
  262. package/views/3d/support/ResourceController.js +1 -1
  263. package/views/3d/support/StreamDataLoader.js +1 -1
  264. package/views/3d/support/StreamDataRequester.js +5 -0
  265. package/views/3d/support/StreamTextureCollection.js +1 -1
  266. package/views/3d/support/engineContent/line.js +1 -1
  267. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  268. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  269. package/views/3d/support/flow/StreamlinesResources3D.js +1 -1
  270. package/views/3d/support/flow/geometryUtils.js +1 -1
  271. package/views/3d/support/index.js +1 -1
  272. package/views/3d/terrain/OverlayRenderer.js +1 -1
  273. package/views/3d/terrain/TerrainRenderer.js +1 -1
  274. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  275. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  276. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +3 -3
  277. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  278. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  279. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  280. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  281. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  282. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  283. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  284. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  285. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  286. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  287. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  288. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  289. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +17 -0
  290. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  291. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  292. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  293. package/views/BreakpointsOwner.js +1 -1
  294. package/views/DOMContainer.js +1 -1
  295. package/views/PopupView.js +1 -1
  296. package/views/VideoView.js +1 -1
  297. package/views/Viewport2DBaseMixin.js +1 -1
  298. package/views/Viewport2DMixin.js +1 -1
  299. package/views/draw/DrawGraphicTool.js +1 -1
  300. package/views/draw/DrawScreenTool.js +1 -1
  301. package/views/draw/DrawTool.js +1 -1
  302. package/views/draw/MultipointDrawAction.js +1 -1
  303. package/views/draw/PointDrawAction.js +1 -1
  304. package/views/draw/PolygonDrawAction.js +1 -1
  305. package/views/draw/PolylineDrawAction.js +1 -1
  306. package/views/interactive/tooltip/infos/TooltipInfoWithCoordinates.js +1 -1
  307. package/views/layers/CatalogDynamicGroupLayerView.js +1 -1
  308. package/views/layers/CatalogFootprintLayerView.js +1 -1
  309. package/views/layers/CatalogLayerView.js +1 -1
  310. package/views/layers/DimensionLayerView.js +1 -1
  311. package/views/layers/FeatureLayerView.js +1 -1
  312. package/views/layers/ImageryLayerView.js +1 -1
  313. package/views/layers/ImageryTileLayerView.js +1 -1
  314. package/views/layers/LineOfSightLayerView.js +1 -1
  315. package/views/layers/MapImageLayerView.js +1 -1
  316. package/views/layers/MediaLayerView.js +1 -1
  317. package/views/layers/OGCFeatureLayerView.js +1 -1
  318. package/views/layers/PointCloudLayerView.js +1 -1
  319. package/views/layers/RefreshableLayerView.js +1 -1
  320. package/views/layers/StreamLayerView.js +1 -1
  321. package/views/layers/ViewshedLayerView.js +1 -1
  322. package/views/layers/WMSLayerView.js +1 -1
  323. package/views/magnifier/mask-svg.js +1 -1
  324. package/views/magnifier/overlay-svg.js +1 -1
  325. package/views/support/Scheduler.js +1 -1
  326. package/views/video/VideoOperationalDataView.js +1 -1
  327. package/views/webgl/BufferObject.js +1 -1
  328. package/views/webgl/Program.js +1 -1
  329. package/views/webgl/Renderbuffer.js +1 -1
  330. package/views/webgl/Texture.js +1 -1
  331. package/views/webgl/Util.js +1 -1
  332. package/webmap/Bookmark.js +1 -1
  333. package/webscene/SunLighting.js +1 -1
  334. package/webscene/VirtualLighting.js +1 -1
  335. package/webscene/spec-certification/spec.js +1 -1
  336. package/widgets/BasemapGallery/support/PortalBasemapsSource.js +1 -1
  337. package/widgets/BasemapLayerList.js +1 -1
  338. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  339. package/widgets/Directions/DirectionsSearchTool.js +1 -1
  340. package/widgets/Editor/EditorViewModel.js +1 -1
  341. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  342. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  343. package/widgets/Editor/support/SketchController.js +1 -1
  344. package/widgets/Editor/workflowUtils.js +1 -1
  345. package/widgets/Editor.js +1 -1
  346. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  347. package/widgets/Feature/support/FeatureContentMixin.js +1 -1
  348. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  349. package/widgets/FeatureTable/support/EditableColumnTemplateMixin.js +1 -1
  350. package/widgets/LayerList.js +1 -1
  351. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  352. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  353. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  354. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  355. package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
  356. package/widgets/OrientedImageryViewer/mixins/SketchHandlerMixin.js +1 -1
  357. package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
  358. package/widgets/OrientedImageryViewer/mixins/TriangulatedSketchHandlerMixin.js +1 -1
  359. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  360. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  361. package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
  362. package/widgets/OrientedImageryViewer.js +1 -1
  363. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  364. package/widgets/PanoramicViewer/PanoramicZoomConditions.js +1 -1
  365. package/widgets/PanoramicViewer.js +1 -1
  366. package/widgets/Print.js +1 -1
  367. package/widgets/Sketch/SketchViewModel.js +1 -1
  368. package/widgets/Sketch/support/ResponsiveToolbar/ToolbarGroupBase.js +1 -1
  369. package/widgets/Slider/SliderViewModel.js +1 -1
  370. package/widgets/support/GoTo.js +1 -1
  371. package/widgets/support/SelectionList.js +1 -1
  372. package/assets/esri/core/workers/chunks/00eef04fd026adaf0df8.js +0 -1
  373. package/assets/esri/core/workers/chunks/0202c2ac73354e3970b2.js +0 -1
  374. package/assets/esri/core/workers/chunks/02dc6e31b1244e5bb785.js +0 -1
  375. package/assets/esri/core/workers/chunks/080c79d6caca3b6a2db2.js +0 -1
  376. package/assets/esri/core/workers/chunks/084236ca316aad980192.js +0 -1
  377. package/assets/esri/core/workers/chunks/0b484224a92b52c34330.js +0 -1
  378. package/assets/esri/core/workers/chunks/0ba6177ba118a0f032e2.js +0 -1
  379. package/assets/esri/core/workers/chunks/16a78f5a82f5ca163816.js +0 -1
  380. package/assets/esri/core/workers/chunks/19ae76283a0cb0fe4dee.js +0 -346
  381. package/assets/esri/core/workers/chunks/1cc30073f8200b67cff6.js +0 -1
  382. package/assets/esri/core/workers/chunks/242b216d61940aebe8e1.js +0 -1
  383. package/assets/esri/core/workers/chunks/32756905bcf11699b3f7.js +0 -1
  384. package/assets/esri/core/workers/chunks/35d238a5a6501f89bed7.js +0 -1
  385. package/assets/esri/core/workers/chunks/3fcd73ba832cb53d3a07.js +0 -1
  386. package/assets/esri/core/workers/chunks/40c1d65039c8f1d6afa0.js +0 -1
  387. package/assets/esri/core/workers/chunks/496e02cfe3d84010f675.js +0 -1
  388. package/assets/esri/core/workers/chunks/49dce142ad1ea4c01d00.js +0 -1
  389. package/assets/esri/core/workers/chunks/4b89d5b9e35bf79b321e.js +0 -1
  390. package/assets/esri/core/workers/chunks/54a49a25845897a15ab1.js +0 -1
  391. package/assets/esri/core/workers/chunks/573a8393bec916dcf16f.js +0 -1
  392. package/assets/esri/core/workers/chunks/576e408fb0834f3948e8.js +0 -1
  393. package/assets/esri/core/workers/chunks/5e805c9e9012dd39ec86.js +0 -1
  394. package/assets/esri/core/workers/chunks/6136bf09950adc46bc33.js +0 -1
  395. package/assets/esri/core/workers/chunks/666afe669866c44830bd.js +0 -1
  396. package/assets/esri/core/workers/chunks/6a0fbc54638f7de138c1.js +0 -1
  397. package/assets/esri/core/workers/chunks/81006d9eed65bbb82962.js +0 -1
  398. package/assets/esri/core/workers/chunks/843b6029d4c13115e1ac.js +0 -1
  399. package/assets/esri/core/workers/chunks/86d6007c45f2aa643ac8.js +0 -1
  400. package/assets/esri/core/workers/chunks/8ea34878a1ef24b4ded3.js +0 -1
  401. package/assets/esri/core/workers/chunks/8eea6251aa09725e654e.js +0 -1
  402. package/assets/esri/core/workers/chunks/90145d49a0cec902435c.js +0 -1
  403. package/assets/esri/core/workers/chunks/916691122d7fb38497d6.js +0 -1
  404. package/assets/esri/core/workers/chunks/9ae18a17f62d91167202.js +0 -1
  405. package/assets/esri/core/workers/chunks/9c510df592befb9ff892.js +0 -1
  406. package/assets/esri/core/workers/chunks/9f91d519da67714f915f.js +0 -1
  407. package/assets/esri/core/workers/chunks/a6a7279b09d7962147ec.js +0 -1
  408. package/assets/esri/core/workers/chunks/aba520714efc01bead36.js +0 -1
  409. package/assets/esri/core/workers/chunks/acb9c166259872828646.js +0 -1
  410. package/assets/esri/core/workers/chunks/accff253af360c34e8a8.js +0 -1
  411. package/assets/esri/core/workers/chunks/ad3871f497ecea1a08c9.js +0 -1
  412. package/assets/esri/core/workers/chunks/ae6eed26fc932bc08356.js +0 -1
  413. package/assets/esri/core/workers/chunks/b4bb461955a4c2bce072.js +0 -1
  414. package/assets/esri/core/workers/chunks/b98279213f45a0c27600.js +0 -1
  415. package/assets/esri/core/workers/chunks/ba5b24beebeb703b5919.js +0 -1
  416. package/assets/esri/core/workers/chunks/bd7d19ba0c7d9143a455.js +0 -1
  417. package/assets/esri/core/workers/chunks/bffaf1f20f18c75fad4e.js +0 -1
  418. package/assets/esri/core/workers/chunks/c4f8da6c238eb5e91f91.js +0 -1
  419. package/assets/esri/core/workers/chunks/cd64181298d82c8d0e9d.js +0 -1
  420. package/assets/esri/core/workers/chunks/cdabea4718a7e7d34cb8.js +0 -1
  421. package/assets/esri/core/workers/chunks/ce7155ae63e7bb74be00.js +0 -1
  422. package/assets/esri/core/workers/chunks/d45383d76ba99718b6d9.js +0 -1
  423. package/assets/esri/core/workers/chunks/d915d0a30d9beb24bd3a.js +0 -1
  424. package/assets/esri/core/workers/chunks/dc6538a2d5a1e60d0209.js +0 -1
  425. package/assets/esri/core/workers/chunks/dca633ae3bfd4a3f9bb3.js +0 -1
  426. package/assets/esri/core/workers/chunks/def8a854a05f17d3538e.js +0 -1
  427. package/assets/esri/core/workers/chunks/dfa7976085f7408a366c.js +0 -1
  428. package/assets/esri/core/workers/chunks/e0a5b499b3ae38c21278.js +0 -1
  429. package/assets/esri/core/workers/chunks/e1a20ba7d6279f59adc0.js +0 -1
  430. package/assets/esri/core/workers/chunks/e49a135a2933306a6105.js +0 -1
  431. package/assets/esri/core/workers/chunks/e9a9174c4d1a0a9effb6.js +0 -1
  432. package/assets/esri/core/workers/chunks/edead1a123860cc74b1b.js +0 -1
  433. package/assets/esri/core/workers/chunks/f3d5d92e0aefc2593208.js +0 -1
  434. package/assets/esri/core/workers/chunks/f90573c9dc36e51cd588.js +0 -1
  435. package/assets/esri/core/workers/chunks/fa9658dbfb921f9c13af.js +0 -1
  436. package/assets/esri/core/workers/chunks/fb5e2b1ced03eef28e96.js +0 -1
  437. package/assets/esri/core/workers/chunks/fd8f4eabb8bbc593dd9c.js +0 -1
  438. package/layers/graphics/controllers/StreamController.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{generateUID as t}from"../../../../core/uid.js";import{multiply as i,copy as e,hasIdentityRotation as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o,IDENTITY as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{m as a,t as n,j as h,i as m,f as l,q as c,c as d}from"../../../../chunks/vec32.js";import{create as g,fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as f,c as _}from"../../../../chunks/sphere.js";import{maxScale as b}from"../../support/mathUtils.js";import{Object3DState as v}from"./basicInterfaces.js";import{Object3DOccludeeStateID as p,Object3DHighlightStateID as S}from"./Object3DStateID.js";import{assert as j}from"./Util.js";import{affectsGeometry as y}from"./VertexAttribute.js";import{addObject3DStateID as x,removeObject3DStateID as V}from"../materials/renderers/utils.js";class A{constructor(i={}){this.id=t(),this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=i.castShadow??!0,this.usesVerticalDistanceToGround=i.usesVerticalDistanceToGround??!1,this.graphicUid=i.graphicUid,this.layerViewUid=i.layerViewUid,i.isElevationSource&&(this.lastValidElevationBB=new M),this._geometries=i.geometries?Array.from(i.geometries):new Array}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(t){j(null==this._layer||null==t,"Object3D can only be added to a single Layer"),this._layer=t}addGeometry(t){t.visible=this._visible,this._geometries.push(t);for(const i of this._highlightIds)t.addHighlight(i);this._emit("geometryAdded",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(t){const i=this._geometries.splice(t,1)[0];if(i){for(const t of this._highlightIds)i.removeHighlight(t);this._emit("geometryRemoved",{object:this,geometry:i}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(t,i,e=!1){this._emit("attributesChanged",{object:this,geometry:t,attribute:i,sync:e}),y(i)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometries)t.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new p;for(const i of this._geometries)i.occludees=x(i.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const i of this._geometries)i.occludees=V(i.occludees,t);this._emit("occlusionChanged",this)}highlight(t){const i=new S(t);for(const e of this._geometries)e.addHighlight(i);return this._emit("highlightChanged",this),this._highlightIds.add(i),i}removeHighlight(t){this._highlightIds.delete(t);for(const i of this._geometries)i.removeHighlight(t);this._emit("highlightChanged",this)}removeStateID(t){t.channel===v.Highlight?this.removeHighlight(t):this.removeOcclude(t)}getCombinedStaticTransformation(t,e){return i(e,this.transformation,t.transformation)}getCombinedShaderTransformation(t,e=o()){return i(e,this.effectiveTransformation,t.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=this._bvWorldSpace||new O,this._validateBoundingVolume(this._bvWorldSpace,w.WorldSpace)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=this._bvObjectSpace||new O,this._validateBoundingVolume(this._bvObjectSpace,w.ObjectSpace)),this._bvObjectSpace}_validateBoundingVolume(t,i){const e=i===w.ObjectSpace;for(const s of this._geometries){const i=s.boundingInfo;i&&T(i,t,e?s.transformation:this.getCombinedShaderTransformation(s))}a(f(t.bounds),t.min,t.max,.5);for(const s of this._geometries){const i=s.boundingInfo;if(null==i)continue;const o=e?s.transformation:this.getCombinedShaderTransformation(s),r=b(o);n(I,i.center,o);const a=h(I,f(t.bounds)),m=i.radius*r;t.bounds[3]=Math.max(t.bounds[3],a+m)}}_invalidateBoundingVolume(){const t=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this.layer&&t&&this.layer.notifyObjectBBChanged(this,t)}_emit(t,i){this.layer?.events.emit(t,i)}get geometries(){return this._geometries}get transformation(){return this._transformation??r}set transformation(t){this._transformation=e(this._transformation??o(),t),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(t){this._shaderTransformation=t?e(this._shaderTransformation??o(),t):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}get test(){}}class M{constructor(){this.min=u(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.max=u(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]<this.min[0]&&this.max[1]<this.min[1]&&this.max[2]<this.min[2]}}class O extends M{constructor(){super(...arguments),this.bounds=_()}}function T(t,i,e){const o=t.bbMin,r=t.bbMax;if(s(e)){const t=m(C,e[12],e[13],e[14]);l(B,o,t),l(U,r,t);for(let e=0;e<3;++e)i.min[e]=Math.min(i.min[e],B[e]),i.max[e]=Math.max(i.max[e],U[e])}else if(n(B,o,e),c(o,r))for(let s=0;s<3;++s)i.min[s]=Math.min(i.min[s],B[s]),i.max[s]=Math.max(i.max[s],B[s]);else{n(U,r,e);for(let t=0;t<3;++t)i.min[t]=Math.min(i.min[t],B[t],U[t]),i.max[t]=Math.max(i.max[t],B[t],U[t]);for(let t=0;t<3;++t){d(B,o),d(U,r),B[t]=r[t],U[t]=o[t],n(B,B,e),n(U,U,e);for(let t=0;t<3;++t)i.min[t]=Math.min(i.min[t],B[t],U[t]),i.max[t]=Math.max(i.max[t],B[t],U[t])}}}const C=g(),B=g(),U=g(),I=g();var w;!function(t){t[t.WorldSpace=0]="WorldSpace",t[t.ObjectSpace=1]="ObjectSpace"}(w||(w={}));export{O as BoundingVolume,A as Object3D};
5
+ import"../../../../core/has.js";import{generateUID as t}from"../../../../core/uid.js";import{multiply as i,copy as e,hasIdentityRotation as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o,IDENTITY as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{m as a,t as n,j as h,i as m,f as l,q as c,c as d}from"../../../../chunks/vec32.js";import{create as g,fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as f,c as _}from"../../../../chunks/sphere.js";import{maxScale as b}from"../../support/mathUtils.js";import{Object3DState as v}from"./basicInterfaces.js";import{Object3DOccludeeStateID as p,Object3DHighlightStateID as S}from"./Object3DStateID.js";import{assert as j}from"./Util.js";import{affectsGeometry as y}from"./VertexAttribute.js";import{addObject3DStateID as x,removeObject3DStateID as V}from"../materials/renderers/utils.js";class A{constructor(i={}){this.id=t(),this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=i.castShadow??!0,this.usesVerticalDistanceToGround=i.usesVerticalDistanceToGround??!1,this.graphicUid=i.graphicUid,this.layerViewUid=i.layerViewUid,i.isElevationSource&&(this.lastValidElevationBB=new M),this._geometries=i.geometries?Array.from(i.geometries):new Array}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(t){j(null==this._layer||null==t,"Object3D can only be added to a single Layer"),this._layer=t}addGeometry(t){t.visible=this._visible,this._geometries.push(t);for(const i of this._highlightIds)t.addHighlight(i);this._emit("geometryAdded",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(t){const i=this._geometries.splice(t,1)[0];if(i){for(const t of this._highlightIds)i.removeHighlight(t);this._emit("geometryRemoved",{object:this,geometry:i}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(t,i,e=!1){this._emit("attributesChanged",{object:this,geometry:t,attribute:i,sync:e}),y(i)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometries)t.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new p;for(const i of this._geometries)i.occludees=x(i.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const i of this._geometries)i.occludees=V(i.occludees,t);this._emit("occlusionChanged",this)}highlight(t){const i=new S(t);for(const e of this._geometries)e.addHighlight(i);return this._emit("highlightChanged",this),this._highlightIds.add(i),i}removeHighlight(t){this._highlightIds.delete(t);for(const i of this._geometries)i.removeHighlight(t);this._emit("highlightChanged",this)}removeStateID(t){t.channel===v.Highlight?this.removeHighlight(t):this.removeOcclude(t)}getCombinedStaticTransformation(t,e){return i(e,this.transformation,t.transformation)}getCombinedShaderTransformation(t,e=o()){return i(e,this.effectiveTransformation,t.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=this._bvWorldSpace||new O,this._validateBoundingVolume(this._bvWorldSpace,w.WorldSpace)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=this._bvObjectSpace||new O,this._validateBoundingVolume(this._bvObjectSpace,w.ObjectSpace)),this._bvObjectSpace}_validateBoundingVolume(t,i){const e=i===w.ObjectSpace;for(const s of this._geometries){const i=s.boundingInfo;i&&T(i,t,e?s.transformation:this.getCombinedShaderTransformation(s))}a(f(t.bounds),t.min,t.max,.5);for(const s of this._geometries){const i=s.boundingInfo;if(null==i)continue;const o=e?s.transformation:this.getCombinedShaderTransformation(s),r=b(o);n(I,i.center,o);const a=h(I,f(t.bounds)),m=i.radius*r;t.bounds[3]=Math.max(t.bounds[3],a+m)}}_invalidateBoundingVolume(){const t=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this.layer&&t&&this.layer.notifyObjectBBChanged(this,t)}_emit(t,i){this.layer?.events.emit(t,i)}get geometries(){return this._geometries}get transformation(){return this._transformation??r}set transformation(t){this._transformation=e(this._transformation??o(),t),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(t){this._shaderTransformation=t?e(this._shaderTransformation??o(),t):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}get test(){}}class M{constructor(){this.min=u(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.max=u(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]<this.min[0]&&this.max[1]<this.min[1]&&this.max[2]<this.min[2]}}class O extends M{constructor(){super(...arguments),this.bounds=_()}}function T(t,i,e){const o=t.bbMin,r=t.bbMax;if(s(e)){const t=m(C,e[12],e[13],e[14]);l(B,o,t),l(U,r,t);for(let e=0;e<3;++e)i.min[e]=Math.min(i.min[e],B[e]),i.max[e]=Math.max(i.max[e],U[e]);return}if(n(B,o,e),c(o,r))for(let s=0;s<3;++s)i.min[s]=Math.min(i.min[s],B[s]),i.max[s]=Math.max(i.max[s],B[s]);else{n(U,r,e);for(let t=0;t<3;++t)i.min[t]=Math.min(i.min[t],B[t],U[t]),i.max[t]=Math.max(i.max[t],B[t],U[t]);for(let t=0;t<3;++t){d(B,o),d(U,r),B[t]=r[t],U[t]=o[t],n(B,B,e),n(U,U,e);for(let t=0;t<3;++t)i.min[t]=Math.min(i.min[t],B[t],U[t]),i.max[t]=Math.max(i.max[t],B[t],U[t])}}}const C=g(),B=g(),U=g(),I=g();var w;!function(t){t[t.WorldSpace=0]="WorldSpace",t[t.ObjectSpace=1]="ObjectSpace"}(w||(w={}));export{O as BoundingVolume,A as Object3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../core/has.js";import{someMap as r}from"../../../../core/MapUtils.js";import t from"../../../../core/PooledArray.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as o}from"../../../../chunks/sphere.js";import{OverlayTarget as d}from"../../terrain/Intersector.js";import{ShaderOutput as a}from"../core/shaderLibrary/ShaderOutput.js";import{ChangeSet as h}from"./ChangeSet.js";import{StoreResults as c}from"./IntersectorInterfaces.js";import{IntersectorResult as l}from"./IntersectorResult.js";import{IntersectorType as p}from"./IntersectorType.js";import{RenderOccludedFlag as m}from"./Material.js";import{DirtyOperation as u,DirtyState as g}from"./ModelDirtyTypes.js";import{RendererBase as y}from"./RendererBase.js";import{RenderSlot as _}from"./RenderSlot.js";import{noBudget as f}from"../../../support/Scheduler.js";let R=class extends y{constructor(e){super(e),this._pending=new G,this._changes=new h,this._sortedRenderers=new t,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return r(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get rendersOccludedDraped(){for(const e of this.renderers.values())if(0!==e.numGeometries&&e.renderOccludedFlags&~m.Occlude)return!0;return!1}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,f,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=r(this.renderers,e=>{const r=e.produces.get(_.DRAPED_MATERIAL);return!!r&&r(a.Highlight)}),this._hasWater=r(this.renderers,e=>{const r=e.produces.get(_.DRAPED_WATER);return!!r&&r(a.Normal)})),this.notifyChange("updating"),!0)}rendererAdded(){this._sortedRenderers.clear()}rendererRemoved(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);s&&this.notifyChange("updating"),r===u.UPDATE&&this._notifyGraphicGeometryChanged(e)}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),r===u.UPDATE&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=this._changes.updates.pushNew();e.renderGeometry=this._ensureValidRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case g.TRANSFORMATION:case g.GEOMETRY:return this._notifyGraphicGeometryChanged(e);case g.VISIBILITY:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersect(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;o&&(n.boundingSphere[0]-n.boundingSphere[3]<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),n.boundingSphere[0]+n.boundingSphere[3]>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)),i++}return i}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.clear(),this._changes.removes.clear(),this._changes.adds.pushArray(Array.from(this._pending.adds)),this._changes.removes.pushArray(Array.from(this._pending.removes)),this._changes.updates.filterInPlace(({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible||!e.material.intersectDraped)return;let o=0;s+=e.transformation[12],o=e.transformation[13],C[0]=t[0]-s,C[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectDraped(e,i,C,(t,s,o)=>{v(r,o,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)},r)}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(o(e.boundingSphere))),e}get test(){}};e([s({constructOnly:!0})],R.prototype,"drapeSource",void 0),e([s({constructOnly:!0})],R.prototype,"rendererContext",void 0),e([s()],R.prototype,"updating",null),e([s()],R.prototype,"rctx",null),e([s()],R.prototype,"_localOriginFactory",null),e([s({readOnly:!0})],R.prototype,"isEmpty",null),e([s()],R.prototype,"_geometries",void 0),R=e([i("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],R);class G{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function v(e,r,t,s,i,n,o){const a=new d(n,o,r),h=r=>{r.set(p.OVERLAY,a,e.distance,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.distance||i.results.ground.distance<=i.results.min.distance)&&h(i.results.min),i.options.store!==c.MIN&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.distance||i.results.ground.distance>i.results.max.distance)&&h(i.results.max),i.options.store===c.ALL){const e=new l(i.ray);h(e),i.results.all.push(e)}}const C=n();export{R as SortedRenderGeometryRenderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../core/has.js";import{someMap as r,everyMap as t}from"../../../../core/MapUtils.js";import s from"../../../../core/PooledArray.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a}from"../../../../chunks/sphere.js";import{OverlayTarget as d}from"../../terrain/Intersector.js";import{ShaderOutput as h}from"../core/shaderLibrary/ShaderOutput.js";import{ChangeSet as c}from"./ChangeSet.js";import{StoreResults as l}from"./IntersectorInterfaces.js";import{IntersectorResult as p}from"./IntersectorResult.js";import{IntersectorType as m}from"./IntersectorType.js";import{DirtyOperation as u,DirtyState as g}from"./ModelDirtyTypes.js";import{RendererBase as y}from"./RendererBase.js";import{RenderSlot as _}from"./RenderSlot.js";import{noBudget as f}from"../../../support/Scheduler.js";let R=class extends y{constructor(e){super(e),this._pending=new G,this._changes=new c,this._sortedRenderers=new s,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return r(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOnlyOccludees(){const e=t(this.renderers,e=>e.hasOnlyOccludees);return this.renderers?.size>0&&e}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,f,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=r(this.renderers,e=>{const r=e.produces.get(_.DRAPED_MATERIAL);return!!r&&r(h.Highlight)}),this._hasWater=r(this.renderers,e=>{const r=e.produces.get(_.DRAPED_WATER);return!!r&&r(h.Normal)})),this.notifyChange("updating"),!0)}rendererAdded(){this._sortedRenderers.clear()}rendererRemoved(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);s&&this.notifyChange("updating"),r===u.UPDATE&&this._notifyGraphicGeometryChanged(e)}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),r===u.UPDATE&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=this._changes.updates.pushNew();e.renderGeometry=this._ensureValidRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case g.TRANSFORMATION:case g.GEOMETRY:return this._notifyGraphicGeometryChanged(e);case g.VISIBILITY:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersect(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;o&&(n.boundingSphere[0]-n.boundingSphere[3]<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),n.boundingSphere[0]+n.boundingSphere[3]>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)),i++}return i}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.clear(),this._changes.removes.clear(),this._changes.adds.pushArray(Array.from(this._pending.adds)),this._changes.removes.pushArray(Array.from(this._pending.removes)),this._changes.updates.filterInPlace(({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible||!e.material.intersectDraped)return;let o=0;s+=e.transformation[12],o=e.transformation[13],C[0]=t[0]-s,C[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectDraped(e,i,C,(t,s,o)=>{v(r,o,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)},r)}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(a(e.boundingSphere))),e}get test(){}};e([i({constructOnly:!0})],R.prototype,"drapeSource",void 0),e([i({constructOnly:!0})],R.prototype,"rendererContext",void 0),e([i()],R.prototype,"updating",null),e([i()],R.prototype,"rctx",null),e([i()],R.prototype,"_localOriginFactory",null),e([i({readOnly:!0})],R.prototype,"isEmpty",null),e([i()],R.prototype,"_geometries",void 0),R=e([n("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],R);class G{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function v(e,r,t,s,i,n,o){const a=new d(n,o,r),h=r=>{r.set(m.OVERLAY,a,e.distance,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.distance||i.results.ground.distance<=i.results.min.distance)&&h(i.results.min),i.options.store!==l.MIN&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.distance||i.results.ground.distance>i.results.max.distance)&&h(i.results.max),i.options.store===l.ALL){const e=new p(i.ray);h(e),i.results.all.push(e)}}const C=o();export{R as SortedRenderGeometryRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import s from"../../../../core/Evented.js";import"../../../../core/has.js";import{disposeMaybe as i,removeMaybe as r}from"../../../../core/maybe.js";import{generateUID as n}from"../../../../core/uid.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as o,s as l}from"../../../../chunks/vec42.js";import{ZEROS as _,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{textTextureAtlas as d}from"./testUtils.js";import{applyTextureResizeModuloCeil as u}from"./textureUtils.js";import{TaskPriority as m}from"../../../support/Scheduler.js";import{Yield as p}from"../../../support/Yield.js";import{TextureWrapMode as g,TextureSamplingMode as f}from"../../../webgl/enums.js";import{Texture as x}from"../../../webgl/Texture.js";import{TextureDescriptor as v}from"../../../webgl/TextureDescriptor.js";const w=4096;let T=class extends t{constructor(e){super(e),this.id=n(),this.events=new s,this._glTexture=null,this._atlas=new b(256,256),this._needsRepack=!1,this._canRepack=!0,this._elementsToRender=new Map,this._elements=new Map,this._uvCallbacks=new Map,this.updating=!1}initialize(){this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","textAtlasCanvas"),this._canvas.setAttribute("style","display:none"),this._ctx=this._canvas.getContext("2d"),this._stage=this.view.stage,this._stage.addTexture(this),this._updateCanvasElementSize(this._atlas),this._reset()}unload(){this._glTexture=i(this._glTexture),this._frameWorker=r(this._frameWorker),this.updating=!1,this.events.emit("unloaded")}get loaded(){return null!=this._glTexture}get glTexture(){return this._glTexture}static get maxSize(){return C=d.stableRendering?k:0,[w-k-C,w-k-C-R]}load(e){if(this._glTexture)return this._glTexture;const t=new v;return t.wrapMode=g.CLAMP_TO_EDGE,t.samplingMode=f.LINEAR_MIPMAP_LINEAR,t.hasMipmap=!0,t.preMultiplyAlpha=!0,t.maxAnisotropy=e.parameters.maxMaxAnisotropy,this._glTexture=new x(e,t,this._canvas),this._frameWorker=this.view.resourceController.scheduler.registerTask(m.TEXT_TEXTURE_ATLAS,this),this.setDirty(),this._glTexture}dispose(){this._elements.clear(),this._elementsToRender.clear(),this._frameWorker=r(this._frameWorker),this._glTexture&&(this._stage.removeTexture(this),this._glTexture=i(this._glTexture)),this._canvas.width=0,this._canvas.height=0,this._canvas=null,this._ctx=null}_updateCanvasElementSize(e){this._canvas.width=e.width,this._canvas.height=e.height}_resizeAtlas(e,t){const{width:s,height:i}=this._atlas;s===e&&i===t||(this._atlas.width=e,this._atlas.height=t,this._glTexture?.resize(e,t),this._glTexture?.updateData(0,0,0,s,i,this._canvas),this._updateCanvasElementSize(this._atlas),this._elements.forEach(e=>this._uvCallbacks.get(e.textRenderer.key)?.forEach(t=>t(e.uv))),this._reset())}_reset(){this._elementsToRender.clear(),this._atlas.reset(),this._needsRepack=!0,this.setDirty()}_addAtlasElement(e,t,s,i){const r=this._atlas;if(r.width<s||r.height<i)return!1;let n=r.cursors.get(i);if(!n){if(r.height<r.nextY+i)return!1;n=[new A(r.nextY)],r.cursors.set(i,n),r.nextY+=i}let h=n.find(e=>r.width>=e.x+s);if(null==h){if(r.height<r.nextY+i)return!1;h=new A(r.nextY),r.nextY+=i,n.push(h)}return e.setNewPosition(h),this._elements.set(t,e),this._elementsToRender.set(t,e),h.x+=s,!0}_ensureCallbacks(e){const t=this._uvCallbacks.get(e);if(t)return t;const s=new Set;return this._uvCallbacks.set(e,s),s}_addCallback(e,t){this._ensureCallbacks(e).add(t)}_removeCallback(e,t){const s=this._uvCallbacks.get(e);return!(!s?.delete(t)||0!==s.size)&&(this._uvCallbacks.delete(e),!0)}_processAddition(e){const t=e.textRenderer.key;if(this._needsRepack)return void this._elements.set(t,e);const s=this._atlas,i=e.textRenderer.renderedWidth,r=e.textRenderer.renderedHeight,n=i+k,h=r+k+R;if(!this._addAtlasElement(e,t,n,h)){if(this._canRepack)this._reset();else if(s.width<n){const e=u(Math.max(n,1.5*s.width),w);this._resizeAtlas(e,s.height)}else{const e=s.nextY+h,t=u(Math.max(e,1.5*s.height),w);if(t>s.height)this._resizeAtlas(s.width,t);else if(s.width<w){const e=u(1.5*s.width,w);this._resizeAtlas(e,s.height)}}this._elements.set(t,e)}}_renderElement(e){const t=e.commitNewPosition(),s=e.textRenderer;this._ctx.clearRect(t[0]-k,t[1]-k,s.renderedWidth+2*k,s.renderedHeight+2*k),s.render(this._ctx,t[0],t[1]),this._uvCallbacks.get(s.key)?.forEach(t=>t(e.uv))}get running(){return this.updating}runTask(e){if(null==this._glTexture)return p;for(;this._needsRepack&&(this._canRepack||this._atlas.height<w&&this._atlas.height<w);){this._canRepack=this._needsRepack=!1;const t=this._elements;this._elements=new Map,t.forEach(e=>this._processAddition(e)),e.madeProgress()}if(this._elementsToRender.size>0){for(const[t,s]of this._elementsToRender){if(e.done)break;this._renderElement(s),this._elementsToRender.delete(t),e.madeProgress()}this._glTexture.setData(this._canvas)}this.updating=this._elementsToRender.size>0}addText(e,t){const s=e.key;this._addCallback(s,t);let i=this._elements.get(s);return i?o(i.uv,_)||t(i.uv):(i=new y(e),this._processAddition(i),this.setDirty()),{remove:()=>this._removeText(e,t)}}_removeText(e,t){const s=e.key;this._elements.get(s)&&this._removeCallback(s,t)&&(this._elements.delete(s),this._elementsToRender.delete(s),this._canRepack=!0)}setDirty(){this._glTexture&&(this.updating=!0)}get test(){}};e([h({constructOnly:!0})],T.prototype,"view",void 0),e([h({type:Boolean})],T.prototype,"updating",void 0),T=e([a("esri.views.3d.webgl-engine.lib.TextTextureAtlas")],T);const k=2,R=2;class y{constructor(e){this.textRenderer=e,this._uv=c(),this._newPosition=[0,0]}get uv(){if(null==this._xOffset||null==this._yOffset)return _;const{renderedWidth:e,renderedHeight:t}=this.textRenderer;return l(this._uv,this._xOffset,this._yOffset+t,this._xOffset+e,this._yOffset)}setNewPosition(e){this._newPosition[0]=e.x,this._newPosition[1]=e.y}commitNewPosition(){return this._xOffset=this._newPosition[0],this._yOffset=this._newPosition[1],this._newPosition}get xOffset(){return this._xOffset}get yOffset(){return this._yOffset}}class b{constructor(e,t){this.width=e,this.height=t,this.cursors=new Map,this.nextY=0}reset(){this.cursors.clear(),this.nextY=C}}class A{constructor(e){this.y=e,this.x=C}}let C=0;export{T as TextTextureAtlas};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import s from"../../../../core/Evented.js";import"../../../../core/has.js";import{disposeMaybe as i,removeMaybe as r}from"../../../../core/maybe.js";import{generateUID as h}from"../../../../core/uid.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as o,s as l}from"../../../../chunks/vec42.js";import{ZEROS as _,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{textTextureAtlas as d}from"./testUtils.js";import{applyTextureResizeModuloCeil as u}from"./textureUtils.js";import{TaskPriority as m}from"../../../support/Scheduler.js";import{Yield as g}from"../../../support/Yield.js";import{TextureWrapMode as p,TextureSamplingMode as f}from"../../../webgl/enums.js";import{Texture as x}from"../../../webgl/Texture.js";import{TextureDescriptor as v}from"../../../webgl/TextureDescriptor.js";const w=4096;let T=class extends t{constructor(e){super(e),this.id=h(),this.events=new s,this._glTexture=null,this._atlas=new b(256,256),this._needsRepack=!1,this._canRepack=!0,this._elementsToRender=new Map,this._elements=new Map,this._uvCallbacks=new Map,this.updating=!1}initialize(){this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","textAtlasCanvas"),this._canvas.setAttribute("style","display:none"),this._ctx=this._canvas.getContext("2d"),this._stage=this.view.stage,this._stage.addTexture(this),this._updateCanvasElementSize(this._atlas),this._reset()}unload(){this._glTexture=i(this._glTexture),this._frameWorker=r(this._frameWorker),this.updating=!1,this.events.emit("unloaded")}get loaded(){return null!=this._glTexture}get glTexture(){return this._glTexture}static get maxSize(){return C=d.stableRendering?k:0,[w-k-C,w-k-C-R]}load(e){if(this._glTexture)return this._glTexture;const t=new v;return t.wrapMode=p.CLAMP_TO_EDGE,t.samplingMode=f.LINEAR_MIPMAP_LINEAR,t.hasMipmap=!0,t.preMultiplyAlpha=!0,t.maxAnisotropy=e.parameters.maxMaxAnisotropy,this._glTexture=new x(e,t,this._canvas),this._frameWorker=this.view.resourceController.scheduler.registerTask(m.TEXT_TEXTURE_ATLAS,this),this.setDirty(),this._glTexture}dispose(){this._elements.clear(),this._elementsToRender.clear(),this._frameWorker=r(this._frameWorker),this._glTexture&&(this._stage.removeTexture(this),this._glTexture=i(this._glTexture)),this._canvas.width=0,this._canvas.height=0,this._canvas=null,this._ctx=null}_updateCanvasElementSize(e){this._canvas.width=e.width,this._canvas.height=e.height}_resizeAtlas(e,t){const{width:s,height:i}=this._atlas;s===e&&i===t||(this._atlas.width=e,this._atlas.height=t,this._glTexture?.resize(e,t),this._glTexture?.updateData(0,0,0,s,i,this._canvas),this._updateCanvasElementSize(this._atlas),this._elements.forEach(e=>this._uvCallbacks.get(e.textRenderer.key)?.forEach(t=>t(e.uv))),this._reset())}_reset(){this._elementsToRender.clear(),this._atlas.reset(),this._needsRepack=!0,this.setDirty()}_addAtlasElement(e,t,s,i){const r=this._atlas;if(r.width<s||r.height<i)return!1;let h=r.cursors.get(i);if(!h){if(r.height<r.nextY+i)return!1;h=[new A(r.nextY)],r.cursors.set(i,h),r.nextY+=i}let n=h.find(e=>r.width>=e.x+s);if(null==n){if(r.height<r.nextY+i)return!1;n=new A(r.nextY),r.nextY+=i,h.push(n)}return e.setNewPosition(n),this._elements.set(t,e),this._elementsToRender.set(t,e),n.x+=s,!0}_ensureCallbacks(e){const t=this._uvCallbacks.get(e);if(t)return t;const s=new Set;return this._uvCallbacks.set(e,s),s}_addCallback(e,t){this._ensureCallbacks(e).add(t)}_removeCallback(e,t){const s=this._uvCallbacks.get(e);return!(!s?.delete(t)||0!==s.size)&&(this._uvCallbacks.delete(e),!0)}_processAddition(e){const t=e.textRenderer.key;if(this._needsRepack)return void this._elements.set(t,e);const s=this._atlas,i=e.textRenderer.renderedWidth,r=e.textRenderer.renderedHeight,h=i+k,n=r+k+R;if(!this._addAtlasElement(e,t,h,n)){if(this._canRepack)this._reset();else if(s.width<h){const e=u(Math.max(h,1.5*s.width),w);this._resizeAtlas(e,s.height)}else{const e=s.nextY+n,t=u(Math.max(e,1.5*s.height),w);if(t>s.height)this._resizeAtlas(s.width,t);else if(s.width<w){const e=u(1.5*s.width,w);this._resizeAtlas(e,s.height)}}this._elements.set(t,e)}}_renderElement(e){const t=e.commitNewPosition(),s=e.textRenderer;this._ctx.clearRect(t[0]-k,t[1]-k,s.renderedWidth+2*k,s.renderedHeight+2*k),s.render(this._ctx,t[0],t[1]),this._uvCallbacks.get(s.key)?.forEach(t=>t(e.uv))}get running(){return this.updating}runTask(e){if(null==this._glTexture)return g;for(;this._needsRepack&&(this._canRepack||this._atlas.height<w&&this._atlas.height<w);){this._canRepack=this._needsRepack=!1;const t=this._elements;this._elements=new Map,t.forEach(e=>this._processAddition(e)),e.madeProgress()}if(this._elementsToRender.size>0){for(const[t,s]of this._elementsToRender){if(e.done)break;this._renderElement(s),this._elementsToRender.delete(t),e.madeProgress()}this._glTexture.setData(this._canvas)}this.updating=this._elementsToRender.size>0}addText(e,t){const s=e.key;this._addCallback(s,t);let i=this._elements.get(s);return i?o(i.uv,_)||t(i.uv):(i=new y(e),this._processAddition(i),this.setDirty()),{remove:()=>this._removeText(e,t)}}_removeText(e,t){const s=e.key;this._elements.get(s)&&this._removeCallback(s,t)&&(this._elements.delete(s),this._elementsToRender.delete(s),this._canRepack=!0)}setDirty(){this._glTexture&&(this.updating=!0)}get test(){}get usedMemory(){return(this._glTexture?.usedMemory??0)+(this._canvas?.width??0)*(this._canvas?.height??0)*4}};e([n({constructOnly:!0})],T.prototype,"view",void 0),e([n({type:Boolean})],T.prototype,"updating",void 0),T=e([a("esri.views.3d.webgl-engine.lib.TextTextureAtlas")],T);const k=2,R=2;class y{constructor(e){this.textRenderer=e,this._uv=c(),this._newPosition=[0,0]}get uv(){if(null==this._xOffset||null==this._yOffset)return _;const{renderedWidth:e,renderedHeight:t}=this.textRenderer;return l(this._uv,this._xOffset,this._yOffset+t,this._xOffset+e,this._yOffset)}setNewPosition(e){this._newPosition[0]=e.x,this._newPosition[1]=e.y}commitNewPosition(){return this._xOffset=this._newPosition[0],this._yOffset=this._newPosition[1],this._newPosition}get xOffset(){return this._xOffset}get yOffset(){return this._yOffset}}class b{constructor(e,t){this.width=e,this.height=t,this.cursors=new Map,this.nextY=0}reset(){this.cursors.clear(),this.nextY=C}}class A{constructor(e){this.y=e,this.x=C}}let C=0;export{T as TextTextureAtlas};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- var e;function E(E){return E===e.POSITION}!function(e){e.POSITION="position",e.NORMAL="normal",e.NORMALCOMPRESSED="normalCompressed",e.UV0="uv0",e.UVI="uvi",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.ROTATION="rotation",e.TANGENT="tangent",e.OFFSET="offset",e.PERSPECTIVEDIVIDE="perspectiveDivide",e.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",e.LENGTH="length",e.NEXTDELTA="nextDelta",e.PREVIOUSDELTA="previousDelta",e.U0="u0",e.LINEPARAMETERS="lineParameters",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.PROFILEAUXDATA="profileAuxData",e.INSTANCEMODELORIGINHI="instanceModelOriginHi",e.INSTANCEMODELORIGINLO="instanceModelOriginLo",e.INSTANCEMODEL="instanceModel",e.INSTANCEMODELNORMAL="instanceModelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMAL2COMPRESSED="normal2Compressed",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.START_UP="startUp",e.END_UP="endUp",e.EXTRUDE="extrude",e.OLIDCOLOR="objectAndLayerIdColor",e.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(e||(e={}));export{e as VertexAttribute,E as affectsGeometry};
5
+ var e;function E(E){return E===e.POSITION}!function(e){e.POSITION="position",e.NORMAL="normal",e.NORMALCOMPRESSED="normalCompressed",e.UV0="uv0",e.UVI="uvi",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.ROTATION="rotation",e.TANGENT="tangent",e.OFFSET="offset",e.PERSPECTIVEDIVIDE="perspectiveDivide",e.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",e.LENGTH="length",e.NEXTDELTA="nextDelta",e.PREVIOUSDELTA="previousDelta",e.U0="u0",e.LINEPARAMETERS="lineParameters",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.TIMESTAMPS="timeStamps",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.PROFILEAUXDATA="profileAuxData",e.INSTANCEMODELORIGINHI="instanceModelOriginHi",e.INSTANCEMODELORIGINLO="instanceModelOriginLo",e.INSTANCEMODEL="instanceModel",e.INSTANCEMODELNORMAL="instanceModelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMAL2COMPRESSED="normal2Compressed",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.START_UP="startUp",e.END_UP="endUp",e.EXTRUDE="extrude",e.OLIDCOLOR="objectAndLayerIdColor",e.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(e||(e={}));export{e as VertexAttribute,E as affectsGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{VertexAttribute as O}from"../lib/VertexAttribute.js";const t=e().vec3f(O.POSITION),f=e().vec3f(O.POSITION).vec2f16(O.UV0),r=e().vec3f(O.POSITION).vec4u8(O.COLOR),I=e().vec3f(O.POSITION).vec2f16(O.UV0).vec4u8(O.OLIDCOLOR);export{r as PositionColorLayout,t as PositionLayout,f as PositionUvLayout,I as PositionUvOlidLayout};
5
+ import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{VertexAttribute as O}from"../lib/VertexAttribute.js";const I=e().vec3f(O.POSITION),c=e().vec3f(O.POSITION).vec2f16(O.UV0),f=e().vec3f(O.POSITION).vec4u8(O.COLOR),v=e().vec3f(O.POSITION).vec2f16(O.UV0).vec4u8(O.OLIDCOLOR),t=e().vec3f(O.POSITION).vec2f(O.UV0),r=e().vec3f(O.POSITION).vec2f(O.UV0).vec4u8(O.OLIDCOLOR);export{f as PositionColorLayout,I as PositionLayout,c as PositionUvLayout,v as PositionUvOlidLayout,t as PositionUvf32Layout,r as PositionUvf32OlidLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as a,e as n,g as o,f as l,c,l as p,j as h,t as f}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as T}from"../../../../geometry/support/float16.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{distance2 as E,fromPoints as _,create as A,closestLineSegmentPoint as R}from"../../../../geometry/support/lineSegment.js";import{fromPoints as g,create as S,signedDistance as O,getNormal as I}from"../../../../geometry/support/plane.js";import{newLayout as v}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as P,isColorOrColorEmission as N,isDepth as L,isColorEmissionHighlightOIDOrDepth as b,is2DGeometryOutput as C,ShaderOutput as U}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as y}from"../effects/geometry/olidUtils.js";import j from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as F}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as J}from"./internal/bufferWriterUtils.js";import{LineMarkerAnchor as z}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as H}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as G,RibbonLineTechnique as k}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Z,CapType as V}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";var Y;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(Y||(Y={}));class q extends D{constructor(e){super(e,Q),this._configuration=new Z,this.vertexAttributeLocations=G,this.produces=new Map([[w.OPAQUE_MATERIAL,e=>P(e)||N(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>L(e)],[w.OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.DRAPED_MATERIAL,e=>C(e)]])}getConfiguration(e,t){super.getConfiguration(e,t,this._configuration),this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===w.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==U.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,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&&te(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===F.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=e.get(B.SIZE);let l=this.parameters.width;if(this.parameters.vvSize){const r=e.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const c=s[0],p=s[1],h=(l/2+4)*r;let f=Number.MAX_VALUE,m=0;const u=e.get(B.POSITION).data,T=ee(this.parameters,e)?u.length-2:u.length-5;for(let d=0;d<T;d+=3){const e=u[d],r=u[d+1],i=(d+3)%u.length,s=c-e,a=p-r,n=u[i]-e,o=u[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),h=n*l-s,T=o*l-a,E=h*h+T*T;E<f&&(f=E,m=d/3)}f<h*h&&a(n.distance,n.normal,m)}intersect(r,f,m,u,T,A){const{options:S,camera:v,rayBegin:P,rayEnd:N}=m;if(!S.selectionMode||!r.visible||!v)return;if(!M(f))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const L=r.attributes,b=L.get(B.POSITION).data;let C=this.parameters.width;if(this.parameters.vvSize){const e=L.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(C*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else L.has(B.SIZE)&&(C*=L.get(B.SIZE).data[0]);const U=ne;i(U,m.point);const y=C*v.pixelRatio/2+4*v.pixelRatio;s(de[0],U[0]-y,U[1]+y,0),s(de[1],U[0]+y,U[1]+y,0),s(de[2],U[0]+y,U[1]-y,0),s(de[3],U[0]-y,U[1]-y,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(de[e],Ee[e]))return;g(v.eye,Ee[0],Ee[1],_e),g(v.eye,Ee[1],Ee[2],Ae),g(v.eye,Ee[2],Ee[3],Re),g(v.eye,Ee[3],Ee[0],ge);let j=Number.MAX_VALUE,D=0;const F=ee(this.parameters,L)?b.length-2:b.length-5;for(let e=0;e<F;e+=3){re[0]=b[e]+f[12],re[1]=b[e+1]+f[13],re[2]=b[e+2]+f[14];const t=(e+3)%b.length;if(ie[0]=b[t]+f[12],ie[1]=b[t+1]+f[13],ie[2]=b[t+2]+f[14],O(_e,re)<0&&O(_e,ie)<0||O(Ae,re)<0&&O(Ae,ie)<0||O(Re,re)<0&&O(Re,ie)<0||O(ge,re)<0&&O(ge,ie)<0)continue;if(v.projectToRenderScreen(re,oe),v.projectToRenderScreen(ie,le),oe[2]<0&&le[2]>0){a(se,re,ie);const e=v.frustum,t=-O(e[d.NEAR],re)/n(se,I(e[d.NEAR]));o(se,se,t),l(re,re,se),v.projectToRenderScreen(re,oe)}else if(oe[2]>0&&le[2]<0){a(se,ie,re);const e=v.frustum,t=-O(e[d.NEAR],ie)/n(se,I(e[d.NEAR]));o(se,se,t),l(ie,ie,se),v.projectToRenderScreen(ie,le)}else if(oe[2]<0&&le[2]<0)continue;oe[2]=0,le[2]=0;const r=E(_(oe,le,he),U);r<j&&(j=r,c(ce,re),c(pe,ie),D=e/3)}if(j<y*y){let e=Number.MAX_VALUE;if(R(_(ce,pe,he),_(P,N,fe),ae)){a(ae,ae,P);const t=p(ae);o(ae,ae,1/t),e=t/h(P,N)}A(e,ae,D)}}get _layout(){const e=v().vec3f(B.POSITION).vec4f16(B.PREVIOUSDELTA).vec4f16(B.NEXTDELTA).f32(B.U0).vec2f16(B.LINEPARAMETERS);return this.parameters.vvColor?e.f32(B.COLORFEATUREATTRIBUTE):e.vec4u8(B.COLOR,{glNormalized:!0}),this.parameters.vvSize?e.f32(B.SIZEFEATUREATTRIBUTE):e.f32(B.SIZE),this.parameters.vvOpacity&&e.f32(B.OPACITYFEATUREATTRIBUTE),y()&&e.vec4u8(B.OLIDCOLOR),e}createBufferWriter(){return new K(this._layout,this.parameters)}createGLMaterial(e){return new X(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class X extends j{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(k,e)}}class Q extends x{constructor(){super(...arguments),this.width=0,this.color=u,this.join="miter",this.cap=V.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,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}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class K{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=H+r}}_isClosed(e){return ee(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(B.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a,n){const o=r.get(B.POSITION),l=o.indices,p=o.data.length/3,m=r.get(B.DISTANCETOSTART)?.data;l&&l.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const u=(this.vertexBufferLayout.fields.has(B.SIZEFEATUREATTRIBUTE)?r.get(B.SIZEFEATUREATTRIBUTE)?.data[0]:r.get(B.SIZE)?.data[0])??1;let d=[1,1,1,1],E=0;const _=this.vertexBufferLayout.fields.has(B.COLORFEATUREATTRIBUTE);_?E=r.get(B.COLORFEATUREATTRIBUTE).data[0]:r.has(B.COLOR)&&(d=r.get(B.COLOR).data);const A=this.vertexBufferLayout.fields.has(B.OPACITYFEATUREATTRIBUTE),R=A?r.get(B.OPACITYFEATUREATTRIBUTE).data[0]:0,g=new Float32Array(a.buffer),S=T(a.buffer),O=new Uint8Array(a.buffer),I=this.vertexBufferLayout.stride/4;let v=n*I;const P=v;let N=0;const L=m?(e,t,r)=>N=m[r]:(e,t,r)=>N+=h(e,t),b=g.BYTES_PER_ELEMENT/S.BYTES_PER_ELEMENT,C=4/b,U=(e,t,r,s,a,n,o)=>{g[v++]=t[0],g[v++]=t[1],g[v++]=t[2],J(e,t,S,v*b),v+=C,J(r,t,S,v*b),v+=C,g[v++]=o;let l=v*b;if(S[l++]=s,S[l++]=a,v=Math.ceil(l/b),_)g[v]=E;else{const e=Math.min(4*n,d.length-4),t=4*v;O[t]=255*d[e],O[t+1]=255*d[e+1],O[t+2]=255*d[e+2],O[t+3]=255*d[e+3]}if(v++,g[v++]=u,A&&(g[v++]=R),y()){let e=4*v;i?(O[e++]=i[0],O[e++]=i[1],O[e++]=i[2],O[e++]=i[3]):(O[e++]=0,O[e++]=0,O[e++]=0,O[e++]=0),v=Math.ceil(.25*e)}};v+=I,s(ue,o.data[0],o.data[1],o.data[2]),e&&f(ue,ue,e);const j=this._isClosed(r);if(j){const t=o.data.length-3;s(me,o.data[t],o.data[t+1],o.data[t+2]),e&&f(me,me,e)}else s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),U(ue,ue,Te,1,Y.LEFT_CAP_START,0,0),U(ue,ue,Te,1,Y.RIGHT_CAP_START,0,0),c(me,ue),c(ue,Te);const D=j?0:1,F=j?p:p-1;for(let h=D;h<F;h++){const t=(h+1)%p*3;s(Te,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Te,Te,e),L(me,ue,h),U(me,ue,Te,0,Y.LEFT_JOIN_END,h,N),U(me,ue,Te,0,Y.RIGHT_JOIN_END,h,N);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);U(me,ue,Te,t,Y.LEFT_JOIN_END,h,N),U(me,ue,Te,t,Y.RIGHT_JOIN_END,h,N)}U(me,ue,Te,1,Y.LEFT_JOIN_START,h,N),U(me,ue,Te,1,Y.RIGHT_JOIN_START,h,N),c(me,ue),c(ue,Te)}j?(s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),N=L(me,ue,F),U(me,ue,Te,0,Y.LEFT_JOIN_END,D,N),U(me,ue,Te,0,Y.RIGHT_JOIN_END,D,N)):(N=L(me,ue,F),U(me,ue,ue,0,Y.LEFT_CAP_END,F,N),U(me,ue,ue,0,Y.RIGHT_CAP_END,F,N)),$(g,P+I,g,P,I);return v=$(g,v-I,g,v,I),this._parameters.wireframe&&this._addWireframeVertices(a,P,v,I),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=$(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function $(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function ee(e,t){if(!e.isClosed)return!1;return t.get(B.POSITION).indices.length>2}function te(e){return e.anchor===z.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const re=m(),ie=m(),se=m(),ae=m(),ne=m(),oe=r(),le=r(),ce=m(),pe=m(),he=A(),fe=A(),me=m(),ue=m(),Te=m(),de=[r(),r(),r(),r()],Ee=[m(),m(),m(),m()],_e=S(),Ae=S(),Re=S(),ge=S();export{Q as Parameters,q as RibbonLineMaterial};
5
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i}from"../../../../core/time.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as a,d as n,e as o,g as l,f as c,c as h,l as p,j as m,t as f}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as T}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as d}from"../../../../geometry/support/float16.js";import{PlaneIndex as E}from"../../../../geometry/support/frustum.js";import{distance2 as _,fromPoints as A,create as R,closestLineSegmentPoint as g}from"../../../../geometry/support/lineSegment.js";import{fromPoints as S,create as I,signedDistance as O,getNormal as v}from"../../../../geometry/support/plane.js";import{newLayout as P}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as N,isColorOrColorEmission as L,isDepth as b,isColorEmissionHighlightOIDOrDepth as C,is2DGeometryOutput as U,ShaderOutput as j}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as y}from"../effects/geometry/olidUtils.js";import M from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as F}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{isTranslationMatrix as B}from"../lib/Util.js";import{VertexAttribute as x}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as J}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as z}from"./internal/bufferWriterUtils.js";import{Animation as H}from"../shaders/AnimatedLine.glsl.js";import{LineMarkerAnchor as G}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as k}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as Z,RibbonLineTechnique as V}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as W,CapType as Y}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as q}from"../../../../webscene/support/AlphaCutoff.js";var X;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(X||(X={}));class Q extends D{constructor(e){super(e,$),this._configuration=new W,this.vertexAttributeLocations=Z,this.produces=new Map([[w.OPAQUE_MATERIAL,e=>N(e)||L(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>b(e)],[w.OCCLUDER_MATERIAL,e=>C(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_OCCLUDER_MATERIAL,e=>C(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL,e=>L(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>L(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.DRAPED_MATERIAL,e=>U(e)]])}getConfiguration(e,t){super.getConfiguration(e,t,this._configuration),this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===w.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==j.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,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&&ie(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===F.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&L(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration}get visible(){return this.parameters.color[3]>=q||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>q}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=e.get(x.SIZE);let l=this.parameters.width;if(this.parameters.vvSize){const r=e.get(x.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const c=s[0],h=s[1],p=(l/2+4)*r;let m=Number.MAX_VALUE,f=0;const u=e.get(x.POSITION).data,T=re(this.parameters,e)?u.length-2:u.length-5;for(let d=0;d<T;d+=3){const e=u[d],r=u[d+1],i=(d+3)%u.length,s=c-e,a=h-r,n=u[i]-e,o=u[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),p=n*l-s,T=o*l-a,E=p*p+T*T;E<m&&(m=E,f=d/3)}m<p*p&&a(n.distance,n.normal,f)}intersect(r,i,f,u,T,d){const{options:R,camera:I,rayBegin:P,rayEnd:N}=f;if(!R.selectionMode||!r.visible||!I)return;if(!B(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const L=r.attributes,b=L.get(x.POSITION).data;let C=this.parameters.width;if(this.parameters.vvSize){const e=L.get(x.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(C*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else L.has(x.SIZE)&&(C*=L.get(x.SIZE).data[0]);const U=le;s(U,f.point);const j=C*I.pixelRatio/2+4*I.pixelRatio;a(Ae[0],U[0]-j,U[1]+j,0),a(Ae[1],U[0]+j,U[1]+j,0),a(Ae[2],U[0]+j,U[1]-j,0),a(Ae[3],U[0]-j,U[1]-j,0);for(let e=0;e<4;e++)if(!I.unprojectFromRenderScreen(Ae[e],Re[e]))return;S(I.eye,Re[0],Re[1],ge),S(I.eye,Re[1],Re[2],Se),S(I.eye,Re[2],Re[3],Ie),S(I.eye,Re[3],Re[0],Oe);let y=Number.MAX_VALUE,M=0;const D=re(this.parameters,L)?b.length-2:b.length-5;for(let e=0;e<D;e+=3){se[0]=b[e]+i[12],se[1]=b[e+1]+i[13],se[2]=b[e+2]+i[14];const t=(e+3)%b.length;if(ae[0]=b[t]+i[12],ae[1]=b[t+1]+i[13],ae[2]=b[t+2]+i[14],O(ge,se)<0&&O(ge,ae)<0||O(Se,se)<0&&O(Se,ae)<0||O(Ie,se)<0&&O(Ie,ae)<0||O(Oe,se)<0&&O(Oe,ae)<0)continue;if(I.projectToRenderScreen(se,ce),I.projectToRenderScreen(ae,he),ce[2]<0&&he[2]>0){n(ne,se,ae);const e=I.frustum,t=-O(e[E.NEAR],se)/o(ne,v(e[E.NEAR]));l(ne,ne,t),c(se,se,ne),I.projectToRenderScreen(se,ce)}else if(ce[2]>0&&he[2]<0){n(ne,ae,se);const e=I.frustum,t=-O(e[E.NEAR],ae)/o(ne,v(e[E.NEAR]));l(ne,ne,t),c(ae,ae,ne),I.projectToRenderScreen(ae,he)}else if(ce[2]<0&&he[2]<0)continue;ce[2]=0,he[2]=0;const r=_(A(ce,he,fe),U);r<y&&(y=r,h(pe,se),h(me,ae),M=e/3)}if(y<j*j){let e=Number.MAX_VALUE;if(g(A(pe,me,fe),A(P,N,ue),oe)){n(oe,oe,P);const t=p(oe);l(oe,oe,1/t),e=t/m(P,N)}d(e,oe,M)}}get _layout(){const e=P().vec3f(x.POSITION).vec4f16(x.PREVIOUSDELTA).vec4f16(x.NEXTDELTA).f32(x.U0).vec2f16(x.LINEPARAMETERS);return this.parameters.vvColor?e.f32(x.COLORFEATUREATTRIBUTE):e.vec4u8(x.COLOR,{glNormalized:!0}),this.parameters.vvSize?e.f32(x.SIZEFEATUREATTRIBUTE):e.f32(x.SIZE),this.parameters.vvOpacity&&e.f32(x.OPACITYFEATUREATTRIBUTE),y()&&e.vec4u8(x.OLIDCOLOR),this.parameters.hasAnimation&&e.vec3f16(x.TIMESTAMPS),e}createBufferWriter(){return new ee(this._layout,this.parameters)}createGLMaterial(e){return new K(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){const{hasAnimation:t,animationSpeed:r}=this.parameters;return!!t&&(this.setParameters({timeElapsed:i(e.time)*r},!1),e.dt>0)}}class K extends M{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(V,e)}}class $ extends J{constructor(){super(...arguments),this.width=0,this.color=T,this.join="miter",this.cap=Y.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,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,this.animation=H.None,this.animationSpeed=1,this.trailLength=1}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==H.None}}class ee{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=k+r}}_isClosed(e){return re(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(x.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,s,n){const o=r.get(x.POSITION),l=o.indices,c=o.data.length/3,p=r.get(x.DISTANCETOSTART)?.data;l&&l.length!==2*(c-1)&&console.warn("RibbonLineMaterial does not support indices");const u=(this.vertexBufferLayout.fields.has(x.SIZEFEATUREATTRIBUTE)?r.get(x.SIZEFEATUREATTRIBUTE)?.data[0]:r.get(x.SIZE)?.data[0])??1;let T=[1,1,1,1],E=0;const _=this.vertexBufferLayout.fields.has(x.COLORFEATUREATTRIBUTE);_?E=r.get(x.COLORFEATUREATTRIBUTE).data[0]:r.has(x.COLOR)&&(T=r.get(x.COLOR).data);const A=r.get(x.TIMESTAMPS)?.data,R=A&&this.vertexBufferLayout.fields.has(x.TIMESTAMPS),g=this.vertexBufferLayout.fields.has(x.OPACITYFEATUREATTRIBUTE),S=g?r.get(x.OPACITYFEATUREATTRIBUTE).data[0]:0,I=new Float32Array(s.buffer),O=d(s.buffer),v=new Uint8Array(s.buffer),P=this.vertexBufferLayout.stride/4;let N=n*P;const L=N;let b=0;const C=p?(e,t,r)=>b=p[r]:(e,t,r)=>b+=m(e,t),U=I.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,j=4/U,M=(e,t,r,s,a,n,o,l)=>{I[N++]=t[0],I[N++]=t[1],I[N++]=t[2],z(e,t,O,N*U),N+=j,z(r,t,O,N*U),N+=j,I[N++]=l;let c=N*U;if(O[c++]=a,O[c++]=n,N=Math.ceil(c/U),_)I[N]=E;else{const e=Math.min(4*o,T.length-4),t=4*N;v[t]=255*T[e],v[t+1]=255*T[e+1],v[t+2]=255*T[e+2],v[t+3]=255*T[e+3]}if(N++,I[N++]=u,g&&(I[N++]=S),y()){let e=4*N;i?(v[e++]=i[0],v[e++]=i[1],v[e++]=i[2],v[e++]=i[3]):(v[e++]=0,v[e++]=0,v[e++]=0,v[e++]=0),N=Math.ceil(.25*e)}R&&(c=N*U,O[c++]=s[0],O[c++]=s[1],O[c++]=s[2],N=Math.ceil(c/U))};N+=P,a(de,o.data[0],o.data[1],o.data[2]),R&&a(_e,A[0],A[1],A[2]),e&&f(de,de,e);const D=this._isClosed(r);if(D){const t=o.data.length-3;a(Te,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Te,Te,e)}else a(Ee,o.data[3],o.data[4],o.data[5]),e&&f(Ee,Ee,e),M(de,de,Ee,_e,1,X.LEFT_CAP_START,0,0),M(de,de,Ee,_e,1,X.RIGHT_CAP_START,0,0),h(Te,de),h(de,Ee),R&&a(_e,A[3],A[4],A[5]);const F=D?0:1,w=D?c:c-1;for(let m=F;m<w;m++){const t=(m+1)%c*3;a(Ee,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Ee,Ee,e),C(Te,de,m),M(Te,de,Ee,_e,0,X.LEFT_JOIN_END,m,b),M(Te,de,Ee,_e,0,X.RIGHT_JOIN_END,m,b);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);M(Te,de,Ee,_e,t,X.LEFT_JOIN_END,m,b),M(Te,de,Ee,_e,t,X.RIGHT_JOIN_END,m,b)}M(Te,de,Ee,_e,1,X.LEFT_JOIN_START,m,b),M(Te,de,Ee,_e,1,X.RIGHT_JOIN_START,m,b),h(Te,de),h(de,Ee),R&&a(_e,A[t],A[t+1],A[t+2])}D?(a(Ee,o.data[3],o.data[4],o.data[5]),e&&f(Ee,Ee,e),b=C(Te,de,w),M(Te,de,Ee,_e,0,X.LEFT_JOIN_END,F,b),M(Te,de,Ee,_e,0,X.RIGHT_JOIN_END,F,b)):(b=C(Te,de,w),M(Te,de,de,_e,0,X.LEFT_CAP_END,w,b),M(Te,de,de,_e,0,X.RIGHT_CAP_END,w,b)),te(I,L+P,I,L,P);return N=te(I,N-P,I,N,P),this._parameters.wireframe&&this._addWireframeVertices(s,L,N,P),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=te(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function te(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function re(e,t){if(!e.isClosed)return!1;return t.get(x.POSITION).indices.length>2}function ie(e){return e.anchor===G.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const se=u(),ae=u(),ne=u(),oe=u(),le=u(),ce=r(),he=r(),pe=u(),me=u(),fe=R(),ue=R(),Te=u(),de=u(),Ee=u(),_e=u(),Ae=[r(),r(),r(),r()],Re=[u(),u(),u(),u()],ge=I(),Se=I(),Ie=I(),Oe=I();export{$ as Parameters,Q as RibbonLineMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColorOrColorEmission as a,isHighlightOrOID as s,ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{MaterialParameters as l}from"../lib/Material.js";import{OITPolygonOffsetLimit as m}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{DefaultBufferWriter as h}from"./DefaultBufferWriter.js";import{PositionUvOlidLayout as f,PositionUvLayout as p}from"./DefaultLayouts.js";import{TriangleMaterial as u}from"./TriangleMaterial.js";import{WaterGLMaterial as d}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as g}from"./WaterTechniqueConfiguration.js";class _ extends u{constructor(t,e){super(t,v),this.produces=new Map([[c.OPAQUE_MATERIAL,t=>a(t)&&!this.parameters.transparent||s(t)],[c.TRANSPARENT_MATERIAL,t=>a(t)&&this.parameters.transparent||s(t)],[c.DRAPED_MATERIAL,t=>this.parameters.draped&&a(t)||t===o.Normal||s(t)],[c.DRAPED_WATER,t=>t===o.Normal]]),this._configuration=new g(e.spherical)}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.writeDepth=!0,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.screenSpaceReflections=null!=e.ssr.lastFrameColor,this._configuration.cloudReflections=null!=e.clouds.data,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=e.oitPass,this._configuration.enableOffset=e.camera.relativeElevation<m,this._configuration.terrainDepthTest=e.terrainDepthTest&&a(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration}get visible(){return!0}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<T}createGLMaterial(t){return new d(t)}createBufferWriter(){return new h(n()?f:p)}get test(){}}class v extends l{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const T=35e3;export{v as Parameters,_ as WaterMaterial};
5
+ import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColorOrColorEmission as a,isHighlightOrOID as s,ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{MaterialParameters as l}from"../lib/Material.js";import{OITPolygonOffsetLimit as m}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{DefaultBufferWriter as h}from"./DefaultBufferWriter.js";import{PositionUvf32OlidLayout as f,PositionUvf32Layout as p}from"./DefaultLayouts.js";import{TriangleMaterial as u}from"./TriangleMaterial.js";import{WaterGLMaterial as d}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as g}from"./WaterTechniqueConfiguration.js";class _ extends u{constructor(t,e){super(t,v),this.produces=new Map([[c.OPAQUE_MATERIAL,t=>a(t)&&!this.parameters.transparent||s(t)],[c.TRANSPARENT_MATERIAL,t=>a(t)&&this.parameters.transparent||s(t)],[c.DRAPED_MATERIAL,t=>this.parameters.draped&&a(t)||t===o.Normal||s(t)],[c.DRAPED_WATER,t=>t===o.Normal]]),this._configuration=new g(e.spherical)}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.writeDepth=!0,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.screenSpaceReflections=null!=e.ssr.lastFrameColor,this._configuration.cloudReflections=null!=e.clouds.data,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=e.oitPass,this._configuration.enableOffset=e.camera.relativeElevation<m,this._configuration.terrainDepthTest=e.terrainDepthTest&&a(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration}get visible(){return!0}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<T}createGLMaterial(t){return new d(t)}createBufferWriter(){return new h(n()?f:p)}get test(){}}class v extends l{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const T=35e3;export{v as Parameters,_ as WaterMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{d as e,l as t,g as f}from"../../../../../chunks/vec32.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{hasIdentityRotation as o,isOrthoNormal as i}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as s,BufferViewVec3f16 as n,BufferViewVec3f as c,BufferViewVec4f16 as l,BufferViewVec4f as d,BufferViewFloat as u,BufferViewVec2i16 as a,BufferViewVec2f16 as p,BufferViewVec2f as g}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as B}from"../../lib/Util.js";import{VertexAttribute as y}from"../../lib/VertexAttribute.js";function b(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l)s[f]=o[i[l]],f+=n;else for(let l=0;l<c;++l){const e=o[i[l]];for(let t=0;t<r;t++)s[f]=e,f+=n}}function m(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=2*o[c];i[f]=r[e],i[f+1]=r[e+1],f+=s}}function O(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=3*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}}function h(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=4*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}}function F(e,t,f){const r=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let i=0;i<f;++i)r[t]=0,r[t+1]=0,r[t+2]=0,r[t+3]=0,t+=o}function I(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=9*o[c];for(let t=0;t<9;++t)i[f+t]=r[e+t];f+=s}}function T(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=16*o[c];for(let t=0;t<16;++t)i[f+t]=r[e+t];f+=s}}function R(e,t,f,r,i=1){if(!t)return void O(e,f,r,i);const{data:s,indices:n}=e,c=f.typedBuffer,l=f.typedBufferStride,d=n.length,u=t[0],a=t[1],p=t[2],g=t[4],B=t[5],y=t[6],b=t[8],m=t[9],h=t[10],F=t[12],I=t[13],T=t[14];r*=l;let R=0,S=0,E=0;const N=o(t)?e=>{R=s[e]+F,S=s[e+1]+I,E=s[e+2]+T}:e=>{const t=s[e],f=s[e+1],r=s[e+2];R=u*t+g*f+b*r+F,S=a*t+B*f+m*r+I,E=p*t+y*f+h*r+T};if(1===i)for(let o=0;o<d;++o)N(3*n[o]),c[r]=R,c[r+1]=S,c[r+2]=E,r+=l;else for(let o=0;o<d;++o){N(3*n[o]);for(let e=0;e<i;++e)c[r]=R,c[r+1]=S,c[r+2]=E,r+=l}}function S(e,t,f,r,s=1){if(!t)return void O(e,f,r,s);const{data:n,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,p=l[0],g=l[1],B=l[2],y=l[4],b=l[5],m=l[6],h=l[8],F=l[9],I=l[10],T=!i(l),R=1e-6,S=1-R;r*=u;let E=0,N=0,A=0;const v=o(l)?e=>{E=n[e],N=n[e+1],A=n[e+2]}:e=>{const t=n[e],f=n[e+1],r=n[e+2];E=p*t+y*f+h*r,N=g*t+b*f+F*r,A=B*t+m*f+I*r};if(1===s)if(T)for(let o=0;o<a;++o){v(3*c[o]);const e=E*E+N*N+A*A;if(e<S&&e>R){const t=1/Math.sqrt(e);d[r]=E*t,d[r+1]=N*t,d[r+2]=A*t}else d[r]=E,d[r+1]=N,d[r+2]=A;r+=u}else for(let o=0;o<a;++o)v(3*c[o]),d[r]=E,d[r+1]=N,d[r+2]=A,r+=u;else for(let o=0;o<a;++o){if(v(3*c[o]),T){const e=E*E+N*N+A*A;if(e<S&&e>R){const t=1/Math.sqrt(e);E*=t,N*=t,A*=t}}for(let e=0;e<s;++e)d[r]=E,d[r+1]=N,d[r+2]=A,r+=u}}function E(e,t,f,r,o=1){if(!t)return void h(e,f,r,o);const{data:s,indices:n}=e,c=t,l=f.typedBuffer,d=f.typedBufferStride,u=n.length,a=c[0],p=c[1],g=c[2],B=c[4],y=c[5],b=c[6],m=c[8],O=c[9],F=c[10],I=!i(c),T=1e-6,R=1-T;if(r*=d,1===o)for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],o=s[e+2],c=s[e+3];let u=a*t+B*f+m*o,h=p*t+y*f+O*o,S=g*t+b*f+F*o;if(I){const e=u*u+h*h+S*S;if(e<R&&e>T){const t=1/Math.sqrt(e);u*=t,h*=t,S*=t}}l[r]=u,l[r+1]=h,l[r+2]=S,l[r+3]=c,r+=d}else for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],c=s[e+2],u=s[e+3];let h=a*t+B*f+m*c,S=p*t+y*f+O*c,E=g*t+b*f+F*c;if(I){const e=h*h+S*S+E*E;if(e<R&&e>T){const t=1/Math.sqrt(e);h*=t,S*=t,E*=t}}for(let i=0;i<o;++i)l[r]=h,l[r+1]=S,l[r+2]=E,l[r+3]=u,r+=d}}function N(e,t,f,r,o=1){const{data:i,indices:s}=e,n=f.typedBuffer,c=f.typedBufferStride,l=s.length;if(r*=c,t!==i.length||4!==t)if(1!==o)if(4!==t)for(let d=0;d<l;++d){const e=3*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=255,r+=c}else for(let d=0;d<l;++d){const e=4*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=i[e+3],r+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=c}return}for(let e=0;e<l;++e){const t=3*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=255,r+=c}}else{n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,s=e[r/=4];r+=t;const d=l*o;for(let f=1;f<d;++f)e[r]=s,r+=t}}function A(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length,c=r[0];f*=s;for(let l=0;l<n;++l)i[f]=c,f+=s}function v(r,o,i,s){e(w,r,o);const n=Math.max(Math.sqrt(t(w)),1e-4);f(w,w,1/n),i[s++]=w[0],i[s++]=w[1],i[s++]=w[2],i[s++]=n}const w=r();function L(e,t,f,r,o=1){const i=t.typedBuffer,s=t.typedBufferStride;if(r*=s,1===o)for(let n=0;n<f;++n)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s;else for(let n=0;n<f;++n)for(let t=0;t<o;++t)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s}function k(e,t,f,r,o,i,n){let c={numItems:0,numVerticesPerItem:0};for(const l of f.fields.keys()){const f=e.get(l),d=f?.indices;if(f&&d)l===y.POSITION&&(c={numItems:1,numVerticesPerItem:d.length}),z(l,f,r,o,i,n);else if(l===y.OLIDCOLOR&&null!=t){const f=e.get(y.POSITION)?.indices;if(f){const e=f.length;L(t,i.getField(l,s),e,n)}}}return c}function z(e,t,f,r,o,i){switch(e){case y.POSITION:{B(3===t.size);const r=o.getField(e,c);B(!!r,`No buffer view for ${e}`),R(t,f,r,i);break}case y.NORMAL:{B(3===t.size);const f=o.getField(e,c);B(!!f,`No buffer view for ${e}`),S(t,r,f,i);break}case y.NORMALCOMPRESSED:case y.PROFILERIGHT:case y.PROFILEUP:{B(2===t.size);const f=o.getField(e,a);B(!!f,`No buffer view for ${e}`),m(t,f,i);break}case y.UV0:{B(2===t.size);const f=o.getField(e,p)??o.getField(e,g);B(!!f,`No buffer view for ${e}`),m(t,f,i);break}case y.UVI:{B(2===t.size);const f=o.getField(e,a);B(!!f,`No buffer view for ${e}`),m(t,f,i);break}case y.COLOR:case y.SYMBOLCOLOR:{const f=o.getField(e,s);B(!!f,`No buffer view for ${e}`),B(3===t.size||4===t.size),N(t,t.size,f,i);break}case y.COLORFEATUREATTRIBUTE:case y.OPACITYFEATUREATTRIBUTE:case y.SIZEFEATUREATTRIBUTE:{const f=o.getField(e,u)??o.getField(e,u);B(!!f,`No buffer view for ${e}`),B(1===t.size),A(t,f,i);break}case y.TANGENT:{B(4===t.size);const r=o.getField(e,d);B(!!r,`No buffer view for ${e}`),E(t,f,r,i);break}case y.PROFILEVERTEXANDNORMAL:{B(4===t.size);const f=o.getField(e,l)??o.getField(e,d);B(!!f,`No buffer view for ${e}`),h(t,f,i);break}case y.PROFILEAUXDATA:{B(3===t.size);const f=o.getField(e,n)??o.getField(e,c);B(!!f,`No buffer view for ${e}`),O(t,f,i);break}}}export{b as writeBufferFloat,I as writeBufferMat3f,T as writeBufferMat4f,m as writeBufferVec2,O as writeBufferVec3,h as writeBufferVec4,F as writeBufferVec4Zeros,N as writeColor,z as writeDefaultAttribute,k as writeDefaultAttributes,v as writeDeltaF16Vector,S as writeNormal,L as writeOlidColor,R as writePosition,E as writeTangent,A as writeVVFeatureAttribute};
5
+ import{d as e,l as t,g as f}from"../../../../../chunks/vec32.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{hasIdentityRotation as o,isOrthoNormal as i}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as s,BufferViewVec3f16 as n,BufferViewVec3f as c,BufferViewVec4f16 as l,BufferViewVec4f as d,BufferViewFloat as u,BufferViewVec2i16 as a,BufferViewVec2f16 as p,BufferViewVec2f as g}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as B}from"../../lib/Util.js";import{VertexAttribute as y}from"../../lib/VertexAttribute.js";function b(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l)s[f]=o[i[l]],f+=n;else for(let l=0;l<c;++l){const e=o[i[l]];for(let t=0;t<r;t++)s[f]=e,f+=n}}function m(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=2*o[c];i[f]=r[e],i[f+1]=r[e+1],f+=s}}function O(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=3*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}}function h(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=4*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}}function F(e,t,f){const r=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let i=0;i<f;++i)r[t]=0,r[t+1]=0,r[t+2]=0,r[t+3]=0,t+=o}function I(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=9*o[c];for(let t=0;t<9;++t)i[f+t]=r[e+t];f+=s}}function T(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=16*o[c];for(let t=0;t<16;++t)i[f+t]=r[e+t];f+=s}}function R(e,t,f,r,i=1){if(!t)return void O(e,f,r,i);const{data:s,indices:n}=e,c=f.typedBuffer,l=f.typedBufferStride,d=n.length,u=t[0],a=t[1],p=t[2],g=t[4],B=t[5],y=t[6],b=t[8],m=t[9],h=t[10],F=t[12],I=t[13],T=t[14];r*=l;let R=0,S=0,E=0;const N=o(t)?e=>{R=s[e]+F,S=s[e+1]+I,E=s[e+2]+T}:e=>{const t=s[e],f=s[e+1],r=s[e+2];R=u*t+g*f+b*r+F,S=a*t+B*f+m*r+I,E=p*t+y*f+h*r+T};if(1===i)for(let o=0;o<d;++o)N(3*n[o]),c[r]=R,c[r+1]=S,c[r+2]=E,r+=l;else for(let o=0;o<d;++o){N(3*n[o]);for(let e=0;e<i;++e)c[r]=R,c[r+1]=S,c[r+2]=E,r+=l}}function S(e,t,f,r,s=1){if(!t)return void O(e,f,r,s);const{data:n,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,p=l[0],g=l[1],B=l[2],y=l[4],b=l[5],m=l[6],h=l[8],F=l[9],I=l[10],T=!i(l),R=1e-6,S=1-R;r*=u;let E=0,N=0,A=0;const v=o(l)?e=>{E=n[e],N=n[e+1],A=n[e+2]}:e=>{const t=n[e],f=n[e+1],r=n[e+2];E=p*t+y*f+h*r,N=g*t+b*f+F*r,A=B*t+m*f+I*r};if(1===s)if(T)for(let o=0;o<a;++o){v(3*c[o]);const e=E*E+N*N+A*A;if(e<S&&e>R){const t=1/Math.sqrt(e);d[r]=E*t,d[r+1]=N*t,d[r+2]=A*t}else d[r]=E,d[r+1]=N,d[r+2]=A;r+=u}else for(let o=0;o<a;++o)v(3*c[o]),d[r]=E,d[r+1]=N,d[r+2]=A,r+=u;else for(let o=0;o<a;++o){if(v(3*c[o]),T){const e=E*E+N*N+A*A;if(e<S&&e>R){const t=1/Math.sqrt(e);E*=t,N*=t,A*=t}}for(let e=0;e<s;++e)d[r]=E,d[r+1]=N,d[r+2]=A,r+=u}}function E(e,t,f,r,o=1){if(!t)return void h(e,f,r,o);const{data:s,indices:n}=e,c=t,l=f.typedBuffer,d=f.typedBufferStride,u=n.length,a=c[0],p=c[1],g=c[2],B=c[4],y=c[5],b=c[6],m=c[8],O=c[9],F=c[10],I=!i(c),T=1e-6,R=1-T;if(r*=d,1===o)for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],o=s[e+2],c=s[e+3];let u=a*t+B*f+m*o,h=p*t+y*f+O*o,S=g*t+b*f+F*o;if(I){const e=u*u+h*h+S*S;if(e<R&&e>T){const t=1/Math.sqrt(e);u*=t,h*=t,S*=t}}l[r]=u,l[r+1]=h,l[r+2]=S,l[r+3]=c,r+=d}else for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],c=s[e+2],u=s[e+3];let h=a*t+B*f+m*c,S=p*t+y*f+O*c,E=g*t+b*f+F*c;if(I){const e=h*h+S*S+E*E;if(e<R&&e>T){const t=1/Math.sqrt(e);h*=t,S*=t,E*=t}}for(let i=0;i<o;++i)l[r]=h,l[r+1]=S,l[r+2]=E,l[r+3]=u,r+=d}}function N(e,t,f,r,o=1){const{data:i,indices:s}=e,n=f.typedBuffer,c=f.typedBufferStride,l=s.length;if(r*=c,t===i.length&&4===t){n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,s=e[r/=4];r+=t;const d=l*o;for(let f=1;f<d;++f)e[r]=s,r+=t;return}if(1!==o)if(4!==t)for(let d=0;d<l;++d){const e=3*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=255,r+=c}else for(let d=0;d<l;++d){const e=4*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=i[e+3],r+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=c}return}for(let e=0;e<l;++e){const t=3*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=255,r+=c}}}function A(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length,c=r[0];f*=s;for(let l=0;l<n;++l)i[f]=c,f+=s}function v(r,o,i,s){e(w,r,o);const n=Math.max(Math.sqrt(t(w)),1e-4);f(w,w,1/n),i[s++]=w[0],i[s++]=w[1],i[s++]=w[2],i[s++]=n}const w=r();function L(e,t,f,r,o=1){const i=t.typedBuffer,s=t.typedBufferStride;if(r*=s,1===o)for(let n=0;n<f;++n)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s;else for(let n=0;n<f;++n)for(let t=0;t<o;++t)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s}function k(e,t,f,r,o,i,n){let c={numItems:0,numVerticesPerItem:0};for(const l of f.fields.keys()){const f=e.get(l),d=f?.indices;if(f&&d)l===y.POSITION&&(c={numItems:1,numVerticesPerItem:d.length}),z(l,f,r,o,i,n);else if(l===y.OLIDCOLOR&&null!=t){const f=e.get(y.POSITION)?.indices;if(f){const e=f.length;L(t,i.getField(l,s),e,n)}}}return c}function z(e,t,f,r,o,i){switch(e){case y.POSITION:{B(3===t.size);const r=o.getField(e,c);B(!!r,`No buffer view for ${e}`),R(t,f,r,i);break}case y.NORMAL:{B(3===t.size);const f=o.getField(e,c);B(!!f,`No buffer view for ${e}`),S(t,r,f,i);break}case y.NORMALCOMPRESSED:case y.PROFILERIGHT:case y.PROFILEUP:{B(2===t.size);const f=o.getField(e,a);B(!!f,`No buffer view for ${e}`),m(t,f,i);break}case y.UV0:{B(2===t.size);const f=o.getField(e,p)??o.getField(e,g);B(!!f,`No buffer view for ${e}`),m(t,f,i);break}case y.UVI:{B(2===t.size);const f=o.getField(e,a);B(!!f,`No buffer view for ${e}`),m(t,f,i);break}case y.COLOR:case y.SYMBOLCOLOR:{const f=o.getField(e,s);B(!!f,`No buffer view for ${e}`),B(3===t.size||4===t.size),N(t,t.size,f,i);break}case y.COLORFEATUREATTRIBUTE:case y.OPACITYFEATUREATTRIBUTE:case y.SIZEFEATUREATTRIBUTE:{const f=o.getField(e,u)??o.getField(e,u);B(!!f,`No buffer view for ${e}`),B(1===t.size),A(t,f,i);break}case y.TANGENT:{B(4===t.size);const r=o.getField(e,d);B(!!r,`No buffer view for ${e}`),E(t,f,r,i);break}case y.PROFILEVERTEXANDNORMAL:{B(4===t.size);const f=o.getField(e,l)??o.getField(e,d);B(!!f,`No buffer view for ${e}`),h(t,f,i);break}case y.PROFILEAUXDATA:{B(3===t.size);const f=o.getField(e,n)??o.getField(e,c);B(!!f,`No buffer view for ${e}`),O(t,f,i);break}}}export{b as writeBufferFloat,I as writeBufferMat3f,T as writeBufferMat4f,m as writeBufferVec2,O as writeBufferVec3,h as writeBufferVec4,F as writeBufferVec4Zeros,N as writeColor,z as writeDefaultAttribute,k as writeDefaultAttributes,v as writeDeltaF16Vector,S as writeNormal,L as writeOlidColor,R as writePosition,E as writeTangent,A as writeVVFeatureAttribute};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{removeUnordered as t,filterInPlace as r}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{nextHighestPowerOfTwo as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{NestedMap as o}from"../../../../../core/NestedMap.js";import a from"../../../../../core/PooledArray.js";import{addMany as n}from"../../../../../core/SetUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as u,invert as f,transpose as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as m}from"../../../support/buffer/glUtil.js";import{ShaderOutput as g}from"../../core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as p}from"../../effects/RenderPlugin.js";import{GLMaterials as y}from"../../lib/GLMaterials.js";import{DirtyState as _}from"../../lib/ModelDirtyTypes.js";import{RenderSlot as b}from"../../lib/RenderSlot.js";import{assert as w}from"../../lib/Util.js";import{DrawParameters as v}from"../DrawParameters.js";import{BufferRange as C,mergeAdjacentRanges as O}from"./BufferRange.js";import{Instance as A}from"./Instance.js";import{PerBufferData as E,hasVao as B}from"./PerBufferData.js";import{PerOriginData as M}from"./PerOriginData.js";import{defaultHighlightName as x}from"../../../../support/HighlightDefaults.js";let D=class extends p{get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(e){return this._highlightNames.has(e)}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new v,this._highlightNames=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=s(this._glMaterials),this._dataByOrigin.forEach(e=>e.dispose()),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this._updateProduces()}_updateProduces(){this.material.produces.forEach((e,t)=>{this._produces.set(t,t=>!(0===this._dataByOrigin.size||!(t!==g.Highlight&&t!==g.ShadowHighlight||this._hasHighlights))&&e(t))})}initializeRenderContext(e){F??=e.renderContext.rctx.isAssumedMetalDriver,this._glMaterials=new y(this.material,e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,m(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees}get hasEmissions(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}get renderOccludedFlags(){return this.material.renderOccludedFlags}get numGeometries(){let e=0;return this._dataByOrigin.forEach(t=>e+=t.buffers.reduce((e,t)=>e+t.instances.size,0)),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach(t=>e+=t.buffers.reduce((e,t)=>e+t.vao.cachedMemory,0)),e}forEachGeometry(e){this._dataByOrigin.forEach(t=>t.buffers.forEach(t=>t.instances.forEach(({geometry:t})=>e(t))))}modify(e,t){this._applyUpdates(e,t),this._applyAddsAndRemoves(e),this._updateDrawCommands()}get canCompact(){for(const e of this._dataByOrigin.values())if(e.buffers.some(e=>e.holes.length>1))return!0;return!1}compact(e){if(!this.canCompact)return!1;let t=!1;for(const r of this._dataByOrigin.values()){const i=new Array;for(let t=0;t<r.buffers.length&&!e.done;){const s=r.buffers[t];s.holes.length<=1?++t:(s.instances.forEach(({geometry:e})=>i.push(e)),this._vaoCache.deleteVao(s.vao),r.buffers[t]=r.buffers[r.buffers.length-1],--r.buffers.length,e.madeProgress())}if(i.length>0){for(r.buffers.forEach(e=>this._applyAdds(e,i));i.length>0;)r.buffers.push(this._applyAndRebuild(new E,i,null));t=!0}}return t}updateHighlights(e){this.highlightOrderMap=e,this._highlightNames.clear(),this._dataByOrigin.forEach(t=>{t.buffers.forEach(t=>{t.updateHighlights(e),t.highlightNames.forEach(e=>this._highlightNames.add(e))})}),this._updateProduces()}_applyUpdates(e,t){const r=this._bufferWriter;if(null==r)return void e.clearUpdates();const i=r.vertexBufferLayout.stride/4;for(const s of e.updates){if(t.done)return;const{renderGeometry:o,updateType:a}=s;e.pending.updates.removeUnordered(s),t.madeProgress();const n=this._dataByOrigin.get(o.localOrigin.id),l=n?.findBuffer(o.id);if(null==l)return;const h=l.instances.get(o.id);if(a&(_.GEOMETRY|_.TRANSFORMATION)){const e=U(r.elementCount(h.geometry.geometry.attributes)*i),t=r.vertexBufferLayout.createView(e.buffer);this._writeGeometry(o,t,0),l.vao.vertexBuffers.get("geometry").setSubData(e,h.from*i,0,h.numElements*i)}a&(_.HIGHLIGHT|_.OCCLUDEE|_.VISIBILITY)&&(l.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new o;for(const i of e){const e=i.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new H(e.vec3),r.set(e.id,null,t)),t.changes.push(i)}for(const i of t){const e=i.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),s=t?.findBuffer(i.id);if(null==s)continue;let o=r.get(e.id,s);null==o&&(o=new H(e.vec3),r.set(e.id,s,o)),o.changes.push(i)}return r}_applyAddsAndRemoves(e){const{_bufferWriter:r,_dataByOrigin:i,_vaoCache:s}=this;if(null==r||null==s)return void e.clearAddsAndRemoves();const o=r.vertexBufferLayout.stride/4,a=this._computeDeltas(e.adds,e.removes);a.forEach((e,n)=>{const l=e.get(null),h=l?.changes??[];a.delete(n,null);let u=i.get(n);if(e.forEach((e,l)=>{if(a.delete(n,l),null==l&&w(!1,"No VAO for removed geometries"),l.instances.size===e.changes.length)return s.deleteVao(l.vao),t(u.buffers,l),void(0===u.buffers.length&&0===h.length&&i.delete(n));const f=l.numElements,c=l.vao.getByteLength("geometry")/4,d=h.reduce((e,t)=>e+r.elementCount(t.geometry.attributes),0),m=e.changes.reduce((e,t)=>e+r.elementCount(t.geometry.attributes),0),g=Math.min((f+d-m)*o,W),p=g>c;g>N&&g<c/2?(e.changes.forEach(({id:e})=>l.deleteInstance(e)),l.instances.forEach(({geometry:e})=>h.push(e)),this._vaoCache.deleteVao(l.vao),t(u.buffers,l)):p?this._applyAndRebuild(l,h,e):this._applyRemoves(l,e)}),h.length>0)for(null==u&&(u=new M(l.origin),i.set(n,u)),u.buffers.forEach(e=>this._applyAdds(e,h));h.length>0;)u.buffers.push(this._applyAndRebuild(new E,h,null))}),e.clearAddsAndRemoves()}_updateDrawCommands(){this._highlightNames.clear(),this._hasOccludees=!1,this._dataByOrigin.forEach(e=>{e.buffers.forEach(e=>{e.updateIfDrawCommandsDirty(this.highlightOrderMap,this._bufferWriter.vertexBufferLayout.stride),e.hasHighlights&&n(this._highlightNames,e.highlightNames),this._hasOccludees=this._hasOccludees||e.hasOccludees})})}_applyAndRebuild(e,t,r){if(r)for(const d of r.changes)e.deleteInstance(d.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,o=s/4,a=Math.floor(W/o);let n=e.numElements;for(;t.length>0;){const r=t.pop(),s=i.elementCount(r.geometry.attributes);if(n+s>a&&n>0){t.push(r);break}n+=s;const o=new A(r,0,0,this.highlightOrderMap);w(null==e.instances.get(r.id)),e.addInstance(r.id,o)}const l=n*o,h=U(l),u=i.vertexBufferLayout.createView(h.buffer);let f=0;e.resetInstanceSummary(),e.instances.forEach((t,r)=>{this._writeGeometry(t.geometry,u,f);const s=f;f+=i.elementCount(t.geometry.geometry.attributes),e.updateInstance(r,s,f),e.updateDrawState(t)}),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(V(l)),e.vao.vertexBuffers.get("geometry").setSubData(h,0,0,f*o),e.holes.clear();const c=e.holes.pushNew();return c.from=f,c.to=Math.floor(e.vao.getByteLength("geometry")/s),e.updateDrawCommands(this.highlightOrderMap,s),e}_applyRemoves(e,t){if(0===t.changes.length||null==this._bufferWriter)return;let r=1/0,i=-1/0;for(const a of t.changes){const t=a.id,s=e.instances.get(t);if(!s)continue;e.deleteInstance(t),F&&(r=Math.min(r,s.from),i=Math.max(i,s.to));const o=S.back();if(o){if(o.to===s.from){o.to=s.to;continue}if(o.from===s.to){o.from=s.from;continue}}const n=S.pushNew();n.from=s.from,n.to=s.to}O(S);const s=this._bufferWriter.vertexBufferLayout.stride/4,o=e.vao.vertexBuffers.get("geometry");if(F){const t=(i-r)*s,a=U(t),n=this._bufferWriter.vertexBufferLayout.createView(a.buffer);a.fill(0,0,t),e.instances.forEach(e=>{if(!(e.from>=r&&e.to<=i))return;const t=e.from-r;this._writeGeometry(e.geometry,n,t)}),o.setSubData(a,r*s,0,t)}else{const e=S.reduce((e,t)=>Math.max(e,t.numElements),0)*s,t=U(e);t.fill(0,0,e),S.forAll(e=>o.setSubData(t,e.from*s,0,e.numElements*s))}e.holes.pushArray(S.data,S.length),S.forAll((e,t)=>S.data[t]=null),S.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null==this._bufferWriter)return;if(!B(e))return void this._applyAndRebuild(e,t,null);const i=this._bufferWriter,s=i.vertexBufferLayout.stride/4,o=e.numElements,a=t.reduce((e,t)=>e+i.elementCount(t.geometry.attributes),0),n=Math.min((o+a)*s,W),l=4*n;if(e.vao.getByteLength("geometry")<V(W-N)&&l>e.vao.getByteLength("geometry"))return void this._applyAndRebuild(e,t,null);O(e.holes);const h=new Array;let u=1/0,f=-1/0;for(const r of t){const t=i.elementCount(r.geometry.attributes),s=R(e.holes,t);h.push(s),F&&null!=s&&(u=Math.min(s,u),f=Math.max(s+t,f))}const c=e.vao.vertexBuffers.get("geometry");let d=0,m=0,g=0;const p=U(F?(f-u)*s:n),y=i.vertexBufferLayout.createView(p.buffer);if(t.forEach((t,r)=>{const o=h[r];if(null==o)return;const a=i.elementCount(t.geometry.attributes);if(!F){if(!(g===o)){const e=g-m;e>0&&c.setSubData(p,m*s,0,e*s),m=o,d=0}this._writeGeometry(t,y,d),d+=a,g=o+a}const n=new A(t,o,o+a,this.highlightOrderMap);w(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0}),F){const t=(f-u)*s;p.fill(0,0,t),e.instances.forEach(e=>{if(!(e.from>=u&&e.to<=f))return;const t=e.from-u;this._writeGeometry(e.geometry,y,t)}),m=u,g=f}const _=g-m;_>0&&c.setSubData(p,m*s,0,_*s),r(t,(e,t)=>null==h[t])}_writeGeometry(e,t,r){null!=this._bufferWriter&&(u(L,e.transformation),L[12]-=e.localOrigin.vec3[0],L[13]-=e.localOrigin.vec3[1],L[14]-=e.localOrigin.vec3[2],f(j,L),c(j,j),this._bufferWriter.write(L,j,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){if(!this.material.shouldRender(e))return null;const{output:t,bind:r}=e,i=this.material.produces.get(r.slot);if(!i?.(t))return null;const{highlight:s,slot:o}=r,a=t===g.ShadowHighlight,n=t===g.Highlight,l=n||a,h=s?.name;if(l&&(0===this._highlightNames.size||n&&h&&!this._highlightNames.has(h)))return null;const u=e=>n&&!!h&&!e.has(h),f=t===g.ShadowExcludeHighlight,c=!(l||f);for(const{buffers:d}of this._dataByOrigin.values())for(const i of d){if(u(i.highlightNames))continue;const s=a?i.drawCommandsHighlights.get(x):l?h?i.drawCommandsHighlights.get(h):i.drawCommandsHighlights.size>0:((f&&i.needsMultipleCommands()?i.drawCommandsShadowHighlightRest:i.drawCommandsDefault)||null)?.length??!1,n=c&&i.drawCommandsOccludees||null;if(s||n?.length){const i=this._glMaterials.load(e.rctx,o,t),s=i?.beginSlot(r);if(s)return s}}return null}render(e,t){const{output:r,bind:i}=e,{slot:s,highlight:o}=i,n=r===g.Highlight,l=o?.name??"";if(n&&!o)return;const h=r===g.ShadowHighlight,u=n||h,f=r===g.ShadowExcludeHighlight,c=!(u||f),d=s===b.OCCLUDER_MATERIAL||s===b.TRANSPARENT_OCCLUDER_MATERIAL?s:null,{rctx:m}=e;m.runAppleAmdDriverHelper();const p=m.bindTechnique(t,i,this.material.parameters);for(const g of this._dataByOrigin.values())for(const e of g.buffers){if(n&&(!e.hasHighlights||!e.drawCommandsHighlights.has(l)))continue;if(h&&(!e.hasHighlights||!e.drawCommandsHighlights.has(x)))continue;const r=()=>{const t=[],r=e.drawCommandsHighlights.get(x)??new a;return r&&t.push(r),t},s=u&&!h?e.drawCommandsHighlights.get(l)??null:null,o=h?r():u?s?[s]:z:f&&e.needsMultipleCommands()?[e.drawCommandsShadowHighlightRest]:[e.drawCommandsDefault],y=o.some(e=>e.length>0),_=c&&e.drawCommandsOccludees||null;if(y||_?.length){if(this._drawParameters.origin=g.origin,p.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(e.vao),m.bindVAO(e.vao),y)for(const e of o)m.setPipelineState(t.getPipeline(!1,d)),e.forAll(e=>m.drawArrays(t.primitiveType,e.first,e.count));_?.length&&(m.setPipelineState(t.getPipeline(!0,d)),_.forAll(e=>m.drawArrays(t.primitiveType,e.first,e.count)))}}}static prune(){G=new Float32Array(N)}get test(){}};e([l({constructOnly:!0})],D.prototype,"material",void 0),e([l({})],D.prototype,"highlightOrderMap",void 0),D=e([h("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],D);class H{constructor(e){this.origin=e,this.changes=new Array}}function R(e,t){const r=e.find(e=>e.numElements>=t);if(null==r)return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const L=d(),j=d(),S=new a({allocator:e=>e||new C,deallocator:null}),N=65536,I=4*N,P=1024,T=16777216,W=T/4;let G=new Float32Array(N);function U(e){return G.length<e&&(G=new Float32Array(e)),G}function V(e){const t=4*e;return t<=P?P:t<I?i(t):Math.max(Math.min(Math.ceil(1.5*t/I)*I,T),t)}const z=[];let F;export{D as MergedRenderer,V as sizeForVao};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{removeUnordered as t,filterInPlace as r}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{nextHighestPowerOfTwo as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{NestedMap as o}from"../../../../../core/NestedMap.js";import a from"../../../../../core/PooledArray.js";import{addMany as n}from"../../../../../core/SetUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as u,invert as f,transpose as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as d}from"../../../support/buffer/glUtil.js";import{ShaderOutput as g}from"../../core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as p}from"../../effects/RenderPlugin.js";import{GLMaterials as y}from"../../lib/GLMaterials.js";import{DirtyState as _}from"../../lib/ModelDirtyTypes.js";import{RenderSlot as b}from"../../lib/RenderSlot.js";import{assert as w}from"../../lib/Util.js";import{DrawParameters as v}from"../DrawParameters.js";import{BufferRange as A,mergeAdjacentRanges as O}from"./BufferRange.js";import{Instance as C}from"./Instance.js";import{PerBufferData as E,hasVao as B}from"./PerBufferData.js";import{PerOriginData as M}from"./PerOriginData.js";import{defaultHighlightName as x}from"../../../../support/HighlightDefaults.js";var D;!function(e){e[e.Empty=0]="Empty",e[e.None=1]="None",e[e.Some=2]="Some",e[e.All=3]="All"}(D||(D={}));let S=class extends p{get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(e){return this._highlightNames.has(e)}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new v,this._highlightNames=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=D.Empty}destroy(){this._glMaterials=s(this._glMaterials),this._dataByOrigin.forEach(e=>e.dispose()),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this._updateProduces()}_updateProduces(){this.material.produces.forEach((e,t)=>{this._produces.set(t,t=>!(0===this._dataByOrigin.size||!(t!==g.Highlight&&t!==g.ShadowHighlight||this._hasHighlights))&&e(t))})}initializeRenderContext(e){k??=e.renderContext.rctx.isAssumedMetalDriver,this._glMaterials=new y(this.material,e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,d(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees===D.Some||this._hasOccludees===D.All}get hasOnlyOccludees(){return this._hasOccludees===D.All}get hasEmissions(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}get renderOccludedFlags(){return this.material.renderOccludedFlags}get numGeometries(){let e=0;return this._dataByOrigin.forEach(t=>e+=t.buffers.reduce((e,t)=>e+t.instances.size,0)),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach(t=>e+=t.buffers.reduce((e,t)=>e+t.vao.cachedMemory,0)),e}forEachGeometry(e){this._dataByOrigin.forEach(t=>t.buffers.forEach(t=>t.instances.forEach(({geometry:t})=>e(t))))}modify(e,t){this._applyUpdates(e,t),this._applyAddsAndRemoves(e),this._updateDrawCommands()}get canCompact(){for(const e of this._dataByOrigin.values())if(e.buffers.some(e=>e.holes.length>1))return!0;return!1}compact(e){if(!this.canCompact)return!1;let t=!1;for(const r of this._dataByOrigin.values()){const i=new Array;for(let t=0;t<r.buffers.length&&!e.done;){const s=r.buffers[t];s.holes.length<=1?++t:(s.instances.forEach(({geometry:e})=>i.push(e)),this._vaoCache.deleteVao(s.vao),r.buffers[t]=r.buffers[r.buffers.length-1],--r.buffers.length,e.madeProgress())}if(i.length>0){for(r.buffers.forEach(e=>this._applyAdds(e,i));i.length>0;)r.buffers.push(this._applyAndRebuild(new E,i,null));t=!0}}return t}updateHighlights(e){this.highlightOrderMap=e,this._highlightNames.clear(),this._dataByOrigin.forEach(t=>{t.buffers.forEach(t=>{t.updateHighlights(e),t.highlightNames.forEach(e=>this._highlightNames.add(e))})}),this._updateProduces()}_applyUpdates(e,t){const r=this._bufferWriter;if(null==r)return void e.clearUpdates();const i=r.vertexBufferLayout.stride/4;for(const s of e.updates){if(t.done)return;const{renderGeometry:o,updateType:a}=s;e.pending.updates.removeUnordered(s),t.madeProgress();const n=this._dataByOrigin.get(o.localOrigin.id),l=n?.findBuffer(o.id);if(null==l)return;const h=l.instances.get(o.id);if(a&(_.GEOMETRY|_.TRANSFORMATION)){const e=V(r.elementCount(h.geometry.geometry.attributes)*i),t=r.vertexBufferLayout.createView(e.buffer);this._writeGeometry(o,t,0),l.vao.vertexBuffers.get("geometry").setSubData(e,h.from*i,0,h.numElements*i)}a&(_.HIGHLIGHT|_.OCCLUDEE|_.VISIBILITY)&&(l.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new o;for(const i of e){const e=i.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new H(e.vec3),r.set(e.id,null,t)),t.changes.push(i)}for(const i of t){const e=i.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),s=t?.findBuffer(i.id);if(null==s)continue;let o=r.get(e.id,s);null==o&&(o=new H(e.vec3),r.set(e.id,s,o)),o.changes.push(i)}return r}_applyAddsAndRemoves(e){const{_bufferWriter:r,_dataByOrigin:i,_vaoCache:s}=this;if(null==r||null==s)return void e.clearAddsAndRemoves();const o=r.vertexBufferLayout.stride/4,a=this._computeDeltas(e.adds,e.removes);a.forEach((e,n)=>{const l=e.get(null),h=l?.changes??[];a.delete(n,null);let u=i.get(n);if(e.forEach((e,l)=>{if(a.delete(n,l),null==l&&w(!1,"No VAO for removed geometries"),l.instances.size===e.changes.length)return s.deleteVao(l.vao),t(u.buffers,l),void(0===u.buffers.length&&0===h.length&&i.delete(n));const f=l.numElements,c=l.vao.getByteLength("geometry")/4,m=h.reduce((e,t)=>e+r.elementCount(t.geometry.attributes),0),d=e.changes.reduce((e,t)=>e+r.elementCount(t.geometry.attributes),0),g=Math.min((f+m-d)*o,G),p=g>c;g>I&&g<c/2?(e.changes.forEach(({id:e})=>l.deleteInstance(e)),l.instances.forEach(({geometry:e})=>h.push(e)),this._vaoCache.deleteVao(l.vao),t(u.buffers,l)):p?this._applyAndRebuild(l,h,e):this._applyRemoves(l,e)}),h.length>0)for(null==u&&(u=new M(l.origin),i.set(n,u)),u.buffers.forEach(e=>this._applyAdds(e,h));h.length>0;)u.buffers.push(this._applyAndRebuild(new E,h,null))}),e.clearAddsAndRemoves()}_updateDrawCommands(){this._highlightNames.clear();let e=D.Empty;this._dataByOrigin.forEach(t=>{t.buffers.forEach(t=>{t.updateIfDrawCommandsDirty(this.highlightOrderMap,this._bufferWriter.vertexBufferLayout.stride),t.hasHighlights&&n(this._highlightNames,t.highlightNames),t.hasOccludees?(e===D.Empty||e===D.None)&&(e=D.All):(e===D.Empty&&(e=D.None),e===D.All&&(e=D.Some))})}),this._hasOccludees=e}_applyAndRebuild(e,t,r){if(r)for(const m of r.changes)e.deleteInstance(m.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,o=s/4,a=Math.floor(G/o);let n=e.numElements;for(;t.length>0;){const r=t.pop(),s=i.elementCount(r.geometry.attributes);if(n+s>a&&n>0){t.push(r);break}n+=s;const o=new C(r,0,0,this.highlightOrderMap);w(null==e.instances.get(r.id)),e.addInstance(r.id,o)}const l=n*o,h=V(l),u=i.vertexBufferLayout.createView(h.buffer);let f=0;e.resetInstanceSummary(),e.instances.forEach((t,r)=>{this._writeGeometry(t.geometry,u,f);const s=f;f+=i.elementCount(t.geometry.geometry.attributes),e.updateInstance(r,s,f),e.updateDrawState(t)}),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(z(l)),e.vao.vertexBuffers.get("geometry").setSubData(h,0,0,f*o),e.holes.clear();const c=e.holes.pushNew();return c.from=f,c.to=Math.floor(e.vao.getByteLength("geometry")/s),e.updateDrawCommands(this.highlightOrderMap,s),e}_applyRemoves(e,t){if(0===t.changes.length||null==this._bufferWriter)return;let r=1/0,i=-1/0;for(const a of t.changes){const t=a.id,s=e.instances.get(t);if(!s)continue;e.deleteInstance(t),k&&(r=Math.min(r,s.from),i=Math.max(i,s.to));const o=N.back();if(o){if(o.to===s.from){o.to=s.to;continue}if(o.from===s.to){o.from=s.from;continue}}const n=N.pushNew();n.from=s.from,n.to=s.to}O(N);const s=this._bufferWriter.vertexBufferLayout.stride/4,o=e.vao.vertexBuffers.get("geometry");if(k){const t=(i-r)*s,a=V(t),n=this._bufferWriter.vertexBufferLayout.createView(a.buffer);a.fill(0,0,t),e.instances.forEach(e=>{if(!(e.from>=r&&e.to<=i))return;const t=e.from-r;this._writeGeometry(e.geometry,n,t)}),o.setSubData(a,r*s,0,t)}else{const e=N.reduce((e,t)=>Math.max(e,t.numElements),0)*s,t=V(e);t.fill(0,0,e),N.forAll(e=>o.setSubData(t,e.from*s,0,e.numElements*s))}e.holes.pushArray(N.data,N.length),N.forAll((e,t)=>N.data[t]=null),N.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null==this._bufferWriter)return;if(!B(e))return void this._applyAndRebuild(e,t,null);const i=this._bufferWriter,s=i.vertexBufferLayout.stride/4,o=e.numElements,a=t.reduce((e,t)=>e+i.elementCount(t.geometry.attributes),0),n=Math.min((o+a)*s,G),l=4*n;if(e.vao.getByteLength("geometry")<z(G-I)&&l>e.vao.getByteLength("geometry"))return void this._applyAndRebuild(e,t,null);O(e.holes);const h=new Array;let u=1/0,f=-1/0;for(const r of t){const t=i.elementCount(r.geometry.attributes),s=R(e.holes,t);h.push(s),k&&null!=s&&(u=Math.min(s,u),f=Math.max(s+t,f))}const c=e.vao.vertexBuffers.get("geometry");let m=0,d=0,g=0;const p=V(k?(f-u)*s:n),y=i.vertexBufferLayout.createView(p.buffer);if(t.forEach((t,r)=>{const o=h[r];if(null==o)return;const a=i.elementCount(t.geometry.attributes);if(!k){if(!(g===o)){const e=g-d;e>0&&c.setSubData(p,d*s,0,e*s),d=o,m=0}this._writeGeometry(t,y,m),m+=a,g=o+a}const n=new C(t,o,o+a,this.highlightOrderMap);w(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0}),k){const t=(f-u)*s;p.fill(0,0,t),e.instances.forEach(e=>{if(!(e.from>=u&&e.to<=f))return;const t=e.from-u;this._writeGeometry(e.geometry,y,t)}),d=u,g=f}const _=g-d;_>0&&c.setSubData(p,d*s,0,_*s),r(t,(e,t)=>null==h[t])}_writeGeometry(e,t,r){null!=this._bufferWriter&&(u(L,e.transformation),L[12]-=e.localOrigin.vec3[0],L[13]-=e.localOrigin.vec3[1],L[14]-=e.localOrigin.vec3[2],f(j,L),c(j,j),this._bufferWriter.write(L,j,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){if(!this.material.shouldRender(e))return null;const{output:t,bind:r}=e,i=this.material.produces.get(r.slot);if(!i?.(t))return null;const{highlight:s,slot:o}=r,a=t===g.ShadowHighlight,n=t===g.Highlight,l=n||a,h=s?.name;if(l&&(0===this._highlightNames.size||n&&h&&!this._highlightNames.has(h)))return null;const u=e=>n&&!!h&&!e.has(h),f=t===g.ShadowExcludeHighlight,c=!(l||f);for(const{buffers:m}of this._dataByOrigin.values())for(const i of m){if(u(i.highlightNames))continue;const s=a?i.drawCommandsHighlights.get(x):l?h?i.drawCommandsHighlights.get(h):i.drawCommandsHighlights.size>0:((f&&i.needsMultipleCommands()?i.drawCommandsShadowHighlightRest:i.drawCommandsDefault)||null)?.length??!1,n=c&&i.drawCommandsOccludees||null;if(s||n?.length){const i=this._glMaterials.load(e.rctx,o,t),s=i?.beginSlot(r);if(s)return s}}return null}render(e,t){const{output:r,bind:i}=e,{slot:s,highlight:o}=i,n=r===g.Highlight,l=o?.name??"";if(n&&!o)return;const h=r===g.ShadowHighlight,u=n||h,f=r===g.ShadowExcludeHighlight,c=!(u||f),m=s===b.OCCLUDER_MATERIAL||s===b.TRANSPARENT_OCCLUDER_MATERIAL?s:null,{rctx:d}=e;d.runAppleAmdDriverHelper();const p=d.bindTechnique(t,i,this.material.parameters);for(const g of this._dataByOrigin.values())for(const e of g.buffers){if(n&&(!e.hasHighlights||!e.drawCommandsHighlights.has(l)))continue;if(h&&(!e.hasHighlights||!e.drawCommandsHighlights.has(x)))continue;const r=()=>{const t=[],r=e.drawCommandsHighlights.get(x)??new a;return r&&t.push(r),t},s=u&&!h?e.drawCommandsHighlights.get(l)??null:null,o=h?r():u?s?[s]:F:f&&e.needsMultipleCommands()?[e.drawCommandsShadowHighlightRest]:[e.drawCommandsDefault],y=o.some(e=>e.length>0),_=c&&e.drawCommandsOccludees||null;if(y||_?.length){if(this._drawParameters.origin=g.origin,p.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(e.vao),d.bindVAO(e.vao),y)for(const e of o)d.setPipelineState(t.getPipeline(!1,m)),e.forAll(e=>d.drawArrays(t.primitiveType,e.first,e.count));_?.length&&(d.setPipelineState(t.getPipeline(!0,m)),_.forAll(e=>d.drawArrays(t.primitiveType,e.first,e.count)))}}}static prune(){U=new Float32Array(I)}get test(){}};e([l({constructOnly:!0})],S.prototype,"material",void 0),e([l({})],S.prototype,"highlightOrderMap",void 0),S=e([h("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],S);class H{constructor(e){this.origin=e,this.changes=new Array}}function R(e,t){const r=e.find(e=>e.numElements>=t);if(null==r)return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const L=m(),j=m(),N=new a({allocator:e=>e||new A,deallocator:null}),I=65536,P=4*I,T=1024,W=16777216,G=W/4;let U=new Float32Array(I);function V(e){return U.length<e&&(U=new Float32Array(e)),U}function z(e){const t=4*e;return t<=T?T:t<P?i(t):Math.max(Math.min(Math.ceil(1.5*t/P)*P,W),t)}const F=[];let k;export{S as MergedRenderer,D as OccludeeState,z as sizeForVao};
@@ -0,0 +1,17 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{FloatPassUniform as t}from"../core/shaderModules/FloatPassUniform.js";import{glsl as a}from"../core/shaderModules/glsl.js";import{VertexAttribute as e}from"../lib/VertexAttribute.js";var i;function r(r,o){const{attributes:d,varyings:m,vertex:n,fragment:s}=r,{animation:T}=o;T!==i.None&&(d.add(e.TIMESTAMPS,"vec3"),m.add("vTimeStamp","float"),m.add("vFirstTime","float"),m.add("vLastTime","float"),n.main.add(a`vTimeStamp = timeStamps.x;
6
+ vFirstTime = timeStamps.y;
7
+ vLastTime = timeStamps.z;`),s.uniforms.add(new t("timeElapsed",t=>t.timeElapsed)),s.uniforms.add(new t("trailLength",t=>t.trailLength)),T===i.FadingTrail&&s.constants.add("decayRate","float",2.3),s.code.add(a`
8
+ float getTrailOpacity(float x) {
9
+ ${l(T)}
10
+ }`),s.code.add(a`vec4 animate(vec4 color) {
11
+ float totalTimeWithTrail = vLastTime - vFirstTime + trailLength;
12
+ float timeAtHead = mod(timeElapsed - vFirstTime, totalTimeWithTrail) + vFirstTime;
13
+ float t = timeAtHead - vTimeStamp;
14
+ vec4 animatedColor = color * step(0.0, t);
15
+ animatedColor.a *= getTrailOpacity(t / trailLength);
16
+ return animatedColor;
17
+ }`))}function l(t){switch(t){case i.FixedTrail:return"return x >= 0.0 && x <= 1.0 ? 1.0 : 0.0;";case i.FadingTrail:return"float cutOff = exp(-decayRate);\n return (exp(-decayRate * x) - cutOff) / (1.0 - cutOff);";case i.FullTrail:default:return"return 1.0;"}}!function(t){t[t.None=0]="None",t[t.FullTrail=1]="FullTrail",t[t.FixedTrail=2]="FixedTrail",t[t.FadingTrail=3]="FadingTrail",t[t.COUNT=4]="COUNT"}(i||(i={}));export{r as AnimatedLine,i as Animation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/shading/LineStipple.glsl.js";import"../core/shaderLibrary/shading/MarkerSizing.glsl.js";import"../core/shaderLibrary/shading/PiUtils.glsl.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatBindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../lib/VertexAttribute.js";import"./LineMarkerTechniqueConfiguration.js";import"./OutputColorHighlightOID.glsl.js";import"./RibbonLineTechniqueConfiguration.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build,r as ribbonlineNumRoundJoinSubdivisions}from"../../../../chunks/RibbonLine.glsl.js";
5
+ import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/shading/LineStipple.glsl.js";import"../core/shaderLibrary/shading/MarkerSizing.glsl.js";import"../core/shaderLibrary/shading/PiUtils.glsl.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatBindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../lib/VertexAttribute.js";import"./AnimatedLine.glsl.js";import"./LineMarkerTechniqueConfiguration.js";import"./OutputColorHighlightOID.glsl.js";import"./RibbonLineTechniqueConfiguration.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build,r as ribbonlineNumRoundJoinSubdivisions}from"../../../../chunks/RibbonLine.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i,depthOnlyOutputBuffersOr as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as l}from"../lib/OITPass.js";import{OITPolygonOffset as n,depthWrite as s,oitDepthTest as o,blending as u,getDrawBuffers as p}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilToolMaskBaseParams as a,stencilBaseAllZerosParams as d,stencilWriteMaskOn as T,stencilToolTransparentOccluderParams as f,depthCompareAlways as h,stencilToolMaskOccluderParams as m,stencilWriteMaskOff as O,depthCompareLess as E}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as A}from"../../../webgl/enums.js";import{makePipelineState as b,defaultColorWrite as g,unpremultipliedAlphaToPremultipliedAlpha as I}from"../../../webgl/renderState.js";class S extends i{constructor(e,i){super(e,i,new t(R,()=>import("./RibbonLine.glsl.js")),_),this.primitiveType=i.wireframe?A.LINES:A.TRIANGLE_STRIP}_makePipelineState(t,i){const{oitPass:c,output:f,hasOccludees:h,hasPolygonOffset:m}=t,O=c===l.NONE,E=c===l.FrontFace;return b({blending:e(f)?u(c):null,depthTest:{func:o(c)},depthWrite:s(t),drawBuffers:r(f,p(c,f)),colorWrite:g,stencilWrite:h?T:null,stencilTest:h?i?a:d:null,polygonOffset:O||E?m?L:null:n})}initializePipeline(e){if(e.occluder){const t=e.hasPolygonOffset?L:null,{output:i,hasOccludees:l}=e;this._occluderPipelineTransparent=b({blending:I,polygonOffset:t,depthTest:h,depthWrite:null,colorWrite:g,stencilWrite:null,stencilTest:l?f:null,drawBuffers:r(i)}),this._occluderPipelineOpaque=b({blending:I,polygonOffset:t,depthTest:l?h:E,depthWrite:null,colorWrite:g,stencilWrite:l?O:null,stencilTest:l?m:null,drawBuffers:r(i)}),this._occluderPipelineMaskWrite=b({blending:null,polygonOffset:t,depthTest:E,depthWrite:null,colorWrite:null,stencilWrite:l?T:null,stencilTest:l?a:null,drawBuffers:r(i)})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case c.TRANSPARENT_OCCLUDER_MATERIAL:return this._occluderPipelineTransparent??super.getPipeline();case c.OCCLUDER_MATERIAL:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const L={factor:0,units:-4},_=new Map([[P.POSITION,0],[P.PREVIOUSDELTA,1],[P.NEXTDELTA,2],[P.U0,3],[P.LINEPARAMETERS,4],[P.COLOR,5],[P.COLORFEATUREATTRIBUTE,5],[P.SIZE,6],[P.SIZEFEATUREATTRIBUTE,6],[P.OPACITYFEATUREATTRIBUTE,7],[P.OLIDCOLOR,8]]);export{S as RibbonLineTechnique,_ as vertexAttributeLocations};
5
+ import"../../../../core/has.js";import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i,depthOnlyOutputBuffersOr as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as l}from"../lib/OITPass.js";import{OITPolygonOffset as n,depthWrite as s,oitDepthTest as o,blending as u,getDrawBuffers as p}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilToolMaskBaseParams as a,stencilBaseAllZerosParams as d,stencilWriteMaskOn as T,stencilToolTransparentOccluderParams as f,depthCompareAlways as h,stencilToolMaskOccluderParams as m,stencilWriteMaskOff as E,depthCompareLess as O}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as A}from"../../../webgl/enums.js";import{makePipelineState as I,defaultColorWrite as S,unpremultipliedAlphaToPremultipliedAlpha as b}from"../../../webgl/renderState.js";class g extends i{constructor(e,i){super(e,i,new t(R,()=>import("./RibbonLine.glsl.js")),_),this.primitiveType=i.wireframe?A.LINES:A.TRIANGLE_STRIP}_makePipelineState(t,i){const{oitPass:c,output:f,hasOccludees:h,hasPolygonOffset:m}=t,E=c===l.NONE,O=c===l.FrontFace;return I({blending:e(f)?u(c):null,depthTest:{func:o(c)},depthWrite:s(t),drawBuffers:r(f,p(c,f)),colorWrite:S,stencilWrite:h?T:null,stencilTest:h?i?a:d:null,polygonOffset:E||O?m?L:null:n})}initializePipeline(e){if(e.occluder){const t=e.hasPolygonOffset?L:null,{output:i,hasOccludees:l}=e;this._occluderPipelineTransparent=I({blending:b,polygonOffset:t,depthTest:h,depthWrite:null,colorWrite:S,stencilWrite:null,stencilTest:l?f:null,drawBuffers:r(i)}),this._occluderPipelineOpaque=I({blending:b,polygonOffset:t,depthTest:l?h:O,depthWrite:null,colorWrite:S,stencilWrite:l?E:null,stencilTest:l?m:null,drawBuffers:r(i)}),this._occluderPipelineMaskWrite=I({blending:null,polygonOffset:t,depthTest:O,depthWrite:null,colorWrite:null,stencilWrite:l?T:null,stencilTest:l?a:null,drawBuffers:r(i)})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case c.TRANSPARENT_OCCLUDER_MATERIAL:return this._occluderPipelineTransparent??super.getPipeline();case c.OCCLUDER_MATERIAL:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const L={factor:0,units:-4},_=new Map([[P.POSITION,0],[P.PREVIOUSDELTA,1],[P.NEXTDELTA,2],[P.U0,3],[P.LINEPARAMETERS,4],[P.COLOR,5],[P.COLORFEATUREATTRIBUTE,5],[P.SIZE,6],[P.SIZEFEATUREATTRIBUTE,6],[P.OPACITYFEATUREATTRIBUTE,7],[P.OLIDCOLOR,8],[P.TIMESTAMPS,9]]);export{g as RibbonLineTechnique,_ as vertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../../chunks/tslib.es6.js";import{TextureCoordinateType as t}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{EmissionSource as e}from"../core/shaderLibrary/output/Emissions.glsl.js";import{parameter as i}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as r}from"../materials/DefaultTechniqueConfiguration.js";var s;!function(o){o[o.BUTT=0]="BUTT",o[o.SQUARE=1]="SQUARE",o[o.ROUND=2]="ROUND",o[o.COUNT=3]="COUNT"}(s||(s={}));class p extends r{constructor(){super(...arguments),this.capType=s.BUTT,this.hasPolygonOffset=!1,this.writeDepth=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stipplePreferContinuous=!0,this.roundJoins=!1,this.applyMarkerOffset=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.hasOccludees=!1,this.occluder=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.wireframe=!1,this.discardInvisibleFragments=!1,this.objectAndLayerIdColorInstanced=!1,this.textureCoordinateType=t.None,this.emissionSource=e.None,this.occlusionPass=!1,this.hasVvInstancing=!0,this.hasSliceTranslatedView=!0,this.overlayEnabled=!1,this.snowCover=!1}}o([i({count:s.COUNT})],p.prototype,"capType",void 0),o([i()],p.prototype,"hasPolygonOffset",void 0),o([i()],p.prototype,"writeDepth",void 0),o([i()],p.prototype,"draped",void 0),o([i()],p.prototype,"stippleEnabled",void 0),o([i()],p.prototype,"stippleOffColorEnabled",void 0),o([i()],p.prototype,"stipplePreferContinuous",void 0),o([i()],p.prototype,"roundJoins",void 0),o([i()],p.prototype,"applyMarkerOffset",void 0),o([i()],p.prototype,"vvSize",void 0),o([i()],p.prototype,"vvColor",void 0),o([i()],p.prototype,"vvOpacity",void 0),o([i()],p.prototype,"falloffEnabled",void 0),o([i()],p.prototype,"innerColorEnabled",void 0),o([i()],p.prototype,"hasOccludees",void 0),o([i()],p.prototype,"occluder",void 0),o([i()],p.prototype,"terrainDepthTest",void 0),o([i()],p.prototype,"cullAboveTerrain",void 0),o([i()],p.prototype,"wireframe",void 0),o([i()],p.prototype,"discardInvisibleFragments",void 0),o([i()],p.prototype,"objectAndLayerIdColorInstanced",void 0);export{s as CapType,p as RibbonLineTechniqueConfiguration};
5
+ import{_ as o}from"../../../../chunks/tslib.es6.js";import{TextureCoordinateType as t}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{EmissionSource as e}from"../core/shaderLibrary/output/Emissions.glsl.js";import{parameter as i}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as r}from"../materials/DefaultTechniqueConfiguration.js";import{Animation as s}from"./AnimatedLine.glsl.js";var p;!function(o){o[o.BUTT=0]="BUTT",o[o.SQUARE=1]="SQUARE",o[o.ROUND=2]="ROUND",o[o.COUNT=3]="COUNT"}(p||(p={}));class a extends r{constructor(){super(...arguments),this.capType=p.BUTT,this.hasPolygonOffset=!1,this.writeDepth=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stipplePreferContinuous=!0,this.roundJoins=!1,this.applyMarkerOffset=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.hasOccludees=!1,this.occluder=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.wireframe=!1,this.discardInvisibleFragments=!1,this.objectAndLayerIdColorInstanced=!1,this.animation=s.FixedTrail,this.textureCoordinateType=t.None,this.emissionSource=e.None,this.occlusionPass=!1,this.hasVvInstancing=!0,this.hasSliceTranslatedView=!0,this.overlayEnabled=!1,this.snowCover=!1}}o([i({count:p.COUNT})],a.prototype,"capType",void 0),o([i()],a.prototype,"hasPolygonOffset",void 0),o([i()],a.prototype,"writeDepth",void 0),o([i()],a.prototype,"draped",void 0),o([i()],a.prototype,"stippleEnabled",void 0),o([i()],a.prototype,"stippleOffColorEnabled",void 0),o([i()],a.prototype,"stipplePreferContinuous",void 0),o([i()],a.prototype,"roundJoins",void 0),o([i()],a.prototype,"applyMarkerOffset",void 0),o([i()],a.prototype,"vvSize",void 0),o([i()],a.prototype,"vvColor",void 0),o([i()],a.prototype,"vvOpacity",void 0),o([i()],a.prototype,"falloffEnabled",void 0),o([i()],a.prototype,"innerColorEnabled",void 0),o([i()],a.prototype,"hasOccludees",void 0),o([i()],a.prototype,"occluder",void 0),o([i()],a.prototype,"terrainDepthTest",void 0),o([i()],a.prototype,"cullAboveTerrain",void 0),o([i()],a.prototype,"wireframe",void 0),o([i()],a.prototype,"discardInvisibleFragments",void 0),o([i()],a.prototype,"objectAndLayerIdColorInstanced",void 0),o([i({count:s.COUNT})],a.prototype,"animation",void 0);export{p as CapType,a as RibbonLineTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import i from"../core/ArrayPool.js";import{watch as s,initial as a}from"../core/reactiveUtils.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";const l={widthBreakpoint:{getValue(e){const i=e.viewSize[0],s=e.breakpoints,a=this.values;return i<=s.xsmall?a.xsmall:i<=s.small?a.small:i<=s.medium?a.medium:i<=s.large?a.large:a.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(e){const i=e.viewSize[1],s=e.breakpoints,a=this.values;return i<=s.xsmall?a.xsmall:i<=s.small?a.small:i<=s.medium?a.medium:i<=s.large?a.large:a.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(e){const i=e.viewSize,s=i[0],a=i[1],t=this.values;return a>=s?t.portrait:t.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},h={xsmall:544,small:768,medium:992,large:1200};function n(e){const i=e;return i&&i.xsmall<i.small&&i.small<i.medium&&i.medium<i.large}function m(e,i){return i?l[e].valueToClassName[i].split(" "):[]}const o=o=>{let g=class extends o{constructor(...e){super(...e),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=h}initialize(){this.addHandles(s(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),a))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(e){if(e===this._get("breakpoints"))return;if(!n(e)){const i=JSON.stringify(h,null,2);console.warn("provided breakpoints are not valid, using defaults:"+i),e=h}this._set("breakpoints",{...e})}_updateClassNames(){if(!this.container)return;const e=i.acquire(),s=i.acquire();let a,t=!1;for(a in l){const i=this[a],r=l[a].getValue({viewSize:this.size,breakpoints:this.breakpoints});i!==r&&(t=!0,this[a]=r,m(a,i).forEach(e=>s.push(e)),m(a,r).forEach(i=>e.push(i)))}t&&(this._applyClassNameChanges(e,s),i.release(e),i.release(s))}_applyClassNameChanges(e,i){const s=this.container;s&&(i.forEach(e=>s.classList.remove(e)),e.forEach(e=>s.classList.add(e)))}_removeActiveClassNames(){const e=this.container;if(!e)return;let i;for(i in l)m(i,this[i]).forEach(i=>e.classList.remove(i))}};return e([t()],g.prototype,"breakpoints",null),e([t()],g.prototype,"orientation",void 0),e([t()],g.prototype,"widthBreakpoint",void 0),e([t()],g.prototype,"heightBreakpoint",void 0),g=e([r("esri.views.BreakpointsOwner")],g),g};export{o as BreakpointsOwner};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import i from"../core/ArrayPool.js";import{watch as s,initial as a}from"../core/reactiveUtils.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";const l={widthBreakpoint:{getValue(e){const i=e.viewSize[0],s=e.breakpoints,a=this.values;return i<=s.xsmall?a.xsmall:i<=s.small?a.small:i<=s.medium?a.medium:i<=s.large?a.large:a.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(e){const i=e.viewSize[1],s=e.breakpoints,a=this.values;return i<=s.xsmall?a.xsmall:i<=s.small?a.small:i<=s.medium?a.medium:i<=s.large?a.large:a.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(e){const i=e.viewSize,s=i[0],a=i[1],t=this.values;return a>=s?t.portrait:t.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},h={xsmall:544,small:768,medium:992,large:1200};function n(e){const i=e;return i&&i.xsmall<i.small&&i.small<i.medium&&i.medium<i.large}function m(e,i){return i?l[e].valueToClassName[i].split(" "):[]}const o=o=>{const g=o;let w=class extends g{constructor(...e){super(...e),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=h}initialize(){this.addHandles(s(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),a))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(e){if(e===this._get("breakpoints"))return;if(!n(e)){const i=JSON.stringify(h,null,2);console.warn("provided breakpoints are not valid, using defaults:"+i),e=h}this._set("breakpoints",{...e})}_updateClassNames(){if(!this.container)return;const e=i.acquire(),s=i.acquire();let a,t=!1;for(a in l){const i=this[a],r=l[a].getValue({viewSize:this.size,breakpoints:this.breakpoints});i!==r&&(t=!0,this[a]=r,m(a,i).forEach(e=>s.push(e)),m(a,r).forEach(i=>e.push(i)))}t&&(this._applyClassNameChanges(e,s),i.release(e),i.release(s))}_applyClassNameChanges(e,i){const s=this.container;s&&(i.forEach(e=>s.classList.remove(e)),e.forEach(e=>s.classList.add(e)))}_removeActiveClassNames(){const e=this.container;if(!e)return;let i;for(i in l)m(i,this[i]).forEach(i=>e.classList.remove(i))}};return e([t()],w.prototype,"breakpoints",null),e([t()],w.prototype,"orientation",void 0),e([t()],w.prototype,"widthBreakpoint",void 0),e([t()],w.prototype,"heightBreakpoint",void 0),w=e([r("esri.views.BreakpointsOwner")],w),w};export{o as BreakpointsOwner};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{byId as t,reparent as s}from"../core/domUtils.js";import{on as i}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import o from"../core/Logger.js";import{removeMaybe as n}from"../core/maybe.js";import{watch as a,initial as h}from"../core/reactiveUtils.js";import{addFrameTask as d}from"../core/scheduling.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import c from"./overlay/ViewOverlay.js";const p=[0,0];function m(e){const t=(e.ownerDocument||window.document).defaultView,s=e.getBoundingClientRect();return p[0]=s.left+(t?.pageXOffset??0),p[1]=s.top+(t?.pageYOffset??0),p}function f(e){e&&(e.textContent="",e.parentNode&&e.parentNode.removeChild(e))}function y(e){const t=document.createElement("div");return e.appendChild(t),t}const g=16,_=750,v=512,w=2,C=p=>{let C=class extends p{constructor(...e){super(...e),this._freqInfo={freq:g,time:_},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([a(()=>this.cursor,e=>{const{surface:t}=this;t&&t.setAttribute("data-cursor",e)}),a(()=>this.navigating,e=>{const{surface:t}=this;t&&t.setAttribute("data-navigating",e.toString())})])}initialize(){this.addHandles([a(()=>this.ui,(e,t)=>this._handleUIChange(e,t),h),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui?.destroy(),this.container=null)}get container(){return this._get("container")??null}set container(e){const i=this._get("container"),r=t(e);if(r||"string"!=typeof e||o.getLogger(this).error("#container",`element with id '${e}' not found`),i===r)return;if(this._stopMeasuring(),i&&(i.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(f(this.root),this._set("root",null)),this.userContent&&(s(this.userContent,i),f(this.userContent),this._set("userContent",null))),!r)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);r.classList.add("esri-view");const h=document.createElement("div");h.className="esri-view-user-storage",s(r,h),r.appendChild(h),this._set("userContent",h);const l=document.createElement("div");l.className="esri-view-root",r.insertBefore(l,r.firstChild),this._set("root",l);const u=document.createElement("div");u.className="esri-view-surface",u.setAttribute("role","application"),u.tabIndex=0,l.appendChild(u),this._set("surface",u);const p=new c;l.appendChild(p.surface),this._set("overlay",p),this.addHandles(a(()=>p.needsRender,e=>{e&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=d({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=n(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",r),this._startMeasuring()}get focused(){const e=document.activeElement===this.surface;return document.hasFocus()&&e}get size(){return[this.width,this.height]}set ui(e){const t=this._get("ui");t!==e&&t?.destroy(),this._set("ui",e)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(e,t,s){const i=this.position;return e-=i?i[0]:0,t-=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}containerToPage(e,t,s){const i=this.position;return e+=i?i[0]:0,t+=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}_handleUIChange(e,t){this.removeHandles("ui"),t&&t!==e&&t.destroy(),e&&(e.view=this,this.addHandles(a(()=>this.root,t=>{e.container=t?y(t):null},h),"ui")),this._set("ui",e)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const e=this._freqInfo;e.freq=g,e.time=_;const t=d({prepare:e=>{const s=this._measure(),i=this._freqInfo;if(i.time+=e.deltaTime,s&&(i.freq=g,this._get("resizing")||this._set("resizing",!0)),i.time<i.freq)return;i.time=0;const r=this._position();i.freq=r||s?g:Math.min(_,i.freq*w),!s&&i.freq>=v&&(t.pause(),this._get("resizing")&&this._set("resizing",!1))}}),s=new ResizeObserver(s=>{e.freq=g,e.time=_,t.resume()});null!=this.container&&s.observe(this.container);const o=r(()=>s.disconnect());this.addHandles([i(window,"resize",()=>{e.freq=g,e.time=_,t.resume()}),o,t],"measuring"),this._measure(),this._position()}_measure(){const e=this.container,t=e?e.clientWidth:0,s=e?e.clientHeight:0;if(0===t||0===s)return this.suspended||this._set("suspended",!0),!1;const i=this.width,r=this.height;return t===i&&s===r?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",t),this._set("height",s),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:i,oldHeight:r,width:t,height:s}),!0)}_position(){const e=this.container,t=this.position,s=e&&m(e);return!!s&&((!t||s[0]!==t[0]||s[1]!==t[1])&&(this._set("position",[s[0],s[1]]),!0))}forceDOMReadyCycle(){}};return e([l()],C.prototype,"container",null),e([l({readOnly:!0})],C.prototype,"focused",null),e([l({readOnly:!0})],C.prototype,"height",void 0),e([l()],C.prototype,"messagesCommon",void 0),e([l({type:c})],C.prototype,"overlay",void 0),e([l({readOnly:!0})],C.prototype,"position",void 0),e([l({readOnly:!0})],C.prototype,"resizing",void 0),e([l({readOnly:!0})],C.prototype,"root",void 0),e([l({value:null,readOnly:!0})],C.prototype,"size",null),e([l({readOnly:!0})],C.prototype,"surface",void 0),e([l({readOnly:!0})],C.prototype,"suspended",void 0),e([l({nonNullable:!0})],C.prototype,"ui",null),e([l({readOnly:!0})],C.prototype,"userContent",void 0),e([l({readOnly:!0})],C.prototype,"width",void 0),e([l()],C.prototype,"widthBreakpoint",void 0),C=e([u("esri.views.DOMContainer")],C),C};export{C as DOMContainer};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{byId as t,reparent as s}from"../core/domUtils.js";import{on as i}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import o from"../core/Logger.js";import{removeMaybe as n}from"../core/maybe.js";import{watch as a,initial as h}from"../core/reactiveUtils.js";import{addFrameTask as d}from"../core/scheduling.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import c from"./overlay/ViewOverlay.js";const p=[0,0];function m(e){const t=(e.ownerDocument||window.document).defaultView,s=e.getBoundingClientRect();return p[0]=s.left+(t?.pageXOffset??0),p[1]=s.top+(t?.pageYOffset??0),p}function f(e){e&&(e.textContent="",e.parentNode&&e.parentNode.removeChild(e))}function y(e){const t=document.createElement("div");return e.appendChild(t),t}const g=16,_=750,v=512,w=2,C=p=>{const C=p;let H=class extends C{constructor(...e){super(...e),this._freqInfo={freq:g,time:_},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([a(()=>this.cursor,e=>{const{surface:t}=this;t&&t.setAttribute("data-cursor",e)}),a(()=>this.navigating,e=>{const{surface:t}=this;t&&t.setAttribute("data-navigating",e.toString())})])}initialize(){this.addHandles([a(()=>this.ui,(e,t)=>this._handleUIChange(e,t),h),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui?.destroy(),this.container=null)}get container(){return this._get("container")??null}set container(e){const i=this._get("container"),r=t(e);if(r||"string"!=typeof e||o.getLogger(this).error("#container",`element with id '${e}' not found`),i===r)return;if(this._stopMeasuring(),i&&(i.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(f(this.root),this._set("root",null)),this.userContent&&(s(this.userContent,i),f(this.userContent),this._set("userContent",null))),!r)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);r.classList.add("esri-view");const h=document.createElement("div");h.className="esri-view-user-storage",s(r,h),r.appendChild(h),this._set("userContent",h);const l=document.createElement("div");l.className="esri-view-root",r.insertBefore(l,r.firstChild),this._set("root",l);const u=document.createElement("div");u.className="esri-view-surface",u.setAttribute("role","application"),u.tabIndex=0,l.appendChild(u),this._set("surface",u);const p=new c;l.appendChild(p.surface),this._set("overlay",p),this.addHandles(a(()=>p.needsRender,e=>{e&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=d({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=n(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",r),this._startMeasuring()}get focused(){const e=document.activeElement===this.surface;return document.hasFocus()&&e}get size(){return[this.width,this.height]}set ui(e){const t=this._get("ui");t!==e&&t?.destroy(),this._set("ui",e)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(e,t,s){const i=this.position;return e-=i?i[0]:0,t-=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}containerToPage(e,t,s){const i=this.position;return e+=i?i[0]:0,t+=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}_handleUIChange(e,t){this.removeHandles("ui"),t&&t!==e&&t.destroy(),e&&(e.view=this,this.addHandles(a(()=>this.root,t=>{e.container=t?y(t):null},h),"ui")),this._set("ui",e)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const e=this._freqInfo;e.freq=g,e.time=_;const t=d({prepare:e=>{const s=this._measure(),i=this._freqInfo;if(i.time+=e.deltaTime,s&&(i.freq=g,this._get("resizing")||this._set("resizing",!0)),i.time<i.freq)return;i.time=0;const r=this._position();i.freq=r||s?g:Math.min(_,i.freq*w),!s&&i.freq>=v&&(t.pause(),this._get("resizing")&&this._set("resizing",!1))}}),s=new ResizeObserver(s=>{e.freq=g,e.time=_,t.resume()});null!=this.container&&s.observe(this.container);const o=r(()=>s.disconnect());this.addHandles([i(window,"resize",()=>{e.freq=g,e.time=_,t.resume()}),o,t],"measuring"),this._measure(),this._position()}_measure(){const e=this.container,t=e?e.clientWidth:0,s=e?e.clientHeight:0;if(0===t||0===s)return this.suspended||this._set("suspended",!0),!1;const i=this.width,r=this.height;return t===i&&s===r?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",t),this._set("height",s),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:i,oldHeight:r,width:t,height:s}),!0)}_position(){const e=this.container,t=this.position,s=e&&m(e);return!!s&&((!t||s[0]!==t[0]||s[1]!==t[1])&&(this._set("position",[s[0],s[1]]),!0))}forceDOMReadyCycle(){}};return e([l()],H.prototype,"container",null),e([l({readOnly:!0})],H.prototype,"focused",null),e([l({readOnly:!0})],H.prototype,"height",void 0),e([l()],H.prototype,"messagesCommon",void 0),e([l({type:c})],H.prototype,"overlay",void 0),e([l({readOnly:!0})],H.prototype,"position",void 0),e([l({readOnly:!0})],H.prototype,"resizing",void 0),e([l({readOnly:!0})],H.prototype,"root",void 0),e([l({value:null,readOnly:!0})],H.prototype,"size",null),e([l({readOnly:!0})],H.prototype,"surface",void 0),e([l({readOnly:!0})],H.prototype,"suspended",void 0),e([l({nonNullable:!0})],H.prototype,"ui",null),e([l({readOnly:!0})],H.prototype,"userContent",void 0),e([l({readOnly:!0})],H.prototype,"width",void 0),e([l()],H.prototype,"widthBreakpoint",void 0),H=e([u("esri.views.DOMContainer")],H),H};export{C as DOMContainer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as p}from"../chunks/tslib.es6.js";import{createTask as e}from"../core/asyncUtils.js";import t from"../core/Error.js";import has from"../core/has.js";import o from"../core/Logger.js";import{throwIfAborted as i,wrapAbortWithTimeout as s,allSettledValues as r,createResolver as a}from"../core/promiseUtils.js";import{watch as u,syncAndInitial as n,whenOnce as c}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{ViewEventPriorities as d}from"./input/InputManager.js";function m(p){return null!=p&&"open"in p&&"declaredClass"in p}function f(p){return null!=p&&"declaredClass"in p&&"dockOptions"in p}const w=a=>{let w=class extends a{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([u(()=>[this.ui,this.popup],([p,e],t)=>{const o="popup",i="manual";if(t){const[p,i]=t;p&&m(i)&&(i.view=null,f(i)&&(p.remove(i,o),i!==e&&e&&i.destroy()))}p&&m(e)&&(e.view=this,f(e)&&p.add(e,{key:o,position:i,internal:!0}))},n),this.on("click",p=>{this.popup&&this.popupEnabled&&("mouse"!==p.pointerType||0===p.button)&&(m(this.popup)?this.popup.viewModel.handleViewClick(p):p.defer(async()=>{await this.setupPopup(),m(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(p)}))},d.WIDGET)]),c(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{import("../widgets/Popup.js")})}destroy(){this.destroyed||this.closePopup()}async openPopup(p){if(m(this.popup))return this.popup.open(p);try{if(await this.setupPopup(),!this.popup)return void o.getLogger(this).error(new t("view:null-popup","Popup is null and can't be opened"));this.popup.open(p)}catch{}}closePopup(){this._popupSetupTask?.abort(),m(this.popup)&&this.popup.close()}async fetchPopupFeatures(p,e){return await this.when(),this._popupHitsToFeatures(await this._getPopupHits(p,e),e)}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!m(this.popup))return this._popupSetupTask=e(async p=>{const{default:e}=await import("../widgets/Popup.js");if(i(p),!this.popup||m(this.popup))return;const t=this.popup;delete t.open,delete t.close,this.popup=new e(t)}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:p,hits:e},t){const o=[],i=[];let a=!1;const u=s(t,has("popup-view-fetch-timeout")??P),n=p=>{const e=new y(p);return i.push(e),o.push(e.promise),e},c=p=>{const e=i.at(-1);return e&&e.layerView===p&&!a?e:n(p)};for(const s of e)if("graphic"in s){c(s.layerView).graphics.push(s.graphic),a=!1}else o.push(s.layerView.fetchPopupFeaturesAtLocation(s.mapPoint,u)),a=!0;i.map(p=>p.resolve(u));const h=r(o).then(p=>p.filter(p=>!!p).flat());return{pendingFeatures:o,allGraphicsPromise:h,location:p}}async _getPopupHits(p,e){const{hits:t,location:o}=await this.popupHitTest(p);i(e);const s=[];for(const i of t)if("graphic"in i){if(this._isValidPopupGraphic(i.graphic,e)){const p=this._isValidPopupGraphicsLayerView(i.layerView)?i.layerView:void 0;s.push({graphic:i.graphic,layerView:p})}}else this._isValidPopupLocationLayerView(i.layerView)&&s.push({mapPoint:i.mapPoint,layerView:i.layerView});return{hits:s,location:o}}_isValidPopupGraphic(p,e){return p&&!!p.getEffectivePopupTemplate(e?.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(p){return!p||(!("layer"in p)||!p.suspended)&&"fetchPopupFeaturesFromGraphics"in p}_isValidPopupLocationLayerView(p){return(!("layer"in p)||!p.suspended)&&"fetchPopupFeaturesAtLocation"in p}};return p([h()],w.prototype,"popup",void 0),p([h()],w.prototype,"popupEnabled",void 0),w=p([l("esri.views.PopupView")],w),w};class y{constructor(p){this.layerView=p,this._resolver=a(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(p){const{layerView:e,graphics:t,_resolver:o}=this;if(!e)return o.resolve(t),o.promise;let i;return e.fetchPopupFeaturesFromGraphics(t,p).catch(p=>(i=p,null)).then(p=>{p?o.resolve(p):o.reject(i)}),o.promise}}const P=5e3;export{w as PopupView};
5
+ import{_ as p}from"../chunks/tslib.es6.js";import{createTask as e}from"../core/asyncUtils.js";import t from"../core/Error.js";import has from"../core/has.js";import o from"../core/Logger.js";import{throwIfAborted as i,wrapAbortWithTimeout as s,allSettledValues as r,createResolver as a}from"../core/promiseUtils.js";import{watch as u,syncAndInitial as n,whenOnce as c}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{ViewEventPriorities as d}from"./input/InputManager.js";function m(p){return null!=p&&"open"in p&&"declaredClass"in p}function f(p){return null!=p&&"declaredClass"in p&&"dockOptions"in p}const w=a=>{const w=a;let V=class extends w{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([u(()=>[this.ui,this.popup],([p,e],t)=>{const o="popup",i="manual";if(t){const[p,i]=t;p&&m(i)&&(i.view=null,f(i)&&(p.remove(i,o),i!==e&&e&&i.destroy()))}p&&m(e)&&(e.view=this,f(e)&&p.add(e,{key:o,position:i,internal:!0}))},n),this.on("click",p=>{this.popup&&this.popupEnabled&&("mouse"!==p.pointerType||0===p.button)&&(m(this.popup)?this.popup.viewModel.handleViewClick(p):p.defer(async()=>{await this.setupPopup(),m(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(p)}))},d.WIDGET)]),c(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{import("../widgets/Popup.js")})}destroy(){this.destroyed||this.closePopup()}async openPopup(p){if(m(this.popup))return this.popup.open(p);try{if(await this.setupPopup(),!this.popup)return void o.getLogger(this).error(new t("view:null-popup","Popup is null and can't be opened"));this.popup.open(p)}catch{}}closePopup(){this._popupSetupTask?.abort(),m(this.popup)&&this.popup.close()}async fetchPopupFeatures(p,e){return await this.when(),this._popupHitsToFeatures(await this._getPopupHits(p,e),e)}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!m(this.popup))return this._popupSetupTask=e(async p=>{const{default:e}=await import("../widgets/Popup.js");if(i(p),!this.popup||m(this.popup))return;const t=this.popup;delete t.open,delete t.close,this.popup=new e(t)}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:p,hits:e},t){const o=[],i=[];let a=!1;const u=s(t,has("popup-view-fetch-timeout")??P),n=p=>{const e=new y(p);return i.push(e),o.push(e.promise),e},c=p=>{const e=i.at(-1);return e&&e.layerView===p&&!a?e:n(p)};for(const s of e)if("graphic"in s){c(s.layerView).graphics.push(s.graphic),a=!1}else o.push(s.layerView.fetchPopupFeaturesAtLocation(s.mapPoint,u)),a=!0;i.map(p=>p.resolve(u));const h=r(o).then(p=>p.filter(p=>!!p).flat());return{pendingFeatures:o,allGraphicsPromise:h,location:p}}async _getPopupHits(p,e){const{hits:t,location:o}=await this.popupHitTest(p);i(e);const s=[];for(const i of t)if("graphic"in i){if(this._isValidPopupGraphic(i.graphic,e)){const p=this._isValidPopupGraphicsLayerView(i.layerView)?i.layerView:void 0;s.push({graphic:i.graphic,layerView:p})}}else this._isValidPopupLocationLayerView(i.layerView)&&s.push({mapPoint:i.mapPoint,layerView:i.layerView});return{hits:s,location:o}}_isValidPopupGraphic(p,e){return p&&!!p.getEffectivePopupTemplate(e?.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(p){return!p||(!("layer"in p)||!p.suspended)&&"fetchPopupFeaturesFromGraphics"in p}_isValidPopupLocationLayerView(p){return(!("layer"in p)||!p.suspended)&&"fetchPopupFeaturesAtLocation"in p}};return p([h()],V.prototype,"popup",void 0),p([h()],V.prototype,"popupEnabled",void 0),V=p([l("esri.views.PopupView")],V),V};class y{constructor(p){this.layerView=p,this._resolver=a(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(p){const{layerView:e,graphics:t,_resolver:o}=this;if(!e)return o.resolve(t),o.promise;let i;return e.fetchPopupFeaturesFromGraphics(t,p).catch(p=>(i=p,null)).then(p=>{p?o.resolve(p):o.reject(i)}),o.promise}}const P=5e3;export{w as PopupView};