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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (435) hide show
  1. package/Map.js +1 -1
  2. package/analysis/ElevationProfileAnalysis.js +1 -1
  3. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
  4. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +4 -0
  5. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +5 -0
  6. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +1 -0
  7. package/applications/KnowledgeStudio/generalSharedKgUtils.js +1 -1
  8. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +2 -0
  9. package/applications/KnowledgeStudio/layerInternalAccessUtils.js +1 -1
  10. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  11. package/assets/components/assets/sort-handle/t9n/messages.uk.json +1 -1
  12. package/assets/esri/core/workers/RemoteClient.js +1 -1
  13. package/assets/esri/core/workers/chunks/020c8913d8e35d63080b.js +1 -0
  14. package/assets/esri/core/workers/chunks/02e69f0c63d97661da60.js +1 -0
  15. package/assets/esri/core/workers/chunks/06ba43843e9c4988049b.js +1 -0
  16. package/assets/esri/core/workers/chunks/087973e7c4fea5fcfa5e.js +1 -0
  17. package/assets/esri/core/workers/chunks/{388482cea4b9fdeaf06e.js → 0f30a9514571c7be9978.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{929ece362604dc301229.js → 17acde0245ecd956306c.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{14ace5dc4b8984212a57.js → 17d5f8dba6ebb1184506.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{651b9144abb1895cc510.js → 1e848d9da1c61a27cf18.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{8cea114168d849c38b1b.js → 20278683bddc8c2d8136.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{00aa85ae6419aad183ea.js → 22d6b8102e75bdef204c.js} +1 -1
  23. package/assets/esri/core/workers/chunks/279366e6b743f9680603.js +1 -0
  24. package/assets/esri/core/workers/chunks/285762ff92d5388b6024.js +1 -0
  25. package/assets/esri/core/workers/chunks/{4f01be74dd26e639330f.js → 2f24017e72d41c259faa.js} +1 -1
  26. package/assets/esri/core/workers/chunks/36b1f47d70b57d79df7b.js +1 -0
  27. package/assets/esri/core/workers/chunks/{3d65b8a2fbe1df050a25.js → 377a66034e7c1bad5599.js} +1 -1
  28. package/assets/esri/core/workers/chunks/37f2ef14399546e697e6.js +1 -0
  29. package/assets/esri/core/workers/chunks/{0f9bb3187306f89e3d63.js → 398f356b11fd33bd3831.js} +1 -1
  30. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
  31. package/assets/esri/core/workers/chunks/{f7c99e9c8d19352af38d.js → 3ac7562ea90f91a9f30c.js} +1 -1
  32. package/assets/esri/core/workers/chunks/3f3d492f1093b7832aab.js +1 -0
  33. package/assets/esri/core/workers/chunks/4442817beb7a76c95770.js +1 -0
  34. package/assets/esri/core/workers/chunks/464d42bebb365287808d.js +1 -0
  35. package/assets/esri/core/workers/chunks/4c5a7249a311070d8f43.js +1 -0
  36. package/assets/esri/core/workers/chunks/{d570c75a425aa29672c8.js → 4d599008e1ea42321b37.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{c0feec6e2f0e45900ae0.js → 53bd8996e8812f1ad7b2.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{9a723d739ac44b45432c.js → 557960763695abee4a83.js} +1 -1
  39. package/assets/esri/core/workers/chunks/5bd36dbf46c25bd961c8.js +1 -0
  40. package/assets/esri/core/workers/chunks/{b7a17927e14f502006b4.js → 5ea0c62016d56990787b.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{2ea6985da4eb0107bb9d.js → 5fc7b61f467f1d60a284.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{a87521ebe632bf783ef4.js → 62a49cfd9a2508950e9f.js} +1 -1
  43. package/assets/esri/core/workers/chunks/67d9cfe02613cb73ee37.js.LICENSE.txt +1 -1
  44. package/assets/esri/core/workers/chunks/{ec13053af1999701464a.js → 6826fe54562dcdc054d7.js} +1 -1
  45. package/assets/esri/core/workers/chunks/6c3b99209d542efa64d4.js +1 -0
  46. package/assets/esri/core/workers/chunks/{8215015f11221a354273.js → 6d049182bec34a22abcd.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{309c5f69ea06f3081d83.js → 73487b9d85e726e9c012.js} +1 -1
  48. package/assets/esri/core/workers/chunks/7413e582bc2b16af6a0f.js +1 -0
  49. package/assets/esri/core/workers/chunks/{3d22fe2f2c40abbc246e.js → 7461124454bfb4fb6474.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{147ad5fdd02f46b6da24.js → 7544316a75dbd981aea6.js} +1 -1
  51. package/assets/esri/core/workers/chunks/75bf27271a31e26e1b21.js +1 -0
  52. package/assets/esri/core/workers/chunks/{630efe10c871425b6a95.js → 76ae1702fecc7ad7017c.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{de1f75c907152df7e788.js → 794748fd1edc29a621cd.js} +1 -1
  54. package/assets/esri/core/workers/chunks/79dbfa2b9b332ca0002f.js +1 -0
  55. package/assets/esri/core/workers/chunks/7a23ab84e1144f081c92.js +1 -0
  56. package/assets/esri/core/workers/chunks/7aaaebbabee27690283c.js +1 -0
  57. package/assets/esri/core/workers/chunks/7c4a63aeead2505d6f02.js +1 -0
  58. package/assets/esri/core/workers/chunks/{2a5f331c0f18d8574b4e.js → 811d4c46c75cf6a63e78.js} +1 -1
  59. package/assets/esri/core/workers/chunks/8372f142c4d7a65c7954.js +1 -0
  60. package/assets/esri/core/workers/chunks/{d84373a6ec94dcfec8c2.js → 88074189fa10c335370b.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{dc31865edea480f0ebba.js → 8833c3d168951be4bf20.js} +1 -1
  62. package/assets/esri/core/workers/chunks/883ffaa69b3e6eb158bf.js +1 -0
  63. package/assets/esri/core/workers/chunks/{85622fe99f4d08afe875.js → 8a314b3790313e6dc5db.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{b0b2670596d6d8c32b5e.js → 8c056eac35d05d9524b7.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{0086a09441627842d34a.js → 8f3503b2fb6cd38757b9.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{1a713dcc9971e1935401.js → 8f56f298e7c1a283f407.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{dabc5a38a472c9719df9.js → 8ffd4710d168c2fcfd96.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{b2add7338258ca7c24dd.js → 90250e9239c173aace88.js} +1 -1
  69. package/assets/esri/core/workers/chunks/90b2b43b8b54c9a1ec35.js +1 -0
  70. package/assets/esri/core/workers/chunks/90f8b4bda28af43ea019.js +1 -0
  71. package/assets/esri/core/workers/chunks/{89027f6800e17fab8973.js → 9486032af3e934d85582.js} +1 -1
  72. package/assets/esri/core/workers/chunks/95c594a87b732f5c4979.js +1 -0
  73. package/assets/esri/core/workers/chunks/9786f91455350eaae493.js +1 -0
  74. package/assets/esri/core/workers/chunks/99859dce1925b406ccd0.js +1 -0
  75. package/assets/esri/core/workers/chunks/9c5cbf8810f37b1a4718.js +1 -0
  76. package/assets/esri/core/workers/chunks/9e8dceef4c961f56940d.js +1 -0
  77. package/assets/esri/core/workers/chunks/9fac5a12e878cd745354.js +1 -0
  78. package/assets/esri/core/workers/chunks/a06bac9b8f9e18874de8.js +316 -0
  79. package/assets/esri/core/workers/chunks/a091623bbfb3d771c8d8.js +1 -0
  80. package/assets/esri/core/workers/chunks/{01642fe19e81bfa33eb5.js → a395373e3173e6458a56.js} +1 -1
  81. package/assets/esri/core/workers/chunks/a3991ae8caa713d4ddcd.js +1 -0
  82. package/assets/esri/core/workers/chunks/{135e270b4f03c4270870.js → a4db5c9a90107e097df8.js} +1 -1
  83. package/assets/esri/core/workers/chunks/a712cdff78fc826acd8c.js +1 -0
  84. package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js.LICENSE.txt +1 -1
  85. package/assets/esri/core/workers/chunks/aa54b6f2aba6952af149.js +1 -0
  86. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  87. package/assets/esri/core/workers/chunks/ac26e3e77df4302f47a2.js +1 -0
  88. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
  89. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js → b017bac40dc8328013e3.js} +2 -2
  90. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js.LICENSE.txt → b017bac40dc8328013e3.js.LICENSE.txt} +1 -1
  91. package/assets/esri/core/workers/chunks/{bc3bcf88b252760e2574.js → b3028b1ff75eafd0c358.js} +1 -1
  92. package/assets/esri/core/workers/chunks/b59f9c3f7a149214256f.js +1 -0
  93. package/assets/esri/core/workers/chunks/b96eb0ea506379182d62.js +2 -0
  94. package/assets/esri/core/workers/chunks/{24921d31efa8d222ad2d.js.LICENSE.txt → b96eb0ea506379182d62.js.LICENSE.txt} +1 -1
  95. package/assets/esri/core/workers/chunks/{b5863afafd3a7d2d5c05.js → bb5484b5eeacc9ad2ceb.js} +3 -3
  96. package/assets/esri/core/workers/chunks/bb56717c4e36f28d4c08.js +1 -0
  97. package/assets/esri/core/workers/chunks/bb7976e2f883b544add6.js +1 -0
  98. package/assets/esri/core/workers/chunks/{5875a51b97ee9bd438a0.js → bc241c7735e4efba734a.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{56916e56c20465428dd4.js → be3b874f86f627f4fa98.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{0eaa4dccba0d844b9da3.js → c3ddcf9148dd2640c402.js} +1 -1
  101. package/assets/esri/core/workers/chunks/c476643002387f60ea42.js +1 -0
  102. package/assets/esri/core/workers/chunks/c4e4da69969499a89a2c.js +1 -0
  103. package/assets/esri/core/workers/chunks/c8733cd621105afab2ac.js +1 -0
  104. package/assets/esri/core/workers/chunks/ccc0da0e01f023c8aa1f.js +1 -0
  105. package/assets/esri/core/workers/chunks/cd1930f08e1fc8b30b14.js +1 -0
  106. package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
  107. package/assets/esri/core/workers/chunks/d048e4926e78458afa3e.js +1 -0
  108. package/assets/esri/core/workers/chunks/d1fe816b6990918c13c7.js +1 -0
  109. package/assets/esri/core/workers/chunks/d305a21666b1ed5bf33d.js +1 -0
  110. package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
  111. package/assets/esri/core/workers/chunks/d40f57f9fc47f9a9f97c.js +1 -0
  112. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  113. package/assets/esri/core/workers/chunks/d97fadbc69e055d183a0.js +1 -0
  114. package/assets/esri/core/workers/chunks/dedc4583b5f32a278124.js +1 -0
  115. package/assets/esri/core/workers/chunks/e31192ae920e3e19b6aa.js +1 -0
  116. package/assets/esri/core/workers/chunks/{e5bcc44f3dc6fc90835a.js → e5a06ce0ef6a9a90e100.js} +1 -1
  117. package/assets/esri/core/workers/chunks/e82f5437bd66779c6740.js +1 -0
  118. package/assets/esri/core/workers/chunks/f0e0a63962784acb4ba1.js +1 -0
  119. package/assets/esri/core/workers/chunks/{039ec0fbe3b4b398b8c6.js → f26dc1d83beed63b6045.js} +1 -1
  120. package/assets/esri/core/workers/chunks/{fa5c87889c2f0bef896b.js → f35aaa04cca676c2d3f8.js} +1 -1
  121. package/assets/esri/core/workers/chunks/f4d0ae6be1b3984228d0.js +1 -0
  122. package/assets/esri/core/workers/chunks/{7c5c272612198db83851.js → f5e47eea8720ba84665b.js} +1 -1
  123. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  124. package/assets/esri/core/workers/chunks/{fa4411e0a5ac3fcba365.js → f65c0102af17390a50ac.js} +1 -1
  125. package/assets/esri/core/workers/chunks/f6c11c8ac687de3ef1ab.js +1 -0
  126. package/assets/esri/core/workers/chunks/f6c8beb60f6d29945a2e.js +1 -0
  127. package/assets/esri/core/workers/chunks/f746e3f7ebff2bbdf333.js +1 -0
  128. package/assets/esri/core/workers/chunks/f9324e88c359c03f35aa.js +1 -0
  129. package/assets/esri/core/workers/chunks/{cfa3164e7fa1884dc2b9.js → facb3886714222772ab2.js} +1 -1
  130. package/assets/esri/core/workers/chunks/fd2efd1d1cf9d95a87e6.js +1 -0
  131. package/assets/esri/core/workers/chunks/{fe3f95fda29e4844b153.js → fe77ae6cf232a7a3298e.js} +1 -1
  132. package/assets/esri/core/workers/chunks/{2ce4a0fe4fae63c43a81.js → ff35a077ac6776469805.js} +1 -1
  133. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  134. package/assets/esri/themes/base/widgets/_Directions.scss +17 -18
  135. package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +14 -4
  136. package/assets/esri/themes/dark/main.css +1 -1
  137. package/assets/esri/themes/light/main.css +1 -1
  138. package/assets/esri/themes/light/view.css +1 -1
  139. package/chunks/ComponentShader.glsl.js +72 -39
  140. package/chunks/OITBlend.glsl.js +3 -3
  141. package/chunks/bundle.js +1 -1
  142. package/config.js +1 -1
  143. package/core/Identifiable.js +1 -1
  144. package/core/MultiOriginJSONSupport.js +1 -1
  145. package/core/NumericIdentifiable.js +5 -0
  146. package/core/QueueProcessor.js +1 -1
  147. package/core/WriteableMultiOriginJSONMixin.js +5 -0
  148. package/core/has.js +1 -1
  149. package/core/performance.js +5 -0
  150. package/core/sanitizerUtils.js +1 -1
  151. package/core/scheduling.js +1 -1
  152. package/core/workers/Connection.js +1 -1
  153. package/core/workers/WorkerHandle.js +1 -1
  154. package/core/workers/utils.js +1 -1
  155. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  156. package/geohash/GeohashCell.js +1 -1
  157. package/geohash/geohashUtils.js +1 -1
  158. package/geometry/GeometryCursor.js +1 -1
  159. package/geometry/geometryCursorCollectUtils.js +1 -1
  160. package/geometry/libtess.js +1 -1
  161. package/geometry/support/jsonUtils.js +1 -1
  162. package/geometry/support/normalizeUtilsSync.js +1 -1
  163. package/geometry/support/triangulationUtils.js +1 -1
  164. package/interfaces.d.ts +444 -349
  165. package/intl/date.js +1 -1
  166. package/intl.d.ts +2 -0
  167. package/intl.js +1 -1
  168. package/kernel.js +1 -1
  169. package/layers/FeatureLayer.js +1 -1
  170. package/layers/graphics/OptimizedFeature.js +1 -1
  171. package/layers/graphics/OptimizedGeometry.js +1 -1
  172. package/layers/graphics/centroid.js +1 -1
  173. package/layers/graphics/contains.js +1 -1
  174. package/layers/graphics/data/AttributesBuilder.js +1 -1
  175. package/layers/graphics/data/FeatureStore.js +1 -1
  176. package/layers/graphics/data/QueryEngine.js +1 -1
  177. package/layers/graphics/data/QueryEngineResult.js +1 -1
  178. package/layers/graphics/data/geometryUtils.js +1 -1
  179. package/layers/graphics/data/spatialQuerySupport.js +1 -1
  180. package/layers/graphics/featureConversionUtils.js +1 -1
  181. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  182. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  183. package/layers/graphics/sources/geojson/geojson.js +1 -1
  184. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  185. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  186. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  187. package/layers/knowledgeGraph/layerUtils.js +1 -1
  188. package/layers/mixins/ArcGISImageService.js +1 -1
  189. package/layers/mixins/ImageryTileMixin.js +1 -1
  190. package/layers/support/MediaElementBase.js +1 -1
  191. package/layers/support/PixelBlock.js +1 -1
  192. package/layers/support/RasterInfo.js +1 -1
  193. package/layers/support/RasterJobHandler.js +1 -1
  194. package/layers/support/RasterSensorInfo.js +1 -1
  195. package/layers/support/RasterStorageInfo.js +1 -1
  196. package/layers/support/RasterWorker.js +1 -1
  197. package/layers/support/TitleCreator.js +1 -1
  198. package/layers/support/arcgisLayerUrl.js +1 -1
  199. package/layers/support/capabilities.js +1 -1
  200. package/layers/support/fieldUtils.js +1 -1
  201. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  202. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  203. package/layers/support/rasterFieldUtils.js +1 -1
  204. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  205. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  206. package/package.json +5 -5
  207. package/request.js +1 -1
  208. package/rest/print.js +1 -1
  209. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  210. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  211. package/rest/query/operations/query.js +1 -1
  212. package/rest/query/operations/queryZScale.js +1 -1
  213. package/rest/versionManagement/getVersionInfos.js +1 -1
  214. package/smartMapping/statistics/histogram.js +1 -1
  215. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  216. package/smartMapping/support/utils.js +1 -1
  217. package/support/basemapDefinitions.js +1 -1
  218. package/support/elevationInfoUtils.js +1 -1
  219. package/support/requestImageUtils.js +1 -1
  220. package/support/revision.js +1 -1
  221. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  222. package/undoredo/support/Services.js +1 -1
  223. package/views/2d/GoToManager.js +1 -1
  224. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  225. package/views/2d/constraints/GeometryConstraint.js +1 -1
  226. package/views/2d/constraints/RotationConstraint.js +1 -1
  227. package/views/2d/constraints/ZoomConstraint.js +1 -1
  228. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  229. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  230. package/views/2d/engine/webgl/Mesh2D.js +1 -1
  231. package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
  232. package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
  233. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  234. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  235. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  236. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  237. package/views/2d/layers/features/aggregation/GridCell.js +1 -1
  238. package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
  239. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  240. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  241. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  242. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  243. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  244. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  245. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  246. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  247. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  248. package/views/2d/layers/features/support/FeatureFilterEvaluator.js +1 -1
  249. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  250. package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
  251. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  252. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  253. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  254. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  255. package/views/3d/FocusAreasView.js +1 -1
  256. package/views/3d/GroundView3D.js +1 -1
  257. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  258. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  259. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  260. package/views/3d/glTF/DefaultLoadingContext.js +1 -1
  261. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  262. package/views/3d/layers/FlowSubView3D.js +1 -1
  263. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  264. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  265. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  266. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  267. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  268. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  269. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  270. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  271. package/views/3d/layers/graphics/pipeline/featureSet/PBFPointFeatureSetView.js +1 -1
  272. package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
  273. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  274. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  275. package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
  276. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  277. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  278. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  279. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  280. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  281. package/views/3d/layers/support/lyr3dTypeConversions.js +1 -1
  282. package/views/3d/state/ViewStateManager.js +1 -1
  283. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  284. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  285. package/views/3d/state/controllers/RotateController.js +1 -1
  286. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  287. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  288. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  289. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  290. package/views/3d/state/utils/navigationUtils.js +1 -1
  291. package/views/3d/support/DisplayQualityProfile.js +1 -1
  292. package/views/3d/support/QualitySettings.js +1 -1
  293. package/views/3d/support/StreamDataLoader.js +1 -1
  294. package/views/3d/support/engineContent/line.js +1 -1
  295. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  296. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  297. package/views/3d/support/flow/FlowWorker.js +1 -1
  298. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  299. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  300. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  301. package/views/3d/support/flow/constants.js +1 -1
  302. package/views/3d/support/hitTest.js +1 -1
  303. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  304. package/views/3d/terrain/OverlayRenderer.js +1 -1
  305. package/views/3d/terrain/Tile.js +1 -1
  306. package/views/3d/terrain/TileOverlayData.js +1 -1
  307. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  308. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  309. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  310. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  311. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  312. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +7 -7
  313. package/views/3d/webgl-engine/core/shaderModules/BooleanDrawUniform.js +5 -0
  314. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConstructionContext.js +1 -1
  315. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  316. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  317. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  318. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  319. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +4 -4
  320. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  321. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  322. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  323. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  324. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  325. package/views/analysis/ElevationProfile/constants.js +1 -1
  326. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  327. package/views/draw/support/Reshape.js +1 -1
  328. package/views/draw/support/reshapeUtils.js +1 -1
  329. package/views/interactive/dragEventPipeline.js +1 -1
  330. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  331. package/views/support/Scheduler.js +1 -1
  332. package/views/webgl/ShaderBuilder.js +1 -1
  333. package/views/webgl/Texture.js +1 -1
  334. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  335. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  336. package/widgets/BatchAttributeForm.js +1 -1
  337. package/widgets/Directions/css.js +1 -1
  338. package/widgets/Directions.js +1 -1
  339. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  340. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  341. package/widgets/Editor/EditorViewModel.js +1 -1
  342. package/widgets/Editor/Edits.js +1 -1
  343. package/widgets/Editor/MergeFeaturesWorkflow.d.ts +4 -0
  344. package/widgets/Editor/MergeFeaturesWorkflow.js +5 -0
  345. package/widgets/Editor/MergeFeaturesWorkflowData.d.ts +4 -0
  346. package/widgets/Editor/MergeFeaturesWorkflowData.js +5 -0
  347. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  348. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  349. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  350. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  351. package/widgets/Editor/components/UploadDetails.js +1 -1
  352. package/widgets/Editor/support/EditorItem.js +1 -1
  353. package/widgets/Editor/support/mergeFeaturesUtils.js +5 -0
  354. package/widgets/Editor/workflowUtils.js +1 -1
  355. package/widgets/Editor.js +1 -1
  356. package/widgets/Feature/FeatureExpression.js +1 -1
  357. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  358. package/widgets/Feature/FeatureFields.js +1 -1
  359. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  360. package/widgets/Feature/FeatureMedia.js +1 -1
  361. package/widgets/Feature/FeatureViewModel.js +1 -1
  362. package/widgets/Feature/support/featureUtils.js +1 -1
  363. package/widgets/Feature.js +1 -1
  364. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  365. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  366. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  367. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  368. package/widgets/Print.js +1 -1
  369. package/widgets/Search/LayerSearchSource.js +1 -1
  370. package/widgets/UtilityNetworkTrace.js +1 -1
  371. package/widgets/support/ColorPicker.js +1 -1
  372. package/widgets/support/SelectionList/LayerItem.js +1 -1
  373. package/widgets/support/jsxWidgetSupport.js +1 -1
  374. package/assets/esri/core/workers/chunks/0429c1a3690f20647c9f.js +0 -1
  375. package/assets/esri/core/workers/chunks/065f2bbcaeef1f13fd48.js +0 -1
  376. package/assets/esri/core/workers/chunks/0731e588afd1f561ec3b.js +0 -1
  377. package/assets/esri/core/workers/chunks/188272af9a6470ccfe31.js +0 -1
  378. package/assets/esri/core/workers/chunks/18da83afbc324fef9fd8.js +0 -316
  379. package/assets/esri/core/workers/chunks/1a9f544f20f643161a36.js +0 -1
  380. package/assets/esri/core/workers/chunks/1cfcadaa98ac528fea37.js +0 -1
  381. package/assets/esri/core/workers/chunks/1db0bf570a04687b3130.js +0 -1
  382. package/assets/esri/core/workers/chunks/24921d31efa8d222ad2d.js +0 -2
  383. package/assets/esri/core/workers/chunks/2a900a632a1231deb713.js +0 -1
  384. package/assets/esri/core/workers/chunks/31c6e951b99315e8e68a.js +0 -1
  385. package/assets/esri/core/workers/chunks/35491fbdd287470d40a4.js +0 -1
  386. package/assets/esri/core/workers/chunks/36247c6f6fc2891df2cf.js +0 -1
  387. package/assets/esri/core/workers/chunks/3d53307efbc3f07d7bf2.js +0 -1
  388. package/assets/esri/core/workers/chunks/40b81d1c2d53cf598b8e.js +0 -1
  389. package/assets/esri/core/workers/chunks/42a72e1d963e4636323b.js +0 -1
  390. package/assets/esri/core/workers/chunks/456161a323be7d640c61.js +0 -1
  391. package/assets/esri/core/workers/chunks/500d09d2191127371081.js +0 -1
  392. package/assets/esri/core/workers/chunks/50864c1924030e62497d.js +0 -1
  393. package/assets/esri/core/workers/chunks/5707713c2f27588b9194.js +0 -1
  394. package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +0 -1
  395. package/assets/esri/core/workers/chunks/5718cf135e105e1e026b.js +0 -1
  396. package/assets/esri/core/workers/chunks/5c585b338a9e9aa0e205.js +0 -1
  397. package/assets/esri/core/workers/chunks/5d1d909354c90cb8eb60.js +0 -1
  398. package/assets/esri/core/workers/chunks/5ea03f53d4d64d9e7cae.js +0 -1
  399. package/assets/esri/core/workers/chunks/63019a7eb5222dc5e420.js +0 -1
  400. package/assets/esri/core/workers/chunks/64629ddcf008349eaf41.js +0 -1
  401. package/assets/esri/core/workers/chunks/64ee8d2acae2d6fce608.js +0 -1
  402. package/assets/esri/core/workers/chunks/6fcacfcb3d83515c37c9.js +0 -1
  403. package/assets/esri/core/workers/chunks/72ecf49d03bb24bf0998.js +0 -1
  404. package/assets/esri/core/workers/chunks/7421f9575487cdc9e28e.js +0 -1
  405. package/assets/esri/core/workers/chunks/77a11d7d53325d108ed8.js +0 -1
  406. package/assets/esri/core/workers/chunks/7a05b1f6163112bc9db2.js +0 -1
  407. package/assets/esri/core/workers/chunks/7d9882ddfa6495f72baa.js +0 -1
  408. package/assets/esri/core/workers/chunks/7fffad8ff6878fa1fd56.js +0 -1
  409. package/assets/esri/core/workers/chunks/81bbe5251ed13c0d91cc.js +0 -1
  410. package/assets/esri/core/workers/chunks/8b16aa50d879b92a5375.js +0 -1
  411. package/assets/esri/core/workers/chunks/8bc64fc7c4b9eb8fca4d.js +0 -1
  412. package/assets/esri/core/workers/chunks/8bfa19c24be0e3f3fd74.js +0 -1
  413. package/assets/esri/core/workers/chunks/8eefa133c36a004c054c.js +0 -1
  414. package/assets/esri/core/workers/chunks/9834bc11586a2d8d6f35.js +0 -1
  415. package/assets/esri/core/workers/chunks/9c6fc4fe2c46f40d63d9.js +0 -1
  416. package/assets/esri/core/workers/chunks/a5f25104938ab33e7a85.js +0 -1
  417. package/assets/esri/core/workers/chunks/a7bd294996e6c8b8354a.js +0 -1
  418. package/assets/esri/core/workers/chunks/abf4f018c692c18c3320.js +0 -1
  419. package/assets/esri/core/workers/chunks/b1f667006cba60ef4aa7.js +0 -1
  420. package/assets/esri/core/workers/chunks/b2d9f4e057af26a538fb.js +0 -1
  421. package/assets/esri/core/workers/chunks/b62807c6fcfb70a87cd4.js +0 -1
  422. package/assets/esri/core/workers/chunks/b8339c1d60847a9eed3e.js +0 -1
  423. package/assets/esri/core/workers/chunks/bc6619307f312f9241bf.js +0 -1
  424. package/assets/esri/core/workers/chunks/bfc1e8aec7aace3ff30e.js +0 -1
  425. package/assets/esri/core/workers/chunks/c362fbbafec91c44eeb2.js +0 -1
  426. package/assets/esri/core/workers/chunks/c368a8e8d2f1535af446.js +0 -1
  427. package/assets/esri/core/workers/chunks/c941d15190fc08523d0d.js +0 -1
  428. package/assets/esri/core/workers/chunks/cc70a4a915b0b2ccb2a0.js +0 -1
  429. package/assets/esri/core/workers/chunks/d121045cddbe55c2ecb2.js +0 -1
  430. package/assets/esri/core/workers/chunks/d2120a623b1bd91b9ed9.js +0 -1
  431. package/assets/esri/core/workers/chunks/d78c2833cdc4730a88a3.js +0 -1
  432. package/assets/esri/core/workers/chunks/df438b62702007267798.js +0 -1
  433. package/assets/esri/core/workers/chunks/f4eb090bcc3eca64306a.js +0 -1
  434. package/assets/esri/core/workers/chunks/f7846523adacbfe5047e.js +0 -1
  435. package/assets/esri/core/workers/chunks/f839b86bee15deaf84e4.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{equals as a,isSome as i}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import{deprecatedProperty as o}from"../../core/deprecate.js";import n from"../../core/Error.js";import{EventedMixin as c}from"../../core/Evented.js";import{makeHandle as l}from"../../core/handleUtils.js";import{equalsShallow as h}from"../../core/lang.js";import u from"../../core/Logger.js";import{clamp as d}from"../../core/mathUtils.js";import{abortMaybe as m,destroyMaybe as p}from"../../core/maybe.js";import{EsriPromise as g}from"../../core/Promise.js";import{isAbortError as y,throwIfAborted as v,waitTick as w}from"../../core/promiseUtils.js";import f from"../../core/ReactiveMap.js";import{whenOnce as F,on as _,watch as b,syncAndInitial as M,initial as I}from"../../core/reactiveUtils.js";import{sqlAnd as P}from"../../core/sql.js";import{getMetersPerUnitForSR as V}from"../../core/unitUtils.js";import{property as S}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as k}from"../../core/accessorSupport/decorators/subclass.js";import{isSerializable as A}from"../../core/support/jsonUtils.js";import{UpdatingHandles as C}from"../../core/support/UpdatingHandles.js";import L from"../../geometry/Extent.js";import{union as G}from"../../geometry/geometryEngineAsync.js";import R from"../../geometry/Multipoint.js";import T from"../../geometry/Point.js";import O from"../../geometry/Polygon.js";import j from"../../geometry/Polyline.js";import{projectWithZConversion as B}from"../../geometry/projectionUtils.js";import H from"../../geometry/SpatialReference.js";import{polygonCentroidPoint as x}from"../../geometry/support/centroid.js";import{isClockwise as E}from"../../geometry/support/coordsUtils.js";import{normalizeMapX as D}from"../../geometry/support/normalizeUtils.js";import{geographicToWebMercator as z}from"../../geometry/support/webMercatorUtils.js";import U from"../../layers/GraphicsLayer.js";import N from"../../layers/MediaLayer.js";import{searchImages as W,getSortedLayerFeatures as q}from"../../layers/orientedImagery/queries.js";import{calculateSuitabilities as $}from"../../layers/orientedImagery/core/bestImageUtils.js";import{createCoveragePolygon as J,computePolygonForInspection as Z,resizePolygon as K,checkIfPolygonContainsSelectedPoint as Q}from"../../layers/orientedImagery/core/coverageUtils.js";import{isElevationSource as X}from"../../layers/orientedImagery/core/ElevationSourceDefinitions.js";import{convertGeographicToWebMercator as Y}from"../../layers/orientedImagery/core/utils.js";import{imageToWorld as ee,imageToWorldPanoramic as te}from"../../layers/orientedImagery/transformations/imageToWorld.js";import ae from"../../layers/orientedImagery/transformations/updateElevation.js";import{getElevationSampler as ie}from"../../layers/orientedImagery/transformations/updateElevationUtils.js";import{or as re,getInitialAngle as se,convertPixelToHeadingPitch as oe,convertHeadingPitchToSphereVertex as ne,getImageToWorldProperties as ce,getUpdateElevationProps as le,isElevationSampler as he,getImageToWorldPanoramicProperties as ue,pointToArray as de,transformGraphicCoordinatesToPixel as me,getWorldToImageProperties as pe}from"../../layers/orientedImagery/transformations/utils.js";import{worldToImage as ge,worldToImagePanoramic as ye}from"../../layers/orientedImagery/transformations/worldToImage.js";import ve from"../../layers/support/ExtentAndRotationGeoreference.js";import{getFloorFilterClause as we}from"../../layers/support/floorFilterUtils.js";import fe from"../../layers/support/VideoElement.js";import Fe from"../../views/MapView.js";import _e from"../../views/draw/Draw.js";import{scale as be}from"../../views/draw/support/drawUtils.js";import{ViewEventPriorities as Me}from"../../views/input/InputManager.js";import Ie from"../PanoramicVideoViewer.js";import Pe from"../PanoramicViewer.js";import{defaultAngleThresholdInDegrees as Ve,videoExtent as Se,invalidCameraHeading as ke,sectorsInOrder as Ae,sampleExtent as Ce,sectorsRadii as Le}from"./constants.js";import{configureSketchTool as Ge,extractFieldsFromDataCaptureLayer as Re,isValidDataCaptureLayer as Te,constructGraphicFromImageGeometry as Oe}from"./dataCaptureUtils.js";import{isFeatureAttachment as je,getImageSourceFromAttachment as Be}from"./galleryUtils.js";import{getModeCorrectedPoint as He,calculateCorrectedPixel as xe,getUnitRateFromSpatialReference as Ee,calculateHeightFromTemporaryDistance as De,computeTriangulatedVector as ze,computeTriangulatedPoint as Ue}from"./imageMeasurementUtils.js";import{crossSymbol as Ne,crossSymbol3D as We,measurementPolygonSymbol as qe,polylineSymbolPanoramic as $e,measurementPolylineSymbol as Je,cameraOverlaySymbol3D as Ze,cameraOverlaySymbol as Ke,diamondSymbol as Qe,diamondSymbol3D as Xe,locationSymbol as Ye,locationSymbol3D as et,activeSourcePointSymbol as tt,sourcePointSymbol as at}from"./symbols.js";import{isNoAttachmentError as it,getContentType as rt,isTifOrMrf as st,filterOILLayerView as ot,assignElevationSampleToFeatures as nt,calculateDirection as ct,calculateSegment as lt,isSceneView as ht,isGraphic as ut}from"./utils.js";import{disableVideoZoomAndPan as dt}from"./videoViewerUtils.js";import mt from"./components/ImageViewer.js";import pt from"./components/NavigationNode.js";import gt from"./components/OrientedImageryVideoViewModel.js";import{NoActiveViewerError as yt,NoFeatureFoundWithObjectIdError as vt}from"./navigation/errors.js";import{queryFeatureByObjectIds as wt}from"./navigation/queries.js";import{ImageMeasurementService as ft}from"./services/ImageMeasurementService.js";import Ft from"../Sketch/SketchViewModel.js";const _t={click:"view-click",imageClick:"image-click",triangularImageClick:"triangular-click",interactionHandles:"interaction-handles",hittestHandles:"hittest-handles",videoPlayerHandles:"video-handles",activeViewerCursorHandles:"active-viewer-cursor-handles",imageViewerCursorHandles:"image-viewer-cursor-handles"},bt=new Set(["JPG","JPEG","TIFF","TIF","MRF"]),Mt=new Set(["MRF","TIFF","TIF"]),It=/\.(\w+)$/,Pt=()=>new n("orientedimageryviewer:sketch-not-initialized","Sketch property is not initialized, call loadSketch first");let Vt=class extends(c(g)){constructor(e){super(e),this.additionalFeatures=new s,this.additionalCameraLocations=new s,this.additionalFootprints=new s,this.areaMeasurementResult=0,this.areaMeasurementAccuracy=0,this.bestFeatureAngle=0,this.bestFeatureCurrentFootprint=null,this.bestFeatureFootprint=null,this.cameraHeadingThreshold=Ve,this.cameraPitchThreshold=Ve,this.clickAction="hittest",this.videoViewModel=null,this.collectionId=null,this.conversionProps=null,this.coverageFrustums=new s,this.coveragePolygons=new s,this.currentBestFeature=null,this.currentBestFeatureMeasurementImage=null,this.currentBestFeatureLocation=null,this.currentCoverageVisible=!0,this.depthImage=null,this.directionMode="Relative",this.featureCache=[],this.navigationNodes=new s,this.determineWorkflowForFeature=async(e,t,a)=>{const{currentBestFeature:i,selectedPoint:r,view:s}=this;if(s?.closePopup(),i&&r){this._initialCurrentCoverageUpdate=!0,this._updateGroundElevation=!0;try{await this._updatePointsAndPolygons(a),await this._loadDepthImage(a),await this._loadImage(a)}catch(o){y(o)||(this.loadImageError(o),u.getLogger(this).error("#loadIImage()","error occured while loading image",o))}}},this.determineWorkflowForTriangularMeasurement=async(e,t,a)=>{if(this.view?.closePopup(),this.currentBestFeatureMeasurementImage&&this.selectedPoint)try{await this._loadMeasurementViewerImage(a)}catch(i){y(i)||(this.loadImageError(i),u.getLogger(this).error("#loadIImage()","error occured while loading image",i))}},this.disabled=!1,this.displayMessage={key:"onLoadMessage",type:"info"},this.displayNewMeasurementButton=!0,this.distanceMeasurementResult=0,this.distanceAccuracyArray=[],this.dataCaptureLayer=null,this.features=new s,this.groundCoordinates=null,this.groundCoordinatesAccuracy=null,this.heightMeasurementPixels=[],this.heightGraphic=null,this.heightMeasurementResult=0,this.heightMeasurementAccuracy=0,this.measurementAngle=null,this.tempDistance=null,this.imageGeometryField=null,this.imageLocationToolState=!1,this.imageMeasurementViewer=new mt,this.isAdditionalCoverageVisible=!1,this.isAdditionalPointSourcesVisible=!1,this.measurementVectors=[],this.layer=null,this.localPort=null,this.mapImageConversionToolState=!1,this.measureType=null,this.measurementGraphic=null,this.navigatorCurrentBestFeature=null,this.oiObjectIdField=null,this.overlayedCameraLocations=new s,this.overlayedMapFeatures=new f,this.pixelCoordinates=null,this.preserveAngle="none",this.pointSources=new s,this.previousFeatureAngle=0,this.selectedPoint=null,this.shouldShowSelectedImage=!1,this.sketch=null,this.sketchTriangular=null,this.sketchTriangularGraphicsLayer=null,this.draw=null,this.sketchAdapter=null,this.triangularMeasurementActive=!1,this.triangulatedDistanceMeasurement=null,this.triangulatedDistanceAccuracy=null,this.triangulatedAreaMeasurement=null,this.triangulatedAreaAccuracy=0,this.triangulatedMeasurementGraphic=null,this.triangulatedPoint=null,this.triangulatedMeasurementAdapter=null,this.updateFootprint=async(e,t)=>{"default"===this.mode&&"image-loaded"!==this.state||this.mode.includes("video")&&!this.videoElement?.content||await(this._adapter?.updateFootprint(e,t))},this.updateFootprintPanorama=async(e,t)=>{await(this._adapter?.updateFootprintPanorama(e,t))},this.updatingTriangularMeasurementState=!1,this.videoElement=null,this.videoLayer=null,this.videoMapView=new Fe({map:new Map}),this._adapter=null,this._highlightedFeatureHandle=null,this._imageViewer=new mt,this._initialCurrentCoverageUpdate=!0,this._locationPointOnImage=null,this._measurementService=null,this._correctedLocationPointOnImage=null,this._overlays=new U({listMode:"hide",internal:!0,elevationInfo:{mode:"absolute-height"},title:"OrentedImageryViewerViewModel overlays layer"}),this._panoramicVideoViewer=new Ie,this._panoramicViewer=new Pe,this._panoramicMeasurementViewer=new Pe,this._referencePointOnGround=null,this._referencePointOnImage=null,this._sectorData=null,this._featureToSector=null,this._updatingHandles=new C,this._clickTask=null,this._crossSymbol=null,this.footprintExtent=null,this._featureChangedTask=null,this._openPopupTask=null,this._suitabilities=null,this._transformController=new AbortController,this._updateFootprintTask=null,this._updateGroundElevation=!1,this.addUpdatingPromise=e=>this._updatingHandles.addPromise(e),this.filterCapturedFeatures=e=>{const t=this.currentBestFeature?.attributes.objectId,a=this.layer?.imageReferenceField;if(!t||!e||!a)return;const i=this.overlayedMapFeatures.get(e);i?.forEach(e=>{const i=e.attributes??{},r=Object.keys(i).find(e=>e.toLowerCase()===a.toLowerCase());(r?i[r]:null)!==t&&(e.visible=!e.visible)})},this.hideImageGeometry=e=>{},this.highlight=e=>{if(!this._overlaysView)return;this.removeHighlight();const t=this.additionalFootprints.find(({attributes:{imageID:t}})=>t===Number(e));this._highlightedFeatureHandle=t?this._overlaysView?.highlight(t):null},this.loadDataCaptureAdapter=async e=>{await this.loadSketch(e);const t=import("./adapters/sketch/DataCaptureAdapter.js"),{default:a}=await t;return v(e),this.sketchAdapter=new a({viewModel:this}),this.sketchAdapter},this.loadImageFromSource=async(e,t)=>this._updatingHandles.addPromise(this._loadImageFromSourceInternal(e,t)),this.storeImageMeasurementViewer=e=>{this.imageMeasurementViewer=e},this.storePanoramicMeasurementViewer=e=>{this._panoramicMeasurementViewer=e},this.loadImageViewer=e=>{this._imageViewer?.destroy(),this._imageViewer=e},this.loadPanoramicViewer=e=>{this._panoramicViewer?.destroy(),this._panoramicViewer=e},this.loadPanoramicVideoViewer=e=>{this._panoramicVideoViewer?.destroy(),this._panoramicVideoViewer=e},this.loadVideoViewer=e=>{this.videoMapView.container=e},this.showImageByObjectId=async(e,t)=>{const a=this.additionalFeatures.find(({attributes:t})=>t.objectId===e);if(a)this.currentBestFeature=a;else{const{layer:a,layerFloorFilterClause:r}=this;if(!a)return void this.setMessage("noLayerSelected","info");this.beforeLoad();const s=this._updatingHandles.addPromise(this._queryAndLoadByObjectId(a,e,r,t));try{await s,await this.selectBestFeature(e,t)}catch(i){y(i)||(u.getLogger(this).error("oriented-imagery-viewer:show-image",i),"NoFeatureFoundWithObjectIdError"===i.name?this.setMessage("noFeatureFoundWithObjectId","error","",{objectId:e}):this.setMessage("imageLoadError","error",i.message))}}},this.imageToImageTransform=async(e,t,a)=>{const{updateElevationProps:i,...r}=t,{updateElevationProps:s,...o}=a,n=await ee(e,r,i);return ge(n,o)},this.imageToImageTransformPanoramic=async(e,t,a)=>{const{updateElevationProps:i,...r}=t,{updateElevationProps:s,...o}=a,n=await te(e,r,i);return ye(n,o)},this.getSectorFeatureById=e=>this._suitabilities?.find(({feature:{attributes:{objectId:t}}})=>t===e),this.getFeatureSectorById=e=>this._featureToSector?.[`${e}`],this.navigate=async(e,t)=>{const{activeViewer:a}=this;if(!a)throw new yt;return await a.navigate(e,t)},this.removeHighlight=()=>this._highlightedFeatureHandle?.remove(),this.revealImageGeometry=e=>{},this.selectBestFeature=async(e,t)=>(v(t),this.currentBestFeature=this.features?.find(({attributes:t})=>`${t.objectId}`==`${e}`),F(()=>"image-loaded"===this.state,t)),this.toggleImageAttributes=()=>{m(this._openPopupTask),this._openPopupTask=r(async e=>{const{currentBestFeature:a,popupEnabled:i,layer:r,view:s}=this;if(s?.closePopup(),!(s&&a&&i&&r))return;const{attributes:o,geometry:n}=a,c=new t({geometry:n,attributes:o.toJSON(),layer:r,sourceLayer:r});v(e),await s.openPopup({features:[c],location:o.location.clone()})})},this.updateSuitabilities=(e,t=!0)=>{e.sort((e,t)=>e.suitability-t.suitability),this._suitabilities=e;const a=this._suitabilities.map(({feature:e})=>e);this._initialCurrentCoverageUpdate=!0,this._updateFeatures(a,t),this._groupFeaturesBySectors()},this._createViewClickHandle=()=>{if(this.removeHandles(_t.click),"disabled"===this.state||null==this.view)return;const e=this.mapImageConversionToolState&&"image-loaded"===this.state?this._mapImageConversionToolViewClickHandler:this._viewClickHandler;this.addHandles(this.view.on("click",e,Me.WIDGET),_t.click)},this._createImageClickHandle=()=>{this.removeHandles(_t.imageClick);const{mapImageConversionToolState:e,mode:t,activeViewer:a,currentBestFeature:i,footprintExtent:s}=this,o=a?.imageSize;if(!(e&&"none"!==t&&o&&s&&i))return;const n=a.clickAction;this.clickAction="pixel-location";const c=l(()=>{this.clickAction=n});let h=null;const u=_(()=>a,"pixel-location",e=>{this.plotReferencePointOnImage(e),h?.abort(),h=r(async a=>{if(!e)return;const r=await this.getMapPoint(e,{feature:i,imageSize:o,mode:t}).then(e=>{const t=this.view?.spatialReference;return re(!t,e.spatialReference.equals(t))?e:B(e,t)});v(a),this.plotReferencePointOnGround(r)})});this.addHandles([u,c],_t.imageClick)},this._createTriangularImageClickHandle=()=>{this.removeHandles(_t.triangularImageClick),this.triangularMeasurementActive&&"none"!==this.mode&&this.currentBestFeature&&this.currentBestFeatureMeasurementImage&&this.activeTriangulatedViewer&&this.addHandles(this.activeTriangulatedViewer.imageRenderer.on("double-click",this._measurementImageClickHandler),_t.triangularImageClick)},this._createTriangularImageLocationHandle=()=>{this.removeHandles(_t.triangularImageClick);const{imageLocationToolState:e,mode:t,activeTriangulatedViewer:a}=this,i=a?.imageSize;if(!e||"none"===t||!i)return;this.clickAction="pixel-location";let s=null;const o=_(()=>a,"pixel-location",e=>{1===this.measurementVectors.length&&(this.plotLocationPointOnImage(e,!0),s?.abort(),s=r(async a=>{if(!e||this.triangulatedPoint||2===this.measurementVectors?.length||!this.currentBestFeatureMeasurementImage)return;let r=await this.getMapPoint(e,{feature:this.currentBestFeatureMeasurementImage,imageSize:i,mode:t});v(a);const s=this.currentBestFeatureMeasurementImage.geometry.spatialReference;s&&!r.spatialReference.equals(s)&&(r=await B(r,s),v(a)),await this._calculateTriangulatedPointFromGroundPoint(r,{signal:a}),v(a)}))});this.addHandles(o,_t.triangularImageClick)},this._createImageLocationHandle=()=>{this.removeHandles(_t.imageClick);const{imageLocationToolState:e,mode:t,activeViewer:a,currentBestFeature:i,footprintExtent:s}=this,o=a?.imageSize;if(!(e&&"none"!==t&&o&&s&&i))return;this.clickAction="pixel-location";let n=null;const c=_(()=>a,"pixel-location",e=>{const{currentBestFeatureMeasurementImage:a,triangularMeasurementActive:s,activeTriangulatedViewer:c}=this;this.pixelCoordinates=e;const l=null!=a&&!c?.state.includes("loading");re(!s,l)&&this.plotLocationPointOnImage(e),n?.abort(),n=r(async a=>{if(!e)return;let r=await this.getMapPoint(e,{feature:i,imageSize:o,mode:t});v(a);const n=this.view?.spatialReference;n&&!r.spatialReference.equals(n)&&(r=await B(r,n),v(a)),this.groundCoordinates=r,s&&r&&l&&await this.triangulatedLocationWorkflow(r,a);const c=await this.calculateLocationAccuracy(e,r,t,a);v(a),c&&(this.groundCoordinatesAccuracy=c)})});this.addHandles(c,_t.imageClick)},this._handleImageHitTestResponse=async e=>{const{layer:t,overlayedCameraLocations:a}=this;if(!t)return;const i=e.results.find(({graphic:e,graphic:{attributes:i}})=>a.includes(e)&&i&&!i[t.imageReferenceField]&&!i[t.imageGeometryField]);if(!i)return;const r=i.graphic.attributes[t.objectIdField];await this.showImageByObjectId(r)},this._loadDepthImage=async e=>{const{currentBestFeature:t,layer:a,depthImageNotSupported:i}=this;if(this.depthImage?.destroy(),this.depthImage=null,!a||!t||i)return;const{depthImage:r}=t.attributes;if(!r)return;const s=(await import("./services/DepthImageService.js")).default;v(e),this.depthImage=new s({url:r});try{await this.depthImage.load(e)}catch(o){y(o)||(u.getLogger(this).error("error occurred while loading depth image",o),this.depthImage?.destroy(),this.depthImage=null)}},this._loadImage=async e=>{const{currentBestFeature:t,layer:a,mode:i}=this;if(this.clearGraphics(),!a||!t||"none"===i||"video"===i||"panoramic-video"===i)return;const{attributes:r}=t,{imagePath:s,imageRotation:o,cameraHeading:n,cameraRoll:c,cameraPitch:l,objectId:h,cameraOrientation:d,location:m}=r,p=(c??0)+(o??0),g=m.spatialReference.isWGS84&&4!==d?.type?z(m):new T(m);let w=s;if(je(s))try{w=await Be(a,h,e)}catch(f){if(y(f))return;return it(f)?(u.getLogger(this).error(f),void this.setMessage("noAttachment","error",`${a.objectIdField}: ${h}`)):(u.getLogger(this).error(f,{[a.objectIdField]:h,layer:a}),void this.setMessage("imageLoadError","error",`query-attachments-failed:${a.objectIdField} ${h}`))}try{await this.loadImageFromSource(w,{imageRotation:p,options:e,pitch:l,yaw:n,mode:i,cameraLocation:g}),v(e),await this.transformAndPlotSelectedLocation(e)}catch(f){y(f)||this.loadImageError(f)}},this._loadVideo=async e=>{const{currentBestFeature:t,layer:a,mode:i,selectedPoint:r}=this,s=t?.attributes.imagePath;if(!a||!t||"panoramic-video"!==i||!s)return;const{attributes:o}=t,{cameraHeading:n,cameraPitch:c,cameraOrientation:l,location:h}=o,u=h.spatialReference.isWGS84&&4!==l?.type?z(h):new T(h);try{this._panoramicVideoViewer.viewModel.video&&this._panoramicVideoViewer.viewModel.video.pause(),this._panoramicVideoViewer.videoSource=s;let t=n??0;u&&r&&(t=await se(u,r)-t),this._panoramicVideoViewer.pitch=c??0,this._panoramicVideoViewer.yaw=t,await this._panoramicVideoViewer.loadVideo(e),v(e)}catch(d){y(d)||this.loadImageError(d)}},this._loadImageFromSourceInternal=async(e,t)=>{const{mode:a,imageRotation:i,options:r}=t,s="string"==typeof e,o=s?e:e.url,{pathname:n,searchParams:c}=new URL(o);let l=s?n.match(It)?.[1]:e.datasetFormat;if(!l)try{l=await rt(o,{...t.options})}catch(h){y(h)||u.getLogger(this).error("#getContentType()",h)}switch(l??="UNKNOWN FORMAT",a){case"default":this.triangularMeasurementActive?await this._setImageSource(this.imageMeasurementViewer,l,o,c,i,r):await this._setImageSource(this._imageViewer,l,o,c,i,r);break;case"panoramic":if(bt.has(l.toUpperCase())){const{selectedPoint:e}=this,{pitch:a,yaw:i,cameraLocation:s,viewAngle:n}=t,c=this.triangularMeasurementActive?this._panoramicMeasurementViewer:this._panoramicViewer;let h=i??0;"number"==typeof n?h=n-h:s&&e&&(h=await se(s,e)-h),c.imageSource=o,c.pitch=a??0,c.yaw=h,Mt.has(l.toUpperCase())?await c.loadImageTiled(o,r):await c.loadImage(r)}else this.setMessage("unsupportedPanoramicImageryError","error",void 0,{datasetFormat:l});break}},this._loadMeasurementViewerImage=async e=>{const{currentBestFeatureMeasurementImage:t,layer:a,mode:i}=this;if(this.imageMeasurementViewer.clearGraphics(),this._panoramicMeasurementViewer.clearGraphics(),!a||!t||"none"===i||"video"===i||"panoramic-video"===i)return;const{attributes:r}=t,{imagePath:s,imageRotation:o,cameraHeading:n,cameraRoll:c,cameraPitch:l,objectId:h,cameraOrientation:d,location:m}=r,p=(c??0)+(o??0),g=m.spatialReference.isWGS84&&4!==d?.type?z(m):new T(m);let w=s;if(je(s))try{w=await Be(a,h,e)}catch(f){if(y(f))return;return it(f)?(u.getLogger(this).error(f),void this.setMessage("noAttachment","error",`${a.objectIdField}: ${h}`)):(u.getLogger(this).error(f,{[a.objectIdField]:h,layer:a}),void this.setMessage("imageLoadError","error",`query-attachments-failed:${a.objectIdField} ${h}`))}try{await this.loadImageFromSource(w,{imageRotation:p,options:e,pitch:l,yaw:n,mode:i,cameraLocation:g}),v(e)}catch(f){y(f)||this.loadImageError(f)}},this._loadViewAdapter=async e=>{const{view:t}=this;if(t)switch(t.type){case"2d":{const{default:t}=await import("./adapters/view/MapViewAdapter.js");v(e),this._adapter=new t(this);break}case"3d":{const{default:t}=await import("./adapters/view/SceneViewAdapter.js");v(e),this._adapter=new t(this);break}}else this._adapter=null},this._mapImageConversionToolViewClickHandler=e=>{if(e.stopPropagation(),e.preventDefault(),e.mapPoint){const t=e.mapPoint;t.x=D(t.x,t.spatialReference),this.plotMapPoint(e.mapPoint)}},this._measurementImageClickHandler=e=>{e.stopPropagation(),e.preventDefault();const{sketchTriangular:t,triangularMeasurementActive:a,currentBestFeatureMeasurementImage:i,triangulatedMeasurementGraphic:r}=this;t&&a&&i&&r&&"active"!==t.state&&(t.update([r],{tool:"reshape"}),this.updatingTriangularMeasurementState=!0)},this._viewClickHandler=e=>{this._clickTask?.abort(),this._clickTask=r(async t=>{const{pointerType:a,button:i,mapPoint:r}=e;if(("mouse"!==a||0===i)&&r)return e.stopPropagation(),e.preventDefault(),this._updatingHandles.addPromise(this.loadBestImage(r,{signal:t}))})},this.plotSelectedPointOnImage=async(e,a)=>{if(await w(a),!e)return;const i=new T({...A(e)?e.toJSON():e});if("default"===this.mode)i.x-=.5,i.y=.5-i.y,i.spatialReference=this._imageViewer.imageRenderer.spatialReference.clone(),this._crossSymbol=new t({geometry:i,symbol:Ne}),this._imageViewer.addGraphic(this._crossSymbol,0);else if("panoramic"===this.mode){const{imageSize:a}=this._panoramicViewer;if(!a)return;const[i,r]=a,{heading:s,pitch:o}=oe(e,i,r),n=ne(s,o);this._crossSymbol=new t({geometry:new T(n,H.WebMercator),symbol:We}),this._panoramicViewer.addGraphic(this._crossSymbol,0)}},this.handleSectorClick=this.handleSectorClick.bind(this),this.searchBestImage=this.searchBestImage.bind(this),this.transformAndPlotReferencePointOnImage=this.transformAndPlotReferencePointOnImage.bind(this)}initialize(){this.addHandles([b(()=>this.view,()=>this.load(),M),b(()=>this.view?.map,(e,t)=>{t?.layers.remove(this._overlays),e?.layers.add(this._overlays)},I),b(()=>this.view?.map?.allLayers?.length,e=>{e&&this.view?.map?.layers.reorder(this._overlays,e-1)},I),b(()=>[this.state,this.mapImageConversionToolState,this.view],()=>{this._createViewClickHandle(),this._createImageClickHandle()},M),b(()=>[this.triangularMeasurementActive,this.currentBestFeatureMeasurementImage],()=>{this._createTriangularImageClickHandle()},M),b(()=>[this.state,this.imageLocationToolState,this.view],(e,t)=>{if(this._initializeMeasurementService(),this._createImageLocationHandle(),!this.imageLocationToolState)return this.clearPreviousGroundLocation(),void this._resetCursor();e[1]!==t?.[1]&&this._setMeasurementCursor()},M),b(()=>this.measureType,()=>{this.clearPreviousMeasurements(),this._initializeMeasurementService()},M),b(()=>this.bestFeatureAngle,(e,t)=>{this.previousFeatureAngle=t??0},M),b(()=>this.currentBestFeature,async(e,t)=>{m(this._featureChangedTask),this._featureChangedTask=r(async a=>this.determineWorkflowForFeature.apply(this,[e,t,{signal:a}])),await this._featureChangedTask.promise},{sync:!0}),b(()=>this.currentBestFeatureMeasurementImage,(e,t)=>{m(this._featureChangedTask),t&&e!==t&&(this.measurementVectors=[],this.triangulatedPoint=null,this.sketchTriangularGraphicsLayer?.graphics.destroyAll()),this._featureChangedTask=r(async a=>{await this.determineWorkflowForTriangularMeasurement(e,t,{signal:a}),v(a),this._reorderTriangularSketchLayer()})},M),b(()=>this.triangularMeasurementActive,(e,t)=>{t&&!e&&(this.measurementVectors=[],this.currentBestFeatureMeasurementImage=null,this.triangulatedDistanceMeasurement=null,this.triangulatedMeasurementGraphic=null,this.triangulatedPoint=null,this.updatingTriangularMeasurementState=!1,this.triangulatedAreaMeasurement=null,this.triangulatedDistanceAccuracy=null,this.triangulatedAreaAccuracy=0,this.sketchTriangularGraphicsLayer?.graphics.destroyAll(),this.clearReferencePointOnImage(),this.imageMeasurementViewer.clearImage(),this.imageMeasurementViewer.clearGraphics(),this._panoramicMeasurementViewer.clearImage(),this._panoramicMeasurementViewer.clearGraphics())}),b(()=>this.mode,e=>{switch(this.removeHandles(_t.interactionHandles),e){case"default":this.addHandles(b(()=>{const{state:e}=this;return"image-loaded"===e?this._imageViewer.imagePointsInView:null},e=>{e&&(m(this._updateFootprintTask),this._updateFootprintTask=r(async t=>{await this.updateFootprint(e,{signal:t})}))},{...M,equals:(e,t)=>a(e,t,h)}),_t.interactionHandles);break;case"video":this.addHandles(b(()=>{const{footprintExtent:e}=this;if(e)return Se},e=>{e&&(m(this._updateFootprintTask),this._updateFootprintTask=r(async t=>{await this.updateFootprint(e,{signal:t})}))},{...M,equals:(e,t)=>a(e,t,h)}),_t.interactionHandles);break;case"panoramic":this.addHandles(b(()=>{const{currentBestFeature:e,state:t,_panoramicViewer:a}=this,{imageSize:i,vfov:r,hfov:s,pitch:o,yaw:n}=a;return e&&i&&!t.includes("loading")&&null!=r&&null!=s&&null!=o&&null!=n?[r,s,n,o]:null},e=>{if(!e||this.state.includes("loading"))return;const[t,a,i,s]=e;this.currentNode&&(this.currentNode.currentHeading=i+(this.currentNode.heading??0),this.currentNode.currentPitch=s+(this.currentNode.pitch??0)),m(this._updateFootprintTask),this._updateFootprintTask=r(async e=>{await this.updateFootprintPanorama({verticalFieldOfView:t,horizontalFieldOfView:a,yaw:i,pitch:s},{signal:e}),this._updateFootprintTask=null})},{equals:(e,t)=>a(e,t,h)}),_t.interactionHandles);break;case"panoramic-video":this.addHandles(b(()=>{const{currentBestFeature:e,state:t,_panoramicVideoViewer:a}=this,{imageSize:i,vfov:r,hfov:s,pitch:o,yaw:n,viewModel:c}=a,l=c.closestFeature??e;return l&&i&&!t.includes("loading")&&null!=r&&null!=s&&null!=o&&null!=n?[r,s,n,o,l]:null},e=>{if(!e)return;const[t,a,i,s,o]=e;m(this._updateFootprintTask),this._updateFootprintTask=r(async e=>{await this.updateFootprintPanorama({verticalFieldOfView:t,horizontalFieldOfView:a,yaw:i,pitch:s,feature:o},{signal:e}),v(e),this._updateFootprintTask=null})},{equals:(e,t)=>a(e,t,h)}),_t.interactionHandles)}},M),b(()=>[this.brightness,this.contrast,this.sharpness],()=>{const{_imageViewer:e,brightness:t,contrast:a,mode:i,sharpness:r}=this;"default"===i&&(e.brightness=t,e.contrast=a,e.sharpness=r)},M),b(()=>this.activeViewer?.imageRenderer,()=>{this.sketch&&(this.sketch.view=this.activeViewer?.imageRenderer)}),b(()=>this.activeViewer,e=>{this.removeHandles(_t.hittestHandles),e&&this.addHandles(_(()=>e,"hittest-response",this._handleImageHitTestResponse),_t.hittestHandles)})]),this.when().finally(()=>{this.notifyChange("state")})}destroy(){this.currentBestFeature=null,this._updateFootprintTask=m(this._updateFootprintTask),this._clickTask=m(this._clickTask),this.coverageFrustums.destroy(),this.coveragePolygons.destroy(),this.pointSources.destroy(),this.additionalFootprints.destroy(),this.additionalCameraLocations.destroy(),this.bestFeatureFootprint=p(this.bestFeatureFootprint),this.bestFeatureCurrentFootprint=p(this.bestFeatureCurrentFootprint),this.videoViewModel=p(this.videoViewModel),this._crossSymbol=p(this._crossSymbol),this._referencePointOnGround=p(this._referencePointOnGround),this._referencePointOnImage=p(this._referencePointOnImage),this._locationPointOnImage=p(this._locationPointOnImage),this._overlays&&this.view?.map?.remove(this._overlays),this._overlays.destroy(),this._imageViewer.destroy(),this.imageMeasurementViewer.destroy(),this._panoramicViewer.destroy(),this._panoramicMeasurementViewer.destroy()}get activeLayer(){return o(u.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){o(u.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeViewer(){const{_imageViewer:e,_panoramicViewer:t,mode:a}=this;switch(a){case"default":return e;case"panoramic":return t;default:return null}}get activeTriangulatedViewer(){switch(this.mode){case"default":return this.imageMeasurementViewer;case"panoramic":return this._panoramicMeasurementViewer;default:return null}}get accuracyParametersMissing(){return this.layer?.orientationAccuracy?.every(e=>0===e)??!0}get brightness(){return this._get("brightness")??0}set brightness(e){this._set("brightness",d(e,-10,10))}get contrast(){return this._get("contrast")??0}set contrast(e){this._set("contrast",d(e,-10,10))}get currentNode(){const{currentBestFeature:e,navigationNodes:t}=this;return t.find(t=>t.id===e?.attributes.objectId)}get depthImageNotSupported(){if(this.currentBestFeature?.attributes.depthImage)return!st(this.currentBestFeature.attributes.depthImage)}get featureCount(){return this.features?.length??0}get imageGalleryEnabled(){const{currentBestFeature:e}=this;if(!e)return!1;const t=e.attributes.imagePath?.trim();return st(t)||je(t)}get imageLoaded(){return o(u.getLogger(this),"imageLoaded",{replacement:'Use OrientedImageryViewer.state === "image-loaded"',version:"4.29",warnOnce:!0}),"image-loaded"===this.state}get invalidCameraHeading(){return this.currentBestFeature?.attributes?.cameraHeading===ke}get imagePointsInView(){const{mode:e,_imageViewer:t}=this;return"default"===e?t.imagePointsInView:null}get layerView(){const{layer:e,view:t}=this;if(e&&t)return t.allLayerViews.find(ot(e))}get layerFloorFilterClause(){const{layerView:e}=this;return e?we(e):null}get mode(){const e=this.currentBestFeature?.attributes;if(!e)return"none";const t=e.orientedImageryType;if(t?.includes("video"))return t.includes("360")?"panoramic-video":"video";const{horizontalFieldOfView:a,isSpherical:i}=e;return 360===a||i?"panoramic":"default"}get panoramicVideoLoaded(){const{mode:e,_panoramicVideoViewer:t}=this,{videoLoaded:a}=t.viewModel;return("panoramic-video"===e&&!0===a)??!1}get popupEnabled(){return!0===this.layer?.popupEnabled}get referencePoint(){return this._referencePointOnGround?.geometry}get sectorData(){const{_sectorData:e}=this;return e?Ae.map(t=>e[t]):null}get sharpness(){return this._get("sharpness")??0}set sharpness(e){this._set("sharpness",d(e,0,1))}get sketchGraphicsLayer(){const{sketch:e}=this;return"graphics"===e?.layer?.type?e.layer:void 0}get state(){const{mode:e,disabled:t,_updatingHandles:{updating:a},_featureChangedTask:i}=this;if(t)return"disabled";if(!this.isFulfilled()||a||!1===i?.finished)return"loading";if(this.isRejected())return"error";if("error"===this.displayMessage?.type)return"image-load-error";switch(e){case"default":return this._imageViewer.state;case"panoramic":return this._panoramicViewer.state;case"video":return this.videoElement?.loaded?"video-loaded":"video-not-loaded"}return"ready"}get thumbnails(){const{features:e}=this;return e?new s(e.map(({attributes:{imagePath:e,objectId:t,cameraRoll:a,imageRotation:i}})=>{const r=e?.trim();return st(r)||je(r)?{url:r,objectId:t,rotation:(a??0)+(i??0)}:null}).filter(i)):null}set view(e){this._set("view",e)}get _defaultGraphicsLayer(){const e={blendMode:"source-atop"};switch(this.mode){case"panoramic":return new U({...e,elevationInfo:{mode:"absolute-height"}});case"default":return new U({...e});default:return}}get _overlaysView(){return this.view?.layerViews.find(({layer:e})=>e===this._overlays)}beforeLoad(e=!0){this.view?.closePopup(),e&&(this.displayMessage=null),this.clearPreviousGroundLocation(),this.triangularMeasurementActive=!1,this.currentBestFeatureMeasurementImage=null,this.measureType=null,this.imageLocationToolState=!1,this.features.removeAll(),this.currentBestFeature=null,this.additionalFeatures.removeAll(),this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint=p(this.bestFeatureCurrentFootprint),this._overlays?.removeAll()}async computeHeight(e,t,a=!0){return this._measurementService?.computeHeight(e,t,a)}async calculateAreaMeasurement(e,t,a){return this._measurementService?.calculateAreaMeasurement(e,t,a)}async calculateDistanceMeasurement(e,t,a){return this._measurementService?.calculateDistanceMeasurement(e,t,a)}async calculateAccuracy(e,t,a){return this._measurementService?.calculateAccuracy(e,t,a)}async calculateLocationAccuracy(e,t,a="default",i){return this._measurementService?.calculateLocationAccuracy(e,t,a,i)}async calculateAccuracyPanoramic(e,t,a){return this._measurementService?.calculateAccuracyPanoramic(e,t,a)}async calculateHeightMeasurementInfo(e,t,a){return this._measurementService?.calculateHeightMeasurementInfo(e,t,a)}async calculateTriangulatedMeasurements(e){await(this._measurementService?.calculateTriangulatedMeasurements(e))}clearPreviousMeasurements(){this.clearMeasurementGraphics(),this.resetMeasurementData(),this.stopMeasurement()}clearPreviousGroundLocation(){this.groundCoordinates=null,this.groundCoordinatesAccuracy=null,this.pixelCoordinates=null,this.clearLocationPointOnImage()}clearMeasurementGraphics(){this.measurementGraphic&&(this.activeViewer?.removeGraphic(this.measurementGraphic),this.measurementGraphic=null),this.heightGraphic&&(this.activeViewer?.removeGraphic(this.heightGraphic),this.heightGraphic=null),this.triangularMeasurementActive&&this.sketchTriangularGraphicsLayer?.graphics.destroyAll()}digitizeCancel(){return this.sketch?.cancel()}digitizeCanRedo(){return this.sketch?.canRedo()??!1}digitizeCanUndo(){return this.sketch?.canUndo()??!1}digitizeComplete(){return this.sketch?.complete()}async digitizeCreate(e,t){const{sketch:a,dataCaptureLayer:i}=this;if(!a)throw Pt();Ge(i,e,a),await a.create(e,{...t,defaultZ:0})}digitizeDelete(){if(!this.sketch)throw Pt();return this.sketch.delete()}digitizeDuplicate(){if(!this.sketch)throw Pt();return this.sketch.duplicate()}digitizePlace(e,t){if(!this.sketch)throw Pt();return this.sketch.place(e,t)}digitizeRedo(){if(!this.sketch)throw Pt();return this.sketch.redo()}digitizeUndo(){if(!this.sketch)throw Pt();return this.sketch.undo()}digitizeUpdate(e,t){if(!this.sketch)throw Pt();return this.sketch.update(e,t)}async displayHeightResults(){const{currentBestFeature:e,activeViewer:t,heightMeasurementPixels:a,mode:i}=this,r=t?.imageSize,s=e?.attributes;if(!s||!r)return;const o=await this.computeHeight(a,i);o?.value&&o?.accuracy&&(this.heightMeasurementResult=o.value,this.heightMeasurementAccuracy=o.accuracy)}filterByFootprints(e,t,a=!1){const i=[],r=[],s=[];return e.forEach(e=>{const{layer:{coveragePercent:o},attributes:n}=e;let c;const{polygon:l,frustum:h}=J(n);if(c=l.clone(),n.isInspection&&(c=Z(n)),o&&(c=K(c,o)),a||!t||Q(c,t)){s.push(e);const{geometry:t,objectId:a,cameraHeight:o,cameraHeading:c}=n,u=t.clone();u.z=o,u.imageID=a,this.pointSources.push(u),c!==ke&&(i.push(l),h&&r.push(h))}}),{features:s,polygons:i,frustums:r}}getMeasurementProperties(e=this.currentBestFeature,t=this.activeViewer){if(!e||!t?.imageSize)return;const{elevationSample:a,attributes:i}=e,{elevationSource:r,cameraHeight:s}=i,o=ce(i,t.imageSize[0],t.imageSize[1]);let n=o.cameraLocation;return(n.spatialReference.isGeographic?B(n,H.WebMercator):Promise.resolve(n)).then(e=>(n=e,le(n.spatialReference,n.z??0,s,{elevationSample:a,elevationSource:r,extent:this.footprintExtent}))).then(t=>("elevationSample"in t&&he(t.elevationSample)&&(e.elevationSample=t.elevationSample),{...o,cameraLocation:n,updateElevationProps:t}))}getMeasurementPropertiesPanoramic(e=this.currentBestFeature,t=this.activeViewer){if(!e||!t?.imageSize)return;const{elevationSample:a,attributes:i}=e,{elevationSource:r,cameraHeight:s}=i,o=ue(i,t.imageSize[0],t.imageSize[1]);let n=o.cameraLocation;return(n.spatialReference.isGeographic?B(n,H.WebMercator):Promise.resolve(n)).then(e=>(n=e,le(n.spatialReference,n.z??0,s,{elevationSample:a,elevationSource:r,extent:this.footprintExtent}))).then(t=>("elevationSample"in t&&he(t.elevationSample)&&(e.elevationSample=t.elevationSample),{...o,cameraLocation:n,updateElevationProps:t}))}async deleteDataCaptureFeatures(e){const{dataCaptureLayer:t}=this;if(!t)throw new n("orientedimageryviewer:missing-featurelayer","Data capture layer is not available");return t.queryFeatures({objectIds:e}).then(({features:e})=>t.applyEdits({deleteFeatures:e}))}handleSectorClick(e){if(isNaN(e))return;const t=this._sectorData?.[Ae[e]],a=t?.at(0);a&&(this.triangularMeasurementActive&&this.currentBestFeature?this._updateImageMeasurementBestFeature(a):this._updateCurrentBestFeature(a))}handleFeatureClick(e){const{sector:t,featureIndexInSector:a}=e;if(isNaN(a))return;const i=this._sectorData?.[t],r=i?.at(a);r&&(this.triangularMeasurementActive&&this.currentBestFeature?this._updateImageMeasurementBestFeature(r):this._updateCurrentBestFeature(r))}handleDrawCursorUpdateEvents(e){const{measurementAngle:t,tempDistance:a,heightMeasurementPixels:i,mode:r,activeViewer:s,currentBestFeature:o}=this,n=s?.imageSize;if(!e.vertices||!n||!o)return;const c=He(e.vertices.at(-1),r,n);if(i.length<1||!c||!a||!t||"none"===r)return;const l=xe(i[0],c,t);if(!l?.length)return;this.heightMeasurementPixels.push(l),"panoramic"===r?this.createPolylineGraphicPano():this.createPolylineGraphic();const h=Ee(o.attributes.location.spatialReference),u=De(this.heightMeasurementPixels,a,h);u&&(this.heightMeasurementResult=u)}async handleDrawVertexAddEvents(e,t){const{currentBestFeature:a,activeViewer:i,heightMeasurementPixels:r,mode:s}=this;if(!a||!i||!e.vertices?.length||"none"===s)return;const o=i?.imageSize;if(!r.length&&o){const a=He(e.vertices.at(-1),s,o);this.heightMeasurementPixels.push(a);const i=await this.calculateHeightMeasurementInfo(a,s,t);if(!i?.measurementAngle||!i?.tempDistance)return;this.measurementAngle=i.measurementAngle,this.tempDistance=i.tempDistance}}load(e){return this.addResolvingPromise(this._loadViewAdapter(e).catch(e=>{if(!y(e))throw e})),this}async loadBestImage(e,t){return this.selectedPoint=Y(e),this.beforeLoad(),this._fetchFeaturesWithController(e,t)}loadImageError(e){u.getLogger(this).error("oriented-imagery-viewer:load-image",e),this.setMessage("imageLoadError","error",e.message)}async loadSketch(e){if(!this.sketch){const t=import("../Sketch/SketchViewModel.js"),{default:a}=await t;v(e),this.sketch=new a({layer:this._defaultGraphicsLayer,view:this.activeViewer?.imageRenderer,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{edgeOperation:"none",shapeOperation:"none",vertexOperation:void 0},enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"transform"}})}return this.sketch}async loadMeasurementAdapter(e){if(!this.sketchAdapter){const t=import("./adapters/sketch/MeasurementAdapter.js"),{default:a}=await t;if(v(e),this.sketchAdapter=new a({viewModel:this}),!this.sketchAdapter.viewModel.isResolved())return}return this.sketchAdapter}async loadTriangulatedMeasurementAdapter(e){if(!this.triangulatedMeasurementAdapter){const t=import("./adapters/sketch/TriangulatedMeasurementAdapter.js"),{default:a}=await t;if(v(e),this.triangulatedMeasurementAdapter=new a({viewModel:this}),!this.triangulatedMeasurementAdapter.viewModel.isResolved())return}return this.triangulatedMeasurementAdapter}async processFeatureResponse(e,t,a){const{features:i}=e;if(this._clearFeatureGeometries(),!this._checkFeatures(i))return;const{features:r,polygons:s,frustums:o}=this.filterByFootprints(i,t,a?.skipFilter);if(!this._checkFeatures(r))return;this.coveragePolygons.addMany(s),this.coverageFrustums.addMany(o);const n=await this.processElevationSample(s,r,a);v(a),await this._updateElevationOfSelectedPointAndLocations(r,t,n),v(a),nt(r,n);const c=this._processSuitableFeatures(r,t);this.updateSuitabilities(c,a?.loadBestImage)}async startMeasurement(e,t){this.sketch||await this.loadSketch(t),await this.loadMeasurementAdapter(t);const{sketch:a,sketchAdapter:i,activeViewer:r,mode:s}=this;if(!a||!i||!r||"none"===s)return;if(this.displayNewMeasurementButton=!1,"panoramic"===s&&(a.defaultCreateOptions.defaultZ=0),await a.create(e),"panoramic"===s){const{drawOperation:e}=a.view.activeTool;e.constraintsEnabled=!1,e._set("elevationDrawSurface",null)}const o=this.activeViewer?.imageRenderer.effectiveTheme.accentColor;o&&this.sketch&&(this.sketch.polygonSymbol=qe(o),this.sketch.polylineSymbol="panoramic"===s?$e:Je(o,2.5))}startHeightMeasurement(){this.heightMeasurementPixels=[],this.displayNewMeasurementButton=!1,this.draw??=new _e({view:this.activeViewer?.imageRenderer});this.draw.create("polyline").on(["cursor-update","vertex-add","draw-complete"],e=>this.handleDrawEvents(e))}createPolylineGraphic(){const e=[this.heightMeasurementPixels[0],this.heightMeasurementPixels.at(-1)],a=this.activeViewer?.imageRenderer.spatialReference;if(this.heightGraphic)this.heightGraphic.geometry=new j({paths:[e],spatialReference:a});else{const i=new j({paths:[e],spatialReference:a}),r=this.activeViewer?.imageRenderer.effectiveTheme.accentColor;this.heightGraphic=new t({geometry:i,symbol:Je(r,2.5)}),this.activeViewer?.addGraphic(this.heightGraphic)}}createPolylineGraphicPano(){const e=this.activeViewer?.imageRenderer.spatialReference,a=this.activeViewer?.imageSize;if(!a)return;const i={x:this.heightMeasurementPixels[0][0],y:this.heightMeasurementPixels[0][1]},r={x:this.heightMeasurementPixels.at(-1)[0],y:this.heightMeasurementPixels.at(-1)[1]},{heading:s,pitch:o}=oe(i,a[0],a[1]),{heading:n,pitch:c}=oe(r,a[0],a[1]),l=[[...ne(s,o)],[...ne(n,c)]];if(this.heightGraphic)this.heightGraphic.geometry=new j({paths:[l],spatialReference:e});else{const a=new j({paths:[l],spatialReference:e});this.heightGraphic=new t({geometry:a,symbol:$e}),this._panoramicViewer.addGraphic(this.heightGraphic,0)}}async editOverlayedGraphics(e){this.sketchTriangularGraphicsLayer||this._initializeSketchTriangularGraphicsLayer(),this.sketchTriangularGraphicsLayer?.destroyed&&this._handleDestroyedTriangularSketchLayer(),this.sketchTriangularGraphicsLayer.add(e),this.sketchTriangular||(this._initializeSketchTriangular(),await this.loadTriangulatedMeasurementAdapter()),this.updateOverlayedGeometry(e)}updateOverlayedGeometry(e){this.sketchTriangular?.update([e],{tool:"reshape"})}async processMeasurementVectors(e){this.triangularMeasurementActive&&this.currentBestFeature&&(this.measurementVectors?.length<2&&await this.updateMeasurementVectorsArray(e),2===this.measurementVectors.length&&await this.calculateTriangulatedMeasurements(e))}async updateMeasurementVectorsArray(e){const t=this.measurementVectors.length?this.currentBestFeatureMeasurementImage:this.currentBestFeature;if(t){const a=await this.computeMeasurementVector(e,t);a&&this.measurementVectors.push(a)}}async computeMeasurementVector(e,t){const{activeViewer:a,mode:i}=this,r=a?.imageSize;if(!e||!t||!r)return;const s=e.map(e=>[e[0]-.5,-.5-e[1]]),o=this.view?.spatialReference,n=[];for(let c=0;c<s.length;c++){const e={x:s[c][0],y:s[c][1]};let a=await this.getMapPoint(e,{feature:t,imageSize:r,mode:i});o&&!a.spatialReference.equals(o)&&(a=await B(a,o)),n.push(a)}return ze(n,t)}async handleDrawEvents(e,t){if(this.draw)switch(e.type){case"cursor-update":this.handleDrawCursorUpdateEvents(e);break;case"vertex-add":await this.handleDrawVertexAddEvents(e,t);break;case"draw-complete":await this.displayHeightResults()}}initializeMeasurement(e){switch(this.clearMeasurementGraphics(),this.resetMeasurementData(),e){case"distance":this.startMeasurement("polyline");break;case"area":this.startMeasurement("polygon");break;case"height":this.startHeightMeasurement()}}async overlayCameraLocations(e){const{activeViewer:a,currentBestFeature:i,overlayedCameraLocations:r,layer:s,mode:o,state:n,layerFloorFilterClause:c}=this,l=a?.imageSize;if(!l||!i||!s||"none"===o||n.includes("loading"))return;const{polygon:h}=J(i.attributes);if(a.removeManyGraphics(r.toArray()),r.removeAll(),e){const{features:e}=await s.queryFeatures({where:P(`${s.objectIdField} <> ${i.attributes.objectId}`,P(s.definitionExpression,c)),geometry:h,returnGeometry:!0,outFields:[s.objectIdField]}),n=await Promise.all(e.map(async e=>{const{attributes:a,geometry:r}=e,s=await this.getPixels(r,{feature:i,imageSize:l,mode:o}),n="panoramic"===o?Ze():Ke();return new t({attributes:a,symbol:n,geometry:s})}));r.addMany(n),a.addManyGraphics(r.toArray())}}overlayGraphicsOnImage(e,t){this.removeOverlayedGraphicsOnImage(e),this.overlayedMapFeatures.set(e,t),this.activeViewer?.addManyGraphics(t.toArray())}async overlayMapFeatures(e,a=!1){const{activeViewer:r,currentBestFeature:o,mode:n,state:c,layer:l}=this,h=r?.imageSize;if(!h||!o||"none"===n||"video"===n||"panoramic-video"===n||c.includes("loading")||!l)return;const{polygon:d}=J(o.attributes);try{const{imageGeometryField:t,oiObjectIdField:a}=Re(e,l.imageGeometryField,l.imageReferenceField);this.imageGeometryField=t.name,this.oiObjectIdField=a.name}catch(g){u.getLogger(this).warn("oriented-imagery-viewer:overlay-map-features",g)}const{features:m}=await e.queryFeatures({geometry:d,returnGeometry:!0,outFields:["*"]}),p=new s((await Promise.all(m.map(async i=>{const r=i.symbol?.clone()??e.renderer?.getSymbol(i)?.clone(),{attributes:s,geometry:c}=i,l=c,{imageGeometryField:d,oiObjectIdField:m}=this;if(d&&m&&Te(e,d,m)&&`${s[m]}`==`${o.attributes.objectId}`)try{return Oe(s,d,e,a,h,n,r)}catch(g){u.getLogger(this).warn("oriented-imagery-viewer:overlay-map-features","couldn't create graphic from attributes, geometry will be used",{error:g,feature:i,layer:e,imageGeometryField:this.imageGeometryField,imageReferenceField:this.oiObjectIdField})}switch(l?.type){case"point":{const i=await this.getPixels(l,{feature:o,imageSize:h,mode:n});return new t({attributes:s,layer:e,symbol:r,geometry:i,visible:e.visible&&a})}case"polygon":{const{rings:i,spatialReference:c}=l,u=i.map(e=>e.map(([e,t,a])=>new T({x:e,y:t,z:a,spatialReference:c}))),d=await Promise.all(u.map(async e=>this.getPixels(e,{feature:o,imageSize:h,mode:n}).then(e=>e.map(de))));return new t({attributes:s,layer:e,symbol:r,geometry:new O({rings:d,spatialReference:H.WebMercator}),visible:e.visible&&a})}case"polyline":{const{paths:i,spatialReference:c}=l,u=i.map(e=>e.map(([e,t,a])=>new T({x:e,y:t,z:a,spatialReference:c}))),d=await Promise.all(u.map(async e=>this.getPixels(e,{feature:o,imageSize:h,mode:n}).then(e=>e.map(de))));return new t({attributes:s,layer:e,symbol:r,geometry:new j({paths:d,spatialReference:H.WebMercator}),visible:e.visible&&a})}case"multipoint":{const{points:i,spatialReference:c}=l,u=i.map(([e,t,a])=>new T({x:e,y:t,z:a,spatialReference:c})),d=await this.getPixels(u,{feature:o,imageSize:h,mode:n}).then(e=>e.map(de));return new t({attributes:s,layer:e,symbol:r,geometry:new R({points:d,spatialReference:H.WebMercator}),visible:e.visible&&a})}}return null}))).filter(i));this.overlayGraphicsOnImage(`${e.id}`,p)}getDepthAt(e){const{activeViewer:t,currentBestFeature:a,mode:i,state:r,depthImage:s}=this,o=t?.imageSize;if(!o||!a||"none"===i||r.includes("loading"))return u.getLogger(this).warnOnce("oriented-imagery-viewer:get-depth-at","Load an image to use depth"),null;if(!s?.loaded)return u.getLogger(this).error("oriented-imagery-viewer:get-depth-at","Depth image is not loaded"),this.emit("depth-image-service:not-loaded"),null;const n=(Array.isArray(e)?e:[e]).map(e=>s.depthAt(e,{width:o[0],height:o[1]})??null);return Array.isArray(e)?n:n[0]}async getPixels(e,t){const{imageSize:a,mode:i,feature:r}=t,s=(await this.worldToImage(Array.isArray(e)?e:[e],r)).map(e=>{if("default"===i)return new T({x:e.x-.5,y:.5-e.y,spatialReference:H.WebMercator});const[t,r]=a,{heading:s,pitch:o}=oe(e,t,r),n=ne(s,o);return new T(n,H.WebMercator)});return Array.isArray(e)?s:s[0]}async getMapPoint(e,t){const{feature:a,mode:i,imageSize:r}=t,{elevationSample:s,attributes:o}=a,{elevationSource:n,location:c,cameraHeight:l}=o;let h=c.clone();h.spatialReference.isGeographic&&(h=await B(h,H.WebMercator));const u=await le(c.spatialReference,c.z??0,l,{elevationSample:s,elevationSource:n,extent:this.footprintExtent});let d;"elevationSample"in u&&he(u.elevationSample)&&(a.elevationSample=u.elevationSample);const m=Array.isArray(e)?e:[e];if(this.depthImage?.loaded)for(const p of m){const e=this.getDepthAt(p);null!=e&&(p.depth=e)}if("default"===i){const e=ce(o,r[0],r[1]);d=await ee(m,{...e,cameraLocation:h},u)}else{const e=ue(o,r[0],r[1]);d=await te(m,{...e,cameraLocation:h},u)}return Array.isArray(e)?d:d[0]}getActiveSectors(){return Ae.filter(e=>this._sectorData?.[e]?.length)}async plotMapPoint(e){return this.plotReferencePoint(e),this.transformAndPlotReferencePointOnImage({feature:this.currentBestFeature,selectedLocation:e,options:{signal:this._transformController?.signal}})}plotReferencePointOnGround(e){this._referencePointOnGround&&(this._overlays?.remove(this._referencePointOnGround),this._referencePointOnGround.destroy()),null!=e&&(this._referencePointOnGround=new t({geometry:new T({...e.toJSON()}),symbol:Qe}),this.view?this._overlays?.add(this._referencePointOnGround):this.emit("plot-ground-point",{data:{point:this._referencePointOnGround?.geometry}}))}plotReferencePointOnImage(e){if("image-loaded"===this.state)switch(this.clearReferencePointOnImage(),this.mode){case"default":{const a=A(e)?e.toJSON():e;a.x-=.5,a.y=.5-a.y,this._referencePointOnImage=new t({geometry:new T({spatialReference:this._imageViewer.imageRenderer.spatialReference,...a}),symbol:Qe}),this._imageViewer.addGraphic(this._referencePointOnImage,0);break}case"panoramic":{const{imageSize:a}=this._panoramicViewer;if(!a)return;const[i,r]=a,{heading:s,pitch:o}=oe(e,i,r),n=ne(s,o);this._referencePointOnImage=new t({geometry:new T(n,H.WebMercator),symbol:Xe}),this._panoramicViewer.addGraphic(this._referencePointOnImage,0);break}}}plotLocationPointOnImage(e,t=!1){if("image-loaded"===this.state)switch(this.clearLocationPointOnImage(t),this.mode){case"default":this._plotLocationPointOnDefaultImage(e,t);break;case"panoramic":this._plotLocationPointOnPanoramicImage(e,t)}}removeAllOverlayMapFeatures(){this.overlayedMapFeatures.forEach(e=>{this._imageViewer.removeManyGraphics(e.toArray())}),this.overlayedMapFeatures.clear()}removeOverlayedGraphicsOnImage(e){const t=this.overlayedMapFeatures.get(e);t?.length&&(this.activeViewer?.removeManyGraphics(t.toArray()),this.overlayedMapFeatures.delete(e))}reset(){const{mode:e}=this;"default"===e||"panoramic"===e?this.resetImage():"video"===e?this.resetVideo():"panoramic-video"===e&&this.resetVideoPanoramic(),this.beforeLoad(!1)}resetImage(){switch(this.setMessage("onLoadMessage","info"),this.mode){case"default":this._imageViewer.clearImage(),this._imageViewer.clearGraphics();break;case"panoramic":this._panoramicViewer.clearGraphics()}this._clickTask=m(this._clickTask)}resetVideo(){this.setMessage("onLoadMessage","info"),this.videoViewModel?.resetVideoHandler(),this._overlays?.removeAll(),this.videoViewModel=null,this.featureCache=[],this.currentBestFeature=null}resetVideoPanoramic(){this.setMessage("onLoadMessage","info"),this._overlays?.removeAll(),this.currentBestFeature=null}resetMeasurementData(){this.areaMeasurementResult=0,this.areaMeasurementAccuracy=0,this.distanceMeasurementResult=0,this.distanceAccuracyArray=[],this.heightMeasurementPixels=[],this.measurementVectors=[],this.heightMeasurementResult=0,this.tempDistance=null,this.measurementAngle=null,this.heightMeasurementAccuracy=0,this.heightGraphic=null,this.triangulatedDistanceMeasurement=null,this.triangulatedDistanceAccuracy=null,this.triangulatedAreaMeasurement=null,this.triangulatedMeasurementGraphic=null,this.updatingTriangularMeasurementState=!1,this.triangulatedAreaAccuracy=0}async saveDrawing(){const{dataCaptureLayer:e,sketchAdapter:t}=this;if(!e||"data-capture"!==t?.type)return;const{pendingGraphics:a,savedGraphics:i}=t,r=a.get(e.id),s=r?.toArray();if(!r||!s?.length)return;const{addFeatureResults:o}=await this.saveDataCaptureFeatures(s),n=o.reduce((t,{objectId:a,globalId:i,error:r},o)=>{const n=s[o],{attributes:c}=n;return r?t.error.push(n):(a&&(c[e.objectIdField]=a),i&&e.globalIdField&&(c[e.globalIdField]=i),t.success.push(n)),t},{success:[],error:[]});i.addMany(n.success),r.removeAll(),r.addMany(n.error)}async saveDataCaptureFeatures(e){const{activeViewer:t,currentBestFeature:a,dataCaptureLayer:r,mode:s}=this,o=t?.imageSize;if(!o||!a||"none"===s||"video"===s||"panoramic-video"===s)throw new n("orientedimageryviewer:missing-input","Image size, current best feature and mode are required to save data capture features");if(!r)throw new n("orientedimageryviewer:missing-featurelayer","Data capture layer is not available");const c=await Promise.all(e.map(async e=>{const t=e.clone(),{geometry:i}=t;if(!i)return;const n=i.type,c=r.hasZ,l=r.geometryType,h=n!==l,u=h?await import("./transformers.js"):null,d=u?.default[l],m=h?d?.(i):i;if(m)switch(m.type){case"point":return t.geometry=await this.getMapPoint(me(s,m,o),{feature:a,imageSize:o,mode:s}),c||(delete t.geometry.z,t.geometry.hasZ=!1),t.geometry.hasM=!1,t;case"polygon":{const e=await Promise.all(m.rings.map(async e=>this.getMapPoint(e.map(([e,t,a])=>me(s,{x:e,y:t,z:a},o)),{feature:a,imageSize:o,mode:s})));return t.geometry=new O({spatialReference:e[0][0].spatialReference,hasZ:c,hasM:!1,rings:e.map(e=>e.map(de))}),t}case"polyline":{const e=await Promise.all(m.paths.map(async e=>this.getMapPoint(e.map(([e,t,a])=>me(s,{x:e,y:t,z:a},o)),{feature:a,imageSize:o,mode:s})));return t.geometry=new j({spatialReference:e[0][0].spatialReference,hasZ:c,hasM:!1,paths:e.map(e=>e.map(de))}),t}}})),l=c.filter(i);return r.applyEdits({addFeatures:l}).then(e=>{const{addFeatureResults:t}=e;let a=0;const i=c.map(e=>{const i=t[a++];return e?i:{error:new n("orientedimageryviewer:save-unsucccessful","Error in saving data capture features"),objectId:null,globalId:null}});return{...e,addFeatureResults:i}})}async searchBestImage(e,t){try{const a=await W(e,t);a&&await this.processFeatureResponse(a,e.point,t)}catch(a){y(a)||(this.setMessage("imageLoadError","error",a.message),u.getLogger(this).error("error occurred while finding best image",a))}}selectTriangularMeasurementFeature(e){this.currentBestFeatureMeasurementImage=this.features?.find(({attributes:t})=>t.objectId===Number(e))}setAdditionalCameraLocationsVisibility(e){this.additionalCameraLocations.forEach(t=>{t.visible=e})}setAdditionalCoverageVisibility(e){this.additionalFootprints.forEach(t=>{t.visible=e})}setCurrentCoverageVisibility(e){this.bestFeatureCurrentFootprint&&(this.bestFeatureCurrentFootprint.visible=e),this.currentBestFeatureLocation&&(this.currentBestFeatureLocation.visible=e)}setMapImageConversionToolState(e){this.mapImageConversionToolState=e}setCurrentPanoramaView(e,t){this._panoramicViewer?.set({yaw:e,pitch:t})}async startDataCapture(e,t){const a=this.activeViewer?.imageRenderer,{oiObjectIdField:i,currentBestFeature:r}=this;if(!a||!r||!i)return;const{attributes:{objectId:o}}=r,n=this.overlayedMapFeatures.get(e.id)?.toArray()??[],c=[],l=[];for(const s of n)`${s.getAttribute(i)}`==`${o}`?c.push(s):l.push(s);this.overlayGraphicsOnImage(e.id,new s(l)),this.collectionId=e.id;const h=await this.loadSketch(t),u=await this.loadDataCaptureAdapter(t);v(t),h.addGraphics(c),u.savedGraphics.addMany(c);a.ui.find("zoom").visible=!1,a.map.layers.add(this.sketchGraphicsLayer)}async stopDataCapture(e=!1){this.sketch?.cancel(),this.sketchGraphicsLayer?.removeAll(),this.sketchAdapter=p(this.sketchAdapter),this.sketch=p(this.sketch),this.collectionId=null;const{dataCaptureLayer:t}=this,a=this.activeViewer?.imageRenderer;if(!a||a.destroyed)return;a.map.layers.remove(this.sketchGraphicsLayer),e&&t&&await this.overlayMapFeatures(t,!0);const i=a.ui.find("zoom");i&&(i.visible=!0)}stopMeasurement(){this.heightMeasurementPixels=[],this.draw?.reset(),this.sketch?.cancel()}toggleAllOverlayMapFeatures(e){this.overlayedMapFeatures.forEach(t=>{this._toggleVisiblity(t,e)})}toggleOverlayMapFeatures(e,t,a){const i=this.overlayedMapFeatures.get(e);i&&a&&this._toggleVisiblity(i,t)}toggleSelection(e){const{sketch:t}=this;t&&(t.updateOnGraphicClick=e,t.cancel())}async transformAndPlotReferencePointOnImage(e){const{feature:t,selectedLocation:a,options:i}=e;let r=!1,s=!1;const o=this.bestFeatureFootprint?.geometry;switch(o?.type){case"polygon":{const e=a.spatialReference.equals(o.spatialReference)?a:await B(a,o.spatialReference);r=o.contains(e);break}case"mesh":{const e=a.spatialReference.equals(o.spatialReference)?a:await B(a,o.spatialReference);s=o.extent.contains(e);break}}if(!r&&!s)return void this.clearReferencePointOnImage();const n=await this.worldToImage(a,t,i);if(n)return v(i),this.plotReferencePointOnImage(n),{x:n.x,y:n.y};this.clearReferencePointOnImage()}async triangulatedLocationWorkflow(e,t){if(this.currentBestFeature&&e){const{currentBestFeature:a}=this;this.triangulatedPoint&&(this.measurementVectors=[],this.triangulatedPoint=null,this.clearLocationPointOnImage(!0));const i=ze(e,a);if(!i)return;this.measurementVectors.push(i),await this.plotReferenceLocationPoint(e,t),v(t),this._createTriangularImageLocationHandle()}}async _calculateTriangulatedPointFromGroundPoint(e,t){if(this.currentBestFeatureMeasurementImage&&e){const{currentBestFeatureMeasurementImage:a}=this,i=ze(e,a);i&&this.measurementVectors.push(i);const r=await Ue(this.measurementVectors);v(t),this.triangulatedPoint=r??this.triangulatedPoint}}async _fetchFeatures(e,t){if(!this.view)return;const a=this.layer;if(a){const i={include:a},r=this.view.toScreen(e);if(!r)return;const s=await this.view.hitTest(r,i);return this._processHitTestResults(a,s,t)}}async _fetchFeaturesWithController(e,t){try{await this._fetchFeatures(e,t)}catch(a){if(y(a))return;this.setMessage("imageLoadError","error"),u.getLogger(this).error("error occurred while fetching features",a)}}_groupFeaturesBySectors(){const{_suitabilities:e,additionalFeatures:t,features:a,invalidCameraHeading:i}=this,r=a.at(0);if(!e||!t||!r||!a||i)return void(this._sectorData=null);this._sectorData={};const o={};this._featureToSector=o;for(const h of Ae)this._sectorData[h]=new s;const n=e.map((e,t)=>({...e,featureIndex:t}));n.sort((e,t)=>e.trueSuitability-t.trueSuitability);const c=n.map(({distance:e})=>e),l=Math.max(...c);n.forEach(e=>{const{distance:t,angle:i,featureIndex:s}=e,n=t/l*Le[2],c=lt(t,l),h=ct(i);if(!this._sectorData)return;const u=Le[3]+n*Math.sin(i*Math.PI/180),d=Le[3]+n*Math.cos(i*Math.PI/180);let m;const p=a.at(s),g=p===r,{cameraPitch:y}=p.attributes,v=y<5;if(g&&v)m=-90;else{const e=u-Le[3],t=d-Le[3],a=t/Math.sqrt(e**2+t**2);let i=180*Math.acos(a)/Math.PI;(e<0&&t<0||e<0&&t>0)&&(i*=-1),m=i}const w=""===c?h:`${c}_${h}`;g&&(m===this.bestFeatureAngle?this.previousFeatureAngle=m:this.bestFeatureAngle=m,this.navigatorCurrentBestFeature=v?null:{x:u,y:d,direction:h}),o[`${p.attributes.objectId}`]=w;const f=this._sectorData[w];f.add({angle:i,featureIndex:s,x:u,y:d,objectID:p.attributes.objectId,sector:w,featureIndexInSector:f.length})})}_handleDestroyedTriangularSketchLayer(){this.sketchTriangularGraphicsLayer&&this.activeTriangulatedViewer&&(this.activeTriangulatedViewer.imageRenderer.map.layers.remove(this.sketchTriangularGraphicsLayer),this.sketchTriangularGraphicsLayer=new U,this.activeTriangulatedViewer.imageRenderer.map.layers.add(this.sketchTriangularGraphicsLayer),this.sketchTriangular&&(this.sketchTriangular.layer=this.sketchTriangularGraphicsLayer,this.sketchTriangular.view=this.activeTriangulatedViewer.imageRenderer))}_initializeMeasurementService(){this._measurementService||(this._measurementService=new ft(this))}_initializeSketchTriangular(){this.activeTriangulatedViewer&&(this.sketchTriangular=new Ft({view:this.activeTriangulatedViewer.imageRenderer,layer:this.sketchTriangularGraphicsLayer,updateOnGraphicClick:!1,defaultUpdateOptions:{toggleToolOnClick:!1}}))}_initializeSketchTriangularGraphicsLayer(){this.activeTriangulatedViewer&&(this.sketchTriangularGraphicsLayer=new U,this.activeTriangulatedViewer.imageRenderer.map.layers.add(this.sketchTriangularGraphicsLayer))}_initializeVideo(){if(this.videoElement||!this.currentBestFeature)return;this.removeHandles(_t.videoPlayerHandles),this.videoElement=new fe({video:this.currentBestFeature.attributes.imagePath,georeference:new ve({extent:new L(Ce)}),autoplay:!1}),this.videoElement.content?.loop&&(this.videoElement.content.loop=!1);const e=new N({source:this.videoElement,title:this.layer?.title,copyright:this.layer?.copyright});this.videoLayer=e,e&&this.videoMapView.map.layers.add(e),this.addHandles(dt(this.videoMapView),_t.videoPlayerHandles),this.videoViewModel=new gt({oiViewModel:this})}_plotLocationPointOnDefaultImage(e,a=!1){const i=A(e)?e.toJSON():e;i.x-=.5,i.y=.5-i.y,a?(this._correctedLocationPointOnImage=new t({geometry:new T({spatialReference:H.WebMercator,...i}),symbol:Ye}),this.imageMeasurementViewer.addGraphic(this._correctedLocationPointOnImage,0)):(this._locationPointOnImage=new t({geometry:new T({spatialReference:H.WebMercator,...i}),symbol:Ye}),this._imageViewer.addGraphic(this._locationPointOnImage,0))}_plotLocationPointOnPanoramicImage(e,a=!1){const i=a?this._panoramicMeasurementViewer:this._panoramicViewer,{imageSize:r}=i;if(!r)return;const[s,o]=r,{heading:n,pitch:c}=oe(e,s,o),l=ne(n,c),h=new t({geometry:new T(l,H.WebMercator),symbol:et});a?this._correctedLocationPointOnImage=h:this._locationPointOnImage=h,i.addGraphic(h,0)}_clearFeatureGeometries(){this.coveragePolygons.removeAll(),this.coverageFrustums.removeAll(),this.pointSources.removeAll()}_checkFeatures(e){return!!e?.length||(this.setMessage("noImageError","error"),this.currentBestFeature=null,!1)}async _getElevationSampleFromGround(e,t,a){if(!e[0])return;const i=await G(e);if(this._updateFootprintWithFeatures(t,i),"3d"===this.view?.type)try{return await this.view.map.ground.createElevationSampler(this.footprintExtent,a)}catch(r){y(r)||u.getLogger(this).error(r)}}async processElevationSample(e,t,a){const{elevationSource:i}=t[0].attributes,r=await this._getElevationSampleFromGround(e,t,a);return r||(i&&this.footprintExtent&&X(i)?await ie({extent:this.footprintExtent,lod:i.lod,url:i.url,rasterFunction:i.rasterFunction}):void 0)}_processSuitableFeatures(e,t){return $({features:e,selectedPoint:t,camera:ht(this.view)?this.view.camera:null,currentImage:this.currentBestFeature})}async _processHitTestResults(e,t,a){const{screenPoint:i,results:[r]}=t,s="graphic"===r?.type&&this.shouldShowSelectedImage,o=r?.mapPoint??this.view?.toMap(i);if(!o)return;o.x=D(o.x,o.spatialReference);const{layerFloorFilterClause:n}=this,c=e.spatialReference.equals(o.spatialReference)?o:await B(o,e.spatialReference),l=c.spatialReference.isGeographic?z(c):c,h=P("1=1",P(e.definitionExpression,n)),u=l.spatialReference.isGeographic?1:V(l.spatialReference),d={layerInstanceOrURL:e,point:l,queryParams:{where:h,maximumDistance:e.maximumDistance?e.maximumDistance/u:void 0,objectIds:s?[r.graphic.getAttribute(e.objectIdField)]:void 0}};await this.searchBestImage(d,a)}async _queryAndLoadByObjectId(e,t,a,i){this.displayMessage=null;const{response:r}=await wt(e,t,a,i);if(v(i),!r?.features?.length)throw new vt(t);const s=J(r.features[0].attributes).polygon,o=T.fromJSON(x(s)),n=Y(o),c=V(n.spatialReference);this.selectedPoint=n;const l={layerInstanceOrURL:e,point:n,queryParams:{where:P(P("1=1",P(e.definitionExpression,a)),`${e.objectIdField} <> ${t}`),maximumDistance:e.maximumDistance?e.maximumDistance/c:void 0}},h=await W(l,i);v(i);const{features:u}=h;return u.push(r.features[0]),await this.processFeatureResponse(h,n,{...i,loadBestImage:!1})}_reorderTriangularSketchLayer(){const e=this.imageMeasurementViewer.imageRenderer.map.layers?.length;this.sketchTriangularGraphicsLayer&&e&&this.imageMeasurementViewer.imageRenderer.map.layers.reorder(this.sketchTriangularGraphicsLayer,e-1)}_resetCursor(){const{activeViewer:e,imageMeasurementViewer:t}=this;e&&this.removeHandles(_t.activeViewerCursorHandles),t&&this.removeHandles(_t.imageViewerCursorHandles)}async _setImageSource(e,t,a,i,r,s){e.imageSource={datasetFormat:t.toUpperCase(),url:a.split("?")[0]},e.customParameters=Object.fromEntries(i),e.imageRotation=r??0,await e.loadImage(s)}_setMeasurementCursor(){const{activeViewer:e,imageMeasurementViewer:t,triangularMeasurementActive:a}=this;e&&this.addHandles(e.imageRenderer.acquireCursor("crosshair","high"),_t.activeViewerCursorHandles),t&&a&&this.addHandles(t.imageRenderer.acquireCursor("crosshair","high"),_t.activeViewerCursorHandles)}_toggleVisiblity(e,t){e.forEach(e=>{e.visible=t})}async _updateElevationOfSelectedPointAndLocations(e,t,a,i){const r=he(a),{location:s,cameraHeight:o}=e[0].attributes,n=await le(s.spatialReference,s.z,o,{elevationSample:r?a:void 0,elevationSource:r?void 0:e[0].attributes.elevationSource,extent:this.footprintExtent},i);v(i);const[c,...l]=await ae([t,...e.map(e=>e.attributes.geometry.clone())],n);v(i),t.elevation=c.z,e.forEach((e,t)=>{e.attributes.elevation=l[t].z})}_updateFeatures(e,t=!0){if(!e.length)return this.currentBestFeature=null,void this.additionalFeatures.removeAll();this.features.removeAll(),this.features.addMany(e),this.navigationNodes.removeAll(),this.navigationNodes.addMany(e.map(e=>{const{geometry:t,attributes:a}=e,{isSpherical:i,cameraHeading:r,cameraPitch:s}=a;return new pt({geometry:t,attributes:a,currentHeading:i?0:r,currentPitch:i?0:s})})),e.length>1?this.additionalFeatures.addMany(e.slice(1)):this.additionalFeatures.removeAll(),this._updateGroundElevation=!0,t&&(this.currentBestFeature=e[0]),"video"===this.mode&&(this._initializeVideo(),this.videoElement?.loaded&&this.videoViewModel?.playVideoFromSelectedLocation(e[0])),"panoramic-video"===this.mode&&this._loadVideo()}_updateFootprintWithFeatures(e,t){const a=[];for(const{attributes:{geometry:i}}of e)t.contains(i)||a.push([i.x,i.y]);a.sort((e,t)=>+E([e,t])),t.addRing(a),this.footprintExtent=be(t.extent,2,2)}async _updatePointsAndPolygons(e){const{pointSources:a,currentBestFeature:i,currentCoverageVisible:r,isAdditionalPointSourcesVisible:s,mode:o,layer:n}=this;if(i&&(this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint&&(this.bestFeatureCurrentFootprint.destroy(),this.bestFeatureCurrentFootprint=null,this.bestFeatureFootprint=null),!this.invalidCameraHeading)){await(this._adapter?.createFootprints(e)),v(e);for(const e of a)e.imageID===i.attributes.objectId?this.currentBestFeatureLocation=new t({attributes:{imageID:e.imageID},geometry:e.clone(),symbol:tt,visible:r}):this.additionalCameraLocations.push(new t({attributes:{imageID:e.imageID},geometry:e.clone(),symbol:at,visible:s}));if(("video"===o||"panoramic-video"===o)&&n&&!this.featureCache.length){const e=await q(n,i.geometry.spatialReference);e.features?.length&&(this.featureCache=e.features)}}}_updateCurrentBestFeature(e){if(!e)return;if(this.currentBestFeature=this.features?.at(e.featureIndex),"video"===this.mode||"panoramic-video"===this.mode)return void(this.currentBestFeature&&this.videoViewModel?.playVideoFromSelectedLocation(this.currentBestFeature));const t=this.currentBestFeature?.attributes.cameraPitch&&this.currentBestFeature?.attributes.cameraPitch<5;let a;if(t)a=-90;else{const t=e.x-Le[3],i=e.y-Le[3],r=i/Math.sqrt(t**2+i**2);let s=180*Math.acos(r)/Math.PI;(t<0&&i<0||t<0&&i>0)&&(s*=-1),a=s}a===this.bestFeatureAngle?this.previousFeatureAngle=a:this.bestFeatureAngle=a,this.navigatorCurrentBestFeature=t?null:{x:e.x,y:e.y,direction:e.sector.includes("_")?e.sector.split("_")[1]:e.sector}}_updateImageMeasurementBestFeature(e){e&&(this.currentBestFeatureMeasurementImage=this.features?.at(e.featureIndex))}clearGraphics(){this._imageViewer.clearGraphics(),this._panoramicViewer.clearGraphics(),this.imageMeasurementViewer.clearGraphics(),this._panoramicMeasurementViewer.clearGraphics()}clearReferencePointOnImage(){this._referencePointOnImage&&(this._imageViewer.removeGraphic(this._referencePointOnImage),this._panoramicViewer.removeGraphic(this._referencePointOnImage),this._referencePointOnImage=p(this._referencePointOnImage))}clearLocationPointOnImage(e=!1){this._locationPointOnImage&&!e&&(this._imageViewer.removeGraphic(this._locationPointOnImage),this._panoramicViewer.removeGraphic(this._locationPointOnImage),this._locationPointOnImage=p(this._locationPointOnImage)),this._correctedLocationPointOnImage&&(this.imageMeasurementViewer.removeGraphic(this._correctedLocationPointOnImage),this._panoramicMeasurementViewer.removeGraphic(this._correctedLocationPointOnImage),this._correctedLocationPointOnImage=p(this._correctedLocationPointOnImage))}plotReferencePoint(e){"mapPoint"in e?this.plotReferencePointOnGround(e.mapPoint):this.plotReferencePointOnGround(e)}async plotReferenceLocationPoint(e,t){if(this.currentBestFeatureMeasurementImage){const a=await this.worldToImage(e,this.currentBestFeatureMeasurementImage,{signal:t});v(t),a&&this.plotLocationPointOnImage(a,!0)}}setMessage(e,t,a,i){this.displayMessage={key:e,type:t,data:a,map:i}}async transformAndPlotSelectedLocation(e){const{currentBestFeature:t,invalidCameraHeading:a,selectedPoint:i,activeViewer:r}=this;if(this._crossSymbol&&(this._panoramicViewer.removeGraphic(this._crossSymbol),this._imageViewer.removeGraphic(this._crossSymbol),this._crossSymbol=p(this._crossSymbol)),!i||!t||"image-loaded"!==r?.state||a)return;let s;try{s=await this.worldToImage(i,t,e),v(e),await this.plotSelectedPointOnImage(s,e)}catch(o){y(o)||u.getLogger(this).error("failed to transform map point to pixel, cross symbol will not be plotted on image",{error:o,selectedPoint:i,feature:t})}}async worldToImage(e,t,a){const{footprintExtent:i}=this,{imageSize:r}=this.activeViewer;if("none"===this.mode||!t||!r||!i)return;const{attributes:{location:s,elevationSource:o,cameraHeading:n,cameraHeight:c},elevationSample:l}=t;let h=s.clone();const u=await le(s.spatialReference,s.z??0,c,{elevationSample:l,elevationSource:o});t.elevationSample=u.elevationSample;const d=Array.isArray(e)?e:[e];let m,p=await Promise.all(d.map(e=>new Promise(t=>{if(!e.hasZ)return t(ae(e,u));t(e)})));if(s.spatialReference.isGeographic&&(h=await B(h,H.WebMercator,a)),p=await Promise.all(p.map(async e=>h.spatialReference.equals(e.spatialReference)?e:await B(e,h.spatialReference,a))),v(a),"panoramic"===this.mode)m=ye(p,{imageHeight:r[1],imageWidth:r[0],cameraHeading:n,cameraLocation:h});else{const e=pe(t.attributes,r[0],r[1]);m=ge(p,{...e,cameraLocation:h})}return Array.isArray(e)?m:m[0]}updateCurrentCoveragePolygon(e){const{additionalFootprints:a,additionalCameraLocations:i,currentBestFeature:r,currentBestFeatureLocation:s,currentCoverageVisible:o,selectedPoint:n,view:c,_adapter:l,mode:h}=this;if(!r)return;const{attributes:{objectId:u},elevationSample:d}=r;if(this._initialCurrentCoverageUpdate){if(this._overlays?.removeAll(),this._initialCurrentCoverageUpdate=!1,this.bestFeatureCurrentFootprint=p(this.bestFeatureCurrentFootprint),e&&!this.invalidCameraHeading&&(e.visible=o,this.bestFeatureCurrentFootprint=e),c){const e=[...a,...i,s].filter(ut);"3d"===c?.type&&d&&l?.updateGroundElevation&&(this._updateGroundElevation&&l.updateGroundElevation(e,d),"panoramic"===h&&l.updateGroundElevation([this.bestFeatureCurrentFootprint],d)),this._updateGroundElevation=!1,n&&(e.splice(-2,0,this.bestFeatureCurrentFootprint),e.push(new t({geometry:n.clone(),symbol:Ne.clone(),attributes:{imageID:u}}))),this._overlays.graphics.addMany(e)}}else if(c){if(this.invalidCameraHeading)return;this.bestFeatureCurrentFootprint&&(this._overlays?.remove(this.bestFeatureCurrentFootprint),this.bestFeatureCurrentFootprint=p(this.bestFeatureCurrentFootprint));const t=this.bestFeatureCurrentFootprint&&this._overlays?this._overlays.graphics.indexOf(this.bestFeatureCurrentFootprint):-1;e&&(this.bestFeatureCurrentFootprint=e,"3d"===c?.type&&d&&l?.updateGroundElevation&&"panoramic"===h&&l.updateGroundElevation([e],d),e.visible=this.currentCoverageVisible,this._overlays?.graphics.add(this.bestFeatureCurrentFootprint,t>=0?t:this._overlays.graphics.length-1))}}};e([S()],Vt.prototype,"activeLayer",null),e([S({readOnly:!0})],Vt.prototype,"activeViewer",null),e([S()],Vt.prototype,"activeTriangulatedViewer",null),e([S()],Vt.prototype,"accuracyParametersMissing",null),e([S()],Vt.prototype,"additionalFeatures",void 0),e([S({type:s.ofType(t)})],Vt.prototype,"additionalCameraLocations",void 0),e([S({type:s.ofType(t)})],Vt.prototype,"additionalFootprints",void 0),e([S()],Vt.prototype,"areaMeasurementResult",void 0),e([S()],Vt.prototype,"areaMeasurementAccuracy",void 0),e([S()],Vt.prototype,"bestFeatureAngle",void 0),e([S()],Vt.prototype,"bestFeatureCurrentFootprint",void 0),e([S({type:t})],Vt.prototype,"bestFeatureFootprint",void 0),e([S({type:Number})],Vt.prototype,"brightness",null),e([S()],Vt.prototype,"cameraHeadingThreshold",void 0),e([S()],Vt.prototype,"cameraPitchThreshold",void 0),e([S()],Vt.prototype,"clickAction",void 0),e([S()],Vt.prototype,"videoViewModel",void 0),e([S()],Vt.prototype,"collectionId",void 0),e([S({type:Number})],Vt.prototype,"contrast",null),e([S()],Vt.prototype,"conversionProps",void 0),e([S()],Vt.prototype,"coverageFrustums",void 0),e([S()],Vt.prototype,"coveragePolygons",void 0),e([S()],Vt.prototype,"currentBestFeature",void 0),e([S()],Vt.prototype,"currentBestFeatureMeasurementImage",void 0),e([S()],Vt.prototype,"currentBestFeatureLocation",void 0),e([S()],Vt.prototype,"currentCoverageVisible",void 0),e([S()],Vt.prototype,"currentNode",null),e([S()],Vt.prototype,"depthImage",void 0),e([S()],Vt.prototype,"depthImageNotSupported",null),e([S()],Vt.prototype,"directionMode",void 0),e([S()],Vt.prototype,"featureCache",void 0),e([S()],Vt.prototype,"navigationNodes",void 0),e([S({json:{write:!1}})],Vt.prototype,"determineWorkflowForFeature",void 0),e([S({json:{write:!1}})],Vt.prototype,"determineWorkflowForTriangularMeasurement",void 0),e([S()],Vt.prototype,"disabled",void 0),e([S()],Vt.prototype,"displayMessage",void 0),e([S()],Vt.prototype,"displayNewMeasurementButton",void 0),e([S()],Vt.prototype,"distanceMeasurementResult",void 0),e([S()],Vt.prototype,"distanceAccuracyArray",void 0),e([S()],Vt.prototype,"dataCaptureLayer",void 0),e([S({readOnly:!0})],Vt.prototype,"featureCount",null),e([S()],Vt.prototype,"features",void 0),e([S()],Vt.prototype,"groundCoordinates",void 0),e([S()],Vt.prototype,"groundCoordinatesAccuracy",void 0),e([S()],Vt.prototype,"heightMeasurementPixels",void 0),e([S()],Vt.prototype,"heightGraphic",void 0),e([S()],Vt.prototype,"heightMeasurementResult",void 0),e([S()],Vt.prototype,"heightMeasurementAccuracy",void 0),e([S()],Vt.prototype,"measurementAngle",void 0),e([S()],Vt.prototype,"tempDistance",void 0),e([S({readOnly:!0})],Vt.prototype,"imageGalleryEnabled",null),e([S()],Vt.prototype,"imageGeometryField",void 0),e([S({readOnly:!0})],Vt.prototype,"imageLoaded",null),e([S()],Vt.prototype,"imageLocationToolState",void 0),e([S({readOnly:!0})],Vt.prototype,"invalidCameraHeading",null),e([S()],Vt.prototype,"imagePointsInView",null),e([S()],Vt.prototype,"imageMeasurementViewer",void 0),e([S()],Vt.prototype,"isAdditionalCoverageVisible",void 0),e([S()],Vt.prototype,"isAdditionalPointSourcesVisible",void 0),e([S()],Vt.prototype,"measurementVectors",void 0),e([S()],Vt.prototype,"layer",void 0),e([S()],Vt.prototype,"layerView",null),e([S({readOnly:!0})],Vt.prototype,"layerFloorFilterClause",null),e([S({type:Number})],Vt.prototype,"localPort",void 0),e([S()],Vt.prototype,"mapImageConversionToolState",void 0),e([S()],Vt.prototype,"measureType",void 0),e([S()],Vt.prototype,"measurementGraphic",void 0),e([S({readOnly:!0,value:"none"})],Vt.prototype,"mode",null),e([S()],Vt.prototype,"navigationMode",void 0),e([S()],Vt.prototype,"navigatorCurrentBestFeature",void 0),e([S()],Vt.prototype,"oiObjectIdField",void 0),e([S({type:s.ofType(t)})],Vt.prototype,"overlayedCameraLocations",void 0),e([S()],Vt.prototype,"overlayedMapFeatures",void 0),e([S()],Vt.prototype,"panoramicVideoLoaded",null),e([S()],Vt.prototype,"pixelCoordinates",void 0),e([S()],Vt.prototype,"preserveAngle",void 0),e([S()],Vt.prototype,"pointSources",void 0),e([S({readOnly:!0})],Vt.prototype,"popupEnabled",null),e([S()],Vt.prototype,"previousFeatureAngle",void 0),e([S()],Vt.prototype,"referencePoint",null),e([S({readOnly:!0})],Vt.prototype,"sectorData",null),e([S()],Vt.prototype,"selectedPoint",void 0),e([S({type:Number})],Vt.prototype,"sharpness",null),e([S()],Vt.prototype,"shouldShowSelectedImage",void 0),e([S()],Vt.prototype,"sketch",void 0),e([S()],Vt.prototype,"sketchTriangular",void 0),e([S()],Vt.prototype,"sketchTriangularGraphicsLayer",void 0),e([S()],Vt.prototype,"draw",void 0),e([S()],Vt.prototype,"sketchAdapter",void 0),e([S({readOnly:!0})],Vt.prototype,"sketchGraphicsLayer",null),e([S({readOnly:!0})],Vt.prototype,"state",null),e([S({readOnly:!0})],Vt.prototype,"thumbnails",null),e([S()],Vt.prototype,"triangularMeasurementActive",void 0),e([S()],Vt.prototype,"triangulatedDistanceMeasurement",void 0),e([S()],Vt.prototype,"triangulatedDistanceAccuracy",void 0),e([S()],Vt.prototype,"triangulatedAreaMeasurement",void 0),e([S()],Vt.prototype,"triangulatedAreaAccuracy",void 0),e([S()],Vt.prototype,"triangulatedMeasurementGraphic",void 0),e([S()],Vt.prototype,"triangulatedPoint",void 0),e([S()],Vt.prototype,"triangulatedMeasurementAdapter",void 0),e([S()],Vt.prototype,"updateFootprint",void 0),e([S()],Vt.prototype,"updateFootprintPanorama",void 0),e([S()],Vt.prototype,"updatingTriangularMeasurementState",void 0),e([S({value:null})],Vt.prototype,"view",null),e([S()],Vt.prototype,"videoElement",void 0),e([S()],Vt.prototype,"videoLayer",void 0),e([S()],Vt.prototype,"videoMapView",void 0),e([S()],Vt.prototype,"_adapter",void 0),e([S()],Vt.prototype,"_defaultGraphicsLayer",null),e([S()],Vt.prototype,"_highlightedFeatureHandle",void 0),e([S()],Vt.prototype,"_imageViewer",void 0),e([S()],Vt.prototype,"_initialCurrentCoverageUpdate",void 0),e([S()],Vt.prototype,"_locationPointOnImage",void 0),e([S()],Vt.prototype,"_measurementService",void 0),e([S()],Vt.prototype,"_correctedLocationPointOnImage",void 0),e([S()],Vt.prototype,"_overlays",void 0),e([S({readOnly:!0})],Vt.prototype,"_overlaysView",null),e([S()],Vt.prototype,"_panoramicVideoViewer",void 0),e([S()],Vt.prototype,"_panoramicViewer",void 0),e([S()],Vt.prototype,"_panoramicMeasurementViewer",void 0),e([S()],Vt.prototype,"_referencePointOnGround",void 0),e([S()],Vt.prototype,"_referencePointOnImage",void 0),e([S()],Vt.prototype,"_sectorData",void 0),e([S()],Vt.prototype,"_featureToSector",void 0),e([S({readOnly:!0})],Vt.prototype,"_updatingHandles",void 0),e([S()],Vt.prototype,"footprintExtent",void 0),e([S()],Vt.prototype,"_featureChangedTask",void 0),Vt=e([k("esri.widgets.OrientedImageryViewer.OrientedImageryViewerViewModel")],Vt);const St=Vt;export{St as default};
5
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{equals as a,isSome as i}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import{deprecatedProperty as o}from"../../core/deprecate.js";import n from"../../core/Error.js";import{EventedMixin as c}from"../../core/Evented.js";import{makeHandle as l}from"../../core/handleUtils.js";import{equalsShallow as h}from"../../core/lang.js";import u from"../../core/Logger.js";import{clamp as d}from"../../core/mathUtils.js";import{abortMaybe as m,destroyMaybe as p}from"../../core/maybe.js";import{EsriPromise as g}from"../../core/Promise.js";import{isAbortError as y,throwIfAborted as v,waitTick as w}from"../../core/promiseUtils.js";import f from"../../core/ReactiveMap.js";import{whenOnce as F,on as _,watch as b,syncAndInitial as M,initial as I}from"../../core/reactiveUtils.js";import{sqlAnd as P}from"../../core/sql.js";import{getMetersPerUnitForSR as V}from"../../core/unitUtils.js";import{property as S}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as k}from"../../core/accessorSupport/decorators/subclass.js";import{isSerializable as A}from"../../core/support/jsonUtils.js";import{UpdatingHandles as C}from"../../core/support/UpdatingHandles.js";import L from"../../geometry/Extent.js";import{union as G}from"../../geometry/geometryEngineAsync.js";import R from"../../geometry/Multipoint.js";import T from"../../geometry/Point.js";import O from"../../geometry/Polygon.js";import j from"../../geometry/Polyline.js";import{projectWithZConversion as B}from"../../geometry/projectionUtils.js";import H from"../../geometry/SpatialReference.js";import{polygonCentroidPoint as x}from"../../geometry/support/centroid.js";import{isClockwise as E}from"../../geometry/support/coordsUtils.js";import{normalizeMapX as D}from"../../geometry/support/normalizeUtils.js";import{geographicToWebMercator as z}from"../../geometry/support/webMercatorUtils.js";import U from"../../layers/GraphicsLayer.js";import N from"../../layers/MediaLayer.js";import{searchImages as W,getSortedLayerFeatures as q}from"../../layers/orientedImagery/queries.js";import{calculateSuitabilities as $}from"../../layers/orientedImagery/core/bestImageUtils.js";import{createCoveragePolygon as J,computePolygonForInspection as Z,resizePolygon as K,checkIfPolygonContainsSelectedPoint as Q}from"../../layers/orientedImagery/core/coverageUtils.js";import{isElevationSource as X}from"../../layers/orientedImagery/core/ElevationSourceDefinitions.js";import{convertGeographicToWebMercator as Y}from"../../layers/orientedImagery/core/utils.js";import{imageToWorld as ee,imageToWorldPanoramic as te}from"../../layers/orientedImagery/transformations/imageToWorld.js";import ae from"../../layers/orientedImagery/transformations/updateElevation.js";import{getElevationSampler as ie}from"../../layers/orientedImagery/transformations/updateElevationUtils.js";import{or as re,getInitialAngle as se,convertPixelToHeadingPitch as oe,convertHeadingPitchToSphereVertex as ne,getImageToWorldProperties as ce,getUpdateElevationProps as le,isElevationSampler as he,getImageToWorldPanoramicProperties as ue,pointToArray as de,transformGraphicCoordinatesToPixel as me,getWorldToImageProperties as pe}from"../../layers/orientedImagery/transformations/utils.js";import{worldToImage as ge,worldToImagePanoramic as ye}from"../../layers/orientedImagery/transformations/worldToImage.js";import ve from"../../layers/support/ExtentAndRotationGeoreference.js";import{getFloorFilterClause as we}from"../../layers/support/floorFilterUtils.js";import fe from"../../layers/support/VideoElement.js";import Fe from"../../views/MapView.js";import _e from"../../views/draw/Draw.js";import{scale as be}from"../../views/draw/support/drawUtils.js";import{ViewEventPriorities as Me}from"../../views/input/InputManager.js";import Ie from"../PanoramicVideoViewer.js";import Pe from"../PanoramicViewer.js";import{defaultAngleThresholdInDegrees as Ve,videoExtent as Se,invalidCameraHeading as ke,sectorsInOrder as Ae,sampleExtent as Ce,sectorsRadii as Le}from"./constants.js";import{configureSketchTool as Ge,extractFieldsFromDataCaptureLayer as Re,isValidDataCaptureLayer as Te,constructGraphicFromImageGeometry as Oe}from"./dataCaptureUtils.js";import{isFeatureAttachment as je,getImageSourceFromAttachment as Be}from"./galleryUtils.js";import{getModeCorrectedPoint as He,calculateCorrectedPixel as xe,getUnitRateFromSpatialReference as Ee,calculateHeightFromTemporaryDistance as De,computeTriangulatedVector as ze,computeTriangulatedPoint as Ue}from"./imageMeasurementUtils.js";import{crossSymbol as Ne,crossSymbol3D as We,measurementPolygonSymbol as qe,polylineSymbolPanoramic as $e,measurementPolylineSymbol as Je,cameraOverlaySymbol3D as Ze,cameraOverlaySymbol as Ke,diamondSymbol as Qe,diamondSymbol3D as Xe,locationSymbol as Ye,locationSymbol3D as et,activeSourcePointSymbol as tt,sourcePointSymbol as at}from"./symbols.js";import{isNoAttachmentError as it,getContentType as rt,isTifOrMrf as st,filterOILLayerView as ot,assignElevationSampleToFeatures as nt,calculateDirection as ct,calculateSegment as lt,isSceneView as ht,isGraphic as ut}from"./utils.js";import{disableVideoZoomAndPan as dt}from"./videoViewerUtils.js";import mt from"./components/ImageViewer.js";import pt from"./components/NavigationNode.js";import gt from"./components/OrientedImageryVideoViewModel.js";import{NoActiveViewerError as yt,NoFeatureFoundWithObjectIdError as vt}from"./navigation/errors.js";import{queryFeatureByObjectIds as wt}from"./navigation/queries.js";import{ImageMeasurementService as ft}from"./services/ImageMeasurementService.js";import Ft from"../Sketch/SketchViewModel.js";const _t={click:"view-click",imageClick:"image-click",triangularImageClick:"triangular-click",interactionHandles:"interaction-handles",hittestHandles:"hittest-handles",videoPlayerHandles:"video-handles",activeViewerCursorHandles:"active-viewer-cursor-handles",imageViewerCursorHandles:"image-viewer-cursor-handles"},bt=new Set(["JPG","JPEG","TIFF","TIF","MRF"]),Mt=new Set(["MRF","TIFF","TIF"]),It=/\.(\w+)$/,Pt=()=>new n("orientedimageryviewer:sketch-not-initialized","Sketch property is not initialized, call loadSketch first");let Vt=class extends(c(g)){constructor(e){super(e),this.additionalFeatures=new s,this.additionalCameraLocations=new s,this.additionalFootprints=new s,this.areaMeasurementResult=0,this.areaMeasurementAccuracy=0,this.bestFeatureAngle=0,this.bestFeatureCurrentFootprint=null,this.bestFeatureFootprint=null,this.cameraHeadingThreshold=Ve,this.cameraPitchThreshold=Ve,this.clickAction="hittest",this.videoViewModel=null,this.collectionId=null,this.conversionProps=null,this.coverageFrustums=new s,this.coveragePolygons=new s,this.currentBestFeature=null,this.currentBestFeatureMeasurementImage=null,this.currentBestFeatureLocation=null,this.currentCoverageVisible=!0,this.depthImage=null,this.directionMode="Relative",this.featureCache=[],this.navigationNodes=new s,this.determineWorkflowForFeature=async(e,t,a)=>{const{currentBestFeature:i,selectedPoint:r,view:s}=this;if(s?.closePopup(),i&&r){this._initialCurrentCoverageUpdate=!0,this._updateGroundElevation=!0;try{await this._updatePointsAndPolygons(a),await this._loadDepthImage(a),await this._loadImage(a)}catch(o){y(o)||(this.loadImageError(o),u.getLogger(this).error("#loadIImage()","error occured while loading image",o))}}},this.determineWorkflowForTriangularMeasurement=async(e,t,a)=>{if(this.view?.closePopup(),this.currentBestFeatureMeasurementImage&&this.selectedPoint)try{await this._loadMeasurementViewerImage(a)}catch(i){y(i)||(this.loadImageError(i),u.getLogger(this).error("#loadIImage()","error occured while loading image",i))}},this.disabled=!1,this.displayMessage={key:"onLoadMessage",type:"info"},this.displayNewMeasurementButton=!0,this.distanceMeasurementResult=0,this.distanceAccuracyArray=[],this.dataCaptureLayer=null,this.features=new s,this.groundCoordinates=null,this.groundCoordinatesAccuracy=null,this.heightMeasurementPixels=[],this.heightGraphic=null,this.heightMeasurementResult=0,this.heightMeasurementAccuracy=0,this.measurementAngle=null,this.tempDistance=null,this.imageGeometryField=null,this.imageLocationToolState=!1,this.imageMeasurementViewer=new mt,this.isAdditionalCoverageVisible=!1,this.isAdditionalPointSourcesVisible=!1,this.measurementVectors=[],this.layer=null,this.localPort=null,this.mapImageConversionToolState=!1,this.measureType=null,this.measurementGraphic=null,this.navigatorCurrentBestFeature=null,this.oiObjectIdField=null,this.overlayedCameraLocations=new s,this.overlayedMapFeatures=new f,this.pixelCoordinates=null,this.preserveAngle="none",this.pointSources=new s,this.previousFeatureAngle=0,this.selectedPoint=null,this.shouldShowSelectedImage=!1,this.sketch=null,this.sketchTriangular=null,this.sketchTriangularGraphicsLayer=null,this.draw=null,this.sketchAdapter=null,this.triangularMeasurementActive=!1,this.triangulatedDistanceMeasurement=null,this.triangulatedDistanceAccuracy=null,this.triangulatedAreaMeasurement=null,this.triangulatedAreaAccuracy=0,this.triangulatedMeasurementGraphic=null,this.triangulatedPoint=null,this.triangulatedMeasurementAdapter=null,this.updateFootprint=async(e,t)=>{"default"===this.mode&&"image-loaded"!==this.state||this.mode.includes("video")&&!this.videoElement?.content||await(this._adapter?.updateFootprint(e,t))},this.updateFootprintPanorama=async(e,t)=>{await(this._adapter?.updateFootprintPanorama(e,t))},this.updatingTriangularMeasurementState=!1,this.videoElement=null,this.videoLayer=null,this.videoMapView=new Fe({map:new Map}),this._adapter=null,this._highlightedFeatureHandle=null,this._imageViewer=new mt,this._initialCurrentCoverageUpdate=!0,this._locationPointOnImage=null,this._measurementService=null,this._correctedLocationPointOnImage=null,this._overlays=new U({listMode:"hide",internal:!0,elevationInfo:{mode:"absolute-height"},title:"OrentedImageryViewerViewModel overlays layer"}),this._panoramicVideoViewer=new Ie,this._panoramicViewer=new Pe,this._panoramicMeasurementViewer=new Pe,this._referencePointOnGround=null,this._referencePointOnImage=null,this._sectorData=null,this._featureToSector=null,this._updatingHandles=new C,this._clickTask=null,this._crossSymbol=null,this.footprintExtent=null,this._featureChangedTask=null,this._openPopupTask=null,this._suitabilities=null,this._transformController=new AbortController,this._updateFootprintTask=null,this._updateGroundElevation=!1,this.addUpdatingPromise=e=>this._updatingHandles.addPromise(e),this.filterCapturedFeatures=e=>{const t=this.currentBestFeature?.attributes.objectId,a=this.layer?.imageReferenceField;if(!t||!e||!a)return;const i=this.overlayedMapFeatures.get(e);i?.forEach(e=>{const i=e.attributes??{},r=Object.keys(i).find(e=>e.toLowerCase()===a.toLowerCase());(r?i[r]:null)!==t&&(e.visible=!e.visible)})},this.hideImageGeometry=e=>{},this.highlight=e=>{if(!this._overlaysView)return;this.removeHighlight();const t=this.additionalFootprints.find(({attributes:{imageID:t}})=>t===Number(e));this._highlightedFeatureHandle=t?this._overlaysView?.highlight(t):null},this.loadDataCaptureAdapter=async e=>{await this.loadSketch(e);const t=import("./adapters/sketch/DataCaptureAdapter.js"),{default:a}=await t;return v(e),this.sketchAdapter=new a({viewModel:this}),this.sketchAdapter},this.loadImageFromSource=async(e,t)=>this._updatingHandles.addPromise(this._loadImageFromSourceInternal(e,t)),this.storeImageMeasurementViewer=e=>{this.imageMeasurementViewer=e},this.storePanoramicMeasurementViewer=e=>{this._panoramicMeasurementViewer=e},this.loadImageViewer=e=>{this._imageViewer?.destroy(),this._imageViewer=e},this.loadPanoramicViewer=e=>{this._panoramicViewer?.destroy(),this._panoramicViewer=e},this.loadPanoramicVideoViewer=e=>{this._panoramicVideoViewer?.destroy(),this._panoramicVideoViewer=e},this.loadVideoViewer=e=>{this.videoMapView.container=e},this.showImageByObjectId=async(e,t)=>{const a=this.additionalFeatures.find(({attributes:t})=>t.objectId===e);if(a)this.currentBestFeature=a;else{const{layer:a,layerFloorFilterClause:r}=this;if(!a)return void this.setMessage("noLayerSelected","info");this.beforeLoad();const s=this._updatingHandles.addPromise(this._queryAndLoadByObjectId(a,e,r,t));try{await s,await this.selectBestFeature(e,t)}catch(i){y(i)||(u.getLogger(this).error("oriented-imagery-viewer:show-image",i),"NoFeatureFoundWithObjectIdError"===i.name?this.setMessage("noFeatureFoundWithObjectId","error","",{objectId:e}):this.setMessage("imageLoadError","error",i.message))}}},this.imageToImageTransform=async(e,t,a)=>{const{updateElevationProps:i,...r}=t,{updateElevationProps:s,...o}=a,n=await ee(e,r,i);return ge(n,o)},this.imageToImageTransformPanoramic=async(e,t,a)=>{const{updateElevationProps:i,...r}=t,{updateElevationProps:s,...o}=a,n=await te(e,r,i);return ye(n,o)},this.getSectorFeatureById=e=>this._suitabilities?.find(({feature:{attributes:{objectId:t}}})=>t===e),this.getFeatureSectorById=e=>this._featureToSector?.[`${e}`],this.navigate=async(e,t)=>{const{activeViewer:a}=this;if(!a)throw new yt;return await a.navigate(e,t)},this.removeHighlight=()=>this._highlightedFeatureHandle?.remove(),this.revealImageGeometry=e=>{},this.selectBestFeature=async(e,t)=>(v(t),this.currentBestFeature=this.features?.find(({attributes:t})=>`${t.objectId}`==`${e}`),F(()=>"image-loaded"===this.state,t)),this.toggleImageAttributes=()=>{m(this._openPopupTask),this._openPopupTask=r(async e=>{const{currentBestFeature:a,popupEnabled:i,layer:r,view:s}=this;if(s?.closePopup(),!(s&&a&&i&&r))return;const{attributes:o,geometry:n}=a,c=new t({geometry:n,attributes:o.toJSON(),layer:r,sourceLayer:r});v(e),await s.openPopup({features:[c],location:o.location.clone()})})},this.updateSuitabilities=(e,t=!0)=>{e.sort((e,t)=>e.suitability-t.suitability),this._suitabilities=e;const a=this._suitabilities.map(({feature:e})=>e);this._initialCurrentCoverageUpdate=!0,this._updateFeatures(a,t),this._groupFeaturesBySectors()},this._createViewClickHandle=()=>{if(this.removeHandles(_t.click),"disabled"===this.state||null==this.view)return;const e=this.mapImageConversionToolState&&"image-loaded"===this.state?this._mapImageConversionToolViewClickHandler:this._viewClickHandler;this.addHandles(this.view.on("click",e,Me.WIDGET),_t.click)},this._createImageClickHandle=()=>{this.removeHandles(_t.imageClick);const{mapImageConversionToolState:e,mode:t,activeViewer:a,currentBestFeature:i,footprintExtent:s}=this,o=a?.imageSize;if(!(e&&"none"!==t&&o&&s&&i))return;const n=a.clickAction;this.clickAction="pixel-location";const c=l(()=>{this.clickAction=n});let h=null;const u=_(()=>a,"pixel-location",e=>{this.plotReferencePointOnImage(e),h?.abort(),h=r(async a=>{if(!e)return;const r=await this.getMapPoint(e,{feature:i,imageSize:o,mode:t}).then(e=>{const t=this.view?.spatialReference;return re(!t,e.spatialReference.equals(t))?e:B(e,t)});v(a),this.plotReferencePointOnGround(r)})});this.addHandles([u,c],_t.imageClick)},this._createTriangularImageClickHandle=()=>{this.removeHandles(_t.triangularImageClick),this.triangularMeasurementActive&&"none"!==this.mode&&this.currentBestFeature&&this.currentBestFeatureMeasurementImage&&this.activeTriangulatedViewer&&this.addHandles(this.activeTriangulatedViewer.imageRenderer.on("double-click",this._measurementImageClickHandler),_t.triangularImageClick)},this._createTriangularImageLocationHandle=()=>{this.removeHandles(_t.triangularImageClick);const{imageLocationToolState:e,mode:t,activeTriangulatedViewer:a}=this,i=a?.imageSize;if(!e||"none"===t||!i)return;this.clickAction="pixel-location";let s=null;const o=_(()=>a,"pixel-location",e=>{1===this.measurementVectors.length&&(this.plotLocationPointOnImage(e,!0),s?.abort(),s=r(async a=>{if(!e||this.triangulatedPoint||2===this.measurementVectors?.length||!this.currentBestFeatureMeasurementImage)return;let r=await this.getMapPoint(e,{feature:this.currentBestFeatureMeasurementImage,imageSize:i,mode:t});v(a);const s=this.currentBestFeatureMeasurementImage.geometry.spatialReference;s&&!r.spatialReference.equals(s)&&(r=await B(r,s),v(a)),await this._calculateTriangulatedPointFromGroundPoint(r,{signal:a}),v(a)}))});this.addHandles(o,_t.triangularImageClick)},this._createImageLocationHandle=()=>{this.removeHandles(_t.imageClick);const{imageLocationToolState:e,mode:t,activeViewer:a,currentBestFeature:i,footprintExtent:s}=this,o=a?.imageSize;if(!(e&&"none"!==t&&o&&s&&i))return;this.clickAction="pixel-location";let n=null;const c=_(()=>a,"pixel-location",e=>{const{currentBestFeatureMeasurementImage:a,triangularMeasurementActive:s,activeTriangulatedViewer:c}=this;this.pixelCoordinates=e;const l=null!=a&&!c?.state.includes("loading");re(!s,l)&&this.plotLocationPointOnImage(e),n?.abort(),n=r(async a=>{if(!e)return;let r=await this.getMapPoint(e,{feature:i,imageSize:o,mode:t});v(a);const n=this.view?.spatialReference;n&&!r.spatialReference.equals(n)&&(r=await B(r,n),v(a)),this.groundCoordinates=r,s&&r&&l&&await this.triangulatedLocationWorkflow(r,a);const c=await this.calculateLocationAccuracy(e,r,t,a);v(a),c&&(this.groundCoordinatesAccuracy=c)})});this.addHandles(c,_t.imageClick)},this._handleImageHitTestResponse=async e=>{const{layer:t,overlayedCameraLocations:a}=this;if(!t)return;const i=e.results.find(({graphic:e,graphic:{attributes:i}})=>a.includes(e)&&i&&!i[t.imageReferenceField]&&!i[t.imageGeometryField]);if(!i)return;const r=i.graphic.attributes[t.objectIdField];await this.showImageByObjectId(r)},this._loadDepthImage=async e=>{const{currentBestFeature:t,layer:a,depthImageNotSupported:i}=this;if(this.depthImage?.destroy(),this.depthImage=null,!a||!t||i)return;const{depthImage:r}=t.attributes;if(!r)return;const s=(await import("./services/DepthImageService.js")).default;v(e),this.depthImage=new s({url:r});try{await this.depthImage.load(e)}catch(o){y(o)||(u.getLogger(this).error("error occurred while loading depth image",o),this.depthImage?.destroy(),this.depthImage=null)}},this._loadImage=async e=>{const{currentBestFeature:t,layer:a,mode:i}=this;if(this.clearGraphics(),!a||!t||"none"===i||"video"===i||"panoramic-video"===i)return;const{attributes:r}=t,{imagePath:s,imageRotation:o,cameraHeading:n,cameraRoll:c,cameraPitch:l,objectId:h,cameraOrientation:d,location:m}=r,p=(c??0)+(o??0),g=m.spatialReference.isWGS84&&4!==d?.type?z(m):new T(m);let w=s;if(je(s))try{w=await Be(a,h,e)}catch(f){if(y(f))return;return it(f)?(u.getLogger(this).error(f),void this.setMessage("noAttachment","error",`${a.objectIdField}: ${h}`)):(u.getLogger(this).error(f,{[a.objectIdField]:h,layer:a}),void this.setMessage("imageLoadError","error",`query-attachments-failed:${a.objectIdField} ${h}`))}try{await this.loadImageFromSource(w,{imageRotation:p,options:e,pitch:l,yaw:n,mode:i,cameraLocation:g}),v(e),await this.transformAndPlotSelectedLocation(e)}catch(f){y(f)||this.loadImageError(f)}},this._loadVideo=async e=>{const{currentBestFeature:t,layer:a,mode:i,selectedPoint:r}=this,s=t?.attributes.imagePath;if(!a||!t||"panoramic-video"!==i||!s)return;const{attributes:o}=t,{cameraHeading:n,cameraPitch:c,cameraOrientation:l,location:h}=o,u=h.spatialReference.isWGS84&&4!==l?.type?z(h):new T(h);try{this._panoramicVideoViewer.viewModel.video&&this._panoramicVideoViewer.viewModel.video.pause(),this._panoramicVideoViewer.videoSource=s;let t=n??0;u&&r&&(t=await se(u,r)-t),this._panoramicVideoViewer.pitch=c??0,this._panoramicVideoViewer.yaw=t,await this._panoramicVideoViewer.loadVideo(e),v(e)}catch(d){y(d)||this.loadImageError(d)}},this._loadImageFromSourceInternal=async(e,t)=>{const{mode:a,imageRotation:i,options:r}=t,s="string"==typeof e,o=s?e:e.url,{pathname:n,searchParams:c}=new URL(o);let l=s?n.match(It)?.[1]:e.datasetFormat;if(!l)try{l=await rt(o,{...t.options})}catch(h){y(h)||u.getLogger(this).error("#getContentType()",h)}switch(l??="UNKNOWN FORMAT",a){case"default":this.triangularMeasurementActive?await this._setImageSource(this.imageMeasurementViewer,l,o,c,i,r):await this._setImageSource(this._imageViewer,l,o,c,i,r);break;case"panoramic":if(bt.has(l.toUpperCase())){const{selectedPoint:e}=this,{pitch:a,yaw:i,cameraLocation:s,viewAngle:n}=t,c=this.triangularMeasurementActive?this._panoramicMeasurementViewer:this._panoramicViewer;let h=i??0;"number"==typeof n?h=n-h:s&&e&&(h=await se(s,e)-h),c.imageSource=o,c.pitch=a??0,c.yaw=h,Mt.has(l.toUpperCase())?await c.loadImageTiled(o,r):await c.loadImage(r)}else this.setMessage("unsupportedPanoramicImageryError","error",void 0,{datasetFormat:l});break}},this._loadMeasurementViewerImage=async e=>{const{currentBestFeatureMeasurementImage:t,layer:a,mode:i}=this;if(this.imageMeasurementViewer.clearGraphics(),this._panoramicMeasurementViewer.clearGraphics(),!a||!t||"none"===i||"video"===i||"panoramic-video"===i)return;const{attributes:r}=t,{imagePath:s,imageRotation:o,cameraHeading:n,cameraRoll:c,cameraPitch:l,objectId:h,cameraOrientation:d,location:m}=r,p=(c??0)+(o??0),g=m.spatialReference.isWGS84&&4!==d?.type?z(m):new T(m);let w=s;if(je(s))try{w=await Be(a,h,e)}catch(f){if(y(f))return;return it(f)?(u.getLogger(this).error(f),void this.setMessage("noAttachment","error",`${a.objectIdField}: ${h}`)):(u.getLogger(this).error(f,{[a.objectIdField]:h,layer:a}),void this.setMessage("imageLoadError","error",`query-attachments-failed:${a.objectIdField} ${h}`))}try{await this.loadImageFromSource(w,{imageRotation:p,options:e,pitch:l,yaw:n,mode:i,cameraLocation:g}),v(e)}catch(f){y(f)||this.loadImageError(f)}},this._loadViewAdapter=async e=>{const{view:t}=this;if(t)switch(t.type){case"2d":{const{default:t}=await import("./adapters/view/MapViewAdapter.js");v(e),this._adapter=new t(this);break}case"3d":{const{default:t}=await import("./adapters/view/SceneViewAdapter.js");v(e),this._adapter=new t(this);break}}else this._adapter=null},this._mapImageConversionToolViewClickHandler=e=>{if(e.stopPropagation(),e.preventDefault(),e.mapPoint){const t=e.mapPoint;t.x=D(t.x,t.spatialReference),this.plotMapPoint(e.mapPoint)}},this._measurementImageClickHandler=e=>{e.stopPropagation(),e.preventDefault();const{sketchTriangular:t,triangularMeasurementActive:a,currentBestFeatureMeasurementImage:i,triangulatedMeasurementGraphic:r}=this;t&&a&&i&&r&&"active"!==t.state&&(t.update([r],{tool:"reshape"}),this.updatingTriangularMeasurementState=!0)},this._viewClickHandler=e=>{this._clickTask?.abort(),this._clickTask=r(async t=>{const{pointerType:a,button:i,mapPoint:r}=e;if(("mouse"!==a||0===i)&&r)return e.stopPropagation(),e.preventDefault(),this._updatingHandles.addPromise(this.loadBestImage(r,{signal:t}))})},this.plotSelectedPointOnImage=async(e,a)=>{if(await w(a),!e)return;const i=new T({...A(e)?e.toJSON():e});if("default"===this.mode)i.x-=.5,i.y=.5-i.y,i.spatialReference=this._imageViewer.imageRenderer.spatialReference.clone(),this._crossSymbol=new t({geometry:i,symbol:Ne}),this._imageViewer.addGraphic(this._crossSymbol,0);else if("panoramic"===this.mode){const{imageSize:a}=this._panoramicViewer;if(!a)return;const[i,r]=a,{heading:s,pitch:o}=oe(e,i,r),n=ne(s,o);this._crossSymbol=new t({geometry:new T(n,H.WebMercator),symbol:We}),this._panoramicViewer.addGraphic(this._crossSymbol,0)}},this.handleSectorClick=this.handleSectorClick.bind(this),this.searchBestImage=this.searchBestImage.bind(this),this.transformAndPlotReferencePointOnImage=this.transformAndPlotReferencePointOnImage.bind(this)}initialize(){this.addHandles([b(()=>this.view,()=>this.load(),M),b(()=>this.view?.map,(e,t)=>{t?.layers.remove(this._overlays),e?.layers.add(this._overlays)},I),b(()=>this.view?.map?.allLayers?.length,e=>{e&&this.view?.map?.layers.reorder(this._overlays,e-1)},I),b(()=>[this.state,this.mapImageConversionToolState,this.view],()=>{this._createViewClickHandle(),this._createImageClickHandle()},M),b(()=>[this.triangularMeasurementActive,this.currentBestFeatureMeasurementImage],()=>{this._createTriangularImageClickHandle()},M),b(()=>[this.state,this.imageLocationToolState,this.view],(e,t)=>{if(this._initializeMeasurementService(),this._createImageLocationHandle(),!this.imageLocationToolState)return this.clearPreviousGroundLocation(),void this._resetCursor();e[1]!==t?.[1]&&this._setMeasurementCursor()},M),b(()=>this.measureType,()=>{this.clearPreviousMeasurements(),this._initializeMeasurementService()},M),b(()=>this.bestFeatureAngle,(e,t)=>{this.previousFeatureAngle=t??0},M),b(()=>this.currentBestFeature,async(e,t)=>{m(this._featureChangedTask),this._featureChangedTask=r(async a=>this.determineWorkflowForFeature.apply(this,[e,t,{signal:a}])),await this._featureChangedTask.promise},{sync:!0}),b(()=>this.currentBestFeatureMeasurementImage,(e,t)=>{m(this._featureChangedTask),t&&e!==t&&(this.measurementVectors=[],this.triangulatedPoint=null,this.sketchTriangularGraphicsLayer?.graphics.destroyAll()),this._featureChangedTask=r(async a=>{await this.determineWorkflowForTriangularMeasurement(e,t,{signal:a}),v(a),this._reorderTriangularSketchLayer()})},M),b(()=>this.triangularMeasurementActive,(e,t)=>{t&&!e&&(this.measurementVectors=[],this.currentBestFeatureMeasurementImage=null,this.triangulatedDistanceMeasurement=null,this.triangulatedMeasurementGraphic=null,this.triangulatedPoint=null,this.updatingTriangularMeasurementState=!1,this.triangulatedAreaMeasurement=null,this.triangulatedDistanceAccuracy=null,this.triangulatedAreaAccuracy=0,this.sketchTriangularGraphicsLayer?.graphics.destroyAll(),this.clearReferencePointOnImage(),this.imageMeasurementViewer.clearImage(),this.imageMeasurementViewer.clearGraphics(),this._panoramicMeasurementViewer.clearImage(),this._panoramicMeasurementViewer.clearGraphics())}),b(()=>this.mode,e=>{switch(this.removeHandles(_t.interactionHandles),e){case"default":this.addHandles(b(()=>{const{state:e}=this;return"image-loaded"===e?this._imageViewer.imagePointsInView:null},e=>{e&&(m(this._updateFootprintTask),this._updateFootprintTask=r(async t=>{await this.updateFootprint(e,{signal:t})}))},{...M,equals:(e,t)=>a(e,t,h)}),_t.interactionHandles);break;case"video":this.addHandles(b(()=>{const{footprintExtent:e}=this;if(e)return Se},e=>{e&&(m(this._updateFootprintTask),this._updateFootprintTask=r(async t=>{await this.updateFootprint(e,{signal:t})}))},{...M,equals:(e,t)=>a(e,t,h)}),_t.interactionHandles);break;case"panoramic":this.addHandles(b(()=>{const{currentBestFeature:e,state:t,_panoramicViewer:a}=this,{imageSize:i,vfov:r,hfov:s,pitch:o,yaw:n}=a;return e&&i&&!t.includes("loading")&&null!=r&&null!=s&&null!=o&&null!=n?[r,s,n,o]:null},e=>{if(!e||this.state.includes("loading"))return;const[t,a,i,s]=e;this.currentNode&&(this.currentNode.currentHeading=i+(this.currentNode.heading??0),this.currentNode.currentPitch=s+(this.currentNode.pitch??0)),m(this._updateFootprintTask),this._updateFootprintTask=r(async e=>{await this.updateFootprintPanorama({verticalFieldOfView:t,horizontalFieldOfView:a,yaw:i,pitch:s},{signal:e}),this._updateFootprintTask=null})},{equals:(e,t)=>a(e,t,h)}),_t.interactionHandles);break;case"panoramic-video":this.addHandles(b(()=>{const{currentBestFeature:e,state:t,_panoramicVideoViewer:a}=this,{imageSize:i,vfov:r,hfov:s,pitch:o,yaw:n,viewModel:c}=a,l=c.closestFeature??e;return l&&i&&!t.includes("loading")&&null!=r&&null!=s&&null!=o&&null!=n?[r,s,n,o,l]:null},e=>{if(!e)return;const[t,a,i,s,o]=e;m(this._updateFootprintTask),this._updateFootprintTask=r(async e=>{await this.updateFootprintPanorama({verticalFieldOfView:t,horizontalFieldOfView:a,yaw:i,pitch:s,feature:o},{signal:e}),v(e),this._updateFootprintTask=null})},{equals:(e,t)=>a(e,t,h)}),_t.interactionHandles)}},M),b(()=>[this.brightness,this.contrast,this.sharpness],()=>{const{_imageViewer:e,brightness:t,contrast:a,mode:i,sharpness:r}=this;"default"===i&&(e.brightness=t,e.contrast=a,e.sharpness=r)},M),b(()=>this.activeViewer?.imageRenderer,()=>{this.sketch&&(this.sketch.view=this.activeViewer?.imageRenderer)}),b(()=>this.activeViewer,e=>{this.removeHandles(_t.hittestHandles),e&&this.addHandles(_(()=>e,"hittest-response",this._handleImageHitTestResponse),_t.hittestHandles)})]),this.when().finally(()=>{this.notifyChange("state")})}destroy(){this.currentBestFeature=null,this._updateFootprintTask=m(this._updateFootprintTask),this._clickTask=m(this._clickTask),this.coverageFrustums.destroy(),this.coveragePolygons.destroy(),this.pointSources.destroy(),this.additionalFootprints.destroy(),this.additionalCameraLocations.destroy(),this.bestFeatureFootprint=p(this.bestFeatureFootprint),this.bestFeatureCurrentFootprint=p(this.bestFeatureCurrentFootprint),this.videoViewModel=p(this.videoViewModel),this._crossSymbol=p(this._crossSymbol),this._referencePointOnGround=p(this._referencePointOnGround),this._referencePointOnImage=p(this._referencePointOnImage),this._locationPointOnImage=p(this._locationPointOnImage),this._overlays&&this.view?.map?.remove(this._overlays),this._overlays.destroy(),this._imageViewer.destroy(),this.imageMeasurementViewer.destroy(),this._panoramicViewer.destroy(),this._panoramicMeasurementViewer.destroy()}get activeLayer(){return o(u.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){o(u.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeViewer(){const{_imageViewer:e,_panoramicViewer:t,mode:a}=this;switch(a){case"default":return e;case"panoramic":return t;default:return null}}get activeTriangulatedViewer(){switch(this.mode){case"default":return this.imageMeasurementViewer;case"panoramic":return this._panoramicMeasurementViewer;default:return null}}get accuracyParametersMissing(){return this.layer?.orientationAccuracy?.every(e=>0===e)??!0}get brightness(){return this._get("brightness")??0}set brightness(e){this._set("brightness",d(e,-10,10))}get contrast(){return this._get("contrast")??0}set contrast(e){this._set("contrast",d(e,-10,10))}get currentNode(){const{currentBestFeature:e,navigationNodes:t}=this;return t.find(t=>t.id===e?.attributes.objectId)}get depthImageNotSupported(){if(this.currentBestFeature?.attributes.depthImage)return!st(this.currentBestFeature.attributes.depthImage)}get featureCount(){return this.features?.length??0}get imageGalleryEnabled(){const{currentBestFeature:e}=this;if(!e)return!1;const t=e.attributes.imagePath?.trim();return st(t)||je(t)}get imageLoaded(){return o(u.getLogger(this),"imageLoaded",{replacement:'Use OrientedImageryViewer.state === "image-loaded"',version:"4.29",warnOnce:!0}),"image-loaded"===this.state}get invalidCameraHeading(){return this.currentBestFeature?.attributes?.cameraHeading===ke}get imagePointsInView(){const{mode:e,_imageViewer:t}=this;return"default"===e?t.imagePointsInView:null}get layerView(){const{layer:e,view:t}=this;if(e&&t)return t.allLayerViews.find(ot(e))}get layerFloorFilterClause(){const{layerView:e}=this;return e?we(e):null}get mode(){const e=this.currentBestFeature?.attributes;if(!e)return"none";const t=e.orientedImageryType;if(t?.includes("video"))return t.includes("360")?"panoramic-video":"video";const{horizontalFieldOfView:a,isSpherical:i}=e;return 360===a||i?"panoramic":"default"}get panoramicVideoLoaded(){const{mode:e,_panoramicVideoViewer:t}=this,{videoLoaded:a}=t.viewModel;return("panoramic-video"===e&&!0===a)??!1}get popupEnabled(){return!0===this.layer?.popupEnabled}get referencePoint(){return this._referencePointOnGround?.geometry}get sectorData(){const{_sectorData:e}=this;return e?Ae.map(t=>e[t]):null}get sharpness(){return this._get("sharpness")??0}set sharpness(e){this._set("sharpness",d(e,0,1))}get sketchGraphicsLayer(){const{sketch:e}=this;return"graphics"===e?.layer?.type?e.layer:void 0}get state(){const{mode:e,disabled:t,_updatingHandles:{updating:a},_featureChangedTask:i}=this;if(t)return"disabled";if(!this.isFulfilled()||a||!1===i?.finished)return"loading";if(this.isRejected())return"error";if("error"===this.displayMessage?.type)return"image-load-error";switch(e){case"default":return this._imageViewer.state;case"panoramic":return this._panoramicViewer.state;case"video":return this.videoElement?.loaded?"video-loaded":"video-not-loaded"}return"ready"}get thumbnails(){const{features:e}=this;return e?new s(e.map(({attributes:{imagePath:e,objectId:t,cameraRoll:a,imageRotation:i}})=>{const r=e?.trim();return st(r)||je(r)?{url:r,objectId:t,rotation:(a??0)+(i??0)}:null}).filter(i)):null}set view(e){this._set("view",e)}get _defaultGraphicsLayer(){const e={blendMode:"source-atop"};switch(this.mode){case"panoramic":return new U({...e,elevationInfo:{mode:"absolute-height"}});case"default":return new U({...e});default:return}}get _overlaysView(){return this.view?.layerViews.find(({layer:e})=>e===this._overlays)}beforeLoad(e=!0){this.view?.closePopup(),e&&(this.displayMessage=null),this.clearPreviousGroundLocation(),this.triangularMeasurementActive=!1,this.currentBestFeatureMeasurementImage=null,this.measureType=null,this.imageLocationToolState=!1,this.features.removeAll(),this.currentBestFeature=null,this.additionalFeatures.removeAll(),this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint=p(this.bestFeatureCurrentFootprint),this._overlays?.removeAll()}async computeHeight(e,t,a=!0){return this._measurementService?.computeHeight(e,t,a)}async calculateAreaMeasurement(e,t,a){return this._measurementService?.calculateAreaMeasurement(e,t,a)}async calculateDistanceMeasurement(e,t,a){return this._measurementService?.calculateDistanceMeasurement(e,t,a)}async calculateAccuracy(e,t,a){return this._measurementService?.calculateAccuracy(e,t,a)}async calculateLocationAccuracy(e,t,a="default",i){return this._measurementService?.calculateLocationAccuracy(e,t,a,i)}async calculateAccuracyPanoramic(e,t,a){return this._measurementService?.calculateAccuracyPanoramic(e,t,a)}async calculateHeightMeasurementInfo(e,t,a){return this._measurementService?.calculateHeightMeasurementInfo(e,t,a)}async calculateTriangulatedMeasurements(e){await(this._measurementService?.calculateTriangulatedMeasurements(e))}clearPreviousMeasurements(){this.clearMeasurementGraphics(),this.resetMeasurementData(),this.stopMeasurement()}clearPreviousGroundLocation(){this.groundCoordinates=null,this.groundCoordinatesAccuracy=null,this.pixelCoordinates=null,this.clearLocationPointOnImage()}clearMeasurementGraphics(){this.measurementGraphic&&(this.activeViewer?.removeGraphic(this.measurementGraphic),this.measurementGraphic=null),this.heightGraphic&&(this.activeViewer?.removeGraphic(this.heightGraphic),this.heightGraphic=null),this.triangularMeasurementActive&&this.sketchTriangularGraphicsLayer?.graphics.destroyAll()}digitizeCancel(){return this.sketch?.cancel()}digitizeCanRedo(){return this.sketch?.canRedo()??!1}digitizeCanUndo(){return this.sketch?.canUndo()??!1}digitizeComplete(){return this.sketch?.complete()}async digitizeCreate(e,t){const{sketch:a,dataCaptureLayer:i}=this;if(!a)throw Pt();Ge(i,e,a),await a.create(e,{...t,defaultZ:0})}digitizeDelete(){if(!this.sketch)throw Pt();return this.sketch.delete()}digitizeDuplicate(){if(!this.sketch)throw Pt();return this.sketch.duplicate()}digitizePlace(e,t){if(!this.sketch)throw Pt();return this.sketch.place(e,t)}digitizeRedo(){if(!this.sketch)throw Pt();return this.sketch.redo()}digitizeUndo(){if(!this.sketch)throw Pt();return this.sketch.undo()}digitizeUpdate(e,t){if(!this.sketch)throw Pt();return this.sketch.update(e,t)}async displayHeightResults(){const{currentBestFeature:e,activeViewer:t,heightMeasurementPixels:a,mode:i}=this,r=t?.imageSize,s=e?.attributes;if(!s||!r)return;const o=await this.computeHeight(a,i);o?.value&&o?.accuracy&&(this.heightMeasurementResult=o.value,this.heightMeasurementAccuracy=o.accuracy)}filterByFootprints(e,t,a=!1){const i=[],r=[],s=[];return e.forEach(e=>{const{layer:{coveragePercent:o},attributes:n}=e;let c;const{polygon:l,frustum:h}=J(n);if(c=l.clone(),n.isInspection&&(c=Z(n)),o&&(c=K(c,o)),a||!t||Q(c,t)){s.push(e);const{geometry:t,objectId:a,cameraHeight:o,cameraHeading:c}=n,u=t.clone();u.z=o,u.imageID=a,this.pointSources.push(u),c!==ke&&(i.push(l),h&&r.push(h))}}),{features:s,polygons:i,frustums:r}}getMeasurementProperties(e=this.currentBestFeature,t=this.activeViewer){if(!e||!t?.imageSize)return;const{elevationSample:a,attributes:i}=e,{elevationSource:r,cameraHeight:s}=i,o=ce(i,t.imageSize[0],t.imageSize[1]);let n=o.cameraLocation;return(n.spatialReference.isGeographic?B(n,H.WebMercator):Promise.resolve(n)).then(e=>(n=e,le(n.spatialReference,n.z??0,s,{elevationSample:a,elevationSource:r,extent:this.footprintExtent}))).then(t=>("elevationSample"in t&&he(t.elevationSample)&&(e.elevationSample=t.elevationSample),{...o,cameraLocation:n,updateElevationProps:t}))}getMeasurementPropertiesPanoramic(e=this.currentBestFeature,t=this.activeViewer){if(!e||!t?.imageSize)return;const{elevationSample:a,attributes:i}=e,{elevationSource:r,cameraHeight:s}=i,o=ue(i,t.imageSize[0],t.imageSize[1]);let n=o.cameraLocation;return(n.spatialReference.isGeographic?B(n,H.WebMercator):Promise.resolve(n)).then(e=>(n=e,le(n.spatialReference,n.z??0,s,{elevationSample:a,elevationSource:r,extent:this.footprintExtent}))).then(t=>("elevationSample"in t&&he(t.elevationSample)&&(e.elevationSample=t.elevationSample),{...o,cameraLocation:n,updateElevationProps:t}))}async deleteDataCaptureFeatures(e){const{dataCaptureLayer:t}=this;if(!t)throw new n("orientedimageryviewer:missing-featurelayer","Data capture layer is not available");return t.queryFeatures({objectIds:e}).then(({features:e})=>t.applyEdits({deleteFeatures:e}))}handleSectorClick(e){if(isNaN(e))return;const t=this._sectorData?.[Ae[e]],a=t?.at(0);a&&(this.triangularMeasurementActive&&this.currentBestFeature?this._updateImageMeasurementBestFeature(a):this._updateCurrentBestFeature(a))}handleFeatureClick(e){const{sector:t,featureIndexInSector:a}=e;if(isNaN(a))return;const i=this._sectorData?.[t],r=i?.at(a);r&&(this.triangularMeasurementActive&&this.currentBestFeature?this._updateImageMeasurementBestFeature(r):this._updateCurrentBestFeature(r))}handleDrawCursorUpdateEvents(e){const{measurementAngle:t,tempDistance:a,heightMeasurementPixels:i,mode:r,activeViewer:s,currentBestFeature:o}=this,n=s?.imageSize;if(!e.vertices||!n||!o)return;const c=He(e.vertices.at(-1),r,n);if(i.length<1||!c||!a||!t||"none"===r)return;const l=xe(i[0],c,t);if(!l?.length)return;this.heightMeasurementPixels.push(l),"panoramic"===r?this.createPolylineGraphicPano():this.createPolylineGraphic();const h=Ee(o.attributes.location.spatialReference),u=De(this.heightMeasurementPixels,a,h);u&&(this.heightMeasurementResult=u)}async handleDrawVertexAddEvents(e,t){const{currentBestFeature:a,activeViewer:i,heightMeasurementPixels:r,mode:s}=this;if(!a||!i||!e.vertices?.length||"none"===s)return;const o=i?.imageSize;if(!r.length&&o){const a=He(e.vertices.at(-1),s,o);this.heightMeasurementPixels.push(a);const i=await this.calculateHeightMeasurementInfo(a,s,t);if(!i?.measurementAngle||!i?.tempDistance)return;this.measurementAngle=i.measurementAngle,this.tempDistance=i.tempDistance}}load(e){return this.addResolvingPromise(this._loadViewAdapter(e).catch(e=>{if(!y(e))throw e})),this}async loadBestImage(e,t){return this.selectedPoint=Y(e),this.beforeLoad(),this._fetchFeaturesWithController(e,t)}loadImageError(e){u.getLogger(this).error("oriented-imagery-viewer:load-image",e),this.setMessage("imageLoadError","error",e.message)}async loadSketch(e){if(!this.sketch){const t=import("../Sketch/SketchViewModel.js"),{default:a}=await t;v(e),this.sketch=new a({layer:this._defaultGraphicsLayer,view:this.activeViewer?.imageRenderer,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{edgeOperation:"none",shapeOperation:"none",vertexOperation:void 0},enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"transform"}})}return this.sketch}async loadMeasurementAdapter(e){if(!this.sketchAdapter){const t=import("./adapters/sketch/MeasurementAdapter.js"),{default:a}=await t;if(v(e),this.sketchAdapter=new a({viewModel:this}),!this.sketchAdapter.viewModel.isResolved())return}return this.sketchAdapter}async loadTriangulatedMeasurementAdapter(e){if(!this.triangulatedMeasurementAdapter){const t=import("./adapters/sketch/TriangulatedMeasurementAdapter.js"),{default:a}=await t;if(v(e),this.triangulatedMeasurementAdapter=new a({viewModel:this}),!this.triangulatedMeasurementAdapter.viewModel.isResolved())return}return this.triangulatedMeasurementAdapter}async processFeatureResponse(e,t,a){const{features:i}=e;if(this._clearFeatureGeometries(),!this._checkFeatures(i))return;const{features:r,polygons:s,frustums:o}=this.filterByFootprints(i,t,a?.skipFilter);if(!this._checkFeatures(r))return;this.coveragePolygons.addMany(s),this.coverageFrustums.addMany(o);const n=await this.processElevationSample(s,r,a);v(a),await this._updateElevationOfSelectedPointAndLocations(r,t,n),v(a),nt(r,n);const c=this._processSuitableFeatures(r,t);this.updateSuitabilities(c,a?.loadBestImage)}async startMeasurement(e,t){this.sketch||await this.loadSketch(t),await this.loadMeasurementAdapter(t);const{sketch:a,sketchAdapter:i,activeViewer:r,mode:s}=this;if(!a||!i||!r||"none"===s)return;if(this.displayNewMeasurementButton=!1,"panoramic"===s&&(a.defaultCreateOptions.defaultZ=0),await a.create(e),"panoramic"===s){const{drawOperation:e}=a.view.activeTool;e.constraintsEnabled=!1,e._set("elevationDrawSurface",null)}const o=this.activeViewer?.imageRenderer.effectiveTheme.accentColor;o&&this.sketch&&(this.sketch.polygonSymbol=qe(o),this.sketch.polylineSymbol="panoramic"===s?$e:Je(o,2.5))}startHeightMeasurement(){this.heightMeasurementPixels=[],this.displayNewMeasurementButton=!1,this.draw??=new _e({view:this.activeViewer?.imageRenderer});this.draw.create("polyline").on(["cursor-update","vertex-add","draw-complete"],e=>this.handleDrawEvents(e))}createPolylineGraphic(){const e=[this.heightMeasurementPixels[0],this.heightMeasurementPixels.at(-1)],a=this.activeViewer?.imageRenderer.spatialReference;if(this.heightGraphic)this.heightGraphic.geometry=new j({paths:[e],spatialReference:a});else{const i=new j({paths:[e],spatialReference:a}),r=this.activeViewer?.imageRenderer.effectiveTheme.accentColor;this.heightGraphic=new t({geometry:i,symbol:Je(r,2.5)}),this.activeViewer?.addGraphic(this.heightGraphic)}}createPolylineGraphicPano(){const e=this.activeViewer?.imageRenderer.spatialReference,a=this.activeViewer?.imageSize;if(!a)return;const i={x:this.heightMeasurementPixels[0][0],y:this.heightMeasurementPixels[0][1]},r={x:this.heightMeasurementPixels.at(-1)[0],y:this.heightMeasurementPixels.at(-1)[1]},{heading:s,pitch:o}=oe(i,a[0],a[1]),{heading:n,pitch:c}=oe(r,a[0],a[1]),l=[[...ne(s,o)],[...ne(n,c)]];if(this.heightGraphic)this.heightGraphic.geometry=new j({paths:[l],spatialReference:e});else{const a=new j({paths:[l],spatialReference:e});this.heightGraphic=new t({geometry:a,symbol:$e}),this._panoramicViewer.addGraphic(this.heightGraphic,0)}}async editOverlayedGraphics(e){this.sketchTriangularGraphicsLayer||this._initializeSketchTriangularGraphicsLayer(),this.sketchTriangularGraphicsLayer?.destroyed&&this._handleDestroyedTriangularSketchLayer(),this.sketchTriangularGraphicsLayer.add(e),this.sketchTriangular||(this._initializeSketchTriangular(),await this.loadTriangulatedMeasurementAdapter()),this.updateOverlayedGeometry(e)}updateOverlayedGeometry(e){this.sketchTriangular?.update([e],{tool:"reshape"})}async processMeasurementVectors(e){this.triangularMeasurementActive&&this.currentBestFeature&&(this.measurementVectors?.length<2&&await this.updateMeasurementVectorsArray(e),2===this.measurementVectors.length&&await this.calculateTriangulatedMeasurements(e))}async updateMeasurementVectorsArray(e){const t=this.measurementVectors.length?this.currentBestFeatureMeasurementImage:this.currentBestFeature;if(t){const a=await this.computeMeasurementVector(e,t);a&&this.measurementVectors.push(a)}}async computeMeasurementVector(e,t){const{activeViewer:a,mode:i}=this,r=a?.imageSize;if(!e||!t||!r)return;const s=e.map(e=>[e[0]-.5,-.5-e[1]]),o=this.view?.spatialReference,n=[];for(let c=0;c<s.length;c++){const e={x:s[c][0],y:s[c][1]};let a=await this.getMapPoint(e,{feature:t,imageSize:r,mode:i});o&&!a.spatialReference.equals(o)&&(a=await B(a,o)),n.push(a)}return ze(n,t)}async handleDrawEvents(e,t){if(this.draw)switch(e.type){case"cursor-update":this.handleDrawCursorUpdateEvents(e);break;case"vertex-add":await this.handleDrawVertexAddEvents(e,t);break;case"draw-complete":await this.displayHeightResults()}}initializeMeasurement(e){switch(this.clearMeasurementGraphics(),this.resetMeasurementData(),e){case"distance":this.startMeasurement("polyline");break;case"area":this.startMeasurement("polygon");break;case"height":this.startHeightMeasurement()}}async overlayCameraLocations(e){const{activeViewer:a,currentBestFeature:i,overlayedCameraLocations:r,layer:s,mode:o,state:n,layerFloorFilterClause:c}=this,l=a?.imageSize;if(!l||!i||!s||"none"===o||n.includes("loading"))return;const{polygon:h}=J(i.attributes);if(a.removeManyGraphics(r.toArray()),r.removeAll(),e){const{features:e}=await s.queryFeatures({where:P(`${s.objectIdField} <> ${i.attributes.objectId}`,P(s.definitionExpression,c)),geometry:h,returnGeometry:!0,outFields:[s.objectIdField]}),n=await Promise.all(e.map(async e=>{const{attributes:a,geometry:r}=e,s=await this.getPixels(r,{feature:i,imageSize:l,mode:o}),n="panoramic"===o?Ze():Ke();return new t({attributes:a,symbol:n,geometry:s})}));r.addMany(n),a.addManyGraphics(r.toArray())}}overlayGraphicsOnImage(e,t){this.removeOverlayedGraphicsOnImage(e),this.overlayedMapFeatures.set(e,t),this.activeViewer?.addManyGraphics(t.toArray())}async overlayMapFeatures(e,a=!1){const{activeViewer:r,currentBestFeature:o,mode:n,state:c,layer:l}=this,h=r?.imageSize;if(!h||!o||"none"===n||"video"===n||"panoramic-video"===n||c.includes("loading")||!l)return;const{polygon:d}=J(o.attributes);try{const{imageGeometryField:t,oiObjectIdField:a}=Re(e,l.imageGeometryField,l.imageReferenceField);this.imageGeometryField=t.name,this.oiObjectIdField=a.name}catch(g){u.getLogger(this).warn("oriented-imagery-viewer:overlay-map-features",g)}const{features:m}=await e.queryFeatures({geometry:d,returnGeometry:!0,outFields:["*"]}),p=new s((await Promise.all(m.map(async i=>{const r=i.symbol?.clone()??e.renderer?.getSymbol(i)?.clone(),{attributes:s,geometry:c}=i,l=c,{imageGeometryField:d,oiObjectIdField:m}=this;if(d&&m&&Te(e,d,m)&&`${s[m]}`==`${o.attributes.objectId}`)try{return Oe(s,d,e,a,h,n,r)}catch(g){u.getLogger(this).warn("oriented-imagery-viewer:overlay-map-features","couldn't create graphic from attributes, geometry will be used",{error:g,feature:i,layer:e,imageGeometryField:this.imageGeometryField,imageReferenceField:this.oiObjectIdField})}switch(l?.type){case"point":{const i=await this.getPixels(l,{feature:o,imageSize:h,mode:n});return new t({attributes:s,layer:e,symbol:r,geometry:i,visible:e.visible&&a})}case"polygon":{const{rings:i,spatialReference:c}=l,u=i.map(e=>e.map(([e,t,a])=>new T({x:e,y:t,z:a,spatialReference:c}))),d=await Promise.all(u.map(async e=>this.getPixels(e,{feature:o,imageSize:h,mode:n}).then(e=>e.map(de))));return new t({attributes:s,layer:e,symbol:r,geometry:new O({rings:d,spatialReference:H.WebMercator}),visible:e.visible&&a})}case"polyline":{const{paths:i,spatialReference:c}=l,u=i.map(e=>e.map(([e,t,a])=>new T({x:e,y:t,z:a,spatialReference:c}))),d=await Promise.all(u.map(async e=>this.getPixels(e,{feature:o,imageSize:h,mode:n}).then(e=>e.map(de))));return new t({attributes:s,layer:e,symbol:r,geometry:new j({paths:d,spatialReference:H.WebMercator}),visible:e.visible&&a})}case"multipoint":{const{points:i,spatialReference:c}=l,u=i.map(([e,t,a])=>new T({x:e,y:t,z:a,spatialReference:c})),d=await this.getPixels(u,{feature:o,imageSize:h,mode:n}).then(e=>e.map(de));return new t({attributes:s,layer:e,symbol:r,geometry:new R({points:d,spatialReference:H.WebMercator}),visible:e.visible&&a})}}return null}))).filter(i));this.overlayGraphicsOnImage(`${e.id}`,p)}getDepthAt(e){const{activeViewer:t,currentBestFeature:a,mode:i,state:r,depthImage:s}=this,o=t?.imageSize;if(!o||!a||"none"===i||r.includes("loading"))return u.getLogger(this).warnOnce("oriented-imagery-viewer:get-depth-at","Load an image to use depth"),null;if(!s?.loaded)return u.getLogger(this).error("oriented-imagery-viewer:get-depth-at","Depth image is not loaded"),this.emit("depth-image-service:not-loaded"),null;const n=(Array.isArray(e)?e:[e]).map(e=>s.depthAt(e,{width:o[0],height:o[1]})??null);return Array.isArray(e)?n:n[0]}async getPixels(e,t){const{imageSize:a,mode:i,feature:r}=t,s=(await this.worldToImage(Array.isArray(e)?e:[e],r)).map(e=>{if("default"===i)return new T({x:e.x-.5,y:.5-e.y,spatialReference:H.WebMercator});const[t,r]=a,{heading:s,pitch:o}=oe(e,t,r),n=ne(s,o);return new T(n,H.WebMercator)});return Array.isArray(e)?s:s[0]}async getMapPoint(e,t){const{feature:a,mode:i,imageSize:r}=t,{elevationSample:s,attributes:o}=a,{elevationSource:n,location:c,cameraHeight:l}=o;let h=c.clone();h.spatialReference.isGeographic&&(h=await B(h,H.WebMercator));const u=await le(c.spatialReference,c.z??0,l,{elevationSample:s,elevationSource:n,extent:this.footprintExtent});let d;"elevationSample"in u&&he(u.elevationSample)&&(a.elevationSample=u.elevationSample);const m=Array.isArray(e)?e:[e];if(this.depthImage?.loaded)for(const p of m){const e=this.getDepthAt(p);null!=e&&(p.depth=e)}if("default"===i){const e=ce(o,r[0],r[1]);d=await ee(m,{...e,cameraLocation:h},u)}else{const e=ue(o,r[0],r[1]);d=await te(m,{...e,cameraLocation:h},u)}return Array.isArray(e)?d:d[0]}getActiveSectors(){return Ae.filter(e=>this._sectorData?.[e]?.length)}async plotMapPoint(e){return this.plotReferencePoint(e),this.transformAndPlotReferencePointOnImage({feature:this.currentBestFeature,selectedLocation:e,options:{signal:this._transformController?.signal}})}plotReferencePointOnGround(e){this._referencePointOnGround&&(this._overlays?.remove(this._referencePointOnGround),this._referencePointOnGround.destroy()),null!=e&&(this._referencePointOnGround=new t({geometry:new T({...e.toJSON()}),symbol:Qe}),this.view?this._overlays?.add(this._referencePointOnGround):this.emit("plot-ground-point",{data:{point:this._referencePointOnGround?.geometry}}))}plotReferencePointOnImage(e){if("image-loaded"===this.state)switch(this.clearReferencePointOnImage(),this.mode){case"default":{const a=A(e)?e.toJSON():e;a.x-=.5,a.y=.5-a.y,this._referencePointOnImage=new t({geometry:new T({spatialReference:this._imageViewer.imageRenderer.spatialReference,...a}),symbol:Qe}),this._imageViewer.addGraphic(this._referencePointOnImage,0);break}case"panoramic":{const{imageSize:a}=this._panoramicViewer;if(!a)return;const[i,r]=a,{heading:s,pitch:o}=oe(e,i,r),n=ne(s,o);this._referencePointOnImage=new t({geometry:new T(n,H.WebMercator),symbol:Xe}),this._panoramicViewer.addGraphic(this._referencePointOnImage,0);break}}}plotLocationPointOnImage(e,t=!1){if("image-loaded"===this.state)switch(this.clearLocationPointOnImage(t),this.mode){case"default":this._plotLocationPointOnDefaultImage(e,t);break;case"panoramic":this._plotLocationPointOnPanoramicImage(e,t)}}removeAllOverlayMapFeatures(){this.overlayedMapFeatures.forEach(e=>{this._imageViewer.removeManyGraphics(e.toArray())}),this.overlayedMapFeatures.clear()}removeOverlayedGraphicsOnImage(e){const t=this.overlayedMapFeatures.get(e);t?.length&&(this.activeViewer?.removeManyGraphics(t.toArray()),this.overlayedMapFeatures.delete(e))}reset(){const{mode:e}=this;"default"===e||"panoramic"===e?this.resetImage():"video"===e?this.resetVideo():"panoramic-video"===e&&this.resetVideoPanoramic(),this.beforeLoad(!1)}resetImage(){switch(this.setMessage("onLoadMessage","info"),this.mode){case"default":this._imageViewer.clearImage(),this._imageViewer.clearGraphics();break;case"panoramic":this._panoramicViewer.clearGraphics()}this._clickTask=m(this._clickTask)}resetVideo(){this.setMessage("onLoadMessage","info"),this.videoViewModel?.resetVideoHandler(),this._overlays?.removeAll(),this.videoViewModel=null,this.featureCache=[],this.currentBestFeature=null}resetVideoPanoramic(){this.setMessage("onLoadMessage","info"),this._overlays?.removeAll(),this.currentBestFeature=null}resetMeasurementData(){this.areaMeasurementResult=0,this.areaMeasurementAccuracy=0,this.distanceMeasurementResult=0,this.distanceAccuracyArray=[],this.heightMeasurementPixels=[],this.measurementVectors=[],this.heightMeasurementResult=0,this.tempDistance=null,this.measurementAngle=null,this.heightMeasurementAccuracy=0,this.heightGraphic=null,this.triangulatedDistanceMeasurement=null,this.triangulatedDistanceAccuracy=null,this.triangulatedAreaMeasurement=null,this.triangulatedMeasurementGraphic=null,this.updatingTriangularMeasurementState=!1,this.triangulatedAreaAccuracy=0}async saveDrawing(){const{dataCaptureLayer:e,sketchAdapter:t}=this;if(!e||"data-capture"!==t?.type)return;const{pendingGraphics:a,savedGraphics:i}=t,r=a.get(e.id),s=r?.toArray();if(!r||!s?.length)return;const{addFeatureResults:o}=await this.saveDataCaptureFeatures(s),n=o.reduce((t,{objectId:a,globalId:i,error:r},o)=>{const n=s[o],{attributes:c}=n;return r?t.error.push(n):(a&&(c[e.objectIdField]=a),i&&e.globalIdField&&(c[e.globalIdField]=i),t.success.push(n)),t},{success:[],error:[]});i.addMany(n.success),r.removeAll(),r.addMany(n.error)}async saveDataCaptureFeatures(e){const{activeViewer:t,currentBestFeature:a,dataCaptureLayer:r,mode:s}=this,o=t?.imageSize;if(!o||!a||"none"===s||"video"===s||"panoramic-video"===s)throw new n("orientedimageryviewer:missing-input","Image size, current best feature and mode are required to save data capture features");if(!r)throw new n("orientedimageryviewer:missing-featurelayer","Data capture layer is not available");const c=await Promise.all(e.map(async e=>{const t=e.clone(),{geometry:i}=t;if(!i)return;const n=i.type,c=r.hasZ,l=r.geometryType,h=n!==l,u=h?await import("./transformers.js"):null,d=u?.default[l],m=h?d?.(i):i;if(m)switch(m.type){case"point":return t.geometry=await this.getMapPoint(me(s,m,o),{feature:a,imageSize:o,mode:s}),c||(delete t.geometry.z,t.geometry.hasZ=!1),t.geometry.hasM=!1,t;case"polygon":{const e=await Promise.all(m.rings.map(async e=>this.getMapPoint(e.map(([e,t,a])=>me(s,{x:e,y:t,z:a},o)),{feature:a,imageSize:o,mode:s})));return t.geometry=new O({spatialReference:e[0][0].spatialReference,hasZ:c,hasM:!1,rings:e.map(e=>e.map(de))}),t}case"polyline":{const e=await Promise.all(m.paths.map(async e=>this.getMapPoint(e.map(([e,t,a])=>me(s,{x:e,y:t,z:a},o)),{feature:a,imageSize:o,mode:s})));return t.geometry=new j({spatialReference:e[0][0].spatialReference,hasZ:c,hasM:!1,paths:e.map(e=>e.map(de))}),t}}})),l=c.filter(i);return r.applyEdits({addFeatures:l}).then(e=>{const{addFeatureResults:t}=e;let a=0;const i=c.map(e=>{const i=t[a++];return e?i:{error:new n("orientedimageryviewer:save-unsucccessful","Error in saving data capture features"),objectId:null,globalId:null}});return{...e,addFeatureResults:i}})}async searchBestImage(e,t){try{const a=await W(e,t);a&&await this.processFeatureResponse(a,e.point,t)}catch(a){y(a)||(this.setMessage("imageLoadError","error",a.message),u.getLogger(this).error("error occurred while finding best image",a))}}selectTriangularMeasurementFeature(e){this.currentBestFeatureMeasurementImage=this.features?.find(({attributes:t})=>t.objectId===Number(e))}setAdditionalCameraLocationsVisibility(e){this.additionalCameraLocations.forEach(t=>{t.visible=e})}setAdditionalCoverageVisibility(e){this.additionalFootprints.forEach(t=>{t.visible=e})}setCurrentCoverageVisibility(e){this.bestFeatureCurrentFootprint&&(this.bestFeatureCurrentFootprint.visible=e),this.currentBestFeatureLocation&&(this.currentBestFeatureLocation.visible=e)}setMapImageConversionToolState(e){this.mapImageConversionToolState=e}setCurrentPanoramaView(e,t){this._panoramicViewer?.set({yaw:e,pitch:t})}async startDataCapture(e,t){const a=this.activeViewer?.imageRenderer,{oiObjectIdField:i,currentBestFeature:r}=this;if(!a||!r||!i)return;const{attributes:{objectId:o}}=r,n=this.overlayedMapFeatures.get(e.id)?.toArray()??[],c=[],l=[];for(const s of n)`${s.getAttribute(i)}`==`${o}`?c.push(s):l.push(s);this.overlayGraphicsOnImage(e.id,new s(l)),this.collectionId=e.id;const h=await this.loadSketch(t),u=await this.loadDataCaptureAdapter(t);v(t),h.addGraphics(c),u.savedGraphics.addMany(c);a.ui.find("zoom").visible=!1,a.map.layers.add(this.sketchGraphicsLayer)}async stopDataCapture(e=!1){this.sketch?.cancel(),this.sketchGraphicsLayer?.removeAll(),this.sketchAdapter=p(this.sketchAdapter),this.sketch=p(this.sketch),this.collectionId=null;const{dataCaptureLayer:t}=this,a=this.activeViewer?.imageRenderer;if(!a||a.destroyed)return;a.map.layers.remove(this.sketchGraphicsLayer),e&&t&&await this.overlayMapFeatures(t,!0);const i=a.ui.find("zoom");i&&(i.visible=!0)}stopMeasurement(){this.heightMeasurementPixels=[],this.draw?.reset(),this.sketch?.cancel()}toggleAllOverlayMapFeatures(e){this.overlayedMapFeatures.forEach(t=>{this._toggleVisiblity(t,e)})}toggleOverlayMapFeatures(e,t,a){const i=this.overlayedMapFeatures.get(e);i&&a&&this._toggleVisiblity(i,t)}toggleSelection(e){const{sketch:t}=this;t&&(t.updateOnGraphicClick=e,t.cancel())}async transformAndPlotReferencePointOnImage(e){const{feature:t,selectedLocation:a,options:i}=e;let r=!1,s=!1;const o=this.bestFeatureFootprint?.geometry;switch(o?.type){case"polygon":{const e=a.spatialReference.equals(o.spatialReference)?a:await B(a,o.spatialReference);r=o.contains(e);break}case"mesh":{const e=a.spatialReference.equals(o.spatialReference)?a:await B(a,o.spatialReference);s=o.extent.contains(e);break}}if(!r&&!s)return void this.clearReferencePointOnImage();const n=await this.worldToImage(a,t,i);if(n)return v(i),this.plotReferencePointOnImage(n),{x:n.x,y:n.y};this.clearReferencePointOnImage()}async triangulatedLocationWorkflow(e,t){if(this.currentBestFeature&&e){const{currentBestFeature:a}=this;this.triangulatedPoint&&(this.measurementVectors=[],this.triangulatedPoint=null,this.clearLocationPointOnImage(!0));const i=ze(e,a);if(!i)return;this.measurementVectors.push(i),await this.plotReferenceLocationPoint(e,t),v(t),this._createTriangularImageLocationHandle()}}async _calculateTriangulatedPointFromGroundPoint(e,t){if(this.currentBestFeatureMeasurementImage&&e){const{currentBestFeatureMeasurementImage:a}=this,i=ze(e,a);i&&this.measurementVectors.push(i);const r=await Ue(this.measurementVectors);v(t),this.triangulatedPoint=r??this.triangulatedPoint}}async _fetchFeatures(e,t){if(!this.view)return;const a=this.layer;if(a){const i={include:a},r=this.view.toScreen(e);if(!r)return;const s=await this.view.hitTest(r,i);return this._processHitTestResults(a,s,t)}}async _fetchFeaturesWithController(e,t){try{await this._fetchFeatures(e,t)}catch(a){if(y(a))return;this.setMessage("imageLoadError","error"),u.getLogger(this).error("error occurred while fetching features",a)}}_groupFeaturesBySectors(){const{_suitabilities:e,additionalFeatures:t,features:a,invalidCameraHeading:i}=this,r=a.at(0);if(!e||!t||!r||!a||i)return void(this._sectorData=null);this._sectorData={};const o={};this._featureToSector=o;for(const h of Ae)this._sectorData[h]=new s;const n=e.map((e,t)=>({...e,featureIndex:t}));n.sort((e,t)=>e.trueSuitability-t.trueSuitability);const c=n.map(({distance:e})=>e),l=Math.max(...c);n.forEach(e=>{const{distance:t,angle:i,featureIndex:s}=e,n=t/l*Le[2],c=lt(t,l),h=ct(i);if(!this._sectorData)return;const u=Le[3]+n*Math.sin(i*Math.PI/180),d=Le[3]+n*Math.cos(i*Math.PI/180);let m;const p=a.at(s),g=p===r,{cameraPitch:y}=p.attributes,v=y<5;if(g&&v)m=-90;else{const e=u-Le[3],t=d-Le[3],a=t/Math.sqrt(e**2+t**2);let i=180*Math.acos(a)/Math.PI;(e<0&&t<0||e<0&&t>0)&&(i*=-1),m=i}const w=""===c?h:`${c}_${h}`;g&&(m===this.bestFeatureAngle?this.previousFeatureAngle=m:this.bestFeatureAngle=m,this.navigatorCurrentBestFeature=v?null:{x:u,y:d,direction:h}),o[`${p.attributes.objectId}`]=w;const f=this._sectorData[w];f.add({angle:i,featureIndex:s,x:u,y:d,objectID:p.attributes.objectId,sector:w,featureIndexInSector:f.length})})}_handleDestroyedTriangularSketchLayer(){this.sketchTriangularGraphicsLayer&&this.activeTriangulatedViewer&&(this.activeTriangulatedViewer.imageRenderer.map.layers.remove(this.sketchTriangularGraphicsLayer),this.sketchTriangularGraphicsLayer=new U,this.activeTriangulatedViewer.imageRenderer.map.layers.add(this.sketchTriangularGraphicsLayer),this.sketchTriangular&&(this.sketchTriangular.layer=this.sketchTriangularGraphicsLayer,this.sketchTriangular.view=this.activeTriangulatedViewer.imageRenderer))}_initializeMeasurementService(){this._measurementService||(this._measurementService=new ft(this))}_initializeSketchTriangular(){this.activeTriangulatedViewer&&(this.sketchTriangular=new Ft({view:this.activeTriangulatedViewer.imageRenderer,layer:this.sketchTriangularGraphicsLayer,updateOnGraphicClick:!1,defaultUpdateOptions:{toggleToolOnClick:!1}}))}_initializeSketchTriangularGraphicsLayer(){this.activeTriangulatedViewer&&(this.sketchTriangularGraphicsLayer=new U,this.activeTriangulatedViewer.imageRenderer.map.layers.add(this.sketchTriangularGraphicsLayer))}_initializeVideo(){if(this.videoElement||!this.currentBestFeature)return;this.removeHandles(_t.videoPlayerHandles),this.videoElement=new fe({video:this.currentBestFeature.attributes.imagePath,georeference:new ve({extent:new L(Ce)}),autoplay:!1}),this.videoElement.content?.loop&&(this.videoElement.content.loop=!1);const e=new N({source:this.videoElement,title:this.layer?.title,copyright:this.layer?.copyright});this.videoLayer=e,e&&this.videoMapView.map.layers.add(e),this.addHandles(dt(this.videoMapView),_t.videoPlayerHandles),this.videoViewModel=new gt({oiViewModel:this})}_plotLocationPointOnDefaultImage(e,a=!1){const i=A(e)?e.toJSON():e;i.x-=.5,i.y=.5-i.y,a?(this._correctedLocationPointOnImage=new t({geometry:new T({spatialReference:H.WebMercator,...i}),symbol:Ye}),this.imageMeasurementViewer.addGraphic(this._correctedLocationPointOnImage,0)):(this._locationPointOnImage=new t({geometry:new T({spatialReference:H.WebMercator,...i}),symbol:Ye}),this._imageViewer.addGraphic(this._locationPointOnImage,0))}_plotLocationPointOnPanoramicImage(e,a=!1){const i=a?this._panoramicMeasurementViewer:this._panoramicViewer,{imageSize:r}=i;if(!r)return;const[s,o]=r,{heading:n,pitch:c}=oe(e,s,o),l=ne(n,c),h=new t({geometry:new T(l,H.WebMercator),symbol:et});a?this._correctedLocationPointOnImage=h:this._locationPointOnImage=h,i.addGraphic(h,0)}_clearFeatureGeometries(){this.coveragePolygons.removeAll(),this.coverageFrustums.removeAll(),this.pointSources.removeAll()}_checkFeatures(e){return!!e?.length||(this.setMessage("noImageError","error"),this.currentBestFeature=null,!1)}async _getElevationSampleFromGround(e,t,a){if(!e[0])return;const i=await G(e);if(this._updateFootprintWithFeatures(t,i),"3d"===this.view?.type)try{return await this.view.map.ground.createElevationSampler(this.footprintExtent,a)}catch(r){y(r)||u.getLogger(this).error(r)}}async processElevationSample(e,t,a){const{elevationSource:i}=t[0].attributes,r=await this._getElevationSampleFromGround(e,t,a);return r||(i&&this.footprintExtent&&X(i)?await ie({extent:this.footprintExtent,lod:i.lod,url:i.url,rasterFunction:i.rasterFunction}):void 0)}_processSuitableFeatures(e,t){return $({features:e,selectedPoint:t,camera:ht(this.view)?this.view.camera:null,currentImage:this.currentBestFeature})}async _processHitTestResults(e,t,a){const{screenPoint:i,results:[r]}=t,s="graphic"===r?.type&&this.shouldShowSelectedImage,o=r?.mapPoint??this.view?.toMap(i);if(!o)return;o.x=D(o.x,o.spatialReference);const{layerFloorFilterClause:n}=this,c=e.spatialReference.equals(o.spatialReference)?o:await B(o,e.spatialReference),l=c.spatialReference.isGeographic?z(c):c,h=P("1=1",P(e.definitionExpression,n)),u=l.spatialReference.isGeographic?1:V(l.spatialReference),d={layerInstanceOrURL:e,point:l,queryParams:{where:h,maximumDistance:e.maximumDistance?e.maximumDistance/u:void 0,objectIds:s?[r.graphic.getAttribute(e.objectIdField)]:void 0}};await this.searchBestImage(d,a)}async _queryAndLoadByObjectId(e,t,a,i){this.displayMessage=null;const{response:r}=await wt(e,t,a,i);if(v(i),!r?.features?.length)throw new vt(t);const s=J(r.features[0].attributes).polygon,o=T.fromJSON(x(s)),n=Y(o),c=V(n.spatialReference);this.selectedPoint=n;const l={layerInstanceOrURL:e,point:n,queryParams:{where:P(P("1=1",P(e.definitionExpression,a)),`${e.objectIdField} <> ${t}`),maximumDistance:e.maximumDistance?e.maximumDistance/c:void 0}},h=await W(l,i);v(i);const{features:u}=h;return u.push(r.features[0]),await this.processFeatureResponse(h,n,{...i,loadBestImage:!1})}_reorderTriangularSketchLayer(){const e=this.imageMeasurementViewer.imageRenderer.map.layers?.length;this.sketchTriangularGraphicsLayer&&e&&this.imageMeasurementViewer.imageRenderer.map.layers.reorder(this.sketchTriangularGraphicsLayer,e-1)}_resetCursor(){const{activeViewer:e,imageMeasurementViewer:t}=this;e&&this.removeHandles(_t.activeViewerCursorHandles),t&&this.removeHandles(_t.imageViewerCursorHandles)}async _setImageSource(e,t,a,i,r,s){e.imageSource={datasetFormat:t.toUpperCase(),url:a.split("?")[0]},e.customParameters=Object.fromEntries(i),e.imageRotation=r??0,await e.loadImage(s)}_setMeasurementCursor(){const{activeViewer:e,imageMeasurementViewer:t,triangularMeasurementActive:a}=this;e&&this.addHandles(e.imageRenderer.acquireCursor("crosshair","high"),_t.activeViewerCursorHandles),t&&a&&this.addHandles(t.imageRenderer.acquireCursor("crosshair","high"),_t.activeViewerCursorHandles)}_toggleVisiblity(e,t){e.forEach(e=>{e.visible=t})}async _updateElevationOfSelectedPointAndLocations(e,t,a,i){const r=he(a),{location:s,cameraHeight:o}=e[0].attributes,n=await le(s.spatialReference,s.z,o,{elevationSample:r?a:void 0,elevationSource:r?void 0:e[0].attributes.elevationSource,extent:this.footprintExtent},i);v(i);const[c,...l]=await ae([t,...e.map(e=>e.attributes.geometry.clone())],n);v(i),t.elevation=c.z,e.forEach((e,t)=>{e.attributes.elevation=l[t].z})}_updateFeatures(e,t=!0){if(!e.length)return this.currentBestFeature=null,void this.additionalFeatures.removeAll();this.features.removeAll(),this.features.addMany(e),this.navigationNodes.removeAll(),this.navigationNodes.addMany(e.map(e=>{const{geometry:t,attributes:a}=e,{isSpherical:i,cameraHeading:r,cameraPitch:s}=a;return new pt({geometry:t,attributes:a,currentHeading:i?0:r,currentPitch:i?0:s})})),e.length>1?this.additionalFeatures.addMany(e.slice(1)):this.additionalFeatures.removeAll(),this._updateGroundElevation=!0,t&&(this.currentBestFeature=e[0]),"video"===this.mode&&(this._initializeVideo(),this.videoElement?.loaded&&this.videoViewModel?.playVideoFromSelectedLocation(e[0])),"panoramic-video"===this.mode&&this._loadVideo()}_updateFootprintWithFeatures(e,t){const a=[];for(const{attributes:{geometry:i}}of e)t.contains(i)||a.push([i.x,i.y]);a.sort((e,t)=>+E([e,t])),t.addRing(a),this.footprintExtent=be(t.extent,2,2)}async _updatePointsAndPolygons(e){const{pointSources:a,currentBestFeature:i,currentCoverageVisible:r,isAdditionalPointSourcesVisible:s,mode:o,layer:n}=this;if(i&&(this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint&&(this.bestFeatureCurrentFootprint.destroy(),this.bestFeatureCurrentFootprint=null,this.bestFeatureFootprint=null),!this.invalidCameraHeading)){await(this._adapter?.createFootprints(e)),v(e);for(const e of a)e.imageID===i.attributes.objectId?this.currentBestFeatureLocation=new t({attributes:{imageID:e.imageID},geometry:e.clone(),symbol:tt,visible:r}):this.additionalCameraLocations.push(new t({attributes:{imageID:e.imageID},geometry:e.clone(),symbol:at,visible:s}));if(("video"===o||"panoramic-video"===o)&&n&&!this.featureCache.length){const e=await q(n,i.geometry.spatialReference);e.features?.length&&(this.featureCache=e.features)}}}_updateCurrentBestFeature(e){if(!e)return;if(this.currentBestFeature=this.features?.at(e.featureIndex),"video"===this.mode)return void(this.currentBestFeature&&this.videoViewModel?.playVideoFromSelectedLocation(this.currentBestFeature));if("panoramic-video"===this.mode)return void(this.currentBestFeature&&this._panoramicVideoViewer.viewModel.playPanoramicVideoFromSelectedLocation(this.currentBestFeature));const t=this.currentBestFeature?.attributes.cameraPitch&&this.currentBestFeature?.attributes.cameraPitch<5;let a;if(t)a=-90;else{const t=e.x-Le[3],i=e.y-Le[3],r=i/Math.sqrt(t**2+i**2);let s=180*Math.acos(r)/Math.PI;(t<0&&i<0||t<0&&i>0)&&(s*=-1),a=s}a===this.bestFeatureAngle?this.previousFeatureAngle=a:this.bestFeatureAngle=a,this.navigatorCurrentBestFeature=t?null:{x:e.x,y:e.y,direction:e.sector.includes("_")?e.sector.split("_")[1]:e.sector}}_updateImageMeasurementBestFeature(e){e&&(this.currentBestFeatureMeasurementImage=this.features?.at(e.featureIndex))}clearGraphics(){this._imageViewer.clearGraphics(),this._panoramicViewer.clearGraphics(),this.imageMeasurementViewer.clearGraphics(),this._panoramicMeasurementViewer.clearGraphics()}clearReferencePointOnImage(){this._referencePointOnImage&&(this._imageViewer.removeGraphic(this._referencePointOnImage),this._panoramicViewer.removeGraphic(this._referencePointOnImage),this._referencePointOnImage=p(this._referencePointOnImage))}clearLocationPointOnImage(e=!1){this._locationPointOnImage&&!e&&(this._imageViewer.removeGraphic(this._locationPointOnImage),this._panoramicViewer.removeGraphic(this._locationPointOnImage),this._locationPointOnImage=p(this._locationPointOnImage)),this._correctedLocationPointOnImage&&(this.imageMeasurementViewer.removeGraphic(this._correctedLocationPointOnImage),this._panoramicMeasurementViewer.removeGraphic(this._correctedLocationPointOnImage),this._correctedLocationPointOnImage=p(this._correctedLocationPointOnImage))}plotReferencePoint(e){"mapPoint"in e?this.plotReferencePointOnGround(e.mapPoint):this.plotReferencePointOnGround(e)}async plotReferenceLocationPoint(e,t){if(this.currentBestFeatureMeasurementImage){const a=await this.worldToImage(e,this.currentBestFeatureMeasurementImage,{signal:t});v(t),a&&this.plotLocationPointOnImage(a,!0)}}setMessage(e,t,a,i){this.displayMessage={key:e,type:t,data:a,map:i}}async transformAndPlotSelectedLocation(e){const{currentBestFeature:t,invalidCameraHeading:a,selectedPoint:i,activeViewer:r}=this;if(this._crossSymbol&&(this._panoramicViewer.removeGraphic(this._crossSymbol),this._imageViewer.removeGraphic(this._crossSymbol),this._crossSymbol=p(this._crossSymbol)),!i||!t||"image-loaded"!==r?.state||a)return;let s;try{s=await this.worldToImage(i,t,e),v(e),await this.plotSelectedPointOnImage(s,e)}catch(o){y(o)||u.getLogger(this).error("failed to transform map point to pixel, cross symbol will not be plotted on image",{error:o,selectedPoint:i,feature:t})}}async worldToImage(e,t,a){const{footprintExtent:i}=this,{imageSize:r}=this.activeViewer;if("none"===this.mode||!t||!r||!i)return;const{attributes:{location:s,elevationSource:o,cameraHeading:n,cameraHeight:c},elevationSample:l}=t;let h=s.clone();const u=await le(s.spatialReference,s.z??0,c,{elevationSample:l,elevationSource:o});t.elevationSample=u.elevationSample;const d=Array.isArray(e)?e:[e];let m,p=await Promise.all(d.map(e=>new Promise(t=>{if(!e.hasZ)return t(ae(e,u));t(e)})));if(s.spatialReference.isGeographic&&(h=await B(h,H.WebMercator,a)),p=await Promise.all(p.map(async e=>h.spatialReference.equals(e.spatialReference)?e:await B(e,h.spatialReference,a))),v(a),"panoramic"===this.mode)m=ye(p,{imageHeight:r[1],imageWidth:r[0],cameraHeading:n,cameraLocation:h});else{const e=pe(t.attributes,r[0],r[1]);m=ge(p,{...e,cameraLocation:h})}return Array.isArray(e)?m:m[0]}updateCurrentCoveragePolygon(e){const{additionalFootprints:a,additionalCameraLocations:i,currentBestFeature:r,currentBestFeatureLocation:s,currentCoverageVisible:o,selectedPoint:n,view:c,_adapter:l,mode:h}=this;if(!r)return;const{attributes:{objectId:u},elevationSample:d}=r;if(this._initialCurrentCoverageUpdate){if(this._overlays?.removeAll(),this._initialCurrentCoverageUpdate=!1,this.bestFeatureCurrentFootprint=p(this.bestFeatureCurrentFootprint),e&&!this.invalidCameraHeading&&(e.visible=o,this.bestFeatureCurrentFootprint=e),c){const e=[...a,...i,s].filter(ut);"3d"===c?.type&&d&&l?.updateGroundElevation&&(this._updateGroundElevation&&l.updateGroundElevation(e,d),"panoramic"===h&&l.updateGroundElevation([this.bestFeatureCurrentFootprint],d)),this._updateGroundElevation=!1,n&&(e.splice(-2,0,this.bestFeatureCurrentFootprint),e.push(new t({geometry:n.clone(),symbol:Ne.clone(),attributes:{imageID:u}}))),this._overlays.graphics.addMany(e)}}else if(c){if(this.invalidCameraHeading)return;this.bestFeatureCurrentFootprint&&(this._overlays?.remove(this.bestFeatureCurrentFootprint),this.bestFeatureCurrentFootprint=p(this.bestFeatureCurrentFootprint));const t=this.bestFeatureCurrentFootprint&&this._overlays?this._overlays.graphics.indexOf(this.bestFeatureCurrentFootprint):-1;e&&(this.bestFeatureCurrentFootprint=e,"3d"===c?.type&&d&&l?.updateGroundElevation&&"panoramic"===h&&l.updateGroundElevation([e],d),e.visible=this.currentCoverageVisible,this._overlays?.graphics.add(this.bestFeatureCurrentFootprint,t>=0?t:this._overlays.graphics.length-1))}}};e([S()],Vt.prototype,"activeLayer",null),e([S({readOnly:!0})],Vt.prototype,"activeViewer",null),e([S()],Vt.prototype,"activeTriangulatedViewer",null),e([S()],Vt.prototype,"accuracyParametersMissing",null),e([S()],Vt.prototype,"additionalFeatures",void 0),e([S({type:s.ofType(t)})],Vt.prototype,"additionalCameraLocations",void 0),e([S({type:s.ofType(t)})],Vt.prototype,"additionalFootprints",void 0),e([S()],Vt.prototype,"areaMeasurementResult",void 0),e([S()],Vt.prototype,"areaMeasurementAccuracy",void 0),e([S()],Vt.prototype,"bestFeatureAngle",void 0),e([S()],Vt.prototype,"bestFeatureCurrentFootprint",void 0),e([S({type:t})],Vt.prototype,"bestFeatureFootprint",void 0),e([S({type:Number})],Vt.prototype,"brightness",null),e([S()],Vt.prototype,"cameraHeadingThreshold",void 0),e([S()],Vt.prototype,"cameraPitchThreshold",void 0),e([S()],Vt.prototype,"clickAction",void 0),e([S()],Vt.prototype,"videoViewModel",void 0),e([S()],Vt.prototype,"collectionId",void 0),e([S({type:Number})],Vt.prototype,"contrast",null),e([S()],Vt.prototype,"conversionProps",void 0),e([S()],Vt.prototype,"coverageFrustums",void 0),e([S()],Vt.prototype,"coveragePolygons",void 0),e([S()],Vt.prototype,"currentBestFeature",void 0),e([S()],Vt.prototype,"currentBestFeatureMeasurementImage",void 0),e([S()],Vt.prototype,"currentBestFeatureLocation",void 0),e([S()],Vt.prototype,"currentCoverageVisible",void 0),e([S()],Vt.prototype,"currentNode",null),e([S()],Vt.prototype,"depthImage",void 0),e([S()],Vt.prototype,"depthImageNotSupported",null),e([S()],Vt.prototype,"directionMode",void 0),e([S()],Vt.prototype,"featureCache",void 0),e([S()],Vt.prototype,"navigationNodes",void 0),e([S({json:{write:!1}})],Vt.prototype,"determineWorkflowForFeature",void 0),e([S({json:{write:!1}})],Vt.prototype,"determineWorkflowForTriangularMeasurement",void 0),e([S()],Vt.prototype,"disabled",void 0),e([S()],Vt.prototype,"displayMessage",void 0),e([S()],Vt.prototype,"displayNewMeasurementButton",void 0),e([S()],Vt.prototype,"distanceMeasurementResult",void 0),e([S()],Vt.prototype,"distanceAccuracyArray",void 0),e([S()],Vt.prototype,"dataCaptureLayer",void 0),e([S({readOnly:!0})],Vt.prototype,"featureCount",null),e([S()],Vt.prototype,"features",void 0),e([S()],Vt.prototype,"groundCoordinates",void 0),e([S()],Vt.prototype,"groundCoordinatesAccuracy",void 0),e([S()],Vt.prototype,"heightMeasurementPixels",void 0),e([S()],Vt.prototype,"heightGraphic",void 0),e([S()],Vt.prototype,"heightMeasurementResult",void 0),e([S()],Vt.prototype,"heightMeasurementAccuracy",void 0),e([S()],Vt.prototype,"measurementAngle",void 0),e([S()],Vt.prototype,"tempDistance",void 0),e([S({readOnly:!0})],Vt.prototype,"imageGalleryEnabled",null),e([S()],Vt.prototype,"imageGeometryField",void 0),e([S({readOnly:!0})],Vt.prototype,"imageLoaded",null),e([S()],Vt.prototype,"imageLocationToolState",void 0),e([S({readOnly:!0})],Vt.prototype,"invalidCameraHeading",null),e([S()],Vt.prototype,"imagePointsInView",null),e([S()],Vt.prototype,"imageMeasurementViewer",void 0),e([S()],Vt.prototype,"isAdditionalCoverageVisible",void 0),e([S()],Vt.prototype,"isAdditionalPointSourcesVisible",void 0),e([S()],Vt.prototype,"measurementVectors",void 0),e([S()],Vt.prototype,"layer",void 0),e([S()],Vt.prototype,"layerView",null),e([S({readOnly:!0})],Vt.prototype,"layerFloorFilterClause",null),e([S({type:Number})],Vt.prototype,"localPort",void 0),e([S()],Vt.prototype,"mapImageConversionToolState",void 0),e([S()],Vt.prototype,"measureType",void 0),e([S()],Vt.prototype,"measurementGraphic",void 0),e([S({readOnly:!0,value:"none"})],Vt.prototype,"mode",null),e([S()],Vt.prototype,"navigationMode",void 0),e([S()],Vt.prototype,"navigatorCurrentBestFeature",void 0),e([S()],Vt.prototype,"oiObjectIdField",void 0),e([S({type:s.ofType(t)})],Vt.prototype,"overlayedCameraLocations",void 0),e([S()],Vt.prototype,"overlayedMapFeatures",void 0),e([S()],Vt.prototype,"panoramicVideoLoaded",null),e([S()],Vt.prototype,"pixelCoordinates",void 0),e([S()],Vt.prototype,"preserveAngle",void 0),e([S()],Vt.prototype,"pointSources",void 0),e([S({readOnly:!0})],Vt.prototype,"popupEnabled",null),e([S()],Vt.prototype,"previousFeatureAngle",void 0),e([S()],Vt.prototype,"referencePoint",null),e([S({readOnly:!0})],Vt.prototype,"sectorData",null),e([S()],Vt.prototype,"selectedPoint",void 0),e([S({type:Number})],Vt.prototype,"sharpness",null),e([S()],Vt.prototype,"shouldShowSelectedImage",void 0),e([S()],Vt.prototype,"sketch",void 0),e([S()],Vt.prototype,"sketchTriangular",void 0),e([S()],Vt.prototype,"sketchTriangularGraphicsLayer",void 0),e([S()],Vt.prototype,"draw",void 0),e([S()],Vt.prototype,"sketchAdapter",void 0),e([S({readOnly:!0})],Vt.prototype,"sketchGraphicsLayer",null),e([S({readOnly:!0})],Vt.prototype,"state",null),e([S({readOnly:!0})],Vt.prototype,"thumbnails",null),e([S()],Vt.prototype,"triangularMeasurementActive",void 0),e([S()],Vt.prototype,"triangulatedDistanceMeasurement",void 0),e([S()],Vt.prototype,"triangulatedDistanceAccuracy",void 0),e([S()],Vt.prototype,"triangulatedAreaMeasurement",void 0),e([S()],Vt.prototype,"triangulatedAreaAccuracy",void 0),e([S()],Vt.prototype,"triangulatedMeasurementGraphic",void 0),e([S()],Vt.prototype,"triangulatedPoint",void 0),e([S()],Vt.prototype,"triangulatedMeasurementAdapter",void 0),e([S()],Vt.prototype,"updateFootprint",void 0),e([S()],Vt.prototype,"updateFootprintPanorama",void 0),e([S()],Vt.prototype,"updatingTriangularMeasurementState",void 0),e([S({value:null})],Vt.prototype,"view",null),e([S()],Vt.prototype,"videoElement",void 0),e([S()],Vt.prototype,"videoLayer",void 0),e([S()],Vt.prototype,"videoMapView",void 0),e([S()],Vt.prototype,"_adapter",void 0),e([S()],Vt.prototype,"_defaultGraphicsLayer",null),e([S()],Vt.prototype,"_highlightedFeatureHandle",void 0),e([S()],Vt.prototype,"_imageViewer",void 0),e([S()],Vt.prototype,"_initialCurrentCoverageUpdate",void 0),e([S()],Vt.prototype,"_locationPointOnImage",void 0),e([S()],Vt.prototype,"_measurementService",void 0),e([S()],Vt.prototype,"_correctedLocationPointOnImage",void 0),e([S()],Vt.prototype,"_overlays",void 0),e([S({readOnly:!0})],Vt.prototype,"_overlaysView",null),e([S()],Vt.prototype,"_panoramicVideoViewer",void 0),e([S()],Vt.prototype,"_panoramicViewer",void 0),e([S()],Vt.prototype,"_panoramicMeasurementViewer",void 0),e([S()],Vt.prototype,"_referencePointOnGround",void 0),e([S()],Vt.prototype,"_referencePointOnImage",void 0),e([S()],Vt.prototype,"_sectorData",void 0),e([S()],Vt.prototype,"_featureToSector",void 0),e([S({readOnly:!0})],Vt.prototype,"_updatingHandles",void 0),e([S()],Vt.prototype,"footprintExtent",void 0),e([S()],Vt.prototype,"_featureChangedTask",void 0),Vt=e([k("esri.widgets.OrientedImageryViewer.OrientedImageryViewerViewModel")],Vt);const St=Vt;export{St as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as o}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";function i(){return t({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-pad":()=>import("@esri/calcite-components/dist/components/calcite-action-pad")})}function n(t){const{expandDisabled:i,layout:n,overlayPositioning:c,actions:e}=t;return o("calcite-action-pad",{expandDisabled:i,layout:n,overlayPositioning:c,slot:"fab"},e.map(t=>o("calcite-action",{icon:t.icon,key:t.title,onclick:t.onclick,scale:t.scale,text:t.text,title:t.title})))}function c(t){const{uiStrings:i,layout:c,onAction:e}=t;return o(n,{actions:[{icon:"chevron-left",scale:"s",text:i.previous,title:i.previous,onclick:()=>{e({step:-1})}},{icon:"chevron-right",scale:"s",text:i.next,title:i.next,onclick:()=>{e({step:1})}}],expandDisabled:!0,layout:c,overlayPositioning:"fixed"})}export{n as FloatingActionPad,c as SequentialNavigationUI,i as loadSequentialNavigationUIComponents};
5
+ import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as o}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";function i(){return t({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar")})}function n(t){const{expandDisabled:i,layout:n,overlayPositioning:c,actions:e}=t;return o("calcite-action-bar",{expandDisabled:i,floating:!0,layout:n,overlayPositioning:c,slot:"fab"},e.map(t=>o("calcite-action",{icon:t.icon,key:t.title,onclick:t.onclick,scale:t.scale,text:t.text,title:t.title})))}function c(t){const{uiStrings:i,layout:c,onAction:e}=t;return o(n,{actions:[{icon:"chevron-left",scale:"s",text:i.previous,title:i.previous,onclick:()=>{e({step:-1})}},{icon:"chevron-right",scale:"s",text:i.next,title:i.next,onclick:()=>{e({step:1})}}],expandDisabled:!0,layout:c,overlayPositioning:"fixed"})}export{n as FloatingActionBar,c as SequentialNavigationUI,i as loadSequentialNavigationUIComponents};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{get as i}from"../../../core/accessorSupport/get.js";import n from"../../Widget.js";import{loadCalciteComponents as s}from"../../support/componentsUtils.js";import{tsx as c}from"../../support/jsxFactory.js";const r={point:()=>[p("pin","point","draw.point"),p("line","polyline","draw.polyline"),p("polygon","polygon","draw.polygon")],polyline:()=>[p("line","polyline","draw.polyline")],polygon:()=>[p("polygon","polygon","draw.polygon")]};let a=class extends n{constructor(o){super(o),this.messages=null,this.type=null}loadDependencies(){return s({"action-pad":()=>import("@esri/calcite-components/dist/components/calcite-action-pad"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action")})}static{this.vnodeSelector="calcite-action-pad"}render(){const{messages:o,type:t}=this,e=l(t);return c("calcite-action-pad",{expandDisabled:!0,layout:"horizontal",position:"start"},e.map(({icon:t,messageKey:e,action:n})=>{const s=i(o,e);return c("calcite-action-group",null,c("calcite-action",{alignment:"center",bind:this,"data-action":n,icon:t,onclick:this.onAction,text:s,title:s}))}))}};function p(o,t,e){return{icon:o,messageKey:e,action:`draw-${t}`}}function l(o){return[{icon:"cursor",messageKey:"selectFeature",action:"select-feature"},...r[o]?.()??[],{icon:"save",messageKey:"save",action:"save"},{icon:"trash",messageKey:"delete",action:"delete-feature"}]}o([t()],a.prototype,"messages",void 0),o([t()],a.prototype,"onAction",void 0),o([t()],a.prototype,"type",void 0),a=o([e("esri.widgets.OrientedImageryViewer.components.SketchTools")],a);const m=a;export{m as default};
5
+ import{__decorate as o}from"tslib";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{get as i}from"../../../core/accessorSupport/get.js";import n from"../../Widget.js";import{loadCalciteComponents as r}from"../../support/componentsUtils.js";import{tsx as s}from"../../support/jsxFactory.js";const c={point:()=>[p("pin","point","draw.point"),p("line","polyline","draw.polyline"),p("polygon","polygon","draw.polygon")],polyline:()=>[p("line","polyline","draw.polyline")],polygon:()=>[p("polygon","polygon","draw.polygon")]};let a=class extends n{constructor(o){super(o),this.messages=null,this.type=null}loadDependencies(){return r({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action")})}static{this.vnodeSelector="calcite-action-bar"}render(){const{messages:o,type:t}=this,e=l(t);return s("calcite-action-bar",{expandDisabled:!0,floating:!0,layout:"horizontal",position:"start"},e.map(({icon:t,messageKey:e,action:n})=>{const r=i(o,e);return s("calcite-action-group",null,s("calcite-action",{alignment:"center",bind:this,"data-action":n,icon:t,onclick:this.onAction,text:r,title:r}))}))}};function p(o,t,e){return{icon:o,messageKey:e,action:`draw-${t}`}}function l(o){return[{icon:"cursor",messageKey:"selectFeature",action:"select-feature"},...c[o]?.()??[],{icon:"save",messageKey:"save",action:"save"},{icon:"trash",messageKey:"delete",action:"delete-feature"}]}o([t()],a.prototype,"messages",void 0),o([t()],a.prototype,"onAction",void 0),o([t()],a.prototype,"type",void 0),a=o([e("esri.widgets.OrientedImageryViewer.components.SketchTools")],a);const m=a;export{m as default};