@arcgis/core 5.2.0-next.146 → 5.2.0-next.148

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 (253) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/03afeefb9d16b6f1d844.js +1 -0
  3. package/assets/esri/core/workers/chunks/{79c83f4e066682543ca1.js → 0a078721c7e0e24027f0.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{72019baeba520edb6bb0.js → 112befb3b5b406f29298.js} +1 -1
  5. package/assets/esri/core/workers/chunks/131e89663014bc76c4ee.js +1 -0
  6. package/assets/esri/core/workers/chunks/14a3808427deaaa85bf2.js +1 -0
  7. package/assets/esri/core/workers/chunks/{392bcef780df52fb4cca.js → 16053ce50642c5ffbfa9.js} +1 -1
  8. package/assets/esri/core/workers/chunks/19689c66776b39cec234.js +1 -0
  9. package/assets/esri/core/workers/chunks/{ba46869e700ba1d2787f.js → 1b3f59fcad6e14c4d0e0.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{6dd0b79fa3a629ab4f27.js → 1bca39e0e651426bdbb5.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{305a718719ef15fda90c.js → 20458fffda7692c78135.js} +1 -1
  12. package/assets/esri/core/workers/chunks/219d0935ce281902a49f.js +1 -0
  13. package/assets/esri/core/workers/chunks/2416518db4a0117541a8.js +1 -0
  14. package/assets/esri/core/workers/chunks/{8b1c17cc52d989924313.js → 27a425d87c57b91489b3.js} +1 -1
  15. package/assets/esri/core/workers/chunks/2d9a1f23ec6ce90723ac.js +1 -0
  16. package/assets/esri/core/workers/chunks/{06e7400f5ebe0719b81c.js → 2e75df54852d65e71330.js} +1 -1
  17. package/assets/esri/core/workers/chunks/39d1d2fbe94afcd0a590.js +1 -0
  18. package/assets/esri/core/workers/chunks/{d01381b548c204835509.js → 3e9f056e4d1f0d067fc6.js} +1 -1
  19. package/assets/esri/core/workers/chunks/407f1e8176f3b0af73b4.js +1 -0
  20. package/assets/esri/core/workers/chunks/{1ba0dfbe0958cdbd7c9f.js → 42fd2a7b22b03dacc6a7.js} +1 -1
  21. package/assets/esri/core/workers/chunks/43321f244effd3d67069.js +1 -0
  22. package/assets/esri/core/workers/chunks/{d201fbf3ceff946d2bd6.js → 44d5508042cacdfcac47.js} +1 -1
  23. package/assets/esri/core/workers/chunks/47e6b5631a625298db5b.js +1 -0
  24. package/assets/esri/core/workers/chunks/4a6b92ecbb1f1c55cc43.js +1 -0
  25. package/assets/esri/core/workers/chunks/4fc337240e7cddd0e988.js +1 -0
  26. package/assets/esri/core/workers/chunks/52c25809edf7ac008a52.js +1 -0
  27. package/assets/esri/core/workers/chunks/54b18559280a7d2a8d93.js +1 -0
  28. package/assets/esri/core/workers/chunks/561c48cb4d49b150765b.js +1 -0
  29. package/assets/esri/core/workers/chunks/{5c855af73ee3c3e764fb.js → 5732fdf6d8b87739aeea.js} +1 -1
  30. package/assets/esri/core/workers/chunks/5924ec3167a2941ebb1f.js +1 -0
  31. package/assets/esri/core/workers/chunks/5f0c06f59121e09091f7.js +1 -0
  32. package/assets/esri/core/workers/chunks/5fa1ec357c3ad1f91bc7.js +1 -0
  33. package/assets/esri/core/workers/chunks/606ea251075fe81a1206.js +1 -0
  34. package/assets/esri/core/workers/chunks/{ceb680688fe7e570a774.js → 608be1172a908e92b9f1.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{6f358116f79021ff9687.js → 612104dff305ff062dfa.js} +2 -2
  36. package/assets/esri/core/workers/chunks/68be3fb88ca61f82fb90.js +1 -0
  37. package/assets/esri/core/workers/chunks/6c9266120d46e8c69dbf.js +1 -0
  38. package/assets/esri/core/workers/chunks/6eb5cc8ddf772c0062e6.js +1 -0
  39. package/assets/esri/core/workers/chunks/709e019885822b1f6f3e.js +1 -0
  40. package/assets/esri/core/workers/chunks/70ee81ba22badbbf045c.js +1 -0
  41. package/assets/esri/core/workers/chunks/731018c0deffc41ffc97.js +1 -0
  42. package/assets/esri/core/workers/chunks/7320a4913b6cad7cc5d7.js +1 -0
  43. package/assets/esri/core/workers/chunks/7a4f1484b119ebafc2e7.js +1 -0
  44. package/assets/esri/core/workers/chunks/8293600f94553afc8c38.js +1 -0
  45. package/assets/esri/core/workers/chunks/{c18189710d6198516175.js → 830ab9b8d000169da675.js} +1 -1
  46. package/assets/esri/core/workers/chunks/8602b3587d4bdd9cc9f5.js +1 -0
  47. package/assets/esri/core/workers/chunks/{956a40f40bde416efe93.js → 898f43feeec74acde1ec.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{700b1d5bc67b7e1b3ff3.js → 8aa80b892fde552577e8.js} +1 -1
  49. package/assets/esri/core/workers/chunks/8ef802ef8d108ae2e473.js +1 -0
  50. package/assets/esri/core/workers/chunks/900181f68449d8f82eeb.js +1 -0
  51. package/assets/esri/core/workers/chunks/925271bb763607a326ae.js +1 -0
  52. package/assets/esri/core/workers/chunks/937824bc7948f7bc7845.js +1 -0
  53. package/assets/esri/core/workers/chunks/939942b00ba380e2957e.js +1 -0
  54. package/assets/esri/core/workers/chunks/{a52bf03bffb6ffac3b54.js → a101b89c18488f213d80.js} +1 -1
  55. package/assets/esri/core/workers/chunks/a337ca943862b30b978d.js +1 -0
  56. package/assets/esri/core/workers/chunks/ac03976b8450331aa31e.js +1 -0
  57. package/assets/esri/core/workers/chunks/af349c7bc8ef41a0e1bd.js +1 -0
  58. package/assets/esri/core/workers/chunks/afc3b2af20e9d1dfd260.js +1 -0
  59. package/assets/esri/core/workers/chunks/{97dbbedea9fe03bd1306.js → b0fd7cd5fc9526d30ddc.js} +1 -1
  60. package/assets/esri/core/workers/chunks/b3e812c3a06b486f05d2.js +1 -0
  61. package/assets/esri/core/workers/chunks/{6883a5c6883eccaddf64.js → b6ba66a05030d3815dfd.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{9ab25ee06041f907b9a2.js → c2c1f51a4668055c2838.js} +1 -1
  63. package/assets/esri/core/workers/chunks/c598b22f78ccc57f9d6d.js +1 -0
  64. package/assets/esri/core/workers/chunks/c5d85be6e16bc895e7fb.js +1 -0
  65. package/assets/esri/core/workers/chunks/c62738f84c914671b143.js +1 -0
  66. package/assets/esri/core/workers/chunks/{820f41d66b2056a3ebc8.js → c7699edd14497d174445.js} +1 -1
  67. package/assets/esri/core/workers/chunks/cfae60b9d2f2939e9c16.js +1 -0
  68. package/assets/esri/core/workers/chunks/{a7985d20fa6e8d4878e7.js → d0f5bee9db1ad51ae687.js} +1 -1
  69. package/assets/esri/core/workers/chunks/dbcac8c1a76d4a9db13d.js +1 -0
  70. package/assets/esri/core/workers/chunks/{4ed8655770a3e018e366.js → de8d7f11f5a078c01b83.js} +1 -1
  71. package/assets/esri/core/workers/chunks/e0351753f6b4d1adf11e.js +1 -0
  72. package/assets/esri/core/workers/chunks/{534186fc921a0ccf58dc.js → e1f5d00878f27e1d413e.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{4479a166b5ac8db1e12e.js → f2b69bd704db62915a6b.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{711cfb84659cb4437679.js → f528ac5c648ca6a98582.js} +1 -1
  75. package/assets/esri/core/workers/chunks/fdbf6208df5c58746d9d.js +1 -0
  76. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ar.json +1 -1
  77. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bg.json +1 -1
  78. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bs.json +1 -1
  79. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ca.json +1 -1
  80. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.cs.json +1 -1
  81. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.da.json +1 -1
  82. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.de.json +1 -1
  83. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.el.json +1 -1
  84. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.es.json +1 -1
  85. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.et.json +1 -1
  86. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fi.json +1 -1
  87. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fr.json +1 -1
  88. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.he.json +1 -1
  89. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hr.json +1 -1
  90. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hu.json +1 -1
  91. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.id.json +1 -1
  92. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.it.json +1 -1
  93. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ja.json +1 -1
  94. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ko.json +1 -1
  95. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lt.json +1 -1
  96. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lv.json +1 -1
  97. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.nl.json +1 -1
  98. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.no.json +1 -1
  99. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pl.json +1 -1
  100. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-BR.json +1 -1
  101. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-PT.json +1 -1
  102. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ro.json +1 -1
  103. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ru.json +1 -1
  104. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sk.json +1 -1
  105. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sl.json +1 -1
  106. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sr.json +1 -1
  107. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sv.json +1 -1
  108. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.th.json +1 -1
  109. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.tr.json +1 -1
  110. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.uk.json +1 -1
  111. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.vi.json +1 -1
  112. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-CN.json +1 -1
  113. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-HK.json +1 -1
  114. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-TW.json +1 -1
  115. package/config.js +1 -1
  116. package/geometry/support/TileClipper.js +1 -1
  117. package/geometry/support/meshUtils.d.ts +1 -1
  118. package/geometry/support/scaleUtils.js +1 -1
  119. package/kernel.js +1 -1
  120. package/layers/CSVLayer.d.ts +1 -1
  121. package/layers/CatalogLayer.d.ts +1 -1
  122. package/layers/FeatureLayer.d.ts +1 -1
  123. package/layers/GeoJSONLayer.d.ts +1 -1
  124. package/layers/OrientedImageryLayer.js +1 -1
  125. package/layers/ParquetLayer.d.ts +4 -3
  126. package/layers/ParquetLayer.js +1 -1
  127. package/layers/SceneLayer.d.ts +4 -5
  128. package/layers/SceneLayer.js +1 -1
  129. package/layers/SketchLayer.d.ts +0 -1
  130. package/layers/SubtypeGroupLayer.d.ts +1 -1
  131. package/layers/WFSLayer.d.ts +1 -1
  132. package/layers/buildingSublayers/BuildingComponentSublayer.d.ts +1 -1
  133. package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
  134. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  135. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -1
  136. package/layers/mixins/ArcGISImageService.d.ts +1 -1
  137. package/layers/mixins/PortalLayer.js +1 -1
  138. package/layers/mixins/ScaleRangeLayer.js +1 -1
  139. package/layers/mixins/SublayersOwner.js +1 -1
  140. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  141. package/layers/orientedImagery/core/utils.js +1 -1
  142. package/layers/support/FeatureFilter.d.ts +1 -1
  143. package/layers/support/ParquetPortalItemData.js +1 -1
  144. package/layers/support/PortalItemData.js +1 -1
  145. package/layers/support/Sublayer.js +1 -1
  146. package/layers/support/SubtypeSublayer.d.ts +1 -1
  147. package/layers/support/SubtypeSublayer.js +1 -1
  148. package/package.json +2 -2
  149. package/popup/FeaturesModel.d.ts +26 -5
  150. package/popup/FeaturesModel.js +1 -1
  151. package/portal/support/layersLoader.js +1 -1
  152. package/portal/support/portalLayers.js +1 -1
  153. package/rest/print.js +1 -1
  154. package/rest/support/printTaskUtils.js +1 -1
  155. package/symbols/cim/CIMSymbolHelper.js +1 -1
  156. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  157. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  158. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  159. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  160. package/views/2d/layers/LayerView2D.js +1 -1
  161. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  162. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  163. package/views/3d/analysis/Viewshed/types.d.ts +3 -1
  164. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  165. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  166. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  167. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  168. package/views/3d/layers/FlowSubView3D.js +1 -1
  169. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  170. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  171. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  172. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  173. package/views/3d/layers/MediaLayerView3D.js +1 -1
  174. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  175. package/views/3d/layers/RouteLayerView3D.js +1 -1
  176. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  177. package/views/3d/layers/SceneLayerView3D.js +1 -1
  178. package/views/3d/layers/TiledLayerView3D.js +1 -1
  179. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  180. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  181. package/views/3d/layers/graphics/Labeler.js +1 -1
  182. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  183. package/views/3d/support/popupHitTest.js +1 -1
  184. package/views/View2D.d.ts +1 -1
  185. package/views/interactive/snapping/FeatureSnappingSourceInfo.js +1 -1
  186. package/views/interactive/snapping/SnappingOptions.d.ts +1 -1
  187. package/views/layers/FeatureLikeLayerView.d.ts +1 -1
  188. package/views/layers/LayerView.js +1 -1
  189. package/views/layers/LineOfSightLayerView.d.ts +3 -4
  190. package/views/layers/ParquetLayerView.js +1 -1
  191. package/views/layers/PointCloudLayerView.d.ts +1 -1
  192. package/views/layers/SceneLayerView.d.ts +1 -1
  193. package/views/layers/ViewshedLayerView.d.ts +5 -6
  194. package/views/support/layerViewUtils.js +1 -1
  195. package/webdoc/support/saveUtils.js +1 -1
  196. package/webdoc/support/unsupportedErrors.js +1 -1
  197. package/widgets/Editor.d.ts +10 -0
  198. package/widgets/Legend.d.ts +1 -0
  199. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  200. package/widgets/OrientedImageryViewer/adapters/draw/HeightMeasurementAdapter.js +1 -1
  201. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  202. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  203. package/widgets/OrientedImageryViewer/components/ImageLocationViewModel.js +1 -1
  204. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  205. package/widgets/support/SnappingControls.d.ts +1 -1
  206. package/assets/esri/core/workers/chunks/00a600c71ceebe7bfeee.js +0 -1
  207. package/assets/esri/core/workers/chunks/0193df3f9fb23633da87.js +0 -1
  208. package/assets/esri/core/workers/chunks/050c4b212f2b5691db34.js +0 -1
  209. package/assets/esri/core/workers/chunks/07aa6d36f1006b6ab7ff.js +0 -1
  210. package/assets/esri/core/workers/chunks/0bb11751efa2023ec937.js +0 -1
  211. package/assets/esri/core/workers/chunks/222af8522773c7dc80b1.js +0 -1
  212. package/assets/esri/core/workers/chunks/303fde8f3459dde16555.js +0 -1
  213. package/assets/esri/core/workers/chunks/347bf269c2b1583d2dca.js +0 -1
  214. package/assets/esri/core/workers/chunks/350540770781b281c39a.js +0 -1
  215. package/assets/esri/core/workers/chunks/3b017b718ea2d4ed498f.js +0 -1
  216. package/assets/esri/core/workers/chunks/3e81dfc9d621ece038fe.js +0 -1
  217. package/assets/esri/core/workers/chunks/46b2d4addfc73f9183a4.js +0 -1
  218. package/assets/esri/core/workers/chunks/4d82db661365daa513a6.js +0 -1
  219. package/assets/esri/core/workers/chunks/4f48d45baa8ada16f579.js +0 -1
  220. package/assets/esri/core/workers/chunks/50ca55ad2f5421acc492.js +0 -1
  221. package/assets/esri/core/workers/chunks/532a1b6ff9a7c950e325.js +0 -1
  222. package/assets/esri/core/workers/chunks/5450f339f97b2b042ee2.js +0 -1
  223. package/assets/esri/core/workers/chunks/55cc8581978c71b17998.js +0 -1
  224. package/assets/esri/core/workers/chunks/58c252289411b0d86473.js +0 -1
  225. package/assets/esri/core/workers/chunks/633a9051580c5302d2f7.js +0 -1
  226. package/assets/esri/core/workers/chunks/641d196a554bd07f729e.js +0 -1
  227. package/assets/esri/core/workers/chunks/655c3afda1eef01611dd.js +0 -1
  228. package/assets/esri/core/workers/chunks/6569797d3c22442e5e97.js +0 -1
  229. package/assets/esri/core/workers/chunks/70793967db45fb142962.js +0 -1
  230. package/assets/esri/core/workers/chunks/798a63653f82c0e842c5.js +0 -1
  231. package/assets/esri/core/workers/chunks/84fcbf7a1d04f01685d1.js +0 -1
  232. package/assets/esri/core/workers/chunks/8e511079918e2fd9261f.js +0 -1
  233. package/assets/esri/core/workers/chunks/8fcfd515ee1b18c902e5.js +0 -1
  234. package/assets/esri/core/workers/chunks/9001e9a1e81bce175ddd.js +0 -1
  235. package/assets/esri/core/workers/chunks/9401cc22373566e1171e.js +0 -1
  236. package/assets/esri/core/workers/chunks/95b82cbbe355266c65d7.js +0 -1
  237. package/assets/esri/core/workers/chunks/9c0fd8baa00ee9733ba4.js +0 -1
  238. package/assets/esri/core/workers/chunks/9c1e69ac82e2bf746191.js +0 -1
  239. package/assets/esri/core/workers/chunks/a010d2e4e34eb7bc1fec.js +0 -1
  240. package/assets/esri/core/workers/chunks/a05790444115e4cf1bcc.js +0 -1
  241. package/assets/esri/core/workers/chunks/a7edf7541569fef77cb3.js +0 -1
  242. package/assets/esri/core/workers/chunks/b2c29bc48c7b3b0c9357.js +0 -1
  243. package/assets/esri/core/workers/chunks/b61008f28b788f759e2a.js +0 -1
  244. package/assets/esri/core/workers/chunks/b7d77dd2abb255fd2e5a.js +0 -1
  245. package/assets/esri/core/workers/chunks/b8054adc45bca069b948.js +0 -1
  246. package/assets/esri/core/workers/chunks/ca7fb75e2c62e7d37122.js +0 -1
  247. package/assets/esri/core/workers/chunks/d21257d2e2a37266c0f7.js +0 -1
  248. package/assets/esri/core/workers/chunks/d270cc9807161033686e.js +0 -1
  249. package/assets/esri/core/workers/chunks/d4f038e04c42aed588c1.js +0 -1
  250. package/assets/esri/core/workers/chunks/e32b96c08cb272a59851.js +0 -1
  251. package/assets/esri/core/workers/chunks/e7c60bd85abbd36cdc64.js +0 -1
  252. package/assets/esri/core/workers/chunks/f0a68d2900d24f56afa0.js +0 -1
  253. package/assets/esri/core/workers/chunks/f511a304e9dea9eb3e01.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Graphic.js";import n from"../PopupTemplate.js";import{ClonableMixin as r}from"../core/Clonable.js";import i from"../core/Collection.js";import a from"../core/Error.js";import{abortHandle as o}from"../core/handleUtils.js";import s from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as l}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as u,throwIfAborted as d,isAbortError as f,throwIfNotAbortError as p}from"../core/promiseUtils.js";import{whenOnce as m}from"../core/reactiveUtils.js";import{property as h,subclass as g}from"../core/accessorSupport/decorators.js";import{getProperties as _}from"../core/accessorSupport/utils.js";import v from"../geometry/Point.js";import{projectAsync as y}from"../geometry/projectionUtils.js";import b from"../graphic/SceneGraphicOrigin.js";import x from"./Layer.js";import{NoModelError as ee,MultipleModelsError as S}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as C}from"./mixins/APIKeyMixin.js";import{ArcGISService as w}from"./mixins/ArcGISService.js";import{CustomParametersMixin as te}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as ne}from"./mixins/EditBusLayer.js";import{OperationalLayer as re}from"./mixins/OperationalLayer.js";import{PortalLayer as ie}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as ae}from"./mixins/ScaleRangeLayer.js";import{SceneService as oe}from"./mixins/SceneService.js";import{useViewTimeProperty as se}from"./mixins/TemporalLayer.js";import{isHostedAgolService as T}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as ce}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as le}from"./support/capabilities.js";import{elevationInfo as E,labelsVisible as D,legendEnabled as O,popupEnabled as k,attributeTableTemplate as A,screenSizePerspectiveEnabled as j,timeInfo as M}from"./support/commonProperties.js";import{getFieldDomain as N,computeEffectiveEditingEnabled as P,getGlobalIdToObjectIdMap as F}from"./support/featureLayerUtils.js";import I from"./support/FeatureReductionSelection.js";import{defineFieldProperties as L}from"./support/fieldProperties.js";import R from"./support/FieldsIndex.js";import{fixRendererFields as z,fixTimeInfoFields as B,unpackFieldNames as V}from"./support/fieldUtils.js";import{I3SNodePageDefinition as H,I3SMaterialDefinition as U,I3STextureSetDefinition as W,I3SGeometryDefinition as ue}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as de,isFileSupported as fe}from"./support/infoFor3D.js";import pe from"./support/LabelClass.js";import{reader as G}from"./support/labelingInfo.js";import me from"./support/LayerFloorInfo.js";import{layersLoaderMap as he}from"./support/layersLoader.js";import{getMeshTransformForMetersToSpatialReference as ge}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as _e}from"./support/RangeInfo.js";import ve from"./support/SceneFilter.js";import{cacheIsOutOfSync as K}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as ye}from"./support/sceneLayerStatistics.js";import{SceneServiceTimeInfo as be}from"./support/SceneServiceTimeInfo.js";import xe from"./support/TimeInfo.js";import{loadStyleRenderer as Se}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Ce}from"../renderers/support/typeUtils.js";import we from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as q,elevationModeUnsupportedMessage as Te,featureExpressionUnsupportedMessage as Ee}from"../support/elevationInfoUtils.js";import{createPopupTemplate as De}from"../support/popupUtils.js";import{extractZipFiles as Oe}from"../support/zipUtils.js";import J from"../time/TimeExtent.js";import ke from"../time/TimeInterval.js";import{queryAttributesFromCachedAttributesId as Ae}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as je,getFetchPopupTemplate as Me}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Ne}from"../webdoc/support/opacityUtils.js";import{reader as Y}from"../core/accessorSupport/decorators/reader.js";const X=new Set([`3DObject`,`Point`]),Z=L();let Q=class extends ne(oe(w(re(ie(ae(l(te(C(r(x)))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType=`ArcGISSceneServiceLayer`,this.type=`scene`,this.fields=null,this.graphicOrigin=new b(this),this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new i,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0,this.serviceTimeInfo=null}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}destroy(){this._set(`renderer`,null),this.associatedLayer=c(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){let n=this.getField(e)?.domain??null;return this.associatedLayer?N(this.associatedLayer,e,t,n):n}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new R(this.fields)}readNodePages(e,t,n){return t.layerType===`Point`&&(e=t.pointNodePages),typeof e!=`object`||!e?null:H.fromJSON(e,n)}set elevationInfo(e){this._set(`elevationInfo`,e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return this.associatedLayer!=null&&P(this.associatedLayer)}get geometryType(){return Pe[this.profile]||`mesh`}set renderer(e){z(e,this.fieldsIndex),this._set(`renderer`,e)}readCachedDrawingInfo(e){return(typeof e!=`object`||!e)&&(e={}),e.color??(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e??=le;let{query:t,queryRelated:n,editing:{supportsGlobalId:r,supportsRollbackOnFailure:i,supportsUploadWithItemId:a,supportsGeometryUpdate:o,supportsReturnServiceEditsInSourceSpatialReference:s},data:{supportsZ:c,supportsM:l,isVersioned:u,supportsAttachment:d},operations:{supportsEditing:f,supportsAdd:p,supportsUpdate:m,supportsDelete:h,supportsQuery:g,supportsQueryAttachments:_,supportsAsyncConvert3D:v},attachment:y}=e,b=e.operations.supportsChangeTracking,x=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:n,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:s,supportsRollbackOnFailure:i,supportsGeometryUpdate:x&&o,supportsUploadWithItemId:a},data:{supportsAttachment:d,supportsZ:c,supportsM:l,isVersioned:u,queryFormats:e.data.queryFormats,sourceFormats:e.data.sourceFormats},operations:{supportsQuery:g,supportsQueryAttachments:_,supportsEditing:f&&b,supportsAdd:x&&p&&b,supportsDelete:x&&h&&b,supportsUpdate:m&&b,supportsAsyncConvert3D:v},attachment:y}}get editingEnabled(){return this._isOverridden(`editingEnabled`)?this._get(`editingEnabled`):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome(`editingEnabled`,e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>(t.type===`esriFieldTypeOID`&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>(t.type===`esriFieldTypeGlobalID`&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){let n=t.store.profile;return n!=null&&$[n]?$[n]:(s.getLogger(this).error(`Unknown or missing profile`,{profile:n,layer:this}),`mesh-pyramids`)}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override(`useViewTime`,e)}get timeInfo(){let e=this.associatedLayer?.timeInfo;if(e==null)return null;let t=e.clone();return B(t,this.fieldsIndex),t}set timeInfo(e){B(e,this.fieldsIndex),this._override(`timeInfo`,e)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(e){this._override(`timeExtent`,e)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(e){this._override(`timeOffset`,e)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(e){this._override(`datesInUnknownTimezone`,e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){let t=e?.signal;await this.loadFromPortal({supportedTypes:[`Scene Service`]},e).catch(u),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await Se(this,{origin:`service`},t),z(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){s.getLogger(this).error(`#_loadFilterGeometries()`,this,`Failed to load filter geometries. Geometry filter will not be applied for this layer.`,{error:e}),this.filter=null}}createQuery(){let e=new we;return this.geometryType===`mesh`?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||`1=1`,e.sqlFormat=`standard`,e.outFields=[`*`],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(let t of e.features)t.layer=this,t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}async queryModels(e,t){let[n,{queryModels:r}]=await Promise.all([this._getAssociatedLayerForQuery(),import(`./scene/modelQuerySupport.js`)]);return r(this,n,e,t)}async queryModel(e,t){let[n,{queryModel:r}]=await Promise.all([this._getAssociatedLayerForQuery(),import(`./scene/modelQuerySupport.js`)]);return r(this,n,e,t)}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new a(`scenelayer:query-not-available`,`SceneLayer queries are not available without an associated feature layer`,{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new a(`scenelayer:query-not-available`,`SceneLayer queries are not available without an associated feature layer`,{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){let n=V(this.fieldsIndex,await je(this,Me(this)));return Ae(this.parsedUrl?.path??``,this.attributeStorageInfo??[],e,t,n,this.apiKey,this.customParameters)}async queryCachedFeature(e,n){let r=await this.queryCachedAttributes(e,[n]);if(!r||r.length===0)throw new a(`scenelayer:feature-not-in-cached-data`,`Feature not found in cached data`);let i=new t;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i.origin=this.graphicOrigin,i}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryAttachments(e,t))}getFieldUsageInfo(e){let t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(s.getLogger(this).error(`#getFieldUsageInfo()`,`Unavailable until layer is loaded`),t)}createPopupTemplate(e){return De(this,e)}_getAssociatedLayerForQuery(){let e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new a(`scenelayer:query-not-available`,`SceneLayer queries are not available without an associated feature layer`,{layer:this});try{await this.associatedLayer.load()}catch(e){throw new a(`scenelayer:query-not-available`,`SceneLayer associated feature layer could not be loaded`,{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:`scene`},e)}async save(){return this._debouncedSaveOperations(0,{getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:`scene`})}async applyEdits(e,t){let{applyEdits:n}=await import(`./graphics/editingSupport.js`),r=t;await this.load();let i=this.associatedLayer;if(!i)throw new a(`${this.type}-layer:not-editable`,`Service is not editable`);await i.load();let{globalIdField:o}=i,s=!!i.infoFor3D,c=r?.globalIdUsed??!0;if(s&&o==null)throw new a(`${this.type}-layer:not-editable`,`Valid globalIdField expected on editable SceneLayer`);if(s&&!c)throw new a(`${this.type}-layer:globalid-required`,`globalIdUsed must not be false for SceneLayer editing as globalIds are required.`);return T(i.url)&&s&&e.deleteFeatures!=null&&o!=null&&(r={...r,globalIdToObjectId:await F(i,e.deleteFeatures,o)}),n(this,i.source,e,r)}async uploadAssets(e,t){if(await this.load(),this.associatedLayer==null)throw new a(`${this.type}-layer:not-editable`,`Service is not editable`);return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={};let n=e=>{throw s.getLogger(this).error(`.convertMesh()`,e.message),e};await this.load(t),this.infoFor3D||n(new a(`invalid:layer`,`SceneLayer has no capability for mesh conversion`));let r=await this.extractAndFilterFiles(e);d(t);let i=r.reduce((e,t)=>de(this.infoFor3D,t)?e+1:e,0);i===0&&n(new ee),i>1&&n(new S);let o=this.spatialReference,c=t.origin,l=await y(c??t.defaultOrigin??new v({x:0,y:0,z:0,spatialReference:o}),o,t),u=o.isGeographic?`local`:`georeferenced`,{createWithExternalSource:f}=await import(`../geometry/support/meshUtils.js`);d(t);let p=f(l,{type:`client`,files:r},{vertexSpace:u,transform:ge(o),unitConversionDisabled:!0}),[m]=await this.uploadAssets([p],{...t,useAssetOrigin:!c});return m}async extractAndFilterFiles(e){await this.load();let t=this.infoFor3D;return t?(await Oe(e)).filter(e=>fe(t,e)):e}validateLayer(e){if(e.layerType&&!X.has(e.layerType))throw new a(`scenelayer:layer-type-not-supported`,`SceneLayer does not support this layer type`,{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new a(`layer:service-version-not-supported`,`Service version is not supported.`,{serviceVersion:this.version.versionString,supportedVersions:`1.x, 2.x`});if(this.version.major>2)throw new a(`layer:service-version-too-new`,`Service version is too new.`,{serviceVersion:this.version.versionString,supportedVersions:`1.x, 2.x`});t(this.normalReferenceFrame,this.spatialReference);function t(e,t){let n=!1,r=!1;if(e==null)n=!0,r=!0;else{let i=t&&t.isGeographic;switch(e){case`east-north-up`:case`earth-centered`:n=!0,r=i;break;case`vertex-reference-frame`:n=!0,r=!i;break;default:n=!1}}if(!n)throw new a(`scenelayer:unsupported-normal-reference-frame`,`Normal reference frame is invalid.`);if(!r)throw new a(`scenelayer:incompatible-normal-reference-frame`,`Normal reference frame is incompatible with layer spatial reference.`)}}get isUsedAsGroundLayer(){return!1}_getTypeKeywords(){let e=[];if(this.profile===`points`)e.push(`Point`);else if(this.profile===`mesh-pyramids`)e.push(`3DObject`);else throw new a(`scenelayer:unknown-profile`,`SceneLayer:save() encountered an unknown SceneLayer profile: `+this.profile);return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(let e of this.fields){let t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),n=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),r={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||n,supportsLayerQuery:n};this._fieldUsageInfo[e.name]=r}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(let t of this.associatedLayer.fields){let n=this.getField(t.name);n?(!n.domain&&t.domain&&(n.domain=t.domain.clone()),n.editable=t.editable,n.nullable=t.nullable,n.length=t.length):(e||=this.fields?this.fields.slice():[],e.push(t.clone()))}e&&this._set(`fields`,e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;let e=[`popupTemplate`,`popupEnabled`,`attributeTableTemplate`],t=_(this);for(let n=0;n<e.length;n++){let r=e[n],i=this.originIdOf(r),a=this.associatedLayer.originIdOf(r);i<a&&(a===2||a===3)&&t.setAtOrigin(r,this.associatedLayer[r],a)}}_applyAssociatedLayerExtentOverride(){let e=this.associatedLayer?.getAtOrigin(`fullExtent`,`service`);this.associatedLayer?.infoFor3D!=null&&e&&T(this.associatedLayer?.url)&&K(this)&&_(this).setAtOrigin(`fullExtent`,e.clone(),2)}_applyAssociatedLayerPrivileges(){let e=this.associatedLayer;e&&(this._set(`userHasEditingPrivileges`,e.userHasEditingPrivileges),this._set(`userHasFullEditingPrivileges`,e.userHasFullEditingPrivileges),this._set(`userHasUpdateItemPrivileges`,e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if([`mesh-pyramids`,`points`].includes(this.profile))try{let{serverUrl:t,layerId:n,portalItem:r}=await ce(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),i=await he.FeatureLayer();this.associatedLayer=new i({url:t,customParameters:this.customParameters,apiKey:this.apiKey,layerId:n,portalItem:r}),await this.associatedLayer.load()}catch(e){f(e)||this._logWarningOnPopupEnabled().catch(()=>{})}}async _logWarningOnPopupEnabled(){let e=new AbortController;this.addHandles(o(e));try{await m(()=>this.popupEnabled&&this.popupTemplate!=null,e.signal)}catch(e){p(e);return}let t=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?s.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):s.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){let e=this.elevationInfo;this.profile===`mesh-pyramids`&&q(s.getLogger(this),Te(`Mesh scene layers`,`relative-to-scene`,e)),q(s.getLogger(this),Ee(`Scene layers`,e))}async fetchStatistics(e,t){return await ye({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:`scenelayer`,fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??``,customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}async loadTimeInfoFromService(e){let{serviceTimeInfo:t}=this;if(t==null)return;let{startTimeField:n,endTimeField:r}=t;if(n==null&&r==null||K({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;let i=async t=>{let r=null;try{r=(await this.fetchStatistics(t,e))?.stats}catch{}if(r==null)return null;let{minTimeStr:i,min:a,maxTimeStr:o,max:s}=r,c=t===n?i??a:o??s;return c==null?null:new Date(c)},[a,o]=await Promise.all([i(n),i(r)]);if(n!=null&&a==null||r!=null&&o==null)return;let s=new J({start:a,end:o});this.setAtOrigin(`timeInfo`,new xe({endField:r,startField:n,fullTimeExtent:s}),`service`)}};e([h({types:{key:`type`,base:null,typeMap:{selection:I}},json:{origins:{"web-scene":{name:`layerDefinition.featureReduction`,write:{allowNull:!0}},"portal-item":{name:`layerDefinition.featureReduction`,write:{allowNull:!0}}}}})],Q.prototype,`featureReduction`,void 0),e([h({type:[_e],json:{read:!1,origins:{"web-scene":{name:`layerDefinition.rangeInfos`,write:!0},"portal-item":{name:`layerDefinition.rangeInfos`,write:!0}}},clonable:!1})],Q.prototype,`rangeInfos`,void 0),e([h({json:{read:!1}})],Q.prototype,`associatedLayer`,void 0),e([h({type:[`show`,`hide`]})],Q.prototype,`listMode`,void 0),e([h({type:[`ArcGISSceneServiceLayer`]})],Q.prototype,`operationalLayerType`,void 0),e([h({json:{read:!1},readOnly:!0})],Q.prototype,`type`,void 0),e([h({...Z.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`fields`,void 0),e([h()],Q.prototype,`types`,null),e([h()],Q.prototype,`typeIdField`,null),e([h()],Q.prototype,`templates`,null),e([h()],Q.prototype,`formTemplate`,null),e([h({readOnly:!0})],Q.prototype,`graphicOrigin`,void 0),e([h({readOnly:!0,clonable:!1})],Q.prototype,`fieldsIndex`,null),e([h({type:me,json:{read:{source:`layerDefinition.floorInfo`},write:{target:`layerDefinition.floorInfo`}}})],Q.prototype,`floorInfo`,void 0),e([h(Z.outFields)],Q.prototype,`outFields`,void 0),e([h({type:H,readOnly:!0,json:{read:!1},clonable:!1})],Q.prototype,`nodePages`,void 0),e([Y(`service`,`nodePages`,[`nodePages`,`pointNodePages`])],Q.prototype,`readNodePages`,null),e([h({type:[U],readOnly:!0,clonable:!1})],Q.prototype,`materialDefinitions`,void 0),e([h({type:[W],readOnly:!0,clonable:!1})],Q.prototype,`textureSetDefinitions`,void 0),e([h({type:[ue],readOnly:!0,clonable:!1})],Q.prototype,`geometryDefinitions`,void 0),e([h({readOnly:!0})],Q.prototype,`serviceUpdateTimeStamp`,void 0),e([h({readOnly:!0})],Q.prototype,`attributeStorageInfo`,void 0),e([h({readOnly:!0})],Q.prototype,`statisticsInfo`,void 0),e([h({type:i.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:`layerDefinition.excludeObjectIds`,write:{enabled:!0}}})],Q.prototype,`excludeObjectIds`,void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:`layerDefinition.definitionExpression`,write:{enabled:!0,allowNull:!0}}})],Q.prototype,`definitionExpression`,void 0),e([h({type:ve,json:{name:`layerDefinition.polygonFilter`,write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Q.prototype,`filter`,void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Q.prototype,`path`,void 0),e([h(E)],Q.prototype,`elevationInfo`,null),e([h({readOnly:!0,json:{read:!1}})],Q.prototype,`effectiveCapabilities`,null),e([h({readOnly:!0})],Q.prototype,`effectiveEditingEnabled`,null),e([h({type:String})],Q.prototype,`geometryType`,null),e([h(D)],Q.prototype,`labelsVisible`,void 0),e([h({type:[pe],json:{origins:{service:{name:`drawingInfo.labelingInfo`,read:{reader:G},write:!1}},name:`layerDefinition.drawingInfo.labelingInfo`,read:{reader:G},write:!0}})],Q.prototype,`labelingInfo`,void 0),e([h(O)],Q.prototype,`legendEnabled`,void 0),e([h({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:[`opacity`,`layerDefinition.drawingInfo.transparency`],reader(e,t){if(typeof e==`number`&&e>=0&&e<=1)return e;let n=t.layerDefinition?.drawingInfo?.transparency;return n===void 0?void 0:Ne(n)}}},"portal-item":{write:!0},service:{read:!1}}}})],Q.prototype,`opacity`,void 0),e([h({type:[`Low`,`High`],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`priority`,void 0),e([h({type:[`Labels`],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`semantic`,void 0),e([h({types:Ce,json:{origins:{service:{read:{source:`drawingInfo.renderer`}}},name:`layerDefinition.drawingInfo.renderer`,write:!0},value:null})],Q.prototype,`renderer`,null),e([h({json:{read:!1}})],Q.prototype,`cachedDrawingInfo`,void 0),e([Y(`service`,`cachedDrawingInfo`)],Q.prototype,`readCachedDrawingInfo`,null),e([h({readOnly:!0,json:{read:!1}})],Q.prototype,`capabilities`,null),e([h({type:Boolean,json:{read:!1}})],Q.prototype,`editingEnabled`,null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Q.prototype,`infoFor3D`,null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Q.prototype,`relationships`,null),e([h(k)],Q.prototype,`popupEnabled`,void 0),e([h({type:n,json:{name:`popupInfo`,write:!0}})],Q.prototype,`popupTemplate`,void 0),e([h({readOnly:!0,json:{read:!1}})],Q.prototype,`defaultPopupTemplate`,null),e([h(A)],Q.prototype,`attributeTableTemplate`,void 0),e([h({type:String,json:{read:!1}})],Q.prototype,`objectIdField`,void 0),e([Y(`service`,`objectIdField`,[`objectIdField`,`fields`])],Q.prototype,`readObjectIdField`,null),e([h({type:String,json:{read:!1}})],Q.prototype,`globalIdField`,void 0),e([Y(`service`,`globalIdField`,[`globalIdField`,`fields`])],Q.prototype,`readGlobalIdField`,null),e([h({readOnly:!0,type:String,json:{read:!1}})],Q.prototype,`displayField`,null),e([h({type:String,json:{read:!1}})],Q.prototype,`profile`,void 0),e([Y(`service`,`profile`,[`store.profile`])],Q.prototype,`readProfile`,null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:`store.normalReferenceFrame`}}},read:!1}})],Q.prototype,`normalReferenceFrame`,void 0),e([h(j)],Q.prototype,`screenSizePerspectiveEnabled`,void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`serviceItemId`,void 0),e([h(se)],Q.prototype,`useViewTime`,null),e([h(M({disableServiceOrigin:!0,webDocumentOrigin:`web-scene`}))],Q.prototype,`timeInfo`,null),e([h({type:J,json:{read:!1,write:!1}})],Q.prototype,`timeExtent`,null),e([h({type:ke,json:{read:!1,write:!1}})],Q.prototype,`timeOffset`,null),e([h({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],Q.prototype,`datesInUnknownTimezone`,null),e([h({type:be,readOnly:!0,json:{read:{source:`timeInfo`}},clonable:!1})],Q.prototype,`serviceTimeInfo`,void 0),e([h()],Q.prototype,`isUsedAsGroundLayer`,null),Q=e([g(`esri.layers.SceneLayer`)],Q);const $={"mesh-pyramids":`mesh-pyramids`,meshpyramids:`mesh-pyramids`,"features-meshes":`mesh-pyramids`,points:`points`,"features-points":`points`,lines:`lines`,"features-lines":`lines`,polygons:`polygons`,"features-polygons":`polygons`},Pe={"mesh-pyramids":`mesh`,points:`point`},Fe=Q;export{Fe as default};
2
+ import{__decorate as e}from"tslib";import t from"../Graphic.js";import n from"../PopupTemplate.js";import{ClonableMixin as r}from"../core/Clonable.js";import i from"../core/Collection.js";import a from"../core/Error.js";import{abortHandle as o}from"../core/handleUtils.js";import s from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as l}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as u,throwIfAborted as d,isAbortError as f,throwIfNotAbortError as p}from"../core/promiseUtils.js";import{whenOnce as m}from"../core/reactiveUtils.js";import{property as h,subclass as g}from"../core/accessorSupport/decorators.js";import{getProperties as _}from"../core/accessorSupport/utils.js";import v from"../geometry/Point.js";import{projectAsync as y}from"../geometry/projectionUtils.js";import b from"../graphic/SceneGraphicOrigin.js";import x from"./Layer.js";import{NoModelError as ee,MultipleModelsError as S}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as C}from"./mixins/APIKeyMixin.js";import{ArcGISService as w}from"./mixins/ArcGISService.js";import{CustomParametersMixin as te}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as ne}from"./mixins/EditBusLayer.js";import{OperationalLayer as re}from"./mixins/OperationalLayer.js";import{PortalLayer as ie}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as ae}from"./mixins/ScaleRangeLayer.js";import{SceneService as oe}from"./mixins/SceneService.js";import{useViewTimeProperty as se}from"./mixins/TemporalLayer.js";import{isHostedAgolService as T}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as ce}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as le}from"./support/capabilities.js";import{elevationInfo as E,labelsVisible as D,legendEnabled as O,popupEnabled as k,attributeTableTemplate as A,screenSizePerspectiveEnabled as j,timeInfo as M}from"./support/commonProperties.js";import{getFieldDomain as N,computeEffectiveEditingEnabled as P,getGlobalIdToObjectIdMap as F}from"./support/featureLayerUtils.js";import I from"./support/FeatureReductionSelection.js";import{defineFieldProperties as L}from"./support/fieldProperties.js";import R from"./support/FieldsIndex.js";import{fixRendererFields as z,fixTimeInfoFields as B,unpackFieldNames as V}from"./support/fieldUtils.js";import{I3SNodePageDefinition as H,I3SMaterialDefinition as U,I3STextureSetDefinition as W,I3SGeometryDefinition as ue}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as de,isFileSupported as fe}from"./support/infoFor3D.js";import pe from"./support/LabelClass.js";import{reader as G}from"./support/labelingInfo.js";import me from"./support/LayerFloorInfo.js";import{layersLoaderMap as he}from"./support/layersLoader.js";import{getMeshTransformForMetersToSpatialReference as ge}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as _e}from"./support/RangeInfo.js";import ve from"./support/SceneFilter.js";import{cacheIsOutOfSync as K}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as ye}from"./support/sceneLayerStatistics.js";import{SceneServiceTimeInfo as be}from"./support/SceneServiceTimeInfo.js";import xe from"./support/TimeInfo.js";import{loadStyleRenderer as Se}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Ce}from"../renderers/support/typeUtils.js";import we from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as q,elevationModeUnsupportedMessage as Te,featureExpressionUnsupportedMessage as Ee}from"../support/elevationInfoUtils.js";import{createPopupTemplate as De}from"../support/popupUtils.js";import{extractZipFiles as Oe}from"../support/zipUtils.js";import J from"../time/TimeExtent.js";import ke from"../time/TimeInterval.js";import{queryAttributesFromCachedAttributesId as Ae}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as je,getFetchPopupTemplate as Me}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Ne}from"../webdoc/support/opacityUtils.js";import{reader as Y}from"../core/accessorSupport/decorators/reader.js";const X=new Set([`3DObject`,`Point`]),Z=L();let Q=class extends ne(oe(w(re(ie(ae(l(te(C(r(x)))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType=`ArcGISSceneServiceLayer`,this.type=`scene`,this.fields=null,this.graphicOrigin=new b(this),this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new i,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0,this.serviceTimeInfo=null}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}destroy(){this._set(`renderer`,null),this.associatedLayer=c(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){let n=this.getField(e)?.domain??null;return this.associatedLayer?N(this.associatedLayer,e,t,n):n}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new R(this.fields)}readNodePages(e,t,n){return t.layerType===`Point`&&(e=t.pointNodePages),typeof e!=`object`||!e?null:H.fromJSON(e,n)}set elevationInfo(e){this._set(`elevationInfo`,e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return this.associatedLayer!=null&&P(this.associatedLayer)}get geometryType(){return Pe[this.profile]||`mesh`}set renderer(e){z(e,this.fieldsIndex),this._set(`renderer`,e)}readCachedDrawingInfo(e){return(typeof e!=`object`||!e)&&(e={}),e.color??(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e??=le;let{query:t,queryRelated:n,editing:{supportsGlobalId:r,supportsRollbackOnFailure:i,supportsUploadWithItemId:a,supportsGeometryUpdate:o,supportsReturnServiceEditsInSourceSpatialReference:s},data:{supportsZ:c,supportsM:l,isVersioned:u,supportsAttachment:d},operations:{supportsEditing:f,supportsAdd:p,supportsUpdate:m,supportsDelete:h,supportsQuery:g,supportsQueryAttachments:_,supportsAsyncConvert3D:v},attachment:y}=e,b=e.operations.supportsChangeTracking,x=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:n,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:s,supportsRollbackOnFailure:i,supportsGeometryUpdate:x&&o,supportsUploadWithItemId:a},data:{supportsAttachment:d,supportsZ:c,supportsM:l,isVersioned:u,queryFormats:e.data.queryFormats,sourceFormats:e.data.sourceFormats},operations:{supportsQuery:g,supportsQueryAttachments:_,supportsEditing:f&&b,supportsAdd:x&&p&&b,supportsDelete:x&&h&&b,supportsUpdate:m&&b,supportsAsyncConvert3D:v},attachment:y}}get editingEnabled(){return this._isOverridden(`editingEnabled`)?this._get(`editingEnabled`):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome(`editingEnabled`,e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>(t.type===`esriFieldTypeOID`&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>(t.type===`esriFieldTypeGlobalID`&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){let n=t.store.profile;return n!=null&&$[n]?$[n]:(s.getLogger(this).error(`Unknown or missing profile`,{profile:n,layer:this}),`mesh-pyramids`)}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override(`useViewTime`,e)}get timeInfo(){let e=this.associatedLayer?.timeInfo;if(e==null)return null;let t=e.clone();return B(t,this.fieldsIndex),t}set timeInfo(e){B(e,this.fieldsIndex),this._override(`timeInfo`,e)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(e){this._override(`timeExtent`,e)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(e){this._override(`timeOffset`,e)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(e){this._override(`datesInUnknownTimezone`,e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){let t=e?.signal;await this.loadFromPortal({supportedTypes:[`Scene Service`]},e).catch(u),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await Se(this,{origin:`service`},t),z(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){s.getLogger(this).error(`#_loadFilterGeometries()`,this,`Failed to load filter geometries. Geometry filter will not be applied for this layer.`,{error:e}),this.filter=null}}createQuery(){let e=new we;this.geometryType===`mesh`?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0);let{timeOffset:t,timeExtent:n}=this;return e.timeExtent=t!=null&&n!=null?n.offset(-t.value,t.unit):n||null,e.where=this.definitionExpression||`1=1`,e.sqlFormat=`standard`,e.outFields=[`*`],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(let t of e.features)t.layer=this,t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}async queryModels(e,t){let[n,{queryModels:r}]=await Promise.all([this._getAssociatedLayerForQuery(),import(`./scene/modelQuerySupport.js`)]);return r(this,n,e,t)}async queryModel(e,t){let[n,{queryModel:r}]=await Promise.all([this._getAssociatedLayerForQuery(),import(`./scene/modelQuerySupport.js`)]);return r(this,n,e,t)}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new a(`scenelayer:query-not-available`,`SceneLayer queries are not available without an associated feature layer`,{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new a(`scenelayer:query-not-available`,`SceneLayer queries are not available without an associated feature layer`,{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){let n=V(this.fieldsIndex,await je(this,Me(this)));return Ae(this.parsedUrl?.path??``,this.attributeStorageInfo??[],e,t,n,this.apiKey,this.customParameters)}async queryCachedFeature(e,n){let r=await this.queryCachedAttributes(e,[n]);if(!r||r.length===0)throw new a(`scenelayer:feature-not-in-cached-data`,`Feature not found in cached data`);let i=new t;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i.origin=this.graphicOrigin,i}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryAttachments(e,t))}getFieldUsageInfo(e){let t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(s.getLogger(this).error(`#getFieldUsageInfo()`,`Unavailable until layer is loaded`),t)}createPopupTemplate(e){return De(this,e)}_getAssociatedLayerForQuery(){let e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new a(`scenelayer:query-not-available`,`SceneLayer queries are not available without an associated feature layer`,{layer:this});try{await this.associatedLayer.load()}catch(e){throw new a(`scenelayer:query-not-available`,`SceneLayer associated feature layer could not be loaded`,{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:`scene`},e)}async save(){return this._debouncedSaveOperations(0,{getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:`scene`})}async applyEdits(e,t){let{applyEdits:n}=await import(`./graphics/editingSupport.js`),r=t;await this.load();let i=this.associatedLayer;if(!i)throw new a(`${this.type}-layer:not-editable`,`Service is not editable`);await i.load();let{globalIdField:o}=i,s=!!i.infoFor3D,c=r?.globalIdUsed??!0;if(s&&o==null)throw new a(`${this.type}-layer:not-editable`,`Valid globalIdField expected on editable SceneLayer`);if(s&&!c)throw new a(`${this.type}-layer:globalid-required`,`globalIdUsed must not be false for SceneLayer editing as globalIds are required.`);return T(i.url)&&s&&e.deleteFeatures!=null&&o!=null&&(r={...r,globalIdToObjectId:await F(i,e.deleteFeatures,o)}),n(this,i.source,e,r)}async uploadAssets(e,t){if(await this.load(),this.associatedLayer==null)throw new a(`${this.type}-layer:not-editable`,`Service is not editable`);return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={};let n=e=>{throw s.getLogger(this).error(`.convertMesh()`,e.message),e};await this.load(t),this.infoFor3D||n(new a(`invalid:layer`,`SceneLayer has no capability for mesh conversion`));let r=await this.extractAndFilterFiles(e);d(t);let i=r.reduce((e,t)=>de(this.infoFor3D,t)?e+1:e,0);i===0&&n(new ee),i>1&&n(new S);let o=this.spatialReference,c=t.origin,l=await y(c??t.defaultOrigin??new v({x:0,y:0,z:0,spatialReference:o}),o,t),u=o.isGeographic?`local`:`georeferenced`,{createWithExternalSource:f}=await import(`../geometry/support/meshUtils.js`);d(t);let p=f(l,{type:`client`,files:r},{vertexSpace:u,transform:ge(o),unitConversionDisabled:!0}),[m]=await this.uploadAssets([p],{...t,useAssetOrigin:!c});return m}async extractAndFilterFiles(e){await this.load();let t=this.infoFor3D;return t?(await Oe(e)).filter(e=>fe(t,e)):e}validateLayer(e){if(e.layerType&&!X.has(e.layerType))throw new a(`scenelayer:layer-type-not-supported`,`SceneLayer does not support this layer type`,{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new a(`layer:service-version-not-supported`,`Service version is not supported.`,{serviceVersion:this.version.versionString,supportedVersions:`1.x, 2.x`});if(this.version.major>2)throw new a(`layer:service-version-too-new`,`Service version is too new.`,{serviceVersion:this.version.versionString,supportedVersions:`1.x, 2.x`});t(this.normalReferenceFrame,this.spatialReference);function t(e,t){let n=!1,r=!1;if(e==null)n=!0,r=!0;else{let i=t&&t.isGeographic;switch(e){case`east-north-up`:case`earth-centered`:n=!0,r=i;break;case`vertex-reference-frame`:n=!0,r=!i;break;default:n=!1}}if(!n)throw new a(`scenelayer:unsupported-normal-reference-frame`,`Normal reference frame is invalid.`);if(!r)throw new a(`scenelayer:incompatible-normal-reference-frame`,`Normal reference frame is incompatible with layer spatial reference.`)}}get isUsedAsGroundLayer(){return!1}_getTypeKeywords(){let e=[];if(this.profile===`points`)e.push(`Point`);else if(this.profile===`mesh-pyramids`)e.push(`3DObject`);else throw new a(`scenelayer:unknown-profile`,`SceneLayer:save() encountered an unknown SceneLayer profile: `+this.profile);return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(let e of this.fields){let t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),n=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),r={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||n,supportsLayerQuery:n};this._fieldUsageInfo[e.name]=r}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(let t of this.associatedLayer.fields){let n=this.getField(t.name);n?(!n.domain&&t.domain&&(n.domain=t.domain.clone()),n.editable=t.editable,n.nullable=t.nullable,n.length=t.length):(e||=this.fields?this.fields.slice():[],e.push(t.clone()))}e&&this._set(`fields`,e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;let e=[`popupTemplate`,`popupEnabled`,`attributeTableTemplate`],t=_(this);for(let n=0;n<e.length;n++){let r=e[n],i=this.originIdOf(r),a=this.associatedLayer.originIdOf(r);i<a&&(a===2||a===3)&&t.setAtOrigin(r,this.associatedLayer[r],a)}}_applyAssociatedLayerExtentOverride(){let e=this.associatedLayer?.getAtOrigin(`fullExtent`,`service`);this.associatedLayer?.infoFor3D!=null&&e&&T(this.associatedLayer?.url)&&K(this)&&_(this).setAtOrigin(`fullExtent`,e.clone(),2)}_applyAssociatedLayerPrivileges(){let e=this.associatedLayer;e&&(this._set(`userHasEditingPrivileges`,e.userHasEditingPrivileges),this._set(`userHasFullEditingPrivileges`,e.userHasFullEditingPrivileges),this._set(`userHasUpdateItemPrivileges`,e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if([`mesh-pyramids`,`points`].includes(this.profile))try{let{serverUrl:t,layerId:n,portalItem:r}=await ce(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),i=await he.FeatureLayer();this.associatedLayer=new i({url:t,customParameters:this.customParameters,apiKey:this.apiKey,layerId:n,portalItem:r}),await this.associatedLayer.load()}catch(e){f(e)||this._logWarningOnPopupEnabled().catch(()=>{})}}async _logWarningOnPopupEnabled(){let e=new AbortController;this.addHandles(o(e));try{await m(()=>this.popupEnabled&&this.popupTemplate!=null,e.signal)}catch(e){p(e);return}let t=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?s.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):s.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){let e=this.elevationInfo;this.profile===`mesh-pyramids`&&q(s.getLogger(this),Te(`Mesh scene layers`,`relative-to-scene`,e)),q(s.getLogger(this),Ee(`Scene layers`,e))}async fetchStatistics(e,t){return await ye({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:`scenelayer`,fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??``,customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}async loadTimeInfoFromService(e){let{serviceTimeInfo:t}=this;if(t==null)return;let{startTimeField:n,endTimeField:r}=t;if(n==null&&r==null||K({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;let i=async t=>{let r=null;try{r=(await this.fetchStatistics(t,e))?.stats}catch{}if(r==null)return null;let{minTimeStr:i,min:a,maxTimeStr:o,max:s}=r,c=t===n?i??a:o??s;return c==null?null:new Date(c)},[a,o]=await Promise.all([i(n),i(r)]);if(n!=null&&a==null||r!=null&&o==null)return;let s=new J({start:a,end:o});this.setAtOrigin(`timeInfo`,new xe({endField:r,startField:n,fullTimeExtent:s}),`service`)}};e([h({types:{key:`type`,base:null,typeMap:{selection:I}},json:{origins:{"web-scene":{name:`layerDefinition.featureReduction`,write:{allowNull:!0}},"portal-item":{name:`layerDefinition.featureReduction`,write:{allowNull:!0}}}}})],Q.prototype,`featureReduction`,void 0),e([h({type:[_e],json:{read:!1,origins:{"web-scene":{name:`layerDefinition.rangeInfos`,write:!0},"portal-item":{name:`layerDefinition.rangeInfos`,write:!0}}},clonable:!1})],Q.prototype,`rangeInfos`,void 0),e([h({json:{read:!1}})],Q.prototype,`associatedLayer`,void 0),e([h({type:[`show`,`hide`]})],Q.prototype,`listMode`,void 0),e([h({type:[`ArcGISSceneServiceLayer`]})],Q.prototype,`operationalLayerType`,void 0),e([h({json:{read:!1},readOnly:!0})],Q.prototype,`type`,void 0),e([h({...Z.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`fields`,void 0),e([h()],Q.prototype,`types`,null),e([h()],Q.prototype,`typeIdField`,null),e([h()],Q.prototype,`templates`,null),e([h()],Q.prototype,`formTemplate`,null),e([h({readOnly:!0})],Q.prototype,`graphicOrigin`,void 0),e([h({readOnly:!0,clonable:!1})],Q.prototype,`fieldsIndex`,null),e([h({type:me,json:{read:{source:`layerDefinition.floorInfo`},write:{target:`layerDefinition.floorInfo`}}})],Q.prototype,`floorInfo`,void 0),e([h(Z.outFields)],Q.prototype,`outFields`,void 0),e([h({type:H,readOnly:!0,json:{read:!1},clonable:!1})],Q.prototype,`nodePages`,void 0),e([Y(`service`,`nodePages`,[`nodePages`,`pointNodePages`])],Q.prototype,`readNodePages`,null),e([h({type:[U],readOnly:!0,clonable:!1})],Q.prototype,`materialDefinitions`,void 0),e([h({type:[W],readOnly:!0,clonable:!1})],Q.prototype,`textureSetDefinitions`,void 0),e([h({type:[ue],readOnly:!0,clonable:!1})],Q.prototype,`geometryDefinitions`,void 0),e([h({readOnly:!0})],Q.prototype,`serviceUpdateTimeStamp`,void 0),e([h({readOnly:!0})],Q.prototype,`attributeStorageInfo`,void 0),e([h({readOnly:!0})],Q.prototype,`statisticsInfo`,void 0),e([h({type:i.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:`layerDefinition.excludeObjectIds`,write:{enabled:!0}}})],Q.prototype,`excludeObjectIds`,void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:`layerDefinition.definitionExpression`,write:{enabled:!0,allowNull:!0}}})],Q.prototype,`definitionExpression`,void 0),e([h({type:ve,json:{name:`layerDefinition.polygonFilter`,write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Q.prototype,`filter`,void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Q.prototype,`path`,void 0),e([h(E)],Q.prototype,`elevationInfo`,null),e([h({readOnly:!0,json:{read:!1}})],Q.prototype,`effectiveCapabilities`,null),e([h({readOnly:!0})],Q.prototype,`effectiveEditingEnabled`,null),e([h({type:String})],Q.prototype,`geometryType`,null),e([h(D)],Q.prototype,`labelsVisible`,void 0),e([h({type:[pe],json:{origins:{service:{name:`drawingInfo.labelingInfo`,read:{reader:G},write:!1}},name:`layerDefinition.drawingInfo.labelingInfo`,read:{reader:G},write:!0}})],Q.prototype,`labelingInfo`,void 0),e([h(O)],Q.prototype,`legendEnabled`,void 0),e([h({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:[`opacity`,`layerDefinition.drawingInfo.transparency`],reader(e,t){if(typeof e==`number`&&e>=0&&e<=1)return e;let n=t.layerDefinition?.drawingInfo?.transparency;return n===void 0?void 0:Ne(n)}}},"portal-item":{write:!0},service:{read:!1}}}})],Q.prototype,`opacity`,void 0),e([h({type:[`Low`,`High`],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`priority`,void 0),e([h({type:[`Labels`],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`semantic`,void 0),e([h({types:Ce,json:{origins:{service:{read:{source:`drawingInfo.renderer`}}},name:`layerDefinition.drawingInfo.renderer`,write:!0},value:null})],Q.prototype,`renderer`,null),e([h({json:{read:!1}})],Q.prototype,`cachedDrawingInfo`,void 0),e([Y(`service`,`cachedDrawingInfo`)],Q.prototype,`readCachedDrawingInfo`,null),e([h({readOnly:!0,json:{read:!1}})],Q.prototype,`capabilities`,null),e([h({type:Boolean,json:{read:!1}})],Q.prototype,`editingEnabled`,null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Q.prototype,`infoFor3D`,null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Q.prototype,`relationships`,null),e([h(k)],Q.prototype,`popupEnabled`,void 0),e([h({type:n,json:{name:`popupInfo`,write:!0}})],Q.prototype,`popupTemplate`,void 0),e([h({readOnly:!0,json:{read:!1}})],Q.prototype,`defaultPopupTemplate`,null),e([h(A)],Q.prototype,`attributeTableTemplate`,void 0),e([h({type:String,json:{read:!1}})],Q.prototype,`objectIdField`,void 0),e([Y(`service`,`objectIdField`,[`objectIdField`,`fields`])],Q.prototype,`readObjectIdField`,null),e([h({type:String,json:{read:!1}})],Q.prototype,`globalIdField`,void 0),e([Y(`service`,`globalIdField`,[`globalIdField`,`fields`])],Q.prototype,`readGlobalIdField`,null),e([h({readOnly:!0,type:String,json:{read:!1}})],Q.prototype,`displayField`,null),e([h({type:String,json:{read:!1}})],Q.prototype,`profile`,void 0),e([Y(`service`,`profile`,[`store.profile`])],Q.prototype,`readProfile`,null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:`store.normalReferenceFrame`}}},read:!1}})],Q.prototype,`normalReferenceFrame`,void 0),e([h(j)],Q.prototype,`screenSizePerspectiveEnabled`,void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`serviceItemId`,void 0),e([h(se)],Q.prototype,`useViewTime`,null),e([h(M({disableServiceOrigin:!0,webDocumentOrigin:`web-scene`}))],Q.prototype,`timeInfo`,null),e([h({type:J,json:{read:!1,write:!1}})],Q.prototype,`timeExtent`,null),e([h({type:ke,json:{read:!1,write:!1}})],Q.prototype,`timeOffset`,null),e([h({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],Q.prototype,`datesInUnknownTimezone`,null),e([h({type:be,readOnly:!0,json:{read:{source:`timeInfo`}},clonable:!1})],Q.prototype,`serviceTimeInfo`,void 0),e([h()],Q.prototype,`isUsedAsGroundLayer`,null),Q=e([g(`esri.layers.SceneLayer`)],Q);const $={"mesh-pyramids":`mesh-pyramids`,meshpyramids:`mesh-pyramids`,"features-meshes":`mesh-pyramids`,points:`points`,"features-points":`points`,lines:`lines`,"features-lines":`lines`,polygons:`polygons`,"features-polygons":`polygons`},Pe={"mesh-pyramids":`mesh`,points:`point`},Fe=Q;export{Fe as default};
@@ -107,7 +107,6 @@ export interface SketchLayerProperties extends LayerProperties, PortalLayerPrope
107
107
  * @see [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/)
108
108
  * @see [WebMap](https://developers.arcgis.com/javascript/latest/references/core/WebMap/)
109
109
  * @see [SketchViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/)
110
- * @see [Sample - MapNotesLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-mapnoteslayer/)
111
110
  */
112
111
  export default class SketchLayer extends SketchLayerSuperclass {
113
112
  constructor(properties?: SketchLayerProperties);
@@ -395,7 +395,7 @@ export default class SubtypeGroupLayer extends SubtypeGroupLayerSuperclass {
395
395
  */
396
396
  applyEdits(edits: Edits, options?: EditOptions): Promise<EditsResult>;
397
397
  /**
398
- * Creates query parameter object that can be used to fetch features from feature-based layers or
398
+ * Creates a query parameter object that can be used to fetch features from feature-based layers or
399
399
  * image footprints from ImageryLayer that satisfy the layer's configurations such as [definitionExpression](https://developers.arcgis.com/javascript/latest/references/core/layers/SubtypeGroupLayer/#definitionExpression).
400
400
  * It will return `Z` and `M` values based on the layer's [data capabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/SubtypeGroupLayer/#capabilities).
401
401
  * It sets the query parameter's [Query.outFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outFields) property to `["*"]`.
@@ -621,7 +621,7 @@ export default class WFSLayer extends WFSLayerSuperclass {
621
621
  */
622
622
  createPopupTemplate(options?: CreatePopupTemplateOptions): PopupTemplate | null | undefined;
623
623
  /**
624
- * Creates query parameter object that can be used to fetch features from feature-based layers or
624
+ * Creates a query parameter object that can be used to fetch features from feature-based layers or
625
625
  * image footprints from ImageryLayer that satisfy the layer's configurations such as [definitionExpression](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/#definitionExpression).
626
626
  * It will return `Z` and `M` values based on the layer's [data capabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/#capabilities).
627
627
  * It sets the query parameter's [Query.outFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outFields) property to `["*"]`.
@@ -215,7 +215,7 @@ export default class BuildingComponentSublayer extends BuildingComponentSublayer
215
215
  * satisfy the component sublayer's current [definition expression](https://developers.arcgis.com/javascript/latest/references/core/layers/buildingSublayers/BuildingComponentSublayer/#definitionExpression).
216
216
  * The query should only be used on the layer and not on the layer view.
217
217
  *
218
- * @returns The query object representing the layer's
218
+ * @returns The query parameter object representing the layer's
219
219
  * definition expression.
220
220
  * @since 4.17
221
221
  */
@@ -648,7 +648,7 @@ export default class CatalogFootprintLayer extends CatalogFootprintLayerSupercla
648
648
  */
649
649
  createPopupTemplate(options?: CreatePopupTemplateOptions): PopupTemplate | null | undefined;
650
650
  /**
651
- * Creates query parameter object that can be used to fetch features from feature-based layers or
651
+ * Creates a query parameter object that can be used to fetch features from feature-based layers or
652
652
  * image footprints from ImageryLayer that satisfy the layer's configurations such as [definitionExpression](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#definitionExpression).
653
653
  * It will return `Z` and `M` values based on the layer's [data capabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#capabilities).
654
654
  * It sets the query parameter's [Query.outFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outFields) property to `["*"]`.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as n}from"../../../../core/compilerUtils.js";import r from"../../../../core/Error.js";import i from"../../../../core/Handles.js";import has from"../../../../core/has.js";import a from"../../../../core/Logger.js";import{onAbortOrThrow as o,throwIfAborted as s}from"../../../../core/promiseUtils.js";import{QueueProcessor as c}from"../../../../core/QueueProcessor.js";import{parseWhereClause as l}from"../../../../core/sql.js";import{getMetersPerUnitForSR as u}from"../../../../core/units.js";import d from"../../../../geometry/SpatialReference.js";import{set as f,create as p,expandWithAABB as m,expandWithRect as ee,negativeInfinity as h}from"../../../../geometry/support/aaBoundingBox.js";import{copy as te,negativeInfinity as g,create as ne,expandWithRect as re}from"../../../../geometry/support/aaBoundingRect.js";import{isWebMercator as _,isWGS84 as v}from"../../../../geometry/support/spatialReferenceUtils.js";import{normalizeColumnPath as y,readParquetFileAttribute as b}from"../../../parquet.js";import{convertToGeometry as x}from"../../featureConversionUtils.js";import{getFieldNamesFromStatistics as S}from"../../data/attributeSupport.js";import{getQueryResultExtent as C,getQueryBoundingRects as w,QueryEngine as T}from"../../data/QueryEngine.js";import{queryCapabilities as ie}from"../../data/QueryEngineCapabilities.js";import{QueryEngineResult as E}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as D}from"../../data/queryUtils.js";import{createFileProvider as O}from"../parquet/createFileProvider.js";import{readFieldStatistic as k}from"../parquet/ParquetFileStatistics.js";import{createDrawingInfo as ae}from"./clientSideDefaults.js";import{getParquetFileId as oe,getParquetRowId as se,getParquetObjectId as ce}from"./parquetIdUtils.js";import A from"../../../support/Field.js";import j from"../../../support/FieldsIndex.js";import{isNumericField as M}from"../../../support/fieldUtils.js";import{fromParquetGeometryEncodingJSON as N}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as P,fromParquetJSONGeometryType as F,toParquetJSONGeometryType as I}from"../../../support/parquetUtils.js";import{loadParquetModule as L}from"../../../../libs/librust-parquet/loadParquetModule.js";import{utc as R}from"../../../../time/constants.js";import{FeatureStoreQueryAdapter as z}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as B}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as V}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as H}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as U}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const W=new z,G=`__OBJECTID`,K=8e3;class le{constructor(e,t){this._files=e,this._createFileStream=t,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(e){for(await this._fill(e);this._pending.size>0;){s(e),await this._fill(e);let t=await ue(this._pending);if(this._pending.delete(t.read),this._resolvedCount++,t.chunk!=null)return t.chunk}return null}async _fill(e){for(this._removeDone();this._pending.size<8;){let t=this._getOrCreateNextStream(e);if(t==null)return;this._pending.add(t.read(e))}}_getOrCreateNextStream(e){let t=this._resolvedCount>=8?8:2;if(this._fileIndex<this._files.length&&this._streams.length<t){let t=this._files[this._fileIndex++],n=new de(t.id,this._createFileStream(t,e));return this._streams.push(n),n}return this._getNextStream()}_getNextStream(){let e=this._streams.length;for(let t=0;t<e;t++){let n=(this._streamIndex+t)%e,r=this._streams[n];if(r.canRead)return this._streamIndex=(n+1)%e,r}return null}_removeDone(){let e=this._streamIndex;for(let t=this._streams.length-1;t>=0;t--)this._streams[t].done&&(this._streams.splice(t,1),t<e&&e--);this._streamIndex=this._streams.length>0?e%this._streams.length:0}}function ue(e){return Promise.race(Array.from(e,async e=>({read:e,chunk:await e})))}class de{constructor(e,t){this._fileId=e,this._stream=t,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&this._readCount===0}async read(e){this._readCount++;try{let t=await(await this._stream).next(e);return t==null?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:t}}finally{this._readCount--}}}class fe{constructor(){this._hasZ=!1,this._hasM=!1,this._queue=new c({concurrency:4,process:(e,t)=>this._executeQuery(e,t)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={},this._handles=new i}async load(e){let t=e.spatialReference?d.fromJSON(e.spatialReference):void 0;if(t&&!t.isWGS84&&!t.isWebMercator)throw new r(`parquet:unsupported-projection`,`Only WGS84 and Web Mercator are supported`);this._customParameters=e.customParameters,this._loadParameters=e,await this._updateProvider(O(e.provider,null,()=>this._customParameters));let n=await this._provider.getMetadata(),i=await P(n,{fields:e.fields?.map(e=>A.fromJSON(e)),geometryEncoding:e.geometryEncoding?N(e.geometryEncoding):null,geometryType:e.geometryType?F(e.geometryType):null,displayOptimization:e.displayOptimization,spatialReference:t});if(this._hasZ=!!n?.hasZ,this._hasM=!!n?.hasM,!i.fields)throw new r(`parquet:unsupported`,`Fields must be defined`);let o;if(i.spatialReference&&i.geometryType){if(!i.spatialReference)throw new r(`parquet:unsupported`,`SpatialReference must be defined`);if(!i.spatialReference.isGeographic&&!i.spatialReference.isWebMercator)throw new r(`parquet:unsupported-projection`,`Only WGS84 and Web Mercator are supported`);i.spatialReference.isGeographic&&!i.spatialReference.isWGS84&&(a.getLogger(`parquet:unsupported-projection`).warn(`Found a geographic projection that is not WGS84. Handling as WGS84.`,{spatialReference:i.spatialReference}),i.spatialReference=d.WGS84),o={geometry:i.geometryEncoding?{geometryType:I(i.geometryType),spatialReference:i.spatialReference.toJSON(),encoding:i.geometryEncoding.toJSON()}:null,displayOptimization:i.displayOptimization}}this.setCustomParameters(e.customParameters),this._displayOptimization=i.displayOptimization,await this._provider.updateGeometryInfo(o),this._capabilities=$(await this._getFileStatistics(),this._hasZ,this._hasM);let s=await this._provider.getFiles();if(!s.length)return{layerDefinition:{},capabilities:$(null,this._hasZ,this._hasM)};let c=await s[0].file;i.file=c;let{fields:l}=i;if(l==null)throw new r(`parquet-layer:missing-metadata`,`Unable to create parquet source: cannot infer fields`,l);l.push(new A({name:G,type:`oid`,alias:G}));for(let e of l){let t=c.getColumnId(e.name);t!=null&&(this._indexMap[e.name]=t)}let u=j.fromLayerJSON({fields:l.map(e=>e.toJSON()),dateFieldsTimeReference:{timeZoneIANA:`UTC`}});this._fieldsIndex=u;let f=I(i.geometryType??`point`);return this._metadata=H.createFeature({fieldsIndex:u.toJSON(),geometryType:f,hasZ:this._hasZ,hasM:this._hasM,featureIdInfo:{type:`object-id`,fieldName:G},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:i.spatialReference,outSpatialReference:null,attributeSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:R}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:f,featureIdInfo:{type:`object-id`,fieldName:G},hasM:this._hasM,hasZ:this._hasZ,spatialReference:i.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=n?.extent?n.extent:await this._tryDeriveParquetFullExtent(i),{capabilities:this._capabilities,layerDefinition:{fields:i.fields?.map(e=>e.toJSON()),drawingInfo:ae(f),extent:this._fullExtent??void 0,geometryType:f,geometryEncoding:i.geometryEncoding?.toJSON(),displayOptimization:i.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(let{handle:e}of this._streams.values())e.remove();this._streams.clear(),this._indexMap={},this._handles.removeAll()}async reload(e){this.destroy(),await this.load(e)}set remoteClient(e){this._source=e.createInvokeProxy(``)}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async updateFileProvider(e){this._loadParameters={...this._loadParameters,provider:e};let t=O(e,this._provider.getGeometryInfo(),()=>this._customParameters);await this._updateProvider(t)}async getDiagnosticsSnapshot(){let e=await this._provider.getFiles();return{files:await Promise.all(e.map(e=>e.getDiagnosticsSnapshot()))}}async getColumnIndex(e){return(await this._getFileInfoById(e.fileId)).getColumnIndex(e.rowGroupIndex,e.columnIndex)}async getOffsetIndex(e){return(await this._getFileInfoById(e.fileId)).getOffsetIndex(e.rowGroupIndex,e.columnIndex)}async queryFeatures(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),we(n)||(n.resultRecordCount=n.resultRecordCount?Math.min(n.resultRecordCount,K):K,n.resultOffset=n.resultOffset??0),n.outStatistics?this._queryStatistics(n,t):(n.returnDistinctValues&&(n.returnGeometry=void 0),(await this._enqueueQuery(n,t)).createQueryResponse())}async queryFeatureCount(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),!q(n)&&!n.returnDistinctValues&&!n.groupByFieldsForStatistics?.length&&!n.outStatistics?.length?this._getFeatureCount():(n.returnDistinctValues||(n.outFields=void 0),n.returnGeometry=void 0,(await this._enqueueQuery(n,t)).createQueryResponseForCount())}async queryObjectIds(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),q(n)?(n.resultRecordCount=n.resultRecordCount?Math.min(n.resultRecordCount,8e3):8e3,n.resultOffset=n.resultOffset??0,n.returnGeometry=void 0,n.outFields=void 0,n.returnDistinctValues=void 0,(await this._enqueueQuery(n,t)).items.map(e=>e.getObjectId())):Array.from({length:await this._getFeatureCount()},(e,t)=>t)}async queryAttributeBins(e,t={}){throw new r(`parquet:unsupported`,`queryAttributeBins not supported.`)}async queryExtent(e,t){let r=await D(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),this._fullExtent&&!q(r))return{count:await this._getFeatureCount(),extent:this._fullExtent};let i=n(this._metadata.spatialReference);r.returnGeometry=!0,r.outFields=void 0;let a=f(p(),h),o=p(),s=await this._enqueueQuery(r,t),c=0;for(let e of s.items)e.getBounds(o)&&(m(a,o),c+=1);let l=C(a,i,r.outSR?n(r.outSR):i.toJSON(),i,!1);return{count:c,extent:l}}async queryStream(e,t){if(!t.signal)throw Error(`InternalError: AbortSignal must be passed`);let n=await this._getCandidateFiles(e),r=new le(n,async(t,n)=>{let r=await t.file,i=await this._createParquetDisplayQuery(r,t.id,e);return r.executeQuery(i,K,n)}),i=this._streamIdCounter++,a=o(t.signal,e=>{let t=this._streams.get(i);t!=null&&(t.handle.remove(),this._streams.delete(i))});return this._streams.set(i,{stream:r,handle:a}),i}async getStreamNext(e,t){if(!t.signal)throw Error(`InternalError: AbortSignal must be passed`);let n=this._streams.get(e);if(!n)return{result:null};let r=await n.stream.next(t.signal);if(r==null)return n.handle.remove(),this._streams.delete(e),{result:null};let i=r.chunk.serialize().buffer,a={fileId:r.fileId,buffer:i};return i instanceof ArrayBuffer?{result:a,transferList:[i]}:{result:a}}async getStreamNextFeatures(e,t){let{result:n}=await this.getStreamNext(e,t);if(n==null)return null;let r=(await L()).ParquetChunk.deserialize(new Uint8Array(n.buffer)),i=new U(this._metadata,this._indexMap,r,n.fileId),a=[];for(;i.next();){let e=x(i.readGeometryWorldSpace(),i.geometryType,i.hasZ,i.hasM),t=i.readAttributes();a.push({attributes:t,geometry:e})}return{features:a}}async createPatch(e,t,n,r,i){if(!i.signal)throw Error(`InternalError: AbortSignal must be passed`);return(await(await(await this._getFileInfoById(e)).file).createChunkPatch(t,n,r,i.signal)).serialize().buffer}async _updateProvider(e){let t=this._provider;this._handles.removeAll(),this._provider=e,this._handles.add([e.events.on(`rangeRead`,e=>{this._source.onRangeRead(e)}),e.events.on(`sourceChanged`,async()=>{await this.reload(this._loadParameters),await this._source.onSourceChange()})]),await t?.destroy()}async _getCandidateFiles(e){let t=await this._provider.getFiles(),n=await this._getSpatialFilePruning(e);if(n==null)return t;let r=t.filter(e=>this._mayIncludeFileForSpatialPruning(e,n));return n.type===`xz`?Ce(r,n):r}async _queryStatistics(e,t){let n=await D({...e},null,this._queryEngineParams.spatialReference);if(n.returnGeometry=void 0,ve(n,this._fieldsIndex)){let e=await this._getStatisticsFromFiles(n);if(e)return e}return(await this._enqueueQuery(n,t)).createQueryResponse()}async _getStatisticsFromFiles(e){let t=await this._provider.getFiles(),n={},r=[];for(let i of e.outStatistics??[]){let e=xe(i,t);if(!e.available)return null;n[i.outStatisticFieldName]=e.value,r.push(be(i,this._fieldsIndex))}return{fields:r,features:[{attributes:n}]}}async _getSpatialFilePruning(e){if(e.type!==`tile`&&(e.type!==`arcade`||e.extent==null))return null;let t=this._displayOptimization?.index;if(t==null)return null;let n=e.outSpatialReference.wkid;if(t.wkid==null||n==null)return null;let r=t.wkid,i=await L();switch(t.type){case`xz`:return{type:`xz`,fieldName:y(t.code),intersects:(a,o)=>i.queryIntersectsXZStatistics(t.fullExtent,e.extent,n,r,t.maxLevel,a,o)};case`z`:return{type:`xy`,xFieldName:y(t.xColumn),yFieldName:y(t.yColumn),intersects:(t,a,o,s)=>i.queryIntersectsXYStatistics(e.extent,n,r,t,a,o,s)}}}_mayIncludeFileForSpatialPruning(e,t){switch(t.type){case`xz`:{let n=Z(e,t);return n?.type===`null-only`?!1:n?.type!==`bounds`||t.intersects(n.minValue,n.maxValue)}case`xy`:{let n=e.statistics.statistics.get(t.xFieldName),r=e.statistics.statistics.get(t.yFieldName);return n?.type===`null-only`||r?.type===`null-only`?!1:n?.type!==`bounds`||r?.type!==`bounds`||t.intersects(n.minValue,n.maxValue,r.minValue,r.maxValue)}}}async _tryDeriveParquetFullExtent(n){if(!n.spatialReference)return null;if(this._fullExtent==null&&n.geometryEncoding?.type===`location`){let r=await this._provider.getFiles(),{xField:i,yField:a}=n.geometryEncoding,o=f(p(),h),s=!1;for(let n of r){let r=await n.file;for(let n of r.rowGroups()){let r={stack:[],error:void 0,hasError:!1};try{let t=e(r,n.columnDescriptorForAttribute(i),!1),c=e(r,n.columnDescriptorForAttribute(a),!1),l=k(t),u=k(c);if(l?.type===`bounds`&&u?.type===`bounds`){let e=[l.minValue,u.minValue,l.maxValue,u.maxValue];ee(o,e),s=!0}n.free()}catch(e){r.error=e,r.hasError=!0}finally{t(r)}}}return s?{xmin:o[0],ymin:o[1],xmax:o[3],ymax:o[4],spatialReference:n.spatialReference?.toJSON()}:null}return null}async _getFileInfoById(e){let t=await this._provider.getFiles();for(let n of t)if(n.id===e)return n;throw Error(`InternalError: File ${e} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(e){return(await this._getFileInfoById(e)).file}async _createParquetQuery(e,t,n,r,i){let a=(await L()).Query.new();n!=null&&a.setPreFilterStart(n),r!=null&&a.setPreFilterCount(r),i!=null&&a.setPostFilterCount(i);let o=await this._getRequiredFields(e);a.setOutFields(o),(e.geometry||e.returnGeometry)&&a.setReturnGeometry(!0),a.setReturnZ(!!e.returnZ),a.setReturnM(!!e.returnM);let s=this._tryGetGeneralizedGeometryResolution(e);s!=null&&a.setSourceResolution(s);let c=e.geometry?.spatialReference??this._queryEngineParams.spatialReference,l=c.wkid;if(e.geometry&&(_(c)||v(c))){let t=te(ne(),g);for(let n of w(e.geometry))re(t,n);a.setOutSpatialReference(l),a.setExtent({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]})}if(e.where){let{id:n,file:r}=t;await this._setWhereClause(a,await r,n,e.where)}return a}async _createParquetDisplayQuery(e,t,n){let r=(await L()).Query.new();if(n.type===`tile`){r.setExtent(n.extent),r.setQuantizationTransform(n.transform);let e=this._sourceResolution(n.resolution,n.outSpatialReference);e!=null&&r.setSourceResolution(e)}else n.type===`arcade`&&n.extent!=null&&r.setExtent(n.extent);return r.setOutFields(n.outFields.filter(e=>this._indexMap[e]!=null)),r.setOutSpatialReference(n.outSpatialReference.wkid),r.setReturnGeometry(n.returnGeometry),r.setReturnZ(n.returnZ),r.setReturnM(n.returnM),n.where&&await this._setWhereClause(r,e,t,n.where),r}async _getFeatureCount(){return(await this._provider.getFiles()).map(e=>e.statistics.rowCount).reduce((e,t)=>e+t,0)}async _getByteLength(){return(await this._provider.getFiles()).map(e=>e.statistics.byteSize).reduce((e,t)=>e+t,0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new r(`parquet:unsupported`,`Statistics queries are not supported`,{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new r(`parquet:unsupported`,`Queries using orderBy are not supported`,{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new r(`parquet:unsupported`,`Queries using returnDistinctValues are not supported`,{query:e})}async _setWhereClause(e,t,n,i){let a=this._indexMap,o=this._fieldsIndex,s={getAttribute(e,r){let i=a[r];if(i==null){if(o.get(r)?.name===`__OBJECTID`){let t=e.row+e.rowGroupStart;return ce(n,t)}return null}let s=o.get(r);return b(t,e.rowGroup,e.row,i,s.type)}},c=await l(i,this._fieldsIndex);if(!c.isStandardized)throw new r(`sql-parse-error`,`expression is not standardized`);let u=(e,t,n)=>c.testFeatureCompiled({rowGroup:e,row:t,rowGroupStart:n},s,null),d=c.fieldNames.map(e=>o.get(e)).filter(e=>e&&this._indexMap[e?.name]!=null);e.setWhere(i),e.setWhereEvaluator(u),e.setWhereFields(d.map(e=>e.name))}async*_streamFeatures(e,t,n,r,i){let a=await this._provider.getFiles(),o=0;for(let s of a){let a=o,c=o+s.statistics.rowCount;if(o+=s.statistics.rowCount,t!=null&&t>=c)continue;let l=t==null?null:Math.max(t-a,0),u=n;if(n!=null){let e=t??0,r=e+n;u=Math.max(Math.min(r,c)-Math.max(e,a),0)}if(u===0)continue;let d=await this._createParquetQuery(e,s,l,u,r),f=await(await s.file).executeQuery(d,K),p=async()=>{let e=await f.next(i);if(!e)return null;let t=new U(this._metadata,this._indexMap,e,s.id);return X([new B(t,null,0,!1)],this._queryEngineParams)},m=await p();for(;m!=null;)yield m,m=await p()}}async _queryFeaturesWithQueryEnginePagination(e,t){let n=[],r=this._streamFeatures(e,null,null,null,t),i=await r.next();for(;!i.done;){let a=await i.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(let e of a)n.push(e);i=await r.next()}return n}async _queryFeaturesWithUpfrontPagination(e,t){let n=e.resultOffset??0,r=e.resultRecordCount??K,i,a,o;ge(e)?_e(e)||(o=n+r):(n&&=(i=n,0),a=e.resultRecordCount);let s=[],c=this._streamFeatures(e,i,a,o,t),l=await c.next();for(;!l.done&&r>0;){let i=await l.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(let e of i){if(n>0){n--;continue}if(s.push(e),--r<=0)return s}l=await c.next()}return s}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){if(e.objectIds?.length){let n=new Map;for(let t of e.objectIds){let e=oe(t),r=se(t),i=n.get(e);i||(i=[],n.set(e,i)),i.push(r)}let r=[];for(let[i,a]of n.entries()){let n=await this._executeFileIdQuery(e,i,a,t);for(let e of n)r.push(e)}return new E(r,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:W,featureIdInfo:this._queryEngineParams.featureIdInfo})}if(e.where===`1=1`&&(e.where=null),e.resultOffset??=0,e.resultRecordCount??=await this._getFeatureCount(),e.resultRecordCount>2e7&&!(this._displayOptimization&&e.geometry))throw new r(`parquet:cannot-execute-query`,`Unable to execute query, dataset is too large.`);let n=!!e.orderByFields?.length||!!e.outStatistics?.length||!!e.returnDistinctValues,i=n?await this._queryFeaturesWithQueryEnginePagination(e,t):await this._queryFeaturesWithUpfrontPagination(e,t);return n||(e.resultOffset=0),new E(i,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:W,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,n,r){let i=await this._getRequiredFields(e),a=(await L()).Query.new();a.setOutFields(i),a.setReturnGeometry(!!e.returnGeometry),a.setReturnZ(!!e.returnZ),a.setReturnM(!!e.returnM),a.setIds(new Uint32Array(n));let o=await(await this._getFile(t)).executeQuery(a,K,r),s=await o.next(r),c=0,l=[];for(;s!=null;){let e=new U(this._metadata,this._indexMap,s,t),n=new B(e,null,c++,!1);l.push(n),s=await o.next(r)}return X(l,this._queryEngineParams).executeQueryForOpaqueFeatures(e,r)}async _getRequiredFields(e){let t=new Set;if(e.outStatistics)for(let n of S(this._fieldsIndex,e.outStatistics,e.groupByFieldsForStatistics))t.add(n);else if(e.outFields)for(let n of e.outFields)t.add(n);return(t.has(`*`)?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>this._indexMap[e]!=null)}_tryGetGeneralizedGeometryResolution(e){if(!this._displayOptimization)return null;let t=e.outSR??this._queryEngineParams.spatialReference;if(!_(t)&&!v(t))return null;let n=e.quantizationParameters?.tolerance??e.maxAllowableOffset;return n?this._sourceResolution(n,t):null}_sourceResolution(e,t){let n=this._queryEngineParams.spatialReference,r=u(t)/u(n)*e;return!Number.isFinite(r)||r<=0?null:r}}function pe(e){switch(e){case`fullText`:case`having`:case`timeExtent`:case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:case`objectIds`:case`where`:case`geometry`:case`resultOffset`:case`resultRecordCount`:return!0;default:return!1}}function me(e){switch(e){case`fullText`:case`having`:case`timeExtent`:case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:case`objectIds`:case`where`:case`geometry`:return!0;default:return!1}}function he(e){switch(e){case`fullText`:case`having`:case`timeExtent`:return!0;case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:return!1;case`objectIds`:case`where`:case`resultOffset`:case`geometry`:case`resultRecordCount`:return!1}return!1}function q(e){for(let t in e){let n=t;if(pe(n)&&e[n]!==null)return!0}return!1}function ge(e){for(let t in e){let n=t;if(me(n)&&e[n]!==null)return!0}return!1}function _e(e){for(let t in e){let n=t;if(he(n)&&e[n]!==null)return!0}return!1}function ve(e,t){return!!e.outStatistics?.length&&!q(e)&&!e.groupByFieldsForStatistics?.length&&!e.orderByFields?.length&&!e.returnDistinctValues&&!e.returnAggIds&&e.outStatistics.every(e=>ye(e,t))}function ye(e,t){switch(e.statisticType){case`count`:return e.onStatisticField===`1`||t.get(e.onStatisticField)!=null;case`min`:case`max`:{let n=t.get(e.onStatisticField);return n!=null&&M(n)}default:return!1}}function be(e,t){let n=e.statisticType===`exceedslimit`?null:t.get(e.onStatisticField),r=(e.statisticType===`min`||e.statisticType===`max`)&&n?.type===`esriFieldTypeDate`?n.type:`esriFieldTypeDouble`;return{name:e.outStatisticFieldName,alias:e.outStatisticFieldName,type:r}}function xe(e,t){switch(e.statisticType){case`count`:return J(e,t);case`min`:return Y(e,t,Math.min);case`max`:return Y(e,t,Math.max);default:return{available:!1,value:null}}}function J(e,t){if(e.statisticType!==`count`)return{available:!1,value:null};if(e.onStatisticField===`1`)return{available:!0,value:t.reduce((e,t)=>e+t.statistics.rowCount,0)};let n=0;for(let r of t){let t=r.statistics.statistics.get(e.onStatisticField);if(t==null||t.nullCount==null)return{available:!1,value:null};n+=r.statistics.rowCount-t.nullCount}return{available:!0,value:n}}function Y(e,t,n){if(e.statisticType!==`min`&&e.statisticType!==`max`)return{available:!1,value:null};let r=null,i=e.statisticType===`min`?`minValue`:`maxValue`;for(let a of t){let t=a.statistics.statistics.get(e.onStatisticField);if(t==null)return{available:!1,value:null};switch(t.type){case`null-only`:continue;case`unknown`:return{available:!1,value:null};case`bounds`:{let e=Se(t[i]);if(e==null)return{available:!1,value:null};r=r==null?e:n(r,e);break}}}return{available:!0,value:r}}function Se(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function X(e,t){let n=new V;for(let t of e)n.insert(t);return new T({...t,featureStore:n})}function Z(e,t){return e.statistics.statistics.get(t.fieldName)??null}function Ce(e,t){return e.slice().sort((e,n)=>{let r=Q(e,t),i=Q(n,t);return r===i?0:r<i?-1:1})}function Q(e,t){let n=Z(e,t);return n?.type===`bounds`?n.maxValue-n.minValue:1/0}function $(e,t,n){let r=e?.featureCount,i=!1;return r!=null&&r<has(`parquetlayer-full-query-feature-count`)&&(i=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:n,supportsTrueCurve:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{...ie,maxRecordCount:K,supportsOrderBy:i,supportsDistinct:!0,supportsStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1}},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function we(e){return!!e.objectIds?.length||!!e.outStatistics||!!e.orderByFields?.length||!!e.returnDistinctValues}export{fe as default};
2
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as n}from"../../../../core/compilerUtils.js";import r from"../../../../core/Error.js";import i from"../../../../core/Handles.js";import has from"../../../../core/has.js";import a from"../../../../core/Logger.js";import{onAbortOrThrow as o,throwIfAborted as s}from"../../../../core/promiseUtils.js";import{QueueProcessor as c}from"../../../../core/QueueProcessor.js";import{parseWhereClause as l}from"../../../../core/sql.js";import{getMetersPerUnitForSR as u}from"../../../../core/units.js";import d from"../../../../geometry/SpatialReference.js";import{set as f,create as p,expandWithAABB as m,expandWithRect as ee,negativeInfinity as h}from"../../../../geometry/support/aaBoundingBox.js";import{copy as te,negativeInfinity as g,create as ne,expandWithRect as re}from"../../../../geometry/support/aaBoundingRect.js";import{isWebMercator as _,isWGS84 as v}from"../../../../geometry/support/spatialReferenceUtils.js";import{normalizeColumnPath as y,readParquetFileAttribute as b}from"../../../parquet.js";import{convertToGeometry as x}from"../../featureConversionUtils.js";import{getFieldNamesFromStatistics as S}from"../../data/attributeSupport.js";import{getQueryResultExtent as C,getQueryBoundingRects as w,QueryEngine as T}from"../../data/QueryEngine.js";import{queryCapabilities as ie}from"../../data/QueryEngineCapabilities.js";import{QueryEngineResult as E}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as D}from"../../data/queryUtils.js";import{createFileProvider as O}from"../parquet/createFileProvider.js";import{readFieldStatistic as k}from"../parquet/ParquetFileStatistics.js";import{createDrawingInfo as ae}from"./clientSideDefaults.js";import{getParquetFileId as oe,getParquetRowId as se,getParquetObjectId as ce}from"./parquetIdUtils.js";import A from"../../../support/Field.js";import j from"../../../support/FieldsIndex.js";import{isNumericField as M}from"../../../support/fieldUtils.js";import{fromParquetGeometryEncodingJSON as N}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as P,fromParquetJSONGeometryType as F,toParquetJSONGeometryType as I}from"../../../support/parquetUtils.js";import{loadParquetModule as L}from"../../../../libs/librust-parquet/loadParquetModule.js";import{utc as R}from"../../../../time/constants.js";import{FeatureStoreQueryAdapter as z}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as B}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as V}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as H}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as U}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const W=new z,G=`__OBJECTID`,K=8e3;class le{constructor(e,t){this._files=e,this._createFileStream=t,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(e){for(await this._fill(e);this._pending.size>0;){s(e),await this._fill(e);let t=await ue(this._pending);if(this._pending.delete(t.read),this._resolvedCount++,t.chunk!=null)return t.chunk}return null}async _fill(e){for(this._removeDone();this._pending.size<8;){let t=this._getOrCreateNextStream(e);if(t==null)return;this._pending.add(t.read(e))}}_getOrCreateNextStream(e){let t=this._resolvedCount>=8?8:2;if(this._fileIndex<this._files.length&&this._streams.length<t){let t=this._files[this._fileIndex++],n=new de(t.id,this._createFileStream(t,e));return this._streams.push(n),n}return this._getNextStream()}_getNextStream(){let e=this._streams.length;for(let t=0;t<e;t++){let n=(this._streamIndex+t)%e,r=this._streams[n];if(r.canRead)return this._streamIndex=(n+1)%e,r}return null}_removeDone(){let e=this._streamIndex;for(let t=this._streams.length-1;t>=0;t--)this._streams[t].done&&(this._streams.splice(t,1),t<e&&e--);this._streamIndex=this._streams.length>0?e%this._streams.length:0}}function ue(e){return Promise.race(Array.from(e,async e=>({read:e,chunk:await e})))}class de{constructor(e,t){this._fileId=e,this._stream=t,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&this._readCount===0}async read(e){this._readCount++;try{let t=await(await this._stream).next(e);return t==null?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:t}}finally{this._readCount--}}}class fe{constructor(){this._hasZ=!1,this._hasM=!1,this._queue=new c({concurrency:4,process:(e,t)=>this._executeQuery(e,t)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={},this._handles=new i}async load(e){let t=e.spatialReference?d.fromJSON(e.spatialReference):void 0;if(t&&!t.isWGS84&&!t.isWebMercator)throw new r(`parquet:unsupported-projection`,`Only WGS84 and Web Mercator are supported`);this._customParameters=e.customParameters,this._loadParameters=e,await this._updateProvider(O(e.provider,null,()=>this._customParameters));let n=await this._provider.getMetadata(),i=await P(n,{fields:e.fields?.map(e=>A.fromJSON(e)),geometryEncoding:e.geometryEncoding?N(e.geometryEncoding):null,geometryType:e.geometryType?F(e.geometryType):null,displayOptimization:e.displayOptimization,spatialReference:t});if(this._hasZ=!!n?.hasZ,this._hasM=!!n?.hasM,!i.fields)throw new r(`parquet:unsupported`,`Fields must be defined`);let o;if(i.spatialReference&&i.geometryType){if(!i.spatialReference)throw new r(`parquet:unsupported`,`SpatialReference must be defined`);if(!i.spatialReference.isGeographic&&!i.spatialReference.isWebMercator)throw new r(`parquet:unsupported-projection`,`Only WGS84 and Web Mercator are supported`);i.spatialReference.isGeographic&&!i.spatialReference.isWGS84&&(a.getLogger(`parquet:unsupported-projection`).warn(`Found a geographic projection that is not WGS84. Handling as WGS84.`,{spatialReference:i.spatialReference}),i.spatialReference=d.WGS84),o={geometry:i.geometryEncoding?{geometryType:I(i.geometryType),spatialReference:i.spatialReference.toJSON(),encoding:i.geometryEncoding.toJSON()}:null,displayOptimization:i.displayOptimization}}this.setCustomParameters(e.customParameters),this._displayOptimization=i.displayOptimization,await this._provider.updateGeometryInfo(o),this._capabilities=$(await this._getFileStatistics(),this._hasZ,this._hasM);let s=await this._provider.getFiles();if(!s.length)return{layerDefinition:{},capabilities:$(null,this._hasZ,this._hasM)};let c=await s[0].file;i.file=c;let{fields:l}=i;if(l==null)throw new r(`parquet-layer:missing-metadata`,`Unable to create parquet source: cannot infer fields`,l);l.push(new A({name:G,type:`oid`,alias:G}));for(let e of l){let t=c.getColumnId(e.name);t!=null&&(this._indexMap[e.name]=t)}let u=j.fromLayerJSON({fields:l.map(e=>e.toJSON()),dateFieldsTimeReference:{timeZoneIANA:`UTC`}});this._fieldsIndex=u;let f=I(i.geometryType??`point`);return this._metadata=H.createFeature({fieldsIndex:u.toJSON(),geometryType:f,hasZ:this._hasZ,hasM:this._hasM,featureIdInfo:{type:`object-id`,fieldName:G},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:i.spatialReference,outSpatialReference:null,attributeSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:R}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:f,featureIdInfo:{type:`object-id`,fieldName:G},hasM:this._hasM,hasZ:this._hasZ,spatialReference:i.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=n?.extent?n.extent:await this._tryDeriveParquetFullExtent(i),{capabilities:this._capabilities,layerDefinition:{fields:i.fields?.map(e=>e.toJSON()),drawingInfo:ae(f),extent:this._fullExtent??void 0,geometryType:f,hasZ:this._hasZ,hasM:this._hasM,geometryEncoding:i.geometryEncoding?.toJSON(),displayOptimization:i.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(let{handle:e}of this._streams.values())e.remove();this._streams.clear(),this._indexMap={},this._handles.removeAll()}async reload(e){this.destroy(),await this.load(e)}set remoteClient(e){this._source=e.createInvokeProxy(``)}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async updateFileProvider(e){this._loadParameters={...this._loadParameters,provider:e};let t=O(e,this._provider.getGeometryInfo(),()=>this._customParameters);await this._updateProvider(t)}async getDiagnosticsSnapshot(){let e=await this._provider.getFiles();return{files:await Promise.all(e.map(e=>e.getDiagnosticsSnapshot()))}}async getColumnIndex(e){return(await this._getFileInfoById(e.fileId)).getColumnIndex(e.rowGroupIndex,e.columnIndex)}async getOffsetIndex(e){return(await this._getFileInfoById(e.fileId)).getOffsetIndex(e.rowGroupIndex,e.columnIndex)}async queryFeatures(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),we(n)||(n.resultRecordCount=n.resultRecordCount?Math.min(n.resultRecordCount,K):K,n.resultOffset=n.resultOffset??0),n.outStatistics?this._queryStatistics(n,t):(n.returnDistinctValues&&(n.returnGeometry=void 0),(await this._enqueueQuery(n,t)).createQueryResponse())}async queryFeatureCount(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),!q(n)&&!n.returnDistinctValues&&!n.groupByFieldsForStatistics?.length&&!n.outStatistics?.length?this._getFeatureCount():(n.returnDistinctValues||(n.outFields=void 0),n.returnGeometry=void 0,(await this._enqueueQuery(n,t)).createQueryResponseForCount())}async queryObjectIds(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),q(n)?(n.resultRecordCount=n.resultRecordCount?Math.min(n.resultRecordCount,8e3):8e3,n.resultOffset=n.resultOffset??0,n.returnGeometry=void 0,n.outFields=void 0,n.returnDistinctValues=void 0,(await this._enqueueQuery(n,t)).items.map(e=>e.getObjectId())):Array.from({length:await this._getFeatureCount()},(e,t)=>t)}async queryAttributeBins(e,t={}){throw new r(`parquet:unsupported`,`queryAttributeBins not supported.`)}async queryExtent(e,t){let r=await D(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),this._fullExtent&&!q(r))return{count:await this._getFeatureCount(),extent:this._fullExtent};let i=n(this._metadata.spatialReference);r.returnGeometry=!0,r.outFields=void 0;let a=f(p(),h),o=p(),s=await this._enqueueQuery(r,t),c=0;for(let e of s.items)e.getBounds(o)&&(m(a,o),c+=1);let l=C(a,i,r.outSR?n(r.outSR):i.toJSON(),i,!1);return{count:c,extent:l}}async queryStream(e,t){if(!t.signal)throw Error(`InternalError: AbortSignal must be passed`);let n=await this._getCandidateFiles(e),r=new le(n,async(t,n)=>{let r=await t.file,i=await this._createParquetDisplayQuery(r,t.id,e);return r.executeQuery(i,K,n)}),i=this._streamIdCounter++,a=o(t.signal,e=>{let t=this._streams.get(i);t!=null&&(t.handle.remove(),this._streams.delete(i))});return this._streams.set(i,{stream:r,handle:a}),i}async getStreamNext(e,t){if(!t.signal)throw Error(`InternalError: AbortSignal must be passed`);let n=this._streams.get(e);if(!n)return{result:null};let r=await n.stream.next(t.signal);if(r==null)return n.handle.remove(),this._streams.delete(e),{result:null};let i=r.chunk.serialize().buffer,a={fileId:r.fileId,buffer:i};return i instanceof ArrayBuffer?{result:a,transferList:[i]}:{result:a}}async getStreamNextFeatures(e,t){let{result:n}=await this.getStreamNext(e,t);if(n==null)return null;let r=(await L()).ParquetChunk.deserialize(new Uint8Array(n.buffer)),i=new U(this._metadata,this._indexMap,r,n.fileId),a=[];for(;i.next();){let e=x(i.readGeometryWorldSpace(),i.geometryType,i.hasZ,i.hasM),t=i.readAttributes();a.push({attributes:t,geometry:e})}return{features:a}}async createPatch(e,t,n,r,i){if(!i.signal)throw Error(`InternalError: AbortSignal must be passed`);return(await(await(await this._getFileInfoById(e)).file).createChunkPatch(t,n,r,i.signal)).serialize().buffer}async _updateProvider(e){let t=this._provider;this._handles.removeAll(),this._provider=e,this._handles.add([e.events.on(`rangeRead`,e=>{this._source.onRangeRead(e)}),e.events.on(`sourceChanged`,async()=>{await this.reload(this._loadParameters),await this._source.onSourceChange()})]),await t?.destroy()}async _getCandidateFiles(e){let t=await this._provider.getFiles(),n=await this._getSpatialFilePruning(e);if(n==null)return t;let r=t.filter(e=>this._mayIncludeFileForSpatialPruning(e,n));return n.type===`xz`?Ce(r,n):r}async _queryStatistics(e,t){let n=await D({...e},null,this._queryEngineParams.spatialReference);if(n.returnGeometry=void 0,ve(n,this._fieldsIndex)){let e=await this._getStatisticsFromFiles(n);if(e)return e}return(await this._enqueueQuery(n,t)).createQueryResponse()}async _getStatisticsFromFiles(e){let t=await this._provider.getFiles(),n={},r=[];for(let i of e.outStatistics??[]){let e=xe(i,t);if(!e.available)return null;n[i.outStatisticFieldName]=e.value,r.push(be(i,this._fieldsIndex))}return{fields:r,features:[{attributes:n}]}}async _getSpatialFilePruning(e){if(e.type!==`tile`&&(e.type!==`arcade`||e.extent==null))return null;let t=this._displayOptimization?.index;if(t==null)return null;let n=e.outSpatialReference.wkid;if(t.wkid==null||n==null)return null;let r=t.wkid,i=await L();switch(t.type){case`xz`:return{type:`xz`,fieldName:y(t.code),intersects:(a,o)=>i.queryIntersectsXZStatistics(t.fullExtent,e.extent,n,r,t.maxLevel,a,o)};case`z`:return{type:`xy`,xFieldName:y(t.xColumn),yFieldName:y(t.yColumn),intersects:(t,a,o,s)=>i.queryIntersectsXYStatistics(e.extent,n,r,t,a,o,s)}}}_mayIncludeFileForSpatialPruning(e,t){switch(t.type){case`xz`:{let n=Z(e,t);return n?.type===`null-only`?!1:n?.type!==`bounds`||t.intersects(n.minValue,n.maxValue)}case`xy`:{let n=e.statistics.statistics.get(t.xFieldName),r=e.statistics.statistics.get(t.yFieldName);return n?.type===`null-only`||r?.type===`null-only`?!1:n?.type!==`bounds`||r?.type!==`bounds`||t.intersects(n.minValue,n.maxValue,r.minValue,r.maxValue)}}}async _tryDeriveParquetFullExtent(n){if(!n.spatialReference)return null;if(this._fullExtent==null&&n.geometryEncoding?.type===`location`){let r=await this._provider.getFiles(),{xField:i,yField:a}=n.geometryEncoding,o=f(p(),h),s=!1;for(let n of r){let r=await n.file;for(let n of r.rowGroups()){let r={stack:[],error:void 0,hasError:!1};try{let t=e(r,n.columnDescriptorForAttribute(i),!1),c=e(r,n.columnDescriptorForAttribute(a),!1),l=k(t),u=k(c);if(l?.type===`bounds`&&u?.type===`bounds`){let e=[l.minValue,u.minValue,l.maxValue,u.maxValue];ee(o,e),s=!0}n.free()}catch(e){r.error=e,r.hasError=!0}finally{t(r)}}}return s?{xmin:o[0],ymin:o[1],xmax:o[3],ymax:o[4],spatialReference:n.spatialReference?.toJSON()}:null}return null}async _getFileInfoById(e){let t=await this._provider.getFiles();for(let n of t)if(n.id===e)return n;throw Error(`InternalError: File ${e} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(e){return(await this._getFileInfoById(e)).file}async _createParquetQuery(e,t,n,r,i){let a=(await L()).Query.new();n!=null&&a.setPreFilterStart(n),r!=null&&a.setPreFilterCount(r),i!=null&&a.setPostFilterCount(i);let o=await this._getRequiredFields(e);a.setOutFields(o),(e.geometry||e.returnGeometry)&&a.setReturnGeometry(!0),a.setReturnZ(!!e.returnZ),a.setReturnM(!!e.returnM);let s=this._tryGetGeneralizedGeometryResolution(e);s!=null&&a.setSourceResolution(s);let c=e.geometry?.spatialReference??this._queryEngineParams.spatialReference,l=c.wkid;if(e.geometry&&(_(c)||v(c))){let t=te(ne(),g);for(let n of w(e.geometry))re(t,n);a.setOutSpatialReference(l),a.setExtent({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]})}if(e.where){let{id:n,file:r}=t;await this._setWhereClause(a,await r,n,e.where)}return a}async _createParquetDisplayQuery(e,t,n){let r=(await L()).Query.new();if(n.type===`tile`){r.setExtent(n.extent),r.setQuantizationTransform(n.transform);let e=this._sourceResolution(n.resolution,n.outSpatialReference);e!=null&&r.setSourceResolution(e)}else n.type===`arcade`&&n.extent!=null&&r.setExtent(n.extent);return r.setOutFields(n.outFields.filter(e=>this._indexMap[e]!=null)),r.setOutSpatialReference(n.outSpatialReference.wkid),r.setReturnGeometry(n.returnGeometry),r.setReturnZ(n.returnZ),r.setReturnM(n.returnM),n.where&&await this._setWhereClause(r,e,t,n.where),r}async _getFeatureCount(){return(await this._provider.getFiles()).map(e=>e.statistics.rowCount).reduce((e,t)=>e+t,0)}async _getByteLength(){return(await this._provider.getFiles()).map(e=>e.statistics.byteSize).reduce((e,t)=>e+t,0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new r(`parquet:unsupported`,`Statistics queries are not supported`,{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new r(`parquet:unsupported`,`Queries using orderBy are not supported`,{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new r(`parquet:unsupported`,`Queries using returnDistinctValues are not supported`,{query:e})}async _setWhereClause(e,t,n,i){let a=this._indexMap,o=this._fieldsIndex,s={getAttribute(e,r){let i=a[r];if(i==null){if(o.get(r)?.name===`__OBJECTID`){let t=e.row+e.rowGroupStart;return ce(n,t)}return null}let s=o.get(r);return b(t,e.rowGroup,e.row,i,s.type)}},c=await l(i,this._fieldsIndex);if(!c.isStandardized)throw new r(`sql-parse-error`,`expression is not standardized`);let u=(e,t,n)=>c.testFeatureCompiled({rowGroup:e,row:t,rowGroupStart:n},s,null),d=c.fieldNames.map(e=>o.get(e)).filter(e=>e&&this._indexMap[e?.name]!=null);e.setWhere(i),e.setWhereEvaluator(u),e.setWhereFields(d.map(e=>e.name))}async*_streamFeatures(e,t,n,r,i){let a=await this._provider.getFiles(),o=0;for(let s of a){let a=o,c=o+s.statistics.rowCount;if(o+=s.statistics.rowCount,t!=null&&t>=c)continue;let l=t==null?null:Math.max(t-a,0),u=n;if(n!=null){let e=t??0,r=e+n;u=Math.max(Math.min(r,c)-Math.max(e,a),0)}if(u===0)continue;let d=await this._createParquetQuery(e,s,l,u,r),f=await(await s.file).executeQuery(d,K),p=async()=>{let e=await f.next(i);if(!e)return null;let t=new U(this._metadata,this._indexMap,e,s.id);return X([new B(t,null,0,!1)],this._queryEngineParams)},m=await p();for(;m!=null;)yield m,m=await p()}}async _queryFeaturesWithQueryEnginePagination(e,t){let n=[],r=this._streamFeatures(e,null,null,null,t),i=await r.next();for(;!i.done;){let a=await i.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(let e of a)n.push(e);i=await r.next()}return n}async _queryFeaturesWithUpfrontPagination(e,t){let n=e.resultOffset??0,r=e.resultRecordCount??K,i,a,o;ge(e)?_e(e)||(o=n+r):(n&&=(i=n,0),a=e.resultRecordCount);let s=[],c=this._streamFeatures(e,i,a,o,t),l=await c.next();for(;!l.done&&r>0;){let i=await l.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(let e of i){if(n>0){n--;continue}if(s.push(e),--r<=0)return s}l=await c.next()}return s}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){if(e.objectIds?.length){let n=new Map;for(let t of e.objectIds){let e=oe(t),r=se(t),i=n.get(e);i||(i=[],n.set(e,i)),i.push(r)}let r=[];for(let[i,a]of n.entries()){let n=await this._executeFileIdQuery(e,i,a,t);for(let e of n)r.push(e)}return new E(r,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:W,featureIdInfo:this._queryEngineParams.featureIdInfo})}if(e.where===`1=1`&&(e.where=null),e.resultOffset??=0,e.resultRecordCount??=await this._getFeatureCount(),e.resultRecordCount>2e7&&!(this._displayOptimization&&e.geometry))throw new r(`parquet:cannot-execute-query`,`Unable to execute query, dataset is too large.`);let n=!!e.orderByFields?.length||!!e.outStatistics?.length||!!e.returnDistinctValues,i=n?await this._queryFeaturesWithQueryEnginePagination(e,t):await this._queryFeaturesWithUpfrontPagination(e,t);return n||(e.resultOffset=0),new E(i,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:W,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,n,r){let i=await this._getRequiredFields(e),a=(await L()).Query.new();a.setOutFields(i),a.setReturnGeometry(!!e.returnGeometry),a.setReturnZ(!!e.returnZ),a.setReturnM(!!e.returnM),a.setIds(new Uint32Array(n));let o=await(await this._getFile(t)).executeQuery(a,K,r),s=await o.next(r),c=0,l=[];for(;s!=null;){let e=new U(this._metadata,this._indexMap,s,t),n=new B(e,null,c++,!1);l.push(n),s=await o.next(r)}return X(l,this._queryEngineParams).executeQueryForOpaqueFeatures(e,r)}async _getRequiredFields(e){let t=new Set;if(e.outStatistics)for(let n of S(this._fieldsIndex,e.outStatistics,e.groupByFieldsForStatistics))t.add(n);else if(e.outFields)for(let n of e.outFields)t.add(n);return(t.has(`*`)?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>this._indexMap[e]!=null)}_tryGetGeneralizedGeometryResolution(e){if(!this._displayOptimization)return null;let t=e.outSR??this._queryEngineParams.spatialReference;if(!_(t)&&!v(t))return null;let n=e.quantizationParameters?.tolerance??e.maxAllowableOffset;return n?this._sourceResolution(n,t):null}_sourceResolution(e,t){let n=this._queryEngineParams.spatialReference,r=u(t)/u(n)*e;return!Number.isFinite(r)||r<=0?null:r}}function pe(e){switch(e){case`fullText`:case`having`:case`timeExtent`:case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:case`objectIds`:case`where`:case`geometry`:case`resultOffset`:case`resultRecordCount`:return!0;default:return!1}}function me(e){switch(e){case`fullText`:case`having`:case`timeExtent`:case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:case`objectIds`:case`where`:case`geometry`:return!0;default:return!1}}function he(e){switch(e){case`fullText`:case`having`:case`timeExtent`:return!0;case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:return!1;case`objectIds`:case`where`:case`resultOffset`:case`geometry`:case`resultRecordCount`:return!1}return!1}function q(e){for(let t in e){let n=t;if(pe(n)&&e[n]!==null)return!0}return!1}function ge(e){for(let t in e){let n=t;if(me(n)&&e[n]!==null)return!0}return!1}function _e(e){for(let t in e){let n=t;if(he(n)&&e[n]!==null)return!0}return!1}function ve(e,t){return!!e.outStatistics?.length&&!q(e)&&!e.groupByFieldsForStatistics?.length&&!e.orderByFields?.length&&!e.returnDistinctValues&&!e.returnAggIds&&e.outStatistics.every(e=>ye(e,t))}function ye(e,t){switch(e.statisticType){case`count`:return e.onStatisticField===`1`||t.get(e.onStatisticField)!=null;case`min`:case`max`:{let n=t.get(e.onStatisticField);return n!=null&&M(n)}default:return!1}}function be(e,t){let n=e.statisticType===`exceedslimit`?null:t.get(e.onStatisticField),r=(e.statisticType===`min`||e.statisticType===`max`)&&n?.type===`esriFieldTypeDate`?n.type:`esriFieldTypeDouble`;return{name:e.outStatisticFieldName,alias:e.outStatisticFieldName,type:r}}function xe(e,t){switch(e.statisticType){case`count`:return J(e,t);case`min`:return Y(e,t,Math.min);case`max`:return Y(e,t,Math.max);default:return{available:!1,value:null}}}function J(e,t){if(e.statisticType!==`count`)return{available:!1,value:null};if(e.onStatisticField===`1`)return{available:!0,value:t.reduce((e,t)=>e+t.statistics.rowCount,0)};let n=0;for(let r of t){let t=r.statistics.statistics.get(e.onStatisticField);if(t==null||t.nullCount==null)return{available:!1,value:null};n+=r.statistics.rowCount-t.nullCount}return{available:!0,value:n}}function Y(e,t,n){if(e.statisticType!==`min`&&e.statisticType!==`max`)return{available:!1,value:null};let r=null,i=e.statisticType===`min`?`minValue`:`maxValue`;for(let a of t){let t=a.statistics.statistics.get(e.onStatisticField);if(t==null)return{available:!1,value:null};switch(t.type){case`null-only`:continue;case`unknown`:return{available:!1,value:null};case`bounds`:{let e=Se(t[i]);if(e==null)return{available:!1,value:null};r=r==null?e:n(r,e);break}}}return{available:!0,value:r}}function Se(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function X(e,t){let n=new V;for(let t of e)n.insert(t);return new T({...t,featureStore:n})}function Z(e,t){return e.statistics.statistics.get(t.fieldName)??null}function Ce(e,t){return e.slice().sort((e,n)=>{let r=Q(e,t),i=Q(n,t);return r===i?0:r<i?-1:1})}function Q(e,t){let n=Z(e,t);return n?.type===`bounds`?n.maxValue-n.minValue:1/0}function $(e,t,n){let r=e?.featureCount,i=!1;return r!=null&&r<has(`parquetlayer-full-query-feature-count`)&&(i=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:n,supportsTrueCurve:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{...ie,maxRecordCount:K,supportsOrderBy:i,supportsDistinct:!0,supportsStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1}},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function we(e){return!!e.objectIds?.length||!!e.outStatistics||!!e.orderByFields?.length||!!e.returnDistinctValues}export{fe as default};
@@ -549,7 +549,7 @@ export default class KnowledgeGraphSublayer extends KnowledgeGraphSublayerSuperc
549
549
  */
550
550
  createPopupTemplate(options?: CreatePopupTemplateOptions): PopupTemplate | null | undefined;
551
551
  /**
552
- * Creates query parameter object that can be used to fetch features from feature-based layers or
552
+ * Creates a query parameter object that can be used to fetch features from feature-based layers or
553
553
  * image footprints from ImageryLayer that satisfy the layer's configurations such as [definitionExpression](https://developers.arcgis.com/javascript/latest/references/core/layers/knowledgeGraph/KnowledgeGraphSublayer/#definitionExpression).
554
554
  * It will return `Z` and `M` values based on the layer's [data capabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/knowledgeGraph/KnowledgeGraphSublayer/#capabilities).
555
555
  * It sets the query parameter's [Query.outFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outFields) property to `["*"]`.
@@ -836,7 +836,7 @@ export abstract class ArcGISImageService {
836
836
  */
837
837
  computeStatisticsHistograms(parameters: ImageHistogramParameters | ImageHistogramParametersProperties, requestOptions?: RequestOptions): Promise<ImageServiceStatisticsHistogramsResult>;
838
838
  /**
839
- * Creates query parameter object that can be used to fetch features from feature-based layers or
839
+ * Creates a query parameter object that can be used to fetch features from feature-based layers or
840
840
  * image footprints from ImageryLayer that satisfy the layer's configurations such as [definitionExpression](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/ArcGISImageService/#definitionExpression).
841
841
  * It will return `Z` and `M` values based on the layer's [data capabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/ArcGISImageService/#capabilities).
842
842
  * It sets the query parameter's [Query.outFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outFields) property to `["*"]`.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../config.js";import{id as n}from"../../kernel.js";import r from"../../request.js";import{result as i}from"../../core/asyncUtils.js";import a from"../../core/Error.js";import{abortHandle as o}from"../../core/handleUtils.js";import s from"../../core/Logger.js";import{destroyMaybe as c}from"../../core/maybe.js";import{throwIfAborted as l,isAbortError as u,throwIfAbortError as d}from"../../core/promiseUtils.js";import{hasSameCanonicalPortal as f,hasSamePortal as p,normalize as m}from"../../core/urlUtils.js";import{property as h,subclass as g}from"../../core/accessorSupport/decorators.js";import{getOwningPortalUrl as _}from"../support/layerUtils.js";import v from"../../portal/Portal.js";import y from"../../portal/PortalItem.js";import b from"../../portal/PortalUser.js";import{getUserPrivileges as x}from"../../portal/support/portalItemUtils.js";import{reader as S}from"../../core/accessorSupport/decorators/reader.js";import{writer as C}from"../../core/accessorSupport/decorators/writer.js";const w=w=>{let E=w,D=class extends E{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){super.destroy(),this.portalItem=c(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get(`portalItem`)}set portalItem(e){e!==this._get(`portalItem`)&&(this.removeOrigin(`portal-item`),this._set(`portalItem`,e))}readPortalItem(e,t,n){if(t.itemId)return new y({id:t.itemId,portal:n?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{let{load:n}=await import(`../../portal/support/layersLoader.js`);return l(t),await n({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw u(e)||s.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async reloadFromPortal(e,t){if(!this.loaded||!this.portalItem?.id)return!1;let n=t?.signal?null:new AbortController;try{let{reload:r}=await import(`../../portal/support/layersLoader.js`);return n&&this.addHandles(o(n),`reloadFromPortal`),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t?.signal?t:{signal:n.signal})}catch(e){throw u(e)||s.getLogger(this).warn(`Failed to reload layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}finally{n&&this.removeHandles(`reloadFromPortal`)}}async finishLoadEditablePortalLayer(e){this._set(`userHasEditingPrivileges`,await this._fetchUserHasEditingPrivileges(e).catch(e=>(d(e),!0)))}async setUserPrivileges(e,n){if(!t.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(n);if(this.url)try{let{features:{edit:t,fullEdit:r},content:{updateItem:i}}=await this._fetchUserPrivileges(e,n);this._set(`userHasEditingPrivileges`,t),this._set(`userHasFullEditingPrivileges`,r),this._set(`userHasUpdateItemPrivileges`,i)}catch(e){d(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);let i=!n?.findCredential(this.url),a=e===r.id;if(a&&r.portal.user)return this._getUserPrivileges(r,i);let o;if(a)o=r.portal.url;else try{o=await _(this.url,t)}catch(e){d(e)}if(!o||!f(o,r.portal.url))return this._fetchFallbackUserPrivileges(t);let s;try{let e=t==null?null:t.signal;s=await n?.getCredential(`${o}/sharing`,{prompt:!1,signal:e})}catch(e){d(e)}if(!s)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(a?await r.reload():(r=new y({id:e,portal:{url:o}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,i)}catch(e){d(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}_getUserPrivileges(e,t){let n=x(e);return t&&(n.features.edit=!0),n}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){d(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){let t=this.url?n?.findCredential(this.url):null;if(!t)return!0;let r=T.credential===t?T.user:await this._fetchEditingUser(e);return T.credential=t,T.user=r,r?.privileges==null||r.privileges.includes(`features:user:edit`)}async _fetchEditingUser(e){let t=this.portalItem?.portal?.user;if(t)return t;let a=n?.findServerInfo(this.url??``);if(!a?.owningSystemUrl)return null;let o=`${a.owningSystemUrl}/sharing/rest`,s=v.getDefault();if(s&&s.loaded&&m(s.restUrl)===m(o))return s.user;let c=`${o}/community/self`,l=e==null?null:e.signal,u=await i(r(c,{authMode:`no-prompt`,query:{f:`json`},signal:l}));return u.ok?b.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){let n=t?.portal,r=this.portalItem?.id&&(this.portalItem.portal||v.getDefault());return n&&r&&!p(r.restUrl,n.restUrl)?(t.messages&&t.messages.push(new a(`layer:cross-portal`,`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return e([h({type:y})],D.prototype,`portalItem`,null),e([S(`web-document`,`portalItem`,[`itemId`])],D.prototype,`readPortalItem`,null),e([C(`web-document`,`portalItem`,{itemId:{type:String}})],D.prototype,`writePortalItem`,null),e([h({clonable:!1})],D.prototype,`resourceReferences`,void 0),e([h({type:Boolean,readOnly:!0})],D.prototype,`userHasEditingPrivileges`,void 0),e([h({type:Boolean,readOnly:!0})],D.prototype,`userHasFullEditingPrivileges`,void 0),e([h({type:Boolean,readOnly:!0})],D.prototype,`userHasUpdateItemPrivileges`,void 0),D=e([g(`esri.layers.mixins.PortalLayer`)],D),D},T={credential:null,user:null};export{w as PortalLayer};
2
+ import{__decorate as e}from"tslib";import t from"../../config.js";import{id as n}from"../../kernel.js";import r from"../../request.js";import{result as i}from"../../core/asyncUtils.js";import a from"../../core/Error.js";import{abortHandle as o}from"../../core/handleUtils.js";import s from"../../core/Logger.js";import{destroyMaybe as c}from"../../core/maybe.js";import{throwIfAborted as l,isAbortError as u,throwIfAbortError as d}from"../../core/promiseUtils.js";import{hasSameCanonicalPortal as f,normalize as p}from"../../core/urlUtils.js";import{property as m,subclass as h}from"../../core/accessorSupport/decorators.js";import{getOwningPortalUrl as g}from"../support/layerUtils.js";import _ from"../../portal/Portal.js";import v from"../../portal/PortalItem.js";import y from"../../portal/PortalUser.js";import{getUserPrivileges as b}from"../../portal/support/portalItemUtils.js";import{isCrossPortalWrite as x}from"../../webdoc/support/saveUtils.js";import{reader as S}from"../../core/accessorSupport/decorators/reader.js";import{writer as C}from"../../core/accessorSupport/decorators/writer.js";const w=w=>{let E=w,D=class extends E{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){super.destroy(),this.portalItem=c(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get(`portalItem`)}set portalItem(e){e!==this._get(`portalItem`)&&(this.removeOrigin(`portal-item`),this._set(`portalItem`,e))}readPortalItem(e,t,n){if(t.itemId)return new v({id:t.itemId,portal:n?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{let{load:n}=await import(`../../portal/support/layersLoader.js`);return l(t),await n({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw u(e)||s.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async reloadFromPortal(e,t){if(!this.loaded||!this.portalItem?.id)return!1;let n=t?.signal?null:new AbortController;try{let{reload:r}=await import(`../../portal/support/layersLoader.js`);return n&&this.addHandles(o(n),`reloadFromPortal`),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t?.signal?t:{signal:n.signal})}catch(e){throw u(e)||s.getLogger(this).warn(`Failed to reload layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}finally{n&&this.removeHandles(`reloadFromPortal`)}}async finishLoadEditablePortalLayer(e){this._set(`userHasEditingPrivileges`,await this._fetchUserHasEditingPrivileges(e).catch(e=>(d(e),!0)))}async setUserPrivileges(e,n){if(!t.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(n);if(this.url)try{let{features:{edit:t,fullEdit:r},content:{updateItem:i}}=await this._fetchUserPrivileges(e,n);this._set(`userHasEditingPrivileges`,t),this._set(`userHasFullEditingPrivileges`,r),this._set(`userHasUpdateItemPrivileges`,i)}catch(e){d(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);let i=!n?.findCredential(this.url),a=e===r.id;if(a&&r.portal.user)return this._getUserPrivileges(r,i);let o;if(a)o=r.portal.url;else try{o=await g(this.url,t)}catch(e){d(e)}if(!o||!f(o,r.portal.url))return this._fetchFallbackUserPrivileges(t);let s;try{let e=t==null?null:t.signal;s=await n?.getCredential(`${o}/sharing`,{prompt:!1,signal:e})}catch(e){d(e)}if(!s)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(a?await r.reload():(r=new v({id:e,portal:{url:o}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,i)}catch(e){d(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}_getUserPrivileges(e,t){let n=b(e);return t&&(n.features.edit=!0),n}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){d(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){let t=this.url?n?.findCredential(this.url):null;if(!t)return!0;let r=T.credential===t?T.user:await this._fetchEditingUser(e);return T.credential=t,T.user=r,r?.privileges==null||r.privileges.includes(`features:user:edit`)}async _fetchEditingUser(e){let t=this.portalItem?.portal?.user;if(t)return t;let a=n?.findServerInfo(this.url??``);if(!a?.owningSystemUrl)return null;let o=`${a.owningSystemUrl}/sharing/rest`,s=_.getDefault();if(s&&s.loaded&&p(s.restUrl)===p(o))return s.user;let c=`${o}/community/self`,l=e==null?null:e.signal,u=await i(r(c,{authMode:`no-prompt`,query:{f:`json`},signal:l}));return u.ok?y.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){return x(this.portalItem,t)?(t?.messages?.push(new a(`layer:cross-portal`,`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return e([m({type:v})],D.prototype,`portalItem`,null),e([S(`web-document`,`portalItem`,[`itemId`])],D.prototype,`readPortalItem`,null),e([C(`web-document`,`portalItem`,{itemId:{type:String}})],D.prototype,`writePortalItem`,null),e([m({clonable:!1})],D.prototype,`resourceReferences`,void 0),e([m({type:Boolean,readOnly:!0})],D.prototype,`userHasEditingPrivileges`,void 0),e([m({type:Boolean,readOnly:!0})],D.prototype,`userHasFullEditingPrivileges`,void 0),e([m({type:Boolean,readOnly:!0})],D.prototype,`userHasUpdateItemPrivileges`,void 0),D=e([h(`esri.layers.mixins.PortalLayer`)],D),D},T={credential:null,user:null};export{w as PortalLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";const r=r=>{let a=r,o=class extends a{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){let e={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t?.effectiveScaleRange!==void 0&&i(e,t.effectiveScaleRange);let n=this._get(`effectiveScaleRange`);return n&&n.minScale===e.minScale&&n.maxScale===e.maxScale?n:e}};return e([t({type:Number,nonNullable:!0,json:{write:!0}})],o.prototype,`minScale`,void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],o.prototype,`maxScale`,void 0),e([t({readOnly:!0})],o.prototype,`effectiveScaleRange`,null),o=e([n(`esri.layers.mixins.ScaleRangeLayer`)],o),o};function i(e,t){return e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale,e}export{r as ScaleRangeLayer};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{joinScaleRanges as r}from"../../geometry/support/scaleUtils.js";const i=i=>{let a=i,o=class extends a{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){let e={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t?.effectiveScaleRange!==void 0&&r(e,t.effectiveScaleRange);let n=this._get(`effectiveScaleRange`);return n&&n.minScale===e.minScale&&n.maxScale===e.maxScale?n:e}};return e([t({type:Number,nonNullable:!0,json:{write:!0}})],o.prototype,`minScale`,void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],o.prototype,`maxScale`,void 0),e([t({readOnly:!0})],o.prototype,`effectiveScaleRange`,null),o=e([n(`esri.layers.mixins.ScaleRangeLayer`)],o),o};export{i as ScaleRangeLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import n from"../../core/CollectionFlattener.js";import r from"../../core/Error.js";import i from"../../core/Logger.js";import{watch as a,sync as o}from"../../core/reactiveUtils.js";import{property as s,subclass as c}from"../../core/accessorSupport/decorators.js";import{nameToId as l,idToName as u}from"../../core/accessorSupport/PropertyOrigin.js";import{getProperties as d}from"../../core/accessorSupport/utils.js";import f from"../support/Sublayer.js";import{isSublayerOverhaul as p}from"../support/sublayerUtils.js";function m(e,t){let n=[],r={};return e&&e.forEach(e=>{let i=new f;if(i.read(e,t),r[i.id]=i,e.parentLayerId!=null&&e.parentLayerId!==-1){let t=r[e.parentLayerId];t.sublayers||=[],t.sublayers.unshift(i)}else n.unshift(i)}),n}const h=t.ofType(f);function g(e,t){e&&e.forEach(e=>{t(e),e.sublayers&&e.sublayers.length&&g(e.sublayers,t)})}const _=_=>{let v=_,y=class extends v{constructor(...e){super(...e),this.allSublayers=new n({getCollections:()=>[this.sublayers],getChildrenFunction(e){return e.sublayers}}),this.sublayersSourceJSON={2:{},3:{},4:{},5:{},6:{}},this.subtables=null,this.addHandles([a(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),o),a(()=>this.subtables,(e,t)=>this._handleSublayersChange(e,t),o)])}destroy(){this.allSublayers.destroy()}readSublayers(e,t){if(!t||!e)return;let{sublayersSourceJSON:n}=this,r=l(t.origin);if(r<2||(n[r]={context:t,visibleLayers:e.visibleLayers||n[r].visibleLayers,layers:e.layers||n[r].layers},r>2))return;this._set(`serviceSublayers`,this.createSublayersForOrigin(`service`).sublayers);let{sublayers:i,origin:a}=this.createSublayersForOrigin(`web-document`),o=d(this);o.setDefaultOrigin(a),this._set(`sublayers`,new h(i)),o.setDefaultOrigin(`user`)}findSublayerById(e){return this.allSublayers.find(t=>t.id===e)}createServiceSublayers(){return this.createSublayersForOrigin(`service`).sublayers}createSublayersForOrigin(e){let t,n=l(e===`web-document`?`web-map`:e),r=2,i=this.sublayersSourceJSON[2].layers,a=this.sublayersSourceJSON[2].context,o=null,s=[3,4,5].filter(e=>e<=n);for(let e of s){let t=this.sublayersSourceJSON[e];p(t.layers)&&(r=e,i=t.layers,a=t.context,t.visibleLayers&&(o={visibleLayers:t.visibleLayers,context:t.context}))}let c=[3,4,5].filter(e=>e>r&&e<=n),d=null;for(let e of c){let{layers:n,visibleLayers:r,context:i}=this.sublayersSourceJSON[e];n&&(d={layers:n,context:i},t??=e),r&&(o={visibleLayers:r,context:i})}let f=m(i,a),_=new Map,v=new Set;if(d)for(let e of d.layers)_.set(e.id,e);if(o?.visibleLayers)for(let e of o.visibleLayers)v.add(e);return g(f,e=>{d&&e.read(_.get(e.id),d.context),o&&e.read({defaultVisibility:v.has(e.id)},o.context)}),{origin:u(r),originWithPartialOverrides:t?u(t):null,sublayers:new h({items:f})}}read(e,t){super.read(e,t),this.readSublayers(e,t)}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null,e.layer=null}),this.removeHandles(`sublayers-owner`)),e&&(e.forEach(e=>{e.parent=this,e.layer=this}),this.addHandles([e.on(`after-add`,({item:e})=>{e.parent=this,e.layer=this}),e.on(`after-remove`,({item:e})=>{e.parent=null,e.layer=null})],`sublayers-owner`),this.type===`tile`&&this.addHandles(e.on(`before-changes`,e=>{i.getLogger(`esri.layers.TileLayer`).error(new r(`tilelayer:sublayers-non-modifiable`,`Sublayer can't be added, moved, or removed from the layer's sublayers`,{layer:this})),e.preventDefault()}),`sublayers-owner`))}};return e([s({readOnly:!0})],y.prototype,`allSublayers`,void 0),e([s({readOnly:!0,type:t.ofType(f)})],y.prototype,`serviceSublayers`,void 0),e([s({value:null,type:h,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],y.prototype,`sublayers`,void 0),e([s({readOnly:!0})],y.prototype,`sublayersSourceJSON`,void 0),e([s({type:h,json:{read:{source:`tables`}}})],y.prototype,`subtables`,void 0),y=e([c(`esri.layers.mixins.SublayersOwner`)],y),y};export{_ as SublayersOwner,g as forEachSublayer};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import n from"../../core/CollectionFlattener.js";import r from"../../core/Error.js";import i from"../../core/Logger.js";import{watch as a,sync as o}from"../../core/reactiveUtils.js";import{property as s,subclass as c}from"../../core/accessorSupport/decorators.js";import{nameToId as l,idToName as u}from"../../core/accessorSupport/PropertyOrigin.js";import{getProperties as d}from"../../core/accessorSupport/utils.js";import f from"../support/Sublayer.js";import{isSublayerOverhaul as p}from"../support/sublayerUtils.js";function m(e,t){let n=[],r={};return e&&e.forEach(e=>{let i=new f;if(i.read(e,t),r[i.id]=i,e.parentLayerId!=null&&e.parentLayerId!==-1){let t=r[e.parentLayerId];t.sublayers||=[],t.sublayers.unshift(i)}else n.unshift(i)}),n}const h=t.ofType(f);function g(e,t){e&&e.forEach(e=>{t(e),e.sublayers&&e.sublayers.length&&g(e.sublayers,t)})}const _=_=>{let v=_,y=class extends v{constructor(...e){super(...e),this.allSublayers=new n({getCollections:()=>[this.sublayers],getChildrenFunction(e){return e.sublayers}}),this.sublayersSourceJSON={2:{},3:{},4:{},5:{},6:{}},this.subtables=null,this.addHandles([a(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),o),a(()=>this.subtables,(e,t)=>this._handleSublayersChange(e,t),o)])}destroy(){this.allSublayers.destroy()}readSublayers(e,t){if(!t||!e)return;let{sublayersSourceJSON:n}=this,r=l(t.origin);if(r<2||(n[r]={context:t,visibleLayers:e.visibleLayers||n[r].visibleLayers,layers:e.layers||n[r].layers},r>2))return;this._set(`serviceSublayers`,this.createSublayersForOrigin(`service`).sublayers);let{sublayers:i,origin:a}=this.createSublayersForOrigin(`web-document`),o=d(this);o.setDefaultOrigin(a),this._set(`sublayers`,new h(i)),o.setDefaultOrigin(`user`)}findSublayerById(e){return this.allSublayers.find(t=>t.id===e)}createServiceSublayers(){return this.createSublayersForOrigin(`service`).sublayers}createSublayersForOrigin(e){let t,n=l(e===`web-document`?`web-map`:e),r=2,i=this.sublayersSourceJSON[2].layers,a=this.sublayersSourceJSON[2].context,o=null,s=[3,4,5].filter(e=>e<=n);for(let e of s){let t=this.sublayersSourceJSON[e];p(t.layers)&&(r=e,i=t.layers,a=t.context,t.visibleLayers&&(o={visibleLayers:t.visibleLayers,context:t.context}))}let c=[3,4,5].filter(e=>e>r&&e<=n),d=null;for(let e of c){let{layers:n,visibleLayers:r,context:i}=this.sublayersSourceJSON[e];n&&(d={layers:n,context:i},t??=e),r&&(o={visibleLayers:r,context:i})}let f=m(i,a),_=new Map,v=new Set;if(d)for(let e of d.layers)_.set(e.id,e);if(o?.visibleLayers)for(let e of o.visibleLayers)v.add(e);return g(f,e=>{d&&e.read(_.get(e.id),d.context),o&&e.read({defaultVisibility:v.has(e.id)},o.context)}),{origin:u(r),originWithPartialOverrides:t?u(t):null,sublayers:new h({items:f})}}read(e,t){super.read(e,t),this.readSublayers(e,t)}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null,e.layer=null}),this.removeHandles(`sublayers-owner`)),e&&(e.forEach(e=>{e.parent=this,e.layer=this}),this.addHandles([e.on(`after-add`,({item:e})=>{e.parent=this,e.layer=this}),e.on(`after-remove`,({item:e})=>{e.parent=null,e.layer=null})],`sublayers-owner`),this.type===`tile`&&this.addHandles(e.on(`before-changes`,e=>{i.getLogger(`esri.layers.TileLayer`).error(new r(`tilelayer:sublayers-non-modifiable`,`Sublayer can't be added, moved, or removed from the layer's sublayers`,{layer:this})),e.preventDefault()}),`sublayers-owner`))}};return e([s({readOnly:!0})],y.prototype,`allSublayers`,void 0),e([s({readOnly:!0})],y.prototype,`effectiveScaleRange`,void 0),e([s({readOnly:!0,type:t.ofType(f)})],y.prototype,`serviceSublayers`,void 0),e([s({value:null,type:h,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],y.prototype,`sublayers`,void 0),e([s({readOnly:!0})],y.prototype,`sublayersSourceJSON`,void 0),e([s({type:h,json:{read:{source:`tables`}}})],y.prototype,`subtables`,void 0),y=e([c(`esri.layers.mixins.SublayersOwner`)],y),y};export{_ as SublayersOwner,g as forEachSublayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{id as t}from"../../../kernel.js";import{ClonableMixin as n}from"../../../core/Clonable.js";import r from"../../../core/Error.js";import{JSONSupport as i}from"../../../core/JSONSupport.js";import a from"../../../core/Logger.js";import{isAbsolute as o,addQueryParameter as s}from"../../../core/urlUtils.js";import{property as c,cast as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import d from"../../../geometry/Point.js";import{getGeometryZScaler as f}from"../../../geometry/support/zscale.js";import p from"./CameraOrientation.js";import m from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as h,getEffectiveElevationSource as g,getArcGISServerUrl as _,getMetersPerUnitOfSR as v,orientedImageryTypeMap as y}from"./utils.js";import{ltpToGeographic as b}from"../transformations/utils.js";import{reader as x}from"../../../core/accessorSupport/decorators/reader.js";import{writer as S}from"../../../core/accessorSupport/decorators/writer.js";import{enumeration as C}from"../../../core/accessorSupport/decorators/enumeration.js";function w(e){throw new r(`exposure-point:missing-default-value`,`a value for ${e} is missing in default properties`)}function T(e,t){throw new r(`exposure-point:missing-attribute-value`,`a value for ${e} is missing in attribute table`,{exposurePoint:t})}function E(e){return e.trim().replaceAll(`\\`,`/`).replace(/^\/+/,``)}function D(e,t){return o(e)?e:h(e,t.imagePathPrefix,t.imagePathSuffix)}function O(e,t){if(o(e))return e;let n=t.url?_(t.url):null;return n?`${n}/${E(e)}`:null}function k(e){return t?.findCredential(e.url)?.token??null}function A(e,t){let n=k(t);return n?s(e,`token`,n):e}const j=e=>({cast:e=>{let t=parseFloat(e);return Number.isFinite(t)?t:void 0},json:{name:e,write:{writer:(e,t,n)=>{t[n]=Number.isFinite(e)?e:void 0}}}}),M=e=>({cast:e=>typeof e==`string`?e.split(`;`).map(Number):e,json:{default:e,write:{writer:(e,t,n)=>{t[n]=e?.join(`;`)}}}}),N=`$virtualCacheDirectory:`,P=new Set([`location`]);let F=class extends n(i){constructor(e){super(e),this._geometry=null,this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,t){let n={},{attributes:r,geometry:i}=e,a={};for(let e in r)P.has(e.toLowerCase())||(n[e.toLowerCase()]=r[e],a[e.toLowerCase()]=e);let o=e.layer??{},s=o.effectiveSequenceOrderField,c=null;s?.length&&(s.map(e=>e.fieldName).forEach(e=>{a[e.toLowerCase()]=e}),c=s.map(e=>({value:r[e.fieldName],...e}))),super.read({geometry:i,layer:o,sourceMap:a,sequenceOrder:c,...n},t)}write(e,t){let n=super.write(e,t),{sourceMap:r}=this;if(!r||!n)return n;let i={};for(let e in n){let t=r[e.toLowerCase()];t&&(i[t]=n[e])}return i}readCameraHeading(e,t){let{cameraheading:n,camheading:r,layer:i}=t;return n??r??i.cameraHeading}readCameraHeight(e,t){let{cameraheight:n,avghtag:r,layer:i}=t;return n??r??i.cameraHeight}readCamOffset(e,t){let{cameraoffset:n,camoffset:r}=t;return n?.split(`;`).map(Number)??r?.split(`;`).map(Number)??null}writeCameraOffset(e,t){e&&(t.cameraOffset=e.join(`;`))}readCameraOrientation(e,t){let{cameraorientation:n,camori:r}=t;return n??r}readCameraPitch(e,t){let{camerapitch:n,campitch:r,layer:i}=t;return n??r??i.cameraPitch}readCameraRoll(e,t){let{cameraroll:n,camroll:r,layer:i}=t;return n??r??i.cameraRoll}readDepthImage(e,t){let{depthimage:n,depthimg:r,layer:i}=t,a=n??r??null,{depthImagePathPrefix:o,depthImagePathSuffix:s}=i??{};return h(a,o,s)}readElevationSource(e,t){let{elevationsource:n,layer:r}=t,{demPathSuffix:i,demPathPrefix:a}=r;if(n){let e=this._parseIfJSON(n);return g(e,a,i)}return r.effectiveElevationSource}readFarDistance(e,t){let{fardistance:n,fardist:r,layer:i}=t;return n??r??i.farDistance}get geometry(){let e=this._geometry.clone();if(!e)return null;let{cameraOffset:t}=this;if(t){let[n,r,i]=t;e.x+=n,e.y+=r,e.z!=null&&i!=null&&(e.z+=i)}return e}set geometry(e){this._geometry=e}writeGeometry(e,t){t.geometry=this._geometry.toJSON()}readHFOV(e,t){let{horizontalfieldofview:n,hfov:r,layer:i}=t;return n??r??i.horizontalFieldOfView}readImageURL(e,t){let{connectionid:n,imagepath:r,layer:i}=t;if(r||T(`imagePath`,this),r.startsWith(N))return`${_(i.url)}/rest/directories/dsid_${r.replace(N,i.dataStoreID+`/`)}`;if(n==null)return D(r,i);let a=i.imageAccessPaths?.[n];if(!a)return D(r,i);let o=O(a,i);return o?A(`${o}/${E(r)}`,i):D(r,i)}readImageRotation(e,t){let{imagerotation:n,imgrot:r,layer:i}=t;return n??r??i.imageRotation}get isHorizontal(){return this.orientedImageryType===`horizontal`}get isInspection(){return this.orientedImageryType===`inspection`}get isNadir(){return this.orientedImageryType===`nadir`}get isOblique(){return this.orientedImageryType===`oblique`}get isSpherical(){return this.orientedImageryType?.includes(`360`)??!1}get location(){let{cameraOrientation:e,cameraHeight:t,elevation:n}=this;if(e){let{type:t,x:n,y:r,z:i,horizontalWKID:a,verticalWKID:o}=e,s=typeof a==`number`?{wkid:a}:{wkt:a};if(t===4){let{latitude:t,longitude:n,ellipsoidRadius:r,squaredEccentricity:i,properties:a}=e,{x:o,y:s,z:c}=a;return new d(b([o,s,c],[t,n,r,i]))}let c=new d({x:n,y:r,z:i,spatialReference:s}),l=o?f(`point`,{wkid:o},s):null;return l&&l(c),c}if(typeof t!=`number`)throw w(`cameraHeight`);let r=this.geometry.clone(),i=(n??0)+t/v(r.spatialReference);return r.z=r.hasZ?r.z:i,r}set matrix(e){if(e){if(e.length!==9){a.getLogger(this).warnOnce(`Ignoring rotation matrix because it doesn't have 9 values`,{value:e}),this._set(`matrix`,null);return}this._set(`matrix`,e)}}readNearDistance(e,t){let{neardistance:n,neardist:r,layer:i}=t;return n??r??i.nearDistance}readOffsetFromStart(e,t){return t.offsetfromstart??null}readOrientationAccuracy(e,t){let{accuracy:n,orientationaccuracy:r}=t;return r?.split(`;`).map(Number)??n?.split(`;`).map(Number)??null}writeOrientationAccuracy(e,t){e&&(t.orientationAccuracy=e.join(`;`))}readOIType(e,t){let{orientedimagerytype:n,oitype:r,camerapitch:i,campitch:a,layer:o}=t,s=y.read(n??r??o.orientedImageryType),c=i??a??o.cameraPitch;return s===`oblique`?c<10?`nadir`:`oblique`:s}set radial(e){if(!e){this._set(`radial`,[0,0,0]);return}if(typeof e==`string`){let[t,n,r]=e.split(`;`).map(Number);this._set(`radial`,[t??0,n??0,r??0]);return}this._set(`radial`,e)}set tangential(e){if(!e){this._set(`tangential`,[0,0]);return}if(typeof e==`string`){let[t,n]=e.split(`;`).map(Number);this._set(`tangential`,[t??0,n??0]);return}this._set(`tangential`,e)}readVFOV(e,t){let{verticalfieldofview:n,vfov:r,layer:i}=t;return n??r??i.verticalFieldOfView}_parseIfJSON(e){let t=null;try{t=JSON.parse(e)}catch(t){a.getLogger(this).error(`couldn't parse the given elevation source JSON`,e,t)}return t}clone(){let e=super.clone();return e._geometry=this._geometry.clone(),e}};e([c()],F.prototype,`_geometry`,void 0),e([c(j())],F.prototype,`a0`,void 0),e([c(j())],F.prototype,`a1`,void 0),e([c(j())],F.prototype,`a2`,void 0),e([c({type:Date,json:{write:{enabled:!0,target:`acquisitionDate`},name:`acquisitiondate`}})],F.prototype,`acquisitionDate`,void 0),e([c(j())],F.prototype,`b0`,void 0),e([c(j())],F.prototype,`b1`,void 0),e([c(j())],F.prototype,`b2`,void 0),e([c({type:Number,json:{write:!0,read:{source:[`cameraheading`,`camheading`,`layer.cameraHeading`]}}})],F.prototype,`cameraHeading`,void 0),e([x(`cameraHeading`)],F.prototype,`readCameraHeading`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`cameraHeight`,void 0),e([x(`cameraHeight`,[`cameraheight`,`avghtag`,`layer.cameraHeight`])],F.prototype,`readCameraHeight`,null),e([c()],F.prototype,`cameraOffset`,void 0),e([x(`cameraOffset`,[`cameraoffset`,`camoffset`])],F.prototype,`readCamOffset`,null),e([S(`cameraOffset`)],F.prototype,`writeCameraOffset`,null),e([c({json:{write:{writer:(e,t,n)=>{t[n]=e.toString()}}},type:p}),l(e=>e?m.getCameraOrientation(e):null)],F.prototype,`cameraOrientation`,void 0),e([x(`cameraOrientation`,[`cameraorientation`,`camori`])],F.prototype,`readCameraOrientation`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`cameraPitch`,void 0),e([x(`cameraPitch`,[`camerapitch`,`campitch`,`layer.cameraPitch`])],F.prototype,`readCameraPitch`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`cameraRoll`,void 0),e([x(`cameraRoll`,[`cameraroll`,`camroll`,`layer.cameraRoll`])],F.prototype,`readCameraRoll`,null),e([c({json:{write:!0},type:String})],F.prototype,`depthImage`,void 0),e([x(`depthImage`,[`depthimage`,`depthimg`])],F.prototype,`readDepthImage`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`elevation`,void 0),e([c({json:{write:!0},clonable:`reference`})],F.prototype,`elevationSource`,void 0),e([x(`elevationSource`,[`elevationsource`,`layer.effectiveElevationSource`])],F.prototype,`readElevationSource`,null),e([c({json:{name:`exposurestationid`,write:{target:`exposureStationId`}},type:String})],F.prototype,`exposureStationId`,void 0),e([c({type:Number,json:{write:!0}})],F.prototype,`farDistance`,void 0),e([x(`farDistance`,[`fardistance`,`fardist`,`layer.farDistance`])],F.prototype,`readFarDistance`,null),e([c(j(`focallength`))],F.prototype,`focalLength`,void 0),e([c({type:d,json:{name:`geometry`}})],F.prototype,`geometry`,null),e([S(`geometry`)],F.prototype,`writeGeometry`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`horizontalFieldOfView`,void 0),e([x(`horizontalFieldOfView`,[`horizontalfieldofview`,`hfov`,`layer.horizontalFieldOfView`])],F.prototype,`readHFOV`,null),e([c({json:{write:!0},type:String})],F.prototype,`imagePath`,void 0),e([x(`imagePath`,[`imagepath`])],F.prototype,`readImageURL`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`imageRotation`,void 0),e([x(`imageRotation`,[`imagerotation`,`imgrot`,`layer.imageRotation`])],F.prototype,`readImageRotation`,null),e([c()],F.prototype,`isHorizontal`,null),e([c()],F.prototype,`isInspection`,null),e([c()],F.prototype,`isNadir`,null),e([c()],F.prototype,`isOblique`,null),e([c()],F.prototype,`isSpherical`,null),e([c()],F.prototype,`location`,null),e([c(M())],F.prototype,`matrix`,null),e([c({json:{write:!0},type:String})],F.prototype,`name`,void 0),e([c({type:Number,json:{write:!0}})],F.prototype,`nearDistance`,void 0),e([x(`nearDistance`,[`neardistance`,`neardist`,`layer.nearDistance`])],F.prototype,`readNearDistance`,null),e([c({json:{write:!0,name:`objectid`},type:Number})],F.prototype,`objectId`,void 0),e([c({type:Number,json:{write:!0}})],F.prototype,`offsetFromStart`,void 0),e([x(`offsetFromStart`,[`offsetfromstart`])],F.prototype,`readOffsetFromStart`,null),e([c()],F.prototype,`orientationAccuracy`,void 0),e([x(`orientationAccuracy`,[`accuracy`,`orientationaccuracy`])],F.prototype,`readOrientationAccuracy`,null),e([S(`orientationAccuracy`)],F.prototype,`writeOrientationAccuracy`,null),e([C(y)],F.prototype,`orientedImageryType`,void 0),e([x(`orientedImageryType`,[`orientedimagerytype`,`oitype`,`layer.orientedImageryType`])],F.prototype,`readOIType`,null),e([c({type:Number,json:{write:!0,read:{source:`principalx`}}})],F.prototype,`principalX`,void 0),e([c({type:Number,json:{write:!0,read:{source:`principaly`}}})],F.prototype,`principalY`,void 0),e([c(M([0,0,0]))],F.prototype,`radial`,null),e([c({json:{write:(e,t)=>{e&&e.forEach(e=>t[e.fieldName]=e.value)}}})],F.prototype,`sequenceOrder`,void 0),e([c({type:Object})],F.prototype,`sourceMap`,void 0),e([c(M([0,0]))],F.prototype,`tangential`,null),e([c({type:Number,json:{write:!0}})],F.prototype,`verticalFieldOfView`,void 0),e([x(`verticalFieldOfView`,[`verticalfieldofview`,`vfov`,`layer.verticalFieldOfView`])],F.prototype,`readVFOV`,null),F=e([u(`esri.layers.orientedImagery.core.ExposurePoint`)],F);const I=F;export{I as default};
2
+ import{__decorate as e}from"tslib";import{id as t}from"../../../kernel.js";import{ClonableMixin as n}from"../../../core/Clonable.js";import r from"../../../core/Error.js";import{JSONSupport as i}from"../../../core/JSONSupport.js";import a from"../../../core/Logger.js";import{isAbsolute as o,addQueryParameter as s}from"../../../core/urlUtils.js";import{property as c,cast as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import d from"../../../geometry/Point.js";import{getGeometryZScaler as f}from"../../../geometry/support/zscale.js";import p from"./CameraOrientation.js";import m from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as h,getEffectiveElevationSource as g,getArcGISServerUrl as _,getMetersPerUnitOfSR as v,parseOrientationAccuracy as y,normalizeOrientationAccuracy as b,orientedImageryTypeMap as x}from"./utils.js";import{ltpToGeographic as S}from"../transformations/utils.js";import{reader as C}from"../../../core/accessorSupport/decorators/reader.js";import{writer as w}from"../../../core/accessorSupport/decorators/writer.js";import{enumeration as T}from"../../../core/accessorSupport/decorators/enumeration.js";function E(e){throw new r(`exposure-point:missing-default-value`,`a value for ${e} is missing in default properties`)}function D(e,t){throw new r(`exposure-point:missing-attribute-value`,`a value for ${e} is missing in attribute table`,{exposurePoint:t})}function O(e){return e.trim().replaceAll(`\\`,`/`).replace(/^\/+/,``)}function k(e,t){return o(e)?e:h(e,t.imagePathPrefix,t.imagePathSuffix)}function A(e,t){if(o(e))return e;let n=t.url?_(t.url):null;return n?`${n}/${O(e)}`:null}function j(e){return t?.findCredential(e.url)?.token??null}function M(e,t){let n=j(t);return n?s(e,`token`,n):e}const N=e=>({cast:e=>{let t=parseFloat(e);return Number.isFinite(t)?t:void 0},json:{name:e,write:{writer:(e,t,n)=>{t[n]=Number.isFinite(e)?e:void 0}}}}),P=e=>({cast:e=>typeof e==`string`?e.split(`;`).map(Number):e,json:{default:e,write:{writer:(e,t,n)=>{t[n]=e?.join(`;`)}}}}),F=`$virtualCacheDirectory:`,I=new Set([`location`]);let L=class extends n(i){constructor(e){super(e),this._geometry=null,this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,t){let n={},{attributes:r,geometry:i}=e,a={};for(let e in r)I.has(e.toLowerCase())||(n[e.toLowerCase()]=r[e],a[e.toLowerCase()]=e);let o=e.layer??{},s=o.effectiveSequenceOrderField,c=null;s?.length&&(s.map(e=>e.fieldName).forEach(e=>{a[e.toLowerCase()]=e}),c=s.map(e=>({value:r[e.fieldName],...e}))),super.read({geometry:i,layer:o,sourceMap:a,sequenceOrder:c,...n},t)}write(e,t){let n=super.write(e,t),{sourceMap:r}=this;if(!r||!n)return n;let i={};for(let e in n){let t=r[e.toLowerCase()];t&&(i[t]=n[e])}return i}readCameraHeading(e,t){let{cameraheading:n,camheading:r,layer:i}=t;return n??r??i.cameraHeading}readCameraHeight(e,t){let{cameraheight:n,avghtag:r,layer:i}=t;return n??r??i.cameraHeight}readCamOffset(e,t){let{cameraoffset:n,camoffset:r}=t;return n?.split(`;`).map(Number)??r?.split(`;`).map(Number)??null}writeCameraOffset(e,t){e&&(t.cameraOffset=e.join(`;`))}readCameraOrientation(e,t){let{cameraorientation:n,camori:r}=t;return n??r}readCameraPitch(e,t){let{camerapitch:n,campitch:r,layer:i}=t;return n??r??i.cameraPitch}readCameraRoll(e,t){let{cameraroll:n,camroll:r,layer:i}=t;return n??r??i.cameraRoll}readDepthImage(e,t){let{depthimage:n,depthimg:r,layer:i}=t,a=n??r??null,{depthImagePathPrefix:o,depthImagePathSuffix:s}=i??{};return h(a,o,s)}readElevationSource(e,t){let{elevationsource:n,layer:r}=t,{demPathSuffix:i,demPathPrefix:a}=r;if(n){let e=this._parseIfJSON(n);return g(e,a,i)}return r.effectiveElevationSource}readFarDistance(e,t){let{fardistance:n,fardist:r,layer:i}=t;return n??r??i.farDistance}get geometry(){let e=this._geometry.clone();if(!e)return null;let{cameraOffset:t}=this;if(t){let[n,r,i]=t;e.x+=n,e.y+=r,e.z!=null&&i!=null&&(e.z+=i)}return e}set geometry(e){this._geometry=e}writeGeometry(e,t){t.geometry=this._geometry.toJSON()}readHFOV(e,t){let{horizontalfieldofview:n,hfov:r,layer:i}=t;return n??r??i.horizontalFieldOfView}readImageURL(e,t){let{connectionid:n,imagepath:r,layer:i}=t;if(r||D(`imagePath`,this),r.startsWith(F))return`${_(i.url)}/rest/directories/dsid_${r.replace(F,i.dataStoreID+`/`)}`;if(n==null)return k(r,i);let a=i.imageAccessPaths?.[n];if(!a)return k(r,i);let o=A(a,i);return o?M(`${o}/${O(r)}`,i):k(r,i)}readImageRotation(e,t){let{imagerotation:n,imgrot:r,layer:i}=t;return n??r??i.imageRotation}get isHorizontal(){return this.orientedImageryType===`horizontal`}get isInspection(){return this.orientedImageryType===`inspection`}get isNadir(){return this.orientedImageryType===`nadir`}get isOblique(){return this.orientedImageryType===`oblique`}get isSpherical(){return this.orientedImageryType?.includes(`360`)??!1}get location(){let{cameraOrientation:e,cameraHeight:t,elevation:n}=this;if(e){let{type:t,x:n,y:r,z:i,horizontalWKID:a,verticalWKID:o}=e,s=typeof a==`number`?{wkid:a}:{wkt:a};if(t===4){let{latitude:t,longitude:n,ellipsoidRadius:r,squaredEccentricity:i,properties:a}=e,{x:o,y:s,z:c}=a;return new d(S([o,s,c],[t,n,r,i]))}let c=new d({x:n,y:r,z:i,spatialReference:s}),l=o?f(`point`,{wkid:o},s):null;return l&&l(c),c}if(typeof t!=`number`)throw E(`cameraHeight`);let r=this.geometry.clone(),i=(n??0)+t/v(r.spatialReference);return r.z=r.hasZ?r.z:i,r}set matrix(e){if(e){if(e.length!==9){a.getLogger(this).warnOnce(`Ignoring rotation matrix because it doesn't have 9 values`,{value:e}),this._set(`matrix`,null);return}this._set(`matrix`,e)}}readNearDistance(e,t){let{neardistance:n,neardist:r,layer:i}=t;return n??r??i.nearDistance}readOffsetFromStart(e,t){return t.offsetfromstart??null}readOrientationAccuracy(e,t){let{accuracy:n,layer:r,orientationaccuracy:i}=t;return y(i===void 0?n:i)??b(r.orientationAccuracy)}writeOrientationAccuracy(e,t){e&&(t.orientationAccuracy=e.join(`;`))}readOIType(e,t){let{orientedimagerytype:n,oitype:r,camerapitch:i,campitch:a,layer:o}=t,s=x.read(n??r??o.orientedImageryType),c=i??a??o.cameraPitch;return s===`oblique`?c<10?`nadir`:`oblique`:s}set radial(e){if(!e){this._set(`radial`,[0,0,0]);return}if(typeof e==`string`){let[t,n,r]=e.split(`;`).map(Number);this._set(`radial`,[t??0,n??0,r??0]);return}this._set(`radial`,e)}set tangential(e){if(!e){this._set(`tangential`,[0,0]);return}if(typeof e==`string`){let[t,n]=e.split(`;`).map(Number);this._set(`tangential`,[t??0,n??0]);return}this._set(`tangential`,e)}readVFOV(e,t){let{verticalfieldofview:n,vfov:r,layer:i}=t;return n??r??i.verticalFieldOfView}_parseIfJSON(e){let t=null;try{t=JSON.parse(e)}catch(t){a.getLogger(this).error(`couldn't parse the given elevation source JSON`,e,t)}return t}clone(){let e=super.clone();return e._geometry=this._geometry.clone(),e}};e([c()],L.prototype,`_geometry`,void 0),e([c(N())],L.prototype,`a0`,void 0),e([c(N())],L.prototype,`a1`,void 0),e([c(N())],L.prototype,`a2`,void 0),e([c({type:Date,json:{write:{enabled:!0,target:`acquisitionDate`},name:`acquisitiondate`}})],L.prototype,`acquisitionDate`,void 0),e([c(N())],L.prototype,`b0`,void 0),e([c(N())],L.prototype,`b1`,void 0),e([c(N())],L.prototype,`b2`,void 0),e([c({type:Number,json:{write:!0,read:{source:[`cameraheading`,`camheading`,`layer.cameraHeading`]}}})],L.prototype,`cameraHeading`,void 0),e([C(`cameraHeading`)],L.prototype,`readCameraHeading`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`cameraHeight`,void 0),e([C(`cameraHeight`,[`cameraheight`,`avghtag`,`layer.cameraHeight`])],L.prototype,`readCameraHeight`,null),e([c()],L.prototype,`cameraOffset`,void 0),e([C(`cameraOffset`,[`cameraoffset`,`camoffset`])],L.prototype,`readCamOffset`,null),e([w(`cameraOffset`)],L.prototype,`writeCameraOffset`,null),e([c({json:{write:{writer:(e,t,n)=>{t[n]=e.toString()}}},type:p}),l(e=>e?m.getCameraOrientation(e):null)],L.prototype,`cameraOrientation`,void 0),e([C(`cameraOrientation`,[`cameraorientation`,`camori`])],L.prototype,`readCameraOrientation`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`cameraPitch`,void 0),e([C(`cameraPitch`,[`camerapitch`,`campitch`,`layer.cameraPitch`])],L.prototype,`readCameraPitch`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`cameraRoll`,void 0),e([C(`cameraRoll`,[`cameraroll`,`camroll`,`layer.cameraRoll`])],L.prototype,`readCameraRoll`,null),e([c({json:{write:!0},type:String})],L.prototype,`depthImage`,void 0),e([C(`depthImage`,[`depthimage`,`depthimg`])],L.prototype,`readDepthImage`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`elevation`,void 0),e([c({json:{write:!0},clonable:`reference`})],L.prototype,`elevationSource`,void 0),e([C(`elevationSource`,[`elevationsource`,`layer.effectiveElevationSource`])],L.prototype,`readElevationSource`,null),e([c({json:{name:`exposurestationid`,write:{target:`exposureStationId`}},type:String})],L.prototype,`exposureStationId`,void 0),e([c({type:Number,json:{write:!0}})],L.prototype,`farDistance`,void 0),e([C(`farDistance`,[`fardistance`,`fardist`,`layer.farDistance`])],L.prototype,`readFarDistance`,null),e([c(N(`focallength`))],L.prototype,`focalLength`,void 0),e([c({type:d,json:{name:`geometry`}})],L.prototype,`geometry`,null),e([w(`geometry`)],L.prototype,`writeGeometry`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`horizontalFieldOfView`,void 0),e([C(`horizontalFieldOfView`,[`horizontalfieldofview`,`hfov`,`layer.horizontalFieldOfView`])],L.prototype,`readHFOV`,null),e([c({json:{write:!0},type:String})],L.prototype,`imagePath`,void 0),e([C(`imagePath`,[`imagepath`])],L.prototype,`readImageURL`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`imageRotation`,void 0),e([C(`imageRotation`,[`imagerotation`,`imgrot`,`layer.imageRotation`])],L.prototype,`readImageRotation`,null),e([c()],L.prototype,`isHorizontal`,null),e([c()],L.prototype,`isInspection`,null),e([c()],L.prototype,`isNadir`,null),e([c()],L.prototype,`isOblique`,null),e([c()],L.prototype,`isSpherical`,null),e([c()],L.prototype,`location`,null),e([c(P())],L.prototype,`matrix`,null),e([c({json:{write:!0},type:String})],L.prototype,`name`,void 0),e([c({type:Number,json:{write:!0}})],L.prototype,`nearDistance`,void 0),e([C(`nearDistance`,[`neardistance`,`neardist`,`layer.nearDistance`])],L.prototype,`readNearDistance`,null),e([c({json:{write:!0,name:`objectid`},type:Number})],L.prototype,`objectId`,void 0),e([c({type:Number,json:{write:!0}})],L.prototype,`offsetFromStart`,void 0),e([C(`offsetFromStart`,[`offsetfromstart`])],L.prototype,`readOffsetFromStart`,null),e([c()],L.prototype,`orientationAccuracy`,void 0),e([C(`orientationAccuracy`,[`accuracy`,`orientationaccuracy`,`layer.orientationAccuracy`])],L.prototype,`readOrientationAccuracy`,null),e([w(`orientationAccuracy`)],L.prototype,`writeOrientationAccuracy`,null),e([T(x)],L.prototype,`orientedImageryType`,void 0),e([C(`orientedImageryType`,[`orientedimagerytype`,`oitype`,`layer.orientedImageryType`])],L.prototype,`readOIType`,null),e([c({type:Number,json:{write:!0,read:{source:`principalx`}}})],L.prototype,`principalX`,void 0),e([c({type:Number,json:{write:!0,read:{source:`principaly`}}})],L.prototype,`principalY`,void 0),e([c(P([0,0,0]))],L.prototype,`radial`,null),e([c({json:{write:(e,t)=>{e&&e.forEach(e=>t[e.fieldName]=e.value)}}})],L.prototype,`sequenceOrder`,void 0),e([c({type:Object})],L.prototype,`sourceMap`,void 0),e([c(P([0,0]))],L.prototype,`tangential`,null),e([c({type:Number,json:{write:!0}})],L.prototype,`verticalFieldOfView`,void 0),e([C(`verticalFieldOfView`,[`verticalfieldofview`,`vfov`,`layer.verticalFieldOfView`])],L.prototype,`readVFOV`,null),L=e([u(`esri.layers.orientedImagery.core.ExposurePoint`)],L);const R=L;export{R as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{JSONMap as e}from"../../../core/jsonMap.js";import{getMetersPerUnitForSR as t}from"../../../core/units.js";import{geographicToWebMercator as n}from"../../../geometry/support/webMercatorUtils.js";import r from"./cameraOrientationRegistry.js";import{isConstantElevation as i,ConstantElevation as a,ElevationSource as o}from"./ElevationSourceDefinitions.js";function s(e,t,n){return t&&(e=`${t}${e}`),n&&(e+=`${n}`),e}function c(e,t,n){let{url:r}=e;return r?(r=s(r,t,n),new o({...e,url:r})):null}function l(e,t,n){return e&&(i(e)?new a(e):c(e,t,n))}const u=new e({Minutes:`minutes`,Hours:`hours`,Days:`days`,Weeks:`weeks`,Months:`months`,Years:`years`}),d=new e({Feet:`feet`,Meter:`meter`}),f=new e({360:`360`,Horizontal:`horizontal`,Inspection:`inspection`,Nadir:`nadir`,Oblique:`oblique`,Terrestrial360Video:`terrestrial-360-video`,TerrestrialFrameVideo:`terrestrial-frame-video`,Aerial360Video:`aerial-360-video`,AerialFrameVideo:`aerial-frame-video`,"":null}),p=new Map;p.set(`1`,_),p.set(`3`,v),p.set(`2`,m),p.set(`4`,y);function m(e){let[t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:n,x:r,y:i,z:a,omega:o,phi:s,kappa:c,...g([l,u,d,f,p,m],[_,v],[y,b,x],[S,C],h)}}const h=e=>{let t=e.map(e=>parseFloat(e)).filter(e=>!isNaN(e));if(t.length===e.length)return t};function g(e,t,n,r,i){let a=h(e),o=h(t),s=h(n),c=h(r);return{affineTransformations:a?.length===6?a:void 0,focalLength:a?.length===6?parseFloat(i):void 0,principalOffsetPoint:o?.length===2?o:[0,0],radialDistortionCoefficients:s?.length===3?s:[0,0,0],tangentialDistortionCoefficients:c?.length===2?c:[0,0]}}function _(e){let[t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:n,x:r,y:i,z:a,heading:o,pitch:s,roll:c,...g([l,u,d,f,p,m],[_,v],[y,b,x],[S,C],h)}}function v(e){let[t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:n,x:r,y:i,z:a,yaw:o,pitch:s,roll:c,...g([l,u,d,f,p,m],[_,v],[y,b,x],[S,C],h)}}function y(e){let[t,n,i,a,o,...s]=e.slice(1),c=p.get(o),l=r.get(o)?.constructor;return!c||!l?null:{latitude:t,longitude:n,ellipsoidRadius:i,squaredEccentricity:a,properties:new l(c([o,``,...s]))}}function b(e){if(!e)return null;let t=`${e}`.split(`|`);if(t.length===0)return null;let n=r.get(t[0]);if(!n)return null;let i=p.get(t[0]);if(!i)return null;let a=n.constructor;return new a(i(t))}function x(e){return Array.isArray(e)&&e?.length>5&&!e.some(isNaN)}function S(e){for(e=e.slice(0,8);e.length<8;)e.push(0);return e}function C(e){return e.spatialReference.isGeographic?n(e):e.clone()}function w(e){return e.isGeographic?1:t(e)}function T(e){let t=e.match(/^(.*)\/rest\/services\/(.*)$/);return t?t[1]:null}const E=`sequenceorder`;function D(e,t){return e?.length?e.map(({field:e,order:n})=>{let r=t.find(t=>t.name.toLowerCase()===e.toLowerCase());return r?{fieldName:r.name,sortOrder:n?.toLowerCase()===`desc`?`desc`:`asc`}:null}).filter(e=>e!=null):null}function O(e,t,n){let r=D(n,t);if(r?.length)return r;if(!e){let e=t.find(e=>e.name.toLocaleLowerCase()===E.toLocaleLowerCase());return e?[{fieldName:e.name,sortOrder:`asc`}]:null}let i=t.find(t=>t.name.toLowerCase()===e.trim().toLowerCase());return i?[{fieldName:i.name,sortOrder:`asc`}]:null}export{s as appendPrefixAndSuffix,C as convertGeographicToWebMercator,b as createCameraOrientation,E as defaultSequenceOrderField,T as getArcGISServerUrl,l as getEffectiveElevationSource,w as getMetersPerUnitOfSR,x as isOrientationAccuracy,f as orientedImageryTypeMap,S as padAccuracyArray,O as parseSequenceOrderFields,c as processElevationSource,u as timeIntervalUnitTypeMap,p as transformersRegistry,d as verticalMeasurementTypeMap};
2
+ import{JSONMap as e}from"../../../core/jsonMap.js";import{getMetersPerUnitForSR as t}from"../../../core/units.js";import{geographicToWebMercator as n}from"../../../geometry/support/webMercatorUtils.js";import r from"./cameraOrientationRegistry.js";import{isConstantElevation as i,ConstantElevation as a,ElevationSource as o}from"./ElevationSourceDefinitions.js";function s(e,t,n){return t&&(e=`${t}${e}`),n&&(e+=`${n}`),e}function c(e,t,n){let{url:r}=e;return r?(r=s(r,t,n),new o({...e,url:r})):null}function l(e,t,n){return e&&(i(e)?new a(e):c(e,t,n))}const u=new e({Minutes:`minutes`,Hours:`hours`,Days:`days`,Weeks:`weeks`,Months:`months`,Years:`years`}),d=new e({Feet:`feet`,Meter:`meter`}),f=new e({360:`360`,Horizontal:`horizontal`,Inspection:`inspection`,Nadir:`nadir`,Oblique:`oblique`,Terrestrial360Video:`terrestrial-360-video`,TerrestrialFrameVideo:`terrestrial-frame-video`,Aerial360Video:`aerial-360-video`,AerialFrameVideo:`aerial-frame-video`,"":null}),p=new Map;p.set(`1`,_),p.set(`3`,v),p.set(`2`,m),p.set(`4`,y);function m(e){let[t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:n,x:r,y:i,z:a,omega:o,phi:s,kappa:c,...g([l,u,d,f,p,m],[_,v],[y,b,x],[S,C],h)}}const h=e=>{let t=e.map(e=>parseFloat(e)).filter(e=>!isNaN(e));if(t.length===e.length)return t};function g(e,t,n,r,i){let a=h(e),o=h(t),s=h(n),c=h(r);return{affineTransformations:a?.length===6?a:void 0,focalLength:a?.length===6?parseFloat(i):void 0,principalOffsetPoint:o?.length===2?o:[0,0],radialDistortionCoefficients:s?.length===3?s:[0,0,0],tangentialDistortionCoefficients:c?.length===2?c:[0,0]}}function _(e){let[t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:n,x:r,y:i,z:a,heading:o,pitch:s,roll:c,...g([l,u,d,f,p,m],[_,v],[y,b,x],[S,C],h)}}function v(e){let[t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:n,x:r,y:i,z:a,yaw:o,pitch:s,roll:c,...g([l,u,d,f,p,m],[_,v],[y,b,x],[S,C],h)}}function y(e){let[t,n,i,a,o,...s]=e.slice(1),c=p.get(o),l=r.get(o)?.constructor;return!c||!l?null:{latitude:t,longitude:n,ellipsoidRadius:i,squaredEccentricity:a,properties:new l(c([o,``,...s]))}}function b(e){if(!e)return null;let t=`${e}`.split(`|`);if(t.length===0)return null;let n=r.get(t[0]);if(!n)return null;let i=p.get(t[0]);if(!i)return null;let a=n.constructor;return new a(i(t))}function x(e){if(!Array.isArray(e)||e.length<=5)return!1;for(let t of e)if(typeof t!=`number`||!Number.isFinite(t)||t<0)return!1;return!0}function S(e){for(e=e.slice(0,8);e.length<8;)e.push(0);return e}function C(e){return x(e)?S(e):null}function w(e){if(typeof e!=`string`)return null;let t=e.split(`;`);return t.some(e=>!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(e.trim()))?null:C(t.map(e=>Number(e.trim())))}function T(e){return e.spatialReference.isGeographic?n(e):e.clone()}function E(e){return e.isGeographic?1:t(e)}function D(e){let t=e.match(/^(.*)\/rest\/services\/(.*)$/);return t?t[1]:null}const O=`sequenceorder`;function k(e,t){return e?.length?e.map(({field:e,order:n})=>{let r=t.find(t=>t.name.toLowerCase()===e.toLowerCase());return r?{fieldName:r.name,sortOrder:n?.toLowerCase()===`desc`?`desc`:`asc`}:null}).filter(e=>e!=null):null}function A(e,t,n){let r=k(n,t);if(r?.length)return r;if(!e){let e=t.find(e=>e.name.toLocaleLowerCase()===O.toLocaleLowerCase());return e?[{fieldName:e.name,sortOrder:`asc`}]:null}let i=t.find(t=>t.name.toLowerCase()===e.trim().toLowerCase());return i?[{fieldName:i.name,sortOrder:`asc`}]:null}export{s as appendPrefixAndSuffix,T as convertGeographicToWebMercator,b as createCameraOrientation,O as defaultSequenceOrderField,D as getArcGISServerUrl,l as getEffectiveElevationSource,E as getMetersPerUnitOfSR,x as isOrientationAccuracy,C as normalizeOrientationAccuracy,f as orientedImageryTypeMap,S as padAccuracyArray,w as parseOrientationAccuracy,A as parseSequenceOrderFields,c as processElevationSource,u as timeIntervalUnitTypeMap,p as transformersRegistry,d as verticalMeasurementTypeMap};
@@ -323,7 +323,7 @@ export default class FeatureFilter extends JSONSupport {
323
323
  * Creates [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) parameters that can be used to fetch features that
324
324
  * satisfy the layer's current filters and definitions.
325
325
  *
326
- * @returns The query object representing the layer's filters
326
+ * @returns The query parameter object representing the layer's filters
327
327
  * and other definitions.
328
328
  * @example
329
329
  * // Get a query object from the filter's current configuration
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{Clonable as t}from"../../core/Clonable.js";import{JSONSupportMixin as n}from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"../../portal/PortalItem.js";import{reader as o}from"../../core/accessorSupport/decorators/reader.js";import{writer as s}from"../../core/accessorSupport/decorators/writer.js";let c=class extends n(t){constructor(e){super(e),this.type=`portal-item`}readPortalItem(e,t,n){if(t.itemId)return new a({id:t.itemId,portal:n?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}};e([r({type:[`portal-item`],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],c.prototype,`type`,void 0),e([r({type:a,json:{write:{isRequired:!0}}})],c.prototype,`portalItem`,void 0),e([o(`portalItem`,[`itemId`])],c.prototype,`readPortalItem`,null),e([s(`portalItem`,{itemId:{type:String}})],c.prototype,`writePortalItem`,null),c=e([i(`esri.layers.support.ParquetPortalItemData`)],c);const l=c;export{l as default};
2
+ import{__decorate as e}from"tslib";import{Clonable as t}from"../../core/Clonable.js";import n from"../../core/Error.js";import{JSONSupportMixin as r}from"../../core/JSONSupport.js";import{property as i}from"../../core/accessorSupport/decorators.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import o from"../../portal/PortalItem.js";import{isCrossPortalWrite as s}from"../../webdoc/support/saveUtils.js";import{reader as c}from"../../core/accessorSupport/decorators/reader.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";let u=class extends r(t){constructor(e){super(e),this.type=`portal-item`}readPortalItem(e,t,n){if(t.itemId)return new o({id:t.itemId,portal:n?.portal})}writePortalItem(e,t,r,i){if(s(e,i)){i.messages?.push(new n(`portal-item-data:cross-portal`,`Data cannot be persisted because it refers to an item on a different portal ('${e?.portal?.url}') than the one being saved to ('${i?.portal?.url}').`,{layer:this,itemId:e?.id}));return}e?.id&&(t.itemId=e.id)}};e([i({type:[`portal-item`],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],u.prototype,`type`,void 0),e([i({type:o,json:{write:{isRequired:!0}}})],u.prototype,`portalItem`,void 0),e([c(`portalItem`,[`itemId`])],u.prototype,`readPortalItem`,null),e([l(`portalItem`,{itemId:{type:String}})],u.prototype,`writePortalItem`,null),u=e([a(`esri.layers.support.ParquetPortalItemData`)],u);const d=u;export{d as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{Clonable as t}from"../../core/Clonable.js";import{JSONSupportMixin as n}from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"../../portal/PortalItem.js";import{reader as o}from"../../core/accessorSupport/decorators/reader.js";import{writer as s}from"../../core/accessorSupport/decorators/writer.js";let c=class extends n(t){constructor(e){super(e),this.type=`portal-item`}readPortalItem(e,t,n){if(t.itemId)return new a({id:t.itemId,portal:n?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}};e([r({type:[`portal-item`],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],c.prototype,`type`,void 0),e([r({type:a,json:{write:{isRequired:!0}}})],c.prototype,`portalItem`,void 0),e([o(`portalItem`,[`itemId`])],c.prototype,`readPortalItem`,null),e([s(`portalItem`,{itemId:{type:String}})],c.prototype,`writePortalItem`,null),c=e([i(`esri.layers.support.PortalItemData`)],c);export{c as default};
2
+ import{__decorate as e}from"tslib";import{Clonable as t}from"../../core/Clonable.js";import n from"../../core/Error.js";import{JSONSupportMixin as r}from"../../core/JSONSupport.js";import{property as i}from"../../core/accessorSupport/decorators.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import o from"../../portal/PortalItem.js";import{isCrossPortalWrite as s}from"../../webdoc/support/saveUtils.js";import{reader as c}from"../../core/accessorSupport/decorators/reader.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";let u=class extends r(t){constructor(e){super(e),this.type=`portal-item`}readPortalItem(e,t,n){if(t.itemId)return new o({id:t.itemId,portal:n?.portal})}writePortalItem(e,t,r,i){if(s(e,i)){i.messages?.push(new n(`portal-item-data:cross-portal`,`Data cannot be persisted because it refers to an item on a different portal ('${e?.portal?.url}') than the one being saved to ('${i?.portal?.url}').`,{layer:this,itemId:e?.id}));return}e?.id&&(t.itemId=e.id)}};e([i({type:[`portal-item`],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],u.prototype,`type`,void 0),e([i({type:o,json:{write:{isRequired:!0}}})],u.prototype,`portalItem`,void 0),e([c(`portalItem`,[`itemId`])],u.prototype,`readPortalItem`,null),e([l(`portalItem`,{itemId:{type:String}})],u.prototype,`writePortalItem`,null),u=e([a(`esri.layers.support.PortalItemData`)],u);export{u as default};