@arcgis/core 4.28.0-next.20230621 → 4.28.0-next.20230623
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/Basemap.js +1 -1
- package/arcade/ArcadeModuleResolver.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeTimeUtils.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0380e9f61b6f3ca85139.js +1 -0
- package/assets/esri/core/workers/chunks/0bd95f46a0a9005a19f9.js +1 -0
- package/assets/esri/core/workers/chunks/0c621046b7211cdde980.js +1 -0
- package/assets/esri/core/workers/chunks/0e0267739728e5413f1d.js +1 -0
- package/assets/esri/core/workers/chunks/{39079bcfd35ed73c4e34.js → 156e801a3262f0ac79c0.js} +1 -1
- package/assets/esri/core/workers/chunks/19b4f02fb2392d964582.js +1 -0
- package/assets/esri/core/workers/chunks/1ae75f5282e983f6d768.js +1 -0
- package/assets/esri/core/workers/chunks/2179b3e9e532ca8ef982.js +1 -0
- package/assets/esri/core/workers/chunks/21aaa7fa0e5482670010.js +1 -0
- package/assets/esri/core/workers/chunks/26212a08ea383547335b.js +1 -0
- package/assets/esri/core/workers/chunks/{2420ec029236ab31d908.js → 2882a55a971af1f7858b.js} +1 -1
- package/assets/esri/core/workers/chunks/294285f2822c101326ec.js +1 -0
- package/assets/esri/core/workers/chunks/29f9a380610e4fd98a7c.js +1 -0
- package/assets/esri/core/workers/chunks/303238fc2fcdbb277981.js +1 -0
- package/assets/esri/core/workers/chunks/{3db8ae98799c752afe60.js → 34958516e604d487c625.js} +1 -1
- package/assets/esri/core/workers/chunks/3bee743f4c9370045a5d.js +1 -0
- package/assets/esri/core/workers/chunks/{8e08968505483dc58e00.js → 40ee4e0a5000a08c3abd.js} +1 -1
- package/assets/esri/core/workers/chunks/4128e45e17c9e5280e11.js +1 -0
- package/assets/esri/core/workers/chunks/4f88c4d1d2103843aca8.js +1 -0
- package/assets/esri/core/workers/chunks/505792ce8cbbddd2e815.js +1 -0
- package/assets/esri/core/workers/chunks/{3d42fa4ab5f8632d690a.js → 5237b3938be0d4bc6045.js} +1 -1
- package/assets/esri/core/workers/chunks/{57077e608f20d3a931e8.js → 570e94f4fbefc856d303.js} +1 -1
- package/assets/esri/core/workers/chunks/{4b235d1b6a72773cd4f4.js → 57bb8516fa998a0fba78.js} +1 -1
- package/assets/esri/core/workers/chunks/57bf3ff01d738cedc292.js +1 -0
- package/assets/esri/core/workers/chunks/{1e9e68312cd865358260.js → 60486acc5dacf73f851a.js} +1 -1
- package/assets/esri/core/workers/chunks/6208f2dfa9dfd3bca000.js +1 -0
- package/assets/esri/core/workers/chunks/64008bde5d3ffd9f2499.js +1 -0
- package/assets/esri/core/workers/chunks/69f51a7768bf51c9e346.js +1 -0
- package/assets/esri/core/workers/chunks/719f741a0e45c3e694ba.js +1 -0
- package/assets/esri/core/workers/chunks/{cfe379a78a983373b3ac.js → 7304f45f5622a68253e4.js} +1 -1
- package/assets/esri/core/workers/chunks/733b70d6e5c466a67e9c.js +1 -0
- package/assets/esri/core/workers/chunks/7694521b44681d52b713.js +1 -0
- package/assets/esri/core/workers/chunks/840fd05ceaa038c476d6.js +1 -0
- package/assets/esri/core/workers/chunks/89f7fd2ab92aa14fe0c0.js +1 -0
- package/assets/esri/core/workers/chunks/8a6f29f2ebd59783bb1b.js +1 -0
- package/assets/esri/core/workers/chunks/9d487b7817ccf5bceff6.js +1 -0
- package/assets/esri/core/workers/chunks/{42b6315e21c4c1345ba5.js → 9f5337a80963e0b3c009.js} +1 -1
- package/assets/esri/core/workers/chunks/a0face18b3ea567999ef.js +1 -0
- package/assets/esri/core/workers/chunks/b773c8854e98384ac8ac.js +1 -0
- package/assets/esri/core/workers/chunks/{fb44d872b9dbadcf8ccf.js → b9ef05c22bc3e395bcb3.js} +1 -1
- package/assets/esri/core/workers/chunks/bc5e34200776cfc83d5b.js +1 -0
- package/assets/esri/core/workers/chunks/{cfc3dcca2b69d20d5375.js → c0b9cc091efd5db827de.js} +1 -1
- package/assets/esri/core/workers/chunks/c9f5e949830196ad9458.js +1 -0
- package/assets/esri/core/workers/chunks/{036301f545aba2b8e485.js → cc15e28a99694120556d.js} +1 -1
- package/assets/esri/core/workers/chunks/ce7f575a6c2053c7ca17.js +1 -0
- package/assets/esri/core/workers/chunks/ce9c99cee3d1a3963e7c.js +1 -0
- package/assets/esri/core/workers/chunks/cf9a87b53ea74bae6a37.js +1 -0
- package/assets/esri/core/workers/chunks/d16850b98a53ade0de10.js +1 -0
- package/assets/esri/core/workers/chunks/d24f7ef6eca8c91b90b4.js +1 -0
- package/assets/esri/core/workers/chunks/dbd86e4b7983873cbe7c.js +1 -0
- package/assets/esri/core/workers/chunks/{3c3f65913006b84b2289.js → de20572d334abd4a7d82.js} +1 -1
- package/assets/esri/core/workers/chunks/e009e7f074a572894f48.js +1 -0
- package/assets/esri/core/workers/chunks/{cb004c492e22c50f9bfa.js → f3eb89cff63e00f036c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2a423d9ce8bb784267c.js → f53f20c7100092823487.js} +1 -1
- package/assets/esri/core/workers/chunks/f6040205c50e2795a1a0.js +1 -0
- package/assets/esri/core/workers/chunks/{915734255a79bff3ef0f.js → fcd54e9e64c2864f183c.js} +1 -1
- package/assets/esri/t9n/common.json +1 -1
- package/assets/esri/t9n/common_en.json +1 -1
- package/assets/esri/themes/base/_core.scss +6 -2
- package/assets/esri/themes/base/_mixins.scss +0 -147
- package/assets/esri/themes/base/widgets/_AreaMeasurement2D.scss +0 -8
- package/assets/esri/themes/base/widgets/_AreaMeasurement3D.scss +0 -8
- package/assets/esri/themes/base/widgets/_DirectLineMeasurement3D.scss +0 -1
- package/assets/esri/themes/base/widgets/_DistanceMeasurement2D.scss +0 -1
- package/assets/esri/themes/base/widgets/_MeasurementWidgetContent.scss +67 -0
- package/assets/esri/themes/base/widgets/_Slice.scss +17 -54
- package/assets/esri/themes/base/widgets/_UnitSelect.scss +14 -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/assets/esri/widgets/AreaMeasurement2D/t9n/AreaMeasurement2D.json +1 -1
- package/assets/esri/widgets/AreaMeasurement2D/t9n/AreaMeasurement2D_en.json +1 -1
- package/assets/esri/widgets/AreaMeasurement3D/t9n/AreaMeasurement3D.json +1 -1
- package/assets/esri/widgets/AreaMeasurement3D/t9n/AreaMeasurement3D_en.json +1 -1
- package/assets/esri/widgets/DirectLineMeasurement3D/t9n/DirectLineMeasurement3D.json +1 -1
- package/assets/esri/widgets/DirectLineMeasurement3D/t9n/DirectLineMeasurement3D_en.json +1 -1
- package/assets/esri/widgets/DistanceMeasurement2D/t9n/DistanceMeasurement2D.json +1 -1
- package/assets/esri/widgets/DistanceMeasurement2D/t9n/DistanceMeasurement2D_en.json +1 -1
- package/chunks/HUDMaterial.glsl.js +39 -39
- package/chunks/HighlightBlur.glsl.js +2 -2
- package/chunks/ShadowHighlight.glsl.js +1 -1
- package/chunks/arcade.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/core/HandleOwner.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/support/{WatchUpdatingTracking.js → UpdatingHandles.js} +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/geometry/projection.js +1 -1
- package/interfaces.d.ts +270 -5
- package/kernel.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/LinkChartLayer.d.ts +4 -0
- package/layers/LinkChartLayer.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/mixins/PortalLayer.js +1 -1
- package/layers/support/TileInfoTilemapCache.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
- package/views/2d/layers/features/sources/DataTileSource.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/environment/Stars.js +1 -1
- package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/labelPlacement.js +1 -1
- package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/DisplayQualityProfile.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/support/SceneViewPerformanceInfo.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +6 -7
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/Highlight.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/LayerViewManager.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/PointDrawAction.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/I3SSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/overlay/ViewOverlay.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FeatureForm/FormExpressionArcadeExecutor.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +5 -0
- package/widgets/support/UnitSelect.js +5 -0
- package/assets/esri/core/workers/chunks/0254165377538522c830.js +0 -1
- package/assets/esri/core/workers/chunks/07f16ea775b39a1a4a7b.js +0 -1
- package/assets/esri/core/workers/chunks/170c72126d10b1fdb2b0.js +0 -1
- package/assets/esri/core/workers/chunks/1bbc868d2430103951eb.js +0 -1
- package/assets/esri/core/workers/chunks/1d2ef88a8d028adef102.js +0 -1
- package/assets/esri/core/workers/chunks/2ef70c9b2484a11b7435.js +0 -1
- package/assets/esri/core/workers/chunks/39ae4b9b766f674bc6f2.js +0 -1
- package/assets/esri/core/workers/chunks/3b3d676b609c47a77164.js +0 -1
- package/assets/esri/core/workers/chunks/3d9a8cb638cf9b8ca4b3.js +0 -1
- package/assets/esri/core/workers/chunks/42f3421740a5479559dc.js +0 -1
- package/assets/esri/core/workers/chunks/45629ff775e77234b227.js +0 -1
- package/assets/esri/core/workers/chunks/52315f93a6f0ad59bd90.js +0 -1
- package/assets/esri/core/workers/chunks/5bb96e602d7cecbecf54.js +0 -1
- package/assets/esri/core/workers/chunks/63322229183f1d4eaa70.js +0 -1
- package/assets/esri/core/workers/chunks/642510b0371311ff8e16.js +0 -1
- package/assets/esri/core/workers/chunks/6995ace1d25d67c98d0e.js +0 -1
- package/assets/esri/core/workers/chunks/7e4013f8c31c9a9438c6.js +0 -1
- package/assets/esri/core/workers/chunks/82939ead43848a13f765.js +0 -1
- package/assets/esri/core/workers/chunks/8b6b963230df56850580.js +0 -1
- package/assets/esri/core/workers/chunks/95ff92d7caa34664d58f.js +0 -1
- package/assets/esri/core/workers/chunks/9e570cd4a48c30c83ae6.js +0 -1
- package/assets/esri/core/workers/chunks/a9e9297267614c4c4f3b.js +0 -1
- package/assets/esri/core/workers/chunks/b052463ffb7cb32306dc.js +0 -1
- package/assets/esri/core/workers/chunks/b31974524932e638df8c.js +0 -1
- package/assets/esri/core/workers/chunks/b75b4b132dbd9cb9d372.js +0 -1
- package/assets/esri/core/workers/chunks/c1dfbda75abc748a6ca4.js +0 -1
- package/assets/esri/core/workers/chunks/c8702e53a8ad6cf6ab85.js +0 -1
- package/assets/esri/core/workers/chunks/c90416e7bf29eb1d4536.js +0 -1
- package/assets/esri/core/workers/chunks/cad7a2092ea7f51dbd8b.js +0 -1
- package/assets/esri/core/workers/chunks/d0e2b42dca51711f2c6f.js +0 -1
- package/assets/esri/core/workers/chunks/d2a127f7bb0e2ba14a13.js +0 -1
- package/assets/esri/core/workers/chunks/df96824a6f76bad1370c.js +0 -1
- package/assets/esri/core/workers/chunks/e097f41bbfac00250477.js +0 -1
- package/assets/esri/core/workers/chunks/e3243d120a23a9b48392.js +0 -1
- package/assets/esri/core/workers/chunks/e55f80b774e090a0aa04.js +0 -1
- package/assets/esri/core/workers/chunks/e668c7e2e61aae6ca6e0.js +0 -1
- package/assets/esri/core/workers/chunks/ef900614353505afb210.js +0 -1
- package/assets/esri/core/workers/chunks/f0299d93a95f40ea7cf7.js +0 -1
- package/assets/esri/core/workers/chunks/f23b95d7e51a144ad065.js +0 -1
- package/assets/esri/core/workers/chunks/f263e73a25fae4beffae.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"hint":"Start to measure by clicking in the map to place your first point","mode":"Mode","modes":{"auto":"Auto","planar":"Planar","geodesic":"Geodesic"},"newMeasurement":"New measurement","perimeter":"Perimeter","unit":"Unit","unsupported":"2D area measurement is only supported in MapView.","widgetLabel":"Area Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"hint":"Start to measure by clicking in the map to place your first point","mode":"Mode","modes":{"auto":"Auto","planar":"Planar","geodesic":"Geodesic"},"newMeasurement":"New measurement","perimeter":"Perimeter","unit":"Unit","unsupported":"2D area measurement is only supported in MapView.","widgetLabel":"Area Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"area":"Area","hint":"Start to measure by clicking in the scene to place your first point.","newMeasurement":"New measurement","perimeterLength":"Perimeter","snappingDisablePrompt":"Press and hold the Ctrl key to temporarily disable snapping.","snappingDisablePromptAlternate":"Hold the Ctrl key to temporarily disable snapping.","unit":"Unit","unsupported":"3D area measurement is only supported in SceneView.","widgetLabel":"Area Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"area":"Area","hint":"Start to measure by clicking in the scene to place your first point.","newMeasurement":"New measurement","perimeterLength":"Perimeter","snappingDisablePrompt":"Press and hold the Ctrl key to temporarily disable snapping.","snappingDisablePromptAlternate":"Hold the Ctrl key to temporarily disable snapping.","unit":"Unit","unsupported":"3D area measurement is only supported in SceneView.","widgetLabel":"Area Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"direct":"Direct","distance":"Distance","hint":"Start to measure by clicking in the scene to place your first point.","horizontal":"Horizontal","newMeasurement":"New measurement","snappingDisablePrompt":"Press and hold the Ctrl key to temporarily disable snapping.","snappingDisablePromptAlternate":"Hold the Ctrl key to temporarily disable snapping.","unit":"Unit","unsupported":"3D direct line measurement is only supported in SceneView.","vertical":"Vertical","widgetLabel":"Direct Line Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"direct":"Direct","distance":"Distance","hint":"Start to measure by clicking in the scene to place your first point.","horizontal":"Horizontal","newMeasurement":"New measurement","snappingDisablePrompt":"Press and hold the Ctrl key to temporarily disable snapping.","snappingDisablePromptAlternate":"Hold the Ctrl key to temporarily disable snapping.","unit":"Unit","unsupported":"3D direct line measurement is only supported in SceneView.","vertical":"Vertical","widgetLabel":"Direct Line Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"distance":"Distance","hint":"Start to measure by clicking in the map to place your first point","mode":"Mode","modes":{"auto":"Auto","planar":"Planar","geodesic":"Geodesic"},"newMeasurement":"New measurement","unit":"Unit","unsupported":"2D distance measurement is only supported in MapView.","widgetLabel":"Distance Measurement"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"distance":"Distance","hint":"Start to measure by clicking in the map to place your first point","mode":"Mode","modes":{"auto":"Auto","planar":"Planar","geodesic":"Geodesic"},"newMeasurement":"New measurement","unit":"Unit","unsupported":"2D distance measurement is only supported in MapView.","widgetLabel":"Distance Measurement"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{s as e,j as o}from"./vec2.js";import{a as i}from"./vec2f64.js";import{Z as r}from"./vec4f64.js";import{DEFAULT_TEX_SIZE as l}from"../views/3d/support/engineContent/sdfPrimitives.js";import{ShaderOutput as t}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as a}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{ObjectAndLayerIdColor as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{AlignPixel as n}from"../views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl.js";import{HUD as c}from"../views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js";import{HUDOcclusionPass as d}from"../views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js";import{OutputHighlight as u}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{VisualVariables as
|
|
5
|
+
import{s as e,j as o}from"./vec2.js";import{a as i}from"./vec2f64.js";import{Z as r}from"./vec4f64.js";import{DEFAULT_TEX_SIZE as l}from"../views/3d/support/engineContent/sdfPrimitives.js";import{ShaderOutput as t}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as a}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{ObjectAndLayerIdColor as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{AlignPixel as n}from"../views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl.js";import{HUD as c}from"../views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js";import{HUDOcclusionPass as d}from"../views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js";import{OutputHighlight as u,occludedHighlightFlag as p,unoccludedHighlightFlag as g}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{VisualVariables as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{symbolAlphaCutoff as v,defaultMaskAlphaCutoff as b}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{ColorConversion as m}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{RgbaFloatEncoding as h}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{ScreenSizePerspective as w,addScreenSizePerspective as x,addScreenSizePerspectiveAlignment as C}from"../views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import{addPixelRatio as P}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float2PassUniform as j}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float4PassUniform as S}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as z}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as y}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as O}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as A}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{TransparencyPassType as $}from"../views/3d/webgl-engine/lib/TransparencyPassType.js";import{VertexAttribute as L}from"../views/3d/webgl-engine/lib/VertexAttribute.js";function F(o){const i=new O,F=o.signedDistanceFieldEnabled;if(i.include(c,o),i.include(a,o),o.occlusionPass)return i.include(d,o),i;const{vertex:H,fragment:T}=i;i.include(w),T.include(h),T.include(m),i.include(f,o),i.include(s,o),i.varyings.add("vcolor","vec4"),i.varyings.add("vtc","vec2"),i.varyings.add("vsize","vec2"),o.binaryHighlightOcclusionEnabled&&i.varyings.add("voccluded","float"),H.uniforms.add(new S("viewport",((e,o)=>o.camera.fullViewport)),new j("screenOffset",((o,i)=>e(E,2*o.screenOffset[0]*i.camera.pixelRatio,2*o.screenOffset[1]*i.camera.pixelRatio))),new j("anchorPosition",(e=>B(e))),new S("materialColor",(e=>e.color))),P(H,o),F&&(H.uniforms.add(new S("outlineColor",(e=>e.outlineColor))),T.uniforms.add(new S("outlineColor",(e=>D(e)?e.outlineColor:r)),new z("outlineSize",(e=>D(e)?e.outlineSize:0)))),o.hasScreenSizePerspective&&(x(H),C(H)),(o.debugDrawLabelBorder||o.binaryHighlightOcclusionEnabled)&&i.varyings.add("debugBorderCoords","vec4"),i.attributes.add(L.UV0,"vec2"),i.attributes.add(L.COLOR,"vec4"),i.attributes.add(L.SIZE,"vec2"),i.attributes.add(L.AUXPOS2,"vec4"),H.code.add(y`
|
|
6
6
|
void main(void) {
|
|
7
7
|
ProjectHUDAux projectAux;
|
|
8
8
|
vec4 posProj = projectPositionHUD(projectAux);
|
|
@@ -14,12 +14,12 @@ import{s as e,j as o}from"./vec2.js";import{a as i}from"./vec2f64.js";import{Z a
|
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
vec2 inputSize;
|
|
17
|
-
${o.hasScreenSizePerspective?
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
`:
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
${o.hasScreenSizePerspective?y`
|
|
18
|
+
inputSize = screenSizePerspectiveScaleVec2(size, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspective);
|
|
19
|
+
vec2 screenOffsetScaled = screenSizePerspectiveScaleVec2(screenOffset, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);
|
|
20
|
+
`:y`
|
|
21
|
+
inputSize = size;
|
|
22
|
+
vec2 screenOffsetScaled = screenOffset;`}
|
|
23
23
|
|
|
24
24
|
${o.vvSize?"inputSize *= vvScale(auxpos2).xx;":""}
|
|
25
25
|
|
|
@@ -29,26 +29,26 @@ import{s as e,j as o}from"./vec2.js";import{a as i}from"./vec2f64.js";import{Z a
|
|
|
29
29
|
${o.occlusionTestEnabled||o.binaryHighlightOcclusionEnabled?"bool visible = testVisibilityHUD(posProj);":""}
|
|
30
30
|
|
|
31
31
|
${o.binaryHighlightOcclusionEnabled?"voccluded = visible ? 0.0 : 1.0;":""}
|
|
32
|
-
`);const
|
|
32
|
+
`);const U=y`vec2 uv01 = floor(uv0);
|
|
33
33
|
vec2 uv = uv0 - uv01;
|
|
34
|
-
quadOffset.xy = ((uv01 - anchorPosition) * 2.0 * combinedSize + screenOffsetScaled) / viewport.zw * posProj.w;`;o.pixelSnappingEnabled&&
|
|
34
|
+
quadOffset.xy = ((uv01 - anchorPosition) * 2.0 * combinedSize + screenOffsetScaled) / viewport.zw * posProj.w;`;o.pixelSnappingEnabled&&H.include(n);const V=o.pixelSnappingEnabled?F?y`posProj = alignToPixelOrigin(posProj, viewport.zw) + quadOffset;`:y`posProj += quadOffset;
|
|
35
35
|
if (inputSize.x == size.x) {
|
|
36
36
|
posProj = alignToPixelOrigin(posProj, viewport.zw);
|
|
37
|
-
}`:
|
|
37
|
+
}`:y`posProj += quadOffset;`;H.code.add(y`
|
|
38
38
|
${o.occlusionTestEnabled?"if (visible) {":""}
|
|
39
|
-
${
|
|
39
|
+
${U}
|
|
40
40
|
${o.vvColor?"vcolor = interpolateVVColor(auxpos2.y) * materialColor;":"vcolor = color / 255.0 * materialColor;"}
|
|
41
41
|
|
|
42
|
-
${o.output===t.ObjectAndLayerIdColor?
|
|
42
|
+
${o.output===t.ObjectAndLayerIdColor?y`vcolor.a = 1.0;`:""}
|
|
43
43
|
|
|
44
|
-
bool alphaDiscard = vcolor.a < ${
|
|
45
|
-
${
|
|
44
|
+
bool alphaDiscard = vcolor.a < ${y.float(v)};
|
|
45
|
+
${F?`alphaDiscard = alphaDiscard && outlineColor.a < ${y.float(v)};`:""}
|
|
46
46
|
if (alphaDiscard) {
|
|
47
47
|
// "early discard" if both symbol color (= fill) and outline color (if applicable) are transparent
|
|
48
48
|
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
49
49
|
return;
|
|
50
50
|
} else {
|
|
51
|
-
${
|
|
51
|
+
${V}
|
|
52
52
|
gl_Position = posProj;
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -56,20 +56,20 @@ posProj = alignToPixelOrigin(posProj, viewport.zw);
|
|
|
56
56
|
|
|
57
57
|
${o.debugDrawLabelBorder?"debugBorderCoords = vec4(uv01, 1.5 / combinedSize);":""}
|
|
58
58
|
vsize = inputSize;
|
|
59
|
-
${o.occlusionTestEnabled?
|
|
59
|
+
${o.occlusionTestEnabled?y`} else { vtc = vec2(0.0);
|
|
60
60
|
${o.debugDrawLabelBorder?"debugBorderCoords = vec4(0.5, 0.5, 1.5 / combinedSize);}":"}"}`:""}
|
|
61
61
|
}
|
|
62
|
-
`),
|
|
63
|
-
${o.debugDrawLabelBorder?
|
|
62
|
+
`),T.uniforms.add(new A("tex",(e=>e.texture)));const I=o.debugDrawLabelBorder?y`(isBorder > 0.0 ? 0.0 : ${y.float(b)})`:y.float(b),M=y`
|
|
63
|
+
${o.debugDrawLabelBorder?y`
|
|
64
64
|
float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`:""}
|
|
65
65
|
|
|
66
|
-
${
|
|
66
|
+
${F?y`
|
|
67
67
|
vec4 fillPixelColor = vcolor;
|
|
68
68
|
|
|
69
69
|
// Attempt to sample texel centers to avoid that thin cross outlines
|
|
70
70
|
// disappear with large symbol sizes.
|
|
71
71
|
// see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/7058#issuecomment-603041
|
|
72
|
-
const float txSize = ${
|
|
72
|
+
const float txSize = ${y.float(l)};
|
|
73
73
|
const float texelSize = 1.0 / txSize;
|
|
74
74
|
// Calculate how much we have to add/subtract to/from each texel to reach the size of an onscreen pixel
|
|
75
75
|
vec2 scaleFactor = (vsize - txSize) * texelSize;
|
|
@@ -94,8 +94,8 @@ posProj = alignToPixelOrigin(posProj, viewport.zw);
|
|
|
94
94
|
outlinePixelColor.a *= outlineAlphaFactor;
|
|
95
95
|
|
|
96
96
|
if (
|
|
97
|
-
outlineAlphaFactor + fillAlphaFactor < ${
|
|
98
|
-
fillPixelColor.a + outlinePixelColor.a < ${
|
|
97
|
+
outlineAlphaFactor + fillAlphaFactor < ${I} ||
|
|
98
|
+
fillPixelColor.a + outlinePixelColor.a < ${y.float(v)}
|
|
99
99
|
) {
|
|
100
100
|
discard;
|
|
101
101
|
}
|
|
@@ -107,7 +107,7 @@ posProj = alignToPixelOrigin(posProj, viewport.zw);
|
|
|
107
107
|
|
|
108
108
|
fragColor = vec4(compositeColor, compositeAlpha);
|
|
109
109
|
} else {
|
|
110
|
-
if (fillAlphaFactor < ${
|
|
110
|
+
if (fillAlphaFactor < ${I}) {
|
|
111
111
|
discard;
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -116,39 +116,39 @@ posProj = alignToPixelOrigin(posProj, viewport.zw);
|
|
|
116
116
|
|
|
117
117
|
// visualize SDF:
|
|
118
118
|
// fragColor = vec4(clamp(-dist/vsize.x*2.0, 0.0, 1.0), clamp(dist/vsize.x*2.0, 0.0, 1.0), 0.0, 1.0);
|
|
119
|
-
`:
|
|
119
|
+
`:y`
|
|
120
120
|
vec4 texColor = texture(tex, vtc, -0.5);
|
|
121
|
-
if (texColor.a < ${
|
|
121
|
+
if (texColor.a < ${I}) {
|
|
122
122
|
discard;
|
|
123
123
|
}
|
|
124
124
|
fragColor = texColor * premultiplyAlpha(vcolor);
|
|
125
125
|
`}
|
|
126
126
|
|
|
127
127
|
// Draw debug border with transparency, so that original texels along border are still partially visible
|
|
128
|
-
${o.debugDrawLabelBorder?
|
|
129
|
-
`;return o.output===t.Alpha&&
|
|
128
|
+
${o.debugDrawLabelBorder?y`fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`:""}
|
|
129
|
+
`;return o.output===t.Alpha&&T.code.add(y`
|
|
130
130
|
void main() {
|
|
131
|
-
${
|
|
131
|
+
${M}
|
|
132
132
|
fragColor = vec4(fragColor.a);
|
|
133
133
|
}
|
|
134
|
-
`),o.output===t.ObjectAndLayerIdColor&&
|
|
134
|
+
`),o.output===t.ObjectAndLayerIdColor&&T.code.add(y`
|
|
135
135
|
void main() {
|
|
136
|
-
${
|
|
136
|
+
${M}
|
|
137
137
|
outputObjectAndLayerIdColor();
|
|
138
138
|
}
|
|
139
|
-
`),o.output===t.Color&&
|
|
139
|
+
`),o.output===t.Color&&T.code.add(y`
|
|
140
140
|
void main() {
|
|
141
|
-
${
|
|
142
|
-
${o.transparencyPassType
|
|
141
|
+
${M}
|
|
142
|
+
${o.transparencyPassType===$.FrontFace?"fragColor.rgb /= fragColor.a;":""}
|
|
143
143
|
}
|
|
144
|
-
`),o.output===t.Highlight&&(i.include(u,o),
|
|
144
|
+
`),o.output===t.Highlight&&(i.include(u,o),o.binaryHighlightOcclusionEnabled&&T.constants.add("occludedHighlightFlag","vec4",p).add("unoccludedHighlightFlag","vec4",g),T.code.add(y`
|
|
145
145
|
void main() {
|
|
146
|
-
${
|
|
147
|
-
${o.binaryHighlightOcclusionEnabled?
|
|
146
|
+
${M}
|
|
147
|
+
${o.binaryHighlightOcclusionEnabled?y`
|
|
148
148
|
if (voccluded == 1.0) {
|
|
149
|
-
fragColor =
|
|
149
|
+
fragColor = occludedHighlightFlag;
|
|
150
150
|
} else {
|
|
151
|
-
fragColor =
|
|
151
|
+
fragColor = unoccludedHighlightFlag;
|
|
152
152
|
}`:"outputHighlight();"}
|
|
153
153
|
}
|
|
154
|
-
`)),i}function
|
|
154
|
+
`)),i}function D(e){return e.outlineColor[3]>0&&e.outlineSize>0}function B(e,i=E){return e.textureIsSignedDistanceField?H(e.anchorPosition,e.distanceFieldBoundingBox,i):o(i,e.anchorPosition),i}function H(o,i,r){null!=i?e(r,o[0]*(i[2]-i[0])+i[0],o[1]*(i[3]-i[1])+i[1]):e(r,0,0)}const E=i(),T=Object.freeze(Object.defineProperty({__proto__:null,build:F,calculateAnchorPosForRendering:B},Symbol.toStringTag,{value:"Module"}));export{T as H,F as b,B as c};
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{a as e}from"./vec2f64.js";import{Float2DrawUniform as r}from"../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js";import{NoParameters as o,glsl as t}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as i}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DDrawUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{VertexAttribute as n}from"../views/3d/webgl-engine/lib/VertexAttribute.js";class a extends o{constructor(){super(...arguments),this.blurSize=e()}}function d(){const e=new i,{
|
|
5
|
+
import{a as e}from"./vec2f64.js";import{Float2DrawUniform as r}from"../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js";import{NoParameters as o,glsl as t}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as i}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DDrawUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{VertexAttribute as n}from"../views/3d/webgl-engine/lib/VertexAttribute.js";class a extends o{constructor(){super(...arguments),this.blurSize=e()}}function d(){const e=new i,{attributes:o,varyings:a,vertex:d,fragment:l}=e;return o.add(n.POSITION,"vec2"),o.add(n.UV0,"vec2"),a.add("blurCoordinate","vec3"),d.uniforms.add(new s("coverageTex",(e=>e.coverageTexture))),l.uniforms.add(new r("blurSize",(e=>e.blurSize))),d.code.add(t`void main() {
|
|
6
6
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
7
7
|
vec4 cov = texture(coverageTex, uv0);
|
|
8
8
|
if (cov.r == 0.0) {
|
|
9
9
|
gl_Position = vec4(0.0);
|
|
10
10
|
}
|
|
11
11
|
blurCoordinate = vec3(gl_Position.xy * 0.5 + vec2(0.5), max(cov.g, cov.b));
|
|
12
|
-
}`),
|
|
12
|
+
}`),l.uniforms.add(new u("tex",(e=>e.blurInputTexture))),l.code.add(t`void main() {
|
|
13
13
|
vec2 uv = blurCoordinate.xy;
|
|
14
14
|
vec4 center = texture(tex, uv);
|
|
15
15
|
if (blurCoordinate.z == 1.0) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{a as e,w as o}from"./mat4.js";import{c as i}from"./mat4f64.js";import{n as r,m as t}from"./vec3.js";import{c as a}from"./vec3f64.js";import{ScreenSpacePass as l}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{unoccludedHighlightFlag as h}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{ReadLinearDepth as s}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadLinearDepth.glsl.js";import{ReadShadowMapDraw as d}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{CameraSpace as n}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{RgbaFloatEncoding as c}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{Float2PassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3PassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as f}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as m}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as w}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as x}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{SnapshotSlot as P}from"../views/3d/webgl-engine/lib/ShadowMap.js";const b={highlightedThreshold:.99999,selfShadowThreshold:.025};function D(i){const a=new w;a.include(d,i);const D=a.fragment;return D.include(c),D.include(s),
|
|
5
|
+
import{a as e,w as o}from"./mat4.js";import{c as i}from"./mat4f64.js";import{n as r,m as t}from"./vec3.js";import{c as a}from"./vec3f64.js";import{ScreenSpacePass as l}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{unoccludedHighlightFlag as h}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{ReadLinearDepth as s}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadLinearDepth.glsl.js";import{ReadShadowMapDraw as d}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{CameraSpace as n}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{RgbaFloatEncoding as c}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{Float2PassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3PassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as f}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as m}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as w}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as x}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{SnapshotSlot as P}from"../views/3d/webgl-engine/lib/ShadowMap.js";const b={highlightedThreshold:.99999,selfShadowThreshold:.025};function D(i){const a=new w;a.include(d,i),a.include(n),a.include(l);const D=a.fragment;return D.include(c),D.include(s),D.uniforms.add(new x("defaultDepthTex",((e,o)=>o.shadowMap.getSnapshot(P.Default))),new x("highlightDepthTex",((e,o)=>o.shadowMap.getSnapshot(P.Highlight))),new x("depthMap",((e,o)=>o.linearDepth?.colorTexture)),new x("highlightTexture",(e=>e.highlight)),new v("uColor",(e=>e.shadowColor)),new p("nearFar",((e,o)=>o.camera.nearFar)),new f("opacity",(e=>e.shadowOpacity)),new f("occludedOpacity",(e=>e.occludedShadowOpacity)),new f("terminationFactor",(e=>e.opacityElevation*e.dayNightTerminator)),new g("lightingMainDirectionView",((e,o)=>r(M,t(M,o.lighting.mainLight.direction,o.camera.viewInverseTransposeMatrix)))),new u("inverseViewMatrix",((i,r)=>e(F,o(F,r.camera.viewMatrix,r.camera.center))))),D.constants.add("unoccludedHighlightFlag","vec4",h).add("highlightedThreshold","float",b.highlightedThreshold).add("selfShadowThreshold","float",b.selfShadowThreshold),D.code.add(m`vec3 normalFromDepth(vec3 pixelPos, vec2 fragCoord, ivec2 iuv) {
|
|
6
6
|
float leftPixelDepth = linearDepthFromRGBA(texelFetch(depthMap, iuv + ivec2(-1, 0), 0), nearFar);
|
|
7
7
|
float rightPixelDepth = linearDepthFromRGBA(texelFetch(depthMap, iuv + ivec2(1, 0), 0), nearFar);
|
|
8
8
|
float bottomPixelDepth = linearDepthFromRGBA(texelFetch(depthMap, iuv + ivec2(0, -1), 0), nearFar);
|
package/chunks/arcade.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{compileScript as e,extend as t,enableAsyncSupport as r}from"../arcade/arcadeCompiler.js";import{ArcadeModuleResolver as n}from"../arcade/ArcadeModuleResolver.js";import{executeScript as s,extend as u}from"../arcade/arcadeRuntime.js";import{ArcadeExecutionError as a,ExecutionErrorCodes as o}from"../arcade/executionError.js";import{parseScript as i}from"../arcade/parser.js";import{referencesMember as c,referencesFunction as l,findFieldLiterals as f,findExpectedFieldLiterals as p,findScriptDependencies as d,findModuleImports as m,findFunctionCalls as y}from"../arcade/treeAnalysis.js";import has from"../core/has.js";import{assertIsSome as S}from"../core/maybe.js";const b=["feature","angle","bearing","centroid","envelopeintersects","extent","geometry","isselfintersecting","ringisclockwise"];
|
|
5
|
+
import{compileScript as e,extend as t,enableAsyncSupport as r}from"../arcade/arcadeCompiler.js";import{ArcadeModuleResolver as n}from"../arcade/ArcadeModuleResolver.js";import{executeScript as s,extend as u}from"../arcade/arcadeRuntime.js";import{ArcadeExecutionError as a,ExecutionErrorCodes as o}from"../arcade/executionError.js";import{parseScript as i}from"../arcade/parser.js";import{referencesMember as c,referencesFunction as l,findFieldLiterals as f,findExpectedFieldLiterals as p,findScriptDependencies as d,findModuleImports as m,findFunctionCalls as y}from"../arcade/treeAnalysis.js";import has from"../core/has.js";import{assertIsSome as S}from"../core/maybe.js";const b=["feature","angle","bearing","centroid","envelopeintersects","extent","geometry","isselfintersecting","ringisclockwise"];let g=!1,A=!1,w=null,h=[];function j(t,r){if(!0===r.useAsync||!0===t.isAsync)return x(t,r);if(has("esri-csp-restrictions")){return function(e){return s(t,e)}}try{return e(t,r)}catch(n){if("esri.arcade.arcadeuncompilableerror"===n.declaredRootClass)return function(e){return s(t,e)};throw n}}function x(t,r){if(null===w)throw new a(null,o.AsyncNotEnabled,null);if(has("esri-csp-restrictions")){return function(e){return w.executeScript(t,e)}}try{return e(t,r,!0)}catch(n){if("esri.arcade.arcadeuncompilableerror"===n.declaredRootClass)return function(e){return w.executeScript(t,e)};throw n}}function M(e){u(e),t(e,"sync"),null===w?h.push(e):(t(e,"async"),w.extend(e))}function F(e,t=[]){return i(e,t)}function E(e,t,r=[]){return G(i(e,r),t)}function G(e,t){if(!0===t.useAsync||!0===e.isAsync){if(null===w)throw new a(null,o.AsyncNotEnabled,null);return w.executeScript(e,t)}return s(e,t)}function v(e,t){return c(e,t)}function U(e,t){return l(e,t)}function _(e,t=!1){return void 0===t&&(t=!1),f(e)}function I(e){return p(e)}function R(e,t=[]){return void 0===e.usesGeometry&&d(e,t),!0===e.usesGeometry}let C=null;function D(){return C||(C=P(),C)}async function P(){const[e,t]=await Promise.all([import("../geometry/geometryEngine.js"),import("../arcade/functions/geomsync.js")]);return A=!0,t.setGeometryEngine(e),!0}let k=null;function z(){return null!==k||(k=L()),k}async function L(){await r(),w=await import("../arcade/arcadeAsyncRuntime.js");for(const e of h)w.extend(e),t(e,"async");return h=null,!0}function N(){return g}function O(){return!!w}function T(){return A}let q=null;function B(){return q||(q=H(),q)}async function H(){await z();const[e,r,n,s,u]=await Promise.all([import("../arcade/featureSetUtils.js"),import("../arcade/functions/featuresetbase.js"),import("../arcade/functions/featuresetgeom.js"),import("../arcade/functions/featuresetstats.js"),import("../arcade/functions/featuresetstring.js")]);return $=e,w.extend([r,n,s,u]),t([r,n,s,u],"async"),g=!0,!0}function J(e,t=[]){return void 0===e.usesFeatureSet&&d(e,t),!0===e.usesFeatureSet}function K(e,t=[]){return void 0===e.isAsync&&d(e,t),!0===e.isAsync}function Q(e,t){if(t){for(const r of t)if(v(e,r))return!0;return!1}return!1}async function V(e,t,r=[],n=!1,s=null){return W(new Set,e,t,r,n,s)}async function W(e,t,r,n=[],s=!1,u=null){const a="string"==typeof t?F(t):t,o=[];return a&&(!1===T()&&(R(a)||s)&&o.push(D()),!1===O()&&(!0===a.isAsync||r)&&o.push(z()),!1===N()&&(J(a)||Q(a,n))&&o.push(B())),o.length&&await Promise.all(o),await Y(e,a,u,r,s),!0}function X(e,t=[]){return void 0===e.usesModules&&d(e,t),!0===e.usesModules}async function Y(e,t,r=null,s=!1,u=!1){const i=m(t);null===r&&i.length>0&&(r=n.getDefault()),t.loadedModules={};for(const n of i){S(r);const i=r.normalizeModuleUri(n.source);if(e.has(i.uri))throw new a(null,o.CircularModules,null);e.add(i.uri);const c=await r.fetchModule(i);await W(e,c,s,[],u,r),e.delete(i.uri),c.isAsync&&(t.isAsync=!0),c.usesFeatureSet&&(t.usesFeatureSet=!0),c.usesGeometry&&(t.usesGeometry=!0),t.loadedModules[n.libname]={uri:i.uri,script:c}}}function Z(e){if(R(e))return!0;const t=y(e);let r=!1;for(let n=0;n<t.length;n++)if(b.includes(t[n])){r=!0;break}return r}let $=null;function ee(){return $}const te=Object.freeze(Object.defineProperty({__proto__:null,_loadScriptDependenciesImpl:W,compileScript:j,enableAsyncSupport:z,enableAsyncSupportImpl:L,enableFeatureSetSupport:B,enableFeatureSetSupportImpl:H,enableGeometrySupport:D,enableGeometrySupportImpl:P,executeScript:G,extend:M,extractExpectedFieldLiterals:I,extractFieldLiterals:_,featureSetUtils:ee,isAsyncEnabled:O,isFeatureSetSupportEnabled:N,isGeometryEnabled:T,loadDependentModules:Y,loadScriptDependencies:V,parseAndExecuteScript:E,parseScript:F,referencesFunction:U,referencesMember:v,scriptIsAsync:K,scriptTouchesGeometry:Z,scriptUsesFeatureSet:J,scriptUsesGeometryEngine:R,scriptUsesModules:X},Symbol.toStringTag,{value:"Module"}));export{Y as A,W as _,I as a,D as b,j as c,B as d,G as e,ee as f,R as g,te as h,M as i,E as j,U as k,V as l,_ as m,P as n,z as o,F as p,L as q,v as r,Z as s,N as t,O as u,T as v,H as w,J as x,K as y,X as z};
|
package/chunks/languageUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ArcadeFunction as e}from"../arcade/FunctionWrapper.js";import n from"../arcade/ImmutableArray.js";import t from"../arcade/ImmutablePathArray.js";import r from"../arcade/ImmutablePointArray.js";import{ArcadeDate as a,createDateTimeZone as i}from"../arcade/ArcadeDate.js";import o from"../geometry/Extent.js";import l from"../geometry/Geometry.js";import s from"../geometry/Multipoint.js";import u from"../geometry/Point.js";import f from"../geometry/Polygon.js";import c from"../geometry/Polyline.js";import{DateTime as d}from"luxon";import{format as m,parse as y}from"../core/number.js";import{isClockwise as p}from"../geometry/support/coordsUtils.js";import{getLocale as g}from"../intl/locale.js";import h from"../config.js";import{version as b}from"../kernel.js";import{esriFieldToJson as S,layerGeometryEsriRestConstants as x}from"../arcade/featureset/support/shared.js";import{ArcadeModule as N}from"../arcade/ArcadeModule.js";import{ArcadeExecutionError as M,ExecutionErrorCodes as k}from"../arcade/executionError.js";class j{constructor(e){this.value=e}}class A{constructor(e){this.value=e}}const T=A,D=j,F={type:"VOID"},C={type:"BREAK"},R={type:"CONTINUE"};function I(e,n,t){return""===n||null==n||n===t||n===t?e:e=e.split(n).join(t)}function O(n){return n instanceof e}function Z(e){return e instanceof N}function w(e){return!!L(e)||(!!J(e)||(!!B(e)||(!!Y(e)||(null===e||(e===F||"number"==typeof e)))))}function v(e,n){return void 0===e?n:e}function _(e){return null==e?"":z(e)||q(e)?"Array":B(e)?"Date":L(e)?"String":Y(e)?"Boolean":J(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":e instanceof N?"Module":E(e)?"Feature":e instanceof u?"Point":e instanceof f?"Polygon":e instanceof c?"Polyline":e instanceof s?"Multipoint":e instanceof o?"Extent":O(e)?"Function":V(e)?"FeatureSet":U(e)?"FeatureSetCollection":e===F?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognised Type"}function L(e){return"string"==typeof e||e instanceof String}function Y(e){return"boolean"==typeof e}function J(e){return"number"==typeof e}function P(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function G(e){return e instanceof l}function z(e){return e instanceof Array}function E(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function V(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function H(e){return"esri.arcade.Dictionary"===e?.declaredClass}function U(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function q(e){return e instanceof n}function B(e){return e instanceof a}function W(e){return null!=e&&"object"==typeof e}function $(e){return e instanceof Date}function Q(e,n,t,r,a){if(e.length<n||e.length>t)throw new M(r,k.WrongNumberOfParameters,a)}function X(e){return e<0?-Math.round(-e):Math.round(e)}function K(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,(n=>{const t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===n?t:3&t|8).toString(16)}))}function ee(e,n){return isNaN(e)||null==n||""===n?e.toString():(n=I(n,"‰",""),n=I(n,"¤",""),m(e,{pattern:n}))}function ne(e,n){return null==n||""===n?e.toISOString(!0):e.toFormat(te(n),{locale:g(),numberingSystem:"latn"})}function te(e){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let n="";const t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of e.match(t)||[])switch(r){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"Z":n+="ZZ";break;case"ZZ":n+="ZZZ";break;case"S":n+="'S'";break;case"SS":n+="'SS'";break;case"SSS":n+="u";break;case"A":case"a":n+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":n+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?n+=`'${r.slice(1,-1)}'`:n+=`'${r}'`}return n}function re(e,n,t){switch(t){case">":return e>n;case"<":return e<n;case">=":return e>=n;case"<=":return e<=n}return!1}function ae(e,n,t){if(null===e){if(null===n||n===F)return re(null,null,t);if(J(n))return re(0,n,t);if(L(n))return re(0,fe(n),t);if(Y(n))return re(0,fe(n),t);if(B(n))return re(0,n.toNumber(),t)}if(e===F){if(null===n||n===F)return re(null,null,t);if(J(n))return re(0,n,t);if(L(n))return re(0,fe(n),t);if(Y(n))return re(0,fe(n),t);if(B(n))return re(0,n.toNumber(),t)}else if(J(e)){if(J(n))return re(e,n,t);if(Y(n))return re(e,fe(n),t);if(null===n||n===F)return re(e,0,t);if(L(n))return re(e,fe(n),t);if(B(n))return re(e,n.toNumber(),t)}else if(L(e)){if(L(n))return re(oe(e),oe(n),t);if(B(n))return re(fe(e),n.toNumber(),t);if(J(n))return re(fe(e),n,t);if(null===n||n===F)return re(fe(e),0,t);if(Y(n))return re(fe(e),fe(n),t)}else if(B(e)){if(B(n))return re(e.toNumber(),n.toNumber(),t);if(null===n||n===F)return re(e.toNumber(),0,t);if(J(n))return re(e.toNumber(),n,t);if(Y(n))return re(e.toNumber(),fe(n),t);if(L(n))return re(e.toNumber(),fe(n),t)}else if(Y(e)){if(Y(n))return re(e,n,t);if(J(n))return re(fe(e),fe(n),t);if(B(n))return re(fe(e),n.toNumber(),t);if(null===n||n===F)return re(fe(e),0,t);if(L(n))return re(fe(e),fe(n),t)}return!!ie(e,n)&&("<="===t||">="===t)}function ie(e,n){if(e===n)return!0;if(null===e&&n===F||null===n&&e===F)return!0;if(B(e)&&B(n))return e.equals(n);if(e instanceof t)return e.equalityTest(n);if(e instanceof r)return e.equalityTest(n);if(e instanceof u&&n instanceof u){const t=e.cache._arcadeCacheId,r=n.cache._arcadeCacheId;if(null!=t)return t===r}if(W(e)&&W(n)){if(e._arcadeCacheId===n._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===n._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function oe(e,t){if(L(e))return e;if(null===e)return"";if(J(e))return ee(e,t);if(Y(e))return e.toString();if(B(e))return ne(e,t);if(e instanceof l)return JSON.stringify(e.toJSON());if(z(e)){const n=[];for(let t=0;t<e.length;t++)n[t]=ue(e[t]);return"["+n.join(",")+"]"}if(e instanceof n){const n=[];for(let t=0;t<e.length();t++)n[t]=ue(e.get(t));return"["+n.join(",")+"]"}return null!==e&&"object"==typeof e&&void 0!==e.castToText?e.castToText():O(e)?"object, Function":e===F?"":Z(e)?"object, Module":""}function le(e){const t=[];if(!z(e))return null;if(e instanceof n){for(let n=0;n<e.length();n++)t[n]=fe(e.get(n));return t}for(let n=0;n<e.length;n++)t[n]=fe(e[n]);return t}function se(e,t,r=!1){if(L(e))return e;if(null===e)return"";if(J(e))return ee(e,t);if(Y(e))return e.toString();if(B(e))return ne(e,t);if(e instanceof l)return e instanceof o?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+xe(e.spatialReference)+"}":xe(e.toJSON(),((e,n)=>e.key===n.key?0:"spatialReference"===e.key?1:"spatialReference"===n.key||e.key<n.key?-1:e.key>n.key?1:0));if(z(e)){const n=[];for(let t=0;t<e.length;t++)n[t]=ue(e[t],r);return"["+n.join(",")+"]"}if(e instanceof n){const n=[];for(let t=0;t<e.length();t++)n[t]=ue(e.get(t),r);return"["+n.join(",")+"]"}return null!==e&&"object"==typeof e&&void 0!==e.castToText?e.castToText(r):O(e)?"object, Function":e===F?"":Z(e)?"object, Module":""}function ue(e,t=!1){if(null===e)return"null";if(Y(e)||J(e)||L(e))return JSON.stringify(e);if(e instanceof l)return se(e,null,t);if(e instanceof n)return se(e,null,t);if(e instanceof Array)return se(e,null,t);if(B(e))return t?JSON.stringify(e.getTime()):JSON.stringify(ne(e,""));if(null!==e&&"object"==typeof e){if(void 0!==e.castToText)return e.castToText(t)}else if(e===F)return"null";return"null"}function fe(e,n){return J(e)?e:null===e||""===e?0:B(e)?NaN:Y(e)?e?1:0:z(e)||""===e||void 0===e?NaN:void 0!==n&&L(e)?(n=I(n,"‰",""),n=I(n,"¤",""),y(e,{pattern:n})):e===F?0:Number(e)}function ce(e,n){if(B(e))return e;if(L(e)){const t=de(e,n);if(t)return a.dateTimeToArcadeDate(t)}return null}function de(e,n){const t=/ (\d\d)/,r=i(n);let a=d.fromISO(e,{zone:r});return a.isValid||t.test(e)&&(e=e.replace(t,"T$1"),a=d.fromISO(e,{zone:n}),a.isValid)?a:null}function me(e){return Y(e)?e:L(e)?"true"===(e=e.toLowerCase()):!!J(e)&&(0!==e&&!isNaN(e))}function ye(e,n){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=n),e)}function pe(e){if(null===e)return null;if(e instanceof u)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof f){if(0===e.rings.length)return null;for(const n of e.rings)if(n.length>0)return e;return null}if(e instanceof c){if(0===e.paths.length)return null;for(const n of e.paths)if(n.length>0)return e;return null}return e instanceof s?0===e.points.length?null:e:e instanceof o?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function ge(e,n){if(!e)return n;if(!e.domain)return n;let t=null,r=null;if("string"===e.field.type||"esriFieldTypeString"===e.field.type)t=oe(n);else{if(null==n)return null;if(""===n)return n;t=fe(n)}for(let a=0;a<e.domain.codedValues.length;a++){const n=e.domain.codedValues[a];n.code===t&&(r=n)}return null===r?oe(n):r.name}function he(e,n){if(!e)return n;if(!e.domain)return n;let t=null;const r=oe(n);for(let a=0;a<e.domain.codedValues.length;a++){const n=e.domain.codedValues[a];n.name===r&&(t=n)}return null===t?n:t.code}function be(e,n,t=null,r=null){if(!n)return null;if(!n.fields)return null;let a,i,o=null;for(let l=0;l<n.fields.length;l++){const t=n.fields[l];t.name.toLowerCase()===e.toString().toLowerCase()&&(o=t)}if(null===o)throw new M(null,k.FieldNotFound,null,{key:e});if(null===r&&t&&n.typeIdField)r=t.hasField(n.typeIdField)?t.field(n.typeIdField):null;else if(n.typeIdField&&null!==r){let e=!1;for(const t of n.types||[])if(r===t.id){e=!0;break}if(!e)for(const t of n.types||[])if(r===t.name){r=t.id,e=!0;break}e||(r=null,t&&n.typeIdField&&(r=t.hasField(n.typeIdField)?t.field(n.typeIdField):null))}return null!=r&&n.types.some((e=>e.id===r&&(a=e.domains&&e.domains[o.name],a&&"inherited"===a.type&&(a=Se(o.name,n),i=!0),!0))),i||a||(a=Se(e,n)),{field:o,domain:a}}function Se(e,n){let t;return n.fields.some((n=>(n.name.toLowerCase()===e.toLowerCase()&&(t=n.domain),!!t))),t}function xe(e,n){n||(n={}),"function"==typeof n&&(n={cmp:n});const t="boolean"==typeof n.cycles&&n.cycles,r=n.cmp&&(a=n.cmp,function(e){return function(n,t){const r={key:n,value:e[n]},i={key:t,value:e[t]};return a(r,i)}});var a;const i=[];return function e(n){if(n&&n.toJSON&&"function"==typeof n.toJSON&&(n=n.toJSON()),void 0===n)return;if("number"==typeof n)return isFinite(n)?""+n:"null";if("object"!=typeof n)return JSON.stringify(n);let a,o;if(Array.isArray(n)){for(o="[",a=0;a<n.length;a++)a&&(o+=","),o+=e(n[a])||"null";return o+"]"}if(null===n)return"null";if(i.includes(n)){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const l=i.push(n)-1,s=Object.keys(n).sort(r&&r(n));for(o="",a=0;a<s.length;a++){const t=s[a],r=e(n[t]);r&&(o&&(o+=","),o+=JSON.stringify(t)+":"+r)}return i.splice(l,1),"{"+o+"}"}(e)}function Ne(e){if(null===e)return null;const n=[];for(const t of e)t&&t.arcadeDeclaredClass&&"esri.arcade.Feature"===t.arcadeDeclaredClass?n.push(t.geometry()):n.push(t);return n}function Me(e,n){if(!(n instanceof u))throw new M(null,k.InvalidParameter,null);e.push(n.hasZ?n.hasM?[n.x,n.y,n.z,n.m]:[n.x,n.y,n.z]:[n.x,n.y])}function ke(e,n){if(z(e)||q(e)){let t=!1,a=!1,i=[],o=n;if(z(e)){for(const n of e)Me(i,n);i.length>0&&(o=e[0].spatialReference,t=e[0].hasZ,a=e[0].hasM)}else if(e instanceof r)i=e._elements,i.length>0&&(t=e._hasZ,a=e._hasM,o=e.get(0).spatialReference);else{if(!q(e))throw new M(null,k.InvalidParameter,null);for(const n of e.toArray())Me(i,n);i.length>0&&(o=e.get(0).spatialReference,t=!0===e.get(0).hasZ,a=!0===e.get(0).hasM)}if(0===i.length)return null;return p(i)||(i=i.slice(0).reverse()),new f({rings:[i],spatialReference:o,hasZ:t,hasM:a})}return e}function je(e,n){if(z(e)||q(e)){let t=!1,a=!1,i=[],o=n;if(z(e)){for(const n of e)Me(i,n);i.length>0&&(o=e[0].spatialReference,t=!0===e[0].hasZ,a=!0===e[0].hasM)}else if(e instanceof r)i=e._elements,i.length>0&&(t=e._hasZ,a=e._hasM,o=e.get(0).spatialReference);else if(q(e)){for(const n of e.toArray())Me(i,n);i.length>0&&(o=e.get(0).spatialReference,t=!0===e.get(0).hasZ,a=!0===e.get(0).hasM)}return 0===i.length?null:new c({paths:[i],spatialReference:o,hasZ:t,hasM:a})}return e}function Ae(e,n){if(z(e)||q(e)){let t=!1,a=!1,i=[],o=n;if(z(e)){for(const n of e)Me(i,n);i.length>0&&(o=e[0].spatialReference,t=!0===e[0].hasZ,a=!0===e[0].hasM)}else if(e instanceof r)i=e._elements,i.length>0&&(t=e._hasZ,a=e._hasM,o=e.get(0).spatialReference);else if(q(e)){for(const n of e.toArray())Me(i,n);i.length>0&&(o=e.get(0).spatialReference,t=!0===e.get(0).hasZ,a=!0===e.get(0).hasM)}return 0===i.length?null:new s({points:i,spatialReference:o,hasZ:t,hasM:a})}return e}function Te(e,t=!1){const r=[];if(null===e)return r;if(!0===z(e)){for(let n=0;n<e.length;n++){const a=oe(e[n]);""===a&&!0!==t||r.push(a)}return r}if(e instanceof n){for(let n=0;n<e.length();n++){const a=oe(e.get(n));""===a&&!0!==t||r.push(a)}return r}if(w(e)){const n=oe(e);return""===n&&!0!==t||r.push(n),r}return[]}let De=0;function Fe(e){return De++,De%100==0?(De=0,new Promise((n=>{setTimeout((()=>{n(e)}),0)}))):e}function Ce(e,n,t){switch(t){case"&":return e&n;case"|":return e|n;case"^":return e^n;case"<<":return e<<n;case">>":return e>>n;case">>>":return e>>>n}}function Re(e,t=null){return null==e?null:Y(e)||J(e)||L(e)?e:e instanceof l?!0===t?.keepGeometryType?e:e.toJSON():e instanceof n?e.toArray().map((e=>Re(e,t))):e instanceof Array?e.map((e=>Re(e,t))):$(e)?e:B(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(t):null}async function Ie(e,n,t,r,a){const i=await Oe(e,n,t);a[r]=i}async function Oe(e,t=null,r=null){if(e instanceof n&&(e=e.toArray()),null==e)return null;if(w(e)||e instanceof l||$(e)||B(e))return Re(e,r);if(e instanceof Array){const n=[],a=[];for(const i of e)null===i||w(i)||i instanceof l||$(i)||B(i)?a.push(Re(i,r)):(a.push(null),n.push(Ie(i,t,r,a.length-1,a)));return n.length>0&&await Promise.all(n),a}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(t,r):null}function Ze(e){return we(e)?e.parent:e}function we(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function ve(e){return e&&"declaredClass"in e&&"esri.layers.SubtypeGroupLayer"===e.declaredClass}function _e(e,n,t){const r=Ze(e.fullSchema());if(null===r)return null;if(!r.fields)return null;return be(n,r,e,t)}function Le(e){const n=Ze(e.fullSchema());return null===n?null:n.fields&&n.typeIdField?{subtypeField:n.typeIdField,subtypes:n.types?n.types.map((e=>({name:e.name,code:e.id}))):[]}:null}function Ye(e,n,t,r){const a=Ze(e.fullSchema());if(null===a)return null;if(!a.fields)return null;const i=be(n,a,e,r);if(void 0===t)try{t=e.field(n)}catch(o){return null}return ge(i,t)}function Je(e,n,t,r){const a=Ze(e.fullSchema());if(null===a)return null;if(!a.fields)return null;if(void 0===t){try{t=e.field(n)}catch(i){return null}return t}return he(be(n,a,e,r),t)}function Pe(e){return e?.timeReference?.timeZone??"system"}function Ge(e){const n=Ze(e.fullSchema());if(null===n)return null;if(!n.fields)return null;const t=[];for(const r of n.fields)t.push(S(r));return{objectIdField:n.objectIdField,globalIdField:n.globalIdField??"",geometryType:void 0===x[n.geometryType]?"":x[n.geometryType],fields:t}}function ze(e,n){return"system"===e&&(e=a.systemTimeZoneCanonicalName),{version:Ee,engineVersion:b,timeZone:e,spatialReference:n.toJSON(),application:h.applicationName??"",engine:"web",locale:g()}}const Ee="1.23",Ve=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:T,ImplicitResultE:A,ReturnResult:D,ReturnResultE:j,absRound:X,arcadeVersion:Ee,autoCastArrayOfPointsToMultiPoint:Ae,autoCastArrayOfPointsToPolygon:ke,autoCastArrayOfPointsToPolyline:je,autoCastFeatureToGeometry:Ne,binaryOperator:Ce,breakResult:C,castAsJson:Re,castAsJsonAsync:Oe,continueResult:R,defaultExecutingContext:ze,defaultTimeZone:Pe,defaultUndefined:v,equalityTest:ie,featureDomainCodeLookup:Je,featureDomainValueLookup:Ye,featureFullDomain:_e,featureSchema:Ge,featureSubtypes:Le,fixNullGeometry:pe,fixSpatialReference:ye,formatDate:ne,formatNumber:ee,generateUUID:K,getDomain:be,getDomainCode:he,getDomainValue:ge,getType:_,greaterThanLessThan:ae,isArray:z,isBoolean:Y,isDate:B,isDictionary:H,isFeature:E,isFeatureSet:V,isFeatureSetCollection:U,isFunctionParameter:O,isGeometry:G,isImmutableArray:q,isInteger:P,isJsDate:$,isModule:Z,isNumber:J,isObject:W,isSimpleType:w,isString:L,isSubtypeGrouplayer:ve,isSubtypeSublayer:we,multiReplace:I,pcCheck:Q,stableStringify:xe,standardiseDateFormat:te,tick:Fe,toBoolean:me,toDate:ce,toNumber:fe,toNumberArray:le,toString:oe,toStringArray:Te,toStringExplicit:se,voidOperation:F},Symbol.toStringTag,{value:"Module"}));export{Fe as $,ie as A,Ce as B,Q as C,v as D,P as E,_ as F,Pe as G,te as H,T as I,X as J,pe as K,Ne as L,je as M,ke as N,Ae as O,I as P,K as Q,D as R,Ge as S,Le as T,_e as U,Ye as V,Je as W,ze as X,le as Y,ve as Z,we as _,Y as a,Te as a0,be as a1,ge as a2,he as a3,j as a4,A as a5,Z as a6,W as a7,$ as a8,ee as a9,ne as aa,xe as ab,Ee as ac,J as b,L as c,Re as d,Oe as e,w as f,fe as g,me as h,O as i,oe as j,B as k,ce as l,z as m,G as n,q as o,E as p,U as q,V as r,H as s,se as t,Ve as u,F as v,C as w,R as x,ye as y,ae as z};
|
|
5
|
+
import e from"../config.js";import{version as n}from"../kernel.js";import{ArcadeDate as t,createDateTimeZone as r}from"../arcade/ArcadeDate.js";import{ArcadeModule as a}from"../arcade/ArcadeModule.js";import{ArcadeExecutionError as i,ExecutionErrorCodes as o}from"../arcade/executionError.js";import{ArcadeFunction as l}from"../arcade/FunctionWrapper.js";import s from"../arcade/ImmutableArray.js";import u from"../arcade/ImmutablePathArray.js";import f from"../arcade/ImmutablePointArray.js";import{esriFieldToJson as c,layerGeometryEsriRestConstants as d}from"../arcade/featureset/support/shared.js";import{format as m,parse as y}from"../core/number.js";import p from"../geometry/Extent.js";import g from"../geometry/Geometry.js";import h from"../geometry/Multipoint.js";import b from"../geometry/Point.js";import S from"../geometry/Polygon.js";import x from"../geometry/Polyline.js";import{isClockwise as N}from"../geometry/support/coordsUtils.js";import{getLocale as M}from"../intl/locale.js";import{DateTime as k}from"luxon";class j{constructor(e){this.value=e}}class A{constructor(e){this.value=e}}const T=A,D=j,F={type:"VOID"},C={type:"BREAK"},R={type:"CONTINUE"};function I(e,n,t){return""===n||null==n||n===t||n===t?e:e=e.split(n).join(t)}function O(e){return e instanceof l}function Z(e){return e instanceof a}function w(e){return!!L(e)||(!!J(e)||(!!B(e)||(!!Y(e)||(null===e||(e===F||"number"==typeof e)))))}function v(e,n){return void 0===e?n:e}function _(e){return null==e?"":z(e)||q(e)?"Array":B(e)?"Date":L(e)?"String":Y(e)?"Boolean":J(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":e instanceof a?"Module":E(e)?"Feature":e instanceof b?"Point":e instanceof S?"Polygon":e instanceof x?"Polyline":e instanceof h?"Multipoint":e instanceof p?"Extent":O(e)?"Function":V(e)?"FeatureSet":U(e)?"FeatureSetCollection":e===F?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognised Type"}function L(e){return"string"==typeof e||e instanceof String}function Y(e){return"boolean"==typeof e}function J(e){return"number"==typeof e}function P(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function G(e){return e instanceof g}function z(e){return e instanceof Array}function E(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function V(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function H(e){return"esri.arcade.Dictionary"===e?.declaredClass}function U(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function q(e){return e instanceof s}function B(e){return e instanceof t}function W(e){return null!=e&&"object"==typeof e}function $(e){return e instanceof Date}function Q(e,n,t,r,a){if(e.length<n||e.length>t)throw new i(r,o.WrongNumberOfParameters,a)}function X(e){return e<0?-Math.round(-e):Math.round(e)}function K(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,(n=>{const t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===n?t:3&t|8).toString(16)}))}function ee(e,n){return isNaN(e)||null==n||""===n?e.toString():(n=I(n,"‰",""),n=I(n,"¤",""),m(e,{pattern:n}))}function ne(e,n){return null==n||""===n?e.toISOString(!0):e.toFormat(te(n),{locale:M(),numberingSystem:"latn"})}function te(e){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let n="";const t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of e.match(t)||[])switch(r){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"Z":n+="ZZ";break;case"ZZ":n+="ZZZ";break;case"S":n+="'S'";break;case"SS":n+="'SS'";break;case"SSS":n+="u";break;case"A":case"a":n+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":n+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?n+=`'${r.slice(1,-1)}'`:n+=`'${r}'`}return n}function re(e,n,t){switch(t){case">":return e>n;case"<":return e<n;case">=":return e>=n;case"<=":return e<=n}return!1}function ae(e,n,t){if(null===e){if(null===n||n===F)return re(null,null,t);if(J(n))return re(0,n,t);if(L(n))return re(0,fe(n),t);if(Y(n))return re(0,fe(n),t);if(B(n))return re(0,n.toNumber(),t)}if(e===F){if(null===n||n===F)return re(null,null,t);if(J(n))return re(0,n,t);if(L(n))return re(0,fe(n),t);if(Y(n))return re(0,fe(n),t);if(B(n))return re(0,n.toNumber(),t)}else if(J(e)){if(J(n))return re(e,n,t);if(Y(n))return re(e,fe(n),t);if(null===n||n===F)return re(e,0,t);if(L(n))return re(e,fe(n),t);if(B(n))return re(e,n.toNumber(),t)}else if(L(e)){if(L(n))return re(oe(e),oe(n),t);if(B(n))return re(fe(e),n.toNumber(),t);if(J(n))return re(fe(e),n,t);if(null===n||n===F)return re(fe(e),0,t);if(Y(n))return re(fe(e),fe(n),t)}else if(B(e)){if(B(n))return re(e.toNumber(),n.toNumber(),t);if(null===n||n===F)return re(e.toNumber(),0,t);if(J(n))return re(e.toNumber(),n,t);if(Y(n))return re(e.toNumber(),fe(n),t);if(L(n))return re(e.toNumber(),fe(n),t)}else if(Y(e)){if(Y(n))return re(e,n,t);if(J(n))return re(fe(e),fe(n),t);if(B(n))return re(fe(e),n.toNumber(),t);if(null===n||n===F)return re(fe(e),0,t);if(L(n))return re(fe(e),fe(n),t)}return!!ie(e,n)&&("<="===t||">="===t)}function ie(e,n){if(e===n)return!0;if(null===e&&n===F||null===n&&e===F)return!0;if(B(e)&&B(n))return e.equals(n);if(e instanceof u)return e.equalityTest(n);if(e instanceof f)return e.equalityTest(n);if(e instanceof b&&n instanceof b){const t=e.cache._arcadeCacheId,r=n.cache._arcadeCacheId;if(null!=t)return t===r}if(W(e)&&W(n)){if(e._arcadeCacheId===n._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===n._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function oe(e,n){if(L(e))return e;if(null===e)return"";if(J(e))return ee(e,n);if(Y(e))return e.toString();if(B(e))return ne(e,n);if(e instanceof g)return JSON.stringify(e.toJSON());if(z(e)){const n=[];for(let t=0;t<e.length;t++)n[t]=ue(e[t]);return"["+n.join(",")+"]"}if(e instanceof s){const n=[];for(let t=0;t<e.length();t++)n[t]=ue(e.get(t));return"["+n.join(",")+"]"}return null!==e&&"object"==typeof e&&void 0!==e.castToText?e.castToText():O(e)?"object, Function":e===F?"":Z(e)?"object, Module":""}function le(e){const n=[];if(!z(e))return null;if(e instanceof s){for(let t=0;t<e.length();t++)n[t]=fe(e.get(t));return n}for(let t=0;t<e.length;t++)n[t]=fe(e[t]);return n}function se(e,n,t=!1){if(L(e))return e;if(null===e)return"";if(J(e))return ee(e,n);if(Y(e))return e.toString();if(B(e))return ne(e,n);if(e instanceof g)return e instanceof p?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+xe(e.spatialReference)+"}":xe(e.toJSON(),((e,n)=>e.key===n.key?0:"spatialReference"===e.key?1:"spatialReference"===n.key||e.key<n.key?-1:e.key>n.key?1:0));if(z(e)){const n=[];for(let r=0;r<e.length;r++)n[r]=ue(e[r],t);return"["+n.join(",")+"]"}if(e instanceof s){const n=[];for(let r=0;r<e.length();r++)n[r]=ue(e.get(r),t);return"["+n.join(",")+"]"}return null!==e&&"object"==typeof e&&void 0!==e.castToText?e.castToText(t):O(e)?"object, Function":e===F?"":Z(e)?"object, Module":""}function ue(e,n=!1){if(null===e)return"null";if(Y(e)||J(e)||L(e))return JSON.stringify(e);if(e instanceof g)return se(e,null,n);if(e instanceof s)return se(e,null,n);if(e instanceof Array)return se(e,null,n);if(B(e))return n?JSON.stringify(e.getTime()):JSON.stringify(ne(e,""));if(null!==e&&"object"==typeof e){if(void 0!==e.castToText)return e.castToText(n)}else if(e===F)return"null";return"null"}function fe(e,n){return J(e)?e:null===e||""===e?0:B(e)?NaN:Y(e)?e?1:0:z(e)||""===e||void 0===e?NaN:void 0!==n&&L(e)?(n=I(n,"‰",""),n=I(n,"¤",""),y(e,{pattern:n})):e===F?0:Number(e)}function ce(e,n){if(B(e))return e;if(L(e)){const r=de(e,n);if(r)return t.dateTimeToArcadeDate(r)}return null}function de(e,n){const t=/ (\d\d)/,a=r(n);let i=k.fromISO(e,{zone:a});return i.isValid||t.test(e)&&(e=e.replace(t,"T$1"),i=k.fromISO(e,{zone:n}),i.isValid)?i:null}function me(e){return Y(e)?e:L(e)?"true"===(e=e.toLowerCase()):!!J(e)&&(0!==e&&!isNaN(e))}function ye(e,n){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=n),e)}function pe(e){if(null===e)return null;if(e instanceof b)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof S){if(0===e.rings.length)return null;for(const n of e.rings)if(n.length>0)return e;return null}if(e instanceof x){if(0===e.paths.length)return null;for(const n of e.paths)if(n.length>0)return e;return null}return e instanceof h?0===e.points.length?null:e:e instanceof p?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function ge(e,n){if(!e)return n;if(!e.domain)return n;let t=null,r=null;if("string"===e.field.type||"esriFieldTypeString"===e.field.type)t=oe(n);else{if(null==n)return null;if(""===n)return n;t=fe(n)}for(let a=0;a<e.domain.codedValues.length;a++){const n=e.domain.codedValues[a];n.code===t&&(r=n)}return null===r?oe(n):r.name}function he(e,n){if(!e)return n;if(!e.domain)return n;let t=null;const r=oe(n);for(let a=0;a<e.domain.codedValues.length;a++){const n=e.domain.codedValues[a];n.name===r&&(t=n)}return null===t?n:t.code}function be(e,n,t=null,r=null){if(!n)return null;if(!n.fields)return null;let a,l,s=null;for(let i=0;i<n.fields.length;i++){const t=n.fields[i];t.name.toLowerCase()===e.toString().toLowerCase()&&(s=t)}if(null===s)throw new i(null,o.FieldNotFound,null,{key:e});if(null===r&&t&&n.typeIdField)r=t.hasField(n.typeIdField)?t.field(n.typeIdField):null;else if(n.typeIdField&&null!==r){let e=!1;for(const t of n.types||[])if(r===t.id){e=!0;break}if(!e)for(const t of n.types||[])if(r===t.name){r=t.id,e=!0;break}e||(r=null,t&&n.typeIdField&&(r=t.hasField(n.typeIdField)?t.field(n.typeIdField):null))}return null!=r&&n.types.some((e=>e.id===r&&(a=e.domains&&e.domains[s.name],a&&"inherited"===a.type&&(a=Se(s.name,n),l=!0),!0))),l||a||(a=Se(e,n)),{field:s,domain:a}}function Se(e,n){let t;return n.fields.some((n=>(n.name.toLowerCase()===e.toLowerCase()&&(t=n.domain),!!t))),t}function xe(e,n){n||(n={}),"function"==typeof n&&(n={cmp:n});const t="boolean"==typeof n.cycles&&n.cycles,r=n.cmp&&(a=n.cmp,function(e){return function(n,t){const r={key:n,value:e[n]},i={key:t,value:e[t]};return a(r,i)}});var a;const i=[];return function e(n){if(n&&n.toJSON&&"function"==typeof n.toJSON&&(n=n.toJSON()),void 0===n)return;if("number"==typeof n)return isFinite(n)?""+n:"null";if("object"!=typeof n)return JSON.stringify(n);let a,o;if(Array.isArray(n)){for(o="[",a=0;a<n.length;a++)a&&(o+=","),o+=e(n[a])||"null";return o+"]"}if(null===n)return"null";if(i.includes(n)){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const l=i.push(n)-1,s=Object.keys(n).sort(r&&r(n));for(o="",a=0;a<s.length;a++){const t=s[a],r=e(n[t]);r&&(o&&(o+=","),o+=JSON.stringify(t)+":"+r)}return i.splice(l,1),"{"+o+"}"}(e)}function Ne(e){if(null===e)return null;const n=[];for(const t of e)t&&t.arcadeDeclaredClass&&"esri.arcade.Feature"===t.arcadeDeclaredClass?n.push(t.geometry()):n.push(t);return n}function Me(e,n){if(!(n instanceof b))throw new i(null,o.InvalidParameter,null);e.push(n.hasZ?n.hasM?[n.x,n.y,n.z,n.m]:[n.x,n.y,n.z]:[n.x,n.y])}function ke(e,n){if(z(e)||q(e)){let t=!1,r=!1,a=[],l=n;if(z(e)){for(const n of e)Me(a,n);a.length>0&&(l=e[0].spatialReference,t=e[0].hasZ,r=e[0].hasM)}else if(e instanceof f)a=e._elements,a.length>0&&(t=e._hasZ,r=e._hasM,l=e.get(0).spatialReference);else{if(!q(e))throw new i(null,o.InvalidParameter,null);for(const n of e.toArray())Me(a,n);a.length>0&&(l=e.get(0).spatialReference,t=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}if(0===a.length)return null;return N(a)||(a=a.slice(0).reverse()),new S({rings:[a],spatialReference:l,hasZ:t,hasM:r})}return e}function je(e,n){if(z(e)||q(e)){let t=!1,r=!1,a=[],i=n;if(z(e)){for(const n of e)Me(a,n);a.length>0&&(i=e[0].spatialReference,t=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof f)a=e._elements,a.length>0&&(t=e._hasZ,r=e._hasM,i=e.get(0).spatialReference);else if(q(e)){for(const n of e.toArray())Me(a,n);a.length>0&&(i=e.get(0).spatialReference,t=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===a.length?null:new x({paths:[a],spatialReference:i,hasZ:t,hasM:r})}return e}function Ae(e,n){if(z(e)||q(e)){let t=!1,r=!1,a=[],i=n;if(z(e)){for(const n of e)Me(a,n);a.length>0&&(i=e[0].spatialReference,t=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof f)a=e._elements,a.length>0&&(t=e._hasZ,r=e._hasM,i=e.get(0).spatialReference);else if(q(e)){for(const n of e.toArray())Me(a,n);a.length>0&&(i=e.get(0).spatialReference,t=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===a.length?null:new h({points:a,spatialReference:i,hasZ:t,hasM:r})}return e}function Te(e,n=!1){const t=[];if(null===e)return t;if(!0===z(e)){for(let r=0;r<e.length;r++){const a=oe(e[r]);""===a&&!0!==n||t.push(a)}return t}if(e instanceof s){for(let r=0;r<e.length();r++){const a=oe(e.get(r));""===a&&!0!==n||t.push(a)}return t}if(w(e)){const r=oe(e);return""===r&&!0!==n||t.push(r),t}return[]}let De=0;function Fe(e){return De++,De%100==0?(De=0,new Promise((n=>{setTimeout((()=>{n(e)}),0)}))):e}function Ce(e,n,t){switch(t){case"&":return e&n;case"|":return e|n;case"^":return e^n;case"<<":return e<<n;case">>":return e>>n;case">>>":return e>>>n}}function Re(e,n=null){return null==e?null:Y(e)||J(e)||L(e)?e:e instanceof g?!0===n?.keepGeometryType?e:e.toJSON():e instanceof s?e.toArray().map((e=>Re(e,n))):e instanceof Array?e.map((e=>Re(e,n))):$(e)?e:B(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(n):null}async function Ie(e,n,t,r,a){const i=await Oe(e,n,t);a[r]=i}async function Oe(e,n=null,t=null){if(e instanceof s&&(e=e.toArray()),null==e)return null;if(w(e)||e instanceof g||$(e)||B(e))return Re(e,t);if(e instanceof Array){const r=[],a=[];for(const i of e)null===i||w(i)||i instanceof g||$(i)||B(i)?a.push(Re(i,t)):(a.push(null),r.push(Ie(i,n,t,a.length-1,a)));return r.length>0&&await Promise.all(r),a}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(n,t):null}function Ze(e){return we(e)?e.parent:e}function we(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function ve(e){return e&&"declaredClass"in e&&"esri.layers.SubtypeGroupLayer"===e.declaredClass}function _e(e,n,t){const r=Ze(e.fullSchema());if(null===r)return null;if(!r.fields)return null;return be(n,r,e,t)}function Le(e){const n=Ze(e.fullSchema());return null===n?null:n.fields&&n.typeIdField?{subtypeField:n.typeIdField,subtypes:n.types?n.types.map((e=>({name:e.name,code:e.id}))):[]}:null}function Ye(e,n,t,r){const a=Ze(e.fullSchema());if(null===a)return null;if(!a.fields)return null;const i=be(n,a,e,r);if(void 0===t)try{t=e.field(n)}catch(o){return null}return ge(i,t)}function Je(e,n,t,r){const a=Ze(e.fullSchema());if(null===a)return null;if(!a.fields)return null;if(void 0===t){try{t=e.field(n)}catch(i){return null}return t}return he(be(n,a,e,r),t)}function Pe(e){return e?.timeReference?.timeZone??"system"}function Ge(e){const n=Ze(e.fullSchema());if(null===n)return null;if(!n.fields)return null;const t=[];for(const r of n.fields)t.push(c(r));return{objectIdField:n.objectIdField,globalIdField:n.globalIdField??"",geometryType:void 0===d[n.geometryType]?"":d[n.geometryType],fields:t}}function ze(r,a){return"system"===r&&(r=t.systemTimeZoneCanonicalName),{version:Ee,engineVersion:n,timeZone:r,spatialReference:a.toJSON(),application:e.applicationName??"",engine:"web",locale:M()}}const Ee="1.23",Ve=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:T,ImplicitResultE:A,ReturnResult:D,ReturnResultE:j,absRound:X,arcadeVersion:Ee,autoCastArrayOfPointsToMultiPoint:Ae,autoCastArrayOfPointsToPolygon:ke,autoCastArrayOfPointsToPolyline:je,autoCastFeatureToGeometry:Ne,binaryOperator:Ce,breakResult:C,castAsJson:Re,castAsJsonAsync:Oe,continueResult:R,defaultExecutingContext:ze,defaultTimeZone:Pe,defaultUndefined:v,equalityTest:ie,featureDomainCodeLookup:Je,featureDomainValueLookup:Ye,featureFullDomain:_e,featureSchema:Ge,featureSubtypes:Le,fixNullGeometry:pe,fixSpatialReference:ye,formatDate:ne,formatNumber:ee,generateUUID:K,getDomain:be,getDomainCode:he,getDomainValue:ge,getType:_,greaterThanLessThan:ae,isArray:z,isBoolean:Y,isDate:B,isDictionary:H,isFeature:E,isFeatureSet:V,isFeatureSetCollection:U,isFunctionParameter:O,isGeometry:G,isImmutableArray:q,isInteger:P,isJsDate:$,isModule:Z,isNumber:J,isObject:W,isSimpleType:w,isString:L,isSubtypeGrouplayer:ve,isSubtypeSublayer:we,multiReplace:I,pcCheck:Q,stableStringify:xe,standardiseDateFormat:te,tick:Fe,toBoolean:me,toDate:ce,toNumber:fe,toNumberArray:le,toString:oe,toStringArray:Te,toStringExplicit:se,voidOperation:F},Symbol.toStringTag,{value:"Module"}));export{Fe as $,ie as A,Ce as B,Q as C,v as D,P as E,_ as F,Pe as G,te as H,T as I,X as J,pe as K,Ne as L,je as M,ke as N,Ae as O,I as P,K as Q,D as R,Ge as S,Le as T,_e as U,Ye as V,Je as W,ze as X,le as Y,ve as Z,we as _,Y as a,Te as a0,be as a1,ge as a2,he as a3,j as a4,A as a5,Z as a6,W as a7,$ as a8,ee as a9,ne as aa,xe as ab,Ee as ac,J as b,L as c,Re as d,Oe as e,w as f,fe as g,me as h,O as i,oe as j,B as k,ce as l,z as m,G as n,q as o,E as p,U as q,V as r,H as s,se as t,Ve as u,F as v,C as w,R as x,ye as y,ae as z};
|
package/core/HandleOwner.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as s}from"../chunks/tslib.es6.js";import e from"./Accessor.js";import r from"./Handles.js";import{property as t}from"./accessorSupport/decorators/property.js";import{subclass as o}from"./accessorSupport/decorators/subclass.js";import{
|
|
5
|
+
import{_ as s}from"../chunks/tslib.es6.js";import e from"./Accessor.js";import r from"./Handles.js";import{property as t}from"./accessorSupport/decorators/property.js";import{subclass as o}from"./accessorSupport/decorators/subclass.js";import{UpdatingHandles as n}from"./support/UpdatingHandles.js";const d=e=>{let d=class extends e{constructor(){super(...arguments),this._handles=new r,this._updatingHandles=new n}destroy(){this.destroyed||(this._handles.destroy(),this._updatingHandles.destroy())}get handles(){return this._handles}get updatingHandles(){return this._updatingHandles}};return s([t({readOnly:!0})],d.prototype,"handles",null),s([t({readOnly:!0})],d.prototype,"updatingHandles",null),d=s([o("esri.core.HandleOwner")],d),d};let a=class extends(d(e)){};a=s([o("esri.core.HandleOwner")],a);export{a as HandleOwner,d as HandleOwnerMixin};
|
package/core/promiseUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clock as t}from"./clock.js";import
|
|
5
|
+
import{clock as t}from"./clock.js";import n from"./Error.js";import{once as r}from"./events.js";import e from"./Logger.js";import{removeMaybe as o}from"./maybe.js";async function i(t,n){const r=t.slice(),e=await Promise.all(t.map(((t,r)=>n(t,r))));return r.filter(((t,n)=>e[n]))}function u(t="Aborted"){return new n("AbortError",t)}function c(t,n="Aborted"){if(l(t))throw u(n)}function s(t){return null!=t?"aborted"in t?t:t.signal:t}function l(t){const n=s(t);return null!=n&&n.aborted}function a(t){if(b(t))throw t}function f(t){if(!b(t))throw t}function m(t,n){const e=s(t);if(null!=e){if(!e.aborted)return r(e,"abort",(()=>n()));n()}}function h(t,n){const e=s(t);if(null!=e)return c(e),r(e,"abort",(()=>n(u())))}function w(t,n){return null==s(n)?t:new Promise(((r,e)=>{let i=m(n,(()=>e(u())));const c=()=>i=o(i);t.then(c,c),t.then(r,e)}))}function p(t,r,e){return Promise.race([t,P(r).then((()=>{throw new n("timeout",`Did not resolve within ${r} milliseconds (${e??"timeout"})`)}))])}function b(t){return"AbortError"===t?.name}async function d(t){try{return await t}catch(n){if(!b(n))throw n;return}}async function v(t,n=e.getLogger("esri")){try{return await t}catch(r){b(r)||n.error(r)}}async function y(t){if(!t)return;if("function"!=typeof t.forEach){const n=Object.keys(t),r=n.map((n=>t[n])),e=await y(r),o={};return n.map(((t,n)=>o[t]=e[n])),o}const n=t;return Promise.allSettled(n).then((t=>Array.from(n,((n,r)=>{const e=t[r];return"fulfilled"===e.status?{promise:n,value:e.value}:{promise:n,error:e.reason}}))))}async function j(t){return(await y(t)).filter((t=>!!t.value)).map((t=>t.value))}function P(t,n=void 0,r){const e=new AbortController;return m(r,(()=>e.abort())),new Promise(((r,o)=>{let i=setTimeout((()=>{i=0,r(n)}),t);m(e,(()=>{i&&(clearTimeout(i),o(u()))}))}))}function g(t,r,e,o){const i=e&&"abort"in e?e:null;null!=o||i||(o=e);let u=setTimeout((()=>{u=0,i&&i.abort()}),r);const c=()=>o||new n("promiseUtils:timeout","The wrapped promise did not resolve within "+r+" ms");return t.then((t=>{if(0===u)throw c();return clearTimeout(u),t}),(t=>{throw clearTimeout(u),0===u?c():t}))}function A(t){return t&&"function"==typeof t.then}function T(t){return A(t)?t:Promise.resolve(t)}function E(t,n=-1){let r,e,o,i,c=null;const s=(...l)=>{if(r){e=l,i&&i.reject(u()),i=k();const t=i.promise;if(c){const t=c;c=null,t.abort()}return t}if(o=i||k(),i=null,n>0){const e=new AbortController;r=T(t(...l,e.signal));const o=r;P(n).then((()=>{r===o&&(i?e.abort():c=e)}))}else r=1,r=T(t(...l));const a=()=>{const t=e;e=o=r=c=null,null!=t&&s(...t)},f=r,m=o;return f.then(a,a),f.then(m.resolve,m.reject),m.promise};return s}function k(){let n,r;const e=new Promise(((t,e)=>{n=t,r=e})),o=t=>{n(t)};return o.resolve=t=>n(t),o.reject=t=>r(t),o.timeout=(n,r)=>t.setTimeout((()=>o.reject(r)),n),o.promise=e,o}function C(t,n){return t.then(n,n)}function L(t,n){n.then(t.resolve,t.reject)}async function $(t){await Promise.resolve(),c(t)}export{P as after,C as always,u as createAbortError,k as createResolver,E as debounce,y as eachAlways,j as eachAlwaysValues,i as filter,d as ignoreAbortErrors,b as isAbortError,l as isAborted,A as isPromiseLike,v as logOnError,m as onAbort,h as onAbortOrThrow,L as settleWithPromise,a as throwIfAbortError,c as throwIfAborted,f as throwIfNotAbortError,g as timeout,$ as waitTick,T as when,w as whenOrAbort,p as whenOrTimeout};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as s}from"../../chunks/tslib.es6.js";import e from"../Accessor.js";import{makeHandle as t}from"../handleUtils.js";import{watch as i,when as n,on as d,sync as a}from"../reactiveUtils.js";import{schedule as r}from"../scheduling.js";import{property as o}from"../accessorSupport/decorators/property.js";import{subclass as l}from"../accessorSupport/decorators/subclass.js";let h=class extends e{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(s,e,t={}){return this._installWatch(s,e,t,i)}addWhen(s,e,t={}){return this._installWatch(s,e,t,n)}addOnCollectionChange(s,e,{initial:i=!1,final:n=!1}={}){const r=++this._handleId;return this.addHandles([d(s,"after-changes",this._createSyncUpdatingCallback(),a),d(s,"change",e,{onListenerAdd:i?s=>e({added:s.toArray(),removed:[]}):void 0,onListenerRemove:n?s=>e({added:[],removed:s.toArray()}):void 0})],r),t((()=>this.removeHandles(r)))}addPromise(s){if(null==s)return s;const e=++this._handleId;this.addHandles(t((()=>{this._pendingPromises.delete(s)&&(0!==this._pendingPromises.size||this.hasHandles(c)||this._set("updating",!1))})),e),this._pendingPromises.add(s),this._set("updating",!0);const i=()=>this.removeHandles(e);return s.then(i,i),s}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(s,e,i={},n){const d=++this._handleId;i.sync||this._installSyncUpdatingWatch(s,d);const a=n(s,e,i);return this.addHandles(a,d),t((()=>this.removeHandles(d)))}_installSyncUpdatingWatch(s,e){const t=this._createSyncUpdatingCallback(),n=i(s,t,{sync:!0,equals:()=>!1});return this.addHandles(n,e),n}_createSyncUpdatingCallback(){return()=>{this.removeHandles(c),++this._scheduleHandleId;const s=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles(r((()=>{s===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(c))})),c)}}};s([o({readOnly:!0})],h.prototype,"updating",void 0),h=s([l("esri.core.support.
|
|
5
|
+
import{_ as s}from"../../chunks/tslib.es6.js";import e from"../Accessor.js";import{makeHandle as t}from"../handleUtils.js";import{watch as i,when as n,on as d,sync as a}from"../reactiveUtils.js";import{schedule as r}from"../scheduling.js";import{property as o}from"../accessorSupport/decorators/property.js";import{subclass as l}from"../accessorSupport/decorators/subclass.js";let h=class extends e{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(s,e,t={}){return this._installWatch(s,e,t,i)}addWhen(s,e,t={}){return this._installWatch(s,e,t,n)}addOnCollectionChange(s,e,{initial:i=!1,final:n=!1}={}){const r=++this._handleId;return this.addHandles([d(s,"after-changes",this._createSyncUpdatingCallback(),a),d(s,"change",e,{onListenerAdd:i?s=>e({added:s.toArray(),removed:[]}):void 0,onListenerRemove:n?s=>e({added:[],removed:s.toArray()}):void 0})],r),t((()=>this.removeHandles(r)))}addPromise(s){if(null==s)return s;const e=++this._handleId;this.addHandles(t((()=>{this._pendingPromises.delete(s)&&(0!==this._pendingPromises.size||this.hasHandles(c)||this._set("updating",!1))})),e),this._pendingPromises.add(s),this._set("updating",!0);const i=()=>this.removeHandles(e);return s.then(i,i),s}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(s,e,i={},n){const d=++this._handleId;i.sync||this._installSyncUpdatingWatch(s,d);const a=n(s,e,i);return this.addHandles(a,d),t((()=>this.removeHandles(d)))}_installSyncUpdatingWatch(s,e){const t=this._createSyncUpdatingCallback(),n=i(s,t,{sync:!0,equals:()=>!1});return this.addHandles(n,e),n}_createSyncUpdatingCallback(){return()=>{this.removeHandles(c),++this._scheduleHandleId;const s=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles(r((()=>{s===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(c))})),c)}}};s([o({readOnly:!0})],h.prototype,"updating",void 0),h=s([l("esri.core.support.UpdatingHandles")],h);const c=-42;export{h as UpdatingHandles};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getAssetUrl as e}from"../../assets.js";import r from"../../config.js";import"../../intl.js";import{fullVersion as o}from"../../kernel.js";import has from"../has.js";import t from"../Logger.js";import{makeAbsolute as s}from"../urlUtils.js";import{loaderConfig as n}from"./loaderConfig.js";import{receiveMessage as i,MessageType as a}from"./utils.js";import l from"./WorkerFallback.js";import{getLocale as f}from"../../intl/locale.js";import{buildDate as c,commitHash as d}from"../../support/revision.js";const u=t.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:m}=a,p='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,s)=>{if(t){if(t.aborted)return s(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:ABORT,jobId:n}),s(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:s}),self.postMessage({type:INVOKE,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n??s}\\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case OPEN:let n;function t(e){const o=n.connect(e);self.postMessage({type:OPENED,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case RESPONSE:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let g,k;const h="Failed to create Worker. Fallback to execute module in main thread";async function w(){if(!has("esri-workers")
|
|
5
|
+
import{getAssetUrl as e}from"../../assets.js";import r from"../../config.js";import"../../intl.js";import{fullVersion as o}from"../../kernel.js";import has from"../has.js";import t from"../Logger.js";import{makeAbsolute as s}from"../urlUtils.js";import{loaderConfig as n}from"./loaderConfig.js";import{receiveMessage as i,MessageType as a}from"./utils.js";import l from"./WorkerFallback.js";import{getLocale as f}from"../../intl/locale.js";import{buildDate as c,commitHash as d}from"../../support/revision.js";const u=t.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:m}=a,p='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,s)=>{if(t){if(t.aborted)return s(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:ABORT,jobId:n}),s(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:s}),self.postMessage({type:INVOKE,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n??s}\\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case OPEN:let n;function t(e){const o=n.connect(e);self.postMessage({type:OPENED,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case RESPONSE:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let g,k;const h="Failed to create Worker. Fallback to execute module in main thread";async function w(){if(!has("esri-workers"))return y(new l);if(!g&&!k)try{const e=p.split('"{CONFIGURATION}"').join(`'${b()}'`);g=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(r){k=r||{}}let e;if(g)try{e=new Worker(g,{name:"esri-worker-"+v++})}catch(r){u.warn(h,k),e=new l}else u.warn(h,k),e=new l;return y(e)}async function y(e){return new Promise((r=>{function o(s){const n=i(s);n&&n.type===m&&(e.removeEventListener("message",o),e.removeEventListener("error",t),r(e))}function t(r){r.preventDefault(),e.removeEventListener("message",o),e.removeEventListener("error",t),u.warn("Failed to create Worker. Fallback to execute module in main thread",r),(e=new l).addEventListener("message",o),e.addEventListener("error",t)}e.addEventListener("message",o),e.addEventListener("error",t)}))}function b(){let t;if(null!=r.default){const e={...r};delete e.default,t=JSON.parse(JSON.stringify(e))}else t=JSON.parse(JSON.stringify(r));t.assetsPath=s(t.assetsPath),t.defaultAssetsPath=t.defaultAssetsPath?s(t.defaultAssetsPath):void 0,t.request.interceptors=[],t.log.interceptors=[],t.locale=f(),t.has={"esri-csp-restrictions":has("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":has("esri-2d-update-debug"),"esri-2d-log-updating":has("esri-2d-log-updating"),"featurelayer-pbf":has("featurelayer-pbf"),"featurelayer-simplify-thresholds":has("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":has("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":has("featurelayer-simplify-mobile-factor"),"esri-atomics":has("esri-atomics"),"esri-shared-array-buffer":has("esri-shared-array-buffer"),"esri-tiles-debug":has("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":has("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":has("feature-polyline-generalization-factor"),"host-webworker":1,"polylabel-placement-enabled":has("polylabel-placement-enabled")},t.workers.loaderUrl&&(t.workers.loaderUrl=s(t.workers.loaderUrl)),t.workers.workerPath?t.workers.workerPath=s(t.workers.workerPath):t.workers.workerPath=s(e("esri/core/workers/RemoteClient.js")),t.workers.useDynamicImport=!1;const i=r.workers.loaderConfig,a=n({baseUrl:i?.baseUrl,locale:f(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...i?.has},map:{...i?.map},paths:{...i?.paths},packages:i?.packages||[]}),l={buildDate:c,fullVersion:o,revision:d};return JSON.stringify({esriConfig:t,loaderConfig:a,kernelInfo:l})}let v=0;export{w as createWorker};
|