@arcgis/core 5.0.0-next.4 → 5.0.0-next.6

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 (435) hide show
  1. package/Map.js +1 -1
  2. package/analysis/ElevationProfileAnalysis.js +1 -1
  3. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
  4. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +4 -0
  5. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +5 -0
  6. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +1 -0
  7. package/applications/KnowledgeStudio/generalSharedKgUtils.js +1 -1
  8. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +2 -0
  9. package/applications/KnowledgeStudio/layerInternalAccessUtils.js +1 -1
  10. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  11. package/assets/components/assets/sort-handle/t9n/messages.uk.json +1 -1
  12. package/assets/esri/core/workers/RemoteClient.js +1 -1
  13. package/assets/esri/core/workers/chunks/020c8913d8e35d63080b.js +1 -0
  14. package/assets/esri/core/workers/chunks/02e69f0c63d97661da60.js +1 -0
  15. package/assets/esri/core/workers/chunks/06ba43843e9c4988049b.js +1 -0
  16. package/assets/esri/core/workers/chunks/087973e7c4fea5fcfa5e.js +1 -0
  17. package/assets/esri/core/workers/chunks/{388482cea4b9fdeaf06e.js → 0f30a9514571c7be9978.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{929ece362604dc301229.js → 17acde0245ecd956306c.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{14ace5dc4b8984212a57.js → 17d5f8dba6ebb1184506.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{651b9144abb1895cc510.js → 1e848d9da1c61a27cf18.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{8cea114168d849c38b1b.js → 20278683bddc8c2d8136.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{00aa85ae6419aad183ea.js → 22d6b8102e75bdef204c.js} +1 -1
  23. package/assets/esri/core/workers/chunks/279366e6b743f9680603.js +1 -0
  24. package/assets/esri/core/workers/chunks/285762ff92d5388b6024.js +1 -0
  25. package/assets/esri/core/workers/chunks/{4f01be74dd26e639330f.js → 2f24017e72d41c259faa.js} +1 -1
  26. package/assets/esri/core/workers/chunks/36b1f47d70b57d79df7b.js +1 -0
  27. package/assets/esri/core/workers/chunks/{3d65b8a2fbe1df050a25.js → 377a66034e7c1bad5599.js} +1 -1
  28. package/assets/esri/core/workers/chunks/37f2ef14399546e697e6.js +1 -0
  29. package/assets/esri/core/workers/chunks/{0f9bb3187306f89e3d63.js → 398f356b11fd33bd3831.js} +1 -1
  30. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
  31. package/assets/esri/core/workers/chunks/{f7c99e9c8d19352af38d.js → 3ac7562ea90f91a9f30c.js} +1 -1
  32. package/assets/esri/core/workers/chunks/3f3d492f1093b7832aab.js +1 -0
  33. package/assets/esri/core/workers/chunks/4442817beb7a76c95770.js +1 -0
  34. package/assets/esri/core/workers/chunks/464d42bebb365287808d.js +1 -0
  35. package/assets/esri/core/workers/chunks/4c5a7249a311070d8f43.js +1 -0
  36. package/assets/esri/core/workers/chunks/{d570c75a425aa29672c8.js → 4d599008e1ea42321b37.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{c0feec6e2f0e45900ae0.js → 53bd8996e8812f1ad7b2.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{9a723d739ac44b45432c.js → 557960763695abee4a83.js} +1 -1
  39. package/assets/esri/core/workers/chunks/5bd36dbf46c25bd961c8.js +1 -0
  40. package/assets/esri/core/workers/chunks/{b7a17927e14f502006b4.js → 5ea0c62016d56990787b.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{2ea6985da4eb0107bb9d.js → 5fc7b61f467f1d60a284.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{a87521ebe632bf783ef4.js → 62a49cfd9a2508950e9f.js} +1 -1
  43. package/assets/esri/core/workers/chunks/67d9cfe02613cb73ee37.js.LICENSE.txt +1 -1
  44. package/assets/esri/core/workers/chunks/{ec13053af1999701464a.js → 6826fe54562dcdc054d7.js} +1 -1
  45. package/assets/esri/core/workers/chunks/6c3b99209d542efa64d4.js +1 -0
  46. package/assets/esri/core/workers/chunks/{8215015f11221a354273.js → 6d049182bec34a22abcd.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{309c5f69ea06f3081d83.js → 73487b9d85e726e9c012.js} +1 -1
  48. package/assets/esri/core/workers/chunks/7413e582bc2b16af6a0f.js +1 -0
  49. package/assets/esri/core/workers/chunks/{3d22fe2f2c40abbc246e.js → 7461124454bfb4fb6474.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{147ad5fdd02f46b6da24.js → 7544316a75dbd981aea6.js} +1 -1
  51. package/assets/esri/core/workers/chunks/75bf27271a31e26e1b21.js +1 -0
  52. package/assets/esri/core/workers/chunks/{630efe10c871425b6a95.js → 76ae1702fecc7ad7017c.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{de1f75c907152df7e788.js → 794748fd1edc29a621cd.js} +1 -1
  54. package/assets/esri/core/workers/chunks/79dbfa2b9b332ca0002f.js +1 -0
  55. package/assets/esri/core/workers/chunks/7a23ab84e1144f081c92.js +1 -0
  56. package/assets/esri/core/workers/chunks/7aaaebbabee27690283c.js +1 -0
  57. package/assets/esri/core/workers/chunks/7c4a63aeead2505d6f02.js +1 -0
  58. package/assets/esri/core/workers/chunks/{2a5f331c0f18d8574b4e.js → 811d4c46c75cf6a63e78.js} +1 -1
  59. package/assets/esri/core/workers/chunks/8372f142c4d7a65c7954.js +1 -0
  60. package/assets/esri/core/workers/chunks/{d84373a6ec94dcfec8c2.js → 88074189fa10c335370b.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{dc31865edea480f0ebba.js → 8833c3d168951be4bf20.js} +1 -1
  62. package/assets/esri/core/workers/chunks/883ffaa69b3e6eb158bf.js +1 -0
  63. package/assets/esri/core/workers/chunks/{85622fe99f4d08afe875.js → 8a314b3790313e6dc5db.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{b0b2670596d6d8c32b5e.js → 8c056eac35d05d9524b7.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{0086a09441627842d34a.js → 8f3503b2fb6cd38757b9.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{1a713dcc9971e1935401.js → 8f56f298e7c1a283f407.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{dabc5a38a472c9719df9.js → 8ffd4710d168c2fcfd96.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{b2add7338258ca7c24dd.js → 90250e9239c173aace88.js} +1 -1
  69. package/assets/esri/core/workers/chunks/90b2b43b8b54c9a1ec35.js +1 -0
  70. package/assets/esri/core/workers/chunks/90f8b4bda28af43ea019.js +1 -0
  71. package/assets/esri/core/workers/chunks/{89027f6800e17fab8973.js → 9486032af3e934d85582.js} +1 -1
  72. package/assets/esri/core/workers/chunks/95c594a87b732f5c4979.js +1 -0
  73. package/assets/esri/core/workers/chunks/9786f91455350eaae493.js +1 -0
  74. package/assets/esri/core/workers/chunks/99859dce1925b406ccd0.js +1 -0
  75. package/assets/esri/core/workers/chunks/9c5cbf8810f37b1a4718.js +1 -0
  76. package/assets/esri/core/workers/chunks/9e8dceef4c961f56940d.js +1 -0
  77. package/assets/esri/core/workers/chunks/9fac5a12e878cd745354.js +1 -0
  78. package/assets/esri/core/workers/chunks/a06bac9b8f9e18874de8.js +316 -0
  79. package/assets/esri/core/workers/chunks/a091623bbfb3d771c8d8.js +1 -0
  80. package/assets/esri/core/workers/chunks/{01642fe19e81bfa33eb5.js → a395373e3173e6458a56.js} +1 -1
  81. package/assets/esri/core/workers/chunks/a3991ae8caa713d4ddcd.js +1 -0
  82. package/assets/esri/core/workers/chunks/{135e270b4f03c4270870.js → a4db5c9a90107e097df8.js} +1 -1
  83. package/assets/esri/core/workers/chunks/a712cdff78fc826acd8c.js +1 -0
  84. package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js.LICENSE.txt +1 -1
  85. package/assets/esri/core/workers/chunks/aa54b6f2aba6952af149.js +1 -0
  86. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  87. package/assets/esri/core/workers/chunks/ac26e3e77df4302f47a2.js +1 -0
  88. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
  89. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js → b017bac40dc8328013e3.js} +2 -2
  90. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js.LICENSE.txt → b017bac40dc8328013e3.js.LICENSE.txt} +1 -1
  91. package/assets/esri/core/workers/chunks/{bc3bcf88b252760e2574.js → b3028b1ff75eafd0c358.js} +1 -1
  92. package/assets/esri/core/workers/chunks/b59f9c3f7a149214256f.js +1 -0
  93. package/assets/esri/core/workers/chunks/b96eb0ea506379182d62.js +2 -0
  94. package/assets/esri/core/workers/chunks/{24921d31efa8d222ad2d.js.LICENSE.txt → b96eb0ea506379182d62.js.LICENSE.txt} +1 -1
  95. package/assets/esri/core/workers/chunks/{b5863afafd3a7d2d5c05.js → bb5484b5eeacc9ad2ceb.js} +3 -3
  96. package/assets/esri/core/workers/chunks/bb56717c4e36f28d4c08.js +1 -0
  97. package/assets/esri/core/workers/chunks/bb7976e2f883b544add6.js +1 -0
  98. package/assets/esri/core/workers/chunks/{5875a51b97ee9bd438a0.js → bc241c7735e4efba734a.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{56916e56c20465428dd4.js → be3b874f86f627f4fa98.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{0eaa4dccba0d844b9da3.js → c3ddcf9148dd2640c402.js} +1 -1
  101. package/assets/esri/core/workers/chunks/c476643002387f60ea42.js +1 -0
  102. package/assets/esri/core/workers/chunks/c4e4da69969499a89a2c.js +1 -0
  103. package/assets/esri/core/workers/chunks/c8733cd621105afab2ac.js +1 -0
  104. package/assets/esri/core/workers/chunks/ccc0da0e01f023c8aa1f.js +1 -0
  105. package/assets/esri/core/workers/chunks/cd1930f08e1fc8b30b14.js +1 -0
  106. package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
  107. package/assets/esri/core/workers/chunks/d048e4926e78458afa3e.js +1 -0
  108. package/assets/esri/core/workers/chunks/d1fe816b6990918c13c7.js +1 -0
  109. package/assets/esri/core/workers/chunks/d305a21666b1ed5bf33d.js +1 -0
  110. package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
  111. package/assets/esri/core/workers/chunks/d40f57f9fc47f9a9f97c.js +1 -0
  112. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  113. package/assets/esri/core/workers/chunks/d97fadbc69e055d183a0.js +1 -0
  114. package/assets/esri/core/workers/chunks/dedc4583b5f32a278124.js +1 -0
  115. package/assets/esri/core/workers/chunks/e31192ae920e3e19b6aa.js +1 -0
  116. package/assets/esri/core/workers/chunks/{e5bcc44f3dc6fc90835a.js → e5a06ce0ef6a9a90e100.js} +1 -1
  117. package/assets/esri/core/workers/chunks/e82f5437bd66779c6740.js +1 -0
  118. package/assets/esri/core/workers/chunks/f0e0a63962784acb4ba1.js +1 -0
  119. package/assets/esri/core/workers/chunks/{039ec0fbe3b4b398b8c6.js → f26dc1d83beed63b6045.js} +1 -1
  120. package/assets/esri/core/workers/chunks/{fa5c87889c2f0bef896b.js → f35aaa04cca676c2d3f8.js} +1 -1
  121. package/assets/esri/core/workers/chunks/f4d0ae6be1b3984228d0.js +1 -0
  122. package/assets/esri/core/workers/chunks/{7c5c272612198db83851.js → f5e47eea8720ba84665b.js} +1 -1
  123. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  124. package/assets/esri/core/workers/chunks/{fa4411e0a5ac3fcba365.js → f65c0102af17390a50ac.js} +1 -1
  125. package/assets/esri/core/workers/chunks/f6c11c8ac687de3ef1ab.js +1 -0
  126. package/assets/esri/core/workers/chunks/f6c8beb60f6d29945a2e.js +1 -0
  127. package/assets/esri/core/workers/chunks/f746e3f7ebff2bbdf333.js +1 -0
  128. package/assets/esri/core/workers/chunks/f9324e88c359c03f35aa.js +1 -0
  129. package/assets/esri/core/workers/chunks/{cfa3164e7fa1884dc2b9.js → facb3886714222772ab2.js} +1 -1
  130. package/assets/esri/core/workers/chunks/fd2efd1d1cf9d95a87e6.js +1 -0
  131. package/assets/esri/core/workers/chunks/{fe3f95fda29e4844b153.js → fe77ae6cf232a7a3298e.js} +1 -1
  132. package/assets/esri/core/workers/chunks/{2ce4a0fe4fae63c43a81.js → ff35a077ac6776469805.js} +1 -1
  133. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  134. package/assets/esri/themes/base/widgets/_Directions.scss +17 -18
  135. package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +14 -4
  136. package/assets/esri/themes/dark/main.css +1 -1
  137. package/assets/esri/themes/light/main.css +1 -1
  138. package/assets/esri/themes/light/view.css +1 -1
  139. package/chunks/ComponentShader.glsl.js +72 -39
  140. package/chunks/OITBlend.glsl.js +3 -3
  141. package/chunks/bundle.js +1 -1
  142. package/config.js +1 -1
  143. package/core/Identifiable.js +1 -1
  144. package/core/MultiOriginJSONSupport.js +1 -1
  145. package/core/NumericIdentifiable.js +5 -0
  146. package/core/QueueProcessor.js +1 -1
  147. package/core/WriteableMultiOriginJSONMixin.js +5 -0
  148. package/core/has.js +1 -1
  149. package/core/performance.js +5 -0
  150. package/core/sanitizerUtils.js +1 -1
  151. package/core/scheduling.js +1 -1
  152. package/core/workers/Connection.js +1 -1
  153. package/core/workers/WorkerHandle.js +1 -1
  154. package/core/workers/utils.js +1 -1
  155. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  156. package/geohash/GeohashCell.js +1 -1
  157. package/geohash/geohashUtils.js +1 -1
  158. package/geometry/GeometryCursor.js +1 -1
  159. package/geometry/geometryCursorCollectUtils.js +1 -1
  160. package/geometry/libtess.js +1 -1
  161. package/geometry/support/jsonUtils.js +1 -1
  162. package/geometry/support/normalizeUtilsSync.js +1 -1
  163. package/geometry/support/triangulationUtils.js +1 -1
  164. package/interfaces.d.ts +444 -349
  165. package/intl/date.js +1 -1
  166. package/intl.d.ts +2 -0
  167. package/intl.js +1 -1
  168. package/kernel.js +1 -1
  169. package/layers/FeatureLayer.js +1 -1
  170. package/layers/graphics/OptimizedFeature.js +1 -1
  171. package/layers/graphics/OptimizedGeometry.js +1 -1
  172. package/layers/graphics/centroid.js +1 -1
  173. package/layers/graphics/contains.js +1 -1
  174. package/layers/graphics/data/AttributesBuilder.js +1 -1
  175. package/layers/graphics/data/FeatureStore.js +1 -1
  176. package/layers/graphics/data/QueryEngine.js +1 -1
  177. package/layers/graphics/data/QueryEngineResult.js +1 -1
  178. package/layers/graphics/data/geometryUtils.js +1 -1
  179. package/layers/graphics/data/spatialQuerySupport.js +1 -1
  180. package/layers/graphics/featureConversionUtils.js +1 -1
  181. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  182. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  183. package/layers/graphics/sources/geojson/geojson.js +1 -1
  184. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  185. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  186. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  187. package/layers/knowledgeGraph/layerUtils.js +1 -1
  188. package/layers/mixins/ArcGISImageService.js +1 -1
  189. package/layers/mixins/ImageryTileMixin.js +1 -1
  190. package/layers/support/MediaElementBase.js +1 -1
  191. package/layers/support/PixelBlock.js +1 -1
  192. package/layers/support/RasterInfo.js +1 -1
  193. package/layers/support/RasterJobHandler.js +1 -1
  194. package/layers/support/RasterSensorInfo.js +1 -1
  195. package/layers/support/RasterStorageInfo.js +1 -1
  196. package/layers/support/RasterWorker.js +1 -1
  197. package/layers/support/TitleCreator.js +1 -1
  198. package/layers/support/arcgisLayerUrl.js +1 -1
  199. package/layers/support/capabilities.js +1 -1
  200. package/layers/support/fieldUtils.js +1 -1
  201. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  202. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  203. package/layers/support/rasterFieldUtils.js +1 -1
  204. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  205. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  206. package/package.json +5 -5
  207. package/request.js +1 -1
  208. package/rest/print.js +1 -1
  209. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  210. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  211. package/rest/query/operations/query.js +1 -1
  212. package/rest/query/operations/queryZScale.js +1 -1
  213. package/rest/versionManagement/getVersionInfos.js +1 -1
  214. package/smartMapping/statistics/histogram.js +1 -1
  215. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  216. package/smartMapping/support/utils.js +1 -1
  217. package/support/basemapDefinitions.js +1 -1
  218. package/support/elevationInfoUtils.js +1 -1
  219. package/support/requestImageUtils.js +1 -1
  220. package/support/revision.js +1 -1
  221. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  222. package/undoredo/support/Services.js +1 -1
  223. package/views/2d/GoToManager.js +1 -1
  224. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  225. package/views/2d/constraints/GeometryConstraint.js +1 -1
  226. package/views/2d/constraints/RotationConstraint.js +1 -1
  227. package/views/2d/constraints/ZoomConstraint.js +1 -1
  228. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  229. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  230. package/views/2d/engine/webgl/Mesh2D.js +1 -1
  231. package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
  232. package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
  233. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  234. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  235. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  236. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  237. package/views/2d/layers/features/aggregation/GridCell.js +1 -1
  238. package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
  239. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  240. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  241. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  242. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  243. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  244. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  245. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  246. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  247. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  248. package/views/2d/layers/features/support/FeatureFilterEvaluator.js +1 -1
  249. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  250. package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
  251. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  252. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  253. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  254. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  255. package/views/3d/FocusAreasView.js +1 -1
  256. package/views/3d/GroundView3D.js +1 -1
  257. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  258. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  259. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  260. package/views/3d/glTF/DefaultLoadingContext.js +1 -1
  261. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  262. package/views/3d/layers/FlowSubView3D.js +1 -1
  263. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  264. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  265. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  266. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  267. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  268. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  269. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  270. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  271. package/views/3d/layers/graphics/pipeline/featureSet/PBFPointFeatureSetView.js +1 -1
  272. package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
  273. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  274. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  275. package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
  276. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  277. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  278. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  279. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  280. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  281. package/views/3d/layers/support/lyr3dTypeConversions.js +1 -1
  282. package/views/3d/state/ViewStateManager.js +1 -1
  283. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  284. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  285. package/views/3d/state/controllers/RotateController.js +1 -1
  286. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  287. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  288. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  289. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  290. package/views/3d/state/utils/navigationUtils.js +1 -1
  291. package/views/3d/support/DisplayQualityProfile.js +1 -1
  292. package/views/3d/support/QualitySettings.js +1 -1
  293. package/views/3d/support/StreamDataLoader.js +1 -1
  294. package/views/3d/support/engineContent/line.js +1 -1
  295. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  296. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  297. package/views/3d/support/flow/FlowWorker.js +1 -1
  298. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  299. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  300. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  301. package/views/3d/support/flow/constants.js +1 -1
  302. package/views/3d/support/hitTest.js +1 -1
  303. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  304. package/views/3d/terrain/OverlayRenderer.js +1 -1
  305. package/views/3d/terrain/Tile.js +1 -1
  306. package/views/3d/terrain/TileOverlayData.js +1 -1
  307. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  308. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  309. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  310. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  311. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  312. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +7 -7
  313. package/views/3d/webgl-engine/core/shaderModules/BooleanDrawUniform.js +5 -0
  314. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConstructionContext.js +1 -1
  315. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  316. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  317. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  318. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  319. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +4 -4
  320. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  321. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  322. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  323. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  324. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  325. package/views/analysis/ElevationProfile/constants.js +1 -1
  326. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  327. package/views/draw/support/Reshape.js +1 -1
  328. package/views/draw/support/reshapeUtils.js +1 -1
  329. package/views/interactive/dragEventPipeline.js +1 -1
  330. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  331. package/views/support/Scheduler.js +1 -1
  332. package/views/webgl/ShaderBuilder.js +1 -1
  333. package/views/webgl/Texture.js +1 -1
  334. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  335. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  336. package/widgets/BatchAttributeForm.js +1 -1
  337. package/widgets/Directions/css.js +1 -1
  338. package/widgets/Directions.js +1 -1
  339. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  340. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  341. package/widgets/Editor/EditorViewModel.js +1 -1
  342. package/widgets/Editor/Edits.js +1 -1
  343. package/widgets/Editor/MergeFeaturesWorkflow.d.ts +4 -0
  344. package/widgets/Editor/MergeFeaturesWorkflow.js +5 -0
  345. package/widgets/Editor/MergeFeaturesWorkflowData.d.ts +4 -0
  346. package/widgets/Editor/MergeFeaturesWorkflowData.js +5 -0
  347. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  348. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  349. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  350. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  351. package/widgets/Editor/components/UploadDetails.js +1 -1
  352. package/widgets/Editor/support/EditorItem.js +1 -1
  353. package/widgets/Editor/support/mergeFeaturesUtils.js +5 -0
  354. package/widgets/Editor/workflowUtils.js +1 -1
  355. package/widgets/Editor.js +1 -1
  356. package/widgets/Feature/FeatureExpression.js +1 -1
  357. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  358. package/widgets/Feature/FeatureFields.js +1 -1
  359. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  360. package/widgets/Feature/FeatureMedia.js +1 -1
  361. package/widgets/Feature/FeatureViewModel.js +1 -1
  362. package/widgets/Feature/support/featureUtils.js +1 -1
  363. package/widgets/Feature.js +1 -1
  364. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  365. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  366. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  367. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  368. package/widgets/Print.js +1 -1
  369. package/widgets/Search/LayerSearchSource.js +1 -1
  370. package/widgets/UtilityNetworkTrace.js +1 -1
  371. package/widgets/support/ColorPicker.js +1 -1
  372. package/widgets/support/SelectionList/LayerItem.js +1 -1
  373. package/widgets/support/jsxWidgetSupport.js +1 -1
  374. package/assets/esri/core/workers/chunks/0429c1a3690f20647c9f.js +0 -1
  375. package/assets/esri/core/workers/chunks/065f2bbcaeef1f13fd48.js +0 -1
  376. package/assets/esri/core/workers/chunks/0731e588afd1f561ec3b.js +0 -1
  377. package/assets/esri/core/workers/chunks/188272af9a6470ccfe31.js +0 -1
  378. package/assets/esri/core/workers/chunks/18da83afbc324fef9fd8.js +0 -316
  379. package/assets/esri/core/workers/chunks/1a9f544f20f643161a36.js +0 -1
  380. package/assets/esri/core/workers/chunks/1cfcadaa98ac528fea37.js +0 -1
  381. package/assets/esri/core/workers/chunks/1db0bf570a04687b3130.js +0 -1
  382. package/assets/esri/core/workers/chunks/24921d31efa8d222ad2d.js +0 -2
  383. package/assets/esri/core/workers/chunks/2a900a632a1231deb713.js +0 -1
  384. package/assets/esri/core/workers/chunks/31c6e951b99315e8e68a.js +0 -1
  385. package/assets/esri/core/workers/chunks/35491fbdd287470d40a4.js +0 -1
  386. package/assets/esri/core/workers/chunks/36247c6f6fc2891df2cf.js +0 -1
  387. package/assets/esri/core/workers/chunks/3d53307efbc3f07d7bf2.js +0 -1
  388. package/assets/esri/core/workers/chunks/40b81d1c2d53cf598b8e.js +0 -1
  389. package/assets/esri/core/workers/chunks/42a72e1d963e4636323b.js +0 -1
  390. package/assets/esri/core/workers/chunks/456161a323be7d640c61.js +0 -1
  391. package/assets/esri/core/workers/chunks/500d09d2191127371081.js +0 -1
  392. package/assets/esri/core/workers/chunks/50864c1924030e62497d.js +0 -1
  393. package/assets/esri/core/workers/chunks/5707713c2f27588b9194.js +0 -1
  394. package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +0 -1
  395. package/assets/esri/core/workers/chunks/5718cf135e105e1e026b.js +0 -1
  396. package/assets/esri/core/workers/chunks/5c585b338a9e9aa0e205.js +0 -1
  397. package/assets/esri/core/workers/chunks/5d1d909354c90cb8eb60.js +0 -1
  398. package/assets/esri/core/workers/chunks/5ea03f53d4d64d9e7cae.js +0 -1
  399. package/assets/esri/core/workers/chunks/63019a7eb5222dc5e420.js +0 -1
  400. package/assets/esri/core/workers/chunks/64629ddcf008349eaf41.js +0 -1
  401. package/assets/esri/core/workers/chunks/64ee8d2acae2d6fce608.js +0 -1
  402. package/assets/esri/core/workers/chunks/6fcacfcb3d83515c37c9.js +0 -1
  403. package/assets/esri/core/workers/chunks/72ecf49d03bb24bf0998.js +0 -1
  404. package/assets/esri/core/workers/chunks/7421f9575487cdc9e28e.js +0 -1
  405. package/assets/esri/core/workers/chunks/77a11d7d53325d108ed8.js +0 -1
  406. package/assets/esri/core/workers/chunks/7a05b1f6163112bc9db2.js +0 -1
  407. package/assets/esri/core/workers/chunks/7d9882ddfa6495f72baa.js +0 -1
  408. package/assets/esri/core/workers/chunks/7fffad8ff6878fa1fd56.js +0 -1
  409. package/assets/esri/core/workers/chunks/81bbe5251ed13c0d91cc.js +0 -1
  410. package/assets/esri/core/workers/chunks/8b16aa50d879b92a5375.js +0 -1
  411. package/assets/esri/core/workers/chunks/8bc64fc7c4b9eb8fca4d.js +0 -1
  412. package/assets/esri/core/workers/chunks/8bfa19c24be0e3f3fd74.js +0 -1
  413. package/assets/esri/core/workers/chunks/8eefa133c36a004c054c.js +0 -1
  414. package/assets/esri/core/workers/chunks/9834bc11586a2d8d6f35.js +0 -1
  415. package/assets/esri/core/workers/chunks/9c6fc4fe2c46f40d63d9.js +0 -1
  416. package/assets/esri/core/workers/chunks/a5f25104938ab33e7a85.js +0 -1
  417. package/assets/esri/core/workers/chunks/a7bd294996e6c8b8354a.js +0 -1
  418. package/assets/esri/core/workers/chunks/abf4f018c692c18c3320.js +0 -1
  419. package/assets/esri/core/workers/chunks/b1f667006cba60ef4aa7.js +0 -1
  420. package/assets/esri/core/workers/chunks/b2d9f4e057af26a538fb.js +0 -1
  421. package/assets/esri/core/workers/chunks/b62807c6fcfb70a87cd4.js +0 -1
  422. package/assets/esri/core/workers/chunks/b8339c1d60847a9eed3e.js +0 -1
  423. package/assets/esri/core/workers/chunks/bc6619307f312f9241bf.js +0 -1
  424. package/assets/esri/core/workers/chunks/bfc1e8aec7aace3ff30e.js +0 -1
  425. package/assets/esri/core/workers/chunks/c362fbbafec91c44eeb2.js +0 -1
  426. package/assets/esri/core/workers/chunks/c368a8e8d2f1535af446.js +0 -1
  427. package/assets/esri/core/workers/chunks/c941d15190fc08523d0d.js +0 -1
  428. package/assets/esri/core/workers/chunks/cc70a4a915b0b2ccb2a0.js +0 -1
  429. package/assets/esri/core/workers/chunks/d121045cddbe55c2ecb2.js +0 -1
  430. package/assets/esri/core/workers/chunks/d2120a623b1bd91b9ed9.js +0 -1
  431. package/assets/esri/core/workers/chunks/d78c2833cdc4730a88a3.js +0 -1
  432. package/assets/esri/core/workers/chunks/df438b62702007267798.js +0 -1
  433. package/assets/esri/core/workers/chunks/f4eb090bcc3eca64306a.js +0 -1
  434. package/assets/esri/core/workers/chunks/f7846523adacbfe5047e.js +0 -1
  435. package/assets/esri/core/workers/chunks/f839b86bee15deaf84e4.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{estimateNumberArrayMemory as t}from"../../../../../core/memoryEstimations.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{getLabelPoint as n}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as d,quantizeY as u}from"../../../../../geometry/support/quantizationUtils.js";import{getCentroidOptimizedGeometry as h}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as c,generalizeOptimizedGeometry as l,quantizeForDisplay as m,unquantizeOptimizedGeometry as y}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as f}from"../../../../../layers/graphics/OptimizedFeature.js";import p from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as g,unknown as _}from"../../../../../time/constants.js";import{FeatureSetCache as b}from"./FeatureSetCache.js";const x=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],D=x[0],T=x[1],F=x[2],A=x[3],S=has("featurelayer-simplify-payload-size-factors")??[1,2,4],I=S[0],B=S[1],j=S[2],M=has("featurelayer-simplify-mobile-factor")??2,G=has("esri-mobile"),C=4294967295;function v(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class O{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._overrides=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let r=1;const s=G?M:1;t>4e6?r=j*s:t>1e6?r=B*s:t>5e5?r=I*s:t>1e5&&(r=s);let i=0;return e>4e3?i=A*r:e>2e3?i=F*r:e>100?i=T:e>15&&(i=D),i}getBounds(e){v(this._boundsBuffer,4*this.getIndex()+4,0);const t=this.getBoundsXMin();if(t===C||!isFinite(t))return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(t?.isPoint&&0===t.coords[0]&&0===t.coords[1])return o(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(C),!1;let r=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEachVertex((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),i=Math.max(i,e),a=Math.max(a,t)}),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(i),this.setBoundsYMax(a),o(e,r,s,i,a),!0}const r=this.getBoundsXMin(),s=this.getBoundsYMin(),i=this.getBoundsXMax(),a=this.getBoundsYMax();return o(e,r,s,i,a),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){const e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace();return new f(e,t,r,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return c(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&"esriGeometryPolyline"===this.metadata.geometryType&&(t=l(new p,t,this.hasZ,this.hasM,this.metadata.geometryType,e.scale[0])),t&&(t=m(t,e,this.metadata.geometryType,this.hasZ,this.hasM)),!t){const t=this.readCentroidForDisplay();if(!t)return null;const r=d(e,t.coords[0]),s=u(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(r,s).deltaDecode()}return t}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createDeltaQuantizedGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&y(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&y(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);null==t&&(t=new b(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}get underlyingMemory(){let e=0;e+=t(this._boundsBuffer);for(const t of this._caches.values())e+=t.usedMemory;return e}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return"esriGeometryPoint"!==this.geometryType&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=c(e,this.geometryType,this.hasZ,this.hasM),r=a(t);if(r){if(!this.metadata.outSpatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.outSpatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??g):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===_}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const o of this._joined)if(o.setIndex(this.getIndex()),i=o.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(o._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(o._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(o._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,o._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}isEmpty(){return this.fields.fields.length<=0&&null==this.geometry()}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}return!0}_computeDisplayCentroid(e){if(null==this.getInTransform())return h(new p,e,this.hasM,this.hasZ);const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=n(t);return r?(r[1]*=-1,new p([],r)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return c(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,r)}_createDeltaQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new p([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new p([2],[e-1,t+1,1,-1])}}export{O as FeatureSetReader};
5
+ import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{estimateNumberArrayMemory as t}from"../../../../../core/memoryEstimations.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{getLabelPoint as n}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as d,quantizeY as u}from"../../../../../geometry/support/quantizationUtils.js";import{getCentroidOptimizedGeometry as c}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as h,generalizeOptimizedGeometry as l,quantizeForDisplay as m,unquantizeOptimizedGeometryInPlace as y}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as f}from"../../../../../layers/graphics/OptimizedFeature.js";import p from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as g,unknown as _}from"../../../../../time/constants.js";import{FeatureSetCache as b}from"./FeatureSetCache.js";const x=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],D=x[0],T=x[1],F=x[2],A=x[3],S=has("featurelayer-simplify-payload-size-factors")??[1,2,4],I=S[0],B=S[1],j=S[2],G=has("featurelayer-simplify-mobile-factor")??2,C=has("esri-mobile"),v=4294967295;function M(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class O{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._overrides=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let r=1;const s=C?G:1;t>4e6?r=j*s:t>1e6?r=B*s:t>5e5?r=I*s:t>1e5&&(r=s);let i=0;return e>4e3?i=A*r:e>2e3?i=F*r:e>100?i=T:e>15&&(i=D),i}getBounds(e){M(this._boundsBuffer,4*this.getIndex()+4,0);const t=this.getBoundsXMin();if(t===v||!isFinite(t))return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(t?.isPoint&&0===t.coords[0]&&0===t.coords[1])return o(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(v),!1;let r=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEachVertex((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),i=Math.max(i,e),a=Math.max(a,t)}),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(i),this.setBoundsYMax(a),o(e,r,s,i,a),!0}const r=this.getBoundsXMin(),s=this.getBoundsYMin(),i=this.getBoundsXMax(),a=this.getBoundsYMax();return o(e,r,s,i,a),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){const e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace();return new f(e,t,r,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return h(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&"esriGeometryPolyline"===this.metadata.geometryType&&(t=l(t,this.metadata.geometryType,e.scale[0])),t&&(t=m(t,e,this.metadata.geometryType)),!t){const t=this.readCentroidForDisplay();if(!t)return null;const r=d(e,t.coords[0]),s=u(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(r,s).deltaDecode()}return t}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createDeltaQuantizedGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&y(t,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&y(r,s),r}setCache(e){let t=this._caches.get(e);null==t&&(t=new b(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}get underlyingMemory(){let e=0;e+=t(this._boundsBuffer);for(const t of this._caches.values())e+=t.usedMemory;return e}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return"esriGeometryPoint"!==this.geometryType&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=h(e,this.geometryType,this.hasZ,this.hasM),r=a(t);if(r){if(!this.metadata.outSpatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.outSpatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??g):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===_}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const o of this._joined)if(o.setIndex(this.getIndex()),i=o.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(o._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(o._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(o._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,o._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}isEmpty(){return this.fields.fields.length<=0&&null==this.geometry()}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}return!0}_computeDisplayCentroid(e){if(null==this.getInTransform())return c(e);const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=n(t);return r?(r[1]*=-1,new p([],r)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return h(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,r)}_createDeltaQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new p([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new p([2],[e-1,t+1,1,-1])}}export{O as FeatureSetReader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{baseObjectMemory as r}from"../../../../../core/memoryEstimations.js";import{normalizeTransform as e,quantizeX as t,quantizeY as s}from"../../../../../geometry/support/quantizationUtils.js";import{convertToGeometry as a}from"../../../../../layers/graphics/featureConversionUtils.js";import{FeatureSetReader as i}from"./FeatureSetReader.js";class d extends i{static from(r,e){if(r instanceof this){const t=new Set(e),s=r._indices.filter(r=>t.has(r));return new d(r._reader,s)}return new d(r.copy(),e)}constructor(r,e){super(r.metadata),this._currentIndex=-1,this._displayTransform=null,this._reader=r,this._indices=e}setTransformForDisplay(r){const t=this._reader.getInTransform();if(null==t)return void(this._displayTransform=e(r));const s=e(t),a=e(r),[i,d]=s.scale,[n,o]=s.translate,[h,u]=a.scale,[_,l]=a.translate,c=i/h,y=d/u,p=(n-_)/h,m=(o-l)/u;this._displayTransform={originPosition:"lowerLeft",scale:[1/c,1/y,1,1],translate:[-p/c,-m/y,0,0]}}getInTransform(){return this._reader.getInTransform()}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){const r=new d(this._reader.copy(),this._indices);return r._currentIndex=this._currentIndex,r._displayTransform=this._displayTransform,r._processorAttributes=this._processorAttributes,r}get contextTimeZone(){return this._reader.contextTimeZone}set contextTimeZone(r){this._reader.contextTimeZone=r}get usedMemory(){return r+this._reader.usedMemory}setProcessorAttributes(r){this._processorAttributes=Object.assign(this._processorAttributes??{},r)}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}readXForDisplay(){return this._displayTransform?t(this._displayTransform,this._reader.readXForDisplay()):this._reader.readXForDisplay()}readYForDisplay(){return this._displayTransform?s(this._displayTransform,this._reader.readYForDisplay()):this._reader.readYForDisplay()}readGeometryForDisplay(){return this._displayTransform?this._reader.readGeometryForDisplayTransformed(this._displayTransform):this._reader.readGeometryForDisplay()}readCentroidForDisplay(){const r=this._reader.readCentroidForDisplay()?.clone();if(r){const[e,a]=r.coords;this._displayTransform?(r.coords[0]=t(this._displayTransform,e),r.coords[1]=s(this._displayTransform,a)):(r.coords[0]=e,r.coords[1]=a)}return r}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}readAttribute(r,e=!1){const t=this._reader.readAttribute(r,e);return null==t&&this._processorAttributes?this._processorAttributes[r]:t}readAttributes(){return{...this._processorAttributes,...this._reader.readAttributes()}}joinAttributes(r){return this._reader.joinAttributes(r)}getBounds(r){return this._reader.getBounds(r)}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(r){return this._reader.setDisplayId(r)}setIndex(r){return this._reader.setIndex(r)}getIndex(){return this._reader.getIndex()}readXWorldSpace(){return this._reader.readXWorldSpace()}readYWorldSpace(){return this._reader.readYWorldSpace()}_readX(){return this._reader.readXForDisplay()}_readY(){return this._reader.readYForDisplay()}_readServerCentroid(){return this._reader._readServerCentroid()}readLegacyFeatureForDisplay(){const r=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(r&&{x:r.coords[0],y:r.coords[1]})??null}}readLegacyGeometryForDisplay(){const r=this.readGeometryForDisplay();return a(r,this.geometryType,!1,!1)}readGeometryArea(){return this._displayTransform?this._reader.readGeometryForDisplayTransformed(this._displayTransform)?.area()??0:this._reader.readGeometryArea()}readGeometryWorldSpace(){return this._reader.readGeometryWorldSpace()}_readGeometry(){return this._reader._readGeometry()}_readAttribute(r,e){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}_readAttributes(){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(r){return this._reader.field(r)}hasField(r){return this._reader.hasField(r)}setField(r,e){return this._reader.setField(r,e)}keys(){return this._reader.keys()}castToText(r=!1){return this._reader.castToText(r)}}export{d as FeatureSetReaderIndirect};
5
+ import{baseObjectMemory as e}from"../../../../../core/memoryEstimations.js";import{normalizeTransform as r,quantizeX as t,quantizeY as s}from"../../../../../geometry/support/quantizationUtils.js";import{convertToGeometry as a}from"../../../../../layers/graphics/featureConversionUtils.js";import{FeatureSetReader as i}from"./FeatureSetReader.js";class d extends i{static from(e,r){if(e instanceof this){const t=new Set(r),s=e._indices.filter(e=>t.has(e));return new d(e._reader,s)}return new d(e.copy(),r)}constructor(e,r){super(e.metadata),this._currentIndex=-1,this._displayTransform=null,this._reader=e,this._indices=r}setTransformForDisplay(e){const t=this._reader.getInTransform();if(null==t)return void(this._displayTransform=r(e));const s=r(t),a=r(e),[i,d]=s.scale,[n,o]=s.translate,[h,u]=a.scale,[_,l]=a.translate,y=i/h,c=d/u,p=(n-_)/h,m=(o-l)/u;this._displayTransform={originPosition:"lowerLeft",scale:[1/y,1/c,1,1],translate:[-p/y,-m/c,0,0]}}getInTransform(){return this._reader.getInTransform()}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){const e=new d(this._reader.copy(),this._indices);return e._currentIndex=this._currentIndex,e._displayTransform=this._displayTransform,e._processorAttributes=this._processorAttributes,e}get contextTimeZone(){return this._reader.contextTimeZone}set contextTimeZone(e){this._reader.contextTimeZone=e}get usedMemory(){return e+this._reader.usedMemory}setProcessorAttributes(e){this._processorAttributes=Object.assign(this._processorAttributes??{},e)}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}readXForDisplay(){return this._displayTransform?t(this._displayTransform,this._reader.readXForDisplay()):this._reader.readXForDisplay()}readYForDisplay(){return this._displayTransform?s(this._displayTransform,this._reader.readYForDisplay()):this._reader.readYForDisplay()}readGeometryForDisplay(){return this._displayTransform?this._reader.readGeometryForDisplayTransformed(this._displayTransform):this._reader.readGeometryForDisplay()}readCentroidForDisplay(){const e=this._reader.readCentroidForDisplay()?.clone();if(e){const[r,a]=e.coords;this._displayTransform&&(e.coords[0]=t(this._displayTransform,r),e.coords[1]=s(this._displayTransform,a))}return e}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}readAttribute(e,r=!1){const t=this._reader.readAttribute(e,r);return null==t&&this._processorAttributes?this._processorAttributes[e]:t}readAttributes(){return{...this._processorAttributes,...this._reader.readAttributes()}}joinAttributes(e){return this._reader.joinAttributes(e)}getBounds(e){return this._reader.getBounds(e)}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(e){return this._reader.setDisplayId(e)}setIndex(e){return this._reader.setIndex(e)}getIndex(){return this._reader.getIndex()}readXWorldSpace(){return this._reader.readXWorldSpace()}readYWorldSpace(){return this._reader.readYWorldSpace()}_readX(){return this._reader.readXForDisplay()}_readY(){return this._reader.readYForDisplay()}_readServerCentroid(){return this._reader._readServerCentroid()}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return a(e,this.geometryType,!1,!1)}readGeometryArea(){return this._displayTransform?this._reader.readGeometryForDisplayTransformed(this._displayTransform)?.area()??0:this._reader.readGeometryArea()}readGeometryWorldSpace(){return this._reader.readGeometryWorldSpace()}_readGeometry(){return this._reader._readGeometry()}_readAttribute(e,r){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}_readAttributes(){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(e){return this._reader.field(e)}hasField(e){return this._reader.hasField(e)}setField(e,r){return this._reader.setField(e,r)}keys(){return this._reader.keys()}castToText(e=!1){return this._reader.castToText(e)}}export{d as FeatureSetReaderIndirect};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{assertIsSome as r}from"../../../../../core/maybe.js";import{baseObjectMemory as s}from"../../../../../core/memoryEstimations.js";import n from"../../../../../core/pbf.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as i}from"./FeatureSetCache.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";import{parseHeader as o}from"./FeatureSetReaderPBFHeader.js";const d=268435455,u=128,c=128e3,l={small:{delta:new Int32Array(u),decoded:new Int32Array(u)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(c),decoded:new Int32Array(c)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function g(e,t){return t?e<=l.small64.delta.length?l.small64:(e<=l.large64.delta.length||(l.large64.delta=new Float64Array(Math.round(1.25*e)),l.large64.decoded=new Float64Array(Math.round(1.25*e))),l.large64):e<=l.small.delta.length?l.small:(e<=l.large.delta.length||(l.large.delta=new Int32Array(Math.round(1.25*e)),l.large.decoded=new Int32Array(Math.round(1.25*e))),l.large)}function _(r){try{const e=2,t=new n(new Uint8Array(r),new DataView(r));for(;t.next();){if(t.tag()===e)return f(t.getMessage());t.skip()}}catch(s){const r=new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:s});t.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF").error(r)}return null}function f(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function y(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function m(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class I extends h{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=_(e),a=o(n,"esriGeometryPoint"===s,t.featureIdInfo,r);return new I(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new I(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return s+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===d?null:new a([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===d)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new a([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new i(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=y(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=g(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),n=s.getLength(),i=s.pos()+n,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new a(o,h)}_parseGeometryForDisplay(e){const t=2,s=3,n=e.asUnsafe(),i=n.getLength(),h=n.pos()+i,o=[],d=[];let u=0,c=0,l=null,_=0;const f="esriGeometryPolygon"===this.geometryType,y="esriGeometryPolyline"===this.geometryType,I=f?3:y?2:1,p=f||y;for(;n.pos()<h&&n.next();)switch(n.tag()){case t:{const e=n.getUInt32(),t=n.pos()+e;for(;n.pos()<t;){const e=n.getUInt32();o.push(e),u+=e}l=g(2*u,this._use64Bit).delta;break}case s:{n.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);r(l);for(const t of o){if(c+e*t>l.length){for(let e=0;e<t;e++)n.getSInt64(),n.getSInt64(),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();continue}let r=0,s=n.getSInt64(),a=n.getSInt64();this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),l[c++]=s,l[c++]=a,r+=1;for(let e=1;e<t;e++){const e=n.getSInt64(),t=n.getSInt64(),i=s+e,h=a+t;_+=-.5*(i-s)*(h+a),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),0===e&&0===t||m(p,l[c-2],l[c-1],e,t)?(l[c-2]+=e,l[c-1]+=t):(l[c++]=e,l[c++]=t,r+=1),s=i,a=h}r>=I?d.push(r):c-=r*e}break}default:n.skip()}return this._cache.area=_,d.length?new a(d,l):null!=l?this._createDeltaQuantizedExtrudedGeometry(l[0],l[1]):null}}export{I as FeatureSetReaderPBF};
5
+ import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{assertIsSome as r}from"../../../../../core/maybe.js";import{baseObjectMemory as s}from"../../../../../core/memoryEstimations.js";import n from"../../../../../core/pbf.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as i}from"./FeatureSetCache.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";import{parseHeader as o}from"./FeatureSetReaderPBFHeader.js";const d=268435455,u=128,c=128e3,l={small:{delta:new Int32Array(u),decoded:new Int32Array(u)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(c),decoded:new Int32Array(c)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function g(e,t){return t?e<=l.small64.delta.length?l.small64:(e<=l.large64.delta.length||(l.large64.delta=new Float64Array(Math.round(1.25*e)),l.large64.decoded=new Float64Array(Math.round(1.25*e))),l.large64):e<=l.small.delta.length?l.small:(e<=l.large.delta.length||(l.large.delta=new Int32Array(Math.round(1.25*e)),l.large.decoded=new Int32Array(Math.round(1.25*e))),l.large)}function _(r){try{const e=2,t=new n(new Uint8Array(r),new DataView(r));for(;t.next();){if(t.tag()===e)return f(t.getMessage());t.skip()}}catch(s){const r=new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:s});t.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF").error(r)}return null}function f(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function y(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function m(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class I extends h{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=_(e),a=o(n,"esriGeometryPoint"===s,t.featureIdInfo,r);return new I(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new I(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return s+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===d?null:new a([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===d)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new a([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new i(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=y(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=g(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),n=s.getLength(),i=s.pos()+n,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new a(o,h,this.hasZ,this.hasM)}_parseGeometryForDisplay(e){const t=2,s=3,n=e.asUnsafe(),i=n.getLength(),h=n.pos()+i,o=[],d=[];let u=0,c=0,l=null,_=0;const f="esriGeometryPolygon"===this.geometryType,y="esriGeometryPolyline"===this.geometryType,I=f?3:y?2:1,p=f||y;for(;n.pos()<h&&n.next();)switch(n.tag()){case t:{const e=n.getUInt32(),t=n.pos()+e;for(;n.pos()<t;){const e=n.getUInt32();o.push(e),u+=e}l=g(2*u,this._use64Bit).delta;break}case s:{n.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);r(l);for(const t of o){if(c+e*t>l.length){for(let e=0;e<t;e++)n.getSInt64(),n.getSInt64(),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();continue}let r=0,s=n.getSInt64(),a=n.getSInt64();this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),l[c++]=s,l[c++]=a,r+=1;for(let e=1;e<t;e++){const e=n.getSInt64(),t=n.getSInt64(),i=s+e,h=a+t;_+=-.5*(i-s)*(h+a),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),0===e&&0===t||m(p,l[c-2],l[c-1],e,t)?(l[c-2]+=e,l[c-1]+=t):(l[c++]=e,l[c++]=t,r+=1),s=i,a=h}r>=I?d.push(r):c-=r*e}break}default:n.skip()}return this._cache.area=_,d.length?new a(d,l,this.hasZ,this.hasM):null!=l?this._createDeltaQuantizedExtrudedGeometry(l[0],l[1]):null}}export{I as FeatureSetReaderPBF};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../core/has.js";import{baseObjectMemory as e}from"../../../../../core/memoryEstimations.js";import t from"../../../../../layers/graphics/OptimizedGeometry.js";import{QuantizedGeometryBuffer as r}from"../../../../../chunks/bundle.js";import{FeatureSetReader as n}from"./FeatureSetReader.js";let s;class i extends n{constructor(t,r,n,s,i,d=new Uint32Array(n.size())){super(t),this._fields=r,this._inner=n,this._chunkId=s,this._fileIndex=i,this._displayIds=d,this._index=-1,this.usedMemory=e,this._size=this._inner.size();t.featureIdInfo.type,this._chunkId>65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return this.metadata.geometryType}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return this._fileIndex<<24|this._inner.rowId(this._index)}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getBoundsXMin(){return this._inner.boundsXMin(this._index)}getBoundsYMin(){return this._inner.boundsYMin(this._index)}getBoundsXMax(){return this._inner.boundsXMax(this._index)}getBoundsYMax(){return this._inner.boundsYMax(this._index)}setBoundsXMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsXMax(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMax(e){throw new Error("InternalError: Setting bounds is unsupported")}getIndex(){return this._index}next(){for(;++this._index<this._size&&!this._getExists(););return this._index<this._size}readGeometryArea(){return this.readGeometryForDisplay()?.area()??0}copy(){const e=new i(this.metadata,this._fields,this._inner,this._chunkId,this._fileIndex,this._displayIds);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._index=this._index}readGeometryForDisplayTransformed(e){const[n,i]=e.translate,[d,o]=e.scale;s||(s=r.new());return this._inner.transformGeometry(s,n,i,d,o,this._index)?new t(s.readLengthsUnsafe(),s.readCoordsUnsafe()):null}_readGeometry(e){const r=this._inner.readCoords(this._index),n=this._inner.readLengths(this._index);return r&&n?new t(n,r):null}_readX(){return this._inner.readX(this._index)}_readY(){return this._inner.readY(this._index)}_readServerCentroid(){return null}_readAttribute(e,t){const r=this.fields.get(e);if(!r)return;if(null==r.column)return this.getObjectId();const n=this._inner.readAttribute(this._index,r.column);if(null==n)return n;const s=this.fields.isDateField(r.name);return t?null==n?n:s?new Date(n):n:n}_readAttributes(){const e={};for(const t of this._fields.fields)null!=t.column&&(this._inner.isEmpty(t.column)||(e[t.name]=this._readAttribute(t.name,!1)));return e.__OBJECTID=this.getObjectId(),e}}export{i as FeatureSetReaderParquet};
5
+ import"../../../../../core/has.js";import{baseObjectMemory as e}from"../../../../../core/memoryEstimations.js";import t from"../../../../../layers/graphics/OptimizedGeometry.js";import{QuantizedGeometryBuffer as r}from"../../../../../chunks/bundle.js";import{FeatureSetReader as n}from"./FeatureSetReader.js";let s;class i extends n{constructor(t,r,n,s,i,d=new Uint32Array(n.size())){super(t),this._fields=r,this._inner=n,this._chunkId=s,this._fileIndex=i,this._displayIds=d,this._index=-1,this.usedMemory=e,this._size=this._inner.size();t.featureIdInfo.type,this._chunkId>65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return this.metadata.geometryType}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return this._fileIndex<<24|this._inner.rowId(this._index)}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getBoundsXMin(){return this._inner.boundsXMin(this._index)}getBoundsYMin(){return this._inner.boundsYMin(this._index)}getBoundsXMax(){return this._inner.boundsXMax(this._index)}getBoundsYMax(){return this._inner.boundsYMax(this._index)}setBoundsXMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsXMax(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMax(e){throw new Error("InternalError: Setting bounds is unsupported")}getIndex(){return this._index}next(){for(;++this._index<this._size&&!this._getExists(););return this._index<this._size}readGeometryArea(){return this.readGeometryForDisplay()?.area()??0}copy(){const e=new i(this.metadata,this._fields,this._inner,this._chunkId,this._fileIndex,this._displayIds);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._index=this._index}readGeometryForDisplayTransformed(e){const[n,i]=e.translate,[d,o]=e.scale;s||(s=r.new());return this._inner.transformGeometry(s,n,i,d,o,this._index)?new t(s.readLengthsUnsafe(),s.readCoordsUnsafe(),this.hasZ,this.hasM):null}_readGeometry(e){const r=this._inner.readCoords(this._index),n=this._inner.readLengths(this._index);return r&&n?new t(n,r,this.hasZ,this.hasM):null}_readX(){return this._inner.readX(this._index)}_readY(){return this._inner.readY(this._index)}_readServerCentroid(){return null}_readAttribute(e,t){const r=this.fields.get(e);if(!r)return;if(null==r.column)return this.getObjectId();const n=this._inner.readAttribute(this._index,r.column);if(null==n)return n;const s=this.fields.isDateField(r.name);return t?null==n?n:s?new Date(n):n:n}_readAttributes(){const e={};for(const t of this._fields.fields)null!=t.column&&(this._inner.isEmpty(t.column)||(e[t.name]=this._readAttribute(t.name,!1)));return e.__OBJECTID=this.getObjectId(),e}}export{i as FeatureSetReaderParquet};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ringsCentroid as t,polygonCentroid as e}from"../../../../../geometry/support/centroid.js";import{getJsonType as r}from"../../../../../geometry/support/jsonUtils.js";import{convertFromGeometry as s,generalizeOptimizedGeometry as i,quantizeOptimizedGeometry as o}from"../../../../../layers/graphics/featureConversionUtils.js";import n from"../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as h}from"../../../engine/webgl/definitions.js";import{FeatureSetReader as u}from"./FeatureSetReader.js";class a extends u{static from(t,e,r){return new a(t,e,r)}constructor(t,e,r){super(r),this._items=t,this._tile=e,this._index=-1,this._cachedGeometry=null;const s=e.lod;s.wrap&&(this._wrappingInfo={worldSizeX:s.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??[]}hasField(t){return null!=this._current.attributes[t]}field(t){return this.readAttribute(t)}get geometryType(){const t=r(this._current.geometry);return"esriGeometryPoint"===t?"esriGeometryMultipoint":t}getCursor(){return this.copy()}copy(){const t=new a(this._items,this._tile,this.metadata);return this.copyInto(t),t}copyInto(t){super.copyInto(t),t._cachedGeometry=this._cachedGeometry,t._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1<this._items.length}get exceededTransferLimit(){throw new Error("InternalError: exceededTransferLimit not implemented for graphics.")}get hasZ(){return!1}get hasM(){return!1}get usedMemory(){return this._current.usedMemory}getInTransform(){return this._tile.transform}getSize(){return this._items.length}getAttributeHash(){let t="";for(const e in this._current.attributes)t+=this._current.attributes[e];return t}getObjectId(){return this._items[this._index].objectId}getDisplayId(){return this._current.displayId}setDisplayId(t){throw new Error("InternalError: Setting displayId not supported for graphics.")}setIndex(t){this._index=t}getIndex(){return this._index}next(){for(this._cachedGeometry=null;++this._index<this._items.length&&!this._getExists(););return this._index<this._items.length}readGeometryArea(){throw new Error("InternalError: readGeometryArea not supported for graphics.")}_readGeometry(){if(!this._cachedGeometry){let t=s(this._current.projectedGeometry,this.hasZ,this.hasM);if("esriGeometryPolyline"===this.geometryType&&(t=i(new n,t,this.hasZ,this.hasM,this.geometryType,this._tile.transform.scale[0])),this._cachedGeometry=o(new n,t,this.hasZ,this.hasM,this.geometryType,this._tile.transform),!this._cachedGeometry)return null;this._wrapGeometry(this._cachedGeometry)}return this._cachedGeometry}_wrapGeometry(t){if(!this._wrappingInfo)return;const{worldSizeX:e}=this._wrappingInfo;if(t.isPoint)return 1===e?(t.coords.push(h,0),t.coords.push(2*-h,0),void t.lengths.push(3)):2===e?(t.coords.push(2*h,0),t.coords.push(4*-h,0),void t.lengths.push(3)):void this._wrapVertex(t.coords,0,2,e);if("esriGeometryMultipoint"!==this.geometryType);else{if(1===e){const e=t.coords.slice();e[0]-=512;const r=t.coords.slice();r[0]+=512,t.coords.push(...e,...r);const s=t.lengths[0];return void t.lengths.push(s,s)}this._wrapVertex(t.coords,0,2,e)}}_wrapVertex(t,e,r,s){const i=e*r,o=t[i];o<-h*(s-2)?t[i]=o+h*s:o>h*(s-1)&&(t[i]=o-h*s)}_readX(){const t=this._readGeometry();return null!=t?t.coords[0]:0}_readY(){const t=this._readGeometry();return null!=t?t.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const t=e(this._current.projectedGeometry),r=new n([],t);return o(new n,r,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const e=this._current.projectedGeometry,r=t(e.paths,this.hasZ),s=new n([],r);return o(new n,s,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}}return null}_readAttribute(t,e){const r=this._current.attributes[t];if(void 0!==r)return r;const s=t.toLowerCase();for(const i in this._current.attributes)if(i.toLowerCase()===s)return this._current.attributes[i]}_readAttributes(){return this._current.attributes}}export{a as GraphicsReader};
5
+ import{ringsCentroid as e,polygonCentroid as t}from"../../../../../geometry/support/centroid.js";import{getJsonType as r,isGeometryWithZ as s,isGeometryWithM as i}from"../../../../../geometry/support/jsonUtils.js";import{convertFromGeometry as o,generalizeOptimizedGeometry as n,quantizeOptimizedGeometry as h}from"../../../../../layers/graphics/featureConversionUtils.js";import u from"../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as c}from"../../../engine/webgl/definitions.js";import{FeatureSetReader as d}from"./FeatureSetReader.js";class a extends d{static from(e,t,r){return new a(e,t,r)}constructor(e,t,r){super(r),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const s=t.lod;s.wrap&&(this._wrappingInfo={worldSizeX:s.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??[]}hasField(e){return null!=this._current.attributes[e]}field(e){return this.readAttribute(e)}get geometryType(){const e=r(this._current.geometry);return"esriGeometryPoint"===e?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new a(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1<this._items.length}get exceededTransferLimit(){throw new Error("InternalError: exceededTransferLimit not implemented for graphics.")}get hasZ(){return s(this._current.projectedGeometry)}get hasM(){return i(this._current.projectedGeometry)}get usedMemory(){return this._current.usedMemory}getInTransform(){return this._tile.transform}getSize(){return this._items.length}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getObjectId(){return this._items[this._index].objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){throw new Error("InternalError: Setting displayId not supported for graphics.")}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(this._cachedGeometry=null;++this._index<this._items.length&&!this._getExists(););return this._index<this._items.length}readGeometryArea(){throw new Error("InternalError: readGeometryArea not supported for graphics.")}_readGeometry(){if(!this._cachedGeometry){let e=o(this._current.projectedGeometry);if("esriGeometryPolyline"===this.geometryType&&(e=n(e,this.geometryType,this._tile.transform.scale[0])),this._cachedGeometry=h(e,this.geometryType,this._tile.transform),!this._cachedGeometry)return null;this._wrapGeometry(this._cachedGeometry)}return this._cachedGeometry}_wrapGeometry(e){if(!this._wrappingInfo)return;const{worldSizeX:t}=this._wrappingInfo;if(e.isPoint)return 1===t?(e.coords.push(c,0),e.coords.push(2*-c,0),void e.lengths.push(3)):2===t?(e.coords.push(2*c,0),e.coords.push(4*-c,0),void e.lengths.push(3)):void this._wrapVertex(e.coords,0,2,t);if("esriGeometryMultipoint"!==this.geometryType);else{if(1===t){const t=e.coords.slice();t[0]-=512;const r=e.coords.slice();r[0]+=512,e.coords.push(...t,...r);const s=e.lengths[0];return void e.lengths.push(s,s)}this._wrapVertex(e.coords,0,2,t)}}_wrapVertex(e,t,r,s){const i=t*r,o=e[i];o<-c*(s-2)?e[i]=o+c*s:o>c*(s-1)&&(e[i]=o-c*s)}_readX(){const e=this._readGeometry();return null!=e?e.coords[0]:0}_readY(){const e=this._readGeometry();return null!=e?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=t(this._current.projectedGeometry),r=new u([],e,this.hasZ,!1);return h(r,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const t=this._current.projectedGeometry,r=e(t.paths,this.hasZ),s=new u([],r,this.hasZ,!1);return h(s,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const r=this._current.attributes[e];if(void 0!==r)return r;const s=e.toLowerCase();for(const i in this._current.attributes)if(i.toLowerCase()===s)return this._current.attributes[i]}_readAttributes(){return this._current.attributes}}export{a as GraphicsReader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import has from"../../../../core/has.js";import{numberMaxFloat32 as r}from"../../../../core/mathUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{isFunctionRaster as o}from"../../../../layers/support/rasterDatasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/support/rasterFormats/pixelRangeUtils.js";import{convertGeometryToMask as a}from"../../../../layers/support/rasterFunctions/clipUtils.js";import{maxMapSizeGpu as l}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{RasterTileContainer as c}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as p}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as u}from"../support/util.js";import{defaultColor as h}from"../../../support/HighlightDefaults.js";import{getHighlightName as d}from"../../../support/highlightOptionsUtils.js";let m=class extends p{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t)return!1;const r=t.lookup.colormapLut?.indexedColormap,s=r&&r.length>this._maxIndexedColormapSize,i=n(this.layer.serviceRasterInfo);return!(has("ios")&&i>4)&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!s&&!("majority"===this.layer.interpolation&&u(this.layer))}attach(){super.attach(),this.container=new c(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const s=this._rasterFunctionState,{rasterFunction:i,primaryRasters:o}=e,n=i.supportsGPU&&(!o||o.rasters.length<=1),a=n?i.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!n||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const p=null==i?"na":r.rasterFunctionChain?"gpu":"cpu",u=s===p||"na"===s&&"cpu"===p&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!u,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=p}async updateTileSource(e,t){const r=this._getBandIds(),s=this._getLayerInterpolation(),{canUseWebGLForProcessing:i}=this,{source:n,globalSymbolizerParams:l,suspended:c,coords:p,resolution:u}=t,h=this.isCPUBasedDRA?l:t.symbolizerParams,{bitmap:d}=e;if([d.x,d.y]=p,d.resolution=u,null!=n?.pixelBlock){const e={extent:n.extent,pixelBlock:n.pixelBlock,srcPixelSize:n.srcTilePixelSize};if(d.rawPixelData=e,i)d.source=n.pixelBlock,d.isRendereredSource=!1;else{const t=await this.layer.applyRenderer(e,"stretch"===l?.type?l:void 0);d.source=t,d.isRendereredSource=!0}d.symbolizerParameters=i?h:null,d.transformGrid=i?n.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();d.source=e,d.symbolizerParameters=i?h:null,d.transformGrid=null}const{isBsqTile:m}=this.layer.raster.rasterInfo.storageInfo;d.bandIds=i&&!m?r:null,d.width=this._tileInfoView.tileInfo.size[0],d.height=this._tileInfoView.tileInfo.size[1],d.interpolation=s,d.suspended=c;const{raster:f}=this.layer;if(o(f)){const t=f.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=f.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);d.mask=a({srcExtent:r,geometry:t,size:[d.width,d.height]})}}d.invalidateTexture()}async updateTileSymbolizerParameters(e,t,r){const{local:s,global:i}=t,o=this._getBandIds(),n=this._getLayerInterpolation(),{canUseWebGLForProcessing:a}=this,{bitmap:l}=e,{rawPixelData:c}=l;a||null==c?(l.isRendereredSource&&null!=c&&(l.source=c.pixelBlock),l.isRendereredSource=!1):(l.source=await this.layer.applyRenderer(c,"stretch"===i?.type?i:void 0,{signal:r}),l.isRendereredSource=!0),l.symbolizerParameters=a?this.layerView.hasTilingEffects?i:s:null;const{isBsqTile:p}=this.layer.raster.rasterInfo.storageInfo;l.bandIds=a&&!p?o:null,l.interpolation=n,l.suspended=!1}updateHighlightOptions(e){if(!e.length)return void(this.container.pixelHighlights=void 0);const s=[],{highlights:i}=this.layerView.view;e.sort((e,t)=>i.findIndex(({name:e})=>e===d(t.options))-i.findIndex(({name:t})=>t===d(e.options)));for(const{target:o,options:n}of e){const{pixelRanges:e}=o,a=Array.from({length:2*l},()=>0);for(let t=0;t<e.length;t++)a[2*t]=e[t][0],a[2*t+1]=e[t][1];for(let t=e.length;t<l;t++)a[2*t]=r,a[2*t+1]=-r;const c=o.bandId??0,p=d(n),u=i.find(e=>e.name===p)?.color??h,m=t.toUnitRGBA(u);s.push({ranges:a,bandId:c,color:m})}this.container.pixelHighlights=s}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.tileInfo.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}};e([s()],m.prototype,"canUseWebGLForProcessing",null),e([s()],m.prototype,"container",void 0),e([s()],m.prototype,"layer",void 0),e([s()],m.prototype,"type",void 0),m=e([i("esri.views.2d.layers.imagery.ImageryTileView2D")],m);export{m as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import has from"../../../../core/has.js";import{numberMaxFloat32 as r}from"../../../../core/mathUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{isFunctionRaster as o}from"../../../../layers/support/rasterDatasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/support/rasterFormats/pixelRangeUtils.js";import{convertGeometryToMask as a}from"../../../../layers/support/rasterFunctions/clipUtils.js";import{maxMapSizeGpu as l}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{RasterTileContainer as c}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as p}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as u}from"../support/util.js";import{defaultColor as h}from"../../../support/HighlightDefaults.js";import{getHighlightName as d}from"../../../support/highlightOptionsUtils.js";let m=class extends p{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t)return!1;const r=t.lookup.colormapLut?.indexedColormap,s=r&&r.length>this._maxIndexedColormapSize,i=n(this.layer.serviceRasterInfo);return!(has("ios")&&i>4)&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!s&&!("majority"===this.layer.interpolation&&u(this.layer))}attach(){super.attach(),this.container=new c(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const s=this._rasterFunctionState,{rasterFunction:i,primaryRasters:o}=e,n=i.supportsGPU&&(!o||o.rasters.length<=1),a=n?i.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!n||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const p=null==i?"na":r.rasterFunctionChain?"gpu":"cpu",u=s===p||"na"===s&&"cpu"===p&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!u,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=p}async updateTileSource(e,t){const r=this._getBandIds(),s=this._getLayerInterpolation(),{canUseWebGLForProcessing:i}=this,{source:n,globalSymbolizerParams:l,suspended:c,coords:p,resolution:u}=t,h=this.isCPUBasedDRA?l:t.symbolizerParams,{bitmap:d}=e;if([d.x,d.y]=p,d.resolution=u,null!=n?.pixelBlock){const e={extent:n.extent,pixelBlock:n.pixelBlock,srcPixelSize:n.srcTilePixelSize};if(d.rawPixelData=e,i)d.source=n.pixelBlock,d.isRendereredSource=!1;else{const t=await this.layer.applyRenderer(e,"stretch"===l?.type?l:void 0);d.source=t,d.isRendereredSource=!0}d.symbolizerParameters=i?h:null,d.transformGrid=i?n.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();d.source=e,d.symbolizerParameters=i?h:null,d.transformGrid=null}const{isBsqTile:m}=this.layer.raster.rasterInfo.storageInfo;d.bandIds=i&&!m?r:null,d.width=this._tileInfoView.tileInfo.size[0],d.height=this._tileInfoView.tileInfo.size[1],d.interpolation=s,d.suspended=c;const{raster:f}=this.layer;if(o(f)){const t=f.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=f.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);r&&(d.mask=a({srcExtent:r,geometry:t,size:[d.width,d.height]}))}}d.invalidateTexture()}async updateTileSymbolizerParameters(e,t,r){const{local:s,global:i}=t,o=this._getBandIds(),n=this._getLayerInterpolation(),{canUseWebGLForProcessing:a}=this,{bitmap:l}=e,{rawPixelData:c}=l;a||null==c?(l.isRendereredSource&&null!=c&&(l.source=c.pixelBlock),l.isRendereredSource=!1):(l.source=await this.layer.applyRenderer(c,"stretch"===i?.type?i:void 0,{signal:r}),l.isRendereredSource=!0),l.symbolizerParameters=a?this.layerView.hasTilingEffects?i:s:null;const{isBsqTile:p}=this.layer.raster.rasterInfo.storageInfo;l.bandIds=a&&!p?o:null,l.interpolation=n,l.suspended=!1}updateHighlightOptions(e){if(!e.length)return void(this.container.pixelHighlights=void 0);const s=[],{highlights:i}=this.layerView.view;e.sort((e,t)=>i.findIndex(({name:e})=>e===d(t.options))-i.findIndex(({name:t})=>t===d(e.options)));for(const{target:o,options:n}of e){const{pixelRanges:e}=o,a=Array.from({length:2*l},()=>0);for(let t=0;t<e.length;t++)a[2*t]=e[t][0],a[2*t+1]=e[t][1];for(let t=e.length;t<l;t++)a[2*t]=r,a[2*t+1]=-r;const c=o.bandId??0,p=d(n),u=i.find(e=>e.name===p)?.color??h,m=t.toUnitRGBA(u);s.push({ranges:a,bandId:c,color:m})}this.container.pixelHighlights=s}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.tileInfo.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}};e([s()],m.prototype,"canUseWebGLForProcessing",null),e([s()],m.prototype,"container",void 0),e([s()],m.prototype,"layer",void 0),e([s()],m.prototype,"type",void 0),m=e([i("esri.views.2d.layers.imagery.ImageryTileView2D")],m);export{m 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import o from"../../core/Accessor.js";import{equals as r}from"../../core/arrayUtils.js";import t from"../../core/Collection.js";import s from"../../core/Error.js";import i from"../../core/Logger.js";import{mapCollection as n}from"../../core/mapCollectionUtils.js";import{watch as a,initial as m}from"../../core/reactiveUtils.js";import{convertToSpatialReferenceUnit as c,convertFromSpatialReferenceUnit as l}from"../../core/unitUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{e as h}from"../../chunks/earcut.js";import{create as d}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as f}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as g}from"../../geometry/ellipsoidUtils.js";import y from"../../geometry/Point.js";import{project as w}from"../../geometry/projectionUtils.js";import{execute as j}from"../../geometry/operators/gx/operatorDensify.js";import{execute as v}from"../../geometry/operators/gx/operatorSimplify.js";import{fromSpatialReference as _,fromPolygon as A,toPolygon as x}from"../../geometry/operators/support/apiConverter.js";import{computeTranslationToOriginAndRotation as b}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as R}from"../../geometry/support/DoubleArray.js";import{earth as N}from"../../geometry/support/Ellipsoid.js";import{newIndexArray as M}from"../../geometry/support/Indices.js";import{t as C}from"../../chunks/vec3.js";import{ElevationContext as U}from"./layers/graphics/ElevationContext.js";import{extrudePolygon as k}from"./layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{computeCentroid as V}from"./layers/graphics/graphicUtils.js";import{geometryToRenderInfo as H}from"./support/renderInfoUtils/polygon.js";import{FocusAreaColorNode as E}from"./webgl-engine/effects/focusArea/FocusAreaColorNode.js";import{FocusAreaMaskNode as F}from"./webgl-engine/effects/focusArea/FocusAreaMaskNode.js";import{FocusAreaOutlineItem as G}from"./webgl-engine/effects/focusArea/FocusAreaOutlineItem.js";const I=2e4;let P=class extends o{constructor(e){super(e),this._volumes=new Map,this._elevationContext=new U,this._outlineMap=new t}initialize(){this.addHandles([a(()=>({polygons:this.polygons,ready:this.view.basemapTerrain?.ready}),({polygons:e,ready:o})=>{o&&this._updateVolumes(e)},m)]),this._outlineMap=n(()=>this.areas?.areas,e=>new G({area:e,view:this.view}),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter(({enabled:e})=>e)??[]}get style(){return this.areas?.style??"bright"}get polygons(){return this.enabledAreas.reduce((e,o)=>e.concat(o.geometries.toArray()),new Array)}containsGeometry(e){if(0===this.polygons.length)return!0;const o=new y(e);return this.polygons.some(e=>e.contains(o))}_updateVolumes(e){this._extrude(e),this._ensureRenderNodes()}_extrude(e){if(!this.view.renderCoordsHelper||r(Array.from(this._volumes.keys()),e))return;const o=this.view.renderCoordsHelper,t=f(),n=1===o.viewingMode,a=d(),m=d(),p=this.view.spatialReference,u=_(p),y=g(p).radius/N.radius,U=c(5e5*y,"meters",p,!0);n||o.worldUpAtPosition([0,0,0],t);const E=new Map;for(const r of e){const e=this._volumes.get(r);if(e)E.set(r,e);else try{const e=p.equals(r.spatialReference)?r:w(r,p),s=Math.max(e.extent.width,e.extent.height),i=l(s,p,"meters",!0),c=Math.max(5*i,I*y),d=n?y/10:y,f=this._reduceGeometryHeight(e,c,d),g=V(f);if(null==g)continue;const _=A(f),N=v(_,u,!1)??_,F=j(N,U,0,0),G=x(F,p);if(null==G)continue;b(p,[g.x,g.y,0],a,o.spatialReference),m[12]=-a[12],m[13]=-a[13],m[14]=-a[14];const P=H(G,this.view.elevationProvider,o,this._elevationContext),{polygons:z,mapPositions:D,position:L}=P,T=new Array,q=new O(T,[a[12],a[13],a[14]]);for(const o of z){const e=o.count,r=h(o.mapPositions,o.holeIndices,3);if(0===r.length)continue;const s=r.length,i=6*e,a=i+s,l=R(3*i),p=M(a),u=M(s);k(L,D,r,o,l,null,null,null,p,u,c,t,n),C(l,l,m);const d=new S(l,u,p,c);T.push(d)}E.set(r,q)}catch(F){i.getLogger(this).error(new s("focusareasview:projection-failed","Failed to project focus area geometry to view spatial reference",{geometry:r,error:F}))}}this._volumes=E,0!==this.volumes.size&&this._maskRenderNode?.updateGeometries()}_ensureRenderNodes(){if(this.view.stage)if(0===this.volumes.size){const{_maskRenderNode:e,_colorRenderNode:o}=this;this._maskRenderNode=this._colorRenderNode=null,o?.fadeOut(()=>{e?.destroy(),o?.destroy()})}else this._maskRenderNode??=new F({focusAreasView:this}),this._colorRenderNode??=new E({focusAreasView:this}),this.view.stage.renderView.requestRender()}_reduceGeometryHeight(e,o,r){const t=-12e5*r,s=Math.max(-o/2,t),i=e.rings.map(e=>e.map(e=>[e[0],e[1],s])),n=e.clone();return n.rings=i,n.hasZ=!0,n}get volumes(){return this._volumes}};e([p()],P.prototype,"_volumes",void 0),e([p({constructOnly:!0})],P.prototype,"view",void 0),P=e([u("esri.views.3d.FocusAreasView")],P);class O{constructor(e,o){this.geometryVolumes=e,this.origin=o}}class S{constructor(e,o,r,t){this.positions=e,this.indicesBottom=o,this.indicesExtruded=r,this.height=t}}export{P as FocusAreasView};
5
+ import{__decorate as e}from"tslib";import o from"../../core/Accessor.js";import{equals as r}from"../../core/arrayUtils.js";import t from"../../core/Collection.js";import s from"../../core/Error.js";import i from"../../core/Logger.js";import{mapCollection as n}from"../../core/mapCollectionUtils.js";import{watch as a,initial as m}from"../../core/reactiveUtils.js";import{convertToSpatialReferenceUnit as c,convertFromSpatialReferenceUnit as l}from"../../core/unitUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{e as h}from"../../chunks/earcut.js";import{create as d}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as f}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as g}from"../../geometry/ellipsoidUtils.js";import y from"../../geometry/Point.js";import{project as w}from"../../geometry/projectionUtils.js";import{execute as j}from"../../geometry/operators/gx/operatorDensify.js";import{execute as v}from"../../geometry/operators/gx/operatorSimplify.js";import{fromSpatialReference as _,fromPolygon as A,toPolygon as x}from"../../geometry/operators/support/apiConverter.js";import{computeTranslationToOriginAndRotation as b}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as R}from"../../geometry/support/DoubleArray.js";import{earth as N}from"../../geometry/support/Ellipsoid.js";import{newIndexArray as M}from"../../geometry/support/Indices.js";import{t as C}from"../../chunks/vec3.js";import{ElevationContext as U}from"./layers/graphics/ElevationContext.js";import{extrudePolygon as k}from"./layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{computeCentroid as V}from"./layers/graphics/graphicUtils.js";import{polygonToRenderInfo as H}from"./support/renderInfoUtils/polygon.js";import{FocusAreaColorNode as E}from"./webgl-engine/effects/focusArea/FocusAreaColorNode.js";import{FocusAreaMaskNode as F}from"./webgl-engine/effects/focusArea/FocusAreaMaskNode.js";import{FocusAreaOutlineItem as G}from"./webgl-engine/effects/focusArea/FocusAreaOutlineItem.js";const I=2e4;let P=class extends o{constructor(e){super(e),this._volumes=new Map,this._elevationContext=new U,this._outlineMap=new t}initialize(){this.addHandles([a(()=>({polygons:this.polygons,ready:this.view.basemapTerrain?.ready}),({polygons:e,ready:o})=>{o&&this._updateVolumes(e)},m)]),this._outlineMap=n(()=>this.areas?.areas,e=>new G({area:e,view:this.view}),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter(({enabled:e})=>e)??[]}get style(){return this.areas?.style??"bright"}get polygons(){return this.enabledAreas.reduce((e,o)=>e.concat(o.geometries.toArray()),new Array)}containsGeometry(e){if(0===this.polygons.length)return!0;const o=new y(e);return this.polygons.some(e=>e.contains(o))}_updateVolumes(e){this._extrude(e),this._ensureRenderNodes()}_extrude(e){if(!this.view.renderCoordsHelper||r(Array.from(this._volumes.keys()),e))return;const o=this.view.renderCoordsHelper,t=f(),n=1===o.viewingMode,a=d(),m=d(),p=this.view.spatialReference,u=_(p),y=g(p).radius/N.radius,U=c(5e5*y,"meters",p,!0);n||o.worldUpAtPosition([0,0,0],t);const E=new Map;for(const r of e){const e=this._volumes.get(r);if(e)E.set(r,e);else try{const e=p.equals(r.spatialReference)?r:w(r,p),s=Math.max(e.extent.width,e.extent.height),i=l(s,p,"meters",!0),c=Math.max(5*i,I*y),d=n?y/10:y,f=this._reduceGeometryHeight(e,c,d),g=V(f);if(null==g)continue;const _=A(f),N=v(_,u,!1)??_,F=j(N,U,0,0),G=x(F,p);if(null==G)continue;b(p,[g.x,g.y,0],a,o.spatialReference),m[12]=-a[12],m[13]=-a[13],m[14]=-a[14];const P=H(G,this.view.elevationProvider,o,this._elevationContext),{polygons:z,mapPositions:D,position:L}=P,T=new Array,q=new O(T,[a[12],a[13],a[14]]);for(const o of z){const e=o.count,r=h(o.mapPositions,o.holeIndices,3);if(0===r.length)continue;const s=r.length,i=6*e,a=i+s,l=R(3*i),p=M(a),u=M(s);k(L,D,r,o,l,null,null,null,p,u,c,t,n),C(l,l,m);const d=new S(l,u,p,c);T.push(d)}E.set(r,q)}catch(F){i.getLogger(this).error(new s("focusareasview:projection-failed","Failed to project focus area geometry to view spatial reference",{geometry:r,error:F}))}}this._volumes=E,0!==this.volumes.size&&this._maskRenderNode?.updateGeometries()}_ensureRenderNodes(){if(this.view.stage)if(0===this.volumes.size){const{_maskRenderNode:e,_colorRenderNode:o}=this;this._maskRenderNode=this._colorRenderNode=null,o?.fadeOut(()=>{e?.destroy(),o?.destroy()})}else this._maskRenderNode??=new F({focusAreasView:this}),this._colorRenderNode??=new E({focusAreasView:this}),this.view.stage.renderView.requestRender()}_reduceGeometryHeight(e,o,r){const t=-12e5*r,s=Math.max(-o/2,t),i=e.rings.map(e=>e.map(e=>[e[0],e[1],s])),n=e.clone();return n.rings=i,n.hasZ=!0,n}get volumes(){return this._volumes}};e([p()],P.prototype,"_volumes",void 0),e([p({constructOnly:!0})],P.prototype,"view",void 0),P=e([u("esri.views.3d.FocusAreasView")],P);class O{constructor(e,o){this.geometryVolumes=e,this.origin=o}}class S{constructor(e,o,r,t){this.positions=e,this.indicesBottom=o,this.indicesExtruded=r,this.height=t}}export{P as FocusAreasView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EventedMixin as r}from"../../core/Evented.js";import{when as t}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"../GroundView.js";let s=class extends(r(a)){constructor(e){super(e)}initialize(){super.initialize(),this.addHandles(t(()=>this._terrainSurface,e=>e.on("elevation-change",e=>this._elevationChange(e)))),this.addHandles(t(()=>this._integratedMeshGroundLayerView,e=>{this.removeHandles(o),e&&this.addHandles(e.elevationProvider.on("elevation-change",e=>this._elevationChange(e)),o)}))}_elevationChange(e){this.emit("elevation-change",e)}get _integratedMeshGroundLayerView(){const e=this.ground?.integratedMeshGround;if(e)return this.view.basemapView?.groundLayerViews.find(r=>r.layer===e)}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return this._terrainSurface?.enabled??!1}get _usingIntegratedMesh(){return this._integratedMeshGroundLayerView?.visible??!1}get spatialReference(){return this._terrainSurface?.spatialReference}intersect(e,r,t,n){this._source?.intersect(e,r,t,n)}get updating(){return!this.suspended&&((this._source?.updating??!1)||this.layerViews.some(({updating:e})=>e))}get elevationQueryCache(){return this._usingTerrain?this._terrainSurface?.elevationQueryCache:null}get extentAABR(){return this._terrainSurface?.extent}get suspended(){return this._source?.suspended??!1}get ready(){return this._source?.ready??!0}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}get _source(){return this._usingTerrain?this._terrainSurface:this._usingIntegratedMesh?this._integratedMeshGroundLayerView:null}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([n({readOnly:!0})],s.prototype,"_integratedMeshGroundLayerView",null),e([n({readOnly:!0})],s.prototype,"_terrainSurface",null),e([n({readOnly:!0})],s.prototype,"_usingTerrain",null),e([n({readOnly:!0})],s.prototype,"_usingIntegratedMesh",null),e([n({readOnly:!0})],s.prototype,"spatialReference",null),e([n({type:Boolean,readOnly:!0})],s.prototype,"updating",null),e([n({readOnly:!0})],s.prototype,"elevationQueryCache",null),e([n({readOnly:!0})],s.prototype,"extentAABR",null),e([n({readOnly:!0})],s.prototype,"suspended",null),e([n({readOnly:!0})],s.prototype,"ready",null),s=e([i("esri.views.3d.GroundView3D")],s);const o=Symbol("integratedMeshHandleKey");export{s as GroundView3D};
5
+ import{__decorate as e}from"tslib";import{EventedMixin as r}from"../../core/Evented.js";import{when as t}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"../GroundView.js";let s=class extends(r(a)){constructor(e){super(e)}initialize(){super.initialize(),this.addHandles(t(()=>this._terrainSurface,e=>e.on("elevation-change",e=>this._elevationChange(e)))),this.addHandles(t(()=>this._integratedMeshGroundLayerView,e=>{this.removeHandles(o),e&&this.addHandles(e.elevationProvider.on("elevation-change",e=>this._elevationChange(e)),o)}))}_elevationChange(e){this.emit("elevation-change",e)}get _integratedMeshGroundLayerView(){const e=this.ground?.integratedMeshGround;if(e)return this.view.basemapView?.groundLayerViews.find(r=>r.layer===e)}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return this._terrainSurface?.enabled??!1}get _usingIntegratedMesh(){return this._integratedMeshGroundLayerView?.visible??!1}get spatialReference(){return this._terrainSurface?.spatialReference}intersect(e,r,t,n){this._usingTerrain&&this._terrainSurface?.intersect(e,r,t,n),this._allIntegratedMeshLayerViews.forEach(i=>i.intersect(e,r,t,n))}get _allIntegratedMeshLayerViews(){return this.view.allLayerViews.filter(u)}get updating(){return!this.suspended&&((this._source?.updating??!1)||this.layerViews.some(({updating:e})=>e))}get elevationQueryCache(){return this._usingTerrain?this._terrainSurface?.elevationQueryCache:null}get extentAABR(){return this._terrainSurface?.extent}get suspended(){return this._source?.suspended??!1}get ready(){return this._source?.ready??!0}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}get _source(){return this._usingTerrain?this._terrainSurface:this._usingIntegratedMesh?this._integratedMeshGroundLayerView:null}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([n({readOnly:!0})],s.prototype,"_integratedMeshGroundLayerView",null),e([n({readOnly:!0})],s.prototype,"_terrainSurface",null),e([n({readOnly:!0})],s.prototype,"_usingTerrain",null),e([n({readOnly:!0})],s.prototype,"_usingIntegratedMesh",null),e([n({readOnly:!0})],s.prototype,"spatialReference",null),e([n()],s.prototype,"_allIntegratedMeshLayerViews",null),e([n({type:Boolean,readOnly:!0})],s.prototype,"updating",null),e([n({readOnly:!0})],s.prototype,"elevationQueryCache",null),e([n({readOnly:!0})],s.prototype,"extentAABR",null),e([n({readOnly:!0})],s.prototype,"suspended",null),e([n({readOnly:!0})],s.prototype,"ready",null),s=e([i("esri.views.3d.GroundView3D")],s);const o=Symbol("integratedMeshHandleKey");function u(e){return"integrated-mesh-3d"===e.type||"integrated-mesh-3dtiles"===e.type}export{s as GroundView3D,u as isIntegratedMeshLayerView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{dedupeResult as t}from"../../../../core/dedupeResult.js";import{isIterable as r}from"../../../../core/iteratorUtils.js";import{equalsShallow as o}from"../../../../core/lang.js";import{equalsMaybe as i}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as n}from"../../../../core/unitUtils.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as c}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../geometry/ellipsoidUtils.js";import{create as m,fromPoints as d}from"../../../../geometry/support/ray.js";import{GeometryDescriptor as y}from"../../../../layers/support/GeometryDescriptor.js";import{externalToInternalIntersectOptions as f}from"../../support/hitTest.js";import{Intersector as h}from"../../webgl-engine/lib/Intersector.js";import{getVisibleLayerIds as v}from"../../../analysis/ElevationProfile/elevationProfileLayerUtils.js";import{ElevationProfileLineComputation as _}from"../../../analysis/ElevationProfile/ElevationProfileLineComputation.js";const g=2e5;let w=class extends _{constructor(){super(...arguments),this.type="scene",this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getStableElevationDependencies=t(()=>{const e=this._view;return e?{view:e,stationary:e.stationary,geometry:this.controller?.analysis.geometry,visibleLayerIds:this._getStableLayerIds(),maxIntersectionDistance:this._maxIntersectionDistance,intersectOptions:this._intersectOptions,spatialReference:this._getStableSpatialReference()}:null},o),this._getStableSpatialReference=t(()=>this._view?.spatialReference,i),this._getStableLayerIds=t(()=>v(this._view),o),this._getStablePointCloudLayers=t(()=>{const e=this._view;return e?e.allLayerViews.toArray().filter(e=>"point-cloud"===e.layer?.type).map(e=>e.layer):[]},o),this._vecA=p(),this._vecB=p(),this._ray=m()}get minDemResolution(){const e=this._view;if(!e)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*n(e.spatialReference)}initialize(){const e=()=>this.onInvalidate(this);return this.addHandles([s(()=>this._queryElevationDependencies,e),this.controller.onElevationChange(e)])}async queryElevation(e,{noDataValue:t,signal:r}){const o=this._queryElevationDependencies;if(null==o)throw new Error(`${this.declaredClass}: no dependencies`);const i=this._intersector;if(null==i)throw new Error(`${this.declaredClass}: no view`);const{intersectOptions:s,view:n,spatialReference:l}=o,a=n.renderCoordsHelper,p=n.sceneIntersectionHelper,u=this._vecA,m=this._vecA,f=this._vecB,h=this._ray;if(!l)return{geometry:e,noDataValue:t};const v=await y.fromGeometry(e).project(l,r);if(!v)return{geometry:e,noDataValue:t};const _=v.coordinates,w=_.length;for(let y=0;y<w;++y){const e=_[y];c(f,e.x,e.y,e.z??0),a.toRenderCoords(f,l,f),a.setAltitude(u,g,f);const r=d(u,f,h);p.computeIntersection(r,i,!0,s);const n=j(o,i.results.all);n?(n.getIntersectionPoint(m),a.fromRenderCoords(m,m,l),e.z=m[2]):e.z=t}return{geometry:v.export(),noDataValue:t}}get _queryElevationDependencies(){return this._getStableElevationDependencies()}get _intersectOptions(){const e=this._view;if(!e||e.destroyed)return{};const{include:t,exclude:o}=this.profile;return f(e,{include:t,exclude:[...this._pointCloudLayers,...r(o)?o:o?[o]:[]]})}get _pointCloudLayers(){return this._getStablePointCloudLayers()}get _view(){const e=this.controller.view;return"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?u(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(!e)return null;const t=new h(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=2,t}};function j({maxIntersectionDistance:e},t){for(const r of t)if(r.withinDistance(e))return r;return null}e([l({readOnly:!0})],w.prototype,"minDemResolution",null),e([l()],w.prototype,"_queryElevationDependencies",null),e([l()],w.prototype,"_intersectOptions",null),e([l()],w.prototype,"_pointCloudLayers",null),e([l()],w.prototype,"_view",null),e([l()],w.prototype,"_maxIntersectionDistance",null),e([l()],w.prototype,"_intersector",null),w=e([a("esri.views.3d.analysis.ElevationProfile.ElevationProfileLineSceneComputation")],w);export{w as ElevationProfileLineSceneComputation};
5
+ import{__decorate as e}from"tslib";import{dedupeResult as t}from"../../../../core/dedupeResult.js";import{isIterable as r}from"../../../../core/iteratorUtils.js";import{equalsShallow as o}from"../../../../core/lang.js";import{equalsMaybe as i}from"../../../../core/maybe.js";import{watch as s,sync as n}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as l}from"../../../../core/unitUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as p}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../../geometry/ellipsoidUtils.js";import{create as d,fromPoints as f}from"../../../../geometry/support/ray.js";import{GeometryDescriptor as y}from"../../../../layers/support/GeometryDescriptor.js";import{externalToInternalIntersectOptions as h,testGraphicUidFilter as v}from"../../support/hitTest.js";import{Intersector as _}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as g}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{getVisibleLayerIds as w}from"../../../analysis/ElevationProfile/elevationProfileLayerUtils.js";import{ElevationProfileLineComputation as j}from"../../../analysis/ElevationProfile/ElevationProfileLineComputation.js";const b=2e5;let I=class extends j{constructor(){super(...arguments),this.type="scene",this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getStableElevationDependencies=t(()=>{const e=this._view;return e?{view:e,stationary:e.stationary,geometry:this.controller?.analysis.geometry,visibleLayerIds:this._getStableLayerIds(),maxIntersectionDistance:this._maxIntersectionDistance,intersectOptions:this._intersectOptions,spatialReference:this._getStableSpatialReference()}:null},o),this._getStableSpatialReference=t(()=>this._view?.spatialReference,i),this._getStableLayerIds=t(()=>w(this._view),o),this._getStablePointCloudLayers=t(()=>{const e=this._view;return e?e.allLayerViews.toArray().filter(e=>"point-cloud"===e.layer?.type).map(e=>e.layer):[]},o),this._vecA=u(),this._vecB=u(),this._ray=d()}get minDemResolution(){const e=this._view;if(!e)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*l(e.spatialReference)}initialize(){const e=()=>this.onInvalidate(this);return this.addHandles([s(()=>this._queryElevationDependencies,e,n),this.controller.onElevationChange(e)])}async queryElevation(e,{noDataValue:t,signal:r}){const o=this._queryElevationDependencies;if(null==o)throw new Error(`${this.declaredClass}: no dependencies`);const i=this._intersector;if(null==i)throw new Error(`${this.declaredClass}: no view`);const{intersectOptions:s,view:n,spatialReference:l}=o,a=n.renderCoordsHelper,c=n.sceneIntersectionHelper,u=this._vecA,m=this._vecA,d=this._vecB,h=this._ray;if(!l)return{geometry:e,noDataValue:t};const v=await y.fromGeometry(e).project(l,r);if(!v)return{geometry:e,noDataValue:t};const _=v.coordinates,g=_.length;for(let y=0;y<g;++y){const e=_[y];p(d,e.x,e.y,e.z??0),a.toRenderCoords(d,l,d),a.setAltitude(u,b,d);const r=f(u,d,h);c.computeIntersection(r,i,!0,s);const n=D(o,i.results.all);n?(n.getIntersectionPoint(m),a.fromRenderCoords(m,m,l),e.z=m[2]):e.z=t}return{geometry:v.export(),noDataValue:t}}get _queryElevationDependencies(){return this._getStableElevationDependencies()}get _intersectOptions(){const e=this._view;if(!e||e.destroyed)return{};const{include:t,exclude:o}=this.profile;return h(e,{include:t,exclude:[...this._pointCloudLayers,...r(o)?o:o?[o]:[]]})}get _pointCloudLayers(){return this._getStablePointCloudLayers()}get _view(){const e=this.controller.view;return"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?m(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(!e)return null;const t=new _(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=2,t}};function D({intersectOptions:e,maxIntersectionDistance:t,view:r},o){const i=e.graphics,s=!(!i?.include&&!i?.exclude);for(const n of o)if(n.withinDistance(t)){if(s){const e=g(n,r);if(null!=e&&!v(i,e))continue}return n}return null}e([a({readOnly:!0})],I.prototype,"minDemResolution",null),e([a()],I.prototype,"_queryElevationDependencies",null),e([a()],I.prototype,"_intersectOptions",null),e([a()],I.prototype,"_pointCloudLayers",null),e([a()],I.prototype,"_view",null),e([a()],I.prototype,"_maxIntersectionDistance",null),e([a()],I.prototype,"_intersector",null),I=e([c("esri.views.3d.analysis.ElevationProfile.ElevationProfileLineSceneComputation")],I);export{I as ElevationProfileLineSceneComputation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{initial as n,watch as s,when as a,syncAndInitial as l,sync as p}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as u}from"../../../../core/screenUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as d}from"../../../../chunks/earcut.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as y,x as g}from"../../../../chunks/vec32.js";import{fromValues as _,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as v}from"../../../../core/support/UpdatingHandles.js";import{projectOrLoad as j}from"../../../../geometry/projectionUtils.js";import{computeTranslationToOriginAndRotation as w}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as E}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as G,create as x,expand as R,width as b,height as L,fromExtent as V,intersects as T}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as C}from"../../../../geometry/support/DoubleArray.js";import{t as M}from"../../../../chunks/vec3.js";import H from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as P}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as O}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementProjectionError as U,VolumeMeasurementInvalidGeometryError as D,VolumeMeasurementDistanceTooCloseError as A,VolumeMeasurementDistanceTooFarError as S,VolumeMeasurementPerimeterTooLargeError as F,VolumeMeasurementUnsupportedCoordinateSystemError as I,VolumeMeasurementUnsupportedLayerTransparencyError as k}from"./volumeMeasurementErrors.js";import N from"./VolumeMeasurementResult.js";import{getRawResult as z}from"./volumeMeasurementUtils.js";import{ElevationContext as W}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as B}from"../../support/ElevationProvider.js";import{geometryToRenderInfo as q}from"../../support/renderInfoUtils/polygon.js";import{CutFillDepth as J,TargetGeometry as K}from"../../webgl-engine/lib/CutFillDepth.js";import{euclideanDirectDistance as Q}from"../../../support/euclideanLengthMeasurementUtils.js";let X=class extends r{constructor(e){super(e),this._projectionError=null,this._getElevationProvider=()=>this.view.elevationProvider,this._updatingHandles=new v,this._computationValue=null}initialize(){const e=this.view;this._renderer=new J({view:e}),this._updatingHandles.add(()=>({computation:this._computation,renderGeometry:this._renderGeometry}),({computation:e,renderGeometry:t})=>{e&&t&&(this._renderer.setup(e,t),this._renderer.start())},n),this.addHandles([this._createElevationUpdateHandle(),s(()=>this._targetGeometry,e=>this.analysisViewData.targetGeometry=e,l),s(()=>this._elevationAlignedGeometry,e=>this.analysisViewData.elevationAlignedGeometry=e,l),s(()=>({computation:this._computation,extent:this._projectedGeometry?.extent,localOrigin:this._renderGeometry?.localOrigin}),({computation:e,extent:t,localOrigin:r})=>{e&&t&&r&&(e.extent=t,e.localOrigin=r)},p),a(()=>this._renderer.done,()=>this._updateResult())])}destroy(){this._updatingHandles.destroy(),this._renderer.destroy()}get _projectedGeometry(){if(this._projectionError=null,!this.analysis.valid)return null;const e=this.analysis.geometry,t=j(e,this.view.spatialReference);return t.pending?(this._updatingHandles.addPromise(t.pending),null):(e&&!t.geometry&&(this._projectionError=new U,P(this.analysis,e.spatialReference,o.getLogger(this))),t.geometry)}get _elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone();return Y(this._getElevationProvider(),t),t}get _targetGeometry(){const e=this._elevationAlignedGeometry;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings[0].forEach(e=>e[2]=r),o}get _renderGeometry(){const e=this._targetGeometry;if(!e)return null;const t=this._projectedGeometry?.extent;if(!t)return null;const{elevationProvider:r,renderCoordsHelper:o}=this.view;if(!r||!o)return null;const i=q(e,r,o,W.fromElevationInfo(new H({mode:"absolute-height"}))),{polygons:n}=i,s=n[0],a=d(s.position,s.holeIndices,3),l=C(3*s.count),p=h(),u=h(),m=_(t.center.x,t.center.y,0);return w(t.spatialReference,m,p,o.spatialReference),u[12]=-p[12],u[13]=-p[13],u[14]=-p[14],M(l,s.position,u),new K(m,l,a)}get updating(){return this._renderer.updating||this._updatingHandles.updating}get result(){const e=this._computation?.rawResult;return e?new N({measureType:this.analysis.measureType,rawResult:e,unit:this.analysisViewData.effectiveDisplayUnits.volume}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._invalidGeometryError??this._projectionError??this._perimeterTooLargeError??this._tooNearFarError}get _invalidGeometryError(){return this.analysis.valid?null:new D}get _tooNearFarError(){const e=this._renderGeometry;if(!e)return null;const{view:r}=this,{camera:o}=r.state,{positions:i,localOrigin:n}=e;r.renderCoordsHelper.toRenderCoords(n,r.spatialReference,ie),G(ne);for(let t=0;t<i.length;t+=3)o.projectToScreen(y(oe,i[t]+ie[0],i[t+1]+ie[1],i[t+2]+ie[2]),se),R(ne,se,ne);const s=b(ne),a=L(ne),{maxVolumeExtentSizeVw:l,minVolumeExtentSizePixels:p}=t;return s>o.width/o.pixelRatio*l||a>o.height/o.pixelRatio*l?new A:Math.max(s,a)<p?new S:null}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeter,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new F:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeter,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new F:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new I:null}get _unsupportedLayerTransparencyError(){return(this.view.map?.ground.opacity??1)<1?new k:null}get _perimeter(){const e=this._renderGeometry?.positions,t=e?$(ee(e)):null;return null!=t?t/this.view.renderCoordsHelper.unitInMeters:null}get _enabled(){return!this.error}get _computation(){const e=this._projectedGeometry?.extent;if(!e||!this._enabled)return this._computationValue=i(this._computationValue),null;if(this._computationValue)return this._computationValue;const t=this._renderGeometry?.localOrigin;if(!t)return null;const{renderCoordsHelper:r}=this.view;return this._computationValue=new O({extent:e,localOrigin:t,renderCoordsHelper:r}),this._computationValue}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&this._enabled&&t&&(E(e.extent,e.spatialReference,te,this.view.spatialReference),V(t,re),T(te,re)&&(this._getElevationProvider=()=>this.view.elevationProvider))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(){if(!this._computation)return;const{spatialReference:e,viewingMode:t}=this.view,{extent:r,boundingRect:o,cameraNearFar:{near:i,far:n}}=this._computation,{width:s,height:a}=this._renderer;let l,p;"local"===t&&e.isWebMercator?({width:l,height:p}=Z(r)):(l=b(o),p=L(o));const u=l/s*(p/a),m=this._renderer.getDepth(),c=e=>e*(n-i)+i,d=c(m.cut)*u,h=c(m.fill)*u;this._computation.rawResult=z(Math.abs(d),h)}};function Y(e,t){t.rings[0].forEach(t=>{t[2]=B(e,t,"ground")??0})}function Z(e){const t=Q([e.xmin,e.ymin,0],[e.xmax,e.ymin,0],e.spatialReference),r=Q([e.xmin,e.ymin,0],[e.xmin,e.ymax,0],e.spatialReference);return{width:t?.value??0,height:r?.value??0}}function $(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1],i[2]??0]),r?o+=g(r,i):r=[0,0,0],r[0]=i[0],r[1]=i[1],r[2]=i[2];return t&&r&&(o+=g(r,t)),Math.sqrt(o)}function*ee(e){const t=f();for(let r=0;r<e.length;r+=3)t[0]=e[r],t[1]=e[r+1],t[2]=e[r+2],yield t}e([m()],X.prototype,"_projectionError",void 0),e([m()],X.prototype,"_projectedGeometry",null),e([m()],X.prototype,"_getElevationProvider",void 0),e([m()],X.prototype,"_elevationAlignedGeometry",null),e([m()],X.prototype,"_targetGeometry",null),e([m()],X.prototype,"_renderGeometry",null),e([m({constructOnly:!0})],X.prototype,"analysis",void 0),e([m({constructOnly:!0})],X.prototype,"analysisViewData",void 0),e([m({constructOnly:!0})],X.prototype,"view",void 0),e([m()],X.prototype,"updating",null),e([m()],X.prototype,"result",null),e([m()],X.prototype,"error",null),e([m()],X.prototype,"_invalidGeometryError",null),e([m()],X.prototype,"_tooNearFarError",null),e([m()],X.prototype,"_perimeterTooLargeError",null),e([m()],X.prototype,"_perimeterTooLargeLocalError",null),e([m()],X.prototype,"_perimeterTooLargeGlobalError",null),e([m()],X.prototype,"_unsupportedCoordinateSystemError",null),e([m()],X.prototype,"_unsupportedLayerTransparencyError",null),e([m()],X.prototype,"_perimeter",null),e([m()],X.prototype,"_enabled",null),e([m()],X.prototype,"_renderer",void 0),e([m({readOnly:!0})],X.prototype,"_updatingHandles",void 0),e([m()],X.prototype,"_computation",null),X=e([c("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],X);const te=G(),re=G(),oe=f(),ie=f(),ne=x(),se=u();export{X as VolumeMeasurementCutFillController};
5
+ import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{initial as n,watch as s,when as a,syncAndInitial as l,sync as p}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as u}from"../../../../core/screenUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as d}from"../../../../chunks/earcut.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as y,x as g}from"../../../../chunks/vec32.js";import{fromValues as _,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as v}from"../../../../core/support/UpdatingHandles.js";import{projectOrLoad as j}from"../../../../geometry/projectionUtils.js";import{computeTranslationToOriginAndRotation as w}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as E}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as G,create as x,expand as R,width as b,height as L,fromExtent as V,intersects as T}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as C}from"../../../../geometry/support/DoubleArray.js";import{t as M}from"../../../../chunks/vec3.js";import H from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as P}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as O}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementProjectionError as U,VolumeMeasurementInvalidGeometryError as D,VolumeMeasurementDistanceTooCloseError as A,VolumeMeasurementDistanceTooFarError as S,VolumeMeasurementPerimeterTooLargeError as F,VolumeMeasurementUnsupportedCoordinateSystemError as I,VolumeMeasurementUnsupportedLayerTransparencyError as k}from"./volumeMeasurementErrors.js";import N from"./VolumeMeasurementResult.js";import{getRawResult as z}from"./volumeMeasurementUtils.js";import{ElevationContext as W}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as B}from"../../support/ElevationProvider.js";import{polygonToRenderInfo as q}from"../../support/renderInfoUtils/polygon.js";import{CutFillDepth as J,TargetGeometry as K}from"../../webgl-engine/lib/CutFillDepth.js";import{euclideanDirectDistance as Q}from"../../../support/euclideanLengthMeasurementUtils.js";let X=class extends r{constructor(e){super(e),this._projectionError=null,this._getElevationProvider=()=>this.view.elevationProvider,this._updatingHandles=new v,this._computationValue=null}initialize(){const e=this.view;this._renderer=new J({view:e}),this._updatingHandles.add(()=>({computation:this._computation,renderGeometry:this._renderGeometry}),({computation:e,renderGeometry:t})=>{e&&t&&(this._renderer.setup(e,t),this._renderer.start())},n),this.addHandles([this._createElevationUpdateHandle(),s(()=>this._targetGeometry,e=>this.analysisViewData.targetGeometry=e,l),s(()=>this._elevationAlignedGeometry,e=>this.analysisViewData.elevationAlignedGeometry=e,l),s(()=>({computation:this._computation,extent:this._projectedGeometry?.extent,localOrigin:this._renderGeometry?.localOrigin}),({computation:e,extent:t,localOrigin:r})=>{e&&t&&r&&(e.extent=t,e.localOrigin=r)},p),a(()=>this._renderer.done,()=>this._updateResult())])}destroy(){this._updatingHandles.destroy(),this._renderer.destroy()}get _projectedGeometry(){if(this._projectionError=null,!this.analysis.valid)return null;const e=this.analysis.geometry,t=j(e,this.view.spatialReference);return t.pending?(this._updatingHandles.addPromise(t.pending),null):(e&&!t.geometry&&(this._projectionError=new U,P(this.analysis,e.spatialReference,o.getLogger(this))),t.geometry)}get _elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone();return Y(this._getElevationProvider(),t),t}get _targetGeometry(){const e=this._elevationAlignedGeometry;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings[0].forEach(e=>e[2]=r),o}get _renderGeometry(){const e=this._targetGeometry;if(!e)return null;const t=this._projectedGeometry?.extent;if(!t)return null;const{elevationProvider:r,renderCoordsHelper:o}=this.view;if(!r||!o)return null;const i=q(e,r,o,W.fromElevationInfo(new H({mode:"absolute-height"}))),{polygons:n}=i,s=n[0],a=d(s.position,s.holeIndices,3),l=C(3*s.count),p=h(),u=h(),m=_(t.center.x,t.center.y,0);return w(t.spatialReference,m,p,o.spatialReference),u[12]=-p[12],u[13]=-p[13],u[14]=-p[14],M(l,s.position,u),new K(m,l,a)}get updating(){return this._renderer.updating||this._updatingHandles.updating}get result(){const e=this._computation?.rawResult;return e?new N({measureType:this.analysis.measureType,rawResult:e,unit:this.analysisViewData.effectiveDisplayUnits.volume}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._invalidGeometryError??this._projectionError??this._perimeterTooLargeError??this._tooNearFarError}get _invalidGeometryError(){return this.analysis.valid?null:new D}get _tooNearFarError(){const e=this._renderGeometry;if(!e)return null;const{view:r}=this,{camera:o}=r.state,{positions:i,localOrigin:n}=e;r.renderCoordsHelper.toRenderCoords(n,r.spatialReference,ie),G(ne);for(let t=0;t<i.length;t+=3)o.projectToScreen(y(oe,i[t]+ie[0],i[t+1]+ie[1],i[t+2]+ie[2]),se),R(ne,se,ne);const s=b(ne),a=L(ne),{maxVolumeExtentSizeVw:l,minVolumeExtentSizePixels:p}=t;return s>o.width/o.pixelRatio*l||a>o.height/o.pixelRatio*l?new A:Math.max(s,a)<p?new S:null}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeter,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new F:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeter,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new F:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new I:null}get _unsupportedLayerTransparencyError(){return(this.view.map?.ground.opacity??1)<1?new k:null}get _perimeter(){const e=this._renderGeometry?.positions,t=e?$(ee(e)):null;return null!=t?t/this.view.renderCoordsHelper.unitInMeters:null}get _enabled(){return!this.error}get _computation(){const e=this._projectedGeometry?.extent;if(!e||!this._enabled)return this._computationValue=i(this._computationValue),null;if(this._computationValue)return this._computationValue;const t=this._renderGeometry?.localOrigin;if(!t)return null;const{renderCoordsHelper:r}=this.view;return this._computationValue=new O({extent:e,localOrigin:t,renderCoordsHelper:r}),this._computationValue}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&this._enabled&&t&&(E(e.extent,e.spatialReference,te,this.view.spatialReference),V(t,re),T(te,re)&&(this._getElevationProvider=()=>this.view.elevationProvider))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(){if(!this._computation)return;const{spatialReference:e,viewingMode:t}=this.view,{extent:r,boundingRect:o,cameraNearFar:{near:i,far:n}}=this._computation,{width:s,height:a}=this._renderer;let l,p;"local"===t&&e.isWebMercator?({width:l,height:p}=Z(r)):(l=b(o),p=L(o));const u=l/s*(p/a),m=this._renderer.getDepth(),c=e=>e*(n-i)+i,d=c(m.cut)*u,h=c(m.fill)*u;this._computation.rawResult=z(Math.abs(d),h)}};function Y(e,t){t.rings[0].forEach(t=>{t[2]=B(e,t,"ground")??0})}function Z(e){const t=Q([e.xmin,e.ymin,0],[e.xmax,e.ymin,0],e.spatialReference),r=Q([e.xmin,e.ymin,0],[e.xmin,e.ymax,0],e.spatialReference);return{width:t?.value??0,height:r?.value??0}}function $(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1],i[2]??0]),r?o+=g(r,i):r=[0,0,0],r[0]=i[0],r[1]=i[1],r[2]=i[2];return t&&r&&(o+=g(r,t)),Math.sqrt(o)}function*ee(e){const t=f();for(let r=0;r<e.length;r+=3)t[0]=e[r],t[1]=e[r+1],t[2]=e[r+2],yield t}e([m()],X.prototype,"_projectionError",void 0),e([m()],X.prototype,"_projectedGeometry",null),e([m()],X.prototype,"_getElevationProvider",void 0),e([m()],X.prototype,"_elevationAlignedGeometry",null),e([m()],X.prototype,"_targetGeometry",null),e([m()],X.prototype,"_renderGeometry",null),e([m({constructOnly:!0})],X.prototype,"analysis",void 0),e([m({constructOnly:!0})],X.prototype,"analysisViewData",void 0),e([m({constructOnly:!0})],X.prototype,"view",void 0),e([m()],X.prototype,"updating",null),e([m()],X.prototype,"result",null),e([m()],X.prototype,"error",null),e([m()],X.prototype,"_invalidGeometryError",null),e([m()],X.prototype,"_tooNearFarError",null),e([m()],X.prototype,"_perimeterTooLargeError",null),e([m()],X.prototype,"_perimeterTooLargeLocalError",null),e([m()],X.prototype,"_perimeterTooLargeGlobalError",null),e([m()],X.prototype,"_unsupportedCoordinateSystemError",null),e([m()],X.prototype,"_unsupportedLayerTransparencyError",null),e([m()],X.prototype,"_perimeter",null),e([m()],X.prototype,"_enabled",null),e([m()],X.prototype,"_renderer",void 0),e([m({readOnly:!0})],X.prototype,"_updatingHandles",void 0),e([m()],X.prototype,"_computation",null),X=e([c("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],X);const te=G(),re=G(),oe=f(),ie=f(),ne=x(),se=u();export{X as VolumeMeasurementCutFillController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import"../../../../intl.js";import{volumeMeasurementConfiguration as i}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import s from"../../../../core/Accessor.js";import{equals as o}from"../../../../core/arrayUtils.js";import{cyclicalPI as r}from"../../../../core/Cyclical.js";import{destroyMaybe as l}from"../../../../core/maybe.js";import{formatDecimal as n}from"../../../../core/quantityFormatUtils.js";import{watch as a,initial as c}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as u}from"../../../../core/unitUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as h}from"../../../../chunks/earcut.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as g,n as y,e as _,i as f,f as v}from"../../../../chunks/vec32.js";import{create as j,fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as L}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as C}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as w}from"../../../../geometry/support/Indices.js";import{angleAroundAxis as G}from"../../../../geometry/support/vector.js";import{t as P}from"../../../../chunks/vec3.js";import V from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as F}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as R}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as A}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as O}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as x}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as S}from"../../layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{geometryToRenderInfo as D}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as M,VolumeGeometry as U}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as E}from"../../webgl-engine/materials/lineStippleUtils.js";import{onLocaleChange as B}from"../../../../intl/locale.js";import{fetchMessageBundle as H}from"../../../../intl/messages.js";import{substitute as N}from"../../../../intl/substitute.js";let T=class extends s{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=x.fromElevationInfo(new V({mode:"absolute-height"})),this._extrusionHeight=1e4,this._projectionLines=[]}initialize(){const{view:e}=this,s={view:e,isDecoration:!0},o=i,r={...s,width:o.geometryOutlineWidth};this._elevationAlignedGeometry=new A({...r,isDraped:!0,color:t.toUnitRGBA(o.geometryOutlineColor)}),this._targetGeometry=new A(r);const l={...s,attached:!0,width:o.projectionLineWidth,renderOccluded:4,polygonOffset:!0},n={...l,stipplePattern:E(o.projectionLineStippleSize)},u=t.toUnitRGBA(o.cutProjectionLineColor),m=t.toUnitRGBA(o.fillProjectionLineColor);this._cutProjectionLines=new R({...l,color:u}),this._occludedCutProjectionLines=new R({...n,color:u}),this._fillProjectionLines=new R({...l,color:m}),this._occludedFillProjectionLines=new R({...n,color:m});const d={...s,attached:!0};this._cutVolumeLabel=new F(d),this._fillVolumeLabel=new F(d),this._cutFillRenderNode=new M({view:e,cutColor:o.cutColor,fillColor:o.fillColor,borderColor:o.geometryOutlineColor}),this.addHandles([a(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},c),a(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i},c),a(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i)),a(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor}),({interactive:e,accentColor:t})=>{this._updateColors(e,t)},c),a(()=>this.analysisViewData.targetGeometry,()=>this._updateCutFillGeometry(),c),a(()=>this.visible,()=>this._updateCutFillVisibility()),a(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i}},e=>this._updateLabels(e)),a(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e)),B(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=l(this._elevationAlignedGeometry),this._targetGeometry=l(this._targetGeometry),this._cutProjectionLines=l(this._cutProjectionLines),this._occludedCutProjectionLines=l(this._occludedCutProjectionLines),this._fillProjectionLines=l(this._fillProjectionLines),this._occludedFillProjectionLines=l(this._occludedFillProjectionLines),this._cutVolumeLabel=l(this._cutVolumeLabel),this._fillVolumeLabel=l(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,r=[],l=e.spatialReference,n=e.rings[0],a=n.length>1&&o(n[0],n[n.length-1]),c=n.length-(a?1:0);for(let o=0;o<c;++o){const e=n[o],i=g(j(),e[0],e[1],e[2]);s.toRenderCoords(i,l,i);const a=t.rings[0][o],c=g(j(),a[0],a[1],a[2]);s.toRenderCoords(c,l,c);const u=new O(i,c);r.push(u)}e.isClockwise(n)||r.reverse();const u=[],m=[],d=[],h=[],p=[],y=this.view.state.camera;for(let o=0;o<r.length;++o){const i=r[o],s=r[0===o?r.length-1:o-1],l=r[o===r.length-1?0:o+1],n=e.rings[0][o],a=t.rings[0][o],c=n[2]>a[2],g=new k(i,s,l,c);u.push(g),g.updateOccluded(y);const _=g.isOccluded;c?(_?d:m).push(i):(_?p:h).push(i)}this._projectionLines=u,this._cutProjectionLines.setGeometryFromSegments(m),this._occludedCutProjectionLines.setGeometryFromSegments(d),this._fillProjectionLines.setGeometryFromSegments(h),this._occludedFillProjectionLines.setGeometryFromSegments(p)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let r=!1,l=!1;for(const n of this._projectionLines){n.updateOccluded(e)&&(r||=n.isCut,l||=!n.isCut);const a=n.isOccluded;(n.isCut?a?i:t:a?o:s).push(n.segment)}l&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),r&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,s){const{geometryOutlineColor:o,cutProjectionLineColor:r,fillProjectionLineColor:l}=i;if(e){const e=t.toUnitRGBA(s);this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillRenderNode.borderColor=s}else{this._targetGeometry.color=t.toUnitRGBA(o);const e=t.toUnitRGBA(r);this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const i=t.toUnitRGBA(l);this._fillProjectionLines.color=i,this._occludedFillProjectionLines.color=i,this._cutFillRenderNode.borderColor=o}}_updateLabels(e){const{labelDistance:t}=i,{effectiveDisplayUnits:s,labelAnchors:o,messages:r,unitsMessages:l,result:n,visible:a}=e;if(this._cutVolumeLabel.visible=a,this._fillVolumeLabel.visible=a,this._cutVolumeLabel.geometry=o.cut?{type:"point",point:o.cut,callout:{distance:t,offset:0}}:null,this._fillVolumeLabel.geometry=o.fill?{type:"point",point:o.fill,callout:{distance:-t,offset:0}}:null,null==n||null==r||null==l)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const c=s.volume,u=N(r.labels.cut,{volume:I(l,n.cutVolume,c)}),m=N(r.labels.fill,{volume:I(l,n.fillVolume,c)});this._cutVolumeLabel.text=u,this._fillVolumeLabel.text=m}_updateCutFillVisibility(){this.visible?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData;if(!t?.extent)return;const{center:i}=t.extent,s=b(i.x,i.y,0),o=j();e.toRenderCoords(s,t.spatialReference,o);const r=this._getExtrudedVolumes(t,this._extrusionHeight,s),l=this._getExtrudedVolumes(t,-this._extrusionHeight,s);this._cutFillRenderNode.updateGeometries(r,l,o)}_getExtrudedVolumes(e,t,i){const{renderCoordsHelper:s,spatialReference:o,elevationProvider:r}=this.view,l=j(),n=1===s.viewingMode;n||s.worldUpAtPosition([0,0,0],l);const a=D(e,r,s,this._elevationContext),{polygons:c,mapPositions:u,position:m}=a,d=c[0],g=d.count,y=h(d.mapPositions,d.holeIndices,3),_=y.length,f=6*g,v=w(f+_),b=w(_),G=C(3*f),V=C(3*f);S(m,u,y,d,G,null,V,null,v,b,t,l,n);const F=p(),R=p();return L(o,i,F,s.spatialReference),R[12]=-F[12],R[13]=-F[13],R[14]=-F[14],P(G,G,R),new U(G,b,v,V)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await H("esri/core/t9n/Units"),this.messages=await H("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,i){return e&&t&&n(e,t,u(t.value,t.unit,i))}e([m({constructOnly:!0})],T.prototype,"view",void 0),e([m({constructOnly:!0})],T.prototype,"analysis",void 0),e([m({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([m()],T.prototype,"unitsMessages",void 0),e([m()],T.prototype,"messages",void 0),e([m()],T.prototype,"loadingMessages",void 0),e([m({readOnly:!0})],T.prototype,"visible",null),e([m()],T.prototype,"updating",null),T=e([d("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],T);class k{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=j(),this._n2=j();const o=y(z,_(z,e.endRenderSpace,e.startRenderSpace));y(this._n1,f(this._n1,o,y(W,_(W,t.startRenderSpace,e.startRenderSpace)))),y(this._n2,f(this._n2,o,y(W,_(W,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=r.normalize(G(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){_(z,this.segment.startRenderSpace,e.eye);const t=v(this._n1,z)<0,i=v(this._n2,z)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const z=j(),W=j();export{T as VolumeMeasurementCutFillVisualization};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import"../../../../intl.js";import{volumeMeasurementConfiguration as i}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import s from"../../../../core/Accessor.js";import{equals as o}from"../../../../core/arrayUtils.js";import{cyclicalPI as r}from"../../../../core/Cyclical.js";import{destroyMaybe as l}from"../../../../core/maybe.js";import{formatDecimal as n}from"../../../../core/quantityFormatUtils.js";import{watch as a,initial as c}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as u}from"../../../../core/unitUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as h}from"../../../../chunks/earcut.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as g,n as y,e as _,i as f,f as v}from"../../../../chunks/vec32.js";import{create as j,fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as L}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as C}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as w}from"../../../../geometry/support/Indices.js";import{angleAroundAxis as G}from"../../../../geometry/support/vector.js";import{t as P}from"../../../../chunks/vec3.js";import V from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as R}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as F}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as A}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as O}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as x}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as D}from"../../layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{polygonToRenderInfo as M}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as S,VolumeGeometry as U}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as E}from"../../webgl-engine/materials/lineStippleUtils.js";import{onLocaleChange as B}from"../../../../intl/locale.js";import{fetchMessageBundle as N}from"../../../../intl/messages.js";import{substitute as H}from"../../../../intl/substitute.js";let T=class extends s{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}get hasUnsupportedError(){const{error:e}=this.analysisViewData;return!!e&&["unsupported-coordinate-system","unsupported-layer-transparency"].includes(e.name)}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=x.fromElevationInfo(new V({mode:"absolute-height"})),this._extrusionHeight=1e4,this._projectionLines=[]}initialize(){const{view:e}=this,s={view:e,isDecoration:!0},o=i,r={...s,width:o.geometryOutlineWidth};this._elevationAlignedGeometry=new A({...r,isDraped:!0,color:t.toUnitRGBA(o.geometryOutlineColor)}),this._targetGeometry=new A(r);const l={...s,attached:!0,width:o.projectionLineWidth,renderOccluded:4,polygonOffset:!0},n={...l,stipplePattern:E(o.projectionLineStippleSize)},u=t.toUnitRGBA(o.cutProjectionLineColor),m=t.toUnitRGBA(o.fillProjectionLineColor);this._cutProjectionLines=new F({...l,color:u}),this._occludedCutProjectionLines=new F({...n,color:u}),this._fillProjectionLines=new F({...l,color:m}),this._occludedFillProjectionLines=new F({...n,color:m});const d={...s,attached:!0};this._cutVolumeLabel=new R(d),this._fillVolumeLabel=new R(d),this._cutFillRenderNode=new S({view:e,cutColor:o.cutColor,fillColor:o.fillColor,borderColor:o.geometryOutlineColor}),this.addHandles([a(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},c),a(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i},c),a(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i)),a(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.analysisViewData.result}),({interactive:e,accentColor:t,hasResult:i})=>{this._updateColors(e,t,i)},c),a(()=>this.analysisViewData.targetGeometry,()=>this._updateCutFillGeometry(),c),a(()=>this.visible&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),c),a(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i&&!!s.result}},e=>this._updateLabels(e)),a(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e)),B(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=l(this._elevationAlignedGeometry),this._targetGeometry=l(this._targetGeometry),this._cutProjectionLines=l(this._cutProjectionLines),this._occludedCutProjectionLines=l(this._occludedCutProjectionLines),this._fillProjectionLines=l(this._fillProjectionLines),this._occludedFillProjectionLines=l(this._occludedFillProjectionLines),this._cutVolumeLabel=l(this._cutVolumeLabel),this._fillVolumeLabel=l(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,r=[],l=e.spatialReference,n=e.rings[0],a=n.length>1&&o(n[0],n[n.length-1]),c=n.length-(a?1:0);for(let o=0;o<c;++o){const e=n[o],i=g(j(),e[0],e[1],e[2]);s.toRenderCoords(i,l,i);const a=t.rings[0][o],c=g(j(),a[0],a[1],a[2]);s.toRenderCoords(c,l,c);const u=new O(i,c);r.push(u)}e.isClockwise(n)||r.reverse();const u=[],m=[],d=[],h=[],p=[],y=this.view.state.camera;for(let o=0;o<r.length;++o){const i=r[o],s=r[0===o?r.length-1:o-1],l=r[o===r.length-1?0:o+1],n=e.rings[0][o],a=t.rings[0][o],c=n[2]>a[2],g=new k(i,s,l,c);u.push(g),g.updateOccluded(y);const _=g.isOccluded;c?(_?d:m).push(i):(_?p:h).push(i)}this._projectionLines=u,this._cutProjectionLines.setGeometryFromSegments(m),this._occludedCutProjectionLines.setGeometryFromSegments(d),this._fillProjectionLines.setGeometryFromSegments(h),this._occludedFillProjectionLines.setGeometryFromSegments(p)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let r=!1,l=!1;for(const n of this._projectionLines){n.updateOccluded(e)&&(r||=n.isCut,l||=!n.isCut);const a=n.isOccluded;(n.isCut?a?i:t:a?o:s).push(n.segment)}l&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),r&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,s,o){const{geometryOutlineColor:r,cutColor:l,fillColor:n,cutColorMuted:a,fillColorMuted:c,cutProjectionLineColor:u,fillProjectionLineColor:m}=i;if(this._cutFillRenderNode.cutColor=o?l:a,this._cutFillRenderNode.fillColor=o?n:c,e){const e=t.toUnitRGBA(s);this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillRenderNode.borderColor=s}else{this._targetGeometry.color=t.toUnitRGBA(r);const e=t.toUnitRGBA(o?u:a);this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const i=t.toUnitRGBA(o?m:c);this._fillProjectionLines.color=i,this._occludedFillProjectionLines.color=i,this._cutFillRenderNode.borderColor=r}}_updateLabels(e){const{labelDistance:t}=i,{effectiveDisplayUnits:s,labelAnchors:o,messages:r,unitsMessages:l,result:n,visible:a}=e;if(this._cutVolumeLabel.visible=a,this._fillVolumeLabel.visible=a,this._cutVolumeLabel.geometry=o.cut?{type:"point",point:o.cut,callout:{distance:t,offset:0}}:null,this._fillVolumeLabel.geometry=o.fill?{type:"point",point:o.fill,callout:{distance:-t,offset:0}}:null,null==n||null==r||null==l)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const c=s.volume,u=H(r.labels.cut,{volume:I(l,n.cutVolume,c)}),m=H(r.labels.fill,{volume:I(l,n.fillVolume,c)});this._cutVolumeLabel.text=u,this._fillVolumeLabel.text=m}_updateCutFillVisibility(e){e?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData;if(!t?.extent)return;const{center:i}=t.extent,s=b(i.x,i.y,0),o=j();e.toRenderCoords(s,t.spatialReference,o);const r=this._getExtrudedVolumes(t,this._extrusionHeight,s),l=this._getExtrudedVolumes(t,-this._extrusionHeight,s);this._cutFillRenderNode.updateGeometries(r,l,o)}_getExtrudedVolumes(e,t,i){const{renderCoordsHelper:s,spatialReference:o,elevationProvider:r}=this.view,l=j(),n=1===s.viewingMode;n||s.worldUpAtPosition([0,0,0],l);const a=M(e,r,s,this._elevationContext),{polygons:c,mapPositions:u,position:m}=a,d=c[0],g=d.count,y=h(d.mapPositions,d.holeIndices,3),_=y.length,f=6*g,v=w(f+_),b=w(_),G=C(3*f),V=C(3*f);D(m,u,y,d,G,null,V,null,v,b,t,l,n);const R=p(),F=p();return L(o,i,R,s.spatialReference),F[12]=-R[12],F[13]=-R[13],F[14]=-R[14],P(G,G,F),new U(G,b,v,V)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await N("esri/core/t9n/Units"),this.messages=await N("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,s){if(!t||!e)return null;const o=u(t.value,t.unit,s),r=i.labelPrecisions[o];return n(e,t,o,r)}e([m({constructOnly:!0})],T.prototype,"view",void 0),e([m({constructOnly:!0})],T.prototype,"analysis",void 0),e([m({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([m()],T.prototype,"unitsMessages",void 0),e([m()],T.prototype,"messages",void 0),e([m()],T.prototype,"loadingMessages",void 0),e([m({readOnly:!0})],T.prototype,"visible",null),e([m()],T.prototype,"updating",null),e([m()],T.prototype,"hasUnsupportedError",null),T=e([d("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],T);class k{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=j(),this._n2=j();const o=y(z,_(z,e.endRenderSpace,e.startRenderSpace));y(this._n1,f(this._n1,o,y(W,_(W,t.startRenderSpace,e.startRenderSpace)))),y(this._n2,f(this._n2,o,y(W,_(W,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=r.normalize(G(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){_(z,this.segment.startRenderSpace,e.eye);const t=v(this._n1,z)<0,i=v(this._n2,z)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const z=j(),W=j();export{T as VolumeMeasurementCutFillVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import r from"../../../request.js";import{result as e}from"../../../core/asyncUtils.js";import t from"../../../core/Error.js";import{throwIfAborted as o,throwIfAbortError as s}from"../../../core/promiseUtils.js";import{isDataProtocol as a,dataToArrayBuffer as i}from"../../../core/urlUtils.js";class l{constructor(r){this._streamDataRequester=r}async loadJSON(r,e){return this._load(0,r,e)}async loadBinary(r,e){return a(r)?(o(e),i(r)):this._load(1,r,e)}async loadImage(r,e){return this._load(2,r,e)}async _load(o,a,i){if(null==this._streamDataRequester)return(await r(a,{responseType:n[o]})).data;const l=await e(this._streamDataRequester.request(a,o,i));if(!0===l.ok)return l.value;throw s(l.error),new t("glt-loader-request-error",`Request for resource failed: ${l.error}`)}}const n={2:"image",1:"array-buffer",0:"json",3:void 0};export{l as DefaultLoadingContext};
5
+ import r from"../../../request.js";import{result as e}from"../../../core/asyncUtils.js";import t from"../../../core/Error.js";import{throwIfAborted as o,throwIfAbortError as s}from"../../../core/promiseUtils.js";import{isDataProtocol as a,dataToArrayBuffer as i}from"../../../core/urlUtils.js";class l{constructor(r){this._streamDataRequester=r}async loadJSON(r,e){return this._load(0,r,e)}async loadBinary(r,e){return a(r)?(o(e),i(r)):this._load(1,r,e)}async loadImage(r,e){return this._load(2,r,e)}async _load(o,a,i){if(null==this._streamDataRequester)return(await r(a,{responseType:n[o]})).data;const l=await e(this._streamDataRequester.request(a,o,i));if(!0===l.ok)return l.value;throw s(l.error),new t("gltf-loader-request-error",`Request for resource failed: ${l.error}`)}}const n={2:"image",1:"array-buffer",0:"json",3:void 0};export{l as DefaultLoadingContext};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getObjectId as u}from"../../../layers/graphics/dehydratedFeatures.js";import{FeatureLikeLayerView3D as n}from"./FeatureLikeLayerView3D.js";import{LayerView3D as p}from"./LayerView3D.js";import{FeatureGraphics3DGraphicsPipeline as l}from"./graphics/FeatureGraphics3DGraphicsPipeline.js";import{updatingProgress as m}from"../support/updatingProperties.js";import c from"../../layers/FeatureLayerView.js";import d from"../../layers/LayerView.js";import{RefreshableLayerView as h}from"../../layers/RefreshableLayerView.js";let y=class extends(h(n(c(p(d))))){constructor(e){super(e)}initialize(){this.addHandles(i(()=>this._updatingRequiredPromise,e=>this._updatingHandles.addPromise(e),s))}destroy(){this._updatingHandles.removeAll(),this._fetcherContext=t(this._fetcherContext)}get maximumNumberOfFeatures(){return this.graphicsPipeline.maximumNumberOfFeatures}set maximumNumberOfFeatures(e){this.graphicsPipeline.maximumNumberOfFeatures=e}get maximumNumberOfFeaturesExceeded(){return null!=this.graphicsPipeline&&!this.suspended&&this.graphicsPipeline.maximumNumberOfFeaturesExceeded}get updatingProgressValue(){return this.graphicsPipeline?.updatingProgressValue??0}get updatePolicy(){return this.graphicsPipeline?.updatePolicy??0}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}setVisibility(e,r){this.graphicsPipeline?.setVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}async createGraphicsPipeline(){if(has("feature-pipeline-3d-test")){const{Feature3DPipeline:e}=await import("./graphics/pipeline/Feature3DPipeline.js");return new e({layerView:this})}return new l({layerView:this})}async doRefresh(e){return await this.graphicsPipeline.doRefresh(e)}_popupFeatureHasRequiredFields(e,r){if(!super._popupFeatureHasRequiredFields(e,r))return!1;const t=u(e,this.layer.objectIdField);if(null==t)return!0;const i=this.graphicsPipeline.getMissingAttributesForFeature(t);if(null==i)return!0;for(const s of r)if(i.has(s))return!1;return!0}get usedMemory(){return this.graphicsPipeline?.usedMemory??0}get unloadedMemory(){return this.graphicsPipeline?.unloadedMemory??0}get ignoresMemoryFactor(){return this.graphicsPipeline?.ignoresMemoryFactor??!1}async _queryFeaturesMesh(e,r){this._validateQueryFeaturesMesh(e);const t=await r(),i=this.graphicsPipeline;if(e?.outStatistics||null==i)return t;const s=this.layer.objectIdField,a=[];for(const o of t.features)if(o.geometry){const e=i.getHydratedGeometry(o.attributes[s]);e&&(o.geometry=e,a.push(o))}else a.push(o);return t.features=a,t}_validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},i=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of i)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),null==e.outSpatialReference||e.outSpatialReference.equals(this.view.spatialReference)||t("outSpatialReference")}get test(){}};e([a()],y.prototype,"layer",void 0),e([a()],y.prototype,"graphicsPipeline",void 0),e([a()],y.prototype,"maximumNumberOfFeatures",null),e([a()],y.prototype,"maximumNumberOfFeaturesExceeded",null),e([a(m)],y.prototype,"updatingProgress",void 0),e([a({readOnly:!0})],y.prototype,"updatingProgressValue",null),e([a({readOnly:!0})],y.prototype,"updatePolicy",null),e([a({readOnly:!0})],y.prototype,"hasZ",null),e([a({readOnly:!0})],y.prototype,"hasM",null),y=e([o("esri.views.3d.layers.FeatureLayerViewBase3D")],y);export{y as default};
5
+ import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getObjectId as u}from"../../../layers/graphics/dehydratedFeatures.js";import{packFields as n}from"../../../layers/support/fieldUtils.js";import{FeatureLikeLayerView3D as p}from"./FeatureLikeLayerView3D.js";import{LayerView3D as l}from"./LayerView3D.js";import{FeatureGraphics3DGraphicsPipeline as m}from"./graphics/FeatureGraphics3DGraphicsPipeline.js";import{updatingProgress as c}from"../support/updatingProperties.js";import d from"../../layers/FeatureLayerView.js";import h from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";let f=class extends(y(p(d(l(h))))){constructor(e){super(e)}initialize(){this.addHandles(i(()=>this._updatingRequiredPromise,e=>this._updatingHandles.addPromise(e),s))}destroy(){this._updatingHandles.removeAll(),this._fetcherContext=t(this._fetcherContext)}get maximumNumberOfFeatures(){return this.graphicsPipeline.maximumNumberOfFeatures}set maximumNumberOfFeatures(e){this.graphicsPipeline.maximumNumberOfFeatures=e}get maximumNumberOfFeaturesExceeded(){return null!=this.graphicsPipeline&&!this.suspended&&this.graphicsPipeline.maximumNumberOfFeaturesExceeded}get updatingProgressValue(){return this.graphicsPipeline?.updatingProgressValue??0}get updatePolicy(){return this.graphicsPipeline?.updatePolicy??0}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}get availableFieldsForQuery(){return n(this.layer.fieldsIndex,this.availableFields)}setVisibility(e,r){this.graphicsPipeline?.setVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}async createGraphicsPipeline(){if(has("feature-pipeline-3d-test")){const{Feature3DPipeline:e}=await import("./graphics/pipeline/Feature3DPipeline.js");return new e({layerView:this})}return new m({layerView:this})}async doRefresh(e){return await this.graphicsPipeline.doRefresh(e)}_popupFeatureHasRequiredFields(e,r){if(!super._popupFeatureHasRequiredFields(e,r))return!1;const t=u(e,this.layer.objectIdField);if(null==t)return!0;const i=this.graphicsPipeline.getMissingAttributesForFeature(t);if(null==i)return!0;for(const s of r)if(i.has(s))return!1;return!0}get usedMemory(){return this.graphicsPipeline?.usedMemory??0}get unloadedMemory(){return this.graphicsPipeline?.unloadedMemory??0}get ignoresMemoryFactor(){return this.graphicsPipeline?.ignoresMemoryFactor??!1}async _queryFeaturesMesh(e,r){this._validateQueryFeaturesMesh(e);const t=await r(),i=this.graphicsPipeline;if(e?.outStatistics||null==i)return t;const s=this.layer.objectIdField,a=[];for(const o of t.features)if(o.geometry){const e=i.getHydratedGeometry(o.attributes[s]);e&&(o.geometry=e,a.push(o))}else a.push(o);return t.features=a,t}_validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},i=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of i)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),null==e.outSpatialReference||e.outSpatialReference.equals(this.view.spatialReference)||t("outSpatialReference")}get test(){}};e([a()],f.prototype,"layer",void 0),e([a()],f.prototype,"graphicsPipeline",void 0),e([a()],f.prototype,"maximumNumberOfFeatures",null),e([a()],f.prototype,"maximumNumberOfFeaturesExceeded",null),e([a(c)],f.prototype,"updatingProgress",void 0),e([a({readOnly:!0})],f.prototype,"updatingProgressValue",null),e([a({readOnly:!0})],f.prototype,"updatePolicy",null),e([a({readOnly:!0})],f.prototype,"hasZ",null),e([a({readOnly:!0})],f.prototype,"hasM",null),e([a()],f.prototype,"availableFieldsForQuery",null),f=e([o("esri.views.3d.layers.FeatureLayerViewBase3D")],f);export{f 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as r}from"../../../core/maybe.js";import{debounce as s,ignoreAbortErrors as o,throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as n,when as l,sync as u,whenOnce as d}from"../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../core/scheduling.js";import{Seconds as h,secondsFromMilliseconds as c}from"../../../core/time.js";import{getMetersPerVerticalUnitForSR as m}from"../../../core/unitUtils.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import{projectOrLoad as y}from"../../../geometry/projectionUtils.js";import{fromExtent as v,intersection as w,toExtent as S,intersects as T}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as b}from"../../../geometry/support/spatialReferenceUtils.js";import R from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as j,getPositions as L,getFlowSimulationSettings as U}from"../../2d/engine/flow/utils.js";import A from"./SubView3D.js";import{makeScheduleFunction as x}from"./support/makeScheduleFunction.js";import{thresholdForLoadingAllTiles as P,fadeOutTime as E,fadeInTime as I,defaultTransitionDuration as k,transitionDurationFactor as F,averageLoadingTimeSmoothingFactor as M}from"../support/flow/constants.js";import{isFullExtent as V,FlowQuery3D as C,wrappedWidth as q}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as z}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as D,createStreamlineGeometry as B}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as W}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as G}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as H}from"../support/flow/StreamlineResources3DShape.js";import{tilesAreRelated as O}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as N}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as Q}from"../webgl-engine/materials/RibbonLineMaterial.js";import{isInEffectiveScaleRange as J,hasLayerBasedScaleVisibility as K}from"../../support/layerViewUtils.js";import{TaskPriority as X}from"../../support/Scheduler.js";let Y=class extends A{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=h(0),this._abortController=null,this._loadingState="ready-to-load",this._tilesUpdateIsWaiting=!1,this._transitionEnabled=!0,this._debugAllowAutoLoading=!0,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._updateTask=null,this._debouncedTileUpdate=s(async()=>{const{allTiles:e}=this.surface,t=this._getTileFilterFunction(),i=new Set;function*r(r){for(let s=0;s<e.length;++s){const o=e.at(s);t(o)&&i.add(o),r.madeProgress(),r.done&&(r=yield)}}await this.frameTask.scheduleGenerator(r),this.renderedTiles=i}),this._transitionEnabled=!0}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new z(x(i)),this.frameTask=i.scheduler.registerTask(X.FLOW_GENERATOR),this._updateTask=p({update:e=>this._update(e)}),this.addHandles([n(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&j(e,t)}),n(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this._visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit]},()=>this.triggerLoad(),u),n(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),e.on("tiles-changed",()=>this._triggerTilesUpdate()),t.enableFeatureTiles(),n(()=>[this._dataBounds,this._featureTilesBounds,this._loadAllTiles],()=>this._triggerTilesUpdate()),n(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],r=e?.visualVariables??[];r.length===i.length&&r.every((e,t)=>e.type===i[t].type)||this.clear()}),l(()=>!t.featureTiles?.updating,()=>this._triggerTilesUpdate())]),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear()}abort(){this._abortController=r(this._abortController),this.requireLoad=!1}get _clippingArea(){const e=y(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _dataBounds(){const e=y(this.layer.fullExtent,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get _ellipsoidRadius(){return f(this.view.spatialReference).radius}get _loadAllTiles(){const{position:e}=this.view.camera,t=e.z;if(null==t)return!1;return t*m(e.spatialReference)/this._ellipsoidRadius>=P}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=y(e,this.surface.spatialReference).geometry;return null==t?null:v(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...D(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),fadeInTime:I,fadeOutTime:E,...this._overrideMaterialParameters,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&N(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _transitionDuration(){const{_averageLoadingTime:e}=this;return h(0===e?k:this._averageLoadingTime*F)}get _visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get elevationInfo(){return this.layer.elevationInfo??Z}startPositions(e){if(!this._transitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:L(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return b(this.surface.spatialReference)}get layer(){return this.layerView.layer}get loadingState(){return this._loadingState}get readyToLoad(){return null!=this.renderedTiles&&this.renderedTiles.size>0}getUpdating(){return this.updatingHandles.updating||this.requireLoad||"before-transition"===this._loadingState}get updating(){return this.getUpdating()}get visibleAtCurrentScale(){return!K()||J(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let i=U(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const r="global"===this.view.viewingMode&&null!=i&&V(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:r}}get surface(){return this.view.basemapTerrain}doRefresh(){this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null}_update(e){const t=c(e.time),i=this._nextStateForTransition(t);if(!this.requireLoad||this.updatingHandles.updating||"ready-to-load"!==i)return void(this._loadingState=i);if(this._loadingState="loading",!this.readyToLoad)return;const r=async()=>{const e=performance.now();await this._load(this.renderedTiles,t,this._transitionDuration);const i=h((performance.now()-e)/1e3);this._updateAverageLoadingTime(i)};this.updatingHandles.addPromise(o(r())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=M;this._averageLoadingTime=h(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){this._debugAllowAutoLoading&&(this.requireLoad=!0)}async _load(e,t,i){if(!this._visible)return this.clear(),void(this._loadingState="ready-to-load");const r=this._computeExtent(e);if(0===e.size||null==r)return void(this._loadingState="ready-to-load");const s=this._transitionEnabled&&null!=this._resources?h(t+i):t,o=new C(r,this.layerView.timeExtent,this._viewSizeWithEqualRatio(r),this.view.state.contentPixelRatio,s);null==this._abortController&&(this._abortController=new AbortController);const n=this._abortController,l=await this._loadStreamlines(o,n.signal);if(a(n.signal),this._visible&&null!=l){this._lastResources?.detach(),await l.attach(),this._transitionEnabled?this._lastResources=this._resources:this._resources?.detach(),this._resources=l;const e=performance.now()/1e3,t=this._transitionEnabled&&e>s?e:s;null!=this._lastResources&&(this._lastResources.endTime=t),this._resources.startTime=t,this._loadingState=this._transitionEnabled?"before-transition":"ready-to-load"}else this._loadingState="ready-to-load"}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i)return null;const{geometries:r,material:s}=await this._createGeometry(e,i);return this._draped?new G(e,i,s,r,this.view.overlayManager):new H(e,i,s,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const i=new Q(this._materialParameters,this.view.state.isGlobal),r=new Array,{elevationInfo:s,_draped:o,view:a}=this;function*n(n){for(let l=0;l<t.length;++l)r.push(B(a,e,t[l],s,i,o)),n.madeProgress(),n.done&&(n=yield)}return await this.frameTask.scheduleGenerator(n),{geometries:r,material:i}}_computeExtent(e){const{spatialReference:t}=this.surface;if(null==t)return null;const i=W(e,this.spatialReferenceInfo);return null==i?null:(w(i,this._clippingArea,i),S(i,t))}_triggerTilesUpdate(){if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=async()=>{await d(()=>this.view.stationary),this._tilesUpdateIsWaiting=!1,await this._debouncedTileUpdate()};this.updatingHandles.addPromise(o(e()))}_getTileFilterFunction(){const{_dataBounds:e,view:i,_featureTilesBounds:r}=this;if(this._loadAllTiles)return t=>t.leaf&&$(e,t.extent);const s=t=>t.rendered&&t.visible&&$(e,t.extent),{featureTiles:o}=i;if(!o)return s;const a=o.tiles.filter(e=>e.measures.visible);return e=>s(e)&&$(r,e.extent)&&a.some(({lij:i})=>t(i,e.lij)||O(i,e.lij))}_viewSizeWithEqualRatio(e){const t=q(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,r]=this.view.size;return i<r?[i,Math.floor(i/t)]:[Math.floor(r*t),r]}_nextStateForTransition(e){const{_resources:t}=this;if(!this._transitionEnabled||null==this._flowRenderer||null==t||"ready-to-load"===this._loadingState||"loading"===this._loadingState)return this._loadingState;const i=t.startTime;return e<i?"before-transition":e<i+E?"transitioning":"ready-to-load"}get test(){}};e([g()],Y.prototype,"type",void 0),e([g()],Y.prototype,"renderedTiles",void 0),e([g()],Y.prototype,"_resources",void 0),e([g()],Y.prototype,"_lastResources",void 0),e([g()],Y.prototype,"requireLoad",void 0),e([g()],Y.prototype,"_averageLoadingTime",void 0),e([g()],Y.prototype,"_loadingState",void 0),e([g()],Y.prototype,"emissiveStrength",void 0),e([g()],Y.prototype,"_clippingArea",null),e([g()],Y.prototype,"_dataBounds",null),e([g()],Y.prototype,"_draped",null),e([g()],Y.prototype,"_ellipsoidRadius",null),e([g()],Y.prototype,"_loadAllTiles",null),e([g()],Y.prototype,"_featureTilesBounds",null),e([g()],Y.prototype,"_flowRenderer",null),e([g()],Y.prototype,"_materialParameters",null),e([g()],Y.prototype,"_opacity",null),e([g()],Y.prototype,"_transitionDuration",null),e([g()],Y.prototype,"_visible",null),e([g()],Y.prototype,"elevationInfo",null),e([g()],Y.prototype,"needsMagnitude",null),e([g()],Y.prototype,"spatialReferenceInfo",null),e([g()],Y.prototype,"layer",null),e([g()],Y.prototype,"loadingState",null),e([g()],Y.prototype,"updating",null),e([g()],Y.prototype,"visibleAtCurrentScale",null),e([g()],Y.prototype,"_overrideMaterialParameters",void 0),e([g()],Y.prototype,"_overrideSimulationSettings",void 0),e([g()],Y.prototype,"_simulationSettings",null),e([g()],Y.prototype,"surface",null),Y=e([_("esri.views.3d.layers.FlowSubView3D")],Y);const Z=new R({mode:"on-the-ground"});function $(e,t){return null==e||null==t||T(e,t)}export{Y as default};
5
+ import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as r}from"../../../core/maybe.js";import{debounce as s,ignoreAbortErrors as o,throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as l,when as n,sync as u,whenOnce as d}from"../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../core/scheduling.js";import{Seconds as h,secondsFromMilliseconds as c}from"../../../core/time.js";import{getMetersPerVerticalUnitForSR as m}from"../../../core/unitUtils.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import{projectOrLoad as y}from"../../../geometry/projectionUtils.js";import{fromExtent as v,intersection as w,toExtent as T,intersects as S}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as b}from"../../../geometry/support/spatialReferenceUtils.js";import R from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as j,getPositions as A,getFlowSimulationSettings as L}from"../../2d/engine/flow/utils.js";import U from"./SubView3D.js";import{makeScheduleFunction as x}from"./support/makeScheduleFunction.js";import{thresholdForLoadingAllTiles as P,fadeOutTime as E,fadeInTime as I,defaultTransitionDuration as M,transitionDurationFactor as q,seamlessTransitionEnabled as F,averageLoadingTimeSmoothingFactor as V}from"../support/flow/constants.js";import{isFullExtent as k,FlowQuery3D as B,wrappedWidth as C}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as W}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as z,createStreamlineGeometry as G}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as H}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as D}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as O}from"../support/flow/StreamlineResources3DShape.js";import{tilesAreRelated as N}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as Q}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as J}from"../webgl-engine/materials/RibbonLineMaterial.js";import{isInEffectiveScaleRange as K,hasLayerBasedScaleVisibility as X}from"../../support/layerViewUtils.js";import{TaskPriority as Y}from"../../support/Scheduler.js";let Z=class extends U{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=h(0),this._abortController=null,this._loadingState="ready-to-load",this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=!0,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._overrideTransitionEnabled=null,this._updateTask=null,this._debouncedTileUpdate=s(async()=>{const{allTiles:e}=this.surface,t=this._getTileFilterFunction(),i=new Set;function*r(r){for(let s=0;s<e.length;++s){const o=e.at(s);t(o)&&i.add(o),r.madeProgress(),r.done&&(r=yield)}}await this.frameTask.scheduleGenerator(r),this.renderedTiles=i})}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new W(x(i)),this.frameTask=i.scheduler.registerTask(Y.FLOW_GENERATOR),this._updateTask=p({update:e=>this._update(e)}),this.addHandles([l(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&j(e,t)}),l(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this._visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit]},()=>this.triggerLoad(),u),l(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),e.on("tiles-changed",()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()}),t.enableFeatureTiles(),l(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),l(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],r=e?.visualVariables??[];r.length===i.length&&r.every((e,t)=>e.type===i[t].type)||this.clear()}),n(()=>!t.featureTiles?.updating,()=>{this.loadByTileTreesAllowed&&this._triggerTilesUpdate()})]),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear()}abort(){this._abortController=r(this._abortController),this.requireLoad=!1}get _clippingArea(){const e=y(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _dataBounds(){const e=y(this.layer.fullExtent,this.surface.spatialReference).geometry;return null==e?null:v(e)}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get _ellipsoidRadius(){return f(this.view.spatialReference).radius}get loadAllTiles(){const{position:e}=this.view.camera,t=e.z;if(null==t)return!1;return t*m(e.spatialReference)/this._ellipsoidRadius>=P}get loadByTileTreesAllowed(){return!this.loadAllTiles||!this.loadRequirementsMet}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=y(e,this.surface.spatialReference).geometry;return null==t?null:v(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...z(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),fadeInTime:I,fadeOutTime:E,...this._overrideMaterialParameters,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&Q(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){const{_averageLoadingTime:e}=this;return h(0===e?M:this._averageLoadingTime*q)}get _seamlessTransitionEnabled(){return null!=this._overrideTransitionEnabled?this._overrideTransitionEnabled:F}get _visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get elevationInfo(){return this.layer.elevationInfo??$}startPositions(e){if(!this._seamlessTransitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:A(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return b(this.surface.spatialReference)}get layer(){return this.layerView.layer}get loadingState(){return this._loadingState}get loadRequirementsMet(){return null!=this.renderedTiles&&this.renderedTiles.size>0}getUpdating(){return this.updatingHandles.updating||this.requireLoad||"before-transition"===this._loadingState}get updating(){return this.getUpdating()}get visibleAtCurrentScale(){return!X()||K(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let i=L(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const r="global"===this.view.viewingMode&&null!=i&&k(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:r}}get surface(){return this.view.basemapTerrain}doRefresh(){this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this._loadingState="ready-to-load"}_update(e){const t=c(e.time);this._lastResources?.hasFadedOut(t)&&this._lastResources.detach();const i=this._nextStateForTransition(t);if(!this.requireLoad||this.updatingHandles.updating||"ready-to-load"!==i||!this.loadRequirementsMet)return void(this._loadingState=i);this._loadingState="loading";const r=async()=>{const e=performance.now(),i=this._seamlessTransitionEnabled&&null!=this._resources?h(t+this._seamlessTransitionWaitingTime):t;await this._load(this.renderedTiles,i);const r=h((performance.now()-e)/1e3);this._updateAverageLoadingTime(r)};this.updatingHandles.addPromise(o(r())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=V;this._averageLoadingTime=h(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){this._debugAllowAutoLoading&&(this.requireLoad=!0)}async _load(e,t){if(!this._visible)return this.clear(),void(this._loadingState="ready-to-load");const i=this._computeExtent(e);if(0===e.size||null==i)return void(this._loadingState="ready-to-load");const r=new B(i,this.layerView.timeExtent,this._viewSizeWithEqualRatio(i),this.view.state.contentPixelRatio,t);null==this._abortController&&(this._abortController=new AbortController);const s=this._abortController,o=await this._loadStreamlines(r,s.signal);if(a(s.signal),this._visible&&null!=o){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=o;const e=performance.now()/1e3,i=e>t?e:t;null!=this._lastResources&&(this._lastResources.endTime=i),this._resources.startTime=i,await o.attach(),this._loadingState=this._seamlessTransitionEnabled?"before-transition":"transitioning"}else this._loadingState="ready-to-load"}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i)return null;const{geometries:r,material:s}=await this._createGeometry(e,i);return this._draped?new D(e,i,s,r,this.layerView):new O(e,i,s,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const i=new J(this._materialParameters,this.view.state.isGlobal),r=new Array,{elevationInfo:s,_draped:o,view:a}=this;function*l(l){for(let n=0;n<t.length;++n)r.push(G(a,e,t[n],s,i,o)),l.madeProgress(),l.done&&(l=yield)}return await this.frameTask.scheduleGenerator(l),{geometries:r,material:i}}_computeExtent(e){const{spatialReference:t}=this.surface;if(null==t)return null;const i=H(e,this.spatialReferenceInfo);return null==i?null:(w(i,this._clippingArea,i),T(i,t))}_triggerTilesUpdate(){if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=async()=>{await d(()=>this.view.stationary),this._tilesUpdateIsWaiting=!1,await this._debouncedTileUpdate()};this.updatingHandles.addPromise(o(e()))}_getTileFilterFunction(){const{_dataBounds:e,view:i,_featureTilesBounds:r}=this;if(this.loadAllTiles)return t=>t.leaf&&ee(e,t.extent);const s=t=>t.rendered&&t.visible&&ee(e,t.extent),{featureTiles:o}=i;if(!o)return s;const a=o.tiles.filter(e=>e.measures.visible);return e=>s(e)&&ee(r,e.extent)&&a.some(({lij:i})=>t(i,e.lij)||N(i,e.lij))}_viewSizeWithEqualRatio(e){const t=C(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,r]=this.view.size;return i<r?[i,Math.floor(i/t)]:[Math.floor(r*t),r]}_nextStateForTransition(e){const{_resources:t}=this;if(null==this._flowRenderer||null==t||"ready-to-load"===this._loadingState||"loading"===this._loadingState)return this._loadingState;const i=t.startTime;return e<i?"before-transition":e<i+E?"transitioning":"ready-to-load"}get test(){}};e([g()],Z.prototype,"type",void 0),e([g()],Z.prototype,"renderedTiles",void 0),e([g()],Z.prototype,"_resources",void 0),e([g()],Z.prototype,"_lastResources",void 0),e([g()],Z.prototype,"requireLoad",void 0),e([g()],Z.prototype,"_averageLoadingTime",void 0),e([g()],Z.prototype,"_loadingState",void 0),e([g()],Z.prototype,"emissiveStrength",void 0),e([g()],Z.prototype,"_clippingArea",null),e([g()],Z.prototype,"_dataBounds",null),e([g()],Z.prototype,"_draped",null),e([g()],Z.prototype,"_ellipsoidRadius",null),e([g()],Z.prototype,"loadAllTiles",null),e([g()],Z.prototype,"_featureTilesBounds",null),e([g()],Z.prototype,"_flowRenderer",null),e([g()],Z.prototype,"_materialParameters",null),e([g()],Z.prototype,"_opacity",null),e([g()],Z.prototype,"_seamlessTransitionWaitingTime",null),e([g()],Z.prototype,"_seamlessTransitionEnabled",null),e([g()],Z.prototype,"_visible",null),e([g()],Z.prototype,"elevationInfo",null),e([g()],Z.prototype,"needsMagnitude",null),e([g()],Z.prototype,"spatialReferenceInfo",null),e([g()],Z.prototype,"layer",null),e([g()],Z.prototype,"loadingState",null),e([g()],Z.prototype,"updating",null),e([g()],Z.prototype,"visibleAtCurrentScale",null),e([g()],Z.prototype,"_overrideMaterialParameters",void 0),e([g()],Z.prototype,"_overrideSimulationSettings",void 0),e([g()],Z.prototype,"_overrideTransitionEnabled",void 0),e([g()],Z.prototype,"_simulationSettings",null),e([g()],Z.prototype,"surface",null),Z=e([_("esri.views.3d.layers.FlowSubView3D")],Z);const $=new R({mode:"on-the-ground"});function ee(e,t){return null==e||null==t||S(e,t)}export{Z as default};