@arcgis/core 4.33.0-next.20250514 → 4.33.0-next.20250515
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.
- package/Graphic.js +1 -1
- package/Map.js +1 -1
- package/WebScene.js +1 -1
- package/applications/Components/SelectionOperation.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/009730713ed9bc7c7388.js +1 -0
- package/assets/esri/core/workers/chunks/02853ab923245459b32e.js +1 -0
- package/assets/esri/core/workers/chunks/0624ae07d3af8d5f1ac8.js +1 -0
- package/assets/esri/core/workers/chunks/{6e8c6c9112ecb867b7be.js → 0817ddd885ce8b2459cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{69e8aabe5a1eb2d1e414.js → 0832bd5195b5791dd803.js} +1 -1
- package/assets/esri/core/workers/chunks/0d23610475c85385fbff.js +1 -0
- package/assets/esri/core/workers/chunks/{b4f38fe9cc948a39ad87.js → 0fd6d80393722132e044.js} +2 -2
- package/assets/esri/core/workers/chunks/{b4f38fe9cc948a39ad87.js.LICENSE.txt → 0fd6d80393722132e044.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/1051a5a57b2fb843a555.js +1 -0
- package/assets/esri/core/workers/chunks/133e4bde346828d4510b.js +1 -0
- package/assets/esri/core/workers/chunks/19a58adc75a34f84b0ef.js +1 -0
- package/assets/esri/core/workers/chunks/1d7f2abfccc54659d6f2.js +1 -0
- package/assets/esri/core/workers/chunks/{339e7a900e2bba9d3647.js → 1f19bd3ef795c6765384.js} +1 -1
- package/assets/esri/core/workers/chunks/{837f886f759fc6f0489d.js → 1f4fd9e3849f4e593375.js} +1 -1
- package/assets/esri/core/workers/chunks/1f9c6fbcd4d0eae1e574.js +1 -0
- package/assets/esri/core/workers/chunks/234117cc5cb7c6863313.js +1 -0
- package/assets/esri/core/workers/chunks/{1c025beaaac5ec7c04fb.js → 2adf558cd8d8155d07d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{47f64a340b5d56bf9e59.js → 2cf82d3645c75d311e99.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7ab3511f6627f467796.js → 377a7f0f7d304ff9fe5b.js} +1 -1
- package/assets/esri/core/workers/chunks/3b4b4f84d594db8945f9.js +1 -0
- package/assets/esri/core/workers/chunks/3bf1cf6c3cba172e2f6d.js +1 -0
- package/assets/esri/core/workers/chunks/{b3ca65d6112079fb1d00.js → 3ce5d7ad16e41eea05be.js} +1 -1
- package/assets/esri/core/workers/chunks/465f2db4ab8aa9c9f907.js +1 -0
- package/assets/esri/core/workers/chunks/{1e13e03aad422f9e871e.js → 47fe2379f2214bf50036.js} +1 -1
- package/assets/esri/core/workers/chunks/{b8b5dfd2d73a8410fba2.js → 4954e0cf4a40e45d237f.js} +1 -1
- package/assets/esri/core/workers/chunks/4a362a35bcdb8405a53a.js +1 -0
- package/assets/esri/core/workers/chunks/4f8ebd9f0758b801835c.js +1 -0
- package/assets/esri/core/workers/chunks/5228d39c05d660a135b6.js +1 -0
- package/assets/esri/core/workers/chunks/{736cb9f74bf050b70f4c.js → 52a3d0e041717da7697e.js} +1 -1
- package/assets/esri/core/workers/chunks/54ea93f416ab52b413c1.js +1 -0
- package/assets/esri/core/workers/chunks/554a8bf4626336e68798.js +1 -0
- package/assets/esri/core/workers/chunks/55f087bca75c3f2a4515.js +1 -0
- package/assets/esri/core/workers/chunks/{bbaadce582df7e20397b.js → 56d2a20c1b143697aa19.js} +1 -1
- package/assets/esri/core/workers/chunks/57211c35a9646f088d86.js +1 -0
- package/assets/esri/core/workers/chunks/58526def64536b6581ab.js +1 -0
- package/assets/esri/core/workers/chunks/5890740d5a761b038560.js +1 -0
- package/assets/esri/core/workers/chunks/{9a641fb94819574e48f6.js → 5a73d8b7b01758ed4fdd.js} +1 -1
- package/assets/esri/core/workers/chunks/5dbd8d81d94cfda5bb32.js +1 -0
- package/assets/esri/core/workers/chunks/5e52c1c076a1502f9fe4.js +1 -0
- package/assets/esri/core/workers/chunks/609c7c9b7046b3a7acde.js +1 -0
- package/assets/esri/core/workers/chunks/{30f3014c0ac6e2bc14bf.js → 622c0552ca3cd674d46c.js} +1 -1
- package/assets/esri/core/workers/chunks/{6e64ce0958c3432004b6.js → 62798f66872dc32e77d6.js} +1 -1
- package/assets/esri/core/workers/chunks/6409160d226a0bea5ac6.js +1 -0
- package/assets/esri/core/workers/chunks/65fd971d0574d69cbc26.js +1 -0
- package/assets/esri/core/workers/chunks/6993a59cbb78bc26f029.js +1 -0
- package/assets/esri/core/workers/chunks/6b23ca6570357f9fb724.js +1 -0
- package/assets/esri/core/workers/chunks/6c37a5bd00d255d1337a.js +1 -0
- package/assets/esri/core/workers/chunks/6ce4327f63e6eb92bba8.js +1 -0
- package/assets/esri/core/workers/chunks/6f9b8df290b0ce09beae.js +1 -0
- package/assets/esri/core/workers/chunks/{e0247252c6a0f3340e33.js → 6fa1a5b7276a037dbd6a.js} +84 -106
- package/assets/esri/core/workers/chunks/7c819b3e6d69c526f4b2.js +1 -0
- package/assets/esri/core/workers/chunks/7df147da40474b028705.js +1 -0
- package/assets/esri/core/workers/chunks/{0766ecb677d667e5fb83.js → 7e1dc8e5e18f18dd21e2.js} +2 -2
- package/assets/esri/core/workers/chunks/{0766ecb677d667e5fb83.js.LICENSE.txt → 7e1dc8e5e18f18dd21e2.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{e662c86b8bafc5512d3d.js → 847e88e1d6da1e74cdc8.js} +1 -1
- package/assets/esri/core/workers/chunks/{6f5ec9bf7cf8a36d8e8b.js → 87eca6de502d18d8b7eb.js} +1 -1
- package/assets/esri/core/workers/chunks/{10e6dffa57aa1a626708.js → 8a6aac37b3133de74cce.js} +1 -1
- package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/8f1fbfdac04e694f621d.js +1 -0
- package/assets/esri/core/workers/chunks/91cd29f53f07bc38fe75.js +1 -0
- package/assets/esri/core/workers/chunks/{5583d18032ed8bc17c74.js → 938f1eebc48871be64e9.js} +1 -1
- package/assets/esri/core/workers/chunks/97c148adf0347c69a79c.js +1 -0
- package/assets/esri/core/workers/chunks/{029a118e6dfb3f544a5c.js → 98ef17d15517368d2383.js} +1 -1
- package/assets/esri/core/workers/chunks/9c8224ca29475556e5ea.js +1 -0
- package/assets/esri/core/workers/chunks/{fd24dd602a3fed88d90e.js → 9d5eac3bd1526e2b33e3.js} +1 -1
- package/assets/esri/core/workers/chunks/{38f5e6a202ce292edd9f.js → 9eb9c8db2510154c09cc.js} +1 -1
- package/assets/esri/core/workers/chunks/a036503087baa1f9fd00.js +1 -0
- package/assets/esri/core/workers/chunks/a673128da9e6656ead2e.js +1 -0
- package/assets/esri/core/workers/chunks/{90ae15ce22a49bd84876.js → ab9614555a15f04396f6.js} +2 -2
- package/assets/esri/core/workers/chunks/{90ae15ce22a49bd84876.js.LICENSE.txt → ab9614555a15f04396f6.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/ae733c963d61065faa54.js +1 -0
- package/assets/esri/core/workers/chunks/b0522dffa5600345c07e.js +1 -0
- package/assets/esri/core/workers/chunks/{d1f7bfb8daf11ecada9f.js → b4273381dc069f4e1fa2.js} +1 -1
- package/assets/esri/core/workers/chunks/{fb2e28e6a87956267d1c.js → b92a34f88569c481ed10.js} +1 -1
- package/assets/esri/core/workers/chunks/{352b7dcd1633e0c98194.js → ba940ebdae84b174a7be.js} +1 -1
- package/assets/esri/core/workers/chunks/bf9b6b74654d303a6dae.js +1 -0
- package/assets/esri/core/workers/chunks/c07c1bb7ae09136dc1f6.js +1 -0
- package/assets/esri/core/workers/chunks/c938f5d269ba202d10ef.js +1 -0
- package/assets/esri/core/workers/chunks/cbbca011f8b176d4b5db.js +1 -0
- package/assets/esri/core/workers/chunks/{c604fefedccfd4db9953.js → ce321fd8fc5551e190ec.js} +1 -1
- package/assets/esri/core/workers/chunks/ce53ddda04e09ba2f860.js +1 -0
- package/assets/esri/core/workers/chunks/d166f805990353578494.js +1 -0
- package/assets/esri/core/workers/chunks/d9a23fb0c6c936d5e8ec.js +1 -0
- package/assets/esri/core/workers/chunks/db3f710d770adf631b28.js +2 -0
- package/assets/esri/core/workers/chunks/{6394ab6f629aa90292e6.js.LICENSE.txt → db3f710d770adf631b28.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{6805e7b43d6ecf3ea93c.js → dcf5719f38ad40b92941.js} +1 -1
- package/assets/esri/core/workers/chunks/e2cada6644c49b1b6e79.js +1 -0
- package/assets/esri/core/workers/chunks/e2fb4bebce3aee406efa.js +1 -0
- package/assets/esri/core/workers/chunks/e3638f9d4c0fda238f4b.js +1 -0
- package/assets/esri/core/workers/chunks/e85f892ea44d67d53ff0.js +2 -0
- package/assets/esri/core/workers/chunks/{3596540ef49e5330ceb2.js.LICENSE.txt → e85f892ea44d67d53ff0.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/e89345c7af9d3d4d8452.js +1 -0
- package/assets/esri/core/workers/chunks/{a31658f544ac6e1801d6.js → ead5d4e271effc04def3.js} +1 -1
- package/assets/esri/core/workers/chunks/ece68a25651ef03fc95d.js +1 -0
- package/assets/esri/core/workers/chunks/f218a190015de1444018.js +1 -0
- package/assets/esri/core/workers/chunks/f229044615af3142bcb0.js +1 -0
- package/assets/esri/core/workers/chunks/f2692f25ef693cf12ce0.js +1 -0
- package/assets/esri/core/workers/chunks/f4c6ea630cecf0f260d7.js +2 -0
- package/assets/esri/core/workers/chunks/{e0dc8794343c2a949ffb.js.LICENSE.txt → f4c6ea630cecf0f260d7.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/f718cb847c4eb1e43ad9.js +1 -0
- package/assets/esri/core/workers/chunks/faa40ef04604c7cce706.js +1 -0
- package/assets/esri/core/workers/chunks/{218a66d53f7cf4f285aa.js → fbd2f45d5adce4ca323f.js} +2 -2
- package/assets/esri/core/workers/chunks/{218a66d53f7cf4f285aa.js.LICENSE.txt → fbd2f45d5adce4ca323f.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{498886c321a2501658bc.js → ffaa977cd97a2b7190c5.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +5 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/Jpg.js +1 -1
- package/chunks/LineSeries.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/ShadowCastAccumulate.glsl.js +7 -5
- package/chunks/ShadowCastVisualize.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +8 -7
- package/chunks/Transformation2D.js +1 -1
- package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
- package/chunks/arcgis-knowledge-client-core.js +1 -1
- package/chunks/basis_encoder.js +1 -1
- package/chunks/basis_transcoder.js +1 -1
- package/chunks/bundle.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/chunks/dxt_encoder.js +1 -1
- package/chunks/geometryEngineBase.js +1 -1
- package/chunks/i3s.js +1 -1
- package/chunks/lclayout.js +1 -1
- package/chunks/libtess-asm.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/chunks/vec4.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/image/apng.js +1 -1
- package/core/image/gif.js +1 -1
- package/core/mathUtils.js +1 -1
- package/core/workers/Connection.js +1 -1
- package/geometry/operators/densifyOperator.d.ts +0 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/support/meshProperties.js +1 -1
- package/geometry/support/normalizeUtilsSync.js +1 -1
- package/interfaces.d.ts +200 -147
- package/intl/date.js +1 -1
- package/intl/number.js +1 -1
- package/layers/BingMapsLayer.js +1 -1
- package/layers/graphics/OptimizedFeatureSet.js +1 -1
- package/layers/graphics/controllers/StreamController.js +1 -1
- package/layers/graphics/data/FeatureIdInfo.js +5 -0
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/StreamFeatureManager.js +1 -1
- package/layers/graphics/data/createFeatureId.js +5 -0
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/graphics/sources/WFSSourceWorker.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/ogc/ogcFeatureUtils.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/core/utils.js +1 -1
- package/layers/orientedImagery/queries.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/support/LercWorker.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/layers/support/rasterFunctions/stretchUtils.js +1 -1
- package/layers/support/wmsUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/package.json +1 -1
- package/rest/networks/support/Association.js +1 -1
- package/rest/networks/support/NetworkElement.js +1 -1
- package/rest/networks/support/QueryAssociationsParameters.js +1 -1
- package/rest/networks/support/TelecomNetworkElement.js +1 -1
- package/rest/networks/support/TraceResult.js +1 -1
- package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
- package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
- package/rest/query/operations/queryRelatedRecords.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/views/2d/engine/ManagedCanvas.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/webgl/TileContainer.js +1 -1
- package/views/2d/engine/webgl/grouping.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/featureServiceUtils.js +1 -1
- package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AnalysisViewManager3D.js +1 -1
- package/views/3d/analysis/DimensionAnalysisView3D.d.ts +4 -0
- package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
- package/views/3d/camera/constraintUtils/common.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/layers/DimensionLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/ViewshedLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/QueryEngine.js +1 -1
- package/views/3d/layers/graphics/focusAreaStyle.js +5 -0
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
- package/views/3d/layers/i3s/PagedNodeIndex.js +1 -1
- package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/LayerViewAnalysisViewManager.js +5 -0
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileAgent.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IndexRange/ComponentRange.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +3 -25
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Texture2DShadowBindUniform.js +5 -0
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +3 -3
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
- package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
- package/views/3d/webgl.js +1 -1
- package/views/FocusArea.js +1 -1
- package/views/FocusAreas.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/TextureDescriptor.js +1 -1
- package/views/webgl/textureUtils.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
- package/widgets/ElevationProfile/support/profileUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +5 -0
- package/widgets/OrientedImageryViewer/components/NavigationUIViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/imageNavigationUtils.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +5 -0
- package/widgets/OrientedImageryViewer/navigation/NavigationManagerPanoramic.js +5 -0
- package/widgets/OrientedImageryViewer/navigation/errors.js +5 -0
- package/widgets/OrientedImageryViewer/navigation/queries.js +5 -0
- package/widgets/OrientedImageryViewer/navigation/utils.js +5 -0
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utils/createAssociation.js +1 -1
- package/assets/esri/core/workers/chunks/0516bd18334d3af6c555.js +0 -1
- package/assets/esri/core/workers/chunks/0d8a635c1f9aeaf7564c.js +0 -1
- package/assets/esri/core/workers/chunks/191a45a594ecaf7f1abb.js +0 -1
- package/assets/esri/core/workers/chunks/1abd026ed12c863e1d94.js +0 -1
- package/assets/esri/core/workers/chunks/1c6542315390037053a6.js +0 -1
- package/assets/esri/core/workers/chunks/201db423e3c6f947b77c.js +0 -1
- package/assets/esri/core/workers/chunks/23de8aeed5b82c682cbe.js +0 -1
- package/assets/esri/core/workers/chunks/2e0af748eba93f3ea6cb.js +0 -1
- package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js +0 -2
- package/assets/esri/core/workers/chunks/3604a77c93cf2927787b.js +0 -1
- package/assets/esri/core/workers/chunks/391b1c3e736a62befbaf.js +0 -1
- package/assets/esri/core/workers/chunks/40e556a0645af8658658.js +0 -1
- package/assets/esri/core/workers/chunks/4402336db7210cd583e0.js +0 -1
- package/assets/esri/core/workers/chunks/4899cdc8bb5085c356f9.js +0 -1
- package/assets/esri/core/workers/chunks/4bd5cbf6e0be2fc7e84d.js +0 -1
- package/assets/esri/core/workers/chunks/4c8052e81916579841f4.js +0 -1
- package/assets/esri/core/workers/chunks/4c9aa1dafdc0d9537231.js +0 -1
- package/assets/esri/core/workers/chunks/4feb774f123da26e9f2a.js +0 -1
- package/assets/esri/core/workers/chunks/51b5dfc7085272d26b89.js +0 -1
- package/assets/esri/core/workers/chunks/566c2ce50af225e556ac.js +0 -1
- package/assets/esri/core/workers/chunks/5ddf463c85c33428e807.js +0 -1
- package/assets/esri/core/workers/chunks/61032b5050464cb48056.js +0 -1
- package/assets/esri/core/workers/chunks/6394ab6f629aa90292e6.js +0 -2
- package/assets/esri/core/workers/chunks/63dade3e1cc7f5b76846.js +0 -1
- package/assets/esri/core/workers/chunks/64af433e88d4dd21a2ff.js +0 -1
- package/assets/esri/core/workers/chunks/6e12900a9f4c3c9941ec.js +0 -1
- package/assets/esri/core/workers/chunks/6e5d8a6b29c06a27998c.js +0 -1
- package/assets/esri/core/workers/chunks/6f506303017903b9a06f.js +0 -1
- package/assets/esri/core/workers/chunks/71e46e866c23372b0b58.js +0 -1
- package/assets/esri/core/workers/chunks/75fa861b5757551f8fdc.js +0 -1
- package/assets/esri/core/workers/chunks/7c49a8877bd744daa3d5.js +0 -1
- package/assets/esri/core/workers/chunks/7ea5bbb52e84be9a608e.js +0 -1
- package/assets/esri/core/workers/chunks/82c395d8649096609a8a.js +0 -1
- package/assets/esri/core/workers/chunks/86138c297095af1ac604.js +0 -1
- package/assets/esri/core/workers/chunks/8c21cc9af4ce9652cc5c.js +0 -1
- package/assets/esri/core/workers/chunks/8e6301006abdf47cc88d.js +0 -1
- package/assets/esri/core/workers/chunks/90f93091fe088875f80f.js +0 -1
- package/assets/esri/core/workers/chunks/91a02ee91f61cf841111.js +0 -1
- package/assets/esri/core/workers/chunks/9baeb3b5733acdda4e7c.js +0 -1
- package/assets/esri/core/workers/chunks/a1d697e2be1e892a666a.js +0 -1
- package/assets/esri/core/workers/chunks/a1f27c4f4b5ef3e359f7.js +0 -1
- package/assets/esri/core/workers/chunks/a348ff2dd936c6bf9399.js +0 -1
- package/assets/esri/core/workers/chunks/b64f708f821dd2bb51cd.js +0 -1
- package/assets/esri/core/workers/chunks/bf453744067267e84d1b.js +0 -1
- package/assets/esri/core/workers/chunks/c1175477dfcdee90a453.js +0 -1
- package/assets/esri/core/workers/chunks/c4e2b75b9135920babc3.js +0 -1
- package/assets/esri/core/workers/chunks/cb80b7ddc9acf625d754.js +0 -1
- package/assets/esri/core/workers/chunks/d22f91bc16a7641bcbef.js +0 -1
- package/assets/esri/core/workers/chunks/d52cf7b795ee52034f9e.js +0 -1
- package/assets/esri/core/workers/chunks/d971571a957de70d5a8d.js +0 -1
- package/assets/esri/core/workers/chunks/d9d9d4f99140e579eabb.js +0 -1
- package/assets/esri/core/workers/chunks/dc3a6beb3028009b3c23.js +0 -1
- package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js +0 -2
- package/assets/esri/core/workers/chunks/e483d2f169e51a361742.js +0 -1
- package/assets/esri/core/workers/chunks/e5608e5232e983531f72.js +0 -1
- package/assets/esri/core/workers/chunks/e613df03ceb39e29befa.js +0 -1
- package/assets/esri/core/workers/chunks/e697dd4508f02dcfe329.js +0 -1
- package/assets/esri/core/workers/chunks/eabfab23246d4a052ea3.js +0 -1
- package/assets/esri/core/workers/chunks/ec8e8048b3df2c92008d.js +0 -1
- package/assets/esri/core/workers/chunks/ed6d0fea159dea638c2f.js +0 -1
- package/assets/esri/core/workers/chunks/f5fcba6ca6f43bf1d65d.js +0 -1
- package/assets/esri/core/workers/chunks/f92d76b694ff0cdb212c.js +0 -1
- package/chunks/NetworkElement.js +0 -5
- package/views/FocusAreasUtils.js +0 -5
- package/views/analysis/DimensionAnalysisView.d.ts +0 -4
- package/views/analysis/DimensionAnalysisView.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";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 n}from"../../core/deprecate.js";import o from"../../core/Error.js";import c from"../../core/Evented.js";import{equalsShallow as l}from"../../core/lang.js";import u from"../../core/Logger.js";import{clamp as h,deg2rad as m}from"../../core/mathUtils.js";import{abortMaybe as p,destroyMaybe as d}from"../../core/maybe.js";import g from"../../core/Promise.js";import{isAbortError as y,throwIfAborted as f,waitTick as v}from"../../core/promiseUtils.js";import w from"../../core/ReactiveMap.js";import{whenOnce as b,on as F,watch as _,syncAndInitial as M,initial as P}from"../../core/reactiveUtils.js";import{sqlAnd as I}from"../../core/sql.js";import{getMetersPerUnitForSR as S}from"../../core/unitUtils.js";import{property as k}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as A}from"../../core/accessorSupport/decorators/subclass.js";import{distance as V}from"../../core/libs/gl-matrix-2/math/vec2.js";import{isSerializable as C}from"../../core/support/jsonUtils.js";import{UpdatingHandles as G}from"../../core/support/UpdatingHandles.js";import{union as R}from"../../geometry/geometryEngineAsync.js";import L from"../../geometry/Multipoint.js";import O from"../../geometry/Point.js";import T from"../../geometry/Polygon.js";import B from"../../geometry/Polyline.js";import{projectWithZConversion as x}from"../../geometry/projection.js";import j from"../../geometry/SpatialReference.js";import{isClockwise as E}from"../../geometry/support/coordsUtils.js";import{geographicToWebMercator as z}from"../../geometry/support/webMercatorUtils.js";import D from"../../layers/GraphicsLayer.js";import{searchImages as H}from"../../layers/orientedImagery/queries.js";import{calculateSuitabilities as N}from"../../layers/orientedImagery/core/bestImageUtils.js";import{createCoveragePolygon as U,computePolygonForInspection as W,resizePolygon as q,checkIfPolygonContainsSelectedPoint as $}from"../../layers/orientedImagery/core/coverageUtils.js";import{isConstantElevation as J,isElevationSource as Z}from"../../layers/orientedImagery/core/ElevationSourceDefinitions.js";import{imageToWorld as K,imageToWorldPanoramic as Q}from"../../layers/orientedImagery/transformations/imageToWorld.js";import X from"../../layers/orientedImagery/transformations/updateElevation.js";import{getElevationSampler as Y}from"../../layers/orientedImagery/transformations/updateElevationUtils.js";import{or as ee,getInitialAngle as te,convertPixelToHeadingPitch as ae,convertHeadingPitchToSphereVertex as ie,getImageToWorldProperties as re,getUpdateElevationProps as se,isElevationSampler as ne,getImageToWorldPanoramicProperties as oe,pointToArray as ce,transformGraphicCoordinatesToPixel as le,getWorldToImageProperties as ue}from"../../layers/orientedImagery/transformations/utils.js";import{worldToImage as he,worldToImagePanoramic as me}from"../../layers/orientedImagery/transformations/worldToImage.js";import{getFloorFilterClause as pe}from"../../layers/support/floorFilterUtils.js";import de from"../../symbols/SimpleLineSymbol.js";import ge from"../../views/draw/Draw.js";import{scale as ye}from"../../views/draw/support/drawUtils.js";import{ViewEventPriorities as fe}from"../../views/input/InputManager.js";import ve from"../PanoramicViewer.js";import{invalidCameraHeading as we,sectorsInOrder as be,sectorsRadii as Fe}from"./constants.js";import{configureSketchTool as _e,extractFieldsFromDataCaptureLayer as Me,isValidDataCaptureLayer as Pe,constructGraphicFromImageGeometry as Ie}from"./dataCaptureUtils.js";import{isFeatureAttachment as Se,getImageSourceFromAttachment as ke}from"./galleryUtils.js";import{formatPixels as Ae,heightMeasurementPanoramic as Ve,heightMeasurement2D as Ce,calculateHeightAccuracyPanoramic as Ge,calculateHeightAccuracy as Re,pixelAreaMeasurement2D as Le,pixelAreaMeasurementPanoramic as Oe,pixelDistanceMeasurement2D as Te,pixelDistanceMeasurementPanoramic as Be,generateCombinations as xe,getRootOfSumOfSquaredErrors as je,generateCombinationsPanoramic as Ee,calculateLocationAccuracyFromDeviations as ze,calculateReferenceImagePointPanoramic as De,calculateAnglePano as He,calculateTempImagePoint as Ne,calculateAngle as Ue,computeTriangulatedAreaMeasurement as We,computeTriangulatedDistanceMeasurement as qe,getModeCorrectedPoint as $e,calculateCorrectedPixel as Je,calculateHeightFromTemporaryDistance as Ze,computeTriangulatedVector as Ke,computeTriangulatedPoint as Qe}from"./imageMeasurementUtils.js";import{crossSymbol as Xe,crossSymbol3D as Ye,measurementPolygonSymbol as et,polylineSymbolPanoramic as tt,measurementPolylineSymbol as at,sourcePointSymbol as it,diamondSymbol as rt,diamondSymbol3D as st,locationSymbol as nt,locationSymbol3D as ot,activeSourcePointSymbol as ct}from"./symbols.js";import{isNoAttachmentError as lt,getContentType as ut,isTifOrMrf as ht,filterOILLayerView as mt,calculateDirection as pt,calculateSegment as dt,assignElevationSampleToFeatures as gt,isSceneView as yt,isGraphic as ft}from"./utils.js";import vt from"./components/ImageViewer.js";import wt from"./components/NavigationNode.js";import bt from"../Sketch/SketchViewModel.js";const Ft={click:"view-click",imageClick:"image-click",triangularImageClick:"triangular-click",interactionHandles:"interaction-handles"},_t=new Set(["JPG","JPEG"]),Mt=/\.(\w+)$/,Pt=()=>new o("orientedimageryviewer:sketch-not-initialized","Sketch property is not initialized, call loadSketch first"),It=5;let St=class extends(c.EventedMixin(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.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.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._loadImage(a)}catch(n){y(n)||(this.loadImageError(n),u.getLogger(this).error("#loadIImage()","error occured while loading image",n))}}},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 vt,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 w,this.pixelCoordinates=null,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)=>{"image-loaded"===this.state&&await(this._adapter?.updateFootprint(e,t))},this.updateFootprintPanorama=async(e,t)=>{await(this._adapter?.updateFootprintPanorama(e,t))},this.updatingTriangularMeasurementState=!1,this._adapter=null,this._highlightedFeatureHandle=null,this._imageViewer=new vt,this._initialCurrentCoverageUpdate=!0,this._locationPointOnImage=null,this._correctedLocationPointOnImage=null,this._overlays=new D({listMode:"hide",internal:!0,elevationInfo:{mode:"absolute-height"}}),this._panoramicViewer=new ve,this._previousCursor=null,this._referencePointOnGround=null,this._referencePointOnImage=null,this._sectorData=null,this._featureToSector=null,this._updatingHandles=new G,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.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 f(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.loadImageViewer=e=>{this._imageViewer.container=e},this.loadPanoramicViewer=e=>{this._panoramicViewer.container=e},this.afterNavigate=async(e,t,a)=>this.selectBestFeature(t.id,a).then((a=>(this._panoramicViewer.yaw=e.currentHeading-t.heading,this._panoramicViewer.pitch=e.currentPitch-t.pitch,a))),this.queryAndProcessNavigationNode=async(e,t,a)=>{const{layer:i,layerFloorFilterClause:r}=this;if(!i)return null;const{currentHeading:s,currentPitch:n}=e,{attributes:{farDistance:o},geometry:c}=t,{x:l,y:u,spatialReference:h}=c,p=h.isGeographic?1:S(h),d=o/(It*p),g=d*Math.sin(m(s))*Math.sin(m(n)),y=d*Math.sin(m(n))*Math.cos(m(s)),v=I("1=1",I(i.definitionExpression,r)),w=new O(l+g,u+y,h);this.selectedPoint=w;const b=await H({layerInstanceOrURL:i,point:w,queryParams:{where:v,maximumDistance:i.maximumDistance?i.maximumDistance/p:void 0}},a);return f(a),await this._processFeatureResponse(b,w,{loadBestImage:!1,signal:a?.signal}),f(a),this.afterNavigate(e,t)},this.navigate=async(e,t)=>{const{currentNode:a}=this;if(!a)return null;const i=this.currentNode?.[e];if(!i)return null;const r=this._suitabilities.find((e=>e.feature.attributes.objectId===i.id)),s=this._featureToSector[`${i.id}`],[n,o]=s.split("_"),c=`NEAR_${o}`,l=`FAR_${o}`,u=this._activeSectors?.includes(c),h=this._activeSectors?.includes(l);return r&&(o===s&&!u&&!h||s===c&&!h||s===l)?this.queryAndProcessNavigationNode(a,i,t):this.afterNavigate(a,i,t)},this.removeHighlight=()=>this._highlightedFeatureHandle?.remove(),this.revealImageGeometry=e=>{},this.selectBestFeature=async(e,t)=>(f(t),this.currentBestFeature=this.features?.find((({attributes:t})=>`${t.objectId}`==`${e}`)),b((()=>"image-loaded"===this.state),t)),this.toggleImageAttributes=()=>{p(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:n,geometry:o}=a,c=new t({geometry:o,attributes:n.toJSON(),layer:r});f(e),await s.openPopup({features:[c],location:n.location.clone()})}))},this._createViewClickHandle=()=>{if(this.removeHandles(Ft.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,fe.WIDGET),Ft.click)},this._createImageClickHandle=()=>{this.removeHandles(Ft.imageClick);const{mapImageConversionToolState:e,mode:t,activeViewer:a,currentBestFeature:i,footprintExtent:s}=this,n=a?.imageSize;if(!(e&&"none"!==t&&n&&s&&i))return;a.clickAction="pixel-location";let o=null;const c=F((()=>a),"pixel-location",(e=>{this.plotReferencePointOnImage(e),o?.abort(),o=r((async a=>{if(!e)return;const r=await this.getMapPoint(e,{feature:i,imageSize:n,mode:t}).then((e=>{const t=this.view?.spatialReference;return ee(!t,e.spatialReference.equals(t))?e:x(e,t)}));f(a),this.plotReferencePointOnGround(r)}))}));this.addHandles(c,Ft.imageClick)},this._createTriangularImageClickHandle=()=>{this.removeHandles(Ft.triangularImageClick);const e=this.imageMeasurementViewer?.imageSize;this.triangularMeasurementActive&&"none"!==this.mode&&e&&this.currentBestFeature&&this.addHandles(this.imageMeasurementViewer.imageRenderer.on("double-click",this._measurementImageClickHandler),Ft.triangularImageClick)},this._createTriangularImageLocationHandle=()=>{this.removeHandles(Ft.triangularImageClick);const{imageLocationToolState:e,mode:t,imageMeasurementViewer:a}=this,i=a?.imageSize;if(!e||"none"===t||!i)return;a.clickAction="pixel-location";let s=null;const n=F((()=>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});f(a);const s=this.currentBestFeatureMeasurementImage.geometry.spatialReference;s&&!r.spatialReference.equals(s)&&(r=await x(r,s),f(a)),await this._calculateTriangulatedPointFromGroundPoint(r,{signal:a}),f(a)})))}));this.addHandles(n,Ft.triangularImageClick)},this._createImageLocationHandle=()=>{this.removeHandles(Ft.imageClick);const{imageLocationToolState:e,mode:t,activeViewer:a,currentBestFeature:i,footprintExtent:s}=this,n=a?.imageSize;if(!(e&&"none"!==t&&n&&s&&i))return;a.clickAction="pixel-location";let o=null;const c=F((()=>a),"pixel-location",(e=>{this.pixelCoordinates=e,this.plotLocationPointOnImage(e),o?.abort(),o=r((async a=>{if(!e)return;let r=await this.getMapPoint(e,{feature:i,imageSize:n,mode:t});f(a);const s=this.view?.spatialReference;s&&!r.spatialReference.equals(s)&&(r=await x(r,s),f(a)),this.groundCoordinates=r,this.triangularMeasurementActive&&r&&this._triangulatedLocationWorkflow(r);const o=await this.calculateLocationAccuracy(e,r,t,a);f(a),o&&(this.groundCoordinatesAccuracy=o)}))}));this.addHandles(c,Ft.imageClick)},this._loadImage=async e=>{const{currentBestFeature:t,layer:a,mode:i}=this;if(this.clearGraphics(),!a||!t||"none"===i)return;const{attributes:r}=t,{imagePath:s,imageRotation:n,cameraHeading:o,cameraRoll:c,cameraPitch:l,objectId:h,cameraOrientation:m,location:p}=r,d=(c??0)+(n??0),g=p.spatialReference.isWGS84&&4!==m?.type?z(p):new O(p);let v=s;if(Se(s))try{v=await ke(a,h,e)}catch(w){if(y(w))return;return lt(w)?(u.getLogger(this).error(w),void this.setMessage("noAttachment","error",`${a.objectIdField}: ${h}`)):(u.getLogger(this).error(w,{[a.objectIdField]:h,layer:a}),void this.setMessage("imageLoadError","error",`query-attachments-failed:${a.objectIdField} ${h}`))}try{await this.loadImageFromSource(v,{imageRotation:d,options:e,pitch:l,yaw:o,mode:i,cameraLocation:g}),f(e),await this.transformAndPlotSelectedLocation(e)}catch(w){y(w)||this.loadImageError(w)}},this._loadImageFromSourceInternal=async(e,t)=>{const{mode:a,imageRotation:i,options:r}=t,s="string"==typeof e,n=s?e:e.url,{pathname:o,searchParams:c}=new URL(n);let l=s?o.match(Mt)?.[1]:e.datasetFormat;if(!l)try{l=await ut(n,{...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,n,c,i,r):await this._setImageSource(this._imageViewer,l,n,c,i,r);break;case"panoramic":if(_t.has(l.toUpperCase())){const{selectedPoint:e}=this,{pitch:a,yaw:i,cameraLocation:s,viewAngle:o}=t;this._panoramicViewer.imageSource=n;let c=i??0;"number"==typeof o?c=o-c:s&&e&&(c=await te(s,e)-c),this._panoramicViewer.pitch=a??0,this._panoramicViewer.yaw=c,await this._panoramicViewer.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(),!a||!t||"none"===i)return;const{attributes:r}=t,{imagePath:s,imageRotation:n,cameraHeading:o,cameraRoll:c,cameraPitch:l,objectId:h,cameraOrientation:m,location:p}=r,d=(c??0)+(n??0),g=p.spatialReference.isWGS84&&4!==m?.type?z(p):new O(p);let v=s;if(Se(s))try{v=await ke(a,h,e)}catch(w){if(y(w))return;return lt(w)?(u.getLogger(this).error(w),void this.setMessage("noAttachment","error",`${a.objectIdField}: ${h}`)):(u.getLogger(this).error(w,{[a.objectIdField]:h,layer:a}),void this.setMessage("imageLoadError","error",`query-attachments-failed:${a.objectIdField} ${h}`))}try{await this.loadImageFromSource(v,{imageRotation:d,options:e,pitch:l,yaw:o,mode:i,cameraLocation:g}),f(e)}catch(w){y(w)||this.loadImageError(w)}},this._loadViewAdapter=async e=>{const{view:t}=this;if(t)switch(t.type){case"2d":{const{default:t}=await import("./adapters/view/MapViewAdapter.js");f(e),this._adapter=new t(this);break}case"3d":{const{default:t}=await import("./adapters/view/SceneViewAdapter.js");f(e),this._adapter=new t(this);break}}else this._adapter=null},this._mapImageConversionToolViewClickHandler=e=>{e.stopPropagation(),e.preventDefault(),e.mapPoint&&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 v(a),!e)return;const i=new O({...C(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:Xe}),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:n}=ae(e,i,r),o=ie(s,n);this._crossSymbol=new t({geometry:new O(o,j.WebMercator),symbol:Ye}),this._panoramicViewer.addGraphic(this._crossSymbol,0)}},this.handleSectorClick=this.handleSectorClick.bind(this),this.searchBestImage=this.searchBestImage.bind(this),this.transformAndPlotReferencePointOnImage=this.transformAndPlotReferencePointOnImage.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this)}initialize(){this.addHandles([_((()=>this.view),(()=>{this.load()}),M),_((()=>this.view?.map),((e,t)=>{t?.layers.remove(this._overlays),e?.layers.add(this._overlays)}),P),_((()=>this.view?.map?.allLayers?.length),(e=>{e&&this.view?.map?.layers.reorder(this._overlays,e-1)}),P),_((()=>[this.state,this.mapImageConversionToolState,this.view]),(()=>{this._createViewClickHandle(),this._createImageClickHandle()}),M),_((()=>[this.triangularMeasurementActive,this.currentBestFeatureMeasurementImage]),(()=>{this._createTriangularImageClickHandle()}),M),_((()=>[this.state,this.imageLocationToolState,this.view]),((e,t)=>{if(this._createImageLocationHandle(),!this.imageLocationToolState)return this.clearPreviousGroundLocation(),void this._resetCursor();e[1]!==t?.[1]&&this._setMeasurementCursor()}),M),_((()=>this.measureType),(()=>{this.clearPreviousMeasurements()}),M),_((()=>this.bestFeatureAngle),((e,t)=>{this.previousFeatureAngle=t??0}),M),_((()=>this.currentBestFeature),(async(e,t)=>{p(this._featureChangedTask),this._featureChangedTask=r((async a=>this.determineWorkflowForFeature.apply(this,[e,t,{signal:a}]))),await this._featureChangedTask.promise}),{sync:!0}),_((()=>this.currentBestFeatureMeasurementImage),(async(e,t)=>{p(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}),f(a),this._reorderTriangularSketchLayer()}))}),M),_((()=>this.triangularMeasurementActive),(async(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.mode),(e=>{switch(this.removeHandles(Ft.interactionHandles),e){case"default":this.addHandles(_((()=>{const{state:e}=this;return"image-loaded"===e?this._imageViewer.imagePointsInView:null}),(e=>{e&&(p(this._updateFootprintTask),this._updateFootprintTask=r((async t=>{await this.updateFootprint(e,{signal:t})})))}),{...M,equals:(e,t)=>a(e,t,l)}),Ft.interactionHandles);break;case"panoramic":this.addHandles(_((()=>{const{currentBestFeature:e,state:t}=this,{imageSize:a,vfov:i,hfov:r,pitch:s,yaw:n}=this._panoramicViewer;return e&&a&&!t.includes("loading")?[i,r,n,s]: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)),p(this._updateFootprintTask),this._updateFootprintTask=r((async e=>{await this.updateFootprintPanorama({verticalFieldOfView:t,horizontalFieldOfView:a,yaw:i,pitch:s},{signal:e})}))}),{...M,equals:(e,t)=>a(e,t,l)}),Ft.interactionHandles)}}),M),_((()=>[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),_((()=>this.activeViewer?.imageRenderer),(()=>{this.sketch&&(this.sketch.view=this.activeViewer?.imageRenderer)})),F((()=>this.features),"change",(()=>{this.navigationNodes.removeAll(),this.features.forEach((e=>{const t=new wt({geometry:e.geometry,attributes:e.attributes});this.navigationNodes.add(t)}))}))]),this.when().finally((()=>{this.notifyChange("state")}))}destroy(){this._updateFootprintTask=p(this._updateFootprintTask),this._clickTask=p(this._clickTask),this.coverageFrustums.destroy(),this.coveragePolygons.destroy(),this.pointSources.destroy(),this.additionalFootprints.destroy(),this.additionalCameraLocations.destroy(),this.bestFeatureFootprint=d(this.bestFeatureFootprint),this.bestFeatureCurrentFootprint=d(this.bestFeatureCurrentFootprint),this._crossSymbol=d(this._crossSymbol),this._referencePointOnGround=d(this._referencePointOnGround),this._referencePointOnImage=d(this._referencePointOnImage),this._locationPointOnImage=d(this._locationPointOnImage),this._overlays&&this.view?.map?.remove(this._overlays),this._overlays.destroy(),this._imageViewer.destroy(),this.imageMeasurementViewer.destroy(),this._panoramicViewer.destroy()}get activeLayer(){return n(u.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){n(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 accuracyParametersMissing(){return this.layer?.orientationAccuracy?.every((e=>0===e))??!0}get brightness(){return this._get("brightness")??0}set brightness(e){this._set("brightness",h(e,-10,10))}get contrast(){return this._get("contrast")??0}set contrast(e){this._set("contrast",h(e,-10,10))}get currentNode(){const{currentBestFeature:e,navigationNodes:t}=this;return t?.find((t=>t.id===e?.attributes.objectId))}get featureCount(){return this.features?.length??0}get imageGalleryEnabled(){const{currentBestFeature:e}=this;if(!e)return!1;const t=e.attributes.imagePath?.trim();return ht(t)||Se(t)}get imageLoaded(){return n(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===we}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(mt(e))}get layerFloorFilterClause(){const{layerView:e}=this;return e?pe(e):null}get mode(){const e=this.currentBestFeature?.attributes;if(!e)return"none";const{horizontalFieldOfView:t,isSpherical:a}=e;return 360===t||a?"panoramic":"default"}get popupEnabled(){return!0===this.layer?.popupEnabled}get referencePoint(){return this._referencePointOnGround?.geometry}get sectorData(){const{_sectorData:e}=this;return e?be.map((t=>e[t])):null}get sharpness(){return this._get("sharpness")??0}set sharpness(e){this._set("sharpness",h(e,0,1))}get sketchGraphicsLayer(){return this.sketch?.layer}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}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 ht(r)||Se(r)?{url:r,objectId:t,rotation:(a??0)+(i??0)}:null})).filter(i)):null}set view(e){this._set("view",e)}get _sketchGraphicsLayer(){const{mode:e}=this;switch(e){case"panoramic":return new D({elevationInfo:{mode:"absolute-height"}});case"default":return new D;case"none":return}}get _overlaysView(){return this.view?.layerViews.find((({layer:e})=>e===this._overlays))}get _activeSectors(){return be.filter((e=>this._sectorData?.[e]?.length))}async computeHeight(e,t,a=!0){const{currentBestFeature:i,activeViewer:r,layer:s,footprintExtent:n}=this,o=r?.imageSize,c=i?.attributes,l=s?.orientationAccuracy;if(!c||!o||!e||e.length<2||!l)return;const u="panoramic"===t?await this.getMeasurementPropertiesPanoramic():re(c,o[0],o[1]),h=e.at(0),m=e.at(-1);if(!(u&&h&&m&&l&&n))return;const p=[m,h],d=Ae(p,!1),g="panoramic"===t?await Ve(p,u,l,i,!0,!1):await Ce(p,u,l,!0,a);if(!g)return;const y="panoramic"===t?await Ge(l,d,u,g,i,!0):await Re(l,d,u,g,!0);return y?{value:g,accuracy:y}:{value:g}}async calculateAreaMeasurement(e,t,a){if(e.length<3||!this.currentBestFeature||!this.activeViewer?.imageSize||"none"===t)return null;const i="default"===t?await this.getMeasurementProperties():await this.getMeasurementPropertiesPanoramic();return f(a),i?"default"===t?await Le(e,i,!0):await Oe(e,i,!0,a):null}async calculateDistanceMeasurement(e,t,a){const{currentBestFeature:i,activeViewer:r}=this;if(e.length<2||!i||!r?.imageSize||"none"===t)return null;const s="default"===t?await this.getMeasurementProperties():await this.getMeasurementPropertiesPanoramic();return f(a),s?"default"===t?await Te([e.at(0),e.at(-1)],s,!0):await Be([e.at(0),e.at(-1)],s,!0):null}async calculateAccuracy(e,t,a){const{layer:i,currentBestFeature:r,activeViewer:s}=this,n=i?.orientationAccuracy,o=n?.every((e=>0===e))||!n?.length;if("area"===t&&e.length<3||"distance"===t&&e.length<2||!r||!s?.imageSize||o)return null;let c=null;if(this.triangularMeasurementActive&&this.currentBestFeatureMeasurementImage&&this.imageMeasurementViewer?c=await this.getMeasurementProperties(this.currentBestFeatureMeasurementImage,this.imageMeasurementViewer):(c=await this.getMeasurementProperties(),f(a)),!c)return null;const l="area"===t?await Le(e,c,!0):await Te([e.at(0),e.at(-1)],c,!0);f(a);const{updateElevationProps:u,...h}=c,m=xe(h,n);if(!m?.length)return null;const p=m.map((e=>({...e,updateElevationProps:u}))).map((async i=>{const r="area"===t?await Le(e,i,!0):await Te([e.at(0),e.at(-1)],i,!0);if(f(a),r&&l){if("area"===t){const e="number"!=typeof r?r.area:null;return e?Math.abs(e-l.area):null}return Math.abs(r-l)}return null})),d=await Promise.all(p);f(a);const g=d.filter((e=>null!==e));return 0===g.length?null:je(g)}async calculateLocationAccuracy(e,t,a="default",i){const{layer:r,currentBestFeature:s}=this,n=r?.orientationAccuracy,o=this.view?.spatialReference,c=n?.every((e=>0===e))||!n?.length;if(!s||c)return null;const l="default"===a?await this.getMeasurementProperties():await this.getMeasurementPropertiesPanoramic();if(f(i),!l)return null;const{updateElevationProps:u,...h}=l,m="default"===a?xe(h,n):Ee(h,n);if(!m?.length)return null;const p=m.map((e=>({...e,updateElevationProps:u}))).map((async r=>{const{updateElevationProps:s,...n}=r;let c="default"===a?await K(e,n,s):await Q(e,n,s);return f(i),o&&!c.spatialReference.equals(o)&&(c=await x(c,o),f(i)),c&&t?[Math.abs(c.x-t.x),Math.abs(c.y-t.y),c.z&&t.z?Math.abs(c.z-t.z):0]:null})),d=await Promise.all(p);if(f(i),!d?.length)return null;const g=d.map((e=>[e?.[0]??0,e?.[1]??0,e?.[2]??0])),[y,v,w]=ze(g);return{x:y,y:v,z:w}}async calculateAccuracyPanoramic(e,t,a){const{layer:i,currentBestFeature:r,activeViewer:s,mode:n}=this,o=i?.orientationAccuracy,c=o?.every((e=>0===e))||!o?.length;if("area"===t&&e.length<3||"distance"===t&&e.length<2||!r||!s?.imageSize||c||"panoramic"!==n)return null;const l=await this.getMeasurementPropertiesPanoramic();if(f(a),!l)return null;const u="area"===t?await Oe(e,l,!0):await Be([e.at(0),e.at(-1)],l,!0);f(a);const{updateElevationProps:h,...m}=l,p=Ee(m,o);if(!p?.length)return null;const d=p.map((e=>({...e,updateElevationProps:h}))).map((async i=>{const r="area"===t?await Oe(e,i,!0):await Be([e.at(0),e.at(-1)],i,!0);if(f(a),r&&u){if("area"===t){const e="number"!=typeof r?r.area:null;return e?Math.abs(e-u.area):null}return Math.abs(r-u)}return null})),g=await Promise.all(d);f(a);const y=g.filter((e=>null!==e));return 0===y.length?null:je(y)}async calculateHeightMeasurementInfo(e,t,a){const{currentBestFeature:i,activeViewer:r}=this,s=r?.imageSize;if(!i||!r||!s?.length||"none"===t)return;const{attributes:n}=i,[o]=Ae([e],"panoramic"!==t),c="panoramic"===t?await this.getMeasurementPropertiesPanoramic():re(n,s[0],s[1]);if("panoramic"===t){if(!c)return;const e=await De(o,c,i,a);if(!e)return;e?.heading>180&&(e.heading-=360);const t=He(o,e),r=V([o.x,o.y],[e.x,e.y]);if(!t||!r)return;return{measurementAngle:t,tempDistance:r}}const l=await Ne(o,c,a);if(!l)return;const u=Ue(o,l),h=V([o.x,o.y],[l.x,l.y]);return u&&h?{measurementAngle:u,tempDistance:h}:void 0}async calculateTriangulatedMeasurements(e){switch(this.measureType){case"distance":{this.triangulatedDistanceMeasurement=await qe(this.measurementVectors);const t=await this.calculateAccuracy(e,"distance");if(t&&this.triangulatedDistanceMeasurement?.distance){const e=Math.atan(t/this.triangulatedDistanceMeasurement.distance);this.triangulatedDistanceAccuracy={distanceAccuracy:t,angleAccuracy:e}}break}case"area":if(this.currentBestFeatureMeasurementImage?.geometry.spatialReference){const t=await We(this.measurementVectors,this.currentBestFeatureMeasurementImage.geometry.spatialReference);this.triangulatedAreaMeasurement=t,this.triangulatedAreaAccuracy=await this.calculateAccuracy(e,"area")??this.triangulatedAreaAccuracy}}}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();_e(i,e,a),await a.create(e,{...t,defaultZ:0})}async 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 n=await this.computeHeight(a,i);n?.value&&n?.accuracy&&(this.heightMeasurementResult=n.value,this.heightMeasurementAccuracy=n.accuracy)}filterByFootprints(e,t){const a=[],i=[],r=[];return e.forEach((e=>{const{layer:{coveragePercent:s},attributes:n}=e;let o;const c=S(e.geometry.spatialReference);n.cameraHeight/=c,n.farDistance/=c,n.nearDistance/=c,J(n.elevationSource)&&(n.elevationSource.constantElevation/=c);const{polygon:l,frustum:u}=U(n);if(o=l.clone(),n.isInspection&&(o=W(n)),s&&(o=q(o,s)),!t||$(o,t)){r.push(e);const{geometry:t,objectId:s,cameraHeight:o,cameraHeading:c}=n,h=t.clone();h.z=o,h.imageID=s,this.pointSources.push(h),c!==we&&(a.push(l),u&&i.push(u))}})),{features:r,polygons:a,frustums:i}}getMeasurementProperties(e=this.currentBestFeature,t=this.activeViewer){if(!e||!t?.imageSize)return;const{elevationSample:a,attributes:i}=e,{elevationSource:r,cameraHeight:s}=i,n=re(i,t.imageSize[0],t.imageSize[1]);let o=n.cameraLocation;return(o.spatialReference.isGeographic?x(o,j.WebMercator):Promise.resolve(o)).then((e=>(o=e,se((o.z??0)-s,{elevationSample:a,elevationSource:r,extent:this.footprintExtent})))).then((t=>("elevationSample"in t&&ne(t.elevationSample)&&(e.elevationSample=t.elevationSample),{...n,cameraLocation:o,updateElevationProps:t})))}getMeasurementPropertiesPanoramic(){const{currentBestFeature:e,activeViewer:t}=this;if(!e||!t?.imageSize)return;const{elevationSample:a,attributes:i}=e,{elevationSource:r,cameraHeight:s}=i,n=oe(i,t.imageSize[0],t.imageSize[1]);let o=n.cameraLocation;return(o.spatialReference.isGeographic?x(o,j.WebMercator):Promise.resolve(o)).then((e=>(o=e,se((o.z??0)-s,{elevationSample:a,elevationSource:r,extent:this.footprintExtent})))).then((t=>("elevationSample"in t&&ne(t.elevationSample)&&(e.elevationSample=t.elevationSample),{...n,cameraLocation:o,updateElevationProps:t})))}async deleteDataCaptureFeatures(e){const{dataCaptureLayer:t}=this;if(!t)throw new o("orientedimagery","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?.[be[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}=this,n=s?.imageSize;if(!e.vertices||!n)return;const o=$e(e.vertices.at(-1),r,n);if(i.length<1||!o||!a||!t||"none"===r)return;const c=Je(i[0],o,t);if(!c?.length)return;this.heightMeasurementPixels.push(c),"panoramic"===r?this.createPolylineGraphicPano():this.createPolylineGraphic();const l=Ze(this.heightMeasurementPixels,a);l&&(this.heightMeasurementResult=l)}async handleDrawVertexAddEvents(e,t){const{currentBestFeature:a,activeViewer:i,heightMeasurementPixels:r,mode:s}=this;if(!a||!i||!e.vertices?.length||"none"===s)return;const n=i?.imageSize;if(!r.length&&n){const a=$e(e.vertices.at(-1),s,n);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}}async load(e){return this.addResolvingPromise(this._loadViewAdapter(e).catch((e=>{if(!y(e))throw e}))),this}async loadBestImage(e,t){return this.view?.closePopup(),this.displayMessage=null,this.clearPreviousGroundLocation(),this.triangularMeasurementActive=!1,this.currentBestFeatureMeasurementImage=null,this.measureType=null,this.imageLocationToolState=!1,this.selectedPoint=e.spatialReference.isGeographic?z(e):e.clone(),this.features.removeAll(),this.currentBestFeature=null,this.additionalFeatures.removeAll(),this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint=d(this.bestFeatureCurrentFootprint),this._overlays?.removeAll(),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;f(e),this.sketch=new a({layer:this._sketchGraphicsLayer,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(f(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(f(e),this.triangulatedMeasurementAdapter=new a({viewModel:this}),!this.triangulatedMeasurementAdapter.viewModel.isResolved())return}return this.triangulatedMeasurementAdapter}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 n=this.activeViewer?.imageRenderer.effectiveTheme.accentColor;n&&this.sketch&&(this.sketch.polygonSymbol=et(n),this.sketch.polylineSymbol="panoramic"===s?tt:at(n,2.5))}startHeightMeasurement(){this.heightMeasurementPixels=[],this.displayNewMeasurementButton=!1,this.draw??=new ge({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 B({paths:[e],spatialReference:a});else{const i=new B({paths:[e],spatialReference:a}),r=this.activeViewer?.imageRenderer.effectiveTheme.accentColor;this.heightGraphic=new t({geometry:i,symbol:at(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:n}=ae(i,a[0],a[1]),{heading:o,pitch:c}=ae(r,a[0],a[1]),l=[[...ie(s,n)],[...ie(o,c)]];if(this.heightGraphic)this.heightGraphic.geometry=new B({paths:[l],spatialReference:e});else{const a=new B({paths:[l],spatialReference:e});this.heightGraphic=new t({geometry:a,symbol:tt}),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]])),n=this.view?.spatialReference,o=[];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});n&&!a.spatialReference.equals(n)&&(a=await x(a,n)),o.push(a)}return Ke(o,t)}async handleDrawEvents(e,t){if(this.draw)switch(e.type){case"cursor-update":this.handleDrawCursorUpdateEvents(e);break;case"vertex-add":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:n,state:o}=this,c=a?.imageSize;if(!c||!i||!s||"none"===n||o.includes("loading"))return;const{polygon:l}=U(i.attributes);if(a.removeManyGraphics(r.toArray()),r.removeAll(),e){const{features:e}=await s.queryFeatures({where:`${s.objectIdField} <> ${i.attributes.objectId}`,geometry:l,returnGeometry:!0,outFields:[s.objectIdField]}),o=await Promise.all(e.map((async e=>{const{attributes:a,geometry:r}=e,s=await this.getPixels(r,{feature:i,imageSize:c,mode:n}),o=it.clone();return o.outline=new de({color:[0,0,0],width:1}),new t({attributes:a,symbol:o,geometry:s})})));r.addMany(o),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:n,mode:o,state:c,layer:l}=this,h=r?.imageSize;if(!h||!n||"none"===o||c.includes("loading")||!l)return;const{polygon:m}=U(n.attributes);try{const{imageGeometryField:t,oiObjectIdField:a}=Me(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:p}=await e.queryFeatures({geometry:m,returnGeometry:!0,outFields:["*"]}),d=new s((await Promise.all(p.map((async i=>{const r=i.symbol?.clone()??e.renderer?.getSymbol(i)?.clone(),{attributes:s,geometry:c}=i,l=c,{imageGeometryField:m,oiObjectIdField:p}=this;if(m&&p&&Pe(e,m,p)&&`${s[p]}`==`${n.attributes.objectId}`)try{return Ie(s,m,e,a,h,o,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:n,imageSize:h,mode:o});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 O({x:e,y:t,z:a,spatialReference:c}))))),m=await Promise.all(u.map((async e=>this.getPixels(e,{feature:n,imageSize:h,mode:o}).then((e=>e.map(ce))))));return new t({attributes:s,layer:e,symbol:r,geometry:new T({rings:m,spatialReference:j.WebMercator}),visible:e.visible&&a})}case"polyline":{const{paths:i,spatialReference:c}=l,u=i.map((e=>e.map((([e,t,a])=>new O({x:e,y:t,z:a,spatialReference:c}))))),m=await Promise.all(u.map((async e=>this.getPixels(e,{feature:n,imageSize:h,mode:o}).then((e=>e.map(ce))))));return new t({attributes:s,layer:e,symbol:r,geometry:new B({paths:m,spatialReference:j.WebMercator}),visible:e.visible&&a})}case"multipoint":{const{points:i,spatialReference:c}=l,u=i.map((([e,t,a])=>new O({x:e,y:t,z:a,spatialReference:c}))),m=await this.getPixels(u,{feature:n,imageSize:h,mode:o}).then((e=>e.map(ce)));return new t({attributes:s,layer:e,symbol:r,geometry:new L({points:m,spatialReference:j.WebMercator}),visible:e.visible&&a})}}return null})))).filter(i));this.overlayGraphicsOnImage(`${e.id}`,d)}async getPixels(e,t){const{imageSize:a,mode:i}=t,r=(await this.worldToImage(Array.isArray(e)?e:[e])).map((e=>{if("default"===i)return new O({x:e.x-.5,y:.5-e.y,spatialReference:j.WebMercator});const[t,r]=a,{heading:s,pitch:n}=ae(e,t,r),o=ie(s,n);return new O(o,j.WebMercator)}));return Array.isArray(e)?r:r[0]}async getMapPoint(e,t){const{feature:a,mode:i,imageSize:r}=t,{elevationSample:s,attributes:n}=a,{elevationSource:o,location:c,elevation:l,cameraHeight:u}=n;let h=c.clone();h.spatialReference.isGeographic&&(h=await x(h,j.WebMercator));const m=await se(l??(c.z??0)-u,{elevationSample:s,elevationSource:o,extent:this.footprintExtent});let p;if("elevationSample"in m&&ne(m.elevationSample)&&(a.elevationSample=m.elevationSample),"default"===i){const t=re(n,r[0],r[1]);p=await K(Array.isArray(e)?e:[e],{...t,cameraLocation:h},m)}else{const t=oe(n,r[0],r[1]);p=await Q(Array.isArray(e)?e:[e],{...t,cameraLocation:h},m)}return Array.isArray(e)?p:p[0]}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 O({...e.toJSON()}),symbol:rt}),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=C(e)?e.toJSON():e;a.x-=.5,a.y=.5-a.y,this._referencePointOnImage=new t({geometry:new O({spatialReference:this._imageViewer.imageRenderer.spatialReference,...a}),symbol:rt}),this._imageViewer.addGraphic(this._referencePointOnImage,0);break}case"panoramic":{const{imageSize:a}=this._panoramicViewer;if(!a)return;const[i,r]=a,{heading:s,pitch:n}=ae(e,i,r),o=ie(s,n);this._referencePointOnImage=new t({geometry:new O(o,j.WebMercator),symbol:st}),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)}}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))}resetImage(){switch(this.setMessage("onLoadMessage","info"),this.mode){case"default":this._imageViewer.clearImage(),this._imageViewer.clearGraphics();break;case"panoramic":this._panoramicViewer.clearGraphics()}this._clickTask=p(this._clickTask)}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:n}=await this.saveDataCaptureFeatures(s),o=n.reduce(((t,{objectId:a,globalId:i,error:r},n)=>{const o=s[n],{attributes:c}=o;return r?t.error.push(o):(a&&(c[e.objectIdField]=a),i&&e.globalIdField&&(c[e.globalIdField]=i),t.success.push(o)),t}),{success:[],error:[]});i.addMany(o.success),r.removeAll(),r.addMany(o.error)}async saveDataCaptureFeatures(e){const{activeViewer:t,currentBestFeature:a,dataCaptureLayer:r,mode:s}=this,n=t?.imageSize;if(!n||!a||"none"===s)throw new o("orientedimagery","Image size, current best feature and mode are required to save data capture features");if(!r)throw new o("orientedimagery","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 o=i.type,c=r.hasZ,l=r.geometryType,u=o!==l,h=u?await import("./transformers.js"):null,m=h?.default[l],p=u?m?.(i):i;if(p)switch(p.type){case"point":return t.geometry=await this.getMapPoint(le(s,p,n),{feature:a,imageSize:n,mode:s}),c||(delete t.geometry.z,t.geometry.hasZ=!1),t.geometry.hasM=!1,t;case"polygon":{const e=await Promise.all(p.rings.map((async e=>this.getMapPoint(e.map((([e,t,a])=>le(s,{x:e,y:t,z:a},n))),{feature:a,imageSize:n,mode:s}))));return t.geometry=new T({spatialReference:e[0][0].spatialReference,hasZ:c,hasM:!1,rings:e.map((e=>e.map(ce)))}),t}case"polyline":{const e=await Promise.all(p.paths.map((async e=>this.getMapPoint(e.map((([e,t,a])=>le(s,{x:e,y:t,z:a},n))),{feature:a,imageSize:n,mode:s}))));return t.geometry=new B({spatialReference:e[0][0].spatialReference,hasZ:c,hasM:!1,paths:e.map((e=>e.map(ce)))}),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 o("orientedimagery","Error in saving data capture features"),objectId:null,globalId:null}}));return{...e,addFeatureResults:i}}))}async searchBestImage(e,t){try{const a=await H(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}async startDataCapture(e,t){const a=this.activeViewer?.imageRenderer,{oiObjectIdField:i,currentBestFeature:r}=this;if(!a||!r||!i)return;const{attributes:{objectId:n}}=r,o=this.overlayedMapFeatures.get(e.id)?.toArray()??[],c=[],l=[];for(const s of o)`${s.getAttribute(i)}`==`${n}`?c.push(s):l.push(s);this.overlayGraphicsOnImage(e.id,new s(l)),this.collectionId=e.id;const u=await this.loadSketch(t),h=await this.loadDataCaptureAdapter(t);f(t),u.layer.addMany(c),u.layer.blendMode="source-atop",h.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=d(this.sketchAdapter),this.sketch=d(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){const a=this.overlayedMapFeatures.get(e);a&&this._toggleVisiblity(a,t)}toggleSelection(e){const{sketch:t}=this;t&&(t.updateOnGraphicClick=e,t.cancel())}async transformAndPlotReferencePointOnImage(e){const{selectedLocation:t,options:a}=e;let i=!1,r=!1;const s=this.bestFeatureFootprint?.geometry;switch(s?.type){case"polygon":{const e=t.spatialReference.equals(s.spatialReference)?t:await x(t,s.spatialReference);i=s.contains(e);break}case"mesh":{const e=t.spatialReference.equals(s.spatialReference)?t:await x(t,s.spatialReference);r=s.extent.contains(e);break}}if(!i&&!r)return void this.clearReferencePointOnImage();const n=await this.worldToImage(t,a);if(n)return f(a),this.plotReferencePointOnImage(n),{x:n.x,y:n.y};this.clearReferencePointOnImage()}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()}async _calculateTriangulatedPointFromGroundPoint(e,t){if(this.currentBestFeatureMeasurementImage&&e){const{currentBestFeatureMeasurementImage:a}=this,i=Ke(e,a);i&&this.measurementVectors.push(i);const r=await Qe(this.measurementVectors);f(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,currentBestFeature:a,features:i,invalidCameraHeading:r}=this;if(!e||!t||!a||!i||r)return void(this._sectorData=null);this._sectorData={};const n={};this._featureToSector=n;for(const h of be)this._sectorData[h]=new s;const o=e.map(((e,t)=>({...e,featureIndex:t})));o.sort(((e,t)=>e.trueSuitability-t.trueSuitability));const c=o.map((({distance:e})=>e)),l=Math.max(...c),u=i.reduce(((e,t)=>Math.max(e,t.attributes.location.z??0)),-1/0);o.forEach((e=>{const{distance:t,angle:a,featureIndex:r}=e,s=t/l*Fe[2],o=dt(t,l),c=pt(a);if(!this._sectorData)return;const h=Fe[3]+s*Math.sin(a*Math.PI/180),m=Fe[3]+s*Math.cos(a*Math.PI/180);let p;const d=i.at(r),g=(d.attributes.location.z??0)/u*Fe[2],y=d===this.currentBestFeature,f=this.currentBestFeature?.attributes.cameraPitch&&this.currentBestFeature?.attributes.cameraPitch<5;if(y&&f)p=-90;else{const e=h-Fe[3],t=m-Fe[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),p=i}const v=""===o?c:`${o}_${c}`;y&&(p===this.bestFeatureAngle?this.previousFeatureAngle=p:this.bestFeatureAngle=p,this.navigatorCurrentBestFeature=f?null:{x:h,y:m,direction:c}),n[`${d.attributes.objectId}`]=v;const w=this._sectorData[v];w.add({angle:a,featureIndex:r,x:h,y:m,z:g,objectID:d.attributes.objectId,sector:v,featureIndexInSector:w.length})}))}_handleDestroyedTriangularSketchLayer(){this.sketchTriangularGraphicsLayer&&(this.imageMeasurementViewer.imageRenderer.map.layers.remove(this.sketchTriangularGraphicsLayer),this.sketchTriangularGraphicsLayer=new D,this.imageMeasurementViewer.imageRenderer.map.layers.add(this.sketchTriangularGraphicsLayer),this.sketchTriangular&&(this.sketchTriangular.layer=this.sketchTriangularGraphicsLayer,this.sketchTriangular.view=this.imageMeasurementViewer.imageRenderer))}_initializeSketchTriangular(){this.sketchTriangular=new bt({view:this.imageMeasurementViewer.imageRenderer,layer:this.sketchTriangularGraphicsLayer,updateOnGraphicClick:!1,defaultUpdateOptions:{toggleToolOnClick:!1}})}_initializeSketchTriangularGraphicsLayer(){this.sketchTriangularGraphicsLayer=new D,this.imageMeasurementViewer.imageRenderer.map.layers.add(this.sketchTriangularGraphicsLayer)}_plotLocationPointOnDefaultImage(e,a=!1){const i=C(e)?e.toJSON():e;i.x-=.5,i.y=.5-i.y,a?(this._correctedLocationPointOnImage=new t({geometry:new O({spatialReference:j.WebMercator,...i}),symbol:nt}),this.imageMeasurementViewer.addGraphic(this._correctedLocationPointOnImage,0)):(this._locationPointOnImage=new t({geometry:new O({spatialReference:j.WebMercator,...i}),symbol:nt}),this._imageViewer.addGraphic(this._locationPointOnImage,0))}_plotLocationPointOnPanoramicImage(e){const{imageSize:a}=this._panoramicViewer;if(!a)return;const[i,r]=a,{heading:s,pitch:n}=ae(e,i,r),o=ie(s,n);this._locationPointOnImage=new t({geometry:new O(o,j.WebMercator),symbol:ot}),this._panoramicViewer.addGraphic(this._locationPointOnImage,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 R(e);if(this._updateFootprintWithFeatures(t,i),this.view?.supportsGround)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&&Z(i)?await Y({extent:this.footprintExtent,lod:i.lod,url:i.url,rasterFunction:i.rasterFunction}):void 0)}async _processFeatureResponse(e,t,a){const{features:i}=e;if(this._clearFeatureGeometries(),!this._checkFeatures(i))return;const{features:r,polygons:s,frustums:n}=this.filterByFootprints(i,t);if(!this._checkFeatures(r))return;this.coveragePolygons.addMany(s),this.coverageFrustums.addMany(n);const o=await this.processElevationSample(s,r,a);f(a),await this._updateElevationOfSelectedPointAndLocations(r,t,o),f(a),gt(r,o),this._processSuitableFeatures(r,t),this._updateSuitabilities(a?.loadBestImage)}_processSuitableFeatures(e,t){this._suitabilities=N({features:e,selectedPoint:t,camera:yt(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,n=r?.mapPoint??this.view?.toMap(i);if(!n)return;const{layerFloorFilterClause:o}=this,c=e.spatialReference.equals(n.spatialReference)?n:await x(n,e.spatialReference),l=c.spatialReference.isGeographic?z(c):c,u=I("1=1",I(e.definitionExpression,o)),h=l.spatialReference.isGeographic?1:S(l.spatialReference),m={layerInstanceOrURL:e,point:l,queryParams:{where:u,maximumDistance:e.maximumDistance?e.maximumDistance/h:void 0,objectIds:s?[r.graphic.getAttribute(e.objectIdField)]:void 0}};await this.searchBestImage(m,a)}_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&&(e.imageRenderer.cursor=this._previousCursor),t&&(t.imageRenderer.cursor=this._previousCursor)}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._previousCursor=e.imageRenderer.cursor,e.imageRenderer.cursor="crosshair"),t&&a&&(t.imageRenderer.cursor="crosshair")}_toggleVisiblity(e,t){e.forEach((e=>{e.visible=t}))}_triangulatedLocationWorkflow(e){if(this.currentBestFeature&&e){const{currentBestFeature:t}=this;this.triangulatedPoint&&(this.measurementVectors=[],this.triangulatedPoint=null,this.clearLocationPointOnImage(!0));const a=Ke(e,t);if(!a)return;this.measurementVectors.push(a),this.plotReferenceLocationPoint(e),this._createTriangularImageLocationHandle()}}async _updateElevationOfSelectedPointAndLocations(e,t,a,i){const r=ne(a),s=await se((e[0].attributes.location.z??0)-e[0].attributes.cameraHeight,{elevationSample:r?a:void 0,elevationSource:r?void 0:e[0].attributes.elevationSource,extent:this.footprintExtent},i);f(i);const[n,...o]=await X([t,...e.map((e=>e.attributes.geometry.clone()))],s);f(i),t.elevation=n.z,e.forEach(((e,t)=>{e.attributes.elevation=o[t].z}))}_updateFeatures(e,t=!0){if(!e.length)return this.currentBestFeature=null,void this.additionalFeatures.removeAll();this.features.removeAll(),this.features.addMany(e),e.length>1?this.additionalFeatures.addMany(e.slice(1)):this.additionalFeatures.removeAll(),this._updateGroundElevation=!0,t&&(this.currentBestFeature=e[0])}_updateFootprintWithFeatures(e,t){const a=[];for(const{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=ye(t.extent,2,2)}_updateSuitabilities(e){const{_suitabilities:t}=this;t&&this.updateSuitabilities(t,e)}async _updatePointsAndPolygons(e){const{pointSources:a,currentBestFeature:i,currentCoverageVisible:r,isAdditionalPointSourcesVisible:s}=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)),f(e);for(const e of a)e.imageID===i.attributes.objectId?this.currentBestFeatureLocation=new t({attributes:{imageID:e.imageID},geometry:e.clone(),symbol:ct,visible:r}):this.additionalCameraLocations.push(new t({attributes:{imageID:e.imageID},geometry:e.clone(),symbol:it,visible:s}))}}_updateCurrentBestFeature(e){if(!e)return;this.currentBestFeature=this.features?.at(e.featureIndex);const t=this.currentBestFeature?.attributes.cameraPitch&&this.currentBestFeature?.attributes.cameraPitch<5;let a;if(t)a=-90;else{const t=e.x-Fe[3],i=e.y-Fe[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()}clearReferencePointOnImage(){this._referencePointOnImage&&(this._imageViewer.removeGraphic(this._referencePointOnImage),this._panoramicViewer.removeGraphic(this._referencePointOnImage),this._referencePointOnImage=d(this._referencePointOnImage))}clearLocationPointOnImage(e=!1){this._locationPointOnImage&&!e&&(this._imageViewer.removeGraphic(this._locationPointOnImage),this._panoramicViewer.removeGraphic(this._locationPointOnImage),this._locationPointOnImage=d(this._locationPointOnImage)),this._correctedLocationPointOnImage&&(this.imageMeasurementViewer.removeGraphic(this._correctedLocationPointOnImage),this._correctedLocationPointOnImage=d(this._correctedLocationPointOnImage))}plotReferencePoint(e){"mapPoint"in e?this.plotReferencePointOnGround(e.mapPoint):this.plotReferencePointOnGround(e)}plotReferenceLocationPoint(e){if(this.currentBestFeatureMeasurementImage){const t=this.imageMeasurementViewer.imageSize[0],a=this.imageMeasurementViewer.imageSize[1],i=ue(this.currentBestFeatureMeasurementImage.attributes,t,a),r=he(e,i);this.plotLocationPointOnImage(r,!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=d(this._crossSymbol)),!i||!t||"image-loaded"!==r?.state||a)return;let s;try{s=await this.worldToImage(i,e),f(e),await this.plotSelectedPointOnImage(s,e)}catch(n){y(n)||u.getLogger(this).error("failed to transform map point to pixel, cross symbol will not be plotted on image",{error:n,selectedPoint:i,feature:t})}}async worldToImage(e,t){const{footprintExtent:a}=this,{imageSize:i}=this.activeViewer;if("none"===this.mode||!this.currentBestFeature||!i||!a)return;const{attributes:{location:r,elevationSource:s,cameraHeading:n,elevation:o,cameraHeight:c},elevationSample:l}=this.currentBestFeature;let u=r.clone();const h=await se(o??(r.z??0)-c,{elevationSample:l,elevationSource:s});this.currentBestFeature.elevationSample=h.elevationSample;const m=Array.isArray(e)?e:[e];let p,d=await Promise.all(m.map((e=>new Promise((t=>{if(!e.hasZ)return t(X(e,h));t(e)})))));if(r.spatialReference.isGeographic&&(u=await x(u,j.WebMercator,t)),d=await Promise.all(d.map((async e=>u.spatialReference.equals(e.spatialReference)?e:await x(e,u.spatialReference,t)))),f(t),"panoramic"===this.mode)p=me(d,{imageHeight:i[1],imageWidth:i[0],cameraHeading:n,cameraLocation:u});else{const e=ue(this.currentBestFeature.attributes,i[0],i[1]);p=he(d,{...e,cameraLocation:u})}return Array.isArray(e)?p:p[0]}updateCurrentCoveragePolygon(e){const{additionalFootprints:a,additionalCameraLocations:i,currentBestFeature:r,currentBestFeatureLocation:s,currentCoverageVisible:n,selectedPoint:o,view:c,_adapter:l,mode:u}=this,{attributes:{objectId:h},elevationSample:m}=r;if(this._initialCurrentCoverageUpdate){if(this._overlays?.removeAll(),this._initialCurrentCoverageUpdate=!1,this.bestFeatureCurrentFootprint=d(this.bestFeatureCurrentFootprint),e&&!this.invalidCameraHeading&&(e.visible=n,this.bestFeatureCurrentFootprint=e),c){const e=[...a,...i,s].filter(ft);c.supportsGround&&m&&l?.updateGroundElevation&&(this._updateGroundElevation&&l.updateGroundElevation(e,m),"panoramic"===u&&l.updateGroundElevation([this.bestFeatureCurrentFootprint],m)),this._updateGroundElevation=!1,o&&(e.splice(-2,0,this.bestFeatureCurrentFootprint),e.push(new t({geometry:o.clone(),symbol:Xe.clone(),attributes:{imageID:h}}))),this._overlays.graphics.addMany(e)}}else if(c){if(this.invalidCameraHeading)return;this.bestFeatureCurrentFootprint&&(this._overlays?.remove(this.bestFeatureCurrentFootprint),this.bestFeatureCurrentFootprint=d(this.bestFeatureCurrentFootprint));const t=this.bestFeatureCurrentFootprint&&this._overlays?this._overlays.graphics.indexOf(this.bestFeatureCurrentFootprint):-1;e&&(this.bestFeatureCurrentFootprint=e,c?.supportsGround&&m&&l?.updateGroundElevation&&"panoramic"===u&&l.updateGroundElevation([e],m),e.visible=this.currentCoverageVisible,this._overlays?.graphics.add(this.bestFeatureCurrentFootprint,t>=0?t:this._overlays.graphics.length-1))}}};e([k()],St.prototype,"activeLayer",null),e([k({readOnly:!0})],St.prototype,"activeViewer",null),e([k()],St.prototype,"accuracyParametersMissing",null),e([k()],St.prototype,"additionalFeatures",void 0),e([k({type:s.ofType(t)})],St.prototype,"additionalCameraLocations",void 0),e([k({type:s.ofType(t)})],St.prototype,"additionalFootprints",void 0),e([k()],St.prototype,"areaMeasurementResult",void 0),e([k()],St.prototype,"areaMeasurementAccuracy",void 0),e([k()],St.prototype,"bestFeatureAngle",void 0),e([k()],St.prototype,"bestFeatureCurrentFootprint",void 0),e([k({type:t})],St.prototype,"bestFeatureFootprint",void 0),e([k({type:Number})],St.prototype,"brightness",null),e([k()],St.prototype,"collectionId",void 0),e([k({type:Number})],St.prototype,"contrast",null),e([k()],St.prototype,"conversionProps",void 0),e([k()],St.prototype,"coverageFrustums",void 0),e([k()],St.prototype,"coveragePolygons",void 0),e([k()],St.prototype,"currentBestFeature",void 0),e([k()],St.prototype,"currentBestFeatureMeasurementImage",void 0),e([k()],St.prototype,"currentBestFeatureLocation",void 0),e([k()],St.prototype,"currentCoverageVisible",void 0),e([k()],St.prototype,"currentNode",null),e([k()],St.prototype,"navigationNodes",void 0),e([k({json:{write:!1}})],St.prototype,"determineWorkflowForFeature",void 0),e([k({json:{write:!1}})],St.prototype,"determineWorkflowForTriangularMeasurement",void 0),e([k()],St.prototype,"disabled",void 0),e([k()],St.prototype,"displayMessage",void 0),e([k()],St.prototype,"displayNewMeasurementButton",void 0),e([k()],St.prototype,"distanceMeasurementResult",void 0),e([k()],St.prototype,"distanceAccuracyArray",void 0),e([k()],St.prototype,"dataCaptureLayer",void 0),e([k({readOnly:!0})],St.prototype,"featureCount",null),e([k()],St.prototype,"features",void 0),e([k()],St.prototype,"groundCoordinates",void 0),e([k()],St.prototype,"groundCoordinatesAccuracy",void 0),e([k()],St.prototype,"heightMeasurementPixels",void 0),e([k()],St.prototype,"heightGraphic",void 0),e([k()],St.prototype,"heightMeasurementResult",void 0),e([k()],St.prototype,"heightMeasurementAccuracy",void 0),e([k()],St.prototype,"measurementAngle",void 0),e([k()],St.prototype,"tempDistance",void 0),e([k({readOnly:!0})],St.prototype,"imageGalleryEnabled",null),e([k()],St.prototype,"imageGeometryField",void 0),e([k({readOnly:!0})],St.prototype,"imageLoaded",null),e([k()],St.prototype,"imageLocationToolState",void 0),e([k({readOnly:!0})],St.prototype,"invalidCameraHeading",null),e([k()],St.prototype,"imagePointsInView",null),e([k()],St.prototype,"imageMeasurementViewer",void 0),e([k()],St.prototype,"isAdditionalCoverageVisible",void 0),e([k()],St.prototype,"isAdditionalPointSourcesVisible",void 0),e([k()],St.prototype,"measurementVectors",void 0),e([k()],St.prototype,"layer",void 0),e([k()],St.prototype,"layerView",null),e([k({readOnly:!0})],St.prototype,"layerFloorFilterClause",null),e([k({type:Number})],St.prototype,"localPort",void 0),e([k()],St.prototype,"mapImageConversionToolState",void 0),e([k()],St.prototype,"measureType",void 0),e([k()],St.prototype,"measurementGraphic",void 0),e([k({readOnly:!0,value:"none"})],St.prototype,"mode",null),e([k()],St.prototype,"navigatorCurrentBestFeature",void 0),e([k()],St.prototype,"oiObjectIdField",void 0),e([k({type:s.ofType(t)})],St.prototype,"overlayedCameraLocations",void 0),e([k()],St.prototype,"overlayedMapFeatures",void 0),e([k()],St.prototype,"pixelCoordinates",void 0),e([k()],St.prototype,"pointSources",void 0),e([k({readOnly:!0})],St.prototype,"popupEnabled",null),e([k()],St.prototype,"previousFeatureAngle",void 0),e([k()],St.prototype,"referencePoint",null),e([k({readOnly:!0})],St.prototype,"sectorData",null),e([k()],St.prototype,"selectedPoint",void 0),e([k({type:Number})],St.prototype,"sharpness",null),e([k()],St.prototype,"shouldShowSelectedImage",void 0),e([k()],St.prototype,"sketch",void 0),e([k()],St.prototype,"sketchTriangular",void 0),e([k()],St.prototype,"sketchTriangularGraphicsLayer",void 0),e([k()],St.prototype,"draw",void 0),e([k()],St.prototype,"sketchAdapter",void 0),e([k({readOnly:!0})],St.prototype,"sketchGraphicsLayer",null),e([k({readOnly:!0})],St.prototype,"state",null),e([k({readOnly:!0})],St.prototype,"thumbnails",null),e([k()],St.prototype,"triangularMeasurementActive",void 0),e([k()],St.prototype,"triangulatedDistanceMeasurement",void 0),e([k()],St.prototype,"triangulatedDistanceAccuracy",void 0),e([k()],St.prototype,"triangulatedAreaMeasurement",void 0),e([k()],St.prototype,"triangulatedAreaAccuracy",void 0),e([k()],St.prototype,"triangulatedMeasurementGraphic",void 0),e([k()],St.prototype,"triangulatedPoint",void 0),e([k()],St.prototype,"triangulatedMeasurementAdapter",void 0),e([k()],St.prototype,"updateFootprint",void 0),e([k()],St.prototype,"updateFootprintPanorama",void 0),e([k()],St.prototype,"updatingTriangularMeasurementState",void 0),e([k({value:null})],St.prototype,"view",null),e([k()],St.prototype,"_adapter",void 0),e([k()],St.prototype,"_sketchGraphicsLayer",null),e([k()],St.prototype,"_highlightedFeatureHandle",void 0),e([k()],St.prototype,"_imageViewer",void 0),e([k()],St.prototype,"_initialCurrentCoverageUpdate",void 0),e([k()],St.prototype,"_locationPointOnImage",void 0),e([k()],St.prototype,"_correctedLocationPointOnImage",void 0),e([k()],St.prototype,"_overlays",void 0),e([k({readOnly:!0})],St.prototype,"_overlaysView",null),e([k()],St.prototype,"_panoramicViewer",void 0),e([k()],St.prototype,"_previousCursor",void 0),e([k()],St.prototype,"_referencePointOnGround",void 0),e([k()],St.prototype,"_referencePointOnImage",void 0),e([k()],St.prototype,"_sectorData",void 0),e([k()],St.prototype,"_featureToSector",void 0),e([k()],St.prototype,"_activeSectors",null),e([k({readOnly:!0})],St.prototype,"_updatingHandles",void 0),e([k()],St.prototype,"footprintExtent",void 0),e([k()],St.prototype,"_featureChangedTask",void 0),St=e([A("esri.widgets.OrientedImageryViewer.OrientedImageryViewerViewModel")],St);const kt=St;export{kt as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import{equals as a,isSome as r}from"../../core/arrayUtils.js";import{createTask as i}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 c from"../../core/Evented.js";import{equalsShallow as l}from"../../core/lang.js";import u from"../../core/Logger.js";import{clamp as h}from"../../core/mathUtils.js";import{abortMaybe as m,destroyMaybe as p}from"../../core/maybe.js";import d from"../../core/Promise.js";import{isAbortError as g,throwIfAborted as y,waitTick as v}from"../../core/promiseUtils.js";import f from"../../core/ReactiveMap.js";import{whenOnce as w,on as F,watch as b,syncAndInitial as M,initial as _}from"../../core/reactiveUtils.js";import{sqlAnd as P}from"../../core/sql.js";import{getMetersPerUnitForSR as I}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{distance as A}from"../../core/libs/gl-matrix-2/math/vec2.js";import{isSerializable as V}from"../../core/support/jsonUtils.js";import{UpdatingHandles as C}from"../../core/support/UpdatingHandles.js";import{union as G}from"../../geometry/geometryEngineAsync.js";import L from"../../geometry/Multipoint.js";import R from"../../geometry/Point.js";import O from"../../geometry/Polygon.js";import T from"../../geometry/Polyline.js";import{projectWithZConversion as B}from"../../geometry/projection.js";import j from"../../geometry/SpatialReference.js";import{isClockwise as x}from"../../geometry/support/coordsUtils.js";import{geographicToWebMercator as z}from"../../geometry/support/webMercatorUtils.js";import E from"../../layers/GraphicsLayer.js";import{searchImages as D}from"../../layers/orientedImagery/queries.js";import{calculateSuitabilities as H}from"../../layers/orientedImagery/core/bestImageUtils.js";import{createCoveragePolygon as U,computePolygonForInspection as N,resizePolygon as W,checkIfPolygonContainsSelectedPoint as q}from"../../layers/orientedImagery/core/coverageUtils.js";import{isConstantElevation as $,isElevationSource as J}from"../../layers/orientedImagery/core/ElevationSourceDefinitions.js";import{imageToWorld as Z,imageToWorldPanoramic as K}from"../../layers/orientedImagery/transformations/imageToWorld.js";import Q from"../../layers/orientedImagery/transformations/updateElevation.js";import{getElevationSampler as X}from"../../layers/orientedImagery/transformations/updateElevationUtils.js";import{or as Y,getInitialAngle as ee,convertPixelToHeadingPitch as te,convertHeadingPitchToSphereVertex as ae,getImageToWorldProperties as re,getUpdateElevationProps as ie,isElevationSampler as se,getImageToWorldPanoramicProperties as oe,pointToArray as ne,transformGraphicCoordinatesToPixel as ce,getWorldToImageProperties as le}from"../../layers/orientedImagery/transformations/utils.js";import{worldToImage as ue,worldToImagePanoramic as he}from"../../layers/orientedImagery/transformations/worldToImage.js";import{getFloorFilterClause as me}from"../../layers/support/floorFilterUtils.js";import pe from"../../symbols/SimpleLineSymbol.js";import de from"../../views/draw/Draw.js";import{scale as ge}from"../../views/draw/support/drawUtils.js";import{ViewEventPriorities as ye}from"../../views/input/InputManager.js";import ve from"../PanoramicViewer.js";import{defaultAngleThresholdInDegrees as fe,invalidCameraHeading as we,sectorsInOrder as Fe,sectorsRadii as be}from"./constants.js";import{configureSketchTool as Me,extractFieldsFromDataCaptureLayer as _e,isValidDataCaptureLayer as Pe,constructGraphicFromImageGeometry as Ie}from"./dataCaptureUtils.js";import{isFeatureAttachment as Se,getImageSourceFromAttachment as ke}from"./galleryUtils.js";import{formatPixels as Ae,heightMeasurementPanoramic as Ve,heightMeasurement2D as Ce,calculateHeightAccuracyPanoramic as Ge,calculateHeightAccuracy as Le,pixelAreaMeasurement2D as Re,pixelAreaMeasurementPanoramic as Oe,pixelDistanceMeasurement2D as Te,pixelDistanceMeasurementPanoramic as Be,generateCombinations as je,getRootOfSumOfSquaredErrors as xe,generateCombinationsPanoramic as ze,calculateLocationAccuracyFromDeviations as Ee,calculateReferenceImagePointPanoramic as De,calculateAnglePano as He,calculateTempImagePoint as Ue,calculateAngle as Ne,computeTriangulatedAreaMeasurement as We,computeTriangulatedDistanceMeasurement as qe,getModeCorrectedPoint as $e,calculateCorrectedPixel as Je,calculateHeightFromTemporaryDistance as Ze,computeTriangulatedVector as Ke,computeTriangulatedPoint as Qe}from"./imageMeasurementUtils.js";import{crossSymbol as Xe,crossSymbol3D as Ye,measurementPolygonSymbol as et,polylineSymbolPanoramic as tt,measurementPolylineSymbol as at,sourcePointSymbol as rt,diamondSymbol as it,diamondSymbol3D as st,locationSymbol as ot,locationSymbol3D as nt,activeSourcePointSymbol as ct}from"./symbols.js";import{isNoAttachmentError as lt,getContentType as ut,isTifOrMrf as ht,filterOILLayerView as mt,assignElevationSampleToFeatures as pt,calculateDirection as dt,calculateSegment as gt,isSceneView as yt,isGraphic as vt}from"./utils.js";import ft from"./components/ImageViewer.js";import wt from"./components/NavigationNode.js";import{NoActiveViewerError as Ft}from"./navigation/errors.js";import bt from"../Sketch/SketchViewModel.js";const Mt={click:"view-click",imageClick:"image-click",triangularImageClick:"triangular-click",interactionHandles:"interaction-handles"},_t=new Set(["JPG","JPEG"]),Pt=/\.(\w+)$/,It=()=>new n("orientedimageryviewer:sketch-not-initialized","Sketch property is not initialized, call loadSketch first");let St=class extends(c.EventedMixin(d)){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=fe,this.cameraPitchThreshold=fe,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.navigationNodes=new s,this.determineWorkflowForFeature=async(e,t,a)=>{const{currentBestFeature:r,selectedPoint:i,view:s}=this;if(s?.closePopup(),r&&i){this._initialCurrentCoverageUpdate=!0,this._updateGroundElevation=!0;try{await this._updatePointsAndPolygons(a),await this._loadImage(a)}catch(o){g(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(r){g(r)||(this.loadImageError(r),u.getLogger(this).error("#loadIImage()","error occured while loading image",r))}},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 ft,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=!1,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)=>{"image-loaded"===this.state&&await(this._adapter?.updateFootprint(e,t))},this.updateFootprintPanorama=async(e,t)=>{await(this._adapter?.updateFootprintPanorama(e,t))},this.updatingTriangularMeasurementState=!1,this._adapter=null,this._highlightedFeatureHandle=null,this._imageViewer=new ft({navigationViewModel:this}),this._initialCurrentCoverageUpdate=!0,this._locationPointOnImage=null,this._correctedLocationPointOnImage=null,this._overlays=new E({listMode:"hide",internal:!0,elevationInfo:{mode:"absolute-height"}}),this._panoramicViewer=new ve,this._previousCursor=null,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.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 y(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.loadImageViewer=e=>{this._imageViewer.container=e},this.loadPanoramicViewer=e=>{this._panoramicViewer.container=e},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 Ft;return await a.navigate(e,t)},this.removeHighlight=()=>this._highlightedFeatureHandle?.remove(),this.revealImageGeometry=e=>{},this.selectBestFeature=async(e,t)=>(y(t),this.currentBestFeature=this.features?.find((({attributes:t})=>`${t.objectId}`==`${e}`)),w((()=>"image-loaded"===this.state),t)),this.toggleImageAttributes=()=>{m(this._openPopupTask),this._openPopupTask=i((async e=>{const{currentBestFeature:a,popupEnabled:r,layer:i,view:s}=this;if(s?.closePopup(),!(s&&a&&r&&i))return;const{attributes:o,geometry:n}=a,c=new t({geometry:n,attributes:o.toJSON(),layer:i});y(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(Mt.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,ye.WIDGET),Mt.click)},this._createImageClickHandle=()=>{this.removeHandles(Mt.imageClick);const{mapImageConversionToolState:e,mode:t,activeViewer:a,currentBestFeature:r,footprintExtent:s}=this,o=a?.imageSize;if(!(e&&"none"!==t&&o&&s&&r))return;a.clickAction="pixel-location";let n=null;const c=F((()=>a),"pixel-location",(e=>{this.plotReferencePointOnImage(e),n?.abort(),n=i((async a=>{if(!e)return;const i=await this.getMapPoint(e,{feature:r,imageSize:o,mode:t}).then((e=>{const t=this.view?.spatialReference;return Y(!t,e.spatialReference.equals(t))?e:B(e,t)}));y(a),this.plotReferencePointOnGround(i)}))}));this.addHandles(c,Mt.imageClick)},this._createTriangularImageClickHandle=()=>{this.removeHandles(Mt.triangularImageClick);const e=this.imageMeasurementViewer?.imageSize;this.triangularMeasurementActive&&"none"!==this.mode&&e&&this.currentBestFeature&&this.addHandles(this.imageMeasurementViewer.imageRenderer.on("double-click",this._measurementImageClickHandler),Mt.triangularImageClick)},this._createTriangularImageLocationHandle=()=>{this.removeHandles(Mt.triangularImageClick);const{imageLocationToolState:e,mode:t,imageMeasurementViewer:a}=this,r=a?.imageSize;if(!e||"none"===t||!r)return;a.clickAction="pixel-location";let s=null;const o=F((()=>a),"pixel-location",(e=>{1===this.measurementVectors.length&&(this.plotLocationPointOnImage(e,!0),s?.abort(),s=i((async a=>{if(!e||this.triangulatedPoint||2===this.measurementVectors?.length||!this.currentBestFeatureMeasurementImage)return;let i=await this.getMapPoint(e,{feature:this.currentBestFeatureMeasurementImage,imageSize:r,mode:t});y(a);const s=this.currentBestFeatureMeasurementImage.geometry.spatialReference;s&&!i.spatialReference.equals(s)&&(i=await B(i,s),y(a)),await this._calculateTriangulatedPointFromGroundPoint(i,{signal:a}),y(a)})))}));this.addHandles(o,Mt.triangularImageClick)},this._createImageLocationHandle=()=>{this.removeHandles(Mt.imageClick);const{imageLocationToolState:e,mode:t,activeViewer:a,currentBestFeature:r,footprintExtent:s}=this,o=a?.imageSize;if(!(e&&"none"!==t&&o&&s&&r))return;a.clickAction="pixel-location";let n=null;const c=F((()=>a),"pixel-location",(e=>{this.pixelCoordinates=e,this.plotLocationPointOnImage(e),n?.abort(),n=i((async a=>{if(!e)return;let i=await this.getMapPoint(e,{feature:r,imageSize:o,mode:t});y(a);const s=this.view?.spatialReference;s&&!i.spatialReference.equals(s)&&(i=await B(i,s),y(a)),this.groundCoordinates=i,this.triangularMeasurementActive&&i&&this._triangulatedLocationWorkflow(i);const n=await this.calculateLocationAccuracy(e,i,t,a);y(a),n&&(this.groundCoordinatesAccuracy=n)}))}));this.addHandles(c,Mt.imageClick)},this._loadImage=async e=>{const{currentBestFeature:t,layer:a,mode:r}=this;if(this.clearGraphics(),!a||!t||"none"===r)return;const{attributes:i}=t,{imagePath:s,imageRotation:o,cameraHeading:n,cameraRoll:c,cameraPitch:l,objectId:h,cameraOrientation:m,location:p}=i,d=(c??0)+(o??0),v=p.spatialReference.isWGS84&&4!==m?.type?z(p):new R(p);let f=s;if(Se(s))try{f=await ke(a,h,e)}catch(w){if(g(w))return;return lt(w)?(u.getLogger(this).error(w),void this.setMessage("noAttachment","error",`${a.objectIdField}: ${h}`)):(u.getLogger(this).error(w,{[a.objectIdField]:h,layer:a}),void this.setMessage("imageLoadError","error",`query-attachments-failed:${a.objectIdField} ${h}`))}try{await this.loadImageFromSource(f,{imageRotation:d,options:e,pitch:l,yaw:n,mode:r,cameraLocation:v}),y(e),await this.transformAndPlotSelectedLocation(e)}catch(w){g(w)||this.loadImageError(w)}},this._loadImageFromSourceInternal=async(e,t)=>{const{mode:a,imageRotation:r,options:i}=t,s="string"==typeof e,o=s?e:e.url,{pathname:n,searchParams:c}=new URL(o);let l=s?n.match(Pt)?.[1]:e.datasetFormat;if(!l)try{l=await ut(o,{...t.options})}catch(h){g(h)||u.getLogger(this).error("#getContentType()",h)}switch(l??="UNKNOWN FORMAT",a){case"default":this.triangularMeasurementActive?await this._setImageSource(this.imageMeasurementViewer,l,o,c,r,i):await this._setImageSource(this._imageViewer,l,o,c,r,i);break;case"panoramic":if(_t.has(l.toUpperCase())){const{selectedPoint:e}=this,{pitch:a,yaw:r,cameraLocation:s,viewAngle:n}=t;this._panoramicViewer.imageSource=o;let c=r??0;"number"==typeof n?c=n-c:s&&e&&(c=await ee(s,e)-c),this._panoramicViewer.pitch=a??0,this._panoramicViewer.yaw=c,await this._panoramicViewer.loadImage(i)}else this.setMessage("unsupportedPanoramicImageryError","error",void 0,{datasetFormat:l});break}},this._loadMeasurementViewerImage=async e=>{const{currentBestFeatureMeasurementImage:t,layer:a,mode:r}=this;if(this.imageMeasurementViewer.clearGraphics(),!a||!t||"none"===r)return;const{attributes:i}=t,{imagePath:s,imageRotation:o,cameraHeading:n,cameraRoll:c,cameraPitch:l,objectId:h,cameraOrientation:m,location:p}=i,d=(c??0)+(o??0),v=p.spatialReference.isWGS84&&4!==m?.type?z(p):new R(p);let f=s;if(Se(s))try{f=await ke(a,h,e)}catch(w){if(g(w))return;return lt(w)?(u.getLogger(this).error(w),void this.setMessage("noAttachment","error",`${a.objectIdField}: ${h}`)):(u.getLogger(this).error(w,{[a.objectIdField]:h,layer:a}),void this.setMessage("imageLoadError","error",`query-attachments-failed:${a.objectIdField} ${h}`))}try{await this.loadImageFromSource(f,{imageRotation:d,options:e,pitch:l,yaw:n,mode:r,cameraLocation:v}),y(e)}catch(w){g(w)||this.loadImageError(w)}},this._loadViewAdapter=async e=>{const{view:t}=this;if(t)switch(t.type){case"2d":{const{default:t}=await import("./adapters/view/MapViewAdapter.js");y(e),this._adapter=new t(this);break}case"3d":{const{default:t}=await import("./adapters/view/SceneViewAdapter.js");y(e),this._adapter=new t(this);break}}else this._adapter=null},this._mapImageConversionToolViewClickHandler=e=>{e.stopPropagation(),e.preventDefault(),e.mapPoint&&this.plotMapPoint(e.mapPoint)},this._measurementImageClickHandler=e=>{e.stopPropagation(),e.preventDefault();const{sketchTriangular:t,triangularMeasurementActive:a,currentBestFeatureMeasurementImage:r,triangulatedMeasurementGraphic:i}=this;t&&a&&r&&i&&"active"!==t.state&&(t.update([i],{tool:"reshape"}),this.updatingTriangularMeasurementState=!0)},this._viewClickHandler=e=>{this._clickTask?.abort(),this._clickTask=i((async t=>{const{pointerType:a,button:r,mapPoint:i}=e;if(("mouse"!==a||0===r)&&i)return e.stopPropagation(),e.preventDefault(),this._updatingHandles.addPromise(this.loadBestImage(i,{signal:t}))}))},this.plotSelectedPointOnImage=async(e,a)=>{if(await v(a),!e)return;const r=new R({...V(e)?e.toJSON():e});if("default"===this.mode)r.x-=.5,r.y=.5-r.y,r.spatialReference=this._imageViewer.imageRenderer.spatialReference.clone(),this._crossSymbol=new t({geometry:r,symbol:Xe}),this._imageViewer.addGraphic(this._crossSymbol,0);else if("panoramic"===this.mode){const{imageSize:a}=this._panoramicViewer;if(!a)return;const[r,i]=a,{heading:s,pitch:o}=te(e,r,i),n=ae(s,o);this._crossSymbol=new t({geometry:new R(n,j.WebMercator),symbol:Ye}),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)}),_),b((()=>this.view?.map?.allLayers?.length),(e=>{e&&this.view?.map?.layers.reorder(this._overlays,e-1)}),_),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._createImageLocationHandle(),!this.imageLocationToolState)return this.clearPreviousGroundLocation(),void this._resetCursor();e[1]!==t?.[1]&&this._setMeasurementCursor()}),M),b((()=>this.measureType),(()=>{this.clearPreviousMeasurements()}),M),b((()=>this.bestFeatureAngle),((e,t)=>{this.previousFeatureAngle=t??0}),M),b((()=>this.currentBestFeature),(async(e,t)=>{m(this._featureChangedTask),this._featureChangedTask=i((async a=>this.determineWorkflowForFeature.apply(this,[e,t,{signal:a}]))),await this._featureChangedTask.promise}),{sync:!0}),b((()=>this.currentBestFeatureMeasurementImage),(async(e,t)=>{m(this._featureChangedTask),t&&e!==t&&(this.measurementVectors=[],this.triangulatedPoint=null,this.sketchTriangularGraphicsLayer?.graphics.destroyAll()),this._featureChangedTask=i((async a=>{await this.determineWorkflowForTriangularMeasurement(e,t,{signal:a}),y(a),this._reorderTriangularSketchLayer()}))}),M),b((()=>this.triangularMeasurementActive),(async(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())})),b((()=>this.mode),(e=>{switch(this.removeHandles(Mt.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=i((async t=>{await this.updateFootprint(e,{signal:t})})))}),{...M,equals:(e,t)=>a(e,t,l)}),Mt.interactionHandles);break;case"panoramic":this.addHandles(b((()=>{const{currentBestFeature:e,state:t}=this,{imageSize:a,vfov:r,hfov:i,pitch:s,yaw:o}=this._panoramicViewer;return e&&a&&!t.includes("loading")?[r,i,o,s]:null}),(e=>{if(!e||this.state.includes("loading"))return;const[t,a,r,s]=e;this.currentNode&&(this.currentNode.currentHeading=r+(this.currentNode.heading??0),this.currentNode.currentPitch=s+(this.currentNode.pitch??0)),m(this._updateFootprintTask),this._updateFootprintTask=i((async e=>{await this.updateFootprintPanorama({verticalFieldOfView:t,horizontalFieldOfView:a,yaw:r,pitch:s},{signal:e})}))}),{...M,equals:(e,t)=>a(e,t,l)}),Mt.interactionHandles)}}),M),b((()=>[this.brightness,this.contrast,this.sharpness]),(()=>{const{_imageViewer:e,brightness:t,contrast:a,mode:r,sharpness:i}=this;"default"===r&&(e.brightness=t,e.contrast=a,e.sharpness=i)}),M),b((()=>this.activeViewer?.imageRenderer),(()=>{this.sketch&&(this.sketch.view=this.activeViewer?.imageRenderer)}))]),this.when().finally((()=>{this.notifyChange("state")}))}destroy(){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._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()}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 accuracyParametersMissing(){return this.layer?.orientationAccuracy?.every((e=>0===e))??!0}get brightness(){return this._get("brightness")??0}set brightness(e){this._set("brightness",h(e,-10,10))}get contrast(){return this._get("contrast")??0}set contrast(e){this._set("contrast",h(e,-10,10))}get currentNode(){const{currentBestFeature:e,navigationNodes:t}=this;return t.find((t=>t.id===e?.attributes.objectId))}get featureCount(){return this.features?.length??0}get imageGalleryEnabled(){const{currentBestFeature:e}=this;if(!e)return!1;const t=e.attributes.imagePath?.trim();return ht(t)||Se(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===we}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(mt(e))}get layerFloorFilterClause(){const{layerView:e}=this;return e?me(e):null}get mode(){const e=this.currentBestFeature?.attributes;if(!e)return"none";const{horizontalFieldOfView:t,isSpherical:a}=e;return 360===t||a?"panoramic":"default"}get popupEnabled(){return!0===this.layer?.popupEnabled}get referencePoint(){return this._referencePointOnGround?.geometry}get sectorData(){const{_sectorData:e}=this;return e?Fe.map((t=>e[t])):null}get sharpness(){return this._get("sharpness")??0}set sharpness(e){this._set("sharpness",h(e,0,1))}get sketchGraphicsLayer(){return this.sketch?.layer}get state(){const{mode:e,disabled:t,_updatingHandles:{updating:a},_featureChangedTask:r}=this;if(t)return"disabled";if(!this.isFulfilled()||a||!1===r?.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}return"ready"}get thumbnails(){const{features:e}=this;return e?new s(e.map((({attributes:{imagePath:e,objectId:t,cameraRoll:a,imageRotation:r}})=>{const i=e?.trim();return ht(i)||Se(i)?{url:i,objectId:t,rotation:(a??0)+(r??0)}:null})).filter(r)):null}set view(e){this._set("view",e)}get _sketchGraphicsLayer(){const{mode:e}=this;switch(e){case"panoramic":return new E({elevationInfo:{mode:"absolute-height"}});case"default":return new E;case"none":return}}get _overlaysView(){return this.view?.layerViews.find((({layer:e})=>e===this._overlays))}async computeHeight(e,t,a=!0){const{currentBestFeature:r,activeViewer:i,layer:s,footprintExtent:o}=this,n=i?.imageSize,c=r?.attributes,l=s?.orientationAccuracy;if(!c||!n||!e||e.length<2||!l)return;const u="panoramic"===t?await this.getMeasurementPropertiesPanoramic():re(c,n[0],n[1]),h=e.at(0),m=e.at(-1);if(!(u&&h&&m&&l&&o))return;const p=[m,h],d=Ae(p,!1),g="panoramic"===t?await Ve(p,u,l,r,!0,!1):await Ce(p,u,l,!0,a);if(!g)return;const y="panoramic"===t?await Ge(l,d,u,g,r,!0):await Le(l,d,u,g,!0);return y?{value:g,accuracy:y}:{value:g}}async calculateAreaMeasurement(e,t,a){if(e.length<3||!this.currentBestFeature||!this.activeViewer?.imageSize||"none"===t)return null;const r="default"===t?await this.getMeasurementProperties():await this.getMeasurementPropertiesPanoramic();return y(a),r?"default"===t?await Re(e,r,!0):await Oe(e,r,!0,a):null}async calculateDistanceMeasurement(e,t,a){const{currentBestFeature:r,activeViewer:i}=this;if(e.length<2||!r||!i?.imageSize||"none"===t)return null;const s="default"===t?await this.getMeasurementProperties():await this.getMeasurementPropertiesPanoramic();return y(a),s?"default"===t?await Te([e.at(0),e.at(-1)],s,!0):await Be([e.at(0),e.at(-1)],s,!0):null}async calculateAccuracy(e,t,a){const{layer:r,currentBestFeature:i,activeViewer:s}=this,o=r?.orientationAccuracy,n=o?.every((e=>0===e))||!o?.length;if("area"===t&&e.length<3||"distance"===t&&e.length<2||!i||!s?.imageSize||n)return null;let c=null;if(this.triangularMeasurementActive&&this.currentBestFeatureMeasurementImage&&this.imageMeasurementViewer?c=await this.getMeasurementProperties(this.currentBestFeatureMeasurementImage,this.imageMeasurementViewer):(c=await this.getMeasurementProperties(),y(a)),!c)return null;const l="area"===t?await Re(e,c,!0):await Te([e.at(0),e.at(-1)],c,!0);y(a);const{updateElevationProps:u,...h}=c,m=je(h,o);if(!m?.length)return null;const p=m.map((e=>({...e,updateElevationProps:u}))).map((async r=>{const i="area"===t?await Re(e,r,!0):await Te([e.at(0),e.at(-1)],r,!0);if(y(a),i&&l){if("area"===t){const e="number"!=typeof i?i.area:null;return e?Math.abs(e-l.area):null}return Math.abs(i-l)}return null})),d=await Promise.all(p);y(a);const g=d.filter((e=>null!==e));return 0===g.length?null:xe(g)}async calculateLocationAccuracy(e,t,a="default",r){const{layer:i,currentBestFeature:s}=this,o=i?.orientationAccuracy,n=this.view?.spatialReference,c=o?.every((e=>0===e))||!o?.length;if(!s||c)return null;const l="default"===a?await this.getMeasurementProperties():await this.getMeasurementPropertiesPanoramic();if(y(r),!l)return null;const{updateElevationProps:u,...h}=l,m="default"===a?je(h,o):ze(h,o);if(!m?.length)return null;const p=m.map((e=>({...e,updateElevationProps:u}))).map((async i=>{const{updateElevationProps:s,...o}=i;let c="default"===a?await Z(e,o,s):await K(e,o,s);return y(r),n&&!c.spatialReference.equals(n)&&(c=await B(c,n),y(r)),c&&t?[Math.abs(c.x-t.x),Math.abs(c.y-t.y),c.z&&t.z?Math.abs(c.z-t.z):0]:null})),d=await Promise.all(p);if(y(r),!d?.length)return null;const g=d.map((e=>[e?.[0]??0,e?.[1]??0,e?.[2]??0])),[v,f,w]=Ee(g);return{x:v,y:f,z:w}}async calculateAccuracyPanoramic(e,t,a){const{layer:r,currentBestFeature:i,activeViewer:s,mode:o}=this,n=r?.orientationAccuracy,c=n?.every((e=>0===e))||!n?.length;if("area"===t&&e.length<3||"distance"===t&&e.length<2||!i||!s?.imageSize||c||"panoramic"!==o)return null;const l=await this.getMeasurementPropertiesPanoramic();if(y(a),!l)return null;const u="area"===t?await Oe(e,l,!0):await Be([e.at(0),e.at(-1)],l,!0);y(a);const{updateElevationProps:h,...m}=l,p=ze(m,n);if(!p?.length)return null;const d=p.map((e=>({...e,updateElevationProps:h}))).map((async r=>{const i="area"===t?await Oe(e,r,!0):await Be([e.at(0),e.at(-1)],r,!0);if(y(a),i&&u){if("area"===t){const e="number"!=typeof i?i.area:null;return e?Math.abs(e-u.area):null}return Math.abs(i-u)}return null})),g=await Promise.all(d);y(a);const v=g.filter((e=>null!==e));return 0===v.length?null:xe(v)}async calculateHeightMeasurementInfo(e,t,a){const{currentBestFeature:r,activeViewer:i}=this,s=i?.imageSize;if(!r||!i||!s?.length||"none"===t)return;const{attributes:o}=r,[n]=Ae([e],"panoramic"!==t),c="panoramic"===t?await this.getMeasurementPropertiesPanoramic():re(o,s[0],s[1]);if("panoramic"===t){if(!c)return;const e=await De(n,c,r,a);if(!e)return;e?.heading>180&&(e.heading-=360);const t=He(n,e),i=A([n.x,n.y],[e.x,e.y]);if(!t||!i)return;return{measurementAngle:t,tempDistance:i}}const l=await Ue(n,c,a);if(!l)return;const u=Ne(n,l),h=A([n.x,n.y],[l.x,l.y]);return u&&h?{measurementAngle:u,tempDistance:h}:void 0}async calculateTriangulatedMeasurements(e){switch(this.measureType){case"distance":{this.triangulatedDistanceMeasurement=await qe(this.measurementVectors);const t=await this.calculateAccuracy(e,"distance");if(t&&this.triangulatedDistanceMeasurement?.distance){const e=Math.atan(t/this.triangulatedDistanceMeasurement.distance);this.triangulatedDistanceAccuracy={distanceAccuracy:t,angleAccuracy:e}}break}case"area":if(this.currentBestFeatureMeasurementImage?.geometry.spatialReference){const t=await We(this.measurementVectors,this.currentBestFeatureMeasurementImage.geometry.spatialReference);this.triangulatedAreaMeasurement=t,this.triangulatedAreaAccuracy=await this.calculateAccuracy(e,"area")??this.triangulatedAreaAccuracy}}}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:r}=this;if(!a)throw It();Me(r,e,a),await a.create(e,{...t,defaultZ:0})}async digitizeDelete(){if(!this.sketch)throw It();return this.sketch.delete()}digitizeDuplicate(){if(!this.sketch)throw It();return this.sketch.duplicate()}digitizePlace(e,t){if(!this.sketch)throw It();return this.sketch.place(e,t)}digitizeRedo(){if(!this.sketch)throw It();return this.sketch.redo()}digitizeUndo(){if(!this.sketch)throw It();return this.sketch.undo()}digitizeUpdate(e,t){if(!this.sketch)throw It();return this.sketch.update(e,t)}async displayHeightResults(){const{currentBestFeature:e,activeViewer:t,heightMeasurementPixels:a,mode:r}=this,i=t?.imageSize,s=e?.attributes;if(!s||!i)return;const o=await this.computeHeight(a,r);o?.value&&o?.accuracy&&(this.heightMeasurementResult=o.value,this.heightMeasurementAccuracy=o.accuracy)}filterByFootprints(e,t,a=!1){const r=[],i=[],s=[];return e.forEach((e=>{const{layer:{coveragePercent:o},attributes:n}=e;let c;const l=I(e.geometry.spatialReference);n.cameraHeight/=l,n.farDistance/=l,n.nearDistance/=l,$(n.elevationSource)&&(n.elevationSource.constantElevation/=l);const{polygon:u,frustum:h}=U(n);if(c=u.clone(),n.isInspection&&(c=N(n)),o&&(c=W(c,o)),a||!t||q(c,t)){s.push(e);const{geometry:t,objectId:a,cameraHeight:o,cameraHeading:c}=n,l=t.clone();l.z=o,l.imageID=a,this.pointSources.push(l),c!==we&&(r.push(u),h&&i.push(h))}})),{features:s,polygons:r,frustums:i}}getMeasurementProperties(e=this.currentBestFeature,t=this.activeViewer){if(!e||!t?.imageSize)return;const{elevationSample:a,attributes:r}=e,{elevationSource:i,cameraHeight:s}=r,o=re(r,t.imageSize[0],t.imageSize[1]);let n=o.cameraLocation;return(n.spatialReference.isGeographic?B(n,j.WebMercator):Promise.resolve(n)).then((e=>(n=e,ie((n.z??0)-s,{elevationSample:a,elevationSource:i,extent:this.footprintExtent})))).then((t=>("elevationSample"in t&&se(t.elevationSample)&&(e.elevationSample=t.elevationSample),{...o,cameraLocation:n,updateElevationProps:t})))}getMeasurementPropertiesPanoramic(){const{currentBestFeature:e,activeViewer:t}=this;if(!e||!t?.imageSize)return;const{elevationSample:a,attributes:r}=e,{elevationSource:i,cameraHeight:s}=r,o=oe(r,t.imageSize[0],t.imageSize[1]);let n=o.cameraLocation;return(n.spatialReference.isGeographic?B(n,j.WebMercator):Promise.resolve(n)).then((e=>(n=e,ie((n.z??0)-s,{elevationSample:a,elevationSource:i,extent:this.footprintExtent})))).then((t=>("elevationSample"in t&&se(t.elevationSample)&&(e.elevationSample=t.elevationSample),{...o,cameraLocation:n,updateElevationProps:t})))}async deleteDataCaptureFeatures(e){const{dataCaptureLayer:t}=this;if(!t)throw new n("orientedimagery","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?.[Fe[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 r=this._sectorData?.[t],i=r?.at(a);i&&(this.triangularMeasurementActive&&this.currentBestFeature?this._updateImageMeasurementBestFeature(i):this._updateCurrentBestFeature(i))}handleDrawCursorUpdateEvents(e){const{measurementAngle:t,tempDistance:a,heightMeasurementPixels:r,mode:i,activeViewer:s}=this,o=s?.imageSize;if(!e.vertices||!o)return;const n=$e(e.vertices.at(-1),i,o);if(r.length<1||!n||!a||!t||"none"===i)return;const c=Je(r[0],n,t);if(!c?.length)return;this.heightMeasurementPixels.push(c),"panoramic"===i?this.createPolylineGraphicPano():this.createPolylineGraphic();const l=Ze(this.heightMeasurementPixels,a);l&&(this.heightMeasurementResult=l)}async handleDrawVertexAddEvents(e,t){const{currentBestFeature:a,activeViewer:r,heightMeasurementPixels:i,mode:s}=this;if(!a||!r||!e.vertices?.length||"none"===s)return;const o=r?.imageSize;if(!i.length&&o){const a=$e(e.vertices.at(-1),s,o);this.heightMeasurementPixels.push(a);const r=await this.calculateHeightMeasurementInfo(a,s,t);if(!r?.measurementAngle||!r?.tempDistance)return;this.measurementAngle=r.measurementAngle,this.tempDistance=r.tempDistance}}async load(e){return this.addResolvingPromise(this._loadViewAdapter(e).catch((e=>{if(!g(e))throw e}))),this}async loadBestImage(e,t){return this.view?.closePopup(),this.displayMessage=null,this.clearPreviousGroundLocation(),this.triangularMeasurementActive=!1,this.currentBestFeatureMeasurementImage=null,this.measureType=null,this.imageLocationToolState=!1,this.selectedPoint=e.spatialReference.isGeographic?z(e):e.clone(),this.features.removeAll(),this.currentBestFeature=null,this.additionalFeatures.removeAll(),this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint=p(this.bestFeatureCurrentFootprint),this._overlays?.removeAll(),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;y(e),this.sketch=new a({layer:this._sketchGraphicsLayer,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(y(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(y(e),this.triangulatedMeasurementAdapter=new a({viewModel:this}),!this.triangulatedMeasurementAdapter.viewModel.isResolved())return}return this.triangulatedMeasurementAdapter}async processFeatureResponse(e,t,a){const{features:r}=e;if(this._clearFeatureGeometries(),!this._checkFeatures(r))return;const{features:i,polygons:s,frustums:o}=this.filterByFootprints(r,t,a?.skipFilter);if(!this._checkFeatures(i))return;this.coveragePolygons.addMany(s),this.coverageFrustums.addMany(o);const n=await this.processElevationSample(s,i,a);y(a),await this._updateElevationOfSelectedPointAndLocations(i,t,n),y(a),pt(i,n);const c=this._processSuitableFeatures(i,t);this.updateSuitabilities(c,a?.loadBestImage)}async startMeasurement(e,t){this.sketch||await this.loadSketch(t),await this.loadMeasurementAdapter(t);const{sketch:a,sketchAdapter:r,activeViewer:i,mode:s}=this;if(!a||!r||!i||"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=et(o),this.sketch.polylineSymbol="panoramic"===s?tt:at(o,2.5))}startHeightMeasurement(){this.heightMeasurementPixels=[],this.displayNewMeasurementButton=!1,this.draw??=new de({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 T({paths:[e],spatialReference:a});else{const r=new T({paths:[e],spatialReference:a}),i=this.activeViewer?.imageRenderer.effectiveTheme.accentColor;this.heightGraphic=new t({geometry:r,symbol:at(i,2.5)}),this.activeViewer?.addGraphic(this.heightGraphic)}}createPolylineGraphicPano(){const e=this.activeViewer?.imageRenderer.spatialReference,a=this.activeViewer?.imageSize;if(!a)return;const r={x:this.heightMeasurementPixels[0][0],y:this.heightMeasurementPixels[0][1]},i={x:this.heightMeasurementPixels.at(-1)[0],y:this.heightMeasurementPixels.at(-1)[1]},{heading:s,pitch:o}=te(r,a[0],a[1]),{heading:n,pitch:c}=te(i,a[0],a[1]),l=[[...ae(s,o)],[...ae(n,c)]];if(this.heightGraphic)this.heightGraphic.geometry=new T({paths:[l],spatialReference:e});else{const a=new T({paths:[l],spatialReference:e});this.heightGraphic=new t({geometry:a,symbol:tt}),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:r}=this,i=a?.imageSize;if(!e||!t||!i)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:i,mode:r});o&&!a.spatialReference.equals(o)&&(a=await B(a,o)),n.push(a)}return Ke(n,t)}async handleDrawEvents(e,t){if(this.draw)switch(e.type){case"cursor-update":this.handleDrawCursorUpdateEvents(e);break;case"vertex-add":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:r,overlayedCameraLocations:i,layer:s,mode:o,state:n}=this,c=a?.imageSize;if(!c||!r||!s||"none"===o||n.includes("loading"))return;const{polygon:l}=U(r.attributes);if(a.removeManyGraphics(i.toArray()),i.removeAll(),e){const{features:e}=await s.queryFeatures({where:`${s.objectIdField} <> ${r.attributes.objectId}`,geometry:l,returnGeometry:!0,outFields:[s.objectIdField]}),n=await Promise.all(e.map((async e=>{const{attributes:a,geometry:i}=e,s=await this.getPixels(i,{feature:r,imageSize:c,mode:o}),n=rt.clone();return n.outline=new pe({color:[0,0,0],width:1}),new t({attributes:a,symbol:n,geometry:s})})));i.addMany(n),a.addManyGraphics(i.toArray())}}overlayGraphicsOnImage(e,t){this.removeOverlayedGraphicsOnImage(e),this.overlayedMapFeatures.set(e,t),this.activeViewer?.addManyGraphics(t.toArray())}async overlayMapFeatures(e,a=!1){const{activeViewer:i,currentBestFeature:o,mode:n,state:c,layer:l}=this,h=i?.imageSize;if(!h||!o||"none"===n||c.includes("loading")||!l)return;const{polygon:m}=U(o.attributes);try{const{imageGeometryField:t,oiObjectIdField:a}=_e(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:p}=await e.queryFeatures({geometry:m,returnGeometry:!0,outFields:["*"]}),d=new s((await Promise.all(p.map((async r=>{const i=r.symbol?.clone()??e.renderer?.getSymbol(r)?.clone(),{attributes:s,geometry:c}=r,l=c,{imageGeometryField:m,oiObjectIdField:p}=this;if(m&&p&&Pe(e,m,p)&&`${s[p]}`==`${o.attributes.objectId}`)try{return Ie(s,m,e,a,h,n,i)}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:r,layer:e,imageGeometryField:this.imageGeometryField,imageReferenceField:this.oiObjectIdField})}switch(l?.type){case"point":{const r=await this.getPixels(l,{feature:o,imageSize:h,mode:n});return new t({attributes:s,layer:e,symbol:i,geometry:r,visible:e.visible&&a})}case"polygon":{const{rings:r,spatialReference:c}=l,u=r.map((e=>e.map((([e,t,a])=>new R({x:e,y:t,z:a,spatialReference:c}))))),m=await Promise.all(u.map((async e=>this.getPixels(e,{feature:o,imageSize:h,mode:n}).then((e=>e.map(ne))))));return new t({attributes:s,layer:e,symbol:i,geometry:new O({rings:m,spatialReference:j.WebMercator}),visible:e.visible&&a})}case"polyline":{const{paths:r,spatialReference:c}=l,u=r.map((e=>e.map((([e,t,a])=>new R({x:e,y:t,z:a,spatialReference:c}))))),m=await Promise.all(u.map((async e=>this.getPixels(e,{feature:o,imageSize:h,mode:n}).then((e=>e.map(ne))))));return new t({attributes:s,layer:e,symbol:i,geometry:new T({paths:m,spatialReference:j.WebMercator}),visible:e.visible&&a})}case"multipoint":{const{points:r,spatialReference:c}=l,u=r.map((([e,t,a])=>new R({x:e,y:t,z:a,spatialReference:c}))),m=await this.getPixels(u,{feature:o,imageSize:h,mode:n}).then((e=>e.map(ne)));return new t({attributes:s,layer:e,symbol:i,geometry:new L({points:m,spatialReference:j.WebMercator}),visible:e.visible&&a})}}return null})))).filter(r));this.overlayGraphicsOnImage(`${e.id}`,d)}async getPixels(e,t){const{imageSize:a,mode:r}=t,i=(await this.worldToImage(Array.isArray(e)?e:[e])).map((e=>{if("default"===r)return new R({x:e.x-.5,y:.5-e.y,spatialReference:j.WebMercator});const[t,i]=a,{heading:s,pitch:o}=te(e,t,i),n=ae(s,o);return new R(n,j.WebMercator)}));return Array.isArray(e)?i:i[0]}async getMapPoint(e,t){const{feature:a,mode:r,imageSize:i}=t,{elevationSample:s,attributes:o}=a,{elevationSource:n,location:c,elevation:l,cameraHeight:u}=o;let h=c.clone();h.spatialReference.isGeographic&&(h=await B(h,j.WebMercator));const m=await ie(l??(c.z??0)-u,{elevationSample:s,elevationSource:n,extent:this.footprintExtent});let p;if("elevationSample"in m&&se(m.elevationSample)&&(a.elevationSample=m.elevationSample),"default"===r){const t=re(o,i[0],i[1]);p=await Z(Array.isArray(e)?e:[e],{...t,cameraLocation:h},m)}else{const t=oe(o,i[0],i[1]);p=await K(Array.isArray(e)?e:[e],{...t,cameraLocation:h},m)}return Array.isArray(e)?p:p[0]}getActiveSectors(){return Fe.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 R({...e.toJSON()}),symbol:it}),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=V(e)?e.toJSON():e;a.x-=.5,a.y=.5-a.y,this._referencePointOnImage=new t({geometry:new R({spatialReference:this._imageViewer.imageRenderer.spatialReference,...a}),symbol:it}),this._imageViewer.addGraphic(this._referencePointOnImage,0);break}case"panoramic":{const{imageSize:a}=this._panoramicViewer;if(!a)return;const[r,i]=a,{heading:s,pitch:o}=te(e,r,i),n=ae(s,o);this._referencePointOnImage=new t({geometry:new R(n,j.WebMercator),symbol:st}),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)}}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))}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)}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:r}=t,i=a.get(e.id),s=i?.toArray();if(!i||!s?.length)return;const{addFeatureResults:o}=await this.saveDataCaptureFeatures(s),n=o.reduce(((t,{objectId:a,globalId:r,error:i},o)=>{const n=s[o],{attributes:c}=n;return i?t.error.push(n):(a&&(c[e.objectIdField]=a),r&&e.globalIdField&&(c[e.globalIdField]=r),t.success.push(n)),t}),{success:[],error:[]});r.addMany(n.success),i.removeAll(),i.addMany(n.error)}async saveDataCaptureFeatures(e){const{activeViewer:t,currentBestFeature:a,dataCaptureLayer:i,mode:s}=this,o=t?.imageSize;if(!o||!a||"none"===s)throw new n("orientedimagery","Image size, current best feature and mode are required to save data capture features");if(!i)throw new n("orientedimagery","Data capture layer is not available");const c=await Promise.all(e.map((async e=>{const t=e.clone(),{geometry:r}=t;if(!r)return;const n=r.type,c=i.hasZ,l=i.geometryType,u=n!==l,h=u?await import("./transformers.js"):null,m=h?.default[l],p=u?m?.(r):r;if(p)switch(p.type){case"point":return t.geometry=await this.getMapPoint(ce(s,p,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(p.rings.map((async e=>this.getMapPoint(e.map((([e,t,a])=>ce(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(ne)))}),t}case"polyline":{const e=await Promise.all(p.paths.map((async e=>this.getMapPoint(e.map((([e,t,a])=>ce(s,{x:e,y:t,z:a},o))),{feature:a,imageSize:o,mode:s}))));return t.geometry=new T({spatialReference:e[0][0].spatialReference,hasZ:c,hasM:!1,paths:e.map((e=>e.map(ne)))}),t}}}))),l=c.filter(r);return i.applyEdits({addFeatures:l}).then((e=>{const{addFeatureResults:t}=e;let a=0;const r=c.map((e=>{const r=t[a++];return e?r:{error:new n("orientedimagery","Error in saving data capture features"),objectId:null,globalId:null}}));return{...e,addFeatureResults:r}}))}async searchBestImage(e,t){try{const a=await D(e,t);a&&await this.processFeatureResponse(a,e.point,t)}catch(a){g(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:r,currentBestFeature:i}=this;if(!a||!i||!r)return;const{attributes:{objectId:o}}=i,n=this.overlayedMapFeatures.get(e.id)?.toArray()??[],c=[],l=[];for(const s of n)`${s.getAttribute(r)}`==`${o}`?c.push(s):l.push(s);this.overlayGraphicsOnImage(e.id,new s(l)),this.collectionId=e.id;const u=await this.loadSketch(t),h=await this.loadDataCaptureAdapter(t);y(t),u.layer.addMany(c),u.layer.blendMode="source-atop",h.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 r=a.ui.find("zoom");r&&(r.visible=!0)}stopMeasurement(){this.heightMeasurementPixels=[],this.draw?.reset(),this.sketch?.cancel()}toggleAllOverlayMapFeatures(e){this.overlayedMapFeatures.forEach((t=>{this._toggleVisiblity(t,e)}))}toggleOverlayMapFeatures(e,t){const a=this.overlayedMapFeatures.get(e);a&&this._toggleVisiblity(a,t)}toggleSelection(e){const{sketch:t}=this;t&&(t.updateOnGraphicClick=e,t.cancel())}async transformAndPlotReferencePointOnImage(e){const{selectedLocation:t,options:a}=e;let r=!1,i=!1;const s=this.bestFeatureFootprint?.geometry;switch(s?.type){case"polygon":{const e=t.spatialReference.equals(s.spatialReference)?t:await B(t,s.spatialReference);r=s.contains(e);break}case"mesh":{const e=t.spatialReference.equals(s.spatialReference)?t:await B(t,s.spatialReference);i=s.extent.contains(e);break}}if(!r&&!i)return void this.clearReferencePointOnImage();const o=await this.worldToImage(t,a);if(o)return y(a),this.plotReferencePointOnImage(o),{x:o.x,y:o.y};this.clearReferencePointOnImage()}async _calculateTriangulatedPointFromGroundPoint(e,t){if(this.currentBestFeatureMeasurementImage&&e){const{currentBestFeatureMeasurementImage:a}=this,r=Ke(e,a);r&&this.measurementVectors.push(r);const i=await Qe(this.measurementVectors);y(t),this.triangulatedPoint=i??this.triangulatedPoint}}async _fetchFeatures(e,t){if(!this.view)return;const a=this.layer;if(a){const r={include:a},i=this.view.toScreen(e);if(!i)return;const s=await this.view.hitTest(i,r);return this._processHitTestResults(a,s,t)}}async _fetchFeaturesWithController(e,t){try{await this._fetchFeatures(e,t)}catch(a){if(g(a))return;this.setMessage("imageLoadError","error"),u.getLogger(this).error("error occurred while fetching features",a)}}_groupFeaturesBySectors(){const{_suitabilities:e,additionalFeatures:t,currentBestFeature:a,features:r,invalidCameraHeading:i}=this;if(!e||!t||!a||!r||i)return void(this._sectorData=null);this._sectorData={};const o={};this._featureToSector=o;for(const h of Fe)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),u=r.reduce(((e,t)=>Math.max(e,t.attributes.location.z??0)),-1/0);n.forEach((e=>{const{distance:t,angle:a,featureIndex:i}=e,s=t/l*be[2],n=gt(t,l),c=dt(a);if(!this._sectorData)return;const h=be[3]+s*Math.sin(a*Math.PI/180),m=be[3]+s*Math.cos(a*Math.PI/180);let p;const d=r.at(i),g=(d.attributes.location.z??0)/u*be[2],y=d===this.currentBestFeature,v=this.currentBestFeature?.attributes.cameraPitch&&this.currentBestFeature?.attributes.cameraPitch<5;if(y&&v)p=-90;else{const e=h-be[3],t=m-be[3],a=t/Math.sqrt(e**2+t**2);let r=180*Math.acos(a)/Math.PI;(e<0&&t<0||e<0&&t>0)&&(r*=-1),p=r}const f=""===n?c:`${n}_${c}`;y&&(p===this.bestFeatureAngle?this.previousFeatureAngle=p:this.bestFeatureAngle=p,this.navigatorCurrentBestFeature=v?null:{x:h,y:m,direction:c}),o[`${d.attributes.objectId}`]=f;const w=this._sectorData[f];w.add({angle:a,featureIndex:i,x:h,y:m,z:g,objectID:d.attributes.objectId,sector:f,featureIndexInSector:w.length})}))}_handleDestroyedTriangularSketchLayer(){this.sketchTriangularGraphicsLayer&&(this.imageMeasurementViewer.imageRenderer.map.layers.remove(this.sketchTriangularGraphicsLayer),this.sketchTriangularGraphicsLayer=new E,this.imageMeasurementViewer.imageRenderer.map.layers.add(this.sketchTriangularGraphicsLayer),this.sketchTriangular&&(this.sketchTriangular.layer=this.sketchTriangularGraphicsLayer,this.sketchTriangular.view=this.imageMeasurementViewer.imageRenderer))}_initializeSketchTriangular(){this.sketchTriangular=new bt({view:this.imageMeasurementViewer.imageRenderer,layer:this.sketchTriangularGraphicsLayer,updateOnGraphicClick:!1,defaultUpdateOptions:{toggleToolOnClick:!1}})}_initializeSketchTriangularGraphicsLayer(){this.sketchTriangularGraphicsLayer=new E,this.imageMeasurementViewer.imageRenderer.map.layers.add(this.sketchTriangularGraphicsLayer)}_plotLocationPointOnDefaultImage(e,a=!1){const r=V(e)?e.toJSON():e;r.x-=.5,r.y=.5-r.y,a?(this._correctedLocationPointOnImage=new t({geometry:new R({spatialReference:j.WebMercator,...r}),symbol:ot}),this.imageMeasurementViewer.addGraphic(this._correctedLocationPointOnImage,0)):(this._locationPointOnImage=new t({geometry:new R({spatialReference:j.WebMercator,...r}),symbol:ot}),this._imageViewer.addGraphic(this._locationPointOnImage,0))}_plotLocationPointOnPanoramicImage(e){const{imageSize:a}=this._panoramicViewer;if(!a)return;const[r,i]=a,{heading:s,pitch:o}=te(e,r,i),n=ae(s,o);this._locationPointOnImage=new t({geometry:new R(n,j.WebMercator),symbol:nt}),this._panoramicViewer.addGraphic(this._locationPointOnImage,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 r=await G(e);if(this._updateFootprintWithFeatures(t,r),this.view?.supportsGround)try{return await this.view.map.ground.createElevationSampler(this.footprintExtent,a)}catch(i){g(i)||u.getLogger(this).error(i)}}async processElevationSample(e,t,a){const{elevationSource:r}=t[0].attributes,i=await this._getElevationSampleFromGround(e,t,a);return i||(r&&this.footprintExtent&&J(r)?await X({extent:this.footprintExtent,lod:r.lod,url:r.url,rasterFunction:r.rasterFunction}):void 0)}_processSuitableFeatures(e,t){return H({features:e,selectedPoint:t,camera:yt(this.view)?this.view.camera:null,currentImage:this.currentBestFeature})}async _processHitTestResults(e,t,a){const{screenPoint:r,results:[i]}=t,s="graphic"===i?.type&&this.shouldShowSelectedImage,o=i?.mapPoint??this.view?.toMap(r);if(!o)return;const{layerFloorFilterClause:n}=this,c=e.spatialReference.equals(o.spatialReference)?o:await B(o,e.spatialReference),l=c.spatialReference.isGeographic?z(c):c,u=P("1=1",P(e.definitionExpression,n)),h=l.spatialReference.isGeographic?1:I(l.spatialReference),m={layerInstanceOrURL:e,point:l,queryParams:{where:u,maximumDistance:e.maximumDistance?e.maximumDistance/h:void 0,objectIds:s?[i.graphic.getAttribute(e.objectIdField)]:void 0}};await this.searchBestImage(m,a)}_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&&(e.imageRenderer.cursor=this._previousCursor),t&&(t.imageRenderer.cursor=this._previousCursor)}async _setImageSource(e,t,a,r,i,s){e.imageSource={datasetFormat:t.toUpperCase(),url:a.split("?")[0]},e.customParameters=Object.fromEntries(r),e.imageRotation=i??0,await e.loadImage(s)}_setMeasurementCursor(){const{activeViewer:e,imageMeasurementViewer:t,triangularMeasurementActive:a}=this;e&&(this._previousCursor=e.imageRenderer.cursor,e.imageRenderer.cursor="crosshair"),t&&a&&(t.imageRenderer.cursor="crosshair")}_toggleVisiblity(e,t){e.forEach((e=>{e.visible=t}))}_triangulatedLocationWorkflow(e){if(this.currentBestFeature&&e){const{currentBestFeature:t}=this;this.triangulatedPoint&&(this.measurementVectors=[],this.triangulatedPoint=null,this.clearLocationPointOnImage(!0));const a=Ke(e,t);if(!a)return;this.measurementVectors.push(a),this.plotReferenceLocationPoint(e),this._createTriangularImageLocationHandle()}}async _updateElevationOfSelectedPointAndLocations(e,t,a,r){const i=se(a),s=await ie((e[0].attributes.location.z??0)-e[0].attributes.cameraHeight,{elevationSample:i?a:void 0,elevationSource:i?void 0:e[0].attributes.elevationSource,extent:this.footprintExtent},r);y(r);const[o,...n]=await Q([t,...e.map((e=>e.attributes.geometry.clone()))],s);y(r),t.elevation=o.z,e.forEach(((e,t)=>{e.attributes.elevation=n[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=>new wt({geometry:e.geometry,attributes:e.attributes})))),e.length>1?this.additionalFeatures.addMany(e.slice(1)):this.additionalFeatures.removeAll(),this._updateGroundElevation=!0,t&&(this.currentBestFeature=e[0])}_updateFootprintWithFeatures(e,t){const a=[];for(const{geometry:r}of e)t.contains(r)||a.push([r.x,r.y]);a.sort(((e,t)=>+x([e,t]))),t.addRing(a),this.footprintExtent=ge(t.extent,2,2)}async _updatePointsAndPolygons(e){const{pointSources:a,currentBestFeature:r,currentCoverageVisible:i,isAdditionalPointSourcesVisible:s}=this;if(r&&(this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint&&(this.bestFeatureCurrentFootprint.destroy(),this.bestFeatureCurrentFootprint=null,this.bestFeatureFootprint=null),!this.invalidCameraHeading)){await(this._adapter?.createFootprints(e)),y(e);for(const e of a)e.imageID===r.attributes.objectId?this.currentBestFeatureLocation=new t({attributes:{imageID:e.imageID},geometry:e.clone(),symbol:ct,visible:i}):this.additionalCameraLocations.push(new t({attributes:{imageID:e.imageID},geometry:e.clone(),symbol:rt,visible:s}))}}_updateCurrentBestFeature(e){if(!e)return;this.currentBestFeature=this.features?.at(e.featureIndex);const t=this.currentBestFeature?.attributes.cameraPitch&&this.currentBestFeature?.attributes.cameraPitch<5;let a;if(t)a=-90;else{const t=e.x-be[3],r=e.y-be[3],i=r/Math.sqrt(t**2+r**2);let s=180*Math.acos(i)/Math.PI;(t<0&&r<0||t<0&&r>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()}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._correctedLocationPointOnImage=p(this._correctedLocationPointOnImage))}plotReferencePoint(e){"mapPoint"in e?this.plotReferencePointOnGround(e.mapPoint):this.plotReferencePointOnGround(e)}plotReferenceLocationPoint(e){if(this.currentBestFeatureMeasurementImage){const t=this.imageMeasurementViewer.imageSize[0],a=this.imageMeasurementViewer.imageSize[1],r=le(this.currentBestFeatureMeasurementImage.attributes,t,a),i=ue(e,r);this.plotLocationPointOnImage(i,!0)}}setMessage(e,t,a,r){this.displayMessage={key:e,type:t,data:a,map:r}}async transformAndPlotSelectedLocation(e){const{currentBestFeature:t,invalidCameraHeading:a,selectedPoint:r,activeViewer:i}=this;if(this._crossSymbol&&(this._panoramicViewer.removeGraphic(this._crossSymbol),this._imageViewer.removeGraphic(this._crossSymbol),this._crossSymbol=p(this._crossSymbol)),!r||!t||"image-loaded"!==i?.state||a)return;let s;try{s=await this.worldToImage(r,e),y(e),await this.plotSelectedPointOnImage(s,e)}catch(o){g(o)||u.getLogger(this).error("failed to transform map point to pixel, cross symbol will not be plotted on image",{error:o,selectedPoint:r,feature:t})}}async worldToImage(e,t){const{footprintExtent:a}=this,{imageSize:r}=this.activeViewer;if("none"===this.mode||!this.currentBestFeature||!r||!a)return;const{attributes:{location:i,elevationSource:s,cameraHeading:o,elevation:n,cameraHeight:c},elevationSample:l}=this.currentBestFeature;let u=i.clone();const h=await ie(n??(i.z??0)-c,{elevationSample:l,elevationSource:s});this.currentBestFeature.elevationSample=h.elevationSample;const m=Array.isArray(e)?e:[e];let p,d=await Promise.all(m.map((e=>new Promise((t=>{if(!e.hasZ)return t(Q(e,h));t(e)})))));if(i.spatialReference.isGeographic&&(u=await B(u,j.WebMercator,t)),d=await Promise.all(d.map((async e=>u.spatialReference.equals(e.spatialReference)?e:await B(e,u.spatialReference,t)))),y(t),"panoramic"===this.mode)p=he(d,{imageHeight:r[1],imageWidth:r[0],cameraHeading:o,cameraLocation:u});else{const e=le(this.currentBestFeature.attributes,r[0],r[1]);p=ue(d,{...e,cameraLocation:u})}return Array.isArray(e)?p:p[0]}updateCurrentCoveragePolygon(e){const{additionalFootprints:a,additionalCameraLocations:r,currentBestFeature:i,currentBestFeatureLocation:s,currentCoverageVisible:o,selectedPoint:n,view:c,_adapter:l,mode:u}=this,{attributes:{objectId:h},elevationSample:m}=i;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,...r,s].filter(vt);c.supportsGround&&m&&l?.updateGroundElevation&&(this._updateGroundElevation&&l.updateGroundElevation(e,m),"panoramic"===u&&l.updateGroundElevation([this.bestFeatureCurrentFootprint],m)),this._updateGroundElevation=!1,n&&(e.splice(-2,0,this.bestFeatureCurrentFootprint),e.push(new t({geometry:n.clone(),symbol:Xe.clone(),attributes:{imageID:h}}))),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,c?.supportsGround&&m&&l?.updateGroundElevation&&"panoramic"===u&&l.updateGroundElevation([e],m),e.visible=this.currentCoverageVisible,this._overlays?.graphics.add(this.bestFeatureCurrentFootprint,t>=0?t:this._overlays.graphics.length-1))}}};e([S()],St.prototype,"activeLayer",null),e([S({readOnly:!0})],St.prototype,"activeViewer",null),e([S()],St.prototype,"accuracyParametersMissing",null),e([S()],St.prototype,"additionalFeatures",void 0),e([S({type:s.ofType(t)})],St.prototype,"additionalCameraLocations",void 0),e([S({type:s.ofType(t)})],St.prototype,"additionalFootprints",void 0),e([S()],St.prototype,"areaMeasurementResult",void 0),e([S()],St.prototype,"areaMeasurementAccuracy",void 0),e([S()],St.prototype,"bestFeatureAngle",void 0),e([S()],St.prototype,"bestFeatureCurrentFootprint",void 0),e([S({type:t})],St.prototype,"bestFeatureFootprint",void 0),e([S({type:Number})],St.prototype,"brightness",null),e([S()],St.prototype,"cameraHeadingThreshold",void 0),e([S()],St.prototype,"cameraPitchThreshold",void 0),e([S()],St.prototype,"collectionId",void 0),e([S({type:Number})],St.prototype,"contrast",null),e([S()],St.prototype,"conversionProps",void 0),e([S()],St.prototype,"coverageFrustums",void 0),e([S()],St.prototype,"coveragePolygons",void 0),e([S()],St.prototype,"currentBestFeature",void 0),e([S()],St.prototype,"currentBestFeatureMeasurementImage",void 0),e([S()],St.prototype,"currentBestFeatureLocation",void 0),e([S()],St.prototype,"currentCoverageVisible",void 0),e([S()],St.prototype,"currentNode",null),e([S()],St.prototype,"navigationNodes",void 0),e([S({json:{write:!1}})],St.prototype,"determineWorkflowForFeature",void 0),e([S({json:{write:!1}})],St.prototype,"determineWorkflowForTriangularMeasurement",void 0),e([S()],St.prototype,"disabled",void 0),e([S()],St.prototype,"displayMessage",void 0),e([S()],St.prototype,"displayNewMeasurementButton",void 0),e([S()],St.prototype,"distanceMeasurementResult",void 0),e([S()],St.prototype,"distanceAccuracyArray",void 0),e([S()],St.prototype,"dataCaptureLayer",void 0),e([S({readOnly:!0})],St.prototype,"featureCount",null),e([S()],St.prototype,"features",void 0),e([S()],St.prototype,"groundCoordinates",void 0),e([S()],St.prototype,"groundCoordinatesAccuracy",void 0),e([S()],St.prototype,"heightMeasurementPixels",void 0),e([S()],St.prototype,"heightGraphic",void 0),e([S()],St.prototype,"heightMeasurementResult",void 0),e([S()],St.prototype,"heightMeasurementAccuracy",void 0),e([S()],St.prototype,"measurementAngle",void 0),e([S()],St.prototype,"tempDistance",void 0),e([S({readOnly:!0})],St.prototype,"imageGalleryEnabled",null),e([S()],St.prototype,"imageGeometryField",void 0),e([S({readOnly:!0})],St.prototype,"imageLoaded",null),e([S()],St.prototype,"imageLocationToolState",void 0),e([S({readOnly:!0})],St.prototype,"invalidCameraHeading",null),e([S()],St.prototype,"imagePointsInView",null),e([S()],St.prototype,"imageMeasurementViewer",void 0),e([S()],St.prototype,"isAdditionalCoverageVisible",void 0),e([S()],St.prototype,"isAdditionalPointSourcesVisible",void 0),e([S()],St.prototype,"measurementVectors",void 0),e([S()],St.prototype,"layer",void 0),e([S()],St.prototype,"layerView",null),e([S({readOnly:!0})],St.prototype,"layerFloorFilterClause",null),e([S({type:Number})],St.prototype,"localPort",void 0),e([S()],St.prototype,"mapImageConversionToolState",void 0),e([S()],St.prototype,"measureType",void 0),e([S()],St.prototype,"measurementGraphic",void 0),e([S({readOnly:!0,value:"none"})],St.prototype,"mode",null),e([S()],St.prototype,"navigatorCurrentBestFeature",void 0),e([S()],St.prototype,"oiObjectIdField",void 0),e([S({type:s.ofType(t)})],St.prototype,"overlayedCameraLocations",void 0),e([S()],St.prototype,"overlayedMapFeatures",void 0),e([S()],St.prototype,"pixelCoordinates",void 0),e([S()],St.prototype,"preserveAngle",void 0),e([S()],St.prototype,"pointSources",void 0),e([S({readOnly:!0})],St.prototype,"popupEnabled",null),e([S()],St.prototype,"previousFeatureAngle",void 0),e([S()],St.prototype,"referencePoint",null),e([S({readOnly:!0})],St.prototype,"sectorData",null),e([S()],St.prototype,"selectedPoint",void 0),e([S({type:Number})],St.prototype,"sharpness",null),e([S()],St.prototype,"shouldShowSelectedImage",void 0),e([S()],St.prototype,"sketch",void 0),e([S()],St.prototype,"sketchTriangular",void 0),e([S()],St.prototype,"sketchTriangularGraphicsLayer",void 0),e([S()],St.prototype,"draw",void 0),e([S()],St.prototype,"sketchAdapter",void 0),e([S({readOnly:!0})],St.prototype,"sketchGraphicsLayer",null),e([S({readOnly:!0})],St.prototype,"state",null),e([S({readOnly:!0})],St.prototype,"thumbnails",null),e([S()],St.prototype,"triangularMeasurementActive",void 0),e([S()],St.prototype,"triangulatedDistanceMeasurement",void 0),e([S()],St.prototype,"triangulatedDistanceAccuracy",void 0),e([S()],St.prototype,"triangulatedAreaMeasurement",void 0),e([S()],St.prototype,"triangulatedAreaAccuracy",void 0),e([S()],St.prototype,"triangulatedMeasurementGraphic",void 0),e([S()],St.prototype,"triangulatedPoint",void 0),e([S()],St.prototype,"triangulatedMeasurementAdapter",void 0),e([S()],St.prototype,"updateFootprint",void 0),e([S()],St.prototype,"updateFootprintPanorama",void 0),e([S()],St.prototype,"updatingTriangularMeasurementState",void 0),e([S({value:null})],St.prototype,"view",null),e([S()],St.prototype,"_adapter",void 0),e([S()],St.prototype,"_sketchGraphicsLayer",null),e([S()],St.prototype,"_highlightedFeatureHandle",void 0),e([S()],St.prototype,"_imageViewer",void 0),e([S()],St.prototype,"_initialCurrentCoverageUpdate",void 0),e([S()],St.prototype,"_locationPointOnImage",void 0),e([S()],St.prototype,"_correctedLocationPointOnImage",void 0),e([S()],St.prototype,"_overlays",void 0),e([S({readOnly:!0})],St.prototype,"_overlaysView",null),e([S()],St.prototype,"_panoramicViewer",void 0),e([S()],St.prototype,"_previousCursor",void 0),e([S()],St.prototype,"_referencePointOnGround",void 0),e([S()],St.prototype,"_referencePointOnImage",void 0),e([S()],St.prototype,"_sectorData",void 0),e([S()],St.prototype,"_featureToSector",void 0),e([S({readOnly:!0})],St.prototype,"_updatingHandles",void 0),e([S()],St.prototype,"footprintExtent",void 0),e([S()],St.prototype,"_featureChangedTask",void 0),St=e([k("esri.widgets.OrientedImageryViewer.OrientedImageryViewerViewModel")],St);const kt=St;export{kt 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/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";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
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";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 i}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../views/MapView.js";import r from"../../Widget.js";import s from"./ImageViewerViewModel.js";import a from"./NavigationUI.js";import n from"./NavigationUIViewModel.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import{globalCss as p}from"../../support/globalCss.js";import"../../support/widgetUtils.js";import{vmEvent as d}from"../../support/decorators/vmEvent.js";import{tsx as c}from"../../support/jsxFactory.js";const h="esri-image-viewer";let m=class extends r{constructor(){super(...arguments),this.navigationEnabled=!1,this.viewModel=new s,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,t)=>{this.viewModel.addGraphic(e,t)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadImage=async e=>this.viewModel.loadImage(e),this.navigate=async(e,t)=>this.viewModel.navigate(e,t),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return l({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get brightness(){return this.viewModel.brightness}set brightness(e){this.viewModel.brightness=e}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get contrast(){return this.viewModel.contrast}set contrast(e){this.viewModel.contrast=e}get currentNode(){return this.navigationViewModel?.currentNode}get customParameters(){return this.viewModel.customParameters}set customParameters(e){this.viewModel.customParameters=e}get error(){return this.viewModel.error}get imageSize(){const e=this.viewModel.image?.serviceRasterInfo;return e?[e.width,e.height]:[0,0]}get imagePointsInView(){return this.viewModel.imagePointsInView}get imageRenderer(){return this.viewModel.imageRenderer}get imageRotation(){return this.viewModel.imageRotation}set imageRotation(e){this.viewModel.imageRotation=e}get imageSource(){return this.viewModel.imageSource}set imageSource(e){this.viewModel.imageSource=e}get navigationNodes(){return this.navigationViewModel?.navigationNodes}set navigationViewModel(e){this.viewModel.navigationViewModel=e}get sharpness(){return this.viewModel.sharpness}set sharpness(e){this.viewModel.sharpness=e}get state(){return this.viewModel.state}render(){return c("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(p.widget,h)},this.navigationEnabled?c(a,{currentNode:this.currentNode,nodes:this.navigationNodes,viewModel:new n({preserveAngle:this.navigationViewModel?.preserveAngle,cameraHeadingThreshold:this.navigationViewModel?.cameraHeadingThreshold,cameraPitchThreshold:this.navigationViewModel?.cameraPitchThreshold})}):null)}static{this.vnodeSelector="calcite-panel"}};e([t({type:Boolean})],m.prototype,"autoLoad",null),e([t({type:Number}),t()],m.prototype,"brightness",null),e([t()],m.prototype,"clickAction",null),e([t({type:Number})],m.prototype,"contrast",null),e([t()],m.prototype,"currentNode",null),e([t({type:Object})],m.prototype,"customParameters",null),e([t({readOnly:!0})],m.prototype,"error",null),e([t()],m.prototype,"imageSize",null),e([t({readOnly:!0})],m.prototype,"imagePointsInView",null),e([t({readOnly:!0,type:o})],m.prototype,"imageRenderer",null),e([t()],m.prototype,"imageRotation",null),e([t()],m.prototype,"imageSource",null),e([t({type:Boolean})],m.prototype,"navigationEnabled",void 0),e([t()],m.prototype,"navigationNodes",null),e([t()],m.prototype,"navigationViewModel",null),e([t({type:Number})],m.prototype,"sharpness",null),e([t({readOnly:!0})],m.prototype,"state",null),e([d(["click","hittest-response","pixel-location"]),t({type:s})],m.prototype,"viewModel",void 0),m=e([i("esri.widgets.OrientedImageryViewer.components.ImageViewer")],m);const g=m;export{g 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/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Map.js";import
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Map.js";import i from"../../../core/Error.js";import r from"../../../core/Evented.js";import a from"../../../core/Logger.js";import{clamp as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{isAbortError as n}from"../../../core/promiseUtils.js";import{watch as m,syncAndInitial as l,initial as h}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import{rotate as c,intersect as p,nearestCoordinate as u}from"../../../geometry/geometryEngine.js";import y from"../../../geometry/Point.js";import v from"../../../geometry/Polygon.js";import _ from"../../../geometry/SpatialReference.js";import f from"../../../layers/GraphicsLayer.js";import R from"../../../layers/ImageryTileLayer.js";import w from"../../../layers/support/RasterFunction.js";import{convolutionKernel as x}from"../../../layers/support/rasterFunctionConstants.js";import C from"../../../layers/support/TileInfo.js";import I from"../../../views/MapView.js";import{getResolutionToScaleFactor as b}from"../../../views/2d/viewpointUtils.js";import{logAndThrow as j,getMissingPropertyErrorName as M,getMissingPropertyErrorMessage as P,castImageSource as S}from"../utils.js";const V={click:"click-handle",enhancements:"enhancements-handle"};let k=class extends r.EventedAccessor{constructor(e){super(e),this._imageChanged=!1,this._panConstraint=null,this._image=null,this._loadController=null,this._overlays=new f({blendMode:"source-atop"}),this._map=new t,this.autoLoad=!1,this.clickAction="none",this.error=null,this.imageSource=null,this.imageRotation=0,this.navigationManager=null,this.navigationViewModel=null,this.state="ready",this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._createImageHandles=()=>{this.removeHandles(V.enhancements),this.addHandles(m((()=>[this.brightness,this.contrast,this.sharpness]),(([e,t,i])=>{this.image?.loaded&&(this.image.effect=`contrast(${10*(t+10)}%) brightness(${10*(e+10)}%)`,this.sharpenImage(this.image,i))}),l))},this._createPanConstraint=()=>{const{image:e,imageRenderer:t}=this,i=i=>{if(!(e&&t&&i.targetGeometry&&e.serviceRasterInfo))return i;const{extent:r}=e.serviceRasterInfo,{constraints:a,rotation:s,width:o,height:n}=t,{extent:m}=c(v.fromExtent(r),s),{width:l,height:h}=m,d=i.targetGeometry.clone(),g=a.scaleToZoom(i.scale),p=1/2**g,y=o/n;let _=p*l,f=p*h;g&&(l/o>h/n?f=_/y:_=f*y);const R=m.clone();return R.xmin+=_/2,R.xmax-=_/2,R.ymin+=f/2,R.ymax-=f/2,i.targetGeometry=u(R,d).coordinate,this.state="image-loaded",i};return{constrain:i,applyPanConstraint:i}},this._createResizeHandles=e=>{e.removeHandles("resize"),e.addHandles(m((()=>{if(!this.imageRenderer.ready)return;const{extent:t}=e.serviceRasterInfo,{width:i,height:r,rotation:a}=this.imageRenderer,{extent:s}=c(v.fromExtent(t),a),{width:o,height:n}=s;return Math.max(o/i,n/r)}),(e=>{if(!this.imageRenderer||null==e)return;const{constraints:t,scale:i,spatialReference:r}=this.imageRenderer,a=t.minScale,s=b(r),o=.25*s,n=s*e;let m=n;const l=[];for(;m>o;)l.push(m),m/=2;l.push(m);const{lods:h}=C.create({scales:l});if(t.set({minScale:n,lods:h}),this._imageChanged)return this.imageRenderer.scale=n,void(this._imageChanged=!1);this.imageRenderer.scale=Math.abs(i-a)<=1e-6?n:i}),l),"resize")},this._loadImageInternal=(e,t={})=>{this.state="image-loading",this.clearImage(),this.error=null,this._imageChanged=!0;const i="string"==typeof e,r=i?void 0:e.datasetFormat,s=i?e:e.url,{customParameters:o,options:m}=t;return this._image=new R({ioConfig:{skipExtensions:["aux.xml","jgw"],skipMapInfo:!0,datasetFormat:r},url:s,customParameters:o}),this._image.when((async e=>{this._updatePanConstraint(),this._createResizeHandles(e),this._map.add(e),this.state="image-loaded"}),(t=>{n(t)?this.state="image-load-aborted":(this.state="image-load-error",this.error=t,a.getLogger(this).error(`error occurred while loading image ${i?e:JSON.stringify(e)}`,t),this.imageSource=null)})),this._image.load(m)},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadImage(this._loadController)},this._loadNavigationManager=async()=>{if(!this.navigationManager||this.navigationManager?.destroyed){const e=await import("../navigation/NavigationManager.js").then((e=>e.default));this.navigationManager=new e({viewModel:this.navigationViewModel})}return this.navigationManager},this._updatePanConstraint=()=>{this._panConstraint&&this.imageRenderer.constraints.customConstraints.remove(this._panConstraint),this._panConstraint=this._createPanConstraint(),this.imageRenderer.constraints.customConstraints.add(this._panConstraint)},this.addGraphic=(e,t)=>{this._overlays.graphics.add(e,t)},this.addManyGraphics=e=>{this._overlays.addMany(e)},this.clearGraphics=()=>{this._overlays.graphics.removeAll()},this.clearImage=()=>{this.image&&(this._map.layers.remove(this.image),this._image=o(this._image))},this.loadImage=e=>{const{customParameters:t,imageSource:r}=this;return r?this._loadImageInternal(r,{customParameters:t,options:e}):j(this.declaredClass,new i(M("image-viewer"),P("ImageViewerViewModel","imageSource")))},this.navigate=async(e,t)=>(await this._loadNavigationManager()).navigate(e,t),this.removeGraphic=e=>{this._overlays.remove(e)},this.removeManyGraphics=e=>{this._overlays.removeMany(e)},this._imageRenderer=new I({constraints:{snapToZoom:!0,rotationEnabled:!1},map:this._map,popupEnabled:!1,spatialReference:_.WebMercator,ui:{components:["zoom"]}})}destroy(){this._imageRenderer.destroy()}initialize(){this.state="initialized",this.addHandles([m((()=>this.imageSource),(e=>{e&&this.autoLoad&&this._loadWithController()}),l),m((()=>this.image?.loaded),(()=>{this._createImageHandles()})),m((()=>this.imageRotation),(()=>{this._rotateImage()})),m((()=>this.imageRenderer.map),((e,t)=>{t?.layers.remove(this._overlays),e?.layers.add(this._overlays)}),h),m((()=>this.imageRenderer.map.allLayers.length),(e=>{e&&this.imageRenderer.map.layers.reorder(this._overlays,e-1)}),l),m((()=>this.clickAction),(e=>{this.removeHandles(V.click),"none"!==e&&this.addHandles(this.imageRenderer.on("click",(t=>{if(this.image?.loaded&&this.imageRenderer.ready)switch(e){case"emit":t.stopPropagation(),this.emit("click",t);break;case"hittest":t.stopPropagation(),t.defer((async()=>{const e=await this.imageRenderer.hitTest(t.screenPoint,{include:this._overlays});this.emit("hittest-response",e)}));break;case"pixel-location":{if(t.stopPropagation(),!this.image?.serviceRasterInfo||!t.mapPoint)return void this.emit("pixel-location",null);const{extent:e,pixelSize:i}=this.image.serviceRasterInfo,r=(t.mapPoint.x-e.xmin)*i.x,a=(e.ymax-t.mapPoint.y)*i.y,s=new y({x:r,y:a,spatialReference:e.spatialReference});this.emit("pixel-location",s);break}}})))}),l)])}get brightness(){return this._get("brightness")??0}set brightness(e){this._set("brightness",s(e,-10,10))}get contrast(){return this._get("contrast")??0}set contrast(e){this._set("contrast",s(e,-10,10))}get currentNode(){return this.navigationViewModel?.currentNode}get image(){return this._image}get imagePointsInView(){const{extent:e,ready:t}=this.imageRenderer,i=this.imageRotation,r=this.image?.fullExtent,a=this.image?.serviceRasterInfo,s=!0===this._imageRenderer.allLayerViews.find((({layer:e})=>e===this.image))?.attached;if(!(t&&e&&r&&a&&s))return null;const o=c(v.fromExtent(e),i),n=v.fromExtent(r),m=p(o,n),{rings:l}=m;return l.flat().map((([e,t])=>({x:(e-a.extent.xmin)*a.pixelSize.x,y:(a.extent.ymax-t)*a.pixelSize.y})))}get imageSize(){const{image:e}=this;if(!e?.raster)return null;const{width:t,height:i}=e.raster.rasterInfo;return[t,i]}get imageRenderer(){return this._imageRenderer}get imageView(){return this.imageRenderer.allLayerViews.find((e=>e.layer===this.image))}get sharpness(){return this._get("sharpness")??0}set sharpness(e){this._set("sharpness",s(e,0,1))}_rotateImage(){this.imageRenderer.constraints.rotationEnabled=!0,this.imageRenderer.rotation=this.imageRotation,this.imageRenderer.constraints.rotationEnabled=!1}sharpenImage(e,t){if(!t)return void(e.rasterFunction=null);const i=[0,-1*t,0,-1*t,4*t+1,-1*t,0,-1*t,0],r=new w({functionName:"Convolution",functionArguments:{type:x.userDefined,cols:3,rows:3,kernel:i,convolutionType:x.userDefined}});e.rasterFunction=r}};e([d()],k.prototype,"_image",void 0),e([d()],k.prototype,"_imageRenderer",void 0),e([d()],k.prototype,"_loadController",void 0),e([d()],k.prototype,"_overlays",void 0),e([d()],k.prototype,"_map",void 0),e([d({type:Boolean})],k.prototype,"autoLoad",void 0),e([d({type:Number})],k.prototype,"brightness",null),e([d()],k.prototype,"clickAction",void 0),e([d({type:Number})],k.prototype,"contrast",null),e([d()],k.prototype,"currentNode",null),e([d({type:Object})],k.prototype,"customParameters",void 0),e([d({type:i})],k.prototype,"error",void 0),e([d({readOnly:!0})],k.prototype,"image",null),e([d({readOnly:!0})],k.prototype,"imagePointsInView",null),e([d({readOnly:!0})],k.prototype,"imageSize",null),e([d({cast:S})],k.prototype,"imageSource",void 0),e([d({readOnly:!0})],k.prototype,"imageRenderer",null),e([d({type:Number})],k.prototype,"imageRotation",void 0),e([d()],k.prototype,"imageView",null),e([d()],k.prototype,"navigationManager",void 0),e([d()],k.prototype,"navigationViewModel",void 0),e([d({type:Number})],k.prototype,"sharpness",null),e([d()],k.prototype,"state",void 0),k=e([g("esri.widgets.OrientedImageryViewer.components.ImageViewerViewModel")],k);const E=k;export{E 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/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{createTask as o}from"../../../core/asyncUtils.js";import i from"../../../core/Collection.js";import{throwIfAborted as e}from"../../../core/promiseUtils.js";import{whenOnce as
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{createTask as o}from"../../../core/asyncUtils.js";import i from"../../../core/Collection.js";import{throwIfAborted as e}from"../../../core/promiseUtils.js";import{whenOnce as r}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../../Widget.js";import{css as a}from"../css.js";import l from"./NavigationNode.js";import d from"./NavigationUIViewModel.js";import{loadCalciteComponents as p}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as h}from"../../support/jsxFactory.js";let m=class extends c{constructor(t){super(t),this.navigate=null,this.viewModel=new d,this._clickTask=null,this._handleClick=t=>{this._clickTask?.abort(),this._clickTask=o((async o=>{const i=t.target;if(!this.navigate||!this.currentNode)return;await r((()=>"compiled"===this.viewModel.state),{signal:o});const s=i.getAttribute("data-direction");e(o),await this.navigate(this.currentNode,{direction:s,signal:o})}))}}loadDependencies(){return p({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}set currentNode(t){this.viewModel.currentNode=t}get currentNode(){return this.viewModel.currentNode}get nodes(){return this.viewModel.nodes}set nodes(t){this.viewModel.nodes=t}render(){const{currentNode:t}=this;if(!t)return null;const{currentHeading:o}=t,i={"--rotate-transform":` rotate(${-o}deg)`},e=t=>{const i=(t-(o??0)+360)%360;return i<45||i>=315?"towards":i>=135&&i<225?"backwards":i>=45&&i<135?"right":"left"},r=e(0),s=e(90),n=e(180),c=e(270);return h("div",{class:a.navigationUI},h("div",{class:a.navigationDirectionPad,styles:i},t[r]?h("calcite-icon",{class:this.classes(a.navigationDirection,a.navigationTop),"data-direction":r,icon:"chevron-up",key:"chevron-up",onclick:this._handleClick}):null,t[s]?h("calcite-icon",{class:this.classes(a.navigationDirection,a.navigationRight),"data-direction":s,icon:"chevron-right",key:"chevron-right",onclick:this._handleClick}):null,t[n]?h("calcite-icon",{class:this.classes(a.navigationDirection,a.navigationBottom),"data-direction":n,icon:"chevron-down",key:"chevron-down",onclick:this._handleClick}):null,t[c]?h("calcite-icon",{class:this.classes(a.navigationDirection,a.navigationLeft),"data-direction":c,icon:"chevron-left",key:"chevron-left",onclick:this._handleClick}):null))}};t([s()],m.prototype,"currentNode",null),t([s()],m.prototype,"navigate",void 0),t([s({type:i.ofType(l),nonNullable:!0})],m.prototype,"nodes",null),t([s({type:d})],m.prototype,"viewModel",void 0),t([s()],m.prototype,"_clickTask",void 0),m=t([n("esri.widgets.OrientedImageryViewer.components.NavigationUI")],m);const u=m;export{u as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as o}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{createTask as r}from"../../../core/asyncUtils.js";import t from"../../../core/Collection.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{watch as i,syncAndInitial as c}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{updateDirectionalNodesGeneric as a}from"./imageNavigationUtils.js";let m=class extends e{constructor(o){super(o),this._compileTask=null,this.currentNode=null,this.nodes=new t}initialize(){this.addHandles(i((()=>({nodes:this.nodes,currenNode:this.currentNode,length:this.nodes.length,currentHeading:this.currentNode?.currentHeading,currentPitch:this.currentNode?.currentPitch})),(()=>{this._compileTask?.abort(),this._compileTask=r((async o=>{s(o),this.compile()}))}),c))}get state(){const o=this._compileTask;return o?o.finished?o.error?"error":"compiled":"compiling":"ready"}compile(){const{currentNode:o,nodes:e}=this;o&&e.length&&(o.reset(),a(e))}};o([n()],m.prototype,"_compileTask",void 0),o([n()],m.prototype,"currentNode",void 0),o([n()],m.prototype,"nodes",void 0),o([n()],m.prototype,"state",null),m=o([p("esri.widgets.OrientedImageryViewer.components.NavigationUIPanoramicViewModel")],m);const d=m;export{d 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/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import{createTask as o}from"../../../core/asyncUtils.js";import t from"../../../core/Collection.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{watch as i,syncAndInitial as c}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{updateDirectionalNodesWithSameView as n,updateDirectionalNodesGeneric as d}from"./imageNavigationUtils.js";let p=class extends r{constructor(e){super(e),this._compileTask=null,this.currentNode=null,this.nodes=new t,this.preserveAngle=!1,this.cameraHeadingThreshold=0,this.cameraPitchThreshold=0}initialize(){this.addHandles(i((()=>({nodes:this.nodes,currenNode:this.currentNode,length:this.nodes.length,currentHeading:this.currentNode?.currentHeading,currentPitch:this.currentNode?.currentPitch,preserveAngle:this.preserveAngle,cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold})),(()=>{this._compileTask?.abort(),this._compileTask=o((async e=>{s(e),this.compile()}))}),c))}get state(){const e=this._compileTask;return e?e.finished?e.error?"error":"compiled":"compiling":"ready"}compile(){const{currentNode:e,nodes:r}=this;e&&r.length&&(e.reset(),this.preserveAngle?n(r,this.cameraHeadingThreshold,this.cameraPitchThreshold):d(r))}};e([a()],p.prototype,"_compileTask",void 0),e([a()],p.prototype,"currentNode",void 0),e([a()],p.prototype,"nodes",void 0),e([a()],p.prototype,"preserveAngle",void 0),e([a()],p.prototype,"cameraHeadingThreshold",void 0),e([a()],p.prototype,"cameraPitchThreshold",void 0),e([a()],p.prototype,"state",null),p=e([h("esri.widgets.OrientedImageryViewer.components.NavigationUIViewModel")],p);const l=p;export{l 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/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{rad2deg as
|
|
5
|
+
import{rad2deg as n}from"../../../core/mathUtils.js";function t(t,e,o,a){const d=o-t,c=a-e;return n(Math.atan2(c,d))}function e(n){let t=n%360;return t<0&&(t+=360),t}function o(n){n.forEach((t=>{const e={towards:{node:null,distance:1/0},backwards:{node:null,distance:1/0},left:{node:null,distance:1/0},right:{node:null,distance:1/0}};n.forEach((n=>{if(t===n)return;const o=t.getDistanceTo(n),a=t.getDirectionTo(n);o>=e[a].distance||(e[a].node=n,e[a].distance=o)})),t.towards=e.towards.node,t.backwards=e.backwards.node,t.left=e.left.node,t.right=e.right.node}))}function a(n,t,o){n.forEach((a=>{const c={towards:{node:null,distance:1/0},backwards:{node:null,distance:1/0},left:{node:null,distance:1/0},right:{node:null,distance:1/0}};n.forEach((n=>{if(a===n)return;const r=a.getDistanceTo(n),i=a.getDirectionTo(n),s=e(a.heading)-e(n.heading),l=e(a.pitch)-e(n.pitch);r>=c[i].distance||!d(s,l,t,o)||(c[i].node=n,c[i].distance=r)})),a.towards=c.towards.node,a.backwards=c.backwards.node,a.left=c.left.node,a.right=c.right.node}))}function d(n,t,e,o){return Math.abs(n)<=e&&Math.abs(t)<=o}export{t as getRelativeAngleBetweenPoints,e as normalizeDegrees,o as updateDirectionalNodesGeneric,a as updateDirectionalNodesWithSameView};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const e=120,t=[21,36,51,60],T=3.5,a=["FAR_WEST","FAR_NORTH","FAR_EAST","FAR_SOUTH","WEST","NORTH","EAST","SOUTH","NEAR_WEST","NEAR_NORTH","NEAR_EAST","NEAR_SOUTH"],A=23.937554159486076,E=96.06244584051393,R={EAST:[A,A,E,A,60,A],NORTH:[A,E,A,A,A,60],SOUTH:[E,A,E,E,E,60],WEST:[E,E,A,E,60,E]},S=-999,O=100,c=()=>["after-data-capture-complete","deselect-data-capture-features","select-data-capture-features"],r="ImageGeometry",H="OIObjectId";export{r as defaultImageGeometryField,H as defaultOIObjectIDField,T as featureCircleRadius,c as getDelegatedEvents,O as imageGalleryThumbnailSize,S as invalidCameraHeading,e as navigationToolDimensionLength,a as sectorsInOrder,t as sectorsRadii,R as segmentArcs};
|
|
5
|
+
const e=120,t=[21,36,51,60],T=3.5,a=["FAR_WEST","FAR_NORTH","FAR_EAST","FAR_SOUTH","WEST","NORTH","EAST","SOUTH","NEAR_WEST","NEAR_NORTH","NEAR_EAST","NEAR_SOUTH"],A=23.937554159486076,E=96.06244584051393,R={EAST:[A,A,E,A,60,A],NORTH:[A,E,A,A,A,60],SOUTH:[E,A,E,E,E,60],WEST:[E,E,A,E,60,E]},S=-999,O=100,c=()=>["after-data-capture-complete","deselect-data-capture-features","select-data-capture-features"],r="ImageGeometry",H="OIObjectId",N=5,_=5;export{_ as defaultAngleThresholdInDegrees,r as defaultImageGeometryField,H as defaultOIObjectIDField,T as featureCircleRadius,N as featureDistanceFactor,c as getDelegatedEvents,O as imageGalleryThumbnailSize,S as invalidCameraHeading,e as navigationToolDimensionLength,a as sectorsInOrder,t as sectorsRadii,R as segmentArcs};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{createCoveragePolygon as s}from"../../../layers/orientedImagery/core/coverageUtils.js";import{InvalidDirectionError as n,FeatureSectorNotFoundError as a}from"./errors.js";import{queryNextLocationFeatures as l,querySequenceCount as c,queryAfterSequenceField as u,querySequenceFeaturesAroundPoint as d,queryOffsetSequenceFeatures as g}from"./queries.js";let w=class extends t{constructor(e){super(e),this.viewModel=null}get currentNode(){return this.viewModel.currentNode}get layer(){return this.viewModel.layer}get navigationNodes(){return this.viewModel.navigationNodes}async _queryAndHandleFeatureResponse(e,t,o,i,s){const{error:n,nextLocation:a,response:c}=await l(e,t,o,i,s);if(r(s),n)throw n;this.viewModel.selectedPoint=a,await this.viewModel.processFeatureResponse(c,a,{signal:s?.signal,loadBestImage:!1,skipFilter:!0})}async afterNavigate(e,t,r){return await this.viewModel.selectBestFeature(t.id,r),t}async navigate(e,t){let r;if("direction"in t?r=await this.navigateInDirection(e,t):("step"in t||"goTo"in t)&&(r=await this.navigateInSequence(e,t)),!r)throw new Error("No next node found");return await this.afterNavigate(e,r,t)}async navigateBySkippingSteps(e,t){const{step:r}=t,{layer:o}=this,{floorFilterClause:i}=this.viewModel;if(!o)throw new Error("Layer is not defined");const n=e.attributes.sequenceOrder;if(0===await c(o,i,{signal:t.signal})||!n)throw new Error("No sequence found");const{response:a,error:l}=await u(o,n,r,1,i,{signal:t.signal});if(l)throw new Error("Error querying sequence features");const g=a?.features[0];if(!g)throw new Error("No next node found");const{attributes:w}=g,{response:p,error:f,nextLocation:h}=await d(o,s(w).polygon.centroid,i,{signal:t.signal});if(f)throw new Error("Error querying sequence features");const v=[...p.features];v.push(g),p.features=v,this.viewModel.selectedPoint=null;const y=g.attributes.objectId;return await this.viewModel.processFeatureResponse(p,h,{signal:t.signal,loadBestImage:!1,skipFilter:!0}),this.viewModel.selectedPoint=h,this.viewModel.navigationNodes.find((e=>e.id===y))}async navigateInDirection(e,t){const{viewModel:r}=this,{layer:o,floorFilterClause:i}=r,{direction:s,signal:l}=t,c=e?.[s];if(!c)throw new n(s);const u=r.getFeatureSectorById(c.id);if(!u)throw new a(c);const[d,g]=u.split("_"),w=`NEAR_${g}`,f=`FAR_${g}`,h=r.getActiveSectors();return p(u,h.includes(w),h.includes(f),g,w,f)&&await this._queryAndHandleFeatureResponse(o,e,c,i,{signal:l}),c}async navigateInSequence(e,t){return"step"in t?this.navigateBySkippingSteps(e,t):this.navigateTo(t)}async navigateTo(e){const{goTo:t}=e,{layer:r}=this,{floorFilterClause:o}=this.viewModel;if(!r)throw new Error("Layer is not defined");const i="number"==typeof t?t:1,{response:n,error:a}=await g(r,i,1,"end"===t?"DESC":"ASC",o,{signal:e.signal});if(a)throw new Error("Error querying sequence features");const l=n?.features[0];if(!l)throw new Error("No next node found");const{attributes:c}=l,{polygon:u}=s(c),{response:w,error:p,nextLocation:f}=await d(r,u.centroid,o,{signal:e.signal});if(p)throw new Error("Error querying sequence features");const h=[...w.features];h.push(l),w.features=h,this.viewModel.selectedPoint=null;const v=l.attributes.objectId;return await this.viewModel.processFeatureResponse(w,f,{signal:e.signal,loadBestImage:!1,skipFilter:!0}),this.viewModel.selectedPoint=f,this.viewModel.navigationNodes.find((e=>e.id===v))}};function p(e,t,r,o,i,s){return e===s||e===i&&!r||e===o&&!t&&!r}e([o()],w.prototype,"currentNode",null),e([o()],w.prototype,"layer",null),e([o()],w.prototype,"navigationNodes",null),e([o({constructOnly:!0})],w.prototype,"viewModel",void 0),w=e([i("esri.widgets.OrientedImageryViewer.navigation.NavigationManager")],w);export{w as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import t from"./NavigationManager.js";let a=class extends t{async afterNavigate(e,r,t){return await this.viewModel.selectBestFeature(r.id,t),this.viewModel.setCurrentPanoramaView(e.currentHeading-r.heading,e.currentPitch-r.pitch),r}};a=e([r("esri.widgets.OrientedImageryViewer.navigation.NavigationManagerPanoramic")],a);const i=a;export{i as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import r from"../../../core/Error.js";class o extends r{constructor(r){super("InvalidDirectionError",`cannot navigate in direction: ${r}`)}}class e extends r{constructor(r){super("NavigationManagerLoadError",`cannot load navigation manager for mode: ${r}`)}}class t extends r{constructor(r){super("FeatureSectorNotFoundError",`cannot find feature sector of node: ${r}`)}}class n extends r{constructor(){super("NoActiveViewerError","no active viewer")}}class a extends r{constructor(){super("NoImageLoadedError","no image loaded")}}export{t as FeatureSectorNotFoundError,o as InvalidDirectionError,e as NavigationManagerLoadError,n as NoActiveViewerError,a as NoImageLoadedError};
|