@arcgis/core 5.1.0-next.71 → 5.1.0-next.72

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 (365) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/003fd7745966fe03510c.js +1 -0
  4. package/assets/esri/core/workers/chunks/00bae4b7e179336e0362.js +1 -0
  5. package/assets/esri/core/workers/chunks/{36031cb53c486630f3c9.js → 026d3fa331caec1ea3d2.js} +1 -1
  6. package/assets/esri/core/workers/chunks/027c3ea756db68e51f0a.js +1 -0
  7. package/assets/esri/core/workers/chunks/{c06d021180418f2014de.js → 02876e434dc91c42b2f4.js} +1 -1
  8. package/assets/esri/core/workers/chunks/041c372e98a6fba90b36.js +1 -0
  9. package/assets/esri/core/workers/chunks/{a5a46d0a0831497cf1b4.js → 0783890816bac45277b9.js} +1 -1
  10. package/assets/esri/core/workers/chunks/07aac6245a0d1adbb2d4.js +1 -0
  11. package/assets/esri/core/workers/chunks/0839da55707f7c4cf780.js +1 -0
  12. package/assets/esri/core/workers/chunks/0c00e5e4bd18467bcecd.js +1 -0
  13. package/assets/esri/core/workers/chunks/{d69110ec4078c583a05e.js → 0d96e39380fd84cea9ba.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0dad0bca8d58b2c63d22.js +1 -0
  15. package/assets/esri/core/workers/chunks/0ef93722524620023f69.js +1 -0
  16. package/assets/esri/core/workers/chunks/127cd8fee3717a473fc5.js +1 -0
  17. package/assets/esri/core/workers/chunks/1286f41f245ef22b3a26.js +1 -0
  18. package/assets/esri/core/workers/chunks/161d60fdac2013c15543.js +1 -0
  19. package/assets/esri/core/workers/chunks/1661684357912726a72a.js +1 -0
  20. package/assets/esri/core/workers/chunks/168de44a789d1cecc1f8.js +1 -0
  21. package/assets/esri/core/workers/chunks/1961b59756933e0a82f2.js +1 -0
  22. package/assets/esri/core/workers/chunks/1d9d7915cf7449e5d468.js +1 -0
  23. package/assets/esri/core/workers/chunks/1f85646936200a399c15.js +1 -0
  24. package/assets/esri/core/workers/chunks/{deb8a0b306d7b9c86b97.js → 2171aaa147aa4d9fc5b5.js} +1 -1
  25. package/assets/esri/core/workers/chunks/235cb82952a18ff8d206.js +1 -0
  26. package/assets/esri/core/workers/chunks/260d4571722cb1ff1366.js +1 -0
  27. package/assets/esri/core/workers/chunks/{3e972ae291df1844017d.js → 266ba61b72a278d93a26.js} +1 -1
  28. package/assets/esri/core/workers/chunks/27b80c386cebadcaca3c.js +1 -0
  29. package/assets/esri/core/workers/chunks/29d3890a5a43d934067a.js +1 -0
  30. package/assets/esri/core/workers/chunks/{333a0038d782d8a34d58.js → 2abf124e2956e4f76688.js} +1 -1
  31. package/assets/esri/core/workers/chunks/2f17438d215bea3ce70f.js +1 -0
  32. package/assets/esri/core/workers/chunks/{f6d5dd2eef0d9918096e.js → 30e710ec4d22c43d4e7e.js} +1 -1
  33. package/assets/esri/core/workers/chunks/356cb86606b8c674f947.js +1 -0
  34. package/assets/esri/core/workers/chunks/398e0dd2bc7e1ab84831.js +1 -0
  35. package/assets/esri/core/workers/chunks/3b1052aa30af3f6186cc.js +1 -0
  36. package/assets/esri/core/workers/chunks/3bbf684ee2484eb44c9f.js +1 -0
  37. package/assets/esri/core/workers/chunks/3cd9bd20e75ba4d5b294.js +1 -0
  38. package/assets/esri/core/workers/chunks/3e87e3ad857d72f6ecbb.js +1 -0
  39. package/assets/esri/core/workers/chunks/{7cb6d8f7eaf762279632.js → 3ea5a18b264628dc37f0.js} +1 -1
  40. package/assets/esri/core/workers/chunks/41809c16544ec25120fa.js +1 -0
  41. package/assets/esri/core/workers/chunks/41913575dd45c65d645e.js +1 -0
  42. package/assets/esri/core/workers/chunks/42e483fde18f12da32a6.js +1 -0
  43. package/assets/esri/core/workers/chunks/43ab44d37bc0ea97ef98.js +1 -0
  44. package/assets/esri/core/workers/chunks/46e622857ba92a72a317.js +1 -0
  45. package/assets/esri/core/workers/chunks/47f2113357b2aa4f4f37.js +1 -0
  46. package/assets/esri/core/workers/chunks/488ed9584b527ec47be3.js +1 -0
  47. package/assets/esri/core/workers/chunks/4ad32580e0c0699fde1f.js +1 -0
  48. package/assets/esri/core/workers/chunks/4d0f793dee4ad919221b.js +1 -0
  49. package/assets/esri/core/workers/chunks/4eed175277eb0df3c821.js +1 -0
  50. package/assets/esri/core/workers/chunks/{916a8f3eed1fafdc7242.js → 54d07eadf113f0e4e506.js} +1 -1
  51. package/assets/esri/core/workers/chunks/54ed37ec9682ea739deb.js +1 -0
  52. package/assets/esri/core/workers/chunks/{9187d1caca1fd2d713e0.js → 55369c5bd65bcaf78da1.js} +1 -1
  53. package/assets/esri/core/workers/chunks/56fd3da911c2c4511e5d.js +1 -0
  54. package/assets/esri/core/workers/chunks/59592bb25f226865e88a.js +1 -0
  55. package/assets/esri/core/workers/chunks/{e77d958cb62536b8eebc.js → 5a4d7ba6dc1d4b41d80d.js} +1 -1
  56. package/assets/esri/core/workers/chunks/5d55b4449bcb24cd72b6.js +1 -0
  57. package/assets/esri/core/workers/chunks/5d8fe41a3c06ddb4094b.js +1 -0
  58. package/assets/esri/core/workers/chunks/{fe68c28d3c61f116ff23.js → 5ef37f37e405b3bb5450.js} +1 -1
  59. package/assets/esri/core/workers/chunks/608d707fd9d9f9088473.js +1 -0
  60. package/assets/esri/core/workers/chunks/{c92352b0e39576ca317a.js → 61ef14e42bc09b787d89.js} +1 -1
  61. package/assets/esri/core/workers/chunks/656d6963e8f837fbf28f.js +1 -0
  62. package/assets/esri/core/workers/chunks/68b47a5a50e0b5fffca2.js +1 -0
  63. package/assets/esri/core/workers/chunks/{a5afcd633b32e6ee31a7.js → 6a0352d20596ca3f4b64.js} +1 -1
  64. package/assets/esri/core/workers/chunks/6c7ff968bd4fc816442d.js +1 -0
  65. package/assets/esri/core/workers/chunks/6e526c06825ecc6c99c0.js +1 -0
  66. package/assets/esri/core/workers/chunks/6ea8b0d68881d16a2432.js +1 -0
  67. package/assets/esri/core/workers/chunks/6f9ea461c268c421f9c9.js +1 -0
  68. package/assets/esri/core/workers/chunks/7027d93dc5a4595d70c6.js +1 -0
  69. package/assets/esri/core/workers/chunks/70b35b2446558d5280e3.js +1 -0
  70. package/assets/esri/core/workers/chunks/7349cb45a93e6916f115.js +1 -0
  71. package/assets/esri/core/workers/chunks/751609831b283903ba48.js +1 -0
  72. package/assets/esri/core/workers/chunks/76edaeaf8fe344bb77a8.js +1 -0
  73. package/assets/esri/core/workers/chunks/76fe5b821d6b54db5721.js +1 -0
  74. package/assets/esri/core/workers/chunks/81d30c9062ad0120a863.js +1 -0
  75. package/assets/esri/core/workers/chunks/84772b023d04e415f17f.js +1 -0
  76. package/assets/esri/core/workers/chunks/{123e920e4460124ec3bb.js → 88b480a1d1fb01778798.js} +9 -30
  77. package/assets/esri/core/workers/chunks/88c5f7c712c6b89b5109.js +1 -0
  78. package/assets/esri/core/workers/chunks/88e469b82d2594f23649.js +1 -0
  79. package/assets/esri/core/workers/chunks/8a14e3db28c403b046cf.js +1 -0
  80. package/assets/esri/core/workers/chunks/8a664451845a47048859.js +1 -0
  81. package/assets/esri/core/workers/chunks/8a8242e7cc7e6a9e7876.js +1 -0
  82. package/assets/esri/core/workers/chunks/{4d51261d6131c07402cd.js → 8acee3fba488f202f82f.js} +1 -1
  83. package/assets/esri/core/workers/chunks/91a0227a64a944af3286.js +596 -0
  84. package/assets/esri/core/workers/chunks/9444ed8ea117861ae89b.js +1 -0
  85. package/assets/esri/core/workers/chunks/96bba4d93a32ad34a1c8.js +1 -0
  86. package/assets/esri/core/workers/chunks/9a38fd68b02b617c45d3.js +1 -0
  87. package/assets/esri/core/workers/chunks/9d434360dfce1e49b7b9.js +1 -0
  88. package/assets/esri/core/workers/chunks/9f4b97204def91567e3c.js +1 -0
  89. package/assets/esri/core/workers/chunks/a37c28e3c4a2be9fd1d5.js +1 -0
  90. package/assets/esri/core/workers/chunks/{58b3c888c8bfedbe6443.js → a37fc886227365f7ecd5.js} +1 -1
  91. package/assets/esri/core/workers/chunks/a8d7f59927bdad564141.js +1 -0
  92. package/assets/esri/core/workers/chunks/{f89976ec97938bf86996.js → abc06d10c7ac8ba5b0e4.js} +1 -1
  93. package/assets/esri/core/workers/chunks/abe22ae8ee0dcc9efbb7.js +1 -0
  94. package/assets/esri/core/workers/chunks/{fef5dc19736f12dfa99a.js → af5db0372d526e592fcc.js} +1 -1
  95. package/assets/esri/core/workers/chunks/{eb3cdc4ff45243fc3cc5.js → b475f5492c6e3fd4cca8.js} +1 -1
  96. package/assets/esri/core/workers/chunks/b495f14d90abe8d1a558.js +1 -0
  97. package/assets/esri/core/workers/chunks/{6ac5ec3ecbca8860338b.js → b54b7cc6b23a70fed700.js} +1 -1
  98. package/assets/esri/core/workers/chunks/b702279c48f3009f6dd8.js +1 -0
  99. package/assets/esri/core/workers/chunks/b79058f5bda6fcac22f8.js +1 -0
  100. package/assets/esri/core/workers/chunks/b801631b58e6fc6cec8a.js +1 -0
  101. package/assets/esri/core/workers/chunks/{31071a43e2c03984d619.js → b92794def31592a6a25f.js} +1 -1
  102. package/assets/esri/core/workers/chunks/be1d6a571f76933dfbb0.js +1 -0
  103. package/assets/esri/core/workers/chunks/bea70be8e38b8c83ccd2.js +1 -0
  104. package/assets/esri/core/workers/chunks/bfcdc5c315131aae34d8.js +1 -0
  105. package/assets/esri/core/workers/chunks/c0f624a2ca0d07ef8f8c.js +1 -0
  106. package/assets/esri/core/workers/chunks/c1838822b096d5f36a8b.js +1 -0
  107. package/assets/esri/core/workers/chunks/c3381b9a36299210ee47.js +1 -0
  108. package/assets/esri/core/workers/chunks/{c2882a9e67124b7c18be.js → c503c79ba5761f7abbeb.js} +1 -1
  109. package/assets/esri/core/workers/chunks/cb5e4b9b4a59c2622eb5.js +1 -0
  110. package/assets/esri/core/workers/chunks/d201a5dff18a5bb467ab.js +1 -0
  111. package/assets/esri/core/workers/chunks/{3b7cda16e656db450f11.js → d2aa75816e84b1e7fd25.js} +1 -1
  112. package/assets/esri/core/workers/chunks/{4d8670f6fa8952b7bab6.js → d950d5c2844206502ff0.js} +1 -1
  113. package/assets/esri/core/workers/chunks/db3c484bfa607dec6050.js +1 -0
  114. package/assets/esri/core/workers/chunks/db588bf3256e95c977b7.js +1 -0
  115. package/assets/esri/core/workers/chunks/{967758a05170545cd371.js → dcc719e15b2e0cce1f3b.js} +1 -1
  116. package/assets/esri/core/workers/chunks/{6bb090f3e5c18604cb39.js → dd5b362bded458afa2d6.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{e957d52cb9643961a843.js → de583214195eff13cb00.js} +58 -45
  118. package/assets/esri/core/workers/chunks/dec6d41d614105e6fd93.js +1 -0
  119. package/assets/esri/core/workers/chunks/dfdd474fddcd1d6091ce.js +1 -0
  120. package/assets/esri/core/workers/chunks/e235ea4293d5d463acfb.js +1 -0
  121. package/assets/esri/core/workers/chunks/e43486113aaf72ac4dc1.js +1 -0
  122. package/assets/esri/core/workers/chunks/ea4c3393c5757e309a71.js +1 -0
  123. package/assets/esri/core/workers/chunks/ed216ddeb7f59f510bd0.js +1 -0
  124. package/assets/esri/core/workers/chunks/ef8886dff54063928bcb.js +1 -0
  125. package/assets/esri/core/workers/chunks/{231f502cd15f30d12be2.js → f1673e723b336204ad77.js} +1 -1
  126. package/assets/esri/core/workers/chunks/f5223ffb3be548c9b0a1.js +1 -0
  127. package/assets/esri/core/workers/chunks/fae147d03ed723ab234d.js +1 -0
  128. package/chunks/CheckerBoard.glsl.js +3 -5
  129. package/chunks/ColorMaterial.glsl.js +4 -6
  130. package/chunks/ComponentShader.glsl.js +42 -44
  131. package/chunks/DefaultMaterial.glsl.js +21 -23
  132. package/chunks/EdgeShader.glsl.js +9 -11
  133. package/chunks/GaussianSplat.glsl.js +8 -8
  134. package/chunks/ImageMaterial.glsl.js +5 -7
  135. package/chunks/LineCallout.glsl.js +9 -12
  136. package/chunks/LineMarker.glsl.js +24 -26
  137. package/chunks/Path.glsl.js +15 -17
  138. package/chunks/Pattern.glsl.js +25 -27
  139. package/chunks/RealisticTree.glsl.js +11 -13
  140. package/chunks/RibbonLine.glsl.js +42 -45
  141. package/chunks/ShadedColorMaterial.glsl.js +8 -9
  142. package/chunks/Water.glsl.js +18 -20
  143. package/config.js +1 -1
  144. package/kernel.js +1 -1
  145. package/layers/VoxelWasmPerSceneView.js +1 -1
  146. package/layers/graphics/FlatFeature.js +1 -1
  147. package/layers/graphics/FlatFeatureSet.js +1 -1
  148. package/layers/graphics/OptimizedFeature.js +1 -1
  149. package/layers/graphics/data/AttributesBuilder.js +1 -1
  150. package/layers/graphics/data/QueryEngineResult.js +1 -1
  151. package/layers/graphics/data/flatFeatureQueryEngineAdapter.js +1 -1
  152. package/layers/graphics/data/optimizedFeatureQueryEngineAdapter.js +1 -1
  153. package/layers/graphics/featureConversionUtils.js +1 -1
  154. package/layers/support/LabelClass.js +1 -1
  155. package/layers/support/featureLayerUtils.js +1 -1
  156. package/layers/support/labelUtils.js +1 -1
  157. package/layers/video/videoUtils.js +1 -1
  158. package/package.json +1 -1
  159. package/popupTemplateUtils.js +2 -0
  160. package/renderers/visualVariables/SizeVariable.js +1 -1
  161. package/renderers/visualVariables/support/sizeVariableUtils.js +1 -1
  162. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  163. package/rest/support/OutDistance.js +2 -0
  164. package/rest/support/Query.js +1 -1
  165. package/smartMapping/statistics/support/utils.js +1 -1
  166. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  167. package/support/arcadeUtils.js +1 -1
  168. package/support/revision.js +1 -1
  169. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  170. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  171. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  172. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  173. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  174. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  175. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  176. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  177. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  178. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  179. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  180. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  181. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  182. package/views/3d/layers/IntegratedMeshNormals.js +1 -1
  183. package/views/3d/layers/StreamLayerView3D.js +1 -1
  184. package/views/3d/layers/graphics/featureExpressionInfoUtils.js +1 -1
  185. package/views/3d/state/ViewStateManager.js +1 -1
  186. package/views/3d/terrain/OverlayRenderer.js +1 -1
  187. package/views/3d/terrain/TerrainRenderer.js +1 -1
  188. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  189. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialGlobalParameters.js +1 -1
  190. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  191. package/views/3d/webgl-engine/collections/Component/Material/ComponentShader.glsl.js +1 -1
  192. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  193. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +20 -32
  194. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +5 -3
  195. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  196. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  197. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  198. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  199. package/views/3d/webgl-engine/lib/Compositor.js +1 -1
  200. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  201. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  202. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  203. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  204. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  205. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  206. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
  207. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechniqueConfiguration.js +1 -1
  208. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  209. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  210. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  211. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  212. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  213. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  214. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  215. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  216. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  217. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  218. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  219. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  220. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  221. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  222. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  223. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  224. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  225. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  226. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  227. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  228. package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
  229. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  230. package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
  231. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  232. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  233. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  234. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  235. package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
  236. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  237. package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
  238. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  239. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  240. package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
  241. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  242. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  243. package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
  244. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  245. package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
  246. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  247. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  248. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  249. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  250. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  251. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
  252. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  253. package/views/VideoView.js +1 -1
  254. package/views/layers/FeatureLikeLayerView.js +1 -1
  255. package/views/video/VideoOperationalDataView.js +1 -1
  256. package/views/webgl/ShaderBuilder.js +1 -1
  257. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +19 -3
  258. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  259. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  260. package/widgets/FeatureTable/VisibleElements.d.ts +15 -1
  261. package/widgets/FeatureTable/VisibleElements.js +1 -1
  262. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  263. package/widgets/FeatureTable.d.ts +15 -1
  264. package/widgets/FeatureTable.js +1 -1
  265. package/widgets/Search/SearchViewModel.js +1 -1
  266. package/assets/esri/core/workers/chunks/09ecb36e44096e577af8.js +0 -1
  267. package/assets/esri/core/workers/chunks/0ca06ea649bbdb93ff49.js +0 -1
  268. package/assets/esri/core/workers/chunks/10308c9f3f0d709d96bc.js +0 -1
  269. package/assets/esri/core/workers/chunks/141edf5ed890105a079b.js +0 -1
  270. package/assets/esri/core/workers/chunks/160b9a76b75875507c86.js +0 -1
  271. package/assets/esri/core/workers/chunks/16dfdee05704df249e95.js +0 -1
  272. package/assets/esri/core/workers/chunks/17ef955dc48e329aa184.js +0 -1
  273. package/assets/esri/core/workers/chunks/18001536ed345955121a.js +0 -1
  274. package/assets/esri/core/workers/chunks/20e715e3aeb1c3265901.js +0 -1
  275. package/assets/esri/core/workers/chunks/238f51d0b36f998017b8.js +0 -1
  276. package/assets/esri/core/workers/chunks/2cee6d751c5e73fe09d4.js +0 -1
  277. package/assets/esri/core/workers/chunks/314140e2e9b813191907.js +0 -1
  278. package/assets/esri/core/workers/chunks/3158a3487d3e8a61b680.js +0 -1
  279. package/assets/esri/core/workers/chunks/3b1446286a9b87f34761.js +0 -1
  280. package/assets/esri/core/workers/chunks/3f7fd58ee7d71989fc83.js +0 -1
  281. package/assets/esri/core/workers/chunks/41396724040180d2537f.js +0 -1
  282. package/assets/esri/core/workers/chunks/416e031bafc0189544fa.js +0 -1
  283. package/assets/esri/core/workers/chunks/55ee78923987ed17ea8c.js +0 -1
  284. package/assets/esri/core/workers/chunks/56c7d7c7217557375fb6.js +0 -1
  285. package/assets/esri/core/workers/chunks/5a1d975b3e9e6b7eff67.js +0 -1
  286. package/assets/esri/core/workers/chunks/5f6942ac94acd7842926.js +0 -1
  287. package/assets/esri/core/workers/chunks/6118706b9a038e9a06b8.js +0 -1
  288. package/assets/esri/core/workers/chunks/6d15229b3fa84a7acf4d.js +0 -599
  289. package/assets/esri/core/workers/chunks/7314c0131403cac84ad7.js +0 -1
  290. package/assets/esri/core/workers/chunks/73545bb13c70f6a347a4.js +0 -1
  291. package/assets/esri/core/workers/chunks/73a045061e69a22b6869.js +0 -1
  292. package/assets/esri/core/workers/chunks/75669912cddcb5db52c8.js +0 -1
  293. package/assets/esri/core/workers/chunks/7ca32806e47be15109a4.js +0 -1
  294. package/assets/esri/core/workers/chunks/7d6ed65bbcd279448191.js +0 -1
  295. package/assets/esri/core/workers/chunks/81f149e45c79b9b086fb.js +0 -1
  296. package/assets/esri/core/workers/chunks/84fa25f66a6949290221.js +0 -1
  297. package/assets/esri/core/workers/chunks/852aabbf671d2ca9cd33.js +0 -1
  298. package/assets/esri/core/workers/chunks/854fe80272b59fafc2e9.js +0 -1
  299. package/assets/esri/core/workers/chunks/861817be5e050e9522ab.js +0 -1
  300. package/assets/esri/core/workers/chunks/89345a682dea60ef1643.js +0 -1
  301. package/assets/esri/core/workers/chunks/8985402c328b90af5724.js +0 -1
  302. package/assets/esri/core/workers/chunks/89fdf9ad10ca8fbb08a5.js +0 -1
  303. package/assets/esri/core/workers/chunks/8b094330323d9b16fb5d.js +0 -1
  304. package/assets/esri/core/workers/chunks/90aed8c4b266832f84ca.js +0 -1
  305. package/assets/esri/core/workers/chunks/9776c2db337222ceceef.js +0 -1
  306. package/assets/esri/core/workers/chunks/990853e9df38fdfc58b5.js +0 -1
  307. package/assets/esri/core/workers/chunks/9a21ba0c45a96b94c05e.js +0 -1
  308. package/assets/esri/core/workers/chunks/9a235c92f21df2c17aa8.js +0 -1
  309. package/assets/esri/core/workers/chunks/9b56162ac67c992193ce.js +0 -1
  310. package/assets/esri/core/workers/chunks/9f1f5fb648302c43ad12.js +0 -1
  311. package/assets/esri/core/workers/chunks/a1e6187c239fdc7553ed.js +0 -1
  312. package/assets/esri/core/workers/chunks/a4b6fdbc995be03d2afb.js +0 -1
  313. package/assets/esri/core/workers/chunks/a760be8fa6c6ea6b745c.js +0 -1
  314. package/assets/esri/core/workers/chunks/a8782286ce3c0d6c20e6.js +0 -1
  315. package/assets/esri/core/workers/chunks/a96692514dcaa50340dd.js +0 -1
  316. package/assets/esri/core/workers/chunks/a994a3c912a33b2f4100.js +0 -1
  317. package/assets/esri/core/workers/chunks/aa7aaeae31ddb259e55e.js +0 -1
  318. package/assets/esri/core/workers/chunks/abcc5fb71be2bd94878c.js +0 -1
  319. package/assets/esri/core/workers/chunks/aecb05df4ad1454f5435.js +0 -1
  320. package/assets/esri/core/workers/chunks/aecb105db7cec2c9c4c5.js +0 -1
  321. package/assets/esri/core/workers/chunks/b19f33e026a2a43b17c4.js +0 -1
  322. package/assets/esri/core/workers/chunks/b3950d5f1f3352521504.js +0 -1
  323. package/assets/esri/core/workers/chunks/b3f0600729227b458a75.js +0 -1
  324. package/assets/esri/core/workers/chunks/b5922991d2f450e6a9d9.js +0 -1
  325. package/assets/esri/core/workers/chunks/b8643976a7f984552d94.js +0 -1
  326. package/assets/esri/core/workers/chunks/b8a11d32a4847513619b.js +0 -1
  327. package/assets/esri/core/workers/chunks/b8acb6c2538053c01cc6.js +0 -1
  328. package/assets/esri/core/workers/chunks/ba4259aa050169c1d523.js +0 -1
  329. package/assets/esri/core/workers/chunks/bbaf1d9835671c0165ca.js +0 -1
  330. package/assets/esri/core/workers/chunks/bcefdf9753d9d2f6f1be.js +0 -1
  331. package/assets/esri/core/workers/chunks/c178e2cfc34603661b1d.js +0 -1
  332. package/assets/esri/core/workers/chunks/c3e80c0e29ac6a7a6f80.js +0 -1
  333. package/assets/esri/core/workers/chunks/c79827f879d1d58d3f1b.js +0 -1
  334. package/assets/esri/core/workers/chunks/c92b40a532e708e506cc.js +0 -1
  335. package/assets/esri/core/workers/chunks/cb903ccbce87172a0757.js +0 -1
  336. package/assets/esri/core/workers/chunks/cda2e445eb2ac269abdf.js +0 -1
  337. package/assets/esri/core/workers/chunks/ce44e172e2847fd8df14.js +0 -1
  338. package/assets/esri/core/workers/chunks/cff7e921649aef715c78.js +0 -1
  339. package/assets/esri/core/workers/chunks/d315098b038a96084ff5.js +0 -1
  340. package/assets/esri/core/workers/chunks/d8c0d18f0132872decd3.js +0 -1
  341. package/assets/esri/core/workers/chunks/db0061a6d5bf454cc509.js +0 -1
  342. package/assets/esri/core/workers/chunks/dcfafcf4386f2940d000.js +0 -1
  343. package/assets/esri/core/workers/chunks/e2b034c391c603f7f825.js +0 -1
  344. package/assets/esri/core/workers/chunks/e3a73d9acebccd3ba49b.js +0 -1
  345. package/assets/esri/core/workers/chunks/e67bdd8bf38ebe89a344.js +0 -1
  346. package/assets/esri/core/workers/chunks/e797d45eba0884dc7e6f.js +0 -1
  347. package/assets/esri/core/workers/chunks/e81a3da05fcff97b4752.js +0 -1
  348. package/assets/esri/core/workers/chunks/e9dd60d0220036545ebb.js +0 -1
  349. package/assets/esri/core/workers/chunks/ea6d3b7c7d720aa7bc94.js +0 -1
  350. package/assets/esri/core/workers/chunks/eb9982bc866976fef960.js +0 -1
  351. package/assets/esri/core/workers/chunks/ec4669a0edeca94710e0.js +0 -1
  352. package/assets/esri/core/workers/chunks/ef9d74f8d5a502fda809.js +0 -1
  353. package/assets/esri/core/workers/chunks/f09446b9ff937a84d6d3.js +0 -1
  354. package/assets/esri/core/workers/chunks/f0bc5e8e44d53b73d431.js +0 -1
  355. package/assets/esri/core/workers/chunks/f653970d983f17fb764b.js +0 -1
  356. package/assets/esri/core/workers/chunks/f9edc685099f51363f41.js +0 -1
  357. package/assets/esri/core/workers/chunks/fa687ba2d66fcc2501da.js +0 -1
  358. package/assets/esri/core/workers/chunks/fb9a889ec9fd23739a14.js +0 -1
  359. package/assets/esri/core/workers/chunks/fe1b67ab7748a3aef231.js +0 -1
  360. package/chunks/HUDCompositing.glsl.js +0 -2
  361. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +0 -5
  362. package/views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js +0 -8
  363. package/views/3d/webgl-engine/effects/fboFormatUtils.js +0 -2
  364. package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +0 -2
  365. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as i,createLabelVVEvaluator as s}from"./labelingUtils.js";import{ExceedsLimitCache as a}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e,this._cache=new a}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r);return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return o(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:this.layer.returnZ,returnM:this.layer.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,postQueryFilter:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const{fields:i,geometryType:s,orderBy:a,objectIdField:o,renderer:n,labelingInfo:u,labelsVisible:d}=this.layer,p={featureReduction:null,labelingInfoSource:this.layer.id,fields:i.map(e=>e.toJSON()),geometryType:s,labelingInfo:u,labelsVisible:d,objectIdField:o,orderBy:a??"default",renderer:n?.clone()};return l(e,r,p,t)}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const s=this.layer,{capabilities:a,editingInfo:o,objectIdField:l,globalIdField:n,datesInUnknownTimezone:u,dateFieldsTimeZone:d,orderBy:p,parsedUrl:c,hasZ:y,hasM:m}=s,h=s.fieldsIndex.toJSON(),f=t(s),g=s.timeInfo?.toJSON(),b=s.spatialReference.toJSON(),F=e(c);let I=l;if(p?.length){const e=!p[0].valueExpression&&p[0].field;e&&(I=e)}const S=r(F.path),R=i.spatialReference.toJSON();return{type:"feature-service",source:F,isSourceHosted:S,orderByFields:I,outSpatialReference:R,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:d,globalIdField:n,fieldsIndex:h,geometryType:f,hasZ:y??!1,hasM:m??!1,featureIdInfo:{type:"object-id",fieldName:l},timeInfo:g,spatialReference:b,outSpatialReference:R,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:o?.lastEditDate?.getTime()}}}}export{u as CatalogFootprintLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as i,createLabelVVEvaluator as s}from"./labelingUtils.js";import{ExceedsLimitCache as a}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e,this._cache=new a}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r);return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return o(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,postQueryFilter:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const{fields:i,geometryType:s,orderBy:a,objectIdField:o,renderer:n,labelingInfo:u,labelsVisible:d}=this.layer,p={featureReduction:null,labelingInfoSource:this.layer.id,fields:i.map(e=>e.toJSON()),geometryType:s,labelingInfo:u,labelsVisible:d,objectIdField:o,orderBy:a??"default",renderer:n?.clone()};return l(e,r,p,t)}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const s=this.layer,{capabilities:a,editingInfo:o,objectIdField:l,globalIdField:n,datesInUnknownTimezone:u,dateFieldsTimeZone:d,orderBy:p,parsedUrl:c,hasZ:y,hasM:m}=s,f=s.fieldsIndex.toJSON(),h=t(s),g=s.timeInfo?.toJSON(),b=s.spatialReference.toJSON(),F=e(c);let I=l;if(p?.length){const e=!p[0].valueExpression&&p[0].field;e&&(I=e)}const S=r(F.path),R=i.spatialReference.toJSON();return{type:"feature-service",source:F,isSourceHosted:S,orderByFields:I,outSpatialReference:R,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:d,globalIdField:n,fieldsIndex:f,geometryType:h,hasZ:y??!1,hasM:m??!1,featureIdInfo:{type:"object-id",fieldName:l},timeInfo:g,spatialReference:b,outSpatialReference:R,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:o?.lastEditDate?.getTime()}}}}export{u as CatalogFootprintLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{canConvertSqlRelativeTime as i,sqlRelativeTimeToAbsolute as s}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as a}from"../../../../../networks/support/networkFieldUtils.js";import{getEffectiveFeatureReduction as o}from"./featureReductionUtils.js";import{createFeatureIdInfo as l}from"./featureServiceUtils.js";import{addFloorFilter as n,hasFloorFilter as y}from"./floorFilterUtils.js";import{getServiceGeometryType as d}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as p,getLayerDeconflictionEnabled as u,createLabelVVEvaluator as c}from"./labelingUtils.js";import{ExceedsLimitCache as m}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as h,createFeatureSourceSchema as f}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as g}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as b}from"../support/rendererUtils.js";class F{constructor(e){this.layer=e,this._cache=new m}getLabelingDeconflictionInfo(e){const r=this.layer,t=p(r,e)??u(r),i=o(r,e),s=[...r.labelingInfo||[],...i?.labelingInfo||[]];return[{vvEvaluators:{0:c(r.renderer)},deconflictionEnabled:t,labelingInfo:s}]}async createSourceSchema(e,t){const a=this._createServiceInfo(e),o=null!=this.layer.editingInfo?.lastEditDate,l=this.layer.refreshInterval>0,n=!o&&l,y=h(a.isSourceHosted,n,this.layer.capabilities,a.metadata.geometryType,e.extent,this.layer.fullExtent),d=null!=this.layer.subtypeCode?`${this.layer.subtypeField} = ${this.layer.subtypeCode}`:null,p=r(this.layer.definitionExpression,d),u=i(p)?await s(this.layer.fieldsIndex,p,this.layer.capabilities.query.relativeTimeBinWindow):p,c=p!==u?{where:p}:null,{returnZ:m,returnM:g,gdbVersion:b,apiKey:F,historicMoment:I,timeExtent:S,customParameters:O,displayFilterInfo:x}=this.layer;return f(a,y,{definitionExpression:u,postQueryFilter:c,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:x,customParameters:O,gdbVersion:b,historicMoment:I,timeExtent:S,apiKey:F,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache,returnZ:m,returnM:g})}createProcessorSchema(e,r,t){const{fields:i,renderer:s,geometryType:a,labelingInfo:l,labelsVisible:n,orderBy:y,objectIdField:d,trackInfo:p,symbolLayerDrawing:u}=this.layer,c={fields:i.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:o(this.layer,r),geometryType:a,labelingInfo:l,labelsVisible:n,objectIdField:d,orderBy:y??"default",trackInfo:p,symbolLayerDrawing:u};return g(e,r,c,t)}get hasRequiredSupport(){return b(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return n(this.layer,e,r)}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>o(this.layer,e),()=>y(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.subtypeCode,()=>this.layer.trackInfo,()=>this.layer.symbolLayerDrawing?.drawOrder,()=>this.layer.symbolLayerDrawing?.enabled,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&a(e,this.layer)]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:s,editingInfo:a,typeIdField:o,globalIdField:n,datesInUnknownTimezone:y,dateFieldsTimeZone:p,orderBy:u,subtypeField:c}=i,m=i.fieldsIndex.toJSON(),h=d(i),{hasZ:f,hasM:g}=i,b=i.timeInfo?.toJSON(),F=i.spatialReference.toJSON(),I=i.types?.map(e=>e.toJSON()),S=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(S.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let O=this.layer.objectIdField;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(O=e)}const x=t(S.path),R=r.spatialReference.toJSON();return{type:"feature-service",source:S,isSourceHosted:x,orderByFields:O,outSpatialReference:R,metadata:{typeIdField:o??void 0,types:I,timeReferenceUnknownClient:y,dateFieldsTimeZone:p,subtypeField:c,globalIdField:n,fieldsIndex:m,geometryType:h,hasZ:f,hasM:g,featureIdInfo:l(i),timeInfo:b,spatialReference:F,outSpatialReference:R,subtypes:this.layer.subtypes?.map(e=>e.toJSON())},queryMetadata:{maxRecordCount:s.query.maxRecordCount,tileMaxRecordCount:s.query.tileMaxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,lastEditDate:a?.lastEditDate?.getTime()}}}}export{F as FeatureLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{canConvertSqlRelativeTime as i,sqlRelativeTimeToAbsolute as s}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as a}from"../../../../../networks/support/networkFieldUtils.js";import{getEffectiveFeatureReduction as o}from"./featureReductionUtils.js";import{createFeatureIdInfo as l}from"./featureServiceUtils.js";import{addFloorFilter as n,hasFloorFilter as y}from"./floorFilterUtils.js";import{getServiceGeometryType as d}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as p,getLayerDeconflictionEnabled as u,createLabelVVEvaluator as c}from"./labelingUtils.js";import{ExceedsLimitCache as m}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as h,createFeatureSourceSchema as f}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as g}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as b}from"../support/rendererUtils.js";class F{constructor(e){this.layer=e,this._cache=new m}getLabelingDeconflictionInfo(e){const r=this.layer,t=p(r,e)??u(r),i=o(r,e),s=[...r.labelingInfo||[],...i?.labelingInfo||[]];return[{vvEvaluators:{0:c(r.renderer)},deconflictionEnabled:t,labelingInfo:s}]}async createSourceSchema(e,t){const a=this._createServiceInfo(e),o=null!=this.layer.editingInfo?.lastEditDate,l=this.layer.refreshInterval>0,n=!o&&l,y=h(a.isSourceHosted,n,this.layer.capabilities,a.metadata.geometryType,e.extent,this.layer.fullExtent),d=null!=this.layer.subtypeCode?`${this.layer.subtypeField} = ${this.layer.subtypeCode}`:null,p=r(this.layer.definitionExpression,d),u=i(p)?await s(this.layer.fieldsIndex,p,this.layer.capabilities.query.relativeTimeBinWindow):p,c=p!==u?{where:p}:null,{gdbVersion:m,apiKey:g,historicMoment:b,timeExtent:F,customParameters:I,displayFilterInfo:S}=this.layer;return f(a,y,{definitionExpression:u,returnZ:e.returnZ,returnM:e.returnM,postQueryFilter:c,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:S,customParameters:I,gdbVersion:m,historicMoment:b,timeExtent:F,apiKey:g,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const{fields:i,renderer:s,geometryType:a,labelingInfo:l,labelsVisible:n,orderBy:y,objectIdField:d,trackInfo:p,symbolLayerDrawing:u}=this.layer,c={fields:i.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:o(this.layer,r),geometryType:a,labelingInfo:l,labelsVisible:n,objectIdField:d,orderBy:y??"default",trackInfo:p,symbolLayerDrawing:u};return g(e,r,c,t)}get hasRequiredSupport(){return b(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return n(this.layer,e,r)}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>o(this.layer,e),()=>y(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.subtypeCode,()=>this.layer.trackInfo,()=>this.layer.symbolLayerDrawing?.drawOrder,()=>this.layer.symbolLayerDrawing?.enabled,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&a(e,this.layer)]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:s,editingInfo:a,typeIdField:o,globalIdField:n,datesInUnknownTimezone:y,dateFieldsTimeZone:p,orderBy:u,subtypeField:c}=i,m=i.fieldsIndex.toJSON(),h=d(i),{hasZ:f,hasM:g}=i,b=i.timeInfo?.toJSON(),F=i.spatialReference.toJSON(),I=i.types?.map(e=>e.toJSON()),S=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(S.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let O=this.layer.objectIdField;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(O=e)}const x=t(S.path),R=r.spatialReference.toJSON();return{type:"feature-service",source:S,isSourceHosted:x,orderByFields:O,outSpatialReference:R,metadata:{typeIdField:o??void 0,types:I,timeReferenceUnknownClient:y,dateFieldsTimeZone:p,subtypeField:c,globalIdField:n,fieldsIndex:m,geometryType:h,hasZ:f,hasM:g,featureIdInfo:l(i),timeInfo:b,spatialReference:F,outSpatialReference:R,subtypes:this.layer.subtypes?.map(e=>e.toJSON())},queryMetadata:{maxRecordCount:s.query.maxRecordCount,tileMaxRecordCount:s.query.tileMaxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,lastEditDate:a?.lastEditDate?.getTime()}}}}export{F as FeatureLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../../core/Error.js";import{hasTimeOptions as r}from"../../../../../layers/support/timeSupport.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as n,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as o}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as p}from"../support/rendererUtils.js";function c(r){if(!("openPorts"in r))throw new e("featurelayer:source-not-supported","source is not supported")}class d{constructor(e){this.layer=e,this._cache=new s}openMessagePorts(){return c(this.layer.source),this.layer.source.openPorts()}getLabelingDeconflictionInfo(e){const r=this.layer,i=n(r,e)??a(r),s=t(r,e),l=[...r.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:i,labelingInfo:l}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return l(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:"returnZ"in this.layer&&this.layer.returnZ,returnM:"returnM"in this.layer&&this.layer.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:"timeExtent"in this.layer?this.layer.timeExtent:null,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:n,renderer:a,geometryType:o,labelingInfo:s,labelsVisible:l,orderBy:p,objectIdField:c}=this.layer,d="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:n.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:o,labelingInfo:s,labelsVisible:l,objectIdField:c,orderBy:p??"default",trackInfo:d};return u(e,r,y,i)}get hasRequiredSupport(){return p(this.layer.renderer)}get timeOptions(){return r(this.layer)?this.layer:null}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){"trackGraphicOrigin"in this.layer&&(e.origin=this.layer.trackGraphicOrigin)}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:n}=r,a=r.fieldsIndex.toJSON(),o=i(r),s="timeInfo"in r?r.timeInfo?.toJSON():null,l=r.spatialReference.toJSON();c(r.source);const u=n,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:u,outSpatialReference:p,metadata:{fieldsIndex:a,geometryType:o,hasZ:"hasZ"in r&&r.hasZ,hasM:"hasM"in r&&r.hasM,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},timeInfo:s,spatialReference:l,outSpatialReference:p,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in r?r.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in r?r.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{d as InMemoryLayerAdapter};
2
+ import e from"../../../../../core/Error.js";import{hasTimeOptions as r}from"../../../../../layers/support/timeSupport.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as n,getLayerDeconflictionEnabled as o,createLabelVVEvaluator as a}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as p}from"../support/rendererUtils.js";function c(r){if(!("openPorts"in r))throw new e("featurelayer:source-not-supported","source is not supported")}class d{constructor(e){this.layer=e,this._cache=new s}openMessagePorts(){return c(this.layer.source),this.layer.source.openPorts()}getLabelingDeconflictionInfo(e){const r=this.layer,i=n(r,e)??o(r),s=t(r,e),l=[...r.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:a(r.renderer)},deconflictionEnabled:i,labelingInfo:l}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return l(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:"timeExtent"in this.layer?this.layer.timeExtent:null,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:n,renderer:o,geometryType:a,labelingInfo:s,labelsVisible:l,orderBy:p,objectIdField:c}=this.layer,d="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:n.map(e=>e.toJSON()),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:a,labelingInfo:s,labelsVisible:l,objectIdField:c,orderBy:p??"default",trackInfo:d};return u(e,r,y,i)}get hasRequiredSupport(){return p(this.layer.renderer)}get timeOptions(){return r(this.layer)?this.layer:null}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){"trackGraphicOrigin"in this.layer&&(e.origin=this.layer.trackGraphicOrigin)}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:n}=r,o=r.fieldsIndex.toJSON(),a=i(r),s="timeInfo"in r?r.timeInfo?.toJSON():null,l=r.spatialReference.toJSON();c(r.source);const u=n,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:u,outSpatialReference:p,metadata:{fieldsIndex:o,geometryType:a,hasZ:"hasZ"in r&&r.hasZ,hasM:"hasM"in r&&r.hasM,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},timeInfo:s,spatialReference:l,outSpatialReference:p,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in r?r.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in r?r.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{d as InMemoryLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{sqlAnd as e}from"../../../../../core/sql.js";import{systemIsSpatialFieldName as r}from"../../../../../layers/knowledgeGraph/constants.js";import t from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveFeatureReduction as i}from"./featureReductionUtils.js";import{getServiceGeometryType as a}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as s,getLayerDeconflictionEnabled as o,createLabelVVEvaluator as l}from"./labelingUtils.js";import{ExceedsLimitCache as n}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as p}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e,this._cache=new n}getLabelingDeconflictionInfo(e){const r=this.layer,t=s(r,e)??o(r);return[{vvEvaluators:{0:l(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return u(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:null,returnM:null,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:null,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,t){const{fields:a,renderer:s,geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:u}=this.layer,c={fields:a.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:i(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:u,orderBy:"default"};return p(e,r,c,t)}get hasRequiredSupport(){return c(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>i(this.layer,e),()=>y(this.layer)]}hasFilters(e){return y(this.layer)}addFilters(i,a){if(y(this.layer)){const a=e(i?.where,`${r}=1`);if(!a)return i;i??=new t,i.where=a}return i}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}openMessagePorts(){return this.layer.source.openPorts()}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:i}=r,s=r.fieldsIndex.toJSON(),o=a(r),l=r.spatialReference.toJSON(),n=i,u=e.spatialReference.toJSON();return{type:"memory",orderByFields:n,outSpatialReference:u,metadata:{fieldsIndex:s,geometryType:o,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},spatialReference:l,outSpatialReference:u,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:r.timeInfo?.toJSON(),timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}function y(e){return"link-chart"===e.parentCompositeLayer.type&&"hidden"===e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode}export{d as KnowledgeGraphSublayerAdapter};
2
+ import{sqlAnd as e}from"../../../../../core/sql.js";import{systemIsSpatialFieldName as r}from"../../../../../layers/knowledgeGraph/constants.js";import t from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveFeatureReduction as i}from"./featureReductionUtils.js";import{getServiceGeometryType as a}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as s,getLayerDeconflictionEnabled as o,createLabelVVEvaluator as n}from"./labelingUtils.js";import{ExceedsLimitCache as l}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as p}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e,this._cache=new l}getLabelingDeconflictionInfo(e){const r=this.layer,t=s(r,e)??o(r);return[{vvEvaluators:{0:n(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return u(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:null,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,t){const{fields:a,renderer:s,geometryType:o,labelingInfo:n,labelsVisible:l,objectIdField:u}=this.layer,c={fields:a.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:i(this.layer,r),geometryType:o,labelingInfo:n,labelsVisible:l,objectIdField:u,orderBy:"default"};return p(e,r,c,t)}get hasRequiredSupport(){return c(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>i(this.layer,e),()=>y(this.layer)]}hasFilters(e){return y(this.layer)}addFilters(i,a){if(y(this.layer)){const a=e(i?.where,`${r}=1`);if(!a)return i;i??=new t,i.where=a}return i}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}openMessagePorts(){return this.layer.source.openPorts()}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:i}=r,s=r.fieldsIndex.toJSON(),o=a(r),n=r.spatialReference.toJSON(),l=i,u=e.spatialReference.toJSON();return{type:"memory",orderByFields:l,outSpatialReference:u,metadata:{fieldsIndex:s,geometryType:o,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},spatialReference:n,outSpatialReference:u,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:r.timeInfo?.toJSON(),timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}function y(e){return"link-chart"===e.parentCompositeLayer.type&&"hidden"===e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode}export{d as KnowledgeGraphSublayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as o}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as u}from"../support/rendererUtils.js";class c{constructor(e){this.layer=e,this._cache=new s}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??a(r);return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:t,labelingInfo:r.labelingInfo}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return l(t,null,{definitionExpression:null,returnZ:null,returnM:!1,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,t,i){const{fields:a,renderer:o,geometryType:s,labelingInfo:l,labelsVisible:u,orderBy:c,objectIdField:p}=this.layer,d={fields:a.map(e=>e.toJSON()),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:r(this.layer,t),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:p,orderBy:c??"default"};return n(e,t,d,i)}get hasRequiredSupport(){return u(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>r(this.layer,e),()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.renderer]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:a}=i,o=i.fieldsIndex.toJSON(),s=t(i),l=i.timeInfo?.toJSON(),n=i.spatialReference.toJSON(),u=i.source.getSource(),c=this.layer.objectIdField,p=e(a);p.query.maxRecordCount=u.maxRecordCount;const d=r.spatialReference.toJSON();return{type:"ogc",source:u,orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:o,geometryType:s,hasZ:this.layer.hasZ??!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:l,spatialReference:n,outSpatialReference:d,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:p.query.maxRecordCount,tileMaxRecordCount:p.query.tileMaxRecordCount,supportsCompactGeometry:p.query.supportsCompactGeometry,supportsDefaultSpatialReference:p.query.supportsDefaultSpatialReference,supportsFormatPBF:p.query.supportsFormatPBF,supportsMaxRecordCountFactor:p.query.supportsMaxRecordCountFactor,supportsQuantization:p.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:p.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:p.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{c as OGCFeatureLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as o}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as u}from"../support/rendererUtils.js";class c{constructor(e){this.layer=e,this._cache=new s}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??a(r);return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:t,labelingInfo:r.labelingInfo}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return l(t,null,{definitionExpression:null,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,t,i){const{fields:a,renderer:o,geometryType:s,labelingInfo:l,labelsVisible:u,orderBy:c,objectIdField:p}=this.layer,d={fields:a.map(e=>e.toJSON()),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:r(this.layer,t),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:p,orderBy:c??"default"};return n(e,t,d,i)}get hasRequiredSupport(){return u(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>r(this.layer,e),()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.renderer]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:a}=i,o=i.fieldsIndex.toJSON(),s=t(i),l=i.timeInfo?.toJSON(),n=i.spatialReference.toJSON(),u=i.source.getSource(),c=this.layer.objectIdField,p=e(a);p.query.maxRecordCount=u.maxRecordCount;const d=r.spatialReference.toJSON();return{type:"ogc",source:u,orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:o,geometryType:s,hasZ:this.layer.hasZ??!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:l,spatialReference:n,outSpatialReference:d,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:p.query.maxRecordCount,tileMaxRecordCount:p.query.tileMaxRecordCount,supportsCompactGeometry:p.query.supportsCompactGeometry,supportsDefaultSpatialReference:p.query.supportsDefaultSpatialReference,supportsFormatPBF:p.query.supportsFormatPBF,supportsMaxRecordCountFactor:p.query.supportsMaxRecordCountFactor,supportsQuantization:p.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:p.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:p.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{c as OGCFeatureLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{addFloorFilter as i,hasFloorFilter as a}from"./floorFilterUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as n}from"./labelingUtils.js";import{ExceedsLimitCache as d}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as c}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as y}from"../support/rendererUtils.js";class h{constructor(e){this.layer=e,this._cache=new d}getLabelingDeconflictionInfo(e){const r=this.layer,t=o(r,e)??l(r);return[{vvEvaluators:{0:n(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=null!=this.layer.editingInfo?.lastEditDate,a=this.layer.refreshInterval>0,s=!i&&a,o=p(t.isSourceHosted,s,this.layer.capabilities,t.metadata.geometryType,e.extent,this.layer.fullExtent);return u(t,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],returnZ:this.layer.returnZ,returnM:this.layer.returnM,displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:a,renderer:s,geometryType:o,labelingInfo:l,labelsVisible:n,orderBy:d,objectIdField:p}=this.layer,u={fields:a.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:d??"default"};return c(e,r,u,i)}get hasRequiredSupport(){return y(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return i(this.layer,e,r)}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.orderBy,()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>a(this.layer,e)?e.floors:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(t){const i=this.layer,{capabilities:a,globalIdField:o,orderBy:l}=i,n=i.fieldsIndex.toJSON(),d=s(i),p=i.timeInfo?.toJSON(),u=i.spatialReference.toJSON(),c=e(this.layer.parsedUrl);let y=this.layer.objectIdField;if(l?.length){const e=!l[0].valueExpression&&l[0].field;e&&(y=e)}const h=r(c.path),m=t.spatialReference.toJSON();return{type:"feature-service",source:c,isSourceHosted:h,orderByFields:y,outSpatialReference:m,metadata:{globalIdField:o,fieldsIndex:n,geometryType:d,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:p,spatialReference:u,outSpatialReference:m,timeReferenceUnknownClient:i.datesInUnknownTimezone,dateFieldsTimeZone:i.dateFieldsTimeZone,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{h as OrientedImageryLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{addFloorFilter as i,hasFloorFilter as a}from"./floorFilterUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as n}from"./labelingUtils.js";import{ExceedsLimitCache as d}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as c}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as y}from"../support/rendererUtils.js";class h{constructor(e){this.layer=e,this._cache=new d}getLabelingDeconflictionInfo(e){const r=this.layer,t=o(r,e)??l(r);return[{vvEvaluators:{0:n(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=null!=this.layer.editingInfo?.lastEditDate,a=this.layer.refreshInterval>0,s=!i&&a,o=p(t.isSourceHosted,s,this.layer.capabilities,t.metadata.geometryType,e.extent,this.layer.fullExtent);return u(t,o,{definitionExpression:this.layer.definitionExpression,returnZ:e.returnZ,returnM:e.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:a,renderer:s,geometryType:o,labelingInfo:l,labelsVisible:n,orderBy:d,objectIdField:p}=this.layer,u={fields:a.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:d??"default"};return c(e,r,u,i)}get hasRequiredSupport(){return y(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return i(this.layer,e,r)}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.orderBy,()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>a(this.layer,e)?e.floors:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(t){const i=this.layer,{capabilities:a,globalIdField:o,orderBy:l}=i,n=i.fieldsIndex.toJSON(),d=s(i),p=i.timeInfo?.toJSON(),u=i.spatialReference.toJSON(),c=e(this.layer.parsedUrl);let y=this.layer.objectIdField;if(l?.length){const e=!l[0].valueExpression&&l[0].field;e&&(y=e)}const h=r(c.path),m=t.spatialReference.toJSON();return{type:"feature-service",source:c,isSourceHosted:h,orderByFields:y,outSpatialReference:m,metadata:{globalIdField:o,fieldsIndex:n,geometryType:d,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:p,spatialReference:u,outSpatialReference:m,timeReferenceUnknownClient:i.datesInUnknownTimezone,dateFieldsTimeZone:i.dateFieldsTimeZone,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{h as OrientedImageryLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as r}from"../../../../../core/mathUtils.js";import{sqlAnd as t}from"../../../../../core/sql.js";import{isHostedAgolService as i}from"../../../../../layers/support/arcgisLayerUrl.js";import s from"../../../../../layers/support/FeatureFilter.js";import{canConvertSqlRelativeTime as a,sqlRelativeTimeToAbsolute as l}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as o}from"../../../../../networks/support/networkFieldUtils.js";import{createFeatureIdInfo as n}from"./featureServiceUtils.js";import{addFloorFilter as u,hasFloorFilter as y}from"./floorFilterUtils.js";import{getServiceGeometryType as p}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as c}from"./labelingUtils.js";import{ExceedsLimitCache as d}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as m,createFeatureSourceSchema as h}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as f}from"../schema/processor/SubtypeProcessorSchema.js";class b{constructor(e){this.layer=e,this._cache=new d}getLabelingDeconflictionInfo(e){const r=this.layer;return[{vvEvaluators:{},deconflictionEnabled:r.sublayers.some(e=>c(e)),labelingInfo:r.sublayers.toArray().filter(e=>!!e.labelingInfo).flatMap(e=>e.labelingInfo)}]}async createSourceSchema(e,r){const{definitionExpression:t,customParameters:i,gdbVersion:s,historicMoment:o,timeExtent:n,apiKey:u,displayFilterInfo:y}=this.layer,p=this._createServiceInfo(e),c=null!=this.layer.editingInfo?.lastEditDate,d=this.layer.refreshInterval>0,f=!c&&d,b=m(p.isSourceHosted,f,this.layer.capabilities,p.metadata.geometryType,e.extent,this.layer.fullExtent),g=a(t)?await l(this.layer.fieldsIndex,t,this.layer.capabilities.query.relativeTimeBinWindow):t,S=t!==g?{where:t}:null;return h(p,b,{definitionExpression:g,returnZ:this.layer.returnZ,returnM:this.layer.returnM,postQueryFilter:S,queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:y,customParameters:i,gdbVersion:s,historicMoment:o,timeExtent:n,apiKey:u,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const i={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,r)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${r}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return f(e,r,i,t)}addFilters(e,r){e=u(this.layer,e,r);const i=this.layer.sublayers.filter(e=>!g(e,r)).map(e=>e.subtypeCode);if(!i.length)return e;e??=new s;const a=`NOT ${this.layer.subtypeField} IN (${i.join(",")})`;return e.where=t(e.where,a),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>y(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&o(e,this.layer),()=>this.layer.sublayers.map(({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:s,maxScale:a})=>({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:s,maxScale:a}))]}setGraphicOrigin(e){const r=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=r,e.origin=r?.graphicOrigin}_createServiceInfo(r){const{capabilities:t,datesInUnknownTimezone:s,dateFieldsTimeZone:a,editingInfo:l,globalIdField:o,objectIdField:u,subtypeField:y}=this.layer,c=this.layer.fieldsIndex.toJSON(),d=p(this.layer),m=this.layer.timeInfo?.toJSON(),h=this.layer.spatialReference.toJSON(),f=e(this.layer.parsedUrl),b=u,g=i(f.path),S=r.spatialReference.toJSON();return{type:"feature-service",source:f,isSourceHosted:g,orderByFields:b,outSpatialReference:S,metadata:{timeReferenceUnknownClient:s,dateFieldsTimeZone:a,subtypeField:y,globalIdField:o,fieldsIndex:c,geometryType:d,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:n(this.layer),timeInfo:m,spatialReference:h,outSpatialReference:S,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:l?.lastEditDate?.getTime()}}}}function g(e,t){return e.visible&&(0===e.minScale||r(t.scale,e.minScale)||t.scale<e.minScale)&&(0===e.maxScale||r(t.scale,e.maxScale)||t.scale>e.maxScale)}export{b as SubtypeGroupLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as r}from"../../../../../core/mathUtils.js";import{sqlAnd as t}from"../../../../../core/sql.js";import{isHostedAgolService as i}from"../../../../../layers/support/arcgisLayerUrl.js";import s from"../../../../../layers/support/FeatureFilter.js";import{canConvertSqlRelativeTime as a,sqlRelativeTimeToAbsolute as l}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getUtilityNetworkFields as o}from"../../../../../networks/support/networkFieldUtils.js";import{createFeatureIdInfo as n}from"./featureServiceUtils.js";import{addFloorFilter as u,hasFloorFilter as y}from"./floorFilterUtils.js";import{getServiceGeometryType as p}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as c}from"./labelingUtils.js";import{ExceedsLimitCache as d}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as m,createFeatureSourceSchema as h}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as f}from"../schema/processor/SubtypeProcessorSchema.js";class b{constructor(e){this.layer=e,this._cache=new d}getLabelingDeconflictionInfo(e){const r=this.layer;return[{vvEvaluators:{},deconflictionEnabled:r.sublayers.some(e=>c(e)),labelingInfo:r.sublayers.toArray().filter(e=>!!e.labelingInfo).flatMap(e=>e.labelingInfo)}]}async createSourceSchema(e,r){const{definitionExpression:t,customParameters:i,gdbVersion:s,historicMoment:o,timeExtent:n,apiKey:u,displayFilterInfo:y}=this.layer,p=this._createServiceInfo(e),c=null!=this.layer.editingInfo?.lastEditDate,d=this.layer.refreshInterval>0,f=!c&&d,b=m(p.isSourceHosted,f,this.layer.capabilities,p.metadata.geometryType,e.extent,this.layer.fullExtent),g=a(t)?await l(this.layer.fieldsIndex,t,this.layer.capabilities.query.relativeTimeBinWindow):t,S=t!==g?{where:t}:null;return h(p,b,{definitionExpression:g,returnZ:e.returnZ,returnM:e.returnM,postQueryFilter:S,queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:y,customParameters:i,gdbVersion:s,historicMoment:o,timeExtent:n,apiKey:u,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const i={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,r)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${r}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return f(e,r,i,t)}addFilters(e,r){e=u(this.layer,e,r);const i=this.layer.sublayers.filter(e=>!g(e,r)).map(e=>e.subtypeCode);if(!i.length)return e;e??=new s;const a=`NOT ${this.layer.subtypeField} IN (${i.join(",")})`;return e.where=t(e.where,a),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>y(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>e?.requiredFieldsOptions?.featureTitleFields&&this.layer.featureTitleFields,()=>e?.requiredFieldsOptions?.utilityNetworkFields&&o(e,this.layer),()=>this.layer.sublayers.map(({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:s,maxScale:a})=>({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:s,maxScale:a}))]}setGraphicOrigin(e){const r=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=r,e.origin=r?.graphicOrigin}_createServiceInfo(r){const{capabilities:t,datesInUnknownTimezone:s,dateFieldsTimeZone:a,editingInfo:l,globalIdField:o,objectIdField:u,subtypeField:y}=this.layer,c=this.layer.fieldsIndex.toJSON(),d=p(this.layer),m=this.layer.timeInfo?.toJSON(),h=this.layer.spatialReference.toJSON(),f=e(this.layer.parsedUrl),b=u,g=i(f.path),S=r.spatialReference.toJSON();return{type:"feature-service",source:f,isSourceHosted:g,orderByFields:b,outSpatialReference:S,metadata:{timeReferenceUnknownClient:s,dateFieldsTimeZone:a,subtypeField:y,globalIdField:o,fieldsIndex:c,geometryType:d,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:n(this.layer),timeInfo:m,spatialReference:h,outSpatialReference:S,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:l?.lastEditDate?.getTime()}}}}function g(e,t){return e.visible&&(0===e.minScale||r(t.scale,e.minScale)||t.scale<e.minScale)&&(0===e.maxScale||r(t.scale,e.maxScale)||t.scale>e.maxScale)}export{b as SubtypeGroupLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- 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,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],I=x[3],A=has("featurelayer-simplify-payload-size-factors")??[1,2,4],S=A[0],B=A[1],j=A[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._postQueryFilteredIds=new Set,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=S*s:t>1e5&&(r=s);let i=0;return e>4e3?i=I*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 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(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=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))}applyPostQueryFilter(e){if(this._postQueryFilteredIds.clear(),!e)return;const t=this.getCursor();for(;t.next();){e.check(t,{currentUser:null})||this._postQueryFilteredIds.add(t.getObjectId())}}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}return!this._postQueryFilteredIds.has(this.getObjectId())}_computeDisplayCentroid(e){if(null==this.getInTransform())return h(e);const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=n(t);return r?isNaN(r[0])||isNaN(r[1])?h(e):(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,e._postQueryFilteredIds=this._postQueryFilteredIds}_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};
2
+ 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],I=x[3],A=has("featurelayer-simplify-payload-size-factors")??[1,2,4],S=A[0],B=A[1],j=A[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._postQueryFilteredIds=new Set,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=S*s:t>1e5&&(r=s);let i=0;return e>4e3?i=I*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);if("esriGeometryPoint"===this.geometryType||!t)return t;const r=this.getInTransform();if(!t||!r)return t;const s=r.scale[2]??1,i=r.translate[2]??0,o=r.scale[3]??1,a=r.translate[3]??0,{hasZ:n,hasM:d,stride:u,size:c,coords:h}=t,l=n&&(1!==s||0!==i),m=d&&(1!==o||0!==a);if(l||m){const e=2,t=n?3:2;for(let r=0,n=u*c;r<n;r+=u)l&&(h[r+e]=s*h[r+e]+i),m&&(h[r+t]=o*h[r+t]+a)}return t.deltaDecode()}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))}applyPostQueryFilter(e){if(this._postQueryFilteredIds.clear(),!e)return;const t=this.getCursor();for(;t.next();){e.check(t,{currentUser:null})||this._postQueryFilteredIds.add(t.getObjectId())}}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}return!this._postQueryFilteredIds.has(this.getObjectId())}_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?isNaN(r[0])||isNaN(r[1])?c(e):(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,e._postQueryFilteredIds=this._postQueryFilteredIds}_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};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{baseObjectMemory as r}from"../../../../../core/memoryEstimations.js";import s from"../../../../../core/pbf.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as n}from"./FeatureSetCache.js";import{FeatureSetReader as i}from"./FeatureSetReader.js";import{parseHeader as h}from"./FeatureSetReaderPBFHeader.js";const o=268435455,d=128,u=128e3,c={small:{delta:new Int32Array(d),decoded:new Int32Array(d)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(u),decoded:new Int32Array(u)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function l(e,t){return t?e<=c.small64.delta.length?c.small64:(e<=c.large64.delta.length||(c.large64.delta=new Float64Array(Math.round(1.25*e)),c.large64.decoded=new Float64Array(Math.round(1.25*e))),c.large64):e<=c.small.delta.length?c.small:(e<=c.large.delta.length||(c.large.delta=new Int32Array(Math.round(1.25*e)),c.large.decoded=new Int32Array(Math.round(1.25*e))),c.large)}function _(t){try{const e=new s(new Uint8Array(t),new DataView(t));for(;e.next();){if(2===e.tag())return g(e.getMessage());e.skip()}}catch(r){throw new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:r})}return null}function g(e){for(;e.next();){if(1===e.tag())return e.getMessage();e.skip()}return null}function f(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}function y(e,t,r,s,a){if(!e)return!1;return 0===t*a-s*r&&t*s+r*a>0}class m extends i{static fromBuffer(e,t,r=!1){const s=t.geometryType,a=_(e),n=h(a,"esriGeometryPoint"===s,t.featureIdInfo);return new m(a,n,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 this._header.hasZ}get hasM(){return this._header.hasM}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 m(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 r+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[this._featureIndex*this._header.stride]}_readY(){return this._header.centroid[this._featureIndex*this._header.stride+1]}_readServerCentroid(){const e=new a([],[],this.hasZ,this.hasM),{coords:t,stride:r}=e;for(let s=this._featureIndex*r,a=s+r;s<a;++s)t.push(this._header.centroid[s]);return t[0]===o?null:e}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints)r=this._readServerCentroid();else{const s=this._header.offsets.geometry[this._featureIndex],a=this._reader;if(0===s)return null;a.move(s);try{r=e?this._parseGeometryForDisplay(a):this._parseGeometry(a)}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),a=this._header.fields.isDateField(r.name);return t?null==s?s:a?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 n(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 a=f(s);return t.set(this._featureIndex,a),a}_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=l(t.coords.length,this._use64Bit).decoded,s=t.clone(r),{lengths:a,coords:n,stride:i}=s;let h=0;for(const e of a){let t=n[h],r=n[h+1];h+=i;for(let s=1;s<e;++s)t=n[h]+=t,r=n[h+1]+=r,h+=i}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=e.asUnsafe(),r=t.getPackedEnd(),s=[],n=[];for(;t.pos()<r&&t.next();)switch(t.tag()){case 2:{const e=t.getPackedEnd();for(;t.pos()<e;)n.push(t.getUInt32());break}case 3:{const e=t.getPackedEnd();for(;t.pos()<e;)s.push(t.getSInt64());break}default:t.skip()}return new a(n,s,this.hasZ,this.hasM)}_parseGeometryForDisplay(e){const r=e.asUnsafe(),s=r.getLength(),n=r.pos()+s,i=[],h=[];let o=0,d=0,u=null,c=0;const _="esriGeometryPolygon"===this.geometryType,g="esriGeometryPolyline"===this.geometryType,f=_?3:g?2:1,m=_||g;for(;r.pos()<n&&r.next();)switch(r.tag()){case 2:{const e=r.getUInt32(),t=r.pos()+e;for(;r.pos()<t;){const e=r.getUInt32();i.push(e),o+=e}u=l(2*o,this._use64Bit).delta;break}case 3:{r.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);t(u);for(const t of i){if(d+e*t>u.length){for(let e=0;e<t;e++)r.getSInt64(),r.getSInt64(),this.hasZ&&r.getSInt64(),this.hasM&&r.getSInt64();continue}let s=r.getSInt64(),a=r.getSInt64();this.hasZ&&r.getSInt64(),this.hasM&&r.getSInt64(),u[d++]=s,u[d++]=a;let n=1;for(let e=1;e<t;e++){const e=r.getSInt64(),t=r.getSInt64();this.hasZ&&r.getSInt64(),this.hasM&&r.getSInt64();const i=s+e,h=a+t;c+=-.5*(i-s)*(h+a),s=i,a=h,0===e&&0===t||y(m,u[d-2],u[d-1],e,t)?(u[d-2]+=e,u[d-1]+=t):(u[d++]=e,u[d++]=t,n+=1)}n>=f?h.push(n):d-=n*e}break}default:r.skip()}return this._cache.area=c,h.length?new a(h,u,this.hasZ,this.hasM):null!=u?this._createDeltaQuantizedExtrudedGeometry(u[0],u[1]):null}}export{m as FeatureSetReaderPBF};
2
+ import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{baseObjectMemory as r}from"../../../../../core/memoryEstimations.js";import s from"../../../../../core/pbf.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as n}from"./FeatureSetCache.js";import{FeatureSetReader as i}from"./FeatureSetReader.js";import{parseHeader as h}from"./FeatureSetReaderPBFHeader.js";const o=268435455,d=128,u=128e3,c={small:{delta:new Int32Array(d),decoded:new Int32Array(d)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(u),decoded:new Int32Array(u)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function l(e,t){return t?e<=c.small64.delta.length?c.small64:(e<=c.large64.delta.length||(c.large64.delta=new Float64Array(Math.round(1.25*e)),c.large64.decoded=new Float64Array(Math.round(1.25*e))),c.large64):e<=c.small.delta.length?c.small:(e<=c.large.delta.length||(c.large.delta=new Int32Array(Math.round(1.25*e)),c.large.decoded=new Int32Array(Math.round(1.25*e))),c.large)}function _(t){try{const e=new s(new Uint8Array(t),new DataView(t));for(;e.next();){if(2===e.tag())return f(e.getMessage());e.skip()}}catch(r){throw new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:r})}return null}function f(e){for(;e.next();){if(1===e.tag())return e.getMessage();e.skip()}return null}function g(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}function y(e,t,r,s,a){if(!e)return!1;return 0===t*a-s*r&&t*s+r*a>0}class m extends i{static fromBuffer(e,t,r=!1){const s=t.geometryType,a=_(e),n=h(a,"esriGeometryPoint"===s,t.featureIdInfo);return new m(a,n,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 this._header.hasZ}get hasM(){return this._header.hasM}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 m(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 r+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[this._featureIndex*this._header.stride]}_readY(){return this._header.centroid[this._featureIndex*this._header.stride+1]}_readServerCentroid(){const e=new a([],[],this.hasZ,this.hasM),{coords:t,stride:r}=e;for(let s=this._featureIndex*r,a=s+r;s<a;++s)t.push(this._header.centroid[s]);return t[0]===o?null:e}_readGeometry(e=!1){if((this.hasZ||this.hasM)&&(e=!1),void 0===this._cache.geometry){let r=null;if(this._isPoints)r=this._readServerCentroid();else{const s=this._header.offsets.geometry[this._featureIndex],a=this._reader;if(0===s)return null;a.move(s);try{r=e?this._parseGeometryForDisplay(a):this._parseGeometry(a)}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),a=this._header.fields.isDateField(r.name);return t?null==s?s:a?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 n(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 a=g(s);return t.set(this._featureIndex,a),a}_readGeometryDeltaDecoded(e){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;const r=this.getInTransform();if(!r)return this._cache.unquantGeometry=t,t;const s=r.scale[2]??1,a=r.translate[2]??1,n=r.scale[3]??1,i=r.translate[3]??1,h=l(t.coords.length,this._use64Bit).decoded,o=t.clone(h);this._cache.unquantGeometry=o;const{lengths:d,coords:u,hasZ:c,hasM:_}=o,f=c&&(1!==s||0!==a),g=_&&(1!==n||0!==i);let y=0;for(const e of d){let t=u[y++],r=u[y++];if(f){const e=u[y];u[y++]=s*e+a}if(g){const e=u[y];u[y++]=n*e+i}for(let h=1;h<e;++h){if(t=u[y++]+=t,r=u[y++]+=r,f){const e=u[y];u[y++]=s*e+a}if(g){const e=u[y];u[y++]=n*e+i}}}return o}return this._cache.unquantGeometry}_parseGeometry(e){const t=e.asUnsafe(),r=t.getPackedEnd(),s=[],n=[];for(;t.pos()<r&&t.next();)switch(t.tag()){case 2:{const e=t.getPackedEnd();for(;t.pos()<e;)n.push(t.getUInt32());break}case 3:{const e=t.getPackedEnd();for(;t.pos()<e;)s.push(t.getSInt64());break}default:t.skip()}return new a(n,s,this.hasZ,this.hasM)}_parseGeometryForDisplay(e){const r=e.asUnsafe(),s=r.getLength(),n=r.pos()+s,i=[],h=[];let o=0,d=0,u=null,c=0;const _="esriGeometryPolygon"===this.geometryType,f="esriGeometryPolyline"===this.geometryType,g=_?3:f?2:1,m=_||f;for(;r.pos()<n&&r.next();)switch(r.tag()){case 2:{const e=r.getUInt32(),t=r.pos()+e;for(;r.pos()<t;){const e=r.getUInt32();i.push(e),o+=e}u=l(2*o,this._use64Bit).delta;break}case 3:{r.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);t(u);for(const t of i){if(d+e*t>u.length){for(let e=0;e<t;e++)r.getSInt64(),r.getSInt64(),this.hasZ&&r.getSInt64(),this.hasM&&r.getSInt64();continue}let s=r.getSInt64(),a=r.getSInt64();this.hasZ&&r.getSInt64(),this.hasM&&r.getSInt64(),u[d++]=s,u[d++]=a;let n=1;for(let e=1;e<t;e++){const e=r.getSInt64(),t=r.getSInt64();this.hasZ&&r.getSInt64(),this.hasM&&r.getSInt64();const i=s+e,h=a+t;c+=-.5*(i-s)*(h+a),s=i,a=h,0===e&&0===t||y(m,u[d-2],u[d-1],e,t)?(u[d-2]+=e,u[d-1]+=t):(u[d++]=e,u[d++]=t,n+=1)}n>=g?h.push(n):d-=n*e}break}default:r.skip()}return this._cache.area=c,h.length?new a(h,u):null!=u?this._createDeltaQuantizedExtrudedGeometry(u[0],u[1]):null}}export{m as FeatureSetReaderPBF};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import"../../../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,subclass as u}from"../../../core/accessorSupport/decorators.js";import{getObjectId as o}from"../../../layers/graphics/dehydratedFeatures.js";import{packFields as n}from"../../../layers/support/fieldUtils.js";import{FeatureLikeLayerViewBase3D as p}from"./FeatureLikeLayerViewBase3D.js";import{FeatureGraphics3DGraphicsPipeline as l}from"./graphics/FeatureGraphics3DGraphicsPipeline.js";import{updatingProgress as d}from"../support/updatingProperties.js";const c=c=>{const m=p(c);let h=class extends m{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 snappingComplexityExceeded(){return this.graphicsPipeline?.snappingComplexityExceeded??!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)}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}async createGraphicsPipeline(){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=o(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 u of t.features)if(u.geometry){const e=i.getHydratedGeometry(u.attributes[s]);e&&(u.geometry=e,a.push(u))}else a.push(u);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(){}};return e([a()],h.prototype,"layer",void 0),e([a()],h.prototype,"graphicsPipeline",void 0),e([a()],h.prototype,"maximumNumberOfFeatures",null),e([a()],h.prototype,"maximumNumberOfFeaturesExceeded",null),e([a(d)],h.prototype,"updatingProgress",void 0),e([a({readOnly:!0})],h.prototype,"updatingProgressValue",null),e([a({readOnly:!0})],h.prototype,"updatePolicy",null),e([a()],h.prototype,"snappingComplexityExceeded",null),e([a({readOnly:!0})],h.prototype,"hasZ",null),e([a({readOnly:!0})],h.prototype,"hasM",null),e([a()],h.prototype,"availableFieldsForQuery",null),h=e([u("esri.views.3d.layers.FeatureLikeLayerView3D")],h),h};export{c as FeatureLikeLayerView3D};
2
+ import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import"../../../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,subclass as u}from"../../../core/accessorSupport/decorators.js";import{getObjectId as o}from"../../../layers/graphics/dehydratedFeatures.js";import{packFields as n}from"../../../layers/support/fieldUtils.js";import{FeatureLikeLayerViewBase3D as p}from"./FeatureLikeLayerViewBase3D.js";import{FeatureGraphics3DGraphicsPipeline as l}from"./graphics/FeatureGraphics3DGraphicsPipeline.js";import{updatingProgress as d}from"../support/updatingProperties.js";const m=m=>{const c=p(m);let h=class extends c{initialize(){this._defaultReturnZ=!0,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 snappingComplexityExceeded(){return this.graphicsPipeline?.snappingComplexityExceeded??!0}get availableFieldsForQuery(){return n(this.layer.fieldsIndex,this.availableFields)}setVisibility(e,r){this.graphicsPipeline?.setVisibility(e,r)}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}async createGraphicsPipeline(){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=o(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 u of t.features)if(u.geometry){const e=i.getHydratedGeometry(u.attributes[s]);e&&(u.geometry=e,a.push(u))}else a.push(u);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(){}};return e([a()],h.prototype,"layer",void 0),e([a()],h.prototype,"graphicsPipeline",void 0),e([a()],h.prototype,"maximumNumberOfFeatures",null),e([a()],h.prototype,"maximumNumberOfFeaturesExceeded",null),e([a(d)],h.prototype,"updatingProgress",void 0),e([a({readOnly:!0})],h.prototype,"updatingProgressValue",null),e([a({readOnly:!0})],h.prototype,"updatePolicy",null),e([a()],h.prototype,"snappingComplexityExceeded",null),e([a()],h.prototype,"availableFieldsForQuery",null),h=e([u("esri.views.3d.layers.FeatureLikeLayerView3D")],h),h};export{m as FeatureLikeLayerView3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{transformMat3 as e}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{decompressNormal as o,compressNormal as r}from"../webgl-engine/lib/Normals.js";import{DataType as n}from"../../webgl/enums.js";import{VertexElementDescriptor as s}from"../../webgl/VertexElementDescriptor.js";class c{constructor(e,t){this.data=e,this.indices=t}}function f(f,i,d,m,u){if(!m||d.some(({name:e})=>"normal"===e)||d.some(({name:e})=>"normalCompressed"===e)){const n=new c(f.slice().buffer,i);if(u){const s=d[0].stride,c=n.data.byteLength/s;for(const f of d)if("normalCompressed"===f.name){const{offset:a}=f,l=new Int16Array(n.data),i=t();for(let t=0;t<c;++t)o(i,l,t,s/2,a/2),e(i,i,u),r(l,t,i[0],i[1],i[2],s/2,a/2)}else if("normal"===f.name){const{offset:o}=f,r=new Float32Array(n.data),a=t();for(let t=0;t<c;++t){const n=(t*s+o)/4;a[0]=r[n],a[1]=r[n+1],a[2]=r[n+2],e(a,a,u),r[n]=a[0],r[n+1]=a[1],r[n+2]=a[2]}}}return n}const w=d[0].stride,y=w/4,A=new Float32Array(f.buffer,f.byteOffset,f.byteLength/4),h=i.length/3,$=f.byteLength/w,{faceNormals:b,faceAreas:v,faceEdges:x,edgeFaces:F,vertexFaces:U,vertexFaceCountAndOffset:p}=a(A,y,$,i,h,u);l(i,h,b,v,x,F);const E=w+4;d.forEach(e=>e.stride=E),d.push(new s("normalCompressed",2,n.SHORT,w,E,!0));const M=3*h,I=E/4,j=new Float32Array(M*I),C=new(M<256?Uint8Array:M<65536?Uint16Array:Uint32Array)(i);let O=$;const q=new Int16Array(j.buffer),L=w/2,N=E/2;let k=0,D=0;const H=new Uint32Array(h);let P=0;for(let e=0;e<$;++e){const t=e*I,o=e*y;for(let e=0;e<y;++e)j[t+e]=A[o+e];k=p[2*e+1],D=k+p[2*e];let n=e;for(;k<D;){{const e=U[--D],t=b[3*e],o=b[3*e+1],s=b[3*e+2];P=0,H[P++]=e;for(let r=k;r<D;++r){const e=U[r],n=b[3*e],c=b[3*e+1],f=b[3*e+2];Math.abs(1-(t*n+o*c+s*f))<g&&(H[P++]=e,r<D-1&&(U[r]=U[--D]))}let c=0,f=0,a=0;if(1===P)c=t,f=o,a=s;else{for(let t=0;t<P;++t){const e=H[t],o=v[e];c+=b[3*e]*o,f+=b[3*e+1]*o,a+=b[3*e+2]*o}const e=Math.sqrt(c*c+f*f+a*a)||1;c/=e,f/=e,a/=e}r(q,n,c,f,a,N,L)}if(n!==e)for(let o=0;o<P;++o){const t=H[o];for(let o=3*t;o<3*t+3;++o)C[o]===e&&(C[o]=n)}if(k>=D)break;n=O++;const t=n*I;for(let e=0;e<y;++e)j[t+e]=A[o+e]}}const R=O<M?j.slice(0,O*I).buffer:j.buffer;return new c(R,C)}function a(e,t,o,r,n,s){const c=new Float32Array(3*n),f=new Float32Array(n),a=new Uint32Array(3*n),l=new Int32Array(2*(3*n)),i=3*n,d=new Uint32Array(i),m=new Uint32Array(2*o);for(let u=0;u<n;++u){const e=3*u;for(let t=0;t<3;++t){++m[2*r[e+t]]}}{let e=0;for(let t=0;t<o;++t){m[2*t+1]=e;e+=m[2*t]}for(let t=0;t<n;++t){const e=3*t;for(let o=0;o<3;++o){d[m[2*r[e+o]+1]++]=t}}for(let t=0;t<o;++t)m[2*t+1]-=m[2*t]}let g=0;{const n=new Uint32Array(2*i*2),d=new Uint32Array(2*o);for(let e=0;e<o;++e){const t=2*m[2*e+1]*2;d[2*e]=t,d[2*e+1]=t}const u=(e,t,o)=>{const r=Math.min(e,t),s=Math.max(e,t),c=e<t?0:1,f=d[2*r],a=d[2*r+1];let i=-1;for(let l=f;l<a;l+=2)if(n[l]===s){i=n[l+1];break}return-1===i&&(i=g++,n[a]=s,n[a+1]=i,d[2*r+1]+=2,l[2*i+(1-c)]=-1),l[2*i+c]=o,i};for(let o=0;o<r.length;o+=3){const n=r[o],l=n*t,i=e[l],d=e[l+1],m=e[l+2],g=r[o+1],w=g*t,y=e[w],A=e[w+1],h=e[w+2],$=r[o+2],b=$*t,v=i-y,x=d-A,F=m-h,U=i-e[b],p=d-e[b+1],E=m-e[b+2],M=x*E-F*p,I=F*U-v*E,j=v*p-x*U,C=Math.sqrt(M*M+I*I+j*j)||1,O=o/3;f[O]=.5*C;const q=1/C;if(s){const e=s[0]*M+s[3]*I+s[6]*j,t=s[1]*M+s[4]*I+s[7]*j,o=s[2]*M+s[5]*I+s[8]*j;c[3*O]=e*q,c[3*O+1]=t*q,c[3*O+2]=o*q}else c[3*O]=M*q,c[3*O+1]=I*q,c[3*O+2]=j*q;const L=u(n,g,O),N=u(g,$,O),k=u($,n,O);a[3*O]=L,a[3*O+1]=N,a[3*O+2]=k}}return{faceNormals:c,faceAreas:f,faceEdges:a,vertexFaces:d,vertexFaceCountAndOffset:m,edgeFaces:l}}function l(e,t,o,r,n,s){const c=new Uint8Array(t),f=new Uint32Array(t),a=new Uint32Array(3*t);let l=0;const i=new Uint32Array(t);let d=0;for(let g=0;g<e.length;g+=3){const e=g/3;if(1===c[e])continue;c[e]=1;const t=o[3*e],u=o[3*e+1],w=o[3*e+2];for(d=0,i[d++]=e,a[0]=n[3*e],a[1]=n[3*e+1],a[2]=n[3*e+2],l=3,f[e]=e+1;l>0;){const r=a[--l];for(let g=0;g<2;++g){const y=s[2*r+g];if(-1===y||f[y]===e+1)continue;f[y]=e+1;const A=o[3*y],h=o[3*y+1],$=o[3*y+2];if(Math.abs(1-(t*A+u*h+w*$))<m){i[d++]=y,c[y]=1;for(let e=0;e<3;++e){const t=n[3*y+e];t!==r&&(a[l++]=t)}}}}if(d>1){let e=0,t=0,n=0,s=0;for(let f=0;f<d;++f){const c=i[f],a=r[c];e+=a,t+=o[3*c]*a,n+=o[3*c+1]*a,s+=o[3*c+2]*a}const c=Math.sqrt(t*t+n*n+s*s)||1;t/=c,n/=c,s/=c;for(let f=0;f<d;++f){const c=i[f];o[3*c]=t,o[3*c+1]=n,o[3*c+2]=s,r[c]=e}}}}function i(e,t,o,r,n,s,c,f,a,l){const i=new Uint32Array(2*r);for(let d=0;d<o;++d){const e=a[2*d],t=a[2*d+1];for(let n=e;n<t;n+=2){const e=l[n],t=l[n+1];t>=r||t<0?console.error(`Invalid edge index ${t} for vertex ${d}`):e>=o||e<0||e<d?console.error(`Invalid vertex ${e} for edge ${t}`):(i[2*t]=d,i[2*t+1]=e)}}for(let m=0;m<t;++m){const t=[e[3*m],e[3*m+1],e[3*m+2]],o=[f[3*m],f[3*m+1],f[3*m+2]];for(const e of t){const t=n[2*e+1];d(s,t,t+n[2*e],1,m)||console.error(`Face ${m} not found in vertexFaces for vertex ${e}`)}for(const e of o){const t=c[2*e],o=c[2*e+1];-1!==t||-1!==o?m!==t&&m!==o&&console.error(`Edge ${e} of face ${m} does not list it as a face`):console.error(`Edge ${e} of face ${m} has no faces`)}}for(let m=0;m<r;++m){const e=c[2*m],t=c[2*m+1];if(-1===e&&-1===t){console.error(`Edge ${m} has no faces`);continue}for(const s of[e,t].filter(e=>-1!==e)){const e=f[3*s],t=f[3*s+1],o=f[3*s+2];m!==e&&m!==t&&m!==o&&console.error(`Edge ${m} not found in edgesPerFace for face ${s}`)}const o=i[2*m],r=i[2*m+1];o===r&&console.error(`Edge ${m} is degenerate with identical vertices ${o}`);const n=Math.min(o,r);d(l,a[2*n]+1,a[2*n+1],2,m)||console.error(`Edge ${m} not found in edgeMap for vertex ${n}`)}for(let m=0;m<o;++m){const o=n[2*m+1],r=n[2*m];for(let n=o;n<o+r;++n){const o=s[n];(o<0||o>=t)&&console.error(`Invalid face ${o} in vertexFaces for vertex ${m}`),d(e,3*o,3*o+3,1,m)||console.error(`Face ${o} in vertexFaces for vertex ${m} does not reference it in indices`)}}}function d(e,t,o,r,n){for(let s=t;s<o;s+=r)if(e[s]===n)return!0;return!1}const m=.04,g=.8;export{f as addNormals,i as checkTopology};
2
+ import{transformMat3 as e}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{decompressNormal as r,compressNormal as n}from"../webgl-engine/lib/Normals.js";import{DataType as o}from"../../webgl/enums.js";import{VertexElementDescriptor as s}from"../../webgl/VertexElementDescriptor.js";class c{constructor(e,t){this.data=e,this.indices=t}}function f(e,t,r,n,o){return!n||r.some(({name:e})=>"normal"===e||"normalCompressed"===e)?a(e,t,r,o):i(e,t,r,o)}function a(o,s,f,a){const i=new c(o.slice().buffer,s);if(a){const o=f[0].stride,s=i.data.byteLength/o;for(const c of f)if("normalCompressed"===c.name){const{offset:f}=c,l=new Int16Array(i.data),d=t();for(let t=0;t<s;++t)r(d,l,t,o/2,f/2),e(d,d,a),n(l,t,d[0],d[1],d[2],o/2,f/2)}else if("normal"===c.name){const{offset:r}=c,n=new Float32Array(i.data),f=t();for(let t=0;t<s;++t){const s=(t*o+r)/4;f[0]=n[s],f[1]=n[s+1],f[2]=n[s+2],e(f,f,a),n[s]=f[0],n[s+1]=f[1],n[s+2]=f[2]}}}return i}function i(e,t,r,n){const c=r[0].stride,f=c/4,a=new Float32Array(e.buffer,e.byteOffset,e.byteLength/4),i=t.length/3,y=e.byteLength/c,{faceNormals:m,faceAreas:A,faceEdges:w,edgeFaces:h,vertexFaces:g,vertexFaceCountAndOffset:b}=d(a,f,y,t,i,n);u(t,i,m,A,w,h);const $=c+4;return r.forEach(e=>e.stride=$),r.push(new s("normalCompressed",2,o.SHORT,c,$,!0)),l(a,f,i,y,t,c,$,m,A,g,b)}function l(e,t,r,n,o,s,f,a,i,l,d){const u=3*r,y=new(u<256?Uint8Array:u<65536?Uint16Array:Uint32Array)(o);let m=n;const A=new(n<256?Uint8Array:n<65536?Uint16Array:Uint32Array)(u-n),h=new ArrayBuffer(4*u),g=new Int16Array(h),b=new Uint32Array(h),$=new Uint32Array(e.buffer,e.byteOffset,e.length);let U=0,v=0;const x=new Uint32Array(r);let F=0;const M=1-w;for(let c=0;c<n;++c){U=d[2*c+1],v=U+d[2*c];let e=c;for(;U<v;){{const t=l[--v],r=3*t,n=a[r],o=a[r+1],s=a[r+2];F=0,x[F++]=t;let c=U;for(;c<v;){const e=l[c],t=3*e;if(n*a[t]+o*a[t+1]+s*a[t+2]>M){x[F++]=e;const t=--v;if(c<t){l[c]=l[t];continue}}++c}let f=0,d=0,u=0;if(1===F)f=n,d=o,u=s;else{for(let t=0;t<F;++t){const e=x[t],r=i[e],n=3*e;f+=a[n]*r,d+=a[n+1]*r,u+=a[n+2]*r}const e=Math.sqrt(f*f+d*d+u*u)||1;f/=e,d/=e,u/=e}{const t=1/(Math.abs(f)+Math.abs(d)+Math.abs(u)),r=f*t,n=d*t;let o=r,s=n;u<=0&&(o=(r>=0?1:-1)*(1-Math.abs(n)),s=(n>=0?1:-1)*(1-Math.abs(r)));const c=2*e,a=Math.round(32767*o),i=Math.round(32767*s);g[c]=a<-32767?-32767:a>32767?32767:a,g[c+1]=i<-32767?-32767:i>32767?32767:i}}if(e!==c)for(let t=0;t<F;++t){const r=3*x[t];y[r]===c&&(y[r]=e),y[r+1]===c&&(y[r+1]=e),y[r+2]===c&&(y[r+2]=e)}if(U>=v)break;e=m++,A[e-n]=c}}const p=m,E=f/4,I=new Float32Array(p*E),j=new Uint32Array(I.buffer),C=s/4;for(let c=0;c<n;++c){const e=c*t,r=c*E;for(let n=0;n<t;++n)j[r+n]=$[e+n];j[r+C]=b[c]}for(let c=n;c<p;++c){const e=A[c-n]*t,r=c*E;for(let n=0;n<t;++n)j[r+n]=$[e+n];j[r+C]=b[c]}return new c(I.buffer,y)}function d(e,t,r,n,o,s){const c=new Float32Array(3*o),f=new Float32Array(o),a=new Uint32Array(3*o),i=new Int32Array(2*(3*o)),l=3*o,d=new Uint32Array(l),u=new Uint32Array(2*r);for(let m=0;m<o;++m){const A=3*m;for(let w=0;w<3;++w){++u[2*n[A+w]]}}{let h=0;for(let g=0;g<r;++g){const b=2*g;u[b+1]=h;h+=u[b]}for(let $=0;$<o;++$){const U=3*$;for(let v=0;v<3;++v){d[u[2*n[U+v]+1]++]=$}}for(let x=0;x<r;++x)u[2*x+1]-=u[2*x]}let y=0;{const F=new Uint32Array(2*l*2),M=new Uint32Array(2*r);for(let E=0;E<r;++E){const I=2*E,j=4*u[I+1];M[I]=j,M[I+1]=j}function p(e,t,r){const n=Math.min(e,t),o=Math.max(e,t),s=e<t?0:1,c=2*n,f=M[c],a=M[c+1];let l=-1;for(let i=f;i<a;i+=2)if(F[i]===o){l=F[i+1];break}return-1===l&&(l=y++,F[a]=o,F[a+1]=l,M[c+1]=a+2,i[2*l+(1-s)]=-1),i[2*l+s]=r,l}for(let C=0;C<n.length;C+=3){const O=n[C],q=O*t,L=e[q],N=e[q+1],k=e[q+2],B=n[C+1],D=B*t,H=e[D],P=e[D+1],R=e[D+2],S=n[C+2],T=S*t,V=L-H,z=N-P,G=k-R,J=L-e[T],K=N-e[T+1],Q=k-e[T+2],W=z*Q-G*K,X=G*J-V*Q,Y=V*K-z*J,Z=Math.sqrt(W*W+X*X+Y*Y)||1,_=C/3;f[_]=.5*Z;const ee=1/Z;if(s){const oe=s[0]*W+s[3]*X+s[6]*Y,se=s[1]*W+s[4]*X+s[7]*Y,ce=s[2]*W+s[5]*X+s[8]*Y;c[3*_]=oe*ee,c[3*_+1]=se*ee,c[3*_+2]=ce*ee}else c[3*_]=W*ee,c[3*_+1]=X*ee,c[3*_+2]=Y*ee;const te=p(O,B,_),re=p(B,S,_),ne=p(S,O,_);a[3*_]=te,a[3*_+1]=re,a[3*_+2]=ne}}return{faceNormals:c,faceAreas:f,faceEdges:a,vertexFaces:d,vertexFaceCountAndOffset:u,edgeFaces:i}}function u(e,t,r,n,o,s){const c=new Uint8Array(t),f=new Uint32Array(t),a=new Uint32Array(3*t);let i=0;const l=new Uint32Array(t);let d=0;for(let u=0;u<e.length;u+=3){const e=u/3;if(1===c[e])continue;c[e]=1;const t=r[3*e],y=r[3*e+1],m=r[3*e+2];for(d=0,l[d++]=e,a[0]=o[3*e],a[1]=o[3*e+1],a[2]=o[3*e+2],i=3,f[e]=e+1;i>0;){const n=a[--i];for(let u=0;u<2;++u){const w=s[2*n+u];if(-1===w||f[w]===e+1)continue;f[w]=e+1;const h=r[3*w],g=r[3*w+1],b=r[3*w+2];if(Math.abs(1-(t*h+y*g+m*b))<A){l[d++]=w,c[w]=1;for(let e=0;e<3;++e){const t=o[3*w+e];t!==n&&(a[i++]=t)}}}}if(d>1){let e=0,t=0,o=0,s=0;for(let f=0;f<d;++f){const c=l[f],a=n[c];e+=a,t+=r[3*c]*a,o+=r[3*c+1]*a,s+=r[3*c+2]*a}const c=Math.sqrt(t*t+o*o+s*s)||1;t/=c,o/=c,s/=c;for(let f=0;f<d;++f){const c=l[f];r[3*c]=t,r[3*c+1]=o,r[3*c+2]=s,n[c]=e}}}}function y(e,t,r,n,o,s,c,f,a,i){const l=new Uint32Array(2*n);for(let d=0;d<r;++d){const e=a[2*d],t=a[2*d+1];for(let o=e;o<t;o+=2){const e=i[o],t=i[o+1];t>=n||t<0?console.error(`Invalid edge index ${t} for vertex ${d}`):e>=r||e<0||e<d?console.error(`Invalid vertex ${e} for edge ${t}`):(l[2*t]=d,l[2*t+1]=e)}}for(let d=0;d<t;++d){const t=[e[3*d],e[3*d+1],e[3*d+2]],r=[f[3*d],f[3*d+1],f[3*d+2]];for(const e of t){const t=o[2*e+1];m(s,t,t+o[2*e],1,d)||console.error(`Face ${d} not found in vertexFaces for vertex ${e}`)}for(const e of r){const t=c[2*e],r=c[2*e+1];-1!==t||-1!==r?d!==t&&d!==r&&console.error(`Edge ${e} of face ${d} does not list it as a face`):console.error(`Edge ${e} of face ${d} has no faces`)}}for(let d=0;d<n;++d){const e=c[2*d],t=c[2*d+1];if(-1===e&&-1===t){console.error(`Edge ${d} has no faces`);continue}for(const s of[e,t].filter(e=>-1!==e)){const e=f[3*s],t=f[3*s+1],r=f[3*s+2];d!==e&&d!==t&&d!==r&&console.error(`Edge ${d} not found in edgesPerFace for face ${s}`)}const r=l[2*d],n=l[2*d+1];r===n&&console.error(`Edge ${d} is degenerate with identical vertices ${r}`);const o=Math.min(r,n);m(i,a[2*o]+1,a[2*o+1],2,d)||console.error(`Edge ${d} not found in edgeMap for vertex ${o}`)}for(let d=0;d<r;++d){const r=o[2*d+1],n=o[2*d];for(let o=r;o<r+n;++o){const r=s[o];(r<0||r>=t)&&console.error(`Invalid face ${r} in vertexFaces for vertex ${d}`),m(e,3*r,3*r+3,1,d)||console.error(`Face ${r} in vertexFaces for vertex ${d} does not reference it in indices`)}}}function m(e,t,r,n,o){for(let s=t;s<r;s+=n)if(e[s]===o)return!0;return!1}const A=.04,w=.8;export{f as addNormals,y as checkTopology};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import{watch as t}from"../../../core/reactiveUtils.js";import{property as i,subclass as s}from"../../../core/accessorSupport/decorators.js";import o from"../../../rest/support/Query.js";import{isNumber as n}from"../../../support/guards.js";import{FeatureLikeLayerViewBase3D as a}from"./FeatureLikeLayerViewBase3D.js";import{StreamController as p}from"./graphics/StreamController.js";import{StreamGraphics3DGraphicsPipeline as c}from"./graphics/StreamGraphics3DGraphicsPipeline.js";import l from"../../layers/StreamLayerView.js";let h=class extends(a(l)){constructor(){super(...arguments),this.type="stream-3d",this.updatePolicy=0,this.hasZ=!0,this.hasM=!1}initialize(){this.addHandles(t(()=>this.suspended,e=>{this.graphicsPipeline&&this._onSuspendedChange(e)}))}get connectionError(){const e=this.graphicsPipeline?.connection?.errorString;return e?new r("stream-controller",e):null}get graphicOrigin(){return this.layer.graphicOrigin}createQuery(){return new o({outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference})}queryLatestObservations(e,r){return this.graphicsPipeline.graphicsQuery.executeQueryForLatestObservations(this._ensureQuery(e),r?.signal)}async queryObjectIds(e,r){return(await super.queryObjectIds(e,r)).filter(n)}setVisibility(e,r){}get _streamConnectionStatus(){return this.graphicsPipeline?.connection?.connectionStatus??"disconnected"}async createGraphicsPipeline(){return new c({layerView:this})}createController(){return new p({layer:this.layer,layerView:this})}beforeSetController(){}_doPause(){this.graphicsPipeline?.pause()}_doResume(){this.graphicsPipeline?.resume()}_doDisconnect(){this.graphicsPipeline?.disconnect(),this._doPause()}_doConnect(){this.graphicsPipeline?.connect(),this.resume()}_doClear(){this.graphicsPipeline?.clear()}};e([i({readOnly:!0})],h.prototype,"updatePolicy",void 0),e([i({readOnly:!0})],h.prototype,"connectionError",null),e([i()],h.prototype,"graphicsPipeline",void 0),e([i({readOnly:!0})],h.prototype,"hasZ",void 0),e([i({readOnly:!0})],h.prototype,"hasM",void 0),e([i()],h.prototype,"graphicOrigin",null),e([i({readOnly:!0})],h.prototype,"_streamConnectionStatus",null),h=e([s("esri.views.3d.layers.StreamLayerView3D")],h);const u=h;export{u as default};
2
+ import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import{watch as t}from"../../../core/reactiveUtils.js";import{property as i,subclass as s}from"../../../core/accessorSupport/decorators.js";import o from"../../../rest/support/Query.js";import{isNumber as n}from"../../../support/guards.js";import{FeatureLikeLayerViewBase3D as a}from"./FeatureLikeLayerViewBase3D.js";import{StreamController as p}from"./graphics/StreamController.js";import{StreamGraphics3DGraphicsPipeline as c}from"./graphics/StreamGraphics3DGraphicsPipeline.js";import l from"../../layers/StreamLayerView.js";let u=class extends(a(l)){constructor(){super(...arguments),this.type="stream-3d",this.updatePolicy=0}initialize(){this.addHandles(t(()=>this.suspended,e=>{this.graphicsPipeline&&this._onSuspendedChange(e)}))}get connectionError(){const e=this.graphicsPipeline?.connection?.errorString;return e?new r("stream-controller",e):null}get graphicOrigin(){return this.layer.graphicOrigin}createQuery(){return new o({outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference})}queryLatestObservations(e,r){return this.graphicsPipeline.graphicsQuery.executeQueryForLatestObservations(this._ensureQuery(e),r?.signal)}async queryObjectIds(e,r){return(await super.queryObjectIds(e,r)).filter(n)}setVisibility(e,r){}get _streamConnectionStatus(){return this.graphicsPipeline?.connection?.connectionStatus??"disconnected"}async createGraphicsPipeline(){return new c({layerView:this})}createController(){return new p({layer:this.layer,layerView:this})}beforeSetController(){}_doPause(){this.graphicsPipeline?.pause()}_doResume(){this.graphicsPipeline?.resume()}_doDisconnect(){this.graphicsPipeline?.disconnect(),this._doPause()}_doConnect(){this.graphicsPipeline?.connect(),this.resume()}_doClear(){this.graphicsPipeline?.clear()}};e([i({readOnly:!0})],u.prototype,"updatePolicy",void 0),e([i({readOnly:!0})],u.prototype,"connectionError",null),e([i()],u.prototype,"graphicsPipeline",void 0),e([i()],u.prototype,"graphicOrigin",null),e([i({readOnly:!0})],u.prototype,"_streamConnectionStatus",null),u=e([s("esri.views.3d.layers.StreamLayerView3D")],u);const h=u;export{h as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{hydrateGeometry as r}from"../../../../layers/graphics/hydratedFeatures.js";import{loadArcade as n}from"../../../../support/loadArcade.js";const c=()=>e.getLogger("esri.views.3d.layers.graphics.featureExpressionInfoUtils");function o(e){return{cachedResult:e.cachedResult,arcade:e.arcade?{func:e.arcade.func,context:e.arcade.modules.arcadeUtils.createExecContext(null,{sr:e.arcade.context.spatialReference}),modules:e.arcade.modules}:null}}function u(e){const t=e?.expression;if("string"==typeof t){const e=m(t);if(null!=e)return{cachedResult:e}}return null}async function a(e,r,c,o){const u=e?.expression;if("string"!=typeof u)return null;const a=m(u);if(null!=a)return{cachedResult:a};const s=await n();t(c);const l=s.arcadeUtils,i=l.createSyntaxTree(u);return l.dependsOnView(i)?(null!=o&&o.error("Expressions containing '$view' are not supported on ElevationInfo"),{cachedResult:0}):{arcade:{func:l.createFunction(i),context:l.createExecContext(null,{sr:r}),modules:s}}}function s(e,t,r){return e.arcadeUtils.createFeature(t.attributes,t.geometry,r)}function l(e,t){if(null!=e&&!p(e)){if(!t||!e.arcade)return void c().errorOncePerTick("Arcade support required but not provided");const n=t;n._geometry&&(n._geometry=r(n._geometry)),e.arcade.modules.arcadeUtils.updateExecContext(e.arcade.context,t)}}function i(e){if(null!=e){if(p(e))return e.cachedResult;const t=e.arcade;let r=t?.modules.arcadeUtils.executeFunction(t.func,t.context);return"number"!=typeof r&&(e.cachedResult=0,r=0),r}return 0}function d(e,t=!1){let r=e?.featureExpressionInfo;const n=r?.expression;return t||"0"===n||(r=null),r??null}const f={cachedResult:0};function p(e){return null!=e.cachedResult}function m(e){return"0"===e?0:null}export{o as clone,a as createContext,u as createContextWithoutExpressionSupport,s as createFeature,i as execute,d as extractExpressionInfo,l as setContextFeature,f as zeroContext};
2
+ import e from"../../../../core/Logger.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{hydrateGeometry as r}from"../../../../layers/graphics/hydratedFeatures.js";import{loadArcade as n}from"../../../../support/loadArcade.js";const c=()=>e.getLogger("esri.views.3d.layers.graphics.featureExpressionInfoUtils");function o(e){return{cachedResult:e.cachedResult,arcade:e.arcade?{func:e.arcade.func,context:e.arcade.modules.arcadeUtils.createExecContext(null,{sr:e.arcade.context.spatialReference}),modules:e.arcade.modules}:null}}function u(e){const t=e?.expression;if("string"==typeof t){const e=m(t);if(null!=e)return{cachedResult:e}}return null}async function s(e,r,c,o){const u=e?.expression;if("string"!=typeof u)return null;const s=m(u);if(null!=s)return{cachedResult:s};const a=await n();t(c);const l=a.arcadeUtils,i=l.createSyntaxTree(u);if(!i)return null;if(l.dependsOnView(i))return null!=o&&o.error("Expressions containing '$view' are not supported on ElevationInfo"),{cachedResult:0};const d=l.createFunction(i);if(!d)return null;return{arcade:{modules:a,func:d,context:l.createExecContext(null,{sr:r})}}}function a(e,t,r){return e.arcadeUtils.createFeature(t.attributes,t.geometry,r)}function l(e,t){if(null!=e&&!p(e)){if(!t||!e.arcade)return void c().errorOncePerTick("Arcade support required but not provided");const n=t;n._geometry&&(n._geometry=r(n._geometry)),e.arcade.modules.arcadeUtils.updateExecContext(e.arcade.context,t)}}function i(e){if(null!=e){if(p(e))return e.cachedResult;const t=e.arcade;let r=t?.modules.arcadeUtils.executeFunction(t.func,t.context);return"number"!=typeof r&&(e.cachedResult=0,r=0),r}return 0}function d(e,t=!1){let r=e?.featureExpressionInfo;const n=r?.expression;return t||"0"===n||(r=null),r??null}const f={cachedResult:0};function p(e){return null!=e.cachedResult}function m(e){return"0"===e?0:null}export{o as clone,s as createContext,u as createContextWithoutExpressionSupport,a as createFeature,i as execute,d as extractExpressionInfo,l as setContextFeature,f as zeroContext};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import r from"../../../core/Accessor.js";import a from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{on as n,watch as o,sync as h,when as l}from"../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../core/scheduling.js";import{createScreenPoint as p}from"../../../core/screenUtils.js";import{Milliseconds as m}from"../../../core/time.js";import{property as d,subclass as v}from"../../../core/accessorSupport/decorators.js";import{runUntracked as u}from"../../../core/accessorSupport/tracking.js";import{squaredDistance as w}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as _}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import y from"../../../geometry/Extent.js";import C from"../../../geometry/Point.js";import x from"../../../geometry/Polygon.js";import{isLoadedOrLoadFor as R,requiresLoad as S}from"../../../geometry/projectionUtils.js";import{fromRenderCamera as P,toRenderCamera as O}from"../webgl.js";import{applyAll as b}from"../camera/constraintUtils.js";import{cameraOnContentAlongViewDirection as T,surfaceElevationBelowRenderLocation as j}from"../camera/intersectionUtils.js";import{ConstraintsManager as z}from"./ConstraintsManager.js";import{Frustum as M}from"./Frustum.js";import{GoToOperation as I}from"./GoToOperation.js";import{SurfaceCollisionCorrectionController as H}from"./controllers/SurfaceCollisionCorrectionController.js";import{toArea as V,toExtent as B,applyTiltAdjustToScale as L,scaleToZoom as D,fromExtentSync as E,getObserverForPointAtDistanceSync as U,viewScaleToCameraDistance as k,zoomToScale as A}from"../support/cameraUtils.js";import{fromCamera as F,toCameraSync as N}from"../support/viewpointUtils.js";import G from"../webgl/RenderCamera.js";import{PropertiesPool as q}from"../../support/PropertiesPool.js";import{ensureAttachmentMaxSize as W}from"../../webgl/FramebufferObject.js";let Z=class extends r{constructor(e){super(e),this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._idleTimeout=re,this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:e=>this._devicePixelRatioOverride=e,getDevicePixelRatioOverride:()=>this._devicePixelRatioOverride,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},get updatingIgnoreRenderState(){return null!=this.renderState},get idleTimeoutEnabled(){return this.viewStateManager._idleTimeout>0},set idleTimeoutEnabled(e){this.viewStateManager._idleTimeout=e?re:0}},this._propertiesPool=new q({frustum:()=>new M(null)},this),this._cameraSetByUser=!1,this._gotoOperation=null,this._cameraChangeTime=0,this._tmpCanvasSize=new J}initialize(){this._cameraChangeTime=performance.now(),this.addHandles([n(()=>this.view.state.events,"before-camera-change",({camera:e})=>e&&this._updateElevation(e)),o(()=>this.view.state?.camera,(e,t)=>this._cameraChangedHandler(e,t),h)]),l(()=>this.view.state?.camera,e=>this._updateElevation(e),{once:!0,sync:!0}),this.addHandles([c({prepare:e=>this._prepareFrame(e.time)}),o(()=>this.view.state.cameraController,()=>{this._cameraSetByUser=!0,this.removeHandles(te)}),n(()=>this.view.state.events,"camera-projection-changed",()=>this.notifyChange("scale"))])}destroy(){this.exit(),this._propertiesPool=s(this._propertiesPool)}get camera(){const e=this._get("camera");if(!this.ready)return e;const{view:t}=this,i=t.state.camera;return u(()=>{const r=P(t,i,Y);return r&&e&&r.equals(e)?e:r.clone()})}set camera(e){if(this._updatePropertyBeforeReady("camera",e))return;this.view.elevationProvider.enableCache(!0);const t=O(this.view,e);t?this.setStateCamera(t,{applyConstraints:!1})||a.getLogger(this).warnOnce("#camera=","There is a currently active camera controller that has priority."):a.getLogger(this).error("#camera=","Invalid camera",e),this.view.elevationProvider.enableCache(!1)}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const{view:t}=this,i=t.state.contentCamera;return u(()=>{const r=P(t,i,Y);return r&&e&&r.equals(e)?e:r.clone()})}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const t=O(this.view,e);this.view.state.contentCamera=null!=t?t:null}installContentCameraReset(e){if(this.removeHandles(ie),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const t=this.zoom,i=this.view.state.camera.distance**2,r=g(this.view.state.camera.center),a=e.sticky?this.contentCamera.clone():null;return this.addHandles([o(()=>this.contentCamera,()=>{e.sticky||(this.removeHandles(ie),this.test.contentCameraResetState.clear())}),o(()=>this.zoom,e=>{void 0!==e&&void 0!==t&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(e-t)/2),Math.abs(e-t)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a))}),o(()=>this.view.state.camera,e=>{const t=w(r,e.center);this.test.contentCameraResetState.set("camera.center",t/i),t>i?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)})],ie),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():a.getLogger(this).error("#center=","Invalid center",e):a.getLogger(this).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#center=","Center may not be null or undefined"))}get visibleArea(){if(!this.ready){const e=this._get("extent");return e?x.fromExtent(e):null}return V(this.view,this.view.pointsOfInterest.focus.renderLocation)}get extent(){if(!this.ready)return this._get("extent");const e=this.view,t=B(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return null!=t?t:this._get("extent")}set extent(e){this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#extent=","Invalid extent",e):a.getLogger(this).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this._propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get constraintsManager(){return this._constraintsManager}get _initialViewpoint(){const e=this.view.map;return e&&"initialViewProperties"in e?e.initialViewProperties?.viewpoint:void 0}get hasInitialView(){return!!this._initialViewpoint}get scale(){if(!this.ready)return this._get("scale");const e=this.view.basemapTerrain.tilingScheme,t=this.view.pointsOfInterest.cameraOnSurface.scale;return e&&t?L(this.view,t,this.view.state.contentCamera,e):this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,t=e.padding,i=e.pixelRatio,r=this._get("padding"),a=Math.round(t[0]/i),s=Math.round(t[1]/i),n=Math.round(t[2]/i),o=Math.round(t[3]/i);return null!=r&&r.top===a&&r.right===s&&r.bottom===n&&r.left===o?r:{top:a,right:s,bottom:n,left:o}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,ee),this.view.state.updateCamera(e=>e.padding=ee))}_paddingToArray(e,t,i){e?_(i,e.top||0,e.right||0,e.bottom||0,e.left||0):_(i,0,0,0,0);for(let r=0;r<4;r++)i[r]=Math.round(i[r]*t)}get screenCenter(){const e=this.padding;return p((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?F(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){if(!this._updatePropertyBeforeReady("viewpoint",e))if(e){if(!this.isCompatible(e)){const t=null!=e.camera?e.camera.position:e.targetGeometry,i=null!=t&&t.spatialReference;return void a.getLogger(this).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(i?i.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e)}this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||a.getLogger(this).error("#viewpoint=","Invalid viewpoint",e)}else a.getLogger(this).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?D(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||void 0===e||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#zoom=","Invalid zoom",e)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;const e=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio),t=(this._useDevicePixelResolution()?this._windowDevicePixelRatio:e)*this.view.resolutionScale;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*t),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*t);const i=this.view.stage.renderView.renderingContext?.parameters.maxTextureSize;return i&&W(this._tmpCanvasSize,i),this._tmpCanvasSize.pixelRatio=this._tmpCanvasSize.width>0?this._tmpCanvasSize.width/this.view.surface.clientWidth*.5+this._tmpCanvasSize.height/this.view.surface.clientHeight*.5:t,this.view.state&&(this.view.state.contentPixelRatio=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)),this._tmpCanvasSize}get _rasterPixelRatio(){return null!=this._devicePixelRatioOverride?this._devicePixelRatioOverride:this._useDevicePixelResolution(2)?this._windowDevicePixelRatio:Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)}_useDevicePixelResolution(e){return this.view?.stage?.renderer.isFeatureEnabled(9,e)??!1}preinit(e){return!(this._isOverridden("center")&&!R(this.center.spatialReference,e))&&(!(this._isOverridden("camera")&&!R(this.camera.position.spatialReference,e))&&(!(this._isOverridden("extent")&&!R(this.extent.spatialReference,e))&&!!(!this._isOverridden("viewpoint")||R(this.viewpoint.targetGeometry?.spatialReference,e)&&R(this.viewpoint.camera?.position?.spatialReference,e))))}init(){this._constraintsManager=new z({view:this.view}),this._prepareFrame(m(0));const e=this._getInitialProperties();this._cameraSetByUser=!1,this._set("ready",!0);for(const t of e)this.set(t.name,t.value);if(!this._cameraSetByUser){const e=this._initialViewpoint||this.view.initialExtent;e&&this.isCompatible(e)?this._setInitialView(e):2===this.view.state.viewingMode&&this.addHandles(l(()=>this.view.groundView.ready,()=>{this.removeHandles(te),this._setInitialView(this.view.dataExtent)},{once:!0,initial:!0}),te)}}exit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles(te),this._constraintsManager=s(this._constraintsManager))}async goTo(e,t){return t={animate:this.view.state.animationsEnabled,...t},null!=this._gotoOperation&&this._gotoOperation.abort(t.animate),this._gotoOperation=new I(e,t,this.view),this.view.resourceController.scheduler.stopFrame(),this._gotoOperation.promise}debugSetCameraOnContent(){this.setStateCamera(T(this.view),{applyConstraints:!1})}step(e){const t=this.view.state?.cameraController;t?.stepController&&this.view.state.updateCamera(i=>t.stepController(e,i))}_cancelGoToOperation(){null!=this._gotoOperation&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const e=new Set,t=[];for(const{propertyName:i,overrides:r}of Q){const a=e.has(i),s=this._isOverridden(i);!a&&s&&t.push({name:i,value:this._get(i)}),this._clearOverride(i),(a||s)&&r.forEach(t=>e.add(t))}return t}_setInitialView(e){if(null==e||this._cameraSetByUser)return;if(e instanceof t)return void this.setStateCamera(O(this.view,e),{applyConstraints:!1});if(e instanceof i){if(e.targetGeometry instanceof y){const t=E(this.view,e.targetGeometry,0,.5,0);return void(null!=t&&this.setStateCamera(O(this.view,t),{applyConstraints:!0}))}const t={applyConstraints:!e.camera},i=this._viewpointToCamera(e);return void this.setStateCamera(i,t)}const r=E(this.view,e,0,.5,0);null!=r&&this.setStateCamera(O(this.view,r),{applyConstraints:!0})}_updatePropertyBeforeReady(e,t){return!this.ready&&(this._override(e,t),t&&K.has(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return null!=e&&(e instanceof i?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof t?this.isCompatible(e.position):e.spatialReference&&!S(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=X){return this._cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,t,i=$){const{heading:r,tilt:a}=this._getPreservingHeadingTilt(),s=U(this.view,r,a,e,t,1);return null==s?null:(i.copyFrom(this.view.state.camera),i.eye=s.eye,i.center=s.center,i.up=s.up,i)}_centerToCamera(e){let t;if(e.hasZ)t=this.view.state.camera.distance;else{const{centerOnContent:e}=this.view.pointsOfInterest;e.runTask(),t=e.distance}return this._centerPointAtDistanceToCamera(e,t)}_extentToCamera(e){const{heading:t,tilt:i}=this._getPreservingHeadingTilt(),r=E(this.view,e,t,i,1,Y);return r?O(this.view,r):null}_scaleToCamera(e){if(null==e)return null;const t=this.view,i=t.pointsOfInterest.centerOnContent;i.runTask();const r=i.renderLocation,a=t.pointsOfInterest.cameraOnSurface.renderLocation,s=k(t,e,r,a);return this._centerPointAtDistanceToCamera(r,s)}_zoomToCamera(e){return this._scaleToCamera(A(this.view,e))}_viewpointToCamera(e){return O(this.view,N(this.view,e))}setStateCamera(e,t){return!(null==e||!this.view.state.stopActiveCameraController())&&(this._cameraSetByUser=!0,t.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera(i=>{t.positionAndOrientationOnly?(i.eye=e.eye,i.center=e.center,i.up=e.up,i.fov=e.fov):i.copyFrom(e),t.applyConstraints&&b(this.view,i)}),t.applyConstraints||(this.view.state.cameraController=new H({view:this.view,desiredCamera:e})),!0)}_prepareFrame(e){const{surface:t,canvas:i,stage:r}=this.view;if(!t||!i||!r||r.destroyed||r.destroying)return;this._windowDevicePixelRatio=window.devicePixelRatio;const a=this._computeCanvasSize();if(0!==a.width&&0!==a.height&&(i.width===a.width&&i.height===a.height||(i.width=a.width,i.height=a.height),this.view.state)){const t=this.view.state.camera;t.fullWidth===a.width&&t.fullHeight===a.height&&t.pixelRatio===a.pixelRatio||($.copyFrom(t),$.pixelRatio!==a.pixelRatio&&(this._paddingToArray(this.padding,a.pixelRatio,ee),$.padding=ee),$.fullWidth=a.width,$.fullHeight=a.height,$.pixelRatio=a.pixelRatio,this.view.state.camera=$),this._updateState(),this.view.state.occludedFragmentOpacity?.update(this.view,this.view.state.mode,e)}}_updateElevation(e){const t=this.view.renderCoordsHelper?.getAltitude(e.eye)??0,i=this.view.basemapTerrain?.spatialReference,r=i?j(this.view,e.eye):0;e.relativeElevation=t-r}_updateState(){null!=this.test.renderState?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=0:this.view.interacting?this.view.state.mode=1:(0===this.view.state.mode&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTime<this._idleTimeout?this.view.state.mode=1:this.view.state.mode=2),this.view.state.rasterPixelRatio=this._rasterPixelRatio}_cameraChangedHandler(e,t){e&&t&&e.almostEquals(t)||(this._cameraChangeTime=performance.now(),this._updateState())}};e([d({type:t})],Z.prototype,"camera",null),e([d({type:t})],Z.prototype,"contentCamera",null),e([d({type:C})],Z.prototype,"center",null),e([d()],Z.prototype,"visibleArea",null),e([d({type:y})],Z.prototype,"extent",null),e([d({readOnly:!0})],Z.prototype,"frustum",null),e([d()],Z.prototype,"_constraintsManager",void 0),e([d({readOnly:!0})],Z.prototype,"constraintsManager",null),e([d()],Z.prototype,"_initialViewpoint",null),e([d({readOnly:!0})],Z.prototype,"hasInitialView",null),e([d({readOnly:!0,type:Boolean})],Z.prototype,"ready",void 0),e([d({type:Number})],Z.prototype,"scale",null),e([d()],Z.prototype,"padding",null),e([d({readOnly:!0})],Z.prototype,"screenCenter",null),e([d({constructOnly:!0})],Z.prototype,"view",void 0),e([d({type:i})],Z.prototype,"viewpoint",null),e([d({type:Number})],Z.prototype,"zoom",null),e([d({readOnly:!0})],Z.prototype,"_rasterPixelRatio",null),e([d({readOnly:!0})],Z.prototype,"_useDevicePixelResolution",null),e([d()],Z.prototype,"_windowDevicePixelRatio",void 0),e([d()],Z.prototype,"_devicePixelRatioOverride",void 0),Z=e([v("esri.views.3d.state.ViewStateManager")],Z);class J{constructor(){this.width=0,this.height=0,this.pixelRatio=1}}const K=new Set(["camera","viewpoint","extent","scale","center","zoom"]),Q=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],X={heading:0,tilt:0};let Y=new t,$=new G;const ee=f(),te="pending-initial-view",ie="content-camera-reset",re=300,ae=100;function se(){Y=new t,$=new G}export{Z as ViewStateManager,se as cleanupViewStateManager,ae as interactingTimeout};
2
+ import{__decorate as e}from"tslib";import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import r from"../../../core/Accessor.js";import a from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{on as n,watch as o,sync as h,when as l}from"../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../core/scheduling.js";import{createScreenPoint as p}from"../../../core/screenUtils.js";import{Milliseconds as m}from"../../../core/time.js";import{property as d,subclass as v}from"../../../core/accessorSupport/decorators.js";import{runUntracked as u}from"../../../core/accessorSupport/tracking.js";import{squaredDistance as w}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as _}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import y from"../../../geometry/Extent.js";import C from"../../../geometry/Point.js";import x from"../../../geometry/Polygon.js";import{isLoadedOrLoadFor as R,requiresLoad as S}from"../../../geometry/projectionUtils.js";import{fromRenderCamera as P,toRenderCamera as O}from"../webgl.js";import{applyAll as b}from"../camera/constraintUtils.js";import{cameraOnContentAlongViewDirection as T,surfaceElevationBelowRenderLocation as j}from"../camera/intersectionUtils.js";import{ConstraintsManager as z}from"./ConstraintsManager.js";import{Frustum as M}from"./Frustum.js";import{GoToOperation as I}from"./GoToOperation.js";import{SurfaceCollisionCorrectionController as H}from"./controllers/SurfaceCollisionCorrectionController.js";import{toArea as V,toExtent as B,applyTiltAdjustToScale as L,scaleToZoom as D,fromExtentSync as E,getObserverForPointAtDistanceSync as U,viewScaleToCameraDistance as k,zoomToScale as A}from"../support/cameraUtils.js";import{fromCamera as F,toCameraSync as N}from"../support/viewpointUtils.js";import G from"../webgl/RenderCamera.js";import{PropertiesPool as q}from"../../support/PropertiesPool.js";import{ensureAttachmentMaxSize as W}from"../../webgl/FramebufferObject.js";let Z=class extends r{constructor(e){super(e),this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._idleTimeout=re,this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:e=>this._devicePixelRatioOverride=e,getDevicePixelRatioOverride:()=>this._devicePixelRatioOverride,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},get updatingIgnoreRenderState(){return null!=this.renderState},get idleTimeoutEnabled(){return this.viewStateManager._idleTimeout>0},set idleTimeoutEnabled(e){this.viewStateManager._idleTimeout=e?re:0}},this._propertiesPool=new q({frustum:()=>new M(null)},this),this._cameraSetByUser=!1,this._gotoOperation=null,this._cameraChangeTime=0,this._tmpCanvasSize=new J}initialize(){this._cameraChangeTime=performance.now(),this.addHandles([n(()=>this.view.state.events,"before-camera-change",({camera:e})=>e&&this._updateElevation(e)),o(()=>this.view.state?.camera,(e,t)=>this._cameraChangedHandler(e,t),h)]),l(()=>this.view.state?.camera,e=>this._updateElevation(e),{once:!0,sync:!0}),this.addHandles([c({prepare:e=>this._prepareFrame(e.time)}),o(()=>this.view.state.cameraController,()=>{this._cameraSetByUser=!0,this.removeHandles(te)}),n(()=>this.view.state.events,"camera-projection-changed",()=>this.notifyChange("scale"))])}destroy(){this.exit(),this._propertiesPool=s(this._propertiesPool)}get camera(){const e=this._get("camera");if(!this.ready)return e;const{view:t}=this,i=t.state.camera;return u(()=>{const r=P(t,i,Y);return r&&e&&r.equals(e)?e:r.clone()})}set camera(e){if(this._updatePropertyBeforeReady("camera",e))return;this.view.elevationProvider.enableCache(!0);const t=O(this.view,e);t?this.setStateCamera(t,{applyConstraints:!1})||a.getLogger(this).warnOnce("#camera=","There is a currently active camera controller that has priority."):a.getLogger(this).error("#camera=","Invalid camera",e),this.view.elevationProvider.enableCache(!1)}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const{view:t}=this,i=t.state.contentCamera;return u(()=>{const r=P(t,i,Y);return r&&e&&r.equals(e)?e:r.clone()})}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const t=O(this.view,e);this.view.state.contentCamera=null!=t?t:null}installContentCameraReset(e){if(this.removeHandles(ie),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const t=this.zoom,i=this.view.state.camera.distance**2,r=g(this.view.state.camera.center),a=e.sticky?this.contentCamera.clone():null;return this.addHandles([o(()=>this.contentCamera,()=>{e.sticky||(this.removeHandles(ie),this.test.contentCameraResetState.clear())}),o(()=>this.zoom,e=>{void 0!==e&&void 0!==t&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(e-t)/2),Math.abs(e-t)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a))}),o(()=>this.view.state.camera,e=>{const t=w(r,e.center);this.test.contentCameraResetState.set("camera.center",t/i),t>i?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)})],ie),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():a.getLogger(this).error("#center=","Invalid center",e):a.getLogger(this).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#center=","Center may not be null or undefined"))}get visibleArea(){if(!this.ready){const e=this._get("extent");return e?x.fromExtent(e):null}return V(this.view,this.view.pointsOfInterest.focus.renderLocation)}get extent(){if(!this.ready)return this._get("extent");const e=this.view,t=B(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return null!=t?t:this._get("extent")}set extent(e){this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#extent=","Invalid extent",e):a.getLogger(this).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this._propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get constraintsManager(){return this._constraintsManager}get _initialViewpoint(){const e=this.view.map;return e&&"initialViewProperties"in e?e.initialViewProperties?.viewpoint:void 0}get hasInitialView(){return!!this._initialViewpoint}get scale(){if(!this.ready)return this._get("scale");const e=this.view.basemapTerrain.tilingScheme,t=this.view.pointsOfInterest.cameraOnSurface.scale;return e&&t?L(this.view,t,this.view.state.contentCamera,e):this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,t=e.padding,i=e.pixelRatio,r=this._get("padding"),a=Math.round(t[0]/i),s=Math.round(t[1]/i),n=Math.round(t[2]/i),o=Math.round(t[3]/i);return null!=r&&r.top===a&&r.right===s&&r.bottom===n&&r.left===o?r:{top:a,right:s,bottom:n,left:o}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,ee),this.view.state.updateCamera(e=>e.padding=ee))}_paddingToArray(e,t,i){e?_(i,e.top||0,e.right||0,e.bottom||0,e.left||0):_(i,0,0,0,0);for(let r=0;r<4;r++)i[r]=Math.round(i[r]*t)}get screenCenter(){const e=this.padding;return p((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?F(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){if(!this._updatePropertyBeforeReady("viewpoint",e))if(e){if(!this.isCompatible(e)){const t=null!=e.camera?e.camera.position:e.targetGeometry,i=null!=t&&t.spatialReference;return void a.getLogger(this).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(i?i.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e)}this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||a.getLogger(this).error("#viewpoint=","Invalid viewpoint",e)}else a.getLogger(this).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?D(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||void 0===e||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#zoom=","Invalid zoom",e)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;const e=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio),t=(this._useDevicePixelResolution()?this._windowDevicePixelRatio:e)*this.view.resolutionScale;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*t),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*t);const i=this.view.stage.renderView.renderingContext?.parameters.maxTextureSize;return i&&W(this._tmpCanvasSize,i),this._tmpCanvasSize.pixelRatio=this._tmpCanvasSize.width>0?this._tmpCanvasSize.width/this.view.surface.clientWidth*.5+this._tmpCanvasSize.height/this.view.surface.clientHeight*.5:t,this.view.state&&(this.view.state.contentPixelRatio=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)),this._tmpCanvasSize}get _rasterPixelRatio(){return null!=this._devicePixelRatioOverride?this._devicePixelRatioOverride:this._useDevicePixelResolution(2)?this._windowDevicePixelRatio:Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)}_useDevicePixelResolution(e){return this.view?.stage?.renderer.isFeatureEnabled(8,e)??!1}preinit(e){return!(this._isOverridden("center")&&!R(this.center.spatialReference,e))&&(!(this._isOverridden("camera")&&!R(this.camera.position.spatialReference,e))&&(!(this._isOverridden("extent")&&!R(this.extent.spatialReference,e))&&!!(!this._isOverridden("viewpoint")||R(this.viewpoint.targetGeometry?.spatialReference,e)&&R(this.viewpoint.camera?.position?.spatialReference,e))))}init(){this._constraintsManager=new z({view:this.view}),this._prepareFrame(m(0));const e=this._getInitialProperties();this._cameraSetByUser=!1,this._set("ready",!0);for(const t of e)this.set(t.name,t.value);if(!this._cameraSetByUser){const e=this._initialViewpoint||this.view.initialExtent;e&&this.isCompatible(e)?this._setInitialView(e):2===this.view.state.viewingMode&&this.addHandles(l(()=>this.view.groundView.ready,()=>{this.removeHandles(te),this._setInitialView(this.view.dataExtent)},{once:!0,initial:!0}),te)}}exit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles(te),this._constraintsManager=s(this._constraintsManager))}async goTo(e,t){return t={animate:this.view.state.animationsEnabled,...t},null!=this._gotoOperation&&this._gotoOperation.abort(t.animate),this._gotoOperation=new I(e,t,this.view),this.view.resourceController.scheduler.stopFrame(),this._gotoOperation.promise}debugSetCameraOnContent(){this.setStateCamera(T(this.view),{applyConstraints:!1})}step(e){const t=this.view.state?.cameraController;t?.stepController&&this.view.state.updateCamera(i=>t.stepController(e,i))}_cancelGoToOperation(){null!=this._gotoOperation&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const e=new Set,t=[];for(const{propertyName:i,overrides:r}of Q){const a=e.has(i),s=this._isOverridden(i);!a&&s&&t.push({name:i,value:this._get(i)}),this._clearOverride(i),(a||s)&&r.forEach(t=>e.add(t))}return t}_setInitialView(e){if(null==e||this._cameraSetByUser)return;if(e instanceof t)return void this.setStateCamera(O(this.view,e),{applyConstraints:!1});if(e instanceof i){if(e.targetGeometry instanceof y){const t=E(this.view,e.targetGeometry,0,.5,0);return void(null!=t&&this.setStateCamera(O(this.view,t),{applyConstraints:!0}))}const t={applyConstraints:!e.camera},i=this._viewpointToCamera(e);return void this.setStateCamera(i,t)}const r=E(this.view,e,0,.5,0);null!=r&&this.setStateCamera(O(this.view,r),{applyConstraints:!0})}_updatePropertyBeforeReady(e,t){return!this.ready&&(this._override(e,t),t&&K.has(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return null!=e&&(e instanceof i?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof t?this.isCompatible(e.position):e.spatialReference&&!S(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=X){return this._cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,t,i=$){const{heading:r,tilt:a}=this._getPreservingHeadingTilt(),s=U(this.view,r,a,e,t,1);return null==s?null:(i.copyFrom(this.view.state.camera),i.eye=s.eye,i.center=s.center,i.up=s.up,i)}_centerToCamera(e){let t;if(e.hasZ)t=this.view.state.camera.distance;else{const{centerOnContent:e}=this.view.pointsOfInterest;e.runTask(),t=e.distance}return this._centerPointAtDistanceToCamera(e,t)}_extentToCamera(e){const{heading:t,tilt:i}=this._getPreservingHeadingTilt(),r=E(this.view,e,t,i,1,Y);return r?O(this.view,r):null}_scaleToCamera(e){if(null==e)return null;const t=this.view,i=t.pointsOfInterest.centerOnContent;i.runTask();const r=i.renderLocation,a=t.pointsOfInterest.cameraOnSurface.renderLocation,s=k(t,e,r,a);return this._centerPointAtDistanceToCamera(r,s)}_zoomToCamera(e){return this._scaleToCamera(A(this.view,e))}_viewpointToCamera(e){return O(this.view,N(this.view,e))}setStateCamera(e,t){return!(null==e||!this.view.state.stopActiveCameraController())&&(this._cameraSetByUser=!0,t.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera(i=>{t.positionAndOrientationOnly?(i.eye=e.eye,i.center=e.center,i.up=e.up,i.fov=e.fov):i.copyFrom(e),t.applyConstraints&&b(this.view,i)}),t.applyConstraints||(this.view.state.cameraController=new H({view:this.view,desiredCamera:e})),!0)}_prepareFrame(e){const{surface:t,canvas:i,stage:r}=this.view;if(!t||!i||!r||r.destroyed||r.destroying)return;this._windowDevicePixelRatio=window.devicePixelRatio;const a=this._computeCanvasSize();if(0!==a.width&&0!==a.height&&(i.width===a.width&&i.height===a.height||(i.width=a.width,i.height=a.height),this.view.state)){const t=this.view.state.camera;t.fullWidth===a.width&&t.fullHeight===a.height&&t.pixelRatio===a.pixelRatio||($.copyFrom(t),$.pixelRatio!==a.pixelRatio&&(this._paddingToArray(this.padding,a.pixelRatio,ee),$.padding=ee),$.fullWidth=a.width,$.fullHeight=a.height,$.pixelRatio=a.pixelRatio,this.view.state.camera=$),this._updateState(),this.view.state.occludedFragmentOpacity?.update(this.view,this.view.state.mode,e)}}_updateElevation(e){const t=this.view.renderCoordsHelper?.getAltitude(e.eye)??0,i=this.view.basemapTerrain?.spatialReference,r=i?j(this.view,e.eye):0;e.relativeElevation=t-r}_updateState(){null!=this.test.renderState?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=0:this.view.interacting?this.view.state.mode=1:(0===this.view.state.mode&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTime<this._idleTimeout?this.view.state.mode=1:this.view.state.mode=2),this.view.state.rasterPixelRatio=this._rasterPixelRatio}_cameraChangedHandler(e,t){e&&t&&e.almostEquals(t)||(this._cameraChangeTime=performance.now(),this._updateState())}};e([d({type:t})],Z.prototype,"camera",null),e([d({type:t})],Z.prototype,"contentCamera",null),e([d({type:C})],Z.prototype,"center",null),e([d()],Z.prototype,"visibleArea",null),e([d({type:y})],Z.prototype,"extent",null),e([d({readOnly:!0})],Z.prototype,"frustum",null),e([d()],Z.prototype,"_constraintsManager",void 0),e([d({readOnly:!0})],Z.prototype,"constraintsManager",null),e([d()],Z.prototype,"_initialViewpoint",null),e([d({readOnly:!0})],Z.prototype,"hasInitialView",null),e([d({readOnly:!0,type:Boolean})],Z.prototype,"ready",void 0),e([d({type:Number})],Z.prototype,"scale",null),e([d()],Z.prototype,"padding",null),e([d({readOnly:!0})],Z.prototype,"screenCenter",null),e([d({constructOnly:!0})],Z.prototype,"view",void 0),e([d({type:i})],Z.prototype,"viewpoint",null),e([d({type:Number})],Z.prototype,"zoom",null),e([d({readOnly:!0})],Z.prototype,"_rasterPixelRatio",null),e([d({readOnly:!0})],Z.prototype,"_useDevicePixelResolution",null),e([d()],Z.prototype,"_windowDevicePixelRatio",void 0),e([d()],Z.prototype,"_devicePixelRatioOverride",void 0),Z=e([v("esri.views.3d.state.ViewStateManager")],Z);class J{constructor(){this.width=0,this.height=0,this.pixelRatio=1}}const K=new Set(["camera","viewpoint","extent","scale","center","zoom"]),Q=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],X={heading:0,tilt:0};let Y=new t,$=new G;const ee=f(),te="pending-initial-view",ie="content-camera-reset",re=300,ae=100;function se(){Y=new t,$=new G}export{Z as ViewStateManager,se as cleanupViewStateManager,ae as interactingTimeout};