@arcgis/core 5.1.0-next.18 → 5.1.0-next.19
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/Camera.d.ts +1 -1
- package/Ground.d.ts +7 -7
- package/PopupTemplate.d.ts +6 -6
- package/WebScene.d.ts +1 -1
- package/analysis/AreaMeasurementAnalysis.d.ts +1 -1
- package/analysis/DirectLineMeasurementAnalysis.d.ts +1 -1
- package/analysis/LengthDimension.d.ts +4 -4
- package/analysis/ShadowCastAnalysis.d.ts +3 -3
- package/analysis/SliceAnalysis.d.ts +1 -1
- package/analysis/SlicePlane.d.ts +1 -1
- package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +1 -1
- package/analysis/VolumeMeasurementAnalysis.d.ts +1 -1
- package/applications/Components/applySetUtils.d.ts +1 -1
- package/applications/WebEditor/geometryUtils.d.ts +26 -0
- package/applications/WebEditor/geometryUtils.js +2 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/045e4e520d6dffe06ba7.js +1 -0
- package/assets/esri/core/workers/chunks/05d6cd51ca970705e46a.js +1 -0
- package/assets/esri/core/workers/chunks/{fd125618f513bc2f5206.js → 08d73543c713984f6ecf.js} +1 -1
- package/assets/esri/core/workers/chunks/{982e709d2cef971ecd82.js → 0d9d33f29124d464a4cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{07317f6b57c1314db442.js → 0e1d559d05229ef92e35.js} +1 -1
- package/assets/esri/core/workers/chunks/{2762149a922275136171.js → 112227b862b935123ddf.js} +2 -2
- package/assets/esri/core/workers/chunks/128cdb4a02549abc68b5.js +1 -0
- package/assets/esri/core/workers/chunks/1336f685bae5f1251558.js +1 -0
- package/assets/esri/core/workers/chunks/{b71e4f48377fefe2537d.js → 15d46482ec096e3ce161.js} +1 -1
- package/assets/esri/core/workers/chunks/1794db88a2006711eff3.js +1 -0
- package/assets/esri/core/workers/chunks/{a327f36561f093dc0fab.js → 19fcc74d34cbbaa56a41.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0d1378e714ff0e43e26.js → 1cfa8d404d42b9eccf78.js} +1 -1
- package/assets/esri/core/workers/chunks/1e916e552ce7d53692d2.js +1 -0
- package/assets/esri/core/workers/chunks/2011da6dfc4bb89829c6.js +1 -0
- package/assets/esri/core/workers/chunks/{1e29a114c1cfe21121c4.js → 203ef5459fc5dde12851.js} +1 -1
- package/assets/esri/core/workers/chunks/215c54520d0da638fe57.js +1 -0
- package/assets/esri/core/workers/chunks/22045f85e503ae0ec8f4.js +1 -0
- package/assets/esri/core/workers/chunks/{78fc7ef00cc4931ef47d.js → 2351b713ba3d05de0728.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a4ebb5dca630a4ab0dd.js → 236f8137ae505c8f0764.js} +1 -1
- package/assets/esri/core/workers/chunks/249630af2fb01257eb75.js +1 -0
- package/assets/esri/core/workers/chunks/{1f30558e3ad6ac68bdb8.js → 25d34552bfb255af9467.js} +1 -1
- package/assets/esri/core/workers/chunks/{7cd4280d24b24045bd7e.js → 27e14277128446e76b45.js} +1 -1
- package/assets/esri/core/workers/chunks/3214763f268622f09986.js +1 -0
- package/assets/esri/core/workers/chunks/32a1ccc145c9f6091e13.js +1 -0
- package/assets/esri/core/workers/chunks/34691b147318b2cfdd45.js +1 -0
- package/assets/esri/core/workers/chunks/{18c05353d6d8950d1491.js → 36215b2c0b1020743458.js} +1 -1
- package/assets/esri/core/workers/chunks/3d3b1ce112be6ea31d93.js +1 -0
- package/assets/esri/core/workers/chunks/{2badadf8032e166b34ec.js → 3f3c63420644f9522ab1.js} +1 -1
- package/assets/esri/core/workers/chunks/41108f58f0f439ebba3f.js +1 -0
- package/assets/esri/core/workers/chunks/{bc9997d15ec0a86793c6.js → 415957a42e45eb21aa84.js} +1 -1
- package/assets/esri/core/workers/chunks/43c797bfc2191b51875b.js +1 -0
- package/assets/esri/core/workers/chunks/460a82f3e4838b13e3b4.js +1 -0
- package/assets/esri/core/workers/chunks/4ad6f80488aa218b95e3.js +1 -0
- package/assets/esri/core/workers/chunks/4e9863a11d09900baf30.js +1 -0
- package/assets/esri/core/workers/chunks/4fe210314813ea1f7a26.js +1 -0
- package/assets/esri/core/workers/chunks/5028de543cc1b8e60e65.js +1 -0
- package/assets/esri/core/workers/chunks/52705ccbb452a3edb064.js +1 -0
- package/assets/esri/core/workers/chunks/{17b39b88547968048113.js → 531c55f3b8e708ccf767.js} +1 -1
- package/assets/esri/core/workers/chunks/{72acfb74fd9ab9bae923.js → 53e348f5585fa8c53fe8.js} +2 -2
- package/assets/esri/core/workers/chunks/54c545f44b7ce21fb604.js +1 -0
- package/assets/esri/core/workers/chunks/558e9fed2e58cbbf9947.js +1 -0
- package/assets/esri/core/workers/chunks/{b50d2d3379654de1f2f3.js → 58134617fb7530836b81.js} +1 -1
- package/assets/esri/core/workers/chunks/58c4be467a922fe37f01.js +1 -0
- package/assets/esri/core/workers/chunks/{ec4e2f18453e1cb68fed.js → 5f10f39835cb40179000.js} +1 -1
- package/assets/esri/core/workers/chunks/{7b1964255722e756eba3.js → 5f9eeab833a6c08c76c4.js} +1 -1
- package/assets/esri/core/workers/chunks/651b46aeabf22ff53a38.js +1 -0
- package/assets/esri/core/workers/chunks/65f86594c42ff82095fe.js +1 -0
- package/assets/esri/core/workers/chunks/{90316fb569389d48920f.js → 666f201d222c50ab8428.js} +1 -1
- package/assets/esri/core/workers/chunks/677f5e444ff588ab670f.js +1 -0
- package/assets/esri/core/workers/chunks/{323f6077a659416c4cee.js → 6a9a96aa811c1d3b6edb.js} +1 -1
- package/assets/esri/core/workers/chunks/6bf7d8de86b9eb76f920.js +1 -0
- package/assets/esri/core/workers/chunks/6c0b7890c8eec7febe28.js +1 -0
- package/assets/esri/core/workers/chunks/{25c189e894927099c239.js → 6c85396c90941a042c33.js} +1 -1
- package/assets/esri/core/workers/chunks/{18b0776aef1536867ab8.js → 6f337c3ccd84d90a35e5.js} +1 -1
- package/assets/esri/core/workers/chunks/711bec78dc00fad0f78d.js +1 -0
- package/assets/esri/core/workers/chunks/7382c9882525101eddad.js +1 -0
- package/assets/esri/core/workers/chunks/778ab9e4c3928b0d7d74.js +1 -0
- package/assets/esri/core/workers/chunks/{a3e8b7185d63a0f85931.js → 79c69ae86a1f4a56f7c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{0420fb4b3592f8a26b1f.js → 7d2b1e5402a88b6bee85.js} +1 -1
- package/assets/esri/core/workers/chunks/7ec83fc059325e207825.js +1 -0
- package/assets/esri/core/workers/chunks/7f385e9c88df3395e678.js +1 -0
- package/assets/esri/core/workers/chunks/{66ed527cd8ad11d008be.js → 80d51d58db09b9f96cb5.js} +1 -1
- package/assets/esri/core/workers/chunks/81a45d7e9dadf678b584.js +1 -0
- package/assets/esri/core/workers/chunks/81c758bdc07ed9d9a132.js +1 -0
- package/assets/esri/core/workers/chunks/{8670d9d11950f3c61b79.js → 83711695e16912e9b9c5.js} +1 -1
- package/assets/esri/core/workers/chunks/8c3bf66f8543cedc72ef.js +1 -0
- package/assets/esri/core/workers/chunks/8cade3af17a8bb6d4e37.js +1 -0
- package/assets/esri/core/workers/chunks/920d6330df72e2f01d19.js +1 -0
- package/assets/esri/core/workers/chunks/9dc7abca1d1eb9ba5b58.js +1 -0
- package/assets/esri/core/workers/chunks/9e054c264b17f04b7efa.js +1 -0
- package/assets/esri/core/workers/chunks/a143a6f8e2f21548b244.js +1 -0
- package/assets/esri/core/workers/chunks/a48a6232fa33084cb686.js +1 -0
- package/assets/esri/core/workers/chunks/a4947d5d2fa6b7bd399b.js +1 -0
- package/assets/esri/core/workers/chunks/a49f1172b17c14527acf.js +1 -0
- package/assets/esri/core/workers/chunks/{6af14a0217077d9ab47f.js → aaf3ed508d30ed583915.js} +1 -1
- package/assets/esri/core/workers/chunks/{ab9156be67332338bbe4.js → aceec85ce64a3e6d8761.js} +1 -1
- package/assets/esri/core/workers/chunks/b10b3eb8c2ed9be14ab2.js +1 -0
- package/assets/esri/core/workers/chunks/b315b3771d0d19681aa5.js +1 -0
- package/assets/esri/core/workers/chunks/{91858b02da40ff251ab2.js → b397a9f87082705301a4.js} +2 -2
- package/assets/esri/core/workers/chunks/b40e4ed067da65c3d7ce.js +1 -0
- package/assets/esri/core/workers/chunks/b4b16914950792c46bd3.js +1 -0
- package/assets/esri/core/workers/chunks/{360b3499e2a671c309ce.js → b6969a42602517a6ef1c.js} +1 -1
- package/assets/esri/core/workers/chunks/baad696d84ab78b3d00e.js +2 -0
- package/assets/esri/core/workers/chunks/{2e7d4a437717606bc39c.js → bc2dcbdc414d157ab727.js} +1 -1
- package/assets/esri/core/workers/chunks/{1aa2187597f7c4adb67f.js → bcb254cb7297fec88679.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d1a772abd730b61854f.js → bd2125e0a68378533641.js} +1 -1
- package/assets/esri/core/workers/chunks/{6bd910e0480451a8d6aa.js → bde2c3199f667b63dbe8.js} +1 -1
- package/assets/esri/core/workers/chunks/bf595eb10f99b8a96baa.js +1 -0
- package/assets/esri/core/workers/chunks/c0b6706f86665cec85f8.js +1 -0
- package/assets/esri/core/workers/chunks/{12fd2e26e949d90abfbd.js → c3c6d337ff53e5d921e8.js} +1 -1
- package/assets/esri/core/workers/chunks/c461c19e4fdbdd2e94d4.js +1 -0
- package/assets/esri/core/workers/chunks/{4214f46bee613dea72f3.js → c66aa57b6360963bd938.js} +1 -1
- package/assets/esri/core/workers/chunks/c873ac660e7d5dc88781.js +1 -0
- package/assets/esri/core/workers/chunks/c99f36159b5ed6f9267e.js +1 -0
- package/assets/esri/core/workers/chunks/cb5f4820277f3fc7ff2f.js +1 -0
- package/assets/esri/core/workers/chunks/cbcb3530375e280bfeac.js +1 -0
- package/assets/esri/core/workers/chunks/cf4202ad468501ef24cf.js +1 -0
- package/assets/esri/core/workers/chunks/d03d50f3247327257d8b.js +1 -0
- package/assets/esri/core/workers/chunks/{a5af20f3d484d2d3bafe.js → d2017b0b27b9e4ada922.js} +1 -1
- package/assets/esri/core/workers/chunks/d2d9c1f32a75befe168b.js +1 -0
- package/assets/esri/core/workers/chunks/{5c12a9b0db317620dce2.js → d39f5d57f7e35c00ca16.js} +1 -1
- package/assets/esri/core/workers/chunks/d5b4487a983921572e58.js +1 -0
- package/assets/esri/core/workers/chunks/d78b2f85ec9212a973e8.js +1 -0
- package/assets/esri/core/workers/chunks/d9dc8d9fc8ab2706f96b.js +1 -0
- package/assets/esri/core/workers/chunks/{09cf8aed89a1ea1f8b28.js → da42da04a9df651b06cc.js} +1 -1
- package/assets/esri/core/workers/chunks/{a82587f69c4bbcac7e0b.js → dc7df2072c0ebed5602c.js} +1 -1
- package/assets/esri/core/workers/chunks/dd24cddc406f610d2483.js +1 -0
- package/assets/esri/core/workers/chunks/dd3789e71270a4640551.js +1 -0
- package/assets/esri/core/workers/chunks/de5719ef663224860af5.js +1 -0
- package/assets/esri/core/workers/chunks/de6438fdbe38d32c4ad5.js +1 -0
- package/assets/esri/core/workers/chunks/ded71a656e2626a411f9.js +1 -0
- package/assets/esri/core/workers/chunks/df1fa0f7e8f7e2bcc2e6.js +1 -0
- package/assets/esri/core/workers/chunks/{b705f837caa76cee81fc.js → e09722903e63f6cc2540.js} +1 -1
- package/assets/esri/core/workers/chunks/e2e03622936d2b35afc0.js +1 -0
- package/assets/esri/core/workers/chunks/e33f5780fb45ac7ca889.js +1 -0
- package/assets/esri/core/workers/chunks/{eb9e913fe0dfcc71cf92.js → e4611ebd7dba7692a914.js} +1 -1
- package/assets/esri/core/workers/chunks/e52793690dff1a199647.js +1 -0
- package/assets/esri/core/workers/chunks/{c13efb74aa4602f6a1ee.js → e56a10a475ce128b5fce.js} +1 -1
- package/assets/esri/core/workers/chunks/{9531f17cecd50431cce2.js → e8ae71e482b8d5f54a72.js} +1 -1
- package/assets/esri/core/workers/chunks/ea633a6a3b9ea8ce965d.js +1 -0
- package/assets/esri/core/workers/chunks/eae1c098c16e2faaf90d.js +1 -0
- package/assets/esri/core/workers/chunks/{f7e25a85a79c4e3c1c9f.js → ec63c0fa21cd3c872633.js} +1 -1
- package/assets/esri/core/workers/chunks/ece363681bb09072f379.js +1 -0
- package/assets/esri/core/workers/chunks/edaae0fc63d16b0f675d.js +2 -0
- package/assets/esri/core/workers/chunks/{8650fbe1db55b7280c00.js → ef4237dc7b67c9039826.js} +1 -1
- package/assets/esri/core/workers/chunks/ef9106ee818ec732b670.js +1 -0
- package/assets/esri/core/workers/chunks/f121a0bf33c03abfa0b6.js +1 -0
- package/assets/esri/core/workers/chunks/{a2f38e86acf45272dbc2.js → f7506c9d57b2ae0c5fd3.js} +1 -1
- package/assets/esri/core/workers/chunks/fab7e3e07d700d7bb651.js +1 -0
- package/assets/esri/core/workers/chunks/fcc8d0b60f7c2397e550.js +1 -0
- package/assets/esri/core/workers/chunks/fe5aec7e2da4465422b4.js +1 -0
- package/assets/esri/themes/base/widgets/_BasemapGallery.scss +1 -0
- package/assets/esri/themes/base/widgets/_Editor.scss +1 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +1 -1
- package/chunks/GeodeticUtils.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorIntegrate.js +2 -0
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/SpatialReference.js +1 -1
- package/chunks/containsOperator.js +1 -1
- package/chunks/disjointOperator.js +1 -1
- package/chunks/relateOperator.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/editing/sharedTemplates/SharedTemplateMetadata.d.ts +0 -31
- package/{layers/graphics/editingSupport.d.ts → editing/types.d.ts} +8 -8
- package/editing/types.js +2 -0
- package/effects/FocusAreas.d.ts +1 -1
- package/form/elements/FieldElement.d.ts +1 -1
- package/form/elements/GroupElement.d.ts +1 -1
- package/form/elements/TextElement.d.ts +1 -1
- package/form/elements/inputs/ComboBoxInput.d.ts +1 -1
- package/form/elements/inputs/RadioButtonsInput.d.ts +1 -1
- package/form/elements/inputs/SwitchInput.d.ts +1 -1
- package/geometry/Mesh.d.ts +7 -7
- package/geometry/operators/alphaShapeOperator.d.ts +1 -1
- package/geometry/operators/areaOperator.d.ts +1 -1
- package/geometry/operators/bufferOperator.d.ts +1 -1
- package/geometry/operators/centroidOperator.d.ts +1 -1
- package/geometry/operators/clipOperator.d.ts +1 -1
- package/geometry/operators/containsOperator.d.ts +1 -1
- package/geometry/operators/convexHullOperator.d.ts +1 -1
- package/geometry/operators/crossesOperator.d.ts +1 -1
- package/geometry/operators/cutOperator.d.ts +1 -1
- package/geometry/operators/densifyOperator.d.ts +1 -1
- package/geometry/operators/differenceOperator.d.ts +1 -1
- package/geometry/operators/disjointOperator.d.ts +1 -1
- package/geometry/operators/distanceOperator.d.ts +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/generalizeOperator.d.ts +1 -1
- package/geometry/operators/geodesicProximityOperator.d.ts +1 -1
- package/geometry/operators/geodeticDistanceOperator.d.ts +1 -1
- package/geometry/operators/geodeticUtilsOperator.d.ts +2 -2
- package/geometry/operators/graphicBufferOperator.d.ts +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/intersectionOperator.d.ts +1 -1
- package/geometry/operators/intersectsOperator.d.ts +1 -1
- package/geometry/operators/isNearOperator.d.ts +1 -1
- package/geometry/operators/json/containsOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/lengthOperator.d.ts +1 -1
- package/geometry/operators/locateBetweenOperator.d.ts +1 -1
- package/geometry/operators/multiPartToSinglePartOperator.d.ts +1 -1
- package/geometry/operators/offsetOperator.d.ts +5 -5
- package/geometry/operators/overlapsOperator.d.ts +1 -1
- package/geometry/operators/proximityOperator.d.ts +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/simplifyOGCOperator.d.ts +1 -1
- package/geometry/operators/simplifyOperator.d.ts +1 -1
- package/geometry/operators/support/GeographicTransformation.d.ts +6 -4
- package/geometry/operators/support/GeographicTransformation.js +1 -1
- package/geometry/operators/support/GeographicTransformationStep.d.ts +5 -3
- package/geometry/operators/support/GeographicTransformationStep.js +1 -1
- package/geometry/operators/support/Transformation.d.ts +6 -6
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/operators/support/projectionTransformation.js +1 -1
- package/geometry/operators/symmetricDifferenceOperator.d.ts +1 -1
- package/geometry/operators/touchesOperator.d.ts +1 -1
- package/geometry/operators/unionOperator.d.ts +1 -1
- package/geometry/operators/withinOperator.d.ts +1 -1
- package/geometry/support/MeshMaterialMetallicRoughness.d.ts +1 -1
- package/geometry/support/zscale.js +1 -1
- package/graphic/KnowledgeGraphGraphicOrigin.d.ts +0 -1
- package/graphic/LinkChartGraphicOrigin.js +1 -1
- package/interfaces.d.ts +60 -60
- package/kernel.js +1 -1
- package/layers/BuildingSceneLayer.d.ts +4 -4
- package/layers/CSVLayer.d.ts +319 -542
- package/layers/CSVLayer.js +1 -1
- package/layers/CatalogLayer.d.ts +2 -2
- package/layers/ElevationLayer.d.ts +1 -1
- package/layers/FeatureLayer.d.ts +15 -15
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoJSONLayer.d.ts +6 -6
- package/layers/GeoRSSLayer.d.ts +1 -1
- package/layers/GraphicsLayer.d.ts +2 -2
- package/layers/ImageryLayer.d.ts +3 -3
- package/layers/ImageryTileLayer.d.ts +2 -2
- package/layers/IntegratedMesh3DTilesLayer.d.ts +6 -6
- package/layers/IntegratedMeshLayer.d.ts +7 -7
- package/layers/MapImageLayer.d.ts +1 -1
- package/layers/MediaLayer.d.ts +1 -1
- package/layers/OGCFeatureLayer.d.ts +2 -2
- package/layers/OrientedImageryLayer.d.ts +6 -6
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/PointCloudLayer.d.ts +1 -1
- package/layers/SceneLayer.d.ts +7 -7
- package/layers/StreamLayer.d.ts +2 -2
- package/layers/SubtypeGroupLayer.d.ts +5 -5
- package/layers/VectorTileLayer.d.ts +2 -2
- package/layers/VideoLayer.d.ts +1 -1
- package/layers/VoxelLayer.d.ts +8 -8
- package/layers/WFSLayer.d.ts +6 -6
- package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
- package/layers/graphics/applyEditsUtils.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/OGCFeatureSource.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/BlendLayer.d.ts +6 -6
- package/layers/mixins/EditBusLayer.d.ts +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/pointCloudFilters/PointCloudReturnFilter.d.ts +1 -1
- package/layers/pointCloudFilters/PointCloudValueFilter.d.ts +1 -1
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/raster/functions/ExtractBandFunction.js +1 -1
- package/layers/support/DimensionalDefinition.d.ts +2 -2
- package/layers/support/FeatureEffect.d.ts +4 -4
- package/layers/support/FeatureFilter.d.ts +17 -17
- package/layers/support/FeatureReductionBinning.d.ts +1 -1
- package/layers/support/FeatureReductionCluster.d.ts +9 -9
- package/layers/support/LabelClass.d.ts +2 -2
- package/layers/support/RasterFunction.d.ts +1 -1
- package/layers/support/SceneFilter.d.ts +2 -2
- package/layers/support/SceneModification.d.ts +3 -3
- package/layers/support/SubtypeSublayer.d.ts +5 -5
- package/layers/support/arcgisLayerUrl.js +1 -1
- package/layers/support/capabilities.js +1 -1
- package/layers/support/featurePopupQueryUtils.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/networks/support/Circuit.d.ts +11 -2
- package/networks/support/CircuitSection.d.ts +3 -2
- package/networks/support/TraceConfiguration.d.ts +5 -4
- package/networks/support/UNTraceConfiguration.d.ts +6 -5
- package/networks/support/jsonTypes.d.ts +305 -0
- package/package.json +3 -3
- package/popup/content/AttachmentsContent.d.ts +1 -1
- package/popup/content/BarChartMediaInfo.d.ts +1 -1
- package/popup/content/ColumnChartMediaInfo.d.ts +1 -1
- package/popup/content/FieldsContent.d.ts +1 -1
- package/popup/content/ImageMediaInfo.d.ts +1 -1
- package/popup/content/LineChartMediaInfo.d.ts +1 -1
- package/popup/content/MediaContent.d.ts +1 -1
- package/popup/content/PieChartMediaInfo.d.ts +1 -1
- package/popup/content/RelationshipContent.d.ts +1 -1
- package/popup/content/TextContent.d.ts +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/portal/support/urlUtils.js +1 -1
- package/renderers/DotDensityRenderer.d.ts +3 -3
- package/renderers/FlowRenderer.d.ts +6 -6
- package/renderers/HeatmapRenderer.d.ts +3 -3
- package/renderers/PieChartRenderer.d.ts +1 -1
- package/renderers/RasterShadedReliefRenderer.d.ts +1 -1
- package/renderers/Renderer.d.ts +2 -2
- package/renderers/SimpleRenderer.d.ts +1 -1
- package/renderers/VectorFieldRenderer.d.ts +1 -1
- package/renderers/mixins/VisualVariablesMixin.d.ts +8 -8
- package/rest/featureService/FeatureService.js +1 -1
- package/rest/featureService/types.d.ts +7 -1
- package/rest/query/operations/editsZScale.js +1 -1
- package/rest/query/operations/pbfFlatFeatureSet.js +1 -1
- package/rest/query/support/AttachmentInfo.d.ts +1 -1
- package/rest/support/AutoIntervalBinParameters.d.ts +1 -1
- package/rest/support/DateBinParameters.d.ts +1 -1
- package/rest/support/FixedBoundariesBinParameters.d.ts +1 -1
- package/rest/support/FixedIntervalBinParameters.d.ts +1 -1
- package/rest/support/Query.d.ts +3 -2
- package/rest/types.d.ts +1 -3
- package/smartMapping/labels/clusters.d.ts +1 -1
- package/smartMapping/popup/clusters.d.ts +2 -2
- package/smartMapping/popup/templates.d.ts +1 -1
- package/smartMapping/raster/renderers/flow.d.ts +2 -2
- package/smartMapping/renderers/color.d.ts +12 -12
- package/smartMapping/renderers/predominance.d.ts +3 -3
- package/smartMapping/renderers/relationship.d.ts +15 -15
- package/smartMapping/renderers/univariateColorSize.d.ts +4 -4
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/smartMapping/support/utils.js +1 -1
- package/smartMapping/symbology/color.d.ts +4 -4
- package/smartMapping/symbology/flow.d.ts +2 -2
- package/smartMapping/symbology/types.d.ts +18 -18
- package/support/revision.js +1 -1
- package/symbols/CIMSymbol.d.ts +1 -1
- package/symbols/FillSymbol3DLayer.d.ts +3 -3
- package/symbols/IconSymbol3DLayer.d.ts +1 -1
- package/symbols/LabelSymbol3D.d.ts +2 -2
- package/symbols/LineStyleMarker3D.d.ts +7 -7
- package/symbols/LineSymbol3D.d.ts +2 -2
- package/symbols/LineSymbol3DLayer.d.ts +7 -7
- package/symbols/LineSymbolMarker.d.ts +6 -6
- package/symbols/MarkerSymbol.d.ts +1 -1
- package/symbols/MeshSymbol3D.d.ts +2 -2
- package/symbols/ObjectSymbol3DLayer.d.ts +1 -1
- package/symbols/PathSymbol3DLayer.d.ts +14 -14
- package/symbols/PictureFillSymbol.d.ts +1 -1
- package/symbols/PictureMarkerSymbol.d.ts +1 -1
- package/symbols/PointSymbol3D.d.ts +3 -3
- package/symbols/PolygonSymbol3D.d.ts +8 -26
- package/symbols/PolygonSymbol3D.js +1 -1
- package/symbols/SimpleFillSymbol.d.ts +8 -8
- package/symbols/SimpleLineSymbol.d.ts +20 -20
- package/symbols/SimpleMarkerSymbol.d.ts +7 -7
- package/symbols/Symbol3DLayer.d.ts +16 -16
- package/symbols/TextSymbol.d.ts +1 -1
- package/symbols/TextSymbol3DLayer.d.ts +1 -1
- package/symbols/WaterSymbol3DLayer.d.ts +3 -3
- package/symbols/WebStyleSymbol.d.ts +1 -1
- package/symbols/callouts/Callout3D.d.ts +1 -1
- package/symbols/callouts/LineCallout3D.d.ts +3 -3
- package/symbols/cim/CIMCursor.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
- package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
- package/symbols/cim/placements/PlacementAtMeasuredUnits.js +1 -1
- package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
- package/symbols/cim/placements/PlacementOnLine.js +1 -1
- package/symbols/cim/placements/PlacementOnVertices.js +1 -1
- package/symbols/cim/types.d.ts +30 -23
- package/symbols/edges/Edges3D.d.ts +1 -1
- package/symbols/edges/SolidEdges3D.d.ts +1 -1
- package/symbols/patterns/LineStylePattern3D.d.ts +11 -11
- package/symbols/patterns/StylePattern3D.d.ts +8 -8
- package/symbols/support/ElevationInfo.d.ts +2 -2
- package/symbols/support/IconSymbol3DLayerResource.d.ts +6 -6
- package/symbols/support/ObjectSymbol3DLayerResource.d.ts +7 -7
- package/symbols/support/Symbol3DEmissive.d.ts +24 -13
- package/symbols/support/Symbol3DVerticalOffset.d.ts +2 -2
- package/symbols/support/previewSymbol3D.js +1 -1
- package/versionManagement/VersionManagementService.d.ts +3 -2
- package/views/2d/analysis/DistanceMeasurement/utils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/attributes.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/BaseLayerViewGL2D.d.ts +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/types.d.ts +3 -3
- package/views/3d/environment/CloudyWeather.d.ts +1 -1
- package/views/3d/environment/Environment.d.ts +4 -4
- package/views/3d/environment/FoggyWeather.d.ts +1 -1
- package/views/3d/environment/RainyWeather.d.ts +1 -1
- package/views/3d/environment/SnowyWeather.d.ts +1 -1
- package/views/3d/environment/SunLighting.d.ts +1 -1
- package/views/3d/environment/SunnyWeather.d.ts +1 -1
- package/views/3d/environment/VirtualLighting.d.ts +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/webgl/RenderNode.d.ts +46 -57
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl.d.ts +8 -5
- package/views/DOMContainer.js +1 -1
- package/views/Magnifier.d.ts +3 -3
- package/views/MapView.d.ts +7 -7
- package/views/SceneView.d.ts +34 -37
- package/views/View.d.ts +2 -2
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/plugins/BezierSegmentPlugin.js +1 -1
- package/views/draw/plugins/CircularArcSegmentPlugin.js +1 -1
- package/views/draw/plugins/FreehandSegmentPlugin.js +1 -1
- package/views/draw/plugins/MultipointPlugin.js +1 -1
- package/views/draw/plugins/PointPlugin.js +1 -1
- package/views/draw/plugins/PolygonPlugin.js +1 -1
- package/views/draw/plugins/PolylinePlugin.js +1 -1
- package/views/draw/plugins/ShapePlugin.js +1 -1
- package/views/draw/support/managers/TooltipManager.js +1 -1
- package/views/interactive/sketch/SketchLabelOptions.d.ts +1 -1
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingOptions.d.ts +7 -7
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDynamic.js +1 -1
- package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/support/HighlightOptions.d.ts +1 -1
- package/views/support/flow/dataUtils.js +1 -1
- package/views/ui/DefaultUI.d.ts +2 -2
- package/webscene/Environment.d.ts +10 -10
- package/webscene/Glow.d.ts +13 -2
- package/webscene/background/ColorBackground.d.ts +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/widgets/AreaMeasurement2D.d.ts +1 -1
- package/widgets/AreaMeasurement3D.d.ts +2 -2
- package/widgets/Attachments.d.ts +1 -1
- package/widgets/Attribution.d.ts +1 -1
- package/widgets/BasemapGallery.d.ts +1 -1
- package/widgets/BasemapLayerList.d.ts +3 -3
- package/widgets/BasemapToggle.d.ts +1 -1
- package/widgets/Bookmarks/BookmarksVisibleElements.d.ts +1 -1
- package/widgets/Bookmarks.d.ts +2 -2
- package/widgets/BuildingExplorer.d.ts +1 -1
- package/widgets/CatalogLayerList.d.ts +3 -3
- package/widgets/Compass.d.ts +2 -2
- package/widgets/CoordinateConversion.d.ts +1 -1
- package/widgets/Daylight.d.ts +5 -5
- package/widgets/DirectLineMeasurement3D.d.ts +2 -2
- package/widgets/Directions/DirectionsViewModel.d.ts +12 -0
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions.d.ts +4 -4
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D.d.ts +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.d.ts +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor.d.ts +2 -2
- package/widgets/ElevationProfile/ElevationProfileLineGround.d.ts +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineInput.d.ts +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.d.ts +1 -1
- package/widgets/ElevationProfile.d.ts +3 -3
- package/widgets/Expand.d.ts +1 -1
- package/widgets/FeatureForm.d.ts +1 -1
- package/widgets/FeatureTable/ActionColumn.d.ts +1 -1
- package/widgets/FeatureTable/AttachmentsColumn.d.ts +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +3 -3
- package/widgets/FeatureTable/Grid/GroupColumn.d.ts +1 -1
- package/widgets/FeatureTable/RelationshipColumn.d.ts +1 -1
- package/widgets/FeatureTable/VisibleElements.d.ts +1 -1
- package/widgets/FeatureTable.d.ts +9 -9
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.d.ts +5 -5
- package/widgets/FeatureTemplates.d.ts +8 -8
- package/widgets/Features/FeaturesViewModel.d.ts +2 -2
- package/widgets/Features/FeaturesVisibleElements.d.ts +2 -2
- package/widgets/Features.d.ts +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/Histogram.d.ts +2 -2
- package/widgets/HistogramRangeSlider.d.ts +1 -1
- package/widgets/Home/HomeViewModel.d.ts +2 -1
- package/widgets/Home/HomeViewModel.js +1 -1
- package/widgets/Home.d.ts +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList.d.ts +4 -4
- package/widgets/Legend.d.ts +8 -8
- package/widgets/LineOfSight.d.ts +1 -1
- package/widgets/Locate.d.ts +2 -2
- package/widgets/Measurement.d.ts +1 -1
- package/widgets/NavigationToggle/NavigationToggleViewModel.d.ts +1 -1
- package/widgets/NavigationToggle.d.ts +3 -3
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
- package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
- package/widgets/OrientedImageryViewer/services/TransformationService.js +1 -1
- package/widgets/OrientedImageryViewer/types.js +1 -1
- package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Popup/PopupVisibleElements.d.ts +2 -2
- package/widgets/Popup.d.ts +5 -5
- package/widgets/Print/CustomTemplate.d.ts +1 -1
- package/widgets/Print/TemplateOptions.d.ts +4 -4
- package/widgets/ScaleRangeSlider.d.ts +1 -1
- package/widgets/Search/SearchViewModel.d.ts +4 -4
- package/widgets/Search.d.ts +5 -5
- package/widgets/ShadowCast.d.ts +3 -3
- package/widgets/Sketch/SketchViewModel.d.ts +39 -39
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/Sketch.d.ts +43 -43
- package/widgets/Slice.d.ts +2 -2
- package/widgets/Slider/SliderViewModel.d.ts +2 -2
- package/widgets/Slider.d.ts +9 -9
- package/widgets/Swipe/SwipeViewModel.d.ts +1 -1
- package/widgets/Swipe.d.ts +2 -2
- package/widgets/TableList.d.ts +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.d.ts +8 -8
- package/widgets/TimeSlider/types.d.ts +1 -1
- package/widgets/TimeSlider.d.ts +11 -11
- package/widgets/Track.d.ts +2 -2
- package/widgets/UtilityNetworkAssociations.d.ts +3 -3
- package/widgets/UtilityNetworkTrace.d.ts +4 -4
- package/widgets/UtilityNetworkValidateTopology.d.ts +1 -1
- package/widgets/ValuePicker.d.ts +5 -5
- package/widgets/VideoPlayer.d.ts +1 -1
- package/widgets/smartMapping/ClassedColorSlider.d.ts +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.d.ts +1 -1
- package/widgets/smartMapping/ColorSizeSlider.d.ts +2 -2
- package/widgets/smartMapping/ColorSlider.d.ts +1 -1
- package/widgets/smartMapping/HeatmapSlider.d.ts +1 -1
- package/widgets/smartMapping/OpacitySlider.d.ts +1 -1
- package/widgets/smartMapping/SizeSlider.d.ts +1 -1
- package/widgets/smartMapping/SmartMappingSliderBase.d.ts +4 -4
- package/widgets/smartMapping/SmartMappingSliderViewModel.d.ts +6 -6
- package/widgets/support/GridControls.d.ts +1 -1
- package/widgets/support/SnappingControls/VisibleElements.d.ts +1 -1
- package/widgets/support/SnappingControls.d.ts +6 -6
- package/assets/esri/core/workers/chunks/0184b4c0c92c76c60ab2.js +0 -1
- package/assets/esri/core/workers/chunks/08616877b58b518e7461.js +0 -1
- package/assets/esri/core/workers/chunks/089cef7124173a5cd5f9.js +0 -1
- package/assets/esri/core/workers/chunks/0baa0d66003d23cc76a7.js +0 -1
- package/assets/esri/core/workers/chunks/0baf2cf9d8998045a605.js +0 -1
- package/assets/esri/core/workers/chunks/0bf742d48f434c4c575f.js +0 -1
- package/assets/esri/core/workers/chunks/0cc68540194bd9f7aa3c.js +0 -1
- package/assets/esri/core/workers/chunks/0e216f0075fd531c3a2b.js +0 -1
- package/assets/esri/core/workers/chunks/1219b588f983b4f35033.js +0 -1
- package/assets/esri/core/workers/chunks/13e913aa5f5113fceb16.js +0 -1
- package/assets/esri/core/workers/chunks/15ba0296403dd4152b88.js +0 -1
- package/assets/esri/core/workers/chunks/15e5471277a48f482383.js +0 -1
- package/assets/esri/core/workers/chunks/16abc548724e428c325a.js +0 -1
- package/assets/esri/core/workers/chunks/1d124a55f6804be19e09.js +0 -1
- package/assets/esri/core/workers/chunks/1ede5fa7a16839ed9444.js +0 -1
- package/assets/esri/core/workers/chunks/25267253ba578eba38cf.js +0 -1
- package/assets/esri/core/workers/chunks/27aa21da934ecaca381a.js +0 -1
- package/assets/esri/core/workers/chunks/27d1f8279df34d8b15b5.js +0 -1
- package/assets/esri/core/workers/chunks/2907e9a7216b5a29729b.js +0 -1
- package/assets/esri/core/workers/chunks/2b0891ba57ba66b913ce.js +0 -1
- package/assets/esri/core/workers/chunks/2bb7bb7901bd343201fc.js +0 -1
- package/assets/esri/core/workers/chunks/2c7e5b78d94e5850537b.js +0 -1
- package/assets/esri/core/workers/chunks/2d52b137ee64469a46b2.js +0 -1
- package/assets/esri/core/workers/chunks/2eb7df99170b7bb2a914.js +0 -1
- package/assets/esri/core/workers/chunks/36b8dd092697ef544f40.js +0 -1
- package/assets/esri/core/workers/chunks/395ee51a863757ea8124.js +0 -1
- package/assets/esri/core/workers/chunks/3b0cfe3db8d90e02d6c6.js +0 -1
- package/assets/esri/core/workers/chunks/454150571b5b664b576a.js +0 -1
- package/assets/esri/core/workers/chunks/4740d319f233b7f528fe.js +0 -1
- package/assets/esri/core/workers/chunks/4742a8c19b86a5f859f0.js +0 -1
- package/assets/esri/core/workers/chunks/49d58bacb5b397246978.js +0 -1
- package/assets/esri/core/workers/chunks/4ba4aa6c75e3f8950e65.js +0 -1
- package/assets/esri/core/workers/chunks/59f955c7d6b0589e7cc6.js +0 -1
- package/assets/esri/core/workers/chunks/5a347b1d87eb6f710136.js +0 -1
- package/assets/esri/core/workers/chunks/5b97cdeb5949822fbef3.js +0 -1
- package/assets/esri/core/workers/chunks/5cd614f50e8925eeeaf4.js +0 -1
- package/assets/esri/core/workers/chunks/620d7cd0b0885122aa0f.js +0 -1
- package/assets/esri/core/workers/chunks/6321680c8070dffa3b6c.js +0 -1
- package/assets/esri/core/workers/chunks/7017c2e621236c7a7da4.js +0 -1
- package/assets/esri/core/workers/chunks/731e6eaad319865fb780.js +0 -1
- package/assets/esri/core/workers/chunks/7407a1e0cef508116a0b.js +0 -1
- package/assets/esri/core/workers/chunks/752c43cdd38dfde912d2.js +0 -1
- package/assets/esri/core/workers/chunks/78936c591fd49ff955a9.js +0 -1
- package/assets/esri/core/workers/chunks/796f5265747ce8be910e.js +0 -1
- package/assets/esri/core/workers/chunks/7b7288c431933a75daca.js +0 -1
- package/assets/esri/core/workers/chunks/7e6309bfed6692e8d2d7.js +0 -2
- package/assets/esri/core/workers/chunks/7f60309d211c49721265.js +0 -1
- package/assets/esri/core/workers/chunks/7f9b0ef7f9b3f3fd3df9.js +0 -1
- package/assets/esri/core/workers/chunks/8177e95596b71bf020aa.js +0 -1
- package/assets/esri/core/workers/chunks/9bb04d5f2e6f6e4585a0.js +0 -1
- package/assets/esri/core/workers/chunks/a03196e6579d738251fc.js +0 -1
- package/assets/esri/core/workers/chunks/a0b715cf03895082b773.js +0 -1
- package/assets/esri/core/workers/chunks/a115984b794a7f90b2c0.js +0 -1
- package/assets/esri/core/workers/chunks/a5e91cf150f6cf6a5d2a.js +0 -1
- package/assets/esri/core/workers/chunks/a60a84c8c45f6d03443f.js +0 -1
- package/assets/esri/core/workers/chunks/aec827b50df6edc54808.js +0 -1
- package/assets/esri/core/workers/chunks/aef2832902b270f1a594.js +0 -1
- package/assets/esri/core/workers/chunks/b0b24fb60a21b995b348.js +0 -1
- package/assets/esri/core/workers/chunks/bb830d93e97dceac350f.js +0 -1
- package/assets/esri/core/workers/chunks/bd05e68b00b9878d0266.js +0 -1
- package/assets/esri/core/workers/chunks/bd12ca39198e6efbefbb.js +0 -1
- package/assets/esri/core/workers/chunks/bdd246cc50ccd5c10987.js +0 -1
- package/assets/esri/core/workers/chunks/c080e189764d8bb9cf25.js +0 -1
- package/assets/esri/core/workers/chunks/c15f0769a64863cccef0.js +0 -1
- package/assets/esri/core/workers/chunks/c516b185b099bf69c0ed.js +0 -1
- package/assets/esri/core/workers/chunks/c53048b0f153b251d792.js +0 -1
- package/assets/esri/core/workers/chunks/c693e8eb96ab8a4b9cbe.js +0 -1
- package/assets/esri/core/workers/chunks/c9babe86c00ae69e63ee.js +0 -2
- package/assets/esri/core/workers/chunks/cf09408cb7729126caae.js +0 -1
- package/assets/esri/core/workers/chunks/d9c1e1ec5c56f09fb82f.js +0 -1
- package/assets/esri/core/workers/chunks/e0565849281ffbe8269e.js +0 -1
- package/assets/esri/core/workers/chunks/e1ba6f857ca12f154e77.js +0 -1
- package/assets/esri/core/workers/chunks/e4f1e584f89ffb86206b.js +0 -1
- package/assets/esri/core/workers/chunks/e60684918100666bb892.js +0 -1
- package/assets/esri/core/workers/chunks/e94448b371cd17d7a472.js +0 -1
- package/assets/esri/core/workers/chunks/ed78e19b1e400c0db309.js +0 -1
- package/assets/esri/core/workers/chunks/ede1d1cc2f315a34f4ca.js +0 -1
- package/assets/esri/core/workers/chunks/f17a301516f008abef3a.js +0 -1
- package/assets/esri/core/workers/chunks/fc98b8351be567d3eb62.js +0 -1
- package/assets/esri/core/workers/chunks/fd5a5b05a1551cdb8c87.js +0 -1
- package/assets/esri/core/workers/chunks/fda0f4469d9cda637af4.js +0 -1
- package/assets/esri/core/workers/chunks/fe52117fe6982046c9e3.js +0 -1
- package/assets/esri/core/workers/chunks/ff961bb6d29ab3fe129d.js +0 -1
- /package/assets/esri/core/workers/chunks/{2762149a922275136171.js.LICENSE.txt → 112227b862b935123ddf.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{72acfb74fd9ab9bae923.js.LICENSE.txt → 53e348f5585fa8c53fe8.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{7e6309bfed6692e8d2d7.js.LICENSE.txt → b397a9f87082705301a4.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{91858b02da40ff251ab2.js.LICENSE.txt → baad696d84ab78b3d00e.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c9babe86c00ae69e63ee.js.LICENSE.txt → edaae0fc63d16b0f675d.js.LICENSE.txt} +0 -0
|
@@ -79,7 +79,7 @@ export interface VisibleElements {
|
|
|
79
79
|
* the Level element, the Construction phases element and the Disciplines are Categories list.
|
|
80
80
|
* The visibility of these elements can be configured using the widget's [visibleElements](https://developers.arcgis.com/javascript/latest/references/core/widgets/BuildingExplorer/#visibleElements).
|
|
81
81
|
*
|
|
82
|
-
* [](https://developers.arcgis.com/javascript/latest/sample-code/building-scene-layer-filter/)
|
|
83
83
|
*
|
|
84
84
|
* The [BuildingSceneLayers](https://developers.arcgis.com/javascript/latest/references/core/layers/BuildingSceneLayer/) to be explored
|
|
85
85
|
* have to be set on the [layers](https://developers.arcgis.com/javascript/latest/references/core/widgets/BuildingExplorer/#layers) property of the widget. When setting multiple layers, the filters set
|
|
@@ -74,7 +74,7 @@ export interface CatalogLayerListEvents extends CatalogLayerListViewModelEvents
|
|
|
74
74
|
* The [ListItem](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/ListItem/) API provides access to each layer's properties, allows
|
|
75
75
|
* the developer to configure actions related to the layer, and allows the developer to add content to the item related to the layer.
|
|
76
76
|
*
|
|
77
|
-
* 
|
|
78
78
|
*
|
|
79
79
|
* @deprecated since version 5.0. Use the [Catalog Layer List](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-catalog-layer-list/) component instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
|
|
80
80
|
* @since 4.30
|
|
@@ -281,8 +281,8 @@ export default class CatalogLayerList extends CatalogLayerListSuperclass {
|
|
|
281
281
|
*
|
|
282
282
|
* | Value | Description | Example |
|
|
283
283
|
* | ----- | ----------- | ------- |
|
|
284
|
-
* | default | Displays view icons on the far side. Icons are hidden except on hover or if they have keyboard focus. See [view-visible](https://developers.arcgis.com/calcite-design-system/icons/?icon=view-visible&library=Calcite%20UI&query=view) and [view-hide](https://developers.arcgis.com/calcite-design-system/icons/?icon=view-hide&library=Calcite%20UI&query=view) calcite icons. |  and [square](https://developers.arcgis.com/calcite-design-system/icons/?icon=square&library=Calcite%20UI&query=square) calcite icons. |  and [view-hide](https://developers.arcgis.com/calcite-design-system/icons/?icon=view-hide&library=Calcite%20UI&query=view) calcite icons. |  |
|
|
285
|
+
* | checkbox | Displays checkbox icons on the near side. See [check-square-f](https://developers.arcgis.com/calcite-design-system/icons/?icon=check-square-f&library=Calcite%20UI&query=check) and [square](https://developers.arcgis.com/calcite-design-system/icons/?icon=square&library=Calcite%20UI&query=square) calcite icons. |  |
|
|
286
286
|
*
|
|
287
287
|
* @default "default"
|
|
288
288
|
* @example catalogLayerList.visibilityAppearance = "checkbox";
|
package/widgets/Compass.d.ts
CHANGED
|
@@ -42,8 +42,8 @@ export interface CompassProperties extends WidgetProperties, Partial<Pick<Compas
|
|
|
42
42
|
* For all other spatial references, the icon will be an arrow. For more information, see the
|
|
43
43
|
* [Reference topic on Spatial references](https://developers.arcgis.com/documentation/spatial-references/).
|
|
44
44
|
*
|
|
45
|
-
* 
|
|
46
|
+
* 
|
|
47
47
|
*
|
|
48
48
|
* You can use the view's [DefaultUI](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/) to add the compass widget
|
|
49
49
|
* to a 2D application via the [MapView.ui](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#ui) property on the view.
|
|
@@ -108,7 +108,7 @@ export interface VisibleElements {
|
|
|
108
108
|
* as any of several popular coordinate notations. Additionally, the widget provides a way to convert
|
|
109
109
|
* user input coordinates into a [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/).
|
|
110
110
|
*
|
|
111
|
-
* [](https://developers.arcgis.com/javascript/latest/sample-code/widgets-coordinateconversion/)
|
|
112
112
|
*
|
|
113
113
|
* Several common [formats](https://developers.arcgis.com/javascript/latest/references/core/widgets/CoordinateConversion/support/Format/) are included by default:
|
|
114
114
|
* * XY - Longitude, Latitude (WGS84)
|
package/widgets/Daylight.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ export interface DaylightEvents extends DaylightViewModelEvents {}
|
|
|
71
71
|
* and the stars get updated accordingly, changing the light and the shadows in the scene. This sets the `date` and `directShadowsEnabled` properties of
|
|
72
72
|
* [SceneView.environment.lighting](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#environment).
|
|
73
73
|
*
|
|
74
|
-
* [](https://developers.arcgis.com/javascript/latest/sample-code/widgets-daylight/)
|
|
75
75
|
*
|
|
76
76
|
* The daytime slider has an option to select the timezone. When the user makes any adjustments here, a new time
|
|
77
77
|
* in the chosen timezone is calculated and displayed in the slider. The timezone selector can be disabled
|
|
@@ -88,7 +88,7 @@ export interface DaylightEvents extends DaylightViewModelEvents {}
|
|
|
88
88
|
* });
|
|
89
89
|
* ```
|
|
90
90
|
*
|
|
91
|
-
* 
|
|
92
92
|
*
|
|
93
93
|
* There are two play buttons, one corresponds to the daytime slider and it animates the time as
|
|
94
94
|
* it cycles through the minutes of the day. The second button corresponds to the date picker
|
|
@@ -102,7 +102,7 @@ export interface DaylightEvents extends DaylightViewModelEvents {}
|
|
|
102
102
|
* });
|
|
103
103
|
* ```
|
|
104
104
|
*
|
|
105
|
-
* 
|
|
106
106
|
*
|
|
107
107
|
* Except for the daytime slider, all the elements in the daylight widget can be hidden by using the
|
|
108
108
|
* [visibleElements](https://developers.arcgis.com/javascript/latest/references/core/widgets/Daylight/#visibleElements) property:
|
|
@@ -122,11 +122,11 @@ export interface DaylightEvents extends DaylightViewModelEvents {}
|
|
|
122
122
|
*
|
|
123
123
|
* With these settings, the widget looks like this:
|
|
124
124
|
*
|
|
125
|
-
* 
|
|
126
126
|
*
|
|
127
127
|
* Whenever the sun position option is unchecked, the scene applies the **virtual light source** relative to the camera. With this, the widget's time slider and date picker get automatically disabled:
|
|
128
128
|
*
|
|
129
|
-
* 
|
|
130
130
|
*
|
|
131
131
|
* > [!WARNING]
|
|
132
132
|
* >
|
|
@@ -81,7 +81,7 @@ export interface DirectLineMeasurement3DProperties extends WidgetProperties, Par
|
|
|
81
81
|
* This widget can be used in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) to measure the vertical, horizontal,
|
|
82
82
|
* and direct distance between two points.
|
|
83
83
|
*
|
|
84
|
-
* [](https://developers.arcgis.com/javascript/latest/sample-code/widgets-measurement-3d/)
|
|
85
85
|
*
|
|
86
86
|
* How distances are computed depends on the scene's spatial reference.
|
|
87
87
|
*
|
|
@@ -98,7 +98,7 @@ export interface DirectLineMeasurement3DProperties extends WidgetProperties, Par
|
|
|
98
98
|
* the measurement visualization is simplified, and only the horizontal and vertical distances are calculated.
|
|
99
99
|
* The direct distance option becomes unavailable.
|
|
100
100
|
*
|
|
101
|
-
* 
|
|
102
102
|
*
|
|
103
103
|
* When the widget is active, a horizontal "laser" line is drawn which indicates the height at the current mouse position.
|
|
104
104
|
* This line can help in analyzing the heights of objects relative to each other and the terrain.
|
|
@@ -289,6 +289,18 @@ export default class DirectionsViewModel extends DirectionsViewModelSuperclass {
|
|
|
289
289
|
* @see [RouteLayer.saveAs()](https://developers.arcgis.com/javascript/latest/references/core/layers/RouteLayer/#saveAs)
|
|
290
290
|
*/
|
|
291
291
|
saveAs(portalItem: PortalItem, options?: LayerSaveAsOptions): Promise<PortalItem>;
|
|
292
|
+
/**
|
|
293
|
+
* Starts an edit session.
|
|
294
|
+
*
|
|
295
|
+
* @internal
|
|
296
|
+
*/
|
|
297
|
+
startEditing(): void;
|
|
298
|
+
/**
|
|
299
|
+
* Ends an edit session.
|
|
300
|
+
*
|
|
301
|
+
* @internal
|
|
302
|
+
*/
|
|
303
|
+
stopEditing(): void;
|
|
292
304
|
/** Zoom so that the full route is displayed within the current map extent. */
|
|
293
305
|
zoomToRoute(): void;
|
|
294
306
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
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{clamp as s}from"../../core/mathUtils.js";import{debounce as a,throwIfNotAbortError as l,isAbortError as n}from"../../core/promiseUtils.js";import{watch as u,syncAndInitial as d,when as c,on as h}from"../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../core/accessorSupport/decorators.js";import{resolveTimeZone as v,formatTimestamp as y,convertDateFormatToIntlOptions as g}from"../../intl/date.js";import{getLocale as f,getLocaleParts as w}from"../../intl/locale.js";import{fetchServiceDescription as _}from"../../rest/networkService.js";import T from"../../rest/support/RouteParameters.js";import S from"../../rest/support/Stop.js";import D from"../../rest/support/TravelMode.js";import{defaultDatePattern as b,defaultTimePattern as C}from"../../support/dateUtils.js";import{system as M}from"../../time/constants.js";import{shortTimeZoneName as I}from"../../time/timeZoneUtils.js";import{DepartureTimeOption as j}from"./support/directionsUtils.js";import{getDefaultLocaleOptions as A}from"../support/dateUtils.js";import{GoTo as P}from"../support/GoTo.js";import{DateTime as L,FixedOffsetZone as O,IANAZone as R}from"luxon";function E(e){return e.map(e=>({locale:e,parts:w(e)})).filter(({parts:e})=>!!e)}function U(e,t){return e.find(({parts:e})=>V(e.language,t.language)&&e.region===t.region)?.locale??e.find(({parts:e})=>V(e.language,t.language))?.locale}function N(e){return"esri.Graphic"===e?.declaredClass}function k(e){return"no"===e||"nb"===e}function V(e,t){return e===t||k(e)&&k(t)}function z(e){return"esri.rest.support.Stop"===e?.declaredClass}let F=class extends(P(i)){constructor(e){super(e),this._debouncedSolveHandler=a(async e=>{switch(e.type){case"create":switch(e.state){case"start":case"active":return}break;case"delete":break;case"update":switch(e.state){case"start":return void(this._networkFeatureUpdated=!1);case"active":if(this._networkFeatureUpdated=!0,this.autoSolveOn.includes("active"))break;return;case"complete":if(!this._networkFeatureUpdated)return;if(this.autoSolveOn.includes("complete"))break;return}}if((this.layer?.stops.filter(({geometry:e})=>!!e).length??0)<2||!this.autoSolve)return;const t="update"===e.type&&"active"===e.state;try{await this.getDirections({zoomToSolvedRoute:!1,ignoreSolvedStopGeometry:t,generalizeGeometry:t})}catch(r){o.getLogger(this).error(r)}}),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.autoSolveOn=["complete"],this.defaultTravelMode=null,this.departureIsoDate=void 0,this.departureIsoTime=void 0,this.departureOption=j.NOW,this.departureTime="now",this.lastError=null,this.lastRoute=null,this.layer=null,this.maxStops=50,this.routeParameters=new T({directionsLengthUnits:"kilometers",findBestSequence:!1,preserveFirstStop:!0,preserveLastStop:!0,returnZ:!0,useTimeWindows:!1}),this.serviceDescription=null,this.view=null}initialize(){this.addHandles([u(()=>this.layer,e=>{if(e){for(;e.stops.length<2;)e.stops.add(new S);this._set("defaultTravelMode",null),this.addHandles(c(()=>this.serviceDescription?e.routeInfo?.analysisSettings?.travelMode:null,e=>{this.defaultTravelMode=this._resolveDefaultTravelMode(e)},{once:!0}))}},d),u(()=>[this.layer,this.view],async()=>{this._layerView=await this._getRouteLayerView()},d),h(()=>this._layerView,["create","delete","update"],e=>{this._debouncedSolveHandler(e).catch(l)})]);const e=v(this.view?.timeZone??M),t=L.fromMillis(Date.now());this.departureIsoDate=t.toFormat(b,A(e)),this.departureIsoTime=t.toFormat(C,A(e))}get _directionsLanguage(){const e=this.serviceDescription?.directionsSupportedLanguages;if(!e)return;const t=this.routeParameters.directionsLanguage??f(),r=w(t),i=r?.language,o=r?.region;if(!i)return;return U(E(e),{language:i,region:o})}get formattedEta(){const e=this.layer?.routeInfo?.endTime,t=this.layer?.routeInfo?.endTimeOffset;if(this.departureOption===j.UNSPECIFIED||!e||!t)return null;const r=L.fromJSDate(e,{zone:O.instance(t)}),i=L.fromJSDate(e,{zone:R.create(v(this.view?.timeZone??M))}),o=L.fromJSDate(new Date,{zone:R.create(v(this.view?.timeZone??M))}),s=o.year===i.year&&o.month===i.month&&o.day===i.day,a=i.offset===t?void 0:I,l=s?void 0:g("short-date"),n=g("short-time");return y(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){this.clearHighlights();const t=await this._getRouteLayerView();this._highlight=t?.highlight(e)??null}clearHighlights(){this._highlight?.remove(),this._highlight=null}centerAt(e){if(!this.view)return;const t=z(e)||N(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,ignoreSolvedStopGeometry:!1,generalizeGeometry:!1}){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("disabled"===o||"initializing"===o||"unauthenticated"===o||2===this._serviceDescriptionStatus)throw new r("directions-view-model:not-loaded","Cannot get directions until view model loads.");this._routeController?.abort(),this._routeController=null;const{startTime:s,startTimeIsUTC:a}=this._getStartTimeParameters(),l=this.view?.spatialReference??null,u=this.routeParameters.clone(),d=e.generalizeGeometry?this._getGeometryPrecision():null;u.set({apiKey:t,directionsLanguage:this._directionsLanguage,geometryPrecision:d,outSpatialReference:l,startTime:s,startTimeIsUTC:a}),this.selectedTravelMode&&(u.travelMode=this.selectedTravelMode);if(i.stops.filter(({geometry:e})=>!!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:c}=this._routeController;let h=null;try{h=await i.solve(u,{signal:c})}catch(p){if(!n(p)){const e=new r("directions-view-model:unable-to-route","Unable to route to these addresses",{error:p});throw this._set("lastError",e),this.clearResults(),e}}finally{this._routeController=null}this._set("lastError",null);for(const r of h.stops)r.geometry||(r.name=null);if(e.ignoreSolvedStopGeometry&&i.stops.every(({objectId:e})=>!!e)&&h.stops.every(({objectId:e})=>!!e))for(const r of h.stops){const e=i.stops.find(({objectId:e})=>e===r.objectId)?.geometry;e&&(r.geometry=e.clone())}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 S,new S]))}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,this._layerView.interactiveOptions.waypointAdditionEnabled=!this.routeParameters.findBestSequence)}async stopEditing(){this._layerView&&(this._layerView.interactive=!1)}updateDepartureTime(){if(this.departureIsoDate&&this.departureIsoTime)switch(this.departureOption){case j.NOW:this.departureTime="now";break;case j.DEPART_AT:{const e=L.fromISO(`${this.departureIsoDate}T${this.departureIsoTime}`,{zone:O.instance(0)});this.departureTime=e.toJSDate();break}case j.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})}_getGeometryPrecision(){const e=this.view?.resolution;return e?s(Math.ceil(-Math.log10(e)),0,4):null}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 _(this.layer.url,this.apiKey,{signal:e});this._set("serviceDescription",t),this._serviceDescriptionStatus=1}catch(t){if(n(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 D.fromJSON({...s?.toJSON(),...e.toJSON()})}const o=r?.find(({name:t})=>t.toLocaleLowerCase()===e.name.toLocaleLowerCase());return o??t}};e([p()],F.prototype,"_directionsLanguage",null),e([p()],F.prototype,"_layerView",void 0),e([p()],F.prototype,"_routeController",void 0),e([p()],F.prototype,"_serviceDescriptionStatus",void 0),e([p()],F.prototype,"apiKey",void 0),e([p()],F.prototype,"autoSolve",void 0),e([p({nonNullable:!0})],F.prototype,"autoSolveOn",void 0),e([p()],F.prototype,"defaultTravelMode",void 0),e([p()],F.prototype,"departureTime",void 0),e([p()],F.prototype,"formattedEta",null),e([p({readOnly:!0})],F.prototype,"impedanceAttribute",null),e([p()],F.prototype,"lastError",void 0),e([p({readOnly:!0})],F.prototype,"lastRoute",void 0),e([p()],F.prototype,"layer",void 0),e([p({type:Number,range:{min:2,max:50},nonNullable:!0})],F.prototype,"maxStops",void 0),e([p({type:T,nonNullable:!0})],F.prototype,"routeParameters",void 0),e([p({readOnly:!0})],F.prototype,"selectedNetworkFeatures",null),e([p({type:D})],F.prototype,"selectedTravelMode",null),e([p({readOnly:!0})],F.prototype,"serviceDescription",void 0),e([p({readOnly:!0})],F.prototype,"state",null),e([p({readOnly:!0})],F.prototype,"timeAttribute",null),e([p()],F.prototype,"travelModes",null),e([p()],F.prototype,"view",void 0),e([p()],F.prototype,"zoomToRoute",null),F=e([m("esri.widgets.Directions.DirectionsViewModel")],F);const G=F;export{G as default};
|
|
2
|
+
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{clamp as s}from"../../core/mathUtils.js";import{debounce as a,throwIfNotAbortError as l,isAbortError as n}from"../../core/promiseUtils.js";import{watch as u,syncAndInitial as d,when as c,on as h}from"../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../core/accessorSupport/decorators.js";import{resolveTimeZone as v,formatTimestamp as y,convertDateFormatToIntlOptions as g}from"../../intl/date.js";import{getLocale as f,getLocaleParts as w}from"../../intl/locale.js";import{fetchServiceDescription as _}from"../../rest/networkService.js";import T from"../../rest/support/RouteParameters.js";import S from"../../rest/support/Stop.js";import D from"../../rest/support/TravelMode.js";import{defaultDatePattern as b,defaultTimePattern as C}from"../../support/dateUtils.js";import{system as M}from"../../time/constants.js";import{shortTimeZoneName as I}from"../../time/timeZoneUtils.js";import{DepartureTimeOption as j}from"./support/directionsUtils.js";import{getDefaultLocaleOptions as A}from"../support/dateUtils.js";import{GoTo as P}from"../support/GoTo.js";import{DateTime as L,FixedOffsetZone as O,IANAZone as R}from"luxon";function E(e){return e.map(e=>({locale:e,parts:w(e)})).filter(({parts:e})=>!!e)}function U(e,t){return e.find(({parts:e})=>V(e.language,t.language)&&e.region===t.region)?.locale??e.find(({parts:e})=>V(e.language,t.language))?.locale}function N(e){return"esri.Graphic"===e?.declaredClass}function k(e){return"no"===e||"nb"===e}function V(e,t){return e===t||k(e)&&k(t)}function z(e){return"esri.rest.support.Stop"===e?.declaredClass}let F=class extends(P(i)){constructor(e){super(e),this._debouncedSolveHandler=a(async e=>{switch(e.type){case"create":switch(e.state){case"start":case"active":return}break;case"delete":break;case"update":switch(e.state){case"start":return void(this._networkFeatureUpdated=!1);case"active":if(this._networkFeatureUpdated=!0,this.autoSolveOn.includes("active"))break;return;case"complete":if(!this._networkFeatureUpdated)return;if(this.autoSolveOn.includes("complete"))break;return}}if((this.layer?.stops.filter(({geometry:e})=>!!e).length??0)<2||!this.autoSolve)return;const t="update"===e.type&&"active"===e.state;try{await this.getDirections({zoomToSolvedRoute:!1,ignoreSolvedStopGeometry:t,generalizeGeometry:t})}catch(r){o.getLogger(this).error(r)}}),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.autoSolveOn=["complete"],this.defaultTravelMode=null,this.departureIsoDate=void 0,this.departureIsoTime=void 0,this.departureOption=j.NOW,this.departureTime="now",this.lastError=null,this.lastRoute=null,this.layer=null,this.maxStops=50,this.routeParameters=new T({directionsLengthUnits:"kilometers",findBestSequence:!1,preserveFirstStop:!0,preserveLastStop:!0,returnZ:!0,useTimeWindows:!1}),this.serviceDescription=null,this.view=null}initialize(){this.addHandles([u(()=>this.layer,e=>{if(e){for(;e.stops.length<2;)e.stops.add(new S);this._set("defaultTravelMode",null),this.addHandles(c(()=>this.serviceDescription?e.routeInfo?.analysisSettings?.travelMode:null,e=>{this.defaultTravelMode=this._resolveDefaultTravelMode(e)},{once:!0}))}},d),u(()=>[this.layer,this.view],async()=>{this._layerView=await this._getRouteLayerView()},d),h(()=>this._layerView,["create","delete","update"],e=>{this._debouncedSolveHandler(e).catch(l)})]);const e=v(this.view?.timeZone??M),t=L.fromMillis(Date.now());this.departureIsoDate=t.toFormat(b,A(e)),this.departureIsoTime=t.toFormat(C,A(e))}get _directionsLanguage(){const e=this.serviceDescription?.directionsSupportedLanguages;if(!e)return;const t=this.routeParameters.directionsLanguage??f(),r=w(t),i=r?.language,o=r?.region;if(!i)return;return U(E(e),{language:i,region:o})}get formattedEta(){const e=this.layer?.routeInfo?.endTime,t=this.layer?.routeInfo?.endTimeOffset;if(this.departureOption===j.UNSPECIFIED||!e||!t)return null;const r=L.fromJSDate(e,{zone:O.instance(t)}),i=L.fromJSDate(e,{zone:R.create(v(this.view?.timeZone??M))}),o=L.fromJSDate(new Date,{zone:R.create(v(this.view?.timeZone??M))}),s=o.year===i.year&&o.month===i.month&&o.day===i.day,a=i.offset===t?void 0:I,l=s?void 0:g("short-date"),n=g("short-time");return y(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){this.clearHighlights();const t=await this._getRouteLayerView();this._highlight=t?.highlight(e)??null}clearHighlights(){this._highlight?.remove(),this._highlight=null}centerAt(e){if(!this.view)return;const t=z(e)||N(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,ignoreSolvedStopGeometry:!1,generalizeGeometry:!1}){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("disabled"===o||"initializing"===o||"unauthenticated"===o||2===this._serviceDescriptionStatus)throw new r("directions-view-model:not-loaded","Cannot get directions until view model loads.");this._routeController?.abort(),this._routeController=null;const{startTime:s,startTimeIsUTC:a}=this._getStartTimeParameters(),l=this.view?.spatialReference??null,u=this.routeParameters.clone(),d=e.generalizeGeometry?this._getGeometryPrecision():null;u.set({apiKey:t,directionsLanguage:this._directionsLanguage,geometryPrecision:d,outSpatialReference:l,startTime:s,startTimeIsUTC:a}),this.selectedTravelMode&&(u.travelMode=this.selectedTravelMode);if(i.stops.filter(({geometry:e})=>!!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:c}=this._routeController;let h=null;try{h=await i.solve(u,{signal:c})}catch(p){if(!n(p)){const e=new r("directions-view-model:unable-to-route","Unable to route to these addresses",{error:p});throw this._set("lastError",e),this.clearResults(),e}}finally{this._routeController=null}this._set("lastError",null);for(const r of h.stops)r.geometry||(r.name=null);if(e.ignoreSolvedStopGeometry&&i.stops.every(({objectId:e})=>!!e)&&h.stops.every(({objectId:e})=>!!e))for(const r of h.stops){const e=i.stops.find(({objectId:e})=>e===r.objectId)?.geometry;e&&(r.geometry=e.clone())}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 S,new S]))}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)}startEditing(){this._layerView&&(this._layerView.interactive=!0,this._layerView.interactiveOptions.waypointAdditionEnabled=!this.routeParameters.findBestSequence)}stopEditing(){this._layerView&&(this._layerView.interactive=!1)}updateDepartureTime(){if(this.departureIsoDate&&this.departureIsoTime)switch(this.departureOption){case j.NOW:this.departureTime="now";break;case j.DEPART_AT:{const e=L.fromISO(`${this.departureIsoDate}T${this.departureIsoTime}`,{zone:O.instance(0)});this.departureTime=e.toJSDate();break}case j.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})}_getGeometryPrecision(){const e=this.view?.resolution;return e?s(Math.ceil(-Math.log10(e)),0,4):null}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 _(this.layer.url,this.apiKey,{signal:e});this._set("serviceDescription",t),this._serviceDescriptionStatus=1}catch(t){if(n(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 D.fromJSON({...s?.toJSON(),...e.toJSON()})}const o=r?.find(({name:t})=>t.toLocaleLowerCase()===e.name.toLocaleLowerCase());return o??t}};e([p()],F.prototype,"_directionsLanguage",null),e([p()],F.prototype,"_layerView",void 0),e([p()],F.prototype,"_routeController",void 0),e([p()],F.prototype,"_serviceDescriptionStatus",void 0),e([p()],F.prototype,"apiKey",void 0),e([p()],F.prototype,"autoSolve",void 0),e([p({nonNullable:!0})],F.prototype,"autoSolveOn",void 0),e([p()],F.prototype,"defaultTravelMode",void 0),e([p()],F.prototype,"departureTime",void 0),e([p()],F.prototype,"formattedEta",null),e([p({readOnly:!0})],F.prototype,"impedanceAttribute",null),e([p()],F.prototype,"lastError",void 0),e([p({readOnly:!0})],F.prototype,"lastRoute",void 0),e([p()],F.prototype,"layer",void 0),e([p({type:Number,range:{min:2,max:50},nonNullable:!0})],F.prototype,"maxStops",void 0),e([p({type:T,nonNullable:!0})],F.prototype,"routeParameters",void 0),e([p({readOnly:!0})],F.prototype,"selectedNetworkFeatures",null),e([p({type:D})],F.prototype,"selectedTravelMode",null),e([p({readOnly:!0})],F.prototype,"serviceDescription",void 0),e([p({readOnly:!0})],F.prototype,"state",null),e([p({readOnly:!0})],F.prototype,"timeAttribute",null),e([p()],F.prototype,"travelModes",null),e([p()],F.prototype,"view",void 0),e([p()],F.prototype,"zoomToRoute",null),F=e([m("esri.widgets.Directions.DirectionsViewModel")],F);const G=F;export{G as default};
|
package/widgets/Directions.d.ts
CHANGED
|
@@ -98,7 +98,7 @@ export interface DirectionsProperties extends WidgetProperties, Partial<Pick<Dir
|
|
|
98
98
|
*
|
|
99
99
|
* | Directions with RouteLayer |
|
|
100
100
|
* |------|
|
|
101
|
-
* |  |
|
|
102
102
|
*
|
|
103
103
|
* This routing service requires authentication.
|
|
104
104
|
* If an API key is specified at the app level (see [Config](https://developers.arcgis.com/javascript/latest/references/core/config/#Config-apiKey)) or widget level (see [apiKey](https://developers.arcgis.com/javascript/latest/references/core/widgets/Directions/#apiKey)) then this key will accompany requests to both the routing service and geocoder/reverse-geocoder.
|
|
@@ -106,14 +106,14 @@ export interface DirectionsProperties extends WidgetProperties, Partial<Pick<Dir
|
|
|
106
106
|
*
|
|
107
107
|
* | Pick a location on the map |
|
|
108
108
|
* |------|
|
|
109
|
-
* |  |
|
|
110
110
|
*
|
|
111
111
|
* Locations on the map can be reverse geocoded and used as stops in the route.
|
|
112
112
|
* Click the button with a crosshairs icon to associate a location with a new or existing stop. After clicking the button, click the map once. To cancel this process, press the `escape` key.
|
|
113
113
|
*
|
|
114
114
|
* | Route options | Route options |
|
|
115
115
|
* |------|------|
|
|
116
|
-
* |  |  |
|
|
117
117
|
*
|
|
118
118
|
* The resulting driving directions are automatically collapsed and can be optionally saved to a new or existing portal item. This can be achieved programically with [save()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Directions/#save) and [saveAs()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Directions/#saveAs).
|
|
119
119
|
* The `Clear` button calls the [DirectionsViewModel.reset()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Directions/DirectionsViewModel/#reset)
|
|
@@ -121,7 +121,7 @@ export interface DirectionsProperties extends WidgetProperties, Partial<Pick<Dir
|
|
|
121
121
|
*
|
|
122
122
|
* | Editing | Editing |
|
|
123
123
|
* |------|------|
|
|
124
|
-
* |  |  |
|
|
125
125
|
*
|
|
126
126
|
* Selecting the `Edit route` button allows you to add/move/remove stops, add/move/remove/reshape polyline barriers.
|
|
127
127
|
* By default the route will be automatically resolve at the completion of any editing operation. For more complex routes, it may be advantageous to disable auto-solving and solve as and when needed with the dedicated solve button.
|
package/widgets/Directions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{deprecateWidget as s}from"../core/deprecate.js";import{addEventListener as o}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{debounce as l,isAbortError as c}from"../core/promiseUtils.js";import{watch as d,initial as h,on as p}from"../core/reactiveUtils.js";import{escapeRegExpString as m}from"../core/string.js";import{property as u,subclass as v}from"../core/accessorSupport/decorators.js";import{onLocaleChange as g,getLocaleLanguage as _}from"../intl/locale.js";import w from"../portal/Portal.js";import{defaultUnitPropertyMetadata as y}from"../properties/defaultUnit.js";import b from"../rest/support/Stop.js";import S from"../symbols/SimpleMarkerSymbol.js";import f from"./Search.js";import k from"./Widget.js";import{css as C}from"./Directions/css.js";import{DirectionsSearchTool as D}from"./Directions/DirectionsSearchTool.js";import M from"./Directions/DirectionsViewModel.js";import I from"./Directions/DirectionsVisibleElements.js";import{formatDistance as P,formatDuration as T,DepartureTimeOption as F,getIconName as x}from"./Directions/support/directionsUtils.js";import{isArcGISWorldGeocoder as L,meteredArcGISLocatorUrl as E}from"./Search/support/locatorUtils.js";import{loadCalciteComponents as R}from"./support/componentsUtils.js";import{globalCss as A}from"./support/globalCss.js";import{messageBundle as N,tsx as O}from"./support/widget.js";function B(e){const{branchName:i,displayText:s,exitName:o,intersectingName:r,name:a,towardName:n}=e;if(null==s)return null;const l=[i,o,r,a,n].filter(t).sort((e,t)=>t.length-e.length).map(e=>m(e));if(!l.length)return s;const c=new RegExp(l.join("|"),"g"),d=s.matchAll(c);let h=0;const p=[];for(const{0:t,index:m}of d)p.push(s.slice(h,m),O("span",{class:C.labelEmphasize,key:`maneuver-${m}`},t)),h=m+t.length;return p.push(s.slice(h)),O("span",null,p)}const j="print-preview-closed";let $=class extends k{constructor(e,t){super(e,t),this._activeManeuver=null,this._placeholderStops=new i([new b,new b]),this._portalFolderCombobox=null,this._portalFolders=null,this._portalItemNameInput=null,this._portalUserName=null,this._printPreviewDialog=null,this._sections=null,this._stopsToSearches=new Map,this._editNoticeClosed=!1,this._printPreviewDialogOpen=!1,this._currentFlowItem="primary",this._parentFlowItem="primary",this._saveState="initialized",this._searchTool=null,this.headingLevel=2,this.messages=null,this.messagesUnits=null,this.searchProperties={popupEnabled:!1,resultGraphicEnabled:!1},this.viewModel=new M,this.visibleElements=new I,this._solveRouteDebounced=l(()=>this._solveRoute()),this.announceDeprecation=()=>{s(a.getLogger(this),"Directions","arcgis-directions",{version:"5.0"})}}initialize(){this.addHandles([d(()=>this.viewModel.layer,()=>{try{this.viewModel.load()}catch{}},h),d(()=>this.viewModel.layer?.routeInfo,()=>{this._sections=this._getStopSections()},h),d(()=>this.viewModel.layer?.stops.toArray(),e=>{e&&this.view?.activeTool&&this._searchTool&&this.view.activeTool===this._searchTool&&!e.includes(this._searchTool.stop)&&(this.view.tools.remove(this._searchTool),this._searchTool=null)})])}loadDependencies(){return R({accordion:()=>import("@esri/calcite-components/dist/components/calcite-accordion"),"accordion-item":()=>import("@esri/calcite-components/dist/components/calcite-accordion-item"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}destroy(){this._stopsToSearches.forEach(n)}get apiKey(){return this.viewModel.apiKey}set apiKey(e){this.viewModel.apiKey=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get displayedStops(){return this.effectiveStops.toArray().filter(({locationType:e})=>"waypoint"!==e)}get effectiveStops(){return this.viewModel.layer?.stops??this._placeholderStops}get icon(){return"right"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get lastRoute(){return this.viewModel.lastRoute}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get maxStops(){return this.viewModel.maxStops}set maxStops(e){this.viewModel.maxStops=e}get unit(){return this.defaultUnit}set unit(e){this._overrideIfSome("unit",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}acquireSearch(e){const{view:t}=this.viewModel;if(this._stopsToSearches.has(e)){const i=this._stopsToSearches.get(e);return i.view=t,this._overrideDefaultSources(i),i}const i=new f({icon:"",popupEnabled:!1,resultGraphicEnabled:!1,view:t,suppressDeprecationWarning:!0,...this.searchProperties});return this._normalizeSearchSources(i),this.addHandles([p(()=>i.allSources,"change",()=>this._normalizeSearchSources(i)),i.on("search-clear",()=>{e.geometry=null,e.name=null,this.viewModel.layer?.removeResult()}),i.on("select-result",()=>{const t=i.selectedResult;e.geometry=t?.feature.geometry,e.name=t?.name,this._solveRouteDebounced()}),d(()=>i.searchTerm,t=>{e.name=t}),g(()=>this._normalizeSearchSources(i))],i),this._stopsToSearches.set(e,i),i}getDirections(){return this.viewModel.getDirections()}render(){return O("div",{class:this.classes(C.base,A.widget,A.panel)},O("calcite-flow",null,this._renderPrimaryFlowItem(),this._renderDirectionsFlowItem(),this._renderEditFlowItem(),this._renderSaveFlowItem()),this._renderPrintDocument())}save(){return this.viewModel.save()}saveAs(e,t={}){return this.viewModel.saveAs(e,t)}zoomToRoute(){return this.viewModel.zoomToRoute()}_applyLocatorSourceOverrides({allSources:e}){for(const t of e)"url"in t&&t.url&&(t.language=_(),t.locationType??="street",L(t.url)&&this.apiKey&&null==t.apiKey&&(t.apiKey=this.apiKey,t.url=E))}_disposeSearch(e){if(!e||!this._stopsToSearches.has(e))return;const t=this._stopsToSearches.get(e);this.removeHandles(t),t.destroy(),this._stopsToSearches.delete(e)}_getErrorDescription(){switch(this.viewModel.lastError?.name){case"directions-view-model:unable-to-route":return this.messages.errors.unableToRoute;case"directions-view-model:service-metadata-unavailable":return this.messages.errors.unableToLoadServiceMetadata;default:return this.messages.errors.unknownError}}_getNetworkFeatureName(e){switch(e.type){case"stop":switch(e.locationType){case"stop":default:return this.messages.networkFeatures.stops.stop;case"waypoint":return this.messages.networkFeatures.stops.waypoint;case"break":return this.messages.networkFeatures.stops.break}case"point-barrier":return this.messages.networkFeatures.pointBarrier;case"polyline-barrier":return this.messages.networkFeatures.polylineBarrier;case"polygon-barrier":return this.messages.networkFeatures.polygonBarrier}}_getRouteCostSummary(){const e=this.viewModel.layer?.routeInfo;if(!e)return null;const t=e.totalDistance??0,i=e.totalDuration??0,{messagesUnits:s,unit:o}=this;return{distance:P(s,t,o),duration:T(i)}}_getStopCostDescription(e){if(!e.directions.length)return;const{totalDistance:t,totalDuration:i}=e.directions.reduce((e,{lines:t})=>{for(const{distance:i,duration:s}of t)e.totalDistance+=i??0,e.totalDuration+=s??0;return e},{totalDistance:0,totalDuration:0}),{messagesUnits:s,unit:o}=this,r=P(s,t,o);return`${T(i)} (${r})`}_getStopSections(){if(!this.viewModel.layer)return null;const{directionPoints:e,directionLines:t,stops:i}=this.viewModel.layer;if(!e||!t)return null;const s=[];let o=null;for(const r of e){const{objectId:e,stopId:a}=r;if(null!=a){const e=i.find(({objectId:e})=>e===a);o&&o.stop===e||(o={stop:e,directions:[]},s.push(o));continue}if(null==o)continue;const n=t.toArray().filter(({directionPointId:t})=>t===e);0!==n.length&&o.directions.push({directionPoint:r,lines:n})}return s}_handleAddStopClick(){const e=new S;this.viewModel.layer?.stops.add(new b({symbol:e}))}_handleAutoSolveChange({target:e}){this.viewModel.autoSolve=e.checked}_handleCreatePolylineBarrierClick(){this.viewModel.create("polyline-barrier")}_handleClearRouteClick(){this._currentFlowItem="primary",this.viewModel.reset()}_handleCreateStopClick(){this.viewModel.create("stop")}_handleDeleteNetworkFeatureClick(e){this.viewModel.remove(e),this.viewModel.autoSolve&&this._solveRouteDebounced()}_handleDeleteStopClick(e){this.effectiveStops.remove(e),this._disposeSearch(e),this._solveRouteDebounced()}_handleDepartureDateChange({currentTarget:{value:e}}){Array.isArray(e)||(this.viewModel.departureIsoDate=e,this._solveRouteDebounced())}_handleDepartureTimeChange({currentTarget:{value:e}}){this.viewModel.departureIsoTime=e,this._solveRouteDebounced()}_handleDepartureTimeOptionChange({currentTarget:e}){const{selectedItems:t}=e;t.length&&(this.viewModel.departureOption=t[0].value,this._solveRouteDebounced())}_handleDirectionsFlowItemBackClick(e){e.stopPropagation(),this._currentFlowItem="primary"}_handleDirectionTurnItemSelect(e){this._activeManeuver===e?this.zoomToRoute():(this._activeManeuver=e,this.viewModel.centerAt(e.geometry))}_handleDirectionTurnPointerEnter(e){this.viewModel.highlight(e)}_handleDirectionTurnPointerLeave(){this.viewModel.clearHighlights()}_handleEditFlowItemBackClick(e){e.stopPropagation(),this.viewModel.stopEditing(),this._currentFlowItem="primary"}_handleEditingDoneClick(){this.viewModel.stopEditing(),this._currentFlowItem="primary"}_handleEditNoticeClose(){this._editNoticeClosed=!0}_handleEditRouteClick(){this._currentFlowItem="edit",this.viewModel.startEditing()}_handleItemDetailsClick(){const e=this.viewModel.layer?.portalItem;e&&window.open(`${e.portal.url}/home/item.html?id=${e.id}`,"_blank")}_handleLocateStopClick(e){const{view:t}=this;if(!t)return;const i="directions-search-tool";this.removeHandles(i),this._searchTool=new D({stop:e,view:t}),this.addHandles([this._searchTool.on("click",async t=>{if(t.mapPoint&&this._stopsToSearches.has(e)){const i=this._stopsToSearches.get(e),s=await i.search(t.mapPoint),o=s?.results?.[0].results?.[0];if(o){const{feature:t,name:s}=o;i.searchTerm=s,e.geometry=t.geometry}}this.removeHandles(i)}),r(()=>{this._searchTool&&(this.view?.tools.remove(this._searchTool),this._searchTool=null)})],i),t.addAndActivateTool(this._searchTool)}_handleOptimizeStopOrderToggle({target:{expanded:e}}){this.viewModel.routeParameters.findBestSequence=e,e&&this._removeWaypoints(),this._solveRouteDebounced()}_handlePanToStopClick(e){this.viewModel.centerAt(e)}_handlePreserveFirstStopChange({target:{checked:e}}){this.viewModel.routeParameters.preserveFirstStop=e,this._solveRouteDebounced()}_handlePreserveLastStopChange({target:{checked:e}}){this.viewModel.routeParameters.preserveLastStop=e,this._solveRouteDebounced()}_handlePrintPreviewDialogAfterCreate(e){document.body.appendChild(e),e.showModal(),this._printPreviewDialog=e,this.removeHandles(j),this.addHandles([o(e,"close",this._handlePrintPreviewDialogClosed.bind(this)),r(()=>{this._printPreviewDialog&&(document.body.removeChild(this._printPreviewDialog),this._printPreviewDialog=null,this._printPreviewDialogOpen=!1)})],j)}_handlePrintPreviewDialogClick(){this._printPreviewDialogOpen=!0}_handlePrintPreviewDialogCloseClick(){this._printPreviewDialog?.close()}_handlePrintPreviewDialogClosed(){this.removeHandles(j)}_handlePrintPreviewDialogPrintClick(){document.body.classList.add(C.printPreviewMedia),window.print(),document.body.classList.remove(C.printPreviewMedia),this._printPreviewDialog?.close()}_handleResolveRouteClick(){this._solveRouteDebounced()}_handleReverseStopOrderClick(){this._removeWaypoints(),this.effectiveStops.reverse(),this._solveRouteDebounced()}_handleSaveErrorCloseClick(){this._currentFlowItem=this._parentFlowItem}_handleSaveFlowItemBackClick(e){e.stopPropagation(),this._currentFlowItem=this._parentFlowItem}async _handleSaveLayerAs(){const e=w.getDefault();try{await e.signIn()}catch(t){if(c(t)||"identity-manager:user-aborted"===t.name)return;return this._parentFlowItem=this._currentFlowItem,this._currentFlowItem="save",void(this._saveState="connect-to-portal-error")}this._saveState="fetch-portal-information",this._parentFlowItem=this._currentFlowItem,this._currentFlowItem="save",this._portalUserName=e.user?.username;try{this._portalFolders=await(e.user?.fetchFolders())}catch{return void(this._saveState="fetch-portal-information-error")}this._saveState="save-layer"}_handleSaveLayerClick(){this.viewModel.layer?.save()}_handleSaveLayerButtonClick(){this._saveState="saving";const{layer:e}=this;if(!e||!this._portalFolders)return;const t=this._portalItemNameInput?.value,i=this._portalFolderCombobox?.value,s=this._portalFolders.find(({id:e})=>e===i);e.saveAs({title:t},{folder:s}).then(()=>{e.title=t,this._currentFlowItem=this._parentFlowItem}).catch(()=>{this._saveState="saving-error"})}_handleSaveLayerCancelClick(){this._currentFlowItem=this._parentFlowItem}_handleSaveLayerFolderCreate(e){this._portalFolderCombobox=e}_handleSaveLayerNameCreate(e){this._portalItemNameInput=e}_handleSignInClick(){this.viewModel.load().catch(()=>{})}_handleStopListReorder({detail:{dragEl:e,newIndex:t}}){this._removeWaypoints(),this.effectiveStops.reorder(e.value,t),this._solveRouteDebounced()}_handleTravelModeChange({currentTarget:{selectedItems:e}}){e.length&&(this.viewModel.selectedTravelMode=e[0].value,this._solveRouteDebounced())}_handleViewDrivingDirectionsClick(){this._currentFlowItem="directions"}_normalizeSearchSources(e){this._overrideDefaultSources(e),this._applyLocatorSourceOverrides(e)}_overrideDefaultSources(e){for(const t of e.viewModel.defaultSources)t.autoNavigate=!1}_removeWaypoints(){const e=this.viewModel.layer?.stops;if(e){const t=e.filter(({locationType:e})=>"waypoint"===e);e.removeMany(t)}}_renderClearRouteAction(e){return O("calcite-action",{bind:this,icon:"trash",key:"clear-route",onclick:this._handleClearRouteClick,...e,text:this.messages.common.clear,textEnabled:!0})}_renderDeleteStopAction(e){return O("calcite-action",{icon:"trash",onclick:this._handleDeleteStopClick.bind(this,e),slot:"actions-end",text:this.messages.deleteStop,title:this.messages.deleteStop})}_renderDepartureTime(){const{DEPART_AT:e,NOW:t,UNSPECIFIED:i}=F;return O("calcite-label",{class:C.departureTime,key:"departure-time"},this.messages.departureTime,O("calcite-combobox",{bind:this,label:this.messages.departureTime,overlayPositioning:"fixed",selectionMode:"single-persist",topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:this._handleDepartureTimeOptionChange},O("calcite-combobox-item",{heading:this.messages.leaveNow,key:t,label:this.messages.leaveNow,selected:this.viewModel.departureOption===t,value:t}),O("calcite-combobox-item",{heading:this.messages.departAt,key:e,label:this.messages.departAt,selected:this.viewModel.departureOption===e,value:e}),O("calcite-combobox-item",{heading:this.messages.timeUnspecified,key:i,label:this.messages.timeUnspecified,selected:this.viewModel.departureOption===i,value:i})))}_renderDepartureTimeOptions(){return this.viewModel.departureOption!==F.DEPART_AT?null:O("div",{class:C.departureTimeOptions},O("calcite-input-date-picker",{bind:this,scale:"s",topLayerDisabled:this.topLayerDisabled,value:this.viewModel.departureIsoDate,onCalciteInputDatePickerChange:this._handleDepartureDateChange}),O("calcite-input-time-picker",{bind:this,scale:"s",value:this.viewModel.departureIsoTime,onCalciteInputTimePickerClose:this._handleDepartureTimeChange}))}_renderDirectionsFlowItem(){if("directions"!==this._currentFlowItem)return null;const e=this._getRouteCostSummary();if(!this._sections||!e)return null;const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel,o=this._sections.at(0)?.stop.name??"",r=this._sections.at(-1)?.stop.name??"";return O("calcite-flow-item",{bind:this,key:"directions-flow-item",overlayPositioning:"fixed",selected:"directions"===this._currentFlowItem,onCalciteFlowItemBack:this._handleDirectionsFlowItemBackClick},O("div",{class:C.directionsHeader,slot:"header-content"},O("div",{class:C.headerStops},O("span",null,this.messages.from)," ",O("span",{class:C.directionsHeaderStopName},o),O("span",null,this.messages.to)," ",O("span",{class:C.directionsHeaderStopName},r)),O("div",{class:C.flexColumn},O("span",null,`${i} (${t})`),s?O("span",null,s):null)),this._renderRouteLayerActions({slot:"header-menu-actions"}),O("calcite-accordion",{class:C.accordion,iconPosition:"start",selectionMode:"single"},this._sections.map((e,t)=>this._renderDirectionSection(e,t))))}_renderDirectionSection(e,t){const{stop:i,directions:s}=e,{name:o}=i,r=0===t,a=this._getStopCostDescription(e);return O("calcite-accordion-item",{description:a,expanded:r,heading:o??"",key:`stop-${t}`},O("calcite-action",{icon:"zoom-to-object",onclick:this._handlePanToStopClick.bind(this,i),slot:"actions-end",text:this.messages.panToStop,title:this.messages.panToStop}),this._renderDirectionTurns(s))}_renderDirectionTurns(e){return O("calcite-list",{label:this.messages.drivingDirections,selectionMode:"none"},e.map((e,t)=>{const{directionPoint:i,lines:s}=e,o=s[0],{distance:r,duration:a}=o,n=P(this.messagesUnits,r??0,this.unit),l=T(a??0),c=n&&l?`${n} | ${l}`:`${n||l}`,d=B(i),h=x(i.directionPointType);return O("calcite-list-item",{class:C.labelNoBottomMargin,key:`driving-direction-${t}`,onpointerenter:this._handleDirectionTurnPointerEnter.bind(this,o),onpointerleave:this._handleDirectionTurnPointerLeave.bind(this),onCalciteListItemSelect:this._handleDirectionTurnItemSelect.bind(this,o)},O("calcite-icon",{icon:h,slot:"content-start"}),O("div",{slot:"content"},O("calcite-label",{layout:"inline",scale:"s"},d),O("calcite-label",{layout:"inline",scale:"s"},c)))}))}_renderEditNotice(){return this._editNoticeClosed?null:O("div",{class:C.editInformationContainer},O("calcite-notice",{bind:this,closable:!0,kind:"info",open:!0,onCalciteNoticeClose:this._handleEditNoticeClose},O("calcite-label",{scale:"s",slot:"message"},this.messages.editInstructions)))}_renderEditFlowItem(){return"edit"!==this._currentFlowItem?null:O("calcite-flow-item",{bind:this,heading:this.messages.editRoute,headingLevel:this.headingLevel,key:"edit-flow-item",loading:"routing"===this.viewModel.state,selected:"edit"===this._currentFlowItem,onCalciteFlowItemBack:this._handleEditFlowItemBackClick},O("div",{class:C.flexColumn,key:"edit-container"},this._renderEditNotice(),O("div",{class:C.editToolbarContainer},O("calcite-label",{layout:"inline",scale:"s"},this.messages.automaticallySolve,O("calcite-switch",{bind:this,checked:this.viewModel.autoSolve,scale:"s",onCalciteSwitchChange:this._handleAutoSolveChange})),O("div",{class:C.editToolbar},O("calcite-action",{bind:this,disabled:!this.viewModel.layer||this.viewModel.layer.stops.length>=this.maxStops,icon:"flag",onclick:this._handleCreateStopClick,scale:"s",text:this.messages.networkFeatures.stops.stop,textEnabled:!0}),O("calcite-action",{bind:this,icon:"line",onclick:this._handleCreatePolylineBarrierClick,scale:"s",text:this.messages.barrier,textEnabled:!0}),O("calcite-action",{bind:this,class:C.solveRoute,disabled:this.viewModel.autoSolve,icon:"refresh",onclick:this._handleResolveRouteClick,scale:"s",text:this.messages.solve,textEnabled:!0}))),O("div",{class:C.selectedFeatureContainer},O("calcite-list",{label:this.messages.selectedNetworkFeatures,scale:"s",selectionMode:"none"},this.viewModel.selectedNetworkFeatures?.toArray().map((e,t)=>O("calcite-list-item",{description:this._getNetworkFeatureName(e),key:`network-feature-${t}`,label:e.name??e.objectId?.toString()??this.messages.unnamed},O("calcite-action",{icon:"trash",onclick:this._handleDeleteNetworkFeatureClick.bind(this,e),slot:"actions-end",text:this.messages.common.delete}))))),O("div",{class:C.editFooter},this._renderEditFooterContent())))}_renderEditFooterContent(){return this.viewModel.lastError?this._renderErrorNotice():O("calcite-button",{appearance:"outline-fill",bind:this,onclick:this._handleEditingDoneClick,width:"full"},this.messages.common.done)}_renderErrorNotice(){return O("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0},O("calcite-label",{class:C.labelNoBottomMargin,slot:"message"},this._getErrorDescription()))}_renderFooter(){if(!this.viewModel.layer)return O("div",{class:C.primaryFooter,key:"footer-missing-layer"},O("calcite-notice",{icon:"information",open:!0},O("calcite-label",{class:C.labelNoBottomMargin,slot:"message"},this.messages.missingLayer)));if("unauthenticated"===this.viewModel.state)return O("div",{class:C.primaryFooterCentered,key:"footer-sign-in"},O("calcite-label",null,this.messages.signInRequired),O("calcite-button",{bind:this,onclick:this._handleSignInClick},this.messages.common.auth.signIn));if("routing"===this.viewModel.state)return O("div",{class:this.classes(C.primaryFooter,C.primaryFooterLoader),key:"footer-routing"},O("calcite-loader",{label:this.messages.solve,scale:"s"}));if("error"===this.viewModel.state)return O("div",{class:C.primaryFooter,key:"footer-service-error"},this._renderErrorNotice());if(!this.viewModel.layer?.routeInfo)return O("div",{class:C.primaryFooter,key:"footer-unsolved-route"},O("calcite-notice",{icon:"information",open:!0},O("calcite-label",{class:C.labelNoBottomMargin,slot:"message"},this.messages.directionsPlaceholder)));const e=this._getRouteCostSummary();if(!e||!this.viewModel.layer?.directionPoints)return O("div",{class:C.primaryFooter,key:"footer-invalid-route"},O("calcite-notice",{icon:"exclamation-mark-triangle",kind:"danger",open:!0},O("calcite-label",{class:C.labelNoBottomMargin,slot:"message"},this.messages.invalidRoute)));const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel;return O("div",{class:C.routeItem,key:"footer-directions-summary"},O("button",{"aria-busy":"false","aria-label":this.messages.viewDrivingDirections,"aria-live":"polite",bind:this,class:C.routeItemButton,onclick:this._handleViewDrivingDirectionsClick,title:this.messages.viewDrivingDirections,type:"button"},O("div",{class:C.routeItemButtonContent},O("span",{class:C.routeItemLabel},`${i} (${t})`),O("span",{class:C.routeItemDescription},s)),O("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s"})),O("calcite-action-menu",{label:"test"},O("calcite-action",{icon:"ellipsis",key:"route-actions",slot:"trigger",text:"Route actions"}),this._renderRouteLayerActions()))}_renderInteractiveRouteActions(){return O("div",{class:C.actionContainer,key:C.actionContainer},O("calcite-button",{appearance:"outline",bind:this,class:C.addStopButton,disabled:this.effectiveStops.length>=this.maxStops,iconStart:"plus",kind:"neutral",label:this.messages.addStop,onclick:this._handleAddStopClick,title:this.messages.addStop,width:"half"},this.messages.addStop),this.visibleElements.editRouteButton?O("calcite-button",{appearance:"outline",bind:this,class:C.editRouteButton,disabled:"2d"!==this.viewModel.view?.type,iconStart:"pencil",kind:"neutral",label:this.messages.editRoute,onclick:this._handleEditRouteClick,title:this.messages.editRoute,width:"half"},this.messages.editRoute):null)}_renderLocateStopAction(e){if(null!=e.name||null!=e.geometry)return null;const t=this.effectiveStops.indexOf(e),i=!!this.view?.activeTool&&this.view.activeTool===this._searchTool&&this._searchTool.stop===e;return O("calcite-action",{active:i,icon:"crosshair",key:`stop-location-action-${t}`,onclick:this._handleLocateStopClick.bind(this,e),slot:"actions-end",text:this.messages.pickALocationOnTheMap,title:this.messages.pickALocationOnTheMap})}_renderOptimizeStopOrder(){const{routeParameters:e}=this.viewModel,{findBestSequence:t,preserveFirstStop:i,preserveLastStop:s}=e;return O("calcite-block-section",{bind:this,class:C.optimizeSection,text:this.messages.optimizeOrder,toggleDisplay:"switch",onCalciteBlockSectionToggle:this._handleOptimizeStopOrderToggle},t?[O("calcite-label",{class:C.optimizeSwitches,key:"preserve-first-stop",layout:"inline-space-between"},this.messages.preserveFirstStop,O("calcite-switch",{bind:this,checked:i,scale:"s",onCalciteSwitchChange:this._handlePreserveFirstStopChange})),O("calcite-label",{class:C.optimizeSwitches,key:"preserve-last-stop",layout:"inline-space-between"},this.messages.preserveLastStop,O("calcite-switch",{bind:this,checked:s,scale:"s",onCalciteSwitchChange:this._handlePreserveLastStopChange}))]:null)}_renderPrimaryFlowItem(){return O("calcite-flow-item",{key:"primary-flow-item",loading:"initializing"===this.viewModel.state,selected:"primary"===this._currentFlowItem},O("calcite-panel",{class:C.primaryFlowItem,disabled:!this.viewModel.layer||"unauthenticated"===this.viewModel.state||"error"===this.viewModel.state&&!this.viewModel.serviceDescription},this._renderStops(),this._renderInteractiveRouteActions(),this._renderSeparator(),this._renderRouteSolveOptions()),this._renderFooter())}_renderPrintDocument(){if(!this._printPreviewDialogOpen)return null;const e=this._getRouteCostSummary();if(!this._sections||!e)return null;const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel,o=this._sections.at(0)?.stop.name??"",r=this._sections.at(-1)?.stop.name??"";return O("dialog",{afterCreate:this._handlePrintPreviewDialogAfterCreate,bind:this,class:C.printPreviewDialog},O("div",{class:C.printPreviewContent},O("div",{class:C.printPreviewHeader},O("div",{class:C.printPreviewHeaderLabel},O("div",{class:C.headerStops},O("span",null,this.messages.from)," ",O("span",{class:C.directionsHeaderStopName},o),O("span",null,this.messages.to)," ",O("span",{class:C.directionsHeaderStopName},r))),O("div",{class:this.classes(C.printPreviewHeaderButtons,C.printPreviewHideOnPrint)},O("calcite-button",{autofocus:!0,bind:this,class:C.printPreviewDialogPrint,iconStart:"print",onclick:this._handlePrintPreviewDialogPrintClick},this.messages.common.print),O("calcite-button",{appearance:"outline",bind:this,class:C.printPreviewDialogClose,iconStart:"x-circle",onclick:this._handlePrintPreviewDialogCloseClick},this.messages.common.close))),O("div",{class:C.directionsHeader},O("span",null,`${i} (${t})`),s?O("span",null,s):null),this._sections.map((e,t)=>this._renderPrintSection(e,t))))}_renderPrintManeuver(e,t){const{directionPoint:i,lines:s}=e,{distance:o,duration:r}=s.at(0)??{},a=P(this.messagesUnits,o??0,this.unit),n=T(r??0),l=a&&n?`${a} | ${n}`:`${a||n}`,c=B(i),d=x(i.directionPointType);return O("div",{class:this.classes(C.flexRow,C.printPreviewAvoidPageBreak),key:`direction-${t}`},O("calcite-icon",{icon:d,preload:!0}),O("div",{class:C.flexColumn},O("span",null,c),O("span",null,l)))}_renderPrintRouteAction(e){if(!this.visibleElements.printButton)return null;const t=!this.viewModel.layer?.routeInfo;return O("calcite-action",{bind:this,disabled:t,icon:"print",key:"print-route",onclick:this._handlePrintPreviewDialogClick,...e,text:this.messages.common.print,textEnabled:!0})}_renderPrintSection({stop:e,directions:t},i){return O("div",{class:C.printPreviewSection,key:`section-${i}`},O("span",{class:C.directionsHeaderStopName},e.name??""),t.map((e,t)=>this._renderPrintManeuver(e,t)))}_renderRouteLayerActions(e){return[this._renderClearRouteAction(e),this._renderSaveLayerAction(e),this._renderSaveLayerAsAction(e),this._renderPrintRouteAction(e),this._renderViewItemDetailsAction(e)]}_renderRouteSolveOptions(){return O("div",{class:C.marginInlineMedium,key:"route-solve-options"},this._renderTravelModes(),this._renderDepartureTime(),this._renderDepartureTimeOptions(),this._renderOptimizeStopOrder())}_renderSaveContent(){switch(this._saveState){case"initialized":return this._renderSaveInitialized();case"connect-to-portal":return this._renderSaveProcessing(this.messages.identity.lblSigning);case"connect-to-portal-error":return this._renderSaveError(this.messages.errors.authenticating);case"fetch-portal-information":return this._renderSaveProcessing(this.messages.processing.fetching);case"fetch-portal-information-error":return this._renderSaveError(this.messages.errors.fetching);case"save-layer":return this._renderSaveLayerSettings();case"saving":return this._renderSaveProcessing(this.messages.processing.saving);case"saving-error":return this._renderSaveError(this.messages.errors.saving)}}_renderSaveError(e){return O("calcite-panel",{class:C.paddingMedium,key:"save-layer-error"},O("div",{class:C.saveError},O("calcite-icon",{class:C.saveErrorIcon,icon:"exclamation-mark-triangle",scale:"l",textLabel:this.messages.common.errorMessage}),O("calcite-label",{class:C.saveErrorLabel},e)),O("calcite-button",{appearance:"outline",bind:this,onclick:this._handleSaveErrorCloseClick,slot:"footer-start",width:"full"},this.messages.common.close))}_renderSaveInitialized(){return O("calcite-panel",{class:C.paddingMedium,key:"save-layer-initialized"})}_renderSaveFlowItem(){return"save"!==this._currentFlowItem?null:O("calcite-flow-item",{bind:this,heading:this.messages.saveLayer,headingLevel:this.headingLevel,key:"save-layer-flow-item",selected:"save"===this._currentFlowItem,onCalciteFlowItemBack:this._handleSaveFlowItemBackClick},this._renderSaveContent())}_renderSaveLayerAction(e){if(!this.visibleElements.saveButton)return null;const t=this.viewModel.layer,i=t?.routeInfo,s=t?.portalItem?.itemControl;return O("calcite-action",{bind:this,disabled:!(!!i&&("admin"===s||"update"===s)),icon:"save",key:"save-route",onclick:this._handleSaveLayerClick,...e,text:this.messages.common.save,textEnabled:!0})}_renderSaveLayerAsAction(e){if(!this.visibleElements.saveAsButton)return null;const t=!this.viewModel.layer?.routeInfo;return O("calcite-action",{disabled:t,icon:"save-as",key:"save-as-route",onclick:()=>{this._handleSaveLayerAs()},...e,text:this.messages.common.saveAs,textEnabled:!0})}_renderSaveLayerSettings(){if(null==this.layer||null==this._portalFolders||null==this._portalUserName)return this._renderSaveInitialized();const{stops:e}=this.layer,t=`${e.at(0).name} - ${e.at(-1).name}`,i=[O("calcite-combobox-item",{heading:`${this._portalUserName} (${this.messages.common.home})`,key:C.folderHome,selected:!0,value:C.folderHome}),...this._portalFolders.map(e=>O("calcite-combobox-item",{heading:e.title??"",key:`${C.folder}-${e.id}`,value:e.id}))];return O("calcite-panel",{key:"save-layer-panel"},O("div",{class:C.paddingMedium},O("calcite-label",null,this.messages.layerName,O("calcite-input",{afterCreate:this._handleSaveLayerNameCreate,bind:this,label:this.messages.layerName,value:t})),O("calcite-label",null,this.messages.saveInFolder,O("calcite-combobox",{afterCreate:this._handleSaveLayerFolderCreate,bind:this,label:this.messages.saveInFolder,overlayPositioning:"fixed",selectionMode:"single-persist",topLayerDisabled:this.topLayerDisabled},i))),O("calcite-button",{bind:this,onclick:this._handleSaveLayerButtonClick,slot:"footer-start",width:"full"},this.messages.common.save),O("calcite-button",{appearance:"outline",bind:this,onclick:this._handleSaveLayerCancelClick,slot:"footer-start",width:"full"},this.messages.common.cancel))}_renderSaveProcessing(e){return O("calcite-panel",{class:C.marginInlineMedium,key:"save-layer-processing"},O("calcite-loader",{class:C.saveProcessLoader,label:e,text:e}))}_renderSeparator(){return O("div",{class:C.separator})}_renderStop(e){const t=this.acquireSearch(e);null!=e.name&&(t.searchTerm=e.name);const i=this._renderLocateStopAction(e),s=this.effectiveStops.length>2&&this._renderDeleteStopAction(e);return O("calcite-list-item",{key:e,value:e},i,s,O("div",{class:C.stopItem,slot:"content"},t.render()))}_renderStops(){const e=this.displayedStops;for(const t of this._stopsToSearches.keys())e.includes(t)||this._disposeSearch(t);return O("div",{class:C.stopContainer,key:C.stopContainer},O("calcite-list",{bind:this,class:C.stopList,dragEnabled:!0,label:this.messages.widgetLabel,scale:"s",onCalciteListOrderChange:this._handleStopListReorder},e.map(e=>this._renderStop(e))),2===e.length&&O("calcite-action",{bind:this,icon:"arrow-up-down",onclick:this._handleReverseStopOrderClick,text:this.messages.reverseStops,title:this.messages.reverseStops}))}_renderTravelMode(e){const{id:t,name:i}=e;return O("calcite-combobox-item",{heading:i,key:t,label:i,selected:this.viewModel.selectedTravelMode?.id===t,value:e})}_renderTravelModes(){return this.viewModel.travelModes.length?O("calcite-label",{key:"travel-modes"},this.messages.mode,O("calcite-combobox",{bind:this,label:this.messages.mode,overlayPositioning:"fixed",selectionMode:"single-persist",topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:this._handleTravelModeChange},this.viewModel.travelModes.map(e=>this._renderTravelMode(e)))):null}_renderViewItemDetailsAction(e){return this.visibleElements.layerDetails?O("calcite-action",{bind:this,disabled:!this.viewModel.layer?.portalItem,icon:"launch",key:"open-route-details-link",onclick:this._handleItemDetailsClick,...e,text:this.messages.viewLayerDetails,textEnabled:!0}):null}async _solveRoute(){this.viewModel.updateDepartureTime();if(!((this.viewModel.layer?.stops.filter(({geometry:e})=>!!e).length??0)<2))try{await this.viewModel.getDirections()}catch{}}};e([u()],$.prototype,"_editNoticeClosed",void 0),e([u()],$.prototype,"_printPreviewDialogOpen",void 0),e([u()],$.prototype,"_currentFlowItem",void 0),e([u()],$.prototype,"_saveState",void 0),e([u()],$.prototype,"_searchTool",void 0),e([u()],$.prototype,"apiKey",null),e([u(y)],$.prototype,"defaultUnit",void 0),e([u()],$.prototype,"goToOverride",null),e([u()],$.prototype,"headingLevel",void 0),e([u()],$.prototype,"displayedStops",null),e([u()],$.prototype,"effectiveStops",null),e([u()],$.prototype,"icon",null),e([u()],$.prototype,"label",null),e([u({readOnly:!0})],$.prototype,"lastRoute",null),e([u()],$.prototype,"layer",null),e([u()],$.prototype,"maxStops",null),e([u(),N("esri/widgets/Directions/t9n/Directions")],$.prototype,"messages",void 0),e([u(),N("esri/core/t9n/Units")],$.prototype,"messagesUnits",void 0),e([u()],$.prototype,"searchProperties",void 0),e([u()],$.prototype,"unit",null),e([u()],$.prototype,"view",null),e([u({type:M})],$.prototype,"viewModel",void 0),e([u({type:I,nonNullable:!0})],$.prototype,"visibleElements",void 0),$=e([v("esri.widgets.Directions")],$);const z=$;export{z as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{deprecateWidget as s}from"../core/deprecate.js";import{addEventListener as o}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{debounce as l,isAbortError as c}from"../core/promiseUtils.js";import{watch as d,initial as h,on as p}from"../core/reactiveUtils.js";import{escapeRegExpString as m}from"../core/string.js";import{property as u,subclass as v}from"../core/accessorSupport/decorators.js";import{onLocaleChange as g,getLocaleLanguage as _}from"../intl/locale.js";import w from"../portal/Portal.js";import{defaultUnitPropertyMetadata as y}from"../properties/defaultUnit.js";import b from"../rest/support/Stop.js";import S from"../symbols/SimpleMarkerSymbol.js";import f from"./Search.js";import k from"./Widget.js";import{css as C}from"./Directions/css.js";import{DirectionsSearchTool as D}from"./Directions/DirectionsSearchTool.js";import M from"./Directions/DirectionsViewModel.js";import I from"./Directions/DirectionsVisibleElements.js";import{formatDistance as P,formatDuration as T,DepartureTimeOption as F,getIconName as x}from"./Directions/support/directionsUtils.js";import{isArcGISWorldGeocoder as L,meteredArcGISLocatorUrl as E}from"./Search/support/locatorUtils.js";import{loadCalciteComponents as R}from"./support/componentsUtils.js";import{globalCss as A}from"./support/globalCss.js";import{messageBundle as N,tsx as O}from"./support/widget.js";function B(e){const{branchName:i,displayText:s,exitName:o,intersectingName:r,name:a,towardName:n}=e;if(null==s)return null;const l=[i,o,r,a,n].filter(t).sort((e,t)=>t.length-e.length).map(e=>m(e));if(!l.length)return s;const c=new RegExp(l.join("|"),"g"),d=s.matchAll(c);let h=0;const p=[];for(const{0:t,index:m}of d)p.push(s.slice(h,m),O("span",{class:C.labelEmphasize,key:`maneuver-${m}`},t)),h=m+t.length;return p.push(s.slice(h)),O("span",null,p)}const j="print-preview-closed";let $=class extends k{constructor(e,t){super(e,t),this._activeManeuver=null,this._placeholderStops=new i([new b,new b]),this._portalFolderCombobox=null,this._portalFolders=null,this._portalItemNameInput=null,this._portalUserName=null,this._printPreviewDialog=null,this._sections=null,this._stopsToSearches=new Map,this._editNoticeClosed=!1,this._printPreviewDialogOpen=!1,this._currentFlowItem="primary",this._parentFlowItem="primary",this._saveState="initialized",this._searchTool=null,this.headingLevel=2,this.messages=null,this.messagesUnits=null,this.searchProperties={popupEnabled:!1,resultGraphicEnabled:!1},this.viewModel=new M,this.visibleElements=new I,this._solveRouteDebounced=l(()=>this._solveRoute()),this.announceDeprecation=()=>{s(a.getLogger(this),"Directions","arcgis-directions",{version:"5.0"})}}initialize(){this.addHandles([d(()=>this.viewModel.layer,()=>{try{this.viewModel.load()}catch{}},h),d(()=>this.viewModel.layer?.routeInfo,()=>{this._sections=this._getStopSections()},h),d(()=>this.viewModel.layer?.stops.toArray(),e=>{e&&this.view?.activeTool&&this._searchTool&&this.view.activeTool===this._searchTool&&!e.includes(this._searchTool.stop)&&(this.view.tools.remove(this._searchTool),this._searchTool=null)})])}loadDependencies(){return R({accordion:()=>import("@esri/calcite-components/dist/components/calcite-accordion"),"accordion-item":()=>import("@esri/calcite-components/dist/components/calcite-accordion-item"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}destroy(){this._stopsToSearches.forEach(n)}get apiKey(){return this.viewModel.apiKey}set apiKey(e){this.viewModel.apiKey=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get displayedStops(){return this.effectiveStops.toArray().filter(({locationType:e})=>"waypoint"!==e)}get effectiveStops(){return this.viewModel.layer?.stops??this._placeholderStops}get icon(){return"right"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get lastRoute(){return this.viewModel.lastRoute}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get maxStops(){return this.viewModel.maxStops}set maxStops(e){this.viewModel.maxStops=e}get unit(){return this.defaultUnit}set unit(e){this._overrideIfSome("unit",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}acquireSearch(e){const{view:t}=this.viewModel;if(this._stopsToSearches.has(e)){const i=this._stopsToSearches.get(e);return i.view=t,this._overrideDefaultSources(i),i}const i=new f({icon:"",popupEnabled:!1,resultGraphicEnabled:!1,view:t,suppressDeprecationWarning:!0,...this.searchProperties});return this._normalizeSearchSources(i),this.addHandles([p(()=>i.allSources,"change",()=>this._normalizeSearchSources(i)),i.on("search-clear",()=>{e.geometry=null,e.name=null,this.viewModel.layer?.removeResult()}),i.on("select-result",()=>{const t=i.selectedResult;e.geometry=t?.feature.geometry,e.name=t?.name,this._solveRouteDebounced()}),d(()=>i.searchTerm,t=>{e.name=t}),g(()=>this._normalizeSearchSources(i))],i),this._stopsToSearches.set(e,i),i}getDirections(){return this.viewModel.getDirections()}render(){return O("div",{class:this.classes(C.base,A.widget,A.panel)},O("calcite-flow",null,this._renderPrimaryFlowItem(),this._renderDirectionsFlowItem(),this._renderEditFlowItem(),this._renderSaveFlowItem()),this._renderPrintDocument())}save(){return this.viewModel.save()}saveAs(e,t={}){return this.viewModel.saveAs(e,t)}zoomToRoute(){return this.viewModel.zoomToRoute()}_applyLocatorSourceOverrides({allSources:e}){for(const t of e)"url"in t&&t.url&&(t.language=_(),t.locationType??="street",L(t.url)&&this.apiKey&&null==t.apiKey&&(t.apiKey=this.apiKey,t.url=E))}_disposeSearch(e){if(!e||!this._stopsToSearches.has(e))return;const t=this._stopsToSearches.get(e);this.removeHandles(t),t.destroy(),this._stopsToSearches.delete(e)}_getErrorDescription(){switch(this.viewModel.lastError?.name){case"directions-view-model:unable-to-route":return this.messages.errors.unableToRoute;case"directions-view-model:service-metadata-unavailable":return this.messages.errors.unableToLoadServiceMetadata;default:return this.messages.errors.unknownError}}_getNetworkFeatureName(e){switch(e.type){case"stop":switch(e.locationType){case"stop":default:return this.messages.networkFeatures.stops.stop;case"waypoint":return this.messages.networkFeatures.stops.waypoint;case"break":return this.messages.networkFeatures.stops.break}case"point-barrier":return this.messages.networkFeatures.pointBarrier;case"polyline-barrier":return this.messages.networkFeatures.polylineBarrier;case"polygon-barrier":return this.messages.networkFeatures.polygonBarrier}}_getRouteCostSummary(){const e=this.viewModel.layer?.routeInfo;if(!e)return null;const t=e.totalDistance??0,i=e.totalDuration??0,{messagesUnits:s,unit:o}=this;return{distance:P(s,t,o),duration:T(i)}}_getStopCostDescription(e){if(!e.directions.length)return;const{totalDistance:t,totalDuration:i}=e.directions.reduce((e,{lines:t})=>{for(const{distance:i,duration:s}of t)e.totalDistance+=i??0,e.totalDuration+=s??0;return e},{totalDistance:0,totalDuration:0}),{messagesUnits:s,unit:o}=this,r=P(s,t,o);return`${T(i)} (${r})`}_getStopSections(){if(!this.viewModel.layer)return null;const{directionPoints:e,directionLines:t,stops:i}=this.viewModel.layer;if(!e||!t)return null;const s=[];let o=null;for(const r of e){const{objectId:e,stopId:a}=r;if(null!=a){const e=i.find(({objectId:e})=>e===a);o&&o.stop===e||(o={stop:e,directions:[]},s.push(o));continue}if(null==o)continue;const n=t.toArray().filter(({directionPointId:t})=>t===e);0!==n.length&&o.directions.push({directionPoint:r,lines:n})}return s}_handleAddStopClick(){const e=new S;this.viewModel.layer?.stops.add(new b({symbol:e}))}_handleAutoSolveChange({target:e}){this.viewModel.autoSolve=e.checked}_handleCreatePolylineBarrierClick(){this.viewModel.create("polyline-barrier")}_handleClearRouteClick(){this._currentFlowItem="primary",this.viewModel.reset()}_handleCreateStopClick(){this.viewModel.create("stop")}_handleDeleteNetworkFeatureClick(e){this.viewModel.remove(e),this.viewModel.autoSolve&&this._solveRouteDebounced()}_handleDeleteStopClick(e){this.effectiveStops.remove(e),this._disposeSearch(e),this._solveRouteDebounced()}_handleDepartureDateChange({currentTarget:{value:e}}){Array.isArray(e)||(this.viewModel.departureIsoDate=e,this._solveRouteDebounced())}_handleDepartureTimeChange({currentTarget:{value:e}}){this.viewModel.departureIsoTime=e,this._solveRouteDebounced()}_handleDepartureTimeOptionChange({currentTarget:e}){const{selectedItems:t}=e;t.length&&(this.viewModel.departureOption=t[0].value,this._solveRouteDebounced())}_handleDirectionsFlowItemBackClick(e){e.stopPropagation(),this._currentFlowItem="primary"}_handleDirectionTurnItemSelect(e){this._activeManeuver===e?this.zoomToRoute():(this._activeManeuver=e,this.viewModel.centerAt(e.geometry))}_handleDirectionTurnPointerEnter(e){this.viewModel.highlight(e)}_handleDirectionTurnPointerLeave(){this.viewModel.clearHighlights()}_handleEditFlowItemBackClick(e){e.stopPropagation(),this.viewModel.stopEditing(),this._currentFlowItem="primary"}_handleEditingDoneClick(){this.viewModel.stopEditing(),this._currentFlowItem="primary"}_handleEditNoticeClose(){this._editNoticeClosed=!0}_handleEditRouteClick(){this._currentFlowItem="edit",this.viewModel.startEditing()}_handleItemDetailsClick(){const e=this.viewModel.layer?.portalItem;e&&window.open(`${e.portal.url}/home/item.html?id=${e.id}`,"_blank")}_handleLocateStopClick(e){const{view:t}=this;if(!t)return;const i="directions-search-tool";this.removeHandles(i),this._searchTool=new D({stop:e,view:t}),this.addHandles([this._searchTool.on("click",async t=>{if(t.mapPoint&&this._stopsToSearches.has(e)){const i=this._stopsToSearches.get(e),s=await i.search(t.mapPoint),o=s?.results?.[0].results?.[0];if(o){const{feature:t,name:s}=o;i.searchTerm=s,e.geometry=t.geometry}}this.removeHandles(i)}),r(()=>{this._searchTool&&(this.view?.tools.remove(this._searchTool),this._searchTool=null)})],i),t.addAndActivateTool(this._searchTool)}_handleOptimizeStopOrderToggle({target:{expanded:e}}){this.viewModel.routeParameters.findBestSequence=e,e&&this._removeWaypoints(),this._solveRouteDebounced()}_handlePanToStopClick(e){this.viewModel.centerAt(e)}_handlePreserveFirstStopChange({target:{checked:e}}){this.viewModel.routeParameters.preserveFirstStop=e,this._solveRouteDebounced()}_handlePreserveLastStopChange({target:{checked:e}}){this.viewModel.routeParameters.preserveLastStop=e,this._solveRouteDebounced()}_handlePrintPreviewDialogAfterCreate(e){document.body.appendChild(e),e.showModal(),this._printPreviewDialog=e,this.removeHandles(j),this.addHandles([o(e,"close",this._handlePrintPreviewDialogClosed.bind(this)),r(()=>{this._printPreviewDialog&&(document.body.removeChild(this._printPreviewDialog),this._printPreviewDialog=null,this._printPreviewDialogOpen=!1)})],j)}_handlePrintPreviewDialogClick(){this._printPreviewDialogOpen=!0}_handlePrintPreviewDialogCloseClick(){this._printPreviewDialog?.close()}_handlePrintPreviewDialogClosed(){this.removeHandles(j)}_handlePrintPreviewDialogPrintClick(){document.body.classList.add(C.printPreviewMedia),window.print(),document.body.classList.remove(C.printPreviewMedia),this._printPreviewDialog?.close()}_handleResolveRouteClick(){this._solveRouteDebounced()}_handleReverseStopOrderClick(){this._removeWaypoints(),this.effectiveStops.reverse(),this._solveRouteDebounced()}_handleSaveErrorCloseClick(){this._currentFlowItem=this._parentFlowItem}_handleSaveFlowItemBackClick(e){e.stopPropagation(),this._currentFlowItem=this._parentFlowItem}async _handleSaveLayerAs(){const e=w.getDefault();try{await e.signIn()}catch(t){if(c(t)||"identity-manager:user-aborted"===t.name)return;return this._parentFlowItem=this._currentFlowItem,this._currentFlowItem="save",void(this._saveState="connect-to-portal-error")}this._saveState="fetch-portal-information",this._parentFlowItem=this._currentFlowItem,this._currentFlowItem="save",this._portalUserName=e.user?.username;try{this._portalFolders=await(e.user?.fetchFolders())}catch{return void(this._saveState="fetch-portal-information-error")}this._saveState="save-layer"}_handleSaveLayerClick(){this.viewModel.layer?.save()}_handleSaveLayerButtonClick(){this._saveState="saving";const{layer:e}=this;if(!e||!this._portalFolders)return;const t=this._portalItemNameInput?.value,i=this._portalFolderCombobox?.value,s=this._portalFolders.find(({id:e})=>e===i);e.saveAs({title:t},{folder:s}).then(()=>{e.title=t,this._currentFlowItem=this._parentFlowItem}).catch(()=>{this._saveState="saving-error"})}_handleSaveLayerCancelClick(){this._currentFlowItem=this._parentFlowItem}_handleSaveLayerFolderCreate(e){this._portalFolderCombobox=e}_handleSaveLayerNameCreate(e){this._portalItemNameInput=e}_handleSignInClick(){this.viewModel.load().catch(()=>{})}_handleStopListReorder({detail:{dragEl:e,newIndex:t}}){this._removeWaypoints(),this.effectiveStops.reorder(e.value,t),this._solveRouteDebounced()}_handleTravelModeChange({currentTarget:{selectedItems:e}}){e.length&&(this.viewModel.selectedTravelMode=e[0].value,this._solveRouteDebounced())}_handleViewDrivingDirectionsClick(){this._currentFlowItem="directions"}_normalizeSearchSources(e){this._overrideDefaultSources(e),this._applyLocatorSourceOverrides(e)}_overrideDefaultSources(e){for(const t of e.viewModel.defaultSources)t.autoNavigate=!1}_removeWaypoints(){const e=this.viewModel.layer?.stops;if(e){const t=e.filter(({locationType:e})=>"waypoint"===e);e.removeMany(t)}}_renderClearRouteAction(e){return O("calcite-action",{bind:this,icon:"trash",key:"clear-route",onclick:this._handleClearRouteClick,...e,text:this.messages.common.clear,textEnabled:!0})}_renderDeleteStopAction(e){return O("calcite-action",{icon:"trash",onclick:this._handleDeleteStopClick.bind(this,e),slot:"actions-end",text:this.messages.deleteStop,title:this.messages.deleteStop})}_renderDepartureTime(){const{DEPART_AT:e,NOW:t,UNSPECIFIED:i}=F;return O("calcite-label",{class:C.departureTime,key:"departure-time"},this.messages.departureTime,O("calcite-combobox",{bind:this,label:this.messages.departureTime,overlayPositioning:"fixed",selectionMode:"single-persist",topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:this._handleDepartureTimeOptionChange},O("calcite-combobox-item",{heading:this.messages.leaveNow,key:t,label:this.messages.leaveNow,selected:this.viewModel.departureOption===t,value:t}),O("calcite-combobox-item",{heading:this.messages.departAt,key:e,label:this.messages.departAt,selected:this.viewModel.departureOption===e,value:e}),O("calcite-combobox-item",{heading:this.messages.timeUnspecified,key:i,label:this.messages.timeUnspecified,selected:this.viewModel.departureOption===i,value:i})))}_renderDepartureTimeOptions(){return this.viewModel.departureOption!==F.DEPART_AT?null:O("div",{class:C.departureTimeOptions},O("calcite-input-date-picker",{bind:this,scale:"s",topLayerDisabled:this.topLayerDisabled,value:this.viewModel.departureIsoDate,onCalciteInputDatePickerChange:this._handleDepartureDateChange}),O("calcite-input-time-picker",{bind:this,scale:"s",value:this.viewModel.departureIsoTime,onCalciteInputTimePickerClose:this._handleDepartureTimeChange}))}_renderDirectionsFlowItem(){if("directions"!==this._currentFlowItem)return null;const e=this._getRouteCostSummary();if(!this._sections||!e)return null;const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel,o=this._sections.at(0)?.stop.name??"",r=this._sections.at(-1)?.stop.name??"";return O("calcite-flow-item",{bind:this,key:"directions-flow-item",overlayPositioning:"fixed",selected:"directions"===this._currentFlowItem,onCalciteFlowItemBack:this._handleDirectionsFlowItemBackClick},O("div",{class:C.directionsHeader,slot:"header-content"},O("div",{class:C.headerStops},O("span",null,this.messages.from)," ",O("span",{class:C.directionsHeaderStopName},o),O("span",null,this.messages.to)," ",O("span",{class:C.directionsHeaderStopName},r)),O("div",{class:C.flexColumn},O("span",null,`${i} (${t})`),s?O("span",null,s):null)),this._renderRouteLayerActions({slot:"header-menu-actions"}),O("calcite-accordion",{class:C.accordion,iconPosition:"start",selectionMode:"single"},this._sections.map((e,t)=>this._renderDirectionSection(e,t))))}_renderDirectionSection(e,t){const{stop:i,directions:s}=e,{name:o}=i,r=0===t,a=this._getStopCostDescription(e);return O("calcite-accordion-item",{description:a,expanded:r,heading:o??"",key:`stop-${t}`},O("calcite-action",{icon:"zoom-to-object",onclick:this._handlePanToStopClick.bind(this,i),slot:"actions-end",text:this.messages.panToStop,title:this.messages.panToStop}),this._renderDirectionTurns(s))}_renderDirectionTurns(e){return O("calcite-list",{label:this.messages.drivingDirections,selectionMode:"none"},e.map((e,t)=>{const{directionPoint:i,lines:s}=e,o=s[0],{distance:r,duration:a}=o,n=P(this.messagesUnits,r??0,this.unit),l=T(a??0),c=n&&l?`${n} | ${l}`:`${n||l}`,d=B(i),h=x(i.directionPointType);return O("calcite-list-item",{class:C.labelNoBottomMargin,key:`driving-direction-${t}`,onpointerenter:this._handleDirectionTurnPointerEnter.bind(this,o),onpointerleave:this._handleDirectionTurnPointerLeave.bind(this),onCalciteListItemSelect:this._handleDirectionTurnItemSelect.bind(this,o)},O("calcite-icon",{icon:h,slot:"content-start"}),O("div",{slot:"content"},O("calcite-label",{layout:"inline",scale:"s"},d),O("calcite-label",{layout:"inline",scale:"s"},c)))}))}_renderEditNotice(){return this._editNoticeClosed?null:O("div",{class:C.editInformationContainer},O("calcite-notice",{bind:this,closable:!0,kind:"info",open:!0,onCalciteNoticeClose:this._handleEditNoticeClose},O("calcite-label",{scale:"s",slot:"message"},this.messages.editInstructions)))}_renderEditFlowItem(){return"edit"!==this._currentFlowItem?null:O("calcite-flow-item",{bind:this,heading:this.messages.editRoute,headingLevel:this.headingLevel,key:"edit-flow-item",loading:"routing"===this.viewModel.state,selected:"edit"===this._currentFlowItem,onCalciteFlowItemBack:this._handleEditFlowItemBackClick},O("div",{class:C.flexColumn,key:"edit-container"},this._renderEditNotice(),O("div",{class:C.editToolbarContainer},O("calcite-label",{layout:"inline",scale:"s"},this.messages.automaticallySolve,O("calcite-switch",{bind:this,checked:this.viewModel.autoSolve,scale:"s",onCalciteSwitchChange:this._handleAutoSolveChange})),O("div",{class:C.editToolbar},O("calcite-action",{bind:this,disabled:!this.viewModel.layer||this.viewModel.layer.stops.length>=this.maxStops,icon:"flag",onclick:this._handleCreateStopClick,scale:"s",text:this.messages.networkFeatures.stops.stop,textEnabled:!0}),O("calcite-action",{bind:this,icon:"line",onclick:this._handleCreatePolylineBarrierClick,scale:"s",text:this.messages.barrier,textEnabled:!0}),O("calcite-action",{bind:this,class:C.solveRoute,disabled:this.viewModel.autoSolve,icon:"refresh",onclick:this._handleResolveRouteClick,scale:"s",text:this.messages.solve,textEnabled:!0}))),O("div",{class:C.selectedFeatureContainer},O("calcite-list",{label:this.messages.selectedNetworkFeatures,scale:"s",selectionMode:"none"},this.viewModel.selectedNetworkFeatures?.toArray().map((e,t)=>O("calcite-list-item",{description:this._getNetworkFeatureName(e),key:`network-feature-${t}`,label:e.name??e.objectId?.toString()??this.messages.unnamed},O("calcite-action",{icon:"trash",onclick:this._handleDeleteNetworkFeatureClick.bind(this,e),slot:"actions-end",text:this.messages.common.delete}))))),O("div",{class:C.editFooter},this._renderEditFooterContent())))}_renderEditFooterContent(){return this.viewModel.lastError?this._renderErrorNotice():O("calcite-button",{appearance:"outline-fill",bind:this,onclick:this._handleEditingDoneClick,width:"full"},this.messages.common.done)}_renderErrorNotice(){return O("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0},O("calcite-label",{class:C.labelNoBottomMargin,slot:"message"},this._getErrorDescription()))}_renderFooter(){if(!this.viewModel.layer)return O("div",{class:C.primaryFooter,key:"footer-missing-layer"},O("calcite-notice",{icon:"information",open:!0},O("calcite-label",{class:C.labelNoBottomMargin,slot:"message"},this.messages.missingLayer)));if("unauthenticated"===this.viewModel.state)return O("div",{class:C.primaryFooterCentered,key:"footer-sign-in"},O("calcite-label",null,this.messages.signInRequired),O("calcite-button",{bind:this,onclick:this._handleSignInClick},this.messages.common.auth.signIn));if("routing"===this.viewModel.state)return O("div",{class:this.classes(C.primaryFooter,C.primaryFooterLoader),key:"footer-routing"},O("calcite-loader",{label:this.messages.solve,scale:"s"}));if("error"===this.viewModel.state)return O("div",{class:C.primaryFooter,key:"footer-service-error"},this._renderErrorNotice());if(!this.viewModel.layer?.routeInfo)return O("div",{class:C.primaryFooter,key:"footer-unsolved-route"},O("calcite-notice",{icon:"information",open:!0},O("calcite-label",{class:C.labelNoBottomMargin,slot:"message"},this.messages.directionsPlaceholder)));const e=this._getRouteCostSummary();if(!e||!this.viewModel.layer?.directionPoints)return O("div",{class:C.primaryFooter,key:"footer-invalid-route"},O("calcite-notice",{icon:"exclamation-mark-triangle",kind:"danger",open:!0},O("calcite-label",{class:C.labelNoBottomMargin,slot:"message"},this.messages.invalidRoute)));const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel;return O("div",{class:C.routeItem,key:"footer-directions-summary"},O("button",{"aria-busy":"false","aria-label":this.messages.viewDrivingDirections,"aria-live":"polite",bind:this,class:C.routeItemButton,onclick:this._handleViewDrivingDirectionsClick,title:this.messages.viewDrivingDirections,type:"button"},O("div",{class:C.routeItemButtonContent},O("span",{class:C.routeItemLabel},`${i} (${t})`),O("span",{class:C.routeItemDescription},s)),O("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s"})),O("calcite-action-menu",{label:"test"},O("calcite-action",{icon:"ellipsis",key:"route-actions",slot:"trigger",text:"Route actions"}),this._renderRouteLayerActions()))}_renderInteractiveRouteActions(){return O("div",{class:C.actionContainer,key:C.actionContainer},O("calcite-button",{appearance:"outline",bind:this,class:C.addStopButton,disabled:this.effectiveStops.length>=this.maxStops,iconStart:"plus",kind:"neutral",label:this.messages.addStop,onclick:this._handleAddStopClick,title:this.messages.addStop,width:"half"},this.messages.addStop),this.visibleElements.editRouteButton?O("calcite-button",{appearance:"outline",bind:this,class:C.editRouteButton,disabled:"2d"!==this.viewModel.view?.type,iconStart:"pencil",kind:"neutral",label:this.messages.editRoute,onclick:this._handleEditRouteClick,title:this.messages.editRoute,width:"half"},this.messages.editRoute):null)}_renderLocateStopAction(e){if(null!=e.name||null!=e.geometry)return null;const t=this.effectiveStops.indexOf(e),i=!!this.view?.activeTool&&this.view.activeTool===this._searchTool&&this._searchTool.stop===e;return O("calcite-action",{active:i,icon:"crosshair",key:`stop-location-action-${t}`,onclick:this._handleLocateStopClick.bind(this,e),slot:"actions-end",text:this.messages.pickALocationOnTheMap,title:this.messages.pickALocationOnTheMap})}_renderOptimizeStopOrder(){const{routeParameters:e}=this.viewModel,{findBestSequence:t,preserveFirstStop:i,preserveLastStop:s}=e;return O("calcite-block-section",{bind:this,class:C.optimizeSection,text:this.messages.optimizeOrder,toggleDisplay:"switch",onCalciteBlockSectionToggle:this._handleOptimizeStopOrderToggle},t?[O("calcite-label",{class:C.optimizeSwitches,key:"preserve-first-stop",layout:"inline-space-between"},this.messages.preserveFirstStop,O("calcite-switch",{bind:this,checked:i,scale:"s",onCalciteSwitchChange:this._handlePreserveFirstStopChange})),O("calcite-label",{class:C.optimizeSwitches,key:"preserve-last-stop",layout:"inline-space-between"},this.messages.preserveLastStop,O("calcite-switch",{bind:this,checked:s,scale:"s",onCalciteSwitchChange:this._handlePreserveLastStopChange}))]:null)}_renderPrimaryFlowItem(){return O("calcite-flow-item",{key:"primary-flow-item",loading:"initializing"===this.viewModel.state,selected:"primary"===this._currentFlowItem},O("calcite-panel",{class:C.primaryFlowItem,disabled:!this.viewModel.layer||"unauthenticated"===this.viewModel.state||"error"===this.viewModel.state&&!this.viewModel.serviceDescription},this._renderStops(),this._renderInteractiveRouteActions(),this._renderSeparator(),this._renderRouteSolveOptions()),this._renderFooter())}_renderPrintDocument(){if(!this._printPreviewDialogOpen)return null;const e=this._getRouteCostSummary();if(!this._sections||!e)return null;const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel,o=this._sections.at(0)?.stop.name??"",r=this._sections.at(-1)?.stop.name??"";return O("dialog",{afterCreate:this._handlePrintPreviewDialogAfterCreate,bind:this,class:C.printPreviewDialog},O("div",{class:C.printPreviewContent},O("div",{class:C.printPreviewHeader},O("div",{class:C.printPreviewHeaderLabel},O("div",{class:C.headerStops},O("span",null,this.messages.from)," ",O("span",{class:C.directionsHeaderStopName},o),O("span",null,this.messages.to)," ",O("span",{class:C.directionsHeaderStopName},r))),O("div",{class:this.classes(C.printPreviewHeaderButtons,C.printPreviewHideOnPrint)},O("calcite-button",{autofocus:!0,bind:this,class:C.printPreviewDialogPrint,iconStart:"print",onclick:this._handlePrintPreviewDialogPrintClick},this.messages.common.print),O("calcite-button",{appearance:"outline",bind:this,class:C.printPreviewDialogClose,iconStart:"x-circle",onclick:this._handlePrintPreviewDialogCloseClick},this.messages.common.close))),O("div",{class:C.directionsHeader},O("span",null,`${i} (${t})`),s?O("span",null,s):null),this._sections.map((e,t)=>this._renderPrintSection(e,t))))}_renderPrintManeuver(e,t){const{directionPoint:i,lines:s}=e,{distance:o,duration:r}=s.at(0)??{},a=P(this.messagesUnits,o??0,this.unit),n=T(r??0),l=a&&n?`${a} | ${n}`:`${a||n}`,c=B(i),d=x(i.directionPointType);return O("div",{class:this.classes(C.flexRow,C.printPreviewAvoidPageBreak),key:`direction-${t}`},O("calcite-icon",{icon:d,preload:!0}),O("div",{class:C.flexColumn},O("span",null,c),O("span",null,l)))}_renderPrintRouteAction(e){if(!this.visibleElements.printButton)return null;const t=!this.viewModel.layer?.routeInfo;return O("calcite-action",{bind:this,disabled:t,icon:"print",key:"print-route",onclick:this._handlePrintPreviewDialogClick,...e,text:this.messages.common.print,textEnabled:!0})}_renderPrintSection({stop:e,directions:t},i){return O("div",{class:C.printPreviewSection,key:`section-${i}`},O("span",{class:C.directionsHeaderStopName},e.name??""),t.map((e,t)=>this._renderPrintManeuver(e,t)))}_renderRouteLayerActions(e){return[this._renderClearRouteAction(e),this._renderSaveLayerAction(e),this._renderSaveLayerAsAction(e),this._renderPrintRouteAction(e),this._renderViewItemDetailsAction(e)]}_renderRouteSolveOptions(){return O("div",{class:C.marginInlineMedium,key:"route-solve-options"},this._renderTravelModes(),this._renderDepartureTime(),this._renderDepartureTimeOptions(),this._renderOptimizeStopOrder())}_renderSaveContent(){switch(this._saveState){case"initialized":return this._renderSaveInitialized();case"connect-to-portal":return this._renderSaveProcessing(this.messages.identity.lblSigning);case"connect-to-portal-error":return this._renderSaveError(this.messages.errors.authenticating);case"fetch-portal-information":return this._renderSaveProcessing(this.messages.processing.fetching);case"fetch-portal-information-error":return this._renderSaveError(this.messages.errors.fetching);case"save-layer":return this._renderSaveLayerSettings();case"saving":return this._renderSaveProcessing(this.messages.processing.saving);case"saving-error":return this._renderSaveError(this.messages.errors.saving)}}_renderSaveError(e){return O("calcite-panel",{class:C.paddingMedium,key:"save-layer-error"},O("div",{class:C.saveError},O("calcite-icon",{class:C.saveErrorIcon,icon:"exclamation-mark-triangle",scale:"l",textLabel:this.messages.common.errorMessage}),O("calcite-label",{class:C.saveErrorLabel},e)),O("calcite-button",{appearance:"outline",bind:this,onclick:this._handleSaveErrorCloseClick,slot:"footer-start",width:"full"},this.messages.common.close))}_renderSaveInitialized(){return O("calcite-panel",{class:C.paddingMedium,key:"save-layer-initialized"})}_renderSaveFlowItem(){return"save"!==this._currentFlowItem?null:O("calcite-flow-item",{bind:this,heading:this.messages.saveLayer,headingLevel:this.headingLevel,key:"save-layer-flow-item",selected:"save"===this._currentFlowItem,onCalciteFlowItemBack:this._handleSaveFlowItemBackClick},this._renderSaveContent())}_renderSaveLayerAction(e){if(!this.visibleElements.saveButton)return null;const t=this.viewModel.layer,i=t?.routeInfo,s=t?.portalItem?.itemControl;return O("calcite-action",{bind:this,disabled:!(!!i&&("admin"===s||"update"===s)),icon:"save",key:"save-route",onclick:this._handleSaveLayerClick,...e,text:this.messages.common.save,textEnabled:!0})}_renderSaveLayerAsAction(e){if(!this.visibleElements.saveAsButton)return null;const t=!this.viewModel.layer?.routeInfo;return O("calcite-action",{disabled:t,icon:"save-as",key:"save-as-route",onclick:()=>{this._handleSaveLayerAs()},...e,text:this.messages.common.saveAs,textEnabled:!0})}_renderSaveLayerSettings(){if(null==this.layer||null==this._portalFolders||null==this._portalUserName)return this._renderSaveInitialized();const{stops:e}=this.layer,t=`${e.at(0).name} - ${e.at(-1).name}`,i=[O("calcite-combobox-item",{heading:`${this._portalUserName} (${this.messages.common.home})`,key:C.folderHome,selected:!0,value:C.folderHome}),...this._portalFolders.map(e=>O("calcite-combobox-item",{heading:e.title??"",key:`${C.folder}-${e.id}`,value:e.id}))];return O("calcite-panel",{key:"save-layer-panel"},O("div",{class:C.paddingMedium},O("calcite-label",null,this.messages.layerName,O("calcite-input",{afterCreate:this._handleSaveLayerNameCreate,bind:this,label:this.messages.layerName,value:t})),O("calcite-label",null,this.messages.saveInFolder,O("calcite-combobox",{afterCreate:this._handleSaveLayerFolderCreate,bind:this,label:this.messages.saveInFolder,overlayPositioning:"fixed",selectionMode:"single-persist",topLayerDisabled:this.topLayerDisabled},i))),O("calcite-button",{bind:this,onclick:this._handleSaveLayerButtonClick,slot:"footer-start",width:"full"},this.messages.common.save),O("calcite-button",{appearance:"outline",bind:this,onclick:this._handleSaveLayerCancelClick,slot:"footer-start",width:"full"},this.messages.common.cancel))}_renderSaveProcessing(e){return O("calcite-panel",{class:C.marginInlineMedium,key:"save-layer-processing"},O("calcite-loader",{class:C.saveProcessLoader,label:e,text:e}))}_renderSeparator(){return O("div",{class:C.separator})}_renderStop(e){const t=this.acquireSearch(e);null!=e.name&&(t.searchTerm=e.name);const i=this._renderLocateStopAction(e),s=this.effectiveStops.length>2&&this._renderDeleteStopAction(e);return O("calcite-list-item",{key:e,value:e},i,s,O("div",{class:C.stopItem,slot:"content"},t.render()))}_renderStops(){const e=this.displayedStops;for(const t of this._stopsToSearches.keys())e.includes(t)||this._disposeSearch(t);return O("div",{class:C.stopContainer,key:C.stopContainer},O("calcite-list",{bind:this,class:C.stopList,dragEnabled:!0,label:this.messages.widgetLabel,scale:"s",onCalciteListOrderChange:this._handleStopListReorder},e.map(e=>this._renderStop(e))),2===e.length&&O("calcite-action",{bind:this,icon:"arrow-up-down",onclick:this._handleReverseStopOrderClick,text:this.messages.reverseStops,title:this.messages.reverseStops}))}_renderTravelMode(e){const{id:t,name:i}=e;return O("calcite-combobox-item",{heading:i,key:t,label:i,selected:this.viewModel.selectedTravelMode?.id===t,value:e})}_renderTravelModes(){return this.viewModel.travelModes.length?O("calcite-label",{key:"travel-modes"},this.messages.mode,O("calcite-combobox",{bind:this,label:this.messages.mode,overlayPositioning:"fixed",selectionMode:"single-persist",topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:this._handleTravelModeChange},this.viewModel.travelModes.map(e=>this._renderTravelMode(e)))):null}_renderViewItemDetailsAction(e){return this.visibleElements.layerDetails?O("calcite-action",{bind:this,disabled:!this.viewModel.layer?.portalItem,icon:"launch",key:"open-route-details-link",onclick:this._handleItemDetailsClick,...e,text:this.messages.viewLayerDetails,textEnabled:!0}):null}async _solveRoute(){this.viewModel.updateDepartureTime();if((this.viewModel.layer?.stops.filter(({geometry:e})=>!!e).length??0)<2)this.viewModel.clearResults();else try{await this.viewModel.getDirections()}catch{}}};e([u()],$.prototype,"_editNoticeClosed",void 0),e([u()],$.prototype,"_printPreviewDialogOpen",void 0),e([u()],$.prototype,"_currentFlowItem",void 0),e([u()],$.prototype,"_saveState",void 0),e([u()],$.prototype,"_searchTool",void 0),e([u()],$.prototype,"apiKey",null),e([u(y)],$.prototype,"defaultUnit",void 0),e([u()],$.prototype,"goToOverride",null),e([u()],$.prototype,"headingLevel",void 0),e([u()],$.prototype,"displayedStops",null),e([u()],$.prototype,"effectiveStops",null),e([u()],$.prototype,"icon",null),e([u()],$.prototype,"label",null),e([u({readOnly:!0})],$.prototype,"lastRoute",null),e([u()],$.prototype,"layer",null),e([u()],$.prototype,"maxStops",null),e([u(),N("esri/widgets/Directions/t9n/Directions")],$.prototype,"messages",void 0),e([u(),N("esri/core/t9n/Units")],$.prototype,"messagesUnits",void 0),e([u()],$.prototype,"searchProperties",void 0),e([u()],$.prototype,"unit",null),e([u()],$.prototype,"view",null),e([u({type:M})],$.prototype,"viewModel",void 0),e([u({type:I,nonNullable:!0})],$.prototype,"visibleElements",void 0),$=e([v("esri.widgets.Directions")],$);const z=$;export{z as default};
|
|
@@ -86,7 +86,7 @@ export interface DistanceMeasurement2DProperties extends WidgetProperties, Parti
|
|
|
86
86
|
* * In geographic coordinate systems (GCS) and in Web Mercator, distances are computed geodetically.
|
|
87
87
|
* * In projected coordinate systems (PCS), apart from Web Mercator, distances are computed in a Euclidean manner (in their respective PCS).
|
|
88
88
|
*
|
|
89
|
-
* [](https://developers.arcgis.com/javascript/latest/sample-code/widgets-measurement-2d/)
|
|
90
90
|
*
|
|
91
91
|
* ### Undo / Redo
|
|
92
92
|
*
|
|
@@ -12,7 +12,7 @@ export interface CreateFeaturesWorkflowProperties extends WorkflowProperties {}
|
|
|
12
12
|
* the [Editor](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/) widget. This workflow provides continuous creation of multiple features of the same type at once. After the initial sketch is created, the attribute form will display with the set field elements. These fields can be updated as the user creates new features. This workflow is designed for both individual and multiple feature creation.
|
|
13
13
|
*
|
|
14
14
|
*
|
|
15
|
-
* 
|
|
16
16
|
*
|
|
17
17
|
* > [!WARNING]
|
|
18
18
|
* >
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import a from"../../core/Error.js";import{makeHandle as i,handlesGroup as r,abortHandle as s}from"../../core/handleUtils.js";import"../../core/has.js";import o from"../../core/Logger.js";import{removeMaybe as n,destroyMaybe as l}from"../../core/maybe.js";import{isPromiseLike as d,debounce as c}from"../../core/promiseUtils.js";import{watch as u,when as h,initial as p,whenOnce as m,syncAndInitial as f}from"../../core/reactiveUtils.js";import{generateBracedUUID as w}from"../../core/uuid.js";import{property as g,subclass as y}from"../../core/accessorSupport/decorators.js";import{isSharedTemplateOrMetadata as v,isSharedTemplate as _,getCreationAttributes as F,isStandardFeatureTemplate as b}from"../../editing/templateUtils.js";import{getFullTemplate as M}from"../../editing/sharedTemplates/templateLoader.js";import I from"../../layers/GraphicsLayer.js";import{isTable as V}from"../../layers/support/layerUtils.js";import{isNumber as k}from"../../support/guards.js";import{getDisplayedSymbol as S}from"../../symbols/support/symbolUtils.js";import{getDrawHelpMessage as A}from"../../views/draw/support/helpMessageUtils.js";import T from"../../views/draw/support/HighlightHelper.js";import C from"../../views/interactive/sketch/SketchOptions.js";import P from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{temporaryHighlightName as E}from"../../views/support/HighlightDefaults.js";import H from"./CreateFeaturesWorkflowData.js";import{isModelUpload as L,handleModelUpload as U}from"./modelUploadUtils.js";import j from"./Workflow.js";import{createToolFromGeometryType as x,findEditorItemForLayer as O,getServiceEditsFromWorkflowData as z,getServiceInfoForLayer as W,orderEditsByRelationshipDependencies as D,getServiceLayersById as R,startCreatingNewFeature as G,findLayerInfo as N,updateGraphicSymbolWhenRequired as K,isTerminalUpdateEventType as Z,getVisualVariableAttributes as q,startUpdatingFeatureGeometry as B,createWorkflowSteps as J,avoidFeatureTemplateSelectionWithOnlyOneItem as Q,setUpSketchCreateWatchers as X,setRelationshipFields as Y,prepareAttachmentsForCreateFeaturesWorkflow as $,showProgressCursor as ee,setVisualVariablesAndElevationInfoForUpdate as te,visualVariableInteractiveUpdate as ae}from"./workflowUtils.js";import ie from"../FeatureForm/FeatureFormViewModel.js";import re from"../Sketch/SketchViewModel.js";var se;const oe=Symbol(),ne=Symbol(),le=Symbol(),de=Symbol(),ce={point:["point"],multipoint:["multipoint"],polygon:["polygon","freehandPolygon","rectangle","circle"],polyline:["polyline","freehandPolyline"],mesh:[],multipatch:[]};let ue=se=class extends j{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.data=void 0,this.isNested=!1,this._getDrawMeshHelpMessage=void 0,this._webStyleCache=new Map,this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._formViewModel=new ie,this._sketchLayer=null,this._sketchViewModel=null,this._attachmentFileInfos=new Map,this._isActive=!0}initialize(){this.isNested&&(this._isActive=!1),this._initializeSketchViewModel()}destroy(){this._sketchViewModel.destroy()}get allowSave(){return!this.updating}get formViewModel(){return this._formViewModel}get hasInvalidFormTemplate(){return!!this.data.editorItem?.hasInvalidFormTemplate}get hasPendingEdits(){if(this.pendingFeatures.some(e=>!!this.data.getEditsForPendingFeature(e)?.modified))return!0;const{creationInfo:e,upload:t}=this.data,{activeComponent:a,createGraphic:i}=this._sketchViewModel,r=i?.geometry?.type;return!("polyline"!==r&&"polygon"!==r&&"multipoint"!==r||"draw-2d"!==a?.type&&"draw-3d"!==a?.type)&&a.drawOperation.committedVertices.length>0||(!(!t||"pending"!==t.state&&"success"!==t.state)||!!e?.geometryToPlace)}get hasPreviousStep(){return this._stepIndex>0||"update-pending"===this.createFeatureState&&!!this.data.selectedPendingFeature&&!this.parent&&!L(this.data.creationInfo)}get helpMessage(){const{creationInfo:e,viewModel:t}=this.data;if("creating-features"!==this.stepId||!e)return;const{_sketchViewModel:a}=this,i=e.layer.geometryType,r=a.createGraphic;if("mesh"===i){this._getDrawMeshHelpMessage||import("../../views/draw/support/helpMessageUtils3d.js").then(e=>{this._getDrawMeshHelpMessage=e.getDrawMeshHelpMessage});const{view:e}=t;return"3d"===e?.type?this._getDrawMeshHelpMessage?.(r,e):void 0}const{activeCreateToolDrawMode:s,activeTool:o}=a;return A("rectangle"===o||"circle"===o?o:i,r?.geometry,s)}get layer(){return this.data.creationInfo?.layer}get numPendingFeatures(){return this.pendingFeatures.length}get numPendingFeaturesExcludingHidden(){return this.pendingFeatures.filter(e=>this.data.isDisplayable(e)).length}get parent(){return this.data.parent}get pendingFeatures(){return this.data.pendingFeatures}get keyboardCancellationEnabled(){return 0===this.numPendingFeatures}get reliesOnOwnerAdminPrivileges(){return this.data.editorItem?.capabilities.create.reliesOnOwnerAdminPrivileges??!1}get saveActionLabel(){return"create"}get shouldShowAttachments(){return(this.data.selectedPendingFeature&&this.data.editorItem?.capabilities.create.attachments.enabled)??!1}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get sketchViewModel(){return this._sketchViewModel}get test(){}get availableCreateTools(){const e=this.data.creationInfo?.layer.geometryType,t=this.data.viewModel.view;if(!e)return[];if(this.data.creationInfo?.maxFeatures&&this.data.creationInfo.maxFeatures<=this.numPendingFeatures)return[];if(v(this.data.fullTemplate)){const{tool:t}=x(e,this.data.fullTemplate);return[t]}return"2d"!==t?.type&&"multipoint"===e?[]:[...ce[e]]}get _attachmentsActive(){const e=this.data.viewModel.attachmentsViewModel.mode,t=this.stepId;return this.shouldShowAttachments&&("add"===e||"edit"===e||"adding-attachment"===t||"editing-attachment"===t)}async enter(){this._isActive=!0,"awaiting-feature-creation-info"!==this.stepId&&await this._updatingHandles.addPromise(this._setUpCreatingFeaturesStep())}exit(){this._isActive=!1,this.removeHandles([le])}async updatePendingFeature(e){if(e!==this.data.selectedPendingFeature)return this._sketchViewModel.cancel(),this._startUpdating({feature:e})}async start(){return await super.start(),V(this.data.creationInfo?.layer)?null:{enter:async()=>{},exit:async()=>{},viewModel:this._sketchViewModel}}async save(){const{formViewModel:e}=this;if(e.pendingSubtypeChoice)return;e.submit(),this._stashValidationState();const t=this.data.selectedPendingFeature,a=this._hasValidationErrors(t)?t:this.data.pendingFeatures.find(e=>this._hasValidationErrors(e));return a?(await this._startUpdating({feature:a}),void e?.submit()):super.save()}back(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||L(this.data.creationInfo)||this._attachmentsActive||this.parent?super.back(e):this._clearSelectedFeature()}previous(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||L(this.data.creationInfo)||this._attachmentsActive?super.previous(e):this._clearSelectedFeature()}cancelFeature(e){this.data.isSharedTemplateWorkflow?o.getLogger(this).warn("Cannot cancel individual features created by shared templates."):(this.data.removePendingFeature(e),this.sketchViewModel.removeGraphic(e))}static create(e){const{addAttachmentsCallback:t,applyEdits:a,applyEditsFeatureService:i,isNested:r,creationInfo:s,parent:o,snappingManager:n,startAt:l,viewModel:d}=e,c=e.sketchOptions??new C,u=s?.layer,h=u?O(d.editorItems,u):void 0,p=new se({data:new H({creationInfo:s,editorItem:h,parent:o,sketchOptions:c,snappingManager:n,viewModel:d}),isNested:r,onCommit:async e=>{const{creationInfo:r}=e;if(!r)return;p._sketchViewModel.cancel();const s=e.pendingFeatures.toArray(),{layer:o}=r,n=o.capabilities?.editing.supportsGlobalId&&"globalIdField"in o,l=p._attachmentFileInfos,{fullTemplate:c}=e,u=z(p.data),h=_(c)&&u;if(n){if(fe(s),h){let t=ge(u,l);const a=await(W(o,d.view)?.load());a&&(t=D({edits:t,serviceInfo:a,view:d.view,findOriginalFeature:t=>e.getEditsForPendingFeature(t)?.initialFeature??t})),await i(c.featureService,t,{globalIdUsed:!0,honorSequenceOfEdits:!0,gdbVersion:c.layer.gdbVersion??void 0})}else{const e=we(s,l);await a(o,e,{globalIdUsed:!0})}return}const m=h?await i(c.featureService,u,{gdbVersion:c.layer.gdbVersion??void 0}):[await a(o,{addFeatures:s})];m&&l.size>0&&await Promise.all(m.map(e=>{if(e?.addFeatureResults)return t(o,me(s,e.addFeatureResults,o,l))}))}});return p._set("steps",this._createWorkflowSteps(p,l)),p}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",i(()=>e.effect=t)}const t=e.opacity;return e.opacity=.7,i(()=>e.opacity=t)}async _initializeFullTemplateAndExecutorInfo(e){const{creationInfo:t}=e,{view:a}=e.viewModel;if(!t||!a)return null;const i=await M(a,t.template);if(e.fullTemplate=i,i&&_(i)){const{createTemplateExecutor:r}=await import("../../editing/sharedTemplates/executor/createTemplateExecutor.js"),s={completionResults:[],executor:await r(i),serviceLayersById:R(t.layer,a)};e.templateExecutorInfo=s}return i}async _startCreating(){this.removeHandles(ne);const{data:e}=this;if(!e.creationInfo)return;const t=this.data.creationInfo?.maxFeatures;if(t&&this.numPendingFeatures>=t)return this.sketchViewModel.cancel(),void(this.numPendingFeatures&&await this._startUpdating({feature:this.pendingFeatures.at(-1)}));this.createFeatureState="create-new",await G(this._sketchViewModel,this._sketchLayer,e,this._webStyleCache)}async _clearSelectedFeature(){const e=this._formViewModel.pendingSubtypeChoice;e&&(e.resolve("undo"),await e.promise),this._stashValidationState(),this.sketchViewModel.cancel(),this.data.selectedPendingFeature=null,this._featureFormHandle=n(this._featureFormHandle),this._formViewModel.feature=null;const t=this.data.viewModel.attachmentsViewModel;"add"!==t.mode&&"edit"!==t.mode||await(this.data.viewModel.activeWorkflow?.previous())}_stashValidationState(){const e=this._formViewModel.feature,t=e&&this.data.getEditsForPendingFeature(e);t&&(t.submittable=this._formViewModel.submittable)}async _selectFeatureForUpdate({feature:e,initialFeature:t=e}){this._stashValidationState();const{data:a,pendingFeatures:i,_webStyleCache:s}=this;i.includes(e)||a.addPendingFeature(e,t),a.selectedPendingFeature=e;const{_formViewModel:o,_sketchViewModel:l}=this,{creationInfo:d,viewModel:c}=a,{attachmentsViewModel:h,layerInfos:p,view:m}=c;if(!m||!d)return;n(this._featureFormHandle);const f=e.sourceLayer,w=N(p,f),g=w?.formTemplate,y=m.spatialReference;o.set({editType:"INSERT",feature:e,formTemplate:g,spatialReference:y,map:m.map}),"add"!==h.mode&&"edit"!==h.mode||await(c.activeWorkflow?.previous()),h.graphic=e,h.fileInfos.removeAll(),h.mode="view";(this._attachmentFileInfos.get(e)||[]).forEach(({file:e,form:t})=>h.addFile(e,t)),await K(e,s,"2d"===m.type?m.scale:null);const v=a.getEditsForPendingFeature(e);this._featureFormHandle=r([o.on("value-change",async({fieldName:t,value:a})=>{if(v?.updateAttributes(o.getValues()),k(a)){const e=this._visualVariableAttributes;e.size&&!e.size.isUpdatingInteractively&&t===e.size.field&&e.size.setInitialValue(a),e.rotation&&!e.rotation.isUpdatingInteractively&&t===e.rotation.field&&e.rotation.setInitialValue(a)}await K(e,s,"2d"===m.type?m.scale:null)}),l.on(["update","undo","redo"],e=>{("undo"===e.type||"redo"===e.type||"update"===e.type&&null!=e.toolEventInfo&&Z(e.toolEventInfo.type))&&o.notifyFeatureGeometryChanged()}),u(()=>o.feature?.sourceLayer,t=>e.sourceLayer=t),u(()=>[o.feature,o.submittable],()=>this._stashValidationState())]),this.createFeatureState="update-pending"}async _startUpdating({feature:e,initialFeature:t=e}){await this._selectFeatureForUpdate({feature:e,initialFeature:t});const{_sketchLayer:a,_sketchViewModel:i,data:r}=this,{creationInfo:s,viewModel:o}=r,{view:n}=o;if(!n||!s)return;const l=e.sourceLayer??s.layer;return V(l)?void 0:(this._visualVariableAttributes=q(e),B({graphic:e,sketchLayer:a,sketchViewModel:i,sourceLayer:l,visualVariables:this._visualVariableAttributes,webStyleCache:this._webStyleCache}))}static _createWorkflowSteps(e,t="awaiting-feature-creation-info"){const{data:a}=e,i=J(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],t,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){const{creationInfo:t,viewModel:i}=a,{view:r}=i;r&&(L(t)?e.addHandles(await U({view:r,data:a,next:()=>e.next(),cancel:()=>i.cancelWorkflow({warnIfNoWorkflow:!1})}),this.id):(a.parent&&t&&e.addHandles(i.restrictFeatureTemplatesViewModelToLayer(t.layer),this.id),e.addHandles(i.featureTemplatesViewModel.on("select",({item:t})=>{t&&(a.creationInfo={...a.creationInfo,layer:t.layer,template:t.template},e.next())}),this.id)))},async tearDown(){e.removeHandles(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){e._isActive&&await e._setUpCreatingFeaturesStep()},async tearDown(t){const{viewModel:i}=a;t.canceled&&(e.removeHandles([le,oe,ne,de]),i.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear())}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}})});return Q(a,i)}static _configureSketchViewModel(e){const{data:t,_sketchLayer:a,_sketchViewModel:s,_webStyleCache:o}=e,{creationInfo:n,viewModel:l}=t,{view:d}=l,p=[];if(!d)return i();if("2d"===d.type){n&&p.push(e._fadeExistingFeatures(n.layer));const t=c((e,t)=>Promise.all(e.map(e=>K(e,o,t))));p.push(u(()=>d.scale,e=>t(a.graphics,e)))}const m=F(t.fullTemplate,n?.attributeOverrides),f=u(()=>s.createGraphic,a=>{a&&!e.hasHandles(ne)&&e._updatingHandles.consumePromise(X({creationAttributes:m,data:t,sketchViewModel:s,view:d,webStyleCache:o}).then(t=>e.addHandles(t,ne)))}),w=async t=>{if("cancel"!==t.state&&"complete"!==t.state||e.removeHandles(ne),"cancel"===t.state&&null!==d.activeTool&&d.activeTool!==e.sketchViewModel.activeComponent&&(await e._waitForActiveToolCleared(),await e._startCreating()),"complete"===t.state&&t.graphic){const a=await e._processEdits(t.graphic,{scale:"2d"===d.type?d.scale:null,useSourceLayer:!0,webStyleCache:e._webStyleCache});a&&(await e._waitForActiveToolCleared(),await e._startUpdating({feature:a}))}},g=async i=>{const{attachmentsViewModel:r}=l,{_formViewModel:o}=e;if(i.graphics.length>1)return void await e._clearSelectedFeature();const c=i.graphics[0];if("complete"===i.state){const{submittable:t}=o;if(e.numPendingFeatures!==n?.maxFeatures&&t||o.submit(),await e._clearSelectedFeature(),"add"!==r.mode&&"edit"!==r.mode||await(l.activeWorkflow?.previous()),!i.aborted&&d.activeTool===e.sketchViewModel.activeComponent&&(await e.sketchViewModel.wait(),"ready"===e.sketchViewModel.state&&"mesh"!==e.data.creationInfo?.layer.geometryType))return e._startCreating()}else{if("start"===i.state)return c.sourceLayer??=t.creationInfo?.layer,await te({graphic:c,sketchLayer:a,sketchViewModel:s,visualVariables:e._visualVariableAttributes,webStyleCache:e._webStyleCache,sourceLayer:c.sourceLayer}),e._selectFeatureForUpdate({feature:c});if("active"===i.state){await e.updatePendingFeature(c);const t=e._visualVariableAttributes;ae(d,c,i,t)&&await K(c,e._webStyleCache,"2d"===d.type?d.scale:null);const a=c.attributes,{rotation:r,size:s}=t;if(null!=r){const{field:e}=r;o.setValue(e,a[e])}if(null!=s){const{field:e}=s;o.setValue(e,a[e])}}}},y=async a=>{if(a.graphics.forEach(e=>{t.removePendingFeature(e)}),!L(t.creationInfo))return e._startCreating()},v=async()=>{if(L(t.creationInfo))try{await e.data.viewModel.back()}catch{}return e._startCreating()};p.push(f,s.on("create",t=>e._updatingHandles.addPromise(w(t))),s.on("update",t=>e._updatingHandles.addPromise(g(t))),s.on("delete",t=>e._updatingHandles.addPromise(y(t))),h(()=>!e.numPendingFeatures,()=>e._updatingHandles.addPromise(v())),i(()=>{s.cancel()}),he(s,a,t),...pe(t));const _=r(p);return s.addHandles(_),_}_initializeSketchViewModel(){const{data:e}=this,{view:t}=e.viewModel,a=new I({elevationInfo:e.creationInfo?.layer.elevationInfo,internal:!0,listMode:"hide",title:"createFeaturesWorkflow-internal"}),r=new re({layer:a,creationMode:"single",sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,useLegacyCreateTools:e.viewModel.useLegacyCreateTools,updateOnGraphicClick:!1,defaultUpdateOptions:{multipleSelectionEnabled:!1},view:t});this._sketchLayer=a,this._sketchViewModel=r,t?.map.add(a),this.addHandles([i(()=>{t?.destroyed||t?.map.remove(a),a.destroy()}),u(()=>this.numPendingFeatures>0,e=>this._sketchViewModel.updateOnGraphicClick=e,p)])}_hasValidationErrors(e){return!!e&&(!this.data.isSubmittable(e)||!!this._formViewModel.validateContingencyConstraints(e.attributes,{includeIncompleteViolations:!0})?.length)}async _processEdits(e,t){const{data:a,_formViewModel:i,_sketchLayer:r}=this,{layerInfos:s,view:o}=a.viewModel;i.editType="INSERT",i.map=o?.map,i.spatialReference=o?.spatialReference;const{templateExecutorInfo:n}=a;if(!n){const t=e.clone();return t.geometry=null,await this._addAndInitializeEdits(e,t),e}r.remove(e);const{executor:l}=n,c=l(e.geometry,"completion"),u=d(c)?await c:c;n.completionResults.push(u),Y(u.relationships),i.editType="INSERT",i.map=o?.map,i.spatialReference=o?.spatialReference,u.primary&&a.creationInfo?.attributeOverrides&&(u.primary.graphic.attributes={...u.primary.graphic.attributes,...a.creationInfo.attributeOverrides});for(const d of u.edits){let e=null;if(d.addFeatures)for(const a of d.addFeatures){const i=a.clone();i.geometry=null,null!=a.geometry&&(a.symbol=await S(a,t),r.add(a)),a.sourceLayer!==e?.layer&&(e=N(s,a.sourceLayer));const o=!!u.associationGraphics?.has(a);await this._addAndInitializeEdits(a,i,e,o)}}i.feature=null,await m(()=>!i.updating);return u.edits.reduce((e,t)=>e+(t.addFeatures?.length??0),0)>1?null:u.primary?.graphic}async _addAndInitializeEdits(e,t,a,i=!1){const{data:r,_formViewModel:s}=this,{layerInfos:o}=r.viewModel,n=r.addPendingFeature(e,t,{isAssociation:i});a??=N(o,e.sourceLayer),s.feature=e,s.formTemplate=a?.formTemplate,await m(()=>!s.updating),n.updateAttributes(s.getValues()),n.submittable=s.submittable}async _setUpCreatingFeaturesStep(){if(this.hasHandles(le))return;const{data:e,sketchViewModel:s}=this,{creationInfo:o,viewModel:l}=e,{attachmentsViewModel:d,view:c}=l;if(!c||!o?.layer)throw new a("missing-parameters","CreateFeaturesWorkflow requires a view and creationInfo.");const{initialFeature:h,layer:m}=o,f=[],w=[];this._featureFormHandle=n(this._featureFormHandle),this._visualVariableAttributes={rotation:null,size:null},e.editorItem=O(l.editorItems,o.layer),o.template&&(null==e.fullTemplate&&await this._initializeFullTemplateAndExecutorInfo(e),w.push(i(()=>{e.templateExecutorInfo&&(e.templateExecutorInfo.completionResults=[])}))),s.allowDeleteKey=!e.isSharedTemplateWorkflow,$(d),f.push(u(()=>d.mode,e=>{switch(e){case"add":this.go("adding-attachment");break;case"edit":this.go("editing-attachment")}}));const g=ee(c);f.push(g);const y=V(o.layer),{template:_}=o,M=!_||b(_)||v(_)&&"feature"===_.type,I=y&&M;try{if(I){const a=h??new t({attributes:F(e.fullTemplate,o.attributeOverrides),sourceLayer:m}),i=await this._processEdits(a);i&&await this._startUpdating({feature:i})}else f.push(se._configureSketchViewModel(this)),h?(L(o)&&o.geometryToPlace&&(h.attributes=F(e.fullTemplate,o.attributeOverrides)),s.addGraphic(h),await this._startUpdating({feature:h})):await this._startCreating()}finally{g.remove()}const k=i(()=>{for(const t of e.pendingFeatures)s.removeGraphic(t),e.removePendingFeature(t)}),S=u(()=>c?.timeZone,e=>{this._formViewModel.timeZone=e,this.data.timeZone=e},p),A=i(()=>{L(o)&&l.cancelWorkflow({warnIfNoWorkflow:!1})});this._featureFormHandle&&f.push(this._featureFormHandle),this.addHandles(f,this._handleKeys.beforeCommit),this.addHandles(w,this._handleKeys.afterCommit),this.addHandles([i(()=>d.fileInfos.removeAll()),r(f),r(w),A,k,S],le)}async _waitForActiveToolCleared(){const e=this.data.viewModel.view;if(null==e?.activeTool)return;const t=new AbortController;this.addHandles(s(t),de),await m(()=>null==e?.activeTool,t.signal),t.abort()}};function he(e,t,a){let s=null;const o=()=>e.snappingOptions.featureSources,n=()=>(s=new P({layer:t}),o().add(s),s),d=()=>{null!=s&&(o().remove(s),s=l(s))};return r([u(()=>{const e=a.creationInfo?.layer,t=o().find(t=>t.layer===e);return{hasFeatureLayerSource:!!t,enabled:t?.enabled??!1}},({hasFeatureLayerSource:e,enabled:t})=>{if(!e)return d();s??=n(),s.enabled=t},f),i(d)])}function pe(e){const t=e.viewModel.view;if(!t)return[];const a=[];if("3d"===t.type){const r=new T({view:t});a.push(u(()=>e.selectedPendingFeature,(e,t)=>{r.remove(e),r.add(t)}),i(()=>r.destroy()))}const r=new T({view:t,highlightName:E});return a.push(u(()=>e.temporaryHighlightFeature,e=>{r.removeAll(),r.add(e)}),i(()=>r.destroy())),a}function me(e,t,a,i){const r=[];return t.forEach((t,s)=>{if(!t.error){const o=e[s],n=i.get(o)||[];o.attributes[a.objectIdField]=t.objectId,n.forEach(({form:e})=>r.push({feature:o,attachment:e}))}}),r}function fe(e){for(const t of e){const{sourceLayer:e}=t;e&&"globalIdField"in e&&null!=e.globalIdField&&(t.attributes[e.globalIdField]??=w())}}function we(e,t){const a=[];if(!t||0===t.size)return{addFeatures:e};for(const[i,r]of t)for(const{file:e}of r)a.push({feature:i,attachment:{globalId:w(),data:e}});return a.length?{addFeatures:e,addAttachments:a}:{addFeatures:e}}function ge(e,t){return e.map(e=>{const{addFeatures:a}=e;if(!a||0===a.length)return e;const i=[];for(const r of a){const e=t.get(r);if(e)for(const{file:t}of e)i.push({feature:r,attachment:{globalId:w(),data:t}})}return i.length?{...e,addAttachments:i}:e})}e([g()],ue.prototype,"allowSave",null),e([g()],ue.prototype,"createFeatureState",void 0),e([g()],ue.prototype,"data",void 0),e([g({constructOnly:!0})],ue.prototype,"isNested",void 0),e([g()],ue.prototype,"formViewModel",null),e([g()],ue.prototype,"hasInvalidFormTemplate",null),e([g()],ue.prototype,"hasPendingEdits",null),e([g()],ue.prototype,"hasPreviousStep",null),e([g()],ue.prototype,"_getDrawMeshHelpMessage",void 0),e([g()],ue.prototype,"helpMessage",null),e([g()],ue.prototype,"layer",null),e([g()],ue.prototype,"parent",null),e([g()],ue.prototype,"keyboardCancellationEnabled",null),e([g()],ue.prototype,"reliesOnOwnerAdminPrivileges",null),e([g()],ue.prototype,"saveActionLabel",null),e([g()],ue.prototype,"shouldShowAttachments",null),e([g()],ue.prototype,"shouldAllowAttachmentEditing",null),e([g()],ue.prototype,"sketchViewModel",null),e([g()],ue.prototype,"availableCreateTools",null),e([g()],ue.prototype,"_attachmentsActive",null),ue=se=e([y("esri.widgets.Editor.CreateFeaturesWorkflow")],ue);const ye=ue;export{ye as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import a from"../../core/Error.js";import{makeHandle as i,handlesGroup as r,abortHandle as s}from"../../core/handleUtils.js";import"../../core/has.js";import o from"../../core/Logger.js";import{removeMaybe as n,destroyMaybe as l}from"../../core/maybe.js";import{isPromiseLike as d,debounce as c}from"../../core/promiseUtils.js";import{watch as u,when as h,initial as p,whenOnce as m,syncAndInitial as f}from"../../core/reactiveUtils.js";import{generateBracedUUID as w}from"../../core/uuid.js";import{property as g,subclass as y}from"../../core/accessorSupport/decorators.js";import{isSharedTemplateOrMetadata as v,isSharedTemplate as _,getCreationAttributes as F,isStandardFeatureTemplate as b}from"../../editing/templateUtils.js";import{getFullTemplate as M}from"../../editing/sharedTemplates/templateLoader.js";import I from"../../layers/GraphicsLayer.js";import{isTable as V}from"../../layers/support/layerUtils.js";import{isNumber as k}from"../../support/guards.js";import{getDisplayedSymbol as S}from"../../symbols/support/symbolUtils.js";import{getDrawHelpMessage as T}from"../../views/draw/support/helpMessageUtils.js";import A from"../../views/draw/support/HighlightHelper.js";import C from"../../views/interactive/sketch/SketchOptions.js";import P from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{temporaryHighlightName as E}from"../../views/support/HighlightDefaults.js";import H from"./CreateFeaturesWorkflowData.js";import{isModelUpload as L,handleModelUpload as U}from"./modelUploadUtils.js";import j from"./Workflow.js";import{createToolFromGeometryType as x,findEditorItemForLayer as O,getServiceEditsFromWorkflowData as z,getServiceInfoForLayer as W,orderEditsByRelationshipDependencies as D,getServiceLayersById as R,startCreatingNewFeature as G,findLayerInfo as N,updateGraphicSymbolWhenRequired as K,isTerminalUpdateEventType as Z,getVisualVariableAttributes as q,startUpdatingFeatureGeometry as B,createWorkflowSteps as J,avoidFeatureTemplateSelectionWithOnlyOneItem as Q,setUpSketchCreateWatchers as X,setRelationshipFields as Y,prepareAttachmentsForCreateFeaturesWorkflow as $,showProgressCursor as ee,setVisualVariablesAndElevationInfoForUpdate as te,visualVariableInteractiveUpdate as ae}from"./workflowUtils.js";import ie from"../FeatureForm/FeatureFormViewModel.js";import re from"../Sketch/SketchViewModel.js";var se;const oe=Symbol(),ne=Symbol(),le=Symbol(),de=Symbol(),ce={point:["point"],multipoint:["multipoint"],polygon:["polygon","freehandPolygon","rectangle","circle"],polyline:["polyline","freehandPolyline"],mesh:[],multipatch:[]};let ue=se=class extends j{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.data=void 0,this.isNested=!1,this._getDrawMeshHelpMessage=void 0,this._webStyleCache=new Map,this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._formViewModel=new ie,this._sketchLayer=null,this._sketchViewModel=null,this._attachmentFileInfos=new Map,this._isActive=!0}initialize(){this.isNested&&(this._isActive=!1),this._initializeSketchViewModel()}destroy(){this._sketchViewModel.destroy()}get allowSave(){return!this.updating}get formViewModel(){return this._formViewModel}get hasInvalidFormTemplate(){return!!this.data.editorItem?.hasInvalidFormTemplate}get hasPendingEdits(){if(this.pendingFeatures.some(e=>!!this.data.getEditsForPendingFeature(e)?.modified))return!0;const{creationInfo:e,upload:t}=this.data,{activeComponent:a,createGraphic:i}=this._sketchViewModel,r=i?.geometry?.type;return!("polyline"!==r&&"polygon"!==r&&"multipoint"!==r||"draw-2d"!==a?.type&&"draw-3d"!==a?.type)&&a.drawOperation.committedVertices.length>0||(!(!t||"pending"!==t.state&&"success"!==t.state)||!!e?.geometryToPlace)}get hasPreviousStep(){return this._stepIndex>0||"update-pending"===this.createFeatureState&&!!this.data.selectedPendingFeature&&!this.parent&&!L(this.data.creationInfo)}get helpMessage(){const{creationInfo:e,viewModel:t}=this.data;if("creating-features"!==this.stepId||!e)return;const{_sketchViewModel:a}=this,{drawTool:i,isUsingLegacyCreateTools:r}=a;if(!r)return i?.helpMessageKey??"noTool";const s=e.layer.geometryType,o=a.createGraphic;if("mesh"===s){this._getDrawMeshHelpMessage||import("../../views/draw/support/helpMessageUtils3d.js").then(e=>{this._getDrawMeshHelpMessage=e.getDrawMeshHelpMessage});const{view:e}=t;return"3d"===e?.type?this._getDrawMeshHelpMessage?.(o,e):void 0}const{activeCreateToolDrawMode:n,activeTool:l}=a;return T("rectangle"===l||"circle"===l?l:s,o?.geometry,n)}get layer(){return this.data.creationInfo?.layer}get numPendingFeatures(){return this.pendingFeatures.length}get numPendingFeaturesExcludingHidden(){return this.pendingFeatures.filter(e=>this.data.isDisplayable(e)).length}get parent(){return this.data.parent}get pendingFeatures(){return this.data.pendingFeatures}get keyboardCancellationEnabled(){return 0===this.numPendingFeatures}get reliesOnOwnerAdminPrivileges(){return this.data.editorItem?.capabilities.create.reliesOnOwnerAdminPrivileges??!1}get saveActionLabel(){return"create"}get shouldShowAttachments(){return(this.data.selectedPendingFeature&&this.data.editorItem?.capabilities.create.attachments.enabled)??!1}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get sketchViewModel(){return this._sketchViewModel}get test(){}get availableCreateTools(){const e=this.data.creationInfo?.layer.geometryType,t=this.data.viewModel.view;if(!e)return[];if(this.data.creationInfo?.maxFeatures&&this.data.creationInfo.maxFeatures<=this.numPendingFeatures)return[];if(v(this.data.fullTemplate)){const{tool:t}=x(e,this.data.fullTemplate);return[t]}return"2d"!==t?.type&&"multipoint"===e?[]:[...ce[e]]}get _attachmentsActive(){const e=this.data.viewModel.attachmentsViewModel.mode,t=this.stepId;return this.shouldShowAttachments&&("add"===e||"edit"===e||"adding-attachment"===t||"editing-attachment"===t)}async enter(){this._isActive=!0,"awaiting-feature-creation-info"!==this.stepId&&await this._updatingHandles.addPromise(this._setUpCreatingFeaturesStep())}exit(){this._isActive=!1,this.removeHandles([le])}async updatePendingFeature(e){if(e!==this.data.selectedPendingFeature)return this._sketchViewModel.cancel(),this._startUpdating({feature:e})}async start(){return await super.start(),V(this.data.creationInfo?.layer)?null:{enter:async()=>{},exit:async()=>{},viewModel:this._sketchViewModel}}async save(){const{formViewModel:e}=this;if(e.pendingSubtypeChoice)return;e.submit(),this._stashValidationState();const t=this.data.selectedPendingFeature,a=this._hasValidationErrors(t)?t:this.data.pendingFeatures.find(e=>this._hasValidationErrors(e));return a?(await this._startUpdating({feature:a}),void e?.submit()):super.save()}back(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||L(this.data.creationInfo)||this._attachmentsActive||this.parent?super.back(e):this._clearSelectedFeature()}previous(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||L(this.data.creationInfo)||this._attachmentsActive?super.previous(e):this._clearSelectedFeature()}cancelFeature(e){this.data.isSharedTemplateWorkflow?o.getLogger(this).warn("Cannot cancel individual features created by shared templates."):(this.data.removePendingFeature(e),this.sketchViewModel.removeGraphic(e))}static create(e){const{addAttachmentsCallback:t,applyEdits:a,applyEditsFeatureService:i,isNested:r,creationInfo:s,parent:o,snappingManager:n,startAt:l,viewModel:d}=e,c=e.sketchOptions??new C,u=s?.layer,h=u?O(d.editorItems,u):void 0,p=new se({data:new H({creationInfo:s,editorItem:h,parent:o,sketchOptions:c,snappingManager:n,viewModel:d}),isNested:r,onCommit:async e=>{const{creationInfo:r}=e;if(!r)return;p._sketchViewModel.cancel();const s=e.pendingFeatures.toArray(),{layer:o}=r,n=o.capabilities?.editing.supportsGlobalId&&"globalIdField"in o,l=p._attachmentFileInfos,{fullTemplate:c}=e,u=z(p.data),h=_(c)&&u;if(n){if(fe(s),h){let t=ge(u,l);const a=await(W(o,d.view)?.load());a&&(t=D({edits:t,serviceInfo:a,view:d.view,findOriginalFeature:t=>e.getEditsForPendingFeature(t)?.initialFeature??t})),await i(c.featureService,t,{globalIdUsed:!0,honorSequenceOfEdits:!0,gdbVersion:c.layer.gdbVersion??void 0})}else{const e=we(s,l);await a(o,e,{globalIdUsed:!0})}return}const m=h?await i(c.featureService,u,{gdbVersion:c.layer.gdbVersion??void 0}):[await a(o,{addFeatures:s})];m&&l.size>0&&await Promise.all(m.map(e=>{if(e?.addFeatureResults)return t(o,me(s,e.addFeatureResults,o,l))}))}});return p._set("steps",this._createWorkflowSteps(p,l)),p}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",i(()=>e.effect=t)}const t=e.opacity;return e.opacity=.7,i(()=>e.opacity=t)}async _initializeFullTemplateAndExecutorInfo(e){const{creationInfo:t}=e,{view:a}=e.viewModel;if(!t||!a)return null;const i=await M(a,t.template);if(e.fullTemplate=i,i&&_(i)){const{createTemplateExecutor:r}=await import("../../editing/sharedTemplates/executor/createTemplateExecutor.js"),s={completionResults:[],executor:await r(i),serviceLayersById:R(t.layer,a)};e.templateExecutorInfo=s}return i}async _startCreating(){this.removeHandles(ne);const{data:e}=this;if(!e.creationInfo)return;const t=this.data.creationInfo?.maxFeatures;if(t&&this.numPendingFeatures>=t)return this.sketchViewModel.cancel(),void(this.numPendingFeatures&&await this._startUpdating({feature:this.pendingFeatures.at(-1)}));this.createFeatureState="create-new",await G(this._sketchViewModel,this._sketchLayer,e,this._webStyleCache)}async _clearSelectedFeature(){const e=this._formViewModel.pendingSubtypeChoice;e&&(e.resolve("undo"),await e.promise),this._stashValidationState(),this.sketchViewModel.cancel(),this.data.selectedPendingFeature=null,this._featureFormHandle=n(this._featureFormHandle),this._formViewModel.feature=null;const t=this.data.viewModel.attachmentsViewModel;"add"!==t.mode&&"edit"!==t.mode||await(this.data.viewModel.activeWorkflow?.previous())}_stashValidationState(){const e=this._formViewModel.feature,t=e&&this.data.getEditsForPendingFeature(e);t&&(t.submittable=this._formViewModel.submittable)}async _selectFeatureForUpdate({feature:e,initialFeature:t=e}){this._stashValidationState();const{data:a,pendingFeatures:i,_webStyleCache:s}=this;i.includes(e)||a.addPendingFeature(e,t),a.selectedPendingFeature=e;const{_formViewModel:o,_sketchViewModel:l}=this,{creationInfo:d,viewModel:c}=a,{attachmentsViewModel:h,layerInfos:p,view:m}=c;if(!m||!d)return;n(this._featureFormHandle);const f=e.sourceLayer,w=N(p,f),g=w?.formTemplate,y=m.spatialReference;o.set({editType:"INSERT",feature:e,formTemplate:g,spatialReference:y,map:m.map}),"add"!==h.mode&&"edit"!==h.mode||await(c.activeWorkflow?.previous()),h.graphic=e,h.fileInfos.removeAll(),h.mode="view";(this._attachmentFileInfos.get(e)||[]).forEach(({file:e,form:t})=>h.addFile(e,t)),await K(e,s,"2d"===m.type?m.scale:null);const v=a.getEditsForPendingFeature(e);this._featureFormHandle=r([o.on("value-change",async({fieldName:t,value:a})=>{if(v?.updateAttributes(o.getValues()),k(a)){const e=this._visualVariableAttributes;e.size&&!e.size.isUpdatingInteractively&&t===e.size.field&&e.size.setInitialValue(a),e.rotation&&!e.rotation.isUpdatingInteractively&&t===e.rotation.field&&e.rotation.setInitialValue(a)}await K(e,s,"2d"===m.type?m.scale:null)}),l.on(["update","undo","redo"],e=>{("undo"===e.type||"redo"===e.type||"update"===e.type&&null!=e.toolEventInfo&&Z(e.toolEventInfo.type))&&o.notifyFeatureGeometryChanged()}),u(()=>o.feature?.sourceLayer,t=>e.sourceLayer=t),u(()=>[o.feature,o.submittable],()=>this._stashValidationState())]),this.createFeatureState="update-pending"}async _startUpdating({feature:e,initialFeature:t=e}){await this._selectFeatureForUpdate({feature:e,initialFeature:t});const{_sketchLayer:a,_sketchViewModel:i,data:r}=this,{creationInfo:s,viewModel:o}=r,{view:n}=o;if(!n||!s)return;const l=e.sourceLayer??s.layer;return V(l)?void 0:(this._visualVariableAttributes=q(e),B({graphic:e,sketchLayer:a,sketchViewModel:i,sourceLayer:l,visualVariables:this._visualVariableAttributes,webStyleCache:this._webStyleCache}))}static _createWorkflowSteps(e,t="awaiting-feature-creation-info"){const{data:a}=e,i=J(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],t,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){const{creationInfo:t,viewModel:i}=a,{view:r}=i;r&&(L(t)?e.addHandles(await U({view:r,data:a,next:()=>e.next(),cancel:()=>i.cancelWorkflow({warnIfNoWorkflow:!1})}),this.id):(a.parent&&t&&e.addHandles(i.restrictFeatureTemplatesViewModelToLayer(t.layer),this.id),e.addHandles(i.featureTemplatesViewModel.on("select",({item:t})=>{t&&(a.creationInfo={...a.creationInfo,layer:t.layer,template:t.template},e.next())}),this.id)))},async tearDown(){e.removeHandles(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){e._isActive&&await e._setUpCreatingFeaturesStep()},async tearDown(t){const{viewModel:i}=a;t.canceled&&(e.removeHandles([le,oe,ne,de]),i.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear())}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}})});return Q(a,i)}static _configureSketchViewModel(e){const{data:t,_sketchLayer:a,_sketchViewModel:s,_webStyleCache:o}=e,{creationInfo:n,viewModel:l}=t,{view:d}=l,p=[];if(!d)return i();if("2d"===d.type){n&&p.push(e._fadeExistingFeatures(n.layer));const t=c((e,t)=>Promise.all(e.map(e=>K(e,o,t))));p.push(u(()=>d.scale,e=>t(a.graphics,e)))}const m=F(t.fullTemplate,n?.attributeOverrides),f=u(()=>s.createGraphic,a=>{a&&!e.hasHandles(ne)&&e._updatingHandles.consumePromise(X({creationAttributes:m,data:t,sketchViewModel:s,view:d,webStyleCache:o}).then(t=>e.addHandles(t,ne)))}),w=async t=>{if("cancel"!==t.state&&"complete"!==t.state||e.removeHandles(ne),"cancel"===t.state&&null!==d.activeTool&&d.activeTool!==e.sketchViewModel.activeComponent&&(await e._waitForActiveToolCleared(),await e._startCreating()),"complete"===t.state&&t.graphic){const a=await e._processEdits(t.graphic,{scale:"2d"===d.type?d.scale:null,useSourceLayer:!0,webStyleCache:e._webStyleCache});a&&(await e._waitForActiveToolCleared(),await e._startUpdating({feature:a}))}},g=async i=>{const{attachmentsViewModel:r}=l,{_formViewModel:o}=e;if(i.graphics.length>1)return void await e._clearSelectedFeature();const c=i.graphics[0];if("complete"===i.state){const{submittable:t}=o;if(e.numPendingFeatures!==n?.maxFeatures&&t||o.submit(),await e._clearSelectedFeature(),"add"!==r.mode&&"edit"!==r.mode||await(l.activeWorkflow?.previous()),!i.aborted&&d.activeTool===e.sketchViewModel.activeComponent&&(await e.sketchViewModel.wait(),"ready"===e.sketchViewModel.state&&"mesh"!==e.data.creationInfo?.layer.geometryType))return e._startCreating()}else{if("start"===i.state)return c.sourceLayer??=t.creationInfo?.layer,await te({graphic:c,sketchLayer:a,sketchViewModel:s,visualVariables:e._visualVariableAttributes,webStyleCache:e._webStyleCache,sourceLayer:c.sourceLayer}),e._selectFeatureForUpdate({feature:c});if("active"===i.state){await e.updatePendingFeature(c);const t=e._visualVariableAttributes;ae(d,c,i,t)&&await K(c,e._webStyleCache,"2d"===d.type?d.scale:null);const a=c.attributes,{rotation:r,size:s}=t;if(null!=r){const{field:e}=r;o.setValue(e,a[e])}if(null!=s){const{field:e}=s;o.setValue(e,a[e])}}}},y=async a=>{if(a.graphics.forEach(e=>{t.removePendingFeature(e)}),!L(t.creationInfo))return e._startCreating()},v=async()=>{if(L(t.creationInfo))try{await e.data.viewModel.back()}catch{}return e._startCreating()};p.push(f,s.on("create",t=>e._updatingHandles.addPromise(w(t))),s.on("update",t=>e._updatingHandles.addPromise(g(t))),s.on("delete",t=>e._updatingHandles.addPromise(y(t))),h(()=>!e.numPendingFeatures,()=>e._updatingHandles.addPromise(v())),i(()=>{s.cancel()}),he(s,a,t),...pe(t));const _=r(p);return s.addHandles(_),_}_initializeSketchViewModel(){const{data:e}=this,{view:t}=e.viewModel,a=new I({elevationInfo:e.creationInfo?.layer.elevationInfo,internal:!0,listMode:"hide",title:"createFeaturesWorkflow-internal"}),r=new re({layer:a,creationMode:"single",sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,useLegacyCreateTools:e.viewModel.useLegacyCreateTools,updateOnGraphicClick:!1,defaultUpdateOptions:{multipleSelectionEnabled:!1},view:t});this._sketchLayer=a,this._sketchViewModel=r,t?.map.add(a),this.addHandles([i(()=>{t?.destroyed||t?.map.remove(a),a.destroy()}),u(()=>this.numPendingFeatures>0,e=>this._sketchViewModel.updateOnGraphicClick=e,p)])}_hasValidationErrors(e){return!!e&&(!this.data.isSubmittable(e)||!!this._formViewModel.validateContingencyConstraints(e.attributes,{includeIncompleteViolations:!0})?.length)}async _processEdits(e,t){const{data:a,_formViewModel:i,_sketchLayer:r}=this,{layerInfos:s,view:o}=a.viewModel;i.editType="INSERT",i.map=o?.map,i.spatialReference=o?.spatialReference;const{templateExecutorInfo:n}=a;if(!n){const t=e.clone();return t.geometry=null,await this._addAndInitializeEdits(e,t),e}r.remove(e);const{executor:l}=n,c=l(e.geometry,"completion"),u=d(c)?await c:c;n.completionResults.push(u),Y(u.relationships),i.editType="INSERT",i.map=o?.map,i.spatialReference=o?.spatialReference,u.primary&&a.creationInfo?.attributeOverrides&&(u.primary.graphic.attributes={...u.primary.graphic.attributes,...a.creationInfo.attributeOverrides});for(const d of u.edits){let e=null;if(d.addFeatures)for(const a of d.addFeatures){const i=a.clone();i.geometry=null,null!=a.geometry&&(a.symbol=await S(a,t),r.add(a)),a.sourceLayer!==e?.layer&&(e=N(s,a.sourceLayer));const o=!!u.associationGraphics?.has(a);await this._addAndInitializeEdits(a,i,e,o)}}i.feature=null,await m(()=>!i.updating);return u.edits.reduce((e,t)=>e+(t.addFeatures?.length??0),0)>1?null:u.primary?.graphic}async _addAndInitializeEdits(e,t,a,i=!1){const{data:r,_formViewModel:s}=this,{layerInfos:o}=r.viewModel,n=r.addPendingFeature(e,t,{isAssociation:i});a??=N(o,e.sourceLayer),s.feature=e,s.formTemplate=a?.formTemplate,await m(()=>!s.updating),n.updateAttributes(s.getValues()),n.submittable=s.submittable}async _setUpCreatingFeaturesStep(){if(this.hasHandles(le))return;const{data:e,sketchViewModel:s}=this,{creationInfo:o,viewModel:l}=e,{attachmentsViewModel:d,view:c}=l;if(!c||!o?.layer)throw new a("missing-parameters","CreateFeaturesWorkflow requires a view and creationInfo.");const{initialFeature:h,layer:m}=o,f=[],w=[];this._featureFormHandle=n(this._featureFormHandle),this._visualVariableAttributes={rotation:null,size:null},e.editorItem=O(l.editorItems,o.layer),o.template&&(null==e.fullTemplate&&await this._initializeFullTemplateAndExecutorInfo(e),w.push(i(()=>{e.templateExecutorInfo&&(e.templateExecutorInfo.completionResults=[])}))),s.allowDeleteKey=!e.isSharedTemplateWorkflow,$(d),f.push(u(()=>d.mode,e=>{switch(e){case"add":this.go("adding-attachment");break;case"edit":this.go("editing-attachment")}}));const g=ee(c);f.push(g);const y=V(o.layer),{template:_}=o,M=!_||b(_)||v(_)&&"feature"===_.type,I=y&&M;try{if(I){const a=h??new t({attributes:F(e.fullTemplate,o.attributeOverrides),sourceLayer:m}),i=await this._processEdits(a);i&&await this._startUpdating({feature:i})}else f.push(se._configureSketchViewModel(this)),h?(L(o)&&o.geometryToPlace&&(h.attributes=F(e.fullTemplate,o.attributeOverrides)),s.addGraphic(h),await this._startUpdating({feature:h})):await this._startCreating()}finally{g.remove()}const k=i(()=>{for(const t of e.pendingFeatures)s.removeGraphic(t),e.removePendingFeature(t)}),S=u(()=>c?.timeZone,e=>{this._formViewModel.timeZone=e,this.data.timeZone=e},p),T=i(()=>{L(o)&&l.cancelWorkflow({warnIfNoWorkflow:!1})});this._featureFormHandle&&f.push(this._featureFormHandle),this.addHandles(f,this._handleKeys.beforeCommit),this.addHandles(w,this._handleKeys.afterCommit),this.addHandles([i(()=>d.fileInfos.removeAll()),r(f),r(w),T,k,S],le)}async _waitForActiveToolCleared(){const e=this.data.viewModel.view;if(null==e?.activeTool)return;const t=new AbortController;this.addHandles(s(t),de),await m(()=>null==e?.activeTool,t.signal),t.abort()}};function he(e,t,a){let s=null;const o=()=>e.snappingOptions.featureSources,n=()=>(s=new P({layer:t}),o().add(s),s),d=()=>{null!=s&&(o().remove(s),s=l(s))};return r([u(()=>{const e=a.creationInfo?.layer,t=o().find(t=>t.layer===e);return{hasFeatureLayerSource:!!t,enabled:t?.enabled??!1}},({hasFeatureLayerSource:e,enabled:t})=>{if(!e)return d();s??=n(),s.enabled=t},f),i(d)])}function pe(e){const t=e.viewModel.view;if(!t)return[];const a=[];if("3d"===t.type){const r=new A({view:t});a.push(u(()=>e.selectedPendingFeature,(e,t)=>{r.remove(e),r.add(t)}),i(()=>r.destroy()))}const r=new A({view:t,highlightName:E});return a.push(u(()=>e.temporaryHighlightFeature,e=>{r.removeAll(),r.add(e)}),i(()=>r.destroy())),a}function me(e,t,a,i){const r=[];return t.forEach((t,s)=>{if(!t.error){const o=e[s],n=i.get(o)||[];o.attributes[a.objectIdField]=t.objectId,n.forEach(({form:e})=>r.push({feature:o,attachment:e}))}}),r}function fe(e){for(const t of e){const{sourceLayer:e}=t;e&&"globalIdField"in e&&null!=e.globalIdField&&(t.attributes[e.globalIdField]??=w())}}function we(e,t){const a=[];if(!t||0===t.size)return{addFeatures:e};for(const[i,r]of t)for(const{file:e}of r)a.push({feature:i,attachment:{globalId:w(),data:e}});return a.length?{addFeatures:e,addAttachments:a}:{addFeatures:e}}function ge(e,t){return e.map(e=>{const{addFeatures:a}=e;if(!a||0===a.length)return e;const i=[];for(const r of a){const e=t.get(r);if(e)for(const{file:t}of e)i.push({feature:r,attachment:{globalId:w(),data:t}})}return i.length?{...e,addAttachments:i}:e})}e([g()],ue.prototype,"allowSave",null),e([g()],ue.prototype,"createFeatureState",void 0),e([g()],ue.prototype,"data",void 0),e([g({constructOnly:!0})],ue.prototype,"isNested",void 0),e([g()],ue.prototype,"formViewModel",null),e([g()],ue.prototype,"hasInvalidFormTemplate",null),e([g()],ue.prototype,"hasPendingEdits",null),e([g()],ue.prototype,"hasPreviousStep",null),e([g()],ue.prototype,"_getDrawMeshHelpMessage",void 0),e([g()],ue.prototype,"helpMessage",null),e([g()],ue.prototype,"layer",null),e([g()],ue.prototype,"parent",null),e([g()],ue.prototype,"keyboardCancellationEnabled",null),e([g()],ue.prototype,"reliesOnOwnerAdminPrivileges",null),e([g()],ue.prototype,"saveActionLabel",null),e([g()],ue.prototype,"shouldShowAttachments",null),e([g()],ue.prototype,"shouldAllowAttachmentEditing",null),e([g()],ue.prototype,"sketchViewModel",null),e([g()],ue.prototype,"availableCreateTools",null),e([g()],ue.prototype,"_attachmentsActive",null),ue=se=e([y("esri.widgets.Editor.CreateFeaturesWorkflow")],ue);const ye=ue;export{ye as default};
|