@arcgis/core 4.34.0-next.36 → 4.34.0-next.37
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/AttributeBinsGraphic.js +1 -1
- package/Basemap.js +1 -1
- package/Camera.js +1 -1
- package/CameraLayout.js +1 -1
- package/Graphic.js +1 -1
- package/Ground.js +1 -1
- package/Map.js +1 -1
- package/PopupTemplate.js +1 -1
- package/WebDocument2D.js +1 -1
- package/WebScene.js +1 -1
- package/analysis/Analysis.js +1 -1
- package/analysis/DimensionSimpleStyle.js +1 -1
- package/analysis/ElevationProfileLine.js +1 -1
- package/analysis/ElevationProfileLineChartOptions.js +1 -1
- package/analysis/ElevationProfileLineViewOptions.js +1 -1
- package/analysis/ElevationProfileUnits.js +1 -1
- package/analysis/LengthDimension.js +1 -1
- package/analysis/LineOfSightAnalysisObserver.js +1 -1
- package/analysis/LineOfSightAnalysisTarget.js +1 -1
- package/analysis/SlicePlane.js +1 -1
- package/analysis/Viewshed.js +1 -1
- package/analysis/VolumeMeasurement/CutFillOptions.js +1 -1
- package/analysis/support/AnalysisOriginWebScene.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02435c653064f879f547.js +1 -0
- package/assets/esri/core/workers/chunks/040a233ce6fbcc061cdb.js +1 -0
- package/assets/esri/core/workers/chunks/{4930bf8f57f481f3a4a3.js → 053086e0a043b00f1cca.js} +1 -1
- package/assets/esri/core/workers/chunks/05d6ccca0cf38c012873.js +1 -0
- package/assets/esri/core/workers/chunks/06bd2f5358c6b85d5420.js +1 -0
- package/assets/esri/core/workers/chunks/0801f9dde41ec5f36cca.js +1 -0
- package/assets/esri/core/workers/chunks/08b4a4c9f3d6478df40a.js +1 -0
- package/assets/esri/core/workers/chunks/0906f977d50b1c5d6ed5.js +1 -0
- package/assets/esri/core/workers/chunks/170fa807b71babedd185.js +1 -0
- package/assets/esri/core/workers/chunks/183130521210c855c565.js +1 -0
- package/assets/esri/core/workers/chunks/{ce8f0ed9179c0d314df8.js → 1a5ddb6d36249fe09cc8.js} +1 -1
- package/assets/esri/core/workers/chunks/1c87ed3a5960f8f06fc8.js +1 -0
- package/assets/esri/core/workers/chunks/1c8dbdb833a66f7183fc.js +1 -0
- package/assets/esri/core/workers/chunks/2177c0ef06c8e7e3e28e.js +1 -0
- package/assets/esri/core/workers/chunks/{a82d7e2eecfe654a65de.js → 21ea48186d01bf459ef6.js} +1 -1
- package/assets/esri/core/workers/chunks/23e0fd2d921f74834b12.js +1 -0
- package/assets/esri/core/workers/chunks/2b9c403f4b20b8f62804.js +1 -0
- package/assets/esri/core/workers/chunks/2d7bbd001b64138db3c1.js +1 -0
- package/assets/esri/core/workers/chunks/2f52a57e8c05a3ca1de8.js +1 -0
- package/assets/esri/core/workers/chunks/307df66d00ba5f88780d.js +1 -0
- package/assets/esri/core/workers/chunks/33aafaabea07b4f80209.js +1 -0
- package/assets/esri/core/workers/chunks/{209c70ba2925171ef742.js → 36d15d1dd19417b37d2f.js} +1 -1
- package/assets/esri/core/workers/chunks/{d6b2ab614f308db50c4a.js → 47cdd5a6351e0db3b2e9.js} +10 -10
- package/assets/esri/core/workers/chunks/4c7162883b228db563c6.js +1 -0
- package/assets/esri/core/workers/chunks/{236fc659747e812f6424.js → 4c77102f083198ae2a6a.js} +1 -1
- package/assets/esri/core/workers/chunks/4d2dcd667b30a98dd341.js +1 -0
- package/assets/esri/core/workers/chunks/4ff7c8420c77256f595a.js +1 -0
- package/assets/esri/core/workers/chunks/{82c10f2418e2f754388c.js → 50f56b417992eb30243e.js} +1 -1
- package/assets/esri/core/workers/chunks/5228f535719f5fc38b28.js +1 -0
- package/assets/esri/core/workers/chunks/{bd6c6acf23db2a2e8ef8.js → 53e166944a42af027345.js} +1 -1
- package/assets/esri/core/workers/chunks/54a686643e1ec1ea00ac.js +1 -0
- package/assets/esri/core/workers/chunks/568f49f9e50c505b2736.js +1 -0
- package/assets/esri/core/workers/chunks/56aafa6f8862629070d8.js +1 -0
- package/assets/esri/core/workers/chunks/5c5509147bda78ce338a.js +1 -0
- package/assets/esri/core/workers/chunks/{9742804f8ee350bf8052.js → 5c5678b15b59f9964bf0.js} +1 -1
- package/assets/esri/core/workers/chunks/5cdeb6dc72f452d6d1bc.js +1 -0
- package/assets/esri/core/workers/chunks/5d4e74eb4c659e8f42d6.js +1 -0
- package/assets/esri/core/workers/chunks/5fac0b2a5aa33e8a3a84.js +1 -0
- package/assets/esri/core/workers/chunks/64553b5eae4edc7f46dc.js +1 -0
- package/assets/esri/core/workers/chunks/67627b1965b27b2f1857.js +1 -0
- package/assets/esri/core/workers/chunks/{0e7e4426daba4a008849.js → 68edbc3b124eb8e28dd6.js} +1 -1
- package/assets/esri/core/workers/chunks/69dc5a7abc1fda2474ad.js +1 -0
- package/assets/esri/core/workers/chunks/{d6eff6cc30acdca04835.js → 6c167daf115cd6abb3e5.js} +1 -1
- package/assets/esri/core/workers/chunks/6f122e4a2a1f913523b4.js +1 -0
- package/assets/esri/core/workers/chunks/{1dc410bc070cabb7198d.js → 72e0fda211d980572292.js} +1 -1
- package/assets/esri/core/workers/chunks/761dab8780495286ec4e.js +1 -0
- package/assets/esri/core/workers/chunks/7641e24ffa0215d51c34.js +1 -0
- package/assets/esri/core/workers/chunks/7e9d5beca1991c961ed8.js +1 -0
- package/assets/esri/core/workers/chunks/826e4bf6374f324d7f19.js +1 -0
- package/assets/esri/core/workers/chunks/{69d44e08861fb8cdd954.js → 82de1b50ae286f1e6c44.js} +1 -1
- package/assets/esri/core/workers/chunks/860bd6d6f0c74ca301a4.js +1 -0
- package/assets/esri/core/workers/chunks/8e7dced4a8d089185c3a.js +1 -0
- package/assets/esri/core/workers/chunks/{7d25f57299c642e727a6.js → 938baf4f99332dfdf29d.js} +1 -1
- package/assets/esri/core/workers/chunks/9a4d0006c118ae5b45c0.js +1 -0
- package/assets/esri/core/workers/chunks/a1591d7f82e06cab5de4.js +1 -0
- package/assets/esri/core/workers/chunks/a76792c4edd1d688fba2.js +1 -0
- package/assets/esri/core/workers/chunks/ada46055fafb8ae21dbe.js +1 -0
- package/assets/esri/core/workers/chunks/{9f43736d6d80c8e858b2.js → ae667084cb6a08b97c37.js} +1 -1
- package/assets/esri/core/workers/chunks/{0550e775677597f3752c.js → afb51b8562f8cb29b97e.js} +1 -1
- package/assets/esri/core/workers/chunks/{b00ad853fa4826d0ceb3.js → b12c44faa1efa60067b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9fe9792312f0161ef5a.js → b1b6300451cc4ccefd46.js} +1 -1
- package/assets/esri/core/workers/chunks/b2f2c1108fb7cbdd1a68.js +1 -0
- package/assets/esri/core/workers/chunks/{37bfc1a771792b6697fd.js → b3466edccd553ae0a5d0.js} +2 -2
- package/assets/esri/core/workers/chunks/b45dbbeae54cea2bbc10.js +1 -0
- package/assets/esri/core/workers/chunks/b49b73e2d0d643dfa351.js +1 -0
- package/assets/esri/core/workers/chunks/b810e2f87c9c59ae04b1.js +1 -0
- package/assets/esri/core/workers/chunks/{20a96c17d1a117dfdf77.js → b8c1a08020d44ee03a17.js} +1 -1
- package/assets/esri/core/workers/chunks/bb0c5275e51d170ac795.js +1 -0
- package/assets/esri/core/workers/chunks/{7a4730c1e6a5355b7a05.js → bb1213adeb05d89fbfdb.js} +1 -1
- package/assets/esri/core/workers/chunks/bd1ba44362b967977003.js +1 -0
- package/assets/esri/core/workers/chunks/c18ac2018aea6ba97eec.js +1 -0
- package/assets/esri/core/workers/chunks/c3d3e55abf01dae271fb.js +1 -0
- package/assets/esri/core/workers/chunks/c5c9f0c8da5f7bf41728.js +1 -0
- package/assets/esri/core/workers/chunks/c78d98ab82f31ddda362.js +1 -0
- package/assets/esri/core/workers/chunks/ca5f63c0297612059486.js +1 -0
- package/assets/esri/core/workers/chunks/cab294fd04f2a5eda81d.js +1 -0
- package/assets/esri/core/workers/chunks/cca36750c86352c6d1f9.js +1 -0
- package/assets/esri/core/workers/chunks/ccf3f29d0b1bde90c3cf.js +1 -0
- package/assets/esri/core/workers/chunks/cd9e6b86ab0103044370.js +1 -0
- package/assets/esri/core/workers/chunks/ce211163d078d3d742ce.js +1 -0
- package/assets/esri/core/workers/chunks/{0ca8d6516323fc28dd58.js → cf1f8fd1d62be0e02e10.js} +1 -1
- package/assets/esri/core/workers/chunks/d16484b389d56a43d204.js +1 -0
- package/assets/esri/core/workers/chunks/d54e18e0f30734610f35.js +1 -0
- package/assets/esri/core/workers/chunks/d7ec905d87a19a1061e7.js +1 -0
- package/assets/esri/core/workers/chunks/{e9a366c225b0687293e3.js → d80e26a1f4a61b1c4cf9.js} +1 -1
- package/assets/esri/core/workers/chunks/{eec36628e638e244f452.js → ddeaf688d72b2873c4ac.js} +1 -1
- package/assets/esri/core/workers/chunks/debd832b6c2c0b2ea362.js +1 -0
- package/assets/esri/core/workers/chunks/dfa3ad5d750d7b143a06.js +1 -0
- package/assets/esri/core/workers/chunks/dfc5936fbbd26f27a92a.js +1 -0
- package/assets/esri/core/workers/chunks/e01fa6389bd0b1ae51a5.js +1 -0
- package/assets/esri/core/workers/chunks/e4d08a85d158c705aa3d.js +1 -0
- package/assets/esri/core/workers/chunks/e59fdb8f625e9080f097.js +1 -0
- package/assets/esri/core/workers/chunks/ed1cd90e899dc9c15ee3.js +1 -0
- package/assets/esri/core/workers/chunks/ee28cd411a93245fb90c.js +1 -0
- package/assets/esri/core/workers/chunks/f5bb7c90f48cae594bc3.js +1 -0
- package/assets/esri/core/workers/chunks/f79c9b37f2842ed88a9b.js +1 -0
- package/assets/esri/core/workers/chunks/f88fe2e8fbc763bdc940.js +1 -0
- package/assets/esri/core/workers/chunks/faa0cfee8c1de9b5b78c.js +1 -0
- package/assets/esri/core/workers/chunks/fae53d825dd9fef0426c.js +1 -0
- package/chunks/TimeInterval.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/core/Clonable.d.ts +1 -1
- package/core/Clonable.js +1 -1
- package/core/Collection.js +1 -1
- package/core/Evented.d.ts +1 -1
- package/core/Evented.js +1 -1
- package/core/Identifiable.d.ts +1 -1
- package/core/Identifiable.js +1 -1
- package/core/Loadable.d.ts +1 -1
- package/core/Loadable.js +1 -1
- package/core/loadAll.js +1 -1
- package/editing/sharedTemplates/SharedTemplate.js +1 -1
- package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/TemplateDefinitionBase.js +1 -1
- package/effects/FocusArea.js +1 -1
- package/effects/FocusAreaOutline.js +1 -1
- package/effects/FocusAreas.js +1 -1
- package/form/elements/UtilityNetworkAssociationsElement.js +1 -1
- package/form/elements/inputs/attachments/Input.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/support/MeshComponent.js +1 -1
- package/geometry/support/MeshGeoreferencedVertexSpace.js +1 -1
- package/geometry/support/MeshLocalVertexSpace.js +1 -1
- package/geometry/support/MeshMaterial.js +1 -1
- package/geometry/support/MeshTexture.js +1 -1
- package/geometry/support/MeshTextureTransform.js +1 -1
- package/geometry/support/MeshTransform.js +1 -1
- package/geometry/support/MeshVertexAttributes.js +1 -1
- package/geometry/support/meshUtils/Metadata.js +1 -1
- package/graphic/GeoRSSGraphicOrigin.d.ts +4 -0
- package/graphic/GeoRSSGraphicOrigin.js +5 -0
- package/graphic/GraphicOrigin.js +1 -1
- package/graphic/KnowledgeGraphGraphicOrigin.d.ts +4 -0
- package/graphic/KnowledgeGraphGraphicOrigin.js +5 -0
- package/graphic/MapImageGraphicOrigin.d.ts +4 -0
- package/graphic/MapImageGraphicOrigin.js +5 -0
- package/graphic/MapNotesGraphicOrigin.d.ts +4 -0
- package/graphic/MapNotesGraphicOrigin.js +5 -0
- package/graphic/OrientedImageryGraphicOrigin.d.ts +4 -0
- package/graphic/OrientedImageryGraphicOrigin.js +5 -0
- package/graphic/ParquetGraphicOrigin.d.ts +4 -0
- package/graphic/ParquetGraphicOrigin.js +5 -0
- package/graphic/SubtypeGroupGraphicOrigin.d.ts +4 -0
- package/graphic/SubtypeGroupGraphicOrigin.js +5 -0
- package/graphic/TileGraphicOrigin.d.ts +4 -0
- package/graphic/TileGraphicOrigin.js +5 -0
- package/graphic/graphicOrigins.d.ts +8 -0
- package/graphic/graphicOrigins.js +1 -1
- package/{views/3d/terrain/RenderOrder.js → graphic/isGeoRSSGraphicOrigin.js} +1 -0
- package/graphic/isKnowledgeGraphGraphicOrigin.js +5 -0
- package/graphic/isMapImageGraphicOrigin.js +5 -0
- package/graphic/isMapNotesGraphicOrigin.js +5 -0
- package/graphic/isOrientedImageryGraphicOrigin.js +5 -0
- package/graphic/isParquetGraphicOrigin.js +5 -0
- package/graphic/isSubtypeGroupGraphicOrigin.js +5 -0
- package/graphic/isTileGraphicOrigin.js +5 -0
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +228 -0
- package/kernel.js +1 -1
- package/layers/CSVLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/MapNotesLayer.js +1 -1
- package/layers/OGCFeatureLayer.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/WFSLayer.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/buildingSublayers/BuildingSublayer.js +1 -1
- package/layers/graphics/data/FeatureStore.js +1 -1
- package/layers/graphics/sources/CSVSource.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/GeoJSONSource.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/graphics/sources/OGCFeatureSource.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/WFSSource.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/orientedImagery/core/CameraOrientationHPR.js +1 -1
- package/layers/orientedImagery/core/CameraOrientationLTP.js +1 -1
- package/layers/orientedImagery/core/CameraOrientationOPK.js +1 -1
- package/layers/orientedImagery/core/CameraOrientationYPR.js +1 -1
- package/layers/orientedImagery/core/ElevationSourceDefinitions.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/support/BuildingSummaryStatistics.js +1 -1
- package/layers/support/ControlPointsGeoreference.js +1 -1
- package/layers/support/DisplayFilter.js +1 -1
- package/layers/support/DisplayFilterInfo.js +1 -1
- package/layers/support/EditFieldsInfo.js +1 -1
- package/layers/support/ExpressionInfo.js +1 -1
- package/layers/support/FeatureIndex.js +1 -1
- package/layers/support/FeatureTemplate.js +1 -1
- package/layers/support/FeatureType.js +1 -1
- package/layers/support/GeometryFieldsInfo.js +1 -1
- package/layers/support/GeoreferenceBase.js +1 -1
- package/layers/support/KMLSublayer.js +1 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/LocalMediaElementSource.js +1 -1
- package/layers/support/MediaElementBase.js +1 -1
- package/layers/support/PlaybackInfo.js +1 -1
- package/layers/support/Relationship.js +1 -1
- package/layers/support/StreamConnection.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/Subtype.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/TelemetryData.js +1 -1
- package/layers/support/TelemetryDisplay.js +1 -1
- package/layers/support/TimeInfo.js +1 -1
- package/layers/support/TrackInfo.js +1 -1
- package/layers/support/TrackPartInfo.js +1 -1
- package/layers/support/VideoFrame.js +1 -1
- package/layers/support/VideoTimeExtent.js +1 -1
- package/layers/support/WMSSublayer.js +1 -1
- package/layers/voxel/VoxelColorStop.js +1 -1
- package/layers/voxel/VoxelDynamicSection.js +1 -1
- package/layers/voxel/VoxelIsosurface.js +1 -1
- package/layers/voxel/VoxelOpacityStop.js +1 -1
- package/layers/voxel/VoxelRangeFilter.js +1 -1
- package/layers/voxel/VoxelSection.js +1 -1
- package/layers/voxel/VoxelSlice.js +1 -1
- package/layers/voxel/VoxelTransferFunctionStyle.js +1 -1
- package/layers/voxel/VoxelUniqueValue.js +1 -1
- package/linkChart/ChronologicalLayoutSettings.js +1 -1
- package/linkChart/LayoutSettings.js +1 -1
- package/linkChart/LinkChartProperties.js +1 -1
- package/linkChart/NonspatialDataDisplay.js +1 -1
- package/linkChart/OrganicLayoutSettings.js +1 -1
- package/networks/Network.js +1 -1
- package/networks/RulesTable.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/NetworkSystemLayers.js +1 -1
- package/networks/support/UtilityNetworkLookupHelper.js +1 -1
- package/package.json +1 -1
- package/popup/content/AttachmentsContent.js +1 -1
- package/popup/content/RelationshipContent.js +1 -1
- package/popup/content/UtilityNetworkAssociationsContent.js +1 -1
- package/popup/support/AttachmentsOrderByInfo.js +1 -1
- package/popup/support/FieldInfoFormat.js +1 -1
- package/popup/support/UtilityNetworkAssociationType.js +1 -1
- package/portal/Portal.js +1 -1
- package/portal/PortalItem.js +1 -1
- package/renderers/PieChartRenderer.js +1 -1
- package/renderers/support/HeatmapLegendOptions.js +1 -1
- package/renderers/support/OthersCategory.js +1 -1
- package/renderers/support/RasterPresetRenderer.js +1 -1
- package/renderers/support/RendererLegendOptions.js +1 -1
- package/renderers/support/UniqueValue.js +1 -1
- package/renderers/support/UniqueValueClass.js +1 -1
- package/renderers/support/UniqueValueGroup.js +1 -1
- package/renderers/visualVariables/support/VisualVariableLegendOptions.js +1 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/rest/support/AttributeBinsFeatureSet.js +1 -1
- package/rest/support/AttributeBinsGrouping.js +1 -1
- package/rest/support/AttributeBinsQuery.js +1 -1
- package/rest/support/BinParametersBase.js +1 -1
- package/rest/support/ClosestFacilityParameters.js +1 -1
- package/rest/support/DataLayer.js +1 -1
- package/rest/support/DateBinTimeInterval.js +1 -1
- package/rest/support/DirectionLine.js +1 -1
- package/rest/support/DirectionPoint.js +1 -1
- package/rest/support/FindImagesParameters.js +1 -1
- package/rest/support/FullTextSearch.js +1 -1
- package/rest/support/ImageBoundaryParameters.js +1 -1
- package/rest/support/ImageGPSInfoParameters.js +1 -1
- package/rest/support/ImageToMapMultirayParameters.js +1 -1
- package/rest/support/ImageToMapParameters.js +1 -1
- package/rest/support/ImageUrlParameters.js +1 -1
- package/rest/support/ImageVolumeParameters.js +1 -1
- package/rest/support/MapToImageParameters.js +1 -1
- package/rest/support/NetworkUrl.js +1 -1
- package/rest/support/PointBarrier.js +1 -1
- package/rest/support/PolygonBarrier.js +1 -1
- package/rest/support/PolylineBarrier.js +1 -1
- package/rest/support/RouteInfo.js +1 -1
- package/rest/support/RouteParameters.js +1 -1
- package/rest/support/ServiceAreaParameters.js +1 -1
- package/rest/support/Stop.js +1 -1
- package/rest/support/TravelMode.js +1 -1
- package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/LayerAdapter.js +1 -1
- package/support/actions/ActionBase.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/LineStyleMarker3D.js +1 -1
- package/symbols/PathSymbol3DLayer.js +1 -1
- package/symbols/support/ElevationInfo.js +1 -1
- package/symbols/support/Symbol3DTextBackground.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/tables/elements/AttributeTableAttachmentElement.js +1 -1
- package/tables/elements/AttributeTableFieldElement.js +1 -1
- package/tables/elements/AttributeTableGroupElement.js +1 -1
- package/tables/elements/AttributeTableRelationshipElement.js +1 -1
- package/tables/support/FieldOrder.js +1 -1
- package/undoredo/support/Services.js +1 -1
- package/versionManagement/VersionManagementService.js +1 -1
- package/versionManagement/VersioningState.js +1 -1
- package/views/2d/constraints/GeometryConstraint.js +1 -1
- package/views/2d/constraints/RotationConstraint.js +1 -1
- package/views/2d/constraints/ZoomConstraint.js +1 -1
- package/views/2d/engine/DisplayObject.js +1 -1
- package/views/2d/engine/ManagedCanvas.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js +1 -1
- package/views/2d/engine/webgl/Profiler.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureSourceEventLog.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/processor/AAggregateStrategy.js +1 -1
- package/views/2d/layers/features/schema/processor/LabelMatcherSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/SubtypeProcessorSchema.js +1 -1
- package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/features/support/TileStore.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/layers/support/RouteLayerInteraction.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/constraints/AltitudeConstraint.js +1 -1
- package/views/3d/constraints/ClipDistanceConstraint.js +1 -1
- package/views/3d/constraints/Constraints.js +1 -1
- package/views/3d/constraints/TiltConstraint.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/SunLighting.js +1 -1
- package/views/3d/environment/VirtualLighting.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
- package/views/3d/interactive/editingTools/ManipulatedObject3DMediaElement.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
- package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
- package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/layers/BuildingSublayerView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/GraphicsView3DDummyLayer.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/graphics/GraphicState.js +1 -1
- package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
- package/views/3d/layers/i3s/I3SGraphicsMap.js +1 -1
- package/views/3d/layers/i3s/I3SQueryFeatureStore.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/support/CombinedElevationProvider.js +1 -1
- package/views/3d/support/EventedSet.js +1 -1
- package/views/3d/support/GraphicsMap.js +1 -1
- package/views/3d/support/LimitGraphicsMap.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/ContentGeometryUpdates.js +1 -1
- package/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
- package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/Theme.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/analysis/ElevationProfileResult.js +1 -1
- package/views/draw/DrawAction.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/draw/DrawManipulator.js +1 -1
- package/views/draw/DrawOperation.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/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/interactive/Tooltip.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/support/GroundViewElevationSampler.js +1 -1
- package/views/ui/UI.js +1 -1
- package/webdoc/GeotriggersInfo.js +1 -1
- package/webdoc/IPSInfo.js +1 -1
- package/webdoc/geotriggersInfo/DeviceLocationFeed.js +1 -1
- package/webdoc/geotriggersInfo/ExpressionInfo.js +1 -1
- package/webdoc/geotriggersInfo/FeatureFenceParameters.js +1 -1
- package/webdoc/geotriggersInfo/FeatureFilter.js +1 -1
- package/webdoc/geotriggersInfo/FeatureLayerSource.js +1 -1
- package/webdoc/geotriggersInfo/Geotrigger.js +1 -1
- package/webdoc/geotriggersInfo/GeotriggerNotificationOptions.js +1 -1
- package/webdoc/ips/AppleIPSProperties.js +1 -1
- package/webdoc/ips/Configuration.js +1 -1
- package/webdoc/ips/GNSSProperties.js +1 -1
- package/webdoc/ips/PathSnappingProperties.js +1 -1
- package/webdoc/ips/PositioningService.js +1 -1
- package/webdoc/ips/SmoothingProperties.js +1 -1
- package/webmap/Bookmark.js +1 -1
- package/webmap/InitialViewProperties.js +1 -1
- package/webscene/InitialViewProperties.js +1 -1
- package/webscene/Presentation.js +1 -1
- package/webscene/Slide.js +1 -1
- package/webscene/SlideLegendInfo.js +1 -1
- package/webscene/support/Description.js +1 -1
- package/webscene/support/FeatureReference.js +1 -1
- package/webscene/support/FeatureReferenceId.js +1 -1
- package/webscene/support/LayerReference.js +1 -1
- package/webscene/support/SlideElements.js +1 -1
- package/webscene/support/SlideEnvironment.js +1 -1
- package/webscene/support/SlideGround.js +1 -1
- package/webscene/support/SlidePopupInfo.js +1 -1
- package/webscene/support/SlideVisibleLayer.js +1 -1
- package/webscene/support/Title.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
- package/widgets/BasemapGallery/support/PortalBasemapsSource.js +1 -1
- package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/templates/ElementTemplateBase.js +1 -1
- package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileInteraction.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLine.js +1 -1
- package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/FeatureTemplates/TemplateItemGroup.js +1 -1
- package/widgets/Home/HomeViewModel.js +1 -1
- package/widgets/LayerList/LayerListViewModel.js +1 -1
- package/widgets/LayerList/ListItem.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationAction.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicZoomConditions.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Search/SearchSource.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/OperationHandle.js +1 -1
- package/widgets/TableList/ListItem.js +1 -1
- package/widgets/TableList/ListItemPanel.js +1 -1
- package/widgets/TableList/TableListViewModel.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/ValuePicker/ValuePickerViewModel.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/support/AnchorElementViewModel.js +1 -1
- package/widgets/support/GeolocationPositioning.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/038bd2fec9a91b5a949d.js +0 -1
- package/assets/esri/core/workers/chunks/093de3942e1ead231990.js +0 -1
- package/assets/esri/core/workers/chunks/0997e09fe5b0aba1f804.js +0 -1
- package/assets/esri/core/workers/chunks/0c0080b652cf8afc4e6b.js +0 -1
- package/assets/esri/core/workers/chunks/0f6207d84d15484a3181.js +0 -1
- package/assets/esri/core/workers/chunks/125fdea50620d4db2678.js +0 -1
- package/assets/esri/core/workers/chunks/152128775b4740e779ab.js +0 -1
- package/assets/esri/core/workers/chunks/173c5b8fa1ac7aa6e072.js +0 -1
- package/assets/esri/core/workers/chunks/1e58b1e191498417c21d.js +0 -1
- package/assets/esri/core/workers/chunks/2032b649350a75ba294f.js +0 -1
- package/assets/esri/core/workers/chunks/2105d2cc75e75bf8f1c0.js +0 -1
- package/assets/esri/core/workers/chunks/21246dfe99a4c5906f71.js +0 -1
- package/assets/esri/core/workers/chunks/221748295a5ec633177e.js +0 -1
- package/assets/esri/core/workers/chunks/2a695b50a384c45ace9a.js +0 -1
- package/assets/esri/core/workers/chunks/2ad63b8d6986ac21c398.js +0 -1
- package/assets/esri/core/workers/chunks/2c29f8a708a03cb703ab.js +0 -1
- package/assets/esri/core/workers/chunks/2df9bfddc737d89c94b8.js +0 -1
- package/assets/esri/core/workers/chunks/34ddb8da5c5c8533bd71.js +0 -1
- package/assets/esri/core/workers/chunks/40b0c5368b8322498189.js +0 -1
- package/assets/esri/core/workers/chunks/427deb82fae9c500b375.js +0 -1
- package/assets/esri/core/workers/chunks/4433c195c62a59739c06.js +0 -1
- package/assets/esri/core/workers/chunks/4ac6bf9ff1cfbde87c7b.js +0 -1
- package/assets/esri/core/workers/chunks/4b9003ddfe61dc3729f4.js +0 -1
- package/assets/esri/core/workers/chunks/4bb6148df66e62a5fcf0.js +0 -1
- package/assets/esri/core/workers/chunks/4fb13252a985131d3dae.js +0 -1
- package/assets/esri/core/workers/chunks/528212fb0474bdb2ec92.js +0 -1
- package/assets/esri/core/workers/chunks/5dba8c0c957becedf7f7.js +0 -1
- package/assets/esri/core/workers/chunks/5f995450f720483fcffa.js +0 -1
- package/assets/esri/core/workers/chunks/61aed9a292c981921869.js +0 -1
- package/assets/esri/core/workers/chunks/6aeff5908c41600a5dfc.js +0 -1
- package/assets/esri/core/workers/chunks/6c72e2c09ed62cb2fd79.js +0 -1
- package/assets/esri/core/workers/chunks/7099ff8dc699fedea931.js +0 -1
- package/assets/esri/core/workers/chunks/752eabfbed7b8b65cf3f.js +0 -1
- package/assets/esri/core/workers/chunks/7848ea5ca13ec350779a.js +0 -1
- package/assets/esri/core/workers/chunks/7a4ec66a577f7f7996c5.js +0 -1
- package/assets/esri/core/workers/chunks/81be8d23b8dfa4937eaf.js +0 -1
- package/assets/esri/core/workers/chunks/831d58235b8b9eb4cdc8.js +0 -1
- package/assets/esri/core/workers/chunks/90a0c1c5c851cc9b6d6d.js +0 -1
- package/assets/esri/core/workers/chunks/969a9edba4be8dcbcedd.js +0 -1
- package/assets/esri/core/workers/chunks/9a54c96b48e94d816881.js +0 -1
- package/assets/esri/core/workers/chunks/a53f2529b7067c28f320.js +0 -1
- package/assets/esri/core/workers/chunks/a6b6915b7321f77f765f.js +0 -1
- package/assets/esri/core/workers/chunks/aa12ba96fb8c91105473.js +0 -1
- package/assets/esri/core/workers/chunks/ab73df4f809430db6249.js +0 -1
- package/assets/esri/core/workers/chunks/acb95ae6203f708d71b4.js +0 -1
- package/assets/esri/core/workers/chunks/ae7f1499912c86973921.js +0 -1
- package/assets/esri/core/workers/chunks/b28855db6a30d4d4f348.js +0 -1
- package/assets/esri/core/workers/chunks/b4bbd38df56e57783cc0.js +0 -1
- package/assets/esri/core/workers/chunks/b98a049561b12a0555b7.js +0 -1
- package/assets/esri/core/workers/chunks/c0718a0461839be41a2a.js +0 -1
- package/assets/esri/core/workers/chunks/c0aee315b6218d6456cd.js +0 -1
- package/assets/esri/core/workers/chunks/c0ec1600a86bb9a848d4.js +0 -1
- package/assets/esri/core/workers/chunks/c9b11c7170c99f9e0e93.js +0 -1
- package/assets/esri/core/workers/chunks/ca88859fc69fcb4568c0.js +0 -1
- package/assets/esri/core/workers/chunks/cc3ca1729af33688c1e3.js +0 -1
- package/assets/esri/core/workers/chunks/cd150c7e1516134c7437.js +0 -1
- package/assets/esri/core/workers/chunks/cde79c3644166d4798a8.js +0 -1
- package/assets/esri/core/workers/chunks/d092a4b8fe3d37a6333d.js +0 -1
- package/assets/esri/core/workers/chunks/d4cadde4a9cbfe2c51d8.js +0 -1
- package/assets/esri/core/workers/chunks/d6a188a7d55db69ba30b.js +0 -1
- package/assets/esri/core/workers/chunks/d7172dc531b4548a8c60.js +0 -1
- package/assets/esri/core/workers/chunks/d88935ae5669d14c5b29.js +0 -1
- package/assets/esri/core/workers/chunks/dab82564928265b9f22d.js +0 -1
- package/assets/esri/core/workers/chunks/e82b1f91465d569012c4.js +0 -1
- package/assets/esri/core/workers/chunks/e892ed8b0b990d7eba28.js +0 -1
- package/assets/esri/core/workers/chunks/e897c5ce83db8a71b0a2.js +0 -1
- package/assets/esri/core/workers/chunks/efec0f496491a0647051.js +0 -1
- package/assets/esri/core/workers/chunks/f01a939af200616eb169.js +0 -1
- package/assets/esri/core/workers/chunks/f19426eb53d8430ded51.js +0 -1
- package/assets/esri/core/workers/chunks/f255b2232f6f049d462d.js +0 -1
- package/assets/esri/core/workers/chunks/f3358b19af0f03f16543.js +0 -1
- package/assets/esri/core/workers/chunks/f4c38a9c01c29b5a6244.js +0 -1
- package/assets/esri/core/workers/chunks/f6c1854f36b029fa6c37.js +0 -1
- package/assets/esri/core/workers/chunks/fa01d418237d7fa67efc.js +0 -1
- package/assets/esri/core/workers/chunks/ff736cb5a9fd18368244.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e
|
|
5
|
+
import{__decorate as t}from"tslib";import{EventedAccessor as e}from"../../core/Evented.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{directionalPadMoveOnceDuration as n}from"./constants.js";import{css as s}from"./css.js";import{angleToUnitVector as r,toUnitVector as v,vectorToClosestAngle as m}from"./utils.js";import a from"../support/GoTo.js";let d=class extends(a(e)){constructor(t){super(t),this._initialAngle=void 0,this._movementVector=void 0,this._widgetCenter=void 0,this._anyAngleMovementEnabled=!1,this._movementTimeout=void 0,this._disabled=!1,this._moveOnceDuration=n,this.angle=void 0,this.speed=1,this.view=null,this.beginFollowingPointer=(t,e)=>{if(this.disabled)return;this._widgetCenter=e;const o=this._pointerLocationToVector(t);if(void 0===o)return;const i=this._resolveClosestAngle(t,o);void 0!==i&&(this._emitMove(r(i)),this.angle=i,this._initialAngle=i,this._setMovementTimeout(()=>{void 0===this._widgetCenter&&this._stopMovement()}),document.addEventListener("pointermove",this._onPointerMove,{passive:!0}),document.addEventListener("pointerup",this._onPointerUp,{passive:!0,once:!0}))},this.moveOnce=t=>{const e=r(t);this._emitMove(e),this._setMovementTimeout(this._stopMovement)},this._pointerLocationToVector=t=>{if(void 0===this._widgetCenter)return;const{x:e,y:o}=v(this._widgetCenter,t);return{x:e,y:-o}},this._resolveClosestAngle=(t,e)=>{const o=t.target,i=o?.getAttribute?.("data-angle"),n=o?.classList?.contains(s.compassButton);if(n)return;const r=Number.parseInt(i??"",10);return Number.isNaN(r)?m(e):r},this._onPointerMove=t=>{if(0===t.buttons)return void this._stopMovement();const e=this._pointerLocationToVector(t);if(void 0===e)return;this._setMovementTimeout(void 0);const o=this._resolveClosestAngle(t,e);if(void 0===o)return void this._emitStop();const i=r(o),n=null!=this._initialAngle&&this._initialAngle!==o;this._anyAngleMovementEnabled||=n;const s=this._anyAngleMovementEnabled?e:i;(s.x!==this._movementVector?.x||s.y!==this._movementVector?.y)&&(this.angle=o,this._emitMove(s))},this._onPointerUp=()=>{void 0===this._movementTimeout?this._stopMovement():this._widgetCenter=void 0},this._stopMovement=()=>{this._emitStop(),this._widgetCenter=void 0,this._initialAngle=void 0,this._anyAngleMovementEnabled=!1,document.removeEventListener("pointermove",this._onPointerMove),document.removeEventListener("pointerup",this._stopMovement),this._setMovementTimeout(void 0)},this.on("move-start",()=>this.view?.mapViewNavigation.begin()),this.on("move-direction-change",({vector:{x:t,y:e}})=>this.view?.mapViewNavigation.continuousPanVector({x:t*this.speed,y:e*this.speed})),this.on("move-stop",()=>this.view?.mapViewNavigation.stop())}destroy(){this._stopMovement()}get disabled(){const{view:t,_disabled:e,supported:o}=this;return!1===t?.ready||e||!o}set disabled(t){this._disabled=t}get rotation(){return this.view?.rotation??this._get("rotation")??0}set rotation(t){this.view?this.view.constraints.rotationEnabled&&this.callGoTo({target:{rotation:t},options:{animate:0===t&&void 0}}):this._set("rotation",t)}get supported(){return null==this.view||"2d"===this.view.type}get state(){const{disabled:t,angle:e}=this;return t?"disabled":null!=e?"moving":"ready"}_setMovementTimeout(t){clearTimeout(this._movementTimeout),this._movementTimeout=void 0===t?void 0:setTimeout(()=>{this._movementTimeout=void 0,t()},this._moveOnceDuration)}_emitMove(t){null==this._movementVector&&this._emitMoveStartEvent({vector:t});const e=this._movementVector;this._movementVector=t,this._emitMoveDirectionChangeEvent({vector:t,oldVector:e})}_emitStop(){this.angle=void 0,void 0!==this._movementVector&&(this._emitMoveStopEvent({oldVector:this._movementVector}),this._movementVector=void 0)}_emitMoveStartEvent(t){this.emit("move-start",{...t,type:"move-start"})}_emitMoveDirectionChangeEvent(t){this.emit("move-direction-change",{...t,type:"move-direction-change"})}_emitMoveStopEvent(t){this.emit("move-stop",{...t,type:"move-stop"})}};t([o()],d.prototype,"_initialAngle",void 0),t([o()],d.prototype,"_movementVector",void 0),t([o()],d.prototype,"_widgetCenter",void 0),t([o()],d.prototype,"_anyAngleMovementEnabled",void 0),t([o()],d.prototype,"_movementTimeout",void 0),t([o()],d.prototype,"_disabled",void 0),t([o()],d.prototype,"_moveOnceDuration",void 0),t([o()],d.prototype,"disabled",null),t([o()],d.prototype,"angle",void 0),t([o({type:Number,range:{min:0,max:100}})],d.prototype,"speed",void 0),t([o()],d.prototype,"rotation",null),t([o()],d.prototype,"supported",null),t([o({readOnly:!0})],d.prototype,"state",null),t([o()],d.prototype,"view",void 0),d=t([i("esri.widgets.DirectionalPad.DirectionalPadViewModel")],d);const h=d;export{h 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import r from"../../core/Error.js";import i from"../../core/Evented.js";import o from"../../core/Logger.js";import{debounce as s,isAbortError as a}from"../../core/promiseUtils.js";import{watch as l,on as n,syncAndInitial as u,when as d}from"../../core/reactiveUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{resolveTimeZone as p,formatTimestamp as m,convertDateFormatToIntlOptions as v}from"../../intl/date.js";import{getLocale as y,getLocaleParts as f}from"../../intl/locale.js";import{fetchServiceDescription as g}from"../../rest/networkService.js";import w from"../../rest/support/RouteParameters.js";import _ from"../../rest/support/Stop.js";import T from"../../rest/support/TravelMode.js";import{defaultDatePattern as D,defaultTimePattern as S}from"../../support/dateUtils.js";import{system as C}from"../../time/constants.js";import{shortTimeZoneName as b}from"../../time/timeZoneUtils.js";import{DepartureTimeOption as M}from"./support/directionsUtils.js";import{getDefaultLocaleOptions as A}from"../support/dateUtils.js";import I from"../support/GoTo.js";import{DateTime as L,FixedOffsetZone as j,IANAZone as R}from"luxon";function E(e){return e.map(e=>({locale:e,parts:f(e)})).filter(({parts:e})=>!!e)}function P(e,t){return e.find(({parts:e})=>O(e.language,t.language)&&e.region===t.region)?.locale??e.find(({parts:e})=>O(e.language,t.language))?.locale}function U(e){return"esri.Graphic"===e?.declaredClass}function N(e){return"no"===e||"nb"===e}function O(e,t){return e===t||N(e)&&N(t)}function V(e){return"esri.rest.support.Stop"===e?.declaredClass}let k=class extends(I(i.EventedAccessor)){constructor(e){super(e),this._debouncedSolveHandler=s(async e=>{switch(e.type){case"create":if("complete"!==e.state)return;break;case"delete":break;case"update":switch(e.state){case"start":return void(this._networkFeatureUpdated=!1);case"active":return void(this._networkFeatureUpdated=!0);case"complete":if(!this._networkFeatureUpdated)return}}if(!((this.layer?.stops.filter(({geometry:e})=>!!e).length??0)<2)&&this.autoSolve)try{await this.getDirections({zoomToSolvedRoute:!1})}catch(t){o.getLogger(this).error(t)}}),this._highlight=null,this._loadController=null,this._loadPromise=null,this._networkFeatureUpdated=!1,this._layerView=null,this._routeController=null,this._serviceDescriptionStatus=3,this.apiKey=void 0,this.autoSolve=!0,this.defaultTravelMode=null,this.departureIsoDate=void 0,this.departureIsoTime=void 0,this.departureOption=M.NOW,this.departureTime="now",this.lastError=null,this.lastRoute=null,this.layer=null,this.maxStops=50,this.routeParameters=new w({directionsLengthUnits:"kilometers",findBestSequence:!1,preserveFirstStop:!0,preserveLastStop:!0,returnZ:!0,useTimeWindows:!1}),this.serviceDescription=null,this.view=null}initialize(){this.addHandles([l(()=>this.layer,e=>{if(null!=e){for(;e.stops.length<2;)e.stops.add(new _);this._set("defaultTravelMode",null),this.addHandles(d(()=>this.serviceDescription?e.routeInfo?.analysisSettings?.travelMode:null,e=>{this.defaultTravelMode=this._resolveDefaultTravelMode(e)},{once:!0}))}},u),l(()=>[this.layer,this.view],async()=>{this._layerView=await this._getRouteLayerView()},u),n(()=>this._layerView,["create","delete","update"],e=>{this._debouncedSolveHandler(e).catch(e=>{if(!a(e))throw e})})]);const e=p(this.view?.timeZone??C),t=L.fromMillis(Date.now());this.departureIsoDate=t.toFormat(D,A(e)),this.departureIsoTime=t.toFormat(S,A(e))}get _directionsLanguage(){const e=this.serviceDescription?.directionsSupportedLanguages;if(!e)return;const t=this.routeParameters.directionsLanguage??y(),r=f(t),i=r?.language,o=r?.region;if(!i)return;return P(E(e),{language:i,region:o})}get formattedEta(){const e=this.layer?.routeInfo?.endTime,t=this.layer?.routeInfo?.endTimeOffset;if(this.departureOption===M.UNSPECIFIED||!e||!t)return null;const r=L.fromJSDate(e,{zone:j.instance(t)}),i=L.fromJSDate(e,{zone:R.create(p(this.view?.timeZone??C))}),o=L.fromJSDate(new Date,{zone:R.create(p(this.view?.timeZone??C))}),s=o.year===i.year&&o.month===i.month&&o.day===i.day,a=i.offset===t?void 0:b,l=s?void 0:v("short-date"),n=v("short-time");return m(r.toISO(),{...l,...n,timeZoneName:a})}get impedanceAttribute(){const e=this.routeParameters.travelMode?.impedanceAttributeName??this.routeParameters.impedanceAttribute??this.serviceDescription?.impedance??null;return this.getCostAttribute(e)}get selectedNetworkFeatures(){return this._layerView?.selectedNetworkFeatures??null}get selectedTravelMode(){return this.serviceDescription?this.defaultTravelMode??this.serviceDescription.defaultTravelMode??this.serviceDescription.supportedTravelModes?.[0]??null:null}set selectedTravelMode(e){this._override("selectedTravelMode",e)}get state(){if(this._routeController)return"routing";if(this.lastError)return"error";switch(this._serviceDescriptionStatus){case 4:return"unauthenticated";case 3:return"disabled";case 0:return"initializing";case 2:return"error";default:return"ready"}}get timeAttribute(){const e=this.routeParameters.travelMode?.timeAttributeName??this.routeParameters.directionsTimeAttribute??this.serviceDescription?.directionsTimeAttribute??null;return this.getCostAttribute(e)}get travelModes(){const e=this.serviceDescription?.supportedTravelModes?.slice()??[];return null==this.defaultTravelMode||e.includes(this.defaultTravelMode)||e.unshift(this.defaultTravelMode),e}async load(){if(this._loadPromise)return this._loadPromise;this._loadPromise=this._load(),await this._loadPromise,this._loadPromise=null}async highlight(e){if(this.clearHighlights(),!this.view||!this.layer)return;const t=await this.view.whenLayerView(this.layer);this._highlight=t.highlight(e)}clearHighlights(){null!=this._highlight&&(this._highlight.remove(),this._highlight=null)}centerAt(e){if(!this.view)return;const t=V(e)||U(e)?e.geometry:e;t&&this.callGoTo({target:t})}clearResults(){this._set("lastRoute",null),this.layer?.removeResult()}async create(e){await(this._layerView?.create(e))}async getDirections(e={zoomToSolvedRoute:!0}){const{apiKey:t,layer:i,state:o}=this;if(!i)throw new r("directions-view-model:missing-route-layer","A route layer must be associated with the view model.");if("unauthenticated"===o||"initializing"===o||"disabled"===o||2===this._serviceDescriptionStatus)throw new r("directions-view-model:not-loaded","Cannot get directions until view model loads.");null!=this._routeController&&(this._routeController.abort(),this._routeController=null);const{startTime:s,startTimeIsUTC:l}=this._getStartTimeParameters(),n=this.view?.spatialReference??null,u=this.routeParameters.clone();u.set({apiKey:t,directionsLanguage:this._directionsLanguage,outSpatialReference:n,startTime:s,startTimeIsUTC:l}),this.selectedTravelMode&&(u.travelMode=this.selectedTravelMode);if(i.stops.filter(({geometry:e})=>null!=e).length<2){const e=new r("directions-view-model:not-enough-stops","Not enough stops for routing");throw this._set("lastError",e),e}i.stops.forEach(e=>e.sequence=null),this._routeController=new AbortController;const{signal:d}=this._routeController;let h=null;try{h=await i.solve(u,{signal:d})}catch(c){if(!a(c)){const e=new r("directions-view-model:unable-to-route","Unable to route to these addresses",{error:c});throw this._set("lastError",e),this.clearResults(),e}}finally{this._routeController=null}this._set("lastError",null);for(const r of h.stops)null==r.geometry&&(r.name=null);return i.update(h),this._set("lastRoute",h),e.zoomToSolvedRoute&&this.zoomToRoute(),h}getCostAttribute(e){return(this.serviceDescription?.networkDataset?.networkAttributes??[]).find(({name:t,usageType:r})=>t===e&&"cost"===r)??null}remove(e){this._layerView?.remove(e)}reset(){this.clearHighlights(),this.clearResults(),null!=this.layer&&(this.layer.removeAll(),this.layer.stops=new t([new _,new _]))}save(){if(!this.layer)throw new r("directions-view-model:missing-layer","save() requires a layer");return this.layer.save()}saveAs(e,t={}){if(!this.layer)throw new r("directions-view-model:missing-layer","saveAs() requires a layer");return this.layer.saveAs(e,t)}async startEditing(){this._layerView&&(this._layerView.interactive=!0)}async stopEditing(){this._layerView&&(this._layerView.interactive=!1)}updateDepartureTime(){if(this.departureIsoDate&&this.departureIsoTime)switch(this.departureOption){case M.NOW:this.departureTime="now";break;case M.DEPART_AT:{const e=L.fromISO(`${this.departureIsoDate}T${this.departureIsoTime}`,{zone:j.instance(0)});this.departureTime=e.toJSDate();break}case M.UNSPECIFIED:this.departureTime=null}}zoomToRoute(){const{view:e,layer:t}=this,r=t?.routeInfo?.geometry?.extent;if(!e||!r)return;const i=r.width>r.height,o=r.clone().expand(i?2:1);this.callGoTo({target:o})}async _getRouteLayerView(){return this.view&&this.layer?this.view.whenLayerView(this.layer):null}_getStartTimeParameters(){if("now"===this.departureTime){return{startTime:this.serviceDescription?.capabilities.supportsNow??!1?"now":new Date,startTimeIsUTC:!0}}return null==this.departureTime?{startTime:void 0,startTimeIsUTC:void 0}:{startTime:this.departureTime,startTimeIsUTC:!1}}async _load(){if(null==this.layer)return;null!=this._loadController&&(this._loadController.abort(),this._loadController=null),this._loadController=new AbortController;const{signal:e}=this._loadController;try{this._serviceDescriptionStatus=0;const t=await g(this.layer.url,this.apiKey,{signal:e});this._set("serviceDescription",t),this._serviceDescriptionStatus=1}catch(t){if(a(t))return void(this._serviceDescriptionStatus=3);if("identity-manager:user-aborted"===t.name)return void(this._serviceDescriptionStatus=4);const e=new r("directions-view-model:service-metadata-unavailable","Cannot load route service metadata",{error:t});throw this._serviceDescriptionStatus=2,this._set("lastError",e),e}finally{this._loadController=null}}_resolveDefaultTravelMode(e){if(null==this.serviceDescription)return null;const{defaultTravelMode:t,supportedTravelModes:r}=this.serviceDescription,i=/^<(?<name>.*)>$/i.exec(e.name)?.groups?.name;if(i){const o=r?.find(({name:e})=>e.toLocaleLowerCase()===i.trim().toLocaleLowerCase()),s=o??t;return T.fromJSON({...s?.toJSON(),...e.toJSON()})}const o=r?.find(({name:t})=>t.toLocaleLowerCase()===e.name.toLocaleLowerCase());return o??t}};e([h()],k.prototype,"_directionsLanguage",null),e([h()],k.prototype,"_layerView",void 0),e([h()],k.prototype,"_routeController",void 0),e([h()],k.prototype,"_serviceDescriptionStatus",void 0),e([h()],k.prototype,"apiKey",void 0),e([h()],k.prototype,"autoSolve",void 0),e([h()],k.prototype,"defaultTravelMode",void 0),e([h()],k.prototype,"departureTime",void 0),e([h()],k.prototype,"formattedEta",null),e([h({readOnly:!0})],k.prototype,"impedanceAttribute",null),e([h()],k.prototype,"lastError",void 0),e([h({readOnly:!0})],k.prototype,"lastRoute",void 0),e([h()],k.prototype,"layer",void 0),e([h({type:Number,range:{min:2,max:50},nonNullable:!0})],k.prototype,"maxStops",void 0),e([h({type:w,nonNullable:!0})],k.prototype,"routeParameters",void 0),e([h({readOnly:!0})],k.prototype,"selectedNetworkFeatures",null),e([h({type:T})],k.prototype,"selectedTravelMode",null),e([h({readOnly:!0})],k.prototype,"serviceDescription",void 0),e([h({readOnly:!0})],k.prototype,"state",null),e([h({readOnly:!0})],k.prototype,"timeAttribute",null),e([h()],k.prototype,"travelModes",null),e([h()],k.prototype,"view",void 0),e([h()],k.prototype,"zoomToRoute",null),k=e([c("esri.widgets.Directions.DirectionsViewModel")],k);const z=k;export{z as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import r from"../../core/Error.js";import{EventedAccessor as i}from"../../core/Evented.js";import o from"../../core/Logger.js";import{debounce as s,isAbortError as a}from"../../core/promiseUtils.js";import{watch as l,on as n,syncAndInitial as u,when as d}from"../../core/reactiveUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{resolveTimeZone as p,formatTimestamp as m,convertDateFormatToIntlOptions as v}from"../../intl/date.js";import{getLocale as y,getLocaleParts as f}from"../../intl/locale.js";import{fetchServiceDescription as g}from"../../rest/networkService.js";import w from"../../rest/support/RouteParameters.js";import _ from"../../rest/support/Stop.js";import T from"../../rest/support/TravelMode.js";import{defaultDatePattern as D,defaultTimePattern as S}from"../../support/dateUtils.js";import{system as C}from"../../time/constants.js";import{shortTimeZoneName as b}from"../../time/timeZoneUtils.js";import{DepartureTimeOption as M}from"./support/directionsUtils.js";import{getDefaultLocaleOptions as A}from"../support/dateUtils.js";import I from"../support/GoTo.js";import{DateTime as L,FixedOffsetZone as j,IANAZone as R}from"luxon";function P(e){return e.map(e=>({locale:e,parts:f(e)})).filter(({parts:e})=>!!e)}function E(e,t){return e.find(({parts:e})=>O(e.language,t.language)&&e.region===t.region)?.locale??e.find(({parts:e})=>O(e.language,t.language))?.locale}function U(e){return"esri.Graphic"===e?.declaredClass}function N(e){return"no"===e||"nb"===e}function O(e,t){return e===t||N(e)&&N(t)}function V(e){return"esri.rest.support.Stop"===e?.declaredClass}let k=class extends(I(i)){constructor(e){super(e),this._debouncedSolveHandler=s(async e=>{switch(e.type){case"create":if("complete"!==e.state)return;break;case"delete":break;case"update":switch(e.state){case"start":return void(this._networkFeatureUpdated=!1);case"active":return void(this._networkFeatureUpdated=!0);case"complete":if(!this._networkFeatureUpdated)return}}if(!((this.layer?.stops.filter(({geometry:e})=>!!e).length??0)<2)&&this.autoSolve)try{await this.getDirections({zoomToSolvedRoute:!1})}catch(t){o.getLogger(this).error(t)}}),this._highlight=null,this._loadController=null,this._loadPromise=null,this._networkFeatureUpdated=!1,this._layerView=null,this._routeController=null,this._serviceDescriptionStatus=3,this.apiKey=void 0,this.autoSolve=!0,this.defaultTravelMode=null,this.departureIsoDate=void 0,this.departureIsoTime=void 0,this.departureOption=M.NOW,this.departureTime="now",this.lastError=null,this.lastRoute=null,this.layer=null,this.maxStops=50,this.routeParameters=new w({directionsLengthUnits:"kilometers",findBestSequence:!1,preserveFirstStop:!0,preserveLastStop:!0,returnZ:!0,useTimeWindows:!1}),this.serviceDescription=null,this.view=null}initialize(){this.addHandles([l(()=>this.layer,e=>{if(null!=e){for(;e.stops.length<2;)e.stops.add(new _);this._set("defaultTravelMode",null),this.addHandles(d(()=>this.serviceDescription?e.routeInfo?.analysisSettings?.travelMode:null,e=>{this.defaultTravelMode=this._resolveDefaultTravelMode(e)},{once:!0}))}},u),l(()=>[this.layer,this.view],async()=>{this._layerView=await this._getRouteLayerView()},u),n(()=>this._layerView,["create","delete","update"],e=>{this._debouncedSolveHandler(e).catch(e=>{if(!a(e))throw e})})]);const e=p(this.view?.timeZone??C),t=L.fromMillis(Date.now());this.departureIsoDate=t.toFormat(D,A(e)),this.departureIsoTime=t.toFormat(S,A(e))}get _directionsLanguage(){const e=this.serviceDescription?.directionsSupportedLanguages;if(!e)return;const t=this.routeParameters.directionsLanguage??y(),r=f(t),i=r?.language,o=r?.region;if(!i)return;return E(P(e),{language:i,region:o})}get formattedEta(){const e=this.layer?.routeInfo?.endTime,t=this.layer?.routeInfo?.endTimeOffset;if(this.departureOption===M.UNSPECIFIED||!e||!t)return null;const r=L.fromJSDate(e,{zone:j.instance(t)}),i=L.fromJSDate(e,{zone:R.create(p(this.view?.timeZone??C))}),o=L.fromJSDate(new Date,{zone:R.create(p(this.view?.timeZone??C))}),s=o.year===i.year&&o.month===i.month&&o.day===i.day,a=i.offset===t?void 0:b,l=s?void 0:v("short-date"),n=v("short-time");return m(r.toISO(),{...l,...n,timeZoneName:a})}get impedanceAttribute(){const e=this.routeParameters.travelMode?.impedanceAttributeName??this.routeParameters.impedanceAttribute??this.serviceDescription?.impedance??null;return this.getCostAttribute(e)}get selectedNetworkFeatures(){return this._layerView?.selectedNetworkFeatures??null}get selectedTravelMode(){return this.serviceDescription?this.defaultTravelMode??this.serviceDescription.defaultTravelMode??this.serviceDescription.supportedTravelModes?.[0]??null:null}set selectedTravelMode(e){this._override("selectedTravelMode",e)}get state(){if(this._routeController)return"routing";if(this.lastError)return"error";switch(this._serviceDescriptionStatus){case 4:return"unauthenticated";case 3:return"disabled";case 0:return"initializing";case 2:return"error";default:return"ready"}}get timeAttribute(){const e=this.routeParameters.travelMode?.timeAttributeName??this.routeParameters.directionsTimeAttribute??this.serviceDescription?.directionsTimeAttribute??null;return this.getCostAttribute(e)}get travelModes(){const e=this.serviceDescription?.supportedTravelModes?.slice()??[];return null==this.defaultTravelMode||e.includes(this.defaultTravelMode)||e.unshift(this.defaultTravelMode),e}async load(){if(this._loadPromise)return this._loadPromise;this._loadPromise=this._load(),await this._loadPromise,this._loadPromise=null}async highlight(e){if(this.clearHighlights(),!this.view||!this.layer)return;const t=await this.view.whenLayerView(this.layer);this._highlight=t.highlight(e)}clearHighlights(){null!=this._highlight&&(this._highlight.remove(),this._highlight=null)}centerAt(e){if(!this.view)return;const t=V(e)||U(e)?e.geometry:e;t&&this.callGoTo({target:t})}clearResults(){this._set("lastRoute",null),this.layer?.removeResult()}async create(e){await(this._layerView?.create(e))}async getDirections(e={zoomToSolvedRoute:!0}){const{apiKey:t,layer:i,state:o}=this;if(!i)throw new r("directions-view-model:missing-route-layer","A route layer must be associated with the view model.");if("unauthenticated"===o||"initializing"===o||"disabled"===o||2===this._serviceDescriptionStatus)throw new r("directions-view-model:not-loaded","Cannot get directions until view model loads.");null!=this._routeController&&(this._routeController.abort(),this._routeController=null);const{startTime:s,startTimeIsUTC:l}=this._getStartTimeParameters(),n=this.view?.spatialReference??null,u=this.routeParameters.clone();u.set({apiKey:t,directionsLanguage:this._directionsLanguage,outSpatialReference:n,startTime:s,startTimeIsUTC:l}),this.selectedTravelMode&&(u.travelMode=this.selectedTravelMode);if(i.stops.filter(({geometry:e})=>null!=e).length<2){const e=new r("directions-view-model:not-enough-stops","Not enough stops for routing");throw this._set("lastError",e),e}i.stops.forEach(e=>e.sequence=null),this._routeController=new AbortController;const{signal:d}=this._routeController;let h=null;try{h=await i.solve(u,{signal:d})}catch(c){if(!a(c)){const e=new r("directions-view-model:unable-to-route","Unable to route to these addresses",{error:c});throw this._set("lastError",e),this.clearResults(),e}}finally{this._routeController=null}this._set("lastError",null);for(const r of h.stops)null==r.geometry&&(r.name=null);return i.update(h),this._set("lastRoute",h),e.zoomToSolvedRoute&&this.zoomToRoute(),h}getCostAttribute(e){return(this.serviceDescription?.networkDataset?.networkAttributes??[]).find(({name:t,usageType:r})=>t===e&&"cost"===r)??null}remove(e){this._layerView?.remove(e)}reset(){this.clearHighlights(),this.clearResults(),null!=this.layer&&(this.layer.removeAll(),this.layer.stops=new t([new _,new _]))}save(){if(!this.layer)throw new r("directions-view-model:missing-layer","save() requires a layer");return this.layer.save()}saveAs(e,t={}){if(!this.layer)throw new r("directions-view-model:missing-layer","saveAs() requires a layer");return this.layer.saveAs(e,t)}async startEditing(){this._layerView&&(this._layerView.interactive=!0)}async stopEditing(){this._layerView&&(this._layerView.interactive=!1)}updateDepartureTime(){if(this.departureIsoDate&&this.departureIsoTime)switch(this.departureOption){case M.NOW:this.departureTime="now";break;case M.DEPART_AT:{const e=L.fromISO(`${this.departureIsoDate}T${this.departureIsoTime}`,{zone:j.instance(0)});this.departureTime=e.toJSDate();break}case M.UNSPECIFIED:this.departureTime=null}}zoomToRoute(){const{view:e,layer:t}=this,r=t?.routeInfo?.geometry?.extent;if(!e||!r)return;const i=r.width>r.height,o=r.clone().expand(i?2:1);this.callGoTo({target:o})}async _getRouteLayerView(){return this.view&&this.layer?this.view.whenLayerView(this.layer):null}_getStartTimeParameters(){if("now"===this.departureTime){return{startTime:this.serviceDescription?.capabilities.supportsNow??!1?"now":new Date,startTimeIsUTC:!0}}return null==this.departureTime?{startTime:void 0,startTimeIsUTC:void 0}:{startTime:this.departureTime,startTimeIsUTC:!1}}async _load(){if(null==this.layer)return;null!=this._loadController&&(this._loadController.abort(),this._loadController=null),this._loadController=new AbortController;const{signal:e}=this._loadController;try{this._serviceDescriptionStatus=0;const t=await g(this.layer.url,this.apiKey,{signal:e});this._set("serviceDescription",t),this._serviceDescriptionStatus=1}catch(t){if(a(t))return void(this._serviceDescriptionStatus=3);if("identity-manager:user-aborted"===t.name)return void(this._serviceDescriptionStatus=4);const e=new r("directions-view-model:service-metadata-unavailable","Cannot load route service metadata",{error:t});throw this._serviceDescriptionStatus=2,this._set("lastError",e),e}finally{this._loadController=null}}_resolveDefaultTravelMode(e){if(null==this.serviceDescription)return null;const{defaultTravelMode:t,supportedTravelModes:r}=this.serviceDescription,i=/^<(?<name>.*)>$/i.exec(e.name)?.groups?.name;if(i){const o=r?.find(({name:e})=>e.toLocaleLowerCase()===i.trim().toLocaleLowerCase()),s=o??t;return T.fromJSON({...s?.toJSON(),...e.toJSON()})}const o=r?.find(({name:t})=>t.toLocaleLowerCase()===e.name.toLocaleLowerCase());return o??t}};e([h()],k.prototype,"_directionsLanguage",null),e([h()],k.prototype,"_layerView",void 0),e([h()],k.prototype,"_routeController",void 0),e([h()],k.prototype,"_serviceDescriptionStatus",void 0),e([h()],k.prototype,"apiKey",void 0),e([h()],k.prototype,"autoSolve",void 0),e([h()],k.prototype,"defaultTravelMode",void 0),e([h()],k.prototype,"departureTime",void 0),e([h()],k.prototype,"formattedEta",null),e([h({readOnly:!0})],k.prototype,"impedanceAttribute",null),e([h()],k.prototype,"lastError",void 0),e([h({readOnly:!0})],k.prototype,"lastRoute",void 0),e([h()],k.prototype,"layer",void 0),e([h({type:Number,range:{min:2,max:50},nonNullable:!0})],k.prototype,"maxStops",void 0),e([h({type:w,nonNullable:!0})],k.prototype,"routeParameters",void 0),e([h({readOnly:!0})],k.prototype,"selectedNetworkFeatures",null),e([h({type:T})],k.prototype,"selectedTravelMode",null),e([h({readOnly:!0})],k.prototype,"serviceDescription",void 0),e([h({readOnly:!0})],k.prototype,"state",null),e([h({readOnly:!0})],k.prototype,"timeAttribute",null),e([h()],k.prototype,"travelModes",null),e([h()],k.prototype,"view",void 0),e([h()],k.prototype,"zoomToRoute",null),k=e([c("esri.widgets.Directions.DirectionsViewModel")],k);const z=k;export{z 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import"../../intl.js";import{getContrast as i,multiplyOpacity as r}from"../../core/colorUtils.js";import{handlesGroup as s}from"../../core/handleUtils.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as n,initial as a}from"../../core/reactiveUtils.js";import{formatDecimal as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import"../../intl.js";import{getContrast as i,multiplyOpacity as r}from"../../core/colorUtils.js";import{handlesGroup as s}from"../../core/handleUtils.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as n,initial as a}from"../../core/reactiveUtils.js";import{formatDecimal as l,formatImperialLength as p,formatMetricLength as m}from"../../core/unitFormatUtils.js";import{convertUnit as c}from"../../core/unitUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as d}from"../../core/support/UpdatingHandles.js";import y from"../../geometry/Point.js";import v from"../../geometry/Polyline.js";import{e as g,l as _}from"../../chunks/geodeticDensifyOperator.js";import{e as f,l as w}from"../../chunks/geodeticLengthOperator.js";import{e as L}from"../../chunks/lengthOperator.js";import{isSupported as j,geodesicLengths as b,geodesicDensify as S}from"../../geometry/support/geodesicUtils.js";import M from"../../layers/GraphicsLayer.js";import x from"../../symbols/CIMSymbol.js";import C from"../../symbols/Font.js";import A from"../../symbols/SimpleMarkerSymbol.js";import D from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as G}from"../../views/2d/interactive/SnappingVisualizer2D.js";import k from"../../views/draw/Draw.js";import{createCoordinateHelper as T}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as O,screenToMap as H,dragManipulatedObject as P}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as R}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as U}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as E}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as I}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as z}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as B}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as F}from"../../views/interactive/snapping/snappingUtils.js";import{fetchMessageBundle as V}from"../../intl/messages.js";import{onLocaleChange as W}from"../../intl/locale.js";const N=1e5;let q=class extends U{constructor(e){super(e),this._measurementLayer=new M({internal:!0,listMode:"hide",visible:!1,title:"DistanceMeasurement2DTool measurement layer"}),this._manipulatorLayer=new M({internal:!0,listMode:"hide",visible:!1,title:"DistanceMeasurement2DTool manipulator layer"}),this._snappingLayer=new M({internal:!0,listMode:"hide",visible:!1,title:"DistanceMeasurement2DTool snapping layer"}),this._updatingHandles=new d,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){V("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new k({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([W(async()=>{this.messages=await V("esri/core/t9n/Units")}),n(()=>[this.unit,this.messages],()=>{this._updatePolylines()},a),n(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),F(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=o(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=o(this._measurementLayer),this._manipulatorLayer=o(this._manipulatorLayer),this._snappingLayer=o(this._snappingLayer),this._updatingHandles=o(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}_getSnappingContext(e){return new z({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new I(new E("point",T(!1,!1,this.view.spatialReference)),2),visualizer:new G(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let l=this._vertices.length;l<e.length;l++){const[i,r]=e[l],o=new y({x:i,y:r,spatialReference:t}),n=J(o,this.view,this._manipulatorLayer);this.manipulators.add(n);const a=I.fromGeometry(o,2),p=[a.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[l].coord=[t.pos[0],t.pos[1]],this._updatePolylines())}),O(n,(e,t,i,r)=>{const s=this._getSnappingContext(r),{snappingManager:o}=this,n=this._updatingHandles,{snappingStep:l}=B({snappingContext:s,snappingManager:o,updatingHandles:n});t.next(H(this.view)).next(t=>{if("start"===t.action){const i=new y(t.mapStart);e.graphic.geometry=i,a.trySetGeometry(i)}return t}).next(...l).next(P({operations:a})).next(()=>{e.graphic.geometry=a.data.geometry})})];this._vertices.push({manipulator:n,coord:[i,r],handle:s(p)})}const i=this._vertices.length-1,r=this._vertices[i],[o,n]=e[i];r.coord[0]===o&&r.coord[1]===n||(r.coord=[o,n],r.manipulator.graphic.geometry=new y({x:o,y:n,spatialReference:t}));const a=this._drawActive?this._vertices[i].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==a||e!==a}),this._updatePolylines()}_updatePolylines(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=K(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:s,drawing:o,original:n}=e;this._set("measurement",s);const a=Y(this.messages,s,this.unit);let l,p;this._set("measurementLabel",a);const{graphics:m}=this._measurementLayer,c=2===m.length,{effectiveTheme:h}=this.view;c?(l=m.at(0),p=m.at(1)):(l=new t({symbol:new x({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[14,12],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",width:3.5,color:i(h.accentColor).toArray()},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:5,color:h.accentColor.toArray()}]}}})}),p=new t({symbol:new D({color:h.textColor,haloColor:r(i(h.textColor,160),.5),haloSize:2,font:new C({size:14,family:"sans-serif"})})}),m.removeAll(),m.addMany([l,p])),l.geometry=o,p.geometry=n.extent?.center,p.symbol.text=a}};function J(e,i,s){const o=r(i.effectiveTheme.accentColor,.5),n={type:"simple-line",width:0},a=8,l=new A({style:"circle",color:o,size:a,outline:n}),p=new A({style:"circle",color:o,size:1.5*a,outline:n}),m=new t({geometry:e,symbol:l});return new R({view:i,layer:s,graphic:m,focusedSymbol:p})}function K(e,t){const i=new v({paths:[e],spatialReference:t});let r,s;return t.isGeographic?j(t)?(r=b([i],"meters")[0],s=S(i,N)):(r=f(i,{unit:"meters"}),s=g(i,N,{unit:"meters"})):t.isWebMercator?(r=f(i,{unit:"meters"}),s=g(i,N,{unit:"meters"})):(r=L(i,{unit:"meters"}),s=i),{measurement:{geometry:s,length:r},original:i,drawing:s}}function Q(e){return null!=e}async function X(e){(e?.isGeographic&&!j(e)||e?.isWebMercator)&&await Promise.all([_(),w()])}function Y(e,t,i){if(!t||!e)return"";switch(i){case"metric":return m(e,t.length,"meters");case"imperial":return p(e,t.length,"meters");default:return l(e,c(t.length,"meters",i),i)}}e([h()],q.prototype,"_drawActive",void 0),e([h({readOnly:!0})],q.prototype,"cursor",null),e([h({value:!0})],q.prototype,"editable",null),e([h({readOnly:!0})],q.prototype,"measurement",void 0),e([h({readOnly:!0})],q.prototype,"measurementLabel",void 0),e([h()],q.prototype,"messages",void 0),e([h({constructOnly:!0})],q.prototype,"snappingManager",void 0),e([h()],q.prototype,"unit",void 0),e([h()],q.prototype,"updating",null),e([h({constructOnly:!0})],q.prototype,"view",void 0),q=e([u("esri.widgets.DistanceMeasurement2D.DistanceMeasurement2DTool")],q);export{q as DistanceMeasurement2DTool,K as createDistanceMeasurementInfo2D,Y as createDistanceMeasurementLabel,Q as isSupported,X as loadGeometryOperators};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{unique as t,isSome as i}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import{deprecatedFunction as o}from"../../core/deprecate.js";import s from"../../core/Error.js";import n from"../../core/Evented.js";import{makeHandle as l}from"../../core/handleUtils.js";import d from"../../core/Logger.js";import{destroyMaybe as p,abortMaybe as c,removeMaybe as u}from"../../core/maybe.js";import{throwIfAborted as h,createResolver as f}from"../../core/promiseUtils.js";import{watch as w,on as m,when as y,syncAndInitial as g,initial as v,sync as k,whenOnce as _}from"../../core/reactiveUtils.js";import{property as M}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as W}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as F}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as E}from"../../editing/templateUtils.js";import b from"../../layers/GraphicsLayer.js";import{isEditableLayer as T}from"../../layers/support/editableLayers.js";import{isFeatureLayer as V,isSubtypeGroupLayer as S,getOwningPortalUrl as L}from"../../layers/support/layerUtils.js";import{parseKnownArcGISOnlineDomain as I}from"../../portal/support/urlUtils.js";import A from"../../views/SelectionManager.js";import U from"../../views/interactive/sketch/SketchOptions.js";import{SnappingManager as C}from"../../views/interactive/snapping/SnappingManager.js";import O from"../../views/interactive/snapping/SnappingOptions.js";import{isSelectableLayer as j}from"../../views/support/selectionUtils.js";import P from"../Attachments/AttachmentsViewModel.js";import R from"./CreateFeaturesWorkflow.js";import H from"./UpdateFeaturesWorkflow.js";import q from"./UpdateWorkflow.js";import{getLayersFromWorkflow as G,isCreateFeaturesWorkflow as x,isUpdateRecordWorkflow as D,isUpdateFeaturesWorkflow as B,isUpdateWorkflow as N,makeMultipleSourceLayersError as Q,whenEditorLayerView as z}from"./workflowUtils.js";import Z from"./support/EditorItem.js";import{makeTemplateGroupInfoForLayer as $}from"../FeatureTemplates/featureTemplatesUtils.js";import J from"../FeatureTemplates/FeatureTemplatesViewModel.js";import K from"../Sketch/SketchViewModel.js";import X from"../Spinner/SpinnerViewModel.js";import{goTo as Y}from"../support/goToUtils.js";import{isFeatureItem as ee,isLayerItem as te}from"../support/SelectionList/selectionListUtils.js";import ie from"../support/SelectionList/SelectionListViewModel.js";import re from"../support/SelectionToolbar/SelectionToolbarViewModel.js";function ae(e,t){return e?.find(e=>e.layer===t)}let oe=class extends n.EventedAccessor{constructor(e){super(e),this._queuedSelectionTool=null,this._sketchEventListenerHandle=null,this._sketchGraphicsLayer=new b({listMode:"hide",internal:!0}),this._snappingManager=null,this._templatesByLayer=new Map,this._updateItemsTask=null,this._updateTemplatesTask=null,this._updatingHandles=new F,this._featureTemplatesViewModelIsRestricted=!1,this.activeWorkflow=null,this._activityQueue=new a,this.editorItems=new a,this.failures=[],this.hideTemplatesForInactiveLayers=!1,this.attachmentsViewModel=new P({capabilities:{editing:!0}}),this.featureTemplatesViewModel=new J({disabledItemFunction:({layer:e})=>this._itemIsSuspended(e)}),this.layerInfos=null,this.ownSketchViewModel=new K({layer:this._sketchGraphicsLayer}),this.selectionListViewModel=new ie,this.selectionManager=new A,this.selectionToolbarViewModel=new re({continuousSelectionEnabled:!0,defaultOperationType:"replace",persistSelection:!1,returnGeometry:!1}),this.sketchOptions=new U,this.snappingOptions=new O({attributeRulesEnabled:!0}),this.spinnerViewModel=new X,this.pageStack=[],this.showDiscardEditsPrompt=()=>Promise.resolve(!0),this._candidateCommitted=!1,this.back=async()=>{if("viewing-selection-list"===this.state)return this.selectionListViewModel.filterText=void 0,void this.effectiveSelectionManager.clear();this.canGoBack&&(this.activeWorkflow?.hasPreviousStep?await this.activeWorkflow.back(this.showDiscardEditsPrompt):await this._cancelWorkflow({force:!this.hasPendingEdits}))},this.saveWorkflow=async()=>await(this.activeWorkflow?.save()),this.selectFeature=(e,t=!1)=>{const i=this.activeWorkflow;this._candidateCommitted||"update"!==i?.type||(i.data.rootFeature=e,t&&(i.next(),this._candidateCommitted=!0))}}initialize(){this.addHandles([w(()=>{const e=this.view,t=e?.map?.editableLayers.toArray(),i=e?.allLayerViews,r=i?.filter(e=>!!t?.includes(e.layer));return[t,r,this.layerInfos]},()=>this._updateEditorItems(),g),w(()=>this.hideTemplatesForInactiveLayers,()=>this.syncFeatureTemplates()),w(()=>this._selectionSources,()=>this._syncSelectionSources(),v),m(()=>this.activeWorkflow,"cancel",()=>this.emit("workflow-cancel")),m(()=>this.activeWorkflow,"commit",()=>this.emit("workflow-commit")),m(()=>this.activeWorkflow,"complete",()=>{this.emit("workflow-commit"),this._set("activeWorkflow",null)}),y(()=>!this.activeWorkflow&&this._queuedSelectionTool,()=>this._queuedSelectionTool&&this.selectionToolbarViewModel.activateTool(this._queuedSelectionTool)),w(()=>this.activeWorkflow,e=>this.selectionManager.showHighlight=!e),y(()=>this.view?.map,e=>e.add(this._sketchGraphicsLayer),v),m(()=>this.editorItems,"change",()=>this._afterEditorItemsChange()),w(()=>[this.canCreate,this.canUpdateVisible],()=>this._afterEditorItemsChange()),w(()=>this.page,(e,t)=>{const i=[...this.pageStack];if(-1===i.indexOf(e))i.push(e);else for(;i.length&&i.at(-1)!==e;)i.pop();this.pageStack=i},g),y(()=>"awaiting-update-feature-candidate"===this.state,()=>this._candidateCommitted=!1),m(()=>this.featureTemplatesViewModel,"select",async({item:e,oldItem:t})=>{const{activeWorkflow:i}=this;if(i){if("update"===i.type&&"awaiting-feature-creation-info"===i.activeWorkflow?.stepId)return;try{await this.cancelWorkflow({force:!this.hasPendingEdits})}catch{return void this.featureTemplatesViewModel.select(t,{emit:!1})}}if(!e)return;const r={layer:e.layer,template:e.template};if(e.supportsUpload)return this.featureTemplatesViewModel.select(t,{emit:!1}),this.startCreateFeaturesWorkflow(r);this.startCreateFeaturesWorkflowAtFeatureCreation(r)}),w(()=>[this.view,this.featureTemplatesViewModel],([e,t])=>{t.view=e},g),m(()=>this.view,"key-down",e=>{"Escape"===e.key&&this.activeWorkflow?.keyboardCancellationEnabled&&(e.stopPropagation(),this.back())}),m(()=>this.sketchViewModel,["create","delete","update"],e=>{const{activeWorkflow:t}=this,i="update"===t?.type,r=G(t),a=i?t?.activeWorkflow?.parentLayer??void 0:void 0,o=`sketch-${e.type}`;this.emit(o,{type:o,detail:e,layer:r[0],layers:r,parentLayer:a})},k),w(()=>this.view,e=>{if(this._snappingManager=p(this._snappingManager),!e)return;const t=this.snappingOptions;this._snappingManager=new C({view:e,options:t}),this.ownSketchViewModel.snappingManager=this._snappingManager},g),w(()=>this.snappingOptions,e=>{this._snappingManager&&(this._snappingManager.options=e)},g),m(()=>this.selectionToolbarViewModel,"complete",e=>this._onSelectionComplete(e)),w(()=>({view:this.view,selectionManager:this.effectiveSelectionManager,selectionListViewModel:this.selectionListViewModel,selectionToolbarViewModel:this.selectionToolbarViewModel}),({view:e,selectionManager:t,selectionListViewModel:i,selectionToolbarViewModel:r})=>{t.view=e,i.view=e,r.view=e},g),w(()=>this.effectiveSelectionManager,e=>{this.selectionListViewModel.selectionManager=e,this.selectionToolbarViewModel.selectionManager=e},g)])}destroy(){this._cancelWorkflow({warnIfNoWorkflow:!1}).then(()=>{this.view?.map?.remove(this._sketchGraphicsLayer),this.view=null}),this._updateItemsTask=c(this._updateItemsTask),this._updatingHandles.destroy(),this._sketchEventListenerHandle=u(this._sketchEventListenerHandle),this.selectionListViewModel?.destroy(),this.selectionToolbarViewModel?.destroy(),this.selectionManager.destroy()}get _featureTemplatesLayersAndTables(){const e=new a;for(const t of this.editorItems){const i=this.hideTemplatesForInactiveLayers&&!t.visible;t.supportsCreateFeaturesWorkflow&&!i&&e.push(t.layer)}return e}get _selectionSources(){const e=new a;for(const t of this.editorItems)j(t.layer)&&t.supportsUpdateWorkflow&&t.visible&&e.push(t.layer);return e}get activeFeatureCount(){const e=this.activeLeafWorkflow;return x(e)?e.pendingFeatures.length:D(e)&&e.data.edits.feature?1:B(e)?e.data.features.length:0}get activeLeafWorkflow(){const e=this.activeWorkflow;return e&&N(e)?e.activeWorkflow??e:e}get canCreate(){return this.editorItems.some(e=>e.supportsCreateFeaturesWorkflow)}get canCreateVisible(){return!!this.featureTemplatesLayers.length}get canUpdate(){return this.editorItems.some(e=>e.supportsUpdateWorkflow)}get canUpdateVisible(){return this.editorItems.some(e=>e.supportsUpdateWorkflow&&e.visible)}get featureTemplatesLayers(){return this._featureTemplatesLayersAndTables.filter(e=>"scene"===e.type||!e.isTable)}get effectiveSelectionManager(){return this.selectionManager}get featureFormViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:null}get formViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:"update-features"===e?.type?e.formViewModel:null}get utilityNetworkAssociationAddAssociationViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeUtilityNetworkAssociationAddAssociationViewModel:null}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get sketchViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeSketchViewModel:"create-features"===e?.type||"update-features"===e?.type?e.sketchViewModel:this.ownSketchViewModel}get state(){if(!this.view?.ready)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this,i=!t?.stepId;return this.effectiveSelectionManager.count&&i?"viewing-selection-list":i?"ready":"update"===t.type&&t.activeWorkflow?.stepId?t.activeWorkflow.stepId:t.stepId}get syncing(){return this._activityQueue.length>0}get updating(){return this._updatingHandles.updating||!0===this.activeWorkflow?.updating}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}set view(e){this.ownSketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}get canZoomTo(){const e=this.sketchViewModel,t=e?.createGraphic?.geometry?.type;return!(!e?.updateGraphics?.length&&"multipoint"!==t)}get page(){const{activeWorkflow:e,state:t}=this;if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associatedLayer)return"viewing-associated-features";if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associationId)return"viewing-associated-layers";if("update"===e?.type&&"awaiting-feature-to-update"===e.stepId)return"ready";if("create-features"===e?.type&&0===e.numPendingFeatures){const t=e.data.upload;if(t)return"default"===t.state?"ready":"creating-features-upload-details"}return t??"disabled"}get featureFormDisabled(){const{activeLeafWorkflow:e}=this;if(D(e))return!1===e.data.editorItem?.capabilities.update.attributes||!0===e.featureFormViewModel.disabled;if(B(e)){const{formViewModel:t}=e;return t.disabled||t.readOnly}return!1}get featureFormHasAssociation(){return!!this.featureFormViewModel?.activeAssociation}get canGoBack(){return null!=this.activeWorkflow&&!this.syncing}get shouldShowDeleteButton(){const{activeLeafWorkflow:e}=this;if(D(e)){const{data:t}=e;return t.editorItem?.capabilities.delete.enabled&&!t.readOnly}return!!B(e)&&e.data.editorItems.every(e=>e.capabilities.delete.enabled)}get hasPendingEdits(){return this.activeWorkflow?.hasPendingEdits??!1}get snappingManager(){return this._snappingManager}getTemplatesForLayer(e){return this._templatesByLayer.get(e)??[]}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,"creating-features")}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(await _(()=>!this.updating),!this.canCreate)throw new s("editing:unsupported-workflow","Creating features is unsupported or disabled.");const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const i=this._createCreateFeaturesWorkflow(e,t);this._set("activeWorkflow",i),await i.start()}catch(r){this._logErrorAndCancelWorkflow(r)}finally{i.resolve()}}async startCreateFeaturesWorkflowAtFeatureEdit(e){await _(()=>!this.updating);const t=this._createUpdatingResolver();try{const{initialFeature:t}=e,i=t.sourceLayer=t.layer,r=i?this.findEditorItemForLayer(i):void 0;if(!r?.supportsCreateFeaturesWorkflow)throw new s("editing:unsupported-workflow","Creating features is unsupported or disabled for this layer.");await this._cancelWorkflow();const a=this._createCreateFeaturesWorkflow({initialFeature:t,layer:r.layer,maxFeatures:1},"creating-features");this._set("activeWorkflow",a),await a.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateFeaturesWorkflow(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update features workflow is unsupported or disabled.");if(t(e.map(e=>e.sourceLayer??e.layer)).length>1)throw Q();const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateFeaturesWorkflow(e);this._set("activeWorkflow",t),await t.start()}catch(r){this._logErrorAndCancelWorkflow(r)}finally{i.resolve()}}async startUpdateWorkflowAtFeatureSelection(){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const e=this._createUpdatingResolver();try{await this._cancelWorkflow();const e=this._createUpdateWorkflow();this._set("activeWorkflow",e),await e.start()}catch(t){this._logErrorAndCancelWorkflow(t)}finally{e.resolve()}}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureEdit(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("editing-existing-feature");t.data.rootFeature=e,t.addHandles(m(()=>t,"commit",()=>{t.destroy(),this.activeWorkflow===t&&this._set("activeWorkflow",null)})),this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowWithActiveSelection(){const{selectionListViewModel:e}=this;if(!e.visibleFeatureCount)throw new s("editing:missing-selection","Unable to determine visible selection.");if(e.visibleLayerCount>1)throw new s("editing:features-different-layers","Cannot start workflow with features from different layers.");const t=e.visibleFeatureItems.map(e=>e.graphic);1===t.length?this.startUpdateWorkflowAtFeatureEdit(t[0]):this.startUpdateFeaturesWorkflow(t)}async deleteFeatureFromWorkflow(){o(d.getLogger(this),"EditorViewModel.deleteFeatureFromWorkflow is deprecated. Use EditorViewModel.deleteFeatures instead.",{version:"4.33",replacement:"EditorViewModel.deleteFeatures",warnOnce:!0}),await this.deleteFeatures()}async deleteFeatures(){const e=this.activeWorkflow;return N(e)?e.deleteActiveFeature():B(e)?e.deleteAndCommit():void this._logError("editing:unsupported-workflow","Deleting features requires an active update workflow.")}async deleteAssociationFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?await e.deleteActiveAssociation():this._logError("editing:unsupported-workflow","Deleting an association requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warnIfNoWorkflow:!0,...e})}findEditorItemForLayer(e){return this.editorItems.find(t=>t.layer===e)}itemHasInvalidFormTemplate(e){return null!=e&&!0===this.findEditorItemForLayer(e.layer)?.hasInvalidFormTemplate}syncFeatureTemplates(){this._featureTemplatesViewModelIsRestricted||this._updateTemplates()}zoomTo(e){const{view:t,sketchViewModel:r}=this;if(!t)return;const a=e??r?.createGraphic;if(a)"mesh"===a.geometry?.type?Y(t,a.geometry):Y(t,a);else{const e=r?.updateGraphics?.toArray();"3d"===t.type&&e?.some(e=>"mesh"===e.geometry?.type)?Y(t,e.map(e=>e.geometry).filter(i)):e&&Y(t,e)}}async toggleUpdateWorkflow(){this.canUpdate&&(this.hasPendingEdits&&!await this.showDiscardEditsPrompt()||(this.activeWorkflow&&"awaiting-feature-to-update"===this.state?await this.cancelWorkflow({force:!0}):await this.startUpdateWorkflowAtFeatureSelection()))}async onSelectionListItemSelect(e){ee(e)&&this.startUpdateWorkflowAtFeatureEdit(e.graphic)}async onSelectionListMenuItemSelect(e){if(ee(e))this.startUpdateWorkflowAtFeatureEdit(e.graphic);else if(te(e)){const t=e.featureItems.filter(e=>e.visible).map(e=>e.graphic);1===t.length?this.startUpdateWorkflowAtFeatureEdit(t[0]):this.startUpdateFeaturesWorkflow(t)}}restrictFeatureTemplatesViewModelToLayer(e){return this._featureTemplatesViewModelIsRestricted=!0,this._setFeatureTemplatesViewModelLayers([e]),l(()=>{this._featureTemplatesViewModelIsRestricted=!1,this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)})}async _getEditorItemCandidates(e){const{view:t}=this;if(!t?.map)return[];const{map:i}=t,r=i.editableLayers.toArray(),a=i.allTables.toArray().filter(e=>V(e)||S(e));return await Promise.allSettled([...r.flatMap(e=>this._getLayerLoadPromise(e)),...a.flatMap(e=>this._getLayerLoadPromise(e))]),h(e),[...r.reverse(),...a.reverse()].filter(e=>T(e)&&("mesh"!==e.geometryType||"3d"===t.type)).flatMap(e=>"subtype-group"===e.type?e.sublayers.toArray():e)}_getLayerLoadPromise(e){return S(e)?e.loadAll():e.load()}_drainEditorItems(){this.editorItems.drain(e=>e.destroy())}_updateEditorItems(){c(this._updateItemsTask);const{view:e}=this,t=r(async t=>{if(!e?.map||!e?.allLayerViews)return;const i=await this._getEditorItemCandidates(t);if(!i.length)return void this._drainEditorItems();const r=[],a=[],o=[],{layerInfos:s}=this;for(const l of i){const t=ae(s,l),i=await z(e,l).catch(()=>null);(t?r:i?a:o).push(new Z({layer:l,layerInfo:t,layerView:i}))}s?.length&&r.sort((e,t)=>s.findIndex(({layer:t})=>t===e.layer)-s.findIndex(({layer:e})=>e===t.layer));const n=[...r,...a,...o];t.aborted||(this._drainEditorItems(),this.editorItems.addMany(n))});this._updatingHandles.addPromise(t.promise),this._updateItemsTask=t}_updateTemplates(){c(this._updateTemplatesTask);const e=r(async e=>{const t=this._templatesByLayer,i=this._featureTemplatesLayersAndTables.filter(e=>!t.has(e));if(i.length>0){const r=await E(i.toArray(),this.view,e);for(const{layer:e,templates:i}of r)t.set(e,i)}this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)});this._updatingHandles.addPromise(e.promise),this._updateTemplatesTask=e}_setFeatureTemplatesViewModelLayers(e){const t=this._templatesByLayer,i=[];for(const r of e){const e=t.get(r);e&&e.length>0&&i.push($(r,e))}this.featureTemplatesViewModel.templateInfos=i}_afterEditorItemsChange(){const{activeWorkflow:e}=this;if(this.syncFeatureTemplates(),!e)return;const{stepId:t}=e;"create-features"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdateVisible||"awaiting-update-feature-candidate"===t&&!e.hasUpdatableCandidates)&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e?.warnIfNoWorkflow&&this._logError("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force){this.emit("workflow-cancel"),this._set("activeWorkflow",null);try{await t.cancel(e)}finally{t.destroy()}}else try{await t.cancel(e),this._set("activeWorkflow",null),t.destroy()}catch(i){}}_createCreateFeaturesWorkflow(e,t){return R.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEditsCallback:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureServiceCallback:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_createUpdateFeaturesWorkflow(e){const t=H.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,features:e,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i)});return t.addHandles(m(()=>t,"commit",()=>{t.destroy(),this.activeWorkflow===t&&this._set("activeWorkflow",null)})),t}_createUpdateWorkflow(e){return q.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:e,applyEditsCallback:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureServiceCallback:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_addAttachments(e,t){const i=t.map(t=>this._addAttachment(e,t.feature,t.attachment))??[];return Promise.all(i)}async _addAttachment(e,t,i){let r=null;if(!("addAttachment"in e)||null==e.capabilities?.attachment)throw new s("editor:attachments-not-supported","Adding attachments is not supported for this layer type");return await this._queueOperation(async()=>(r=await(e.addAttachment?.(t,i).catch(e=>{throw e?.error||e}))??null,r)),r}async _applyEdits(e,t,i){let r=null;const a=e.url?await L(e.url):null,o={returnServiceEditsOption:(!a||!I(a))&&!RegExp("/hosted/","i").test(e.url)?"original-and-current-features":void 0,...i};return await this._queueOperation(async()=>{const{view:i}=this;if(!i)return null;const a=await z(i,e).catch(()=>null);return r=await e.applyEdits(t,o),a&&await _(()=>!a.updating),r}),r}async _applyEditsFeatureService(e,t,i){let r=null;return await this._queueOperation(async()=>r=await e.applyEdits(t,i)),r}_queueOperation(e){this._activityQueue.push(e);const t=(e,t)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)};return e().then(e=>(Array.isArray(e)?e.forEach(e=>this._handleEditsResultError(e)):this._handleEditsResultError(e),e)).catch(i=>{this._logError("editing:operation-error","An error occurred.",{error:i});const r={error:i,retry:()=>(t(r,this.failures),this._queueOperation(e)),cancel:()=>{t(r,this.failures)}};this._set("failures",[...this.failures,r])}).then(()=>{t(e,this._activityQueue)})}_handleEditsResultError(e){if(null!=e&&"error"in e&&null!=e.error)throw e.error;if(null!=e&&"addFeatureResults"in e){const{addFeatureResults:t,deleteFeatureResults:i,updateFeatureResults:r}=e,a=t.find(e=>!!e.error)||r.find(e=>!!e.error)||i.find(e=>!!e.error);if(a)throw a.error}}_createUpdatingResolver(){const e=f();return this._updatingHandles.addPromise(e.promise),e}_logErrorAndCancelWorkflow(e){const{name:t,message:i,details:r}=e;this._logError(t??"editing:workflow-start-failed",i??void 0,r??e),this._cancelWorkflow({force:!0})}_itemIsSuspended(e){const t=this.findEditorItemForLayer(e);return null!=t&&(!t.visible||t.disabled)}_logError(e,t,i){d.getLogger(this).error(new s(e,t,i))}_syncSelectionSources(){this.selectionManager.sources.items=this._selectionSources.toArray()}async _onSelectionComplete(e){if(e.aborted)return;const{operationType:t,selection:i}=e,{effectiveSelectionManager:r}=this,a="ready"===this.state,o=1===i.length;if(this._queuedSelectionTool=void 0,a&&o&&(0===r.count&&"add"===t||"replace"===t))return this._queuedSelectionTool=e.toolName,this.startUpdateWorkflowAtFeatureEdit(i[0]);switch(t){case"remove":r.updateSelection({current:[],added:[],removed:i});break;case"replace":r.clear(),r.updateSelection({current:i,added:[],removed:[]});break;case"add":r.updateSelection({current:i,added:[],removed:[]})}}};e([M()],oe.prototype,"_featureTemplatesLayersAndTables",null),e([M()],oe.prototype,"_queuedSelectionTool",void 0),e([M()],oe.prototype,"_snappingManager",void 0),e([M()],oe.prototype,"_selectionSources",null),e([M()],oe.prototype,"activeFeatureCount",null),e([M({readOnly:!0})],oe.prototype,"activeWorkflow",void 0),e([M()],oe.prototype,"activeLeafWorkflow",null),e([M({readOnly:!0})],oe.prototype,"_activityQueue",void 0),e([M({readOnly:!0})],oe.prototype,"canCreate",null),e([M()],oe.prototype,"canCreateVisible",null),e([M({readOnly:!0})],oe.prototype,"canUpdate",null),e([M()],oe.prototype,"canUpdateVisible",null),e([M()],oe.prototype,"featureTemplatesLayers",null),e([M()],oe.prototype,"editorItems",void 0),e([M()],oe.prototype,"effectiveSelectionManager",null),e([M({readOnly:!0})],oe.prototype,"failures",void 0),e([M()],oe.prototype,"hideTemplatesForInactiveLayers",void 0),e([M({type:P})],oe.prototype,"attachmentsViewModel",void 0),e([M()],oe.prototype,"featureFormViewModel",null),e([M()],oe.prototype,"formViewModel",null),e([M()],oe.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),e([M({type:J})],oe.prototype,"featureTemplatesViewModel",void 0),e([M()],oe.prototype,"labelOptions",null),e([M()],oe.prototype,"layerInfos",void 0),e([M()],oe.prototype,"ownSketchViewModel",void 0),e([M()],oe.prototype,"selectionListViewModel",void 0),e([M()],oe.prototype,"selectionManager",void 0),e([M()],oe.prototype,"selectionToolbarViewModel",void 0),e([M()],oe.prototype,"sketchOptions",void 0),e([M()],oe.prototype,"sketchViewModel",null),e([M({type:O,nonNullable:!0})],oe.prototype,"snappingOptions",void 0),e([M()],oe.prototype,"spinnerViewModel",void 0),e([M()],oe.prototype,"state",null),e([M({readOnly:!0})],oe.prototype,"syncing",null),e([M()],oe.prototype,"updating",null),e([M()],oe.prototype,"tooltipOptions",null),e([M()],oe.prototype,"valueOptions",null),e([M()],oe.prototype,"view",null),e([M()],oe.prototype,"canZoomTo",null),e([M()],oe.prototype,"pageStack",void 0),e([M()],oe.prototype,"showDiscardEditsPrompt",void 0),e([M()],oe.prototype,"_candidateCommitted",void 0),e([M()],oe.prototype,"page",null),e([M()],oe.prototype,"featureFormDisabled",null),e([M()],oe.prototype,"featureFormHasAssociation",null),e([M()],oe.prototype,"canGoBack",null),e([M()],oe.prototype,"shouldShowDeleteButton",null),e([M()],oe.prototype,"hasPendingEdits",null),e([M()],oe.prototype,"snappingManager",null),oe=e([W("esri.widgets.Editor.EditorViewModel")],oe);const se=oe;export{se as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{unique as t,isSome as i}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import{deprecatedFunction as o}from"../../core/deprecate.js";import s from"../../core/Error.js";import{EventedAccessor as n}from"../../core/Evented.js";import{makeHandle as l}from"../../core/handleUtils.js";import d from"../../core/Logger.js";import{destroyMaybe as p,abortMaybe as c,removeMaybe as u}from"../../core/maybe.js";import{throwIfAborted as h,createResolver as f}from"../../core/promiseUtils.js";import{watch as w,on as m,when as y,syncAndInitial as g,initial as k,sync as v,whenOnce as _}from"../../core/reactiveUtils.js";import{property as M}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as W}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as F}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as E}from"../../editing/templateUtils.js";import b from"../../layers/GraphicsLayer.js";import{isEditableLayer as T}from"../../layers/support/editableLayers.js";import{isFeatureLayer as V,isSubtypeGroupLayer as S,getOwningPortalUrl as L}from"../../layers/support/layerUtils.js";import{parseKnownArcGISOnlineDomain as I}from"../../portal/support/urlUtils.js";import A from"../../views/SelectionManager.js";import U from"../../views/interactive/sketch/SketchOptions.js";import{SnappingManager as C}from"../../views/interactive/snapping/SnappingManager.js";import O from"../../views/interactive/snapping/SnappingOptions.js";import{isSelectableLayer as j}from"../../views/support/selectionUtils.js";import P from"../Attachments/AttachmentsViewModel.js";import R from"./CreateFeaturesWorkflow.js";import H from"./UpdateFeaturesWorkflow.js";import q from"./UpdateWorkflow.js";import{getLayersFromWorkflow as G,isCreateFeaturesWorkflow as x,isUpdateRecordWorkflow as D,isUpdateFeaturesWorkflow as B,isUpdateWorkflow as N,makeMultipleSourceLayersError as Q,whenEditorLayerView as z}from"./workflowUtils.js";import Z from"./support/EditorItem.js";import{makeTemplateGroupInfoForLayer as $}from"../FeatureTemplates/featureTemplatesUtils.js";import J from"../FeatureTemplates/FeatureTemplatesViewModel.js";import K from"../Sketch/SketchViewModel.js";import X from"../Spinner/SpinnerViewModel.js";import{goTo as Y}from"../support/goToUtils.js";import{isFeatureItem as ee,isLayerItem as te}from"../support/SelectionList/selectionListUtils.js";import ie from"../support/SelectionList/SelectionListViewModel.js";import re from"../support/SelectionToolbar/SelectionToolbarViewModel.js";function ae(e,t){return e?.find(e=>e.layer===t)}let oe=class extends n{constructor(e){super(e),this._queuedSelectionTool=null,this._sketchEventListenerHandle=null,this._sketchGraphicsLayer=new b({listMode:"hide",internal:!0,title:"Editor sketch layer"}),this._snappingManager=null,this._templatesByLayer=new Map,this._updateItemsTask=null,this._updateTemplatesTask=null,this._updatingHandles=new F,this._featureTemplatesViewModelIsRestricted=!1,this.activeWorkflow=null,this._activityQueue=new a,this.editorItems=new a,this.failures=[],this.hideTemplatesForInactiveLayers=!1,this.attachmentsViewModel=new P({capabilities:{editing:!0}}),this.featureTemplatesViewModel=new J({disabledItemFunction:({layer:e})=>this._itemIsSuspended(e)}),this.layerInfos=null,this.ownSketchViewModel=new K({layer:this._sketchGraphicsLayer}),this.selectionListViewModel=new ie,this.selectionManager=new A,this.selectionToolbarViewModel=new re({continuousSelectionEnabled:!0,defaultOperationType:"replace",persistSelection:!1,returnGeometry:!1}),this.sketchOptions=new U,this.snappingOptions=new O({attributeRulesEnabled:!0}),this.spinnerViewModel=new X,this.pageStack=[],this.showDiscardEditsPrompt=()=>Promise.resolve(!0),this._candidateCommitted=!1,this.back=async()=>{if("viewing-selection-list"===this.state)return this.selectionListViewModel.filterText=void 0,void this.effectiveSelectionManager.clear();this.canGoBack&&(this.activeWorkflow?.hasPreviousStep?await this.activeWorkflow.back(this.showDiscardEditsPrompt):await this._cancelWorkflow({force:!this.hasPendingEdits}))},this.saveWorkflow=async()=>await(this.activeWorkflow?.save()),this.selectFeature=(e,t=!1)=>{const i=this.activeWorkflow;this._candidateCommitted||"update"!==i?.type||(i.data.rootFeature=e,t&&(i.next(),this._candidateCommitted=!0))}}initialize(){this.addHandles([w(()=>{const e=this.view,t=e?.map?.editableLayers.toArray(),i=e?.allLayerViews,r=i?.filter(e=>!!t?.includes(e.layer));return[t,r,this.layerInfos]},()=>this._updateEditorItems(),g),w(()=>this.hideTemplatesForInactiveLayers,()=>this.syncFeatureTemplates()),w(()=>this._selectionSources,()=>this._syncSelectionSources(),k),m(()=>this.activeWorkflow,"cancel",()=>this.emit("workflow-cancel")),m(()=>this.activeWorkflow,"commit",()=>this.emit("workflow-commit")),m(()=>this.activeWorkflow,"complete",()=>{this.emit("workflow-commit"),this._set("activeWorkflow",null)}),y(()=>!this.activeWorkflow&&this._queuedSelectionTool,()=>this._queuedSelectionTool&&this.selectionToolbarViewModel.activateTool(this._queuedSelectionTool)),w(()=>this.activeWorkflow,e=>this.selectionManager.showHighlight=!e),y(()=>this.view?.map,e=>e.add(this._sketchGraphicsLayer),k),m(()=>this.editorItems,"change",()=>this._afterEditorItemsChange()),w(()=>[this.canCreate,this.canUpdateVisible],()=>this._afterEditorItemsChange()),w(()=>this.page,(e,t)=>{const i=[...this.pageStack];if(-1===i.indexOf(e))i.push(e);else for(;i.length&&i.at(-1)!==e;)i.pop();this.pageStack=i},g),y(()=>"awaiting-update-feature-candidate"===this.state,()=>this._candidateCommitted=!1),m(()=>this.featureTemplatesViewModel,"select",async({item:e,oldItem:t})=>{const{activeWorkflow:i}=this;if(i){if("update"===i.type&&"awaiting-feature-creation-info"===i.activeWorkflow?.stepId)return;try{await this.cancelWorkflow({force:!this.hasPendingEdits})}catch{return void this.featureTemplatesViewModel.select(t,{emit:!1})}}if(!e)return;const r={layer:e.layer,template:e.template};if(e.supportsUpload)return this.featureTemplatesViewModel.select(t,{emit:!1}),this.startCreateFeaturesWorkflow(r);this.startCreateFeaturesWorkflowAtFeatureCreation(r)}),w(()=>[this.view,this.featureTemplatesViewModel],([e,t])=>{t.view=e},g),m(()=>this.view,"key-down",e=>{"Escape"===e.key&&this.activeWorkflow?.keyboardCancellationEnabled&&(e.stopPropagation(),this.back())}),m(()=>this.sketchViewModel,["create","delete","update"],e=>{const{activeWorkflow:t}=this,i="update"===t?.type,r=G(t),a=i?t?.activeWorkflow?.parentLayer??void 0:void 0,o=`sketch-${e.type}`;this.emit(o,{type:o,detail:e,layer:r[0],layers:r,parentLayer:a})},v),w(()=>this.view,e=>{if(this._snappingManager=p(this._snappingManager),!e)return;const t=this.snappingOptions;this._snappingManager=new C({view:e,options:t}),this.ownSketchViewModel.snappingManager=this._snappingManager},g),w(()=>this.snappingOptions,e=>{this._snappingManager&&(this._snappingManager.options=e)},g),m(()=>this.selectionToolbarViewModel,"complete",e=>this._onSelectionComplete(e)),w(()=>({view:this.view,selectionManager:this.effectiveSelectionManager,selectionListViewModel:this.selectionListViewModel,selectionToolbarViewModel:this.selectionToolbarViewModel}),({view:e,selectionManager:t,selectionListViewModel:i,selectionToolbarViewModel:r})=>{t.view=e,i.view=e,r.view=e},g),w(()=>this.effectiveSelectionManager,e=>{this.selectionListViewModel.selectionManager=e,this.selectionToolbarViewModel.selectionManager=e},g)])}destroy(){this._cancelWorkflow({warnIfNoWorkflow:!1}).then(()=>{this.view?.map?.remove(this._sketchGraphicsLayer),this.view=null}),this._updateItemsTask=c(this._updateItemsTask),this._updatingHandles.destroy(),this._sketchEventListenerHandle=u(this._sketchEventListenerHandle),this.selectionListViewModel?.destroy(),this.selectionToolbarViewModel?.destroy(),this.selectionManager.destroy()}get _featureTemplatesLayersAndTables(){const e=new a;for(const t of this.editorItems){const i=this.hideTemplatesForInactiveLayers&&!t.visible;t.supportsCreateFeaturesWorkflow&&!i&&e.push(t.layer)}return e}get _selectionSources(){const e=new a;for(const t of this.editorItems)j(t.layer)&&t.supportsUpdateWorkflow&&t.visible&&e.push(t.layer);return e}get activeFeatureCount(){const e=this.activeLeafWorkflow;return x(e)?e.pendingFeatures.length:D(e)&&e.data.edits.feature?1:B(e)?e.data.features.length:0}get activeLeafWorkflow(){const e=this.activeWorkflow;return e&&N(e)?e.activeWorkflow??e:e}get canCreate(){return this.editorItems.some(e=>e.supportsCreateFeaturesWorkflow)}get canCreateVisible(){return!!this.featureTemplatesLayers.length}get canUpdate(){return this.editorItems.some(e=>e.supportsUpdateWorkflow)}get canUpdateVisible(){return this.editorItems.some(e=>e.supportsUpdateWorkflow&&e.visible)}get featureTemplatesLayers(){return this._featureTemplatesLayersAndTables.filter(e=>"scene"===e.type||!e.isTable)}get effectiveSelectionManager(){return this.selectionManager}get featureFormViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:null}get formViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:"update-features"===e?.type?e.formViewModel:null}get utilityNetworkAssociationAddAssociationViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeUtilityNetworkAssociationAddAssociationViewModel:null}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get sketchViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeSketchViewModel:"create-features"===e?.type||"update-features"===e?.type?e.sketchViewModel:this.ownSketchViewModel}get state(){if(!this.view?.ready)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this,i=!t?.stepId;return this.effectiveSelectionManager.count&&i?"viewing-selection-list":i?"ready":"update"===t.type&&t.activeWorkflow?.stepId?t.activeWorkflow.stepId:t.stepId}get syncing(){return this._activityQueue.length>0}get updating(){return this._updatingHandles.updating||!0===this.activeWorkflow?.updating}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}set view(e){this.ownSketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}get canZoomTo(){const e=this.sketchViewModel,t=e?.createGraphic?.geometry?.type;return!(!e?.updateGraphics?.length&&"multipoint"!==t)}get page(){const{activeWorkflow:e,state:t}=this;if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associatedLayer)return"viewing-associated-features";if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associationId)return"viewing-associated-layers";if("update"===e?.type&&"awaiting-feature-to-update"===e.stepId)return"ready";if("create-features"===e?.type&&0===e.numPendingFeatures){const t=e.data.upload;if(t)return"default"===t.state?"ready":"creating-features-upload-details"}return t??"disabled"}get featureFormDisabled(){const{activeLeafWorkflow:e}=this;if(D(e))return!1===e.data.editorItem?.capabilities.update.attributes||!0===e.featureFormViewModel.disabled;if(B(e)){const{formViewModel:t}=e;return t.disabled||t.readOnly}return!1}get featureFormHasAssociation(){return!!this.featureFormViewModel?.activeAssociation}get canGoBack(){return null!=this.activeWorkflow&&!this.syncing}get shouldShowDeleteButton(){const{activeLeafWorkflow:e}=this;if(D(e)){const{data:t}=e;return t.editorItem?.capabilities.delete.enabled&&!t.readOnly}return!!B(e)&&e.data.editorItems.every(e=>e.capabilities.delete.enabled)}get hasPendingEdits(){return this.activeWorkflow?.hasPendingEdits??!1}get snappingManager(){return this._snappingManager}getTemplatesForLayer(e){return this._templatesByLayer.get(e)??[]}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,"creating-features")}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(await _(()=>!this.updating),!this.canCreate)throw new s("editing:unsupported-workflow","Creating features is unsupported or disabled.");const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const i=this._createCreateFeaturesWorkflow(e,t);this._set("activeWorkflow",i),await i.start()}catch(r){this._logErrorAndCancelWorkflow(r)}finally{i.resolve()}}async startCreateFeaturesWorkflowAtFeatureEdit(e){await _(()=>!this.updating);const t=this._createUpdatingResolver();try{const{initialFeature:t}=e,i=t.sourceLayer=t.layer,r=i?this.findEditorItemForLayer(i):void 0;if(!r?.supportsCreateFeaturesWorkflow)throw new s("editing:unsupported-workflow","Creating features is unsupported or disabled for this layer.");await this._cancelWorkflow();const a=this._createCreateFeaturesWorkflow({initialFeature:t,layer:r.layer,maxFeatures:1},"creating-features");this._set("activeWorkflow",a),await a.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateFeaturesWorkflow(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update features workflow is unsupported or disabled.");if(t(e.map(e=>e.sourceLayer??e.layer)).length>1)throw Q();const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateFeaturesWorkflow(e);this._set("activeWorkflow",t),await t.start()}catch(r){this._logErrorAndCancelWorkflow(r)}finally{i.resolve()}}async startUpdateWorkflowAtFeatureSelection(){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const e=this._createUpdatingResolver();try{await this._cancelWorkflow();const e=this._createUpdateWorkflow();this._set("activeWorkflow",e),await e.start()}catch(t){this._logErrorAndCancelWorkflow(t)}finally{e.resolve()}}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureEdit(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("editing-existing-feature");t.data.rootFeature=e,t.addHandles(m(()=>t,"commit",()=>{t.destroy(),this.activeWorkflow===t&&this._set("activeWorkflow",null)})),this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowWithActiveSelection(){const{selectionListViewModel:e}=this;if(!e.visibleFeatureCount)throw new s("editing:missing-selection","Unable to determine visible selection.");if(e.visibleLayerCount>1)throw new s("editing:features-different-layers","Cannot start workflow with features from different layers.");const t=e.visibleFeatureItems.map(e=>e.graphic);1===t.length?this.startUpdateWorkflowAtFeatureEdit(t[0]):this.startUpdateFeaturesWorkflow(t)}async deleteFeatureFromWorkflow(){o(d.getLogger(this),"EditorViewModel.deleteFeatureFromWorkflow is deprecated. Use EditorViewModel.deleteFeatures instead.",{version:"4.33",replacement:"EditorViewModel.deleteFeatures",warnOnce:!0}),await this.deleteFeatures()}async deleteFeatures(){const e=this.activeWorkflow;return N(e)?e.deleteActiveFeature():B(e)?e.deleteAndCommit():void this._logError("editing:unsupported-workflow","Deleting features requires an active update workflow.")}async deleteAssociationFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?await e.deleteActiveAssociation():this._logError("editing:unsupported-workflow","Deleting an association requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warnIfNoWorkflow:!0,...e})}findEditorItemForLayer(e){return this.editorItems.find(t=>t.layer===e)}itemHasInvalidFormTemplate(e){return null!=e&&!0===this.findEditorItemForLayer(e.layer)?.hasInvalidFormTemplate}syncFeatureTemplates(){this._featureTemplatesViewModelIsRestricted||this._updateTemplates()}zoomTo(e){const{view:t,sketchViewModel:r}=this;if(!t)return;const a=e??r?.createGraphic;if(a)"mesh"===a.geometry?.type?Y(t,a.geometry):Y(t,a);else{const e=r?.updateGraphics?.toArray();"3d"===t.type&&e?.some(e=>"mesh"===e.geometry?.type)?Y(t,e.map(e=>e.geometry).filter(i)):e&&Y(t,e)}}async toggleUpdateWorkflow(){this.canUpdate&&(this.hasPendingEdits&&!await this.showDiscardEditsPrompt()||(this.activeWorkflow&&"awaiting-feature-to-update"===this.state?await this.cancelWorkflow({force:!0}):await this.startUpdateWorkflowAtFeatureSelection()))}async onSelectionListItemSelect(e){ee(e)&&this.startUpdateWorkflowAtFeatureEdit(e.graphic)}async onSelectionListMenuItemSelect(e){if(ee(e))this.startUpdateWorkflowAtFeatureEdit(e.graphic);else if(te(e)){const t=e.featureItems.filter(e=>e.visible).map(e=>e.graphic);1===t.length?this.startUpdateWorkflowAtFeatureEdit(t[0]):this.startUpdateFeaturesWorkflow(t)}}restrictFeatureTemplatesViewModelToLayer(e){return this._featureTemplatesViewModelIsRestricted=!0,this._setFeatureTemplatesViewModelLayers([e]),l(()=>{this._featureTemplatesViewModelIsRestricted=!1,this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)})}async _getEditorItemCandidates(e){const{view:t}=this;if(!t?.map)return[];const{map:i}=t,r=i.editableLayers.toArray(),a=i.allTables.toArray().filter(e=>V(e)||S(e));return await Promise.allSettled([...r.flatMap(e=>this._getLayerLoadPromise(e)),...a.flatMap(e=>this._getLayerLoadPromise(e))]),h(e),[...r.reverse(),...a.reverse()].filter(e=>T(e)&&("mesh"!==e.geometryType||"3d"===t.type)).flatMap(e=>"subtype-group"===e.type?e.sublayers.toArray():e)}_getLayerLoadPromise(e){return S(e)?e.loadAll():e.load()}_drainEditorItems(){this.editorItems.drain(e=>e.destroy())}_updateEditorItems(){c(this._updateItemsTask);const{view:e}=this,t=r(async t=>{if(!e?.map||!e?.allLayerViews)return;const i=await this._getEditorItemCandidates(t);if(!i.length)return void this._drainEditorItems();const r=[],a=[],o=[],{layerInfos:s}=this;for(const l of i){const t=ae(s,l),i=await z(e,l).catch(()=>null);(t?r:i?a:o).push(new Z({layer:l,layerInfo:t,layerView:i}))}s?.length&&r.sort((e,t)=>s.findIndex(({layer:t})=>t===e.layer)-s.findIndex(({layer:e})=>e===t.layer));const n=[...r,...a,...o];t.aborted||(this._drainEditorItems(),this.editorItems.addMany(n))});this._updatingHandles.addPromise(t.promise),this._updateItemsTask=t}_updateTemplates(){c(this._updateTemplatesTask);const e=r(async e=>{const t=this._templatesByLayer,i=this._featureTemplatesLayersAndTables.filter(e=>!t.has(e));if(i.length>0){const r=await E(i.toArray(),this.view,e);for(const{layer:e,templates:i}of r)t.set(e,i)}this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)});this._updatingHandles.addPromise(e.promise),this._updateTemplatesTask=e}_setFeatureTemplatesViewModelLayers(e){const t=this._templatesByLayer,i=[];for(const r of e){const e=t.get(r);e&&e.length>0&&i.push($(r,e))}this.featureTemplatesViewModel.templateInfos=i}_afterEditorItemsChange(){const{activeWorkflow:e}=this;if(this.syncFeatureTemplates(),!e)return;const{stepId:t}=e;"create-features"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdateVisible||"awaiting-update-feature-candidate"===t&&!e.hasUpdatableCandidates)&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e?.warnIfNoWorkflow&&this._logError("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force){this.emit("workflow-cancel"),this._set("activeWorkflow",null);try{await t.cancel(e)}finally{t.destroy()}}else try{await t.cancel(e),this._set("activeWorkflow",null),t.destroy()}catch(i){}}_createCreateFeaturesWorkflow(e,t){return R.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEditsCallback:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureServiceCallback:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_createUpdateFeaturesWorkflow(e){const t=H.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,features:e,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i)});return t.addHandles(m(()=>t,"commit",()=>{t.destroy(),this.activeWorkflow===t&&this._set("activeWorkflow",null)})),t}_createUpdateWorkflow(e){return q.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:e,applyEditsCallback:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureServiceCallback:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_addAttachments(e,t){const i=t.map(t=>this._addAttachment(e,t.feature,t.attachment))??[];return Promise.all(i)}async _addAttachment(e,t,i){let r=null;if(!("addAttachment"in e)||null==e.capabilities?.attachment)throw new s("editor:attachments-not-supported","Adding attachments is not supported for this layer type");return await this._queueOperation(async()=>(r=await(e.addAttachment?.(t,i).catch(e=>{throw e?.error||e}))??null,r)),r}async _applyEdits(e,t,i){let r=null;const a=e.url?await L(e.url):null,o={returnServiceEditsOption:(!a||!I(a))&&!RegExp("/hosted/","i").test(e.url)?"original-and-current-features":void 0,...i};return await this._queueOperation(async()=>{const{view:i}=this;if(!i)return null;const a=await z(i,e).catch(()=>null);return r=await e.applyEdits(t,o),a&&await _(()=>!a.updating),r}),r}async _applyEditsFeatureService(e,t,i){let r=null;return await this._queueOperation(async()=>r=await e.applyEdits(t,i)),r}_queueOperation(e){this._activityQueue.push(e);const t=(e,t)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)};return e().then(e=>(Array.isArray(e)?e.forEach(e=>this._handleEditsResultError(e)):this._handleEditsResultError(e),e)).catch(i=>{this._logError("editing:operation-error","An error occurred.",{error:i});const r={error:i,retry:()=>(t(r,this.failures),this._queueOperation(e)),cancel:()=>{t(r,this.failures)}};this._set("failures",[...this.failures,r])}).then(()=>{t(e,this._activityQueue)})}_handleEditsResultError(e){if(null!=e&&"error"in e&&null!=e.error)throw e.error;if(null!=e&&"addFeatureResults"in e){const{addFeatureResults:t,deleteFeatureResults:i,updateFeatureResults:r}=e,a=t.find(e=>!!e.error)||r.find(e=>!!e.error)||i.find(e=>!!e.error);if(a)throw a.error}}_createUpdatingResolver(){const e=f();return this._updatingHandles.addPromise(e.promise),e}_logErrorAndCancelWorkflow(e){const{name:t,message:i,details:r}=e;this._logError(t??"editing:workflow-start-failed",i??void 0,r??e),this._cancelWorkflow({force:!0})}_itemIsSuspended(e){const t=this.findEditorItemForLayer(e);return null!=t&&(!t.visible||t.disabled)}_logError(e,t,i){d.getLogger(this).error(new s(e,t,i))}_syncSelectionSources(){this.selectionManager.sources.items=this._selectionSources.toArray()}async _onSelectionComplete(e){if(e.aborted)return;const{operationType:t,selection:i}=e,{effectiveSelectionManager:r}=this,a="ready"===this.state,o=1===i.length;if(this._queuedSelectionTool=void 0,a&&o&&(0===r.count&&"add"===t||"replace"===t))return this._queuedSelectionTool=e.toolName,this.startUpdateWorkflowAtFeatureEdit(i[0]);switch(t){case"remove":r.updateSelection({current:[],added:[],removed:i});break;case"replace":r.clear(),r.updateSelection({current:i,added:[],removed:[]});break;case"add":r.updateSelection({current:i,added:[],removed:[]})}}};e([M()],oe.prototype,"_featureTemplatesLayersAndTables",null),e([M()],oe.prototype,"_queuedSelectionTool",void 0),e([M()],oe.prototype,"_snappingManager",void 0),e([M()],oe.prototype,"_selectionSources",null),e([M()],oe.prototype,"activeFeatureCount",null),e([M({readOnly:!0})],oe.prototype,"activeWorkflow",void 0),e([M()],oe.prototype,"activeLeafWorkflow",null),e([M({readOnly:!0})],oe.prototype,"_activityQueue",void 0),e([M({readOnly:!0})],oe.prototype,"canCreate",null),e([M()],oe.prototype,"canCreateVisible",null),e([M({readOnly:!0})],oe.prototype,"canUpdate",null),e([M()],oe.prototype,"canUpdateVisible",null),e([M()],oe.prototype,"featureTemplatesLayers",null),e([M()],oe.prototype,"editorItems",void 0),e([M()],oe.prototype,"effectiveSelectionManager",null),e([M({readOnly:!0})],oe.prototype,"failures",void 0),e([M()],oe.prototype,"hideTemplatesForInactiveLayers",void 0),e([M({type:P})],oe.prototype,"attachmentsViewModel",void 0),e([M()],oe.prototype,"featureFormViewModel",null),e([M()],oe.prototype,"formViewModel",null),e([M()],oe.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),e([M({type:J})],oe.prototype,"featureTemplatesViewModel",void 0),e([M()],oe.prototype,"labelOptions",null),e([M()],oe.prototype,"layerInfos",void 0),e([M()],oe.prototype,"ownSketchViewModel",void 0),e([M()],oe.prototype,"selectionListViewModel",void 0),e([M()],oe.prototype,"selectionManager",void 0),e([M()],oe.prototype,"selectionToolbarViewModel",void 0),e([M()],oe.prototype,"sketchOptions",void 0),e([M()],oe.prototype,"sketchViewModel",null),e([M({type:O,nonNullable:!0})],oe.prototype,"snappingOptions",void 0),e([M()],oe.prototype,"spinnerViewModel",void 0),e([M()],oe.prototype,"state",null),e([M({readOnly:!0})],oe.prototype,"syncing",null),e([M()],oe.prototype,"updating",null),e([M()],oe.prototype,"tooltipOptions",null),e([M()],oe.prototype,"valueOptions",null),e([M()],oe.prototype,"view",null),e([M()],oe.prototype,"canZoomTo",null),e([M()],oe.prototype,"pageStack",void 0),e([M()],oe.prototype,"showDiscardEditsPrompt",void 0),e([M()],oe.prototype,"_candidateCommitted",void 0),e([M()],oe.prototype,"page",null),e([M()],oe.prototype,"featureFormDisabled",null),e([M()],oe.prototype,"featureFormHasAssociation",null),e([M()],oe.prototype,"canGoBack",null),e([M()],oe.prototype,"shouldShowDeleteButton",null),e([M()],oe.prototype,"hasPendingEdits",null),e([M()],oe.prototype,"snappingManager",null),oe=e([W("esri.widgets.Editor.EditorViewModel")],oe);const se=oe;export{se 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{makeHandle as i}from"../../core/handleUtils.js";import"../../core/has.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as s}from"../../core/reactiveUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../layers/GraphicsLayer.js";import{hasEffectiveFeatureExpressionInfo as d}from"../../support/elevationInfoUtils.js";import{highlightsSupported as n}from"../../views/support/layerViewUtils.js";import h from"./UpdateFeatureWorkflowData.js";import{UpdateRecordWorkflow as c,handleKeys as p}from"./UpdateRecordWorkflow.js";import{getVisualVariableAttributes as w,setUpGeometryUpdate as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{makeHandle as i}from"../../core/handleUtils.js";import"../../core/has.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as s}from"../../core/reactiveUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../layers/GraphicsLayer.js";import{hasEffectiveFeatureExpressionInfo as d}from"../../support/elevationInfoUtils.js";import{highlightsSupported as n}from"../../views/support/layerViewUtils.js";import h from"./UpdateFeatureWorkflowData.js";import{UpdateRecordWorkflow as c,handleKeys as p}from"./UpdateRecordWorkflow.js";import{getVisualVariableAttributes as w,setUpGeometryUpdate as u,updateGraphicSymbolWhenRequired as m,swapForEditingSession as y,cloneGraphicExceptMesh as f,canCreateInteractiveEditSession as g,isTerminalUpdateEventType as k}from"./workflowUtils.js";import _ from"../Sketch/SketchViewModel.js";var V;const v={...p,highlights:Symbol(),sketchGraphics:Symbol(),sketchViewModel:Symbol(),waitingForTool:Symbol()};let M=V=class extends c{constructor(e){super(e),this.type="update-feature",this._layerViewEditSession=null,this._sketchGraphicClone=null,this._sketchViewModel=null,this._webStyleCache=new Map}destroy(){this._layerViewEditSession?.rollback()}async commit(){this.removeHandles(v.sketchGraphics);try{const e=this.data.edits.stagedForDelete;await super.commit();const t=this._layerViewEditSession;e?t?.rollback():t?.commit()}catch(e){throw await this._configureSketchViewModel(),new t("editor-workflow:failed-to-commit","An error occurred when sending the updates to the service",{error:e})}}async start(){return await super.start(),await this._initializeSketchViewModel()}_initializeFeatureFormViewModel(){super._initializeFeatureFormViewModel(),this.addHandles([this._featureFormViewModel.on("value-change",e=>{this._layerViewEditSession?.setAttribute(e.fieldName,e.value)}),s(()=>this._featureFormViewModel.feature?.sourceLayer,e=>this._sketchGraphicClone.sourceLayer=e)])}_configureHighlight(){const{edits:e,layerView:t}=this.data;n(t)&&this.addHandles(t.highlight(e.feature),v.highlights)}async _configureSketchViewModel(){const e=this._sketchViewModel;if(!e)return;const{data:t,_featureFormViewModel:i,_sketchGraphicClone:o}=this,{edits:s,viewModel:r}=t,a=s.feature,{view:l}=r,d=w(a),n=await u({feature:a,featureClone:o,visualVariableAttributes:d,sketchViewModel:e,view:l,onUpdate:({geometry:e,attributes:t},o)=>{if(s.updateAttributes(t),s.updateGeometry(e),i.feature&&(i.feature.geometry=e),null!=d.rotation){const{field:e}=d.rotation;i.setValue(e,t[e])}if(null!=d.size){const{field:e}=d.size;i.setValue(e,t[e])}("undo"===o.type||"redo"===o.type||"update"===o.type&&null!=o.toolEventInfo&&k(o.toolEventInfo.type))&&i.notifyFeatureGeometryChanged()},addUpdatingPromise:e=>{this._updatingHandles.addPromise(e)},addHandle:e=>{this.addHandles(e,v.waitingForTool)},webStyleCache:this._webStyleCache});this.addHandles(n,v.sketchGraphics),e.addHandles(n)}async _initializeSketchViewModel(){const{data:e,_sketchGraphicClone:t}=this,{readOnly:s}=e,r=e.edits.feature,{capabilities:a,layer:n}=e.editorItem,{view:h}=e.viewModel;if(this.removeHandles([v.highlights,v.sketchGraphics,v.sketchViewModel,v.waitingForTool]),!a.update.geometry||s||"3d"===h?.type&&d(n.elevationInfo))return{enter:async()=>{this.hasHandles(v.highlights)||this._configureHighlight()},exit:()=>this.removeHandles([v.highlights])};const c=new l({elevationInfo:n.elevationInfo,internal:!0,listMode:"hide",title:"updateFeaturesWorkflow-internal"}),p=new _({allowDeleteKey:!1,layer:c,sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,updateOnGraphicClick:!1,view:h});return this._sketchViewModel=p,h?.map.add(c),await(h?.whenLayerView(c)),this.addHandles(i(()=>{h?.destroyed||h?.map.remove(c),c.destroyed||c.destroy(),this._sketchViewModel=o(p)}),v.sketchViewModel),await m(t,this._webStyleCache,"2d"===h?.type?h.scale:null),this.addHandles([await y(p,r,t)]),{enter:async()=>{this.hasHandles(v.sketchGraphics)||await this._configureSketchViewModel()},exit:()=>this.removeHandles([v.sketchGraphics]),viewModel:p}}_onFullFeatureLoaded(e){super._onFullFeatureLoaded(e);const t=this._sketchGraphicClone=f(e),{edits:i,layerView:o}=this.data;i.updateGeometry(e.geometry),i.trackChanges(),g(o)&&(this._layerViewEditSession=o.createInteractiveEditSession(t))}static async create(e){const t=new V({data:await h.create(e),onCommit:this._onCommitFactory(e.applyEdits)});return t._set("steps",this._createWorkflowSteps(t)),t}get test(){}};e([r()],M.prototype,"_layerViewEditSession",void 0),e([r()],M.prototype,"_sketchGraphicClone",void 0),e([r()],M.prototype,"_sketchViewModel",void 0),M=V=e([a("esri.widgets.Editor.UpdateFeatureWorkflow")],M);export{M as UpdateFeatureWorkflow,v as handleKeys};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../core/Error.js";import s
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../core/Error.js";import{EventedAccessor as s}from"../../core/Evented.js";import{throwIfNotAbortError as i,createResolver as n}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 r}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as a}from"../../core/support/UpdatingHandles.js";let p=class extends s{constructor(t){super(t),this._indexHistory=[],this._lastStepIndex=-1,this._stepIndex=-1,this._updatingHandles=new a,this._handleKeys={afterCommit:"after-commit",beforeCommit:"before-commit"},this.data=void 0,this.started=!1,this.steps=[],this.type=null,this._pendingOperation=null}destroy(){this._updatingHandles.destroy()}get hasNextStep(){const{steps:t}=this;return!!(t&&this._stepIndex<t.filter(t=>!t.parent).length-1)}get hasPreviousStep(){return this._stepIndex>0}get reliesOnOwnerAdminPrivileges(){return!1}get hasInvalidFormTemplate(){return!1}get shouldShowAttachments(){return!1}get shouldAllowAttachmentEditing(){return!1}get stepId(){const{steps:t}=this,e=t&&t[this._stepIndex];return e&&e.id}get helpMessage(){}get hasPendingEdits(){return!1}get keyboardCancellationEnabled(){return!0}get updating(){return this._updatingHandles.updating}async back(t=()=>Promise.resolve(!0)){if(this.hasPendingEdits){if(!await t())return}this.hasPreviousStep?await this.previous({cancelCurrentStep:!0}):await this.cancel({force:!0})}async cancel(t={force:!0}){return!1!==t.force?this._cancel(t):new Promise((s,i)=>{this.emit("cancel-request",{controller:{allow:()=>{this._cancel({...t,force:!0}).then(s)},deny:()=>i(new e("workflow:cancel-denied","Request to cancel workflow was denied."))}})})}async commit(){this.removeHandles(this._handleKeys.beforeCommit),this.onCommit&&await this.onCommit(this.data),this.removeHandles(this._handleKeys.afterCommit),this.emit("commit")}async go(t){const{steps:e}=this,s=e.findIndex(e=>e.id===t);this._indexHistory.push(this._stepIndex),await this._go(s)}async next(){this._indexHistory.push(this._stepIndex),await this._go(this._stepIndex+1)}async previous(t={cancelCurrentStep:!1}){await this._go(this._indexHistory.pop(),t.cancelCurrentStep)}async reset(){await this._cancel({emitCancelEvent:!1}),await this.start()}async save(){await this.commit(),await this.reset()}async start(){this._set("started",!0);const t=-1===this._stepIndex?0:this._stepIndex;await this._go(t)}async _cancel({emitCancelEvent:t=!0,error:e}={}){this.started&&(this._set("started",!1),await this._transaction(()=>this.steps[this._stepIndex]?.tearDown({canceled:!0}))),this.removeHandles([this._handleKeys.afterCommit,this._handleKeys.beforeCommit]),this._resetIndexing(t),t&&this.emit("cancel",{error:e})}_go(t=-1,e=!1){return this._transaction(async()=>{const{steps:s}=this;if(!(t<=-1||t>=s.length)){if(!this.started)return this._stepIndex=t,void this._notifyStepProps();this._lastStepIndex>-1&&await s[this._lastStepIndex].tearDown({canceled:e});try{await s[t].setUp()}catch(n){i(n)}this._lastStepIndex=t,this._stepIndex=t,this._notifyStepProps()}})}async _transaction(t){const e=this._pendingOperation,s=n(),i=(e??Promise.resolve()).then(()=>s.promise);this._pendingOperation=i,this._updatingHandles.addPromise(i);try{e&&await e,await t()}finally{s.resolve(),i===this._pendingOperation&&(this._pendingOperation=null)}}_resetIndexing(t=!0){this._stepIndex=-1,this._lastStepIndex=-1,this._indexHistory.length=0,t&&this._notifyStepProps()}_notifyStepProps(){this.notifyChange("stepId"),this.notifyChange("hasPreviousStep"),this.notifyChange("hasNextStep")}};t([o()],p.prototype,"data",void 0),t([o()],p.prototype,"hasNextStep",null),t([o()],p.prototype,"hasPreviousStep",null),t([o()],p.prototype,"onCommit",void 0),t([o()],p.prototype,"reliesOnOwnerAdminPrivileges",null),t([o()],p.prototype,"hasInvalidFormTemplate",null),t([o()],p.prototype,"shouldShowAttachments",null),t([o()],p.prototype,"shouldAllowAttachmentEditing",null),t([o()],p.prototype,"started",void 0),t([o({readOnly:!0})],p.prototype,"stepId",null),t([o()],p.prototype,"steps",void 0),t([o({readOnly:!0})],p.prototype,"type",void 0),t([o()],p.prototype,"helpMessage",null),t([o()],p.prototype,"hasPendingEdits",null),t([o()],p.prototype,"keyboardCancellationEnabled",null),t([o()],p.prototype,"updating",null),p=t([r("esri.widgets.Editor.Workflow")],p);const h=p;export{h 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Error.js";import{abortHandle as r}from"../../../core/handleUtils.js";import{debounce as a}from"../../../core/promiseUtils.js";import{whenOnce as o,watch as n}from"../../../core/reactiveUtils.js";import{first as l}from"../../../core/SetUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Error.js";import{abortHandle as r}from"../../../core/handleUtils.js";import{debounce as a}from"../../../core/promiseUtils.js";import{whenOnce as o,watch as n}from"../../../core/reactiveUtils.js";import{first as l}from"../../../core/SetUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../core/support/UpdatingHandles.js";import d from"../../../layers/GraphicsLayer.js";import u from"../../../views/interactive/sketch/SketchOptions.js";import{getVisualVariablesForLayer as y,updateGraphicSymbolWhenRequired as m,setVisualVariablesAndElevationInfoForUpdate as w,swapForEditingSession as g,visualVariableInteractiveUpdate as f,getSizeVariableAttribute as v,getRotationVariableAttribute as _}from"../workflowUtils.js";import b from"../../Sketch/SketchViewModel.js";const k=Symbol();let L=class extends t{constructor(e){super(e),this.features=[],this.sketchOptions=new u,this.snappingManager=null,this.sourceLayer=null,this.view=null,this.viewModel=null,this._sketchGraphics=new Map,this._sketchLayer=null,this._updatingHandles=new h,this._visualVariableAttributes=new Map,this._visualVariablesForLayer=null,this._webStyleCache=new Map}async initialize(){this._visualVariablesForLayer=y(this.sourceLayer),this._initializeSketchGraphics(),this._initializeSketchLayer(),await this._updatingHandles.addPromise(this._initializeSketchViewModel())}destroy(){const{_sketchLayer:e,view:t}=this;t?.destroyed||t?.map.remove(e),e.destroy(),this.viewModel.destroy()}get updating(){return this._updatingHandles.updating}async enter(){throw new Error("enter() not implemented")}async exit(){throw new Error("exit() not implemented")}notifyAttributesChanged({features:e,fieldName:t}){const i=this._webStyleCache,s=this.view.scale,r=this._updatingHandles;for(const a of e){const e=this._sketchGraphics.get(a),o=a.getAttribute(t);if(!e||e.getAttribute(t)===o)continue;e.setAttribute(t,o);const n=this._visualVariableAttributes.get(a);null==n?.size||n.size.isUpdatingInteractively||n.size.field!==t||n.size.setInitialValue(o),null==n?.rotation||n.rotation.isUpdatingInteractively||n.rotation.field!==t||n.rotation.setInitialValue(o),r.addPromise(m(e,i,s))}}async startUpdatingFeatures(e,t,s){const{_sketchGraphics:a,sourceLayer:n,view:l,viewModel:c,_webStyleCache:p}=this,h=e.map(e=>a.get(e)).filter(i),d={};this.removeHandles(k),c.complete();let u=null;if(1===e.length){const t=e[0],i=this._visualVariableAttributes.get(t);!(!i?.rotation&&!i?.size)&&(w({sketchViewModel:c,graphic:h[0],sourceLayer:n,visualVariables:i,webStyleCache:p}),"point"===n.geometryType&&(d.enableRotation=null!=i.rotation,d.enableScaling=null!=i.size,u=async e=>{const r=e.graphics[0];f(l,r,e,i)&&(s?.([{feature:t,attributes:r.attributes}],e),this._updatingHandles.addPromise(m(r,p,"2d"===l.type?l.scale:null)))}))}else d.tool="move";const y=()=>c.update(h,d),g=c.on("update",s=>{if("complete"===s.state){if(null===l.activeTool)return void y();const e=new AbortController,t=r(e);return this.addHandles(t,k),void this._updatingHandles.addPromise(o(()=>null===l.activeTool,e.signal).then(async()=>{e.signal.aborted||(e.abort(),await y())}))}const n=e.map(e=>{const t=a.get(e);return t?{feature:e,geometry:t.geometry}:null}).filter(i);t(n,s),u?.(s)});await y(),this.addHandles(g,k),c.addHandles(g)}_initializeSketchGraphics(){const{features:e,_sketchGraphics:t,sourceLayer:i,_visualVariableAttributes:s}=this,r=this._visualVariablesForLayer,a=r.rotation?.field,o=r.size?.field,n={rotation:a?i.getField(a):null,size:o?i.getField(o):null},l=!(!n.rotation&&!n.size);for(const c of e)t.set(c,c.clone()),l&&s.set(c,z(r,n))}_initializeSketchLayer(){const{view:e}=this,t=new d({elevationInfo:this.sourceLayer.elevationInfo,internal:!0,listMode:"hide",title:"SketchController layer"});this._sketchLayer=t,e.map.add(t),this._updatingHandles.addPromise(e.whenLayerView(t))}async _initializeSketchViewModel(){const{_sketchGraphics:e,view:t,_webStyleCache:i}=this,s=Array.from(e.entries()),r=new b({allowDeleteKey:!1,defaultUpdateOptions:{multipleSelectionEnabled:!1},layer:this._sketchLayer,sketchOptions:this.sketchOptions,snappingManager:this.snappingManager,updateOnGraphicClick:!1,view:this.view});this.viewModel=r;const o=a(e=>Promise.all(s.map(([,t])=>m(t,i,e))));await o("2d"===t.type?t.scale:null),"2d"===t.type&&this.addHandles(n(()=>t.scale,e=>o(e))),this.addHandles(await Promise.all(s.map(([e,t])=>g(r,e,t))))}};function S({features:e,sketchOptions:t,snappingManager:i,view:r}){const a=new Set(e.map(e=>e.sourceLayer));if(1!==a.size)throw new s("editor:features-must-belong-to-same-layer","All features must belong to the same layer.");const o=l(a);return new L({view:r,features:e,sketchOptions:t,snappingManager:i,sourceLayer:o})}function z({rotation:e,size:t},i){return{rotation:e?_(e,i.rotation):null,size:t?v(t,i.size):null}}e([c()],L.prototype,"features",void 0),e([c()],L.prototype,"sketchOptions",void 0),e([c()],L.prototype,"snappingManager",void 0),e([c()],L.prototype,"sourceLayer",void 0),e([c()],L.prototype,"updating",null),e([c()],L.prototype,"view",void 0),e([c()],L.prototype,"viewModel",void 0),e([c()],L.prototype,"_sketchGraphics",void 0),e([c()],L.prototype,"_sketchLayer",void 0),e([c()],L.prototype,"_visualVariablesForLayer",void 0),L=e([p("esri.widgets.Editor.support.SketchController")],L);export{L as SketchController,S as createSketchController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../Graphic.js";import i from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import{makeHandle as o}from"../../core/handleUtils.js";import"../../core/has.js";import{destroyMaybe as n,abortMaybe as a}from"../../core/maybe.js";import{ignoreAbortErrors as r,throwIfAborted as l}from"../../core/promiseUtils.js";import{watch as h,syncAndInitial as c,when as p}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import _ from"../../layers/GraphicsLayer.js";import m from"../../symbols/CIMSymbol.js";import v from"../../symbols/SimpleLineSymbol.js";import{ViewEventPriorities as g}from"../../views/input/InputManager.js";import{isPolyline as y}from"./support/geometryUtils.js";import f from"../Sketch/SketchViewModel.js";function b(t){return"2d"===t?new m({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5,color:[0,0,0,255]},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5,color:[255,255,255,255]}]}}}):new v({color:[0,0,0,0]})}let I=class extends i{constructor(t){super(t),this.state="ready",this._pendingStartOptions=null,this._previousInputInfo=null,this._shouldRemoveLastPoint=!1,this._sketchedGraphics=new WeakSet,this._creationToolPromise=null,this._updateToolPromise=null,this._updateDisabled=!1}initialize(){this.addHandles(h(()=>({view:this.tool.viewModel.view,visible:this.tool.visible}),({view:t,visible:e})=>{null!=t&&e?this._attach(t):this._detach()},c),"view")}destroy(){this._detach()}get canStopCreating(){const t=this._geometry,e=this._shouldRemoveLastPoint?3:2;return y(t)&&t.paths.length>0&&t.paths[0].length>=e}get _input(){return this.tool.viewModel.input}set _input(t){this.tool.viewModel.input=t}get _geometry(){return this._input?.geometry}get _visibleAndEditable(){return this.tool.visible&&this.tool.editable}get _view(){return this.tool.viewModel.view}get test(){}start(t={mode:"sketch"}){if(!this.tool.editable)return;const e=this._view;if(null!=e&&e.ready)switch(this._pendingStartOptions=null,this._stopInteraction(),null==this._previousInputInfo&&this._storePreviousInput(this._input),this._setSketchedGraphic(null),t.mode){case"sketch":this._set("state","creating"),this._startCreationInteraction();break;case"select":this._set("state","selecting"),this._startSelectionInteraction()}else this._pendingStartOptions=t}stop(){this._pendingStartOptions=null,this._stopInteractionAndUpdate(),this._clearPreviousInput()}cancel(){this._pendingStartOptions=null,this._stopInteractionAndUpdate(),this._restorePreviousInput()}clear(){this._stopInteractionAndUpdate(),this._set("state","ready"),this._clearPreviousInput(),this._input=null,this._pendingStartOptions=null}isSketchedGraphic(t){return null!=t&&this._sketchedGraphics.has(t)}_attach(t){this._detach();const e={mode:"3d"===t.type?"relative-to-ground":"on-the-ground",offset:null};this._graphicsLayer=new _({listMode:"hide",internal:!0,elevationInfo:e});const i=b(t.type);this._sketchVM=new f({layer:this._graphicsLayer,view:t,defaultCreateOptions:{mode:"click",hasZ:!1},updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"none"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polylineSymbol:i,activeLineSymbol:i}),this.addHandles([p(()=>t.ready,()=>{const t=this._pendingStartOptions;t&&this.start(t)},c),h(()=>[this._input,this._visibleAndEditable],()=>this._update(),c),h(()=>({map:t.map,graphicsLayer:this._graphicsLayer}),({map:t,graphicsLayer:e})=>{null!=t&&null!=e&&t.add(e),this._update()},c)],"main")}_detach(){this.removeHandles("main"),this._sketchVM=n(this._sketchVM),this._creationToolPromise=null,this._updateToolPromise=null;const t=this._view?.map,e=this._graphicsLayer;null!=t&&null!=e&&t.remove(e),this._graphicsLayer=n(this._graphicsLayer),this._shouldRemoveLastPoint=!1,this._set("state","ready")}_startCreationInteraction(){this._stopInteractionAndUpdate();const t=this._view,i=this._sketchVM;if(null==t||null==i)return;this._shouldRemoveLastPoint=!1;const s=i.on("create",t=>{const e=t.graphic;switch(t.state){case"complete":this._shouldRemoveLastPoint=!1,this._setSketchedGraphic(e),this._stopInteractionAndUpdate(),this._clearPreviousInput();break;case"cancel":this.cancel();break;case"active":this._setSketchedGraphic(e),"cursor-update"===t.toolEventInfo?.type&&(this._shouldRemoveLastPoint=!0);break;case"start":this._setSketchedGraphic(e)}}),n=()=>{s.remove();const t=this.canStopCreating,o=this._geometry?.clone();i.cancel(),this._creationToolPromise=null,null!=o&&t?this._shouldRemoveLastPoint&&this._setSketchedGraphic(new e({geometry:S(o)})):this._input=null};this.removeHandles("interaction"),this.addHandles(o(n),"interaction"),this._creationToolPromise=r(i.create("polyline"))}_startReshapeInteraction(){this._stopInteraction();const t=this._view,e=this._sketchVM;if(null==t||null==e)return;const i=e.on("update",t=>{const e=t.graphics[0];switch(t.state){case"complete":this._setSketchedGraphic(e),this._stopInteractionAndUpdate(),this._clearPreviousInput();break;case"active":case"start":this._setSketchedGraphic(e)}}),s=()=>{i.remove(),e.cancel(),this._updateToolPromise=null};this.removeHandles("interaction"),this.addHandles(o(s),"interaction");const n=this._input;n&&(n.visible=!0,this._updateToolPromise=r(e.update(n,{tool:"reshape"})))}_startSelectionInteraction(){this._stopInteraction();const t=this._view;if(null==t)return;const e=t.acquireCursor("crosshair","high");t.closePopup();let i=null;const n=o(()=>a(i)),r=t.on("immediate-click",e=>{e.defer(async()=>{a(i),i=s(async i=>{const{results:s}=await t.hitTest(e);l(i);const o=s.filter(t=>"graphic"===t.type).map(t=>t.graphic).find(t=>null!=t.geometry&&"polyline"===t.geometry.type);o&&(e.preventDefault(),e.stopPropagation(),this._input=o,this._clearPreviousInput(),this._stopInteractionAndUpdate())}),await i.promise})},g.TOOL),h=t.on("key-down",t=>{"Escape"===t.key&&this.cancel()});this.removeHandles("interaction"),this.addHandles([r,h,n,e],"interaction"),t.ready&&t.focus()}_stopInteraction(){this.removeHandles("interaction")}_stopInteractionAndUpdate(){this.hasHandles("interaction")&&(this._updateDisabled=!0,this._stopInteraction(),this._updateDisabled=!1,this._triggerUpdate())}_triggerUpdate(){this._set("state","ready"),this._update()}_update(){if(this._updateDisabled)return;const t=this.state;if("selecting"!==t){if(this._visibleAndEditable){if("creating"===t||"reshaping"===t&&this.isSketchedGraphic(this._input))return}else this.cancel();this._set("state",this._getNextState()),this._updateVisuals()}else this.stop()}_getNextState(){return null==this._input?"ready":this.isSketchedGraphic(this._input)?"creating"===this.state?"creating":this._visibleAndEditable?"reshaping":"reshaping-disabled":"selected"}_updateVisuals(){switch(this.state){case"creating":break;case"reshaping":this._startReshapeInteraction();break;case"reshaping-disabled":{this._stopInteractionAndUpdate();const t=this._input;null!=t&&this.isSketchedGraphic(t)&&(t.visible=!1);break}case"ready":case"selected":this._stopInteractionAndUpdate()}this._updateSketchedGraphic()}_storePreviousInput(t){this._previousInputInfo={graphic:t}}_restorePreviousInput(){const t=this._previousInputInfo;null!=t&&(this._clearPreviousInput(),this._input=t.graphic,this._triggerUpdate())}_clearPreviousInput(){this._previousInputInfo=null}_updateSketchedGraphic(){const t=this._graphicsLayer;if(null==t)return;const e=t.graphics,i=this._input;if(null==i||!this.isSketchedGraphic(i))return void e.removeAll();if(-1===e.indexOf(i))e.removeAll(),e.add(i);else if(1!==e.length){const t=e.filter(t=>t!==i);e.removeMany(t)}}_setSketchedGraphic(t){null!=t&&this._sketchedGraphics.add(t),this._input=t,this._updateSketchedGraphic()}};function S(t){if(y(t)){const e=t.clone();return e.paths=[e.paths[0].slice(0,-1)],e}return t}t([d({nonNullable:!0})],I.prototype,"state",void 0),t([d({nonNullable:!0})],I.prototype,"tool",void 0),t([d()],I.prototype,"canStopCreating",null),t([d()],I.prototype,"_graphicsLayer",void 0),t([d()],I.prototype,"_sketchVM",void 0),t([d()],I.prototype,"_input",null),t([d()],I.prototype,"_geometry",null),t([d()],I.prototype,"_visibleAndEditable",null),t([d()],I.prototype,"_view",null),t([d()],I.prototype,"_shouldRemoveLastPoint",void 0),I=t([u("esri.widgets.ElevationProfile.ElevationProfileInteraction")],I);export{I as ElevationProfileInteraction};
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../Graphic.js";import i from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import{makeHandle as o}from"../../core/handleUtils.js";import"../../core/has.js";import{destroyMaybe as n,abortMaybe as a}from"../../core/maybe.js";import{ignoreAbortErrors as r,throwIfAborted as l}from"../../core/promiseUtils.js";import{watch as h,syncAndInitial as c,when as p}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import _ from"../../layers/GraphicsLayer.js";import m from"../../symbols/CIMSymbol.js";import v from"../../symbols/SimpleLineSymbol.js";import{ViewEventPriorities as g}from"../../views/input/InputManager.js";import{isPolyline as y}from"./support/geometryUtils.js";import f from"../Sketch/SketchViewModel.js";function b(t){return"2d"===t?new m({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5,color:[0,0,0,255]},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5,color:[255,255,255,255]}]}}}):new v({color:[0,0,0,0]})}let I=class extends i{constructor(t){super(t),this.state="ready",this._pendingStartOptions=null,this._previousInputInfo=null,this._shouldRemoveLastPoint=!1,this._sketchedGraphics=new WeakSet,this._creationToolPromise=null,this._updateToolPromise=null,this._updateDisabled=!1}initialize(){this.addHandles(h(()=>({view:this.tool.viewModel.view,visible:this.tool.visible}),({view:t,visible:e})=>{null!=t&&e?this._attach(t):this._detach()},c),"view")}destroy(){this._detach()}get canStopCreating(){const t=this._geometry,e=this._shouldRemoveLastPoint?3:2;return y(t)&&t.paths.length>0&&t.paths[0].length>=e}get _input(){return this.tool.viewModel.input}set _input(t){this.tool.viewModel.input=t}get _geometry(){return this._input?.geometry}get _visibleAndEditable(){return this.tool.visible&&this.tool.editable}get _view(){return this.tool.viewModel.view}get test(){}start(t={mode:"sketch"}){if(!this.tool.editable)return;const e=this._view;if(null!=e&&e.ready)switch(this._pendingStartOptions=null,this._stopInteraction(),null==this._previousInputInfo&&this._storePreviousInput(this._input),this._setSketchedGraphic(null),t.mode){case"sketch":this._set("state","creating"),this._startCreationInteraction();break;case"select":this._set("state","selecting"),this._startSelectionInteraction()}else this._pendingStartOptions=t}stop(){this._pendingStartOptions=null,this._stopInteractionAndUpdate(),this._clearPreviousInput()}cancel(){this._pendingStartOptions=null,this._stopInteractionAndUpdate(),this._restorePreviousInput()}clear(){this._stopInteractionAndUpdate(),this._set("state","ready"),this._clearPreviousInput(),this._input=null,this._pendingStartOptions=null}isSketchedGraphic(t){return null!=t&&this._sketchedGraphics.has(t)}_attach(t){this._detach();const e={mode:"3d"===t.type?"relative-to-ground":"on-the-ground",offset:null};this._graphicsLayer=new _({listMode:"hide",internal:!0,elevationInfo:e,title:"Elevation info"});const i=b(t.type);this._sketchVM=new f({layer:this._graphicsLayer,view:t,defaultCreateOptions:{mode:"click",hasZ:!1},updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"none"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polylineSymbol:i,activeLineSymbol:i}),this.addHandles([p(()=>t.ready,()=>{const t=this._pendingStartOptions;t&&this.start(t)},c),h(()=>[this._input,this._visibleAndEditable],()=>this._update(),c),h(()=>({map:t.map,graphicsLayer:this._graphicsLayer}),({map:t,graphicsLayer:e})=>{null!=t&&null!=e&&t.add(e),this._update()},c)],"main")}_detach(){this.removeHandles("main"),this._sketchVM=n(this._sketchVM),this._creationToolPromise=null,this._updateToolPromise=null;const t=this._view?.map,e=this._graphicsLayer;null!=t&&null!=e&&t.remove(e),this._graphicsLayer=n(this._graphicsLayer),this._shouldRemoveLastPoint=!1,this._set("state","ready")}_startCreationInteraction(){this._stopInteractionAndUpdate();const t=this._view,i=this._sketchVM;if(null==t||null==i)return;this._shouldRemoveLastPoint=!1;const s=i.on("create",t=>{const e=t.graphic;switch(t.state){case"complete":this._shouldRemoveLastPoint=!1,this._setSketchedGraphic(e),this._stopInteractionAndUpdate(),this._clearPreviousInput();break;case"cancel":this.cancel();break;case"active":this._setSketchedGraphic(e),"cursor-update"===t.toolEventInfo?.type&&(this._shouldRemoveLastPoint=!0);break;case"start":this._setSketchedGraphic(e)}}),n=()=>{s.remove();const t=this.canStopCreating,o=this._geometry?.clone();i.cancel(),this._creationToolPromise=null,null!=o&&t?this._shouldRemoveLastPoint&&this._setSketchedGraphic(new e({geometry:S(o)})):this._input=null};this.removeHandles("interaction"),this.addHandles(o(n),"interaction"),this._creationToolPromise=r(i.create("polyline"))}_startReshapeInteraction(){this._stopInteraction();const t=this._view,e=this._sketchVM;if(null==t||null==e)return;const i=e.on("update",t=>{const e=t.graphics[0];switch(t.state){case"complete":this._setSketchedGraphic(e),this._stopInteractionAndUpdate(),this._clearPreviousInput();break;case"active":case"start":this._setSketchedGraphic(e)}}),s=()=>{i.remove(),e.cancel(),this._updateToolPromise=null};this.removeHandles("interaction"),this.addHandles(o(s),"interaction");const n=this._input;n&&(n.visible=!0,this._updateToolPromise=r(e.update(n,{tool:"reshape"})))}_startSelectionInteraction(){this._stopInteraction();const t=this._view;if(null==t)return;const e=t.acquireCursor("crosshair","high");t.closePopup();let i=null;const n=o(()=>a(i)),r=t.on("immediate-click",e=>{e.defer(async()=>{a(i),i=s(async i=>{const{results:s}=await t.hitTest(e);l(i);const o=s.filter(t=>"graphic"===t.type).map(t=>t.graphic).find(t=>null!=t.geometry&&"polyline"===t.geometry.type);o&&(e.preventDefault(),e.stopPropagation(),this._input=o,this._clearPreviousInput(),this._stopInteractionAndUpdate())}),await i.promise})},g.TOOL),h=t.on("key-down",t=>{"Escape"===t.key&&this.cancel()});this.removeHandles("interaction"),this.addHandles([r,h,n,e],"interaction"),t.ready&&t.focus()}_stopInteraction(){this.removeHandles("interaction")}_stopInteractionAndUpdate(){this.hasHandles("interaction")&&(this._updateDisabled=!0,this._stopInteraction(),this._updateDisabled=!1,this._triggerUpdate())}_triggerUpdate(){this._set("state","ready"),this._update()}_update(){if(this._updateDisabled)return;const t=this.state;if("selecting"!==t){if(this._visibleAndEditable){if("creating"===t||"reshaping"===t&&this.isSketchedGraphic(this._input))return}else this.cancel();this._set("state",this._getNextState()),this._updateVisuals()}else this.stop()}_getNextState(){return null==this._input?"ready":this.isSketchedGraphic(this._input)?"creating"===this.state?"creating":this._visibleAndEditable?"reshaping":"reshaping-disabled":"selected"}_updateVisuals(){switch(this.state){case"creating":break;case"reshaping":this._startReshapeInteraction();break;case"reshaping-disabled":{this._stopInteractionAndUpdate();const t=this._input;null!=t&&this.isSketchedGraphic(t)&&(t.visible=!1);break}case"ready":case"selected":this._stopInteractionAndUpdate()}this._updateSketchedGraphic()}_storePreviousInput(t){this._previousInputInfo={graphic:t}}_restorePreviousInput(){const t=this._previousInputInfo;null!=t&&(this._clearPreviousInput(),this._input=t.graphic,this._triggerUpdate())}_clearPreviousInput(){this._previousInputInfo=null}_updateSketchedGraphic(){const t=this._graphicsLayer;if(null==t)return;const e=t.graphics,i=this._input;if(null==i||!this.isSketchedGraphic(i))return void e.removeAll();if(-1===e.indexOf(i))e.removeAll(),e.add(i);else if(1!==e.length){const t=e.filter(t=>t!==i);e.removeMany(t)}}_setSketchedGraphic(t){null!=t&&this._sketchedGraphics.add(t),this._input=t,this._updateSketchedGraphic()}};function S(t){if(y(t)){const e=t.clone();return e.paths=[e.paths[0].slice(0,-1)],e}return t}t([d({nonNullable:!0})],I.prototype,"state",void 0),t([d({nonNullable:!0})],I.prototype,"tool",void 0),t([d()],I.prototype,"canStopCreating",null),t([d()],I.prototype,"_graphicsLayer",void 0),t([d()],I.prototype,"_sketchVM",void 0),t([d()],I.prototype,"_input",null),t([d()],I.prototype,"_geometry",null),t([d()],I.prototype,"_visibleAndEditable",null),t([d()],I.prototype,"_view",null),t([d()],I.prototype,"_shouldRemoveLastPoint",void 0),I=t([u("esri.widgets.ElevationProfile.ElevationProfileInteraction")],I);export{I as ElevationProfileInteraction};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../Color.js";import o
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../Color.js";import{EventedAccessor as o}from"../../core/Evented.js";import{handlesGroup as i}from"../../core/handleUtils.js";import{memoize as r}from"../../core/memoize.js";import{watch as s,syncAndInitial as l,sync as n}from"../../core/reactiveUtils.js";import{generateUUID as p}from"../../core/uuid.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 u}from"../../core/accessorSupport/decorators/subclass.js";import h from"../../geometry/Point.js";import{getConfig as m}from"./support/constants.js";import{binaryFindClosest as c}from"./support/profileUtils.js";import{convertSamples as d,convertStatistics as v}from"./support/unitUtils.js";let f=class extends o{constructor(t){super(t),this.type=null,this.id=p(),this.title=null,this.color=new e("#000000"),this.visible=!0,this._getSamplesMemoized=r((t,e)=>d(t,e)),this._getStatisticsMemoized=r((t,e)=>v(t,e)),this.viewVisualizationEnabled=!0,this.result=null,this.effectiveUnits=null,this.numSamplesForPreview=30,this.numSamplesPerChunk=200,this.chartFillEnabled=!0,this.chartStrokeWidth=1.5,this.chartStrokeOffsetY=0,this._viewModel=null}get progress(){return null!=this.result&&this.visible?this.result.progress:0}get samples(){return this._getSamplesMemoized(this.result,this.effectiveUnits)}get statistics(){return this._getStatisticsMemoized(this.result,this.effectiveUnits)}get hoveredPoint(){const t=this._viewModel?.hoveredChartPosition;return null!=t?this._getPoint(t):null}get available(){return!0}get hasZ(){const t=this.result;return null!=t&&t.hasZ}get minDemResolution(){return m().defaultDemResolution}queryElevation(){throw new Error("not implemented")}attach(t){return this._viewModel=t,i([s(()=>t.effectiveUnits,t=>{this.effectiveUnits=t},l),s(()=>[t.input],()=>this._onChange(),n)])}toggleVisibility(t){this.visible=void 0===t?!this.visible:t}_onChange(){this.emit("change")}_getPoint(t){const{samples:e,result:o}=this;if(null==e||null==o)return null;const i=e.length;if(0===i)return null;const r=e[i-1].distance,s=c(e,t*r,t=>t.distance);if(null==s)return null;const{x:l,y:n,z:p}=s;return null==p?null:new h({x:l,y:n,z:p,spatialReference:o.spatialReference})}};t([a({nonNullable:!0})],f.prototype,"id",void 0),t([a()],f.prototype,"title",void 0),t([a({type:e,nonNullable:!0})],f.prototype,"color",void 0),t([a({nonNullable:!0})],f.prototype,"visible",void 0),t([a({readOnly:!0})],f.prototype,"progress",null),t([a({readOnly:!0})],f.prototype,"samples",null),t([a({readOnly:!0})],f.prototype,"statistics",null),t([a()],f.prototype,"hoveredPoint",null),t([a()],f.prototype,"viewVisualizationEnabled",void 0),t([a()],f.prototype,"available",null),t([a()],f.prototype,"result",void 0),t([a()],f.prototype,"effectiveUnits",void 0),t([a()],f.prototype,"numSamplesForPreview",void 0),t([a()],f.prototype,"numSamplesPerChunk",void 0),t([a()],f.prototype,"chartFillEnabled",void 0),t([a()],f.prototype,"chartStrokeWidth",void 0),t([a()],f.prototype,"chartStrokeOffsetY",void 0),t([a({readOnly:!0})],f.prototype,"hasZ",null),t([a({readOnly:!0})],f.prototype,"minDemResolution",null),t([a()],f.prototype,"_viewModel",void 0),f=t([u("esri.widgets.ElevationProfile.ElevationProfileLine")],f);const y=f;export{y 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{isSome as o}from"../../../core/arrayUtils.js";import l from"../../../core/Clonable.js";import a from"../../../core/Collection.js";import i from"../../../core/Identifiable.js";import{ignoreAbortErrors as s,debounce as n}from"../../../core/promiseUtils.js";import{watch as u,initial as d}from"../../../core/reactiveUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../rest/support/RelationshipQuery.js";import{getFixedFieldName as c,isRelatableFeatureSupportedLayer as g,findRelatedLayer as C}from"../support/featureUtils.js";import{getFieldsInTitleAndDesc as b}from"../../FeatureForm/featureFormUtils.js";const F=100;let _=class extends(l.ClonableMixin(i.IdentifiableMixin(r))){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.activeCategory=null,this.allCategories=null,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await s(this._query()),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const e=new AbortController;this._queryFeatureCountAbortController=e,await s(this._queryFeatureCount()),this._queryFeatureCountAbortController===e&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const e=new AbortController;this._queryPageAbortController=e,await s(this._queryPage()),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryDebounced=n(this._queryController,F),this._queryFeatureCountDebounced=n(this._queryFeatureCountController,F),this._queryPageDebounced=n(this._queryPageController,F),this._query=async()=>{const{_queryAbortController:e,relatedFeatures:t}=this;this.featureCount&&("subtype-group"!==this.relatedLayer?.type||this.activeCategory)&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,t.destroyAll(),this.destroyed||t.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:e?.signal}))))},this.addHandles([u(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount,this.activeCategory],()=>this._queryDebounced(),d),u(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),u(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery,this.activeCategory],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:r}=this,o=1,l=Math.ceil(r/t)||1;this._set("featurePage",Math.min(Math.max(e,o),l))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(e=>{const r=e.clone();return r.field=c(e.field,t),r}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get canLoad(){return!!this.map&&null!=this.relationshipId&&"number"==typeof this.objectId}get canQuery(){const e=this.layer?.capabilities?.queryRelated;return!!(this.relatedLayer&&this.relationship&&null!=this.relationshipId&&null!=this.objectId&&e?.supportsCount&&e?.supportsPagination)}get allCategoriesCount(){return this.allCategories?.length??0}get categories(){const{allCategories:e}=this;return this.showAllEnabled?e:e?.slice(0,this.displayCount)??null}set displayCount(e){const t=0,r=10,o=3;this._set("displayCount",Math.min(Math.max(e??o,t),r))}get displayCount(){return this._get("displayCount")}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new a}get relatedLayer(){const{layer:e,map:t,relationship:r}=this;if(!e?.loaded||!t||!r)return null;const o="subtype-sublayer"===e.type&&e.parent&&g(e.parent)?e.parent:e;return C(t,o,r)??null}get relatedLayerKeyField(){const{relatedLayer:e,relationshipId:t}=this;return e?.loaded&&null!=t?e.relationships?.find(e=>e.id===t)?.keyField:null}get relatedLayerKeyFields(){const{relatedLayer:e}=this;return e?.loaded?e.relationships?.map(e=>e.keyField).filter(o)??[]:[]}get relationship(){const{relationshipId:e,layer:t}=this;return null!=e&&t?.loaded?t.relationships?.find(({id:t})=>t===e)??null:null}get relationshipKey(){const{relationshipKeyField:e}=this;return(e&&this.graphic?.attributes?.[e])??null}get relationshipKeyField(){return this.relationship?.keyField||null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new a}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,canQuery:o,_loaded:l,canLoad:a}=this;return t||a&&!l?"loading":e||r?"querying":o?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.destroyAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t}=this;await(e?.load()),await(t?.load());const{_queryFeatureCountAbortController:r,activeCategory:l,canQuery:a,objectId:i,relatedLayerKeyField:s,relationshipId:n,relationshipKey:u,supportsCacheHint:d}=this;if(!a||!e||!t||null==i)return this._set("featureCount",0),void this._set("allCategories",null);if("subtype-group"===t?.type&&!l){if(this._set("featureCount",0),this._destroyRelatedFeatureViewModels(),this.featurePage=1,this.relatedFeatures.destroyAll(),s&&null!=u){const{default:e}=await import("../../../smartMapping/statistics/uniqueValues.js"),{uniqueValueInfos:l}=await e({layer:t,sqlWhere:`${s} = '${u}'`,field:t.subtypeField,signal:r?.signal}),a=l.map(({count:e,value:r})=>{const o=t.subtypes?.find(e=>e.code===r)?.name;return null!=r&&o?{count:e,value:r,name:o}:void 0}).filter(o);this._set("allCategories",a)}return}const{historicMoment:y,gdbVersion:h}=e,c=new p({cacheHint:d,gdbVersion:h,historicMoment:y,relationshipId:n,returnGeometry:!1,objectIds:[i],where:this._getRelationshipWhereClause(t)}),g=await e.queryRelatedFeaturesCount(c,{signal:r?.signal});this._set("allCategories",null),this._set("featureCount",g[i]||0)}_getRelationshipWhereClause(e){const{activeCategory:t}=this,r=e.createQuery(),o="subtypeField"in e?e.subtypeField:void 0,l=t&&o?`${o} = ${t.value}`:void 0,a=r.where;return a&&l?`(${a}) AND (${l})`:a??l}_sliceFeatures(e){const{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:o,featureCount:l}=this;!r||t<2||!l||"subtype-group"===this.relatedLayer?.type&&!this.activeCategory||e.addMany(await this._queryRelatedFeatures({signal:o?.signal}))}async _queryRelatedFeatures(e){const{displayCount:t,featureCount:r,featurePage:o,featuresPerPage:l,layer:a,orderByFieldsFixedCasing:i,relatedLayer:s,relatedLayerKeyFields:n,relationshipId:u,showAllEnabled:d,supportsCacheHint:y}=this,{canQuery:h,objectId:c}=this;if(!h||!a||!s||null==c)return[];const g=d?((o-1)*l+r)%r:0,C=d?l:t,F=s.objectIdField,_="subtypeField"in s?s.subtypeField:void 0,m=[...i.map(e=>e.field),...b(s),...n,F,_].filter(f),q=i.map(e=>`${e.field} ${e.order}`),{historicMoment:A,gdbVersion:w}=a,P=new p({orderByFields:q,start:g,num:C,outFields:m,cacheHint:y,historicMoment:A,gdbVersion:w,relationshipId:u,returnGeometry:!1,objectIds:[c],where:this._getRelationshipWhereClause(s)}),v=await a.queryRelatedFeatures(P,{signal:e?.signal}),j=v[c]?.features||[];return"subtype-group"===s.type&&_?j.forEach(e=>{const t=e.attributes[_],r=s.findSublayerForSubtypeCode?.(t);e.sourceLayer=r,e.layer=r}):j.forEach(e=>{e.sourceLayer=s,e.layer=s}),j}};function f(e){return null!=e&&""!==e}e([y()],_.prototype,"_loaded",void 0),e([y()],_.prototype,"_queryAbortController",void 0),e([y()],_.prototype,"_queryPageAbortController",void 0),e([y()],_.prototype,"_queryFeatureCountAbortController",void 0),e([y({value:1})],_.prototype,"featurePage",null),e([y()],_.prototype,"featuresPerPage",void 0),e([y({readOnly:!0})],_.prototype,"orderByFieldsFixedCasing",null),e([y({readOnly:!0})],_.prototype,"supportsCacheHint",null),e([y({readOnly:!0})],_.prototype,"canLoad",null),e([y({readOnly:!0})],_.prototype,"canQuery",null),e([y()],_.prototype,"activeCategory",void 0),e([y({readOnly:!0})],_.prototype,"allCategories",void 0),e([y({readOnly:!0})],_.prototype,"allCategoriesCount",null),e([y({readOnly:!0})],_.prototype,"categories",null),e([y()],_.prototype,"description",void 0),e([y({value:3})],_.prototype,"displayCount",null),e([y({type:t})],_.prototype,"graphic",void 0),e([y({readOnly:!0})],_.prototype,"itemDescriptionFieldName",null),e([y()],_.prototype,"layer",void 0),e([y()],_.prototype,"map",void 0),e([y({readOnly:!0})],_.prototype,"objectId",null),e([y({readOnly:!0})],_.prototype,"objectIdField",null),e([y()],_.prototype,"orderByFields",void 0),e([y({readOnly:!0})],_.prototype,"relatedFeatures",null),e([y({readOnly:!0})],_.prototype,"relatedLayer",null),e([y({readOnly:!0})],_.prototype,"relatedLayerKeyField",null),e([y({readOnly:!0})],_.prototype,"relatedLayerKeyFields",null),e([y({readOnly:!0})],_.prototype,"relationship",null),e([y({readOnly:!0})],_.prototype,"relationshipKey",null),e([y({readOnly:!0})],_.prototype,"relationshipKeyField",null),e([y({readOnly:!0})],_.prototype,"featureCount",void 0),e([y({readOnly:!0})],_.prototype,"relatedFeatureViewModels",null),e([y()],_.prototype,"relationshipId",void 0),e([y()],_.prototype,"showAllEnabled",void 0),e([y()],_.prototype,"state",null),e([y()],_.prototype,"title",void 0),_=e([h("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],_);export{_ as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{isSome as o}from"../../../core/arrayUtils.js";import{ClonableMixin as l}from"../../../core/Clonable.js";import a from"../../../core/Collection.js";import{IdentifiableMixin as i}from"../../../core/Identifiable.js";import{ignoreAbortErrors as s,debounce as n}from"../../../core/promiseUtils.js";import{watch as u,initial as d}from"../../../core/reactiveUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../rest/support/RelationshipQuery.js";import{getFixedFieldName as c,isRelatableFeatureSupportedLayer as g,findRelatedLayer as C}from"../support/featureUtils.js";import{getFieldsInTitleAndDesc as b}from"../../FeatureForm/featureFormUtils.js";const F=100;let _=class extends(l(i(r))){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.activeCategory=null,this.allCategories=null,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await s(this._query()),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const e=new AbortController;this._queryFeatureCountAbortController=e,await s(this._queryFeatureCount()),this._queryFeatureCountAbortController===e&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const e=new AbortController;this._queryPageAbortController=e,await s(this._queryPage()),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryDebounced=n(this._queryController,F),this._queryFeatureCountDebounced=n(this._queryFeatureCountController,F),this._queryPageDebounced=n(this._queryPageController,F),this._query=async()=>{const{_queryAbortController:e,relatedFeatures:t}=this;this.featureCount&&("subtype-group"!==this.relatedLayer?.type||this.activeCategory)&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,t.destroyAll(),this.destroyed||t.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:e?.signal}))))},this.addHandles([u(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount,this.activeCategory],()=>this._queryDebounced(),d),u(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),u(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery,this.activeCategory],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:r}=this,o=1,l=Math.ceil(r/t)||1;this._set("featurePage",Math.min(Math.max(e,o),l))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(e=>{const r=e.clone();return r.field=c(e.field,t),r}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get canLoad(){return!!this.map&&null!=this.relationshipId&&"number"==typeof this.objectId}get canQuery(){const e=this.layer?.capabilities?.queryRelated;return!!(this.relatedLayer&&this.relationship&&null!=this.relationshipId&&null!=this.objectId&&e?.supportsCount&&e?.supportsPagination)}get allCategoriesCount(){return this.allCategories?.length??0}get categories(){const{allCategories:e}=this;return this.showAllEnabled?e:e?.slice(0,this.displayCount)??null}set displayCount(e){const t=0,r=10,o=3;this._set("displayCount",Math.min(Math.max(e??o,t),r))}get displayCount(){return this._get("displayCount")}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new a}get relatedLayer(){const{layer:e,map:t,relationship:r}=this;if(!e?.loaded||!t||!r)return null;const o="subtype-sublayer"===e.type&&e.parent&&g(e.parent)?e.parent:e;return C(t,o,r)??null}get relatedLayerKeyField(){const{relatedLayer:e,relationshipId:t}=this;return e?.loaded&&null!=t?e.relationships?.find(e=>e.id===t)?.keyField:null}get relatedLayerKeyFields(){const{relatedLayer:e}=this;return e?.loaded?e.relationships?.map(e=>e.keyField).filter(o)??[]:[]}get relationship(){const{relationshipId:e,layer:t}=this;return null!=e&&t?.loaded?t.relationships?.find(({id:t})=>t===e)??null:null}get relationshipKey(){const{relationshipKeyField:e}=this;return(e&&this.graphic?.attributes?.[e])??null}get relationshipKeyField(){return this.relationship?.keyField||null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new a}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,canQuery:o,_loaded:l,canLoad:a}=this;return t||a&&!l?"loading":e||r?"querying":o?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.destroyAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t}=this;await(e?.load()),await(t?.load());const{_queryFeatureCountAbortController:r,activeCategory:l,canQuery:a,objectId:i,relatedLayerKeyField:s,relationshipId:n,relationshipKey:u,supportsCacheHint:d}=this;if(!a||!e||!t||null==i)return this._set("featureCount",0),void this._set("allCategories",null);if("subtype-group"===t?.type&&!l){if(this._set("featureCount",0),this._destroyRelatedFeatureViewModels(),this.featurePage=1,this.relatedFeatures.destroyAll(),s&&null!=u){const{default:e}=await import("../../../smartMapping/statistics/uniqueValues.js"),{uniqueValueInfos:l}=await e({layer:t,sqlWhere:`${s} = '${u}'`,field:t.subtypeField,signal:r?.signal}),a=l.map(({count:e,value:r})=>{const o=t.subtypes?.find(e=>e.code===r)?.name;return null!=r&&o?{count:e,value:r,name:o}:void 0}).filter(o);this._set("allCategories",a)}return}const{historicMoment:y,gdbVersion:h}=e,c=new p({cacheHint:d,gdbVersion:h,historicMoment:y,relationshipId:n,returnGeometry:!1,objectIds:[i],where:this._getRelationshipWhereClause(t)}),g=await e.queryRelatedFeaturesCount(c,{signal:r?.signal});this._set("allCategories",null),this._set("featureCount",g[i]||0)}_getRelationshipWhereClause(e){const{activeCategory:t}=this,r=e.createQuery(),o="subtypeField"in e?e.subtypeField:void 0,l=t&&o?`${o} = ${t.value}`:void 0,a=r.where;return a&&l?`(${a}) AND (${l})`:a??l}_sliceFeatures(e){const{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:o,featureCount:l}=this;!r||t<2||!l||"subtype-group"===this.relatedLayer?.type&&!this.activeCategory||e.addMany(await this._queryRelatedFeatures({signal:o?.signal}))}async _queryRelatedFeatures(e){const{displayCount:t,featureCount:r,featurePage:o,featuresPerPage:l,layer:a,orderByFieldsFixedCasing:i,relatedLayer:s,relatedLayerKeyFields:n,relationshipId:u,showAllEnabled:d,supportsCacheHint:y}=this,{canQuery:h,objectId:c}=this;if(!h||!a||!s||null==c)return[];const g=d?((o-1)*l+r)%r:0,C=d?l:t,F=s.objectIdField,_="subtypeField"in s?s.subtypeField:void 0,m=[...i.map(e=>e.field),...b(s),...n,F,_].filter(f),q=i.map(e=>`${e.field} ${e.order}`),{historicMoment:A,gdbVersion:w}=a,P=new p({orderByFields:q,start:g,num:C,outFields:m,cacheHint:y,historicMoment:A,gdbVersion:w,relationshipId:u,returnGeometry:!1,objectIds:[c],where:this._getRelationshipWhereClause(s)}),v=await a.queryRelatedFeatures(P,{signal:e?.signal}),j=v[c]?.features||[];return"subtype-group"===s.type&&_?j.forEach(e=>{const t=e.attributes[_],r=s.findSublayerForSubtypeCode?.(t);e.sourceLayer=r,e.layer=r}):j.forEach(e=>{e.sourceLayer=s,e.layer=s}),j}};function f(e){return null!=e&&""!==e}e([y()],_.prototype,"_loaded",void 0),e([y()],_.prototype,"_queryAbortController",void 0),e([y()],_.prototype,"_queryPageAbortController",void 0),e([y()],_.prototype,"_queryFeatureCountAbortController",void 0),e([y({value:1})],_.prototype,"featurePage",null),e([y()],_.prototype,"featuresPerPage",void 0),e([y({readOnly:!0})],_.prototype,"orderByFieldsFixedCasing",null),e([y({readOnly:!0})],_.prototype,"supportsCacheHint",null),e([y({readOnly:!0})],_.prototype,"canLoad",null),e([y({readOnly:!0})],_.prototype,"canQuery",null),e([y()],_.prototype,"activeCategory",void 0),e([y({readOnly:!0})],_.prototype,"allCategories",void 0),e([y({readOnly:!0})],_.prototype,"allCategoriesCount",null),e([y({readOnly:!0})],_.prototype,"categories",null),e([y()],_.prototype,"description",void 0),e([y({value:3})],_.prototype,"displayCount",null),e([y({type:t})],_.prototype,"graphic",void 0),e([y({readOnly:!0})],_.prototype,"itemDescriptionFieldName",null),e([y()],_.prototype,"layer",void 0),e([y()],_.prototype,"map",void 0),e([y({readOnly:!0})],_.prototype,"objectId",null),e([y({readOnly:!0})],_.prototype,"objectIdField",null),e([y()],_.prototype,"orderByFields",void 0),e([y({readOnly:!0})],_.prototype,"relatedFeatures",null),e([y({readOnly:!0})],_.prototype,"relatedLayer",null),e([y({readOnly:!0})],_.prototype,"relatedLayerKeyField",null),e([y({readOnly:!0})],_.prototype,"relatedLayerKeyFields",null),e([y({readOnly:!0})],_.prototype,"relationship",null),e([y({readOnly:!0})],_.prototype,"relationshipKey",null),e([y({readOnly:!0})],_.prototype,"relationshipKeyField",null),e([y({readOnly:!0})],_.prototype,"featureCount",void 0),e([y({readOnly:!0})],_.prototype,"relatedFeatureViewModels",null),e([y()],_.prototype,"relationshipId",void 0),e([y()],_.prototype,"showAllEnabled",void 0),e([y()],_.prototype,"state",null),e([y()],_.prototype,"title",void 0),_=e([h("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],_);export{_ as default};
|