@arcgis/core 6.0.0-next.27 → 6.0.0-next.29

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 (421) hide show
  1. package/Map.d.ts +6 -0
  2. package/analysis/AreaMeasurementAnalysis.d.ts +4 -2
  3. package/analysis/DirectLineMeasurementAnalysis.d.ts +8 -4
  4. package/arcgisGlobal.d.ts +0 -2
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/131185d26343a997495e.js +1 -0
  7. package/assets/esri/core/workers/chunks/144bad0c2415c345736a.js +1 -0
  8. package/assets/esri/core/workers/chunks/176d0a06ebff5a29dedf.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b0ca81a07cff25df19d2.js → 176d75e76318bfc25a53.js} +1 -1
  10. package/assets/esri/core/workers/chunks/18776a130d96879a68b1.js +1 -0
  11. package/assets/esri/core/workers/chunks/{e35641a3a4da8cfbcf54.js → 189321d88026bd7e6d3e.js} +1 -1
  12. package/assets/esri/core/workers/chunks/18e7fa4d3e0b1a084cc6.js +1 -0
  13. package/assets/esri/core/workers/chunks/{1168bc5c9f0a7e1f63a2.js → 1989410a618865f02dec.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{2c0cb214fedb29487eef.js → 199a7f97916679e0257c.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1c406ab2bf99ac563316.js +1 -0
  16. package/assets/esri/core/workers/chunks/1d96fbad881a7d14a950.js +1 -0
  17. package/assets/esri/core/workers/chunks/{42d44c7d532df5ee70e9.js → 1deca3de77b1a9a07da4.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{45f826554499c38968c6.js → 1ee4df0fd61440cb5f02.js} +1 -1
  19. package/assets/esri/core/workers/chunks/22e73501e1435a896826.js +1 -0
  20. package/assets/esri/core/workers/chunks/25657f70c5f04a4ed978.js +1 -0
  21. package/assets/esri/core/workers/chunks/276a0b549acf048e8673.js +1 -0
  22. package/assets/esri/core/workers/chunks/{56e903ccef66cbe18f92.js → 2cd60fd062d954322c1f.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{ad96132bc89671e595f3.js → 2d3e0e4442dbc6ec6def.js} +1 -1
  24. package/assets/esri/core/workers/chunks/2de4296590bf9f9e9add.js +1 -0
  25. package/assets/esri/core/workers/chunks/2f5d014d6a72108b0b3a.js +1 -0
  26. package/assets/esri/core/workers/chunks/{0363d29fc665d169ebc4.js → 3105336a05f38a95ebea.js} +1 -1
  27. package/assets/esri/core/workers/chunks/379ef56f6b32494832a6.js +1 -0
  28. package/assets/esri/core/workers/chunks/3aafdb905c697bc9b1ad.js +1 -0
  29. package/assets/esri/core/workers/chunks/40c2674dae73f0942751.js +1 -0
  30. package/assets/esri/core/workers/chunks/418addce122dbb8897b4.js +1 -0
  31. package/assets/esri/core/workers/chunks/4419732baf3459a80e6d.js +1 -0
  32. package/assets/esri/core/workers/chunks/4976f5567fc7f1b63d10.js +1 -0
  33. package/assets/esri/core/workers/chunks/4e17665dd9048c300d87.js +1 -0
  34. package/assets/esri/core/workers/chunks/5396b6e99a0546a25d19.js +1 -0
  35. package/assets/esri/core/workers/chunks/53c7510df09b71ab5646.js +1 -0
  36. package/assets/esri/core/workers/chunks/561c48cb4d49b150765b.js +1 -0
  37. package/assets/esri/core/workers/chunks/{d90a3bfd45b5ed4092e0.js → 590fe0f56bc4c33a50e7.js} +1 -1
  38. package/assets/esri/core/workers/chunks/5bb6c255bdc8aa9ba23e.js +1 -0
  39. package/assets/esri/core/workers/chunks/5f1cb79aec9c4a9b7ddc.js +29 -0
  40. package/assets/esri/core/workers/chunks/{23a4806b4cdf7cc32e4d.js → 5f787809b74eed7b9a91.js} +1 -1
  41. package/assets/esri/core/workers/chunks/636e9c4ac1f9ae98f9d1.js +1 -0
  42. package/assets/esri/core/workers/chunks/654f5441227579d2b6b4.js +1 -0
  43. package/assets/esri/core/workers/chunks/692f0093c444fcc752b5.js +1 -0
  44. package/assets/esri/core/workers/chunks/69627b2634da64dd885f.js +1 -0
  45. package/assets/esri/core/workers/chunks/6a7de221cea4426cb490.js +1 -0
  46. package/assets/esri/core/workers/chunks/7030a4d0714a35995a58.js +1 -0
  47. package/assets/esri/core/workers/chunks/72d20d3957d612f86431.js +1 -0
  48. package/assets/esri/core/workers/chunks/7862abd24fb5c3b12e6b.js +1 -0
  49. package/assets/esri/core/workers/chunks/7a0b4dc0cda190367a39.js +1 -0
  50. package/assets/esri/core/workers/chunks/{ab1660f5f8a5268c2fac.js → 84038dd85005fea413eb.js} +1 -1
  51. package/assets/esri/core/workers/chunks/849f446c718e892f39ce.js +1 -0
  52. package/assets/esri/core/workers/chunks/{8ac2098ecdc40ad41055.js → 8502274806ea52308822.js} +1 -1
  53. package/assets/esri/core/workers/chunks/865cebc5c982c040ab6f.js +1 -0
  54. package/assets/esri/core/workers/chunks/{76196c414e48834f7b92.js → 8f008eedb11685ee2048.js} +1 -1
  55. package/assets/esri/core/workers/chunks/90d797ab82d4a68ba32f.js +1 -0
  56. package/assets/esri/core/workers/chunks/9184c947cdefe06bf551.js +1 -0
  57. package/assets/esri/core/workers/chunks/9976eaa81085c0d17e14.js +1 -0
  58. package/assets/esri/core/workers/chunks/{177f353ce72133e2eeed.js → 9c2436464b7dfd666678.js} +1 -1
  59. package/assets/esri/core/workers/chunks/a125650edbed802e419a.js +1 -0
  60. package/assets/esri/core/workers/chunks/{23fd4de56de352f63e2d.js → a2196a49f89d57a0a1c7.js} +1 -1
  61. package/assets/esri/core/workers/chunks/ad21757d78e372fa2ed6.js +1 -0
  62. package/assets/esri/core/workers/chunks/b01688ccc29d33bfc82d.js +1 -0
  63. package/assets/esri/core/workers/chunks/b5eff28cf482d920b9ea.js +1 -0
  64. package/assets/esri/core/workers/chunks/{04ecf15524ff3838c01c.js → ba4520ddcb6a49988da6.js} +1 -1
  65. package/assets/esri/core/workers/chunks/be55771758e4bcef0976.js +1 -0
  66. package/assets/esri/core/workers/chunks/bead830a677690eeb6fb.js +1 -0
  67. package/assets/esri/core/workers/chunks/c131e0dd180a4c10e12e.js +1 -0
  68. package/assets/esri/core/workers/chunks/c1cf3edce15f09648eb4.js +1 -0
  69. package/assets/esri/core/workers/chunks/c4f78a481f43cfae7b63.js +1 -0
  70. package/assets/esri/core/workers/chunks/c570b90995c65bbb2e14.js +1 -0
  71. package/assets/esri/core/workers/chunks/c576bef77e34920af188.js +1 -0
  72. package/assets/esri/core/workers/chunks/c9feffb9884cfed52c4b.js +1 -0
  73. package/assets/esri/core/workers/chunks/cc97e4fd0dacad970a23.js +1 -0
  74. package/assets/esri/core/workers/chunks/ce324dde6d7daea33638.js +1 -0
  75. package/assets/esri/core/workers/chunks/d1d6154b4af1c9cc497b.js +1 -0
  76. package/assets/esri/core/workers/chunks/d3c3fb079ad97970f834.js +1 -0
  77. package/assets/esri/core/workers/chunks/daae21cf77864f3293ef.js +1 -0
  78. package/assets/esri/core/workers/chunks/dc2f93453dfa40f623ab.js +1 -0
  79. package/assets/esri/core/workers/chunks/dcf6024dc19428ff2b9d.js +1 -0
  80. package/assets/esri/core/workers/chunks/dd30b02c5978c1c5f511.js +1 -0
  81. package/assets/esri/core/workers/chunks/de3f140058aa0b907b65.js +1 -0
  82. package/assets/esri/core/workers/chunks/df375d1b0dab5ecbd1be.js +1 -0
  83. package/assets/esri/core/workers/chunks/{ef2c3febcceedc44b3ac.js → dfd4782b11d6fdca0492.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{48cc58890fddbcf69cef.js → e121d15b883184ee83e7.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{67e06d606c7fd2064adf.js → e2c6cd8dac01e129ccfe.js} +1 -1
  86. package/assets/esri/core/workers/chunks/e3b212f8af448ec29eef.js +1 -0
  87. package/assets/esri/core/workers/chunks/e4042e43f0081fe49f7b.js +1 -0
  88. package/assets/esri/core/workers/chunks/e480e7d5f40049a2053b.js +1 -0
  89. package/assets/esri/core/workers/chunks/eaab787a5f2445be5e5a.js +1 -0
  90. package/assets/esri/core/workers/chunks/edd36a1fc80b1d29907e.js +1 -0
  91. package/assets/esri/core/workers/chunks/ee0dc906cc7979080329.js +1 -0
  92. package/assets/esri/core/workers/chunks/f07fb9b3fa30d7ee1681.js +1 -0
  93. package/assets/esri/core/workers/chunks/f09bc86cd52224febfcb.js +1 -0
  94. package/assets/esri/core/workers/chunks/{037c67ef5c4398d5954d.js → f2dab9fcd90ce38ae3d1.js} +1 -1
  95. package/assets/esri/core/workers/chunks/f39c700f3db7db52b522.js +1 -0
  96. package/assets/esri/core/workers/chunks/f3b4159c0722df8ffe13.js +1 -0
  97. package/assets/esri/core/workers/chunks/f3dc0bc0e00635855a7a.js +1 -0
  98. package/assets/esri/core/workers/chunks/f45064066e1ab041a0b2.js +1 -0
  99. package/assets/esri/core/workers/chunks/f7398cfd8bbd041bd635.js +1 -0
  100. package/assets/esri/core/workers/chunks/f9dc38761b314d33890f.js +1 -0
  101. package/assets/esri/core/workers/chunks/fe6dcb21570395e46ce8.js +1 -0
  102. package/assets/esri/core/workers/chunks/{00580a68835aac653038.js → fefdd10bdd5a4c8d8ed0.js} +45 -48
  103. package/assets/esri/core/workers/chunks/ffe49d9e7df081bef4a5.js +1 -0
  104. package/assets/esri/themes/base/_core.scss +0 -2
  105. package/assets/esri/themes/dark/main.css +1 -1
  106. package/assets/esri/themes/light/main.css +1 -1
  107. package/assets/esri/themes/light/view.css +1 -1
  108. package/chunks/BlendLayers.glsl.js +1 -1
  109. package/chunks/Component.glsl.js +51 -54
  110. package/chunks/EmissionComposite.glsl.js +1 -1
  111. package/chunks/Fog.glsl.js +1 -1
  112. package/chunks/GaussianSplat.glsl.js +65 -21
  113. package/chunks/GaussianSplatDepth.glsl.js +53 -4
  114. package/chunks/GaussianSplatShadow.glsl.js +83 -19
  115. package/chunks/GlobalIllumination.glsl.js +2 -17
  116. package/chunks/LineMarker.glsl.js +32 -31
  117. package/chunks/OITAddEmission.glsl.js +1 -1
  118. package/chunks/RasterColorizer.glsl.js +1 -1
  119. package/chunks/RibbonLine.glsl.js +34 -34
  120. package/chunks/Terrain.glsl.js +3 -4
  121. package/chunks/Water.glsl.js +22 -23
  122. package/config.d.ts +12 -9
  123. package/config.js +1 -1
  124. package/form/FormTemplate.d.ts +1 -1
  125. package/form/elements/AttachmentElement.d.ts +2 -0
  126. package/form/elements/FieldElement.d.ts +2 -2
  127. package/form/elements/FieldElement.js +1 -1
  128. package/form/elements/RelationshipElement.d.ts +1 -1
  129. package/form/elements/TextElement.d.ts +2 -2
  130. package/form/elements/UtilityNetworkAssociationsElement.d.ts +1 -1
  131. package/form/elements/inputs/DynamicChoiceInput.d.ts +2 -2
  132. package/form/elements/inputs/inputUtils.js +1 -1
  133. package/form/elements/inputs/types.d.ts +19 -0
  134. package/form/elements/inputs.d.ts +3 -2
  135. package/form/elements/inputs.js +1 -1
  136. package/geometry/operators/containsOperator.d.ts +1 -1
  137. package/geometry/operators/densifyOperator.d.ts +1 -1
  138. package/geometry/operators/differenceOperator.d.ts +6 -4
  139. package/geometry/operators/distanceOperator.d.ts +1 -1
  140. package/geometry/operators/geodesicProximityOperator.d.ts +8 -8
  141. package/geometry/operators/graphicBufferOperator.d.ts +6 -6
  142. package/geometry/operators/integrateOperator.d.ts +2 -2
  143. package/geometry/operators/intersectsOperator.d.ts +3 -3
  144. package/geometry/operators/linesToPolygonsOperator.d.ts +2 -2
  145. package/geometry/operators/locateBetweenOperator.d.ts +2 -2
  146. package/geometry/operators/minimumBoundingCircleOperator.d.ts +1 -1
  147. package/geometry/operators/multiPartToSinglePartOperator.d.ts +2 -2
  148. package/geometry/operators/polygonSlicerOperator.d.ts +2 -2
  149. package/geometry/operators/projectOperator.d.ts +2 -2
  150. package/geometry/operators/proximityOperator.d.ts +15 -15
  151. package/geometry/operators/shapePreservingProjectOperator.d.ts +2 -2
  152. package/geometry/operators/simplifyOperator.d.ts +2 -2
  153. package/geometry/operators/support/GeographicTransformationStep.d.ts +3 -3
  154. package/geometry/operators/support/Transformation.d.ts +8 -8
  155. package/geometry/operators/support/geographicTransformationUtils.d.ts +3 -3
  156. package/geometry/operators/symmetricDifferenceOperator.d.ts +2 -2
  157. package/geometry/operators/withinOperator.d.ts +3 -3
  158. package/interfaces.d.ts +0 -14
  159. package/kernel.js +1 -1
  160. package/layers/GeospatialPDFLayer.d.ts +2 -2
  161. package/layers/ParquetLayer.d.ts +1 -1
  162. package/layers/VideoLayer.d.ts +5 -5
  163. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  164. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  165. package/layers/orientedImagery/transformations/rotationUtils.js +2 -0
  166. package/layers/orientedImagery/transformations/utils.js +1 -1
  167. package/layers/save/parquetLayerUtils.js +1 -1
  168. package/layers/support/vectorTileLayerLoader.js +1 -1
  169. package/package.json +2 -2
  170. package/popup/FeaturesModel.js +1 -1
  171. package/popup/support/featureUtils.js +1 -1
  172. package/rest/featureService/FeatureService.d.ts +0 -5
  173. package/rest/networks/support/TraceLocation.d.ts +2 -1
  174. package/rest/networks/support/TraceResult.d.ts +0 -4
  175. package/rest/support/OutDistance.d.ts +0 -1
  176. package/smartMapping/statistics/histogramForTimeSeries.js +1 -1
  177. package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +1 -1
  178. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  179. package/support/BasemapStyle.d.ts +2 -2
  180. package/symbols/cim/types.d.ts +7 -9
  181. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  182. package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSource.js +1 -1
  183. package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSourceWorker.js +1 -1
  184. package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +2 -0
  185. package/views/2d/engine/webgl/animations/instructions.js +1 -1
  186. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  187. package/views/2d/engine/webgl/collisions/LabelStore.js +1 -1
  188. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  189. package/views/2d/layers/features/FeatureContainer.js +1 -1
  190. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  191. package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
  192. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  193. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  194. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  195. package/views/3d/analysis/support/projectionUtils.js +1 -1
  196. package/views/3d/environment/SunLighting.d.ts +15 -2
  197. package/views/3d/environment/VirtualLighting.d.ts +15 -2
  198. package/views/3d/input/SceneInputManager.js +1 -1
  199. package/views/3d/input/handlers/ground/GroundMouseWheelMove.js +2 -0
  200. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  201. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  202. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  203. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  204. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  205. package/views/3d/navigation/Navigation3D.js +1 -1
  206. package/views/3d/state/controllers/GroundMouseWheelController.js +2 -0
  207. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  208. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  209. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  210. package/views/3d/support/ResourceController.js +1 -1
  211. package/views/3d/terrain/BlendLayers.glsl.js +1 -1
  212. package/views/3d/terrain/RasterColorizer.glsl.js +1 -1
  213. package/views/3d/terrain/TerrainRenderer.js +1 -1
  214. package/views/3d/terrain/TerrainSurface.js +1 -1
  215. package/views/3d/terrain/TileAgent.js +1 -1
  216. package/views/3d/terrain/TileCompositor.js +1 -1
  217. package/views/3d/terrain/TileRenderer.js +1 -1
  218. package/views/3d/webgl-engine/Stage.js +1 -1
  219. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  220. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +23 -26
  221. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +18 -21
  222. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js +7 -8
  223. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +5 -5
  224. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +10 -12
  225. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +22 -25
  226. package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +3 -5
  227. package/views/3d/webgl-engine/core/shaderLibrary/shading/forwardLocalUp.glsl.js +6 -0
  228. package/views/3d/webgl-engine/core/shaderLibrary/shading/getLocalUp.glsl.js +4 -0
  229. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +1 -1
  230. package/views/3d/webgl-engine/core/shaderLibrary/terrain/{TileBackground.glsl.js → blendLayers.glsl.js} +10 -11
  231. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +8 -2
  232. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
  233. package/views/3d/webgl-engine/effects/RenderPluginContext.js +2 -0
  234. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  235. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  236. package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +3 -3
  237. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  238. package/views/3d/webgl-engine/lib/GaussianSplatDepthRenderer.js +1 -1
  239. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  240. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  241. package/views/3d/webgl-engine/lib/edgeRendering/EdgeUtil.glsl.js +30 -35
  242. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  243. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  244. package/views/3d/webgl-engine/shaders/EmissiveTechniqueConfiguration.js +1 -1
  245. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  246. package/views/3d/webgl-engine/shaders/GaussianSplatDepth.glsl.js +1 -1
  247. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +70 -108
  248. package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
  249. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  250. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  251. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  252. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  253. package/views/VideoView.d.ts +10 -0
  254. package/views/VideoView.js +1 -1
  255. package/views/draw/DrawOperation.js +1 -1
  256. package/views/draw/DrawScreenTool.js +1 -1
  257. package/views/input/types.d.ts +2 -4
  258. package/views/interactive/options/LabelOptions.d.ts +5 -5
  259. package/views/interactive/options/SnappingOptions.d.ts +2 -2
  260. package/views/layers/LayerView.d.ts +10 -2
  261. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +2 -3
  262. package/widgets/Editor/EditorViewModel.d.ts +10 -12
  263. package/widgets/Editor/VisibleElements.d.ts +4 -0
  264. package/widgets/Editor.d.ts +2 -0
  265. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  266. package/widgets/FeatureTable/support/EditableColumnTemplateMixin.js +1 -1
  267. package/widgets/FeatureTable.js +1 -1
  268. package/widgets/Features/FeaturesViewModel.js +1 -1
  269. package/widgets/OrientedImageryViewer/ImageMeasurementWorker.js +1 -1
  270. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  271. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  272. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  273. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  274. package/widgets/OrientedImageryViewer/imageMeasurementWorkerUtils.js +2 -0
  275. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  276. package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
  277. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
  278. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  279. package/widgets/PanoramicViewer/utils.js +1 -1
  280. package/widgets/Search/LayerSearchSource.d.ts +1 -1
  281. package/widgets/Sketch/VisibleElements.d.ts +4 -0
  282. package/widgets/Sketch.d.ts +2 -0
  283. package/widgets/support/iconUtils.js +1 -1
  284. package/assets/esri/core/workers/chunks/010f57ec7fdbedf78d02.js +0 -1
  285. package/assets/esri/core/workers/chunks/0487e1d7a7cecf7c1c25.js +0 -1
  286. package/assets/esri/core/workers/chunks/09300e74e5b014ce6269.js +0 -1
  287. package/assets/esri/core/workers/chunks/0bd04bcd4b2710838d48.js +0 -1
  288. package/assets/esri/core/workers/chunks/0d9c4c6c571ce26d356b.js +0 -1
  289. package/assets/esri/core/workers/chunks/112ed86f812e4400a7e0.js +0 -1
  290. package/assets/esri/core/workers/chunks/151e5799ede763a03ee2.js +0 -1
  291. package/assets/esri/core/workers/chunks/173f89c55a5c79ff065b.js +0 -1
  292. package/assets/esri/core/workers/chunks/2447d2e2a4a3ab8fcf94.js +0 -1
  293. package/assets/esri/core/workers/chunks/2a36fe3f3f257a779a1b.js +0 -1
  294. package/assets/esri/core/workers/chunks/2a97268000c6d03ef720.js +0 -1
  295. package/assets/esri/core/workers/chunks/2cf8172be83b10b11bdc.js +0 -1
  296. package/assets/esri/core/workers/chunks/2df37a9a95ceebb87a5f.js +0 -1
  297. package/assets/esri/core/workers/chunks/2e00c155e447e4930442.js +0 -1
  298. package/assets/esri/core/workers/chunks/2f91fd61019d2a37476d.js +0 -1
  299. package/assets/esri/core/workers/chunks/30af63b3b750142faadb.js +0 -1
  300. package/assets/esri/core/workers/chunks/3a47fc97c400fca2c736.js +0 -1
  301. package/assets/esri/core/workers/chunks/3cd04d23b73beaf79650.js +0 -1
  302. package/assets/esri/core/workers/chunks/426b4eb500fdfe9df325.js +0 -1
  303. package/assets/esri/core/workers/chunks/45367aa8e5c5d574de94.js +0 -1
  304. package/assets/esri/core/workers/chunks/47c97640ec525676918b.js +0 -1
  305. package/assets/esri/core/workers/chunks/47d074136a7f8e551a9a.js +0 -1
  306. package/assets/esri/core/workers/chunks/4a6b92ecbb1f1c55cc43.js +0 -1
  307. package/assets/esri/core/workers/chunks/4cb751dc8d00bdaeb04c.js +0 -1
  308. package/assets/esri/core/workers/chunks/518ab22f80c3300bcfff.js +0 -1
  309. package/assets/esri/core/workers/chunks/53ff68d4f9e365fc15cd.js +0 -1
  310. package/assets/esri/core/workers/chunks/58609bf94f72bc4f1952.js +0 -1
  311. package/assets/esri/core/workers/chunks/586a929bc037e23857af.js +0 -1
  312. package/assets/esri/core/workers/chunks/5c7780f804d789cb37f5.js +0 -1
  313. package/assets/esri/core/workers/chunks/5d76f4d97beee494bbbf.js +0 -1
  314. package/assets/esri/core/workers/chunks/603fdbbe9534c614928f.js +0 -1
  315. package/assets/esri/core/workers/chunks/611e3cdf67283c11576f.js +0 -1
  316. package/assets/esri/core/workers/chunks/6431480ba0fa8c8d487f.js +0 -1
  317. package/assets/esri/core/workers/chunks/652faf4359ac072c5dde.js +0 -1
  318. package/assets/esri/core/workers/chunks/65c98f3449044fa4fd79.js +0 -1
  319. package/assets/esri/core/workers/chunks/6b9961261241fdce0e94.js +0 -1
  320. package/assets/esri/core/workers/chunks/6dfe96b056bec30068df.js +0 -1
  321. package/assets/esri/core/workers/chunks/6f897b4e7ddd1dd1672b.js +0 -1
  322. package/assets/esri/core/workers/chunks/70cc2d79653d66e85b58.js +0 -1
  323. package/assets/esri/core/workers/chunks/7159d9c36869cd82599e.js +0 -29
  324. package/assets/esri/core/workers/chunks/7393f63043a1da3d05a6.js +0 -1
  325. package/assets/esri/core/workers/chunks/7449568eb2305bf2d650.js +0 -1
  326. package/assets/esri/core/workers/chunks/75d551a449bba61ce238.js +0 -1
  327. package/assets/esri/core/workers/chunks/7748c2886d0122b40eeb.js +0 -1
  328. package/assets/esri/core/workers/chunks/78643f116677950ea29a.js +0 -1
  329. package/assets/esri/core/workers/chunks/78fbe330f16bdbdb886e.js +0 -1
  330. package/assets/esri/core/workers/chunks/7e0f04a5038e2a4f6e4b.js +0 -1
  331. package/assets/esri/core/workers/chunks/7f16ae01ccd9b6114d1c.js +0 -1
  332. package/assets/esri/core/workers/chunks/90153b5230b3a4985c14.js +0 -1
  333. package/assets/esri/core/workers/chunks/9189dfe19a2a2ccd5173.js +0 -1
  334. package/assets/esri/core/workers/chunks/943a0f140813ee4ab04a.js +0 -1
  335. package/assets/esri/core/workers/chunks/98be2f621801e230aa01.js +0 -1
  336. package/assets/esri/core/workers/chunks/99f51d5d9da6e9bfc430.js +0 -1
  337. package/assets/esri/core/workers/chunks/9aebe876b1a2fb075f9c.js +0 -1
  338. package/assets/esri/core/workers/chunks/9b6929faf649e81265fb.js +0 -1
  339. package/assets/esri/core/workers/chunks/9dd1fc56eb1ea6eb705e.js +0 -1
  340. package/assets/esri/core/workers/chunks/9dd48e75b4e8d9811d81.js +0 -1
  341. package/assets/esri/core/workers/chunks/a163c6005aba3378edaa.js +0 -1
  342. package/assets/esri/core/workers/chunks/a8286febe371dc186aaa.js +0 -1
  343. package/assets/esri/core/workers/chunks/acb265a22be5e12f38e5.js +0 -1
  344. package/assets/esri/core/workers/chunks/b12acf1f694f82e00df9.js +0 -1
  345. package/assets/esri/core/workers/chunks/b83cef2d3f528726d492.js +0 -1
  346. package/assets/esri/core/workers/chunks/b9596d862da1ec342cd3.js +0 -1
  347. package/assets/esri/core/workers/chunks/bc1fcc9c897461e68e29.js +0 -1
  348. package/assets/esri/core/workers/chunks/bdc221d94300c225665a.js +0 -1
  349. package/assets/esri/core/workers/chunks/be97a629e2ae4d13ceb3.js +0 -1
  350. package/assets/esri/core/workers/chunks/bfb39590c548188f5052.js +0 -1
  351. package/assets/esri/core/workers/chunks/c2318c014e97ba519be8.js +0 -1
  352. package/assets/esri/core/workers/chunks/c29091fe157564cffcf7.js +0 -1
  353. package/assets/esri/core/workers/chunks/c62237c344e341619341.js +0 -1
  354. package/assets/esri/core/workers/chunks/c8eae00b0ec87d8b2ff3.js +0 -1
  355. package/assets/esri/core/workers/chunks/cdb5c26fed7d9a97db49.js +0 -1
  356. package/assets/esri/core/workers/chunks/cdf0c7706d3e1221f49b.js +0 -1
  357. package/assets/esri/core/workers/chunks/cea0db3ee326f60610eb.js +0 -1
  358. package/assets/esri/core/workers/chunks/d7f2f1708d2a2668676c.js +0 -1
  359. package/assets/esri/core/workers/chunks/daf9b691817e83a11f3c.js +0 -1
  360. package/assets/esri/core/workers/chunks/db41490bd39d863305bf.js +0 -1
  361. package/assets/esri/core/workers/chunks/ddc95cdac6c06fc4794c.js +0 -1
  362. package/assets/esri/core/workers/chunks/df26ec0b508cf4716e0a.js +0 -1
  363. package/assets/esri/core/workers/chunks/e11159e3dc3353b27c57.js +0 -1
  364. package/assets/esri/core/workers/chunks/e4a57a0a9629faafd6c6.js +0 -1
  365. package/assets/esri/core/workers/chunks/ebc1a2ef3aed8aa29424.js +0 -1
  366. package/assets/esri/core/workers/chunks/ec1c4d66142b6efb0e8b.js +0 -1
  367. package/assets/esri/core/workers/chunks/ef12fa3574d4cbf8b084.js +0 -1
  368. package/assets/esri/core/workers/chunks/f2d56f5c15d5977e1d19.js +0 -1
  369. package/assets/esri/core/workers/chunks/f7bfa3d33b05b250ce33.js +0 -1
  370. package/assets/esri/core/workers/chunks/f905f1a1aa4c123cbe83.js +0 -1
  371. package/assets/esri/core/workers/chunks/fc139f251dc0523074e7.js +0 -1
  372. package/assets/esri/themes/base/widgets/_VideoPlayer.scss +0 -129
  373. package/assets/esri/widgets/VideoPlayer/t9n/messages.ar.json +0 -1
  374. package/assets/esri/widgets/VideoPlayer/t9n/messages.bg.json +0 -1
  375. package/assets/esri/widgets/VideoPlayer/t9n/messages.bs.json +0 -1
  376. package/assets/esri/widgets/VideoPlayer/t9n/messages.ca.json +0 -1
  377. package/assets/esri/widgets/VideoPlayer/t9n/messages.cs.json +0 -1
  378. package/assets/esri/widgets/VideoPlayer/t9n/messages.da.json +0 -1
  379. package/assets/esri/widgets/VideoPlayer/t9n/messages.de.json +0 -1
  380. package/assets/esri/widgets/VideoPlayer/t9n/messages.el.json +0 -1
  381. package/assets/esri/widgets/VideoPlayer/t9n/messages.en.json +0 -1
  382. package/assets/esri/widgets/VideoPlayer/t9n/messages.es.json +0 -1
  383. package/assets/esri/widgets/VideoPlayer/t9n/messages.et.json +0 -1
  384. package/assets/esri/widgets/VideoPlayer/t9n/messages.fi.json +0 -1
  385. package/assets/esri/widgets/VideoPlayer/t9n/messages.fr.json +0 -1
  386. package/assets/esri/widgets/VideoPlayer/t9n/messages.he.json +0 -1
  387. package/assets/esri/widgets/VideoPlayer/t9n/messages.hr.json +0 -1
  388. package/assets/esri/widgets/VideoPlayer/t9n/messages.hu.json +0 -1
  389. package/assets/esri/widgets/VideoPlayer/t9n/messages.id.json +0 -1
  390. package/assets/esri/widgets/VideoPlayer/t9n/messages.it.json +0 -1
  391. package/assets/esri/widgets/VideoPlayer/t9n/messages.ja.json +0 -1
  392. package/assets/esri/widgets/VideoPlayer/t9n/messages.ko.json +0 -1
  393. package/assets/esri/widgets/VideoPlayer/t9n/messages.lt.json +0 -1
  394. package/assets/esri/widgets/VideoPlayer/t9n/messages.lv.json +0 -1
  395. package/assets/esri/widgets/VideoPlayer/t9n/messages.nl.json +0 -1
  396. package/assets/esri/widgets/VideoPlayer/t9n/messages.no.json +0 -1
  397. package/assets/esri/widgets/VideoPlayer/t9n/messages.pl.json +0 -1
  398. package/assets/esri/widgets/VideoPlayer/t9n/messages.pt-BR.json +0 -1
  399. package/assets/esri/widgets/VideoPlayer/t9n/messages.pt-PT.json +0 -1
  400. package/assets/esri/widgets/VideoPlayer/t9n/messages.ro.json +0 -1
  401. package/assets/esri/widgets/VideoPlayer/t9n/messages.ru.json +0 -1
  402. package/assets/esri/widgets/VideoPlayer/t9n/messages.sk.json +0 -1
  403. package/assets/esri/widgets/VideoPlayer/t9n/messages.sl.json +0 -1
  404. package/assets/esri/widgets/VideoPlayer/t9n/messages.sr.json +0 -1
  405. package/assets/esri/widgets/VideoPlayer/t9n/messages.sv.json +0 -1
  406. package/assets/esri/widgets/VideoPlayer/t9n/messages.th.json +0 -1
  407. package/assets/esri/widgets/VideoPlayer/t9n/messages.tr.json +0 -1
  408. package/assets/esri/widgets/VideoPlayer/t9n/messages.uk.json +0 -1
  409. package/assets/esri/widgets/VideoPlayer/t9n/messages.vi.json +0 -1
  410. package/assets/esri/widgets/VideoPlayer/t9n/messages.zh-CN.json +0 -1
  411. package/assets/esri/widgets/VideoPlayer/t9n/messages.zh-HK.json +0 -1
  412. package/assets/esri/widgets/VideoPlayer/t9n/messages.zh-TW.json +0 -1
  413. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +0 -232
  414. package/widgets/VideoPlayer/VideoPlayerViewModel.js +0 -2
  415. package/widgets/VideoPlayer/components/MetadataSection.js +0 -2
  416. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +0 -2
  417. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +0 -2
  418. package/widgets/VideoPlayer/components/SettingsButton.js +0 -2
  419. package/widgets/VideoPlayer/css.js +0 -2
  420. package/widgets/VideoPlayer.d.ts +0 -119
  421. package/widgets/VideoPlayer.js +0 -2
@@ -17,7 +17,7 @@ import type { GeometryUnion, GeometryWithoutMeshUnion } from "../types.js";
17
17
  *
18
18
  * @param leftGeometry - The first geometry to be XOR'd.
19
19
  * @param rightGeometry - The second geometry to be XOR'd.
20
- * @returns Returns the symmetric difference of the two geometries. The result has the higher of dimensions of the two geometries.
20
+ * @returns Returns the symmetric difference of the two geometries. The result has the higher dimension of the two geometries.
21
21
  * @since 5.2
22
22
  * @example
23
23
  * // Calculate the symmetric difference of two polygons.
@@ -33,7 +33,7 @@ export function symmetricDifferenceExecute(leftGeometry: GeometryUnion, rightGeo
33
33
  * with [symmetricDifferenceExecute()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/symmetricDifferenceOperator/#symmetricDifferenceExecute).
34
34
  * @param leftGeometry - The first geometry to be XOR'd.
35
35
  * @param rightGeometry - The second geometry to be XOR'd.
36
- * @returns Returns the symmetric difference of the two geometries. The result has the higher of dimensions of the two geometries.
36
+ * @returns Returns the symmetric difference of the two geometries. The result has the higher dimension of the two geometries.
37
37
  * @example
38
38
  * // Calculate the symmetric difference of two polygons.
39
39
  * const differencePolygon = symmetricDifferenceExecute(polygon1, polygon2);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Perform a relational operation to determine if one 2D geometry is within another 2D geometry. Geometry A is within geometry B, when A is the intersection of A and B.
2
+ * Perform a relational operation to determine if one 2D geometry is within another 2D geometry. Geometry A is within geometry B when A is the intersection of A and B.
3
3
  *
4
4
  * Geometry A can be non-simple geometry.
5
5
  *
@@ -37,7 +37,7 @@ export function accelerateGeometry(geometry: GeometryUnion): boolean;
37
37
  * @returns Returns `true` if `inner` is within `outer`.
38
38
  * @since 5.2
39
39
  * @example
40
- * Returns true if a geometry is completely within another
40
+ * // Returns true if a geometry is completely within another
41
41
  * const isWithin = withinExecute(polygon1, polygon2);
42
42
  */
43
43
  export function withinExecute(inner: GeometryUnion, outer: GeometryUnion): boolean;
@@ -52,7 +52,7 @@ export function withinExecute(inner: GeometryUnion, outer: GeometryUnion): boole
52
52
  * @param outer - The comparison geometry that is tested for the "contains" relationship with `inner`.
53
53
  * @returns Returns `true` if `inner` is within `outer`.
54
54
  * @example
55
- * Returns true if a geometry is completely within another
55
+ * // Returns true if a geometry is completely within another
56
56
  * const isWithin = withinExecute(polygon1, polygon2);
57
57
  */
58
58
  export function execute(inner: GeometryUnion, outer: GeometryUnion): boolean;
package/interfaces.d.ts CHANGED
@@ -13719,13 +13719,6 @@ declare namespace __esri {
13719
13719
  /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
13720
13720
  export type ValuePickerPreviousEventHandler = (event: ValuePickerPreviousEvent) => void;
13721
13721
 
13722
- /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
13723
- export type VideoPlayerProperties = import("./widgets/VideoPlayer.js").VideoPlayerProperties;
13724
-
13725
- /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
13726
- export type VideoPlayer = import("./widgets/VideoPlayer.js").default;
13727
- export const VideoPlayer: typeof import("./widgets/VideoPlayer.js").default;
13728
-
13729
13722
  /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
13730
13723
  export type WeatherProperties = import("./widgets/Weather.js").WeatherProperties;
13731
13724
 
@@ -15697,13 +15690,6 @@ declare namespace __esri {
15697
15690
  export type VersionManagementViewModel = import("./widgets/VersionManagement/VersionManagementViewModel.js").default;
15698
15691
  export const VersionManagementViewModel: typeof import("./widgets/VersionManagement/VersionManagementViewModel.js").default;
15699
15692
 
15700
- /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
15701
- export type VideoPlayerViewModelProperties = import("./widgets/VideoPlayer/VideoPlayerViewModel.js").VideoPlayerViewModelProperties;
15702
-
15703
- /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
15704
- export type VideoPlayerViewModel = import("./widgets/VideoPlayer/VideoPlayerViewModel.js").default;
15705
- export const VideoPlayerViewModel: typeof import("./widgets/VideoPlayer/VideoPlayerViewModel.js").default;
15706
-
15707
15693
  /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
15708
15694
  export type WeatherVisibleElementsProperties = import("./widgets/Weather/VisibleElements.js").VisibleElementsProperties;
15709
15695
 
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`6.0.0-next.27`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
2
+ import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`6.0.0-next.29`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
@@ -28,7 +28,7 @@ export interface GeospatialPDFLayerProperties extends LayerProperties, ScaleRang
28
28
  * The entire document is downloaded before rendering; large or complex PDFs can increase load time and memory usage.
29
29
  * The layer derives its [spatial reference](https://developers.arcgis.com/javascript/latest/references/core/layers/GeospatialPDFLayer/#spatialReference) and
30
30
  * [extent](https://developers.arcgis.com/javascript/latest/references/core/layers/GeospatialPDFLayer/#fullExtent) from the embedded georeferencing information.
31
- * The rendered imagery can be reprojected to the spatial reference of the view. In an scene, it is draped on the ground.
31
+ * The rendered imagery can be reprojected to the spatial reference of the view. In a scene, it is draped on the ground.
32
32
  *
33
33
  * Additionally the PDF defines the boundary of the georeferenced map within the page, called a *neatline*.
34
34
  * Set [clippedToNeatline](https://developers.arcgis.com/javascript/latest/references/core/layers/GeospatialPDFLayer/#clippedToNeatline) to `true` to hide content outside this boundary, such as page margins, legends, and titles.
@@ -44,7 +44,7 @@ export interface GeospatialPDFLayerProperties extends LayerProperties, ScaleRang
44
44
  * >
45
45
  * > - Documents that require a password to open are not supported.
46
46
  * > - Tile reprojection is limited: grid-based transformations are not supported. As a result, the layer may still display but appear shifted. See the [project operator's known limitations](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/projectOperator/).
47
- * > - To decode certain image types from PDF files, GeospatialPDFLayer is using WebAssembly features not available yet in Safari. As a result it uses a slower JavaScript fallback which impact the initial load of the layer.
47
+ * > - To decode certain image types from PDF files, GeospatialPDFLayer uses WebAssembly features not yet available in Safari. As a result, it uses a slower JavaScript fallback, which impacts the initial load of the layer.
48
48
  * > - Not supported by the [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/).
49
49
  *
50
50
  * @beta
@@ -366,7 +366,7 @@ export default class ParquetLayer extends ParquetLayerSuperclass {
366
366
  /** Describes the layer's supported capabilities. */
367
367
  get capabilities(): FeatureLayerCapabilities | null | undefined;
368
368
  /**
369
- * Array of Chart Items of type WebMapWebChart available on the parquet layer.
369
+ * Array of chart items of type WebMapWebChart available on the Parquet layer.
370
370
  *
371
371
  * @since 5.2
372
372
  */
@@ -155,17 +155,17 @@ export interface VideoLayerProperties extends LayerProperties, CustomParametersM
155
155
 
156
156
  /**
157
157
  * The VideoLayer provides video content from on-demand and livestream feeds from an [ArcGIS Video Server](https://enterprise.arcgis.com/en/video/).
158
- * Application developers using VideoLayer can display the video georeferenced on a [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/), and control the playback with the [VideoPlayer](https://developers.arcgis.com/javascript/latest/references/core/widgets/VideoPlayer/) widget.
158
+ * Application developers using VideoLayer can display the video georeferenced on a [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/), and control playback with the [Video Player component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-video-player/).
159
159
  *
160
160
  * > [!WARNING]
161
161
  * >
162
162
  * > **Known Limitations**
163
163
  * >
164
- * > Not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
165
- * > Not supported by the [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/).
166
- * > Not supported on macOS and iOS devices.
164
+ * > - Not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
165
+ * > - Not supported by the [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/).
166
+ * > - Not supported on macOS and iOS devices.
167
167
  *
168
- * ![VideoLayer and VideoPlayer](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/video-player.avif)
168
+ * ![VideoLayer and Video Player](https://developers.arcgis.com/javascript/latest/assets/references/components/video-player/video-player.avif)
169
169
  *
170
170
  * @since 4.30
171
171
  * @example const videoLayer = new VideoLayer({ url });
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../PopupTemplate.js";import n from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{MultiOriginJSONSupportMixin as a}from"../../core/MultiOriginJSONSupport.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import"../../core/workers/workers.js";import ee from"../../form/FormTemplate.js";import c from"../../geometry/Extent.js";import te from"../../geometry/Point.js";import ne from"../../geometry/Polygon.js";import re from"../../geometry/Polyline.js";import{initializeProjection as ie,project as l}from"../../geometry/projectionUtils.js";import ae from"../../geometry/SpatialReference.js";import{wgs84 as u}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as d}from"../../geometry/support/typeUtils.js";import f from"../../graphic/KnowledgeGraphGraphicOrigin.js";import oe from"../../graphic/LinkChartGraphicOrigin.js";import se from"../Layer.js";import ce from"../graphics/data/FeatureStore.js";import{QueryEngine as le}from"../graphics/data/QueryEngine.js";import{createDrawingInfo as p}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as m,systemAggregationCountFieldName as h,systemIsSpatialFieldName as g,systemLayoutGeometryFieldName as _,systemOriginIdFieldName as ue,systemDestinationIdFieldName as v}from"./constants.js";import{KnowledgeGraphSublayerBase as y}from"./KnowledgeGraphSublayerBase.js";import{createCapabilitiesFromKnowledgeGraph as b,createDefaultKGSLFormTemplate as x,getDisplayLabelProperty as S,getLinkChartDefaultLabelingInfo as C,getMapDefaultLabelingInfo as w,getKGSublayerSymbolColor as T,getDefaultLCRelationshipSublayerSymbol as E,createDefaultKGSLFeatureTemplates as D,convertLayerEditsToGraphEdits as O,convertGraphEditsResultToFeatureEdits as k}from"./layerUtils.js";import{BlendLayer as A,blendModeProperty as j,effectProperty as M}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as N,displayFilterEnabledProperty as P,displayFilterInfoProperty as F}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as I,featureEffectProperty as L}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as R}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as z,orderByProperty as B}from"../mixins/OrderedLayer.js";import{RefreshableLayer as V}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as H}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as U,useViewTimeProperty as de}from"../mixins/TemporalLayer.js";import{legendEnabled as fe,maxScale as pe,minScale as me,opacity as he,popupEnabled as ge}from"../support/commonProperties.js";import{featureReductionProperty as _e}from"../support/featureReductionUtils.js";import ve from"../support/FeatureTemplate.js";import W from"../support/Field.js";import{fixRendererFields as ye,fixTimeInfoFields as be}from"../support/fieldUtils.js";import xe from"../support/LabelClass.js";import{reader as Se}from"../support/labelingInfo.js";import Ce from"../support/TimeInfo.js";import we from"../../renderers/SimpleRenderer.js";import{fromJSON as G}from"../../renderers/support/jsonUtils.js";import{rendererTypes as Te}from"../../renderers/support/typeUtils.js";import{executeApplyEdits as Ee}from"../../rest/knowledgeGraphService.js";import De from"../../rest/support/FeatureSet.js";import K from"../../rest/support/Query.js";import{createPopupTemplate as Oe}from"../../support/popupUtils.js";import ke from"../../symbols/support/ElevationInfo.js";import{applyColorToSymbol as q}from"../../symbols/support/utils.js";import Ae from"../../core/workers/RemoteClient.js";import{writer as je}from"../../core/accessorSupport/decorators/writer.js";function J(e){if(!e.json)return e;e.json.write=Y(e.json.write);let t=e.json.origins;if(!t)return e;let n;for(n in t){let e=t[n];e&&(e.write=Y(e.write))}return e}function Y(e){return typeof e==`object`&&e?(e.enabled!==!1&&(e.overridePolicy=Me(e)),e):e===!0?X():e}function Me(e){let{target:t,writer:n,overridePolicy:r,...i}=e;return function(e,t){let n=Z.call(this,e,t);return n.enabled?{...i,...n}:n}}function X(){return{overridePolicy:Z}}function Z(e,t){let n=!!this.geometryType,r={enabled:n};return n&&(r={...r,...Q.call(this,e,t)}),r}function Q(e,t){return{allowNull:this.originIdOf(t)>=3,ignoreOrigin:this.originIdOf(t)>0}}let $=class extends y(N(R(I(A(z(U(H(V(a(se)))))))))){constructor(e){super(e),this.blendMode=`normal`,this.charts=null,this.definitionExpression=null,this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=m,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{let e=new MessageChannel;return new Ae(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{let n=K.fromJSON(e);return this.queryFeaturesJSON(n,t)}}}),[e.port2]})},this.type=`knowledge-graph-sublayer`,this.useViewTime=!0,this.visible=!0}get capabilities(){return this.parent?this.parent.sublayerCapabilities:b(null)}get isTable(){return this.parentCompositeLayer?.type!==`link-chart`&&this.geometryFieldName==null}get defaultPopupTemplate(){return this.createPopupTemplate()}get editingEnabled(){return this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome(`editingEnabled`,e)}get effectiveCapabilities(){let e=r(this.capabilities),{operations:t,editing:n}=e;return this.userHasUpdateItemPrivileges&&(t.supportsAdd=t.supportsDelete=t.supportsEditing=t.supportsQuery=t.supportsUpdate=n.supportsDeleteByOthers=n.supportsGeometryUpdate=n.supportsUpdateByOthers=!0),this.userHasFullEditingPrivileges&&t.supportsEditing&&(t.supportsAdd=t.supportsDelete=t.supportsUpdate=n.supportsGeometryUpdate=!0),e}get effectiveEditingEnabled(){return this.userHasUpdateItemPrivileges||this.editingEnabled}set featureReduction(e){let t=this._normalizeFeatureReduction(e);this._set(`featureReduction`,t)}get fields(){let e=[],t=new Map;for(let e of this.parent?.knowledgeGraph.dataModel.domains??[])t.set(e.name,e);return this.objectType?.properties?.forEach(n=>{let r=n.fieldType===`esriFieldTypeOID`?`esriFieldTypeInteger`:n.fieldType,i=W.fromJSON({name:n.name,type:r,alias:n.alias,defaultValue:n.defaultValue,editable:n.editable,nullable:n.nullable,domain:n.domain&&t.has(n.domain)?t.get(n.domain).toJSON():void 0});e.push(i)}),e.push(W.fromJSON({name:this.objectIdField,type:`esriFieldTypeString`,alias:this.objectIdField,editable:!1}),W.fromJSON({name:h,type:`esriFieldTypeInteger`,alias:h,editable:!1}),W.fromJSON({name:g,type:`esriFieldTypeInteger`,alias:g,editable:!1})),e}get formTemplate(){return this._isOverridden(`formTemplate`)?this._get(`formTemplate`):x(this)}set formTemplate(e){this._overrideIfSome(`formTemplate`,e)}get geometryType(){if(this.parentCompositeLayer?.type===`link-chart`)return this.graphType===`relationship`?`polyline`:`point`;let e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.geometryType;return!e||e===`esriGeometryNull`?null:d.fromJSON(e)}get geometryFieldName(){return this.parentCompositeLayer?.type===`link-chart`?_:this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name??null}get graphicOrigin(){if(!this.parent)return null;switch(this.parent.type){case`knowledge-graph`:return new f(this.parent,this);case`link-chart`:return new oe(this.parent,this)}}get graphTypeName(){return this.objectType?.name}set graphTypeName(e){this._set(`graphTypeName`,e)}get hasM(){let e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name;return(e?this.objectType?.properties?.[e]:null)?.hasM??!1}get hasZ(){let e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name;return(e?this.objectType?.properties?.[e]:null)?.hasZ??!1}set labelingInfo(e){this._set(`labelingInfo`,e)}get labelingInfo(){if(this._isOverridden(`labelingInfo`))return this._get(`labelingInfo`);if(!this.objectType||!this.parentCompositeLayer||!this.graphTypeName)return null;let e=this.objectType.properties?S(this.objectType.properties):`ESRI__ID`;return this.parentCompositeLayer.type===`link-chart`?C(this.graphType,this.graphTypeName,e):w(this.graphTypeName,this.geometryType,e)}set renderer(e){ye(e,this.fieldsIndex),this._set(`renderer`,e)}get renderer(){if(this._isOverridden(`renderer`))return this._get(`renderer`);let e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map(e=>e.name).indexOf(this.graphTypeName),n=T(t);if(this.parentCompositeLayer?.type===`link-chart`){if(this.graphType===`relationship`)return new we({type:`simple`,symbol:E(n)});let e=G(p(d.toJSON(`point`)).renderer);return q(e.symbol,n),e}let r=G(p(d.toJSON(this.geometryType)).renderer);return q(r.symbol,n),r}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??ae.WGS84}get templates(){return this._isOverridden(`templates`)?this._get(`templates`):D(this)}set templates(e){this._overrideIfSome(`templates`,e)}set timeInfo(e){this._set(`timeInfo`,e)}get dateFieldsTimeZone(){return this.parentCompositeLayer?.dateFieldsTimeZone}get title(){return this._isOverridden(`title`)?this._get(`title`):this.graphTypeName}set title(e){this._set(`title`,e)}writeTitle(e,t){t.title=e??`Layer`}get userHasEditingPrivileges(){return!this.parent||this.parent.userHasEditingPrivileges}get userHasFullEditingPrivileges(){return this.parent?this.parent.userHasFullEditingPrivileges:!1}get userHasUpdateItemPrivileges(){return this.parent?this.parent.userHasUpdateItemPrivileges:!1}createPopupTemplate(e){return Oe(this,e)}createQuery(){return new K({where:`1=1`,outFields:[`*`]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return this.fields.find(t=>t.name===e)?.domain||null}async queryFeatures(e,t){await this.load();let{resolvedQuery:n,queryEngine:r,cypherTranslationApplied:i}=await this._setupQueryObjects(e),a=this.graphicOrigin,o=De.fromJSON(await r.executeQuery(this._createQueryEngineQueryJSON(n,i),t?.signal));return o.features.forEach(e=>{e.sourceLayer=this,e.origin=a}),o}async queryFeaturesJSON(e,t){await this.load();let{resolvedQuery:n,queryEngine:r,cypherTranslationApplied:i}=await this._setupQueryObjects(e);return await r.executeQuery(this._createQueryEngineQueryJSON(n,i),t?.signal)}async queryFeatureCount(e,t){await this.load();let{resolvedQuery:n,queryEngine:r,cypherTranslationApplied:i}=await this._setupQueryObjects(e);return r.executeQueryForCount(this._createQueryEngineQueryJSON(n,i),t?.signal)}async queryExtent(e={},t){await this.load();let n={...e,returnGeometry:!0},{resolvedQuery:r,queryEngine:i,cypherTranslationApplied:a}=await this._setupQueryObjects(n),o=await i.executeQueryForExtent(this._createQueryEngineQueryJSON(r,a),t?.signal),s;return s=o.extent?.xmin!=null&&o.extent?.xmax!=null&&o.extent?.ymin!=null&&o.extent?.ymax!=null?new c(o.extent):new c,{count:o.count,extent:s}}async queryObjectIds(e,t){await this.load();let n=K.from(e),r;if(!this.parentCompositeLayer)i.getLogger(this).warn(`Attempting to query for object IDs with no features failed because the parent composite layer is missing or not yet loaded.`),r=this.loadQueryEngine([]);else if(this.parentCompositeLayer.type===`link-chart`&&this._cachedQueryEngine)r=this._cachedQueryEngine;else{let{features:e,cypherTranslationApplied:i}=await this.parentCompositeLayer.dataManager.getData(n,this,this.parentCompositeLayer,t);return r=this.loadQueryEngine(e),await r.executeQueryForIds(this._createQueryEngineQueryJSON(n,i),t?.signal)}return await r.executeQueryForIds(this._createQueryEngineQueryJSON(n,!1),t?.signal)}async applyEdits(e){if(!this.parentCompositeLayer?.dataManager.knowledgeGraph)throw new n(`knowledge-graph-sublayer:no-knowledge-graph`,`ApplyEdits cannot be executed because the parent does not have a Knowledge Graph model. This is usually caused by the layer not yet being loaded`);let t=await O(e,this,this.parentCompositeLayer);t.options={cascadeDelete:!0,cascadeProvenanceDelete:this.parent?.knowledgeGraph.serviceDefinition.supportsProvenance?!0:void 0};let r=await Ee(this.parentCompositeLayer.dataManager.knowledgeGraph,t),i=k(r,this.graphTypeName),a={addedFeatures:i.addFeatureResults,updatedFeatures:i.updateFeatureResults,deletedFeatures:i.deleteFeatureResults,addedAttachments:i.addAttachmentResults,deletedAttachments:i.deleteAttachmentResults,updatedAttachments:i.updateAttachmentResults,exceededTransferLimit:!1,historicMoment:new Date,edits:void 0};return this.emit(`edits`,a),this.emit(`apply-edits`,{result:Promise.resolve(a)}),this.parentCompositeLayer.type===`link-chart`&&await this.parentCompositeLayer.refreshLinkChartCache([...a.addedFeatures.map(e=>e.globalId),...a.updatedFeatures.map(e=>e.globalId),...a.deletedFeatures.map(e=>e.globalId)]),i}loadQueryEngine(e){let t=new ce({geometryType:d.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),n=new le({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:d.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:`object-id`,fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return n.featureStore.addMany(e),n}async refreshCachedQueryEngine(){if(!this.parentCompositeLayer){i.getLogger(this).warn(`Attempting to refresh the cached query engine with no features failed because the parent composite layer is missing or not yet loaded.`),this._cachedQueryEngine=this.loadQueryEngine([]);return}let{features:e}=await this.parentCompositeLayer.dataManager.getData(new K({where:`1=1`,outFields:[m]}),this,this.parentCompositeLayer);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>be(this.timeInfo,this.fieldsIndex))),Promise.resolve(this)}_createQueryEngineQueryJSON(e,t){let n=e.toJSON();return t&&delete n.resultOffset,n}async _setupQueryObjects(e,t){let n=K.from(e),r=n.geometry;if(r&&!r.spatialReference?.isWGS84&&(await ie(r.spatialReference,u),n.geometry=r instanceof ne||r instanceof re||r instanceof te?l(r,u):l(r.extent,u)),!this.parentCompositeLayer)return i.getLogger(this).warn(`Attempting to execute a query with no features failed because the parent composite layer is missing or not yet loaded.`),{resolvedQuery:n,queryEngine:this.loadQueryEngine([]),cypherTranslationApplied:!1};if(this.parentCompositeLayer.type===`link-chart`&&this._cachedQueryEngine)return{resolvedQuery:n,queryEngine:this._cachedQueryEngine,cypherTranslationApplied:!1};let{features:a,cypherTranslationApplied:o}=await this.parentCompositeLayer.dataManager.getData(n,this,this.parentCompositeLayer,t);return{resolvedQuery:n,queryEngine:this.loadQueryEngine(a),cypherTranslationApplied:o}}};e([o(J(r(j)))],$.prototype,`blendMode`,void 0),e([o({readOnly:!0})],$.prototype,`capabilities`,null),e([o()],$.prototype,`isTable`,null),e([o({json:{origins:{"web-scene":{write:!1}},write:X()}})],$.prototype,`charts`,void 0),e([o({readOnly:!0})],$.prototype,`defaultPopupTemplate`,null),e([o({type:String,json:{origins:{service:{read:!1}},name:`layerDefinition.definitionExpression`,write:{ignoreOrigin:!0}}})],$.prototype,`definitionExpression`,void 0),e([o(J(r(P)))],$.prototype,`displayFilterEnabled`,void 0),e([o(J(r(F)))],$.prototype,`displayFilterInfo`,void 0),e([o()],$.prototype,`editingEnabled`,null),e([o(J(r(M)))],$.prototype,`effect`,void 0),e([o({readOnly:!0})],$.prototype,`effectiveCapabilities`,null),e([o({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),e([o({type:ke})],$.prototype,`elevationInfo`,void 0),e([o(J(r(L)))],$.prototype,`featureEffect`,void 0),e([o(J(r(_e)))],$.prototype,`featureReduction`,null),e([o()],$.prototype,`fields`,null),e([o({type:ee})],$.prototype,`formTemplate`,null),e([o()],$.prototype,`geometryType`,null),e([o()],$.prototype,`geometryFieldName`,null),e([o({readOnly:!0})],$.prototype,`graphicOrigin`,null),e([o({type:[`entity`,`relationship`],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],$.prototype,`graphType`,void 0),e([o({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],$.prototype,`graphTypeName`,null),e([o()],$.prototype,`hasM`,null),e([o()],$.prototype,`hasZ`,null),e([o({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],$.prototype,`id`,void 0),e([o({type:Boolean,value:!0,nonNullable:!0,json:{name:`showLabels`,default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],$.prototype,`labelsVisible`,void 0),e([o({type:[xe],json:{name:`layerDefinition.drawingInfo.labelingInfo`,read:Ne,write:X()}})],$.prototype,`labelingInfo`,null),e([o({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case`link-chart`:t.layerType=`LinkChartSubLayer`;break;case`knowledge-graph`:t.layerType=this.geometryType?`KnowledgeGraphSubLayer`:`KnowledgeGraphSubTable`}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],$.prototype,`layerType`,void 0),e([o(J(r(fe)))],$.prototype,`legendEnabled`,void 0),e([o(J(r(pe)))],$.prototype,`maxScale`,void 0),e([o(J(r(me)))],$.prototype,`minScale`,void 0),e([o()],$.prototype,`objectIdField`,void 0),e([o()],$.prototype,`objectType`,void 0),e([o(J(r(he)))],$.prototype,`opacity`,void 0),e([o(J(r(B)))],$.prototype,`orderBy`,void 0),e([o({clonable:!1})],$.prototype,`parent`,void 0),e([o()],$.prototype,`parentCompositeLayer`,void 0),e([o(J(r(ge)))],$.prototype,`popupEnabled`,void 0),e([o({type:t,json:{name:`popupInfo`,write:{ignoreOrigin:!0}}})],$.prototype,`popupTemplate`,void 0),e([o({type:Number,json:{write:{overridePolicy:Q}}})],$.prototype,`refreshInterval`,void 0),e([o({types:Te,json:{name:`layerDefinition.drawingInfo.renderer`,write:X()}})],$.prototype,`renderer`,null),e([o()],$.prototype,`source`,void 0),e([o()],$.prototype,`spatialReference`,null),e([o({type:ve})],$.prototype,`templates`,null),e([o({type:Ce,json:{name:`layerDefinition.timeInfo`,write:{overridePolicy:Q},origins:{"web-document":{name:`layerDefinition.timeInfo`,read:!0,write:{overridePolicy:Q}},"portal-item":{name:`layerDefinition.timeInfo`,read:!0,write:{overridePolicy:Q}}}}})],$.prototype,`timeInfo`,null),e([o({readOnly:!0})],$.prototype,`dateFieldsTimeZone`,null),e([o({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],$.prototype,`title`,null),e([je(`title`)],$.prototype,`writeTitle`,null),e([o({json:{read:!1}})],$.prototype,`type`,void 0),e([o(J(r(de)))],$.prototype,`useViewTime`,void 0),e([o({readOnly:!0})],$.prototype,`userHasEditingPrivileges`,null),e([o({readOnly:!0})],$.prototype,`userHasFullEditingPrivileges`,null),e([o({readOnly:!0})],$.prototype,`userHasUpdateItemPrivileges`,null),e([o({type:Boolean,json:{name:`visibility`,write:X()}})],$.prototype,`visible`,void 0),$=e([s(`esri.layers.knowledgeGraph.KnowledgeGraphSublayer`)],$);function Ne(e,t,n){let r=[[`ESRI__AGGREGATION_COUNT`,h],[`ESRI__ORIGIN_ID`,ue],[`ESRI__DESTINATION_ID`,v],[`ESRI__LAYOUT_GEOMETRY`,_]];try{for(let t of e)for(let[e,n]of r)t.labelExpression=t.labelExpression?.replaceAll(e,n),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,n))}catch(e){i.getLogger(this).warn(`Error updating labelingInfo`,e)}return Se.call(this,e,t,n)}export{$ as default};
2
+ import{__decorate as e}from"tslib";import t from"../../PopupTemplate.js";import n from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{MultiOriginJSONSupportMixin as a}from"../../core/MultiOriginJSONSupport.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import"../../core/workers/workers.js";import ee from"../../form/FormTemplate.js";import c from"../../geometry/Extent.js";import te from"../../geometry/Point.js";import ne from"../../geometry/Polygon.js";import re from"../../geometry/Polyline.js";import{initializeProjection as ie,project as l}from"../../geometry/projectionUtils.js";import ae from"../../geometry/SpatialReference.js";import{wgs84 as u}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as d}from"../../geometry/support/typeUtils.js";import oe from"../../graphic/KnowledgeGraphGraphicOrigin.js";import se from"../../graphic/LinkChartGraphicOrigin.js";import ce from"../Layer.js";import le from"../graphics/data/FeatureStore.js";import{QueryEngine as ue}from"../graphics/data/QueryEngine.js";import{createDrawingInfo as f}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as p,systemAggregationCountFieldName as m,systemIsSpatialFieldName as h,systemLayoutGeometryFieldName as g,systemOriginIdFieldName as de,systemDestinationIdFieldName as fe}from"./constants.js";import{KnowledgeGraphSublayerBase as _}from"./KnowledgeGraphSublayerBase.js";import{createCapabilitiesFromKnowledgeGraph as v,createDefaultKGSLFormTemplate as y,getDisplayLabelProperty as b,getLinkChartDefaultLabelingInfo as x,getMapDefaultLabelingInfo as S,getKGSublayerSymbolColor as C,getDefaultLCRelationshipSublayerSymbol as w,createDefaultKGSLFeatureTemplates as T,convertLayerEditsToGraphEdits as E,convertGraphEditsResultToFeatureEdits as D}from"./layerUtils.js";import{BlendLayer as O,blendModeProperty as k,effectProperty as A}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as j,displayFilterEnabledProperty as M,displayFilterInfoProperty as N}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as P,featureEffectProperty as F}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as I}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as L,orderByProperty as R}from"../mixins/OrderedLayer.js";import{RefreshableLayer as z}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as B}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as V,useViewTimeProperty as pe}from"../mixins/TemporalLayer.js";import{legendEnabled as me,maxScale as he,minScale as ge,opacity as _e,popupEnabled as ve}from"../support/commonProperties.js";import{featureReductionProperty as ye}from"../support/featureReductionUtils.js";import be from"../support/FeatureTemplate.js";import H from"../support/Field.js";import{fixRendererFields as xe,fixTimeInfoFields as Se}from"../support/fieldUtils.js";import Ce from"../support/LabelClass.js";import{reader as we}from"../support/labelingInfo.js";import Te from"../support/TimeInfo.js";import Ee from"../../renderers/SimpleRenderer.js";import{fromJSON as U}from"../../renderers/support/jsonUtils.js";import{rendererTypes as De}from"../../renderers/support/typeUtils.js";import{executeApplyEdits as Oe}from"../../rest/knowledgeGraphService.js";import ke from"../../rest/support/FeatureSet.js";import W from"../../rest/support/Query.js";import{createPopupTemplate as Ae}from"../../support/popupUtils.js";import je from"../../symbols/support/ElevationInfo.js";import{applyColorToSymbol as G}from"../../symbols/support/utils.js";import Me from"../../core/workers/RemoteClient.js";import{writer as K}from"../../core/accessorSupport/decorators/writer.js";function q(e){if(!e.json)return e;e.json.write=J(e.json.write);let t=e.json.origins;if(!t)return e;let n;for(n in t){let e=t[n];e&&(e.write=J(e.write))}return e}function J(e){return typeof e==`object`&&e?(e.enabled!==!1&&(e.overridePolicy=Ne(e)),e):e===!0?Y():e}function Ne(e){let{target:t,writer:n,overridePolicy:r,...i}=e;return function(e,t){let n=X.call(this,e,t);return n.enabled?{...i,...n}:n}}function Y(){return{overridePolicy:X}}function X(e,t){let n=!!this.geometryType,r={enabled:n};return n&&(r={...r,...Z.call(this,e,t)}),r}function Z(e,t){return{ignoreOrigin:this.originIdOf(t)>0}}function Q(e,t){return{...Z.call(this,e,t),allowNull:this.originIdOf(t)>=3}}let $=class extends _(j(I(P(O(L(V(B(z(a(ce)))))))))){constructor(e){super(e),this.blendMode=`normal`,this.charts=null,this.definitionExpression=null,this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=p,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{let e=new MessageChannel;return new Me(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{let n=W.fromJSON(e);return this.queryFeaturesJSON(n,t)}}}),[e.port2]})},this.type=`knowledge-graph-sublayer`,this.useViewTime=!0,this.visible=!0}get capabilities(){return this.parent?this.parent.sublayerCapabilities:v(null)}get isTable(){return this.parentCompositeLayer?.type!==`link-chart`&&this.geometryFieldName==null}get defaultPopupTemplate(){return this.createPopupTemplate()}get editingEnabled(){return this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome(`editingEnabled`,e)}get effectiveCapabilities(){let e=r(this.capabilities),{operations:t,editing:n}=e;return this.userHasUpdateItemPrivileges&&(t.supportsAdd=t.supportsDelete=t.supportsEditing=t.supportsQuery=t.supportsUpdate=n.supportsDeleteByOthers=n.supportsGeometryUpdate=n.supportsUpdateByOthers=!0),this.userHasFullEditingPrivileges&&t.supportsEditing&&(t.supportsAdd=t.supportsDelete=t.supportsUpdate=n.supportsGeometryUpdate=!0),e}get effectiveEditingEnabled(){return this.userHasUpdateItemPrivileges||this.editingEnabled}set featureReduction(e){let t=this._normalizeFeatureReduction(e);this._set(`featureReduction`,t)}get fields(){let e=[],t=new Map;for(let e of this.parent?.knowledgeGraph.dataModel.domains??[])t.set(e.name,e);return this.objectType?.properties?.forEach(n=>{let r=n.fieldType===`esriFieldTypeOID`?`esriFieldTypeInteger`:n.fieldType,i=H.fromJSON({name:n.name,type:r,alias:n.alias,defaultValue:n.defaultValue,editable:n.editable,nullable:n.nullable,domain:n.domain&&t.has(n.domain)?t.get(n.domain).toJSON():void 0});e.push(i)}),e.push(H.fromJSON({name:this.objectIdField,type:`esriFieldTypeString`,alias:this.objectIdField,editable:!1}),H.fromJSON({name:m,type:`esriFieldTypeInteger`,alias:m,editable:!1}),H.fromJSON({name:h,type:`esriFieldTypeInteger`,alias:h,editable:!1})),e}get formTemplate(){return this._isOverridden(`formTemplate`)?this._get(`formTemplate`):y(this)}set formTemplate(e){this._overrideIfSome(`formTemplate`,e)}get geometryType(){if(this.parentCompositeLayer?.type===`link-chart`)return this.graphType===`relationship`?`polyline`:`point`;let e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.geometryType;return!e||e===`esriGeometryNull`?null:d.fromJSON(e)}get geometryFieldName(){return this.parentCompositeLayer?.type===`link-chart`?g:this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name??null}get graphicOrigin(){if(!this.parent)return null;switch(this.parent.type){case`knowledge-graph`:return new oe(this.parent,this);case`link-chart`:return new se(this.parent,this)}}get graphTypeName(){return this.objectType?.name}set graphTypeName(e){this._set(`graphTypeName`,e)}get hasM(){let e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name;return(e?this.objectType?.properties?.[e]:null)?.hasM??!1}get hasZ(){let e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name;return(e?this.objectType?.properties?.[e]:null)?.hasZ??!1}set labelingInfo(e){this._set(`labelingInfo`,e)}get labelingInfo(){if(this._isOverridden(`labelingInfo`))return this._get(`labelingInfo`);if(!this.objectType||!this.parentCompositeLayer||!this.graphTypeName)return null;let e=this.objectType.properties?b(this.objectType.properties):`ESRI__ID`;return this.parentCompositeLayer.type===`link-chart`?x(this.graphType,this.graphTypeName,e):S(this.graphTypeName,this.geometryType,e)}set renderer(e){xe(e,this.fieldsIndex),this._set(`renderer`,e)}get renderer(){if(this._isOverridden(`renderer`))return this._get(`renderer`);let e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map(e=>e.name).indexOf(this.graphTypeName),n=C(t);if(this.parentCompositeLayer?.type===`link-chart`){if(this.graphType===`relationship`)return new Ee({type:`simple`,symbol:w(n)});let e=U(f(d.toJSON(`point`)).renderer);return G(e.symbol,n),e}let r=U(f(d.toJSON(this.geometryType)).renderer);return G(r.symbol,n),r}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??ae.WGS84}get templates(){return this._isOverridden(`templates`)?this._get(`templates`):T(this)}set templates(e){this._overrideIfSome(`templates`,e)}set timeInfo(e){this._set(`timeInfo`,e)}get dateFieldsTimeZone(){return this.parentCompositeLayer?.dateFieldsTimeZone}get title(){return this._isOverridden(`title`)?this._get(`title`):this.graphTypeName}set title(e){this._set(`title`,e)}writeTitle(e,t){t.title=e??`Layer`}get userHasEditingPrivileges(){return!this.parent||this.parent.userHasEditingPrivileges}get userHasFullEditingPrivileges(){return this.parent?this.parent.userHasFullEditingPrivileges:!1}get userHasUpdateItemPrivileges(){return this.parent?this.parent.userHasUpdateItemPrivileges:!1}createPopupTemplate(e){return Ae(this,e)}createQuery(){return new W({where:`1=1`,outFields:[`*`]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return this.fields.find(t=>t.name===e)?.domain||null}async queryFeatures(e,t){await this.load();let{resolvedQuery:n,queryEngine:r,cypherTranslationApplied:i}=await this._setupQueryObjects(e),a=this.graphicOrigin,o=ke.fromJSON(await r.executeQuery(this._createQueryEngineQueryJSON(n,i),t?.signal));return o.features.forEach(e=>{e.sourceLayer=this,e.origin=a}),o}async queryFeaturesJSON(e,t){await this.load();let{resolvedQuery:n,queryEngine:r,cypherTranslationApplied:i}=await this._setupQueryObjects(e);return await r.executeQuery(this._createQueryEngineQueryJSON(n,i),t?.signal)}async queryFeatureCount(e,t){await this.load();let{resolvedQuery:n,queryEngine:r,cypherTranslationApplied:i}=await this._setupQueryObjects(e);return r.executeQueryForCount(this._createQueryEngineQueryJSON(n,i),t?.signal)}async queryExtent(e={},t){await this.load();let n={...e,returnGeometry:!0},{resolvedQuery:r,queryEngine:i,cypherTranslationApplied:a}=await this._setupQueryObjects(n),o=await i.executeQueryForExtent(this._createQueryEngineQueryJSON(r,a),t?.signal),s;return s=o.extent?.xmin!=null&&o.extent?.xmax!=null&&o.extent?.ymin!=null&&o.extent?.ymax!=null?new c(o.extent):new c,{count:o.count,extent:s}}async queryObjectIds(e,t){await this.load();let n=W.from(e),r;if(!this.parentCompositeLayer)i.getLogger(this).warn(`Attempting to query for object IDs with no features failed because the parent composite layer is missing or not yet loaded.`),r=this.loadQueryEngine([]);else if(this.parentCompositeLayer.type===`link-chart`&&this._cachedQueryEngine)r=this._cachedQueryEngine;else{let{features:e,cypherTranslationApplied:i}=await this.parentCompositeLayer.dataManager.getData(n,this,this.parentCompositeLayer,t);return r=this.loadQueryEngine(e),await r.executeQueryForIds(this._createQueryEngineQueryJSON(n,i),t?.signal)}return await r.executeQueryForIds(this._createQueryEngineQueryJSON(n,!1),t?.signal)}async applyEdits(e){if(!this.parentCompositeLayer?.dataManager.knowledgeGraph)throw new n(`knowledge-graph-sublayer:no-knowledge-graph`,`ApplyEdits cannot be executed because the parent does not have a Knowledge Graph model. This is usually caused by the layer not yet being loaded`);let t=await E(e,this,this.parentCompositeLayer);t.options={cascadeDelete:!0,cascadeProvenanceDelete:this.parent?.knowledgeGraph.serviceDefinition.supportsProvenance?!0:void 0};let r=await Oe(this.parentCompositeLayer.dataManager.knowledgeGraph,t),i=D(r,this.graphTypeName),a={addedFeatures:i.addFeatureResults,updatedFeatures:i.updateFeatureResults,deletedFeatures:i.deleteFeatureResults,addedAttachments:i.addAttachmentResults,deletedAttachments:i.deleteAttachmentResults,updatedAttachments:i.updateAttachmentResults,exceededTransferLimit:!1,historicMoment:new Date,edits:void 0};return this.emit(`edits`,a),this.emit(`apply-edits`,{result:Promise.resolve(a)}),this.parentCompositeLayer.type===`link-chart`&&await this.parentCompositeLayer.refreshLinkChartCache([...a.addedFeatures.map(e=>e.globalId),...a.updatedFeatures.map(e=>e.globalId),...a.deletedFeatures.map(e=>e.globalId)]),i}loadQueryEngine(e){let t=new le({geometryType:d.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),n=new ue({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:d.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:`object-id`,fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return n.featureStore.addMany(e),n}async refreshCachedQueryEngine(){if(!this.parentCompositeLayer){i.getLogger(this).warn(`Attempting to refresh the cached query engine with no features failed because the parent composite layer is missing or not yet loaded.`),this._cachedQueryEngine=this.loadQueryEngine([]);return}let{features:e}=await this.parentCompositeLayer.dataManager.getData(new W({where:`1=1`,outFields:[p]}),this,this.parentCompositeLayer);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>Se(this.timeInfo,this.fieldsIndex))),Promise.resolve(this)}_createQueryEngineQueryJSON(e,t){let n=e.toJSON();return t&&delete n.resultOffset,n}async _setupQueryObjects(e,t){let n=W.from(e),r=n.geometry;if(r&&!r.spatialReference?.isWGS84&&(await ie(r.spatialReference,u),n.geometry=r instanceof ne||r instanceof re||r instanceof te?l(r,u):l(r.extent,u)),!this.parentCompositeLayer)return i.getLogger(this).warn(`Attempting to execute a query with no features failed because the parent composite layer is missing or not yet loaded.`),{resolvedQuery:n,queryEngine:this.loadQueryEngine([]),cypherTranslationApplied:!1};if(this.parentCompositeLayer.type===`link-chart`&&this._cachedQueryEngine)return{resolvedQuery:n,queryEngine:this._cachedQueryEngine,cypherTranslationApplied:!1};let{features:a,cypherTranslationApplied:o}=await this.parentCompositeLayer.dataManager.getData(n,this,this.parentCompositeLayer,t);return{resolvedQuery:n,queryEngine:this.loadQueryEngine(a),cypherTranslationApplied:o}}};e([o(q(r(k)))],$.prototype,`blendMode`,void 0),e([o({readOnly:!0})],$.prototype,`capabilities`,null),e([o()],$.prototype,`isTable`,null),e([o({json:{origins:{"web-scene":{write:!1}},write:Y()}})],$.prototype,`charts`,void 0),e([o({readOnly:!0})],$.prototype,`defaultPopupTemplate`,null),e([o({type:String,json:{origins:{service:{read:!1}},name:`layerDefinition.definitionExpression`,write:{ignoreOrigin:!0}}})],$.prototype,`definitionExpression`,void 0),e([o(q(r(M)))],$.prototype,`displayFilterEnabled`,void 0),e([o(q(r(N)))],$.prototype,`displayFilterInfo`,void 0),e([o()],$.prototype,`editingEnabled`,null),e([o(q(r(A)))],$.prototype,`effect`,void 0),e([o({readOnly:!0})],$.prototype,`effectiveCapabilities`,null),e([o({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),e([o({type:je})],$.prototype,`elevationInfo`,void 0),e([o(q(r(F)))],$.prototype,`featureEffect`,void 0),e([o(q(r(ye)))],$.prototype,`featureReduction`,null),e([o()],$.prototype,`fields`,null),e([o({type:ee})],$.prototype,`formTemplate`,null),e([o()],$.prototype,`geometryType`,null),e([o()],$.prototype,`geometryFieldName`,null),e([o({readOnly:!0})],$.prototype,`graphicOrigin`,null),e([o({type:[`entity`,`relationship`],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],$.prototype,`graphType`,void 0),e([o({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],$.prototype,`graphTypeName`,null),e([o()],$.prototype,`hasM`,null),e([o()],$.prototype,`hasZ`,null),e([o({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],$.prototype,`id`,void 0),e([o({type:Boolean,value:!0,nonNullable:!0,json:{name:`showLabels`,default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],$.prototype,`labelsVisible`,void 0),e([o({type:[Ce],json:{name:`layerDefinition.drawingInfo.labelingInfo`,read:Pe,write:Y()}})],$.prototype,`labelingInfo`,null),e([o({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case`link-chart`:t.layerType=`LinkChartSubLayer`;break;case`knowledge-graph`:t.layerType=this.geometryType?`KnowledgeGraphSubLayer`:`KnowledgeGraphSubTable`}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],$.prototype,`layerType`,void 0),e([o(q(r(me)))],$.prototype,`legendEnabled`,void 0),e([o(q(r(he)))],$.prototype,`maxScale`,void 0),e([o(q(r(ge)))],$.prototype,`minScale`,void 0),e([o()],$.prototype,`objectIdField`,void 0),e([o()],$.prototype,`objectType`,void 0),e([o(q(r(_e)))],$.prototype,`opacity`,void 0),e([o(q(r(R)))],$.prototype,`orderBy`,void 0),e([o({clonable:!1})],$.prototype,`parent`,void 0),e([o()],$.prototype,`parentCompositeLayer`,void 0),e([o(q(r(ve)))],$.prototype,`popupEnabled`,void 0),e([o({type:t,json:{name:`popupInfo`,write:{ignoreOrigin:!0}}})],$.prototype,`popupTemplate`,void 0),e([o({type:Number,json:{write:{overridePolicy:Z}}})],$.prototype,`refreshInterval`,void 0),e([o({types:De,json:{name:`layerDefinition.drawingInfo.renderer`,write:Y()}})],$.prototype,`renderer`,null),e([o()],$.prototype,`source`,void 0),e([o()],$.prototype,`spatialReference`,null),e([o({type:be})],$.prototype,`templates`,null),e([o({type:Te,json:{name:`layerDefinition.timeInfo`,write:{overridePolicy:Q},origins:{"web-document":{name:`layerDefinition.timeInfo`,read:!0,write:{overridePolicy:Q}},"portal-item":{name:`layerDefinition.timeInfo`,read:!0,write:{overridePolicy:Q}}}}})],$.prototype,`timeInfo`,null),e([o({readOnly:!0})],$.prototype,`dateFieldsTimeZone`,null),e([o({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],$.prototype,`title`,null),e([K(`title`)],$.prototype,`writeTitle`,null),e([o({json:{read:!1}})],$.prototype,`type`,void 0),e([o(q(r(pe)))],$.prototype,`useViewTime`,void 0),e([o({readOnly:!0})],$.prototype,`userHasEditingPrivileges`,null),e([o({readOnly:!0})],$.prototype,`userHasFullEditingPrivileges`,null),e([o({readOnly:!0})],$.prototype,`userHasUpdateItemPrivileges`,null),e([o({type:Boolean,json:{name:`visibility`,write:Y()}})],$.prototype,`visible`,void 0),$=e([s(`esri.layers.knowledgeGraph.KnowledgeGraphSublayer`)],$);function Pe(e,t,n){let r=[[`ESRI__AGGREGATION_COUNT`,m],[`ESRI__ORIGIN_ID`,de],[`ESRI__DESTINATION_ID`,fe],[`ESRI__LAYOUT_GEOMETRY`,g]];try{for(let t of e)for(let[e,n]of r)t.labelExpression=t.labelExpression?.replaceAll(e,n),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,n))}catch(e){i.getLogger(this).warn(`Error updating labelingInfo`,e)}return we.call(this,e,t,n)}export{$ as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{deg2rad as e}from"../../../core/mathUtils.js";import{throwIfAborted as t}from"../../../core/promiseUtils.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{zeros as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transpose as i}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{sub as a,add as o,length as s,dot as c}from"../../../core/libs/gl-matrix-2/math/vec3.js";import l from"../../../geometry/Circle.js";import u from"../../../geometry/Mesh.js";import d from"../../../geometry/Multipoint.js";import f from"../../../geometry/Polygon.js";import{projectAsync as p}from"../../../geometry/projectionUtils.js";import m from"../../../geometry/SpatialReference.js";import{polygonCentroidPoint as h}from"../../../geometry/support/centroid.js";import{earth as g}from"../../../geometry/support/Ellipsoid.js";import _ from"../../../geometry/support/MeshComponent.js";import{createSphere as v}from"../../../geometry/support/meshUtils.js";import y from"../../../geometry/support/MeshVertexAttributes.js";import{create as b,fromArray as x,intersectRay as S}from"../../../geometry/support/plane.js";import{isWebMercator as C}from"../../../geometry/support/spatialReferenceUtils.js";import{getMetersPerUnitOfSR as w}from"./utils.js";import{convertToSRUnits as T,getWebMercatorScalingFactor as E,createRotationMatrixFromHPR as D,transformMat3 as O,scaleAndAddWithFactor as k,scaleWithFactor as A,computeHFOVAndVFOV as j,projectiveTransform as M}from"../transformations/utils.js";const N=Math.PI/180;function P(e,t,n){let r=T(e,t.spatialReference);return r.cameraHeight=(t.z??r.cameraHeight)-n,e.isSpherical?te(r,t):F(r,t)}function F(e,t){let{horizontalFieldOfView:n,verticalFieldOfView:r,cameraHeading:i}=e,a=E(t.y,t.spatialReference),o=e.cameraPitch,s=e.cameraRoll??0,c=150;n>150&&(o=90,s=0,c=5);let l=Math.ceil(n/c),u=I(l,i,n),d=V(e)*a,p=new f({spatialReference:t?.spatialReference});p.imageID=e.objectId;let m=null;for(let i of u)m=ee(i,o,e.cameraHeight,t,d,a,r,n,l,p,s,e.nearDistance);return m.imageID=e.objectId,{polygon:p,frustum:m}}function I(e,t,n){let r=[];if(e%2==0)for(let i=0;i<e/2;i++)r.push(t-n/e*(i+.5),t+n/e*(i+.5));else{r.push(t);for(let i=1;i<e/2;i++)r.push(t-n/e*i,t+n/e*i)}return r.sort(),r}function ee(e,t,s,c,l,u,d,f,p,m,h=0,g=0){let _=i(n(),D([e,t,h??0])),v=re({cameraHeight:s,cameraPitch:t,farDistance:l,location:c,horizontalFieldOfView:f,nearDistance:g,verticalFieldOfView:d},_),y=O([0,0,-1],_),{x:b,y:x}=c,S=k([b,x,c.z??s],y,l,u),C=2*Math.tan(d*N/2)*l,w=2*Math.tan(f/p*N/2)*l,T=O([0,1,0],_),E=O([1,0,0],_),j=A(T,C/2,u),M=A(E,w/2,u),P=a(r(),j,M),F=o(r(),j,M),I=L([o(r(),S,P),o(r(),S,F),a(r(),S,P),a(r(),S,F)],s,c,u);return I.push(I[0]),m.addRing(I),v}function L(e,t,n,r){return e.map(e=>ie(e,t,n,r))}function te(e,t){let{farDistance:n,objectId:r,nearDistance:i,cameraHeight:a}=e,o=E(t.y,t.spatialReference),s=new l({center:t.clone(),radius:n*o});if(s.imageID=r,i){let e=new l({center:t.clone(),radius:i*o});s.addRing(e.rings[0])}let c=t.clone();c.z=(t.z??a)-n*o;let u=v(c,{size:2*n*o});return u.imageID=r,{polygon:s,frustum:u}}function ne(e,t){return e.contains(t)}function R({cameraHeading:e,cameraPitch:t,cameraRoll:r,farDistance:a,horizontalFieldOfView:o,nearDistance:s,vectorToPoint:l,verticalFieldOfView:u}){let d=i(n(),D([e,t,r])),f=O([1,0,0],d),p=O([0,1,0],d),m=O([0,0,-1],d),h=c(l,f),g=c(l,p),_=c(l,m);if(_<=0||_<s||_>a)return!1;let v=_*Math.tan(o*N/2),y=_*Math.tan(u*N/2);return Math.abs(h)<=v&&Math.abs(g)<=y}function z(e,t){let n=T(e,e.location.spatialReference);if(t.z==null)return!1;let{horizontalFieldOfView:r,location:i,nearDistance:a,verticalFieldOfView:o}=n,c=V(n);if(r==null||o==null||!Number.isFinite(a)||a<0||!Number.isFinite(c)||c<=0)return!1;let l=E(i.y,i.spatialReference),u=i.z??0,d=[(t.x-i.x)/l,(t.y-i.y)/l,t.z-u];if(n.isSpherical){let e=s(d);return a<=e&&e<=c}let f={vectorToPoint:d,verticalFieldOfView:o,nearDistance:a,farDistance:c};if(r>150){let e=Math.ceil(r/5),t=r/e;return I(e,n.cameraHeading,r).some(e=>R({...f,cameraHeading:e,cameraPitch:90,cameraRoll:0,horizontalFieldOfView:t}))}return R({...f,cameraHeading:n.cameraHeading,cameraPitch:n.cameraPitch,cameraRoll:n.cameraRoll??0,horizontalFieldOfView:r})}function B(e,t){return Math.sign(e)!==Math.sign(t)}function re(e,t,n){let{cameraHeight:i,cameraPitch:s,farDistance:c,location:l,horizontalFieldOfView:d,nearDistance:f,verticalFieldOfView:p}=e,m=l.z??i,h=m-i,g=H(l),_=!(s+p/2>=90),v=2*Math.tan(p*N/2)*f,b=2*Math.tan(d*N/2)*f,x=2*Math.tan(p*N/2)*c,S=2*Math.tan(d*N/2)*c,C,w=[0,0,-1];w=O(w,t),C=k([l.x,l.y,m],w,c,g),_&&(C[2]=h);let T=k([l.x,l.y,m],w,f,g),E=[0,1,0];E=O(E,t);let D=[1,0,0];D=O(D,t);let j=[],M=[];f?(M=[{faces:[4,0,3,4,7,3]},{faces:[5,1,2,5,6,2]},{faces:[4,0,1,4,5,1]},{faces:[6,2,3,6,7,3]}],j=j.concat(o(r(),T,a(r(),A(E,v/2,g),A(D,b/2,g)))),j=j.concat(o(r(),T,o(r(),A(E,v/2,g),A(D,b/2,g)))),j=j.concat(a(r(),T,a(r(),A(E,v/2,g),A(D,b/2,g)))),j=j.concat(a(r(),T,o(r(),A(E,v/2,g),A(D,b/2,g))))):(j=[l.x,l.y,m],M=[{faces:[0,1,2,0,2,3,0,3,4,0,4,1]}]),j=j.concat(o(r(),C,a(r(),A(E,x/2,g),A(D,S/2,g)))),j=j.concat(o(r(),C,o(r(),A(E,x/2,g),A(D,S/2,g)))),j=j.concat(a(r(),C,a(r(),A(E,x/2,g),A(D,S/2,g)))),j=j.concat(a(r(),C,o(r(),A(E,x/2,g),A(D,S/2,g))));let P=new y({position:Float64Array.from(j)});return new u({vertexAttributes:P,components:M,spatialReference:l.spatialReference})}function ie(e,t,n,i){{let o=n.z??t,s=o-t,c=Math.sqrt((e[2]-o)**2+(Math.sqrt((e[0]-n.x)**2+(e[1]-n.y)**2)/i)**2)*i,l=A(a(r(),[e[0],e[1],e[2]],[n.x,n.y,o]),1/c,1/i),u=t/(o-e[2]),d={x:(1-u)*n.x+u*e[0],y:(1-u)*n.y+u*e[1],z:(1-u)*o+u*e[2]},f=Math.sqrt((d.z-o)**2+(Math.sqrt((d.x-n.x)**2+(d.y-n.y)**2)/i)**2)*i,p=A(a(r(),[d.x,d.y,d.z],[n.x,n.y,o]),1/f,1/i);return B(l[0],p[0])&&B(l[1],p[1])&&B(l[2],p[2])||e[2]>=s?[e[0],e[1],s]:[d.x,d.y,d.z]}}function ae(e){let{spatialReference:t,x:n,y:r}=e.geometry,{cameraHeading:i,cameraPitch:a,farDistance:o,nearDistance:s}=e,c=H(e.geometry),l=new f({spatialReference:t}),u=Math.abs(1.44*o*c),d=Math.abs(1.44*s*c);(a<20||i==null)&&(d=u);let p=[];return p[0]={x:n+u*Math.sin((i-45)*N),y:r+u*Math.cos((i-45)*N)},p[1]={x:n+u*Math.sin((i+45)*N),y:r+u*Math.cos((i+45)*N)},p[2]={x:n+d*Math.sin((i+135)*N),y:r+d*Math.cos((i+135)*N)},p[3]={x:n+d*Math.sin((i+225)*N),y:r+d*Math.cos((i+225)*N)},l.addRing([[p[0].x,p[0].y,0],[p[1].x,p[1].y,0],[p[2].x,p[2].y,0],[p[3].x,p[3].y,0],[p[0].x,p[0].y,0]]),l}function V(t){let{cameraHeight:n,cameraPitch:r,farDistance:i,location:a,verticalFieldOfView:o}=t;return i??(r+o/2>=90?20/w(a.spatialReference):n/Math.cos(e(r)))}function H(e){return e&&C(e?.spatialReference)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*e.y/g.radius))):1}function U(e,t){let n=1+t/100;if(e.declaredClass===`esri.geometry.Circle`){let{radius:t,center:r}=e,i=t*n,a=new l({radius:i,center:r});return e.rings.length>1&&a.addRing(e.rings[1]),a}if(e.declaredClass===`esri.geometry.Polygon`){let t=new f({spatialReference:e.spatialReference}),i=h(e);if(i){let o=[];for(let t=0;t<e.rings[0].length;t++){let s=Math.sqrt((i.x-e.rings[0][t][0])**2+(i.y-e.rings[0][t][1])**2),c=A(a(r(),[e.rings[0][t][0],e.rings[0][t][1],0],[i.x,i.y,0]),1/s,1),l=k([i.x,i.y,0],c,s*n,1);o.push({x:l[0],y:l[1]})}t.addRing([[o[0].x,o[0].y,0],[o[1].x,o[1].y,0],[o[2].x,o[2].y,0],[o[3].x,o[3].y,0],[o[0].x,o[0].y,0]])}return t}return e}async function W(e,t,n){let{cameraHeight:r,cameraLocation:i,cameraPitch:a,frustumVertices:o,horizontalFieldOfView:s,imageHeight:c,imageWidth:l,inSRS:u,outSRS:d,verticalFieldOfView:f,cameraRoll:p,options:h}=n,g=new m(u),_=new m(d),v=j(s,f,p??0),y=o.length>15;return a+v.vfov/2>=90?await se(o,e,l,c,g,_,y,h):await G(o,e,t,i,r,y,g,_,h)}async function G(e,t,n,r,i,a,o,s,c){let l=K(e,t,n,r,i);if(!l)return;let{farPlane:d,nearPlane:f}=l,p=await J([...f?.vertexPositions??e.slice(0,3),...d.vertexPositions],o,s,c),m=$(p);return new u({vertexAttributes:new y({position:p}),components:Q(a?X(m,!0):Z(m,!0)),spatialReference:s})}function K(e,t,n,r,i){let a=Y(e),o=Y(e,`near`);if(!a)return;let s=t.length;for(let e=0;e<s;e++){let t=Array.from(n[e]),s=[t[0]-r[0],t[1]-r[1],t[2]-(r[2]??i)];oe(r,s,e,o),q(r,s,e,a)}return{farPlane:a,nearPlane:o}}function q(e,t,n,i){let{coefficients:a,vertexPositions:o}=i,s=r();S(a,{origin:e,direction:t},s)&&o.splice(n*3,3,...s)}function oe(e,t,n,i){if(!i)return;let a=r();S(i.coefficients,{origin:e,direction:t},a)&&i.vertexPositions.splice(n*3,3,...a)}async function se(e,t,n,r,i,a,o,s){let c=o?[]:[e[0],e[1],e[2]],l,d=[];for(let i of t)o?(l=M([i[0],i[1],1],[[0,0,1],[n,0,1],[n,r,1],[0,r,1]],[[e[0],e[1],e[2]],[e[3],e[4],e[5]],[e[6],e[7],e[8]],[e[9],e[10],e[11]]]),c=c.concat(...l),l=M([i[0],i[1],1],[[0,0,1],[n,0,1],[n,r,1],[0,r,1]],[[e[12],e[13],e[14]],[e[15],e[16],e[17]],[e[18],e[19],e[20]],[e[21],e[22],e[23]]]),d=d.concat(...l)):(l=M([i[0],i[1],1],[[0,0,1],[n,0,1],[n,r,1],[0,r,1]],[[e[3],e[4],e[5]],[e[6],e[7],e[8]],[e[9],e[10],e[11]],[e[12],e[13],e[14]]]),c=c.concat(...l));c=c.concat(d);let f=await J(c,i,a,s),p=$(f);return new u({vertexAttributes:new y({position:f}),components:Q(o?X(p,!0):Z(p,!0)),spatialReference:a})}async function J(e,n,r,i){if(n.equals(r))return e;let a=e.reduce((e,t,n)=>{let r=Math.floor(n/3);return e[r]||(e[r]=[]),e[r].push(t),e},[]),{points:o}=await p(new d({points:a,spatialReference:n}),r,i);return t(i),o.flat()}function Y(e,t=`far`){let n=b(),r;switch(t){case`far`:if(r=Array.from(e.length===15?e.slice(3):e.slice(12)),x(n,r,!1))return{coefficients:n,vertexPositions:r};break;case`near`:return r=Array.from(e.slice(0,12)),e.length===15||!x(n,r,!1)?void 0:{coefficients:n,vertexPositions:r}}}const X=(e,t=!1)=>{if(t&&e-2<=4||e<=4||e%2!=0)throw Error(`Invalid number of vertices`);let n=[],r=e/2,i=Math.round((t?e-2:e)/2);for(let a=0;a<i;a++){let i=a+r,o=t?i+1:i,s=o%e,c=(t?i:o+1)%e;n.push({faces:new Uint32Array([a,c,s,a,a+1,s])})}return n};function Z(e,t=!1){if(e<3||t&&e-1<3)throw Error(`Invalid number of vertices`);let n=[],r=t?e-2:e-1;for(let e=0;e<r;e++)n.push({faces:new Uint32Array([0,e+1,e+2])});return n}const Q=e=>e.map(e=>new _(e)),$=e=>e.length/3;export{z as checkIfFrustumContainsSelectedPoint,ne as checkIfPolygonContainsSelectedPoint,ae as computePolygonForInspection,P as createCoveragePolygon,L as limitZToGround,J as projectVertices,U as resizePolygon,W as updateFrustum};
2
+ import{deg2rad as e}from"../../../core/mathUtils.js";import{throwIfAborted as t}from"../../../core/promiseUtils.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{zeros as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transpose as i}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{sub as a,add as o,length as s,dot as c}from"../../../core/libs/gl-matrix-2/math/vec3.js";import l from"../../../geometry/Circle.js";import u from"../../../geometry/Mesh.js";import d from"../../../geometry/Multipoint.js";import f from"../../../geometry/Polygon.js";import{projectAsync as p}from"../../../geometry/projectionUtils.js";import m from"../../../geometry/SpatialReference.js";import{polygonCentroidPoint as h}from"../../../geometry/support/centroid.js";import{earth as g}from"../../../geometry/support/Ellipsoid.js";import _ from"../../../geometry/support/MeshComponent.js";import{createSphere as v}from"../../../geometry/support/meshUtils.js";import y from"../../../geometry/support/MeshVertexAttributes.js";import{create as b,fromArray as x,intersectRay as S}from"../../../geometry/support/plane.js";import{isWebMercator as C}from"../../../geometry/support/spatialReferenceUtils.js";import{getMetersPerUnitOfSR as w}from"./utils.js";import{convertToSRUnits as T,getWebMercatorScalingFactor as E,transformMat3 as D,scaleAndAddWithFactor as O,scaleWithFactor as k,computeHFOVAndVFOV as A,projectiveTransform as j}from"../transformations/utils.js";import{createRotationMatrixFromHPR as M}from"../transformations/rotationUtils.js";const N=Math.PI/180;function P(e,t,n){let r=T(e,t.spatialReference);return r.cameraHeight=(t.z??r.cameraHeight)-n,e.isSpherical?z(r,t):F(r,t)}function F(e,t){let{horizontalFieldOfView:n,verticalFieldOfView:r,cameraHeading:i}=e,a=E(t.y,t.spatialReference),o=e.cameraPitch,s=e.cameraRoll??0,c=150;n>150&&(o=90,s=0,c=5);let l=Math.ceil(n/c),u=I(l,i,n),d=K(e)*a,p=new f({spatialReference:t?.spatialReference});p.imageID=e.objectId;let m=null;for(let i of u)m=L(i,o,e.cameraHeight,t,d,a,r,n,l,p,s,e.nearDistance);return m.imageID=e.objectId,{polygon:p,frustum:m}}function I(e,t,n){let r=[];if(e%2==0)for(let i=0;i<e/2;i++)r.push(t-n/e*(i+.5),t+n/e*(i+.5));else{r.push(t);for(let i=1;i<e/2;i++)r.push(t-n/e*i,t+n/e*i)}return r.sort(),r}function L(e,t,s,c,l,u,d,f,p,m,h=0,g=0){let _=i(n(),M([e,t,h??0])),v=W({cameraHeight:s,cameraPitch:t,farDistance:l,location:c,horizontalFieldOfView:f,nearDistance:g,verticalFieldOfView:d},_),y=D([0,0,-1],_),{x:b,y:x}=c,S=O([b,x,c.z??s],y,l,u),C=2*Math.tan(d*N/2)*l,w=2*Math.tan(f/p*N/2)*l,T=D([0,1,0],_),E=D([1,0,0],_),A=k(T,C/2,u),j=k(E,w/2,u),P=a(r(),A,j),F=o(r(),A,j),I=R([o(r(),S,P),o(r(),S,F),a(r(),S,P),a(r(),S,F)],s,c,u);return I.push(I[0]),m.addRing(I),v}function R(e,t,n,r){return e.map(e=>G(e,t,n,r))}function z(e,t){let{farDistance:n,objectId:r,nearDistance:i,cameraHeight:a}=e,o=E(t.y,t.spatialReference),s=new l({center:t.clone(),radius:n*o});if(s.imageID=r,i){let e=new l({center:t.clone(),radius:i*o});s.addRing(e.rings[0])}let c=t.clone();c.z=(t.z??a)-n*o;let u=v(c,{size:2*n*o});return u.imageID=r,{polygon:s,frustum:u}}function B(e,t){return e.contains(t)}function V({cameraHeading:e,cameraPitch:t,cameraRoll:r,farDistance:a,horizontalFieldOfView:o,nearDistance:s,vectorToPoint:l,verticalFieldOfView:u}){let d=i(n(),M([e,t,r])),f=D([1,0,0],d),p=D([0,1,0],d),m=D([0,0,-1],d),h=c(l,f),g=c(l,p),_=c(l,m);if(_<=0||_<s||_>a)return!1;let v=_*Math.tan(o*N/2),y=_*Math.tan(u*N/2);return Math.abs(h)<=v&&Math.abs(g)<=y}function H(e,t){let n=T(e,e.location.spatialReference);if(t.z==null)return!1;let{horizontalFieldOfView:r,location:i,nearDistance:a,verticalFieldOfView:o}=n,c=K(n);if(r==null||o==null||!Number.isFinite(a)||a<0||!Number.isFinite(c)||c<=0)return!1;let l=E(i.y,i.spatialReference),u=i.z??0,d=[(t.x-i.x)/l,(t.y-i.y)/l,t.z-u];if(n.isSpherical){let e=s(d);return a<=e&&e<=c}let f={vectorToPoint:d,verticalFieldOfView:o,nearDistance:a,farDistance:c};if(r>150){let e=Math.ceil(r/5),t=r/e;return I(e,n.cameraHeading,r).some(e=>V({...f,cameraHeading:e,cameraPitch:90,cameraRoll:0,horizontalFieldOfView:t}))}return V({...f,cameraHeading:n.cameraHeading,cameraPitch:n.cameraPitch,cameraRoll:n.cameraRoll??0,horizontalFieldOfView:r})}function U(e,t){return Math.sign(e)!==Math.sign(t)}function W(e,t,n){let{cameraHeight:i,cameraPitch:s,farDistance:c,location:l,horizontalFieldOfView:d,nearDistance:f,verticalFieldOfView:p}=e,m=l.z??i,h=m-i,g=q(l),_=!(s+p/2>=90),v=2*Math.tan(p*N/2)*f,b=2*Math.tan(d*N/2)*f,x=2*Math.tan(p*N/2)*c,S=2*Math.tan(d*N/2)*c,C,w=[0,0,-1];w=D(w,t),C=O([l.x,l.y,m],w,c,g),_&&(C[2]=h);let T=O([l.x,l.y,m],w,f,g),E=[0,1,0];E=D(E,t);let A=[1,0,0];A=D(A,t);let j=[],M=[];f?(M=[{faces:[4,0,3,4,7,3]},{faces:[5,1,2,5,6,2]},{faces:[4,0,1,4,5,1]},{faces:[6,2,3,6,7,3]}],j=j.concat(o(r(),T,a(r(),k(E,v/2,g),k(A,b/2,g)))),j=j.concat(o(r(),T,o(r(),k(E,v/2,g),k(A,b/2,g)))),j=j.concat(a(r(),T,a(r(),k(E,v/2,g),k(A,b/2,g)))),j=j.concat(a(r(),T,o(r(),k(E,v/2,g),k(A,b/2,g))))):(j=[l.x,l.y,m],M=[{faces:[0,1,2,0,2,3,0,3,4,0,4,1]}]),j=j.concat(o(r(),C,a(r(),k(E,x/2,g),k(A,S/2,g)))),j=j.concat(o(r(),C,o(r(),k(E,x/2,g),k(A,S/2,g)))),j=j.concat(a(r(),C,a(r(),k(E,x/2,g),k(A,S/2,g)))),j=j.concat(a(r(),C,o(r(),k(E,x/2,g),k(A,S/2,g))));let P=new y({position:Float64Array.from(j)});return new u({vertexAttributes:P,components:M,spatialReference:l.spatialReference})}function G(e,t,n,i){{let o=n.z??t,s=o-t,c=Math.sqrt((e[2]-o)**2+(Math.sqrt((e[0]-n.x)**2+(e[1]-n.y)**2)/i)**2)*i,l=k(a(r(),[e[0],e[1],e[2]],[n.x,n.y,o]),1/c,1/i),u=t/(o-e[2]),d={x:(1-u)*n.x+u*e[0],y:(1-u)*n.y+u*e[1],z:(1-u)*o+u*e[2]},f=Math.sqrt((d.z-o)**2+(Math.sqrt((d.x-n.x)**2+(d.y-n.y)**2)/i)**2)*i,p=k(a(r(),[d.x,d.y,d.z],[n.x,n.y,o]),1/f,1/i);return U(l[0],p[0])&&U(l[1],p[1])&&U(l[2],p[2])||e[2]>=s?[e[0],e[1],s]:[d.x,d.y,d.z]}}function ee(e){let{spatialReference:t,x:n,y:r}=e.geometry,{cameraHeading:i,cameraPitch:a,farDistance:o,nearDistance:s}=e,c=q(e.geometry),l=new f({spatialReference:t}),u=Math.abs(1.44*o*c),d=Math.abs(1.44*s*c);(a<20||i==null)&&(d=u);let p=[];return p[0]={x:n+u*Math.sin((i-45)*N),y:r+u*Math.cos((i-45)*N)},p[1]={x:n+u*Math.sin((i+45)*N),y:r+u*Math.cos((i+45)*N)},p[2]={x:n+d*Math.sin((i+135)*N),y:r+d*Math.cos((i+135)*N)},p[3]={x:n+d*Math.sin((i+225)*N),y:r+d*Math.cos((i+225)*N)},l.addRing([[p[0].x,p[0].y,0],[p[1].x,p[1].y,0],[p[2].x,p[2].y,0],[p[3].x,p[3].y,0],[p[0].x,p[0].y,0]]),l}function K(t){let{cameraHeight:n,cameraPitch:r,farDistance:i,location:a,verticalFieldOfView:o}=t;return i??(r+o/2>=90?20/w(a.spatialReference):n/Math.cos(e(r)))}function q(e){return e&&C(e?.spatialReference)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*e.y/g.radius))):1}function te(e,t){let n=1+t/100;if(e.declaredClass===`esri.geometry.Circle`){let{radius:t,center:r}=e,i=t*n,a=new l({radius:i,center:r});return e.rings.length>1&&a.addRing(e.rings[1]),a}if(e.declaredClass===`esri.geometry.Polygon`){let t=new f({spatialReference:e.spatialReference}),i=h(e);if(i){let o=[];for(let t=0;t<e.rings[0].length;t++){let s=Math.sqrt((i.x-e.rings[0][t][0])**2+(i.y-e.rings[0][t][1])**2),c=k(a(r(),[e.rings[0][t][0],e.rings[0][t][1],0],[i.x,i.y,0]),1/s,1),l=O([i.x,i.y,0],c,s*n,1);o.push({x:l[0],y:l[1]})}t.addRing([[o[0].x,o[0].y,0],[o[1].x,o[1].y,0],[o[2].x,o[2].y,0],[o[3].x,o[3].y,0],[o[0].x,o[0].y,0]])}return t}return e}async function ne(e,t,n){let{cameraHeight:r,cameraLocation:i,cameraPitch:a,frustumVertices:o,horizontalFieldOfView:s,imageHeight:c,imageWidth:l,inSRS:u,outSRS:d,verticalFieldOfView:f,cameraRoll:p,options:h}=n,g=new m(u),_=new m(d),v=A(s,f,p??0),y=o.length>15;return a+v.vfov/2>=90?await se(o,e,l,c,g,_,y,h):await re(o,e,t,i,r,y,g,_,h)}async function re(e,t,n,r,i,a,o,s,c){let l=ie(e,t,n,r,i);if(!l)return;let{farPlane:d,nearPlane:f}=l,p=await J([...f?.vertexPositions??e.slice(0,3),...d.vertexPositions],o,s,c),m=$(p);return new u({vertexAttributes:new y({position:p}),components:Q(a?X(m,!0):Z(m,!0)),spatialReference:s})}function ie(e,t,n,r,i){let a=Y(e),o=Y(e,`near`);if(!a)return;let s=t.length;for(let e=0;e<s;e++){let t=Array.from(n[e]),s=[t[0]-r[0],t[1]-r[1],t[2]-(r[2]??i)];oe(r,s,e,o),ae(r,s,e,a)}return{farPlane:a,nearPlane:o}}function ae(e,t,n,i){let{coefficients:a,vertexPositions:o}=i,s=r();S(a,{origin:e,direction:t},s)&&o.splice(n*3,3,...s)}function oe(e,t,n,i){if(!i)return;let a=r();S(i.coefficients,{origin:e,direction:t},a)&&i.vertexPositions.splice(n*3,3,...a)}async function se(e,t,n,r,i,a,o,s){let c=o?[]:[e[0],e[1],e[2]],l,d=[];for(let i of t)o?(l=j([i[0],i[1],1],[[0,0,1],[n,0,1],[n,r,1],[0,r,1]],[[e[0],e[1],e[2]],[e[3],e[4],e[5]],[e[6],e[7],e[8]],[e[9],e[10],e[11]]]),c=c.concat(...l),l=j([i[0],i[1],1],[[0,0,1],[n,0,1],[n,r,1],[0,r,1]],[[e[12],e[13],e[14]],[e[15],e[16],e[17]],[e[18],e[19],e[20]],[e[21],e[22],e[23]]]),d=d.concat(...l)):(l=j([i[0],i[1],1],[[0,0,1],[n,0,1],[n,r,1],[0,r,1]],[[e[3],e[4],e[5]],[e[6],e[7],e[8]],[e[9],e[10],e[11]],[e[12],e[13],e[14]]]),c=c.concat(...l));c=c.concat(d);let f=await J(c,i,a,s),p=$(f);return new u({vertexAttributes:new y({position:f}),components:Q(o?X(p,!0):Z(p,!0)),spatialReference:a})}async function J(e,n,r,i){if(n.equals(r))return e;let a=e.reduce((e,t,n)=>{let r=Math.floor(n/3);return e[r]||(e[r]=[]),e[r].push(t),e},[]),{points:o}=await p(new d({points:a,spatialReference:n}),r,i);return t(i),o.flat()}function Y(e,t=`far`){let n=b(),r;switch(t){case`far`:if(r=Array.from(e.length===15?e.slice(3):e.slice(12)),x(n,r,!1))return{coefficients:n,vertexPositions:r};break;case`near`:return r=Array.from(e.slice(0,12)),e.length===15||!x(n,r,!1)?void 0:{coefficients:n,vertexPositions:r}}}const X=(e,t=!1)=>{if(t&&e-2<=4||e<=4||e%2!=0)throw Error(`Invalid number of vertices`);let n=[],r=e/2,i=Math.round((t?e-2:e)/2);for(let a=0;a<i;a++){let i=a+r,o=t?i+1:i,s=o%e,c=(t?i:o+1)%e;n.push({faces:new Uint32Array([a,c,s,a,a+1,s])})}return n};function Z(e,t=!1){if(e<3||t&&e-1<3)throw Error(`Invalid number of vertices`);let n=[],r=t?e-2:e-1;for(let e=0;e<r;e++)n.push({faces:new Uint32Array([0,e+1,e+2])});return n}const Q=e=>e.map(e=>new _(e)),$=e=>e.length/3;export{H as checkIfFrustumContainsSelectedPoint,B as checkIfPolygonContainsSelectedPoint,ee as computePolygonForInspection,P as createCoveragePolygon,R as limitZToGround,J as projectVertices,te as resizePolygon,ne as updateFrustum};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import e from"../../../core/Error.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{multiply as r}from"../../../core/libs/gl-matrix-2/math/mat3.js";const i={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]],YPR:[[0,-1],[1,-1],[2,-1]]};function a(r,i,a,o=!0){if(!Number.isFinite(r))throw new e(`InvalidRotationAngle`,`Please specify a valid angle for rotation`);let s=a*(o?t(r):r),c=Math.cos(s),l=Math.sin(s),u=n();switch(i){case 0:u[4]=c,u[5]=-l,u[7]=l,u[8]=c;break;case 1:u[0]=c,u[2]=l,u[6]=-l,u[8]=c;break;case 2:u[0]=c,u[1]=-l,u[3]=l,u[4]=c;break;default:throw new e(`InvalidRotationAxis`,`Please specify either 0, 1 or 2 for X, Y or Z axis respectively`)}return u}function o(t,i,o=!0){if(t?.length!==3||i?.length!==3)throw new e(`InvalidRotationAngles`,`Please specify three angles with config for rotation`);let s=n();for(let e=0;e<3;e++){let[n,c]=i[e],l=a(t[e],n,c,o);r(s,l,s)}return s}function s(e,t=!0){return o(e,i.HPR,t)}export{o as createRotationMatrix,s as createRotationMatrixFromHPR,i as defaultAxisRotationInfo};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../core/Error.js";import{deg2rad as t,rad2deg as n}from"../../../core/mathUtils.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as i,fromValues as a}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{zeros as o,create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as c}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{multiply as l,transpose as u}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as d,mul as f}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{scale as p,sub as m,add as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{isSerializable as g}from"../../../core/support/jsonUtils.js";import _ from"../../../geometry/Point.js";import{projectAsync as v}from"../../../geometry/projectionUtils.js";import{earth as y}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{a as x}from"../../../chunks/vec3.js";import{isConstantElevation as S,ConstantElevation as C,isElevationSource as w}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as T}from"../core/utils.js";import{getElevationSampler as ee}from"./updateElevationUtils.js";import{isNumber as E}from"../../../support/guards.js";import{defaultImageSphereSize as D}from"../../../widgets/PanoramicViewer/constants.js";function O(e,t,n){let[r,a,o,s]=t,[c,l,u,p]=n;k(r,a,o,s);let m=k(c,l,u,p),h=A(r,a,o,s),g=A(c,l,u,p),_=d(i(),h),[v,y,b,x]=ne(e,f(i(),_,g));return[v/x,y/x,m?0:b/x]}function k(e,t,n,r){return e[2]===0&&t[2]===0&&n[2]===0&&r[2]===0&&(e[2]=t[2]=n[2]=r[2]=1,!0)}function te(e){return e===0?1:e}function ne(e,t){let[n,r,i]=e,a=[0,0,0,0];return a[0]=n*t[0]+r*t[1]+i*t[2]+t[3],a[1]=n*t[4]+r*t[5]+i*t[6]+t[7],a[2]=n*t[8]+r*t[9]+i*t[10]+t[11],a[3]=te(n*t[12]+r*t[13]+i*t[14]+t[15]),a}function A(e,t,n,r){let o=re(c([...r,1]),d(Array(16),a(e[0],t[0],n[0],0,e[1],t[1],n[1],0,e[2],t[2],n[2],0,1,1,1,1))),s=o[0],l=o[1],u=o[2],f=i();return f[0]=s*e[0],f[1]=l*t[0],f[2]=u*n[0],f[3]=0,f[4]=s*e[1],f[5]=l*t[1],f[6]=u*n[1],f[7]=0,f[8]=s*e[2],f[9]=l*t[2],f[10]=u*n[2],f[11]=0,f[12]=s,f[13]=l,f[14]=u,f[15]=1,f}function j(e,t,n,r,i=o()){return i[0]=e[0]+t[0]*n,i[1]=e[1]+t[1]*n,i[2]=e[2]+t[2]*(n/r),i}function M(e,t,n){let r=o();return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*(t/n),r}function N(e,t){let[n,r,i]=e,a=o();return a[0]=n*t[0]+r*t[3]+i*t[6],a[1]=n*t[1]+r*t[4]+i*t[7],a[2]=n*t[2]+r*t[5]+i*t[8],a}function re(e,t){let[n,r,i,a]=e,o=[,,,,];return o[0]=n*t[0]+r*t[1]+i*t[2]+a*t[3],o[1]=n*t[4]+r*t[5]+i*t[6]+a*t[7],o[2]=n*t[8]+r*t[9]+i*t[10]+a*t[11],o[3]=n*t[12]+r*t[13]+i*t[14]+a*t[15],o}function ie(n,i,a,o=!0){if(!Number.isFinite(n))throw new e(`InvalidRotationAngle`,`Please specify a valid angle for rotation`);let s=a*(o?t(n):n),c=Math.cos(s),l=Math.sin(s),u=r();switch(i){case 0:u[4]=c,u[5]=-l,u[7]=l,u[8]=c;break;case 1:u[0]=c,u[2]=l,u[6]=-l,u[8]=c;break;case 2:u[0]=c,u[1]=-l,u[3]=l,u[4]=c;break;default:throw new e(`InvalidRotationAxis`,`Please specify either 0, 1 or 2 for X, Y or Z axis respectively`)}return u}const P={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]],YPR:[[0,-1],[1,-1],[2,-1]]};function F(t,n,i=!0){if(t?.length!==3||n?.length!==3)throw new e(`InvalidRotationAngles`,`Please specify three angles with config for rotation`);let a=r();for(let e=0;e<3;e++){let[r,o]=n[e],s=ie(t[e],r,o,i);l(a,s,a)}return a}function I(e,t=!0){return F(e,P.OPK,t)}function L(e,t=!0){return F(e,P.HPR,t)}function ae(e,n,r){let i=Math.sin(t(r)),a=Math.cos(t(r)),o=[[e,0],[e,n],[0,n]];o.forEach((e,t)=>{o[t]=[a*e[0]-i*e[1],i*e[0]+a*e[1]]});let s={xmin:Math.min(0,o[0][0],o[1][0],o[2][0]),xmax:Math.max(0,o[0][0],o[1][0],o[2][0]),ymin:Math.min(0,o[0][1],o[1][1],o[2][1]),ymax:Math.max(0,o[0][1],o[1][1],o[2][1])};return{hfov:Math.abs(s.xmax-s.xmin),vfov:Math.abs(s.ymax-s.ymin)}}function oe(e,r){let i=Number(e[0]),a=Number(e[1]),o=Number(e[2]),[s,c,l,u]=r,d=t(s),f=t(c),p=l/Math.sqrt(1-u*Math.sin(d)**2),m=i/p,h=a/p,g=o/p,_=Math.cos(d)-Math.sin(d)*h+Math.cos(d)*g,v=Math.sin(d)+Math.cos(d)*h+Math.sin(d)*g,y=Math.sqrt(_**2+m**2),b=u*p*Math.sin(d),x=(e,t=5)=>{if(t===0)return e;let n=x(e,t-1);return Math.atan(v/y-(b-u*(l/Math.sqrt(1-u*Math.sin(n)**2))*Math.sin(n))/(p*y))},S=x(d),C=Math.atan(i/(p*_))+f,w=n(S);return[n(C),w,i/(Math.cos(S)*Math.sin(C-f))-l/Math.sqrt(1-u*Math.sin(S)**2)]}function R(e,t,n){let r=360/t,i=180/n,a=e.x-t/2,o=e.y-n/2;return{heading:a*r,pitch:90-o*i}}function se(e,t,n,r,i=D/2){let{heading:a,pitch:o}=B(e,i),s=r?$(a,o,r):[a,o];return{heading:a,pitch:o,...z(s[0],s[1],t,n)}}function z(e,t,n,r){let i=360/n,a=180/r,o=e%360,s=o<-180?o+360:o>180?o-360:o;return{x:n/2+s/i,y:r-t/a}}function B(e,t){let r=n(Math.acos(-e.z/t));return{heading:n(Math.atan2(e.x,e.y)),pitch:r}}function V(e,n){return[Math.sin(t(e))*Math.sin(t(n)),Math.cos(t(e))*Math.sin(t(n)),Math.cos(t(180-n))]}function H(e,t,n,r=D/2){let i=n?$(e,t,n,!0):[e,t];return p(s(),V(i[0],i[1]),r)}function ce(e,t,n,r,i=D/2){let{heading:a,pitch:o}=R(e,t,n);return H(a,o,r,i)}async function le(e,t,r){let i=await v(t,e.spatialReference,r),a=n(Math.atan2(i.y-e.y,i.x-e.x));return a=a>=0&&a<=90?90-a:a>90&&a<=180?360-a+90:90+Math.abs(a),a}function ue(e,t,n){let r=Math.cos(n),i=Math.sin(n),a=[1,0,0,1,0,0],o=a[0]*r+a[2]*i,s=a[1]*r+a[3]*i,c=-a[0]*i+a[2]*r,l=-a[1]*i+a[3]*r;return a[0]=o,a[1]=s,a[2]=c,a[3]=l,[e*a[0]+t*a[2]+a[4],e*a[1]+t*a[3]+a[5]]}const de=e=>e.toArray(),U=(...e)=>e.some(e=>e);function fe(e,t){if(U(e.length===0,e.some(({x:e,y:t})=>U(e==null,t==null)),!t.hasZ))throw Error(`Input pixels must have x, y and camera location must have z value`)}function pe(e,t){if(e.some(e=>e.z==null)||t.z==null)throw Error(`Input points and camera location must have z value`)}function me(e){if(e?.length!==9)throw Error(`Rotation matrix is not provided or is not a valid 3x3 matrix`)}function he(e,t){return b(t)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*e/y.radius))):1}const ge=e=>t=>new _({x:t[0],y:t[1],z:t[2],spatialReference:e});function _e(e,t,n,r){return[[-t,-t],[+t,-t],[+t,+t],[-t,+t]].map(([t,i])=>O(x(o(),n,[t,i,0]),r,e))}function W({a0:e,a1:t,a2:n,b0:r,b1:i,b2:a},o,s,c){let l=[e??o/2-.5,t,n??0,r??s/2-.5,i??0,a].map(ve);return c!=null&&G(l)?{affines:l,focalLength:c}:{affines:[o/2-.5,1,0,s/2-.5,0,-1]}}function ve(e,t){if(e==null)return null;let n=parseFloat(`${e}`);return isNaN(n)?null:n}function G(e){return e[1]!=null&&e[5]!=null}function ye(e,t,n){let{cameraHeight:r,cameraPitch:i,cameraRoll:a,elevation:o,farDistance:s,horizontalFieldOfView:c,location:l,verticalFieldOfView:u}=Q(e,e.location.spatialReference),d=o??(l.z??0)-r;return{...K(e,t,n),averageElevation:d,cameraPitch:i,cameraRoll:a??0,farDistance:s,horizontalFieldOfView:c,verticalFieldOfView:u}}function be(e,t,n,r){return X(r)?I([r.omega,r.phi,r.kappa]):Z(r)?L([r.heading,r.pitch,r.roll]):L([e,t,n??0])}function xe(e,t,n){let{cameraHeading:r,cameraHeight:i,farDistance:a,horizontalFieldOfView:o,location:s,verticalFieldOfView:c}=Q(e,e.location.spatialReference),l=(s.z??0)-i,u=-r,d=0,f=0;if(e?.matrix){let{matrix:t}=e;[d,f,u]=Ee(t)}return{averageElevation:l,cameraLocation:s,cameraHeading:r,farDistance:a,horizontalFieldOfView:o,imageHeight:n,imageWidth:t,verticalFieldOfView:c,horizonYaw:u,horizonPitch:d,horizonRoll:f}}function K(e,t,n){let{a0:r,a1:i,a2:a,b0:o,b1:s,b2:c,cameraHeading:l,cameraOrientation:u,cameraPitch:d,cameraRoll:f,focalLength:p,horizontalFieldOfView:m,location:h,matrix:g,principalX:_,principalY:v,radial:y,tangential:b,verticalFieldOfView:x}=e,{affines:S,focalLength:C}=W({a0:r,a1:i,a2:a,b0:o,b1:s,b2:c},t,n,p),w=g??be(l,d,f,u),T=_!=null&&v!=null?[_,v]:void 0;return{affineTransformations:u?.affineTransformations??S,cameraLocation:h.clone(),focalLength:u?.focalLength??C,horizontalFieldOfView:m,imageHeight:n,imageWidth:t,principalOffsetPoint:u?.principalOffsetPoint??T,radialDistortionCoefficients:u?.radialDistortionCoefficients??y,rotationMatrix:w,tangentialDistortionCoefficients:u?.tangentialDistortionCoefficients??b,verticalFieldOfView:x}}const q=e=>e!=null&&`elevationSample`in e&&e.elevationSample!=null,J=e=>w(e?.elevationSource)&&e?.extent!=null,Y=e=>S(e?.elevationSource),Se=async(e,t,n,r,i)=>{let a=T(e),o=t-n/a;return q(r)?r:Y(r)?(r.elevationSource=new C({constantElevation:r.elevationSource.constantElevation/a}),r):J(r)?{elevationSample:await ee({...g(r.elevationSource)?r.elevationSource.toJSON():r.elevationSource,extent:r.extent},i),elevationSource:new C({constantElevation:o})}:{averageGroundElevation:o,spatialReference:e}},Ce=e=>E(e?.heading)&&E(e?.pitch),we=(e,t)=>[[-e,-t],[e,-t],[e,t],[-e,t]];function Te(e){let{cameraLocation:n,farDistance:i,horizontalFieldOfView:a,rotationMatrix:s,scalingFactor:c,verticalFieldOfView:l}=e,d=r();u(d,s);let f=2*Math.tan(t(l)/2)*i*c,p=2*Math.tan(t(a)/2)*i*c,g=N([0,0,-1],d),_=j([n.x,n.y,n.z],g,e.farDistance*c,c),v=N([0,1,0],d),y=N([1,0,0],d),b=M(v,f/2,c),x=M(y,p/2,c),S=m(o(),b,x),C=h(o(),b,x);return[h(o(),_,S),h(o(),_,C),m(o(),_,S),m(o(),_,C)]}const X=e=>e?.type===2,Z=e=>e?.type===1;function Q(e,t,n=!0){let r=T(t),i=n?e.clone():e;return i.cameraHeight/=r,i.farDistance/=r,i.nearDistance/=r,S(i.elevationSource)&&(i.elevationSource.constantElevation/=r),i}function Ee(e){return[n(Math.asin(-e[6])),n(Math.atan(e[7]/e[8])),n(Math.atan2(e[3],e[0]))]}function $(e,t,n,r=!1){return De(V(e,t),n,r)}function De(e,t,i=!1){let a=i?u(r(),F(t,P.YPR)):F(t,P.YPR),o=e[0]*a[0]+e[1]*a[1]+e[2]*a[2],s=e[0]*a[3]+e[1]*a[4]+e[2]*a[5],c=e[0]*a[6]+e[1]*a[7]+e[2]*a[8],l=n(Math.acos(-c));return[n(Math.atan2(o,s)),l]}export{$ as adjustHorizonAngles,De as adjustHorizonAnglesVec3,Te as computeFarplaneVertices,ae as computeHFOVAndVFOV,_e as computeNewReferenceCoordinates,H as convertHeadingPitchToSphereVertex,z as convertOrientationToPixelLocation,ce as convertPixelLocationToSphereVertex,R as convertPixelToHeadingPitch,B as convertSphereVertexToOrientation,se as convertSphereVertexToPixelLocation,Q as convertToSRUnits,V as createMeshSpaceVector,F as createRotationMatrix,L as createRotationMatrixFromHPR,I as createRotationMatrixFromOPK,Ee as extractHorizonAngles,W as getAffinesAndFocalLength,xe as getImageToWorldPanoramicProperties,ye as getImageToWorldProperties,le as getInitialAngle,Se as getUpdateElevationProps,he as getWebMercatorScalingFactor,K as getWorldToImageProperties,Ce as hasAngles,Z as hasHeadingPitchRoll,X as hasOmegaPhiKappa,q as isUpdateElevationWithElevationSampler,J as isUpdateElevationWithElevationSource,Y as isUpdateUsingConstantElevation,G as isValidAffines,A as linearEquationSolve,oe as ltpToGeographic,U as or,de as pointToArray,O as projectiveTransform,we as reducerFn,ue as rotatePixel,j as scaleAndAddWithFactor,M as scaleWithFactor,N as transformMat3,re as transformMat4,fe as validatePixelsToTransform,pe as validatePointsToTransform,me as validateRotationMatrix,ge as vecToPoint};
2
+ import{rad2deg as e,deg2rad as t}from"../../../core/mathUtils.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as r,fromValues as i}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{zeros as a,create as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as s}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{transpose as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as l,mul as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{scale as d,sub as f,add as p}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{isSerializable as m}from"../../../core/support/jsonUtils.js";import h from"../../../geometry/Point.js";import{projectAsync as g}from"../../../geometry/projectionUtils.js";import{earth as _}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as v}from"../../../geometry/support/spatialReferenceUtils.js";import{a as y}from"../../../chunks/vec3.js";import{isConstantElevation as b,ConstantElevation as x,isElevationSource as S}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as C}from"../core/utils.js";import{createRotationMatrix as w,defaultAxisRotationInfo as T,createRotationMatrixFromHPR as E}from"./rotationUtils.js";import{getElevationSampler as ee}from"./updateElevationUtils.js";import{isNumber as D}from"../../../support/guards.js";import{defaultImageSphereSize as O}from"../../../widgets/PanoramicViewer/constants.js";function k(e,t,n){let[i,a,o,s]=t,[c,d,f,p]=n;A(i,a,o,s);let m=A(c,d,f,p),h=j(i,a,o,s),g=j(c,d,f,p),_=l(r(),h),[v,y,b,x]=ne(e,u(r(),_,g));return[v/x,y/x,m?0:b/x]}function A(e,t,n,r){return e[2]===0&&t[2]===0&&n[2]===0&&r[2]===0&&(e[2]=t[2]=n[2]=r[2]=1,!0)}function te(e){return e===0?1:e}function ne(e,t){let[n,r,i]=e,a=[0,0,0,0];return a[0]=n*t[0]+r*t[1]+i*t[2]+t[3],a[1]=n*t[4]+r*t[5]+i*t[6]+t[7],a[2]=n*t[8]+r*t[9]+i*t[10]+t[11],a[3]=te(n*t[12]+r*t[13]+i*t[14]+t[15]),a}function j(e,t,n,a){let o=F(s([...a,1]),l(Array(16),i(e[0],t[0],n[0],0,e[1],t[1],n[1],0,e[2],t[2],n[2],0,1,1,1,1))),c=o[0],u=o[1],d=o[2],f=r();return f[0]=c*e[0],f[1]=u*t[0],f[2]=d*n[0],f[3]=0,f[4]=c*e[1],f[5]=u*t[1],f[6]=d*n[1],f[7]=0,f[8]=c*e[2],f[9]=u*t[2],f[10]=d*n[2],f[11]=0,f[12]=c,f[13]=u,f[14]=d,f[15]=1,f}function M(e,t,n,r,i=a()){return i[0]=e[0]+t[0]*n,i[1]=e[1]+t[1]*n,i[2]=e[2]+t[2]*(n/r),i}function N(e,t,n){let r=a();return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*(t/n),r}function P(e,t){let[n,r,i]=e,o=a();return o[0]=n*t[0]+r*t[3]+i*t[6],o[1]=n*t[1]+r*t[4]+i*t[7],o[2]=n*t[2]+r*t[5]+i*t[8],o}function F(e,t){let[n,r,i,a]=e,o=[,,,,];return o[0]=n*t[0]+r*t[1]+i*t[2]+a*t[3],o[1]=n*t[4]+r*t[5]+i*t[6]+a*t[7],o[2]=n*t[8]+r*t[9]+i*t[10]+a*t[11],o[3]=n*t[12]+r*t[13]+i*t[14]+a*t[15],o}function I(e,t=!0){return w(e,T.OPK,t)}function re(e,n,r){let i=Math.sin(t(r)),a=Math.cos(t(r)),o=[[e,0],[e,n],[0,n]];o.forEach((e,t)=>{o[t]=[a*e[0]-i*e[1],i*e[0]+a*e[1]]});let s={xmin:Math.min(0,o[0][0],o[1][0],o[2][0]),xmax:Math.max(0,o[0][0],o[1][0],o[2][0]),ymin:Math.min(0,o[0][1],o[1][1],o[2][1]),ymax:Math.max(0,o[0][1],o[1][1],o[2][1])};return{hfov:Math.abs(s.xmax-s.xmin),vfov:Math.abs(s.ymax-s.ymin)}}function ie(n,r){let i=Number(n[0]),a=Number(n[1]),o=Number(n[2]),[s,c,l,u]=r,d=t(s),f=t(c),p=l/Math.sqrt(1-u*Math.sin(d)**2),m=i/p,h=a/p,g=o/p,_=Math.cos(d)-Math.sin(d)*h+Math.cos(d)*g,v=Math.sin(d)+Math.cos(d)*h+Math.sin(d)*g,y=Math.sqrt(_**2+m**2),b=u*p*Math.sin(d),x=(e,t=5)=>{if(t===0)return e;let n=x(e,t-1);return Math.atan(v/y-(b-u*(l/Math.sqrt(1-u*Math.sin(n)**2))*Math.sin(n))/(p*y))},S=x(d),C=Math.atan(i/(p*_))+f,w=e(S);return[e(C),w,i/(Math.cos(S)*Math.sin(C-f))-l/Math.sqrt(1-u*Math.sin(S)**2)]}function L(e,t,n){let r=360/t,i=180/n,a=e.x-t/2,o=e.y-n/2;return{heading:a*r,pitch:90-o*i}}function ae(e,t,n,r,i=O/2){let{heading:a,pitch:o}=z(e,i),s=r?$(a,o,r):[a,o];return{heading:a,pitch:o,...R(s[0],s[1],t,n)}}function R(e,t,n,r){let i=360/n,a=180/r,o=e%360,s=o<-180?o+360:o>180?o-360:o;return{x:n/2+s/i,y:r-t/a}}function z(t,n){let r=e(Math.acos(-t.z/n));return{heading:e(Math.atan2(t.x,t.y)),pitch:r}}function B(e,n){return[Math.sin(t(e))*Math.sin(t(n)),Math.cos(t(e))*Math.sin(t(n)),Math.cos(t(180-n))]}function V(e,t,n,r=O/2){let i=n?$(e,t,n,!0):[e,t];return d(o(),B(i[0],i[1]),r)}function oe(e,t,n,r,i=O/2){let{heading:a,pitch:o}=L(e,t,n);return V(a,o,r,i)}async function se(t,n,r){let i=await g(n,t.spatialReference,r),a=e(Math.atan2(i.y-t.y,i.x-t.x));return a=a>=0&&a<=90?90-a:a>90&&a<=180?360-a+90:90+Math.abs(a),a}function ce(e,t,n){let r=Math.cos(n),i=Math.sin(n),a=[1,0,0,1,0,0],o=a[0]*r+a[2]*i,s=a[1]*r+a[3]*i,c=-a[0]*i+a[2]*r,l=-a[1]*i+a[3]*r;return a[0]=o,a[1]=s,a[2]=c,a[3]=l,[e*a[0]+t*a[2]+a[4],e*a[1]+t*a[3]+a[5]]}const le=e=>e.toArray(),H=(...e)=>e.some(e=>e);function ue(e,t){if(H(e.length===0,e.some(({x:e,y:t})=>H(e==null,t==null)),!t.hasZ))throw Error(`Input pixels must have x, y and camera location must have z value`)}function de(e,t){if(e.some(e=>e.z==null)||t.z==null)throw Error(`Input points and camera location must have z value`)}function fe(e){if(e?.length!==9)throw Error(`Rotation matrix is not provided or is not a valid 3x3 matrix`)}function pe(e,t){return v(t)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*e/_.radius))):1}const me=e=>t=>new h({x:t[0],y:t[1],z:t[2],spatialReference:e});function he(e,t,n,r){return[[-t,-t],[+t,-t],[+t,+t],[-t,+t]].map(([t,i])=>k(y(a(),n,[t,i,0]),r,e))}function U({a0:e,a1:t,a2:n,b0:r,b1:i,b2:a},o,s,c){let l=[e??o/2-.5,t,n??0,r??s/2-.5,i??0,a].map(ge);return c!=null&&W(l)?{affines:l,focalLength:c}:{affines:[o/2-.5,1,0,s/2-.5,0,-1]}}function ge(e,t){if(e==null)return null;let n=parseFloat(`${e}`);return isNaN(n)?null:n}function W(e){return e[1]!=null&&e[5]!=null}function _e(e,t,n){let{cameraHeight:r,cameraPitch:i,cameraRoll:a,elevation:o,farDistance:s,horizontalFieldOfView:c,location:l,verticalFieldOfView:u}=Z(e,e.location.spatialReference),d=o??(l.z??0)-r;return{...G(e,t,n),averageElevation:d,cameraPitch:i,cameraRoll:a??0,farDistance:s,horizontalFieldOfView:c,verticalFieldOfView:u}}function ve(e,t,n,r){return Y(r)?I([r.omega,r.phi,r.kappa]):X(r)?E([r.heading,r.pitch,r.roll]):E([e,t,n??0])}function ye(e,t,n){let{cameraHeading:r,cameraHeight:i,farDistance:a,horizontalFieldOfView:o,location:s,verticalFieldOfView:c}=Z(e,e.location.spatialReference),l=(s.z??0)-i,u=-r,d=0,f=0;if(e?.matrix){let{matrix:t}=e;[d,f,u]=Q(t)}return{averageElevation:l,cameraLocation:s,cameraHeading:r,farDistance:a,horizontalFieldOfView:o,imageHeight:n,imageWidth:t,verticalFieldOfView:c,horizonYaw:u,horizonPitch:d,horizonRoll:f}}function G(e,t,n){let{a0:r,a1:i,a2:a,b0:o,b1:s,b2:c,cameraHeading:l,cameraOrientation:u,cameraPitch:d,cameraRoll:f,focalLength:p,horizontalFieldOfView:m,location:h,matrix:g,principalX:_,principalY:v,radial:y,tangential:b,verticalFieldOfView:x}=e,{affines:S,focalLength:C}=U({a0:r,a1:i,a2:a,b0:o,b1:s,b2:c},t,n,p),w=g??ve(l,d,f,u),T=_!=null&&v!=null?[_,v]:void 0;return{affineTransformations:u?.affineTransformations??S,cameraLocation:h.clone(),focalLength:u?.focalLength??C,horizontalFieldOfView:m,imageHeight:n,imageWidth:t,principalOffsetPoint:u?.principalOffsetPoint??T,radialDistortionCoefficients:u?.radialDistortionCoefficients??y,rotationMatrix:w,tangentialDistortionCoefficients:u?.tangentialDistortionCoefficients??b,verticalFieldOfView:x}}const K=e=>e!=null&&`elevationSample`in e&&e.elevationSample!=null,q=e=>S(e?.elevationSource)&&e?.extent!=null,J=e=>b(e?.elevationSource),be=async(e,t,n,r,i)=>{let a=C(e),o=t-n/a;return K(r)?r:J(r)?(r.elevationSource=new x({constantElevation:r.elevationSource.constantElevation/a}),r):q(r)?{elevationSample:await ee({...m(r.elevationSource)?r.elevationSource.toJSON():r.elevationSource,extent:r.extent},i),elevationSource:new x({constantElevation:o})}:{averageGroundElevation:o,spatialReference:e}},xe=e=>D(e?.heading)&&D(e?.pitch),Se=(e,t)=>[[-e,-t],[e,-t],[e,t],[-e,t]];function Ce(e){let{cameraLocation:r,farDistance:i,horizontalFieldOfView:o,rotationMatrix:s,scalingFactor:l,verticalFieldOfView:u}=e,d=n();c(d,s);let m=2*Math.tan(t(u)/2)*i*l,h=2*Math.tan(t(o)/2)*i*l,g=P([0,0,-1],d),_=M([r.x,r.y,r.z],g,e.farDistance*l,l),v=P([0,1,0],d),y=P([1,0,0],d),b=N(v,m/2,l),x=N(y,h/2,l),S=f(a(),b,x),C=p(a(),b,x);return[p(a(),_,S),p(a(),_,C),f(a(),_,S),f(a(),_,C)]}const Y=e=>e?.type===2,X=e=>e?.type===1;function Z(e,t,n=!0){let r=C(t),i=n?e.clone():e;return i.cameraHeight/=r,i.farDistance/=r,i.nearDistance/=r,b(i.elevationSource)&&(i.elevationSource.constantElevation/=r),i}function Q(t){return[e(Math.asin(-t[6])),e(Math.atan(t[7]/t[8])),e(Math.atan2(t[3],t[0]))]}function $(e,t,n,r=!1){return we(B(e,t),n,r)}function we(t,r,i=!1){let a=i?c(n(),w(r,T.YPR)):w(r,T.YPR),o=t[0]*a[0]+t[1]*a[1]+t[2]*a[2],s=t[0]*a[3]+t[1]*a[4]+t[2]*a[5],l=t[0]*a[6]+t[1]*a[7]+t[2]*a[8],u=e(Math.acos(-l));return[e(Math.atan2(o,s)),u]}export{$ as adjustHorizonAngles,we as adjustHorizonAnglesVec3,Ce as computeFarplaneVertices,re as computeHFOVAndVFOV,he as computeNewReferenceCoordinates,V as convertHeadingPitchToSphereVertex,R as convertOrientationToPixelLocation,oe as convertPixelLocationToSphereVertex,L as convertPixelToHeadingPitch,z as convertSphereVertexToOrientation,ae as convertSphereVertexToPixelLocation,Z as convertToSRUnits,B as createMeshSpaceVector,w as createRotationMatrix,E as createRotationMatrixFromHPR,I as createRotationMatrixFromOPK,Q as extractHorizonAngles,U as getAffinesAndFocalLength,ye as getImageToWorldPanoramicProperties,_e as getImageToWorldProperties,se as getInitialAngle,be as getUpdateElevationProps,pe as getWebMercatorScalingFactor,G as getWorldToImageProperties,xe as hasAngles,X as hasHeadingPitchRoll,Y as hasOmegaPhiKappa,K as isUpdateElevationWithElevationSampler,q as isUpdateElevationWithElevationSource,J as isUpdateUsingConstantElevation,W as isValidAffines,j as linearEquationSolve,ie as ltpToGeographic,H as or,le as pointToArray,k as projectiveTransform,Se as reducerFn,ce as rotatePixel,M as scaleAndAddWithFactor,N as scaleWithFactor,P as transformMat3,F as transformMat4,ue as validatePixelsToTransform,de as validatePointsToTransform,fe as validateRotationMatrix,me as vecToPoint};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{saveAs as e,save as t}from"./utils.js";import{getWGS84ExtentForItem as n,removeTypeKeyword as r,typeKeyword as i}from"../../portal/support/portalItemUtils.js";const a=`Parquet Feature Layer`;function o(e){return{isValid:e.type===`parquet`,errorMessage:`Layer.type should be 'parquet'`}}function s(e){let t=e.layerJSON;return Promise.resolve(t&&Object.keys(t).length?t:null)}async function c(e,t){let{title:a,fullExtent:o}=e;t.title||=a,t.extent=o?await n(o):null,r(t,i.METADATA)}async function l(e,n){return t({layer:e,itemType:a,validateLayer:o,createItemData:s,errorNamePrefix:`parquet-layer-save`},n)}async function u(t,n,r){return e({layer:t,itemType:a,validateLayer:o,createItemData:s,errorNamePrefix:`parquet-layer-save-as`,newItem:n,setItemProperties:c},r)}export{l as save,u as saveAs};
2
+ import{saveAs as e,save as t}from"./utils.js";import{removeTypeKeyword as n,typeKeyword as r,getWGS84ExtentForItem as i,toggleTypeKeyword as a}from"../../portal/support/portalItemUtils.js";const o=`Parquet Feature Layer`;function s(e){return{isValid:e.type===`parquet`,errorMessage:`Layer.type should be 'parquet'`}}function c(e){let t=e.layerJSON;return Promise.resolve(t&&Object.keys(t).length?t:null)}async function l(e,t){t.extent||await d(e,t),f(e,t)}async function u(e,t){t.title||=e.title,await d(e,t),n(t,r.METADATA),f(e,t)}async function d(e,t){t.extent=e.fullExtent?await i(e.fullExtent):null}function f(e,t){a(t,r.CHARTS,!!e.charts?.length)}async function p(e,n){return t({layer:e,itemType:o,validateLayer:s,createItemData:c,errorNamePrefix:`parquet-layer-save`,setItemProperties:l},n)}async function m(t,n,r){return e({layer:t,itemType:o,validateLayer:s,createItemData:c,errorNamePrefix:`parquet-layer-save-as`,newItem:n,setItemProperties:u},r)}export{p as save,m as saveAs};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../request.js";import{clone as t}from"../../core/lang.js";import n from"../../core/Logger.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{normalize as i,removeFile as a,getAppBaseUrl as o,removeTrailingSlash as s,addQueryParameters as c,isProtocolRelative as l,isAbsolute as u,join as d}from"../../core/urlUtils.js";import{wgs84 as f,webMercator as p}from"../../geometry/support/spatialReferenceUtils.js";import{geographicToWebMercator as m}from"../../geometry/support/webMercatorUtils.js";import h from"../../views/2d/engine/vectorTiles/style/GeoJSONVectorTileSource.js";import g from"../../views/2d/engine/vectorTiles/style/RemoteVectorTileSource.js";async function _(e,t){let n={source:null,sourceBase:null,sourceUrl:null,validatedSource:null,style:null,styleBase:null,styleUrl:null,sourceNameToSource:{},primarySourceName:``,spriteFormat:`png`},[r,i]=typeof e==`string`?[e,null]:[null,e.jsonUrl];return await y(n,`esri`,e,i,t),{layerDefinition:n.validatedSource,url:r,serviceUrl:n.sourceUrl,style:n.style,styleUrl:n.styleUrl,spriteUrl:n.style&&n.style.sprite&&v(n.styleBase,n.style.sprite),spriteFormat:n.spriteFormat,glyphsUrl:n.style&&n.style.glyphs&&v(n.styleBase,n.style.glyphs),sourceNameToSource:n.sourceNameToSource,primarySourceName:n.primarySourceName}}function v(...e){let t;for(let n of e)n!=null&&(l(n)?t&&=t.split(`://`)[0]+`:`+n.trim():t=u(n)?n:d(t,n));return t?s(t):void 0}async function y(t,n,a,o,s){r(s);let c,l,u;if(typeof a==`string`){let t=i(a);u=await e(t,{...s,responseType:`json`,query:{f:`json`,...s?.query}}),u.ssl&&(c&&=c.replace(/^http:/i,`https:`),l&&=l.replace(/^http:/i,`https:`)),c=t,l=t}else a!=null&&(u={data:a},c=a.jsonUrl||null,l=o);let d=u?.data;switch(d?.type){case`Feature`:case`FeatureCollection`:return t.sourceUrl=c||null,C(t,T(d),l,s)}if(x(d))return t.styleUrl=c||null,C(t,d,l,s);if(S(d))return t.primarySourceName?D(t,d,l,!1,n,s):(t.sourceUrl=c||null,b(d)&&t.style==null&&(n=`tilejson`),D(t,d,l,!0,n,s));throw Error(`You must specify the URL or the JSON for a service or for a style.`)}function b(e){return typeof e==`object`&&!!e&&`tilejson`in e&&e.tilejson!=null}function x(e){return!!e&&`sources`in e&&!!e.sources}function S(e){return!!e&&!x(e)}async function C(e,t,n,r){let i=n?a(n):o(),s=t.layers==null||t.layers.length===0,c=s?{...t,layers:[]}:t;e.styleBase=i,e.style=c,c[`sprite-format`]?.toLowerCase()===`webp`&&(e.spriteFormat=`webp`);let l=[];if(c.sources&&c.sources.esri&&c.sources.esri.type!==`geojson`){let t=c.sources.esri;t.url?await y(e,`esri`,v(i,t.url),void 0,r):l.push(y(e,`esri`,t,i,r))}for(let t of Object.keys(c.sources))t!==`esri`&&t!==`tilejson`&&c.sources[t].type===`vector`&&(c.sources[t].url?l.push(y(e,t,v(i,c.sources[t].url),void 0,r)):c.sources[t].tiles&&l.push(y(e,t,c.sources[t],i,r)));await Promise.all(l);for(let t of Object.keys(c.sources)){let n=c.sources[t];if(n.type===`geojson`){let a=await w(e,t,n,i,r);s&&c.layers.push(...E(t,a.geometryTypes))}}}async function w(e,t,n,r,i){if(n.data==null)throw Error(`GeoJSON source '${t}' must define a data property.`);let a={...n,type:`geojson`,data:typeof n.data==`string`?v(r,n.data):n.data},o=k({maxzoom:a.maxzoom,minzoom:a.minzoom},e),s=await h.create(t,r,o,a,i);return O(e,t,n,o,s,!e.primarySourceName,r),s}function T(e){return{version:8,sprite:``,glyphs:``,sources:{geojson:{type:`geojson`,data:e}},layers:[]}}function E(e,t){return t.map(t=>{switch(t){case`polygon`:return{id:`${e}_polygon`,type:`fill`,source:e,filter:[`==`,`$type`,`Polygon`],paint:{"fill-color":`#808080`}};case`line`:return{id:`${e}_line`,type:`line`,source:e,filter:[`==`,`$type`,`LineString`],paint:{"line-color":`#808080`,"line-width":1}};case`point`:return{id:`${e}_point`,type:`circle`,source:e,filter:[`==`,`$type`,`Point`],paint:{"circle-color":`#808080`,"circle-radius":3}}}})}async function D(e,t,n,r,i,a){let l=n?s(n)+`/`:o(),u=k(t,e);if(O(e,i,t,u,new g(i,c(l,a?.query??{}),u),r,l),!b(e)&&`defaultStyles`in t&&!e.style){if(t.defaultStyles==null)throw Error();return typeof t.defaultStyles==`string`?y(e,``,v(l,t.defaultStyles,`root.json`),void 0,a):y(e,``,t.defaultStyles,v(l,`root.json`),a)}if(b(t)&&e.style==null&&u.defaultStyles)return y(e,``,u.defaultStyles,v(l,`root.json`),a)}function O(e,t,r,i,a,o,s){if(!o&&e.primarySourceName in e.sourceNameToSource){let r=e.sourceNameToSource[e.primarySourceName];if(!r.isCompatibleWith(a)){n.getLogger(`esri.layers.support.vectorTileLayerLoader`).warn(`Ignoring source '${t}' because its tiling scheme is incompatible with the primary source '${e.primarySourceName}'.`),a.destroy();return}a.fullExtent!=null&&(r.fullExtent==null?r.fullExtent=a.fullExtent.clone():r.fullExtent.union(a.fullExtent)),r.tileInfo&&a.tileInfo&&r.tileInfo.lods.length<a.tileInfo.lods.length&&(r.tileInfo=a.tileInfo)}o&&(e.sourceBase=s,e.source=r,e.validatedSource=i,e.primarySourceName=t),e.sourceNameToSource[t]=a}function k(e,n){if(A(e)){let t=e?.tileInfo;return t!=null&&(t.rows??=512,t.cols??=512),e}let r={xmin:-20037507.067161843,ymin:-20037507.067161843,xmax:20037507.067161843,ymax:20037507.067161843,spatialReference:{wkid:102100,latestWkid:3857}},i=null,a;if(b(e)){let{bounds:r,vector_layers:o}=e;if(r){let e=m({x:r[0],y:r[1],spatialReference:t(f)}),n=m({x:r[2],y:r[3],spatialReference:t(f)});i={xmin:e.x,ymin:e.y,xmax:n.x,ymax:n.y,spatialReference:t(p)}}if(o&&o.length>0)a={version:8,sprite:``,glyphs:``,sources:{tilejson:{type:`vector`,url:e.tilejson}},layers:j(o)};else if(n.style==null)throw Error(`The TileJSON source does not contain any vector_layers. This VectorTileLayer cannot be loaded.`)}i===null&&(i=r);let o=78271.51696400007,s=295828763.7957775,c=[],l=e.hasOwnProperty(`maxzoom`)&&e.maxzoom!=null?Math.abs(+e.maxzoom):22;for(let e=0;e<=l;e++)c.push({level:e,scale:s,resolution:o}),o/=2,s/=2;return{capabilities:`TilesOnly`,initialExtent:i,fullExtent:r,minScale:0,maxScale:0,tiles:e.tiles,tileInfo:{rows:512,cols:512,dpi:96,format:`pbf`,origin:{x:-20037508.342787,y:20037508.342787},lods:c,spatialReference:t(p)},defaultStyles:a}}function A(e){return e.hasOwnProperty(`tileInfo`)}function j(e){let t=[];for(let n of e)n.geometry_type?t.push(M(n.geometry_type.toLowerCase(),n,!1)):(t.push(M(`polygon`,n,!0)),t.push(M(`line`,n,!0)),t.push(M(`circle`,n,!0)));return t}function M(e,t,n){let{id:r,minzoom:i,maxzoom:a}=t,o={type:e===`polygon`||e===`polygons`?`fill`:e===`line`||e===`lines`?`line`:`circle`,id:r,source:`tilejson`,"source-layer":r,minzoom:i,maxzoom:a};switch(e){case`fill`:n&&(o.id+=`_polygon`,o.filter=`(["==", "$type", "Polygon"])`),o.paint={"fill-color":`#808080`};break;case`line`:n&&(o.id+=`_line`,o.filter=`(["==", "$type", "LineString"])`);break;case`circle`:n&&(o.id+=`_point`,o.filter=`(["==", "$type", "Point"])`)}return o}export{_ as loadMetadata};
2
+ import e from"../../request.js";import{clone as t}from"../../core/lang.js";import n from"../../core/Logger.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{normalize as i,removeFile as a,getAppBaseUrl as o,removeTrailingSlash as s,addQueryParameters as c,isProtocolRelative as l,isAbsolute as u,join as d}from"../../core/urlUtils.js";import f from"../../geometry/SpatialReference.js";import{wgs84 as p,webMercator as m}from"../../geometry/support/spatialReferenceUtils.js";import{geographicToWebMercator as h}from"../../geometry/support/webMercatorUtils.js";import g from"./LOD.js";import _ from"../../views/2d/engine/vectorTiles/style/GeoJSONVectorTileSource.js";import{createTileInfo as v}from"../../views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js";import y from"../../views/2d/engine/vectorTiles/style/RemoteVectorTileSource.js";async function b(e,t){let n={source:null,sourceBase:null,sourceUrl:null,validatedSource:null,style:null,styleBase:null,styleUrl:null,sourceNameToSource:{},primarySourceName:``,spriteFormat:`png`},[r,i]=typeof e==`string`?[e,null]:[null,e.jsonUrl];return await S(n,`esri`,e,i,t),{layerDefinition:n.validatedSource,url:r,serviceUrl:n.sourceUrl,style:n.style,styleUrl:n.styleUrl,spriteUrl:n.style&&n.style.sprite&&x(n.styleBase,n.style.sprite),spriteFormat:n.spriteFormat,glyphsUrl:n.style&&n.style.glyphs&&x(n.styleBase,n.style.glyphs),sourceNameToSource:n.sourceNameToSource,primarySourceName:n.primarySourceName}}function x(...e){let t;for(let n of e)n!=null&&(l(n)?t&&=t.split(`://`)[0]+`:`+n.trim():t=u(n)?n:d(t,n));return t?s(t):void 0}async function S(t,n,a,o,s){r(s);let c,l,u;if(typeof a==`string`){let t=i(a);u=await e(t,{...s,responseType:`json`,query:{f:`json`,...s?.query}}),u.ssl&&(c&&=c.replace(/^http:/i,`https:`),l&&=l.replace(/^http:/i,`https:`)),c=t,l=t}else a!=null&&(u={data:a},c=a.jsonUrl||null,l=o);let d=u?.data;switch(d?.type){case`Feature`:case`FeatureCollection`:return t.sourceUrl=c||null,E(t,O(d),l,s)}if(w(d))return t.styleUrl=c||null,E(t,d,l,s);if(T(d))return t.primarySourceName?A(t,d,l,!1,n,s):(t.sourceUrl=c||null,C(d)&&t.style==null&&(n=`tilejson`),A(t,d,l,!0,n,s));throw Error(`You must specify the URL or the JSON for a service or for a style.`)}function C(e){return typeof e==`object`&&!!e&&`tilejson`in e&&e.tilejson!=null}function w(e){return!!e&&`sources`in e&&!!e.sources}function T(e){return!!e&&!w(e)}async function E(e,t,n,r){let i=n?a(n):o(),s=t.layers==null||t.layers.length===0,c=s?{...t,layers:[]}:t;e.styleBase=i,e.style=c,c[`sprite-format`]?.toLowerCase()===`webp`&&(e.spriteFormat=`webp`);let l=[];if(c.sources&&c.sources.esri&&c.sources.esri.type!==`geojson`){let t=c.sources.esri;t.url?await S(e,`esri`,x(i,t.url),void 0,r):l.push(S(e,`esri`,t,i,r))}for(let t of Object.keys(c.sources))t!==`esri`&&t!==`tilejson`&&c.sources[t].type===`vector`&&(c.sources[t].url?l.push(S(e,t,x(i,c.sources[t].url),void 0,r)):c.sources[t].tiles&&l.push(S(e,t,c.sources[t],i,r)));await Promise.all(l);for(let t of Object.keys(c.sources)){let n=c.sources[t];if(n.type===`geojson`){let a=await D(e,t,n,i,r);s&&c.layers.push(...k(t,a.geometryTypes))}}}async function D(e,t,n,r,i){if(n.data==null)throw Error(`GeoJSON source '${t}' must define a data property.`);let a={...n,type:`geojson`,data:typeof n.data==`string`?x(r,n.data):n.data},o=e.sourceNameToSource[e.primarySourceName],s=o?.tileInfo?.spatialReference,c=s?.isWGS84||s?.isWebMercator?o.tileInfo.clone():v(f.WGS84,a.maxzoom),l=a.maxzoom??22;for(let e=c.lods[c.lods.length-1];e.level<l;)e=new g({level:e.level+1,resolution:e.resolution/2,scale:e.scale/2}),c.lods.push(e);let u=c.spatialReference.isWebMercator?{xmin:-20037507.067161843,ymin:-20037507.067161843,xmax:20037507.067161843,ymax:20037507.067161843,spatialReference:c.spatialReference.toJSON()}:{xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:{wkid:4326}},d={capabilities:`TilesOnly`,tileInfo:c.toJSON(),fullExtent:u,initialExtent:u,minScale:0,maxScale:0},p=await _.create(t,r,d,a,i);return j(e,t,n,d,p,!e.primarySourceName,r),p}function O(e){return{version:8,sprite:``,glyphs:``,sources:{geojson:{type:`geojson`,data:e}},layers:[]}}function k(e,t){return t.map(t=>{switch(t){case`polygon`:return{id:`${e}_polygon`,type:`fill`,source:e,filter:[`==`,`$type`,`Polygon`],paint:{"fill-color":`#808080`}};case`line`:return{id:`${e}_line`,type:`line`,source:e,filter:[`==`,`$type`,`LineString`],paint:{"line-color":`#808080`,"line-width":1}};case`point`:return{id:`${e}_point`,type:`circle`,source:e,filter:[`==`,`$type`,`Point`],paint:{"circle-color":`#808080`,"circle-radius":3}}}})}async function A(e,t,n,r,i,a){let l=n?s(n)+`/`:o(),u=M(t,e);if(j(e,i,t,u,new y(i,c(l,a?.query??{}),u),r,l),!C(e)&&`defaultStyles`in t&&!e.style){if(t.defaultStyles==null)throw Error();return typeof t.defaultStyles==`string`?S(e,``,x(l,t.defaultStyles,`root.json`),void 0,a):S(e,``,t.defaultStyles,x(l,`root.json`),a)}if(C(t)&&e.style==null&&u.defaultStyles)return S(e,``,u.defaultStyles,x(l,`root.json`),a)}function j(e,t,r,i,a,o,s){if(!o&&e.primarySourceName in e.sourceNameToSource){let r=e.sourceNameToSource[e.primarySourceName];if(!r.isCompatibleWith(a)){n.getLogger(`esri.layers.support.vectorTileLayerLoader`).warn(`Ignoring source '${t}' because its tiling scheme is incompatible with the primary source '${e.primarySourceName}'.`),a.destroy();return}a.fullExtent!=null&&(r.fullExtent==null?r.fullExtent=a.fullExtent.clone():r.fullExtent.union(a.fullExtent)),r.tileInfo&&a.tileInfo&&r.tileInfo.lods.length<a.tileInfo.lods.length&&(r.tileInfo=a.tileInfo)}o&&(e.sourceBase=s,e.source=r,e.validatedSource=i,e.primarySourceName=t),e.sourceNameToSource[t]=a}function M(e,n){if(N(e)){let t=e?.tileInfo;return t!=null&&(t.rows??=512,t.cols??=512),e}let r={xmin:-20037507.067161843,ymin:-20037507.067161843,xmax:20037507.067161843,ymax:20037507.067161843,spatialReference:{wkid:102100,latestWkid:3857}},i=null,a;if(C(e)){let{bounds:r,vector_layers:o}=e;if(r){let e=h({x:r[0],y:r[1],spatialReference:t(p)}),n=h({x:r[2],y:r[3],spatialReference:t(p)});i={xmin:e.x,ymin:e.y,xmax:n.x,ymax:n.y,spatialReference:t(m)}}if(o&&o.length>0)a={version:8,sprite:``,glyphs:``,sources:{tilejson:{type:`vector`,url:e.tilejson}},layers:P(o)};else if(n.style==null)throw Error(`The TileJSON source does not contain any vector_layers. This VectorTileLayer cannot be loaded.`)}i===null&&(i=r);let o=78271.51696400007,s=295828763.7957775,c=[],l=e.hasOwnProperty(`maxzoom`)&&e.maxzoom!=null?Math.abs(+e.maxzoom):22;for(let e=0;e<=l;e++)c.push({level:e,scale:s,resolution:o}),o/=2,s/=2;return{capabilities:`TilesOnly`,initialExtent:i,fullExtent:r,minScale:0,maxScale:0,tiles:e.tiles,tileInfo:{rows:512,cols:512,dpi:96,format:`pbf`,origin:{x:-20037508.342787,y:20037508.342787},lods:c,spatialReference:t(m)},defaultStyles:a}}function N(e){return e.hasOwnProperty(`tileInfo`)}function P(e){let t=[];for(let n of e)n.geometry_type?t.push(F(n.geometry_type.toLowerCase(),n,!1)):(t.push(F(`polygon`,n,!0)),t.push(F(`line`,n,!0)),t.push(F(`circle`,n,!0)));return t}function F(e,t,n){let{id:r,minzoom:i,maxzoom:a}=t,o={type:e===`polygon`||e===`polygons`?`fill`:e===`line`||e===`lines`?`line`:`circle`,id:r,source:`tilejson`,"source-layer":r,minzoom:i,maxzoom:a};switch(e){case`fill`:n&&(o.id+=`_polygon`,o.filter=`(["==", "$type", "Polygon"])`),o.paint={"fill-color":`#808080`};break;case`line`:n&&(o.id+=`_line`,o.filter=`(["==", "$type", "LineString"])`);break;case`circle`:n&&(o.id+=`_point`,o.filter=`(["==", "$type", "Point"])`)}return o}export{b as loadMetadata};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "6.0.0-next.27",
3
+ "version": "6.0.0-next.29",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -20,7 +20,7 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.21.5",
23
- "@arcgis/toolkit": "6.0.0-next.27",
23
+ "@arcgis/toolkit": "6.0.0-next.29",
24
24
  "@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
25
25
  "@esri/calcite-components": "^5.2.0",
26
26
  "@vaadin/grid": "~25.3.5",
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../core/Error.js";import{EventedAccessor as n}from"../core/Evented.js";import r from"../core/Logger.js";import{abortMaybe as i}from"../core/maybe.js";import{debounce as a,logOnError as o,isAbortError as s}from"../core/promiseUtils.js";import{watch as c,when as l}from"../core/reactiveUtils.js";import{throttle as u}from"../core/throttle.js";import{property as d,subclass as f}from"../core/accessorSupport/decorators.js";import p from"../geometry/Point.js";import{project as m}from"../geometry/projectionUtils.js";import h from"../geometry/SpatialReference.js";import{geographicToWebMercator as g}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as _}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as v}from"../layers/LayerConstants.js";import{ActionsCollection as y,createDefaultActions as b}from"./actions.js";import{getSelectedTarget as x}from"./actionUtils.js";import S from"./FeatureModel.js";import C from"./support/FeatureAbilities.js";import{getDisplayedSymbol as w}from"../symbols/support/symbolUtils.js";import{system as T}from"../time/constants.js";import{highlightsSupported as E}from"../views/support/layerViewUtils.js";import{GoTo as D}from"../widgets/support/GoTo.js";const O=Symbol(`feature-stream-flush`);let k=null;function A(e,t){switch(e){case`building-scene`:case`map-image`:case`tile`:case`imagery`:return!0;case`imagery-tile`:return t===`2d`;default:return!1}}let j=class extends D(n){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new C,this._activeFeatureStream=null,this._featureStreamHasYielded=!1,this.actions=new y,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureModels=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=a(async()=>{this._cancelLocationUpdate();let e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([c(()=>this.view?.scale,()=>{this.open&&o(this._debouncedLocationUpdate(),r.getLogger(this))}),c(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),c(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),c(()=>this.location,e=>this._locationChange(e)),c(()=>!!this.view?.focusRegionVisible,()=>{this._initialDisplayMode===void 0&&this._syncSelectedFeatureIndex(this.features)}),c(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),c(()=>[this.featurePage,this.selectedFeatureIndex,this.featuresPerPage,this.featureMenuOpen,this.open,this.initialDisplayMode,this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.actions,this.defaultPopupTemplateEnabled,this.includeDefaultActions,this.features,this.map,this.spatialReference,this.timeZone],(e,t)=>this._updateFeatureModels(t?.[1]??-1),{initial:!0}),l(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._destroyFeatureModels(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get defaultActions(){let e=this._get(`defaultActions`)||new y;return e.removeAll(),e.addMany(this.selectedFeatureItem?.defaultActions.toArray()??b()),e}get active(){return this.open&&!this.waitingForResult}set content(e){this.featureStream=null,this._set(`diagnostics`,null),this.features=[],this._set(`content`,e)}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}get featurePage(){return this._get(`featurePage`)}set featurePage(e){e==null?this.featureCount||this._set(`featurePage`,null):!Number.isInteger(e)||e<1||e>Math.ceil(this.featureCount/this.featuresPerPage)||e!==1&&e!==(this.featurePage??0)+1||this._set(`featurePage`,e)}set features(e){if(this._get(`features`)===e)return;let t=e||[];this._set(`features`,t),this._activeFeatureStream&&t.length&&this.featurePage!=null||(this.featurePage=t.length?1:null),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get(`featureStream`)||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,n){this._set(`diagnostics`,n??null),this._get(`featureStream`)!==e&&(this._set(`featureStream`,e),this._cancelFeatureStream(),e&&(this._featureStreamHasYielded=!1,this._set(`pendingLocation`,t??null),this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionVisible?`list`:`feature`)}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?g(e):e;this._set(`location`,t)}get map(){return this.view?.map??null}set map(e){this._override(`map`,e)}get pendingLocation(){return this._get(`pendingLocation`)??null}get streamingFeatures(){return this._activeFeatureStream!=null}get selectedFeature(){return this.selectedFeatureIndex===-1?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){let e=this._get(`selectedFeatureIndex`);return typeof e==`number`?e:-1}set selectedFeatureIndex(e){let{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set(`selectedFeatureIndex`,e)}get selectedFeatureItem(){return this.featureModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get state(){return this.view?this.view.ready?`ready`:`disabled`:this.map?`ready`:`disabled`}get timeZone(){return this.view?.timeZone??T}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get waitingForContents(){return this.featureModels.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&!this._featureStreamHasYielded}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set(`diagnostics`,null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,n){let{view:r}=this;if(!r||!e)throw new t(`fetch-features:invalid-screenpoint-or-view`,`Cannot fetch features without a screen point/screen area and view.`,{screenPoint:e,view:r});let i={},a=r.fetchPopupFeatures(e,{diagnostics:i,pointerType:n?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:n?.signal});this._setFeatureStream(a,void 0,i)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){let{selectedFeatureIndex:t}=this,n=this._activeFeatureStream!=null&&e.length>0;this.initialDisplayMode===`list`?n||(this.selectedFeatureIndex=-1):n&&t===-1?this.selectedFeatureIndex=0:n&&t!==-1||(this.selectedFeatureIndex=e.length?0:-1)}_centerAtLocation(){let{view:e}=this,n=x(this);this._cancelCenterAtLocation();let i=new AbortController,{signal:a}=i;return this._centerAtLocationController=i,!n||!e?Promise.reject(new t(`center-at-location:invalid-target-or-view`,`Cannot center at a location without a target and view.`,{target:n,view:e})):this.callGoTo({target:{target:n,scale:e.scale},options:{signal:a}}).catch(e=>{s(e)||r.getLogger(this).error(e)})}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){let{selectedFeature:t,updateLocationEnabled:n,view:r}=this;r&&!this._locationUpdateController&&n&&e&&(!t||t.geometry)&&this._centerAtLocation()}async _selectedFeatureChange(e){let{location:t,updateLocationEnabled:n,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;let i=_(e)?.type;if((i===`map-image`||i===`imagery`||i===`imagery-tile`)&&(e.symbol=await w(e)),(n||!t)&&e.geometry){if(e.geometry.type===`point`){this.location=e.geometry;return}let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);this.location=t(e.geometry)}else if(n&&!e.geometry){await this._centerAtLocation();let e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureModels(){this.featureModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set(`featureModels`,[])}_reconcileFeatureModels(e,t){let n=[],r=new Map;if(this.featureModels.forEach((t,i)=>{let a=t?.graphic;if(!a||t.destroyed)t.destroy();else if(e[i]===a)n[i]=t;else{let e=r.get(a);e?e.push(t):r.set(a,[t])}}),!r.size)return n;for(let e of r.values())e.reverse();for(let t=0;t<e.length&&r.size;t++){if(n[t])continue;let i=e[t],a=r.get(i);a&&(n[t]=a.pop(),a.length||r.delete(i))}let i=this.selectedFeatureIndex,a=e[i],o=this.featureModels[t],s=null;for(let e of r.values())for(let t of e)t===o?s=t:t.destroy();return s&&(a&&!n[i]?(s.graphic=a,n[i]=s):s.destroy()),n}_updateFeatureModels(e){let{selectedFeature:t,features:n}=this;if(!n.length){this._destroyFeatureModels();return}let r={abilities:this.featureItemAbilities??this._defaultFeatureAbilities,actions:this.actions,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,includeDefaultActions:this.includeDefaultActions,spatialReference:this.spatialReference,location:this.location,map:this.map,view:this.view,timeZone:this.timeZone},i=this._reconcileFeatureModels(n,e);i.forEach(e=>e.set(r));let a=e=>{let t=n[e];t&&!i[e]&&(i[e]=new S({...r,graphic:t}))};if(t&&a(this.selectedFeatureIndex),(this.featurePage??0)>1||this.open&&(this.featureMenuOpen||this.initialDisplayMode===`list`)){let e=Math.min((this.featurePage??0)*this.featuresPerPage,n.length);for(let t=0;t<e;t++)a(t)}this._set(`featureModels`,i)}_cancelCenterAtLocation(){this._centerAtLocationController=i(this._centerAtLocationController)}_cancelFeatureStream(){this.removeHandles(O);let e=this._activeFeatureStream;this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._get(`featureStream`)===e&&this._set(`featureStream`,null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){let{spatialReference:t}=this,n=this.selectedFeature,i=n?.geometry?.type,a=this.location;if(i&&i!==`mesh`&&t&&a&&n){if(i===`point`){let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);if(e?.signal?.aborted||this.selectedFeature!==n||!n.geometry)return;this.location=t(n.geometry)}else try{let r=n.geometry,i=this._getHighlightLayer(n),o=n.getObjectId();if(!i||!this.view)return;if(o!=null){let n=this.view?.allLayerViews.find(e=>e.layer.uid===i.uid);if(!n||!(`queryFeatures`in n))return;let a=n.createQuery();a.outSpatialReference=t,a.objectIds=[o],a.returnGeometry=!0;let{features:s}=await n.queryFeatures(a,e);if(e?.signal?.aborted)return;r=s[0]?.geometry}if(!r||r.type===`mesh`)return;r=m(r,t),k??=await Promise.all([import(`../geometry/operators/intersectsOperator.js`),import(`../geometry/operators/proximityOperator.js`)]);let[{intersectsExecute:s},{proximityGetNearestCoordinate:c}]=k;if(!s(r,a)){let e=c(r,a).coordinate??a;this.selectedFeature===n&&(this.location=e)}}catch(e){s(e)||r.getLogger(this).error(e)}}}_cancelLocationUpdate(){this._locationUpdateController=i(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){let t=_(e),{layer:n}=e;return t&&`layer`in t&&t.layer?t.layer:t?.type===`map-notes`||t?.type===`sketch`||t?.type===`subtype-group`?t:n??t}_getHighlightLayerView(e,t){return t.type===`subtype-sublayer`&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,n){if(A(t.type,n))return e;let r=e.getObjectId();if(r!=null)return r;let i=t.type===`imagery`?void 0:`objectIdField`in t?t.objectIdField||v:null,a=e.attributes;return a&&i&&a[i]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);let n=this[t];if(!n)return;let{highlightEnabled:r,view:i,open:a}=this;if(!i||!r||!a)return;let o=this._getHighlightLayer(n);if(!o)return;let s=this._getHighlightLayerView(i,o);if(!s)return;this._highlightPromises[e]=s;let c=await s;if(!c||!E(c)||this._highlightPromises[e]!==s||!this[t]||!this.highlightEnabled)return;let l=c.highlight(this._getHighlightTarget(n,o,i.type));this.addHandles(l,e)}async _highlightActiveFeature(){return this._highlightFeature(`highlight-active-feature`,`activeFeature`)}async _highlightSelectedFeature(){return this._highlightFeature(`highlight-selected-feature`,`selectedFeature`)}async _consumeFeatureStream(e,t){if(e!==this._activeFeatureStream)return;let n=[],r=u(()=>{let t=n;n=[],e===this._activeFeatureStream&&t.length&&this._addFeatures(t)},16);this.addHandles({remove:()=>{r.remove(),n=[]}},O);try{for await(let i of e){if(e!==this._activeFeatureStream)return;let a=!this._featureStreamHasYielded;a&&(this.features=[]),t!==void 0&&(this.location=t,t=void 0),this._set(`pendingLocation`,null),a?(this._addFeatures([i]),e===this._activeFeatureStream&&(this._featureStreamHasYielded=!0)):(n.push(i),r())}}finally{this._activeFeatureStream===e&&r.forceUpdate(),this._activeFeatureStream===e&&(this.removeHandles(O),this._featureStreamHasYielded||(this.features=[]),this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._waitingForResultChange())}}_addFeatures(e){let{features:t}=this,n=new Set(t),r=e.filter(e=>!n.has(e)&&(n.add(e),!0));r.length&&(this.features=t.concat(r))}};e([d()],j.prototype,`_initialDisplayMode`,void 0),e([d()],j.prototype,`_activeFeatureStream`,void 0),e([d()],j.prototype,`_featureStreamHasYielded`,void 0),e([d({type:y})],j.prototype,`actions`,void 0),e([d({type:y,readOnly:!0})],j.prototype,`defaultActions`,null),e([d({readOnly:!0})],j.prototype,`active`,null),e([d()],j.prototype,`activeFeature`,void 0),e([d()],j.prototype,`aggregatedFeaturesEnabled`,void 0),e([d({value:null})],j.prototype,`content`,null),e([d({type:Boolean})],j.prototype,`defaultPopupTemplateEnabled`,void 0),e([d({readOnly:!0})],j.prototype,`diagnostics`,void 0),e([d({readOnly:!0})],j.prototype,`effectiveHeading`,null),e([d({readOnly:!0})],j.prototype,`featureCount`,null),e([d({value:null})],j.prototype,`featurePage`,null),e([d({value:[]})],j.prototype,`features`,null),e([d()],j.prototype,`featureStream`,null),e([d()],j.prototype,`featuresPerPage`,void 0),e([d()],j.prototype,`featureMenuOpen`,void 0),e([d({type:C})],j.prototype,`featureItemAbilities`,void 0),e([d({readOnly:!0})],j.prototype,`featureModels`,void 0),e([d()],j.prototype,`heading`,void 0),e([d()],j.prototype,`highlightEnabled`,void 0),e([d()],j.prototype,`includeDefaultActions`,void 0),e([d()],j.prototype,`initialDisplayMode`,null),e([d({type:p})],j.prototype,`location`,null),e([d()],j.prototype,`map`,null),e([d()],j.prototype,`open`,void 0),e([d({readOnly:!0})],j.prototype,`pendingLocation`,null),e([d({readOnly:!0})],j.prototype,`streamingFeatures`,null),e([d({value:null,readOnly:!0})],j.prototype,`selectedFeature`,null),e([d({value:-1})],j.prototype,`selectedFeatureIndex`,null),e([d({readOnly:!0})],j.prototype,`selectedFeatureItem`,null),e([d({type:h})],j.prototype,`spatialReference`,null),e([d({readOnly:!0})],j.prototype,`state`,null),e([d()],j.prototype,`timeZone`,null),e([d()],j.prototype,`updateLocationEnabled`,void 0),e([d()],j.prototype,`view`,void 0),e([d({readOnly:!0})],j.prototype,`waitingForContents`,null),e([d({readOnly:!0})],j.prototype,`waitingForResult`,null),e([d()],j.prototype,`zoomFactor`,void 0),j=e([f(`esri.popup.FeaturesModel`)],j);const M=j;export{M as default};
2
+ import{__decorate as e}from"tslib";import t from"../core/Error.js";import{EventedAccessor as n}from"../core/Evented.js";import r from"../core/Logger.js";import{abortMaybe as i}from"../core/maybe.js";import{debounce as a,logOnError as o,isAbortError as s}from"../core/promiseUtils.js";import{watch as c,when as l}from"../core/reactiveUtils.js";import{throttle as u}from"../core/throttle.js";import{property as d,subclass as f}from"../core/accessorSupport/decorators.js";import p from"../geometry/Point.js";import{project as m}from"../geometry/projectionUtils.js";import h from"../geometry/SpatialReference.js";import{geographicToWebMercator as g}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as _}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as v}from"../layers/LayerConstants.js";import{ActionsCollection as y,createDefaultActions as b}from"./actions.js";import{getSelectedTarget as x}from"./actionUtils.js";import S from"./FeatureModel.js";import C from"./support/FeatureAbilities.js";import{getHighlightLayer as w,getHighlightLayerView as T}from"./support/featureUtils.js";import{getDisplayedSymbol as E}from"../symbols/support/symbolUtils.js";import{system as D}from"../time/constants.js";import{highlightsSupported as O}from"../views/support/layerViewUtils.js";import{GoTo as k}from"../widgets/support/GoTo.js";const A=Symbol(`feature-stream-flush`);let j=null;function M(e,t){switch(e){case`building-scene`:case`map-image`:case`tile`:case`imagery`:return!0;case`imagery-tile`:return t===`2d`;default:return!1}}let N=class extends k(n){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new C,this._activeFeatureStream=null,this._featureStreamHasYielded=!1,this.actions=new y,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureModels=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=a(async()=>{this._cancelLocationUpdate();let e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([c(()=>this.view?.scale,()=>{this.open&&o(this._debouncedLocationUpdate(),r.getLogger(this))}),c(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),c(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),c(()=>this.location,e=>this._locationChange(e)),c(()=>!!this.view?.focusRegionVisible,()=>{this._initialDisplayMode===void 0&&this._syncSelectedFeatureIndex(this.features)}),c(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),c(()=>[this.featurePage,this.selectedFeatureIndex,this.featuresPerPage,this.featureMenuOpen,this.open,this.initialDisplayMode,this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.actions,this.defaultPopupTemplateEnabled,this.includeDefaultActions,this.features,this.map,this.spatialReference,this.timeZone],(e,t)=>this._updateFeatureModels(t?.[1]??-1),{initial:!0}),l(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._destroyFeatureModels(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get defaultActions(){let e=this._get(`defaultActions`)||new y;return e.removeAll(),e.addMany(this.selectedFeatureItem?.defaultActions.toArray()??b()),e}get active(){return this.open&&!this.waitingForResult}set content(e){this.featureStream=null,this._set(`diagnostics`,null),this.features=[],this._set(`content`,e)}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}get featurePage(){return this._get(`featurePage`)}set featurePage(e){e==null?this.featureCount||this._set(`featurePage`,null):!Number.isInteger(e)||e<1||e>Math.ceil(this.featureCount/this.featuresPerPage)||e!==1&&e!==(this.featurePage??0)+1||this._set(`featurePage`,e)}set features(e){if(this._get(`features`)===e)return;let t=e||[];this._set(`features`,t),this._activeFeatureStream&&t.length&&this.featurePage!=null||(this.featurePage=t.length?1:null),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get(`featureStream`)||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,n){this._set(`diagnostics`,n??null),this._get(`featureStream`)!==e&&(this._set(`featureStream`,e),this._cancelFeatureStream(),e&&(this._featureStreamHasYielded=!1,this._set(`pendingLocation`,t??null),this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionVisible?`list`:`feature`)}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){let t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?g(e):e;this._set(`location`,t)}get map(){return this.view?.map??null}set map(e){this._override(`map`,e)}get pendingLocation(){return this._get(`pendingLocation`)??null}get streamingFeatures(){return this._activeFeatureStream!=null}get selectedFeature(){return this.selectedFeatureIndex===-1?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){let e=this._get(`selectedFeatureIndex`);return typeof e==`number`?e:-1}set selectedFeatureIndex(e){let{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set(`selectedFeatureIndex`,e)}get selectedFeatureItem(){return this.featureModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override(`spatialReference`,e)}get state(){return this.view?this.view.ready?`ready`:`disabled`:this.map?`ready`:`disabled`}get timeZone(){return this.view?.timeZone??D}set timeZone(e){this._overrideIfSome(`timeZone`,e)}get waitingForContents(){return this.featureModels.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&!this._featureStreamHasYielded}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set(`diagnostics`,null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,n){let{view:r}=this;if(!r||!e)throw new t(`fetch-features:invalid-screenpoint-or-view`,`Cannot fetch features without a screen point/screen area and view.`,{screenPoint:e,view:r});let i={},a=r.fetchPopupFeatures(e,{diagnostics:i,pointerType:n?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:n?.signal});this._setFeatureStream(a,void 0,i)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){let{selectedFeatureIndex:t}=this,n=this._activeFeatureStream!=null&&e.length>0;this.initialDisplayMode===`list`?n||(this.selectedFeatureIndex=-1):n&&t===-1?this.selectedFeatureIndex=0:n&&t!==-1||(this.selectedFeatureIndex=e.length?0:-1)}_centerAtLocation(){let{view:e}=this,n=x(this);this._cancelCenterAtLocation();let i=new AbortController,{signal:a}=i;return this._centerAtLocationController=i,!n||!e?Promise.reject(new t(`center-at-location:invalid-target-or-view`,`Cannot center at a location without a target and view.`,{target:n,view:e})):this.callGoTo({target:{target:n,scale:e.scale},options:{signal:a}}).catch(e=>{s(e)||r.getLogger(this).error(e)})}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){let{selectedFeature:t,updateLocationEnabled:n,view:r}=this;r&&!this._locationUpdateController&&n&&e&&(!t||t.geometry)&&this._centerAtLocation()}async _selectedFeatureChange(e){let{location:t,updateLocationEnabled:n,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;let i=_(e)?.type;if((i===`map-image`||i===`imagery`||i===`imagery-tile`)&&(e.symbol=await E(e)),(n||!t)&&e.geometry){if(e.geometry.type===`point`){this.location=e.geometry;return}let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);this.location=t(e.geometry)}else if(n&&!e.geometry){await this._centerAtLocation();let e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureModels(){this.featureModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set(`featureModels`,[])}_reconcileFeatureModels(e,t){let n=[],r=new Map;if(this.featureModels.forEach((t,i)=>{let a=t?.graphic;if(!a||t.destroyed)t.destroy();else if(e[i]===a)n[i]=t;else{let e=r.get(a);e?e.push(t):r.set(a,[t])}}),!r.size)return n;for(let e of r.values())e.reverse();for(let t=0;t<e.length&&r.size;t++){if(n[t])continue;let i=e[t],a=r.get(i);a&&(n[t]=a.pop(),a.length||r.delete(i))}let i=this.selectedFeatureIndex,a=e[i],o=this.featureModels[t],s=null;for(let e of r.values())for(let t of e)t===o?s=t:t.destroy();return s&&(a&&!n[i]?(s.graphic=a,n[i]=s):s.destroy()),n}_updateFeatureModels(e){let{selectedFeature:t,features:n}=this;if(!n.length){this._destroyFeatureModels();return}let r={abilities:this.featureItemAbilities??this._defaultFeatureAbilities,actions:this.actions,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,includeDefaultActions:this.includeDefaultActions,spatialReference:this.spatialReference,location:this.location,map:this.map,view:this.view,timeZone:this.timeZone},i=this._reconcileFeatureModels(n,e);i.forEach(e=>e.set(r));let a=e=>{let t=n[e];t&&!i[e]&&(i[e]=new S({...r,graphic:t}))};if(t&&a(this.selectedFeatureIndex),(this.featurePage??0)>1||this.open&&(this.featureMenuOpen||this.initialDisplayMode===`list`)){let e=Math.min((this.featurePage??0)*this.featuresPerPage,n.length);for(let t=0;t<e;t++)a(t)}this._set(`featureModels`,i)}_cancelCenterAtLocation(){this._centerAtLocationController=i(this._centerAtLocationController)}_cancelFeatureStream(){this.removeHandles(A);let e=this._activeFeatureStream;this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._get(`featureStream`)===e&&this._set(`featureStream`,null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){let{spatialReference:t}=this,n=this.selectedFeature,i=n?.geometry?.type,a=this.location;if(i&&i!==`mesh`&&t&&a&&n){if(i===`point`){let{labelPointExecute:t}=await import(`../geometry/operators/labelPointOperator.js`);if(e?.signal?.aborted||this.selectedFeature!==n||!n.geometry)return;this.location=t(n.geometry)}else try{let r=n.geometry,i=this._getHighlightLayer(n),o=n.getObjectId();if(!i||!this.view)return;if(o!=null){let n=this.view?.allLayerViews.find(e=>e.layer.uid===i.uid);if(!n||!(`queryFeatures`in n))return;let a=n.createQuery();a.outSpatialReference=t,a.objectIds=[o],a.returnGeometry=!0;let{features:s}=await n.queryFeatures(a,e);if(e?.signal?.aborted)return;r=s[0]?.geometry}if(!r||r.type===`mesh`)return;r=m(r,t),j??=await Promise.all([import(`../geometry/operators/intersectsOperator.js`),import(`../geometry/operators/proximityOperator.js`)]);let[{intersectsExecute:s},{proximityGetNearestCoordinate:c}]=j;if(!s(r,a)){let e=c(r,a).coordinate??a;this.selectedFeature===n&&(this.location=e)}}catch(e){s(e)||r.getLogger(this).error(e)}}}_cancelLocationUpdate(){this._locationUpdateController=i(this._locationUpdateController)}_getHighlightLayer(e){return w(e,this.map)}_getHighlightTarget(e,t,n){if(M(t.type,n))return e;let r=e.getObjectId();if(r!=null)return r;let i=t.type===`imagery`?void 0:`objectIdField`in t?t.objectIdField||v:null,a=e.attributes;return a&&i&&a[i]||e}async _highlightFeature(e,t){this.removeHandles(e);let n=this[t];if(!n)return;let{highlightEnabled:r,view:i,open:a}=this;if(!i||!r||!a)return;let o=this._getHighlightLayer(n);if(!o)return;let s=T(i,o,this.map);if(!s)return;this._highlightPromises[e]=s;let c=await s;if(!c||!O(c)||this._highlightPromises[e]!==s||!this[t]||!this.highlightEnabled)return;let l=c.highlight(this._getHighlightTarget(n,o,i.type));this.addHandles(l,e)}async _highlightActiveFeature(){return this._highlightFeature(`highlight-active-feature`,`activeFeature`)}async _highlightSelectedFeature(){return this._highlightFeature(`highlight-selected-feature`,`selectedFeature`)}async _consumeFeatureStream(e,t){if(e!==this._activeFeatureStream)return;let n=[],r=u(()=>{let t=n;n=[],e===this._activeFeatureStream&&t.length&&this._addFeatures(t)},16);this.addHandles({remove:()=>{r.remove(),n=[]}},A);try{for await(let i of e){if(e!==this._activeFeatureStream)return;let a=!this._featureStreamHasYielded;a&&(this.features=[]),t!==void 0&&(this.location=t,t=void 0),this._set(`pendingLocation`,null),a?(this._addFeatures([i]),e===this._activeFeatureStream&&(this._featureStreamHasYielded=!0)):(n.push(i),r())}}finally{this._activeFeatureStream===e&&r.forceUpdate(),this._activeFeatureStream===e&&(this.removeHandles(A),this._featureStreamHasYielded||(this.features=[]),this._activeFeatureStream=null,this._set(`pendingLocation`,null),this._waitingForResultChange())}}_addFeatures(e){let{features:t}=this,n=new Set(t),r=e.filter(e=>!n.has(e)&&(n.add(e),!0));r.length&&(this.features=t.concat(r))}};e([d()],N.prototype,`_initialDisplayMode`,void 0),e([d()],N.prototype,`_activeFeatureStream`,void 0),e([d()],N.prototype,`_featureStreamHasYielded`,void 0),e([d({type:y})],N.prototype,`actions`,void 0),e([d({type:y,readOnly:!0})],N.prototype,`defaultActions`,null),e([d({readOnly:!0})],N.prototype,`active`,null),e([d()],N.prototype,`activeFeature`,void 0),e([d()],N.prototype,`aggregatedFeaturesEnabled`,void 0),e([d({value:null})],N.prototype,`content`,null),e([d({type:Boolean})],N.prototype,`defaultPopupTemplateEnabled`,void 0),e([d({readOnly:!0})],N.prototype,`diagnostics`,void 0),e([d({readOnly:!0})],N.prototype,`effectiveHeading`,null),e([d({readOnly:!0})],N.prototype,`featureCount`,null),e([d({value:null})],N.prototype,`featurePage`,null),e([d({value:[]})],N.prototype,`features`,null),e([d()],N.prototype,`featureStream`,null),e([d()],N.prototype,`featuresPerPage`,void 0),e([d()],N.prototype,`featureMenuOpen`,void 0),e([d({type:C})],N.prototype,`featureItemAbilities`,void 0),e([d({readOnly:!0})],N.prototype,`featureModels`,void 0),e([d()],N.prototype,`heading`,void 0),e([d()],N.prototype,`highlightEnabled`,void 0),e([d()],N.prototype,`includeDefaultActions`,void 0),e([d()],N.prototype,`initialDisplayMode`,null),e([d({type:p})],N.prototype,`location`,null),e([d()],N.prototype,`map`,null),e([d()],N.prototype,`open`,void 0),e([d({readOnly:!0})],N.prototype,`pendingLocation`,null),e([d({readOnly:!0})],N.prototype,`streamingFeatures`,null),e([d({value:null,readOnly:!0})],N.prototype,`selectedFeature`,null),e([d({value:-1})],N.prototype,`selectedFeatureIndex`,null),e([d({readOnly:!0})],N.prototype,`selectedFeatureItem`,null),e([d({type:h})],N.prototype,`spatialReference`,null),e([d({readOnly:!0})],N.prototype,`state`,null),e([d()],N.prototype,`timeZone`,null),e([d()],N.prototype,`updateLocationEnabled`,void 0),e([d()],N.prototype,`view`,void 0),e([d({readOnly:!0})],N.prototype,`waitingForContents`,null),e([d({readOnly:!0})],N.prototype,`waitingForResult`,null),e([d()],N.prototype,`zoomFactor`,void 0),N=e([f(`esri.popup.FeaturesModel`)],N);const P=N;export{P as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../core/Logger.js";import{replace as t}from"../../core/string.js";import{getGraphicLayer as n}from"../../graphic/graphicOriginUtils.js";import{formatDate as r,convertDateFormatToIntlOptions as i}from"../../intl/date.js";import{convertNumberFieldFormatToIntlOptions as a,convertNumberFormatToIntlOptions as o,formatNumber as s}from"../../intl/number.js";import{typesHaveUniqueIdsAndNames as c}from"../../layers/support/featureLayerUtils.js";import{fieldFormatFromFieldInfo as l}from"../../layers/support/fieldFormatUtils.js";import{isRasterPixelValueField as u,featureHasFields as d,isTimeOnlyField as f}from"../../layers/support/fieldUtils.js";import{getFieldConfigurationsContainer as p,getEffectiveLayerCapabilities as m}from"../../layers/support/layerUtils.js";import{formatAnyDate as h,isAnyDateField as g}from"../../smartMapping/support/utils.js";import{loadArcade as _}from"../../support/loadArcade.js";import{getTimeZoneFormattingOptions as v}from"../../time/timeZoneUtils.js";const y=()=>e.getLogger(`esri.popup.support.featureUtils`),b=/href=(""|'')/gi,ee=/(\{([^{\r\n]+)\})/g,te=/'/g,x=/^\s*expression\//i,ne=/(\n)/gi,re=/[\u00A0-\u9999<>&]/gim,ie=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,ae=/^(?:mailto:|tel:)/,S=`relationships/`,C=i(`short-date-short-time`);function oe(e){if(e!=null)return(e.sourceLayer||e.layer)??void 0}const se=new Set([`building`,`knowledge-graph`,`link-chart`,`map-image`,`map-notes`,`subtype-group`,`tile`]);function ce(e){let t=e?.origin;return(t==null?void 0:se.has(t.type??``)?t.sublayer:t.layer)??e?.layer}async function le({type:e,value:t,event:n}){try{return typeof t==`function`?t(n):await t}catch(r){y().error(`error`,`An error occurred when calling the "${e}" function`,{error:r,graphic:n.graphic,value:t});return}}function ue(e=``){if(e)return!ae.test(e.trim().toLowerCase())}function w(e){return e?x.test(e):!1}function T(e,t){if(!t||!w(t)||!e)return;let n=t.replace(x,``).toLowerCase();return e.find(({name:e})=>e.toLowerCase()===n)}function E(e){let{fieldInfo:t,graphic:n,layer:r}=e;return de({fieldInfo:t,graphic:n})?p(r,{graphic:n}):null}function de({fieldInfo:e,graphic:t}){return!!e?.fieldName&&!w(e.fieldName)&&!J(e.fieldName)&&!t?.popupTemplate}function fe({expressionInfos:e,fieldInfo:t,graphic:n,isContentFieldInfos:r,layer:i}){if(!t?.fieldName)return null;let a=T(e,t.fieldName);if(a)return a.title||null;let o=E({fieldInfo:t,graphic:n,layer:i});if(o){let e=o.getFieldAlias(t.fieldName);return r?t.label||e||t.fieldName:e||t.fieldName}return t.label||t.fieldName}function D(e){let{configurableFieldsContainer:t,fieldInfo:n,isContentFieldInfos:r}=e;if(!n?.fieldName)return null;let i=!t.popupTemplate&&!t.fieldConfigurations?l(n,t.getField(n.fieldName)):t.getFieldConfiguration(n.fieldName)?.fieldFormat;return r&&n.fieldFormat||i}function pe(e,t){return`{${t.get(e.toLowerCase())?.fieldName||e}}`}function me(e){return e.replaceAll(b,``)}function O(e,t){let n=k(t,e);return n?n.name:e}function he(e,t){return e&&e.map(e=>O(e,t))}function k(e,t){return!(e&&typeof e.getField==`function`)||!t?null:e.getField(t)??null}function A(e){return`${e}`.trim()}function ge({attributes:e,globalAttributes:t,layer:n,text:r,expressionAttributes:i,fieldInfoMap:a}){return r?j({formattedAttributes:t,template:I(r,{...t,...i,...e},n),fieldInfoMap:a}):``}function j({formattedAttributes:e,template:n,fieldInfoMap:r}){return A(me(t(t(n,e=>pe(e,r)),e)))}function M(e,t,n=!1){let r=t[e];typeof r==`string`&&(t[e]=(n?encodeURIComponent(r):r).replaceAll(te,`%27`))}function N(e,t=!1){let n={...e};return Object.keys(n).forEach(e=>M(e,n,t)),n}function P(e,n,r){n=A(n);let i=n&&!n.startsWith(`{`);return t(e,N(r,i||!1))}function F(e,t){return e.replaceAll(ee,(e,n,r)=>{let i=k(t,r);return i?`{${i.name}}`:n})}function I(e,t,n){let r=F(e,n);return r&&r.replaceAll(ie,(e,n,r)=>P(e,n||r,t))}function L(e,t){let n=t?.fieldFormat?.type===`number`||t?.format&&t.format.dateFormat==null&&(t.format.places!=null||t.format.digitSeparator!=null);if(typeof e==`string`&&n){let t=Number(e);if(!isNaN(t))return t}return e}function R(e){return typeof e==`object`&&!!e&&`fieldsIndex`in e&&`geometryType`in e&&`getField`in e&&`load`in e&&`loaded`in e&&`objectIdField`in e&&`spatialReference`in e&&`type`in e&&(e.type===`feature`||e.type===`scene`||e.type===`subtype-group`||e.type===`subtype-sublayer`||e.type===`sublayer`)&&`when`in e}function z(e){return typeof e==`object`&&!!e&&`createQuery`in e&&`queryFeatureCount`in e&&`queryObjectIds`in e&&`queryRelatedFeatures`in e&&`queryRelatedFeaturesCount`in e&&`relationships`in e}function B(e){return R(e)&&z(e)}function _e(e){return e&&typeof e==`object`&&`createQuery`in e&&`getField`in e&&`queryFeatureCount`in e&&`queryFeatures`in e&&`queryObjectIds`in e&&`capabilities`in e&&`fields`in e&&`fieldsIndex`in e&&`type`in e&&(e.type===`feature`||e.type===`subtype-group`||e.type===`subtype-sublayer`||e.type===`sublayer`)&&`when`in e?e.type===`subtype-sublayer`&&`parent`in e&&e.parent&&typeof e.parent==`object`?`globalIdField`in e.parent:`globalIdField`in e:!1}function ve(e){return!e||typeof e!=`object`?!1:B(n(e))}function V(e,t){let{fieldInfos:n,fieldName:r,graphic:i,isContentFieldInfos:c,layer:l,preventPlacesFormatting:d,timeZone:f}=t,p=U(n,r),m=E({fieldInfo:p,graphic:i,layer:l}),g=k(m||l,r),_=m?null:p?.format,v=m?D({configurableFieldsContainer:m,fieldInfo:p,isContentFieldInfos:c}):null,y=v?.type===`number`;if(p&&!u(r)){let t=g?.type,n=v?.type===`date-time`,r=_?.dateFormat;if(t===`date`||t===`date-only`||t===`time-only`||t===`timestamp-offset`||n||r)return h(e,{format:n?void 0:r,fieldFormat:n?v:void 0,fieldType:t,timeZoneOptions:{layerTimeZone:l&&`preferredTimeZone`in l?l.preferredTimeZone:null,viewTimeZone:f,datesInUnknownTimezone:l&&`datesInUnknownTimezone`in l?!!l.datesInUnknownTimezone:!1}})}if(typeof e==`string`&&u(r)&&_)return ye(e,_);if(e=L(e,{format:y?void 0:_,fieldFormat:y?v:void 0}),typeof e==`string`||e==null||_==null&&v==null)return G(e);let b=y?a(v):_?o(_):void 0;return d?s(e,{...b,minimumFractionDigits:0,maximumFractionDigits:20}):s(e,b)}function ye(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(`,`)?H(e,`,`,`, `,t):e.includes(`;`)?H(e,`;`,`; `,t):e.includes(` `)?H(e,` `,` `,t):s(Number(e),o(t))}function H(e,t,n,r){return e.trim().split(t).map(e=>s(Number(e),o(r))).join(n)}function U(e,t){if(e?.length&&t)return e.find(e=>e.fieldName?.toLowerCase()===t.toLowerCase())}function be({fieldName:e,graphic:t,layer:n}){if(J(e)||!n||typeof n.getFeatureType!=`function`)return null;let{typeIdField:r}=n;if(!r||e!==r)return null;let i=n.getFeatureType(t);return i?i.name:null}function xe({fieldName:e,value:t,graphic:n,layer:r}){if(J(e)||!r||typeof r.getFieldDomain!=`function`)return null;let i=n&&r.getFieldDomain(e,{feature:n});return!i||i.type!==`coded-value`?null:i.getName(t)}function Se(e,t,n,i){let{creatorField:a,creationDateField:o,editorField:s,editDateField:c}=e;if(!t)return;let l=v(i&&`preferredTimeZone`in i?i.preferredTimeZone:null,i&&`datesInUnknownTimezone`in i?!!i.datesInUnknownTimezone:!1,n,C,`date`),u={...C,...l},d=t[c];if(typeof d==`number`){let e=t[s];return{type:`edit`,date:r(d,u),user:e}}let f=t[o];if(typeof f==`number`){let e=t[a];return{type:`create`,date:r(f,u),user:e}}return null}function W(e,t){let n=new Map;if(!e)return n;for(let r of e){if(!r.fieldName)continue;let e=O(r.fieldName,t);r.fieldName=e,n.set(e.toLowerCase(),r)}return n}function Ce(e){let t=[];if(!e)return t;let{fieldInfos:n,content:r}=e;return n&&t.push(...n),!r||!Array.isArray(r)||r.forEach(e=>{if(e.type===`fields`){let n=e?.fieldInfos;n&&t.push(...n)}}),t}function we(e){return e.replaceAll(re,e=>`&#${e.charCodeAt(0)};`)}function G(e){return typeof e==`string`?e.replaceAll(ne,`<br class="esri-text-new-line" />`):e}function K(e){let{fieldInfoMap:t,fieldInfos:n,fieldName:r,graphic:i,isContentFieldInfos:a,layer:o,timeZone:s,value:l}=e;if(l==null)return``;let u=xe({fieldName:r,value:l,graphic:i,layer:o});if(u)return u;let d=o?.types&&c(o.types)?be({fieldName:r,graphic:i,layer:o}):null;if(d)return d;if(t.get(r.toLowerCase()))return V(l,{fieldInfos:n||Array.from(t.values()),fieldName:r,graphic:i,isContentFieldInfos:a,layer:o,timeZone:s});let p=o?.fieldsIndex?.get(r);return p&&(g(p)||f(p))?h(l,{fieldType:p.type,timeZoneOptions:{layerTimeZone:o&&`preferredTimeZone`in o?o.preferredTimeZone:null,viewTimeZone:s,datesInUnknownTimezone:o&&`datesInUnknownTimezone`in o?!!o.datesInUnknownTimezone:!1}}):G(l)}function Te({attributes:e,fieldInfoMap:t,fieldInfos:n,graphic:r,isContentFieldInfos:i,layer:a,relatedInfos:o,timeZone:s}){let c={};return o?.forEach(e=>Ae({attributes:c,relatedInfo:e,fieldInfoMap:t,fieldInfos:n,layer:a,timeZone:s})),e&&Object.keys(e).forEach(o=>{let l=e[o];c[o]=K({fieldInfoMap:t,fieldInfos:n,fieldName:o,graphic:r,isContentFieldInfos:i,layer:a,timeZone:s,value:l})}),c}async function q(e,t){let{layer:n,graphic:r,outFields:i,objectIds:a,returnGeometry:o,spatialReference:s}=e,c=a[0];if(typeof c!=`number`&&typeof c!=`string`){let e={layer:n,graphic:r,objectId:c,requiredFields:i};return y().warn(`Could not query required fields for the specified feature. The feature's ID is invalid.`,e),null}if(!m(n)?.operations?.supportsQuery){let e={layer:n,graphic:r,requiredFields:i,returnGeometry:o};return y().warn(`The specified layer cannot be queried. The following fields will not be available.`,e),null}let l=n.createQuery();return l.objectIds=a,l.outFields=i?.length?i:[n.objectIdField],l.returnGeometry=!!o,l.returnZ=!!o,l.returnM=!!o,l.outSpatialReference=s,(await n.queryFeatures(l,t)).features[0]}async function Ee(e){if(!e.expressionInfos?.length)return!1;let{arcadeUtils:{hasGeometryFunctions:t}}=await _();return t(e)}async function De(e){if(!e.expressionInfos?.length)return!1;let{arcadeUtils:{requiresTrack:t}}=await _();return t(e)}async function Oe({graphic:e,popupTemplate:t,layer:n,spatialReference:r},i){if(!n||!t||(typeof n.load==`function`&&await n.load(i),!e.attributes))return;let a=n.objectIdField,o=e.attributes[a];if(o==null)return;let s=[o],c=new Set(await t.getRequiredFields(n.fieldsIndex));n.timeInfo?.trackIdField!=null&&!c.has(n.timeInfo.trackIdField)&&await De(t)&&c.add(n.timeInfo.trackIdField);let l=d(e,c),u=l?[]:c.has(a)?[...c]:[...c,a],f=t.returnGeometry||await Ee(t);if(l&&!f)return;let p=await q({layer:n,graphic:e,outFields:u,objectIds:s,returnGeometry:f,spatialReference:r},i);p&&(p.geometry&&(e.geometry=p.geometry),p.attributes&&(e.attributes={...e.attributes,...p.attributes}))}function J(e=``){return e?e.includes(S):!1}function ke(e){return e?`${S}${e.layerId}/${e.fieldName}`:``}function Y({attributes:e,graphic:t,relatedInfo:n,fieldInfos:r,fieldInfoMap:i,layer:a,timeZone:o}){e&&t&&n&&Object.keys(t.attributes).forEach(s=>{let c=ke({layerId:n.relation.id.toString(),fieldName:s}),l=t.attributes[s];e[c]=K({fieldName:c,fieldInfos:r,fieldInfoMap:i,layer:a,value:l,graphic:t,timeZone:o})})}function Ae({attributes:e,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a}){e&&t&&(t.relatedFeatures?.forEach(o=>Y({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})),t.relatedStatsFeatures?.forEach(o=>Y({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})))}const X=e=>{if(!e)return!1;let t=e.toUpperCase();return t.includes(`CURRENT_TIMESTAMP`)||t.includes(`CURRENT_DATE`)||t.includes(`CURRENT_TIME`)},Z=({layer:e,method:t,query:n,definitionExpression:r})=>{if(!e.capabilities?.query?.supportsCacheHint||t===`attachments`)return;let i=n.where==null?null:n.where,a=n.geometry==null?null:n.geometry;e.capabilities.query.supportsCacheHint&&!X(r)&&!X(i)&&a?.type!==`extent`&&n.resultType!==`tile`&&(n.cacheHint=!0)},je=({query:e,layer:t,method:n})=>{Z({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??``}`})},Me=({queryPayload:e,layer:t,method:n})=>{Z({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??``}`})};function Ne(e,t,n){return!e||!t||!n?null:t.type===`sublayer`?$({layers:t.layer?.allSublayers,map:e,relatedLayer:t,relationship:n})||$({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:n}):$({layers:e.allLayers,map:e,relatedLayer:t,relationship:n})||$({layers:e.allTables,map:e,relatedLayer:t,relationship:n})}function Pe(e,t){return!e||!(`utilityNetworks`in e)||!t?null:e.utilityNetworks?.find(e=>e.isUtilityLayer(t))}function Q(e,t){return e?.allTables.find(e=>e.type===`feature`&&e.layerId===t.id&&e.url===t.layer?.url)}function $({map:e,relationship:t,relationship:{relatedTableId:n},relatedLayer:r,layers:i}){if(!i)return null;for(let a of i){if(a.type===`map-image`){let n=$({layers:a.sublayers,map:e,relatedLayer:r,relationship:t})||$({layers:a.subtables,map:e,relatedLayer:r,relationship:t});if(n)return n;continue}if(!B(a))continue;if(r.type===`sublayer`){if(a!==r&&a.id===n)return a.isTable?Q(e,a):a;continue}let i=r.type===`scene`&&r.associatedLayer?r.associatedLayer.url:r.url;if(!i)return null;if(a.type===`sublayer`){if(a!==r&&a.layer?.url===i&&a.id===n)return a.isTable?Q(e,a):a}else if(a!==r&&a.url===i&&a.layerId===n)return a}return null}export{G as applyTextFormattingHTML,W as createFieldInfoMap,Ne as findRelatedLayer,Pe as findUtilityNetwork,F as fixTokens,Te as formatAttributes,Se as formatEditInfo,V as formatValueToFieldInfo,Ce as getAllFieldInfos,E as getConfigurableFieldsContainer,D as getFieldFormat,U as getFieldInfo,fe as getFieldInfoLabel,O as getFixedFieldName,he as getFixedFieldNames,ce as getPopupLayer,oe as getSourceLayer,le as graphicCallback,we as htmlEntities,_e as isAssociatedFeatureSupportedLayer,w as isExpressionField,R as isFeatureSupportedLayer,ve as isGraphicForRelatableFeatureSupportedLayer,B as isRelatableFeatureSupportedLayer,z as isRelatableLayer,J as isRelatedField,je as preLayerQueryCallback,Me as preRequestCallback,q as querySourceLayer,Oe as queryUpdatedFeature,ue as shouldOpenInNewTab,j as substituteAttributes,ge as substituteFieldsInLinksAndAttributes};
2
+ import e from"../../core/Logger.js";import{replace as t}from"../../core/string.js";import{getGraphicLayer as n}from"../../graphic/graphicOriginUtils.js";import{formatDate as r,convertDateFormatToIntlOptions as i}from"../../intl/date.js";import{convertNumberFieldFormatToIntlOptions as a,convertNumberFormatToIntlOptions as o,formatNumber as s}from"../../intl/number.js";import{typesHaveUniqueIdsAndNames as c}from"../../layers/support/featureLayerUtils.js";import{fieldFormatFromFieldInfo as l}from"../../layers/support/fieldFormatUtils.js";import{isRasterPixelValueField as u,featureHasFields as d,isTimeOnlyField as f}from"../../layers/support/fieldUtils.js";import{getFieldConfigurationsContainer as p,getEffectiveLayerCapabilities as m}from"../../layers/support/layerUtils.js";import{formatAnyDate as h,isAnyDateField as g}from"../../smartMapping/support/utils.js";import{loadArcade as _}from"../../support/loadArcade.js";import{getTimeZoneFormattingOptions as v}from"../../time/timeZoneUtils.js";const y=()=>e.getLogger(`esri.popup.support.featureUtils`),b=/href=(""|'')/gi,ee=/(\{([^{\r\n]+)\})/g,te=/'/g,x=/^\s*expression\//i,ne=/(\n)/gi,re=/[\u00A0-\u9999<>&]/gim,ie=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,ae=/^(?:mailto:|tel:)/,S=`relationships/`,C=i(`short-date-short-time`);function oe(e){if(e!=null)return(e.sourceLayer||e.layer)??void 0}const se=new Set([`building`,`knowledge-graph`,`link-chart`,`map-image`,`map-notes`,`subtype-group`,`tile`]);function ce(e){let t=e?.origin;return(t==null?void 0:se.has(t.type??``)?t.sublayer:t.layer)??e?.layer}function le(e,t){let r=n(e);r&&`layer`in r&&r.layer&&(r=r.layer);let i=r?.type===`subtype-sublayer`?r.parent:r;return i&&t?.allLayers.includes(i)?r:e.layer??r}function ue(e,t,n){let r=t.type===`subtype-sublayer`&&t.parent&&n?.allLayers?.includes(t.parent)?t.parent:n?.allLayers?.includes(t)?t:null;return r?e.when().then(()=>e.whenLayerView(r)):null}async function w({type:e,value:t,event:n}){try{return typeof t==`function`?t(n):await t}catch(r){y().error(`error`,`An error occurred when calling the "${e}" function`,{error:r,graphic:n.graphic,value:t});return}}function T(e=``){if(e)return!ae.test(e.trim().toLowerCase())}function E(e){return e?x.test(e):!1}function de(e,t){if(!t||!E(t)||!e)return;let n=t.replace(x,``).toLowerCase();return e.find(({name:e})=>e.toLowerCase()===n)}function D(e){let{fieldInfo:t,graphic:n,layer:r}=e;return fe({fieldInfo:t,graphic:n})?p(r,{graphic:n}):null}function fe({fieldInfo:e,graphic:t}){return!!e?.fieldName&&!E(e.fieldName)&&!J(e.fieldName)&&!t?.popupTemplate}function pe({expressionInfos:e,fieldInfo:t,graphic:n,isContentFieldInfos:r,layer:i}){if(!t?.fieldName)return null;let a=de(e,t.fieldName);if(a)return a.title||null;let o=D({fieldInfo:t,graphic:n,layer:i});if(o){let e=o.getFieldAlias(t.fieldName);return r?t.label||e||t.fieldName:e||t.fieldName}return t.label||t.fieldName}function O(e){let{configurableFieldsContainer:t,fieldInfo:n,isContentFieldInfos:r}=e;if(!n?.fieldName)return null;let i=!t.popupTemplate&&!t.fieldConfigurations?l(n,t.getField(n.fieldName)):t.getFieldConfiguration(n.fieldName)?.fieldFormat;return r&&n.fieldFormat||i}function me(e,t){return`{${t.get(e.toLowerCase())?.fieldName||e}}`}function he(e){return e.replaceAll(b,``)}function k(e,t){let n=A(t,e);return n?n.name:e}function ge(e,t){return e&&e.map(e=>k(e,t))}function A(e,t){return!(e&&typeof e.getField==`function`)||!t?null:e.getField(t)??null}function j(e){return`${e}`.trim()}function M({attributes:e,globalAttributes:t,layer:n,text:r,expressionAttributes:i,fieldInfoMap:a}){return r?N({formattedAttributes:t,template:_e(r,{...t,...i,...e},n),fieldInfoMap:a}):``}function N({formattedAttributes:e,template:n,fieldInfoMap:r}){return j(he(t(t(n,e=>me(e,r)),e)))}function P(e,t,n=!1){let r=t[e];typeof r==`string`&&(t[e]=(n?encodeURIComponent(r):r).replaceAll(te,`%27`))}function F(e,t=!1){let n={...e};return Object.keys(n).forEach(e=>P(e,n,t)),n}function I(e,n,r){n=j(n);let i=n&&!n.startsWith(`{`);return t(e,F(r,i||!1))}function L(e,t){return e.replaceAll(ee,(e,n,r)=>{let i=A(t,r);return i?`{${i.name}}`:n})}function _e(e,t,n){let r=L(e,n);return r&&r.replaceAll(ie,(e,n,r)=>I(e,n||r,t))}function ve(e,t){let n=t?.fieldFormat?.type===`number`||t?.format&&t.format.dateFormat==null&&(t.format.places!=null||t.format.digitSeparator!=null);if(typeof e==`string`&&n){let t=Number(e);if(!isNaN(t))return t}return e}function R(e){return typeof e==`object`&&!!e&&`fieldsIndex`in e&&`geometryType`in e&&`getField`in e&&`load`in e&&`loaded`in e&&`objectIdField`in e&&`spatialReference`in e&&`type`in e&&(e.type===`feature`||e.type===`scene`||e.type===`subtype-group`||e.type===`subtype-sublayer`||e.type===`sublayer`)&&`when`in e}function z(e){return typeof e==`object`&&!!e&&`createQuery`in e&&`queryFeatureCount`in e&&`queryObjectIds`in e&&`queryRelatedFeatures`in e&&`queryRelatedFeaturesCount`in e&&`relationships`in e}function B(e){return R(e)&&z(e)}function ye(e){return e&&typeof e==`object`&&`createQuery`in e&&`getField`in e&&`queryFeatureCount`in e&&`queryFeatures`in e&&`queryObjectIds`in e&&`capabilities`in e&&`fields`in e&&`fieldsIndex`in e&&`type`in e&&(e.type===`feature`||e.type===`subtype-group`||e.type===`subtype-sublayer`||e.type===`sublayer`)&&`when`in e?e.type===`subtype-sublayer`&&`parent`in e&&e.parent&&typeof e.parent==`object`?`globalIdField`in e.parent:`globalIdField`in e:!1}function be(e){return!e||typeof e!=`object`?!1:B(n(e))}function V(e,t){let{fieldInfos:n,fieldName:r,graphic:i,isContentFieldInfos:c,layer:l,preventPlacesFormatting:d,timeZone:f}=t,p=U(n,r),m=D({fieldInfo:p,graphic:i,layer:l}),g=A(m||l,r),_=m?null:p?.format,v=m?O({configurableFieldsContainer:m,fieldInfo:p,isContentFieldInfos:c}):null,y=v?.type===`number`;if(p&&!u(r)){let t=g?.type,n=v?.type===`date-time`,r=_?.dateFormat;if(t===`date`||t===`date-only`||t===`time-only`||t===`timestamp-offset`||n||r)return h(e,{format:n?void 0:r,fieldFormat:n?v:void 0,fieldType:t,timeZoneOptions:{layerTimeZone:l&&`preferredTimeZone`in l?l.preferredTimeZone:null,viewTimeZone:f,datesInUnknownTimezone:l&&`datesInUnknownTimezone`in l?!!l.datesInUnknownTimezone:!1}})}if(typeof e==`string`&&u(r)&&_)return xe(e,_);if(e=ve(e,{format:y?void 0:_,fieldFormat:y?v:void 0}),typeof e==`string`||e==null||_==null&&v==null)return G(e);let b=y?a(v):_?o(_):void 0;return d?s(e,{...b,minimumFractionDigits:0,maximumFractionDigits:20}):s(e,b)}function xe(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(`,`)?H(e,`,`,`, `,t):e.includes(`;`)?H(e,`;`,`; `,t):e.includes(` `)?H(e,` `,` `,t):s(Number(e),o(t))}function H(e,t,n,r){return e.trim().split(t).map(e=>s(Number(e),o(r))).join(n)}function U(e,t){if(e?.length&&t)return e.find(e=>e.fieldName?.toLowerCase()===t.toLowerCase())}function Se({fieldName:e,graphic:t,layer:n}){if(J(e)||!n||typeof n.getFeatureType!=`function`)return null;let{typeIdField:r}=n;if(!r||e!==r)return null;let i=n.getFeatureType(t);return i?i.name:null}function W({fieldName:e,value:t,graphic:n,layer:r}){if(J(e)||!r||typeof r.getFieldDomain!=`function`)return null;let i=n&&r.getFieldDomain(e,{feature:n});return!i||i.type!==`coded-value`?null:i.getName(t)}function Ce(e,t,n,i){let{creatorField:a,creationDateField:o,editorField:s,editDateField:c}=e;if(!t)return;let l=v(i&&`preferredTimeZone`in i?i.preferredTimeZone:null,i&&`datesInUnknownTimezone`in i?!!i.datesInUnknownTimezone:!1,n,C,`date`),u={...C,...l},d=t[c];if(typeof d==`number`){let e=t[s];return{type:`edit`,date:r(d,u),user:e}}let f=t[o];if(typeof f==`number`){let e=t[a];return{type:`create`,date:r(f,u),user:e}}return null}function we(e,t){let n=new Map;if(!e)return n;for(let r of e){if(!r.fieldName)continue;let e=k(r.fieldName,t);r.fieldName=e,n.set(e.toLowerCase(),r)}return n}function Te(e){let t=[];if(!e)return t;let{fieldInfos:n,content:r}=e;return n&&t.push(...n),!r||!Array.isArray(r)||r.forEach(e=>{if(e.type===`fields`){let n=e?.fieldInfos;n&&t.push(...n)}}),t}function Ee(e){return e.replaceAll(re,e=>`&#${e.charCodeAt(0)};`)}function G(e){return typeof e==`string`?e.replaceAll(ne,`<br class="esri-text-new-line" />`):e}function K(e){let{fieldInfoMap:t,fieldInfos:n,fieldName:r,graphic:i,isContentFieldInfos:a,layer:o,timeZone:s,value:l}=e;if(l==null)return``;let u=W({fieldName:r,value:l,graphic:i,layer:o});if(u)return u;let d=o?.types&&c(o.types)?Se({fieldName:r,graphic:i,layer:o}):null;if(d)return d;if(t.get(r.toLowerCase()))return V(l,{fieldInfos:n||Array.from(t.values()),fieldName:r,graphic:i,isContentFieldInfos:a,layer:o,timeZone:s});let p=o?.fieldsIndex?.get(r);return p&&(g(p)||f(p))?h(l,{fieldType:p.type,timeZoneOptions:{layerTimeZone:o&&`preferredTimeZone`in o?o.preferredTimeZone:null,viewTimeZone:s,datesInUnknownTimezone:o&&`datesInUnknownTimezone`in o?!!o.datesInUnknownTimezone:!1}}):G(l)}function De({attributes:e,fieldInfoMap:t,fieldInfos:n,graphic:r,isContentFieldInfos:i,layer:a,relatedInfos:o,timeZone:s}){let c={};return o?.forEach(e=>Me({attributes:c,relatedInfo:e,fieldInfoMap:t,fieldInfos:n,layer:a,timeZone:s})),e&&Object.keys(e).forEach(o=>{let l=e[o];c[o]=K({fieldInfoMap:t,fieldInfos:n,fieldName:o,graphic:r,isContentFieldInfos:i,layer:a,timeZone:s,value:l})}),c}async function q(e,t){let{layer:n,graphic:r,outFields:i,objectIds:a,returnGeometry:o,spatialReference:s}=e,c=a[0];if(typeof c!=`number`&&typeof c!=`string`){let e={layer:n,graphic:r,objectId:c,requiredFields:i};return y().warn(`Could not query required fields for the specified feature. The feature's ID is invalid.`,e),null}if(!m(n)?.operations?.supportsQuery){let e={layer:n,graphic:r,requiredFields:i,returnGeometry:o};return y().warn(`The specified layer cannot be queried. The following fields will not be available.`,e),null}let l=n.createQuery();return l.objectIds=a,l.outFields=i?.length?i:[n.objectIdField],l.returnGeometry=!!o,l.returnZ=!!o,l.returnM=!!o,l.outSpatialReference=s,(await n.queryFeatures(l,t)).features[0]}async function Oe(e){if(!e.expressionInfos?.length)return!1;let{arcadeUtils:{hasGeometryFunctions:t}}=await _();return t(e)}async function ke(e){if(!e.expressionInfos?.length)return!1;let{arcadeUtils:{requiresTrack:t}}=await _();return t(e)}async function Ae({graphic:e,popupTemplate:t,layer:n,spatialReference:r},i){if(!n||!t||(typeof n.load==`function`&&await n.load(i),!e.attributes))return;let a=n.objectIdField,o=e.attributes[a];if(o==null)return;let s=[o],c=new Set(await t.getRequiredFields(n.fieldsIndex));n.timeInfo?.trackIdField!=null&&!c.has(n.timeInfo.trackIdField)&&await ke(t)&&c.add(n.timeInfo.trackIdField);let l=d(e,c),u=l?[]:c.has(a)?[...c]:[...c,a],f=t.returnGeometry||await Oe(t);if(l&&!f)return;let p=await q({layer:n,graphic:e,outFields:u,objectIds:s,returnGeometry:f,spatialReference:r},i);p&&(p.geometry&&(e.geometry=p.geometry),p.attributes&&(e.attributes={...e.attributes,...p.attributes}))}function J(e=``){return e?e.includes(S):!1}function je(e){return e?`${S}${e.layerId}/${e.fieldName}`:``}function Y({attributes:e,graphic:t,relatedInfo:n,fieldInfos:r,fieldInfoMap:i,layer:a,timeZone:o}){e&&t&&n&&Object.keys(t.attributes).forEach(s=>{let c=je({layerId:n.relation.id.toString(),fieldName:s}),l=t.attributes[s];e[c]=K({fieldName:c,fieldInfos:r,fieldInfoMap:i,layer:a,value:l,graphic:t,timeZone:o})})}function Me({attributes:e,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a}){e&&t&&(t.relatedFeatures?.forEach(o=>Y({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})),t.relatedStatsFeatures?.forEach(o=>Y({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})))}const X=e=>{if(!e)return!1;let t=e.toUpperCase();return t.includes(`CURRENT_TIMESTAMP`)||t.includes(`CURRENT_DATE`)||t.includes(`CURRENT_TIME`)},Z=({layer:e,method:t,query:n,definitionExpression:r})=>{if(!e.capabilities?.query?.supportsCacheHint||t===`attachments`)return;let i=n.where==null?null:n.where,a=n.geometry==null?null:n.geometry;e.capabilities.query.supportsCacheHint&&!X(r)&&!X(i)&&a?.type!==`extent`&&n.resultType!==`tile`&&(n.cacheHint=!0)},Ne=({query:e,layer:t,method:n})=>{Z({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??``}`})},Pe=({queryPayload:e,layer:t,method:n})=>{Z({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??``}`})};function Fe(e,t,n){return!e||!t||!n?null:t.type===`sublayer`?$({layers:t.layer?.allSublayers,map:e,relatedLayer:t,relationship:n})||$({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:n}):$({layers:e.allLayers,map:e,relatedLayer:t,relationship:n})||$({layers:e.allTables,map:e,relatedLayer:t,relationship:n})}function Ie(e,t){return!e||!(`utilityNetworks`in e)||!t?null:e.utilityNetworks?.find(e=>e.isUtilityLayer(t))}function Q(e,t){return e?.allTables.find(e=>e.type===`feature`&&e.layerId===t.id&&e.url===t.layer?.url)}function $({map:e,relationship:t,relationship:{relatedTableId:n},relatedLayer:r,layers:i}){if(!i)return null;for(let a of i){if(a.type===`map-image`){let n=$({layers:a.sublayers,map:e,relatedLayer:r,relationship:t})||$({layers:a.subtables,map:e,relatedLayer:r,relationship:t});if(n)return n;continue}if(!B(a))continue;if(r.type===`sublayer`){if(a!==r&&a.id===n)return a.isTable?Q(e,a):a;continue}let i=r.type===`scene`&&r.associatedLayer?r.associatedLayer.url:r.url;if(!i)return null;if(a.type===`sublayer`){if(a!==r&&a.layer?.url===i&&a.id===n)return a.isTable?Q(e,a):a}else if(a!==r&&a.url===i&&a.layerId===n)return a}return null}export{G as applyTextFormattingHTML,we as createFieldInfoMap,Fe as findRelatedLayer,Ie as findUtilityNetwork,L as fixTokens,De as formatAttributes,Ce as formatEditInfo,V as formatValueToFieldInfo,Te as getAllFieldInfos,D as getConfigurableFieldsContainer,O as getFieldFormat,U as getFieldInfo,pe as getFieldInfoLabel,k as getFixedFieldName,ge as getFixedFieldNames,le as getHighlightLayer,ue as getHighlightLayerView,ce as getPopupLayer,oe as getSourceLayer,w as graphicCallback,Ee as htmlEntities,ye as isAssociatedFeatureSupportedLayer,E as isExpressionField,R as isFeatureSupportedLayer,be as isGraphicForRelatableFeatureSupportedLayer,B as isRelatableFeatureSupportedLayer,z as isRelatableLayer,J as isRelatedField,Ne as preLayerQueryCallback,Pe as preRequestCallback,q as querySourceLayer,Ae as queryUpdatedFeature,T as shouldOpenInNewTab,N as substituteAttributes,M as substituteFieldsInLinksAndAttributes};