@arcgis/core 4.22.0-next.20211021 → 4.22.0-next.20211025

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 (440) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/00ac1ce56f9885a8be83.js +1 -0
  3. package/assets/esri/core/workers/chunks/01c9afe41ab4ccc597c9.js +1 -0
  4. package/assets/esri/core/workers/chunks/02a3d14adc504a51fa24.js +1 -0
  5. package/assets/esri/core/workers/chunks/035a9ab0202d5386b782.js +1 -0
  6. package/assets/esri/core/workers/chunks/062bace5505f13689c7d.js +1 -0
  7. package/assets/esri/core/workers/chunks/06c7745d813bcb540ce8.js +1 -0
  8. package/assets/esri/core/workers/chunks/0950b488a60b2abc21fc.js +1 -0
  9. package/assets/esri/core/workers/chunks/0af396f2e0de681113ef.js +1 -0
  10. package/assets/esri/core/workers/chunks/131838059f0f81d8eaee.js +1 -0
  11. package/assets/esri/core/workers/chunks/146cba0d172ec2f4eba2.js +1 -0
  12. package/assets/esri/core/workers/chunks/17e49c0dfa5a5a6213e2.js +1 -0
  13. package/assets/esri/core/workers/chunks/1a0b08190274725dc956.js +1 -0
  14. package/assets/esri/core/workers/chunks/1add7f0779accdf8d204.js +1 -0
  15. package/assets/esri/core/workers/chunks/20b81d11e6286d347bfc.js +1 -0
  16. package/assets/esri/core/workers/chunks/{e596bd3de960d1dc1c57.js → 2207580a78ee292ed9b8.js} +1 -1
  17. package/assets/esri/core/workers/chunks/2d3646a83465c75986f9.js +1 -0
  18. package/assets/esri/core/workers/chunks/2d38ee3ef3ebe32a1194.js +1 -0
  19. package/assets/esri/core/workers/chunks/3737dcc3c0dea3ca05d5.js +1 -0
  20. package/assets/esri/core/workers/chunks/3e2042e70647c1afa6aa.js +1 -0
  21. package/assets/esri/core/workers/chunks/3ebfaab2855a2236a95d.js +1 -0
  22. package/assets/esri/core/workers/chunks/{d6fe616192a8efbfbc3e.js → 440f8101402a4c0d7019.js} +1 -1
  23. package/assets/esri/core/workers/chunks/4587d770767966985e22.js +1 -0
  24. package/assets/esri/core/workers/chunks/487b8892fae85810a8c0.js +1 -0
  25. package/assets/esri/core/workers/chunks/4901a78f32c3ea6b823b.js +1 -0
  26. package/assets/esri/core/workers/chunks/496fe47fc4d28e1a716d.js +1 -0
  27. package/assets/esri/core/workers/chunks/{9f22f47d4b2e72d7bdcf.js → 4c010119c24510ea31bb.js} +2 -2
  28. package/assets/esri/core/workers/chunks/{9f22f47d4b2e72d7bdcf.js.LICENSE.txt → 4c010119c24510ea31bb.js.LICENSE.txt} +0 -0
  29. package/assets/esri/core/workers/chunks/4f5076e1f2b18ce8156d.js +1 -0
  30. package/assets/esri/core/workers/chunks/{f291ebc4b089bd1f0a3f.js → 50e86a6bb13042b1dbac.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{64d9a062c1f1ac08a3ac.js → 565020b1c02a8cb33c2b.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{d78c60a22f76df7c48c7.js → 59640d78295e2e363f18.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{a0356f320a1b2fbd03f0.js → 5ac2b2598245aa17cdbd.js} +1 -1
  34. package/assets/esri/core/workers/chunks/5b4a8cce5601cc92c8a3.js +1 -0
  35. package/assets/esri/core/workers/chunks/5b92d5d4049622531109.js +1 -0
  36. package/assets/esri/core/workers/chunks/{751c1a2838b54a74a9a6.js → 5f3caa0ddb215342c728.js} +2 -2
  37. package/assets/esri/core/workers/chunks/615e995d5ce8fa044b09.js +1 -0
  38. package/assets/esri/core/workers/chunks/62a2453699e0dd2393b9.js +1 -0
  39. package/assets/esri/core/workers/chunks/67013547be1a7ae1670a.js +1 -0
  40. package/assets/esri/core/workers/chunks/67eddf4808f8888faeb4.js +1 -0
  41. package/assets/esri/core/workers/chunks/695dbedff2340aa019ba.js +1 -0
  42. package/assets/esri/core/workers/chunks/6a7e388c94206d2f61ff.js +1 -0
  43. package/assets/esri/core/workers/chunks/6e22b69d55e791ab3d9a.js +1 -0
  44. package/assets/esri/core/workers/chunks/71e6c0c5ef0aa7eb1703.js +1 -0
  45. package/assets/esri/core/workers/chunks/7a74e230439c5111f852.js +1 -0
  46. package/assets/esri/core/workers/chunks/7e76a8e6fa67e607d09e.js +1 -0
  47. package/assets/esri/core/workers/chunks/7fe4985ca0cb3e6d35c6.js +1 -0
  48. package/assets/esri/core/workers/chunks/8027330714ff5ffb020e.js +1 -0
  49. package/assets/esri/core/workers/chunks/844b564d1a422a17f6ac.js +1 -0
  50. package/assets/esri/core/workers/chunks/856f9281a08cb032238e.js +1 -0
  51. package/assets/esri/core/workers/chunks/89b4983de872780e9aa1.js +1 -0
  52. package/assets/esri/core/workers/chunks/8f3bc0cd2c2b01ab80cd.js +1 -0
  53. package/assets/esri/core/workers/chunks/8fd912e325ccd48b98a9.js +1 -0
  54. package/assets/esri/core/workers/chunks/901907a5c01f0fd1478f.js +1 -0
  55. package/assets/esri/core/workers/chunks/92a0b88a14c92239df8a.js +1 -0
  56. package/assets/esri/core/workers/chunks/972e9aeb3c29c9bf441a.js +1 -0
  57. package/assets/esri/core/workers/chunks/9758c34ce61c3714515a.js +1 -0
  58. package/assets/esri/core/workers/chunks/{457ea4feaa006d60c6b1.js → 9a04d087a29f0f3937a3.js} +1 -1
  59. package/assets/esri/core/workers/chunks/9b0bb171224b35ce2031.js +1 -0
  60. package/assets/esri/core/workers/chunks/9cbe7afdaef8720dfc8d.js +1 -0
  61. package/assets/esri/core/workers/chunks/9ccde5b6562f0007fe45.js +1 -0
  62. package/assets/esri/core/workers/chunks/9d320bbeedeea15522ab.js +1 -0
  63. package/assets/esri/core/workers/chunks/a001b3b4527817548094.js +1 -0
  64. package/assets/esri/core/workers/chunks/{197b72bca45065e0eb4a.js → a0c580d4a1915ddd3fe4.js} +1 -1
  65. package/assets/esri/core/workers/chunks/a4a9c15929b43d83701f.js +1 -0
  66. package/assets/esri/core/workers/chunks/a54d11f44721f808b82f.js +1 -0
  67. package/assets/esri/core/workers/chunks/a646a11673d513c00e7a.js +1 -0
  68. package/assets/esri/core/workers/chunks/a792e2bc7cafdc29f05e.js +1 -0
  69. package/assets/esri/core/workers/chunks/acae1771697034f265b1.js +1 -0
  70. package/assets/esri/core/workers/chunks/af2ee804a9c63eea610c.js +1 -0
  71. package/assets/esri/core/workers/chunks/b28b487047da3aeef3fd.js +1 -0
  72. package/assets/esri/core/workers/chunks/b3e57824a5855cb37a96.js +1 -0
  73. package/assets/esri/core/workers/chunks/b89449ead32e4cd21edd.js +1 -0
  74. package/assets/esri/core/workers/chunks/b99891ed5a02cab02173.js +1 -0
  75. package/assets/esri/core/workers/chunks/bac84bc621be73a7a4bc.js +1 -0
  76. package/assets/esri/core/workers/chunks/{25037dcf8a0c72b7b647.js → bbe068388167e9dd0c11.js} +1 -1
  77. package/assets/esri/core/workers/chunks/c271a1857bcc4e9a36dd.js +1 -0
  78. package/assets/esri/core/workers/chunks/{eb3035e49a45ecc82575.js → c5030664720fcdc6d85e.js} +1 -1
  79. package/assets/esri/core/workers/chunks/c534ed122f8a1202d3a3.js +1 -0
  80. package/assets/esri/core/workers/chunks/c5ef2e28b0c539ddb6a7.js +1 -0
  81. package/assets/esri/core/workers/chunks/c65e5ccfae03d148d82b.js +1 -0
  82. package/assets/esri/core/workers/chunks/c91660f3982be4e03705.js +1 -0
  83. package/assets/esri/core/workers/chunks/ce93113b99bdbeddd07b.js +1 -0
  84. package/assets/esri/core/workers/chunks/cf2d408e669cfa2c65be.js +1 -0
  85. package/assets/esri/core/workers/chunks/d08f63ffeecefa02ad91.js +1 -0
  86. package/assets/esri/core/workers/chunks/{8d33644192c01e5416b4.js → d1a71b58ef62e71979c5.js} +1 -1
  87. package/assets/esri/core/workers/chunks/d30eade5afecd334f6cb.js +1 -0
  88. package/assets/esri/core/workers/chunks/d8782d0856b9d815cb6c.js +1 -0
  89. package/assets/esri/core/workers/chunks/db16c21b650001502e6c.js +1 -0
  90. package/assets/esri/core/workers/chunks/db18110c57253a31ac96.js +1 -0
  91. package/assets/esri/core/workers/chunks/dbaa5fb466d6c0214f24.js +1 -0
  92. package/assets/esri/core/workers/chunks/deae370788a7aacf4dd5.js +1 -0
  93. package/assets/esri/core/workers/chunks/e6ca132e1eeea3aa174e.js +1 -0
  94. package/assets/esri/core/workers/chunks/e878ccc431729ef3360f.js +1 -0
  95. package/assets/esri/core/workers/chunks/eb124f15ad4b9193f00a.js +1 -0
  96. package/assets/esri/core/workers/chunks/ebc71c06c1c22aaef54e.js +1 -0
  97. package/assets/esri/core/workers/chunks/f183da283af0836421ab.js +1 -0
  98. package/assets/esri/core/workers/chunks/f42bdc2a134833d33b4e.js +1 -0
  99. package/assets/esri/core/workers/chunks/{736d628cda4e02d40337.js → f8612c2fc5739e98be58.js} +1 -1
  100. package/assets/esri/core/workers/chunks/f965e3e5f6f4f9ba54ac.js +1 -0
  101. package/assets/esri/core/workers/chunks/fa4089640f480b69962e.js +1 -0
  102. package/assets/esri/core/workers/chunks/fb219563e5169ea67d68.js +1 -0
  103. package/assets/esri/libs/i3s/i3s.wasm +0 -0
  104. package/chunks/ChapmanAtmosphere.glsl.js +56 -77
  105. package/chunks/Clouds.glsl.js +1 -1
  106. package/chunks/Pattern.glsl.js +9 -11
  107. package/chunks/RibbonLine.glsl.js +60 -68
  108. package/chunks/i3s.js +1 -1
  109. package/chunks/mat4.js +1 -1
  110. package/chunks/vec3.js +1 -1
  111. package/core/Collection.js +1 -1
  112. package/core/Loadable.js +1 -1
  113. package/core/accessorSupport/ensureType.js +1 -1
  114. package/core/promiseUtils.js +1 -1
  115. package/core/support/OwningCollection.js +1 -1
  116. package/core/workers/RemoteClient.js +1 -1
  117. package/core/workers/WorkerOwner.js +1 -1
  118. package/core/workers/workers.js +2 -2
  119. package/geometry/projection.js +1 -1
  120. package/identity/IdentityManagerBase.js +1 -1
  121. package/interfaces.d.ts +205 -497
  122. package/layers/ElevationLayer.js +1 -1
  123. package/layers/GeoJSONLayer.js +1 -1
  124. package/layers/ImageryTileLayer.js +1 -1
  125. package/layers/VectorTileLayer.js +1 -1
  126. package/layers/VoxelWasmPerScene.js +1 -1
  127. package/layers/WCSLayer.js +1 -1
  128. package/layers/analyses/AreaMeasurement3D.js +1 -1
  129. package/layers/analyses/DirectLineMeasurement3D.js +1 -1
  130. package/layers/analyses/Slice.js +1 -1
  131. package/layers/effects/EffectList.js +1 -1
  132. package/layers/effects/effects.js +1 -1
  133. package/layers/effects/jsonUtils.js +1 -1
  134. package/layers/effects/parser.js +1 -1
  135. package/layers/effects/utils.js +5 -0
  136. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  137. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  138. package/layers/graphics/data/QueryEngine.js +1 -1
  139. package/layers/graphics/data/QueryEngineResult.js +1 -1
  140. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  141. package/layers/mixins/ImageryTileMixin.js +1 -1
  142. package/layers/support/RasterWorker.js +1 -1
  143. package/layers/support/TilemapCache.js +1 -1
  144. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  145. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  146. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  147. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  148. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  149. package/package.json +2 -2
  150. package/portal/support/portalLayers.js +1 -1
  151. package/request.js +1 -1
  152. package/smartMapping/renderers/support/utils.js +1 -1
  153. package/smartMapping/statistics/support/WorkerClient.js +1 -1
  154. package/smartMapping/statistics/support/statsWorker.js +1 -1
  155. package/smartMapping/statistics/support/utils.js +1 -1
  156. package/smartMapping/support/adapters/CSVLayerAdapter.js +1 -1
  157. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  158. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  159. package/smartMapping/support/adapters/support/utils.js +1 -1
  160. package/statistics/utils.js +1 -1
  161. package/support/GraphicsCollection.js +1 -1
  162. package/support/revision.js +1 -1
  163. package/symbols/FillSymbol3DLayer.js +1 -1
  164. package/symbols/IconSymbol3DLayer.js +1 -1
  165. package/symbols/LineSymbol3DLayer.js +1 -1
  166. package/symbols/patterns/LinePattern3D.js +5 -0
  167. package/symbols/patterns/LineStylePattern3D.d.ts +4 -0
  168. package/symbols/patterns/LineStylePattern3D.js +5 -0
  169. package/symbols/patterns/StylePattern3D.js +1 -1
  170. package/symbols/patterns/lineStyles.js +5 -0
  171. package/symbols/patterns/utils.js +1 -1
  172. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  173. package/symbols/support/Symbol3DIconOutline.js +5 -0
  174. package/symbols/support/Symbol3DMaterial.js +1 -1
  175. package/symbols/support/Symbol3DOutline.js +1 -1
  176. package/symbols/support/defaults3D.js +1 -1
  177. package/symbols/support/previewSymbol3D.js +1 -1
  178. package/symbols/support/symbolLayerUtils3D.js +1 -1
  179. package/views/2d/engine/vectorTiles/TileParser.js +1 -1
  180. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  181. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  182. package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
  183. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  184. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  185. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  186. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  187. package/views/2d/layers/features/controllers/EditsQueue.js +1 -1
  188. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  189. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  190. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  191. package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
  192. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  193. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  194. package/views/3d/environment/CloudsGenerator.js +1 -1
  195. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  196. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  197. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  198. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  199. package/views/3d/externalRenderers.js +1 -1
  200. package/views/3d/interactive/Manipulator3D.js +1 -1
  201. package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
  202. package/views/3d/interactive/analysisTools/slice/images/Factory.js +5 -0
  203. package/views/3d/interactive/analysisTools/slice/sliceToolConfig.js +1 -1
  204. package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
  205. package/views/3d/interactive/editingTools/settings.js +1 -1
  206. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  207. package/views/3d/interactive/graphics/Slice/SliceController.js +1 -1
  208. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  209. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  210. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  211. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  212. package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
  213. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  214. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  215. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  216. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  217. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  218. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  219. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  220. package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
  221. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  222. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  223. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  224. package/views/3d/layers/I3SMeshView3D.js +1 -1
  225. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  226. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  227. package/views/3d/layers/analyses/AreaMeasurement3D/AreaMeasurementView3D.js +1 -1
  228. package/views/3d/layers/analyses/AreaMeasurement3D/support/AreaMeasurementPathHelper.js +1 -1
  229. package/views/3d/layers/analyses/AreaMeasurement3D/support/AreaMeasurementVisualization.js +1 -1
  230. package/views/3d/layers/analyses/DirectLineMeasurement3D/DirectLineMeasurementView3D.js +1 -1
  231. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  232. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  233. package/views/3d/layers/graphics/ElevationQuery.js +1 -1
  234. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  235. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  236. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  237. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  238. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  239. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  240. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  241. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  242. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  243. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  244. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  245. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  246. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  247. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  248. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  249. package/views/3d/layers/graphics/Labeler.js +1 -1
  250. package/views/3d/layers/graphics/Loadable.js +1 -1
  251. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  252. package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
  253. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  254. package/views/3d/layers/graphics/labelPlacement.js +1 -1
  255. package/views/3d/layers/graphics/pointUtils.js +1 -1
  256. package/views/3d/layers/i3s/I3SAttributeOverrides.js +1 -1
  257. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  258. package/views/3d/layers/i3s/I3SStreamDataController.js +1 -1
  259. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  260. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  261. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  262. package/views/3d/layers/support/patternUtils.js +1 -1
  263. package/views/3d/state/GoToOperation.js +1 -1
  264. package/views/3d/state/ViewStateManager.js +1 -1
  265. package/views/3d/support/LaserLineRenderer.js +1 -1
  266. package/views/3d/support/SharedSymbolResources.js +1 -1
  267. package/views/3d/support/StreamDataLoader.js +1 -1
  268. package/views/3d/support/StreamTextureCollection.js +5 -0
  269. package/views/3d/support/TextureCollection.js +1 -1
  270. package/views/3d/support/debugFlags.js +1 -1
  271. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  272. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  273. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  274. package/views/3d/terrain/OverlayManager.js +1 -1
  275. package/views/3d/terrain/OverlayRenderTarget.js +1 -1
  276. package/views/3d/terrain/OverlayRenderer.js +1 -1
  277. package/views/3d/terrain/Tile.js +1 -1
  278. package/views/3d/webgl-engine/Stage.js +1 -1
  279. package/views/3d/webgl-engine/core/material/RenderTexture.js +1 -1
  280. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +13 -12
  281. package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +1 -1
  282. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +10 -3
  283. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  284. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  285. package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
  286. package/views/3d/webgl-engine/lib/GLMaterialTexture.js +1 -1
  287. package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
  288. package/views/3d/webgl-engine/lib/Material.js +1 -1
  289. package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
  290. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  291. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  292. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  293. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  294. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  295. package/views/3d/webgl-engine/lib/TextTexture.js +1 -1
  296. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  297. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  298. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  299. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  300. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  301. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  302. package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
  303. package/views/3d/webgl-engine/lib/lodRendering/LodLevel.js +1 -1
  304. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  305. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  306. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  307. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  308. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  309. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  310. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  311. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  312. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  313. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  314. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  315. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  316. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  317. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  318. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  319. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  320. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  321. package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
  322. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  323. package/views/3d/webgl-engine/parts/Model.js +1 -1
  324. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  325. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  326. package/views/LayerViewManager.js +1 -1
  327. package/views/SceneView.js +1 -1
  328. package/views/ToolViewManager.js +1 -1
  329. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  330. package/views/support/AllocationTracer.js +1 -1
  331. package/views/support/DefaultsFromMap.js +1 -1
  332. package/views/support/QueueProcessor.js +1 -1
  333. package/views/webgl/capabilities/load.js +1 -1
  334. package/webscene/Slide.js +1 -1
  335. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  336. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  337. package/widgets/BuildingExplorer/support/layerUtils.js +1 -1
  338. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  339. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  340. package/widgets/Editor/UpdateWorkflow.js +1 -1
  341. package/widgets/Feature/FeatureViewModel.js +1 -1
  342. package/widgets/Home/HomeViewModel.js +1 -1
  343. package/widgets/Locate/LocateViewModel.js +1 -1
  344. package/widgets/Popup/PopupViewModel.js +1 -1
  345. package/widgets/Search/SearchViewModel.js +1 -1
  346. package/widgets/Search.js +1 -1
  347. package/widgets/Sketch/SketchViewModel.js +1 -1
  348. package/widgets/Slice/SliceViewModel.js +1 -1
  349. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  350. package/assets/esri/core/workers/chunks/0283801d442984997abe.js +0 -1
  351. package/assets/esri/core/workers/chunks/0419e14a520b8fcf3e7a.js +0 -1
  352. package/assets/esri/core/workers/chunks/05318446b6a40caea361.js +0 -1
  353. package/assets/esri/core/workers/chunks/09e714d4381649348ac9.js +0 -1
  354. package/assets/esri/core/workers/chunks/0cecd668b9d5d3f83293.js +0 -1
  355. package/assets/esri/core/workers/chunks/13a73a88efd4f464173e.js +0 -1
  356. package/assets/esri/core/workers/chunks/1576727e8174d672555b.js +0 -1
  357. package/assets/esri/core/workers/chunks/1a3cbeb0a53d03a51dad.js +0 -1
  358. package/assets/esri/core/workers/chunks/1b8524b617bfc6fe422c.js +0 -1
  359. package/assets/esri/core/workers/chunks/1dc1d750046912ff6cef.js +0 -1
  360. package/assets/esri/core/workers/chunks/21fa174c114640be5e40.js +0 -1
  361. package/assets/esri/core/workers/chunks/2a3f6e56079620421a02.js +0 -1
  362. package/assets/esri/core/workers/chunks/2a5bcc73e55986ad93fe.js +0 -1
  363. package/assets/esri/core/workers/chunks/2a6f2e3d639aae491171.js +0 -1
  364. package/assets/esri/core/workers/chunks/2c17d1bad17bcee53f7d.js +0 -1
  365. package/assets/esri/core/workers/chunks/2cea27a0d07aa9a88ad4.js +0 -1
  366. package/assets/esri/core/workers/chunks/2e193d97d199b29b00c2.js +0 -1
  367. package/assets/esri/core/workers/chunks/2eb41fdf0d0a3b0c3232.js +0 -1
  368. package/assets/esri/core/workers/chunks/2f09ea639ca5d1d6ca7e.js +0 -1
  369. package/assets/esri/core/workers/chunks/2fb847ab1440bd1bdf15.js +0 -1
  370. package/assets/esri/core/workers/chunks/402d22ebbae608760b4f.js +0 -1
  371. package/assets/esri/core/workers/chunks/44daef7f0cbc6f6af09f.js +0 -1
  372. package/assets/esri/core/workers/chunks/46899156159e398c693f.js +0 -1
  373. package/assets/esri/core/workers/chunks/46bf8921db25845c63c0.js +0 -1
  374. package/assets/esri/core/workers/chunks/4eb23554e375350f73b5.js +0 -1
  375. package/assets/esri/core/workers/chunks/551917be63a513dfa4de.js +0 -1
  376. package/assets/esri/core/workers/chunks/564f6f5484bcb13ebb2b.js +0 -1
  377. package/assets/esri/core/workers/chunks/61df67ae47b7fb5875d9.js +0 -1
  378. package/assets/esri/core/workers/chunks/62642a8fc7bafe339984.js +0 -1
  379. package/assets/esri/core/workers/chunks/6304f4e53027df04eb8f.js +0 -1
  380. package/assets/esri/core/workers/chunks/6331987617ad166ea098.js +0 -1
  381. package/assets/esri/core/workers/chunks/6b13fcbc71c0088d317e.js +0 -1
  382. package/assets/esri/core/workers/chunks/6f7a6841e7269d2764ad.js +0 -1
  383. package/assets/esri/core/workers/chunks/70110efd2de23d9a5263.js +0 -1
  384. package/assets/esri/core/workers/chunks/7eae3f0588cde44fce39.js +0 -1
  385. package/assets/esri/core/workers/chunks/80d3c7a429c6412f1a8d.js +0 -1
  386. package/assets/esri/core/workers/chunks/80deebdf54bea04a0889.js +0 -1
  387. package/assets/esri/core/workers/chunks/81aa5fe7dcb4fdeb0974.js +0 -1
  388. package/assets/esri/core/workers/chunks/840d08b41913cad4df89.js +0 -1
  389. package/assets/esri/core/workers/chunks/85d154aeb511c5d70bb1.js +0 -1
  390. package/assets/esri/core/workers/chunks/8681e99e2bc9ece61c43.js +0 -1
  391. package/assets/esri/core/workers/chunks/8e5ef967f6518f4c93b1.js +0 -1
  392. package/assets/esri/core/workers/chunks/8edd7f70c8b95c34125c.js +0 -1
  393. package/assets/esri/core/workers/chunks/9044a7b90a53312b6392.js +0 -1
  394. package/assets/esri/core/workers/chunks/905b4dfc1ce57a225fa4.js +0 -1
  395. package/assets/esri/core/workers/chunks/945f90b31ebfae623ea0.js +0 -1
  396. package/assets/esri/core/workers/chunks/9943fd69b67cd1871d68.js +0 -1
  397. package/assets/esri/core/workers/chunks/9ad91c23480ffb656030.js +0 -1
  398. package/assets/esri/core/workers/chunks/9d103681372ab01a4147.js +0 -1
  399. package/assets/esri/core/workers/chunks/9d3230f59b4c4d1b2713.js +0 -1
  400. package/assets/esri/core/workers/chunks/9db75bc0980d16b730a1.js +0 -1
  401. package/assets/esri/core/workers/chunks/a0659b8bdc067da7badd.js +0 -1
  402. package/assets/esri/core/workers/chunks/a480ee9a994410177961.js +0 -1
  403. package/assets/esri/core/workers/chunks/a9b279975d7df0f295d7.js +0 -1
  404. package/assets/esri/core/workers/chunks/aa3abaa5ad4a5a3bcb84.js +0 -1
  405. package/assets/esri/core/workers/chunks/aa8e607f908297786675.js +0 -1
  406. package/assets/esri/core/workers/chunks/ab5a302b5f62d38293f9.js +0 -1
  407. package/assets/esri/core/workers/chunks/abd6a84396e0eb3f01ad.js +0 -1
  408. package/assets/esri/core/workers/chunks/abe9f8516b03a3fb0477.js +0 -1
  409. package/assets/esri/core/workers/chunks/aff6aa5c7f75f8e052d9.js +0 -1
  410. package/assets/esri/core/workers/chunks/b601cc5304b132536239.js +0 -1
  411. package/assets/esri/core/workers/chunks/b85f614ddbddd3c3007e.js +0 -1
  412. package/assets/esri/core/workers/chunks/b944f4ab25a691b3e611.js +0 -1
  413. package/assets/esri/core/workers/chunks/bbdacddb61e651ca0098.js +0 -1
  414. package/assets/esri/core/workers/chunks/c2fa728e805637a1783e.js +0 -1
  415. package/assets/esri/core/workers/chunks/c901f5f85d962254fc2c.js +0 -1
  416. package/assets/esri/core/workers/chunks/ca173b908d89a4e334f6.js +0 -1
  417. package/assets/esri/core/workers/chunks/cc2ef3bfa1f614d7452c.js +0 -1
  418. package/assets/esri/core/workers/chunks/cdb32a9ac9f5804c4212.js +0 -1
  419. package/assets/esri/core/workers/chunks/ce9a4997973da80141a5.js +0 -1
  420. package/assets/esri/core/workers/chunks/d0674b50a358d3bb9db2.js +0 -1
  421. package/assets/esri/core/workers/chunks/d18b7b4b3b9bea7204b0.js +0 -1
  422. package/assets/esri/core/workers/chunks/d2ce983f7babdf18a0ed.js +0 -1
  423. package/assets/esri/core/workers/chunks/d38a0d867dc6cecdc551.js +0 -1
  424. package/assets/esri/core/workers/chunks/e39ca33e9e463c1d6060.js +0 -1
  425. package/assets/esri/core/workers/chunks/e471d103205018a5cf7f.js +0 -1
  426. package/assets/esri/core/workers/chunks/e542fb044fc96f7e8af2.js +0 -1
  427. package/assets/esri/core/workers/chunks/e94e00a28591337b2def.js +0 -1
  428. package/assets/esri/core/workers/chunks/eb2709ccbc001f42ac1b.js +0 -1
  429. package/assets/esri/core/workers/chunks/f905511ca5f9b59fc17f.js +0 -1
  430. package/assets/esri/core/workers/chunks/f910e80dd87727af5184.js +0 -1
  431. package/assets/esri/core/workers/chunks/f9300a24305b0af1d227.js +0 -1
  432. package/assets/esri/core/workers/chunks/fa1e1ac5b3ef7bdf8a78.js +0 -1
  433. package/assets/esri/core/workers/chunks/fce76a84c7d25d8d47e8.js +0 -1
  434. package/assets/esri/core/workers/chunks/fef4f97fbe861a1b60e8.js +0 -1
  435. package/layers/AreaMeasurementLayer.d.ts +0 -4
  436. package/layers/DirectLineMeasurementLayer.d.ts +0 -4
  437. package/symbols/support/symbolPreview.d.ts +0 -4
  438. package/symbols/support/symbolPreview.js +0 -5
  439. package/views/3d/layers/AreaMeasurementLayerView3D.d.ts +0 -4
  440. package/views/3d/layers/DirectLineMeasurementLayerView3D.d.ts +0 -4
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{outputFromPass as e}from"../lib/GLMaterials.js";import t from"../lib/GLMaterialTexture.js";import{Material as r,materialParametersDefaults as a}from"../lib/Material.js";import{OITPolygonOffsetLimit as s}from"../lib/OrderIndependentTransparency.js";import{DefaultBufferWriter as i,PositionUVLayout as n}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as u}from"./internal/MaterialUtil.js";import{ImageMaterialTechniqueConfiguration as l,ImageMaterialTechnique as c}from"../shaders/ImageMaterialTechnique.js";class h extends r{constructor(e){super(e,o),this.supportsEdges=!0,this.techniqueConfig=new l}getTechniqueConfig(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.cullFace=this.params.cullFace,this.techniqueConfig.slicePlaneEnabled=this.params.slicePlaneEnabled,this.techniqueConfig.transparent=this.params.transparent,this.techniqueConfig.writeDepth=this.params.writeDepth,this.techniqueConfig.sceneHasOcludees=this.params.sceneHasOcludees,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.enableOffset=t.camera.relativeElevation<s,this.techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=t.cullAboveGround,this.techniqueConfig}intersect(e,t,r,a,s,i,n){u(e,t,a,s,i,void 0,n)}requiresSlot(t,r){if(20===t)return!0;if(4===e(r))return 2===t;return t===(this.params.transparent?this.params.writeDepth?4:7:2)}createGLMaterial(e){return 0===e.output||7===e.output||4===e.output?new p(e):void 0}createBufferWriter(){return new i(n)}}class p extends t{constructor(e){super({...e,...e.material.params})}updateParameters(e){const t=this._material.params;return this.updateTexture(t.textureId),this.ensureTechnique(c,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.params.sceneHasOcludees&&(this._material.setParameterValues({sceneHasOcludees:e.hasOccludees}),this.updateParameters(e))}beginSlot(e){return 0!==this._output&&7!==this._output||this._updateOccludeeState(e),this.updateParameters(e)}bind(e,t){this.bindTextures(t.program),this.bindTextureScale(t.program),t.bindPass(this._material.params,e)}}const o={transparent:!1,writeDepth:!0,slicePlaneEnabled:!1,cullFace:0,sceneHasOcludees:!1,opacity:1,textureId:null,initTextureTransparent:!0,...a};export{h as ImageMaterial};
5
+ import{outputFromPass as e}from"../lib/GLMaterials.js";import t from"../lib/GLMaterialTexture.js";import{Material as r,materialParametersDefaults as a}from"../lib/Material.js";import{OITPolygonOffsetLimit as s}from"../lib/OrderIndependentTransparency.js";import{DefaultBufferWriter as i,PositionUVLayout as n}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as u}from"./internal/MaterialUtil.js";import{ImageMaterialTechniqueConfiguration as c,ImageMaterialTechnique as l}from"../shaders/ImageMaterialTechnique.js";class h extends r{constructor(e){super(e,o),this.supportsEdges=!0,this.techniqueConfig=new c}getTechniqueConfig(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.cullFace=this.parameters.cullFace,this.techniqueConfig.slicePlaneEnabled=this.parameters.slicePlaneEnabled,this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.writeDepth=this.parameters.writeDepth,this.techniqueConfig.sceneHasOcludees=this.parameters.sceneHasOcludees,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.enableOffset=t.camera.relativeElevation<s,this.techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=t.cullAboveGround,this.techniqueConfig}intersect(e,t,r,a,s,i,n){u(e,t,a,s,i,void 0,n)}requiresSlot(t,r){if(20===t)return!0;if(4===e(r))return 2===t;return t===(this.parameters.transparent?this.parameters.writeDepth?4:7:2)}createGLMaterial(e){return 0===e.output||7===e.output||4===e.output?new p(e):void 0}createBufferWriter(){return new i(n)}}class p extends t{constructor(e){super({...e,...e.material.parameters})}updateParameters(e){const t=this._material.parameters;return this.updateTexture(t.textureId),this.ensureTechnique(l,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.sceneHasOcludees&&(this._material.setParameters({sceneHasOcludees:e.hasOccludees}),this.updateParameters(e))}beginSlot(e){return 0!==this._output&&7!==this._output||this._updateOccludeeState(e),this.updateParameters(e)}bind(e,t){this.bindTextures(t.program),this.bindTextureScale(t.program),t.bindPass(this._material.parameters,e)}}const o={transparent:!1,writeDepth:!0,slicePlaneEnabled:!1,cullFace:0,sceneHasOcludees:!1,opacity:1,textureId:null,initTextureTransparent:!0,...a};export{h as ImageMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{f as e}from"../../../../chunks/vec2f32.js";import{newLayout as t}from"../../support/buffer/InterleavedLayout.js";import i from"../lib/GLMaterial.js";import{Material as r,materialParametersDefaults as s}from"../lib/Material.js";import{writePosition as n,writeNormal as a,writeBufferVec4 as u}from"./internal/bufferWriterUtils.js";import{LineCalloutTechniqueConfiguration as o,LineCalloutTechnique as l}from"../shaders/LineCalloutTechnique.js";class c extends r{constructor(e){super(e,h),this.techniqueConfig=new o,this._uniqueMaterialIdentifier=c.uniqueMaterialIdentifier(this.params)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}getPassParameters(){return this.params}getTechniqueConfig(e,t){const i=18!==(null==t?void 0:t.slot);return this.techniqueConfig.occlusionTestEnabled=this.params.occlusionTest,this.techniqueConfig.verticalOffset=!!this.params.verticalOffset,this.techniqueConfig.screenSizePerspective=!!this.params.screenSizePerspective,this.techniqueConfig.depthHudEnabled=i,this.techniqueConfig.depthHudAlignStartEnabled=!!this.params.depthHUDAlignStart,this.techniqueConfig.screenCenterOffsetUnitsEnabled="screen"===this.params.centerOffsetUnits?1:0,this.techniqueConfig.slicePlaneEnabled=this.params.slicePlaneEnabled,this.techniqueConfig.multipassGeometryEnabled=!!t&&t.multipassGeometryEnabled,this.techniqueConfig}intersect(){}requiresSlot(e){switch(e){case 18:case 19:return!0}return!1}createGLMaterial(e){return 0===e.output?new f(e):null}createBufferWriter(){return new m}validateParameterValues(e){const t=c.uniqueMaterialIdentifier(e);t!==this._uniqueMaterialIdentifier&&(this._uniqueMaterialIdentifier=t)}static uniqueMaterialIdentifier(e){return JSON.stringify({screenOffset:e.screenOffset||[0,0],centerOffsetUnits:e.centerOffsetUnits||"world"})}}class f extends i{updateParameters(e){return this.ensureTechnique(l,e)}beginSlot(e){return this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}const h={verticalOffset:null,screenSizePerspective:null,screenOffset:[0,0],color:[0,0,0,1],size:1,borderColor:null,occlusionTest:!1,shaderPolygonOffset:1e-5,depthHUDAlignStart:!1,centerOffsetUnits:"world",slicePlaneEnabled:!1,...s},d=t().vec3f("position").vec3f("normal").vec2f("uv0").vec4f("auxpos1"),p=[e(0,0),e(1,0),e(0,1),e(1,0),e(1,1),e(0,1)];class m{constructor(){this.vertexBufferLayout=d}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return 6*e.indices.get("position").length}write(e,t,i,r){n(t.indices.get("position"),t.vertexAttributes.get("position").data,e.transformation,i.position,r,6),a(t.indices.get("normal"),t.vertexAttributes.get("normal").data,e.invTranspTransformation,i.normal,r,6),u(t.indices.get("auxpos1"),t.vertexAttributes.get("auxpos1").data,i.auxpos1,r,6);for(let s=0;s<p.length;++s)i.uv0.setVec(r+s,p[s])}}export{c as LineCalloutMaterial};
5
+ import{f as e}from"../../../../chunks/vec2f32.js";import{newLayout as t}from"../../support/buffer/InterleavedLayout.js";import i from"../lib/GLMaterial.js";import{Material as r,materialParametersDefaults as s}from"../lib/Material.js";import{writePosition as n,writeNormal as a,writeBufferVec4 as u}from"./internal/bufferWriterUtils.js";import{LineCalloutTechniqueConfiguration as o,LineCalloutTechnique as l}from"../shaders/LineCalloutTechnique.js";class c extends r{constructor(e){super(e,h),this.techniqueConfig=new o,this._uniqueMaterialIdentifier=c.uniqueMaterialIdentifier(this.parameters)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}getPassParameters(){return this.parameters}getTechniqueConfig(e,t){const i=18!==(null==t?void 0:t.slot);return this.techniqueConfig.occlusionTestEnabled=this.parameters.occlusionTest,this.techniqueConfig.verticalOffset=!!this.parameters.verticalOffset,this.techniqueConfig.screenSizePerspective=!!this.parameters.screenSizePerspective,this.techniqueConfig.depthHudEnabled=i,this.techniqueConfig.depthHudAlignStartEnabled=!!this.parameters.depthHUDAlignStart,this.techniqueConfig.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits?1:0,this.techniqueConfig.slicePlaneEnabled=this.parameters.slicePlaneEnabled,this.techniqueConfig.multipassGeometryEnabled=!!t&&t.multipassGeometryEnabled,this.techniqueConfig}intersect(){}requiresSlot(e){switch(e){case 18:case 19:return!0}return!1}createGLMaterial(e){return 0===e.output?new f(e):null}createBufferWriter(){return new m}validateParameters(e){const t=c.uniqueMaterialIdentifier(e);t!==this._uniqueMaterialIdentifier&&(this._uniqueMaterialIdentifier=t)}static uniqueMaterialIdentifier(e){return JSON.stringify({screenOffset:e.screenOffset||[0,0],centerOffsetUnits:e.centerOffsetUnits||"world"})}}class f extends i{updateParameters(e){return this.ensureTechnique(l,e)}beginSlot(e){return this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}const h={verticalOffset:null,screenSizePerspective:null,screenOffset:[0,0],color:[0,0,0,1],size:1,borderColor:null,occlusionTest:!1,shaderPolygonOffset:1e-5,depthHUDAlignStart:!1,centerOffsetUnits:"world",slicePlaneEnabled:!1,...s},d=t().vec3f("position").vec3f("normal").vec2f("uv0").vec4f("auxpos1"),p=[e(0,0),e(1,0),e(0,1),e(1,0),e(1,1),e(0,1)];class m{constructor(){this.vertexBufferLayout=d}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return 6*e.indices.get("position").length}write(e,t,i,r){n(t.indices.get("position"),t.vertexAttributes.get("position").data,e.transformation,i.position,r,6),a(t.indices.get("normal"),t.vertexAttributes.get("normal").data,e.invTranspTransformation,i.normal,r,6),u(t.indices.get("auxpos1"),t.vertexAttributes.get("auxpos1").data,i.auxpos1,r,6);for(let s=0;s<p.length;++s)i.uv0.setVec(r+s,p[s])}}export{c as LineCalloutMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{s as e,n as t,f as s,c as r,i as n,m as o}from"../../../../chunks/vec3.js";import{c as i}from"../../../../chunks/vec3f64.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import u from"../lib/GLMaterial.js";import{Material as c,materialParametersDefaults as l}from"../lib/Material.js";import{MeasurementArrowTechniqueConfiguration as p,MeasurementArrowTechnique as f}from"../shaders/MeasurementArrowTechnique.js";class h extends c{constructor(e){super(e,d),this.techniqueConfig=new p}getTechniqueConfig(e,t){var s;return this.techniqueConfig.polygonOffsetEnabled=this.params.polygonOffset,this.techniqueConfig.transparent=this.params.stripeEvenColor[3]<1||this.params.stripeOddColor[3]<1||this.params.outlineColor[3]<1,this.techniqueConfig.transparencyPassType=null!=(s=null==t?void 0:t.transparencyPassType)?s:3,this.techniqueConfig}dispose(){}getPassParameters(){return this.params}intersect(){}requiresSlot(e){return 2===e}createGLMaterial(e){return 0===e.output?new m(e):null}createBufferWriter(){return new x}}class m extends u{updateParameters(e){return this.ensureTechnique(f,e)}beginSlot(e){return this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}const d={width:32,outlineSize:.2,outlineColor:[1,.5,0,1],stripeLength:1,stripeEvenColor:[1,1,1,1],stripeOddColor:[1,.5,0,1],polygonOffset:!1,...l},g=a().vec3f("position").vec3f("normal").vec2f("uv0").f32("auxpos1"),v=i(),C=i(),y=i(),b=i(),q=i();class x{constructor(){this.vertexBufferLayout=g}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return 2*(e.indices.get("position").length/2+1)}write(i,a,u,c){const l=a.vertexAttributes.get("position").data,p=a.vertexAttributes.get("normal").data,f=l.length/3,h=a&&a.indices&&a.indices.get("position");h&&h.length!==2*(f-1)&&console.warn("MeasurementArrowMaterial does not support indices");const m=v,d=C,g=y,x=b,P=q,w=i.transformation,T=i.invTranspTransformation,j=u.position,L=u.normal,M=u.uv0;let O=0;for(let v=0;v<f;++v){const i=3*v;if(e(m,l[i],l[i+1],l[i+2]),v<f-1){const n=3*(v+1);e(d,l[n],l[n+1],l[n+2]),e(P,p[n],p[n+1],p[n+2]),t(P,P),s(g,d,m),t(g,g),r(x,P,g),t(x,x)}const a=n(m,d);w&&T&&(o(m,m,w),o(d,d,w),o(x,x,T));const u=c+2*v,h=u+1;j.setVec(u,m),j.setVec(h,m),L.setVec(u,x),L.setVec(h,x),M.set(u,0,O),M.set(u,1,-1),M.set(h,0,O),M.set(h,1,1),v<f-1&&(O+=a)}const A=u.auxpos1;for(let e=0;e<2*f;++e)A.set(c+e,O)}}export{h as MeasurementArrowMaterial};
5
+ import{s as e,n as t,f as r,c as s,i as n,m as o}from"../../../../chunks/vec3.js";import{c as i}from"../../../../chunks/vec3f64.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import u from"../lib/GLMaterial.js";import{Material as c,materialParametersDefaults as l}from"../lib/Material.js";import{MeasurementArrowTechniqueConfiguration as p,MeasurementArrowTechnique as f}from"../shaders/MeasurementArrowTechnique.js";class h extends c{constructor(e){super(e,d),this.techniqueConfig=new p}getTechniqueConfig(e,t){var r;return this.techniqueConfig.polygonOffsetEnabled=this.parameters.polygonOffset,this.techniqueConfig.transparent=this.parameters.stripeEvenColor[3]<1||this.parameters.stripeOddColor[3]<1||this.parameters.outlineColor[3]<1,this.techniqueConfig.transparencyPassType=null!=(r=null==t?void 0:t.transparencyPassType)?r:3,this.techniqueConfig}dispose(){}getPassParameters(){return this.parameters}intersect(){}requiresSlot(e){return 2===e}createGLMaterial(e){return 0===e.output?new m(e):null}createBufferWriter(){return new x}}class m extends u{updateParameters(e){return this.ensureTechnique(f,e)}beginSlot(e){return this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}const d={width:32,outlineSize:.2,outlineColor:[1,.5,0,1],stripeLength:1,stripeEvenColor:[1,1,1,1],stripeOddColor:[1,.5,0,1],polygonOffset:!1,...l},g=a().vec3f("position").vec3f("normal").vec2f("uv0").f32("auxpos1"),v=i(),C=i(),y=i(),b=i(),q=i();class x{constructor(){this.vertexBufferLayout=g}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return 2*(e.indices.get("position").length/2+1)}write(i,a,u,c){const l=a.vertexAttributes.get("position").data,p=a.vertexAttributes.get("normal").data,f=l.length/3,h=a&&a.indices&&a.indices.get("position");h&&h.length!==2*(f-1)&&console.warn("MeasurementArrowMaterial does not support indices");const m=v,d=C,g=y,x=b,P=q,w=i.transformation,T=i.invTranspTransformation,j=u.position,L=u.normal,M=u.uv0;let O=0;for(let v=0;v<f;++v){const i=3*v;if(e(m,l[i],l[i+1],l[i+2]),v<f-1){const n=3*(v+1);e(d,l[n],l[n+1],l[n+2]),e(P,p[n],p[n+1],p[n+2]),t(P,P),r(g,d,m),t(g,g),s(x,P,g),t(x,x)}const a=n(m,d);w&&T&&(o(m,m,w),o(d,d,w),o(x,x,T));const u=c+2*v,h=u+1;j.setVec(u,m),j.setVec(h,m),L.setVec(u,x),L.setVec(h,x),M.set(u,0,O),M.set(u,1,-1),M.set(h,0,O),M.set(h,1,1),v<f-1&&(O+=a)}const A=u.auxpos1;for(let e=0;e<2*f;++e)A.set(c+e,O)}}export{h as MeasurementArrowMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Logger.js";import{isSome as t,isNone as r}from"../../../../core/maybe.js";import{createRenderScreenPointArray3 as s}from"../../../../core/screenUtils.js";import{c as i}from"../../../../chunks/vec2.js";import{s as n,f as o,d as a,a as c,b as l,g as u,l as p,i as f}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{create as h,distance2 as d,fromPoints as g,closestLineSegmentPoint as b}from"../../../../geometry/support/lineSegment.js";import{create as j,fromPoints as C,signedDistance as v,normal as y}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as x}from"../../../../geometry/support/buffer/BufferView.js";import{computeAttachmentOriginLines as P}from"../lib/geometryDataUtils.js";import q from"../lib/GLMaterial.js";import{Material as L,materialParametersDefaults as O}from"../lib/Material.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{writeDefaultAttributes as S}from"./internal/bufferWriterUtils.js";import{PositionColorLayout as A,PositionLayout as B,DefaultBufferWriter as E}from"./internal/DefaultBufferWriter.js";import{intersectDrapedRenderLineGeometry as T}from"./internal/MaterialUtil.js";import{isInstanceHidden as M}from"./renderers/utils.js";import{NativeLineTechniqueConfiguration as R,NativeLineTechnique as _}from"../shaders/NativeLineTechnique.js";const U=e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial");class H extends L{constructor(e){super(e,V),this.techniqueConfig=new R}getTechniqueConfig(e){this.techniqueConfig.output=e,this.techniqueConfig.slicePlaneEnabled=this.params.slicePlaneEnabled,this.techniqueConfig.vertexColors=this.params.vertexColors,this.techniqueConfig.transparent=this.params.color[3]<1||this.params.width<1,this.techniqueConfig.draped=!1;const r=t(this.params.stipplePattern);return this.techniqueConfig.stippleEnabled=r,this.techniqueConfig.stippleOffColorEnabled=r&&t(this.params.stippleOffColor),this.techniqueConfig.stippleIntegerRepeatsEnabled=r&&this.params.stippleIntegerRepeats,this.techniqueConfig.sceneHasOcludees=this.params.sceneHasOcludees,this.techniqueConfig}getPassParameters(){return this.params}intersect(e,t,r,s,i,n,o,a,c){c?T(e,s,n,1,o):this.intersectLineGeometry(e,t,r,s,o)}intersectLineGeometry(e,t,r,s,m){if(!s.options.selectionMode||M(t))return;if(!w(r))return void U.error("intersection assumes a translation-only matrix");const h=e.vertexAttributes.get("position").data,j=s.camera,x=Y;i(x,s.point);const P=2;n(Z[0],x[0]-P,x[1]+P,0),n(Z[1],x[0]+P,x[1]+P,0),n(Z[2],x[0]+P,x[1]-P,0),n(Z[3],x[0]-P,x[1]-P,0);for(let i=0;i<4;i++)if(!j.unprojectFromRenderScreen(Z[i],$[i]))return;C(j.eye,$[0],$[1],ee),C(j.eye,$[1],$[2],te),C(j.eye,$[2],$[3],re),C(j.eye,$[3],$[0],se);let q=Number.MAX_VALUE;for(let i=0;i<h.length-5;i+=3){if(k[0]=h[i]+r[12],k[1]=h[i+1]+r[13],k[2]=h[i+2]+r[14],I[0]=h[i+3]+r[12],I[1]=h[i+4]+r[13],I[2]=h[i+5]+r[14],v(ee,k)<0&&v(ee,I)<0||v(te,k)<0&&v(te,I)<0||v(re,k)<0&&v(re,I)<0||v(se,k)<0&&v(se,I)<0)continue;if(j.projectToRenderScreen(k,F),j.projectToRenderScreen(I,X),F[2]<0&&X[2]>0){o(W,k,I);const e=j.frustum,t=-v(e[4],k)/a(W,y(e[4]));c(W,W,t),l(k,k,W),j.projectToRenderScreen(k,F)}else if(F[2]>0&&X[2]<0){o(W,I,k);const e=j.frustum,t=-v(e[4],I)/a(W,y(e[4]));c(W,W,t),l(I,I,W),j.projectToRenderScreen(I,X)}else if(F[2]<0&&X[2]<0)continue;F[2]=0,X[2]=0;const e=d(g(F,X,K),x);e<q&&(q=e,u(z,k),u(J,I))}const L=s.rayBeginPoint,O=s.rayEndPoint;if(q<P*P){let e=Number.MAX_VALUE;if(b(g(z,J,K),g(L,O,Q),D)){o(D,D,L);const t=p(D);c(D,D,1/t),e=t/f(L,O)}m(e,D)}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const s=r.get("position");return P(s,null,!1,t)}requiresSlot(e){return 2===e||20===e}createGLMaterial(e){return 0===e.output||4===e.output?new G(e):null}createBufferWriter(){const e=this.params.vertexColors?A:B;return r(this.params.stipplePattern)?new E(e):new N(e.clone().vec3f("auxpos1"))}}class G extends q{updateParameters(e){return this.ensureTechnique(_,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.params.sceneHasOcludees&&this._material.setParameterValues({sceneHasOcludees:e.hasOccludees})}beginSlot(e){return 0===this._output&&this._updateOccludeeState(e),this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}class N{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get("position").length}write(e,t,r,s){S(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,s),this.writeAuxpos1(e,t,r,s)}writeAuxpos1(e,t,r,s){const i=r.getField("auxpos1",x),n=t.indices.get("position"),o=t.vertexAttributes.get("position").data,a=e.transformation,c=i.typedBufferStride,l=i.typedBuffer;s*=c;for(let u=0;u<n.length;u+=2){const e=3*n[u],t=o[e],r=o[e+1],i=o[e+2],p=a[0]*t+a[4]*r+a[8]*i+a[12],f=a[1]*t+a[5]*r+a[9]*i+a[13],m=a[2]*t+a[6]*r+a[10]*i+a[14];for(let n=0;n<2;++n)l[s]=p,l[s+1]=f,l[s+2]=m,s+=c}}}const V={color:[1,1,1,1],vertexColors:!1,slicePlaneEnabled:!1,width:1,stipplePattern:null,stippleIntegerRepeats:!1,stippleOffColor:null,sceneHasOcludees:!1,...O},k=m(),I=m(),W=m(),D=m(),F=s(),X=s(),z=m(),J=m(),K=h(),Q=h(),Y=m(),Z=[s(),s(),s(),s()],$=[m(),m(),m(),m()],ee=j(),te=j(),re=j(),se=j();export{H as NativeLineMaterial};
5
+ import e from"../../../../core/Logger.js";import{isSome as t,isNone as r}from"../../../../core/maybe.js";import{createRenderScreenPointArray3 as s}from"../../../../core/screenUtils.js";import{c as i}from"../../../../chunks/vec2.js";import{s as n,f as o,d as a,a as c,b as l,g as u,l as p,i as f}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{create as h,distance2 as d,fromPoints as g,closestLineSegmentPoint as b}from"../../../../geometry/support/lineSegment.js";import{create as j,fromPoints as C,signedDistance as v,normal as y}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as _}from"../../../../geometry/support/buffer/BufferView.js";import{computeAttachmentOriginLines as x}from"../lib/geometryDataUtils.js";import P from"../lib/GLMaterial.js";import{Material as q,materialParametersDefaults as L}from"../lib/Material.js";import{isTranslationMatrix as O}from"../lib/Util.js";import{writeDefaultAttributes as w}from"./internal/bufferWriterUtils.js";import{PositionColorLayout as S,PositionLayout as A,DefaultBufferWriter as B}from"./internal/DefaultBufferWriter.js";import{intersectDrapedRenderLineGeometry as E}from"./internal/MaterialUtil.js";import{isInstanceHidden as T}from"./renderers/utils.js";import{NativeLineTechniqueConfiguration as M,NativeLineTechnique as R}from"../shaders/NativeLineTechnique.js";const U=e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial");class H extends q{constructor(e){super(e,k),this._techniqueConfig=new M}getTechniqueConfig(e){this._techniqueConfig.output=e,this._techniqueConfig.slicePlaneEnabled=this.parameters.slicePlaneEnabled,this._techniqueConfig.vertexColors=this.parameters.vertexColors,this._techniqueConfig.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._techniqueConfig.draped=!1;const r=t(this.parameters.stipplePattern);return this._techniqueConfig.stippleEnabled=r,this._techniqueConfig.stippleOffColorEnabled=r&&t(this.parameters.stippleOffColor),this._techniqueConfig.stippleIntegerRepeatsEnabled=r&&this.parameters.stippleIntegerRepeats,this._techniqueConfig.sceneHasOcludees=this.parameters.sceneHasOcludees,this._techniqueConfig}getPassParameters(){return this.parameters}intersect(e,t,r,s,i,n,o,a,c){c?E(e,s,n,1,o):this.intersectLineGeometry(e,t,r,s,o)}intersectLineGeometry(e,t,r,s,m){if(!s.options.selectionMode||T(t))return;if(!O(r))return void U.error("intersection assumes a translation-only matrix");const h=e.vertexAttributes.get("position").data,j=s.camera,_=Y;i(_,s.point);const x=2;n(Z[0],_[0]-x,_[1]+x,0),n(Z[1],_[0]+x,_[1]+x,0),n(Z[2],_[0]+x,_[1]-x,0),n(Z[3],_[0]-x,_[1]-x,0);for(let i=0;i<4;i++)if(!j.unprojectFromRenderScreen(Z[i],$[i]))return;C(j.eye,$[0],$[1],ee),C(j.eye,$[1],$[2],te),C(j.eye,$[2],$[3],re),C(j.eye,$[3],$[0],se);let P=Number.MAX_VALUE;for(let i=0;i<h.length-5;i+=3){if(I[0]=h[i]+r[12],I[1]=h[i+1]+r[13],I[2]=h[i+2]+r[14],V[0]=h[i+3]+r[12],V[1]=h[i+4]+r[13],V[2]=h[i+5]+r[14],v(ee,I)<0&&v(ee,V)<0||v(te,I)<0&&v(te,V)<0||v(re,I)<0&&v(re,V)<0||v(se,I)<0&&v(se,V)<0)continue;if(j.projectToRenderScreen(I,F),j.projectToRenderScreen(V,X),F[2]<0&&X[2]>0){o(W,I,V);const e=j.frustum,t=-v(e[4],I)/a(W,y(e[4]));c(W,W,t),l(I,I,W),j.projectToRenderScreen(I,F)}else if(F[2]>0&&X[2]<0){o(W,V,I);const e=j.frustum,t=-v(e[4],V)/a(W,y(e[4]));c(W,W,t),l(V,V,W),j.projectToRenderScreen(V,X)}else if(F[2]<0&&X[2]<0)continue;F[2]=0,X[2]=0;const e=d(g(F,X,K),_);e<P&&(P=e,u(z,I),u(J,V))}const q=s.rayBeginPoint,L=s.rayEndPoint;if(P<x*x){let e=Number.MAX_VALUE;if(b(g(z,J,K),g(q,L,Q),D)){o(D,D,q);const t=p(D);c(D,D,1/t),e=t/f(q,L)}m(e,D)}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const s=r.get("position");return x(s,null,!1,t)}requiresSlot(e){return 2===e||20===e}createGLMaterial(e){return 0===e.output||4===e.output?new G(e):null}createBufferWriter(){const e=this.parameters.vertexColors?S:A;return r(this.parameters.stipplePattern)?new B(e):new N(e.clone().vec3f("auxpos1"))}}class G extends P{updateParameters(e){return this.ensureTechnique(R,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.sceneHasOcludees&&this._material.setParameters({sceneHasOcludees:e.hasOccludees})}beginSlot(e){return 0===this._output&&this._updateOccludeeState(e),this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}class N{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get("position").length}write(e,t,r,s){w(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,s),this.writeAuxpos1(e,t,r,s)}writeAuxpos1(e,t,r,s){const i=r.getField("auxpos1",_),n=t.indices.get("position"),o=t.vertexAttributes.get("position").data,a=e.transformation,c=i.typedBufferStride,l=i.typedBuffer;s*=c;for(let u=0;u<n.length;u+=2){const e=3*n[u],t=o[e],r=o[e+1],i=o[e+2],p=a[0]*t+a[4]*r+a[8]*i+a[12],f=a[1]*t+a[5]*r+a[9]*i+a[13],m=a[2]*t+a[6]*r+a[10]*i+a[14];for(let n=0;n<2;++n)l[s]=p,l[s+1]=f,l[s+2]=m,s+=c}}}const k={color:[1,1,1,1],vertexColors:!1,slicePlaneEnabled:!1,width:1,stipplePattern:null,stippleIntegerRepeats:!1,stippleOffColor:null,sceneHasOcludees:!1,...L},I=m(),V=m(),W=m(),D=m(),F=s(),X=s(),z=m(),J=m(),K=h(),Q=h(),Y=m(),Z=[s(),s(),s(),s()],$=[m(),m(),m(),m()],ee=j(),te=j(),re=j(),se=j();export{H as NativeLineMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as e}from"../../../../core/mathUtils.js";import{isNone as t}from"../../../../core/maybe.js";import{fromValues as i}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec4f as s}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{computeAttachmentOriginLines as r}from"../lib/geometryDataUtils.js";import n from"../lib/GLMaterial.js";import{materialParametersDefaults as o,Material as u}from"../lib/Material.js";import{isPathGeometry as l}from"../lib/PathGeometry.js";import{assert as h}from"../lib/Util.js";import{pathVertexAttributeLocations as c,PathTechniqueConfiguration as p,PathTechnique as d}from"./PathTechnique.js";import f from"./VisualVariableMaterialParameters.js";import{writeDefaultAttributes as m,writeBufferVec4 as b}from"./internal/bufferWriterUtils.js";import{intersectAabbInvDir as v}from"./internal/MaterialUtil.js";const g=h;class S extends u{constructor(e){super(e,q),this.supportsEdges=!0,this._vertexAttributeLocations=c,this.techniqueConfig=new p,this.vertexBufferLayout=S.getVertexBufferLayout(this.params)}getTechniqueConfig(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.vvSize=this.params.vvSizeEnabled,this.techniqueConfig.vvColor=this.params.vvColorEnabled,this.techniqueConfig.vvOpacity=this.params.vvOpacityEnabled,this.techniqueConfig.slicePlaneEnabled=this.params.slicePlaneEnabled,this.techniqueConfig.transparent=this.params.transparent,this.techniqueConfig.sceneHasOcludees=this.params.sceneHasOcludees,0!==e&&7!==e||(this.techniqueConfig.doubleSidedMode=this.params.doubleSided&&"normal"===this.params.doubleSidedType?1:this.params.doubleSided&&"winding-order"===this.params.doubleSidedType?2:0,this.techniqueConfig.receiveShadows=this.params.receiveShadows,this.techniqueConfig.receiveSSAO=!!t.ssaoEnabled&&this.params.receiveSSAO),this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=t.cullAboveGround,this.techniqueConfig}getPassParameters(){return this.params}isVisibleInPass(e){return 4!==e&&6!==e&&7!==e||this.params.castShadows}isVisible(){const e=this.params;return!!super.isVisible()&&e.opacity>0}intersect(s,a,r,n,o,u,h){const c=s;if(!l(c))return;const p=c.path,d=[this.params.size[0],this.params.size[1]];if(this.params.vvSizeEnabled){const t=this.params.vvSizeOffset,i=this.params.vvSizeFactor,s=this.params.vvSizeMinSize,a=this.params.vvSizeMaxSize,r=p.sizeAttributeValue;d[0]*=e(t[0]+r*i[0],s[0],a[0]),d[1]*=e(t[2]+r*i[2],s[2],a[2])}const f=Math.max(d[0],d[1]),m=s.boundingInfo;if(t(m))return void this._intersectTriangles(p,d,o,u,h);const b=i(m.bbMin[0]-f,m.bbMin[1]-f,m.bbMin[2]-f,m.bbMax[0]+f,m.bbMax[1]+f,m.bbMax[2]+f),g=[u[0]-o[0],u[1]-o[1],u[2]-o[2]],S=Math.sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2]),y=[S/g[0],S/g[1],S/g[2]];v(b,o,y,n.tolerance)&&this._intersectTriangles(p,d,o,u,h)}_intersectTriangles(e,t,i,s,a){e.baked.size&&e.baked.size[0]===t[0]&&e.baked.size[1]===t[1]||e.baked.bake(t),e.baked.intersect(i,s,a)}computeAttachmentOrigin(e,t){const i=e.vertexAttributes;if(!i)return null;const s=i.get("position");return r(s,null,!1,t)}createBufferWriter(){return new x(this.vertexBufferLayout)}requiresSlot(e){return e===(this.params.transparent?4:2)||20===e}createGLMaterial(e){return 0===e.output||7===e.output||1===e.output||2===e.output||4===e.output||3===e.output&&this.params.castShadows?new y(e):null}static getVertexBufferLayout(e){let t=a().vec3f("position").vec4f("profileRight").vec4f("profileUp").vec4f("profileVertexAndNormal");return(e.vvColorEnabled||e.vvSizeEnabled||e.vvOpacityEnabled)&&(t=t.vec4f("featureValue")),t}}class y extends n{updateParameters(e){return this.ensureTechnique(d,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.params.sceneHasOcludees&&this._material.setParameterValues({sceneHasOcludees:e.hasOccludees})}_updateShadowState(e){(t(this.technique)||e.shadowMappingEnabled!==this.technique.configuration.receiveShadows)&&this._material.setParameterValues({receiveShadows:e.shadowMappingEnabled})}beginSlot(e){return 0!==this._output&&7!==this._output||(this._updateShadowState(e),this._updateOccludeeState(e)),this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}const q={size:[1,1,1],ambient:[.2,.2,.2],diffuse:[.8,.8,.8],specular:[0,0,0],opacity:1,doubleSided:!1,doubleSidedType:"normal",receiveSSAO:!0,receiveShadows:!1,castShadows:!0,slicePlaneEnabled:!1,transparent:!1,sceneHasOcludees:!1,...f.Default,...o};class x{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get("position").length}write(e,t,i,a){const r=e=>{if(t.vertexAttributes.has(e)){const r=t.vertexAttributes.get(e),n=t.indices.get(e);g(4===r.size);const o=i.getField(e,s);if(!o)throw new Error("unable to acquire view for "+e);b(n,r.data,o,a)}};r("profileRight"),r("profileUp"),r("profileVertexAndNormal"),this.vertexBufferLayout.hasField("featureValue")&&r("featureValue"),m(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,i,a)}}export{S as PathMaterial};
5
+ import{clamp as e}from"../../../../core/mathUtils.js";import{isNone as t}from"../../../../core/maybe.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec4f as i}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{computeAttachmentOriginLines as a}from"../lib/geometryDataUtils.js";import n from"../lib/GLMaterial.js";import{materialParametersDefaults as o,Material as u}from"../lib/Material.js";import{isPathGeometry as l}from"../lib/PathGeometry.js";import{assert as h}from"../lib/Util.js";import{pathVertexAttributeLocations as c,PathTechniqueConfiguration as p,PathTechnique as d}from"./PathTechnique.js";import f from"./VisualVariableMaterialParameters.js";import{writeDefaultAttributes as m,writeBufferVec4 as b}from"./internal/bufferWriterUtils.js";import{intersectAabbInvDir as v}from"./internal/MaterialUtil.js";const g=h;class S extends u{constructor(e){super(e,q),this.supportsEdges=!0,this._vertexAttributeLocations=c,this.techniqueConfig=new p,this.vertexBufferLayout=S.getVertexBufferLayout(this.parameters)}getTechniqueConfig(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.vvSize=this.parameters.vvSizeEnabled,this.techniqueConfig.vvColor=this.parameters.vvColorEnabled,this.techniqueConfig.vvOpacity=this.parameters.vvOpacityEnabled,this.techniqueConfig.slicePlaneEnabled=this.parameters.slicePlaneEnabled,this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.sceneHasOcludees=this.parameters.sceneHasOcludees,0!==e&&7!==e||(this.techniqueConfig.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?1:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?2:0,this.techniqueConfig.receiveShadows=this.parameters.receiveShadows,this.techniqueConfig.receiveSSAO=!!t.ssaoEnabled&&this.parameters.receiveSSAO),this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=t.cullAboveGround,this.techniqueConfig}getPassParameters(){return this.parameters}isVisibleInPass(e){return 4!==e&&6!==e&&7!==e||this.parameters.castShadows}isVisible(){const e=this.parameters;return!!super.isVisible()&&e.opacity>0}intersect(i,s,a,n,o,u,h){const c=i;if(!l(c))return;const p=c.path,d=[this.parameters.size[0],this.parameters.size[1]];if(this.parameters.vvSizeEnabled){const t=this.parameters.vvSizeOffset,r=this.parameters.vvSizeFactor,i=this.parameters.vvSizeMinSize,s=this.parameters.vvSizeMaxSize,a=p.sizeAttributeValue;d[0]*=e(t[0]+a*r[0],i[0],s[0]),d[1]*=e(t[2]+a*r[2],i[2],s[2])}const f=Math.max(d[0],d[1]),m=i.boundingInfo;if(t(m))return void this._intersectTriangles(p,d,o,u,h);const b=r(m.bbMin[0]-f,m.bbMin[1]-f,m.bbMin[2]-f,m.bbMax[0]+f,m.bbMax[1]+f,m.bbMax[2]+f),g=[u[0]-o[0],u[1]-o[1],u[2]-o[2]],S=Math.sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2]),y=[S/g[0],S/g[1],S/g[2]];v(b,o,y,n.tolerance)&&this._intersectTriangles(p,d,o,u,h)}_intersectTriangles(e,t,r,i,s){e.baked.size&&e.baked.size[0]===t[0]&&e.baked.size[1]===t[1]||e.baked.bake(t),e.baked.intersect(r,i,s)}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return null;const i=r.get("position");return a(i,null,!1,t)}createBufferWriter(){return new x(this.vertexBufferLayout)}requiresSlot(e){return e===(this.parameters.transparent?4:2)||20===e}createGLMaterial(e){return 0===e.output||7===e.output||1===e.output||2===e.output||4===e.output||3===e.output&&this.parameters.castShadows?new y(e):null}static getVertexBufferLayout(e){let t=s().vec3f("position").vec4f("profileRight").vec4f("profileUp").vec4f("profileVertexAndNormal");return(e.vvColorEnabled||e.vvSizeEnabled||e.vvOpacityEnabled)&&(t=t.vec4f("featureValue")),t}}class y extends n{updateParameters(e){return this.ensureTechnique(d,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.sceneHasOcludees&&this._material.setParameters({sceneHasOcludees:e.hasOccludees})}_updateShadowState(e){(t(this.technique)||e.shadowMappingEnabled!==this.technique.configuration.receiveShadows)&&this._material.setParameters({receiveShadows:e.shadowMappingEnabled})}beginSlot(e){return 0!==this._output&&7!==this._output||(this._updateShadowState(e),this._updateOccludeeState(e)),this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}const q={size:[1,1,1],ambient:[.2,.2,.2],diffuse:[.8,.8,.8],specular:[0,0,0],opacity:1,doubleSided:!1,doubleSidedType:"normal",receiveSSAO:!0,receiveShadows:!1,castShadows:!0,slicePlaneEnabled:!1,transparent:!1,sceneHasOcludees:!1,...f.Default,...o};class x{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get("position").length}write(e,t,r,s){const a=e=>{if(t.vertexAttributes.has(e)){const a=t.vertexAttributes.get(e),n=t.indices.get(e);g(4===a.size);const o=r.getField(e,i);if(!o)throw new Error("unable to acquire view for "+e);b(n,a.data,o,s)}};a("profileRight"),a("profileUp"),a("profileVertexAndNormal"),this.vertexBufferLayout.hasField("featureValue")&&a("featureValue"),m(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,s)}}export{S as PathMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{BufferViewMat3f as e,BufferViewVec4f as t,BufferViewVec4u8 as i,BufferViewVec3f as r}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import a from"../lib/GLMaterial.js";import{outputFromPass as n}from"../lib/GLMaterials.js";import{Material as o,materialParametersDefaults as u}from"../lib/Material.js";import{OITPolygonOffsetLimit as c}from"../lib/OrderIndependentTransparency.js";import{assert as l}from"../lib/Util.js";import{writeBufferVec4 as p,writeColor as h,writePosition as f}from"./internal/bufferWriterUtils.js";import{DefaultBufferWriter as d}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as m}from"./internal/MaterialUtil.js";import{patternVertexAttributeLocations as g,PatternTechniqueConfiguration as b,PatternTechnique as q}from"../shaders/PatternTechnique.js";class C extends o{constructor(e){super(e,w),this.supportsEdges=!0,this._vertexAttributeLocations=g,this.techniqueConfig=new b}getTechniqueConfig(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.cullFace=this.params.cullFace,this.techniqueConfig.vertexColors=this.params.vertexColors,this.techniqueConfig.slicePlaneEnabled=this.params.slicePlaneEnabled,this.techniqueConfig.polygonOffset=this.params.polygonOffset,this.techniqueConfig.writeDepth=this.params.writeDepth,this.techniqueConfig.style=this.params.style,this.techniqueConfig.patternSpacing=this.params.patternSpacing,this.techniqueConfig.lineWidth=this.params.lineWidth,this.techniqueConfig.draped=this.params.draped,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.enableOffset=t.camera.relativeElevation<c,this.techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=t.cullAboveGround,this.techniqueConfig}getPassParameters(){return this.params}intersect(e,t,i,r,s,a,n){m(e,t,r,s,a,void 0,n)}requiresSlot(e,t){if(20===e)return!0;if(4===n(t))return 2===e;return e===(this.params.writeDepth?4:7)}createGLMaterial(e){return 0===e.output||7===e.output||4===e.output||1===e.output&&this.params.writeLinearDepth?new v(e):null}createBufferWriter(){const e=s().vec3f("position").vec4u8("color").vec4f("uvMapSpace");return this.params.draped||e.mat3f("boundingRect"),new y(e)}}class v extends a{updateParameters(e){return this.ensureTechnique(q,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.params.sceneHasOcludees&&this._material.setParameterValues({sceneHasOcludees:e.hasOccludees})}beginSlot(e){return 0!==this._output&&7!==this._output||this._updateOccludeeState(e),this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}class y extends d{write(s,a,n,o){for(const u of this.vertexBufferLayout.fieldNames){const c=a.vertexAttributes.get(u),d=a.indices.get(u);if(c&&d)switch(u){case"position":{l(3===c.size);const e=n.getField(u,r);e&&f(d,c.data,s.transformation,e,o);break}case"color":{l(3===c.size||4===c.size);const e=n.getField(u,i);e&&h(d,c.data,c.size,e,o);break}case"uvMapSpace":{l(4===c.size);const e=n.getField(u,t);e&&p(d,c.data,e,o);break}case"boundingRect":{l(9===c.size);const t=n.getField(u,e);t&&this.writeBoundingRect(d,c.data,s.transformation,t,o);break}}}}writeBoundingRect(e,t,i,r,s){const a=i,n=r.typedBuffer,o=r.typedBufferStride,u=e.length;s*=o;for(let c=0;c<u;++c){const i=9*e[c],r=t[i],u=t[i+1],l=t[i+2];n[s]=a[0]*r+a[4]*u+a[8]*l+a[12],n[s+1]=a[1]*r+a[5]*u+a[9]*l+a[13],n[s+2]=a[2]*r+a[6]*u+a[10]*l+a[14];for(let e=3;e<9;++e)n[s+e]=t[i+e];s+=o}}}const w={color:[1,1,1,1],writeDepth:!0,writeLinearDepth:!1,vertexColors:!1,polygonOffset:!1,slicePlaneEnabled:!1,cullFace:0,sceneHasOcludees:!1,style:2,patternSpacing:10,lineWidth:1,draped:!0,...u};export{C as PatternMaterial};
5
+ import{BufferViewMat3f as e,BufferViewVec4f as t,BufferViewVec4u8 as r,BufferViewVec3f as i}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import a from"../lib/GLMaterial.js";import{outputFromPass as n}from"../lib/GLMaterials.js";import{Material as o,materialParametersDefaults as u}from"../lib/Material.js";import{OITPolygonOffsetLimit as c}from"../lib/OrderIndependentTransparency.js";import{assert as l}from"../lib/Util.js";import{writeBufferVec4 as p,writeColor as h,writePosition as f}from"./internal/bufferWriterUtils.js";import{DefaultBufferWriter as d}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as m}from"./internal/MaterialUtil.js";import{patternVertexAttributeLocations as g,PatternTechniqueConfiguration as b,PatternTechnique as q}from"../shaders/PatternTechnique.js";class C extends o{constructor(e){super(e,w),this.supportsEdges=!0,this._vertexAttributeLocations=g,this.techniqueConfig=new b}getTechniqueConfig(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.cullFace=this.parameters.cullFace,this.techniqueConfig.vertexColors=this.parameters.vertexColors,this.techniqueConfig.slicePlaneEnabled=this.parameters.slicePlaneEnabled,this.techniqueConfig.polygonOffset=this.parameters.polygonOffset,this.techniqueConfig.writeDepth=this.parameters.writeDepth,this.techniqueConfig.style=this.parameters.style,this.techniqueConfig.patternSpacing=this.parameters.patternSpacing,this.techniqueConfig.lineWidth=this.parameters.lineWidth,this.techniqueConfig.draped=this.parameters.draped,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.enableOffset=t.camera.relativeElevation<c,this.techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=t.cullAboveGround,this.techniqueConfig}getPassParameters(){return this.parameters}intersect(e,t,r,i,s,a,n){m(e,t,i,s,a,void 0,n)}requiresSlot(e,t){if(20===e)return!0;if(4===n(t))return 2===e;return e===(this.parameters.writeDepth?4:7)}createGLMaterial(e){return 0===e.output||7===e.output||4===e.output||1===e.output&&this.parameters.writeLinearDepth?new v(e):null}createBufferWriter(){const e=s().vec3f("position").vec4u8("color").vec4f("uvMapSpace");return this.parameters.draped||e.mat3f("boundingRect"),new y(e)}}class v extends a{updateParameters(e){return this.ensureTechnique(q,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.sceneHasOcludees&&this._material.setParameters({sceneHasOcludees:e.hasOccludees})}beginSlot(e){return 0!==this._output&&7!==this._output||this._updateOccludeeState(e),this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}class y extends d{write(s,a,n,o){for(const u of this.vertexBufferLayout.fieldNames){const c=a.vertexAttributes.get(u),d=a.indices.get(u);if(c&&d)switch(u){case"position":{l(3===c.size);const e=n.getField(u,i);e&&f(d,c.data,s.transformation,e,o);break}case"color":{l(3===c.size||4===c.size);const e=n.getField(u,r);e&&h(d,c.data,c.size,e,o);break}case"uvMapSpace":{l(4===c.size);const e=n.getField(u,t);e&&p(d,c.data,e,o);break}case"boundingRect":{l(9===c.size);const t=n.getField(u,e);t&&this.writeBoundingRect(d,c.data,s.transformation,t,o);break}}}}writeBoundingRect(e,t,r,i,s){const a=r,n=i.typedBuffer,o=i.typedBufferStride,u=e.length;s*=o;for(let c=0;c<u;++c){const r=9*e[c],i=t[r],u=t[r+1],l=t[r+2];n[s]=a[0]*i+a[4]*u+a[8]*l+a[12],n[s+1]=a[1]*i+a[5]*u+a[9]*l+a[13],n[s+2]=a[2]*i+a[6]*u+a[10]*l+a[14];for(let e=3;e<9;++e)n[s+e]=t[r+e];s+=o}}}const w={color:[1,1,1,1],writeDepth:!0,writeLinearDepth:!1,vertexColors:!1,polygonOffset:!1,slicePlaneEnabled:!1,cullFace:0,sceneHasOcludees:!1,style:2,patternSpacing:10,lineWidth:1,draped:!0,...u};export{C as PatternMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{isSome as i}from"../../../../core/maybe.js";import{createRenderScreenPointArray3 as s}from"../../../../core/screenUtils.js";import{c as r}from"../../../../chunks/vec2.js";import{s as a,f as n,d as o,a as l,b as u,g as c,l as p,i as h,m}from"../../../../chunks/vec3.js";import{c as f}from"../../../../chunks/vec3f64.js";import{create as d,distance2 as v,fromPoints as b,closestLineSegmentPoint as g}from"../../../../geometry/support/lineSegment.js";import{create as C,fromPoints as S,signedDistance as y,normal as A}from"../../../../geometry/support/plane.js";import{newLayout as q}from"../../support/buffer/InterleavedLayout.js";import{computeAttachmentOriginLines as x}from"../lib/geometryDataUtils.js";import z from"../lib/GLMaterial.js";import{outputFromPass as E}from"../lib/GLMaterials.js";import{materialParametersDefaults as j,Material as L}from"../lib/Material.js";import{isTranslationMatrix as O}from"../lib/Util.js";import P from"./VisualVariableMaterialParameters.js";import{isInstanceHidden as T}from"./renderers/utils.js";import{ribbonVertexAttributeLocations as w,RibbonLineTechniqueConfiguration as M,RibbonLineTechnique as R}from"../shaders/RibbonLineTechnique.js";const F=e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial");class W extends L{constructor(e){super(e,G),this._vertexAttributeLocations=w,this.techniqueConfig=new M,this.layout=this.createLayout()}isClosed(e,t){return B(this.params,e,t)}dispose(){}getPassParameters(){return this.params}getTechniqueConfig(e,t){this.techniqueConfig.output=e;const s=20===t.slot;this.techniqueConfig.draped=s;const r=i(this.params.stipplePattern);return this.techniqueConfig.stippleEnabled=r,this.techniqueConfig.stippleIntegerRepeatsEnabled=r&&this.params.stippleIntegerRepeats,this.techniqueConfig.stippleOffColorEnabled=r&&i(this.params.stippleOffColor),this.techniqueConfig.scaleStippleWithLineWidth=r&&this.params.scaleStippleWithLineWidth,this.techniqueConfig.slicePlaneEnabled=this.params.slicePlaneEnabled,this.techniqueConfig.sceneHasOcludees=this.params.sceneHasOcludees,this.techniqueConfig.roundJoins="round"===this.params.join,this.techniqueConfig.capType=this.params.cap,this.techniqueConfig.transparent=this.params.transparent,this.techniqueConfig.polygonOffset=this.params.polygonOffset,this.techniqueConfig.writeDepth=this.params.writeDepth,this.techniqueConfig.vvColor=this.params.vvColorEnabled,this.techniqueConfig.vvOpacity=this.params.vvOpacityEnabled,this.techniqueConfig.vvSize=this.params.vvSizeEnabled,this.techniqueConfig.innerColorEnabled=this.params.innerWidth>0&&i(this.params.innerColor),this.techniqueConfig.falloffEnabled=this.params.falloff>0,this.techniqueConfig.occluder=8===this.params.renderOccluded,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=t.cullAboveGround,this.techniqueConfig}intersect(e,t,i,s,r,a,n,o,l){l?this.intersectDrapedLineGeometry(e,s,a,n):this.intersectLineGeometry(e,t,i,s,this.params.width,n)}intersectDrapedLineGeometry(e,i,s,r){if(!i.options.selectionMode)return;const a=e.vertexAttributes.get("position").data,n=e.vertexAttributes.get("size");let o=this.params.width;if(this.params.vvSizeEnabled){const i=e.vertexAttributes.get("sizeFeatureAttribute").data[0];o*=t(this.params.vvSizeOffset[0]+i*this.params.vvSizeFactor[0],this.params.vvSizeMinSize[0],this.params.vvSizeMaxSize[0])}else n&&(o*=n.data[0]);const l=s[0],u=s[1],c=(o/2+4)*e.screenToWorldRatio;let p=Number.MAX_VALUE;for(let h=0;h<a.length-5;h+=3){const e=a[h],i=a[h+1],s=l-e,r=u-i,n=a[h+3]-e,o=a[h+4]-i,c=t((n*s+o*r)/(n*n+o*o),0,1),m=n*c-s,f=o*c-r,d=m*m+f*f;d<p&&(p=d)}p<c*c&&r()}intersectLineGeometry(e,i,s,m,f,d){if(!m.options.selectionMode||T(i))return;if(!O(s))return void F.error("intersection assumes a translation-only matrix");const C=e.vertexAttributes,q=C.get("position").data;let x=f;if(this.params.vvSizeEnabled){const e=C.get("sizeFeatureAttribute").data[0];x*=t(this.params.vvSizeOffset[0]+e*this.params.vvSizeFactor[0],this.params.vvSizeMinSize[0],this.params.vvSizeMaxSize[0])}else C.has("size")&&(x*=C.get("size").data[0]);const z=m.camera,E=X;r(E,m.point);const j=x*z.pixelRatio/2+4*z.pixelRatio;a(re[0],E[0]-j,E[1]+j,0),a(re[1],E[0]+j,E[1]+j,0),a(re[2],E[0]+j,E[1]-j,0),a(re[3],E[0]-j,E[1]-j,0);for(let t=0;t<4;t++)if(!z.unprojectFromRenderScreen(re[t],ae[t]))return;S(z.eye,ae[0],ae[1],ne),S(z.eye,ae[1],ae[2],oe),S(z.eye,ae[2],ae[3],le),S(z.eye,ae[3],ae[0],ue);let L=Number.MAX_VALUE;const P=V(this.params,C,e.indices)?q.length-2:q.length-5;for(let t=0;t<P;t+=3){H[0]=q[t]+s[12],H[1]=q[t+1]+s[13],H[2]=q[t+2]+s[14];const e=(t+3)%q.length;if(k[0]=q[e]+s[12],k[1]=q[e+1]+s[13],k[2]=q[e+2]+s[14],y(ne,H)<0&&y(ne,k)<0||y(oe,H)<0&&y(oe,k)<0||y(le,H)<0&&y(le,k)<0||y(ue,H)<0&&y(ue,k)<0)continue;if(z.projectToRenderScreen(H,K),z.projectToRenderScreen(k,Q),K[2]<0&&Q[2]>0){n(I,H,k);const e=z.frustum,t=-y(e[4],H)/o(I,A(e[4]));l(I,I,t),u(H,H,I),z.projectToRenderScreen(H,K)}else if(K[2]>0&&Q[2]<0){n(I,k,H);const e=z.frustum,t=-y(e[4],k)/o(I,A(e[4]));l(I,I,t),u(k,k,I),z.projectToRenderScreen(k,Q)}else if(K[2]<0&&Q[2]<0)continue;K[2]=0,Q[2]=0;const i=v(b(K,Q,$),E);i<L&&(L=i,c(Y,H),c(Z,k))}const w=m.rayBeginPoint,M=m.rayEndPoint;if(L<j*j){let e=Number.MAX_VALUE;if(g(b(Y,Z,$),b(w,M,ee),N)){n(N,N,w);const t=p(N);l(N,N,1/t),e=t/h(w,M)}d(e,N)}}computeAttachmentOrigin(e,t){const i=e.vertexAttributes;if(!i)return null;const s=e.indices,r=i.get("position");return x(r,s?s.get("position"):null,s&&V(this.params,i,s),t)}createLayout(){const e=q().vec3f("position").f32("subdivisionFactor").vec2f("uv0").vec3f("auxpos1").vec3f("auxpos2");return this.params.vvSizeEnabled?e.f32("sizeFeatureAttribute"):e.f32("size"),this.params.vvColorEnabled?e.f32("colorFeatureAttribute"):e.vec4f("color"),this.params.vvOpacityEnabled&&e.f32("opacityFeatureAttribute"),e}createBufferWriter(){return new D(this.layout,this.params)}requiresSlot(e,t){if(20===e)return!0;if(8===this.params.renderOccluded)return 2===e||9===e||10===e;const i=E(t);if(0===i||7===i){return e===(this.params.writeDepth?4:7)}return 2===e}createGLMaterial(e){return 0===e.output||7===e.output||4===e.output||1===e.output?new _(e):null}validateParameterValues(e){"miter"!==e.join&&(e.miterLimit=0),this.requiresTransparent(e)&&(e.transparent=!0)}requiresTransparent(e){return!!((e.color&&e.color[3])<1||e.innerWidth>0&&this.colorRequiresTransparent(e.innerColor)||e.stipplePattern&&this.colorRequiresTransparent(e.stippleOffColor)||e.falloff>0)}colorRequiresTransparent(e){return i(e)&&e[3]<1&&e[3]>0}}class _ extends z{updateParameters(e){return this.ensureTechnique(R,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.params.sceneHasOcludees&&this._material.setParameterValues({sceneHasOcludees:e.hasOccludees})}beginSlot(e){return 0!==this._output&&7!==this._output||this._updateOccludeeState(e),this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}const G={width:0,color:[1,1,1,1],join:"miter",cap:0,miterLimit:5,writeDepth:!0,polygonOffset:!1,stipplePattern:null,stippleIntegerRepeats:!1,stippleOffColor:null,scaleStippleWithLineWidth:!1,slicePlaneEnabled:!1,vvFastUpdate:!1,transparent:!1,isClosed:!1,falloff:0,innerWidth:0,innerColor:null,sceneHasOcludees:!1,...j,...P.Default};class D{constructor(e,t){switch(this.params=t,this.numJoinSubdivisions=0,this.vertexBufferLayout=e,this.params.join){case"miter":case"bevel":this.numJoinSubdivisions=t.stipplePattern?1:0;break;case"round":this.numJoinSubdivisions=J}}isClosed(e){return V(this.params,e.vertexAttributes,e.indices)}numCapSubdivisions(e){if(this.isClosed(e))return 0;switch(this.params.cap){case 1:case 2:return 1;default:return 0}}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2*this.numCapSubdivisions(e)+2,i=e.indices.get("position").length/2+1,s=this.isClosed(e);let r=s?2:2*t;const a=s?0:1,n=s?i:i-1;if(e.vertexAttributes.has("subdivisions")){const t=e.vertexAttributes.get("subdivisions").data;for(let e=a;e<n;++e){r+=4+2*t[e]}}else{r+=(n-a)*(2*this.numJoinSubdivisions+4)}return r+=2,r}write(e,t,i,s){const r=te,n=ie,o=se,l=t.vertexAttributes.get("position").data,u=t.indices&&t.indices.get("position"),p=this.numCapSubdivisions(t);u&&u.length!==2*(l.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");let f=null;t.vertexAttributes.has("subdivisions")&&(f=t.vertexAttributes.get("subdivisions").data);let d=1,v=0;this.params.vvSizeEnabled?v=t.vertexAttributes.get("sizeFeatureAttribute").data[0]:t.vertexAttributes.has("size")&&(d=t.vertexAttributes.get("size").data[0]);let b=[1,1,1,1],g=0;this.params.vvColorEnabled?g=t.vertexAttributes.get("colorFeatureAttribute").data[0]:t.vertexAttributes.has("color")&&(b=t.vertexAttributes.get("color").data);let C=0;this.params.vvOpacityEnabled&&(C=t.vertexAttributes.get("opacityFeatureAttribute").data[0]);const S=l.length/3,y=e.transformation,A=new Float32Array(i.buffer),q=this.vertexBufferLayout.stride/4;let x=s*q;const z=x;let E=0;const j=(e,t,i,s,r,a,n,o)=>{if(A[x++]=t[0],A[x++]=t[1],A[x++]=t[2],A[x++]=s,A[x++]=o,A[x++]=a+r/10,A[x++]=e[0],A[x++]=e[1],A[x++]=e[2],A[x++]=i[0],A[x++]=i[1],A[x++]=i[2],this.params.vvSizeEnabled?A[x++]=v:A[x++]=d,this.params.vvColorEnabled)A[x++]=g;else{const e=Math.min(4*n,b.length-4);A[x++]=b[e+0],A[x++]=b[e+1],A[x++]=b[e+2],A[x++]=b[e+3]}this.params.vvOpacityEnabled&&(A[x++]=C)};x+=q,a(n,l[0],l[1],l[2]),y&&m(n,n,y);const L=this.isClosed(t);if(L){const e=l.length-3;a(r,l[e],l[e+1],l[e+2]),y&&m(r,r,y)}else{c(r,n),a(o,l[3],l[4],l[5]),y&&m(o,o,y);for(let e=0;e<p;++e){const t=1-e/p;j(r,n,o,t,1,-4,0,E),j(r,n,o,t,1,4,0,E)}j(r,n,o,0,0,-4,0,E),j(r,n,o,0,0,4,0,E),c(r,n),c(n,o)}const O=L?0:1,P=L?S:S-1;for(let T=O;T<P;T++){const e=(T+1)%S*3;a(o,l[e+0],l[e+1],l[e+2]),y&&m(o,o,y),E+=h(r,n),j(r,n,o,0,1,-1,T,E),j(r,n,o,0,1,1,T,E);const t=f?f[T]:this.numJoinSubdivisions;for(let i=0;i<t;++i){const e=(i+1)/(t+1);j(r,n,o,e,1,-2,T,E),j(r,n,o,e,1,2,T,E)}j(r,n,o,1,0,-2,T,E),j(r,n,o,1,0,2,T,E),c(r,n),c(n,o)}if(L)a(o,l[3],l[4],l[5]),y&&m(o,o,y),E+=h(r,n),j(r,n,o,0,1,-1,O,E),j(r,n,o,0,1,1,O,E);else{E+=h(r,n),j(r,n,o,0,1,-5,P,E),j(r,n,o,0,1,5,P,E);for(let e=0;e<p;++e){const t=(e+1)/p;j(r,n,o,t,1,-5,P,E),j(r,n,o,t,1,5,P,E)}}U(A,z+q,A,z,q);x=U(A,x-q,A,x,q)}}function U(e,t,i,s,r){for(let a=0;a<r;a++)i[s++]=e[t++];return s}function V(e,t,i){return B(e,t.get("position").data,i?i.get("position"):null)}function B(e,t,i){return!!e.isClosed&&(i?i.length>2:t.length>6)}const J=1,H=f(),k=f(),I=f(),N=f(),X=f(),K=s(),Q=s(),Y=f(),Z=f(),$=d(),ee=d(),te=f(),ie=f(),se=f(),re=[s(),s(),s(),s()],ae=[f(),f(),f(),f()],ne=C(),oe=C(),le=C(),ue=C();export{W as RibbonLineMaterial};
5
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{isSome as i}from"../../../../core/maybe.js";import{createRenderScreenPointArray3 as s}from"../../../../core/screenUtils.js";import{c as r}from"../../../../chunks/vec2.js";import{s as n,f as a,d as o,a as l,b as u,g as c,l as p,i as h,m}from"../../../../chunks/vec3.js";import{c as f}from"../../../../chunks/vec3f64.js";import{create as d,distance2 as v,fromPoints as b,closestLineSegmentPoint as g}from"../../../../geometry/support/lineSegment.js";import{create as C,fromPoints as S,signedDistance as y,normal as A}from"../../../../geometry/support/plane.js";import{newLayout as q}from"../../support/buffer/InterleavedLayout.js";import{computeAttachmentOriginLines as x}from"../lib/geometryDataUtils.js";import z from"../lib/GLMaterial.js";import{outputFromPass as E}from"../lib/GLMaterials.js";import{materialParametersDefaults as j,Material as L}from"../lib/Material.js";import{isTranslationMatrix as O}from"../lib/Util.js";import P from"./VisualVariableMaterialParameters.js";import{isInstanceHidden as T}from"./renderers/utils.js";import{ribbonVertexAttributeLocations as w,RibbonLineTechniqueConfiguration as M,RibbonLineTechnique as R}from"../shaders/RibbonLineTechnique.js";const F=e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial");class W extends L{constructor(e){super(e,G),this._vertexAttributeLocations=w,this.techniqueConfig=new M,this.layout=this.createLayout()}isClosed(e,t){return J(this.parameters,e,t)}dispose(){}getPassParameters(){return this.parameters}getTechniqueConfig(e,t){this.techniqueConfig.output=e;const s=20===t.slot;this.techniqueConfig.draped=s;const r=i(this.parameters.stipplePattern);return this.techniqueConfig.stippleEnabled=r,this.techniqueConfig.stippleIntegerRepeatsEnabled=r&&this.parameters.stippleIntegerRepeats,this.techniqueConfig.stippleOffColorEnabled=r&&i(this.parameters.stippleOffColor),this.techniqueConfig.scaleStippleWithLineWidth=r&&this.parameters.scaleStippleWithLineWidth,this.techniqueConfig.slicePlaneEnabled=this.parameters.slicePlaneEnabled,this.techniqueConfig.sceneHasOcludees=this.parameters.sceneHasOcludees,this.techniqueConfig.roundJoins="round"===this.parameters.join,this.techniqueConfig.capType=this.parameters.cap,this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.polygonOffset=this.parameters.polygonOffset,this.techniqueConfig.writeDepth=this.parameters.writeDepth,this.techniqueConfig.vvColor=this.parameters.vvColorEnabled,this.techniqueConfig.vvOpacity=this.parameters.vvOpacityEnabled,this.techniqueConfig.vvSize=this.parameters.vvSizeEnabled,this.techniqueConfig.innerColorEnabled=this.parameters.innerWidth>0&&i(this.parameters.innerColor),this.techniqueConfig.falloffEnabled=this.parameters.falloff>0,this.techniqueConfig.occluder=8===this.parameters.renderOccluded,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=t.cullAboveGround,this.techniqueConfig}intersect(e,t,i,s,r,n,a,o,l){l?this.intersectDrapedLineGeometry(e,s,n,a):this.intersectLineGeometry(e,t,i,s,a)}intersectDrapedLineGeometry(e,i,s,r){if(!i.options.selectionMode)return;const n=e.vertexAttributes.get("position").data,a=e.vertexAttributes.get("size");let o=this.parameters.width;if(this.parameters.vvSizeEnabled){const i=e.vertexAttributes.get("sizeFeatureAttribute").data[0];o*=t(this.parameters.vvSizeOffset[0]+i*this.parameters.vvSizeFactor[0],this.parameters.vvSizeMinSize[0],this.parameters.vvSizeMaxSize[0])}else a&&(o*=a.data[0]);const l=s[0],u=s[1],c=(o/2+4)*e.screenToWorldRatio;let p=Number.MAX_VALUE;for(let h=0;h<n.length-5;h+=3){const e=n[h],i=n[h+1],s=l-e,r=u-i,a=n[h+3]-e,o=n[h+4]-i,c=t((a*s+o*r)/(a*a+o*o),0,1),m=a*c-s,f=o*c-r,d=m*m+f*f;d<p&&(p=d)}p<c*c&&r()}intersectLineGeometry(e,i,s,m,f){if(!m.options.selectionMode||T(i))return;if(!O(s))return void F.error("intersection assumes a translation-only matrix");const d=e.vertexAttributes,C=d.get("position").data;let q=this.parameters.width;if(this.parameters.vvSizeEnabled){const e=d.get("sizeFeatureAttribute").data[0];q*=t(this.parameters.vvSizeOffset[0]+e*this.parameters.vvSizeFactor[0],this.parameters.vvSizeMinSize[0],this.parameters.vvSizeMaxSize[0])}else d.has("size")&&(q*=d.get("size").data[0]);const x=m.camera,z=X;r(z,m.point);const E=q*x.pixelRatio/2+4*x.pixelRatio;n(re[0],z[0]-E,z[1]+E,0),n(re[1],z[0]+E,z[1]+E,0),n(re[2],z[0]+E,z[1]-E,0),n(re[3],z[0]-E,z[1]-E,0);for(let t=0;t<4;t++)if(!x.unprojectFromRenderScreen(re[t],ne[t]))return;S(x.eye,ne[0],ne[1],ae),S(x.eye,ne[1],ne[2],oe),S(x.eye,ne[2],ne[3],le),S(x.eye,ne[3],ne[0],ue);let j=Number.MAX_VALUE;const L=B(this.parameters,d,e.indices)?C.length-2:C.length-5;for(let t=0;t<L;t+=3){V[0]=C[t]+s[12],V[1]=C[t+1]+s[13],V[2]=C[t+2]+s[14];const e=(t+3)%C.length;if(k[0]=C[e]+s[12],k[1]=C[e+1]+s[13],k[2]=C[e+2]+s[14],y(ae,V)<0&&y(ae,k)<0||y(oe,V)<0&&y(oe,k)<0||y(le,V)<0&&y(le,k)<0||y(ue,V)<0&&y(ue,k)<0)continue;if(x.projectToRenderScreen(V,K),x.projectToRenderScreen(k,Q),K[2]<0&&Q[2]>0){a(I,V,k);const e=x.frustum,t=-y(e[4],V)/o(I,A(e[4]));l(I,I,t),u(V,V,I),x.projectToRenderScreen(V,K)}else if(K[2]>0&&Q[2]<0){a(I,k,V);const e=x.frustum,t=-y(e[4],k)/o(I,A(e[4]));l(I,I,t),u(k,k,I),x.projectToRenderScreen(k,Q)}else if(K[2]<0&&Q[2]<0)continue;K[2]=0,Q[2]=0;const i=v(b(K,Q,$),z);i<j&&(j=i,c(Y,V),c(Z,k))}const P=m.rayBeginPoint,w=m.rayEndPoint;if(j<E*E){let e=Number.MAX_VALUE;if(g(b(Y,Z,$),b(P,w,ee),N)){a(N,N,P);const t=p(N);l(N,N,1/t),e=t/h(P,w)}f(e,N)}}computeAttachmentOrigin(e,t){const i=e.vertexAttributes;if(!i)return null;const s=e.indices,r=i.get("position");return x(r,s?s.get("position"):null,s&&B(this.parameters,i,s),t)}createLayout(){const e=q().vec3f("position").f32("subdivisionFactor").vec2f("uv0").vec3f("auxpos1").vec3f("auxpos2");return this.parameters.vvSizeEnabled?e.f32("sizeFeatureAttribute"):e.f32("size"),this.parameters.vvColorEnabled?e.f32("colorFeatureAttribute"):e.vec4f("color"),this.parameters.vvOpacityEnabled&&e.f32("opacityFeatureAttribute"),e}createBufferWriter(){return new D(this.layout,this.parameters)}requiresSlot(e,t){if(20===e)return!0;if(8===this.parameters.renderOccluded)return 2===e||9===e||10===e;const i=E(t);if(0===i||7===i){return e===(this.parameters.writeDepth?4:7)}return 2===e}createGLMaterial(e){return 0===e.output||7===e.output||4===e.output||1===e.output?new _(e):null}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),this.requiresTransparent(e)&&(e.transparent=!0)}requiresTransparent(e){return!!((e.color&&e.color[3])<1||e.innerWidth>0&&this.colorRequiresTransparent(e.innerColor)||e.stipplePattern&&this.colorRequiresTransparent(e.stippleOffColor)||e.falloff>0)}colorRequiresTransparent(e){return i(e)&&e[3]<1&&e[3]>0}}class _ extends z{updateParameters(e){return this.ensureTechnique(R,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.sceneHasOcludees&&this._material.setParameters({sceneHasOcludees:e.hasOccludees})}beginSlot(e){return 0!==this._output&&7!==this._output||this._updateOccludeeState(e),this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}const G={width:0,color:[1,1,1,1],join:"miter",cap:0,miterLimit:5,writeDepth:!0,polygonOffset:!1,stipplePattern:null,stippleIntegerRepeats:!1,stippleOffColor:null,scaleStippleWithLineWidth:!1,slicePlaneEnabled:!1,vvFastUpdate:!1,transparent:!1,isClosed:!1,falloff:0,innerWidth:0,innerColor:null,sceneHasOcludees:!1,...j,...P.Default};class D{constructor(e,t){switch(this.parameters=t,this.numJoinSubdivisions=0,this.vertexBufferLayout=e,this.parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=t.stipplePattern?1:0;break;case"round":this.numJoinSubdivisions=H}}isClosed(e){return B(this.parameters,e.vertexAttributes,e.indices)}numCapSubdivisions(e){if(this.isClosed(e))return 0;switch(this.parameters.cap){case 1:case 2:return 1;default:return 0}}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2*this.numCapSubdivisions(e)+2,i=e.indices.get("position").length/2+1,s=this.isClosed(e);let r=s?2:2*t;const n=s?0:1,a=s?i:i-1;if(e.vertexAttributes.has("subdivisions")){const t=e.vertexAttributes.get("subdivisions").data;for(let e=n;e<a;++e){r+=4+2*t[e]}}else{r+=(a-n)*(2*this.numJoinSubdivisions+4)}return r+=2,r}write(e,t,i,s){const r=te,a=ie,o=se,l=t.vertexAttributes.get("position").data,u=t.indices&&t.indices.get("position"),p=this.numCapSubdivisions(t);u&&u.length!==2*(l.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");let f=null;t.vertexAttributes.has("subdivisions")&&(f=t.vertexAttributes.get("subdivisions").data);let d=1,v=0;this.parameters.vvSizeEnabled?v=t.vertexAttributes.get("sizeFeatureAttribute").data[0]:t.vertexAttributes.has("size")&&(d=t.vertexAttributes.get("size").data[0]);let b=[1,1,1,1],g=0;this.parameters.vvColorEnabled?g=t.vertexAttributes.get("colorFeatureAttribute").data[0]:t.vertexAttributes.has("color")&&(b=t.vertexAttributes.get("color").data);let C=0;this.parameters.vvOpacityEnabled&&(C=t.vertexAttributes.get("opacityFeatureAttribute").data[0]);const S=l.length/3,y=e.transformation,A=new Float32Array(i.buffer),q=this.vertexBufferLayout.stride/4;let x=s*q;const z=x;let E=0;const j=(e,t,i,s,r,n,a)=>{if(A[x++]=t[0],A[x++]=t[1],A[x++]=t[2],A[x++]=s,A[x++]=a,A[x++]=r,A[x++]=e[0],A[x++]=e[1],A[x++]=e[2],A[x++]=i[0],A[x++]=i[1],A[x++]=i[2],this.parameters.vvSizeEnabled?A[x++]=v:A[x++]=d,this.parameters.vvColorEnabled)A[x++]=g;else{const e=Math.min(4*n,b.length-4);A[x++]=b[e+0],A[x++]=b[e+1],A[x++]=b[e+2],A[x++]=b[e+3]}this.parameters.vvOpacityEnabled&&(A[x++]=C)};x+=q,n(a,l[0],l[1],l[2]),y&&m(a,a,y);const L=this.isClosed(t);if(L){const e=l.length-3;n(r,l[e],l[e+1],l[e+2]),y&&m(r,r,y)}else{c(r,a),n(o,l[3],l[4],l[5]),y&&m(o,o,y);for(let e=0;e<p;++e){const t=1-e/p;j(r,a,o,t,-4,0,E),j(r,a,o,t,4,0,E)}j(r,a,o,0,-4,0,E),j(r,a,o,0,4,0,E),c(r,a),c(a,o)}const O=L?0:1,P=L?S:S-1;for(let T=O;T<P;T++){const e=(T+1)%S*3;n(o,l[e+0],l[e+1],l[e+2]),y&&m(o,o,y),E+=h(r,a),j(r,a,o,0,-1,T,E),j(r,a,o,0,1,T,E);const t=f?f[T]:this.numJoinSubdivisions;for(let i=0;i<t;++i){const e=(i+1)/(t+1);j(r,a,o,e,-2,T,E),j(r,a,o,e,2,T,E)}j(r,a,o,1,-2,T,E),j(r,a,o,1,2,T,E),c(r,a),c(a,o)}if(L)n(o,l[3],l[4],l[5]),y&&m(o,o,y),E+=h(r,a),j(r,a,o,0,-1,O,E),j(r,a,o,0,1,O,E);else{E+=h(r,a),j(r,a,o,0,-5,P,E),j(r,a,o,0,5,P,E);for(let e=0;e<p;++e){const t=(e+1)/p;j(r,a,o,t,-5,P,E),j(r,a,o,t,5,P,E)}}U(A,z+q,A,z,q);x=U(A,x-q,A,x,q)}}function U(e,t,i,s,r){for(let n=0;n<r;n++)i[s++]=e[t++];return s}function B(e,t,i){return J(e,t.get("position").data,i?i.get("position"):null)}function J(e,t,i){return!!e.isClosed&&(i?i.length>2:t.length>6)}const H=1,V=f(),k=f(),I=f(),N=f(),X=f(),K=s(),Q=s(),Y=f(),Z=f(),$=d(),ee=d(),te=f(),ie=f(),se=f(),re=[s(),s(),s(),s()],ne=[f(),f(),f(),f()],ae=C(),oe=C(),le=C(),ue=C();export{W 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.22/esri/copyright.txt for details.
4
4
  */
5
- import{n as e,s as t,a as r,b as s}from"../../../../chunks/vec3.js";import{c as i}from"../../../../chunks/vec3f64.js";import{center as a,scale as n}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as o}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as u}from"../../support/buffer/InterleavedLayout.js";import c from"../lib/GLMaterial.js";import{outputFromPass as l}from"../lib/GLMaterials.js";import{materialParametersDefaults as f,Material as h}from"../lib/Material.js";import{assert as p}from"../lib/Util.js";import{writeDefaultAttributes as m,writePosition as d}from"./internal/bufferWriterUtils.js";import{intersectTriangleGeometry as b}from"./internal/MaterialUtil.js";import{ShadedColorMaterialTechniqueConfiguration as g,ShadedColorMaterialVertexAttrLocations as v,ShadedColorMaterialTechnique as E}from"../shaders/ShadedColorMaterialTechnique.js";class q extends h{constructor(e){super(e,C),this.supportsEdges=!0,this.techniqueConfig=new g,this._vertexAttributeLocations=v}getTechniqueConfig(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.cullFace=this.params.cullFace,this.techniqueConfig.slicePlaneEnabled=this.params.slicePlaneEnabled,this.techniqueConfig.transparent=this.params.transparent,this.techniqueConfig.writeDepth=this.params.writeDepth,this.techniqueConfig.screenSizeEnabled=this.params.screenSizeEnabled,this.techniqueConfig.shadingEnabled=this.params.shadingEnabled,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=t.cullAboveGround,this.techniqueConfig}getPassParameters(){return this.params}intersect(e,i,o,u,c,l,f){if(this.params.screenSizeEnabled){const o=e.vertexAttributes.get("offset"),h={applyToVertex:(e,i,a,n)=>{const c=t(z,o.data[3*n+0],o.data[3*n+1],o.data[3*n+2]),l=t(w,e,i,a);return r(c,c,this.params.screenSize*u.camera.computeRenderPixelSizeAt(c)),s(l,l,c),[l[0],l[1],l[2]]},applyToAabb:e=>{const t=a(e,z);return n(e,this.params.screenSize*u.camera.computeRenderPixelSizeAt(t))}};b(e,i,u,c,l,h,f)}else b(e,i,u,c,l,void 0,f)}requiresSlot(e,t){if(4===l(t))return 2===e;let r=2;return this.params.transparent&&(r=this.params.writeDepth?4:7),e===r||20===e}createGLMaterial(e){return 0===e.output||7===e.output||4===e.output?new S(e):null}createBufferWriter(){return new x(this.params.screenSizeEnabled)}}class S extends c{updateParameters(e){return this.ensureTechnique(E,e)}beginSlot(e){return this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}const C={color:[1,1,1,1],shadingTint:[0,0,0,.25],shadingDirection:e(i(),[.5,-.5,-.5]),transparent:!1,writeDepth:!0,slicePlaneEnabled:!1,cullFace:0,screenSizeEnabled:!1,screenSize:14,shadingEnabled:!0,...f};class x{constructor(e){this.screenSizeEnabled=e;const t=u().vec3f("position").vec3f("normal");this.screenSizeEnabled&&t.vec3f("offset"),this.vertexBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get("position").length}write(e,t,r,s){if(m(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,s),this.screenSizeEnabled){if(!t.vertexAttributes.has("offset"))throw new Error("offset vertex attribute required for screenSizeEnabled ShadedColorMaterial");{const i=t.vertexAttributes.get("offset"),a=t.indices.get("offset");p(3===i.size);const n=r.getField("offset",o);if(!n)throw new Error("unable to acquire view for offset");d(a,i.data,e.invTranspTransformation,n,s)}}}}const z=i(),w=i();export{q as ShadedColorMaterial};
5
+ import{n as e,s as t,a as r,b as s}from"../../../../chunks/vec3.js";import{c as i}from"../../../../chunks/vec3f64.js";import{center as a,scale as n}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as o}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as u}from"../../support/buffer/InterleavedLayout.js";import c from"../lib/GLMaterial.js";import{outputFromPass as l}from"../lib/GLMaterials.js";import{materialParametersDefaults as f,Material as h}from"../lib/Material.js";import{assert as p}from"../lib/Util.js";import{writeDefaultAttributes as m,writePosition as d}from"./internal/bufferWriterUtils.js";import{intersectTriangleGeometry as b}from"./internal/MaterialUtil.js";import{ShadedColorMaterialTechniqueConfiguration as g,ShadedColorMaterialVertexAttrLocations as v,ShadedColorMaterialTechnique as E}from"../shaders/ShadedColorMaterialTechnique.js";class q extends h{constructor(e){super(e,C),this.supportsEdges=!0,this.techniqueConfig=new g,this._vertexAttributeLocations=v}getTechniqueConfig(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.cullFace=this.parameters.cullFace,this.techniqueConfig.slicePlaneEnabled=this.parameters.slicePlaneEnabled,this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.writeDepth=this.parameters.writeDepth,this.techniqueConfig.screenSizeEnabled=this.parameters.screenSizeEnabled,this.techniqueConfig.shadingEnabled=this.parameters.shadingEnabled,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=t.cullAboveGround,this.techniqueConfig}getPassParameters(){return this.parameters}intersect(e,i,o,u,c,l,f){if(this.parameters.screenSizeEnabled){const o=e.vertexAttributes.get("offset"),h={applyToVertex:(e,i,a,n)=>{const c=t(z,o.data[3*n+0],o.data[3*n+1],o.data[3*n+2]),l=t(w,e,i,a);return r(c,c,this.parameters.screenSize*u.camera.computeRenderPixelSizeAt(c)),s(l,l,c),[l[0],l[1],l[2]]},applyToAabb:e=>{const t=a(e,z);return n(e,this.parameters.screenSize*u.camera.computeRenderPixelSizeAt(t))}};b(e,i,u,c,l,h,f)}else b(e,i,u,c,l,void 0,f)}requiresSlot(e,t){if(4===l(t))return 2===e;let r=2;return this.parameters.transparent&&(r=this.parameters.writeDepth?4:7),e===r||20===e}createGLMaterial(e){return 0===e.output||7===e.output||4===e.output?new S(e):null}createBufferWriter(){return new x(this.parameters.screenSizeEnabled)}}class S extends c{updateParameters(e){return this.ensureTechnique(E,e)}beginSlot(e){return this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}const C={color:[1,1,1,1],shadingTint:[0,0,0,.25],shadingDirection:e(i(),[.5,-.5,-.5]),transparent:!1,writeDepth:!0,slicePlaneEnabled:!1,cullFace:0,screenSizeEnabled:!1,screenSize:14,shadingEnabled:!0,...f};class x{constructor(e){this.screenSizeEnabled=e;const t=u().vec3f("position").vec3f("normal");this.screenSizeEnabled&&t.vec3f("offset"),this.vertexBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get("position").length}write(e,t,r,s){if(m(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,s),this.screenSizeEnabled){if(!t.vertexAttributes.has("offset"))throw new Error("offset vertex attribute required for screenSizeEnabled ShadedColorMaterial");{const i=t.vertexAttributes.get("offset"),a=t.indices.get("offset");p(3===i.size);const n=r.getField("offset",o);if(!n)throw new Error("unable to acquire view for offset");d(a,i.data,e.invTranspTransformation,n,s)}}}}const z=i(),w=i();export{q as ShadedColorMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{unwrap as r}from"../../../../core/maybe.js";import{ShaderTechniqueConfiguration as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import t from"../lib/GLMaterial.js";import{Material as i,materialParametersDefaults as n}from"../lib/Material.js";import{DefaultBufferWriter as o,PositionUVLayout as s}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as a}from"./internal/MaterialUtil.js";import{SlicePlaneMaterialTechnique as u}from"../shaders/SlicePlaneMaterialTechnique.js";class l extends i{constructor(r){super(r,m),this._config=new e}intersect(r,e,t,i,n,o,s){return a(r,e,i,n,o,void 0,s)}createBufferWriter(){return new o(s)}requiresSlot(r){return 7===r}createGLMaterial(r){return 0===r.output?new c(r):null}getTechniqueConfig(){return this._config}}class c extends t{constructor(r){super(r),this.ensureTechnique(u,null)}updateParameters(){return r(this.technique)}beginSlot(){return r(this.technique)}bind(r,e){e.bindPass(this._material.params,r)}}const m={backgroundColor:[1,0,0,.5],gridColor:[0,1,0,.5],gridWidth:4,...n};export{l as SlicePlaneMaterial};
5
+ import{unwrap as r}from"../../../../core/maybe.js";import{ShaderTechniqueConfiguration as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import t from"../lib/GLMaterial.js";import{Material as i,materialParametersDefaults as n}from"../lib/Material.js";import{DefaultBufferWriter as o,PositionUVLayout as s}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as a}from"./internal/MaterialUtil.js";import{SlicePlaneMaterialTechnique as u}from"../shaders/SlicePlaneMaterialTechnique.js";class l extends i{constructor(r){super(r,m),this._config=new e}intersect(r,e,t,i,n,o,s){return a(r,e,i,n,o,void 0,s)}createBufferWriter(){return new o(s)}requiresSlot(r){return 7===r}createGLMaterial(r){return 0===r.output?new c(r):null}getTechniqueConfig(){return this._config}}class c extends t{constructor(r){super(r),this.ensureTechnique(u,null)}updateParameters(){return r(this.technique)}beginSlot(){return r(this.technique)}bind(r,e){e.bindPass(this._material.parameters,r)}}const m={backgroundColor:[1,0,0,.5],gridColor:[0,1,0,.5],gridWidth:4,...n};export{l as SlicePlaneMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import e from"../lib/GLMaterial.js";import{WaterTechnique as t}from"./WaterTechnique.js";class a extends e{updateParameters(e){return this.ensureTechnique(t,e)}setElapsedTimeUniform(e){const t=.001*this._material.animation.time;e.setUniform1f("timeElapsed",t*this._material.params.animationSpeed)}_updateShadowState(e){e.shadowMappingEnabled!==this._material.params.receiveShadows&&this._material.setParameterValues({receiveShadows:e.shadowMappingEnabled})}_updateSSRState(e){e.ssrEnabled!==this._material.params.ssrEnabled&&this._material.setParameterValues({ssrEnabled:e.ssrEnabled})}ensureResources(e){const t=this._techniqueRep.constructionContext.waterTextureRepository;return t.ready||t.updating||t.loadTextures(e),t.ready?2:1}beginSlot(e){return 0===this._output&&(this._updateShadowState(e),this._updateSSRState(e)),this.updateParameters(e)}bind(e,t){t.bindPass(this._material.params,e),2!==this._output&&0!==this._output||this.setElapsedTimeUniform(t.program)}}export{a as WaterGLMaterial};
5
+ import e from"../lib/GLMaterial.js";import{WaterTechnique as t}from"./WaterTechnique.js";class a extends e{updateParameters(e){return this.ensureTechnique(t,e)}setElapsedTimeUniform(e){const t=.001*this._material.animation.time;e.setUniform1f("timeElapsed",t*this._material.parameters.animationSpeed)}_updateShadowState(e){e.shadowMappingEnabled!==this._material.parameters.receiveShadows&&this._material.setParameters({receiveShadows:e.shadowMappingEnabled})}_updateSSRState(e){e.ssrEnabled!==this._material.parameters.ssrEnabled&&this._material.setParameters({ssrEnabled:e.ssrEnabled})}ensureResources(e){const t=this._techniqueRep.constructionContext.waterTextureRepository;return t.ready||t.updating||t.loadTextures(e),t.ready?2:1}beginSlot(e){return 0===this._output&&(this._updateShadowState(e),this._updateSSRState(e)),this.updateParameters(e)}bind(e,t){t.bindPass(this._material.parameters,e),2!==this._output&&0!==this._output||this.setElapsedTimeUniform(t.program)}}export{a as WaterGLMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{AnimationTimer as e}from"../lib/AnimationTimer.js";import{outputFromPass as t}from"../lib/GLMaterials.js";import{Material as i}from"../lib/Material.js";import{OITPolygonOffsetLimit as r}from"../lib/OrderIndependentTransparency.js";import{WaterGLMaterial as a}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as n}from"./WaterTechnique.js";import{DefaultBufferWriter as s,PositionUVLayout as o}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as h}from"./internal/MaterialUtil.js";import{defaultWaterMaterialParameters as u}from"./internal/waterMaterialUtils.js";class c extends i{constructor(t){super(t,u),this._techniqueConfig=new n,this.animation=new e}getTechniqueConfig(e,t){return this._techniqueConfig.output=e,this._techniqueConfig.writeDepth=this.params.writeDepth,this._techniqueConfig.receiveShadows=this.params.receiveShadows,this._techniqueConfig.slicePlaneEnabled=this.params.slicePlaneEnabled,this._techniqueConfig.transparent=this.params.transparent,this._techniqueConfig.useSSR=this.params.ssrEnabled,this._techniqueConfig.isDraped=this.params.isDraped,this._techniqueConfig.transparencyPassType=t.transparencyPassType,this._techniqueConfig.enableOffset=t.camera.relativeElevation<r,this._techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this._techniqueConfig.cullAboveGround=t.cullAboveGround,this._techniqueConfig}update(e){const t=Math.min(e.camera.relativeElevation,e.camera.distance);this.animation.enabled=Math.sqrt(this.params.waveTextureRepeat/this.params.waveStrength)*t<p;const i=this.animation.advance(e);return this.animation.enabled&&i}intersect(e,t,i,r,a,n,s){h(e,t,r,a,n,void 0,s)}requiresSlot(e,i){switch(t(i)){case 2:return 21===e;case 0:if(this.params.isDraped)return 20===e;break;case 4:return 2===e||20===e}let r=2;return this.params.transparent&&(r=this.params.writeDepth?4:7),e===r}createGLMaterial(e){if(0===e.output&&this.params.isDraped)return e.output=5,new a(e);switch(e.output){case 0:case 2:case 4:case 7:return new a(e)}return null}createBufferWriter(){return new s(o)}}const p=35e3;export{c as WaterMaterial};
5
+ import{AnimationTimer as e}from"../lib/AnimationTimer.js";import{outputFromPass as t}from"../lib/GLMaterials.js";import{Material as r}from"../lib/Material.js";import{OITPolygonOffsetLimit as i}from"../lib/OrderIndependentTransparency.js";import{WaterGLMaterial as a}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as n}from"./WaterTechnique.js";import{DefaultBufferWriter as s,PositionUVLayout as o}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as h}from"./internal/MaterialUtil.js";import{defaultWaterMaterialParameters as u}from"./internal/waterMaterialUtils.js";class c extends r{constructor(t){super(t,u),this._techniqueConfig=new n,this.animation=new e}getTechniqueConfig(e,t){return this._techniqueConfig.output=e,this._techniqueConfig.writeDepth=this.parameters.writeDepth,this._techniqueConfig.receiveShadows=this.parameters.receiveShadows,this._techniqueConfig.slicePlaneEnabled=this.parameters.slicePlaneEnabled,this._techniqueConfig.transparent=this.parameters.transparent,this._techniqueConfig.useSSR=this.parameters.ssrEnabled,this._techniqueConfig.isDraped=this.parameters.isDraped,this._techniqueConfig.transparencyPassType=t.transparencyPassType,this._techniqueConfig.enableOffset=t.camera.relativeElevation<i,this._techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this._techniqueConfig.cullAboveGround=t.cullAboveGround,this._techniqueConfig}update(e){const t=Math.min(e.camera.relativeElevation,e.camera.distance);this.animation.enabled=Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*t<p;const r=this.animation.advance(e);return this.animation.enabled&&r}intersect(e,t,r,i,a,n,s){h(e,t,i,a,n,void 0,s)}requiresSlot(e,r){switch(t(r)){case 2:return 21===e;case 0:if(this.parameters.isDraped)return 20===e;break;case 4:return 2===e||20===e}let i=2;return this.parameters.transparent&&(i=this.parameters.writeDepth?4:7),e===i}createGLMaterial(e){if(0===e.output&&this.parameters.isDraped)return e.output=5,new a(e);switch(e.output){case 0:case 2:case 4:case 7:return new a(e)}return null}createBufferWriter(){return new s(o)}}const p=35e3;export{c 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.22/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as o,applySome as t}from"../../../../core/maybe.js";const d={dash:[4,3],dot:[1,3],"long-dash":[8,3],"short-dash":[4,1],"short-dot":[1,1]},s={dash:d.dash,"dash-dot":[...d.dash,...d.dot],dot:d.dot,"long-dash":d["long-dash"],"long-dash-dot":[...d["long-dash"],...d.dot],"long-dash-dot-dot":[...d["long-dash"],...d.dot,...d.dot],none:null,"short-dash":d["short-dash"],"short-dash-dot":[...d["short-dash"],...d["short-dot"]],"short-dash-dot-dot":[...d["short-dash"],...d["short-dot"],...d["short-dot"]],"short-dot":d["short-dot"],solid:null},h=8;function r(t,d=2){return o(t)?t:{pattern:t.slice(),pixelRatio:d}}function a(o,t=2){return{pattern:[o,o],pixelRatio:t}}function n(o){return t(o,(o=>r(s[o],h)))}export{r as createStipplePattern,a as createStipplePatternSimple,n as getStipplePatternForLinePattern};
5
+ import{isNone as o,isSome as t}from"../../../../core/maybe.js";const d={dash:[4,3],dot:[1,3],"long-dash":[8,3],"short-dash":[4,1],"short-dot":[1,1]},s={dash:d.dash,"dash-dot":[...d.dash,...d.dot],dot:d.dot,"long-dash":d["long-dash"],"long-dash-dot":[...d["long-dash"],...d.dot],"long-dash-dot-dot":[...d["long-dash"],...d.dot,...d.dot],none:null,"short-dash":d["short-dash"],"short-dash-dot":[...d["short-dash"],...d["short-dot"]],"short-dash-dot-dot":[...d["short-dash"],...d["short-dot"],...d["short-dot"]],"short-dot":d["short-dot"],solid:null},h=8;function r(t,d=2){return o(t)?t:{pattern:t.slice(),pixelRatio:d}}function a(o,t=2){return{pattern:[o,o],pixelRatio:t}}function n(o){return t(o)&&"style"===o.type?r(s[o.style],h):null}export{r as createStipplePattern,a as createStipplePatternSimple,n as getStipplePatternForLinePattern};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{someMap as e}from"../../../../../core/MapUtils.js";import{isSome as t,isNone as s}from"../../../../../core/maybe.js";import r from"../../../../../core/PooledArray.js";import{m as i,b as a,a as o}from"../../../../../chunks/mat4.js";import{c as n}from"../../../../../chunks/mat4f64.js";import{glLayout as d}from"../../../support/buffer/glUtil.js";import{GLMaterials as h}from"../../lib/GLMaterials.js";import{assert as f,setMatrixTranslation3 as m}from"../../lib/Util.js";import{WaterMaterial as l}from"../WaterMaterial.js";import{sortInstancesByRange as c,BufferRange as u,Instance as g,addOrMerge as b}from"./Instance.js";import{MergedGeometryBuffer as p}from"./MergedGeometryBuffer.js";import{MergedGeometryBufferPool as w}from"./MergedGeometryBufferPool.js";import{calculateTransformRelativeToOrigin as y}from"./utils.js";class _{constructor(e,t,s){this._rctx=e,this._materialRepository=t,this._material=s,this.type="MergedRenderer",this._dataByOrigin=new Map,this._renderCommandData=new r,this._hasHighlights=!1,this._hasOccludees=!1,this._glMaterials=new h(this._material,this._materialRepository),this._bufferWriter=s.createBufferWriter(),this._bufferPool=new w(e,s.vertexAttributeLocations,d(this._bufferWriter.vertexBufferLayout))}dispose(){this._glMaterials.destroy(),this._dataByOrigin.forEach((e=>e.buffer.dispose())),this._dataByOrigin.clear(),this._bufferPool.dispose()}get isEmpty(){return 0===this._dataByOrigin.size}get hasHighlights(){return this._hasHighlights}get hasOccludees(){return this._hasOccludees}get hasWater(){return!this.isEmpty&&this._material instanceof l}get rendersOccluded(){return!this.isEmpty&&1!==this._material.renderOccluded}modify(e){this.updateGeometries(e.updates),this.addAndRemoveGeometries(e.adds,e.removes),this.updateRenderCommands()}addAndRemoveGeometries(e,t){const s=this._bufferWriter,r=s.vertexBufferLayout.stride/4,i=this._dataByOrigin,a=v(e,t);a.forEach(((e,t)=>{a.delete(t);const o=e.toAdd.reduce(((e,t)=>e+s.elementCount(t.data)),0);let n=i.get(t);if(null==n)f(0===e.toRemove.length),n=new A(e.origin,new p(this._bufferPool,o*r)),i.set(t,n);else if(0===e.toAdd.length&&n.instances.size===e.toRemove.length)return n.buffer.dispose(),void i.delete(t);let d=0;n.instances.forEach((e=>d+=e.to-e.from));const h=e.toRemove.reduce(((e,t)=>e+s.elementCount(t.data)),0),l=n.buffer.size,c=(d+o-h)*r,u=P;if(c<l/2?this.removeAndRebuild(n,e.toRemove,r,c,u):e.toRemove.length>0&&this.remove(n,e.toRemove,r,u),e.toAdd.length>0){const t=M;m(t,-e.origin[0],-e.origin[1],-e.origin[2]),this.add(n,e.toAdd,r,t,u)}const g=n.buffer.vao.vertexBuffers.geometry;R(u),u.forAll((({from:e,to:t})=>{if(e<t){const s=n.buffer.array,r=4,i=e*r,a=t*r;g.setSubData(s,i,i,a)}})),u.clear(),n.drawCommandsDirty=!0}))}updateGeometries(e){const t=this._bufferWriter,s=t.vertexBufferLayout.stride/4;for(const r of e){const e=r.renderGeometry,i=this._dataByOrigin.get(e.origin.id),a=i&&i.instances.get(e.id);if(!a)return;const o=r.updateType;if(1&o&&(a.isVisible=e.instanceParameters.visible),9&o){const t=e.instanceParameters.visible;a.hasHighlights=!!e.instanceParameters.highlights&&t}if(16&o&&(a.hasOccludees=!!e.instanceParameters.occludees),6&o){const{array:r,vao:o}=i.buffer;y(e,j,x),t.write({transformation:j,invTranspTransformation:x},e.data,t.vertexBufferLayout.createView(r.buffer),a.from),f(a.from+t.elementCount(e.data)===a.to,"material VBO layout has changed"),o.vertexBuffers.geometry.setSubData(r,a.from*s*4,a.from*s*4,a.to*s*4)}i.drawCommandsDirty=!0}}updateRenderCommands(){this._hasHighlights=!1,this._hasOccludees=!1,this._dataByOrigin.forEach((t=>{t.hasHiddenInstances=!1,t.hasHighlights=!1,t.hasOccludees=!1,e(t.instances,(e=>(e.isVisible?(e.hasHighlights&&(this._hasHighlights=!0,t.hasHighlights=!0),e.hasOccludees&&(this._hasOccludees=!0,t.hasOccludees=!0)):t.hasHiddenInstances=!0,t.hasHiddenInstances&&t.hasHighlights&&t.hasOccludees)))}));const t=e=>{if(e.drawCommandsDefault=null,e.drawCommandsHighlight=null,e.drawCommandsOccludees=null,e.drawCommandsShadowHighlightRest=null,0===e.instances.size)return;if(!H(e)){const t=this._bufferWriter.vertexBufferLayout.stride,s=4*e.buffer.size/t;return void(e.drawCommandsDefault=[{first:0,count:s}])}const t=c(e.instances);e.drawCommandsDefault=[],e.drawCommandsHighlight=[],e.drawCommandsOccludees=[],e.drawCommandsShadowHighlightRest=[];for(const s of t)s.isVisible&&(s.hasOccludees?b(e.drawCommandsOccludees,s):b(e.drawCommandsDefault,s),s.hasHighlights?b(e.drawCommandsHighlight,s):b(e.drawCommandsShadowHighlightRest,s))};this._dataByOrigin.forEach((e=>{e.drawCommandsDirty&&(t(e),e.drawCommandsDirty=!1)}))}updateLogic(e){return this._material.update(e)}render(e,r,i){if(null!=e&&!this._material.requiresSlot(e,r))return!1;const a=5===r||7===r;if(a&&!this._hasHighlights)return!1;const o=6===r,n=!(a||o);if(this._dataByOrigin.forEach((e=>{if(a&&!e.hasHighlights)return;const s=(a?e.drawCommandsHighlight:o&&H(e)?e.drawCommandsShadowHighlightRest:e.drawCommandsDefault)||null,r=n&&e.drawCommandsOccludees||null;(t(s)||t(r))&&this._renderCommandData.push(new D(e.origin,e.buffer,s,r))})),0===this._renderCommandData.length)return!1;const d=this._rctx,h=this._glMaterials.get(r);if(s(h)||2!==h.ensureResources(d))return this._renderCommandData.clear(),!1;const f=h.beginSlot(i);return f.bindPipelineState(d,e,!1),d.useProgram(f.program),h.bind(i,f),this._renderCommandData.forAll((({origin:s,buffer:r,renderCommands:a,occludeeCommands:o})=>{i.origin=s,f.bindDraw(i),f.ensureAttributeLocations(r.vao),d.bindVAO(r.vao);const n=f.primitiveType;t(a)&&this.renderCommands(d,n,a),t(o)&&(f.bindPipelineState(d,e,!0),this.renderCommands(d,n,o),f.bindPipelineState(d,e,!1))})),this._renderCommandData.clear(),!0}renderCommands(e,t,s){for(let r=0;r<s.length;r++)e.drawArrays(t,s[r].first,s[r].count)}removeAndRebuild(e,t,s,r,i){for(const h of t)e.instances.delete(h.id);const a=c(e.instances);e.instances.clear();const o=e.buffer.size,n=e.buffer.alloc(r);let d=0;for(const h of a){const t=h.from*s,r=h.to*s;n.copy(d,t,r),h.from=d/s,d+=r-t,h.to=d/s,e.instances.set(h.id,h)}i.push(new u(0,n.hasNewBuffer?e.buffer.array.length:o)),n.dispose(),e.buffer.erase(d,i.back().to),e.holes.clear()}remove(e,t,s,r){for(const i of t){const t=i.id,a=e.instances.get(t),o=a.from*s,n=a.to*s;e.buffer.erase(o,n),e.holes.push(new u(a.from,a.to)),e.instances.delete(t),r.push(new u(o,n))}R(e.holes)}add(e,r,n,d,h){const m=this._bufferWriter;let l=m.vertexBufferLayout.createView(e.buffer.array.buffer);for(const c of r){const r=t(c.transformation)?i(j,d,c.transformation):d;a(x,r);const b=o(x,x),p=m.elementCount(c.data),w=p*n;let y=B(e.holes,p);s(y)&&(y=e.buffer.size/n,e.buffer.grow(w),l=m.vertexBufferLayout.createView(e.buffer.array.buffer)),m.write({transformation:r,invTranspTransformation:b},c.data,l,y);const _=c.instanceParameters.visible,C=!!c.instanceParameters.highlights&&_,v=!!c.instanceParameters.occludees,O=new g(c.id,y,y+p,_,C,v);f(null==e.instances.get(c.id)),e.instances.set(c.id,O),h.push(new u(O.from*n,O.to*n))}}get test(){return{material:this._material,glMaterials:this._glMaterials}}}class C{constructor(e){this.origin=e,this.toAdd=new Array,this.toRemove=new Array}}function v(e,t){const s=new Map;for(const r of e)O(s,r,!0);for(const r of t)O(s,r,!1);return s}function O(e,t,r){const i=t.origin;if(s(i))return;let a=e.get(i.id);null==a&&(a=new C(i.vec3),e.set(i.id,a)),r?a.toAdd.push(t):a.toRemove.push(t)}function H(e){return e.hasOccludees||e.hasHighlights||e.hasHiddenInstances}function B(e,t){let s;if(!e.some((e=>!(e.to-e.from<t)&&(s=e,!0))))return null;const r=s.from;return s.from+=t,s.from>=s.to&&e.removeUnordered(s),r}function R(e){const t=new Map;e.forAll((e=>t.set(e.from,e)));let s=!0;for(;s;)s=!1,e.forEach((r=>{const i=t.get(r.to);i&&(r.to=i.to,t.delete(i.from),e.removeUnordered(i),s=!0)}))}class A{constructor(e,t){this.origin=e,this.buffer=t,this.instances=new Map,this.holes=new r({deallocator:null}),this.hasHiddenInstances=!1,this.hasHighlights=!1,this.hasOccludees=!1,this.drawCommandsDirty=!1}}class D{constructor(e,t,s,r){this.origin=e,this.buffer=t,this.renderCommands=s,this.occludeeCommands=r}}const P=new r({deallocator:null}),M=n(),j=n(),x=n();export{_ as MergedRenderer};
5
+ import{someMap as e}from"../../../../../core/MapUtils.js";import{isSome as t,isNone as s}from"../../../../../core/maybe.js";import r from"../../../../../core/PooledArray.js";import{m as i,b as a,a as o}from"../../../../../chunks/mat4.js";import{c as n}from"../../../../../chunks/mat4f64.js";import{glLayout as d}from"../../../support/buffer/glUtil.js";import{GLMaterials as h}from"../../lib/GLMaterials.js";import{assert as f,setMatrixTranslation3 as l}from"../../lib/Util.js";import{WaterMaterial as m}from"../WaterMaterial.js";import{sortInstancesByRange as c,BufferRange as u,Instance as g,addOrMerge as b}from"./Instance.js";import{MergedGeometryBuffer as p}from"./MergedGeometryBuffer.js";import{MergedGeometryBufferPool as w}from"./MergedGeometryBufferPool.js";import{calculateTransformRelativeToOrigin as y}from"./utils.js";class _{constructor(e,t,s){this._rctx=e,this._materialRepository=t,this._material=s,this.type="MergedRenderer",this._dataByOrigin=new Map,this._renderCommandData=new r,this._hasHighlights=!1,this._hasOccludees=!1,this._glMaterials=new h(this._material,this._materialRepository),this._bufferWriter=s.createBufferWriter(),this._bufferPool=new w(e,s.vertexAttributeLocations,d(this._bufferWriter.vertexBufferLayout))}dispose(){this._glMaterials.destroy(),this._dataByOrigin.forEach((e=>e.buffer.dispose())),this._dataByOrigin.clear(),this._bufferPool.dispose()}get isEmpty(){return 0===this._dataByOrigin.size}get hasHighlights(){return this._hasHighlights}get hasOccludees(){return this._hasOccludees}get hasWater(){return!this.isEmpty&&this._material instanceof m}get rendersOccluded(){return!this.isEmpty&&1!==this._material.renderOccluded}modify(e){this.updateGeometries(e.updates),this.addAndRemoveGeometries(e.adds,e.removes),this.updateRenderCommands()}addAndRemoveGeometries(e,t){const s=this._bufferWriter,r=s.vertexBufferLayout.stride/4,i=this._dataByOrigin,a=v(e,t);a.forEach(((e,t)=>{a.delete(t);const o=e.toAdd.reduce(((e,t)=>e+s.elementCount(t.data)),0);let n=i.get(t);if(null==n)f(0===e.toRemove.length),n=new A(e.origin,new p(this._bufferPool,o*r)),i.set(t,n);else if(0===e.toAdd.length&&n.instances.size===e.toRemove.length)return n.buffer.dispose(),void i.delete(t);let d=0;n.instances.forEach((e=>d+=e.to-e.from));const h=e.toRemove.reduce(((e,t)=>e+s.elementCount(t.data)),0),m=n.buffer.size,c=(d+o-h)*r,u=P;if(c<m/2?this.removeAndRebuild(n,e.toRemove,r,c,u):e.toRemove.length>0&&this.remove(n,e.toRemove,r,u),e.toAdd.length>0){const t=M;l(t,-e.origin[0],-e.origin[1],-e.origin[2]),this.add(n,e.toAdd,r,t,u)}const g=n.buffer.vao.vertexBuffers.geometry;R(u),u.forAll((({from:e,to:t})=>{if(e<t){const s=n.buffer.array,r=4,i=e*r,a=t*r;g.setSubData(s,i,i,a)}})),u.clear(),n.drawCommandsDirty=!0}))}updateGeometries(e){const t=this._bufferWriter,s=t.vertexBufferLayout.stride/4;for(const r of e){const e=r.renderGeometry,i=this._dataByOrigin.get(e.origin.id),a=i&&i.instances.get(e.id);if(!a)return;const o=r.updateType;if(1&o&&(a.isVisible=e.instanceParameters.visible),9&o){const t=e.instanceParameters.visible;a.hasHighlights=!!e.instanceParameters.highlights&&t}if(16&o&&(a.hasOccludees=!!e.instanceParameters.occludees),6&o){const{array:r,vao:o}=i.buffer;y(e,j,x),t.write({transformation:j,invTranspTransformation:x},e.data,t.vertexBufferLayout.createView(r.buffer),a.from),f(a.from+t.elementCount(e.data)===a.to,"material VBO layout has changed"),o.vertexBuffers.geometry.setSubData(r,a.from*s*4,a.from*s*4,a.to*s*4)}i.drawCommandsDirty=!0}}updateRenderCommands(){this._hasHighlights=!1,this._hasOccludees=!1,this._dataByOrigin.forEach((t=>{t.hasHiddenInstances=!1,t.hasHighlights=!1,t.hasOccludees=!1,e(t.instances,(e=>(e.isVisible?(e.hasHighlights&&(this._hasHighlights=!0,t.hasHighlights=!0),e.hasOccludees&&(this._hasOccludees=!0,t.hasOccludees=!0)):t.hasHiddenInstances=!0,t.hasHiddenInstances&&t.hasHighlights&&t.hasOccludees)))}));const t=e=>{if(e.drawCommandsDefault=null,e.drawCommandsHighlight=null,e.drawCommandsOccludees=null,e.drawCommandsShadowHighlightRest=null,0===e.instances.size)return;if(!H(e)){const t=this._bufferWriter.vertexBufferLayout.stride,s=4*e.buffer.size/t;return void(e.drawCommandsDefault=[{first:0,count:s}])}const t=c(e.instances);e.drawCommandsDefault=[],e.drawCommandsHighlight=[],e.drawCommandsOccludees=[],e.drawCommandsShadowHighlightRest=[];for(const s of t)s.isVisible&&(s.hasOccludees?b(e.drawCommandsOccludees,s):b(e.drawCommandsDefault,s),s.hasHighlights?b(e.drawCommandsHighlight,s):b(e.drawCommandsShadowHighlightRest,s))};this._dataByOrigin.forEach((e=>{e.drawCommandsDirty&&(t(e),e.drawCommandsDirty=!1)}))}updateLogic(e){return this._material.update(e)}render(e,r,i){if(null!=e&&!this._material.requiresSlot(e,r))return!1;const a=5===r||7===r;if(a&&!this._hasHighlights)return!1;const o=6===r,n=!(a||o);if(this._dataByOrigin.forEach((e=>{if(a&&!e.hasHighlights)return;const s=(a?e.drawCommandsHighlight:o&&H(e)?e.drawCommandsShadowHighlightRest:e.drawCommandsDefault)||null,r=n&&e.drawCommandsOccludees||null;(t(s)||t(r))&&this._renderCommandData.push(new D(e.origin,e.buffer,s,r))})),0===this._renderCommandData.length)return!1;const d=this._rctx,h=this._glMaterials.load(d,r);if(s(h))return this._renderCommandData.clear(),!1;const f=h.beginSlot(i);return f.bindPipelineState(d,e,!1),d.useProgram(f.program),h.bind(i,f),this._renderCommandData.forAll((({origin:s,buffer:r,renderCommands:a,occludeeCommands:o})=>{i.origin=s,f.bindDraw(i),f.ensureAttributeLocations(r.vao),d.bindVAO(r.vao);const n=f.primitiveType;t(a)&&this.renderCommands(d,n,a),t(o)&&(f.bindPipelineState(d,e,!0),this.renderCommands(d,n,o),f.bindPipelineState(d,e,!1))})),this._renderCommandData.clear(),!0}renderCommands(e,t,s){for(let r=0;r<s.length;r++)e.drawArrays(t,s[r].first,s[r].count)}removeAndRebuild(e,t,s,r,i){for(const h of t)e.instances.delete(h.id);const a=c(e.instances);e.instances.clear();const o=e.buffer.size,n=e.buffer.alloc(r);let d=0;for(const h of a){const t=h.from*s,r=h.to*s;n.copy(d,t,r),h.from=d/s,d+=r-t,h.to=d/s,e.instances.set(h.id,h)}i.push(new u(0,n.hasNewBuffer?e.buffer.array.length:o)),n.dispose(),e.buffer.erase(d,i.back().to),e.holes.clear()}remove(e,t,s,r){for(const i of t){const t=i.id,a=e.instances.get(t),o=a.from*s,n=a.to*s;e.buffer.erase(o,n),e.holes.push(new u(a.from,a.to)),e.instances.delete(t),r.push(new u(o,n))}R(e.holes)}add(e,r,n,d,h){const l=this._bufferWriter;let m=l.vertexBufferLayout.createView(e.buffer.array.buffer);for(const c of r){const r=t(c.transformation)?i(j,d,c.transformation):d;a(x,r);const b=o(x,x),p=l.elementCount(c.data),w=p*n;let y=B(e.holes,p);s(y)&&(y=e.buffer.size/n,e.buffer.grow(w),m=l.vertexBufferLayout.createView(e.buffer.array.buffer)),l.write({transformation:r,invTranspTransformation:b},c.data,m,y);const _=c.instanceParameters.visible,C=!!c.instanceParameters.highlights&&_,v=!!c.instanceParameters.occludees,O=new g(c.id,y,y+p,_,C,v);f(null==e.instances.get(c.id)),e.instances.set(c.id,O),h.push(new u(O.from*n,O.to*n))}}get test(){return{material:this._material,glMaterials:this._glMaterials}}}class C{constructor(e){this.origin=e,this.toAdd=new Array,this.toRemove=new Array}}function v(e,t){const s=new Map;for(const r of e)O(s,r,!0);for(const r of t)O(s,r,!1);return s}function O(e,t,r){const i=t.origin;if(s(i))return;let a=e.get(i.id);null==a&&(a=new C(i.vec3),e.set(i.id,a)),r?a.toAdd.push(t):a.toRemove.push(t)}function H(e){return e.hasOccludees||e.hasHighlights||e.hasHiddenInstances}function B(e,t){let s;if(!e.some((e=>!(e.to-e.from<t)&&(s=e,!0))))return null;const r=s.from;return s.from+=t,s.from>=s.to&&e.removeUnordered(s),r}function R(e){const t=new Map;e.forAll((e=>t.set(e.from,e)));let s=!0;for(;s;)s=!1,e.forEach((r=>{const i=t.get(r.to);i&&(r.to=i.to,t.delete(i.from),e.removeUnordered(i),s=!0)}))}class A{constructor(e,t){this.origin=e,this.buffer=t,this.instances=new Map,this.holes=new r({deallocator:null}),this.hasHiddenInstances=!1,this.hasHighlights=!1,this.hasOccludees=!1,this.drawCommandsDirty=!1}}class D{constructor(e,t,s,r){this.origin=e,this.buffer=t,this.renderCommands=s,this.occludeeCommands=r}}const P=new r({deallocator:null}),M=n(),j=n(),x=n();export{_ as MergedRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{GridLocalOriginFactory as n}from"../lib/GridLocalOriginFactory.js";import i from"../lib/ModelDirtySet.js";import{RenderGeometry as s}from"../lib/RenderGeometry.js";import{assert as a}from"../lib/Util.js";import{isWebGLLayer as c}from"../lib/WebGLLayer.js";let d=class extends e{constructor(){super(...arguments),this.dirtySet=new i({model:this}),this._content=new Map,this._originFactory=new n(null,75e4)}getObject(t){return this._content.get(t)}add(t){const e=t.id;a(!this._content.has(e),"Model/Stage already contains object to be added"),this._content.set(e,t),c(t)&&this.dirtySet.layerAdded(t)}remove(t){a(this._content.has(t.id),"Model/Stage doesn't contain object to be removed"),this._content.delete(t.id),t.unload(),c(t)&&this.dirtySet.layerRemoved(t)}addMany(t){for(const e of t)a(!this._content.has(e.id),"Model/Stage already contains object to be added"),this._content.set(e.id,e)}removeMany(t){for(const e of t)a(this._content.has(e.id),"Model/Stage doesn't contain object to be removed"),this._content.delete(e.id),e.unload()}forEachOfType(t,e){this._content.forEach((o=>{o.type===t&&e(o)}))}getRenderGeometry(t,e){const{geometry:o,material:r,id:n,shaderTransformation:i,origin:a,instanceParameters:c}=e,d=new s(o,r,null,null,n,o.boundingInfo,i,t.castShadow);return d.updateTransformation((o=>t.getCombinedStaticTransformation(e,o))),d.origin=a||this._originFactory.getOrigin(d.boundingSphere),d.instanceParameters=c,d}updateRenderGeometryTransformation(t,e,o){o.updateTransformation((o=>t.getCombinedStaticTransformation(e,o)));const r=this._originFactory.getOrigin(o.boundingSphere);return o.origin!==r}getStats(){const t={},e=Array.from(this._content.values());for(let o=0;o<5;++o)t[o]=e.filter((t=>t.type===o)).length;return{contentTypes:t,dirtySet:this.dirtySet.formatDebugInfo()}}get test(){return{content:Array.from(this._content.values())}}};t([o({constructOnly:!0})],d.prototype,"dirtySet",void 0),d=t([r("esri.views.3d.webgl-engine.parts.Model")],d);export{d as Model};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import{isSome as o,isNone as r}from"../../../../core/maybe.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{GridLocalOriginFactory as s}from"../lib/GridLocalOriginFactory.js";import a from"../lib/ModelDirtySet.js";import{RenderGeometry as c}from"../lib/RenderGeometry.js";import{assert as d}from"../lib/Util.js";import{isWebGLLayer as m}from"../lib/WebGLLayer.js";let l=class extends e{constructor(){super(...arguments),this.dirtySet=new a({model:this}),this._content=new Map,this._originFactory=new s(null,75e4)}getObject(t){return this._content.get(t)}add(t){const e=t.id;d(!this._content.has(e),"Model/Stage already contains object to be added"),this._content.set(e,t),m(t)&&this.dirtySet.layerAdded(t)}remove(t){d(this._content.has(t.id),"Model/Stage doesn't contain object to be removed"),this._content.delete(t.id),t.unload(),m(t)&&this.dirtySet.layerRemoved(t)}addMany(t){for(const e of t)o(e)&&(d(!this._content.has(e.id),"Model/Stage already contains object to be added"),this._content.set(e.id,e))}removeMany(t){for(const e of t)d(this._content.has(e.id),"Model/Stage doesn't contain object to be removed"),this._content.delete(e.id),e.unload()}forEachOfType(t,e){this._content.forEach((o=>{o.type===t&&e(o)}))}getRenderGeometry(t,e){const{geometry:o,material:r,id:n,shaderTransformation:i,origin:s,instanceParameters:a}=e,d=new c(o,r,null,null,n,o.boundingInfo,i,t.castShadow);return d.updateTransformation((o=>t.getCombinedStaticTransformation(e,o))),d.origin=s||this._originFactory.getOrigin(d.boundingSphere),d.instanceParameters=a,d}updateRenderGeometryTransformation(t,e,o){if(r(t))return!1;o.updateTransformation((o=>t.getCombinedStaticTransformation(e,o)));const n=this._originFactory.getOrigin(o.boundingSphere);return o.origin!==n}getStats(){const t={},e=Array.from(this._content.values());for(let o=0;o<5;++o)t[o]=e.filter((t=>t.type===o)).length;return{contentTypes:t,dirtySet:this.dirtySet.formatDebugInfo()}}get test(){return{content:Array.from(this._content.values())}}};t([n({constructOnly:!0})],l.prototype,"dirtySet",void 0),l=t([i("esri.views.3d.webgl-engine.parts.Model")],l);export{l as Model};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import i from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as o,isNone as n,isSome as a}from"../../../../core/maybe.js";import{addFrameTask as d}from"../../../../core/scheduling.js";import{Milliseconds as p}from"../../../../core/time.js";import{init as h}from"../../../../core/watchUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{DESIRED_ANIMATION_MS as m}from"../../support/animationUtils.js";import{ComponentObjectCollection as u}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueRepository as _}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{autoDispose as g,AutoDisposableMixin as f}from"../lib/AutoDisposable.js";import y from"../lib/CompositingHelper.js";import{textureToDepth as R}from"../lib/depthRangeUtils.js";import{GLMaterialRepository as x}from"../lib/GLMaterialRepository.js";import{MagnifierHelper as v}from"../lib/MagnifierHelper.js";import{Renderer as b}from"../lib/Renderer.js";import{RenderingContext as w}from"../lib/RenderingContext.js";import{TextureRepository as j}from"../lib/TextureRepository.js";import{StippleTextureRepository as U}from"../materials/StippleTextureRepository.js";import{WaterTextureRepository as T}from"../materials/internal/WaterTextureRepository.js";import{removeLoadedShaderModules as C}from"./requireUtils.js";import{ScreenshotManager as S}from"./ScreenshotManager.js";import{createContextOrErrorHTML as M,createContext as A}from"../../../webgl/context-util.js";const L=s.getLogger("esri.views.3d.webgl-engine.parts.View");let H=class extends(f(t)){constructor(e){super({}),this.events=new r,this.waterTextureRepository=new T,this._magnifierHelper=new v,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._logicUpdateLast=0,this._container=e.container,this._initializeContext(e),h(this.waterTextureRepository,"loadingState",(()=>this.setNeedsRender())),this._magnifierHelper.events.on("request-render",(()=>this.setNeedsRender())),this._stippleTextureRepository=new U(this._rctx),this._shaderTechniqueRepository=new _({rctx:this._rctx,viewingMode:e.viewingMode,stippleTextureRepository:this._stippleTextureRepository,waterTextureRepository:this.waterTextureRepository}),this._textureRepository=new j(e,this._shaderTechniqueRepository,this._rctx),this._textureRepository.events.on("changed",(e=>this.setNeedsRender(e))),this._materialRepository=new x(this._textureRepository,this._shaderTechniqueRepository,(()=>this.setNeedsRender())),this._compositingHelper=new y(this._rctx,this._shaderTechniqueRepository),this._renderer=new b(this._materialRepository,this._textureRepository,this._shaderTechniqueRepository,this._rctx,this._compositingHelper,this._magnifierHelper,((e=1)=>this.setNeedsRender(e)),((t,r)=>e.schedule(t,r)),e),this._screenshotManager=new S(this._rctx,((e,t,r)=>this._renderer.render(e,t,t,r)),(e=>this.setNeedsRender(e)),e.options.screenshot.renderOverlay,(e=>this.events.emit("force-camera-for-screenshot",e))),this._registerFrameTask(e)}normalizeCtorArgs(){return{}}dispose(){this._container.contains(this._canvas)&&this._container.removeChild(this._canvas),this._frameTask=o(this._frameTask),this._shaderTechniqueRepository.dispose(),this._shaderTechniqueRepository=null,super.dispose(),this._tmpDepthBuffer=null,this._rctx=null}get performanceInfo(){const e=this._rctx.gl;return{renderer:this._renderer.performanceInfo,textureMemory:void 0!==e.getUsedTextureMemory?e.getUsedTextureMemory():void 0,renderbufferMemory:void 0!==e.getUsedRenderbufferMemory?e.getUsedRenderbufferMemory():void 0,VBOMemory:void 0!==e.getUsedVBOMemory?e.getUsedVBOMemory():void 0}}setNeedsRender(e=1){1===e?this._needsUpdate||(this._needsUpdate=!0,this.notifyChange("updating")):this._needsRender=!0}get needsUpdate(){return this._needsUpdate}get updating(){return this.evaluateUpdating()}evaluateUpdating(){return this.needsUpdate||this._needsWaterReflectionUpdate||this._renderer.updating||this._textureRepository.updating||this.waterTextureRepository.updating||this._magnifierHelper.updating}ensureEdgeView(){return this._renderer.ensureEdgeView()}get edgeView(){return this._renderer.edgeView}get textureRepository(){return this._textureRepository}get compositingHelper(){return this._compositingHelper}set magnifier(e){this._magnifierHelper.magnifier=e}updateLightSources(e,t,r){this._renderer.updateLightSources(e,t,r),this.setNeedsRender()}setRenderParameters(e){void 0!==e.idleSuspend&&this._idleSuspend!==!!e.idleSuspend&&(this._idleSuspend=!!e.idleSuspend,this.setNeedsRender()),this._renderer.setRenderParameters(e)}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}modify(e){this._renderer.modify(e),e.clear()}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e)}get hasShadowsEnabled(){return this._renderer.hasShadowsEnabled}readAccumulatedShadow(e){return this._renderer.readAccumulatedShadow(e[0],e[1])}getMinimalDepthForArea(e,t,r,i,s=i){const o=r.constrainWindowSize(e,t,i*r.pixelRatio,s*r.pixelRatio),n=this._ensureDepthBuffer(o);this._renderer.readDepthPixels(r,o[0],o[1],o[2],o[3],n);let a=Number.MAX_VALUE;for(let d=0;d<o[2]*o[3];d++){const e=R(4*d,n,r.nearFar);a>e&&e!==r.nearFar[0]&&e!==r.nearFar[1]&&(a=e)}return a===Number.MAX_VALUE?void 0:a}_ensureDepthBuffer(e){const t=4*e[2]*e[3];return(n(this._tmpDepthBuffer)||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}get renderPlugins(){return this._renderer.renderPlugins}get test(){return{renderer:this._renderer}}get gpuMemoryUsage(){return this._renderer.gpuMemoryUsage}async hotReloadShaders(){C(),await this._shaderTechniqueRepository.hotReload(),this.setNeedsRender()}_registerFrameTask(e){const t=e.state,r={viewCamera:t.camera,frameHasDecorations:!1};let i=!1;const s={preRender:r=>{i=this.evaluateUpdating(),e.processSyncLayers();const s=p(r.time-this._logicUpdateLast);if(s>m||a(this.forcedAnimationTime)){const e={camera:t.camera,dt:s,forcedTime:this.forcedAnimationTime};this._logicUpdateLast=r.time,this._renderer.updateLogic(e)&&this.setNeedsRender(0)}},render:()=>{if((this.needsUpdate||this._needsRender||!this._idleSuspend||!this._renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this._renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this._renderer.render(null,t.camera,t.contentCamera,1),e&&this._renderer.hasWaterReflection&&(this.setNeedsRender(0),this._needsWaterReflectionUpdate=!0)}},postRender:()=>{i===this.updating&&i===this.evaluateUpdating()||this.notifyChange("updating")},update:()=>{r.viewCamera=t.camera,r.frameHasDecorations=this._renderer.hasSlicePlane||this._magnifierHelper.enabled,this._textureRepository.update(),this._screenshotManager.update(r)}};this._frameTask=d(s)}_initializeContext(e){const t=e.options;this._canvas=t.canvas,this._canvas||(this._canvas=document.createElement("canvas")),this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");const r={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:null==t.stencil||t.stencil,powerPreference:"high-performance"};let s;const o=i("esri-force-webgl");if(1===o||2===o?s=M(this._canvas,o,r):(s=A(this._canvas,2,r),n(s)&&(s=M(this._canvas,1,r))),n(s))return void L.error(o);const a={disabledExtensions:t.deactivatedWebGLExtensions||{},debugWebGLExtensions:t.debugWebGLExtensions||{},maxAnisotropy:8};this._rctx=new w(s,a,((t,r)=>e.resourceController.memoryController.newCache(t,r))),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&L.error("WebGL context has alpha channel even though no alpha channel was requested"),!this._rctx.contextAttributes.alpha&&i("safari")>=11&&(this._container.style.backgroundColor="black"),this._container.appendChild(this._canvas)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("standardDerivatives"),this._rctx.capabilities.enable("shaderTextureLOD"),this._rctx.capabilities.enable("textureFloat")}get componentObjectCollection(){return n(this._componentObjectCollection)&&(this._componentObjectCollection=new u(this._renderer.renderPassManager)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}};e([c({type:Boolean,readOnly:!0})],H.prototype,"updating",null),e([g()],H.prototype,"_rctx",void 0),e([g()],H.prototype,"_container",void 0),e([g()],H.prototype,"_canvas",void 0),e([g()],H.prototype,"_stippleTextureRepository",void 0),e([g(),c()],H.prototype,"waterTextureRepository",void 0),e([g(),c()],H.prototype,"_magnifierHelper",void 0),e([g(),c()],H.prototype,"_textureRepository",void 0),e([g()],H.prototype,"_compositingHelper",void 0),e([g()],H.prototype,"_renderer",void 0),e([g()],H.prototype,"_screenshotManager",void 0),e([g()],H.prototype,"componentObjectCollection",null),e([g()],H.prototype,"_componentObjectCollection",void 0),H=e([l("esri.views.3d.webgl-engine.parts.RenderView")],H);export{H as RenderView};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import i from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as o,disposeMaybe as n,isNone as a,isSome as p}from"../../../../core/maybe.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{Milliseconds as d}from"../../../../core/time.js";import{init as c}from"../../../../core/watchUtils.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{DESIRED_ANIMATION_MS as u}from"../../support/animationUtils.js";import{ComponentObjectCollection as _}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueRepository as g}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{autoDispose as f,AutoDisposableMixin as y}from"../lib/AutoDisposable.js";import R from"../lib/CompositingHelper.js";import{textureToDepth as x}from"../lib/depthRangeUtils.js";import{GLMaterialRepository as b}from"../lib/GLMaterialRepository.js";import{MagnifierHelper as v}from"../lib/MagnifierHelper.js";import{Renderer as w}from"../lib/Renderer.js";import{RenderingContext as j}from"../lib/RenderingContext.js";import{TextureRepository as T}from"../lib/TextureRepository.js";import{StippleTextureRepository as U}from"../materials/StippleTextureRepository.js";import{WaterTextureRepository as S}from"../materials/internal/WaterTextureRepository.js";import{removeLoadedShaderModules as C}from"./requireUtils.js";import{ScreenshotManager as q}from"./ScreenshotManager.js";import{createContextOrErrorHTML as M,createContext as A}from"../../../webgl/context-util.js";const L=s.getLogger("esri.views.3d.webgl-engine.parts.View");let H=class extends(y(t)){constructor(e){super({}),this.events=new r,this.waterTextureRepository=new S,this._magnifierHelper=new v,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._logicUpdateLast=0,this._container=e.container,this._initializeContext(e),c(this.waterTextureRepository,"loadingState",(()=>this.requestRender())),this._magnifierHelper.events.on("request-render",(()=>this.requestRender())),this._stippleTextureRepository=new U(this._rctx),this._shaderTechniqueRepository=new g({rctx:this._rctx,viewingMode:e.viewingMode,stippleTextureRepository:this._stippleTextureRepository,waterTextureRepository:this.waterTextureRepository}),this._textureRepository=new T(e,this._shaderTechniqueRepository,this._rctx),this._textureRepository.events.on("changed",(e=>this.requestRender(e))),this._materialRepository=new b(this._textureRepository,this._shaderTechniqueRepository,(()=>this.requestRender()),(()=>this.requestRender())),this._compositingHelper=new R(this._rctx,this._shaderTechniqueRepository),this._renderer=new w(this._materialRepository,this._textureRepository,this._shaderTechniqueRepository,this._rctx,this._compositingHelper,this._magnifierHelper,(e=>this.requestRender(e)),((t,r)=>e.schedule(t,r)),e),this._screenshotManager=new q(this._rctx,((e,t,r)=>this._renderer.render(e,t,t,r)),(e=>this.requestRender(e)),e.options.screenshot.renderOverlay,(e=>this.events.emit("force-camera-for-screenshot",e))),this._registerFrameTask(e)}normalizeCtorArgs(){return{}}dispose(){this._container.contains(this._canvas)&&this._container.removeChild(this._canvas),this._frameTask=o(this._frameTask),this._shaderTechniqueRepository=n(this._shaderTechniqueRepository),super.dispose(),this._tmpDepthBuffer=null,this._rctx=null}get performanceInfo(){const e=this._rctx.gl;return{renderer:this._renderer.performanceInfo,textureMemory:void 0!==e.getUsedTextureMemory?e.getUsedTextureMemory():void 0,renderbufferMemory:void 0!==e.getUsedRenderbufferMemory?e.getUsedRenderbufferMemory():void 0,VBOMemory:void 0!==e.getUsedVBOMemory?e.getUsedVBOMemory():void 0}}requestRender(e=1){1===e?this._needsUpdate=!0:this._needsRender=!0}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this._renderer.updating||this._textureRepository.updating||this.waterTextureRepository.updating||this._magnifierHelper.updating}ensureEdgeView(){return this._renderer.ensureEdgeView()}get edgeView(){return this._renderer.edgeView}get textureRepository(){return this._textureRepository}get compositingHelper(){return this._compositingHelper}set magnifier(e){this._magnifierHelper.magnifier=e}updateLightSources(e,t,r){this._renderer.updateLightSources(e,t,r),this.requestRender()}setRenderParameters(e){void 0!==e.idleSuspend&&this._idleSuspend!==!!e.idleSuspend&&(this._idleSuspend=!!e.idleSuspend,this.requestRender()),this._renderer.setRenderParameters(e)}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}modify(e){this._renderer.modify(e),e.clear()}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e)}get hasShadowsEnabled(){return this._renderer.hasShadowsEnabled}readAccumulatedShadow(e){return this._renderer.readAccumulatedShadow(e[0],e[1])}getMinimalDepthForArea(e,t,r,i,s=i){const o=r.constrainWindowSize(e,t,i*r.pixelRatio,s*r.pixelRatio),n=this._ensureDepthBuffer(o);this._renderer.readDepthPixels(r,o[0],o[1],o[2],o[3],n);let a=Number.MAX_VALUE;for(let p=0;p<o[2]*o[3];p++){const e=x(4*p,n,r.nearFar);a>e&&e!==r.nearFar[0]&&e!==r.nearFar[1]&&(a=e)}return a===Number.MAX_VALUE?void 0:a}_ensureDepthBuffer(e){const t=4*e[2]*e[3];return(a(this._tmpDepthBuffer)||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}get renderPlugins(){return this._renderer.renderPlugins}get test(){return{renderer:this._renderer}}get gpuMemoryUsage(){return this._renderer.gpuMemoryUsage}async reloadShaders(){C(),await this._shaderTechniqueRepository.reloadAll(),this.requestRender()}_registerFrameTask(e){const t=e.state,r={viewCamera:t.camera,frameHasDecorations:!1},i={preRender:r=>{e.processSyncLayers();const i=d(r.time-this._logicUpdateLast);if(i>u||p(this.forcedAnimationTime)){const e={camera:t.camera,dt:i,forcedTime:this.forcedAnimationTime};this._logicUpdateLast=r.time,this._renderer.updateLogic(e)&&this.requestRender(0)}},render:()=>{if((this._needsUpdate||this._needsRender||!this._idleSuspend||!this._renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this._renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this._renderer.render(null,t.camera,t.contentCamera,1),e&&this._renderer.hasWaterReflection&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:()=>{r.viewCamera=t.camera,r.frameHasDecorations=this._renderer.hasSlicePlane||this._magnifierHelper.enabled,this._textureRepository.update(),this._screenshotManager.update(r)}};this._frameTask=h(i)}_initializeContext(e){const t=e.options;this._canvas=t.canvas,this._canvas||(this._canvas=document.createElement("canvas")),this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");const r={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:null==t.stencil||t.stencil,powerPreference:"high-performance"};let s;const o=i("esri-force-webgl");if(1===o||2===o?s=M(this._canvas,o,r):(s=A(this._canvas,2,r),a(s)&&(s=M(this._canvas,1,r))),a(s))return void L.error(o);const n={disabledExtensions:t.deactivatedWebGLExtensions||{},debugWebGLExtensions:t.debugWebGLExtensions||{},maxAnisotropy:8};this._rctx=new j(s,n,((t,r)=>e.resourceController.memoryController.newCache(t,r))),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&L.error("WebGL context has alpha channel even though no alpha channel was requested"),!this._rctx.contextAttributes.alpha&&i("safari")>=11&&(this._container.style.backgroundColor="black"),this._container.appendChild(this._canvas)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("standardDerivatives"),this._rctx.capabilities.enable("shaderTextureLOD"),this._rctx.capabilities.enable("textureFloat")}get componentObjectCollection(){return a(this._componentObjectCollection)&&(this._componentObjectCollection=new _(this._renderer.renderPassManager)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}};e([l({type:Boolean,readOnly:!0})],H.prototype,"updating",null),e([f()],H.prototype,"_rctx",void 0),e([f()],H.prototype,"_container",void 0),e([f()],H.prototype,"_canvas",void 0),e([f()],H.prototype,"_stippleTextureRepository",void 0),e([f(),l()],H.prototype,"waterTextureRepository",void 0),e([f(),l()],H.prototype,"_magnifierHelper",void 0),e([f(),l()],H.prototype,"_textureRepository",void 0),e([f()],H.prototype,"_compositingHelper",void 0),e([f()],H.prototype,"_renderer",void 0),e([f()],H.prototype,"_screenshotManager",void 0),e([f()],H.prototype,"componentObjectCollection",null),e([f()],H.prototype,"_componentObjectCollection",void 0),e([l()],H.prototype,"_needsUpdate",void 0),e([l()],H.prototype,"_needsWaterReflectionUpdate",void 0),H=e([m("esri.views.3d.webgl-engine.parts.RenderView")],H);export{H as RenderView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{isSome as t,unwrap as i,unwrapOr as r}from"../../../../core/maybe.js";import{bindSliceUniformsWithOrigin as o}from"../core/shaderLibrary/Slice.glsl.js";import{bindOutputHighlight as s}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{bindMultipassTerrainTexture as n}from"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{bindVisualVariablesUniformsWithOpacity as p}from"../core/shaderLibrary/shading/VisualVariables.glsl.js";import{bindProjectionMatrix as l,bindView as a}from"../core/shaderLibrary/util/View.glsl.js";import{ReloadableShaderModule as d}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as c}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as h,ShaderTechniqueConfiguration as u}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{blendingDefault as f,OITBlending as m,OITDepthTest as g,OITDepthWrite as b,OITPolygonOffset as v}from"../lib/OrderIndependentTransparency.js";import{Program as y}from"../lib/Program.js";import{stencilWriteMaskOn as T,stencilToolMaskBaseParams as P,stencilBaseAllZerosParams as E,depthCompareAlways as x,stencilToolTransparentOccluderParams as S,stencilWriteMaskOff as O,stencilToolMaskOccluderParams as W,depthCompareLess as C}from"../lib/StencilUtils.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{makePipelineState as j,defaultDepthWriteParams as z,defaultColorWriteParams as U}from"../../../webgl/renderState.js";const w=new Map([["position",0],["subdivisionFactor",1],["uv0",2],["auxpos1",3],["auxpos2",4],["size",6],["sizeFeatureAttribute",6],["color",5],["colorFeatureAttribute",5],["opacityFeatureAttribute",7]]);class L extends c{constructor(e,t,i){super(e,t,i),this.stippleTextureRepository=e.stippleTextureRepository}initializeProgram(e){const t=L.shader.get(),i=this.configuration,r=t.build({OITEnabled:0===i.transparencyPassType,output:i.output,slicePlaneEnabled:i.slicePlaneEnabled,sliceHighlightDisabled:!1,sliceEnabledForVertexPrograms:!1,draped:i.draped,stippleEnabled:i.stippleEnabled,stippleOffColorEnabled:i.stippleOffColorEnabled,stippleDistanceMaxEnabled:i.stippleIntegerRepeatsEnabled,stippleIntegerRepeatsEnabled:i.stippleIntegerRepeatsEnabled,scaleStippleWithLineWidth:i.scaleStippleWithLineWidth,capType:i.capType,roundJoins:i.roundJoins,vvColor:i.vvColor,vvSize:i.vvSize,vvInstancingEnabled:!0,vvOpacity:i.vvOpacity,falloffEnabled:i.falloffEnabled,innerColorEnabled:i.innerColorEnabled,multipassTerrainEnabled:i.multipassTerrainEnabled,cullAboveGround:i.cullAboveGround});return new y(e.rctx,r,w)}dispose(){super.dispose(),this.stippleTextureRepository.release(this.stipplePattern),this.stipplePattern=null,this.stippleTextureBind=null}bindPass(e,o){if(l(this.program,o.camera.projectionMatrix),4===this.configuration.output&&s(this.program,o),o.multipassTerrainEnabled&&(this.program.setUniform2fv("inverseViewport",o.inverseViewport),n(this.program,o)),this.program.setUniform1f("intrinsicWidth",e.width),this.program.setUniform4fv("intrinsicColor",e.color),this.program.setUniform1f("miterLimit","miter"!==e.join?0:e.miterLimit),this.program.setUniform2fv("cameraNearFar",o.camera.nearFar),this.program.setUniform1f("pixelRatio",o.camera.pixelRatio),this.program.setUniform2f("screenSize",o.camera.fullViewport[2],o.camera.fullViewport[3]),p(this.program,e),this.stipplePattern!==e.stipplePattern){const t=e.stipplePattern;this.stippleTextureBind=this.stippleTextureRepository.swap(this.stipplePattern,t),this.stipplePattern=t}if(this.configuration.stippleEnabled){const{pixelSize:r,sdfNormalizer:s,pixels:n}=t(this.stippleTextureBind)?this.stippleTextureBind(this.program):{pixelSize:1,sdfNormalizer:1,pixels:1};if(this.program.setUniform1f("stipplePatternSDFNormalizer",s),this.program.setUniform1f("stipplePatternTextureSize",n),this.configuration.draped?(this.program.setUniform1f("stipplePatternPixelSizeInv",1/r),this.program.setUniform1f("worldToScreenRatio",1/o.screenToWorldRatio)):this.program.setUniform1f("stipplePatternPixelSizeInv",1/(r*o.camera.pixelRatio)),this.configuration.stippleOffColorEnabled){const t=i(e.stippleOffColor);this.program.setUniform4f("stippleOffColor",t[0],t[1],t[2],t.length>3?t[3]:1)}}this.configuration.falloffEnabled&&this.program.setUniform1f("falloff",e.falloff),this.configuration.innerColorEnabled&&(this.program.setUniform4fv("innerColor",r(e.innerColor,e.color)),this.program.setUniform1f("innerWidth",e.innerWidth*o.camera.pixelRatio))}bindDraw(e){a(this.program,e),o(this.program,this.configuration,e),this.program.rebindTextures()}makePipelineState(e,t){const i=this.configuration,r=3===e,o=2===e;return j({blending:0===i.output||7===i.output?r?f:m(e):null,depthTest:{func:g(e)},depthWrite:r?!i.transparent&&i.writeDepth&&z:b(e),colorWrite:U,stencilWrite:i.sceneHasOcludees?T:null,stencilTest:i.sceneHasOcludees?t?P:E:null,polygonOffset:r||o?i.polygonOffset&&I:v})}initializePipeline(){const e=this.configuration,t=e.polygonOffset&&I;return e.occluder&&(this._occluderPipelineTransparent=j({blending:f,polygonOffset:t,depthTest:x,depthWrite:null,colorWrite:U,stencilWrite:null,stencilTest:S}),this._occluderPipelineOpaque=j({blending:f,polygonOffset:t,depthTest:x,depthWrite:null,colorWrite:U,stencilWrite:O,stencilTest:W}),this._occluderPipelineMaskWrite=j({blending:null,polygonOffset:t,depthTest:C,depthWrite:null,colorWrite:null,stencilWrite:T,stencilTest:P})),this._occludeePipelineState=this.makePipelineState(this.configuration.transparencyPassType,!0),this.makePipelineState(this.configuration.transparencyPassType,!1)}get primitiveType(){return 5}getPipelineState(e,t){return t?this._occludeePipelineState:this.configuration.occluder?10===e?this._occluderPipelineTransparent:9===e?this._occluderPipelineOpaque:this._occluderPipelineMaskWrite:super.getPipelineState(e,t)}}L.shader=new d(R,(()=>import("./RibbonLine.glsl.js")));const I={factor:0,units:-4};class _ extends u{constructor(){super(...arguments),this.output=0,this.occluder=!1,this.slicePlaneEnabled=!1,this.transparent=!1,this.polygonOffset=!1,this.writeDepth=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stippleIntegerRepeatsEnabled=!1,this.scaleStippleWithLineWidth=!1,this.capType=0,this.roundJoins=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.sceneHasOcludees=!1,this.transparencyPassType=3,this.multipassTerrainEnabled=!1,this.cullAboveGround=!1}}e([h({count:8})],_.prototype,"output",void 0),e([h()],_.prototype,"occluder",void 0),e([h()],_.prototype,"slicePlaneEnabled",void 0),e([h()],_.prototype,"transparent",void 0),e([h()],_.prototype,"polygonOffset",void 0),e([h()],_.prototype,"writeDepth",void 0),e([h()],_.prototype,"draped",void 0),e([h()],_.prototype,"stippleEnabled",void 0),e([h()],_.prototype,"stippleOffColorEnabled",void 0),e([h()],_.prototype,"stippleIntegerRepeatsEnabled",void 0),e([h()],_.prototype,"scaleStippleWithLineWidth",void 0),e([h({count:3})],_.prototype,"capType",void 0),e([h()],_.prototype,"roundJoins",void 0),e([h()],_.prototype,"vvSize",void 0),e([h()],_.prototype,"vvColor",void 0),e([h()],_.prototype,"vvOpacity",void 0),e([h()],_.prototype,"falloffEnabled",void 0),e([h()],_.prototype,"innerColorEnabled",void 0),e([h()],_.prototype,"sceneHasOcludees",void 0),e([h({count:4})],_.prototype,"transparencyPassType",void 0),e([h()],_.prototype,"multipassTerrainEnabled",void 0),e([h()],_.prototype,"cullAboveGround",void 0);export{L as RibbonLineTechnique,_ as RibbonLineTechniqueConfiguration,w as ribbonVertexAttributeLocations};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{isSome as t,unwrap as i,unwrapOr as r}from"../../../../core/maybe.js";import o from"../../support/debugFlags.js";import{bindSliceUniformsWithOrigin as s}from"../core/shaderLibrary/Slice.glsl.js";import{bindOutputHighlight as n}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{bindMultipassTerrainTexture as p}from"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{bindVisualVariablesUniformsWithOpacity as a}from"../core/shaderLibrary/shading/VisualVariables.glsl.js";import{bindProjectionMatrix as l,bindView as d,bindCameraPosition as c}from"../core/shaderLibrary/util/View.glsl.js";import{ReloadableShaderModule as h}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as u}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as f,ShaderTechniqueConfiguration as m}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{blendingDefault as g,OITBlending as b,OITDepthTest as v,OITDepthWrite as y,OITPolygonOffset as T}from"../lib/OrderIndependentTransparency.js";import{Program as E}from"../lib/Program.js";import{stencilWriteMaskOn as P,stencilToolMaskBaseParams as S,stencilBaseAllZerosParams as O,depthCompareAlways as x,stencilToolTransparentOccluderParams as W,stencilWriteMaskOff as R,stencilToolMaskOccluderParams as U,depthCompareLess as C}from"../lib/StencilUtils.js";import{R as j}from"../../../../chunks/RibbonLine.glsl.js";import{makePipelineState as w,defaultDepthWriteParams as z,defaultColorWriteParams as L}from"../../../webgl/renderState.js";const I=new Map([["position",0],["subdivisionFactor",1],["uv0",2],["auxpos1",3],["auxpos2",4],["size",6],["sizeFeatureAttribute",6],["color",5],["colorFeatureAttribute",5],["opacityFeatureAttribute",7]]);class _ extends u{constructor(e,t,i){super(e,t,i),this.stippleTextureRepository=e.stippleTextureRepository}initializeProgram(e){const t=_.shader.get(),i=this.configuration,r=t.build({OITEnabled:0===i.transparencyPassType,output:i.output,slicePlaneEnabled:i.slicePlaneEnabled,sliceHighlightDisabled:!1,sliceEnabledForVertexPrograms:!1,draped:i.draped,stippleEnabled:i.stippleEnabled,stippleOffColorEnabled:i.stippleOffColorEnabled,stippleDistanceMaxEnabled:i.stippleIntegerRepeatsEnabled,stippleIntegerRepeatsEnabled:i.stippleIntegerRepeatsEnabled,scaleStippleWithLineWidth:i.scaleStippleWithLineWidth,capType:i.capType,roundJoins:i.roundJoins,vvColor:i.vvColor,vvSize:i.vvSize,vvInstancingEnabled:!0,vvOpacity:i.vvOpacity,falloffEnabled:i.falloffEnabled,innerColorEnabled:i.innerColorEnabled,multipassTerrainEnabled:i.multipassTerrainEnabled,cullAboveGround:i.cullAboveGround});return new E(e.rctx,r,I)}dispose(){super.dispose(),this.stippleTextureRepository.release(this.stipplePattern),this.stipplePattern=null,this.stippleTextureBind=null}bindPass(e,s){if(l(this.program,s.camera.projectionMatrix),4===this.configuration.output&&n(this.program,s),s.multipassTerrainEnabled&&(this.program.setUniform2fv("inverseViewport",s.inverseViewport),p(this.program,s)),this.program.setUniform1f("intrinsicWidth",e.width),this.program.setUniform4fv("intrinsicColor",e.color),this.program.setUniform1f("miterLimit","miter"!==e.join?0:e.miterLimit),this.program.setUniform2fv("cameraNearFar",s.camera.nearFar),this.program.setUniform1f("pixelRatio",s.camera.pixelRatio),this.program.setUniform2f("screenSize",s.camera.fullViewport[2],s.camera.fullViewport[3]),a(this.program,e),this.stipplePattern!==e.stipplePattern){const t=e.stipplePattern;this.stippleTextureBind=this.stippleTextureRepository.swap(this.stipplePattern,t),this.stipplePattern=t}if(this.configuration.stippleEnabled){const{pixelSize:r,sdfNormalizer:n,pixels:p}=t(this.stippleTextureBind)?this.stippleTextureBind(this.program):{pixelSize:1,sdfNormalizer:1,pixels:1};if(this.program.setUniform1f("stipplePatternSDFNormalizer",n),this.program.setUniform1f("stipplePatternTextureSize",p),o.ENABLE_CONTINUOUS_LINE_PATTERNS?(this.program.setUniform1f("stipplePatternPixelSizeInv",1/r),this.configuration.draped?this.program.setUniform1f("worldToScreenRatio",1/s.screenToWorldRatio):(this.program.setUniform1f("worldToScreenPerDistanceRatio",1/s.camera.perScreenPixelRatio),this.program.setUniform1f("cameraDistanceToSurface",s.camera.distanceFromSurface))):this.program.setUniform1f("stipplePatternPixelSizeInv",1/(r*s.camera.pixelRatio)),this.configuration.stippleOffColorEnabled){const t=i(e.stippleOffColor);this.program.setUniform4f("stippleOffColor",t[0],t[1],t[2],t.length>3?t[3]:1)}}this.configuration.falloffEnabled&&this.program.setUniform1f("falloff",e.falloff),this.configuration.innerColorEnabled&&(this.program.setUniform4fv("innerColor",r(e.innerColor,e.color)),this.program.setUniform1f("innerWidth",e.innerWidth*s.camera.pixelRatio))}bindDraw(e){d(this.program,e),this.configuration.stippleEnabled&&o.ENABLE_CONTINUOUS_LINE_PATTERNS&&!this.configuration.draped&&c(this.program,e.origin,e.camera.viewInverseTransposeMatrix),s(this.program,this.configuration,e),this.program.rebindTextures()}makePipelineState(e,t){const i=this.configuration,r=3===e,o=2===e;return w({blending:0===i.output||7===i.output?r?g:b(e):null,depthTest:{func:v(e)},depthWrite:r?!i.transparent&&i.writeDepth&&z:y(e),colorWrite:L,stencilWrite:i.sceneHasOcludees?P:null,stencilTest:i.sceneHasOcludees?t?S:O:null,polygonOffset:r||o?i.polygonOffset&&N:T})}initializePipeline(){const e=this.configuration,t=e.polygonOffset&&N;return e.occluder&&(this._occluderPipelineTransparent=w({blending:g,polygonOffset:t,depthTest:x,depthWrite:null,colorWrite:L,stencilWrite:null,stencilTest:W}),this._occluderPipelineOpaque=w({blending:g,polygonOffset:t,depthTest:x,depthWrite:null,colorWrite:L,stencilWrite:R,stencilTest:U}),this._occluderPipelineMaskWrite=w({blending:null,polygonOffset:t,depthTest:C,depthWrite:null,colorWrite:null,stencilWrite:P,stencilTest:S})),this._occludeePipelineState=this.makePipelineState(this.configuration.transparencyPassType,!0),this.makePipelineState(this.configuration.transparencyPassType,!1)}get primitiveType(){return 5}getPipelineState(e,t){return t?this._occludeePipelineState:this.configuration.occluder?10===e?this._occluderPipelineTransparent:9===e?this._occluderPipelineOpaque:this._occluderPipelineMaskWrite:super.getPipelineState(e,t)}}_.shader=new h(j,(()=>import("./RibbonLine.glsl.js")));const N={factor:0,units:-4};class A extends m{constructor(){super(...arguments),this.output=0,this.occluder=!1,this.slicePlaneEnabled=!1,this.transparent=!1,this.polygonOffset=!1,this.writeDepth=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stippleIntegerRepeatsEnabled=!1,this.scaleStippleWithLineWidth=!1,this.capType=0,this.roundJoins=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.sceneHasOcludees=!1,this.transparencyPassType=3,this.multipassTerrainEnabled=!1,this.cullAboveGround=!1}}e([f({count:8})],A.prototype,"output",void 0),e([f()],A.prototype,"occluder",void 0),e([f()],A.prototype,"slicePlaneEnabled",void 0),e([f()],A.prototype,"transparent",void 0),e([f()],A.prototype,"polygonOffset",void 0),e([f()],A.prototype,"writeDepth",void 0),e([f()],A.prototype,"draped",void 0),e([f()],A.prototype,"stippleEnabled",void 0),e([f()],A.prototype,"stippleOffColorEnabled",void 0),e([f()],A.prototype,"stippleIntegerRepeatsEnabled",void 0),e([f()],A.prototype,"scaleStippleWithLineWidth",void 0),e([f({count:3})],A.prototype,"capType",void 0),e([f()],A.prototype,"roundJoins",void 0),e([f()],A.prototype,"vvSize",void 0),e([f()],A.prototype,"vvColor",void 0),e([f()],A.prototype,"vvOpacity",void 0),e([f()],A.prototype,"falloffEnabled",void 0),e([f()],A.prototype,"innerColorEnabled",void 0),e([f()],A.prototype,"sceneHasOcludees",void 0),e([f({count:4})],A.prototype,"transparencyPassType",void 0),e([f()],A.prototype,"multipassTerrainEnabled",void 0),e([f()],A.prototype,"cullAboveGround",void 0);export{_ as RibbonLineTechnique,A as RibbonLineTechniqueConfiguration,I as ribbonVertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import r from"../core/CollectionFlattener.js";import i from"../core/Error.js";import{HandleOwner as t}from"../core/HandleOwner.js";import a from"../core/Logger.js";import{someMap as s}from"../core/MapUtils.js";import{isNone as o,isSome as l,removeMaybe as n}from"../core/maybe.js";import{createDeferred as y,isAbortError as h,createAbortController as p,onAbort as w,throwIfAborted as c}from"../core/promiseUtils.js";import{schedule as d}from"../core/scheduling.js";import{on as m,init as u}from"../core/watchUtils.js";import{property as f}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as v}from"../core/accessorSupport/decorators/subclass.js";import{WatchUpdatingTracking as _}from"./support/WatchUpdatingTracking.js";const g=a.getLogger("esri.views.LayerViewManager");class V{constructor(e,r,t){this.layer=e,this.view=r,this.layerViewImporter=t,this._controller=p(),this._deferred=y(),this._started=!1,this.done=!1,w(this._controller.signal,(()=>{const r=new i("cancelled:layerview-create","layerview creation cancelled",{layer:e});this._deferred.reject(r)}))}get promise(){return this._deferred.promise}destroy(){this._controller.abort();const{layerView:e}=this;if(!e)return;const{layer:r,view:i}=this;r.emit("layerview-destroy",{view:i,layerView:e}),i.emit("layerview-destroy",{layer:r,layerView:e}),this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:r,view:t}=this;this._map=t.map;try{var a,s;let l,y;if(await r.load({signal:e}),"prefetchResources"in r&&await r.prefetchResources({signal:e}),r.createLayerView)l=await r.createLayerView(t,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(r))throw new i("layer:view-not-supported","No layerview implementation was found");const a=await this.layerViewImporter.importLayerView(r);c(e),l="default"in a?new a.default({layer:r,view:t}):new a({layer:r,view:t})}const h=()=>{y=n(y),l.destroyed||l.destroy(),l.layer=null,l.parent=null,l.view=null,this.done=!0};y=w(e,h),c(e);try{await l.when()}catch(o){throw h(),o}if(!(null==(a=this._map)||null==(s=a.allLayers)?void 0:s.includes(r)))return h(),void this._deferred.reject(new i("view:no-layerview-for-layer","The layer has been removed from the map",{layer:r}));this.layerView=l,r.emit("layerview-create",{view:t,layerView:l}),t.emit("layerview-create",{layer:r,layerView:l}),this.done=!0,this._deferred.resolve(l)}catch(o){r.emit("layerview-create-error",{view:t,error:o}),t.emit("layerview-create-error",{layer:r,error:o}),this.done=!0,this._deferred.reject(new i("layerview:create-error","layerview creation failed",{layer:r,error:o}))}}}let L=class extends t{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._watchUpdatingTracking=new _,this.supportsGround=!0,this._preloadLayerViewModules=()=>{var e;const r=null==(e=this.view.map)?void 0:e.allLayers;if(r)for(const i of r)this.layerViewImporter.hasLayerViewModule(i)&&this.layerViewImporter.importLayerView(i)},this._reschedule=()=>(o(this._workPromise)&&(this._workPromise=y()),this.handles.remove("reschedule"),this.handles.add(d(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{var e,i,t;const a=this.view.map;if(this._map!==a&&(this.clear(),this._map=a),o(this._workPromise))return void this.notifyChange("updating");this.handles.remove("reschedule"),this.handles.remove("collection-change");const s=new r({getCollections:()=>this._rootCollectionNames.map((e=>this.get(e))),getChildrenFunction:e=>e&&"layers"in e?e.layers:null});if(!s)return this._workPromise.resolve(),void(this._workPromise=null);for(const r of s)this._createLayerView(r);this._refreshCollections();for(const[r,o]of this._layerLayerViewInfoMap)s.includes(r)||(this._layerLayerViewInfoMap.delete(o.layer),o.destroy());const l=s.filter((e=>"group"===e.type)).map((e=>e.layers)),n=[null==a||null==(e=a.ground)?void 0:e.layers,null==a||null==(i=a.basemap)?void 0:i.baseLayers,null==a||null==(t=a.basemap)?void 0:t.referenceLayers,null==a?void 0:a.layers,...l].filter((e=>!!e));this.handles.add(n.map((e=>this._watchUpdatingTracking.addOnCollectionChange(e,this._reschedule))),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.handles.add([m(this,"view.map.allLayers","change",this._preloadLayerViewModules,this._preloadLayerViewModules),u(this.view,["map.basemap","map.ground","map.layers","ready"],this._reschedule,!0)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),this._watchUpdatingTracking.destroy(),this._map=null}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return l(this._workPromise)||this._watchUpdatingTracking.updating||s(this._layerLayerViewInfoMap,(e=>!e.done))}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){if(!this.destroyed){for(const e of this._layerLayerViewInfoMap.values())e.destroy();this._layerLayerViewInfoMap.clear(),this._refreshCollections()}}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e))throw new i("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e});return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(this.get(e),this.get(r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,r,i){if(!e||!r)return void(r&&r.removeAll());let t=0;for(const a of e){const e=this._layerLayerViewInfoMap.get(a);if(!e||!e.layerView)continue;const s=e.layerView;s.layer=a,s.parent=i,r.getItemAt(t)!==s&&r.splice(t,0,s),a.layers&&this._populateLayerViewsOwners(a.layers,s.layerViews,s),t+=1}t<r.length&&r.splice(t,r.length)}_createLayerView(e){if(this._layerLayerViewInfoMap.has(e))return this.view.ready&&this._layerLayerViewInfoMap.get(e).start(),this.notifyChange("updating"),void this.notifyChange("updatingRemaining");e.load().catch((()=>{})),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new V(e,this.view,this.layerViewImporter);r.promise.then((()=>this._refreshCollections()),(r=>{var i,t;r&&(h(r)||"cancelled:layerview-create"===r.name)||g.error(`Failed to create layerview for layer title:'${null!=(i=e.title)?i:"no title"}', id:'${null!=(t=e.id)?t:"no id"}' of type '${e.type}'.`,{layer:e,error:r});this._refreshCollections()})),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};e([f()],L.prototype,"_workPromise",void 0),e([f({readOnly:!0})],L.prototype,"_watchUpdatingTracking",void 0),e([f({readOnly:!0})],L.prototype,"_layersToLayerViews",null),e([f({readOnly:!0})],L.prototype,"_rootCollectionNames",null),e([f()],L.prototype,"layerViewImporter",void 0),e([f()],L.prototype,"supportsGround",void 0),e([f({readOnly:!0})],L.prototype,"updating",null),e([f({readOnly:!0})],L.prototype,"updatingRemaining",null),e([f({constructOnly:!0})],L.prototype,"view",void 0),L=e([v("esri.views.LayerViewManager")],L);const M=L;export{M as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import r from"../core/CollectionFlattener.js";import i from"../core/Error.js";import{HandleOwner as t}from"../core/HandleOwner.js";import a from"../core/Logger.js";import{someMap as s}from"../core/MapUtils.js";import{isNone as o,isSome as l,removeMaybe as n}from"../core/maybe.js";import{createDeferred as y,isAbortError as h,onAbort as p,throwIfAborted as w}from"../core/promiseUtils.js";import{schedule as c}from"../core/scheduling.js";import{on as d,init as m}from"../core/watchUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{WatchUpdatingTracking as v}from"./support/WatchUpdatingTracking.js";const _=a.getLogger("esri.views.LayerViewManager");class g{constructor(e,r,t){this.layer=e,this.view=r,this.layerViewImporter=t,this._controller=new AbortController,this._deferred=y(),this._started=!1,this.done=!1,p(this._controller.signal,(()=>{const r=new i("cancelled:layerview-create","layerview creation cancelled",{layer:e});this._deferred.reject(r)}))}get promise(){return this._deferred.promise}destroy(){this._controller.abort();const{layerView:e}=this;if(!e)return;const{layer:r,view:i}=this;r.emit("layerview-destroy",{view:i,layerView:e}),i.emit("layerview-destroy",{layer:r,layerView:e}),this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:r,view:t}=this;this._map=t.map;try{var a,s;let l,y;if(await r.load({signal:e}),"prefetchResources"in r&&await r.prefetchResources({signal:e}),r.createLayerView)l=await r.createLayerView(t,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(r))throw new i("layer:view-not-supported","No layerview implementation was found");const a=await this.layerViewImporter.importLayerView(r);w(e),l="default"in a?new a.default({layer:r,view:t}):new a({layer:r,view:t})}const h=()=>{y=n(y),l.destroyed||l.destroy(),l.layer=null,l.parent=null,l.view=null,this.done=!0};y=p(e,h),w(e);try{await l.when()}catch(o){throw h(),o}if(!(null==(a=this._map)||null==(s=a.allLayers)?void 0:s.includes(r)))return h(),void this._deferred.reject(new i("view:no-layerview-for-layer","The layer has been removed from the map",{layer:r}));this.layerView=l,r.emit("layerview-create",{view:t,layerView:l}),t.emit("layerview-create",{layer:r,layerView:l}),this.done=!0,this._deferred.resolve(l)}catch(o){r.emit("layerview-create-error",{view:t,error:o}),t.emit("layerview-create-error",{layer:r,error:o}),this.done=!0,this._deferred.reject(new i("layerview:create-error","layerview creation failed",{layer:r,error:o}))}}}let V=class extends t{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._watchUpdatingTracking=new v,this.supportsGround=!0,this._preloadLayerViewModules=()=>{var e;const r=null==(e=this.view.map)?void 0:e.allLayers;if(r)for(const i of r)this.layerViewImporter.hasLayerViewModule(i)&&this.layerViewImporter.importLayerView(i)},this._reschedule=()=>(o(this._workPromise)&&(this._workPromise=y()),this.handles.remove("reschedule"),this.handles.add(c(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{var e,i,t;const a=this.view.map;if(this._map!==a&&(this.clear(),this._map=a),o(this._workPromise))return void this.notifyChange("updating");this.handles.remove("reschedule"),this.handles.remove("collection-change");const s=new r({getCollections:()=>this._rootCollectionNames.map((e=>this.get(e))),getChildrenFunction:e=>e&&"layers"in e?e.layers:null});if(!s)return this._workPromise.resolve(),void(this._workPromise=null);for(const r of s)this._createLayerView(r);this._refreshCollections();for(const[r,o]of this._layerLayerViewInfoMap)s.includes(r)||(this._layerLayerViewInfoMap.delete(o.layer),o.destroy());const l=s.filter((e=>"group"===e.type)).map((e=>e.layers)),n=[null==a||null==(e=a.ground)?void 0:e.layers,null==a||null==(i=a.basemap)?void 0:i.baseLayers,null==a||null==(t=a.basemap)?void 0:t.referenceLayers,null==a?void 0:a.layers,...l].filter((e=>!!e));this.handles.add(n.map((e=>this._watchUpdatingTracking.addOnCollectionChange(e,this._reschedule))),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.handles.add([d(this,"view.map.allLayers","change",this._preloadLayerViewModules,this._preloadLayerViewModules),m(this.view,["map.basemap","map.ground","map.layers","ready"],this._reschedule,!0)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),this._watchUpdatingTracking.destroy(),this._map=null}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return l(this._workPromise)||this._watchUpdatingTracking.updating||s(this._layerLayerViewInfoMap,(e=>!e.done))}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){if(!this.destroyed){for(const e of this._layerLayerViewInfoMap.values())e.destroy();this._layerLayerViewInfoMap.clear(),this._refreshCollections()}}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e))throw new i("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e});return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(this.get(e),this.get(r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,r,i){if(!e||!r)return void(r&&r.removeAll());let t=0;for(const a of e){const e=this._layerLayerViewInfoMap.get(a);if(!e||!e.layerView)continue;const s=e.layerView;s.layer=a,s.parent=i,r.getItemAt(t)!==s&&r.splice(t,0,s),a.layers&&this._populateLayerViewsOwners(a.layers,s.layerViews,s),t+=1}t<r.length&&r.splice(t,r.length)}_createLayerView(e){if(this._layerLayerViewInfoMap.has(e))return this.view.ready&&this._layerLayerViewInfoMap.get(e).start(),this.notifyChange("updating"),void this.notifyChange("updatingRemaining");e.load().catch((()=>{})),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new g(e,this.view,this.layerViewImporter);r.promise.then((()=>this._refreshCollections()),(r=>{var i,t;r&&(h(r)||"cancelled:layerview-create"===r.name)||_.error(`Failed to create layerview for layer title:'${null!=(i=e.title)?i:"no title"}', id:'${null!=(t=e.id)?t:"no id"}' of type '${e.type}'.`,{layer:e,error:r});this._refreshCollections()})),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};e([u()],V.prototype,"_workPromise",void 0),e([u({readOnly:!0})],V.prototype,"_watchUpdatingTracking",void 0),e([u({readOnly:!0})],V.prototype,"_layersToLayerViews",null),e([u({readOnly:!0})],V.prototype,"_rootCollectionNames",null),e([u()],V.prototype,"layerViewImporter",void 0),e([u()],V.prototype,"supportsGround",void 0),e([u({readOnly:!0})],V.prototype,"updating",null),e([u({readOnly:!0})],V.prototype,"updatingRemaining",null),e([u({constructOnly:!0})],V.prototype,"view",void 0),V=e([f("esri.views.LayerViewManager")],V);const L=V;export{L as default};