@arcgis/core 4.24.0-next.20220430 → 4.24.0-next.20220503

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 (998) hide show
  1. package/Basemap.js +1 -1
  2. package/Color.js +1 -1
  3. package/Ground.js +1 -1
  4. package/Map.js +1 -1
  5. package/PopupTemplate.js +1 -1
  6. package/WebMap.js +1 -1
  7. package/WebScene.js +1 -1
  8. package/analysis/LinearDimension.js +1 -1
  9. package/analysis/SliceAnalysis.js +1 -1
  10. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  11. package/arcade/Dictionary.js +1 -1
  12. package/arcade/Feature.js +1 -1
  13. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  14. package/arcade/featureset/support/FeatureSet.js +1 -1
  15. package/assets/esri/core/workers/RemoteClient.js +1 -1
  16. package/assets/esri/core/workers/chunks/{e06461703e6f1acfcfdc.js → 076d1b1101b59af0d389.js} +1 -1
  17. package/assets/esri/core/workers/chunks/0b72d123386dc4ec7538.js +1 -0
  18. package/assets/esri/core/workers/chunks/0d53e575f11198867619.js +1 -0
  19. package/assets/esri/core/workers/chunks/0e6e3cf07c84d9f040c0.js +1 -0
  20. package/assets/esri/core/workers/chunks/105728404ddd9e73d5c9.js +1 -0
  21. package/assets/esri/core/workers/chunks/11106873b009b98e4286.js +1 -0
  22. package/assets/esri/core/workers/chunks/11a7b156591d1feca952.js +1 -0
  23. package/assets/esri/core/workers/chunks/{94325f920a125610e1f5.js → 12feeace7215248be23f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/17be5bd0d1c233d73d7a.js +1 -0
  25. package/assets/esri/core/workers/chunks/1b53bd65407ba5c479d7.js +1 -0
  26. package/assets/esri/core/workers/chunks/1d91aa745b49b2ab36cf.js +1 -0
  27. package/assets/esri/core/workers/chunks/{fd35b69872ac9393924f.js → 1db8bfb1731be3ae320c.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{3433361f09c84b31aec4.js → 2290bd6dc2e6bb136e14.js} +1 -1
  29. package/assets/esri/core/workers/chunks/24217129d492e170f0f0.js +1 -0
  30. package/assets/esri/core/workers/chunks/24e194107e0e5090125b.js +1 -0
  31. package/assets/esri/core/workers/chunks/2a1301a1d0cd4c0c17cf.js +1 -0
  32. package/assets/esri/core/workers/chunks/{178831b0d0bdabcc45e7.js → 2a676221ca1fc8e0cf34.js} +1 -1
  33. package/assets/esri/core/workers/chunks/2aede0d1dcac8592436b.js +1 -0
  34. package/assets/esri/core/workers/chunks/2b93ad626f5e75b97692.js +1 -0
  35. package/assets/esri/core/workers/chunks/2d03210fc6b5884c6bf9.js +1 -0
  36. package/assets/esri/core/workers/chunks/{b10c333abe4f4e52841c.js → 2dfd3def105005fc72c7.js} +1 -1
  37. package/assets/esri/core/workers/chunks/2f8ff35b8ab15c0e39c2.js +1 -0
  38. package/assets/esri/core/workers/chunks/36272141b3c33cb19026.js +1 -0
  39. package/assets/esri/core/workers/chunks/36c8e8de9c3f67d32572.js +1 -0
  40. package/assets/esri/core/workers/chunks/3ab8c6ae2f2713f637b0.js +1 -0
  41. package/assets/esri/core/workers/chunks/3c058381adcfdc407aa1.js +1 -0
  42. package/assets/esri/core/workers/chunks/3f39df1dfc0a685e5f9d.js +1 -0
  43. package/assets/esri/core/workers/chunks/3fd52a03b3126556aee6.js +1 -0
  44. package/assets/esri/core/workers/chunks/4082d8573f41f952c72e.js +1 -0
  45. package/assets/esri/core/workers/chunks/40b11eea270f6688ff9c.js +1 -0
  46. package/assets/esri/core/workers/chunks/4281b4b27f4767cdd3ae.js +1 -0
  47. package/assets/esri/core/workers/chunks/43fcaaeb6fd179e9199b.js +1 -0
  48. package/assets/esri/core/workers/chunks/4c65b27d80b23c0c3101.js +1 -0
  49. package/assets/esri/core/workers/chunks/{a6406a248b7b2ed65f35.js → 4ec7d59b0c814dbaa7a4.js} +1 -1
  50. package/assets/esri/core/workers/chunks/4f378ad6f4299183df85.js +1 -0
  51. package/assets/esri/core/workers/chunks/505b0aa5ee3e5a26c351.js +1 -0
  52. package/assets/esri/core/workers/chunks/509a9cdd0228a730bcea.js +1 -0
  53. package/assets/esri/core/workers/chunks/52255ad573cec0a34720.js +1 -0
  54. package/assets/esri/core/workers/chunks/52d4fdc451a58a858af1.js +1 -0
  55. package/assets/esri/core/workers/chunks/5405f478af3563580926.js +1 -0
  56. package/assets/esri/core/workers/chunks/54577c2522ca3ff08f7e.js +1 -0
  57. package/assets/esri/core/workers/chunks/54d67e450da6ce2641b4.js +1 -0
  58. package/assets/esri/core/workers/chunks/56d3cb0ae0069a8eadde.js +1 -0
  59. package/assets/esri/core/workers/chunks/5b4efe0014162f777534.js +1 -0
  60. package/assets/esri/core/workers/chunks/5baa162351551817838b.js +1 -0
  61. package/assets/esri/core/workers/chunks/5cf2064bfd9d0847d9ec.js +1 -0
  62. package/assets/esri/core/workers/chunks/620dc3c13c345d5aa9f6.js +1 -0
  63. package/assets/esri/core/workers/chunks/7c290763920f52a1f504.js +1 -0
  64. package/assets/esri/core/workers/chunks/7dc266be958e34e81007.js +972 -0
  65. package/assets/esri/core/workers/chunks/7dfd70f4fa1096e56641.js +1 -0
  66. package/assets/esri/core/workers/chunks/7f097de06972a68cd08a.js +1 -0
  67. package/assets/esri/core/workers/chunks/8033531b0cc706b40d86.js +1 -0
  68. package/assets/esri/core/workers/chunks/814234844a056d9f1ddc.js +1 -0
  69. package/assets/esri/core/workers/chunks/83700cdd60ceecc639cd.js +1 -0
  70. package/assets/esri/core/workers/chunks/857df84cea67079a91e5.js +1 -0
  71. package/assets/esri/core/workers/chunks/8793070d288878d6f49b.js +1 -0
  72. package/assets/esri/core/workers/chunks/8865c5cc28df60364e60.js +1 -0
  73. package/assets/esri/core/workers/chunks/{e9f786d4ba3143ed9644.js → 8cc85d1d46dda16ad041.js} +1 -1
  74. package/assets/esri/core/workers/chunks/958a7ef2cbf048819988.js +1 -0
  75. package/assets/esri/core/workers/chunks/967af0aa4dc4da032fdc.js +1 -0
  76. package/assets/esri/core/workers/chunks/9722880bd7f455b2bd07.js +1 -0
  77. package/assets/esri/core/workers/chunks/9d738aab0d907cd09a9d.js +1 -0
  78. package/assets/esri/core/workers/chunks/{86b31ae136f931d7884a.js → 9e6df034d7949880471f.js} +1 -1
  79. package/assets/esri/core/workers/chunks/a056a79f31cddb066f15.js +1 -0
  80. package/assets/esri/core/workers/chunks/a2c9fd78d42df7314a3e.js +1 -0
  81. package/assets/esri/core/workers/chunks/a4dcb50f6622cb1444c8.js +1 -0
  82. package/assets/esri/core/workers/chunks/a6bfbe449b8c2fa5334c.js +1 -0
  83. package/assets/esri/core/workers/chunks/a8ed1a938dc164b401d9.js +1 -0
  84. package/assets/esri/core/workers/chunks/a9a73bc4875a5aeaf1b9.js +1 -0
  85. package/assets/esri/core/workers/chunks/ac0df52b2f2a4874e4ea.js +1 -0
  86. package/assets/esri/core/workers/chunks/{431efa172901ab8e4d53.js → acfa8eb19225f7862b1d.js} +1 -1
  87. package/assets/esri/core/workers/chunks/adae54f116f311d72d97.js +1 -0
  88. package/assets/esri/core/workers/chunks/{718073d13d3de67b629b.js → aeeb364b7c1876f6e7db.js} +1 -1
  89. package/assets/esri/core/workers/chunks/afddfe620e6539991e6b.js +1 -0
  90. package/assets/esri/core/workers/chunks/b02a83845d3da4caee9d.js +1 -0
  91. package/assets/esri/core/workers/chunks/{0d21506b7d4f9afdbb09.js → b3847a6bbd45d813f03c.js} +1 -1
  92. package/assets/esri/core/workers/chunks/b4c23630d6c85f7b59c0.js +1 -0
  93. package/assets/esri/core/workers/chunks/{c318b229911b60fc3cbf.js → b50ae3dc7e43ff452568.js} +1 -1
  94. package/assets/esri/core/workers/chunks/b5ede4df4620097c6528.js +1 -0
  95. package/assets/esri/core/workers/chunks/b7d7ad127f8939cbdec2.js +1 -0
  96. package/assets/esri/core/workers/chunks/bf1d1c02d12b526b0750.js +1 -0
  97. package/assets/esri/core/workers/chunks/c0e6dbecdbd30066a82c.js +1 -0
  98. package/assets/esri/core/workers/chunks/c2a36243eb105d570bff.js +1 -0
  99. package/assets/esri/core/workers/chunks/c8a3a28809542396c6fd.js +1 -0
  100. package/assets/esri/core/workers/chunks/cf1047ad176a25dcd2d6.js +1 -0
  101. package/assets/esri/core/workers/chunks/d03de043d43691665a93.js +1 -0
  102. package/assets/esri/core/workers/chunks/d3fecbaca51ef8844026.js +1 -0
  103. package/assets/esri/core/workers/chunks/dafe120243db6648a4ab.js +1 -0
  104. package/assets/esri/core/workers/chunks/dccc33d87cb7d902f5c7.js +1 -0
  105. package/assets/esri/core/workers/chunks/dd43f5647900ee27af22.js +1 -0
  106. package/assets/esri/core/workers/chunks/{52489e2f7748dc610263.js → dfdd853dd6c023089963.js} +1 -1
  107. package/assets/esri/core/workers/chunks/e6f76f62cf58fb1e67c6.js +1 -0
  108. package/assets/esri/core/workers/chunks/ea73a1d9cad5e1a5d861.js +1 -0
  109. package/assets/esri/core/workers/chunks/{4130ea1f5a9f197168d7.js → ed4519ac9533a4d340f1.js} +1 -1
  110. package/assets/esri/core/workers/chunks/f0e462f5a16852f33225.js +1 -0
  111. package/assets/esri/core/workers/chunks/f13c29bcc71aed8f3a2e.js +1 -0
  112. package/assets/esri/core/workers/chunks/f356e505c36397fda3cf.js +1 -0
  113. package/assets/esri/core/workers/chunks/f55cbaf5a1d6ee6ac171.js +1 -0
  114. package/assets/esri/core/workers/chunks/f6e613ae6812a347a26c.js +1 -0
  115. package/assets/esri/core/workers/chunks/fb3279408bd5323ec612.js +1 -0
  116. package/assets/esri/core/workers/chunks/fdf80a371b7b2a45f1ff.js +1 -0
  117. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  118. package/chunks/ChapmanAtmosphere.glsl.js +15 -15
  119. package/chunks/CheckerBoard.glsl.js +3 -3
  120. package/chunks/Clouds.glsl.js +2 -3
  121. package/chunks/CloudsComposition.glsl.js +3 -3
  122. package/chunks/ColorMaterial.glsl.js +11 -11
  123. package/chunks/DefaultMaterial.glsl.js +26 -26
  124. package/chunks/EdgeShader.glsl.js +3 -3
  125. package/chunks/Fog.glsl.js +6 -6
  126. package/chunks/HUDMaterial.glsl.js +48 -48
  127. package/chunks/HeatmapDensity.glsl.js +7 -7
  128. package/chunks/HighlightApply.glsl.js +3 -3
  129. package/chunks/LineCallout.glsl.js +3 -3
  130. package/chunks/LineMarker.glsl.js +22 -22
  131. package/chunks/MeasurementArrow.glsl.js +4 -4
  132. package/chunks/NativeLine.glsl.js +11 -11
  133. package/chunks/Path.glsl.js +16 -16
  134. package/chunks/Pattern.glsl.js +30 -30
  135. package/chunks/RasterColorizer.glsl.js +4 -4
  136. package/chunks/RealisticTree.glsl.js +20 -20
  137. package/chunks/RibbonLine.glsl.js +39 -39
  138. package/chunks/ShadedColorMaterial.glsl.js +10 -10
  139. package/chunks/ShadowCastVisualize.glsl.js +5 -5
  140. package/chunks/ShadowHighlight.glsl.js +2 -2
  141. package/chunks/SlicePlaneMaterial.glsl.js +3 -3
  142. package/chunks/Stars.glsl.js +2 -2
  143. package/chunks/WaterSurface.glsl.js +20 -20
  144. package/chunks/languageUtils.js +1 -1
  145. package/chunks/persistableUrlUtils.js +1 -1
  146. package/chunks/vec22.js +1 -1
  147. package/chunks/vec2f64.js +1 -1
  148. package/chunks/vec3.js +1 -1
  149. package/chunks/vec33.js +1 -1
  150. package/chunks/vec43.js +1 -1
  151. package/colorUtils.js +1 -1
  152. package/config.js +1 -1
  153. package/core/Accessor.js +1 -1
  154. package/core/AsyncUpdate.js +1 -1
  155. package/core/Clonable.js +1 -1
  156. package/core/Collection.js +1 -1
  157. package/core/HandleOwner.js +1 -1
  158. package/core/Loadable.js +1 -1
  159. package/core/NestedMap.js +1 -1
  160. package/core/accessorSupport/DefaultsStore.js +1 -1
  161. package/core/accessorSupport/Properties.js +1 -1
  162. package/core/accessorSupport/decorators/enumeration.js +1 -1
  163. package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
  164. package/core/accessorSupport/extensions/serializableProperty/writePolicyUtils.js +1 -1
  165. package/core/accessorSupport/extensions/serializableProperty/writer.js +1 -1
  166. package/core/accessorSupport/read.js +1 -1
  167. package/core/accessorSupport/tracking.js +1 -1
  168. package/core/accessorSupport/write.js +1 -1
  169. package/core/devEnvironmentUtils.js +1 -1
  170. package/core/has.js +1 -1
  171. package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
  172. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  173. package/core/libs/rbush/PooledRBush.js +1 -1
  174. package/core/promiseUtils.js +1 -1
  175. package/core/reactiveUtils.js +1 -1
  176. package/core/scheduling.js +1 -1
  177. package/core/throttle.js +1 -1
  178. package/core/urlUtils.js +1 -1
  179. package/core/watchUtils.js +1 -1
  180. package/core/workers/RemoteClient.js +1 -1
  181. package/core/workers/WorkerOwner.js +1 -1
  182. package/core/workers/loaderConfig.js +1 -1
  183. package/core/workers/workerFactory.js +1 -1
  184. package/geometry/Mesh.js +1 -1
  185. package/geometry/geometryEngine.js +1 -1
  186. package/geometry/geometryEngineAsync.js +1 -1
  187. package/geometry/projection.js +1 -1
  188. package/geometry/support/axisAngleDegrees.js +1 -1
  189. package/geometry/support/meshUtils/centerAt.js +1 -1
  190. package/geometry/support/meshUtils/deduplicate.js +1 -1
  191. package/geometry/support/meshUtils/elevation.js +1 -1
  192. package/geometry/support/meshUtils/geographicUtils.js +1 -1
  193. package/geometry/support/meshUtils/georeference.js +1 -1
  194. package/geometry/support/meshUtils/loadExternal.js +1 -1
  195. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  196. package/geometry/support/meshUtils/offset.js +1 -1
  197. package/geometry/support/meshUtils/rotate.js +1 -1
  198. package/geometry/support/meshUtils/scale.js +1 -1
  199. package/geometry/support/normalizeUtils.js +1 -1
  200. package/geometry/support/normalizeUtilsCommon.js +1 -1
  201. package/geometry/support/offset.js +1 -1
  202. package/geometry/support/rotate.js +1 -1
  203. package/identity/IdentityManagerBase.js +1 -1
  204. package/identity/IdentityModal.js +1 -1
  205. package/interfaces.d.ts +109 -2
  206. package/intl/locale.js +1 -1
  207. package/intl/messages.js +1 -1
  208. package/kernel.js +1 -1
  209. package/layers/AnalysisLayer.js +1 -1
  210. package/layers/CSVLayer.js +1 -1
  211. package/layers/FeatureLayer.js +1 -1
  212. package/layers/GeoJSONLayer.js +1 -1
  213. package/layers/GeoRSSLayer.js +1 -1
  214. package/layers/ImageryLayer.js +1 -1
  215. package/layers/ImageryTileLayer.js +1 -1
  216. package/layers/Layer.js +1 -1
  217. package/layers/MapImageLayer.js +1 -1
  218. package/layers/MapNotesLayer.js +1 -1
  219. package/layers/OGCFeatureLayer.js +1 -1
  220. package/layers/RouteLayer.js +1 -1
  221. package/layers/SceneLayer.js +1 -1
  222. package/layers/StreamLayer.js +1 -1
  223. package/layers/SubtypeGroupLayer.js +1 -1
  224. package/layers/TileLayer.js +1 -1
  225. package/layers/VectorTileLayer.js +1 -1
  226. package/layers/VoxelLayer.js +1 -1
  227. package/layers/VoxelWasmPerScene.js +1 -1
  228. package/layers/WCSLayer.js +1 -1
  229. package/layers/WFSLayer.js +1 -1
  230. package/layers/WMSLayer.js +1 -1
  231. package/layers/WMTSLayer.js +1 -1
  232. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  233. package/layers/effects/EffectView.js +1 -1
  234. package/layers/effects/FeatureEffectView.js +1 -1
  235. package/layers/effects/jsonUtils.js +1 -1
  236. package/layers/graphics/OptimizedGeometry.js +1 -1
  237. package/layers/graphics/centroid.js +1 -1
  238. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  239. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  240. package/layers/graphics/data/QueryEngineResult.js +1 -1
  241. package/layers/graphics/data/StreamFeatureManager.js +1 -1
  242. package/layers/graphics/editingSupport.js +1 -1
  243. package/layers/graphics/objectIdUtils.js +1 -1
  244. package/layers/graphics/sources/CSVSource.js +1 -1
  245. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  246. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  247. package/layers/graphics/sources/MemorySource.js +1 -1
  248. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  249. package/layers/graphics/sources/WFSSource.js +1 -1
  250. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  251. package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
  252. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  253. package/layers/graphics/sources/geojson/geojson.js +1 -1
  254. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  255. package/layers/graphics/sources/support/QueryTask.js +1 -1
  256. package/layers/mixins/APIKeyMixin.js +1 -1
  257. package/layers/mixins/ArcGISImageService.js +1 -1
  258. package/layers/mixins/ArcGISMapService.js +1 -1
  259. package/layers/mixins/ImageryTileMixin.js +1 -1
  260. package/layers/mixins/OperationalLayer.js +1 -1
  261. package/layers/mixins/PortalLayer.js +1 -1
  262. package/layers/mixins/SceneService.js +1 -1
  263. package/layers/mixins/refresh.js +1 -1
  264. package/layers/ogc/dateUtils.js +1 -1
  265. package/layers/ogc/ogcFeatureUtils.js +1 -1
  266. package/layers/ogc/wfsUtils.js +1 -1
  267. package/layers/save/featureLayerUtils.js +1 -1
  268. package/layers/support/ExportImageParameters.js +1 -1
  269. package/layers/support/ExportImageServiceParameters.js +1 -1
  270. package/layers/support/ExportWMSImageParameters.js +1 -1
  271. package/layers/support/FeatureEffect.js +1 -1
  272. package/layers/support/FeatureType.js +1 -1
  273. package/layers/support/FetchAssociatedFeatureLayer.js +1 -1
  274. package/layers/support/LabelClass.js +1 -1
  275. package/layers/support/LayerContingentValuesCache.js +1 -1
  276. package/layers/support/RasterFunction.js +1 -1
  277. package/layers/support/RasterInfo.js +1 -1
  278. package/layers/support/RasterJobHandler.js +1 -1
  279. package/layers/support/RasterWorker.js +1 -1
  280. package/layers/support/Sublayer.js +1 -1
  281. package/layers/support/SubtypeSublayer.js +1 -1
  282. package/layers/support/TilemapCache.js +1 -1
  283. package/layers/support/TimeReference.d.ts +4 -0
  284. package/layers/support/WMTSSublayer.js +1 -1
  285. package/layers/support/arcgisLayers.js +1 -1
  286. package/layers/support/commonProperties.js +1 -1
  287. package/layers/support/editableLayers.js +1 -1
  288. package/layers/support/fieldUtils.js +1 -1
  289. package/layers/support/floorFilterUtils.js +1 -1
  290. package/layers/support/imageryRendererUtils.js +1 -1
  291. package/layers/support/layerUtils.js +1 -1
  292. package/layers/support/layersCreator.js +1 -1
  293. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  294. package/layers/support/rasterDatasets/CloudRaster.js +1 -1
  295. package/layers/support/rasterDatasets/ImageAuxRaster.js +1 -1
  296. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  297. package/layers/support/rasterDatasets/InMemoryRaster.js +1 -1
  298. package/layers/support/rasterDatasets/MRFRaster.js +1 -1
  299. package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
  300. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  301. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  302. package/layers/support/rasterDatasets/pamParser.js +1 -1
  303. package/layers/support/rasterDatasets/wcsCapabilitiesParser.js +1 -1
  304. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  305. package/layers/support/rasterDatasets/xmlUtilities.js +1 -1
  306. package/layers/support/rasterFormats/Lerc.js +1 -1
  307. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  308. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  309. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  310. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  311. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  312. package/layers/support/rasterFunctions/vectorFieldUtils.js +1 -1
  313. package/layers/support/rasterTransforms/PolynomialTransform.js +1 -1
  314. package/layers/support/rasterTransforms/utils.js +1 -1
  315. package/layers/support/source/DataLayerSource.js +1 -1
  316. package/layers/support/source/QueryTableDataSource.js +1 -1
  317. package/layers/support/vectorTileLayerLoader.js +1 -1
  318. package/layers/support/wmsUtils.js +1 -1
  319. package/layers/support/wmtsUtils.js +1 -1
  320. package/libs/maquette-advanced-projector/projector.js +1 -1
  321. package/networks/Network.js +1 -1
  322. package/networks/UtilityNetwork.js +1 -1
  323. package/networks/support/utils.js +1 -1
  324. package/package.json +1 -1
  325. package/popup/content/ExpressionContent.js +1 -1
  326. package/portal/Portal.js +1 -1
  327. package/portal/PortalItem.js +1 -1
  328. package/portal/support/geometryServiceUtils.js +1 -1
  329. package/portal/support/layersLoader.js +1 -1
  330. package/portal/support/portalItemUtils.js +1 -1
  331. package/portal/support/portalLayers.js +1 -1
  332. package/renderers/DictionaryRenderer.js +1 -1
  333. package/renderers/FlowRenderer.js +1 -1
  334. package/renderers/RasterColormapRenderer.js +1 -1
  335. package/renderers/RasterStretchRenderer.js +1 -1
  336. package/renderers/VectorFieldRenderer.js +1 -1
  337. package/renderers/support/RasterSymbolizer.js +1 -1
  338. package/renderers/support/UniqueValueInfo.js +1 -1
  339. package/renderers/support/colorRampUtils.js +1 -1
  340. package/renderers/support/heatmapUtils.js +1 -1
  341. package/renderers/support/rasterRendererHelper.js +1 -1
  342. package/request.js +1 -1
  343. package/rest/identify.js +1 -1
  344. package/rest/imageService.js +1 -1
  345. package/rest/networkService.js +1 -1
  346. package/rest/networks/support/SynthesizeAssociationGeometriesParameters.js +1 -1
  347. package/rest/operations/identify.js +1 -1
  348. package/rest/print.js +1 -1
  349. package/rest/query/executeQuery.js +1 -1
  350. package/rest/query/operations/query.js +1 -1
  351. package/rest/query/operations/queryRelatedRecords.js +1 -1
  352. package/rest/query/operations/queryTopFeatures.js +1 -1
  353. package/rest/route.js +1 -1
  354. package/rest/support/DirectionLine.js +1 -1
  355. package/rest/support/DirectionPoint.js +1 -1
  356. package/rest/support/DirectionsFeatureSet.js +1 -1
  357. package/rest/support/FeatureSet.js +1 -1
  358. package/rest/support/ImageSampleParameters.js +1 -1
  359. package/rest/support/PointBarrier.js +1 -1
  360. package/rest/support/PolygonBarrier.js +1 -1
  361. package/rest/support/PolylineBarrier.js +1 -1
  362. package/rest/support/RouteInfo.js +1 -1
  363. package/rest/support/Stop.js +1 -1
  364. package/rest/support/meshFeatureSet.js +1 -1
  365. package/rest/support/printTaskUtils.js +1 -1
  366. package/smartMapping/labels/clusters.js +1 -1
  367. package/smartMapping/raster/renderers/rgb.js +1 -1
  368. package/smartMapping/raster/renderers/uniqueValue.js +1 -1
  369. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  370. package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
  371. package/smartMapping/raster/support/utils.js +1 -1
  372. package/smartMapping/renderers/color.js +1 -1
  373. package/smartMapping/renderers/size.js +1 -1
  374. package/smartMapping/renderers/support/utils.js +1 -1
  375. package/smartMapping/renderers/univariateColorSize.js +1 -1
  376. package/smartMapping/statistics/support/WorkerClient.js +1 -1
  377. package/smartMapping/support/adapters/CSVLayerAdapter.js +1 -1
  378. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  379. package/smartMapping/support/adapters/OGCFeatureLayerAdapter.js +1 -1
  380. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  381. package/smartMapping/support/adapters/support/utils.js +1 -1
  382. package/statistics/utils.js +1 -1
  383. package/support/LayersMixin.js +1 -1
  384. package/support/TablesMixin.js +1 -1
  385. package/support/arcadeUtils.js +1 -1
  386. package/support/basemapUtils.js +1 -1
  387. package/support/popupUtils.js +1 -1
  388. package/support/revision.js +1 -1
  389. package/support/timeUtils.js +1 -1
  390. package/symbols/FillSymbol3DLayer.js +1 -1
  391. package/symbols/LineSymbol3DLayer.js +1 -1
  392. package/symbols/LineSymbolMarker.js +1 -1
  393. package/symbols/PictureFillSymbol.js +1 -1
  394. package/symbols/PointSymbol3D.js +1 -1
  395. package/symbols/SimpleLineSymbol.js +1 -1
  396. package/symbols/SimpleMarkerSymbol.js +1 -1
  397. package/symbols/cim/CIMResourceManager.js +1 -1
  398. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  399. package/symbols/cim/CIMSymbolHelper.js +1 -1
  400. package/symbols/cim/ExpandedCIM.js +1 -1
  401. package/symbols/cim/SDFHelper.js +1 -1
  402. package/symbols/cim/cimAnalyzer.js +1 -1
  403. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  404. package/symbols/cim/effects/EffectDashes.js +1 -1
  405. package/symbols/cim/effects/EffectOffset.js +1 -1
  406. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  407. package/symbols/cim/utils.js +1 -1
  408. package/symbols/support/cimSymbolUtils.js +1 -1
  409. package/symbols/support/jsonUtils.js +1 -1
  410. package/symbols/support/previewCIMSymbol.js +1 -1
  411. package/symbols/support/previewSymbol2D.js +1 -1
  412. package/symbols/support/previewSymbol3D.js +1 -1
  413. package/symbols/support/previewWebStyleSymbol.js +1 -1
  414. package/symbols/support/svgUtils.js +1 -1
  415. package/symbols/support/symbolConversion.js +1 -1
  416. package/symbols/support/symbolUtils.js +1 -1
  417. package/tasks/GenerateRendererTask.js +1 -1
  418. package/views/2d/MapViewConstraints.js +1 -1
  419. package/views/2d/constraints/GeometryConstraint.js +1 -1
  420. package/views/2d/engine/Bitmap.js +1 -1
  421. package/views/2d/engine/Container.js +1 -1
  422. package/views/2d/engine/DisplayObject.js +1 -1
  423. package/views/2d/engine/Stage.js +1 -1
  424. package/views/2d/engine/imagery/BrushRasterBitmap.js +1 -1
  425. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  426. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  427. package/views/2d/engine/vectorTiles/TilemapRequest.js +1 -1
  428. package/views/2d/engine/vectorTiles/WorkerTileHandler.js +1 -1
  429. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  430. package/views/2d/engine/vectorTiles/buckets/LineBucket.js +1 -1
  431. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  432. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  433. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  434. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  435. package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
  436. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  437. package/views/2d/engine/webgl/GraphicTile.js +1 -1
  438. package/views/2d/engine/webgl/TextureManager.js +1 -1
  439. package/views/2d/engine/webgl/brushes/WGLBrushHeatmap.js +1 -1
  440. package/views/2d/engine/webgl/brushes/WGLBrushVTLCircle.js +1 -1
  441. package/views/2d/engine/webgl/brushes/WGLBrushVTLFill.js +1 -1
  442. package/views/2d/engine/webgl/brushes/WGLBrushVTLLine.js +1 -1
  443. package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
  444. package/views/2d/engine/webgl/collisions/MetricReader.js +1 -1
  445. package/views/2d/engine/webgl/cpuMapped/DisplayRecordReader.js +1 -1
  446. package/views/2d/engine/webgl/cpuMapped/FreeList.js +1 -1
  447. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  448. package/views/2d/engine/webgl/mesh/templates/WGLBaseLineTemplate.js +1 -1
  449. package/views/2d/engine/webgl/mesh/templates/WGLBaseMarkerTemplate.js +1 -1
  450. package/views/2d/engine/webgl/mesh/templates/WGLBaseTextTemplate.js +1 -1
  451. package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
  452. package/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js +1 -1
  453. package/views/2d/engine/webgl/mesh/templates/WGLLineTemplate.js +1 -1
  454. package/views/2d/engine/webgl/mesh/templates/WGLMeshTemplate.js +1 -1
  455. package/views/2d/engine/webgl/painter/RenderPass.js +1 -1
  456. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  457. package/views/2d/engine/webgl/techniques/dotDensity/TechniqueDotDensity.js +1 -1
  458. package/views/2d/input/MapViewInputManager.js +1 -1
  459. package/views/2d/input/handlers/GamepadNavigation.js +1 -1
  460. package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
  461. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  462. package/views/2d/layers/BaseLayerView2D.js +1 -1
  463. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  464. package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
  465. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  466. package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
  467. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  468. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  469. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  470. package/views/2d/layers/KMLLayerView2D.js +1 -1
  471. package/views/2d/layers/LayerView2D.js +1 -1
  472. package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
  473. package/views/2d/layers/TileLayerView2D.js +1 -1
  474. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  475. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  476. package/views/2d/layers/features/FeatureStore2D.js +1 -1
  477. package/views/2d/layers/features/Pipeline.js +1 -1
  478. package/views/2d/layers/features/batchUtils.js +1 -1
  479. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  480. package/views/2d/layers/features/controllers/support/sourceAdapters.js +1 -1
  481. package/views/2d/layers/features/createSymbolSchema.js +1 -1
  482. package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
  483. package/views/2d/layers/features/schemaUtils.js +1 -1
  484. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  485. package/views/2d/layers/features/sources/DataTileSource.js +1 -1
  486. package/views/2d/layers/features/sources/DataTileSubscription.js +1 -1
  487. package/views/2d/layers/features/sources/SnapshotFeatureSource.js +1 -1
  488. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  489. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  490. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  491. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  492. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  493. package/views/2d/layers/features/support/ResourceManagerProxy.js +1 -1
  494. package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
  495. package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
  496. package/views/2d/layers/graphics/graphicsUtils.js +1 -1
  497. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  498. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  499. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  500. package/views/2d/layers/support/ExportStrategy.js +1 -1
  501. package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
  502. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  503. package/views/2d/support/engineHelpers.js +1 -1
  504. package/views/2d/tiling/TileManager.js +1 -1
  505. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  506. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  507. package/views/3d/analysis/Dimensioning/DimensioningVisualization.js +5 -0
  508. package/views/3d/analysis/Dimensioning/LinearDimensionVisualization.js +5 -0
  509. package/views/3d/analysis/DimensioningAnalysisView3D.js +1 -1
  510. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  511. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  512. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  513. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  514. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  515. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  516. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  517. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  518. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  519. package/views/3d/environment/Clouds.glsl.js +1 -1
  520. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  521. package/views/3d/environment/CloudsComposition.js +1 -1
  522. package/views/3d/environment/CloudsCompositionParameters.js +5 -0
  523. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  524. package/views/3d/environment/Fog.glsl.js +1 -1
  525. package/views/3d/environment/Fog.js +1 -1
  526. package/views/3d/environment/Precipitation.js +1 -1
  527. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  528. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  529. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  530. package/views/3d/environment/Stars.glsl.js +1 -1
  531. package/views/3d/environment/Stars.js +1 -1
  532. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  533. package/views/3d/glTF/internal/Resource.js +1 -1
  534. package/views/3d/glTF/loader.js +1 -1
  535. package/views/3d/input/SceneInputManager.js +1 -1
  536. package/views/3d/input/handlers/TwoFingerTilt.js +1 -1
  537. package/views/3d/interactive/Manipulator3D.js +1 -1
  538. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  539. package/views/3d/interactive/editingTools/manipulations/MoveManipulation.js +1 -1
  540. package/views/3d/interactive/editingTools/moveGraphic/isSupportedGraphic.js +1 -1
  541. package/views/3d/interactive/editingTools/reshapeGraphic/GraphicReshapeTool.js +1 -1
  542. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  543. package/views/3d/interactive/editingTools/reshapeGraphic/isSupportedGraphic.js +1 -1
  544. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  545. package/views/3d/interactive/editingTools/transformGraphic/isSupportedGraphic.js +1 -1
  546. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  547. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  548. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  549. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  550. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  551. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  552. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  553. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  554. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  555. package/views/3d/layers/FeatureLayerView3D.js +1 -1
  556. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  557. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  558. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  559. package/views/3d/layers/GraphicsView3D.js +1 -1
  560. package/views/3d/layers/I3SMeshView3D.js +1 -1
  561. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  562. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  563. package/views/3d/layers/LayerView3D.js +1 -1
  564. package/views/3d/layers/RouteLayerView3D.js +1 -1
  565. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  566. package/views/3d/layers/SceneLayerView3D.js +1 -1
  567. package/views/3d/layers/SceneLayerWorker.js +1 -1
  568. package/views/3d/layers/StreamLayerView3D.js +1 -1
  569. package/views/3d/layers/TiledLayerView3D.js +1 -1
  570. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  571. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  572. package/views/3d/layers/WMSLayerView3D.js +1 -1
  573. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  574. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  575. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  576. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  577. package/views/3d/layers/graphics/Graphics3DFilterVisibility.js +1 -1
  578. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  579. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  580. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  581. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  582. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  583. package/views/3d/layers/graphics/Graphics3DPointSymbol.js +1 -1
  584. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  585. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  586. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  587. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  588. package/views/3d/layers/graphics/Labeler.js +1 -1
  589. package/views/3d/layers/i3s/I3SAttributeOverrides.js +1 -1
  590. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  591. package/views/3d/layers/i3s/I3SStreamDataController.js +1 -1
  592. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  593. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  594. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  595. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  596. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  597. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  598. package/views/3d/state/ConstraintsManager.js +1 -1
  599. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  600. package/views/3d/support/ResourceController.js +1 -1
  601. package/views/3d/support/SharedSymbolResources.js +1 -1
  602. package/views/3d/support/TextureCollection.js +1 -1
  603. package/views/3d/support/cameraUtils.js +1 -1
  604. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  605. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  606. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  607. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  608. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  609. package/views/3d/terrain/OverlayManager.js +1 -1
  610. package/views/3d/terrain/OverlayRenderer.js +1 -1
  611. package/views/3d/terrain/PatchGeometry.js +1 -1
  612. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  613. package/views/3d/terrain/PatchRenderData.js +1 -1
  614. package/views/3d/terrain/PlanarPatch.js +1 -1
  615. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  616. package/views/3d/terrain/RasterTile.js +1 -1
  617. package/views/3d/terrain/SphericalPatch.js +1 -1
  618. package/views/3d/terrain/TerrainRenderer.js +1 -1
  619. package/views/3d/terrain/TerrainSurface.js +1 -1
  620. package/views/3d/terrain/Tile.js +1 -1
  621. package/views/3d/terrain/TileCompositor.js +1 -1
  622. package/views/3d/terrain/TileRenderer.js +1 -1
  623. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  624. package/views/3d/terrain/terrainUtils.js +1 -1
  625. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  626. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  627. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  628. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +2 -2
  629. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  630. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +1 -1
  631. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +5 -5
  632. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +8 -8
  633. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +6 -6
  634. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +4 -4
  635. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  636. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +5 -5
  637. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +13 -13
  638. package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
  639. package/views/3d/webgl-engine/core/shaderLibrary/raster/Colormap.glsl.js +1 -1
  640. package/views/3d/webgl-engine/core/shaderLibrary/raster/Common.glsl.js +2 -2
  641. package/views/3d/webgl-engine/core/shaderLibrary/raster/Projection.glsl.js +1 -1
  642. package/views/3d/webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl.js +1 -1
  643. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +1 -1
  644. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +5 -5
  645. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js +3 -3
  646. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +13 -13
  647. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +17 -17
  648. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +1 -1
  649. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +7 -7
  650. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +2 -2
  651. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +5 -5
  652. package/views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js +2 -2
  653. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +15 -15
  654. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +2 -2
  655. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  656. package/views/3d/webgl-engine/core/shaderModules/BooleanPassUniform.js +5 -0
  657. package/views/3d/webgl-engine/core/shaderModules/Float4DrawUniform.js +5 -0
  658. package/views/3d/webgl-engine/core/shaderModules/{Matrix3Uniform.js → Float4PassUniform.js} +1 -1
  659. package/views/3d/webgl-engine/core/shaderModules/Float4Uniform.js +1 -1
  660. package/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform.js +5 -0
  661. package/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform.js +5 -0
  662. package/views/3d/webgl-engine/core/shaderModules/{TextureCubeUniform.js → TextureCubePassUniform.js} +1 -1
  663. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js +1 -1
  664. package/views/3d/webgl-engine/lib/AutoDisposable.js +1 -1
  665. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  666. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  667. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  668. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  669. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  670. package/views/3d/webgl-engine/lib/ShadowHighlight.js +1 -1
  671. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  672. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  673. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  674. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  675. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  676. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  677. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  678. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  679. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  680. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  681. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  682. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  683. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  684. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  685. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  686. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  687. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  688. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  689. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  690. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  691. package/views/3d/webgl-engine/materials/{VisualVariableMaterialParameters.js → VisualVariablePassParameters.js} +1 -1
  692. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  693. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  694. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  695. package/views/3d/webgl-engine/parts/requireUtils.js +1 -1
  696. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  697. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  698. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  699. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  700. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  701. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  702. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  703. package/views/3d/webgl-engine/shaders/HeatmapDensity.glsl.js +1 -1
  704. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  705. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  706. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  707. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  708. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  709. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +3 -3
  710. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  711. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  712. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  713. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  714. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  715. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  716. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  717. package/views/3d/webgl-engine/shaders/ShadowCastVisualize.glsl.js +1 -1
  718. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  719. package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
  720. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  721. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +3 -3
  722. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShader.glsl.js +1 -1
  723. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +5 -5
  724. package/views/BasemapView.js +1 -1
  725. package/views/GroundView.js +1 -1
  726. package/views/LayerViewManager.js +1 -1
  727. package/views/MapView.js +1 -1
  728. package/views/SceneView.js +1 -1
  729. package/views/ToolViewManager.js +1 -1
  730. package/views/View.js +1 -1
  731. package/views/draw/DrawAction.js +1 -1
  732. package/views/draw/DrawGraphicTool.js +1 -1
  733. package/views/draw/DrawOperation.js +1 -1
  734. package/views/draw/DrawTool.js +1 -1
  735. package/views/draw/support/Box.js +1 -1
  736. package/views/draw/support/GraphicMover.js +1 -1
  737. package/views/draw/support/Reshape.js +1 -1
  738. package/views/interactive/coordinateHelper.js +1 -1
  739. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  740. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  741. package/views/interactive/snapping/SnappingManager.js +1 -1
  742. package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
  743. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  744. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  745. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  746. package/views/layers/FeatureLayerView.js +1 -1
  747. package/views/layers/GroupLayerView.js +1 -1
  748. package/views/layers/ImageryLayerView.js +1 -1
  749. package/views/layers/ImageryTileLayerView.js +1 -1
  750. package/views/layers/LayerView.js +1 -1
  751. package/views/layers/MapImageLayerView.js +1 -1
  752. package/views/layers/WMSLayerView.js +1 -1
  753. package/views/support/AllocationTracer.js +1 -1
  754. package/views/support/DefaultsFromMap.js +1 -1
  755. package/views/support/geometry2dUtils.js +1 -1
  756. package/views/support/layerViewUtils.js +1 -1
  757. package/views/support/waitForResources.js +1 -1
  758. package/views/ui/UI.js +1 -1
  759. package/views/webgl/BufferObject.js +1 -1
  760. package/views/webgl/FramebufferObject.js +1 -1
  761. package/views/webgl/RenderingContext.js +1 -1
  762. package/views/webgl/Texture.js +1 -1
  763. package/views/webgl/UniformBufferLayout.js +1 -1
  764. package/views/webgl/VertexArrayObject.js +1 -1
  765. package/views/webgl/capabilities.js +1 -1
  766. package/views/webgl/rasterUtils.js +1 -1
  767. package/views/webgl/testFloatBufferBlend.js +1 -1
  768. package/webdoc/widgets/TimeSlider.js +1 -1
  769. package/webmap/Bookmark.js +1 -1
  770. package/webscene/Slide.js +1 -1
  771. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  772. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  773. package/widgets/AreaMeasurement2D.js +1 -1
  774. package/widgets/AreaMeasurement3D.js +1 -1
  775. package/widgets/Attribution.js +1 -1
  776. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  777. package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
  778. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  779. package/widgets/BasemapLayerList.js +1 -1
  780. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  781. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  782. package/widgets/Bookmarks.js +1 -1
  783. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  784. package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
  785. package/widgets/BuildingExplorer/BuildingLevel.js +1 -1
  786. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  787. package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
  788. package/widgets/BuildingExplorer/BuildingPhase.js +1 -1
  789. package/widgets/BuildingExplorer/support/buildingLayerUtils.js +1 -1
  790. package/widgets/BuildingExplorer.js +1 -1
  791. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  792. package/widgets/CoordinateConversion/support/Format.js +1 -1
  793. package/widgets/Daylight/DaylightViewModel.js +1 -1
  794. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  795. package/widgets/Daylight.js +1 -1
  796. package/widgets/DirectLineMeasurement3D.js +1 -1
  797. package/widgets/Directions/DirectionsViewModel.js +1 -1
  798. package/widgets/Directions.js +1 -1
  799. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  800. package/widgets/DistanceMeasurement2D.js +1 -1
  801. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  802. package/widgets/Editor/CreateWorkflow.js +1 -1
  803. package/widgets/Editor/EditorViewModel.js +1 -1
  804. package/widgets/Editor/UpdateWorkflow.js +1 -1
  805. package/widgets/Editor/workflowUtils.js +1 -1
  806. package/widgets/Editor.js +1 -1
  807. package/widgets/ElevationProfile/ElevationProfileLineGround.js +1 -1
  808. package/widgets/ElevationProfile/ElevationProfileLineInput.js +1 -1
  809. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  810. package/widgets/ElevationProfile/ElevationProfileTool.js +1 -1
  811. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  812. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  813. package/widgets/ElevationProfile/support/elevationQuerySourceUtils.js +1 -1
  814. package/widgets/ElevationProfile/support/profileUtils.js +1 -1
  815. package/widgets/ElevationProfile.js +1 -1
  816. package/widgets/Expand.js +1 -1
  817. package/widgets/Feature/FeatureAttachments.js +1 -1
  818. package/widgets/Feature/FeatureContent.js +1 -1
  819. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  820. package/widgets/Feature/FeatureExpression.js +1 -1
  821. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  822. package/widgets/Feature/FeatureFields.js +1 -1
  823. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  824. package/widgets/Feature/FeatureMedia.js +1 -1
  825. package/widgets/Feature/FeatureViewModel.js +1 -1
  826. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  827. package/widgets/Feature/support/featureUtils.js +1 -1
  828. package/widgets/Feature/support/relatedFeatureUtils.js +1 -1
  829. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  830. package/widgets/FeatureForm/InputField.js +1 -1
  831. package/widgets/FeatureForm/support/formTemplateUtils.js +1 -1
  832. package/widgets/FeatureForm.js +1 -1
  833. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  834. package/widgets/FeatureTable/FieldColumn.js +1 -1
  835. package/widgets/FeatureTable/Grid/Column.js +1 -1
  836. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  837. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  838. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  839. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  840. package/widgets/FeatureTable/Grid/support/LocalStore.js +1 -1
  841. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  842. package/widgets/FeatureTable.js +1 -1
  843. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  844. package/widgets/FeatureTemplates/ItemList.js +1 -1
  845. package/widgets/FeatureTemplates/TemplateItem.js +1 -1
  846. package/widgets/FeatureTemplates.js +1 -1
  847. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  848. package/widgets/FloorFilter.js +1 -1
  849. package/widgets/Fullscreen.js +1 -1
  850. package/widgets/Home.js +1 -1
  851. package/widgets/LayerList/LayerListViewModel.js +1 -1
  852. package/widgets/LayerList/support/layerListUtils.js +1 -1
  853. package/widgets/LayerList.js +1 -1
  854. package/widgets/Legend/LegendViewModel.js +1 -1
  855. package/widgets/Legend/styles/Card.js +1 -1
  856. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  857. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  858. package/widgets/Legend/support/clusterUtils.js +1 -1
  859. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  860. package/widgets/Locate/LocateViewModel.js +1 -1
  861. package/widgets/Popup/PopupViewModel.js +1 -1
  862. package/widgets/Popup/actionUtils.js +1 -1
  863. package/widgets/Popup.js +1 -1
  864. package/widgets/Print/PrintViewModel.js +1 -1
  865. package/widgets/Print.js +1 -1
  866. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  867. package/widgets/Search/LayerSearchSource.js +1 -1
  868. package/widgets/Search/SearchResultRenderer.js +1 -1
  869. package/widgets/Search/SearchViewModel.js +1 -1
  870. package/widgets/Search/support/geometryUtils.js +1 -1
  871. package/widgets/Search/support/layerSearchUtils.js +1 -1
  872. package/widgets/Search/support/locatorUtils.js +1 -1
  873. package/widgets/Search.js +1 -1
  874. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  875. package/widgets/ShadowCast/components/Label.js +1 -1
  876. package/widgets/ShadowCast/components/TimezonePicker.js +1 -1
  877. package/widgets/ShadowCast.js +1 -1
  878. package/widgets/Sketch/SketchViewModel.js +1 -1
  879. package/widgets/Sketch.js +1 -1
  880. package/widgets/Slider.js +1 -1
  881. package/widgets/Swipe/SwipeViewModel.js +1 -1
  882. package/widgets/TableList/TableListViewModel.js +1 -1
  883. package/widgets/TableList/support/tableListUtils.js +1 -1
  884. package/widgets/TableList.js +1 -1
  885. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  886. package/widgets/TimeSlider/utils.js +1 -1
  887. package/widgets/TimeSlider.js +1 -1
  888. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  889. package/widgets/Weather.js +1 -1
  890. package/widgets/Widget.js +1 -1
  891. package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.js +1 -1
  892. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  893. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  894. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  895. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  896. package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
  897. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  898. package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
  899. package/widgets/support/AnalysisViewModel.js +1 -1
  900. package/widgets/support/ColorPicker.js +1 -1
  901. package/widgets/support/DatePicker.js +1 -1
  902. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  903. package/widgets/support/Popover.js +1 -1
  904. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  905. package/widgets/support/SelectionToolbar.js +1 -1
  906. package/widgets/support/Selector2D/SelectionOperation2D.js +1 -1
  907. package/widgets/support/Selector2D.js +1 -1
  908. package/widgets/support/SnappingControls/SnappingControlsViewModel.js +1 -1
  909. package/widgets/support/SnappingControls.js +1 -1
  910. package/widgets/support/jsxWidgetSupport.js +1 -1
  911. package/widgets/support/widgetUtils.js +1 -1
  912. package/assets/esri/core/workers/chunks/049c5c30bd37693dddb7.js +0 -1
  913. package/assets/esri/core/workers/chunks/055a0ebf22a82f859474.js +0 -1
  914. package/assets/esri/core/workers/chunks/0b12ff7b2ed2838afbb8.js +0 -1
  915. package/assets/esri/core/workers/chunks/0e25548573baf855e394.js +0 -1
  916. package/assets/esri/core/workers/chunks/0edd4c3ca6e7d749d0e5.js +0 -1
  917. package/assets/esri/core/workers/chunks/0fcbf7e2db58e38ee6d1.js +0 -1
  918. package/assets/esri/core/workers/chunks/133f971e72a1a6277ac4.js +0 -1
  919. package/assets/esri/core/workers/chunks/135a90ae61f3b3cae91b.js +0 -1
  920. package/assets/esri/core/workers/chunks/13fde7fd56c39fa3f2d5.js +0 -1
  921. package/assets/esri/core/workers/chunks/1c90855c3b0e5dcff908.js +0 -1
  922. package/assets/esri/core/workers/chunks/1dbef1919c7ac10a6bcc.js +0 -1
  923. package/assets/esri/core/workers/chunks/1facbda248863cf72cbd.js +0 -1
  924. package/assets/esri/core/workers/chunks/1fb2d7abe6c8efa84695.js +0 -1
  925. package/assets/esri/core/workers/chunks/2068377c2a796d5f2245.js +0 -1
  926. package/assets/esri/core/workers/chunks/28a5878cbe5880476855.js +0 -1
  927. package/assets/esri/core/workers/chunks/2cf3934b3ecabdf207c8.js +0 -1
  928. package/assets/esri/core/workers/chunks/2d42711a629384144625.js +0 -1
  929. package/assets/esri/core/workers/chunks/3021fda52083fc67d18c.js +0 -1
  930. package/assets/esri/core/workers/chunks/30333a95dc0a44e23fb5.js +0 -1
  931. package/assets/esri/core/workers/chunks/30837d93116f0337972f.js +0 -1
  932. package/assets/esri/core/workers/chunks/320543485c8e22485075.js +0 -1
  933. package/assets/esri/core/workers/chunks/3f0f7da92a6e4493686e.js +0 -1
  934. package/assets/esri/core/workers/chunks/42057f252ba4e82a8b45.js +0 -1
  935. package/assets/esri/core/workers/chunks/45a3f6033cdf4bc74a4c.js +0 -1
  936. package/assets/esri/core/workers/chunks/492b65fe99641f5740f0.js +0 -1
  937. package/assets/esri/core/workers/chunks/4d1cd7df617273c489f4.js +0 -1
  938. package/assets/esri/core/workers/chunks/4df9dfa80dbbae9b743d.js +0 -1
  939. package/assets/esri/core/workers/chunks/515c1c055666ff4740f3.js +0 -1
  940. package/assets/esri/core/workers/chunks/541e644fc77dbe527124.js +0 -1
  941. package/assets/esri/core/workers/chunks/59e341b2db44351bf557.js +0 -1
  942. package/assets/esri/core/workers/chunks/5a10b58533b4116115ac.js +0 -1
  943. package/assets/esri/core/workers/chunks/5f940853341d7e2bc852.js +0 -1
  944. package/assets/esri/core/workers/chunks/5ff2cdecf95e0136dd52.js +0 -1
  945. package/assets/esri/core/workers/chunks/6147bfbe2bd7292d6ad0.js +0 -1
  946. package/assets/esri/core/workers/chunks/6467f996fe9f136c370b.js +0 -1
  947. package/assets/esri/core/workers/chunks/682a8f15f352de76df69.js +0 -1
  948. package/assets/esri/core/workers/chunks/6a06635089761ee3e6d4.js +0 -972
  949. package/assets/esri/core/workers/chunks/725828a41917d3d56f2d.js +0 -1
  950. package/assets/esri/core/workers/chunks/794b47764ebb0257ed41.js +0 -1
  951. package/assets/esri/core/workers/chunks/7fd03a75eb07a09cda35.js +0 -1
  952. package/assets/esri/core/workers/chunks/86ad6b020c01850d9095.js +0 -1
  953. package/assets/esri/core/workers/chunks/86f9d1ce36661781d962.js +0 -1
  954. package/assets/esri/core/workers/chunks/8dcf6c836b53b40dfbf1.js +0 -1
  955. package/assets/esri/core/workers/chunks/8e98ff9404a802352037.js +0 -1
  956. package/assets/esri/core/workers/chunks/94e51fe1c539df6257c2.js +0 -1
  957. package/assets/esri/core/workers/chunks/9519a02b9b8db88a3150.js +0 -1
  958. package/assets/esri/core/workers/chunks/9a8b50ed75219b4a42e1.js +0 -1
  959. package/assets/esri/core/workers/chunks/9f3a094aa4b47e4eb046.js +0 -1
  960. package/assets/esri/core/workers/chunks/a0ebf25c9c9a7f839b93.js +0 -1
  961. package/assets/esri/core/workers/chunks/a25f0a195f9217665530.js +0 -1
  962. package/assets/esri/core/workers/chunks/a2be1e0b632cef87f6a4.js +0 -1
  963. package/assets/esri/core/workers/chunks/a4d8cf9829da9cfc5f36.js +0 -1
  964. package/assets/esri/core/workers/chunks/a562059dbdd1bf1fab66.js +0 -1
  965. package/assets/esri/core/workers/chunks/a59ee7d2b98c85f27dd2.js +0 -1
  966. package/assets/esri/core/workers/chunks/a5dbab94697757c87c49.js +0 -1
  967. package/assets/esri/core/workers/chunks/a5e65d5a7a536759d1cc.js +0 -1
  968. package/assets/esri/core/workers/chunks/a8ac0b6a3eba35e3a5b6.js +0 -1
  969. package/assets/esri/core/workers/chunks/acbd0f4d72d1f5d8e4e8.js +0 -1
  970. package/assets/esri/core/workers/chunks/acc97a210f36bff2d1b0.js +0 -1
  971. package/assets/esri/core/workers/chunks/ad68fe924456d6d7d4f0.js +0 -1
  972. package/assets/esri/core/workers/chunks/b06c949fc7d08e376a5f.js +0 -1
  973. package/assets/esri/core/workers/chunks/b26bd8fde2fc65bb67fb.js +0 -1
  974. package/assets/esri/core/workers/chunks/b4405e9fe6c0cf7250d3.js +0 -1
  975. package/assets/esri/core/workers/chunks/bc08fe3b03767bd694c5.js +0 -1
  976. package/assets/esri/core/workers/chunks/c11501e96ffd81bf39a0.js +0 -1
  977. package/assets/esri/core/workers/chunks/c44116378cc1bc627044.js +0 -1
  978. package/assets/esri/core/workers/chunks/c9b09099488d0e719dfb.js +0 -1
  979. package/assets/esri/core/workers/chunks/cbea4f1eb814115748db.js +0 -1
  980. package/assets/esri/core/workers/chunks/ce262a2accd982988ef1.js +0 -1
  981. package/assets/esri/core/workers/chunks/d15e6662d90718411d62.js +0 -1
  982. package/assets/esri/core/workers/chunks/d16aac3461af9cee0c29.js +0 -1
  983. package/assets/esri/core/workers/chunks/d60dd3e1028f714f2258.js +0 -1
  984. package/assets/esri/core/workers/chunks/d6c150c243ca1f6108f9.js +0 -1
  985. package/assets/esri/core/workers/chunks/d85748b57a71999caf3a.js +0 -1
  986. package/assets/esri/core/workers/chunks/d8c59b1d73650c060dfb.js +0 -1
  987. package/assets/esri/core/workers/chunks/dcb6e1b33402d7fa455b.js +0 -1
  988. package/assets/esri/core/workers/chunks/df653bca2b14dffc82d1.js +0 -1
  989. package/assets/esri/core/workers/chunks/e2a12142439d3037a3a7.js +0 -1
  990. package/assets/esri/core/workers/chunks/e3e1d87b8532bf84a18d.js +0 -1
  991. package/assets/esri/core/workers/chunks/e7744b7e0c16bba93151.js +0 -1
  992. package/assets/esri/core/workers/chunks/ea50effc5c39870dc871.js +0 -1
  993. package/assets/esri/core/workers/chunks/f1665a64564593f2a438.js +0 -1
  994. package/assets/esri/core/workers/chunks/f4c12f3a5e7f89106ae0.js +0 -1
  995. package/assets/esri/core/workers/chunks/fbefdc74b3aab716187f.js +0 -1
  996. package/assets/esri/core/workers/chunks/fc4fd9db056579e09bfe.js +0 -1
  997. package/assets/esri/core/workers/chunks/fd4907fa96f55128764d.js +0 -1
  998. package/views/3d/webgl-engine/core/shaderModules/BooleanUniform.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{applySome as t,isNone as e,isSome as s,unwrapOr as i}from"../../core/maybe.js";import{after as a}from"../../core/promiseUtils.js";import{Milliseconds as r}from"../../core/time.js";import{webglDebugEnabled as n}from"./checkWebGLError.js";import{ContextType as l}from"./context-util.js";import{ContextState as h}from"./ContextState.js";import{BufferType as f,Face as o,BASE_TEXTURE_UNIT as u,ClearBufferBit as _,FramebufferTarget as c,TextureSamplingMode as d,SyncCondition as b,ResourceType as F,ClientWaitSyncStatus as g,BlendFactor as E,BlendOperation as p,CullMode as B,CompareFunction as m,StencilOperation as R,ColorAttachment as T,TextureType as A,PrimitiveType as x}from"./enums.js";import{InstanceCounter as O}from"./InstanceCounter.js";import{ProgramCache as U}from"./ProgramCache.js";import{StateTracker as C}from"./renderState.js";import{Texture as S}from"./Texture.js";import{getErrorString as P}from"./Util.js";import{WebGLDriverTest as M}from"./WebGLDriverTest.js";import{Capabilities as v}from"./capabilities/Capabilities.js";import N from"./capabilities/isWebGL2Context.js";class k{constructor(t,e){this.gl=t,this.instanceCounter=new O,this.programCache=new U(this),this._state=new h,this._numOfDrawCalls=0,this._numOfTriangles=0,this.type=N(t)?l.WEBGL2:l.WEBGL1,this._loadExtensions(),this.configure(e)}configure(t){this._capabilities=new v(this.gl,t),this._parameters=this._loadParameters(t);const e=this.gl.getParameter(this.gl.VIEWPORT);this._state=new h,this._state.viewport={x:e[0],y:e[1],width:e[2],height:e[3]},this._stateTracker=new C({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const e=t.function;this.setStencilFunction(e.func,e.ref,e.mask);const s=t.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)}}),this.enforceState(),this._driverTest=new M(this)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}dispose(){this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(f.ARRAY_BUFFER),this.unbindBuffer(f.ELEMENT_ARRAY_BUFFER),N(this.gl)&&(this.unbindBuffer(f.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(f.PIXEL_PACK_BUFFER),this.unbindBuffer(f.PIXEL_UNPACK_BUFFER),this.unbindBuffer(f.COPY_READ_BUFFER),this.unbindBuffer(f.COPY_WRITE_BUFFER)),this._state.textureUnitMap.length=0,n()&&this.instanceCounter.printResourceCount()}setPipelineState(t){this._stateTracker.setPipeline(t)}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){var t;null==(t=this._state.program)||t.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s)this._state.textureUnitMap[t[s]]=null;e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){const t=this.capabilities.vao;t&&(t.bindVertexArray(null),this._state.vertexArrayObject=null),this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=o.FRONT_AND_BACK,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){this._state.stencilOperation.face===o.FRONT_AND_BACK&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=o.FRONT_AND_BACK,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(u+t),this._state.activeTexture=t),s}clear(t){t&&this.gl.clear(t)}clearSafe(t,e=255){t&&(t&_.COLOR_BUFFER_BIT&&this.setColorMask(!0,!0,!0,!0),t&_.DEPTH_BUFFER_BIT&&this.setDepthWriteEnabled(!0),t&_.STENCIL_BUFFER_BIT&&this.setStencilWriteMask(e),this.gl.clear(t))}drawArrays(t,e,s){if(n()&&(this._numOfDrawCalls++,this._numOfTriangles+=I(t,s)),this.gl.drawArrays(t,e,s),n()){const t=P(this);t&&console.error("drawArrays:",t)}}drawElements(e,s,i,a){if(n()&&(this._numOfDrawCalls++,this._numOfTriangles+=I(e,s)),this.gl.drawElements(e,s,i,a),n()){const n=P(this);if(n){var r;const l=this.getBoundVAO(),h=null==l?void 0:l.indexBuffer,f={indexBuffer:h,vertexBuffers:null==l?void 0:l.vertexBuffers},o={mode:e,count:s,type:i,offset:a},u=null!=(r=t(h,(t=>t.size)))?r:0,_=a+s,c=u<_?`. Buffer is too small. Attempted to draw index ${_} of ${u}`:"";console.error(`drawElements: ${n}${c}`,{args:o,vao:f})}}}logInfo(){n()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}resetInfo(){n()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}getViewport(){return{x:this._state.viewport.x,y:this._state.viewport.y,width:this._state.viewport.width,height:this._state.viewport.height}}useProgram(t){var e,s;this._state.program!==t&&(null==(e=this._state.program)||e.stop(),this._state.program=t,this.gl.useProgram(null!=(s=null==t?void 0:t.glName)?s:null))}bindTexture(t,i,a=!1){(i>=this.parameters.maxTextureImageUnits||i<0)&&console.error("Input texture unit is out of range of available units!");const r=this._state.textureUnitMap[i];return e(t)||null==t.glName?(s(r)&&(this.setActiveTexture(i,a),this.gl.bindTexture(r.descriptor.target,null)),this._state.textureUnitMap[i]=null,r):a||r!==t?(this.setActiveTexture(i,a),this.gl.bindTexture(t.descriptor.target,t.glName),t.applyChanges(),this._state.textureUnitMap[i]=t,r):(t.isDirty&&(this.setActiveTexture(i,a),t.applyChanges()),r)}unbindTexture(t){if(!e(t))for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(t,s=!1){if(s||this._state.readFramebuffer!==t||this._state.drawFramebuffer!==t){if(e(t))return this.gl.bindFramebuffer(c.FRAMEBUFFER,null),this._state.readFramebuffer=null,void(this._state.drawFramebuffer=null);t.initializeAndBind(c.FRAMEBUFFER),this._state.readFramebuffer=t,this._state.drawFramebuffer=t}}bindFramebufferSeparate(t,s,a=!1){const r=s===c.READ_FRAMEBUFFER,n=r?this._state.readFramebuffer:this._state.drawFramebuffer;(a||n!==t)&&(e(t)?this.gl.bindFramebuffer(s,null):t.initializeAndBind(s),r?this._state.readFramebuffer=i(t,null):this._state.drawFramebuffer=i(t,null))}blitFramebuffer(t,e,s=0,i=0,a=t.width,r=t.height,n=0,l=0,h=e.width,f=e.height,o=_.COLOR_BUFFER_BIT,u=d.NEAREST){this.bindFramebufferSeparate(t,c.READ_FRAMEBUFFER),this.bindFramebufferSeparate(e,c.DRAW_FRAMEBUFFER);this.gl.blitFramebuffer(s,i,a,r,n,l,h,f,o,u)}bindBuffer(t,e){if(t)switch(null!=e||(e=t.bufferType),e){case f.ARRAY_BUFFER:this._state.vertexBuffer=y(this.gl,t,e,this._state.vertexBuffer);break;case f.ELEMENT_ARRAY_BUFFER:this._state.indexBuffer=y(this.gl,t,e,this._state.indexBuffer);break;case f.UNIFORM_BUFFER:this._state.uniformBuffer=y(this.gl,t,e,this._state.uniformBuffer);break;case f.PIXEL_PACK_BUFFER:this._state.pixelPackBuffer=y(this.gl,t,e,this._state.pixelPackBuffer);break;case f.PIXEL_UNPACK_BUFFER:this._state.pixelUnpackBuffer=y(this.gl,t,e,this._state.pixelUnpackBuffer);break;case f.COPY_READ_BUFFER:this._state.copyReadBuffer=y(this.gl,t,e,this._state.copyReadBuffer);break;case f.COPY_WRITE_BUFFER:this._state.copyWriteBuffer=y(this.gl,t,e,this._state.copyWriteBuffer)}}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}_getBufferBinding(t,s){if(s>=this.parameters.maxUniformBufferBindings||s<0)return console.error("Uniform buffer binding point is out of range!"),null;const i=this._state.uniformBufferBindingPoints;let a=i[s];return e(a)&&(a={buffer:null,offset:0,size:0},i[s]=a),a}bindBufferBase(t,s,i){const a=this._getBufferBinding(t,s);if(e(a))return;if(a.buffer===i&&0===a.offset&&0===a.size)return;this.gl.bindBufferBase(t,s,i?i.glName:null),a.buffer=i,a.offset=0,a.size=0}bindBufferRange(t,s,i,a,r){const n=this._getBufferBinding(t,s);if(e(n))return;if(n.buffer===i&&n.offset===a&&n.size===r)return;if(a%this._parameters.uniformBufferOffsetAlignment!=0)return void console.error("Uniform buffer binding offset is not a multiple of the context offset alignment");this.gl.bindBufferRange(t,s,i.glName,a,r),n.buffer=i,n.offset=a,n.size=r}bindUBO(t,s,i,a){e(s)?this.bindBufferBase(f.UNIFORM_BUFFER,t,null):(n()&&(null!=a?a:s.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),s.initialize(),void 0!==i&&void 0!==a?this.bindBufferRange(f.UNIFORM_BUFFER,t,s.buffer,i,a):this.bindBufferBase(f.UNIFORM_BUFFER,t,s.buffer))}unbindUBO(t){for(let e=0,i=this._state.uniformBufferBindingPoints.length;e<i;e++){const i=this._state.uniformBufferBindingPoints[e];s(i)&&i.buffer===t.buffer&&this.bindBufferBase(f.UNIFORM_BUFFER,e,null)}}unbindBuffer(t){switch(t){case f.ARRAY_BUFFER:this._state.vertexBuffer=y(this.gl,null,t,this._state.vertexBuffer);break;case f.ELEMENT_ARRAY_BUFFER:this._state.indexBuffer=y(this.gl,null,t,this._state.indexBuffer);break;case f.UNIFORM_BUFFER:this._state.uniformBuffer=y(this.gl,null,t,this._state.uniformBuffer);break;case f.PIXEL_PACK_BUFFER:this._state.pixelPackBuffer=y(this.gl,null,t,this._state.pixelPackBuffer);break;case f.PIXEL_UNPACK_BUFFER:this._state.pixelUnpackBuffer=y(this.gl,null,t,this._state.pixelUnpackBuffer);break;case f.COPY_READ_BUFFER:this._state.copyReadBuffer=y(this.gl,null,t,this._state.copyReadBuffer);break;case f.COPY_WRITE_BUFFER:this._state.copyWriteBuffer=y(this.gl,null,t,this._state.copyWriteBuffer)}}bindVAO(t=null){e(t)?this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null):this._state.vertexArrayObject!==t&&(t.bind(),this._state.vertexArrayObject=t)}async clientWaitAsync(t=r(10)){const e=this.gl,s=e.fenceSync(b.SYNC_GPU_COMMANDS_COMPLETE,0);let i;this.instanceCounter.increment(F.Sync,s),e.flush();do{await a(t),i=e.clientWaitSync(s,0,0)}while(i===g.TIMEOUT_EXPIRED);if(this.instanceCounter.decrement(F.Sync,s),e.deleteSync(s),i===g.WAIT_FAILED)throw new Error("Client wait failed")}getBoundFramebufferObject(t=c.FRAMEBUFFER){return t===c.READ_FRAMEBUFFER?this._state.readFramebuffer:this._state.drawFramebuffer}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null,!0),this.unbindBuffer(f.ARRAY_BUFFER),this.unbindBuffer(f.ELEMENT_ARRAY_BUFFER),N(this.gl)&&(this.unbindBuffer(f.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(f.PIXEL_PACK_BUFFER),this.unbindBuffer(f.PIXEL_UNPACK_BUFFER),this.unbindBuffer(f.COPY_READ_BUFFER),this.unbindBuffer(f.COPY_WRITE_BUFFER));for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(E.ONE,E.ZERO),this.setBlendEquation(p.ADD),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(o.BACK),this.setFrontFace(B.CCW),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(m.LESS),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(m.ALWAYS,0,0),this.setStencilOp(R.KEEP,R.KEEP,R.KEEP),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){var t,e;const i=this.gl,a=this.capabilities.vao;a&&a.bindVertexArray(null);for(let s=0;s<this.parameters.maxVertexAttributes;s++)i.disableVertexAttribArray(s);if(this._state.vertexBuffer?i.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):i.bindBuffer(f.ARRAY_BUFFER,null),this._state.indexBuffer?i.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):i.bindBuffer(f.ELEMENT_ARRAY_BUFFER,null),N(i)){var r,n;this._state.uniformBuffer?i.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):i.bindBuffer(f.UNIFORM_BUFFER,null);for(let t=0;t<this._parameters.maxUniformBufferBindings;t++){const e=this._state.uniformBufferBindingPoints[t];if(s(e)){const{buffer:s,offset:a,size:r}=e;null!==s?0===a&&0===r?i.bindBufferBase(f.UNIFORM_BUFFER,t,s.glName):i.bindBufferRange(f.UNIFORM_BUFFER,t,s.glName,a,r):i.bindBufferBase(f.UNIFORM_BUFFER,t,null)}}this._state.pixelPackBuffer?i.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):i.bindBuffer(f.PIXEL_PACK_BUFFER,null),this._state.pixelUnpackBuffer?i.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):i.bindBuffer(f.PIXEL_UNPACK_BUFFER,null),this._state.copyReadBuffer?i.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):i.bindBuffer(f.COPY_READ_BUFFER,null),this._state.copyWriteBuffer?i.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):i.bindBuffer(f.COPY_WRITE_BUFFER,null),i.bindFramebuffer(c.READ_FRAMEBUFFER,null),i.readBuffer(i.BACK),this._state.readFramebuffer&&(i.bindFramebuffer(c.READ_FRAMEBUFFER,this._state.readFramebuffer.glName),i.readBuffer(T.COLOR_ATTACHMENT0)),i.bindFramebuffer(c.DRAW_FRAMEBUFFER,null!=(r=null==(n=this._state.drawFramebuffer)?void 0:n.glName)?r:null)}else{var l,h;this._state.readFramebuffer=this._state.drawFramebuffer,i.bindFramebuffer(c.FRAMEBUFFER,null!=(l=null==(h=this._state.drawFramebuffer)?void 0:h.glName)?l:null)}if(a&&this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}i.useProgram(null!=(t=null==(e=this._state.program)?void 0:e.glName)?t:null),i.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),i.bindRenderbuffer(i.RENDERBUFFER,this._state.renderbuffer?this._state.renderbuffer.glName:null),!0===this._state.blend?i.enable(this.gl.BLEND):i.disable(this.gl.BLEND),i.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),i.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),i.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),i.clearDepth(this._state.clearDepth),i.clearStencil(this._state.clearStencil),i.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),i.cullFace(this._state.cullFace),i.depthFunc(this._state.depthFunction),i.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?i.enable(i.DEPTH_TEST):i.disable(i.DEPTH_TEST),i.depthMask(this._state.depthWrite),i.frontFace(this._state.frontFace),i.lineWidth(1),!0===this._state.faceCulling?i.enable(i.CULL_FACE):i.disable(i.CULL_FACE),i.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?i.enable(i.POLYGON_OFFSET_FILL):i.disable(i.POLYGON_OFFSET_FILL),i.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?i.enable(i.SCISSOR_TEST):i.disable(i.SCISSOR_TEST),i.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),i.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?i.enable(i.STENCIL_TEST):i.disable(i.STENCIL_TEST),i.stencilMask(this._state.stencilWriteMask);for(let f=0;f<this.parameters.maxTextureImageUnits;f++){i.activeTexture(u+f),i.bindTexture(A.TEXTURE_2D,null),i.bindTexture(A.TEXTURE_CUBE_MAP,null),N(i)&&(i.bindTexture(A.TEXTURE_3D,null),i.bindTexture(A.TEXTURE_2D_ARRAY,null));const t=this._state.textureUnitMap[f];s(t)&&i.bindTexture(t.descriptor.target,t.glName)}i.activeTexture(u+this._state.activeTexture),i.viewport(this._state.viewport.x,this._state.viewport.y,this._state.viewport.width,this._state.viewport.height),this.resetInfo()}_loadExtensions(){this.type===l.WEBGL1&&this.gl.getExtension("OES_element_index_uint"),this.gl.getExtension("KHR_parallel_shader_compile")}_loadParameters(t){var e;const s=this.capabilities.textureFilterAnisotropic,i=null!=(e=t.maxAnisotropy)?e:1/0,a=N(this.gl),r=this.gl,n={versionString:this.gl.getParameter(this.gl.VERSION),maxVertexTextureImageUnits:this.gl.getParameter(this.gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxVertexAttributes:this.gl.getParameter(this.gl.MAX_VERTEX_ATTRIBS),maxMaxAnisotropy:s?Math.min(this.gl.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY),i):1,maxTextureImageUnits:this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS),maxTextureSize:this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),maxUniformBufferBindings:a?r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS):0,maxVertexUniformBlocks:a?r.getParameter(r.MAX_VERTEX_UNIFORM_BLOCKS):0,maxFragmentUniformBlocks:a?r.getParameter(r.MAX_FRAGMENT_UNIFORM_BLOCKS):0,maxUniformBlockSize:a?r.getParameter(r.MAX_UNIFORM_BLOCK_SIZE):0,uniformBufferOffsetAlignment:a?r.getParameter(r.UNIFORM_BUFFER_OFFSET_ALIGNMENT):1,maxArrayTextureLayers:a?r.getParameter(r.MAX_ARRAY_TEXTURE_LAYERS):1,maxSamples:a?r.getParameter(r.MAX_SAMPLES):1};return S.TEXTURE_UNIT_FOR_UPDATES=n.maxTextureImageUnits-1,n}}function y(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function I(t,e){switch(t){case x.POINTS:return 2*e;case x.TRIANGLES:return e/3;case x.TRIANGLE_STRIP:case x.TRIANGLE_FAN:return e-2;default:return 0}}export{k as RenderingContext};
5
+ import{applySome as t,isNone as e,isSome as s,unwrapOr as i}from"../../core/maybe.js";import{after as a}from"../../core/promiseUtils.js";import{Milliseconds as r}from"../../core/time.js";import{webglDebugEnabled as n}from"./checkWebGLError.js";import{ContextType as l}from"./context-util.js";import{ContextState as h}from"./ContextState.js";import{BufferType as f,Face as o,BASE_TEXTURE_UNIT as _,ClearBufferBit as u,FramebufferTarget as c,TextureSamplingMode as d,SyncCondition as b,ResourceType as F,ClientWaitSyncStatus as g,BlendFactor as E,BlendOperation as p,CullMode as B,CompareFunction as m,StencilOperation as R,ColorAttachment as T,TextureType as A,PrimitiveType as x}from"./enums.js";import{InstanceCounter as O}from"./InstanceCounter.js";import{ProgramCache as U}from"./ProgramCache.js";import{StateTracker as C}from"./renderState.js";import{Texture as S}from"./Texture.js";import{getErrorString as P}from"./Util.js";import{WebGLDriverTest as M}from"./WebGLDriverTest.js";import{Capabilities as N}from"./capabilities/Capabilities.js";import k from"./capabilities/isWebGL2Context.js";class y{constructor(t,e){this.gl=t,this.instanceCounter=new O,this.programCache=new U(this),this._state=new h,this._numOfDrawCalls=0,this._numOfTriangles=0,this.type=k(t)?l.WEBGL2:l.WEBGL1,this._loadExtensions(),this.configure(e)}configure(t){this._capabilities=new N(this.gl,t),this._parameters=this._loadParameters(t);const e=this.gl.getParameter(this.gl.VIEWPORT);this._state=new h,this._state.viewport={x:e[0],y:e[1],width:e[2],height:e[3]},this._stateTracker=new C({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const e=t.function;this.setStencilFunction(e.func,e.ref,e.mask);const s=t.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)}}),this.enforceState(),this._driverTest=new M(this)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}dispose(){this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(f.ARRAY_BUFFER),this.unbindBuffer(f.ELEMENT_ARRAY_BUFFER),k(this.gl)&&(this.unbindBuffer(f.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(f.PIXEL_PACK_BUFFER),this.unbindBuffer(f.PIXEL_UNPACK_BUFFER),this.unbindBuffer(f.COPY_READ_BUFFER),this.unbindBuffer(f.COPY_WRITE_BUFFER)),this._state.textureUnitMap.length=0,n()&&this.instanceCounter.printResourceCount()}setPipelineState(t){this._stateTracker.setPipeline(t)}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s)this._state.textureUnitMap[t[s]]=null;e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){const t=this.capabilities.vao;t&&(t.bindVertexArray(null),this._state.vertexArrayObject=null),this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=o.FRONT_AND_BACK,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){this._state.stencilOperation.face===o.FRONT_AND_BACK&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=o.FRONT_AND_BACK,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(_+t),this._state.activeTexture=t),s}clear(t){t&&this.gl.clear(t)}clearSafe(t,e=255){t&&(t&u.COLOR_BUFFER_BIT&&this.setColorMask(!0,!0,!0,!0),t&u.DEPTH_BUFFER_BIT&&this.setDepthWriteEnabled(!0),t&u.STENCIL_BUFFER_BIT&&this.setStencilWriteMask(e),this.gl.clear(t))}drawArrays(t,e,s){if(n()&&(this._numOfDrawCalls++,this._numOfTriangles+=I(t,s)),this.gl.drawArrays(t,e,s),n()){const t=P(this);t&&console.error("drawArrays:",t)}}drawElements(e,s,i,a){if(n()&&(this._numOfDrawCalls++,this._numOfTriangles+=I(e,s)),this.gl.drawElements(e,s,i,a),n()){const r=P(this);if(r){const n=this.getBoundVAO(),l=n?.indexBuffer,h=n?.vertexBuffers,f={indexBuffer:l,vertexBuffers:h},o={mode:e,count:s,type:i,offset:a},_=t(l,(t=>t.size))??0,u=a+s,c=_<u?`. Buffer is too small. Attempted to draw index ${u} of ${_}`:"";console.error(`drawElements: ${r}${c}`,{args:o,vao:f})}}}logInfo(){n()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}resetInfo(){n()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}getViewport(){return{x:this._state.viewport.x,y:this._state.viewport.y,width:this._state.viewport.width,height:this._state.viewport.height}}useProgram(t){this._state.program!==t&&(this._state.program?.stop(),this._state.program=t,this.gl.useProgram(t?.glName??null))}bindTexture(t,i,a=!1){(i>=this.parameters.maxTextureImageUnits||i<0)&&console.error("Input texture unit is out of range of available units!");const r=this._state.textureUnitMap[i];return e(t)||null==t.glName?(s(r)&&(this.setActiveTexture(i,a),this.gl.bindTexture(r.descriptor.target,null)),this._state.textureUnitMap[i]=null,r):a||r!==t?(this.setActiveTexture(i,a),this.gl.bindTexture(t.descriptor.target,t.glName),t.applyChanges(),this._state.textureUnitMap[i]=t,r):(t.isDirty&&(this.setActiveTexture(i,a),t.applyChanges()),r)}unbindTexture(t){if(!e(t))for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(t,s=!1){if(s||this._state.readFramebuffer!==t||this._state.drawFramebuffer!==t){if(e(t))return this.gl.bindFramebuffer(c.FRAMEBUFFER,null),this._state.readFramebuffer=null,void(this._state.drawFramebuffer=null);t.initializeAndBind(c.FRAMEBUFFER),this._state.readFramebuffer=t,this._state.drawFramebuffer=t}}bindFramebufferSeparate(t,s,a=!1){const r=s===c.READ_FRAMEBUFFER,n=r?this._state.readFramebuffer:this._state.drawFramebuffer;(a||n!==t)&&(e(t)?this.gl.bindFramebuffer(s,null):t.initializeAndBind(s),r?this._state.readFramebuffer=i(t,null):this._state.drawFramebuffer=i(t,null))}blitFramebuffer(t,e,s=0,i=0,a=t.width,r=t.height,n=0,l=0,h=e.width,f=e.height,o=u.COLOR_BUFFER_BIT,_=d.NEAREST){this.bindFramebufferSeparate(t,c.READ_FRAMEBUFFER),this.bindFramebufferSeparate(e,c.DRAW_FRAMEBUFFER);this.gl.blitFramebuffer(s,i,a,r,n,l,h,f,o,_)}bindBuffer(t,e){if(t)switch(e??(e=t.bufferType),e){case f.ARRAY_BUFFER:this._state.vertexBuffer=v(this.gl,t,e,this._state.vertexBuffer);break;case f.ELEMENT_ARRAY_BUFFER:this._state.indexBuffer=v(this.gl,t,e,this._state.indexBuffer);break;case f.UNIFORM_BUFFER:this._state.uniformBuffer=v(this.gl,t,e,this._state.uniformBuffer);break;case f.PIXEL_PACK_BUFFER:this._state.pixelPackBuffer=v(this.gl,t,e,this._state.pixelPackBuffer);break;case f.PIXEL_UNPACK_BUFFER:this._state.pixelUnpackBuffer=v(this.gl,t,e,this._state.pixelUnpackBuffer);break;case f.COPY_READ_BUFFER:this._state.copyReadBuffer=v(this.gl,t,e,this._state.copyReadBuffer);break;case f.COPY_WRITE_BUFFER:this._state.copyWriteBuffer=v(this.gl,t,e,this._state.copyWriteBuffer)}}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}_getBufferBinding(t,s){if(s>=this.parameters.maxUniformBufferBindings||s<0)return console.error("Uniform buffer binding point is out of range!"),null;const i=this._state.uniformBufferBindingPoints;let a=i[s];return e(a)&&(a={buffer:null,offset:0,size:0},i[s]=a),a}bindBufferBase(t,s,i){const a=this._getBufferBinding(t,s);if(e(a))return;if(a.buffer===i&&0===a.offset&&0===a.size)return;this.gl.bindBufferBase(t,s,i?i.glName:null),a.buffer=i,a.offset=0,a.size=0}bindBufferRange(t,s,i,a,r){const n=this._getBufferBinding(t,s);if(e(n))return;if(n.buffer===i&&n.offset===a&&n.size===r)return;if(a%this._parameters.uniformBufferOffsetAlignment!=0)return void console.error("Uniform buffer binding offset is not a multiple of the context offset alignment");this.gl.bindBufferRange(t,s,i.glName,a,r),n.buffer=i,n.offset=a,n.size=r}bindUBO(t,s,i,a){e(s)?this.bindBufferBase(f.UNIFORM_BUFFER,t,null):(n()&&(a??s.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),s.initialize(),void 0!==i&&void 0!==a?this.bindBufferRange(f.UNIFORM_BUFFER,t,s.buffer,i,a):this.bindBufferBase(f.UNIFORM_BUFFER,t,s.buffer))}unbindUBO(t){for(let e=0,i=this._state.uniformBufferBindingPoints.length;e<i;e++){const i=this._state.uniformBufferBindingPoints[e];s(i)&&i.buffer===t.buffer&&this.bindBufferBase(f.UNIFORM_BUFFER,e,null)}}unbindBuffer(t){switch(t){case f.ARRAY_BUFFER:this._state.vertexBuffer=v(this.gl,null,t,this._state.vertexBuffer);break;case f.ELEMENT_ARRAY_BUFFER:this._state.indexBuffer=v(this.gl,null,t,this._state.indexBuffer);break;case f.UNIFORM_BUFFER:this._state.uniformBuffer=v(this.gl,null,t,this._state.uniformBuffer);break;case f.PIXEL_PACK_BUFFER:this._state.pixelPackBuffer=v(this.gl,null,t,this._state.pixelPackBuffer);break;case f.PIXEL_UNPACK_BUFFER:this._state.pixelUnpackBuffer=v(this.gl,null,t,this._state.pixelUnpackBuffer);break;case f.COPY_READ_BUFFER:this._state.copyReadBuffer=v(this.gl,null,t,this._state.copyReadBuffer);break;case f.COPY_WRITE_BUFFER:this._state.copyWriteBuffer=v(this.gl,null,t,this._state.copyWriteBuffer)}}bindVAO(t=null){e(t)?this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null):this._state.vertexArrayObject!==t&&(t.bind(),this._state.vertexArrayObject=t)}async clientWaitAsync(t=r(10)){const e=this.gl,s=e.fenceSync(b.SYNC_GPU_COMMANDS_COMPLETE,0);let i;this.instanceCounter.increment(F.Sync,s),e.flush();do{await a(t),i=e.clientWaitSync(s,0,0)}while(i===g.TIMEOUT_EXPIRED);if(this.instanceCounter.decrement(F.Sync,s),e.deleteSync(s),i===g.WAIT_FAILED)throw new Error("Client wait failed")}getBoundFramebufferObject(t=c.FRAMEBUFFER){return t===c.READ_FRAMEBUFFER?this._state.readFramebuffer:this._state.drawFramebuffer}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null,!0),this.unbindBuffer(f.ARRAY_BUFFER),this.unbindBuffer(f.ELEMENT_ARRAY_BUFFER),k(this.gl)&&(this.unbindBuffer(f.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(f.PIXEL_PACK_BUFFER),this.unbindBuffer(f.PIXEL_UNPACK_BUFFER),this.unbindBuffer(f.COPY_READ_BUFFER),this.unbindBuffer(f.COPY_WRITE_BUFFER));for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(E.ONE,E.ZERO),this.setBlendEquation(p.ADD),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(o.BACK),this.setFrontFace(B.CCW),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(m.LESS),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(m.ALWAYS,0,0),this.setStencilOp(R.KEEP,R.KEEP,R.KEEP),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){const t=this.gl,e=this.capabilities.vao;e&&e.bindVertexArray(null);for(let s=0;s<this.parameters.maxVertexAttributes;s++)t.disableVertexAttribArray(s);if(this._state.vertexBuffer?t.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):t.bindBuffer(f.ARRAY_BUFFER,null),this._state.indexBuffer?t.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):t.bindBuffer(f.ELEMENT_ARRAY_BUFFER,null),k(t)){this._state.uniformBuffer?t.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):t.bindBuffer(f.UNIFORM_BUFFER,null);for(let e=0;e<this._parameters.maxUniformBufferBindings;e++){const i=this._state.uniformBufferBindingPoints[e];if(s(i)){const{buffer:s,offset:a,size:r}=i;null!==s?0===a&&0===r?t.bindBufferBase(f.UNIFORM_BUFFER,e,s.glName):t.bindBufferRange(f.UNIFORM_BUFFER,e,s.glName,a,r):t.bindBufferBase(f.UNIFORM_BUFFER,e,null)}}this._state.pixelPackBuffer?t.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):t.bindBuffer(f.PIXEL_PACK_BUFFER,null),this._state.pixelUnpackBuffer?t.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):t.bindBuffer(f.PIXEL_UNPACK_BUFFER,null),this._state.copyReadBuffer?t.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):t.bindBuffer(f.COPY_READ_BUFFER,null),this._state.copyWriteBuffer?t.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):t.bindBuffer(f.COPY_WRITE_BUFFER,null),t.bindFramebuffer(c.READ_FRAMEBUFFER,null),t.readBuffer(t.BACK),this._state.readFramebuffer&&(t.bindFramebuffer(c.READ_FRAMEBUFFER,this._state.readFramebuffer.glName),t.readBuffer(T.COLOR_ATTACHMENT0)),t.bindFramebuffer(c.DRAW_FRAMEBUFFER,this._state.drawFramebuffer?.glName??null)}else this._state.readFramebuffer=this._state.drawFramebuffer,t.bindFramebuffer(c.FRAMEBUFFER,this._state.drawFramebuffer?.glName??null);if(e&&this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}t.useProgram(this._state.program?.glName??null),t.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),t.bindRenderbuffer(t.RENDERBUFFER,this._state.renderbuffer?this._state.renderbuffer.glName:null),!0===this._state.blend?t.enable(this.gl.BLEND):t.disable(this.gl.BLEND),t.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),t.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),t.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),t.clearDepth(this._state.clearDepth),t.clearStencil(this._state.clearStencil),t.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),t.cullFace(this._state.cullFace),t.depthFunc(this._state.depthFunction),t.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),t.depthMask(this._state.depthWrite),t.frontFace(this._state.frontFace),t.lineWidth(1),!0===this._state.faceCulling?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?t.enable(t.POLYGON_OFFSET_FILL):t.disable(t.POLYGON_OFFSET_FILL),t.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST),t.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),t.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),t.stencilMask(this._state.stencilWriteMask);for(let i=0;i<this.parameters.maxTextureImageUnits;i++){t.activeTexture(_+i),t.bindTexture(A.TEXTURE_2D,null),t.bindTexture(A.TEXTURE_CUBE_MAP,null),k(t)&&(t.bindTexture(A.TEXTURE_3D,null),t.bindTexture(A.TEXTURE_2D_ARRAY,null));const e=this._state.textureUnitMap[i];s(e)&&t.bindTexture(e.descriptor.target,e.glName)}t.activeTexture(_+this._state.activeTexture),t.viewport(this._state.viewport.x,this._state.viewport.y,this._state.viewport.width,this._state.viewport.height),this.resetInfo()}_loadExtensions(){this.type===l.WEBGL1&&this.gl.getExtension("OES_element_index_uint"),this.gl.getExtension("KHR_parallel_shader_compile")}_loadParameters(t){const e=this.capabilities.textureFilterAnisotropic,s=t.maxAnisotropy??1/0,i=k(this.gl),a=this.gl,r={versionString:this.gl.getParameter(this.gl.VERSION),maxVertexTextureImageUnits:this.gl.getParameter(this.gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxVertexAttributes:this.gl.getParameter(this.gl.MAX_VERTEX_ATTRIBS),maxMaxAnisotropy:e?Math.min(this.gl.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY),s):1,maxTextureImageUnits:this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS),maxTextureSize:this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),maxUniformBufferBindings:i?a.getParameter(a.MAX_UNIFORM_BUFFER_BINDINGS):0,maxVertexUniformBlocks:i?a.getParameter(a.MAX_VERTEX_UNIFORM_BLOCKS):0,maxFragmentUniformBlocks:i?a.getParameter(a.MAX_FRAGMENT_UNIFORM_BLOCKS):0,maxUniformBlockSize:i?a.getParameter(a.MAX_UNIFORM_BLOCK_SIZE):0,uniformBufferOffsetAlignment:i?a.getParameter(a.UNIFORM_BUFFER_OFFSET_ALIGNMENT):1,maxArrayTextureLayers:i?a.getParameter(a.MAX_ARRAY_TEXTURE_LAYERS):1,maxSamples:i?a.getParameter(a.MAX_SAMPLES):1};return S.TEXTURE_UNIT_FOR_UPDATES=r.maxTextureImageUnits-1,r}}function v(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function I(t,e){switch(t){case x.POINTS:return 2*e;case x.TRIANGLES:return e/3;case x.TRIANGLE_STRIP:case x.TRIANGLE_FAN:return e-2;default:return 0}}export{y as RenderingContext};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{isPowerOfTwo as t}from"../../core/mathUtils.js";import{isSome as e,unwrap as i}from"../../core/maybe.js";import{checkWebGLError as r}from"./checkWebGLError.js";import{ContextType as a}from"./context-util.js";import{ResourceType as s,TextureType as o,TextureSamplingMode as n,TextureWrapMode as p,CompressedTextureFormat as h,PixelType as l,PixelFormat as _,SizedPixelFormat as m}from"./enums.js";import d from"./capabilities/isWebGL2Context.js";const c=4;class u{constructor(t,e,i=null){if(this._context=t,this.type="texture",this._glName=null,this._descriptor=void 0,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,t.instanceCounter.increment(s.Texture,this),this._descriptor={target:o.TEXTURE_2D,samplingMode:n.LINEAR,wrapMode:p.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1,...e},t.type!==a.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),A(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===o.TEXTURE_CUBE_MAP?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(s.Texture,this))}release(){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");i.width=t,i.height=e,this._descriptor.target===o.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(t=null){for(let e=o.TEXTURE_CUBE_MAP_POSITIVE_X;e<=o.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this._setData(t,e)}setData(t){this._setData(t)}_setData(t,i){if(!this._context||!this._context.gl)return;const a=this._context.gl;this._glName||(this._glName=a.createTexture()),void 0===t&&(t=null);const s=this._descriptor;null!=i||(i=s.target);const o=A(i);var n;null===t&&(s.width=s.width||c,s.height=s.height||c,o&&(s.depth=null!=(n=s.depth)?n:1));const p=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),u._validateTexture(this._context,s),this._configurePixelStorage();const h=s.pixelFormat;let l=s.internalFormat?s.internalFormat:this._deriveInternalFormat(h,s.dataType);if(M(t)){let e=t.width,n=t.height;const p=1;t instanceof HTMLVideoElement&&(e=t.videoWidth,n=t.videoHeight),s.width&&s.height,o&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(i,l,s.hasMipmap,e,n,p),this._texImage(i,0,l,e,n,p,t),r(a),s.hasMipmap&&this.generateMipmap(),void 0===s.width&&(s.width=e),void 0===s.height&&(s.height=n),o&&void 0===s.depth&&(s.depth=p)}else{const{width:n,height:p,depth:h}=s;if(null!=n&&null!=p||console.error("Width and height must be specified!"),o&&null==h&&console.error("Depth must be specified!"),s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(i,l,s.hasMipmap,n,p,h),a.DEPTH24_STENCIL8&&l===a.DEPTH_STENCIL&&(l=a.DEPTH24_STENCIL8),g(t)){const e=t.levels,r=I(i,n,p,h),o=Math.min(r-1,e.length-1);d(a)?a.texParameteri(s.target,a.TEXTURE_MAX_LEVEL,o):s.hasMipmap=s.hasMipmap&&r===e.length;const _=l;if(!T(_))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel(((t,r,a,s)=>{const o=e[Math.min(t,e.length-1)];this._compressedTexImage(i,t,_,r,a,s,o)}),o)}else e(t)?(this._texImage(i,0,l,n,p,h,t),r(a),s.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((t,e,s,o)=>{this._texImage(i,t,l,e,s,o,null),r(a)}))}u._applySamplingMode(a,this._descriptor),u._applyWrapMode(a,this._descriptor),u._applyAnisotropicFilteringParameters(this._context,this._descriptor),r(a),this._context.bindTexture(p,u.TEXTURE_UNIT_FOR_UPDATES)}updateData(t,e,i,r,a,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const o=this._context.gl,n=this._descriptor,{pixelFormat:p,internalFormat:h,dataType:l,isImmutable:_,target:m}=n;if(_&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const d=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);(e<0||i<0||r>n.width||a>n.height||e+r>n.width||i+a>n.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),M(s)?o.texSubImage2D(m,t,e,i,p,l,s):g(s)?o.compressedTexSubImage2D(m,t,e,i,r,a,h,s.levels[t]):o.texSubImage2D(m,t,e,i,r,a,p,l,s),this._context.bindTexture(d,u.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,r,a,s,o,n){n||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const p=this._context.gl;if(!d(p))throw new Error("3D textures are not supported in WebGL1");const h=this._descriptor,{pixelFormat:l,dataType:_,isImmutable:m,target:c,internalFormat:E}=h;if(m&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");A(c)||console.warn("Attempting to set 3D texture data on a non-3D texture");const T=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||r<0||a>h.width||s>h.height||o>h.depth||e+a>h.width||i+s>h.height||r+o>h.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),g(n))n=n.levels[t],p.compressedTexSubImage3D(c,t,e,i,r,a,s,o,E,n);else{const h=n;p.texSubImage3D(c,t,e,i,r,a,s,o,l,_,h)}this._context.bindTexture(T,u.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,u._validateTexture(this._context,t)}t.samplingMode===n.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=n.LINEAR_MIPMAP_NEAREST):t.samplingMode===n.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=n.NEAREST_MIPMAP_NEAREST);const e=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES);this._context.gl.generateMipmap(t.target),this._context.bindTexture(e,u.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,u._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const t=this._context.gl,e=this._descriptor;this._samplingModeDirty&&(u._applySamplingMode(t,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(u._applyWrapMode(t,e),this._wrapModeDirty=!1)}_deriveInternalFormat(t,e){if(this._context.type===a.WEBGL1)return t;switch(e){case l.FLOAT:switch(t){case _.RGBA:return m.RGBA32F;case _.RGB:return m.RGB32F;default:throw new Error("Unable to derive format")}case l.UNSIGNED_BYTE:switch(t){case _.RGBA:return m.RGBA8;case _.RGB:return m.RGB8}default:return t}}_configurePixelStorage(){const t=this._context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_texStorage(t,e,i,r,a,s){const o=this._context.gl;if(!d(o))throw new Error("Immutable textures are not supported in WebGL1");if(!E(e))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const n=i?I(t,r,a,s):1;A(t)?o.texStorage3D(t,n,e,r,a,s):o.texStorage2D(t,n,e,r,a),this._wasImmutablyAllocated=!0}_texImage(t,r,s,o,n,p,h){const l=this._context.gl;let _=null;const m=this._context.type===a.WEBGL2,d=A(t),{isImmutable:c,pixelFormat:u,dataType:E}=this._descriptor;if(m&&(_=l),m||!M(h))if(c){if(e(h)){const e=h;d?_.texSubImage3D(t,r,0,0,0,o,n,p,u,E,e):l.texSubImage2D(t,r,0,0,o,n,u,E,e)}}else{const e=i(h);d?_.texImage3D(t,r,s,o,n,p,0,u,E,e):l.texImage2D(t,r,s,o,n,0,u,E,e)}else l.texImage2D(t,0,s,u,E,h)}_compressedTexImage(t,i,r,s,o,n,p){const h=this._context.gl;let l=null;const _=A(t),m=this._descriptor.isImmutable;if(_){if(this._context.type!==a.WEBGL2)throw new Error("3D textures are not supported in WebGL1");l=h}m?e(p)&&(_?l.compressedTexSubImage3D(t,i,0,0,0,s,o,n,r,p):h.compressedTexSubImage2D(t,i,0,0,s,o,r,p)):_?l.compressedTexImage3D(t,i,r,s,o,n,0,p):h.compressedTexImage2D(t,i,r,s,o,0,p)}_forEachMipmapLevel(t,e=1/0){let{width:i,height:r,depth:a,hasMipmap:s,target:n}=this._descriptor;const p=n===o.TEXTURE_3D;for(let o=0;t(o,i,r,a),s&&(1!==i||1!==r||p&&1!==a)&&!(o>=e);++o)i=Math.max(1,i>>1),r=Math.max(1,r>>1),p&&(a=Math.max(1,a>>1))}static _validateTexture(e,i){(i.width<0||i.height<0||i.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=d(e.gl),a=t(i.width)&&t(i.height);r||!i.isImmutable&&!A(i.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||a||("number"==typeof i.wrapMode?i.wrapMode!==p.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):i.wrapMode.s===p.CLAMP_TO_EDGE&&i.wrapMode.t===p.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),i.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(t,e){let i=e.samplingMode,r=e.samplingMode;i===n.LINEAR_MIPMAP_NEAREST||i===n.LINEAR_MIPMAP_LINEAR?(i=n.LINEAR,e.hasMipmap||(r=n.LINEAR)):i!==n.NEAREST_MIPMAP_NEAREST&&i!==n.NEAREST_MIPMAP_LINEAR||(i=n.NEAREST,e.hasMipmap||(r=n.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,i),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,r)}static _applyWrapMode(t,e){"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}static _applyAnisotropicFilteringParameters(t,e){var i;const r=t.capabilities.textureFilterAnisotropic;if(!r)return;t.gl.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY,null!=(i=e.maxAnisotropy)?i:1)}}function E(t){return t in m}function T(t){return t in h}function g(t){return e(t)&&"type"in t&&"compressed"===t.type}function x(t){return e(t)&&"byteLength"in t}function M(t){return e(t)&&!g(t)&&!x(t)}function A(t){return t===o.TEXTURE_3D||t===o.TEXTURE_2D_ARRAY}function I(t,e,i,r=1){let a=Math.max(e,i);return t===o.TEXTURE_3D&&(a=Math.max(a,r)),Math.round(Math.log(a)/Math.LN2)+1}u.TEXTURE_UNIT_FOR_UPDATES=0;export{u as Texture};
5
+ import"../../core/has.js";import{isPowerOfTwo as t}from"../../core/mathUtils.js";import{isSome as e,unwrap as i}from"../../core/maybe.js";import{checkWebGLError as r}from"./checkWebGLError.js";import{ContextType as a}from"./context-util.js";import{ResourceType as s,TextureType as o,TextureSamplingMode as n,TextureWrapMode as p,CompressedTextureFormat as h,PixelType as _,PixelFormat as l,SizedPixelFormat as m}from"./enums.js";import d from"./capabilities/isWebGL2Context.js";const c=4;class u{constructor(t,e,i=null){if(this._context=t,this.type="texture",this._glName=null,this._descriptor=void 0,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,t.instanceCounter.increment(s.Texture,this),this._descriptor={target:o.TEXTURE_2D,samplingMode:n.LINEAR,wrapMode:p.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1,...e},t.type!==a.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),A(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===o.TEXTURE_CUBE_MAP?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(s.Texture,this))}release(){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");i.width=t,i.height=e,this._descriptor.target===o.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(t=null){for(let e=o.TEXTURE_CUBE_MAP_POSITIVE_X;e<=o.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this._setData(t,e)}setData(t){this._setData(t)}_setData(t,i){if(!this._context||!this._context.gl)return;const a=this._context.gl;this._glName||(this._glName=a.createTexture()),void 0===t&&(t=null);const s=this._descriptor;i??(i=s.target);const o=A(i);null===t&&(s.width=s.width||c,s.height=s.height||c,o&&(s.depth=s.depth??1));const n=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),u._validateTexture(this._context,s),this._configurePixelStorage();const p=s.pixelFormat;let h=s.internalFormat?s.internalFormat:this._deriveInternalFormat(p,s.dataType);if(M(t)){let e=t.width,n=t.height;const p=1;t instanceof HTMLVideoElement&&(e=t.videoWidth,n=t.videoHeight),s.width&&s.height,o&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(i,h,s.hasMipmap,e,n,p),this._texImage(i,0,h,e,n,p,t),r(a),s.hasMipmap&&this.generateMipmap(),void 0===s.width&&(s.width=e),void 0===s.height&&(s.height=n),o&&void 0===s.depth&&(s.depth=p)}else{const{width:n,height:p,depth:_}=s;if(null!=n&&null!=p||console.error("Width and height must be specified!"),o&&null==_&&console.error("Depth must be specified!"),s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(i,h,s.hasMipmap,n,p,_),a.DEPTH24_STENCIL8&&h===a.DEPTH_STENCIL&&(h=a.DEPTH24_STENCIL8),g(t)){const e=t.levels,r=I(i,n,p,_),o=Math.min(r-1,e.length-1);d(a)?a.texParameteri(s.target,a.TEXTURE_MAX_LEVEL,o):s.hasMipmap=s.hasMipmap&&r===e.length;const l=h;if(!T(l))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel(((t,r,a,s)=>{const o=e[Math.min(t,e.length-1)];this._compressedTexImage(i,t,l,r,a,s,o)}),o)}else e(t)?(this._texImage(i,0,h,n,p,_,t),r(a),s.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((t,e,s,o)=>{this._texImage(i,t,h,e,s,o,null),r(a)}))}u._applySamplingMode(a,this._descriptor),u._applyWrapMode(a,this._descriptor),u._applyAnisotropicFilteringParameters(this._context,this._descriptor),r(a),this._context.bindTexture(n,u.TEXTURE_UNIT_FOR_UPDATES)}updateData(t,e,i,r,a,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const o=this._context.gl,n=this._descriptor,{pixelFormat:p,internalFormat:h,dataType:_,isImmutable:l,target:m}=n;if(l&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const d=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);(e<0||i<0||r>n.width||a>n.height||e+r>n.width||i+a>n.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),M(s)?o.texSubImage2D(m,t,e,i,p,_,s):g(s)?o.compressedTexSubImage2D(m,t,e,i,r,a,h,s.levels[t]):o.texSubImage2D(m,t,e,i,r,a,p,_,s),this._context.bindTexture(d,u.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,r,a,s,o,n){n||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const p=this._context.gl;if(!d(p))throw new Error("3D textures are not supported in WebGL1");const h=this._descriptor,{pixelFormat:_,dataType:l,isImmutable:m,target:c,internalFormat:E}=h;if(m&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");A(c)||console.warn("Attempting to set 3D texture data on a non-3D texture");const T=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||r<0||a>h.width||s>h.height||o>h.depth||e+a>h.width||i+s>h.height||r+o>h.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),g(n))n=n.levels[t],p.compressedTexSubImage3D(c,t,e,i,r,a,s,o,E,n);else{const h=n;p.texSubImage3D(c,t,e,i,r,a,s,o,_,l,h)}this._context.bindTexture(T,u.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,u._validateTexture(this._context,t)}t.samplingMode===n.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=n.LINEAR_MIPMAP_NEAREST):t.samplingMode===n.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=n.NEAREST_MIPMAP_NEAREST);const e=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES);this._context.gl.generateMipmap(t.target),this._context.bindTexture(e,u.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,u._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const t=this._context.gl,e=this._descriptor;this._samplingModeDirty&&(u._applySamplingMode(t,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(u._applyWrapMode(t,e),this._wrapModeDirty=!1)}_deriveInternalFormat(t,e){if(this._context.type===a.WEBGL1)return t;switch(e){case _.FLOAT:switch(t){case l.RGBA:return m.RGBA32F;case l.RGB:return m.RGB32F;default:throw new Error("Unable to derive format")}case _.UNSIGNED_BYTE:switch(t){case l.RGBA:return m.RGBA8;case l.RGB:return m.RGB8}default:return t}}_configurePixelStorage(){const t=this._context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_texStorage(t,e,i,r,a,s){const o=this._context.gl;if(!d(o))throw new Error("Immutable textures are not supported in WebGL1");if(!E(e))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const n=i?I(t,r,a,s):1;A(t)?o.texStorage3D(t,n,e,r,a,s):o.texStorage2D(t,n,e,r,a),this._wasImmutablyAllocated=!0}_texImage(t,r,s,o,n,p,h){const _=this._context.gl;let l=null;const m=this._context.type===a.WEBGL2,d=A(t),{isImmutable:c,pixelFormat:u,dataType:E}=this._descriptor;if(m&&(l=_),m||!M(h))if(c){if(e(h)){const e=h;d?l.texSubImage3D(t,r,0,0,0,o,n,p,u,E,e):_.texSubImage2D(t,r,0,0,o,n,u,E,e)}}else{const e=i(h);d?l.texImage3D(t,r,s,o,n,p,0,u,E,e):_.texImage2D(t,r,s,o,n,0,u,E,e)}else _.texImage2D(t,0,s,u,E,h)}_compressedTexImage(t,i,r,s,o,n,p){const h=this._context.gl;let _=null;const l=A(t),m=this._descriptor.isImmutable;if(l){if(this._context.type!==a.WEBGL2)throw new Error("3D textures are not supported in WebGL1");_=h}m?e(p)&&(l?_.compressedTexSubImage3D(t,i,0,0,0,s,o,n,r,p):h.compressedTexSubImage2D(t,i,0,0,s,o,r,p)):l?_.compressedTexImage3D(t,i,r,s,o,n,0,p):h.compressedTexImage2D(t,i,r,s,o,0,p)}_forEachMipmapLevel(t,e=1/0){let{width:i,height:r,depth:a,hasMipmap:s,target:n}=this._descriptor;const p=n===o.TEXTURE_3D;for(let o=0;t(o,i,r,a),s&&(1!==i||1!==r||p&&1!==a)&&!(o>=e);++o)i=Math.max(1,i>>1),r=Math.max(1,r>>1),p&&(a=Math.max(1,a>>1))}static _validateTexture(e,i){(i.width<0||i.height<0||i.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=d(e.gl),a=t(i.width)&&t(i.height);r||!i.isImmutable&&!A(i.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||a||("number"==typeof i.wrapMode?i.wrapMode!==p.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):i.wrapMode.s===p.CLAMP_TO_EDGE&&i.wrapMode.t===p.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),i.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(t,e){let i=e.samplingMode,r=e.samplingMode;i===n.LINEAR_MIPMAP_NEAREST||i===n.LINEAR_MIPMAP_LINEAR?(i=n.LINEAR,e.hasMipmap||(r=n.LINEAR)):i!==n.NEAREST_MIPMAP_NEAREST&&i!==n.NEAREST_MIPMAP_LINEAR||(i=n.NEAREST,e.hasMipmap||(r=n.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,i),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,r)}static _applyWrapMode(t,e){"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}static _applyAnisotropicFilteringParameters(t,e){const i=t.capabilities.textureFilterAnisotropic;if(!i)return;t.gl.texParameterf(e.target,i.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}function E(t){return t in m}function T(t){return t in h}function g(t){return e(t)&&"type"in t&&"compressed"===t.type}function x(t){return e(t)&&"byteLength"in t}function M(t){return e(t)&&!g(t)&&!x(t)}function A(t){return t===o.TEXTURE_3D||t===o.TEXTURE_2D_ARRAY}function I(t,e,i,r=1){let a=Math.max(e,i);return t===o.TEXTURE_3D&&(a=Math.max(a,r)),Math.round(Math.log(a)/Math.LN2)+1}u.TEXTURE_UNIT_FOR_UPDATES=0;export{u as Texture};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/Logger.js";import{STD140_LAYOUT as e}from"./storageLayouts.js";function a(t,e){return t+(e-t%e)%e}const r=(()=>{const t=new ArrayBuffer(2),e=new Uint8Array(t),a=new Uint16Array(t);return e[0]=170,e[1]=187,48042===a[0]})(),n=4,i=t.getLogger("esri.views.webgl.UniformBufferLayout");class s{constructor(t){this._layout=new Map,this.byteLength=this._buildLayout(t),this.array=new ArrayBuffer(this.byteLength),this.arrayView32=new Float32Array(this.array),this._dataView=new DataView(this.array)}setValues(t,e){for(const a in t)this.setValue(a,t[a],e)}setValue(t,a,r){if(!this._layout.has(t))return void i.warn("Trying to set an unrecognized layout array member!");let s=this.byteLength/n,o=0;const{type:h,offset:y,arrayLength:u}=this._layout.get(t),{numberType:l,elementLength:f,elementCount:g,arrayStride:m}=e[h],w="number"!=typeof a,c=u*g,_=c*f;if((w?"byteLength"in a?a.byteLength/n:a.length:1)!==_&&i.warn("Attempting to set layout array member value with the wrong length!"),w)for(let e=0;e<c;e++)for(let t=0;t<f;t++){const r=y+e*m+t*n,i=e*f+t;if(this._setData(r,a[i],l)){const t=r/n;s=Math.min(s,t),o=Math.max(o,t+1)}}else if(this._setData(y,a,l)){const t=y/n;s=Math.min(s,t),o=Math.max(o,t+1)}r&&(r.from=Math.min(s,r.from),r.to=Math.max(o,r.to))}_setData(t,e,a){switch(a){case"Int32":if(e!==this._dataView.getInt32(t,r))return this._dataView.setInt32(t,e,r),!0;break;case"Uint32":if(e!==this._dataView.getUint32(t,r))return this._dataView.setUint32(t,e,r),!0;break;case"Float32":if(e!==this._dataView.getFloat32(t,r))return this._dataView.setFloat32(t,e,r),!0}return!1}_buildLayout(t){let r=0;for(const{name:i,type:s,count:o}of t){const{elementLength:t,elementCount:h,elementAlignment:y,arrayStride:u,arrayAlignment:l}=e[s],f=null!=o?o:1,g=f*h,m=g>1,w=m?l:y,c=m?g*u:t*n;r=a(r,w),this._layout.set(i,{type:s,offset:r,arrayLength:f}),r+=c,m&&(r=a(r,w))}return a(r,4*n)}}export{s as UniformBufferLayout};
5
+ import t from"../../core/Logger.js";import{STD140_LAYOUT as e}from"./storageLayouts.js";function a(t,e){return t+(e-t%e)%e}const r=(()=>{const t=new ArrayBuffer(2),e=new Uint8Array(t),a=new Uint16Array(t);return e[0]=170,e[1]=187,48042===a[0]})(),n=4,i=t.getLogger("esri.views.webgl.UniformBufferLayout");class s{constructor(t){this._layout=new Map,this.byteLength=this._buildLayout(t),this.array=new ArrayBuffer(this.byteLength),this.arrayView32=new Float32Array(this.array),this._dataView=new DataView(this.array)}setValues(t,e){for(const a in t)this.setValue(a,t[a],e)}setValue(t,a,r){if(!this._layout.has(t))return void i.warn("Trying to set an unrecognized layout array member!");let s=this.byteLength/n,o=0;const{type:h,offset:y,arrayLength:u}=this._layout.get(t),{numberType:l,elementLength:f,elementCount:g,arrayStride:m}=e[h],w="number"!=typeof a,c=u*g,_=c*f;if((w?"byteLength"in a?a.byteLength/n:a.length:1)!==_&&i.warn("Attempting to set layout array member value with the wrong length!"),w)for(let e=0;e<c;e++)for(let t=0;t<f;t++){const r=y+e*m+t*n,i=e*f+t;if(this._setData(r,a[i],l)){const t=r/n;s=Math.min(s,t),o=Math.max(o,t+1)}}else if(this._setData(y,a,l)){const t=y/n;s=Math.min(s,t),o=Math.max(o,t+1)}r&&(r.from=Math.min(s,r.from),r.to=Math.max(o,r.to))}_setData(t,e,a){switch(a){case"Int32":if(e!==this._dataView.getInt32(t,r))return this._dataView.setInt32(t,e,r),!0;break;case"Uint32":if(e!==this._dataView.getUint32(t,r))return this._dataView.setUint32(t,e,r),!0;break;case"Float32":if(e!==this._dataView.getFloat32(t,r))return this._dataView.setFloat32(t,e,r),!0}return!1}_buildLayout(t){let r=0;for(const{name:i,type:s,count:o}of t){const{elementLength:t,elementCount:h,elementAlignment:y,arrayStride:u,arrayAlignment:l}=e[s],f=o??1,g=f*h,m=g>1,w=m?l:y,c=m?g*u:t*n;r=a(r,w),this._layout.set(i,{type:s,offset:r,arrayLength:f}),r+=c,m&&(r=a(r,w))}return a(r,4*n)}}export{s as UniformBufferLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/Logger.js";import{isSome as e,disposeMaybe as i}from"../../core/maybe.js";import{ResourceType as r}from"./enums.js";import{bindVertexBufferLayout as s,unbindVertexBufferLayout as n}from"./Util.js";const o=t.getLogger("esri.views.webgl.VertexArrayObject");class f{constructor(t,e,i,s,n=null){this._context=t,this._locations=e,this._layout=i,this._buffers=s,this._indexBuffer=n,this._glName=null,this._initialized=!1,t.instanceCounter.increment(r.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((t,e)=>t+this._buffers[e].size),e(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(t=!0){if(!this._context)return void((this._glName||t&&Object.getOwnPropertyNames(this._buffers).length>0)&&o.warn("Leaked WebGL VAO"));if(this._glName){var e,s;const t=null==(e=this._context)||null==(s=e.capabilities)?void 0:s.vao;t?(t.deleteVertexArray(this._glName),this._glName=null):o.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),t){for(const t in this._buffers)this._buffers[t].dispose(),delete this._buffers[t];this._indexBuffer=i(this._indexBuffer)}this._context.instanceCounter.decrement(r.VertexArrayObject,this),this._context=null}initialize(){if(this._initialized)return;const t=this._context.capabilities.vao;if(t){const e=t.createVertexArray();t.bindVertexArray(e),this._bindLayout(),t.bindVertexArray(null),this._glName=e}this._initialized=!0}bind(){this.initialize();const t=this._context.capabilities.vao;t?t.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:t,_layout:i,_indexBuffer:r}=this;t||o.error("Vertex buffer dictionary is empty!");const n=this._context.gl;for(const e in t){const r=t[e];r||o.error("Vertex buffer is uninitialized!");const n=i[e];n||o.error("Vertex element descriptor is empty!"),s(this._context,this._locations,r,n)}if(e(r)){!!this._context.capabilities.vao?n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r)}}unbind(){this.initialize();const t=this._context.capabilities.vao;t?t.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:t,_layout:i}=this;t||o.error("Vertex buffer dictionary is empty!");for(const e in t){const r=t[e];r||o.error("Vertex buffer is uninitialized!");const s=i[e];n(this._context,this._locations,r,s)}e(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}export{f as VertexArrayObject};
5
+ import t from"../../core/Logger.js";import{isSome as e,disposeMaybe as i}from"../../core/maybe.js";import{ResourceType as r}from"./enums.js";import{bindVertexBufferLayout as s,unbindVertexBufferLayout as n}from"./Util.js";const o=t.getLogger("esri.views.webgl.VertexArrayObject");class f{constructor(t,e,i,s,n=null){this._context=t,this._locations=e,this._layout=i,this._buffers=s,this._indexBuffer=n,this._glName=null,this._initialized=!1,t.instanceCounter.increment(r.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((t,e)=>t+this._buffers[e].size),e(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(t=!0){if(!this._context)return void((this._glName||t&&Object.getOwnPropertyNames(this._buffers).length>0)&&o.warn("Leaked WebGL VAO"));if(this._glName){const t=this._context?.capabilities?.vao;t?(t.deleteVertexArray(this._glName),this._glName=null):o.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),t){for(const t in this._buffers)this._buffers[t].dispose(),delete this._buffers[t];this._indexBuffer=i(this._indexBuffer)}this._context.instanceCounter.decrement(r.VertexArrayObject,this),this._context=null}initialize(){if(this._initialized)return;const t=this._context.capabilities.vao;if(t){const e=t.createVertexArray();t.bindVertexArray(e),this._bindLayout(),t.bindVertexArray(null),this._glName=e}this._initialized=!0}bind(){this.initialize();const t=this._context.capabilities.vao;t?t.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:t,_layout:i,_indexBuffer:r}=this;t||o.error("Vertex buffer dictionary is empty!");const n=this._context.gl;for(const e in t){const r=t[e];r||o.error("Vertex buffer is uninitialized!");const n=i[e];n||o.error("Vertex element descriptor is empty!"),s(this._context,this._locations,r,n)}if(e(r)){!!this._context.capabilities.vao?n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r)}}unbind(){this.initialize();const t=this._context.capabilities.vao;t?t.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:t,_layout:i}=this;t||o.error("Vertex buffer dictionary is empty!");for(const e in t){const r=t[e];r||o.error("Vertex buffer is uninitialized!");const s=i[e];n(this._context,this._locations,r,s)}e(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}export{f as VertexArrayObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as t,isSome as e}from"../../core/maybe.js";import{getContextTypes as r,ContextType as o,createContext as s}from"./context-util.js";let n,l;function a(t){const e=r(t);for(;e.length>1;){const t=u(e.shift());if(t.available)return t}return u(e.shift())}function u(t){switch(t){case o.WEBGL1:return i();case o.WEBGL2:return p()}}function i(){return n||(n=x()),n}function p(){return l||(l=h()),l}class f{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsElementIndexUint=!1,this.supportsStandardDerivatives=!1,this.supportsInstancedArrays=!1,this.supportsTextureFloat=!1,this.supportsTextureFloatLinear=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsTextureHalfFloat=!1,this.supportsTextureHalfFloatLinear=!1,this.supportsColorBufferHalfFloat=!1,this.supportsColorBufferHalfFloatBlend=!1}}class E extends f{constructor(){super(...arguments),this.type=o.WEBGL1}}class c extends f{constructor(){super(...arguments),this.type=o.WEBGL2,this.supportsElementIndexUint=!0,this.supportsStandardDerivatives=!0,this.supportsInstancedArrays=!0,this.supportsTextureFloat=!0,this.supportsTextureHalfFloat=!0,this.supportsTextureHalfFloatLinear=!0}}function _(r,n){if(r===o.WEBGL1&&void 0===typeof WebGLRenderingContext||r===o.WEBGL2&&void 0===typeof WebGL2RenderingContext)return null;const l=document.createElement("canvas");if(!l)return null;let a=s(l,r,{failIfMajorPerformanceCaveat:!0});if(t(a)&&(a=s(l,r),e(a)&&(n.majorPerformanceCaveat=!0)),t(a))return a;if(r===o.WEBGL1){const t=a.getParameter(a.VERSION),e=null==t?void 0:t.match(/^WebGL\s+([\d.]*)/);if(e){const t=parseFloat(e[1]);n.available=t>=.94}}else n.available=!0;n.maxTextureSize=a.getParameter(a.MAX_TEXTURE_SIZE),n.supportsVertexShaderSamplers=a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const u=a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT);return u&&(n.supportsHighPrecisionFragment=u.precision>0),a}function x(){const e=new E,r=_(o.WEBGL1,e);return t(r)||(e.supportsElementIndexUint=null!==r.getExtension("OES_element_index_uint"),e.supportsStandardDerivatives=null!==r.getExtension("OES_standard_derivatives"),e.supportsInstancedArrays=null!==r.getExtension("ANGLE_instanced_arrays"),e.supportsTextureFloat=null!==r.getExtension("OES_texture_float"),e.supportsTextureFloatLinear=null!==r.getExtension("OES_texture_float_linear"),e.supportsColorBufferFloat=null!==r.getExtension("WEBGL_color_buffer_float"),e.supportsColorBufferFloatBlend=null!==r.getExtension("EXT_float_blend"),e.supportsTextureHalfFloat=null!==r.getExtension("OES_texture_half_float"),e.supportsTextureHalfFloatLinear=null!==r.getExtension("OES_texture_half_float_linear"),e.supportsColorBufferHalfFloat=null!==r.getExtension("EXT_color_buffer_half_float"),e.supportsColorBufferHalfFloatBlend=e.supportsColorBufferHalfFloat),e}function h(){const e=new c,r=_(o.WEBGL2,e);return t(r)||(e.supportsTextureFloatLinear=null!==r.getExtension("OES_texture_float_linear"),e.supportsColorBufferFloat=null!==r.getExtension("EXT_color_buffer_float"),e.supportsColorBufferFloatBlend=null!==r.getExtension("EXT_float_blend"),e.supportsColorBufferHalfFloat=e.supportsColorBufferFloat||null!==r.getExtension("EXT_color_buffer_half_float"),e.supportsColorBufferHalfFloatBlend=e.supportsColorBufferHalfFloat),e}export{i as getWebGL1Capabilities,p as getWebGL2Capabilities,a as getWebGLCapabilities,u as getWebGLVersionCapabilities};
5
+ import{isNone as t,isSome as e}from"../../core/maybe.js";import{getContextTypes as r,ContextType as o,createContext as s}from"./context-util.js";let n,l;function a(t){const e=r(t);for(;e.length>1;){const t=u(e.shift());if(t.available)return t}return u(e.shift())}function u(t){switch(t){case o.WEBGL1:return i();case o.WEBGL2:return p()}}function i(){return n||(n=x()),n}function p(){return l||(l=h()),l}class f{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsElementIndexUint=!1,this.supportsStandardDerivatives=!1,this.supportsInstancedArrays=!1,this.supportsTextureFloat=!1,this.supportsTextureFloatLinear=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsTextureHalfFloat=!1,this.supportsTextureHalfFloatLinear=!1,this.supportsColorBufferHalfFloat=!1,this.supportsColorBufferHalfFloatBlend=!1}}class E extends f{constructor(){super(...arguments),this.type=o.WEBGL1}}class c extends f{constructor(){super(...arguments),this.type=o.WEBGL2,this.supportsElementIndexUint=!0,this.supportsStandardDerivatives=!0,this.supportsInstancedArrays=!0,this.supportsTextureFloat=!0,this.supportsTextureHalfFloat=!0,this.supportsTextureHalfFloatLinear=!0}}function _(r,n){if(r===o.WEBGL1&&void 0===typeof WebGLRenderingContext||r===o.WEBGL2&&void 0===typeof WebGL2RenderingContext)return null;const l=document.createElement("canvas");if(!l)return null;let a=s(l,r,{failIfMajorPerformanceCaveat:!0});if(t(a)&&(a=s(l,r),e(a)&&(n.majorPerformanceCaveat=!0)),t(a))return a;if(r===o.WEBGL1){const t=a.getParameter(a.VERSION)?.match(/^WebGL\s+([\d.]*)/);if(t){const e=parseFloat(t[1]);n.available=e>=.94}}else n.available=!0;n.maxTextureSize=a.getParameter(a.MAX_TEXTURE_SIZE),n.supportsVertexShaderSamplers=a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const u=a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT);return u&&(n.supportsHighPrecisionFragment=u.precision>0),a}function x(){const e=new E,r=_(o.WEBGL1,e);return t(r)||(e.supportsElementIndexUint=null!==r.getExtension("OES_element_index_uint"),e.supportsStandardDerivatives=null!==r.getExtension("OES_standard_derivatives"),e.supportsInstancedArrays=null!==r.getExtension("ANGLE_instanced_arrays"),e.supportsTextureFloat=null!==r.getExtension("OES_texture_float"),e.supportsTextureFloatLinear=null!==r.getExtension("OES_texture_float_linear"),e.supportsColorBufferFloat=null!==r.getExtension("WEBGL_color_buffer_float"),e.supportsColorBufferFloatBlend=null!==r.getExtension("EXT_float_blend"),e.supportsTextureHalfFloat=null!==r.getExtension("OES_texture_half_float"),e.supportsTextureHalfFloatLinear=null!==r.getExtension("OES_texture_half_float_linear"),e.supportsColorBufferHalfFloat=null!==r.getExtension("EXT_color_buffer_half_float"),e.supportsColorBufferHalfFloatBlend=e.supportsColorBufferHalfFloat),e}function h(){const e=new c,r=_(o.WEBGL2,e);return t(r)||(e.supportsTextureFloatLinear=null!==r.getExtension("OES_texture_float_linear"),e.supportsColorBufferFloat=null!==r.getExtension("EXT_color_buffer_float"),e.supportsColorBufferFloatBlend=null!==r.getExtension("EXT_float_blend"),e.supportsColorBufferHalfFloat=e.supportsColorBufferFloat||null!==r.getExtension("EXT_color_buffer_half_float"),e.supportsColorBufferHalfFloatBlend=e.supportsColorBufferHalfFloat),e}export{i as getWebGL1Capabilities,p as getWebGL2Capabilities,a as getWebGLCapabilities,u as getWebGLVersionCapabilities};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{ContextType as e}from"./context-util.js";import{PixelType as t,TextureType as n,PixelFormat as a,SizedPixelFormat as r,TextureSamplingMode as i,TextureWrapMode as o,TargetType as s,DepthStencilTargetType as u,UniformType as f}from"./enums.js";import{FramebufferObject as l}from"./FramebufferObject.js";import{Texture as m}from"./Texture.js";function c(s,u,f="nearest",l=!1){var c;const _=!(l&&"u8"===u.pixelType),p=_?t.FLOAT:t.UNSIGNED_BYTE,E=null==u.pixels||0===u.pixels.length?null:_?u.getAsRGBAFloat():u.getAsRGBA(),T=null==(c=s.capabilities.textureFloat)?void 0:c.textureFloatLinear,g={width:u.width,height:u.height,target:n.TEXTURE_2D,pixelFormat:a.RGBA,internalFormat:s.type===e.WEBGL2&&_?r.RGBA32F:a.RGBA,samplingMode:!T||"bilinear"!==f&&"cubic"!==f?i.NEAREST:i.LINEAR,dataType:p,wrapMode:o.CLAMP_TO_EDGE,flipped:!1};return new m(s,g,E)}function _(e,r,f,c){const _=c?t.UNSIGNED_BYTE:t.FLOAT,p={width:r,height:f,target:n.TEXTURE_2D,pixelFormat:a.RGBA,internalFormat:a.RGBA,samplingMode:i.NEAREST,dataType:_,wrapMode:o.CLAMP_TO_EDGE,flipped:!1},E=new m(e,p);return new l(e,{colorTarget:s.TEXTURE,depthStencilTarget:u.DEPTH_STENCIL_RENDER_BUFFER,width:r,height:f},E)}function p(s,u){const{spacing:f,offsets:l,coefficients:c,size:[_,p]}=u,E=f[0]>1,T={width:E?4*_:_,height:p,target:n.TEXTURE_2D,pixelFormat:a.RGBA,internalFormat:s.type===e.WEBGL2?r.RGBA32F:a.RGBA,dataType:t.FLOAT,samplingMode:i.NEAREST,wrapMode:o.CLAMP_TO_EDGE,flipped:!1},g=new Float32Array(E?_*p*16:2*l.length);if(E)for(let e=0,t=0;e<c.length;e++)g[t++]=c[e],e%3==2&&(g[t++]=1);else for(let e=0;e<p;e++)for(let t=0;t<_;t++){const n=4*(e*_+t),a=2*(t*p+e);g[n]=l[a],g[n+1]=l[a+1],g[n+3]=-1===l[a]?0:1}return new m(s,T,g)}function E(e,r){const s={width:r.length/4,height:1,target:n.TEXTURE_2D,pixelFormat:a.RGBA,internalFormat:a.RGBA,dataType:t.UNSIGNED_BYTE,samplingMode:i.NEAREST,wrapMode:o.CLAMP_TO_EDGE,flipped:!1};return new m(e,s,r)}function T(e,t,n,a=1,r=!0,i=!1){return{u_flipY:r,u_isFloatTexture:i,u_applyTransform:!!e,u_opacity:a,u_transformSpacing:e?e.spacing:null,u_transformGridSize:e?e.size:null,u_targetImageSize:t,u_srcImageSize:n}}function g(e,t){return{u_colormapOffset:t||0,u_colormapMaxIndex:e?e.length/4-1:null}}function A(e,t){return{u_scale:e,u_offset:t}}function h(e){return{u_bandCount:e.bandCount,u_minOutput:e.outMin,u_maxOutput:e.outMax,u_minCutOff:e.minCutOff,u_maxCutOff:e.maxCutOff,u_factor:e.factor,u_useGamma:e.useGamma,u_gamma:e.gamma,u_gammaCorrection:e.gammaCorrection}}function d(e){return{u_hillshadeType:e.hillshadeType,u_sinZcosAs:e.sinZcosAs,u_sinZsinAs:e.sinZsinAs,u_cosZs:e.cosZs,u_weights:e.weights,u_factor:e.factor,u_minValue:e.minValue,u_maxValue:e.maxValue}}function O(e,t){const n=e.gl,a=t.glName,r=n.getProgramParameter(a,n.ACTIVE_UNIFORMS),i=new Map;let o;for(let s=0;s<r;s++)o=n.getActiveUniform(a,s),o&&i.set(o.name,{location:n.getUniformLocation(a,o.name),info:o});return i}function F(e,t,n){Object.keys(n).forEach((a=>{const r=t.get(a)||t.get(a+"[0]");r&&U(e,a,n[a],r)}))}function R(e,t,n,a){n.length===a.length&&(a.some((e=>null==e))||n.some((e=>null==e))||n.forEach(((n,r)=>{t.setUniform1i(n,r),e.bindTexture(a[r],r)})))}function U(e,t,n,a){if(null===a||null==n)return!1;const{info:r}=a;switch(r.type){case f.FLOAT:r.size>1?e.setUniform1fv(t,n):e.setUniform1f(t,n);break;case f.FLOAT_VEC2:e.setUniform2fv(t,n);break;case f.FLOAT_VEC3:e.setUniform3fv(t,n);break;case f.FLOAT_VEC4:e.setUniform4fv(t,n);break;case f.FLOAT_MAT3:e.setUniformMatrix3fv(t,n);break;case f.FLOAT_MAT4:e.setUniformMatrix4fv(t,n);break;case f.INT:r.size>1?e.setUniform1iv(t,n):e.setUniform1i(t,n);break;case f.BOOL:e.setUniform1i(t,n?1:0);break;case f.INT_VEC2:case f.BOOL_VEC2:e.setUniform2iv(t,n);break;case f.INT_VEC3:case f.BOOL_VEC3:e.setUniform3iv(t,n);break;case f.INT_VEC4:case f.BOOL_VEC4:e.setUniform4iv(t,n);break;default:return!1}return!0}export{E as createColormapTexture,_ as createFrameBuffer,c as createRasterTexture,p as createTransformTexture,A as getBasicGridUniforms,g as getColormapUniforms,T as getCommonUniforms,d as getShadedReliefUniforms,h as getStretchUniforms,O as getUniformLocationInfos,R as setTextures,F as setUniforms};
5
+ import{Z as e}from"../../chunks/vec2f64.js";import{ContextType as t}from"./context-util.js";import{PixelType as n,TextureType as a,PixelFormat as r,SizedPixelFormat as i,TextureSamplingMode as o,TextureWrapMode as s,TargetType as u,DepthStencilTargetType as f,UniformType as m}from"./enums.js";import{FramebufferObject as c}from"./FramebufferObject.js";import{Texture as l}from"./Texture.js";function _(e,u,f="nearest",m=!1){const c=!(m&&"u8"===u.pixelType),_=c?n.FLOAT:n.UNSIGNED_BYTE,p=null==u.pixels||0===u.pixels.length?null:c?u.getAsRGBAFloat():u.getAsRGBA(),E=e.capabilities.textureFloat?.textureFloatLinear,T={width:u.width,height:u.height,target:a.TEXTURE_2D,pixelFormat:r.RGBA,internalFormat:e.type===t.WEBGL2&&c?i.RGBA32F:r.RGBA,samplingMode:!E||"bilinear"!==f&&"cubic"!==f?o.NEAREST:o.LINEAR,dataType:_,wrapMode:s.CLAMP_TO_EDGE,flipped:!1};return new l(e,T,p)}function p(e,t,i,m){const _=m?n.UNSIGNED_BYTE:n.FLOAT,p={width:t,height:i,target:a.TEXTURE_2D,pixelFormat:r.RGBA,internalFormat:r.RGBA,samplingMode:o.NEAREST,dataType:_,wrapMode:s.CLAMP_TO_EDGE,flipped:!1},E=new l(e,p);return new c(e,{colorTarget:u.TEXTURE,depthStencilTarget:f.DEPTH_STENCIL_RENDER_BUFFER,width:t,height:i},E)}function E(e,u){const{spacing:f,offsets:m,coefficients:c,size:[_,p]}=u,E=f[0]>1,T={width:E?4*_:_,height:p,target:a.TEXTURE_2D,pixelFormat:r.RGBA,internalFormat:e.type===t.WEBGL2?i.RGBA32F:r.RGBA,dataType:n.FLOAT,samplingMode:o.NEAREST,wrapMode:s.CLAMP_TO_EDGE,flipped:!1},g=new Float32Array(E?_*p*16:2*m.length);if(E)for(let t=0,n=0;t<c.length;t++)g[n++]=c[t],t%3==2&&(g[n++]=1);else for(let t=0;t<p;t++)for(let e=0;e<_;e++){const n=4*(t*_+e),a=2*(e*p+t);g[n]=m[a],g[n+1]=m[a+1],g[n+3]=-1===m[a]?0:1}return new l(e,T,g)}function T(e,t){const i={width:t.length/4,height:1,target:a.TEXTURE_2D,pixelFormat:r.RGBA,internalFormat:r.RGBA,dataType:n.UNSIGNED_BYTE,samplingMode:o.NEAREST,wrapMode:s.CLAMP_TO_EDGE,flipped:!1};return new l(e,i,t)}function g(t,n,a,r=1,i=!0){return{u_flipY:i,u_applyTransform:!!t,u_opacity:r,u_transformSpacing:t?t.spacing:e,u_transformGridSize:t?t.size:e,u_targetImageSize:n,u_srcImageSize:a}}function A(e,t){return{u_colormapOffset:t||0,u_colormapMaxIndex:e?e.length/4-1:0}}function h(e,t){return{u_scale:e,u_offset:t}}function d(e){return{u_bandCount:e.bandCount,u_minOutput:e.outMin,u_maxOutput:e.outMax,u_minCutOff:e.minCutOff,u_maxCutOff:e.maxCutOff,u_factor:e.factor,u_useGamma:e.useGamma,u_gamma:e.gamma,u_gammaCorrection:e.gammaCorrection}}function O(e){return{u_hillshadeType:e.hillshadeType,u_sinZcosAs:e.sinZcosAs,u_sinZsinAs:e.sinZsinAs,u_cosZs:e.cosZs,u_weights:e.weights,u_factor:e.factor,u_minValue:e.minValue,u_maxValue:e.maxValue}}function F(e,t){const n=e.gl,a=t.glName,r=n.getProgramParameter(a,n.ACTIVE_UNIFORMS),i=new Map;let o;for(let s=0;s<r;s++)o=n.getActiveUniform(a,s),o&&i.set(o.name,{location:n.getUniformLocation(a,o.name),info:o});return i}function R(e,t,n){Object.keys(n).forEach((a=>{const r=t.get(a)||t.get(a+"[0]");r&&G(e,a,n[a],r)}))}function U(e,t,n,a){n.length===a.length&&(a.some((e=>null==e))||n.some((e=>null==e))||n.forEach(((n,r)=>{t.setUniform1i(n,r),e.bindTexture(a[r],r)})))}function G(e,t,n,a){if(null===a||null==n)return!1;const{info:r}=a;switch(r.type){case m.FLOAT:r.size>1?e.setUniform1fv(t,n):e.setUniform1f(t,n);break;case m.FLOAT_VEC2:e.setUniform2fv(t,n);break;case m.FLOAT_VEC3:e.setUniform3fv(t,n);break;case m.FLOAT_VEC4:e.setUniform4fv(t,n);break;case m.FLOAT_MAT3:e.setUniformMatrix3fv(t,n);break;case m.FLOAT_MAT4:e.setUniformMatrix4fv(t,n);break;case m.INT:r.size>1?e.setUniform1iv(t,n):e.setUniform1i(t,n);break;case m.BOOL:e.setUniform1i(t,n?1:0);break;case m.INT_VEC2:case m.BOOL_VEC2:e.setUniform2iv(t,n);break;case m.INT_VEC3:case m.BOOL_VEC3:e.setUniform3iv(t,n);break;case m.INT_VEC4:case m.BOOL_VEC4:e.setUniform4iv(t,n);break;default:return!1}return!0}export{T as createColormapTexture,p as createFrameBuffer,_ as createRasterTexture,E as createTransformTexture,h as getBasicGridUniforms,A as getColormapUniforms,g as getCommonUniforms,O as getShadedReliefUniforms,d as getStretchUniforms,F as getUniformLocationInfos,U as setTextures,R as setUniforms};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{blendingAlpha as e}from"../3d/webgl-engine/lib/OrderIndependentTransparency.js";import{BufferObject as t}from"./BufferObject.js";import{ContextType as r}from"./context-util.js";import{TargetType as n,DepthStencilTargetType as o,TextureType as i,TextureWrapMode as a,PixelFormat as u,PixelType as f,SizedPixelFormat as l,TextureSamplingMode as c,Usage as s,DataType as d,PrimitiveType as g}from"./enums.js";import{FramebufferObject as b}from"./FramebufferObject.js";import{makePipelineState as E}from"./renderState.js";import{VertexArrayObject as p}from"./VertexArrayObject.js";import{VertexElementDescriptor as m}from"./VertexElementDescriptor.js";var T,_,F,v={exports:{}};function x(T){var _,F,x,A,R;if(!T.gl)return!1;if(T.type===r.WEBGL1)return!(null==(A=T.capabilities.textureFloat)||!A.textureFloat||null==(R=T.capabilities.colorBufferFloat)||!R.textureFloat);if(!((null==(_=T.capabilities.textureFloat)?void 0:_.textureFloat)&&(null==(F=T.capabilities.colorBufferFloat)?void 0:F.textureFloat)&&(null==(x=T.capabilities.colorBufferFloat)?void 0:x.floatBlend)))return!1;const S=new b(T,{colorTarget:n.TEXTURE,depthStencilTarget:o.NONE},{target:i.TEXTURE_2D,wrapMode:a.CLAMP_TO_EDGE,pixelFormat:u.RGBA,dataType:f.FLOAT,internalFormat:l.RGBA32F,samplingMode:c.NEAREST,width:1,height:1}),h=t.createVertex(T,s.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),P=new p(T,new Map([["a_pos",0]]),{geometry:[new m("a_pos",2,d.UNSIGNED_SHORT,0,4)]},{geometry:h}),L="\n precision highp float;\n attribute vec2 a_pos;\n\n void main() {\n gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0);\n }\n ",B="\n precision highp float;\n\n void main() {\n gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5);\n }\n ",C=T.programCache.acquire(L,B,new Map([["a_pos",0]]));T.useProgram(C);const w=T.getBoundFramebufferObject(),{x:O,y:N,width:I,height:U}=T.getViewport();T.bindFramebuffer(S),T.setViewport(0,0,1,1),T.bindVAO(P),T.drawArrays(g.TRIANGLE_STRIP,0,4);const y=E({blending:e});T.setPipelineState(y),T.drawArrays(g.TRIANGLE_STRIP,0,4),v.exports.init(T);const D=T.gl.getError();return T.setViewport(O,N,I,U),T.bindFramebuffer(w),C.dispose(),P.dispose(!1),h.dispose(),S.dispose(),1282!==D||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}T=v,_=function(){var e=function(e){window.console&&window.console.log&&window.console.log(e)},t=function(t){window.console&&window.console.error?window.console.error(t):e(t)},r={enable:{1:{0:!0}},disable:{1:{0:!0}},getParameter:{1:{0:!0}},drawArrays:{3:{0:!0}},drawElements:{4:{0:!0,2:!0}},createShader:{1:{0:!0}},getShaderParameter:{2:{1:!0}},getProgramParameter:{2:{1:!0}},getShaderPrecisionFormat:{2:{0:!0,1:!0}},getVertexAttrib:{2:{1:!0}},vertexAttribPointer:{6:{2:!0}},bindTexture:{2:{0:!0}},activeTexture:{1:{0:!0}},getTexParameter:{2:{0:!0,1:!0}},texParameterf:{3:{0:!0,1:!0}},texParameteri:{3:{0:!0,1:!0,2:!0}},texImage2D:{9:{0:!0,2:!0,6:!0,7:!0},6:{0:!0,2:!0,3:!0,4:!0}},texSubImage2D:{9:{0:!0,6:!0,7:!0},7:{0:!0,4:!0,5:!0}},copyTexImage2D:{8:{0:!0,2:!0}},copyTexSubImage2D:{8:{0:!0}},generateMipmap:{1:{0:!0}},compressedTexImage2D:{7:{0:!0,2:!0}},compressedTexSubImage2D:{8:{0:!0,6:!0}},bindBuffer:{2:{0:!0}},bufferData:{3:{0:!0,2:!0}},bufferSubData:{3:{0:!0}},getBufferParameter:{2:{0:!0,1:!0}},pixelStorei:{2:{0:!0,1:!0}},readPixels:{7:{4:!0,5:!0}},bindRenderbuffer:{2:{0:!0}},bindFramebuffer:{2:{0:!0}},checkFramebufferStatus:{1:{0:!0}},framebufferRenderbuffer:{4:{0:!0,1:!0,2:!0}},framebufferTexture2D:{5:{0:!0,1:!0,2:!0}},getFramebufferAttachmentParameter:{3:{0:!0,1:!0,2:!0}},getRenderbufferParameter:{2:{0:!0,1:!0}},renderbufferStorage:{4:{0:!0,1:!0}},clear:{1:{0:{enumBitwiseOr:["COLOR_BUFFER_BIT","DEPTH_BUFFER_BIT","STENCIL_BUFFER_BIT"]}}},depthFunc:{1:{0:!0}},blendFunc:{2:{0:!0,1:!0}},blendFuncSeparate:{4:{0:!0,1:!0,2:!0,3:!0}},blendEquation:{1:{0:!0}},blendEquationSeparate:{2:{0:!0,1:!0}},stencilFunc:{3:{0:!0}},stencilFuncSeparate:{4:{0:!0,1:!0}},stencilMaskSeparate:{2:{0:!0}},stencilOp:{3:{0:!0,1:!0,2:!0}},stencilOpSeparate:{4:{0:!0,1:!0,2:!0,3:!0}},cullFace:{1:{0:!0}},frontFace:{1:{0:!0}},drawArraysInstancedANGLE:{4:{0:!0}},drawElementsInstancedANGLE:{5:{0:!0,2:!0}},blendEquationEXT:{1:{0:!0}}},n=null,o=null;function i(e){if(null==n)for(var t in n={},o={},e)"number"==typeof e[t]&&(n[e[t]]=t,o[t]=e[t])}function a(){if(null==n)throw"WebGLDebugUtils.init(ctx) not called"}function u(e){return a(),void 0!==n[e]}function f(e){a();var t=n[e];return void 0!==t?"gl."+t:"/*UNKNOWN WebGL ENUM*/ 0x"+e.toString(16)}function l(e,t,n,i){var a;if(void 0!==(a=r[e])&&void 0!==(a=a[t])&&a[n]){if("object"==typeof a[n]&&void 0!==a[n].enumBitwiseOr){for(var u=a[n].enumBitwiseOr,l=0,c=[],s=0;s<u.length;++s){var d=o[u[s]];0!=(i&d)&&(l|=d,c.push(f(d)))}return l===i?c.join(" | "):f(i)}return f(i)}return null===i?"null":void 0===i?"undefined":i.toString()}function c(e,t){for(var r="",n=t.length,o=0;o<n;++o)r+=(0==o?"":", ")+l(e,n,o,t[o]);return r}function s(e,t,r){e.__defineGetter__(r,(function(){return t[r]})),e.__defineSetter__(r,(function(e){t[r]=e}))}function d(e,r,n,o){o=o||e,i(e),r=r||function(e,r,n){for(var o="",i=n.length,a=0;a<i;++a)o+=(0==a?"":", ")+l(r,i,a,n[a]);t("WebGL error "+f(e)+" in "+r+"("+o+")")};var a={};function u(e,t){return function(){n&&n(t,arguments);var i=e[t].apply(e,arguments),u=o.getError();return 0!=u&&(a[u]=!0,r(u,t,arguments)),i}}var c={};for(var g in e)if("function"==typeof e[g])if("getExtension"!=g)c[g]=u(e,g);else{var b=u(e,g);c[g]=function(){return d(b.apply(e,arguments),r,n,o)}}else s(c,e,g);return c.getError=function(){for(var t in a)if(a.hasOwnProperty(t)&&a[t])return a[t]=!1,t;return e.NO_ERROR},c}function g(e){var t=e.getParameter(e.MAX_VERTEX_ATTRIBS),r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r);for(var n=0;n<t;++n)e.disableVertexAttribArray(n),e.vertexAttribPointer(n,4,e.FLOAT,!1,0,0),e.vertexAttrib1f(n,0);e.deleteBuffer(r);var o=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);for(n=0;n<o;++n)e.activeTexture(e.TEXTURE0+n),e.bindTexture(e.TEXTURE_CUBE_MAP,null),e.bindTexture(e.TEXTURE_2D,null);for(e.activeTexture(e.TEXTURE0),e.useProgram(null),e.bindBuffer(e.ARRAY_BUFFER,null),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.DITHER),e.disable(e.SCISSOR_TEST),e.blendColor(0,0,0,0),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.clearColor(0,0,0,0),e.clearDepth(1),e.clearStencil(-1),e.colorMask(!0,!0,!0,!0),e.cullFace(e.BACK),e.depthFunc(e.LESS),e.depthMask(!0),e.depthRange(0,1),e.frontFace(e.CCW),e.hint(e.GENERATE_MIPMAP_HINT,e.DONT_CARE),e.lineWidth(1),e.pixelStorei(e.PACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.UNPACK_COLORSPACE_CONVERSION_WEBGL&&e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),e.polygonOffset(0,0),e.sampleCoverage(1,!1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilMask(4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.viewport(0,0,e.canvas.width,e.canvas.height),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT);e.getError(););}function b(e){var t,r,n=[],o=[],i={},a=1,u=!1,f=[],l=0,c=0,d=!1,b=0,E={};function p(e){return"function"==typeof e?e:function(t){e.handleEvent(t)}}e.getContext=(r=e.getContext,function(){var n=r.apply(e,arguments);if(n instanceof WebGLRenderingContext){if(n!=t){if(t)throw"got different context";i=S(t=n)}return i}return n});var m=function(e){n.push(p(e))},T=function(e){o.push(p(e))};function _(e){var t=e.addEventListener;e.addEventListener=function(r,n,o){switch(r){case"webglcontextlost":m(n);break;case"webglcontextrestored":T(n);break;default:t.apply(e,arguments)}}}function F(){for(var e=Object.keys(E),t=0;t<e.length;++t)delete E[e]}function v(){++c,u||l==c&&e.loseContext()}function x(e,t){var r=e[t];return function(){if(v(),!u)return r.apply(e,arguments)}}function A(){for(var e=0;e<f.length;++e){var r=f[e];r instanceof WebGLBuffer?t.deleteBuffer(r):r instanceof WebGLFramebuffer?t.deleteFramebuffer(r):r instanceof WebGLProgram?t.deleteProgram(r):r instanceof WebGLRenderbuffer?t.deleteRenderbuffer(r):r instanceof WebGLShader?t.deleteShader(r):r instanceof WebGLTexture&&t.deleteTexture(r)}}function R(e){return{statusMessage:e,preventDefault:function(){d=!0}}}return _(e),e.loseContext=function(){if(!u){for(u=!0,l=0,++a;t.getError(););F(),E[t.CONTEXT_LOST_WEBGL]=!0;var r=R("context lost"),o=n.slice();setTimeout((function(){for(var t=0;t<o.length;++t)o[t](r);b>=0&&setTimeout((function(){e.restoreContext()}),b)}),0)}},e.restoreContext=function(){u&&o.length&&setTimeout((function(){if(!d)throw"can not restore. webglcontestlost listener did not call event.preventDefault";A(),g(t),u=!1,c=0,d=!1;for(var e=o.slice(),r=R("context restored"),n=0;n<e.length;++n)e[n](r)}),0)},e.loseContextInNCalls=function(e){if(u)throw"You can not ask a lost contet to be lost";l=c+e},e.getNumCalls=function(){return c},e.setRestoreTimeout=function(e){b=e},e;function S(e){for(var r in e)"function"==typeof e[r]?i[r]=x(e,r):s(i,e,r);i.getError=function(){if(v(),!u)for(;e=t.getError();)E[e]=!0;for(var e in E)if(E[e])return delete E[e],e;return i.NO_ERROR};for(var n=["createBuffer","createFramebuffer","createProgram","createRenderbuffer","createShader","createTexture"],o=0;o<n.length;++o){var l=n[o];i[l]=function(t){return function(){if(v(),u)return null;var r=t.apply(e,arguments);return r.__webglDebugContextLostId__=a,f.push(r),r}}(e[l])}var c=["getActiveAttrib","getActiveUniform","getBufferParameter","getContextAttributes","getAttachedShaders","getFramebufferAttachmentParameter","getParameter","getProgramParameter","getProgramInfoLog","getRenderbufferParameter","getShaderParameter","getShaderInfoLog","getShaderSource","getTexParameter","getUniform","getUniformLocation","getVertexAttrib"];for(o=0;o<c.length;++o)l=c[o],i[l]=function(t){return function(){return v(),u?null:t.apply(e,arguments)}}(i[l]);var d=["isBuffer","isEnabled","isFramebuffer","isProgram","isRenderbuffer","isShader","isTexture"];for(o=0;o<d.length;++o)l=d[o],i[l]=function(t){return function(){return v(),!u&&t.apply(e,arguments)}}(i[l]);return i.checkFramebufferStatus=function(t){return function(){return v(),u?i.FRAMEBUFFER_UNSUPPORTED:t.apply(e,arguments)}}(i.checkFramebufferStatus),i.getAttribLocation=function(t){return function(){return v(),u?-1:t.apply(e,arguments)}}(i.getAttribLocation),i.getVertexAttribOffset=function(t){return function(){return v(),u?0:t.apply(e,arguments)}}(i.getVertexAttribOffset),i.isContextLost=function(){return u},i}}return{init:i,mightBeEnum:u,glEnumToString:f,glFunctionArgToString:l,glFunctionArgsToString:c,makeDebugContext:d,makeLostContextSimulatingCanvas:b,resetToInitialState:g}},void 0!==(F=_())&&(T.exports=F);export{x as testFloatBufferBlend};
5
+ import{blendingAlpha as e}from"../3d/webgl-engine/lib/OrderIndependentTransparency.js";import{BufferObject as t}from"./BufferObject.js";import{ContextType as r}from"./context-util.js";import{TargetType as n,DepthStencilTargetType as o,TextureType as a,TextureWrapMode as i,PixelFormat as f,PixelType as u,SizedPixelFormat as l,TextureSamplingMode as c,Usage as s,DataType as d,PrimitiveType as g}from"./enums.js";import{FramebufferObject as b}from"./FramebufferObject.js";import{makePipelineState as E}from"./renderState.js";import{VertexArrayObject as p}from"./VertexArrayObject.js";import{VertexElementDescriptor as m}from"./VertexElementDescriptor.js";var T,_,F,x={exports:{}};function A(T){if(!T.gl)return!1;if(T.type===r.WEBGL1)return!(!T.capabilities.textureFloat?.textureFloat||!T.capabilities.colorBufferFloat?.textureFloat);if(!(T.capabilities.textureFloat?.textureFloat&&T.capabilities.colorBufferFloat?.textureFloat&&T.capabilities.colorBufferFloat?.floatBlend))return!1;const _=new b(T,{colorTarget:n.TEXTURE,depthStencilTarget:o.NONE},{target:a.TEXTURE_2D,wrapMode:i.CLAMP_TO_EDGE,pixelFormat:f.RGBA,dataType:u.FLOAT,internalFormat:l.RGBA32F,samplingMode:c.NEAREST,width:1,height:1}),F=t.createVertex(T,s.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),A=new p(T,new Map([["a_pos",0]]),{geometry:[new m("a_pos",2,d.UNSIGNED_SHORT,0,4)]},{geometry:F}),R="\n precision highp float;\n attribute vec2 a_pos;\n\n void main() {\n gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0);\n }\n ",v="\n precision highp float;\n\n void main() {\n gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5);\n }\n ",S=T.programCache.acquire(R,v,new Map([["a_pos",0]]));T.useProgram(S);const h=T.getBoundFramebufferObject(),{x:P,y:L,width:B,height:C}=T.getViewport();T.bindFramebuffer(_),T.setViewport(0,0,1,1),T.bindVAO(A),T.drawArrays(g.TRIANGLE_STRIP,0,4);const w=E({blending:e});T.setPipelineState(w),T.drawArrays(g.TRIANGLE_STRIP,0,4),x.exports.init(T);const O=T.gl.getError();return T.setViewport(P,L,B,C),T.bindFramebuffer(h),S.dispose(),A.dispose(!1),F.dispose(),_.dispose(),1282!==O||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}T=x,_=function(){var e=function(e){window.console&&window.console.log&&window.console.log(e)},t=function(t){window.console&&window.console.error?window.console.error(t):e(t)},r={enable:{1:{0:!0}},disable:{1:{0:!0}},getParameter:{1:{0:!0}},drawArrays:{3:{0:!0}},drawElements:{4:{0:!0,2:!0}},createShader:{1:{0:!0}},getShaderParameter:{2:{1:!0}},getProgramParameter:{2:{1:!0}},getShaderPrecisionFormat:{2:{0:!0,1:!0}},getVertexAttrib:{2:{1:!0}},vertexAttribPointer:{6:{2:!0}},bindTexture:{2:{0:!0}},activeTexture:{1:{0:!0}},getTexParameter:{2:{0:!0,1:!0}},texParameterf:{3:{0:!0,1:!0}},texParameteri:{3:{0:!0,1:!0,2:!0}},texImage2D:{9:{0:!0,2:!0,6:!0,7:!0},6:{0:!0,2:!0,3:!0,4:!0}},texSubImage2D:{9:{0:!0,6:!0,7:!0},7:{0:!0,4:!0,5:!0}},copyTexImage2D:{8:{0:!0,2:!0}},copyTexSubImage2D:{8:{0:!0}},generateMipmap:{1:{0:!0}},compressedTexImage2D:{7:{0:!0,2:!0}},compressedTexSubImage2D:{8:{0:!0,6:!0}},bindBuffer:{2:{0:!0}},bufferData:{3:{0:!0,2:!0}},bufferSubData:{3:{0:!0}},getBufferParameter:{2:{0:!0,1:!0}},pixelStorei:{2:{0:!0,1:!0}},readPixels:{7:{4:!0,5:!0}},bindRenderbuffer:{2:{0:!0}},bindFramebuffer:{2:{0:!0}},checkFramebufferStatus:{1:{0:!0}},framebufferRenderbuffer:{4:{0:!0,1:!0,2:!0}},framebufferTexture2D:{5:{0:!0,1:!0,2:!0}},getFramebufferAttachmentParameter:{3:{0:!0,1:!0,2:!0}},getRenderbufferParameter:{2:{0:!0,1:!0}},renderbufferStorage:{4:{0:!0,1:!0}},clear:{1:{0:{enumBitwiseOr:["COLOR_BUFFER_BIT","DEPTH_BUFFER_BIT","STENCIL_BUFFER_BIT"]}}},depthFunc:{1:{0:!0}},blendFunc:{2:{0:!0,1:!0}},blendFuncSeparate:{4:{0:!0,1:!0,2:!0,3:!0}},blendEquation:{1:{0:!0}},blendEquationSeparate:{2:{0:!0,1:!0}},stencilFunc:{3:{0:!0}},stencilFuncSeparate:{4:{0:!0,1:!0}},stencilMaskSeparate:{2:{0:!0}},stencilOp:{3:{0:!0,1:!0,2:!0}},stencilOpSeparate:{4:{0:!0,1:!0,2:!0,3:!0}},cullFace:{1:{0:!0}},frontFace:{1:{0:!0}},drawArraysInstancedANGLE:{4:{0:!0}},drawElementsInstancedANGLE:{5:{0:!0,2:!0}},blendEquationEXT:{1:{0:!0}}},n=null,o=null;function a(e){if(null==n)for(var t in n={},o={},e)"number"==typeof e[t]&&(n[e[t]]=t,o[t]=e[t])}function i(){if(null==n)throw"WebGLDebugUtils.init(ctx) not called"}function f(e){return i(),void 0!==n[e]}function u(e){i();var t=n[e];return void 0!==t?"gl."+t:"/*UNKNOWN WebGL ENUM*/ 0x"+e.toString(16)}function l(e,t,n,a){var i;if(void 0!==(i=r[e])&&void 0!==(i=i[t])&&i[n]){if("object"==typeof i[n]&&void 0!==i[n].enumBitwiseOr){for(var f=i[n].enumBitwiseOr,l=0,c=[],s=0;s<f.length;++s){var d=o[f[s]];0!=(a&d)&&(l|=d,c.push(u(d)))}return l===a?c.join(" | "):u(a)}return u(a)}return null===a?"null":void 0===a?"undefined":a.toString()}function c(e,t){for(var r="",n=t.length,o=0;o<n;++o)r+=(0==o?"":", ")+l(e,n,o,t[o]);return r}function s(e,t,r){e.__defineGetter__(r,(function(){return t[r]})),e.__defineSetter__(r,(function(e){t[r]=e}))}function d(e,r,n,o){o=o||e,a(e),r=r||function(e,r,n){for(var o="",a=n.length,i=0;i<a;++i)o+=(0==i?"":", ")+l(r,a,i,n[i]);t("WebGL error "+u(e)+" in "+r+"("+o+")")};var i={};function f(e,t){return function(){n&&n(t,arguments);var a=e[t].apply(e,arguments),f=o.getError();return 0!=f&&(i[f]=!0,r(f,t,arguments)),a}}var c={};for(var g in e)if("function"==typeof e[g])if("getExtension"!=g)c[g]=f(e,g);else{var b=f(e,g);c[g]=function(){return d(b.apply(e,arguments),r,n,o)}}else s(c,e,g);return c.getError=function(){for(var t in i)if(i.hasOwnProperty(t)&&i[t])return i[t]=!1,t;return e.NO_ERROR},c}function g(e){var t=e.getParameter(e.MAX_VERTEX_ATTRIBS),r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r);for(var n=0;n<t;++n)e.disableVertexAttribArray(n),e.vertexAttribPointer(n,4,e.FLOAT,!1,0,0),e.vertexAttrib1f(n,0);e.deleteBuffer(r);var o=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);for(n=0;n<o;++n)e.activeTexture(e.TEXTURE0+n),e.bindTexture(e.TEXTURE_CUBE_MAP,null),e.bindTexture(e.TEXTURE_2D,null);for(e.activeTexture(e.TEXTURE0),e.useProgram(null),e.bindBuffer(e.ARRAY_BUFFER,null),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.DITHER),e.disable(e.SCISSOR_TEST),e.blendColor(0,0,0,0),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.clearColor(0,0,0,0),e.clearDepth(1),e.clearStencil(-1),e.colorMask(!0,!0,!0,!0),e.cullFace(e.BACK),e.depthFunc(e.LESS),e.depthMask(!0),e.depthRange(0,1),e.frontFace(e.CCW),e.hint(e.GENERATE_MIPMAP_HINT,e.DONT_CARE),e.lineWidth(1),e.pixelStorei(e.PACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.UNPACK_COLORSPACE_CONVERSION_WEBGL&&e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),e.polygonOffset(0,0),e.sampleCoverage(1,!1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilMask(4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.viewport(0,0,e.canvas.width,e.canvas.height),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT);e.getError(););}function b(e){var t,r,n=[],o=[],a={},i=1,f=!1,u=[],l=0,c=0,d=!1,b=0,E={};function p(e){return"function"==typeof e?e:function(t){e.handleEvent(t)}}e.getContext=(r=e.getContext,function(){var n=r.apply(e,arguments);if(n instanceof WebGLRenderingContext){if(n!=t){if(t)throw"got different context";a=S(t=n)}return a}return n});var m=function(e){n.push(p(e))},T=function(e){o.push(p(e))};function _(e){var t=e.addEventListener;e.addEventListener=function(r,n,o){switch(r){case"webglcontextlost":m(n);break;case"webglcontextrestored":T(n);break;default:t.apply(e,arguments)}}}function F(){for(var e=Object.keys(E),t=0;t<e.length;++t)delete E[e]}function x(){++c,f||l==c&&e.loseContext()}function A(e,t){var r=e[t];return function(){if(x(),!f)return r.apply(e,arguments)}}function R(){for(var e=0;e<u.length;++e){var r=u[e];r instanceof WebGLBuffer?t.deleteBuffer(r):r instanceof WebGLFramebuffer?t.deleteFramebuffer(r):r instanceof WebGLProgram?t.deleteProgram(r):r instanceof WebGLRenderbuffer?t.deleteRenderbuffer(r):r instanceof WebGLShader?t.deleteShader(r):r instanceof WebGLTexture&&t.deleteTexture(r)}}function v(e){return{statusMessage:e,preventDefault:function(){d=!0}}}return _(e),e.loseContext=function(){if(!f){for(f=!0,l=0,++i;t.getError(););F(),E[t.CONTEXT_LOST_WEBGL]=!0;var r=v("context lost"),o=n.slice();setTimeout((function(){for(var t=0;t<o.length;++t)o[t](r);b>=0&&setTimeout((function(){e.restoreContext()}),b)}),0)}},e.restoreContext=function(){f&&o.length&&setTimeout((function(){if(!d)throw"can not restore. webglcontestlost listener did not call event.preventDefault";R(),g(t),f=!1,c=0,d=!1;for(var e=o.slice(),r=v("context restored"),n=0;n<e.length;++n)e[n](r)}),0)},e.loseContextInNCalls=function(e){if(f)throw"You can not ask a lost contet to be lost";l=c+e},e.getNumCalls=function(){return c},e.setRestoreTimeout=function(e){b=e},e;function S(e){for(var r in e)"function"==typeof e[r]?a[r]=A(e,r):s(a,e,r);a.getError=function(){if(x(),!f)for(;e=t.getError();)E[e]=!0;for(var e in E)if(E[e])return delete E[e],e;return a.NO_ERROR};for(var n=["createBuffer","createFramebuffer","createProgram","createRenderbuffer","createShader","createTexture"],o=0;o<n.length;++o){var l=n[o];a[l]=function(t){return function(){if(x(),f)return null;var r=t.apply(e,arguments);return r.__webglDebugContextLostId__=i,u.push(r),r}}(e[l])}var c=["getActiveAttrib","getActiveUniform","getBufferParameter","getContextAttributes","getAttachedShaders","getFramebufferAttachmentParameter","getParameter","getProgramParameter","getProgramInfoLog","getRenderbufferParameter","getShaderParameter","getShaderInfoLog","getShaderSource","getTexParameter","getUniform","getUniformLocation","getVertexAttrib"];for(o=0;o<c.length;++o)l=c[o],a[l]=function(t){return function(){return x(),f?null:t.apply(e,arguments)}}(a[l]);var d=["isBuffer","isEnabled","isFramebuffer","isProgram","isRenderbuffer","isShader","isTexture"];for(o=0;o<d.length;++o)l=d[o],a[l]=function(t){return function(){return x(),!f&&t.apply(e,arguments)}}(a[l]);return a.checkFramebufferStatus=function(t){return function(){return x(),f?a.FRAMEBUFFER_UNSUPPORTED:t.apply(e,arguments)}}(a.checkFramebufferStatus),a.getAttribLocation=function(t){return function(){return x(),f?-1:t.apply(e,arguments)}}(a.getAttribLocation),a.getVertexAttribOffset=function(t){return function(){return x(),f?0:t.apply(e,arguments)}}(a.getVertexAttribOffset),a.isContextLost=function(){return f},a}}return{init:a,mightBeEnum:f,glEnumToString:u,glFunctionArgToString:l,glFunctionArgsToString:c,makeDebugContext:d,makeLostContextSimulatingCanvas:b,resetToInitialState:g}},void 0!==(F=_())&&(T.exports=F);export{A as testFloatBufferBlend};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../TimeExtent.js";import r from"../../TimeInterval.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{clone as s}from"../../core/lang.js";import{isSome as n}from"../../core/maybe.js";import{setDeepValue as p}from"../../core/object.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";var m;let c=m=class extends o{constructor(t){super(t),this.currentTimeExtent=null,this.fullTimeExtent=null,this.loop=!1,this.numStops=null,this.numThumbs=null,this.stopDelay=null,this.stopInterval=null,this.stops=null}readCurrentTimeExtent(t){if(!t)return;const r=null!=t[0]?new Date(t[0]):null,o=null!=t[1]?new Date(t[1]):null;return new e({start:r,end:o})}writeCurrentTimeExtent(t,e,r){t&&p(r,[n(t.start)?t.start.getTime():null,n(t.end)?t.end.getTime():null],e)}readFullTimeExtent(t,r){const o=r.properties;if(!o)return;const s=null!=o.endTime?new Date(o.endTime):null,n=null!=o.startTime?new Date(o.startTime):null;return new e({start:n,end:s})}writeFullTimeExtent(t,e){if(!t)return;const r=e.properties=e.properties||{},o=t.end,s=t.start;o&&(r.endTime=n(o)?o.getTime():null),s&&(r.startTime=n(s)?s.getTime():null)}readStopInterval(t,e,o){return t?r.fromJSON({value:t.interval,unit:t.units},o):null}writeStopInterval(t,e,r,o){if(!t)return;const s=t.toJSON(o);p(r,{interval:s.value,units:s.unit},e)}readStops(t){return t&&t.length?t.map((t=>new Date(t))):null}writeStops(t,e,r){t&&t.length&&p(r,t.map((t=>t.getTime())),e)}clone(){return new m(s({currentTimeExtent:this.currentTimeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:this.numStops,numThumbs:this.numThumbs,stopDelay:this.stopDelay,stopInterval:this.stopInterval,stops:this.stops}))}};t([i({type:e,json:{read:{source:"properties.currentTimeExtent"},write:{target:"properties.currentTimeExtent"}}})],c.prototype,"currentTimeExtent",void 0),t([l("currentTimeExtent")],c.prototype,"readCurrentTimeExtent",null),t([a("currentTimeExtent")],c.prototype,"writeCurrentTimeExtent",null),t([i({type:e,json:{read:{source:["properties.endTime","properties.startTime"]},write:{target:{"properties.endTime":{type:Number},"properties.startTime":{type:Number}}}}})],c.prototype,"fullTimeExtent",void 0),t([l("fullTimeExtent")],c.prototype,"readFullTimeExtent",null),t([a("fullTimeExtent")],c.prototype,"writeFullTimeExtent",null),t([i({type:Boolean,nonNullable:!0,json:{default:!1,read:{source:"properties.loop"},write:{target:"properties.loop"}}})],c.prototype,"loop",void 0),t([i({type:Number,json:{read:{source:"properties.numberOfStops"},write:{target:"properties.numberOfStops",overridePolicy(){var t;const e=!!this.stopInterval,r=!(null==(t=this.stops)||!t.length),o=!(e||r);return{enabled:o,isRequired:o}}}}})],c.prototype,"numStops",void 0),t([i({type:[1,2],nonNullable:!0,json:{read:{source:"properties.thumbCount"},write:{target:"properties.thumbCount",isRequired:!0}}})],c.prototype,"numThumbs",void 0),t([i({type:Number,nonNullable:!0,json:{read:{source:"properties.thumbMovingRate"},write:{target:"properties.thumbMovingRate",isRequired:!0}}})],c.prototype,"stopDelay",void 0),t([i({type:r,json:{read:{source:"properties.timeStopInterval"},write:{target:"properties.timeStopInterval",overridePolicy(){var t;const e=null!=this.numStops,r=!(null==(t=this.stops)||!t.length);return{enabled:!r,isRequired:!(e||r)}}}}})],c.prototype,"stopInterval",void 0),t([l("stopInterval")],c.prototype,"readStopInterval",null),t([a("stopInterval")],c.prototype,"writeStopInterval",null),t([i({type:[Date],json:{read:{source:"properties.stops"},write:{target:"properties.stops",overridePolicy(){return{isRequired:null==this.numStops&&!this.stopInterval}}}}})],c.prototype,"stops",void 0),t([l("stops")],c.prototype,"readStops",null),t([a("stops")],c.prototype,"writeStops",null),c=m=t([u("esri.webdoc.widgets.TimeSlider")],c);const d=c;export{d as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../TimeExtent.js";import r from"../../TimeInterval.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{clone as s}from"../../core/lang.js";import{isSome as n}from"../../core/maybe.js";import{setDeepValue as p}from"../../core/object.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../../core/accessorSupport/decorators/writer.js";var a;let c=a=class extends o{constructor(t){super(t),this.currentTimeExtent=null,this.fullTimeExtent=null,this.loop=!1,this.numStops=null,this.numThumbs=null,this.stopDelay=null,this.stopInterval=null,this.stops=null}readCurrentTimeExtent(t){if(!t)return;const r=null!=t[0]?new Date(t[0]):null,o=null!=t[1]?new Date(t[1]):null;return new e({start:r,end:o})}writeCurrentTimeExtent(t,e,r){t&&p(r,[n(t.start)?t.start.getTime():null,n(t.end)?t.end.getTime():null],e)}readFullTimeExtent(t,r){const o=r.properties;if(!o)return;const s=null!=o.endTime?new Date(o.endTime):null,n=null!=o.startTime?new Date(o.startTime):null;return new e({start:n,end:s})}writeFullTimeExtent(t,e){if(!t)return;const r=e.properties=e.properties||{},o=t.end,s=t.start;o&&(r.endTime=n(o)?o.getTime():null),s&&(r.startTime=n(s)?s.getTime():null)}readStopInterval(t,e,o){return t?r.fromJSON({value:t.interval,unit:t.units},o):null}writeStopInterval(t,e,r,o){if(!t)return;const s=t.toJSON(o);p(r,{interval:s.value,units:s.unit},e)}readStops(t){return t&&t.length?t.map((t=>new Date(t))):null}writeStops(t,e,r){t&&t.length&&p(r,t.map((t=>t.getTime())),e)}clone(){return new a(s({currentTimeExtent:this.currentTimeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:this.numStops,numThumbs:this.numThumbs,stopDelay:this.stopDelay,stopInterval:this.stopInterval,stops:this.stops}))}};t([i({type:e,json:{read:{source:"properties.currentTimeExtent"},write:{target:"properties.currentTimeExtent"}}})],c.prototype,"currentTimeExtent",void 0),t([l("currentTimeExtent")],c.prototype,"readCurrentTimeExtent",null),t([m("currentTimeExtent")],c.prototype,"writeCurrentTimeExtent",null),t([i({type:e,json:{read:{source:["properties.endTime","properties.startTime"]},write:{target:{"properties.endTime":{type:Number},"properties.startTime":{type:Number}}}}})],c.prototype,"fullTimeExtent",void 0),t([l("fullTimeExtent")],c.prototype,"readFullTimeExtent",null),t([m("fullTimeExtent")],c.prototype,"writeFullTimeExtent",null),t([i({type:Boolean,nonNullable:!0,json:{default:!1,read:{source:"properties.loop"},write:{target:"properties.loop"}}})],c.prototype,"loop",void 0),t([i({type:Number,json:{read:{source:"properties.numberOfStops"},write:{target:"properties.numberOfStops",overridePolicy(){const t=!!this.stopInterval,e=!!this.stops?.length,r=!(t||e);return{enabled:r,isRequired:r}}}}})],c.prototype,"numStops",void 0),t([i({type:[1,2],nonNullable:!0,json:{read:{source:"properties.thumbCount"},write:{target:"properties.thumbCount",isRequired:!0}}})],c.prototype,"numThumbs",void 0),t([i({type:Number,nonNullable:!0,json:{read:{source:"properties.thumbMovingRate"},write:{target:"properties.thumbMovingRate",isRequired:!0}}})],c.prototype,"stopDelay",void 0),t([i({type:r,json:{read:{source:"properties.timeStopInterval"},write:{target:"properties.timeStopInterval",overridePolicy(){const t=null!=this.numStops,e=!!this.stops?.length;return{enabled:!e,isRequired:!(t||e)}}}}})],c.prototype,"stopInterval",void 0),t([l("stopInterval")],c.prototype,"readStopInterval",null),t([m("stopInterval")],c.prototype,"writeStopInterval",null),t([i({type:[Date],json:{read:{source:"properties.stops"},write:{target:"properties.stops",overridePolicy(){return{isRequired:null==this.numStops&&!this.stopInterval}}}}})],c.prototype,"stops",void 0),t([l("stops")],c.prototype,"readStops",null),t([m("stops")],c.prototype,"writeStops",null),c=a=t([u("esri.webdoc.widgets.TimeSlider")],c);const d=c;export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../TimeExtent.js";import o from"../Viewpoint.js";import{deprecatedProperty as r}from"../core/deprecate.js";import i from"../core/Error.js";import{IdentifiableMixin as n}from"../core/Identifiable.js";import{JSONSupport as s}from"../core/JSONSupport.js";import{clone as p}from"../core/lang.js";import m from"../core/Logger.js";import{isSome as a,isNone as c}from"../core/maybe.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{cast as u}from"../core/accessorSupport/decorators/cast.js";import{reader as w}from"../core/accessorSupport/decorators/reader.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import{ensureType as h}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import{SlideThumbnail as j}from"../webdoc/support/SlideThumbnail.js";var v;const b="esri.webmap.Bookmark",x=m.getLogger(b);let g=v=class extends(n(s)){constructor(e){super(e),this.name=null,this.thumbnail=new j,this.timeExtent=null}set extent(e){r(x,"extent",{replacement:"viewpoint",version:"4.17"}),this._set("viewpoint",new o({targetGeometry:e.clone()})),this._set("extent",e)}castThumbnail(e){return"string"==typeof e?new j({url:e}):h(j,e)}set viewpoint(e){const{targetGeometry:t,scale:o}=e;a(t)&&("extent"===t.type?this._set("extent",t.clone()):"point"===t.type&&c(o)&&x.warn("Bookmark.viewpoint should include 'scale' when its targetGeometry is a point.",e)),this._set("viewpoint",e)}readViewpoint(e,t){const{extent:r,viewpoint:i}=t;return o.fromJSON(i||{targetGeometry:r})}writeViewpoint(e,t,o,r){if(!e)return;const{targetGeometry:n}=e;if(a(n)&&"extent"!==n.type){const e="Bookmark.viewpoint cannot be written to JSON when the viewpoint's targetGeometry is not an extent.";null!=r&&r.messages?r.messages.push(new i("property:unsupported",e)):x.error(e)}else t[o]=e.toJSON()}clone(){return new v(p({name:this.name,thumbnail:this.thumbnail,timeExtent:this.timeExtent,viewpoint:this.viewpoint}))}};e([l({type:f,nonNullable:!0,json:{read:!1,write:{isRequired:!0}}})],g.prototype,"extent",null),e([l({type:String,nonNullable:!0,json:{write:{isRequired:!0}}})],g.prototype,"name",void 0),e([l({type:j,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.url)})}}})],g.prototype,"thumbnail",void 0),e([u("thumbnail")],g.prototype,"castThumbnail",null),e([l({type:t,json:{write:!0}})],g.prototype,"timeExtent",void 0),e([l({type:o,nonNullable:!0,json:{write:!0}})],g.prototype,"viewpoint",null),e([w("viewpoint",["extent","viewpoint"])],g.prototype,"readViewpoint",null),e([d("viewpoint")],g.prototype,"writeViewpoint",null),g=v=e([y(b)],g);const S=g;export{S as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../TimeExtent.js";import o from"../Viewpoint.js";import{deprecatedProperty as r}from"../core/deprecate.js";import i from"../core/Error.js";import{IdentifiableMixin as n}from"../core/Identifiable.js";import{JSONSupport as s}from"../core/JSONSupport.js";import{clone as p}from"../core/lang.js";import m from"../core/Logger.js";import{isSome as a,isNone as c}from"../core/maybe.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{cast as u}from"../core/accessorSupport/decorators/cast.js";import{reader as w}from"../core/accessorSupport/decorators/reader.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import{ensureType as h}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import{SlideThumbnail as j}from"../webdoc/support/SlideThumbnail.js";var v;const b="esri.webmap.Bookmark",x=m.getLogger(b);let g=v=class extends(n(s)){constructor(e){super(e),this.name=null,this.thumbnail=new j,this.timeExtent=null}set extent(e){r(x,"extent",{replacement:"viewpoint",version:"4.17"}),this._set("viewpoint",new o({targetGeometry:e.clone()})),this._set("extent",e)}castThumbnail(e){return"string"==typeof e?new j({url:e}):h(j,e)}set viewpoint(e){const{targetGeometry:t,scale:o}=e;a(t)&&("extent"===t.type?this._set("extent",t.clone()):"point"===t.type&&c(o)&&x.warn("Bookmark.viewpoint should include 'scale' when its targetGeometry is a point.",e)),this._set("viewpoint",e)}readViewpoint(e,t){const{extent:r,viewpoint:i}=t;return o.fromJSON(i||{targetGeometry:r})}writeViewpoint(e,t,o,r){if(!e)return;const{targetGeometry:n}=e;if(a(n)&&"extent"!==n.type){const e="Bookmark.viewpoint cannot be written to JSON when the viewpoint's targetGeometry is not an extent.";r?.messages?r.messages.push(new i("property:unsupported",e)):x.error(e)}else t[o]=e.toJSON()}clone(){return new v(p({name:this.name,thumbnail:this.thumbnail,timeExtent:this.timeExtent,viewpoint:this.viewpoint}))}};e([l({type:f,nonNullable:!0,json:{read:!1,write:{isRequired:!0}}})],g.prototype,"extent",null),e([l({type:String,nonNullable:!0,json:{write:{isRequired:!0}}})],g.prototype,"name",void 0),e([l({type:j,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.url)})}}})],g.prototype,"thumbnail",void 0),e([u("thumbnail")],g.prototype,"castThumbnail",null),e([l({type:t,json:{write:!0}})],g.prototype,"timeExtent",void 0),e([l({type:o,nonNullable:!0,json:{write:!0}})],g.prototype,"viewpoint",null),e([w("viewpoint",["extent","viewpoint"])],g.prototype,"readViewpoint",null),e([d("viewpoint")],g.prototype,"writeViewpoint",null),g=v=e([y(b)],g);const S=g;export{S as default};
package/webscene/Slide.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import r from"../core/Collection.js";import{referenceSetter as s}from"../core/collectionUtils.js";import{JSONSupport as o}from"../core/JSONSupport.js";import a from"../core/Logger.js";import{isSome as l}from"../core/maybe.js";import{eachAlways as p,onAbortOrThrow as m,isAbortError as h}from"../core/promiseUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as u}from"../core/accessorSupport/decorators/cast.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as y}from"../core/accessorSupport/ensureType.js";import{d as g}from"../chunks/vec3.js";import{c as v}from"../chunks/vec3f64.js";import b from"../layers/Layer.js";import{isOperationalLayer as w}from"../layers/mixins/OperationalLayer.js";import{ensureType as f,clonePreservingTiledLayers as L}from"../support/basemapUtils.js";import{moduloPositive as j}from"../views/3d/support/mathUtils.js";import{toCamera as T}from"../views/3d/support/viewpointUtils.js";import{TaskPriority as _}from"../views/support/Scheduler.js";import{SlideThumbnail as C}from"../webdoc/support/SlideThumbnail.js";import S from"./Lighting.js";import U from"./support/Description.js";import{SlideEnvironment as V}from"./support/SlideEnvironment.js";import x from"./support/SlideGround.js";import{SlideVisibleLayer as D}from"./support/SlideVisibleLayer.js";import E from"./support/Title.js";let I=0;const k=r.ofType(D),R=a.getLogger("esri.webscene.Slide");let A=class extends o{constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+I++,this.title=new E,this.description=new U,this.thumbnail=new C,this.viewpoint=null,this.basemap=null,this.ground=null,this.environment=new V,this.visibleLayers=new k}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail&&this.thumbnail.destroy(),this.description=null,this.title=null,this.thumbnail=null}castTitle(e){return"string"==typeof e?new E({text:e}):y(E,e)}castDescription(e){return"string"==typeof e?new U({text:e}):y(U,e)}castThumbnail(e){return"string"==typeof e?new C({url:e}):y(C,e)}castBasemap(e){return f(e)}set visibleLayers(e){this._set("visibleLayers",s(e,this._get("visibleLayers"),k))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if(e instanceof b){const t=q(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:e.sublayerIds}:(R.warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}clone(){return new(0,this.constructor)({id:this.id,title:this.title.clone(),thumbnail:this.thumbnail.clone(),description:this.description&&this.description.clone()||null,viewpoint:this.viewpoint&&this.viewpoint.clone()||null,basemap:this.basemap&&this.basemap.clone()||null,ground:this.ground&&this.ground.clone()||null,visibleLayers:this.visibleLayers.clone(),environment:this.environment&&this.environment.clone()||null})}_updateVisibleLayersFrom(e){const t=[];return p(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=q(i);t.push(new D({id:e.layer.id,sublayerIds:n}))}})))).toArray()).then((()=>{this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}))}updateFrom(e,t){return t={screenshot:{format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t&&t.screenshot}},e.when((()=>(this.viewpoint=e.viewpoint.clone(),this.environment.lighting=S.prototype.clone.apply(e.environment.lighting),this.basemap=e.map.basemap&&e.map.basemap.clone()||null,this.ground=e.map.ground?x.fromGround(e.map.ground):null,this._updateVisibleLayersFrom(e)))).then((()=>e.takeScreenshot(t.screenshot))).then((e=>(this.thumbnail=new C({url:e.dataUrl}),this)))}async applyTo(e,t){l(this._applyToController)&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=m(t,(()=>i.abort())),s=e.resourceController.scheduler.registerTask(_.SLIDE);let o=!1;t={animate:!0,...t,signal:this._applyToController.signal};const a=async()=>{await Promise.all([s.schedule((()=>o=this._setViewpointOfInterest(e,t))),s.schedule((()=>this._applyBasemap(e,t)),t.signal)]),await Promise.all([s.schedule((()=>this._applyLayerVisibility(e)),t.signal),s.schedule((()=>this._applyGround(e)),t.signal),s.schedule((()=>this._applyViewpoint(e,t)),t.signal)])},p=await n(e.addUpdatingPromise(a()));if(o&&(e.contentCamera=null),s.remove(),this._applyToController===i&&(this._applyToController=null),i=null,null==r||r.remove(),!1===p.ok)throw p.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(h(i))throw i}e.map.basemap=L(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_getLayers(e){const t=new r;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach((e=>{w(e)&&(t.add(e),"layers"in e&&this._collectLayers(e,t))}))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t&&t.sublayerIds,n=O(e);i&&n&&n.forEach((e=>e.visible=i.includes(e.id)))}))}_setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t.ignoreViewpoint||!t.useDestinationCamera)return!1;const i=T(e,this.viewpoint);return e.contentCamera=i,l(i)}async _applyViewpoint(e,t){if(this.viewpoint&&!t.ignoreViewpoint){if(l(this.viewpoint.camera)&&(this.viewpoint.camera.fov=e.camera.fov),t.animate&&this.get("environment.lighting.date"))return void await this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(this.environment.lighting.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"sun"===e.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e)),e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,null!=this.environment.lighting.displayUTCOffset&&"sun"===e.environment.lighting.type&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);const n=e.goTo(this.viewpoint,t),r=()=>{i&&i.remove(),"sun"===e.environment.lighting.type&&(e.environment.lighting.cameraTrackingEnabled=!0)};return n.then((()=>{e.environment.applyLighting(this.environment.lighting.clone()),r()}),(e=>{throw r(),e}))}_getTime(e){return[e.getTime(),3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e){const t=new Date(e.environment.lighting.date.toString()),[i,n]=this._getTime(t),[r,s]=this._getTime(this.environment.lighting.date),o=F(n,s),a=e.renderCoordsHelper,p=v();a.toRenderCoords(e.camera.position,p);const m=v(),h=v();l(this.viewpoint.camera)&&a.toRenderCoords(this.viewpoint.camera.position,m);const c=new Date;return e.watch("camera",(t=>{a.toRenderCoords(t.position,h);const s=g(p,h),l=g(m,h);let u=0;s+l!==0&&(u=s/(s+l));const d=i+(r-i)*u,y=G(n,o*u);e.environment.lighting.date=this._setTime(c,d,y)}))}static createFrom(e,t){return(new this).updateFrom(e,t)}};function O(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function q(e){const t=O(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}e([c({type:String,json:{write:{isRequired:!0}}})],A.prototype,"id",void 0),e([c({type:E,json:{default:()=>new E({text:""}),write:{isRequired:!0}}})],A.prototype,"title",void 0),e([u("title")],A.prototype,"castTitle",null),e([c({type:U,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],A.prototype,"description",void 0),e([u("description")],A.prototype,"castDescription",null),e([c({type:C,json:{default:()=>new C({url:""}),write:{isRequired:!0}}})],A.prototype,"thumbnail",void 0),e([u("thumbnail")],A.prototype,"castThumbnail",null),e([c({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],A.prototype,"viewpoint",void 0),e([c({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],A.prototype,"basemap",void 0),e([u("basemap")],A.prototype,"castBasemap",null),e([c({type:x,json:{write:!0}})],A.prototype,"ground",void 0),e([c({type:k,json:{write:{isRequired:!0}}})],A.prototype,"visibleLayers",null),e([u("visibleLayers")],A.prototype,"castVisibleLayers",null),e([c({type:V,json:{write:!0}})],A.prototype,"environment",void 0),A=e([d("esri.webscene.Slide")],A);const M=86400,B=43200;function F(e,t){let i=t-e;return i>B&&(i-=M),i<-B&&(i+=M),i}function G(e,t){return j(e+t,M)}const P=A;export{P as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import r from"../core/Collection.js";import{referenceSetter as s}from"../core/collectionUtils.js";import{JSONSupport as o}from"../core/JSONSupport.js";import a from"../core/Logger.js";import{isSome as l}from"../core/maybe.js";import{eachAlways as p,onAbortOrThrow as m,isAbortError as h}from"../core/promiseUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as u}from"../core/accessorSupport/decorators/cast.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as y}from"../core/accessorSupport/ensureType.js";import{d as g}from"../chunks/vec3.js";import{c as v}from"../chunks/vec3f64.js";import b from"../layers/Layer.js";import{isOperationalLayer as w}from"../layers/mixins/OperationalLayer.js";import{ensureType as f,clonePreservingTiledLayers as L}from"../support/basemapUtils.js";import{moduloPositive as j}from"../views/3d/support/mathUtils.js";import{toCamera as T}from"../views/3d/support/viewpointUtils.js";import{TaskPriority as _}from"../views/support/Scheduler.js";import{SlideThumbnail as C}from"../webdoc/support/SlideThumbnail.js";import S from"./Lighting.js";import U from"./support/Description.js";import{SlideEnvironment as V}from"./support/SlideEnvironment.js";import x from"./support/SlideGround.js";import{SlideVisibleLayer as D}from"./support/SlideVisibleLayer.js";import E from"./support/Title.js";let I=0;const k=r.ofType(D),R=a.getLogger("esri.webscene.Slide");let A=class extends o{constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+I++,this.title=new E,this.description=new U,this.thumbnail=new C,this.viewpoint=null,this.basemap=null,this.ground=null,this.environment=new V,this.visibleLayers=new k}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail&&this.thumbnail.destroy(),this.description=null,this.title=null,this.thumbnail=null}castTitle(e){return"string"==typeof e?new E({text:e}):y(E,e)}castDescription(e){return"string"==typeof e?new U({text:e}):y(U,e)}castThumbnail(e){return"string"==typeof e?new C({url:e}):y(C,e)}castBasemap(e){return f(e)}set visibleLayers(e){this._set("visibleLayers",s(e,this._get("visibleLayers"),k))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if(e instanceof b){const t=q(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:e.sublayerIds}:(R.warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}clone(){return new(0,this.constructor)({id:this.id,title:this.title.clone(),thumbnail:this.thumbnail.clone(),description:this.description&&this.description.clone()||null,viewpoint:this.viewpoint&&this.viewpoint.clone()||null,basemap:this.basemap&&this.basemap.clone()||null,ground:this.ground&&this.ground.clone()||null,visibleLayers:this.visibleLayers.clone(),environment:this.environment&&this.environment.clone()||null})}_updateVisibleLayersFrom(e){const t=[];return p(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=q(i);t.push(new D({id:e.layer.id,sublayerIds:n}))}})))).toArray()).then((()=>{this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}))}updateFrom(e,t){return t={screenshot:{format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t&&t.screenshot}},e.when((()=>(this.viewpoint=e.viewpoint.clone(),this.environment.lighting=S.prototype.clone.apply(e.environment.lighting),this.basemap=e.map.basemap&&e.map.basemap.clone()||null,this.ground=e.map.ground?x.fromGround(e.map.ground):null,this._updateVisibleLayersFrom(e)))).then((()=>e.takeScreenshot(t.screenshot))).then((e=>(this.thumbnail=new C({url:e.dataUrl}),this)))}async applyTo(e,t){l(this._applyToController)&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=m(t,(()=>i.abort())),s=e.resourceController.scheduler.registerTask(_.SLIDE);let o=!1;t={animate:!0,...t,signal:this._applyToController.signal};const a=async()=>{await Promise.all([s.schedule((()=>o=this._setViewpointOfInterest(e,t))),s.schedule((()=>this._applyBasemap(e,t)),t.signal)]),await Promise.all([s.schedule((()=>this._applyLayerVisibility(e)),t.signal),s.schedule((()=>this._applyGround(e)),t.signal),s.schedule((()=>this._applyViewpoint(e,t)),t.signal)])},p=await n(e.addUpdatingPromise(a()));if(o&&(e.contentCamera=null),s.remove(),this._applyToController===i&&(this._applyToController=null),i=null,r?.remove(),!1===p.ok)throw p.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(h(i))throw i}e.map.basemap=L(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_getLayers(e){const t=new r;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach((e=>{w(e)&&(t.add(e),"layers"in e&&this._collectLayers(e,t))}))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t&&t.sublayerIds,n=O(e);i&&n&&n.forEach((e=>e.visible=i.includes(e.id)))}))}_setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t.ignoreViewpoint||!t.useDestinationCamera)return!1;const i=T(e,this.viewpoint);return e.contentCamera=i,l(i)}async _applyViewpoint(e,t){if(this.viewpoint&&!t.ignoreViewpoint){if(l(this.viewpoint.camera)&&(this.viewpoint.camera.fov=e.camera.fov),t.animate&&this.get("environment.lighting.date"))return void await this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(this.environment.lighting.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"sun"===e.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e)),e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,null!=this.environment.lighting.displayUTCOffset&&"sun"===e.environment.lighting.type&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);const n=e.goTo(this.viewpoint,t),r=()=>{i&&i.remove(),"sun"===e.environment.lighting.type&&(e.environment.lighting.cameraTrackingEnabled=!0)};return n.then((()=>{e.environment.applyLighting(this.environment.lighting.clone()),r()}),(e=>{throw r(),e}))}_getTime(e){return[e.getTime(),3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e){const t=new Date(e.environment.lighting.date.toString()),[i,n]=this._getTime(t),[r,s]=this._getTime(this.environment.lighting.date),o=F(n,s),a=e.renderCoordsHelper,p=v();a.toRenderCoords(e.camera.position,p);const m=v(),h=v();l(this.viewpoint.camera)&&a.toRenderCoords(this.viewpoint.camera.position,m);const c=new Date;return e.watch("camera",(t=>{a.toRenderCoords(t.position,h);const s=g(p,h),l=g(m,h);let u=0;s+l!==0&&(u=s/(s+l));const d=i+(r-i)*u,y=G(n,o*u);e.environment.lighting.date=this._setTime(c,d,y)}))}static createFrom(e,t){return(new this).updateFrom(e,t)}};function O(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function q(e){const t=O(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}e([c({type:String,json:{write:{isRequired:!0}}})],A.prototype,"id",void 0),e([c({type:E,json:{default:()=>new E({text:""}),write:{isRequired:!0}}})],A.prototype,"title",void 0),e([u("title")],A.prototype,"castTitle",null),e([c({type:U,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],A.prototype,"description",void 0),e([u("description")],A.prototype,"castDescription",null),e([c({type:C,json:{default:()=>new C({url:""}),write:{isRequired:!0}}})],A.prototype,"thumbnail",void 0),e([u("thumbnail")],A.prototype,"castThumbnail",null),e([c({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],A.prototype,"viewpoint",void 0),e([c({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],A.prototype,"basemap",void 0),e([u("basemap")],A.prototype,"castBasemap",null),e([c({type:x,json:{write:!0}})],A.prototype,"ground",void 0),e([c({type:k,json:{write:{isRequired:!0}}})],A.prototype,"visibleLayers",null),e([u("visibleLayers")],A.prototype,"castVisibleLayers",null),e([c({type:V,json:{write:!0}})],A.prototype,"environment",void 0),A=e([d("esri.webscene.Slide")],A);const M=86400,B=43200;function F(e,t){let i=t-e;return i>B&&(i-=M),i<-B&&(i+=M),i}function G(e,t){return j(e+t,M)}const P=A;export{P as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../Graphic.js";import"../../intl.js";import"../../symbols.js";import r from"../../core/Handles.js";import{destroyMaybe as s}from"../../core/maybe.js";import{watch as i,initial as o}from"../../core/reactiveUtils.js";import{formatDecimal as a,formatImperialArea as l,formatMetricArea as n,formatImperialLength as m,formatMetricLength as c}from"../../core/unitFormatUtils.js";import{convertUnit as h}from"../../core/unitUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{geodesicDensify as d,planarLength as y,simplify as f,geodesicLength as v,geodesicArea as _,planarArea as g}from"../../geometry/geometryEngine.js";import{isLoaded as w,project as b}from"../../geometry/projection.js";import{isSupported as j,geodesicDensify as L,geodesicLengths as S,geodesicAreas as G}from"../../geometry/support/geodesicUtils.js";import A from"../../layers/GraphicsLayer.js";import k from"../../layers/GroupLayer.js";import{ViewingMode as q}from"../../views/ViewingMode.js";import x from"../../views/draw/Draw.js";import{createManipulatorDragEventPipeline as W,screenToMap as M,dragGraphic as I}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as R}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as T}from"../../views/interactive/InteractiveToolBase.js";import{fetchMessageBundle as D}from"../../intl/messages.js";import{onLocaleChange as U}from"../../intl/locale.js";import C from"../../geometry/Point.js";import z from"../../symbols/SimpleFillSymbol.js";import E from"../../symbols/SimpleLineSymbol.js";import O from"../../symbols/TextSymbol.js";import P from"../../symbols/Font.js";import F from"../../symbols/SimpleMarkerSymbol.js";import B from"../../geometry/Polyline.js";import H from"../../geometry/SpatialReference.js";import N from"../../geometry/Polygon.js";const V=1e5;let J=class extends T{constructor(e){super(e),this._drawActive=!1,this._handles=new r,this._graphicsLayer=new A,this._manipulatorLayer=new A,this._groupLayer=new k({layers:[this._graphicsLayer,this._manipulatorLayer],listMode:"hide",visible:!1}),this._vertices=[],this.geodesicDistanceThreshold=1e5,this.measurement=null,this.measurementLabel=null}initialize(){D("esri/core/t9n/Units").then((e=>{this.messages=e})),this._handles.add(U((async()=>{this.messages=await D("esri/core/t9n/Units")})));const e=this.view;this._draw=new x({view:e}),e.map.add(this._groupLayer),e.focus(),this._handles.add([i((()=>[this.unit,this.geodesicDistanceThreshold,this.palette,this.messages]),(()=>{this._vertices.length>0&&this._updateGraphics()}),o)])}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=s(this._draw),e.remove(this._groupLayer),this._handles.removeAll(),this._graphicsLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._handles=s(this._handles),this._graphicsLayer=s(this._graphicsLayer),this._manipulatorLayer=s(this._manipulatorLayer)}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._groupLayer.visible=!0}onHide(){this._groupLayer.visible=!1}reset(){this._vertices=[],this._graphicsLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1,this._updateSketch([])}_startSketch(){this._drawActive=!0;const e=this._draw.create("polyline",{mode:"click"});e.on(["vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],(e=>this._updateSketch(e.vertices))),e.on("draw-complete",(()=>this._stopSketch()))}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach((e=>{e.manipulator.interactive=!0})),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){if(Y(this.view.spatialReference)&&!w())return;if(e.length<2)return this._vertices=[],this.manipulators.removeAll(),void this._graphicsLayer.removeAll();const t=this.view.spatialReference;for(;this._vertices.length>e.length;){const{manipulatorId:e}=this._vertices.pop();this.manipulators.remove(e)}for(let l=this._vertices.length;l<e.length;l++){const[r,s]=e[l],i=K(new C({x:r,y:s,spatialReference:t}),this.view,this._manipulatorLayer,this.palette),o=this.manipulators.add(i);W(i,((e,t)=>{t.next(M(this.view)).next(I(e.graphic,q.Local)).next((()=>{const t=e.graphic.geometry;this._vertices[l].coord=[t.x,t.y],this._updateGraphics()}))})),this._vertices.push({manipulatorId:o,coord:[r,s]})}const r=this._vertices.length-1,s=this._vertices[r],[i,o]=e[r];if(s.coord[0]!==i||s.coord[1]!==o){s.coord=[i,o];const e=new C({x:i,y:o,spatialReference:t});this.manipulators.findById(s.manipulatorId).graphic.geometry=e}const a=this._drawActive?this._vertices[r].manipulatorId:null;this.manipulators.forEach((e=>{e.manipulator.interactive=null==a||e.id!==a})),this._updateGraphics()}_updateGraphics(){const e=Q(this._vertices.map((e=>e.coord)),this.view.spatialReference,this.geodesicDistanceThreshold);if(!e)return;const{measurement:r,fillGeometry:s,outlineGeometry:i}=e;this._set("measurement",r);const o=r?Z(this.messages,r,this.unit):null;if(this._set("measurementLabel",o),!s&&!i)return;let a,l,n;const{graphics:m}=this._graphicsLayer;if(3===m.length)a=m.getItemAt(0),l=m.getItemAt(1),n=m.getItemAt(2);else{const{fillColor:e,pathColor:r,pathWidth:s}=this.palette;a=new t({symbol:new z({color:e,outline:null})}),l=new t({symbol:new E({color:r,width:s})}),n=new t({symbol:new O({color:[255,255,255,1],font:new P({size:14,family:"sans-serif"}),haloColor:[0,0,0,.5],haloSize:2})}),m.removeAll(),m.addMany([a,l,n])}a.geometry=s,l.geometry=i,n.geometry=null==s?void 0:s.centroid,n.symbol.text=null==o?void 0:o.area}};function K(e,r,s,i){const o=new F({style:"circle",color:i.handleColor,size:i.handleWidth,outline:{type:"simple-line",width:0}}),a=new F({style:"circle",color:i.handleColor,size:1.5*i.handleWidth,outline:{type:"simple-line",width:0}}),l=new t({geometry:e,symbol:o});return new R({view:r,layer:s,graphic:l,focusedSymbol:a})}function Q(e,t,r){if(2===e.length){const s=new B({paths:e,spatialReference:t});let i;if(t.isGeographic)if(j(t))i=L(s,V);else{const e=b(s,H.WGS84),r=L(e,V);i=b(r,t)}else if(t.isWebMercator)i=d(s,V,"meters");else{if(y(s,"meters")>=r){const e=b(s,H.WGS84),r=L(e,V);i=b(r,t)}else i=s}return{measurement:null,fillGeometry:null,outlineGeometry:i}}e.push(e[0]);const s=new B({paths:[e],spatialReference:t}),i=new N({rings:[e],spatialReference:t});let o,a,l=null,n=null;if(t.isGeographic)if(j(t)){if(l=L(s,V),n=L(i,V),n=f(n),!n)return null;o=S([s],"meters")[0],a=G([n],"square-meters")[0]}else{const e=H.WGS84,r=b(s,e),m=b(i,e);if(l=L(r,V),n=L(m,V),n=f(n),!n)return null;o=S([r],"meters")[0],a=G([n],"square-meters")[0],l=b(l,t),n=b(n,t)}else if(t.isWebMercator){if(l=d(s,V,"meters"),n=d(i,V,"meters"),n=f(n),!n)return null;o=v(s,"meters"),a=_(n,"square-meters")}else{const e=y(s,"meters");if(e>=r){const e=H.WGS84,r=b(s,e),m=b(i,e);if(l=L(r,V),n=L(m,V),n=f(n),!n)return null;o=S([r],"meters")[0],a=G([n],"square-meters")[0],l=b(l,t),n=b(n,t)}else{if(l=s,n=f(i),!n)return null;o=e,a=g(n,"square-meters")}}return{measurement:{geometry:n,area:a,perimeter:o},fillGeometry:n,outlineGeometry:l}}function X(e){return null!=e}function Y(e){if(!e)return!1;const{isGeographic:t,isWebMercator:r,isWGS84:s}=e;return t&&!s&&!j(e)||!t&&!r}function Z(e,t,r){if(!t||!e)return null;const s={area:null,perimeter:null},{area:i,perimeter:o}=t;switch(r){case"metric":s.area=n(e,i,"square-meters");break;case"imperial":s.area=l(e,i,"square-meters");break;default:{const t=h(i,"square-meters",r);s.area=a(e,t,r);break}}const p=$(r);if(p)switch(p){case"metric":s.perimeter=c(e,o,"meters");break;case"imperial":s.perimeter=m(e,o,"meters");break;default:{const t=h(o,"meters",p);s.perimeter=a(e,t,p);break}}else s.perimeter="";return s}function $(e){switch(e){case"metric":case"ares":case"hectares":return"metric";case"imperial":case"acres":return"imperial";case"square-inches":return"inches";case"square-feet":return"feet";case"square-yards":return"yards";case"square-miles":return"miles";case"square-us-feet":return"us-feet";case"square-meters":return"meters";case"square-kilometers":return"kilometers";case"square-millimeters":return"millimeters";case"square-centimeters":return"centimeters";case"square-decimeters":return"decimeters";default:return null}}e([p()],J.prototype,"_drawActive",void 0),e([p({readOnly:!0})],J.prototype,"cursor",null),e([p({value:!0})],J.prototype,"editable",null),e([p({type:Number})],J.prototype,"geodesicDistanceThreshold",void 0),e([p({readOnly:!0})],J.prototype,"measurement",void 0),e([p({readOnly:!0})],J.prototype,"measurementLabel",void 0),e([p()],J.prototype,"messages",void 0),e([p()],J.prototype,"palette",void 0),e([p()],J.prototype,"unit",void 0),e([p({constructOnly:!0})],J.prototype,"view",void 0),J=e([u("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],J);export{J as AreaMeasurement2DTool,Q as createAreaMeasurementInfo2D,Z as createAreaMeasurementLabel,Y as isProjectionEngineRequired,X as isSupported};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../Graphic.js";import"../../intl.js";import"../../symbols.js";import r from"../../core/Handles.js";import{destroyMaybe as s}from"../../core/maybe.js";import{watch as i,initial as o}from"../../core/reactiveUtils.js";import{formatDecimal as a,formatImperialArea as n,formatMetricArea as l,formatImperialLength as m,formatMetricLength as c}from"../../core/unitFormatUtils.js";import{convertUnit as h}from"../../core/unitUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{geodesicDensify as d,planarLength as y,simplify as f,geodesicLength as v,geodesicArea as _,planarArea as g}from"../../geometry/geometryEngine.js";import{isLoaded as w,project as b}from"../../geometry/projection.js";import{isSupported as j,geodesicDensify as L,geodesicLengths as S,geodesicAreas as G}from"../../geometry/support/geodesicUtils.js";import A from"../../layers/GraphicsLayer.js";import k from"../../layers/GroupLayer.js";import{ViewingMode as q}from"../../views/ViewingMode.js";import x from"../../views/draw/Draw.js";import{createManipulatorDragEventPipeline as W,screenToMap as M,dragGraphic as I}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as R}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as T}from"../../views/interactive/InteractiveToolBase.js";import{fetchMessageBundle as D}from"../../intl/messages.js";import{onLocaleChange as U}from"../../intl/locale.js";import C from"../../geometry/Point.js";import z from"../../symbols/SimpleFillSymbol.js";import E from"../../symbols/SimpleLineSymbol.js";import O from"../../symbols/TextSymbol.js";import P from"../../symbols/Font.js";import F from"../../symbols/SimpleMarkerSymbol.js";import B from"../../geometry/Polyline.js";import H from"../../geometry/SpatialReference.js";import N from"../../geometry/Polygon.js";const V=1e5;let J=class extends T{constructor(e){super(e),this._drawActive=!1,this._handles=new r,this._graphicsLayer=new A,this._manipulatorLayer=new A,this._groupLayer=new k({layers:[this._graphicsLayer,this._manipulatorLayer],listMode:"hide",visible:!1}),this._vertices=[],this.geodesicDistanceThreshold=1e5,this.measurement=null,this.measurementLabel=null}initialize(){D("esri/core/t9n/Units").then((e=>{this.messages=e})),this._handles.add(U((async()=>{this.messages=await D("esri/core/t9n/Units")})));const e=this.view;this._draw=new x({view:e}),e.map.add(this._groupLayer),e.focus(),this._handles.add([i((()=>[this.unit,this.geodesicDistanceThreshold,this.palette,this.messages]),(()=>{this._vertices.length>0&&this._updateGraphics()}),o)])}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=s(this._draw),e.remove(this._groupLayer),this._handles.removeAll(),this._graphicsLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._handles=s(this._handles),this._graphicsLayer=s(this._graphicsLayer),this._manipulatorLayer=s(this._manipulatorLayer)}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._groupLayer.visible=!0}onHide(){this._groupLayer.visible=!1}reset(){this._vertices=[],this._graphicsLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1,this._updateSketch([])}_startSketch(){this._drawActive=!0;const e=this._draw.create("polyline",{mode:"click"});e.on(["vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],(e=>this._updateSketch(e.vertices))),e.on("draw-complete",(()=>this._stopSketch()))}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach((e=>{e.manipulator.interactive=!0})),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){if(Y(this.view.spatialReference)&&!w())return;if(e.length<2)return this._vertices=[],this.manipulators.removeAll(),void this._graphicsLayer.removeAll();const t=this.view.spatialReference;for(;this._vertices.length>e.length;){const{manipulatorId:e}=this._vertices.pop();this.manipulators.remove(e)}for(let n=this._vertices.length;n<e.length;n++){const[r,s]=e[n],i=K(new C({x:r,y:s,spatialReference:t}),this.view,this._manipulatorLayer,this.palette),o=this.manipulators.add(i);W(i,((e,t)=>{t.next(M(this.view)).next(I(e.graphic,q.Local)).next((()=>{const t=e.graphic.geometry;this._vertices[n].coord=[t.x,t.y],this._updateGraphics()}))})),this._vertices.push({manipulatorId:o,coord:[r,s]})}const r=this._vertices.length-1,s=this._vertices[r],[i,o]=e[r];if(s.coord[0]!==i||s.coord[1]!==o){s.coord=[i,o];const e=new C({x:i,y:o,spatialReference:t});this.manipulators.findById(s.manipulatorId).graphic.geometry=e}const a=this._drawActive?this._vertices[r].manipulatorId:null;this.manipulators.forEach((e=>{e.manipulator.interactive=null==a||e.id!==a})),this._updateGraphics()}_updateGraphics(){const e=Q(this._vertices.map((e=>e.coord)),this.view.spatialReference,this.geodesicDistanceThreshold);if(!e)return;const{measurement:r,fillGeometry:s,outlineGeometry:i}=e;this._set("measurement",r);const o=r?Z(this.messages,r,this.unit):null;if(this._set("measurementLabel",o),!s&&!i)return;let a,n,l;const{graphics:m}=this._graphicsLayer;if(3===m.length)a=m.getItemAt(0),n=m.getItemAt(1),l=m.getItemAt(2);else{const{fillColor:e,pathColor:r,pathWidth:s}=this.palette;a=new t({symbol:new z({color:e,outline:null})}),n=new t({symbol:new E({color:r,width:s})}),l=new t({symbol:new O({color:[255,255,255,1],font:new P({size:14,family:"sans-serif"}),haloColor:[0,0,0,.5],haloSize:2})}),m.removeAll(),m.addMany([a,n,l])}a.geometry=s,n.geometry=i,l.geometry=s?.centroid,l.symbol.text=o?.area}};function K(e,r,s,i){const o=new F({style:"circle",color:i.handleColor,size:i.handleWidth,outline:{type:"simple-line",width:0}}),a=new F({style:"circle",color:i.handleColor,size:1.5*i.handleWidth,outline:{type:"simple-line",width:0}}),n=new t({geometry:e,symbol:o});return new R({view:r,layer:s,graphic:n,focusedSymbol:a})}function Q(e,t,r){if(2===e.length){const s=new B({paths:e,spatialReference:t});let i;if(t.isGeographic)if(j(t))i=L(s,V);else{const e=b(s,H.WGS84),r=L(e,V);i=b(r,t)}else if(t.isWebMercator)i=d(s,V,"meters");else{if(y(s,"meters")>=r){const e=b(s,H.WGS84),r=L(e,V);i=b(r,t)}else i=s}return{measurement:null,fillGeometry:null,outlineGeometry:i}}e.push(e[0]);const s=new B({paths:[e],spatialReference:t}),i=new N({rings:[e],spatialReference:t});let o,a,n=null,l=null;if(t.isGeographic)if(j(t)){if(n=L(s,V),l=L(i,V),l=f(l),!l)return null;o=S([s],"meters")[0],a=G([l],"square-meters")[0]}else{const e=H.WGS84,r=b(s,e),m=b(i,e);if(n=L(r,V),l=L(m,V),l=f(l),!l)return null;o=S([r],"meters")[0],a=G([l],"square-meters")[0],n=b(n,t),l=b(l,t)}else if(t.isWebMercator){if(n=d(s,V,"meters"),l=d(i,V,"meters"),l=f(l),!l)return null;o=v(s,"meters"),a=_(l,"square-meters")}else{const e=y(s,"meters");if(e>=r){const e=H.WGS84,r=b(s,e),m=b(i,e);if(n=L(r,V),l=L(m,V),l=f(l),!l)return null;o=S([r],"meters")[0],a=G([l],"square-meters")[0],n=b(n,t),l=b(l,t)}else{if(n=s,l=f(i),!l)return null;o=e,a=g(l,"square-meters")}}return{measurement:{geometry:l,area:a,perimeter:o},fillGeometry:l,outlineGeometry:n}}function X(e){return null!=e}function Y(e){if(!e)return!1;const{isGeographic:t,isWebMercator:r,isWGS84:s}=e;return t&&!s&&!j(e)||!t&&!r}function Z(e,t,r){if(!t||!e)return null;const s={area:null,perimeter:null},{area:i,perimeter:o}=t;switch(r){case"metric":s.area=l(e,i,"square-meters");break;case"imperial":s.area=n(e,i,"square-meters");break;default:{const t=h(i,"square-meters",r);s.area=a(e,t,r);break}}const p=$(r);if(p)switch(p){case"metric":s.perimeter=c(e,o,"meters");break;case"imperial":s.perimeter=m(e,o,"meters");break;default:{const t=h(o,"meters",p);s.perimeter=a(e,t,p);break}}else s.perimeter="";return s}function $(e){switch(e){case"metric":case"ares":case"hectares":return"metric";case"imperial":case"acres":return"imperial";case"square-inches":return"inches";case"square-feet":return"feet";case"square-yards":return"yards";case"square-miles":return"miles";case"square-us-feet":return"us-feet";case"square-meters":return"meters";case"square-kilometers":return"kilometers";case"square-millimeters":return"millimeters";case"square-centimeters":return"centimeters";case"square-decimeters":return"decimeters";default:return null}}e([p()],J.prototype,"_drawActive",void 0),e([p({readOnly:!0})],J.prototype,"cursor",null),e([p({value:!0})],J.prototype,"editable",null),e([p({type:Number})],J.prototype,"geodesicDistanceThreshold",void 0),e([p({readOnly:!0})],J.prototype,"measurement",void 0),e([p({readOnly:!0})],J.prototype,"measurementLabel",void 0),e([p()],J.prototype,"messages",void 0),e([p()],J.prototype,"palette",void 0),e([p()],J.prototype,"unit",void 0),e([p({constructOnly:!0})],J.prototype,"view",void 0),J=e([u("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],J);export{J as AreaMeasurement2DTool,Q as createAreaMeasurementInfo2D,Z as createAreaMeasurementLabel,Y as isProjectionEngineRequired,X as isSupported};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Handles.js";import{isSome as i,isNone as s,unwrap as o}from"../../core/maybe.js";import{watch as r,initial as a,whenOnce as n}from"../../core/reactiveUtils.js";import{measurementAreaUnits as l}from"../../core/unitUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{load as d}from"../../geometry/projection.js";import{defaultUnitPropertyMetadata as u}from"../../properties/defaultUnit.js";import{isSupported as c,isProjectionEngineRequired as m,AreaMeasurement2DTool as v}from"./AreaMeasurement2DTool.js";import{InteractiveToolViewModel as y}from"../support/InteractiveToolViewModel.js";const f={handleWidth:8,handleColor:[255,128,0,.5],pathWidth:2,pathColor:[255,128,0,1],fillColor:[255,128,0,.3]};let g=class extends y{constructor(t){super(t),this.supportedViewType="2d",this.unsupportedErrorMessage="AreaMeasurement2DViewModel is only supported in 2D views.",this._handles=new e,this.geodesicDistanceThreshold=1e5,this.measurement=null,this.measurementLabel=null,this.palette=f}initialize(){this._handles.add([r((()=>{var t;return null==(t=o(this.view))?void 0:t.spatialReference}),(()=>this.clear())),r((()=>this.unit),(t=>{i(this.tool)&&(this.tool.unit=t)}),a),r((()=>this.geodesicDistanceThreshold),(t=>{i(this.tool)&&(this.tool.geodesicDistanceThreshold=t)}),a),r((()=>this.palette),(t=>{i(this.tool)&&(this.tool.palette=t)}),a)])}destroy(){this._handles&&(this._handles.destroy(),this._handles=null)}get state(){return this.disabled||s(this.view)||!c(this.view.spatialReference)?"disabled":i(this.tool)&&this.tool.measurement?this.tool.active?"measuring":"measured":"ready"}get unit(){return this._validateUnit(this.defaultUnit)}set unit(t){void 0!==t?this._override("unit",this._validateUnit(t)):this._clearOverride("unit")}get unitOptions(){return l}set unitOptions(t){void 0!==t?this._override("unitOptions",this._validateUnits(t)):this._clearOverride("unitOptions")}async start(){const t=this.view;i(t)&&(await n((()=>t.ready)),m(t.spatialReference)&&await d()),this.createTool({interactive:!0})}clear(){this.removeTool()}constructTool(){return new v({view:o(this.view),visible:this.visible,geodesicDistanceThreshold:this.geodesicDistanceThreshold,palette:this.palette,unit:this.unit})}_validateUnit(t){return this.unitOptions.includes(t)?t:this.unitOptions.includes(this.defaultUnit)?this.defaultUnit:this.unitOptions[0]}_validateUnits(t=[]){const e=t.filter((t=>l.includes(t)));return 0===e.length?l.slice():e}};t([h(u)],g.prototype,"defaultUnit",void 0),t([h({type:Number})],g.prototype,"geodesicDistanceThreshold",void 0),t([h({readOnly:!0,aliasOf:"tool.measurement"})],g.prototype,"measurement",void 0),t([h({readOnly:!0,aliasOf:"tool.measurementLabel"})],g.prototype,"measurementLabel",void 0),t([h()],g.prototype,"palette",void 0),t([h({readOnly:!0})],g.prototype,"state",null),t([h({type:String})],g.prototype,"unit",null),t([h({type:[String]})],g.prototype,"unitOptions",null),g=t([p("esri.widgets.AreaMeasurement2D.AreaMeasurement2DViewModel")],g);const w=g;export{w as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Handles.js";import{isSome as i,isNone as s,unwrap as o}from"../../core/maybe.js";import{watch as r,initial as a,whenOnce as n}from"../../core/reactiveUtils.js";import{measurementAreaUnits as l}from"../../core/unitUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{load as d}from"../../geometry/projection.js";import{defaultUnitPropertyMetadata as u}from"../../properties/defaultUnit.js";import{isSupported as c,isProjectionEngineRequired as m,AreaMeasurement2DTool as v}from"./AreaMeasurement2DTool.js";import{InteractiveToolViewModel as y}from"../support/InteractiveToolViewModel.js";const f={handleWidth:8,handleColor:[255,128,0,.5],pathWidth:2,pathColor:[255,128,0,1],fillColor:[255,128,0,.3]};let g=class extends y{constructor(t){super(t),this.supportedViewType="2d",this.unsupportedErrorMessage="AreaMeasurement2DViewModel is only supported in 2D views.",this._handles=new e,this.geodesicDistanceThreshold=1e5,this.measurement=null,this.measurementLabel=null,this.palette=f}initialize(){this._handles.add([r((()=>o(this.view)?.spatialReference),(()=>this.clear())),r((()=>this.unit),(t=>{i(this.tool)&&(this.tool.unit=t)}),a),r((()=>this.geodesicDistanceThreshold),(t=>{i(this.tool)&&(this.tool.geodesicDistanceThreshold=t)}),a),r((()=>this.palette),(t=>{i(this.tool)&&(this.tool.palette=t)}),a)])}destroy(){this._handles&&(this._handles.destroy(),this._handles=null)}get state(){return this.disabled||s(this.view)||!c(this.view.spatialReference)?"disabled":i(this.tool)&&this.tool.measurement?this.tool.active?"measuring":"measured":"ready"}get unit(){return this._validateUnit(this.defaultUnit)}set unit(t){void 0!==t?this._override("unit",this._validateUnit(t)):this._clearOverride("unit")}get unitOptions(){return l}set unitOptions(t){void 0!==t?this._override("unitOptions",this._validateUnits(t)):this._clearOverride("unitOptions")}async start(){const t=this.view;i(t)&&(await n((()=>t.ready)),m(t.spatialReference)&&await d()),this.createTool({interactive:!0})}clear(){this.removeTool()}constructTool(){return new v({view:o(this.view),visible:this.visible,geodesicDistanceThreshold:this.geodesicDistanceThreshold,palette:this.palette,unit:this.unit})}_validateUnit(t){return this.unitOptions.includes(t)?t:this.unitOptions.includes(this.defaultUnit)?this.defaultUnit:this.unitOptions[0]}_validateUnits(t=[]){const e=t.filter((t=>l.includes(t)));return 0===e.length?l.slice():e}};t([h(u)],g.prototype,"defaultUnit",void 0),t([h({type:Number})],g.prototype,"geodesicDistanceThreshold",void 0),t([h({readOnly:!0,aliasOf:"tool.measurement"})],g.prototype,"measurement",void 0),t([h({readOnly:!0,aliasOf:"tool.measurementLabel"})],g.prototype,"measurementLabel",void 0),t([h()],g.prototype,"palette",void 0),t([h({readOnly:!0})],g.prototype,"state",null),t([h({type:String})],g.prototype,"unit",null),t([h({type:[String]})],g.prototype,"unitOptions",null),g=t([p("esri.widgets.AreaMeasurement2D.AreaMeasurement2DViewModel")],g);const w=g;export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{isMeasurementSystem as s}from"../core/unitUtils.js";import{aliasOf as i}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import o from"./AreaMeasurement2D/AreaMeasurement2DViewModel.js";import{accessibleHandler as l}from"./support/decorators/accessibleHandler.js";import{messageBundle as u}from"./support/decorators/messageBundle.js";import{tsx as m}from"./support/jsxFactory.js";import"./support/widgetUtils.js";const p="esri-area-measurement-2d",c={buttonDisabled:"esri-button--disabled",widgetIcon:"esri-icon-measure-area",base:`${p} esri-widget esri-widget--panel`,container:`${p}__container`,hint:`${p}__hint`,hintText:`${p}__hint-text`,panelError:`${p}__panel--error`,measurement:`${p}__measurement`,measurementItem:`${p}__measurement-item`,measurementItemDisabled:`${p}__measurement-item--disabled`,measurementItemTitle:`${p}__measurement-item-title`,measurementItemValue:`${p}__measurement-item-value`,settings:`${p}__settings`,units:`${p}__units`,unitsLabel:`${p}__units-label`,unitsSelect:`${p}__units-select esri-select`,unitsSelectWrapper:`${p}__units-select-wrapper`,actionSection:`${p}__actions`,newMeasurementButton:`${p}__clear-button esri-button esri-button--primary`};let d=class extends a{constructor(e,t){super(e,t),this.active=null,this.iconClass=c.widgetIcon,this.label=void 0,this.messages=null,this.messagesUnits=null,this.unit=null,this.unitOptions=null,this.view=null,this.viewModel=new o}render(){const{id:e,viewModel:t,visible:i}=this,{active:r,supported:n,measurementLabel:a,state:o,unit:l,unitOptions:u}=t,p="disabled"===o,d="ready"===o,v="measuring"===o||"measured"===o,{messages:_,messagesUnits:b}=this,h=r&&d?m("section",{key:"hint",class:c.hint},m("p",{class:c.hintText},_.hint)):null,w=n?null:m("section",{key:"unsupported",class:c.panelError},m("p",null,_.unsupported)),y=(e,t,s)=>t?m("div",{key:`${s}-enabled`,class:c.measurementItem},m("span",{class:c.measurementItemTitle},e),m("span",{class:c.measurementItemValue},t)):m("div",{key:`${s}-disabled`,class:this.classes(c.measurementItem,c.measurementItemDisabled),"aria-disabled":"true"},m("span",{class:c.measurementItemTitle},e)),g=v?m("section",{key:"measurement",class:c.measurement},y(_.area,a.area,"area"),y(_.perimeter,a.perimeter,"perimeter")):null,M=`${e}__units`,$=m("section",{key:"units",class:c.units},m("label",{class:c.unitsLabel,for:M},_.unit),m("div",{class:c.unitsSelectWrapper},m("select",{class:c.unitsSelect,id:M,onchange:this._changeUnit,bind:this,value:l},u.map((e=>{var t;return m("option",{key:e,value:e},s(e)?b.systems[e]:null==(t=b.units[e])?void 0:t.pluralCapitalized)}))))),j=v?m("div",{key:"settings",class:c.settings},$):null,f=!n||r&&!v?null:m("div",{class:c.actionSection},m("button",{disabled:p,class:this.classes(c.newMeasurementButton,p&&c.buttonDisabled),bind:this,onclick:this._newMeasurement,title:_.newMeasurement,type:"button","aria-label":_.newMeasurement},_.newMeasurement)),I=i?m("div",{class:c.container},w,h,j,g,f):null;return m("div",{class:c.base},I)}_newMeasurement(){t(this.viewModel.start())}_changeUnit(e){const t=e.target,s=t.options[t.selectedIndex];s&&(this.viewModel.unit=s.value)}};e([i("viewModel.active")],d.prototype,"active",void 0),e([r()],d.prototype,"iconClass",void 0),e([r({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],d.prototype,"label",void 0),e([r(),u("esri/widgets/AreaMeasurement2D/t9n/AreaMeasurement2D")],d.prototype,"messages",void 0),e([r(),u("esri/core/t9n/Units")],d.prototype,"messagesUnits",void 0),e([r()],d.prototype,"uiStrings",void 0),e([i("viewModel.unit")],d.prototype,"unit",void 0),e([i("viewModel.unitOptions")],d.prototype,"unitOptions",void 0),e([i("viewModel.view")],d.prototype,"view",void 0),e([r({type:o})],d.prototype,"viewModel",void 0),e([i("viewModel.visible")],d.prototype,"visible",void 0),e([l()],d.prototype,"_newMeasurement",null),e([l()],d.prototype,"_changeUnit",null),d=e([n("esri.widgets.AreaMeasurement2D")],d);const v=d;export{v as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{isMeasurementSystem as s}from"../core/unitUtils.js";import{aliasOf as i}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import o from"./AreaMeasurement2D/AreaMeasurement2DViewModel.js";import{accessibleHandler as l}from"./support/decorators/accessibleHandler.js";import{messageBundle as u}from"./support/decorators/messageBundle.js";import{tsx as m}from"./support/jsxFactory.js";import"./support/widgetUtils.js";const p="esri-area-measurement-2d",c={buttonDisabled:"esri-button--disabled",widgetIcon:"esri-icon-measure-area",base:`${p} esri-widget esri-widget--panel`,container:`${p}__container`,hint:`${p}__hint`,hintText:`${p}__hint-text`,panelError:`${p}__panel--error`,measurement:`${p}__measurement`,measurementItem:`${p}__measurement-item`,measurementItemDisabled:`${p}__measurement-item--disabled`,measurementItemTitle:`${p}__measurement-item-title`,measurementItemValue:`${p}__measurement-item-value`,settings:`${p}__settings`,units:`${p}__units`,unitsLabel:`${p}__units-label`,unitsSelect:`${p}__units-select esri-select`,unitsSelectWrapper:`${p}__units-select-wrapper`,actionSection:`${p}__actions`,newMeasurementButton:`${p}__clear-button esri-button esri-button--primary`};let d=class extends a{constructor(e,t){super(e,t),this.active=null,this.iconClass=c.widgetIcon,this.label=void 0,this.messages=null,this.messagesUnits=null,this.unit=null,this.unitOptions=null,this.view=null,this.viewModel=new o}render(){const{id:e,viewModel:t,visible:i}=this,{active:r,supported:n,measurementLabel:a,state:o,unit:l,unitOptions:u}=t,p="disabled"===o,d="ready"===o,v="measuring"===o||"measured"===o,{messages:_,messagesUnits:b}=this,h=r&&d?m("section",{key:"hint",class:c.hint},m("p",{class:c.hintText},_.hint)):null,w=n?null:m("section",{key:"unsupported",class:c.panelError},m("p",null,_.unsupported)),y=(e,t,s)=>t?m("div",{key:`${s}-enabled`,class:c.measurementItem},m("span",{class:c.measurementItemTitle},e),m("span",{class:c.measurementItemValue},t)):m("div",{key:`${s}-disabled`,class:this.classes(c.measurementItem,c.measurementItemDisabled),"aria-disabled":"true"},m("span",{class:c.measurementItemTitle},e)),g=v?m("section",{key:"measurement",class:c.measurement},y(_.area,a.area,"area"),y(_.perimeter,a.perimeter,"perimeter")):null,M=`${e}__units`,$=m("section",{key:"units",class:c.units},m("label",{class:c.unitsLabel,for:M},_.unit),m("div",{class:c.unitsSelectWrapper},m("select",{class:c.unitsSelect,id:M,onchange:this._changeUnit,bind:this,value:l},u.map((e=>m("option",{key:e,value:e},s(e)?b.systems[e]:b.units[e]?.pluralCapitalized)))))),j=v?m("div",{key:"settings",class:c.settings},$):null,f=!n||r&&!v?null:m("div",{class:c.actionSection},m("button",{disabled:p,class:this.classes(c.newMeasurementButton,p&&c.buttonDisabled),bind:this,onclick:this._newMeasurement,title:_.newMeasurement,type:"button","aria-label":_.newMeasurement},_.newMeasurement)),I=i?m("div",{class:c.container},w,h,j,g,f):null;return m("div",{class:c.base},I)}_newMeasurement(){t(this.viewModel.start())}_changeUnit(e){const t=e.target,s=t.options[t.selectedIndex];s&&(this.viewModel.unit=s.value)}};e([i("viewModel.active")],d.prototype,"active",void 0),e([r()],d.prototype,"iconClass",void 0),e([r({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],d.prototype,"label",void 0),e([r(),u("esri/widgets/AreaMeasurement2D/t9n/AreaMeasurement2D")],d.prototype,"messages",void 0),e([r(),u("esri/core/t9n/Units")],d.prototype,"messagesUnits",void 0),e([r()],d.prototype,"uiStrings",void 0),e([i("viewModel.unit")],d.prototype,"unit",void 0),e([i("viewModel.unitOptions")],d.prototype,"unitOptions",void 0),e([i("viewModel.view")],d.prototype,"view",void 0),e([r({type:o})],d.prototype,"viewModel",void 0),e([i("viewModel.visible")],d.prototype,"visible",void 0),e([l()],d.prototype,"_newMeasurement",null),e([l()],d.prototype,"_changeUnit",null),d=e([n("esri.widgets.AreaMeasurement2D")],d);const v=d;export{v as default};