@arcgis/core 5.0.0-next.45 → 5.0.0-next.46
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/063045ac5553e91c0c4c.js +1 -0
- package/assets/esri/core/workers/chunks/{20ad34f9d45c64392022.js → 08c1ea29678da27136f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{5dc2f2e28c30386efadf.js → 10094eb2b94e98dd4a8a.js} +1 -1
- package/assets/esri/core/workers/chunks/169be08394c5e7703628.js +1 -0
- package/assets/esri/core/workers/chunks/1a6f3531ef3d671e0289.js +1 -0
- package/assets/esri/core/workers/chunks/{b809d499ff050976d9ed.js → 1c58064ea80e6a4a4a3b.js} +1 -1
- package/assets/esri/core/workers/chunks/1c816aff8613d1e4bf38.js +1 -0
- package/assets/esri/core/workers/chunks/{ee67c8a7c1f8b482cd99.js → 1ced78750c61600b2d4e.js} +1 -1
- package/assets/esri/core/workers/chunks/{98175b454e807b1a3c5f.js → 1e152a34e368bd810a0f.js} +1 -1
- package/assets/esri/core/workers/chunks/1e17ad6cdffa5016a3db.js +1 -0
- package/assets/esri/core/workers/chunks/1e2d42e9984ed3437ba2.js +1 -0
- package/assets/esri/core/workers/chunks/2008b22f76071a2dde4e.js +1 -0
- package/assets/esri/core/workers/chunks/2107c93d1fe87f3b8dfa.js +1 -0
- package/assets/esri/core/workers/chunks/2209550b6510e25da375.js +1 -0
- package/assets/esri/core/workers/chunks/229e1ed4282005aa0b83.js +1 -0
- package/assets/esri/core/workers/chunks/22b8eaa6afab0e5ffc47.js +1 -0
- package/assets/esri/core/workers/chunks/{1c0fb4795a52204882a8.js → 2550d2ba935cfdf30236.js} +1 -1
- package/assets/esri/core/workers/chunks/{49e6219dd08cb6c27023.js → 273ac1066095d63d6a6f.js} +1 -1
- package/assets/esri/core/workers/chunks/2e2867bc66c94aba7dc7.js +1 -0
- package/assets/esri/core/workers/chunks/{cda5c95fd49b8901f7d4.js → 3298e96d3f2e49e338d2.js} +1 -1
- package/assets/esri/core/workers/chunks/34613b288cf174983f8b.js +1 -0
- package/assets/esri/core/workers/chunks/{e5baa30944061418cb13.js → 35f086a2ae0585348ae6.js} +1 -1
- package/assets/esri/core/workers/chunks/{f441fc74451330384fb0.js → 37ea150dec5e491f691e.js} +1 -1
- package/assets/esri/core/workers/chunks/3c94db7ecdcd38eeb1b1.js +1 -0
- package/assets/esri/core/workers/chunks/3f7749f06ae54a4437d9.js +1 -0
- package/assets/esri/core/workers/chunks/40a722933af28823953b.js +1 -0
- package/assets/esri/core/workers/chunks/{7aa730e5ac7b268e3c98.js → 424daef7b5dec1b99aba.js} +1 -1
- package/assets/esri/core/workers/chunks/456684b1c1417ed0e611.js +1 -0
- package/assets/esri/core/workers/chunks/{d14e75b160aa432233c6.js → 461093ce28ceadd7853d.js} +1 -1
- package/assets/esri/core/workers/chunks/4a48b8ec5f3f2fd139b5.js +1 -0
- package/assets/esri/core/workers/chunks/4b084f985bc4100e7aec.js +1 -0
- package/assets/esri/core/workers/chunks/4b1de1fcd13677b615a8.js +1 -0
- package/assets/esri/core/workers/chunks/{31186e83fe009aa0fd36.js → 4d933de84afb2e3b7d18.js} +1 -1
- package/assets/esri/core/workers/chunks/{83aa39fbb1fad3b9d143.js → 4ff771942531fb2755c4.js} +1 -1
- package/assets/esri/core/workers/chunks/{e0017c6739d2532793e6.js → 513a4ef960e27500f986.js} +1 -1
- package/assets/esri/core/workers/chunks/56b693baa376bb990925.js +1 -0
- package/assets/esri/core/workers/chunks/{1d4ea8db272655c0608c.js → 57fd5e1260269002d18a.js} +1 -1
- package/assets/esri/core/workers/chunks/5fe40bb0e9ab333f6854.js +1 -0
- package/assets/esri/core/workers/chunks/{b56c07c0b43cb1999070.js → 60362c5651ef41fa7e5f.js} +1 -1
- package/assets/esri/core/workers/chunks/{e8a9971c8354569cb81d.js → 609919428305d8c8c243.js} +1 -1
- package/assets/esri/core/workers/chunks/{ab88577987cf2fe1cb32.js → 61373d2fa7e7638d3395.js} +1 -1
- package/assets/esri/core/workers/chunks/6202922b1c2637e9aaa5.js +1 -0
- package/assets/esri/core/workers/chunks/633368ae6fbb46373328.js +1 -0
- package/assets/esri/core/workers/chunks/6d702cb26cef46a76963.js +1 -0
- package/assets/esri/core/workers/chunks/{35272810c2ed04eb403d.js → 6f3943bebe2d5f4994f7.js} +1 -1
- package/assets/esri/core/workers/chunks/708aba69a1870ea41a61.js +1 -0
- package/assets/esri/core/workers/chunks/{7ba13b52fce1060fbb2a.js → 7147fc7502b385b302b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ba8a2e1c0fb4e1efc7c.js → 7364fb5e99933533890d.js} +1 -1
- package/assets/esri/core/workers/chunks/74b1028e95f7cfff387b.js +1 -0
- package/assets/esri/core/workers/chunks/78fccea3445fb2f9120a.js +1 -0
- package/assets/esri/core/workers/chunks/7ba31425caa404f86424.js +1 -0
- package/assets/esri/core/workers/chunks/{040f3d8e1099c4843390.js → 81a60dfa600b690098f9.js} +1 -1
- package/assets/esri/core/workers/chunks/833fd2bc42c5cb459084.js +1 -0
- package/assets/esri/core/workers/chunks/{75643711d9585ee26a15.js → 83c8e5a92d8d6193cb32.js} +1 -1
- package/assets/esri/core/workers/chunks/{e537e1d37f3fcb14fce2.js → 870022661376442411e4.js} +1 -1
- package/assets/esri/core/workers/chunks/898ab7db220e81e921c6.js +1 -0
- package/assets/esri/core/workers/chunks/{31b074ae2162a3508d2a.js → 8b578ffc3a83089aa782.js} +1 -1
- package/assets/esri/core/workers/chunks/{48c8ef4170e803a564d6.js → 8b75861196d1ce5cba63.js} +1 -1
- package/assets/esri/core/workers/chunks/8be61e13530fd0dc2fd1.js +1 -0
- package/assets/esri/core/workers/chunks/90b8ccee883738917a6d.js +1 -0
- package/assets/esri/core/workers/chunks/90bc9c299ae0e8b8b5e5.js +1 -0
- package/assets/esri/core/workers/chunks/91d9ade78854f40a962d.js +1 -0
- package/assets/esri/core/workers/chunks/{74881340e040bfd0580f.js → 934bc1028b287f8df4aa.js} +1 -1
- package/assets/esri/core/workers/chunks/96055de47831e59a28bf.js +1 -0
- package/assets/esri/core/workers/chunks/963ba863e0f87abfca25.js +1 -0
- package/assets/esri/core/workers/chunks/9aa8d60483ad905fe13b.js +1 -0
- package/assets/esri/core/workers/chunks/9fed9946241bb2a5cfa4.js +1 -0
- package/assets/esri/core/workers/chunks/a2662e98857f0abf8e82.js +1 -0
- package/assets/esri/core/workers/chunks/a5a9b0a35849b9f2e86d.js +1 -0
- package/assets/esri/core/workers/chunks/a60006c9ccf6817fc0d2.js +1 -0
- package/assets/esri/core/workers/chunks/a627b7eb94b7fca33210.js +1 -0
- package/assets/esri/core/workers/chunks/a651dc3b8f1fc1ab34cc.js +1 -0
- package/assets/esri/core/workers/chunks/{bf5f9da0837ed09729c6.js → aab93e885b6c7c6aa76e.js} +1 -1
- package/assets/esri/core/workers/chunks/adfe28c1c1619cdd3ca1.js +1019 -0
- package/assets/esri/core/workers/chunks/b88dc7d8ae105747e6a4.js +1 -0
- package/assets/esri/core/workers/chunks/b90c786dd474ea1a409c.js +1 -0
- package/assets/esri/core/workers/chunks/b92e9e5df8154a128982.js +1 -0
- package/assets/esri/core/workers/chunks/{9a855a10798348a21bab.js → bff814d34b38ec80c44d.js} +1 -1
- package/assets/esri/core/workers/chunks/c36d699a75b6e8fb93eb.js +1 -0
- package/assets/esri/core/workers/chunks/c50fdf723f2d4316862e.js +1 -0
- package/assets/esri/core/workers/chunks/{9461cc37ab3397265270.js → c5e8ff4721b15ac3c6eb.js} +1 -1
- package/assets/esri/core/workers/chunks/{4cda42b94e9cb58dd372.js → ca61077e0a598654f33f.js} +1 -1
- package/assets/esri/core/workers/chunks/{61a9ffd4cf07d8bb7a9b.js → ca81be5bdb88ef557bf3.js} +1 -1
- package/assets/esri/core/workers/chunks/{ca1c65eb7f5900c60170.js → cd8fec3500e6503ae020.js} +1 -1
- package/assets/esri/core/workers/chunks/ce90e8489143228262e7.js +1 -0
- package/assets/esri/core/workers/chunks/d0320ca67abca4f8b0d2.js +1 -0
- package/assets/esri/core/workers/chunks/{4b6a44c6265c8959abd8.js → d3db7244fac7398cc700.js} +1 -1
- package/assets/esri/core/workers/chunks/{19820cddba13a3585c0b.js → d561624ddb9388732b25.js} +1 -1
- package/assets/esri/core/workers/chunks/d65ca3b8fccae8c3c3fa.js +1 -0
- package/assets/esri/core/workers/chunks/{630eba99f48ea79a9560.js → d705410c369bd03b1875.js} +1 -1
- package/assets/esri/core/workers/chunks/{9c7682b300b877f60095.js → d76513a6260d9ec4ea25.js} +1 -1
- package/assets/esri/core/workers/chunks/d82e17522ed946c2d809.js +1 -0
- package/assets/esri/core/workers/chunks/d8dc130ea559be1f68c6.js +1 -0
- package/assets/esri/core/workers/chunks/{768ae52b4e5c3e571ef5.js → dc29cb16704e2e4d0a46.js} +1 -1
- package/assets/esri/core/workers/chunks/e8c2e2fbe9cef4c8a8c6.js +1 -0
- package/assets/esri/core/workers/chunks/{3f33708eb39c7169a226.js → f2ba50eb29f93df885d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{6e5d41f51572e3e7cf92.js → f7163048146ddaedfc36.js} +1 -1
- package/assets/esri/core/workers/chunks/fdaa10a588db394e2f65.js +1 -0
- package/chunks/Laserlines.glsl.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/vec32.js +1 -1
- package/config.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/geometry/FlatGeometry.js +1 -1
- package/geometry/operators/support/apiConverter.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/curves/circleUtils.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +122 -14
- package/kernel.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectSuppress.js +1 -1
- package/views/2d/interactive/SegmentLabels2D.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsParameters.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/glTF/loader.js +1 -1
- package/views/3d/interactive/SegmentLabels3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.d.ts +4 -0
- package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.js +5 -0
- package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +4 -0
- package/widgets/BatchAttributeForm/inputs/TextElementInput.js +5 -0
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/templates/GroupElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/TextElementTemplate.js +5 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureForm/TextElementInput.d.ts +2 -2
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMedia.js +5 -0
- package/widgets/PanoramicViewer/support/PanoramicMediaCollection.js +5 -0
- package/widgets/PanoramicViewer/support/PanoramicMediaError.js +5 -0
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.js +0 -1
- package/assets/esri/core/workers/chunks/1e0e7cef7ef947894bbe.js +0 -1019
- package/assets/esri/core/workers/chunks/20988e116f3723228f36.js +0 -1
- package/assets/esri/core/workers/chunks/2613e482450b57f2d4f5.js +0 -1
- package/assets/esri/core/workers/chunks/274f2b5e6dbc58505142.js +0 -1
- package/assets/esri/core/workers/chunks/27dfbe3d903b95d4c67a.js +0 -1
- package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +0 -1
- package/assets/esri/core/workers/chunks/2c4218306747f5d15575.js +0 -1
- package/assets/esri/core/workers/chunks/2db7a7607657f1d669f7.js +0 -1
- package/assets/esri/core/workers/chunks/3767617c0dfc7d801441.js +0 -1
- package/assets/esri/core/workers/chunks/44b6b7418cbf7f778bef.js +0 -1
- package/assets/esri/core/workers/chunks/4675ed3ca3e0104d00bf.js +0 -1
- package/assets/esri/core/workers/chunks/4df7cc3477bc46fc39af.js +0 -1
- package/assets/esri/core/workers/chunks/538ddb267aa328814865.js +0 -1
- package/assets/esri/core/workers/chunks/555a0ea44ba77819d493.js +0 -1
- package/assets/esri/core/workers/chunks/55818fe7a7aa1e5c8bbd.js +0 -1
- package/assets/esri/core/workers/chunks/5f781ef46ce7c4048c2f.js +0 -1
- package/assets/esri/core/workers/chunks/60f2de8dd8876bfd715a.js +0 -1
- package/assets/esri/core/workers/chunks/679088064420a906aa7f.js +0 -1
- package/assets/esri/core/workers/chunks/706423d801fa9cbf2e90.js +0 -1
- package/assets/esri/core/workers/chunks/71dd80231ea656a6380c.js +0 -1
- package/assets/esri/core/workers/chunks/725819839434c59102f3.js +0 -1
- package/assets/esri/core/workers/chunks/72cebf18da5ec5eeb666.js +0 -1
- package/assets/esri/core/workers/chunks/768d9b6eaba7bfa18dde.js +0 -1
- package/assets/esri/core/workers/chunks/77b45957cfe42523c1c8.js +0 -1
- package/assets/esri/core/workers/chunks/852de585a72d902344a6.js +0 -1
- package/assets/esri/core/workers/chunks/871dd5e1f016a04b8d98.js +0 -1
- package/assets/esri/core/workers/chunks/892c417f5130b003889d.js +0 -1
- package/assets/esri/core/workers/chunks/907083c427d7fb4354e9.js +0 -1
- package/assets/esri/core/workers/chunks/93c5f097bb7b380bb175.js +0 -1
- package/assets/esri/core/workers/chunks/9f0172b83f25ef5f8d40.js +0 -1
- package/assets/esri/core/workers/chunks/ae793d814cf32db9fbde.js +0 -1
- package/assets/esri/core/workers/chunks/b21cf62652ca772108c8.js +0 -1
- package/assets/esri/core/workers/chunks/c5c02ace54fe4ab9214b.js +0 -1
- package/assets/esri/core/workers/chunks/c82a974c8448407885e6.js +0 -1
- package/assets/esri/core/workers/chunks/d08ee45c501102deea20.js +0 -1
- package/assets/esri/core/workers/chunks/d239a4ef60e348cfb05a.js +0 -1
- package/assets/esri/core/workers/chunks/da2ba40bc017bff0fe49.js +0 -1
- package/assets/esri/core/workers/chunks/dc3a4ad62bc041a4f899.js +0 -1
- package/assets/esri/core/workers/chunks/e093e745708f722bc1b9.js +0 -1
- package/assets/esri/core/workers/chunks/e501d68a1464805c4b4e.js +0 -1
- package/assets/esri/core/workers/chunks/f3c232fc56a29d51196a.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[189,2027,3169,4161,5076,7373,8125],{4197:(t,e,n)=>{n.d(e,{Vj:()=>c,cj:()=>u,jh:()=>s,l5:()=>a,xm:()=>i});var r=n(34275),o=n(9093);function s(t){return t<=r.y9?new Array(t).fill(0):new Float64Array(t)}function i(t){return((0,r.iu)(t)?t.byteLength/8:t.length)<=r.y9?Array.from(t):new Float64Array(t)}function a(t,e,n){return Array.isArray(t)?t.slice(e,e+n):t.subarray(e,e+n)}function u(t){return[...t]}function c(t){const e=(0,o.vt)();for(let n=0;n<16;++n)e[n]=t[n];return e}},9093:(t,e,n)=>{function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function o(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}n.d(e,{o8:()=>o,vt:()=>r,zK:()=>s});const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:s,clone:o,create:r,fromValues:function(t,e,n,r,o,s,i,a,u,c,h,l,f,m,g,y){return[t,e,n,r,o,s,i,a,u,c,h,l,f,m,g,y]}},Symbol.toStringTag,{value:"Module"}))},69397:(t,e,n)=>{n.d(e,{$B:()=>o,Qf:()=>c,Qh:()=>a,RS:()=>s,ez:()=>f,lM:()=>i,qK:()=>l});var r=n(34275);function o(t){return 32+t.length}const s=16;function i(t){if(!t)return 0;let e=l;for(const n in t)t.hasOwnProperty(n)&&(e+=u(t[n],!1));return e}function a(t){if(!t)return 0;if("number"==typeof t[0])return c(t);if(Array.isArray(t))return function(t){const e=t.length;if(0===e||"number"==typeof t[0])return h(t,8);let n=f;for(let r=0;r<e;r++)n+=u(t[r]);return n}(t);let e=l;for(const n in t)t.hasOwnProperty(n)&&(e+=u(t[n]));return e}function u(t,e=!0){switch(typeof t){case"object":return e?a(t):l;case"string":return o(t);case"number":return s;case"boolean":return 4;default:return 8}}function c(...t){return t.reduce((t,e)=>t+(e?(0,r.iu)(e)?e.byteLength+m:Array.isArray(e)?h(e,s):0:0),0)}function h(t,e){return f+t.length*e}const l=32,f=16,m=145},70328:(t,e,n)=>{n.d(e,{BI:()=>d,DC:()=>l,Ej:()=>m,Ie:()=>x,Jt:()=>M,Ne:()=>g,RF:()=>h,aI:()=>G,fA:()=>i,gE:()=>u,hZ:()=>p,iT:()=>f,is:()=>v,qv:()=>C,vI:()=>y,vY:()=>a,v_:()=>I,vt:()=>s,w1:()=>c});var r=n(5443),o=(n(19419),n(4197));function s(t=I){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function i(t,e,n,r,o,i,a=s()){return a[0]=t,a[1]=e,a[2]=n,a[3]=r,a[4]=o,a[5]=i,a}function a(t,e=s()){return function(t,e,n,r=s()){return p(r,C),function(t,e,n=0,r=e.length/3){let o=t[0],s=t[1],i=t[2],a=t[3],u=t[4],c=t[5];for(let t=0;t<r;t++)o=Math.min(o,e[n+3*t]),s=Math.min(s,e[n+3*t+1]),i=Math.min(i,e[n+3*t+2]),a=Math.max(a,e[n+3*t]),u=Math.max(u,e[n+3*t+1]),c=Math.max(c,e[n+3*t+2]);t[0]=o,t[1]=s,t[2]=i,t[3]=a,t[4]=u,t[5]=c}(r,t,e,n),r}(t,0,t.length/3,e)}function u(t,e=(0,o.jh)(24)){const[n,r,s,i,a,u]=t;return e[0]=n,e[1]=r,e[2]=s,e[3]=n,e[4]=r,e[5]=u,e[6]=n,e[7]=a,e[8]=s,e[9]=n,e[10]=a,e[11]=u,e[12]=i,e[13]=r,e[14]=s,e[15]=i,e[16]=r,e[17]=u,e[18]=i,e[19]=a,e[20]=s,e[21]=i,e[22]=a,e[23]=u,e}function c(t,e){const n=isFinite(t[2])||isFinite(t[5]);return new r.A(n?{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],zmin:t[2],zmax:t[5],spatialReference:e}:{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],spatialReference:e})}function h(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2]),t[3]=Math.max(t[3],e[3]),t[4]=Math.max(t[4],e[4]),t[5]=Math.max(t[5],e[5])}function l(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[3]=Math.max(t[3],e[2]),t[4]=Math.max(t[4],e[3])}function f(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2]),t[3]=Math.max(t[3],e[0]),t[4]=Math.max(t[4],e[1]),t[5]=Math.max(t[5],e[2])}function m(t,e=[0,0,0]){return e[0]=function(t){return t[0]>=t[3]?0:t[3]-t[0]}(t),e[1]=function(t){return t[1]>=t[4]?0:t[4]-t[1]}(t),e[2]=function(t){return t[2]>=t[5]?0:t[5]-t[2]}(t),e}function g(t,e,n=t){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n!==t&&(n[3]=t[3],n[4]=t[4],n[5]=t[5]),n}function y(t,e,n=t){return n[3]=e[0],n[4]=e[1],n[5]=e[2],n!==t&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),t}function p(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function x(t){return t?p(t,C):s(C)}function M(t,e){return t[0]=e[0],t[1]=e[1],t[2]=Number.NEGATIVE_INFINITY,t[3]=e[2],t[4]=e[3],t[5]=Number.POSITIVE_INFINITY,t}function d(t,e,n,r,o){return t[0]=e,t[1]=n,t[2]=Number.NEGATIVE_INFINITY,t[3]=r,t[4]=o,t[5]=Number.POSITIVE_INFINITY,t}function v(t){return 6===t.length}function G(t,e,n){if(null==t||null==e)return t===e;if(!v(t)||!v(e))return!1;if(n){for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1}else for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}const C=[1/0,1/0,1/0,-1/0,-1/0,-1/0],I=[0,0,0,0,0,0];s()},76061:(t,e,n)=>{n.d(e,{G:()=>r,S:()=>o});class r{*[Symbol.iterator](){let t=this.next();for(;t;)yield t,t=this.next()}}class o extends r{constructor(t){super(),this.m_iGeom=-1,this.m_aGeoms=t?t.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const t=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,t}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},78125:(t,e,n)=>{n.r(e),n.d(e,{fromExtent:()=>M,fromGeometry:()=>x,fromMultipoint:()=>d,fromPoint:()=>v,fromPolygon:()=>G,fromPolyline:()=>C,fromPolylineUsingImportOperator:()=>I,fromSpatialReference:()=>w,getSpatialReference:()=>p,toExtent:()=>V,toGeometry:()=>P,toMultipoint:()=>A,toPoint:()=>R,toPolygon:()=>Z,toPolyline:()=>_});var r=n(83661),o=(n(79187),n(55537)),s=n(95213),i=n(88885),a=n(5443),u=n(48526),c=n(86738),h=n(39829),l=n(82799),f=(n(90293),n(34772));const m="_gxVersion",g=2,y=1;function p(t){return Array.isArray(t)?t[0].spatialReference:t.spatialReference}function x(t){switch(t.type){case"point":return v(t);case"multipoint":return d(t);case"polyline":return C(t);case"polygon":return G(t);case"extent":return M(t);default:throw new Error(`Unsupported geometry type: ${t.type}`)}}function M(t){if(!t.getCacheValue(m)){const e=new s.E;e.setCoords(t.xmin,t.ymin,t.xmax,t.ymax),t.hasM&&e.setInterval(g,0,t.mmin,t.mmax),t.hasZ&&e.setInterval(y,0,t.zmin,t.zmax),t.setCacheValue(m,e)}return t.getCacheValue(m)}function d(t){if(!t.getCacheValue(m)){const e=new i.M,n=new s.P,r=t.points,o=t.hasM,a=t.hasZ,u=a?3:2;for(let t=0,s=r.length;t<s;t++){const s=r[t];n.setXYCoords(s[0],s[1]),a&&n.setZ(s[2]??0),o&&n.setM(s[u]??NaN),e.add(n)}t.setCacheValue(m,e)}return t.getCacheValue(m)}function v(t){if(!t.getCacheValue(m)){const e=new s.P;e.setXYCoords(t.x,t.y),t.hasM&&e.setM(t.m),t.hasZ&&e.setZ(t.z),t.setCacheValue(m,e)}return t.getCacheValue(m)}function G(t){if(!t.getCacheValue(m)){const{curveRings:e,hasM:n,hasZ:r,rings:o}=t,s=(0,f.fromGeometryToGXGeometry)({curveRings:e,hasM:n,hasZ:r,rings:o});t.setCacheValue(m,s)}return t.getCacheValue(m)}function C(t){if(!t.getCacheValue(m)){const{curvePaths:e,hasM:n,hasZ:r,paths:o}=t,s=(0,f.fromGeometryToGXGeometry)({curvePaths:e,hasM:n,hasZ:r,paths:o});t.setCacheValue(m,s)}return t.getCacheValue(m)}function I(t){if(!t.getCacheValue(m)){const{curvePaths:e,hasM:n,hasZ:r,paths:o}=t,s=(0,f.fromGeometryToGXGeometryUsingImportOperator)({curvePaths:e,hasM:n,hasZ:r,paths:o});t.setCacheValue(m,s)}return t.getCacheValue(m)}function w(t){return(0,f.fromSpatialReference)(t)}function P(t,e){if(t)switch(t.getGeometryType()){case o.G.enumPoint:return R(t,e);case o.G.enumEnvelope:return V(t,e);case o.G.enumMultiPoint:return A(t,e);case o.G.enumPolyline:return _(t,e);case o.G.enumPolygon:return Z(t,e)}return null}function V(t,e){if(t.isEmpty())return null;const n=new a.A({xmin:t.getXMin(),ymin:t.getYMin(),xmax:t.getXMax(),ymax:t.getYMax(),spatialReference:e}),r=t.getDescription();if(r.hasM()){const e=t.queryInterval(g,0);n.mmin=e.vmin,n.mmax=e.vmax}if(r.hasZ()){const e=t.queryInterval(y,0);n.zmin=e.vmin,n.zmax=e.vmax}return n.setCacheValue(m,t),n}function A(t,e){if(t.isEmpty())return null;const n=t.getDescription(),r=n.hasM(),o=n.hasZ(),i=[],a=new s.P;for(let e=0,n=t.getPointCount();e<n;e++){t.getPointByVal(e,a);const n=[a.getX(),a.getY()];o&&n.push(a.getZ()),r&&n.push(a.getM()),i.push(n)}const c=new u.A({hasM:r,hasZ:o,points:i,spatialReference:e});return c.setCacheValue(m,t),c}function R(t,e){if(t instanceof r.P)return new c.A({x:t.x,y:t.y,spatialReference:e});if(t.isEmpty())return null;const n=new c.A({x:t.getX(),y:t.getY(),spatialReference:e}),o=t.getDescription();return o.hasM()&&(n.m=t.getM()),o.hasZ()&&(n.z=t.getZ()),n.setCacheValue(m,t),n}function Z(t,e){if(t.isEmpty())return null;const n=h.A.fromJSON({...(0,f.toGeometry)(t,null),spatialReference:e});return n.setCacheValue(m,t),n}function _(t,e){if(t.isEmpty())return null;const n=l.A.fromJSON({...(0,f.toGeometry)(t,null),spatialReference:e});return n.setCacheValue(m,t),n}},85503:(t,e,n)=>{n.d(e,{d:()=>h,e:()=>u});var r=n(4576),o=n(34727),s=n(86211),i=n(91735),a=n(78125);function u(t,e,n={}){let{maxAngleInDegrees:r=0,maxDeviation:u=0,unit:c}=n;const h=(0,a.getSpatialReference)(t);return c&&(e=(0,s.UW)(e,c,h),u&&(u=(0,s.UW)(u,c,h))),(0,a.toGeometry)((0,i.g7)((0,a.fromGeometry)(t),e,u,(0,o.kU)(r)),h)}const c=(0,i.fz)(),h=Object.freeze(Object.defineProperty({__proto__:null,execute:u,executeMany:function(t,e,n={}){let{maxAngleInDegrees:u=0,maxDeviation:c=0,unit:h}=n;const l=t.map(a.fromGeometry),f=(0,a.getSpatialReference)(t);return h&&(e=(0,s.UW)(e,h,f),c&&(c=(0,s.UW)(c,h,f))),(0,i.zo)(l,e,c,(0,o.kU)(u)).map(t=>(0,a.toGeometry)(t,f)).filter(r.Ru)},supportsCurves:c},Symbol.toStringTag,{value:"Module"}))},88411:(t,e,n)=>{n.d(e,{execute:()=>r.e}),n(4576),n(34727),n(86211),n(91735),n(78125);var r=n(85503)},91735:(t,e,n)=>{n.d(e,{fz:()=>a,g7:()=>s,zo:()=>i});var r=n(76061);const o=new(n(5247).O);function s(t,e,n,r){return o.execute(t,e,n,r,null)}function i(t,e,n,s){const i=o.executeMany(new r.S(t),e,n,s,null);return Array.from(i)}function a(){return o.supportsCurves()}},92722:(t,e,n)=>{n.d(e,{A:()=>o});var r=n(69397);class o{constructor(t=[],e=[],n=!1,r=!1){this.lengths=t??[],this.coords=e??[],this.hasZ=n,this.hasM=r}static fromJSON({lengths:t,coords:e,hasZ:n,hasM:r}){return new o(t,e,n||!1,r||!1)}static fromRect([t,e,n,r]){const s=n-t,i=r-e;return new o([5],[t,e,s,0,0,i,-s,0,0,-i])}get isPoint(){return 0===this.lengths.length&&this.coords.length>=2}get maxLength(){return Math.max(...this.lengths)}get size(){return this.isPoint?1:this.lengths.reduce((t,e)=>t+e,0)}get usedMemory(){return 64+(0,r.Qf)(this.lengths,this.coords)}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}area(){if(this.isPoint)return 0;let t=0,e=0;for(const n of this.lengths){if(n<3)continue;const{stride:r}=this;let o=this.coords[r*e],s=this.coords[r*e+1];for(let i=1;i<n;i+=1){const n=r*(e+i),a=this.coords[n],u=this.coords[n+1];t+=-.5*(a-o)*(u+s),o=a,s=u}e+=n}return t}forEachVertex(t){let e=0;if(this.isPoint)return t(this.coords[0],this.coords[1]);const{stride:n}=this;for(const r of this.lengths){for(let o=0;o<r;o++){const r=n*(e+o);t(this.coords[r],this.coords[r+1])}e+=r}}deltaDecode(){const t=this.clone(),{coords:e,lengths:n}=t;let r=0;const{stride:o}=this;for(const t of n){for(let n=1;n<t;n++){const t=o*(r+n);e[t]+=e[t-o],e[t+1]+=e[t+1-o]}r+=t}return t}clone(t){if(this.isPoint)return new o([],Array.from(this.coords.slice(0,this.stride)),this.hasZ,this.hasM);const e=Array.from(this.lengths),{stride:n,size:r}=this,s=this.coords.slice(0,r*n);return t?(t.set(s),new o(e,t)):new o(e,Array.from(s),this.hasZ,this.hasM)}justXY(){const{stride:t,size:e}=this;if(2===t)return this;const n=new Array(e*t);for(let e=0,r=0;e<n.length;e+=t)n[r++]=this.coords[e],n[r++]=this.coords[e+1];return new o(this.lengths,n,!1,!1)}}}}]);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{deg2rad as e}from"../core/mathUtils.js";import{set as i}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as n,e as a,n as o,b as r,
|
|
5
|
+
import{deg2rad as e}from"../core/mathUtils.js";import{set as i}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as n,e as a,n as o,b as r,D as l,d as s,f as c,i as d}from"./vec32.js";import{create as f}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as p}from"./vec42.js";import{create as g}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{pointAt as h}from"../geometry/support/lineSegment.js";import{fromPositionAndNormal as m,create as u}from"../geometry/support/plane.js";import{Laserline as w}from"../views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js";import{ScreenSpacePass as x}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{Float2PassUniform as b}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3BindUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as P}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as D}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatBindUniform as M}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as S}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as C}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{ShaderBuilder as L}from"../views/webgl/ShaderBuilder.js";const A=e(6);function j(e){const i=new L;i.include(x),i.include(w,e);const t=i.fragment;if(e.lineVerticalPlaneEnabled||e.heightManifoldEnabled)if(t.uniforms.add(new S("maxPixelDistance",(i,t)=>e.heightManifoldEnabled?2*t.camera.computeScreenPixelSizeAt(i.heightManifoldTarget):2*t.camera.computeScreenPixelSizeAt(i.lineVerticalPlaneSegment.origin))),t.code.add(C`float planeDistancePixels(vec4 plane, vec3 pos) {
|
|
6
6
|
float dist = dot(plane.xyz, pos) + plane.w;
|
|
7
7
|
float width = fwidth(dist);
|
|
8
8
|
dist /= min(width, maxPixelDistance);
|
package/chunks/boundedPlane.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../core/has.js";import s from"../core/Logger.js";import{acosClamped as t}from"../core/mathUtils.js";import{ObjectStack as i}from"../core/ObjectStack.js";import{invert as n,transpose as r,fromRotation as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as a,j as c,i as u,h as g,
|
|
5
|
+
import"../core/has.js";import s from"../core/Logger.js";import{acosClamped as t}from"../core/mathUtils.js";import{ObjectStack as i}from"../core/ObjectStack.js";import{invert as n,transpose as r,fromRotation as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as a,j as c,i as u,h as g,D as b,b as f,E as p,g as l,e as m,m as d,p as j,F as h,n as I}from"./vec32.js";import{fromValues as y,clone as v,create as P}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as N}from"../geometry/support/aaBoundingRect.js";import{projectPointClamp as w,distance2 as x,create as M}from"../geometry/support/lineSegment.js";import{create as S,wrap as T,copy as V,fromVectorsAndPoint as A,fromValues as E,intersectRay as _,intersectLineSegment as O,intersectLineSegmentClamp as F,isPointInside as k,projectPoint as R,getNormal as q,setOffsetFromPoint as B}from"../geometry/support/plane.js";import{distance2 as C}from"../geometry/support/ray.js";import{projectPointSignedLength as Y}from"../geometry/support/vector.js";import{sv3d as L}from"../geometry/support/vectorStacks.js";const U=()=>s.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function z(s=Ns){return{plane:S(s.plane),origin:v(s.origin),basis1:v(s.basis1),basis2:v(s.basis2)}}function D(s,t,i){const n=Ss.get();return n.origin=s,n.basis1=t,n.basis2=i,n.plane=T(0,0,0,0),J(n),n}function G(s,t=z()){return H(s.origin,s.basis1,s.basis2,t)}function W(s,t){a(t.origin,s.origin),a(t.basis1,s.basis1),a(t.basis2,s.basis2),V(t.plane,s.plane)}function H(s,t,i,n=z()){return a(n.origin,s),a(n.basis1,t),a(n.basis2,i),J(n),vs(n,"fromValues()"),n}function J(s){A(s.basis2,s.basis1,s.origin,s.plane)}function K(s,t,i){s!==i&&G(s,i);const n=c(L.get(),ds(s),t);return u(i.origin,i.origin,n),i.plane[3]-=t,i}function Q(s,t,i){return Z(t,i),K(i,bs(s,s.origin),i),i}function X(s,t){const i=s.basis1[0],n=s.basis2[1],[r,e]=s.origin;return N(r-i,e-n,r+i,e+n,t)}function Z(s,t=z()){const i=(s[2]-s[0])/2,n=(s[3]-s[1])/2;return g(t.origin,s[0]+i,s[1]+n,0),g(t.basis1,i,0,0),g(t.basis2,0,n,0),E(0,0,1,0,t.plane),t}function $(s,t,i){return!!_(s.plane,t,i)&&hs(s,i)}function ss(s,t,i){if($(s,t,i))return i;const n=ts(s,t,L.get());return u(i,t.origin,c(L.get(),t.direction,b(t.origin,n)/f(t.direction))),i}function ts(s,i,n){const r=ws.get();Ps(s,i,r,ws.get());let e=Number.POSITIVE_INFINITY;for(const o of Ts){const c=ys(s,o,xs.get()),u=L.get();if(O(r,c,u)){const s=p(L.get(),i.origin,u),r=Math.abs(t(l(i.direction,s)));r<e&&(e=r,a(n,u))}}return e===Number.POSITIVE_INFINITY?ns(s,i,n):n}function is(s,t){return(t-s)/t}function ns(s,t,i){if($(s,t,i))return i;const n=ws.get(),r=ws.get();Ps(s,t,n,r);let e=Number.POSITIVE_INFINITY;for(const o of Ts){const c=ys(s,o,xs.get()),u=L.get();if(F(n,c,u)){const s=C(t,u);if(!k(r,u))continue;s<e&&(e=s,a(i,u))}}return os(s,t.origin)<e&&rs(s,t.origin,i),i}function rs(s,t,i){const n=R(s.plane,t,L.get()),r=w(Is(s,s.basis1),n,-1,1,L.get()),e=w(Is(s,s.basis2),n,-1,1,L.get());return m(i,u(L.get(),r,e),s.origin),i}function es(s,t,i){const{origin:n,basis1:r,basis2:e}=s,o=m(L.get(),t,n),a=Y(r,o),c=Y(e,o),u=Y(ds(s),o);return g(i,a,c,u)}function os(s,t){const i=es(s,t,L.get()),{basis1:n,basis2:r}=s,e=f(n),o=f(r),a=Math.max(Math.abs(i[0])-e,0),c=Math.max(Math.abs(i[1])-o,0),u=i[2];return a*a+c*c+u*u}function as(s,t){return Math.sqrt(os(s,t))}function cs(s,t){let i=Number.NEGATIVE_INFINITY;for(const n of Ts){const r=ys(s,n,xs.get()),e=x(r,t);e>i&&(i=e)}return Math.sqrt(i)}function us(s,t){return k(s.plane,t)&&hs(s,t)}function gs(s,t,i,n){return js(s,i,n)}function bs(s,t){const i=-s.plane[3];return Y(ds(s),t)-i}function fs(s,t,i,n){const r=bs(s,t),e=c(Ms,ds(s),i-r);return u(n,t,e),n}function ps(s,t){return d(s.basis1,t.basis1)&&d(s.basis2,t.basis2)&&d(s.origin,t.origin)}function ls(s,t,i){return s!==i&&G(s,i),n(Vs,t),r(Vs,Vs),j(i.basis1,s.basis1,Vs),j(i.basis2,s.basis2,Vs),j(q(i.plane),q(s.plane),Vs),j(i.origin,s.origin,t),B(i.plane,i.plane,i.origin),i}function ms(s,t,i,n){return s!==n&&G(s,n),e(As,t,i),j(n.basis1,s.basis1,As),j(n.basis2,s.basis2,As),J(n),n}function ds(s){return q(s.plane)}function js(s,t,i){switch(t){case 0:a(i,s.basis1),I(i,i);break;case 1:a(i,s.basis2),I(i,i);break;case 2:a(i,ds(s))}return i}function hs(s,t){const i=m(L.get(),t,s.origin),n=h(s.basis1),r=h(s.basis2),e=l(s.basis1,i),o=l(s.basis2,i);return-e-n<0&&e-n<0&&-o-r<0&&o-r<0}function Is(s,t){const i=xs.get();return a(i.origin,s.origin),a(i.vector,t),i}function ys(s,t,i){const{basis1:n,basis2:r,origin:e}=s,o=c(L.get(),n,t.origin[0]),a=c(L.get(),r,t.origin[1]);u(i.origin,o,a),u(i.origin,i.origin,e);const g=c(L.get(),n,t.direction[0]),b=c(L.get(),r,t.direction[1]);return c(i.vector,u(g,g,b),2),i}function vs(s,t){Math.abs(l(s.basis1,s.basis2)/(f(s.basis1)*f(s.basis2)))>1e-6&&U().warn(t,"Provided basis vectors are not perpendicular"),Math.abs(l(s.basis1,ds(s)))>1e-6&&U().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-l(ds(s),s.origin)-s.plane[3])>1e-6&&U().warn(t,"Plane offset is not consistent with plane origin")}function Ps(s,t,i,n){const r=ds(s);A(r,t.direction,t.origin,i),A(q(i),r,t.origin,n)}const Ns={plane:S(),origin:y(0,0,0),basis1:y(1,0,0),basis2:y(0,1,0)},ws=new i(S),xs=new i(M),Ms=P(),Ss=new i(()=>z()),Ts=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],Vs=o(),As=o(),Es=Object.freeze(Object.defineProperty({__proto__:null,altitudeAt:bs,axisAt:gs,cameraFrustumCoverage:is,closestPoint:ns,closestPointOnSilhouette:ts,copy:G,copyWithoutVerify:W,create:z,distance:as,distance2:os,distanceToSilhouette:cs,elevate:K,equals:ps,extrusionContainsPoint:us,fromAABoundingRect:Z,fromValues:H,getExtent:X,intersectRay:$,intersectRayClosestSilhouette:ss,normal:ds,projectPoint:rs,projectPointLocal:es,rotate:ms,setAltitudeAt:fs,setExtent:Q,transform:ls,up:Ns,updateUnboundedPlane:J,wrap:D},Symbol.toStringTag,{value:"Module"}));export{gs as A,bs as B,fs as C,Ns as D,z as a,Es as b,is as c,G as d,us as e,H as f,ps as g,Z as h,$ as i,as as j,W as k,K as l,X as m,ds as n,ss as o,ts as p,ns as q,ms as r,Q as s,ls as t,J as u,rs as v,D as w,es as x,os as y,cs as z};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{cyclical2PI as e}from"../core/Cyclical.js";import{deg2rad as t,rad2deg as r,asinClamped as o,lerp as s,clamp as n}from"../core/mathUtils.js";import{fromRotation as a,rotate as i}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{f as l,g as m,n as p,p as u,q as f,b as h,j as g,
|
|
5
|
+
import{cyclical2PI as e}from"../core/Cyclical.js";import{deg2rad as t,rad2deg as r,asinClamped as o,lerp as s,clamp as n}from"../core/mathUtils.js";import{fromRotation as a,rotate as i}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{f as l,g as m,n as p,p as u,q as f,b as h,j as g,D as d,l as y,w as M,c as j}from"./vec32.js";import{fromValues as b,create as v,ZEROS as x,clone as T}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as w,d as C}from"./vec42.js";import{create as R}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{getEpsilon as S}from"../core/libs/gl-matrix-2/math/common.js";import{getReferenceEllipsoid as U}from"../geometry/ellipsoidUtils.js";import P from"../geometry/Extent.js";import q from"../geometry/Polygon.js";import H from"../geometry/SpatialReference.js";import{isClockwise as I}from"../geometry/support/coordsUtils.js";import{fromPoints as A,create as E}from"../geometry/support/lineSegment.js";import{gcsCyclical as k}from"../geometry/support/normalizeUtils.js";import{fromPositionAndNormal as F,create as _,isPointInside as z,intersectLineOrRay as G,getNormal as W}from"../geometry/support/plane.js";import{wrap as D}from"../geometry/support/ray.js";import{Sphere as O}from"../geometry/support/sphere.js";import{geographicToWebMercator as L}from"../geometry/support/webMercatorUtils.js";import{Frustum as N}from"../views/3d/state/Frustum.js";import{minNearDistanceInMeters as B}from"../views/3d/state/NearFarHeuristic.js";import{createDirectionUp as J,directionToHeadingTilt as K,clampLineSegmentToPlane as Q}from"../views/3d/support/cameraUtilsInternal.js";import{getLonDeltaForDistance as V}from"../views/3d/support/earthUtils.js";import{slerp as X}from"../views/3d/support/mathUtils.js";const Y=b(0,0,1),Z=p(v(),b(1,1,1)),$=c(),ee=v(),te=v();function re(e,r,o,s=J()){l(ee,e,Y),0===m(ee,ee)&&l(ee,e,Z),a($,-t(r),e),i($,$,-t(o),ee);const{up:n,direction:c}=s;return l(n,ee,e),p(n,n),u(n,n,$),p(c,e),f(c,c),u(c,c,$),s}function oe(e,t,r,o){const s=ee,n=te;return p(s,e),l(te,s,Y),0===m(te,te)&&l(te,s,Z),l(n,te,s),K(t,r,o,s,n)}function se(e,r,s,n){const a={eye:v(),up:null,tilt:n,heading:s},i=ee;i[0]=e[0],i[1]=e[2],i[2]=-e[1];const c=r,l=t(s),m=t(n),p=Math.sin(l),u=Math.cos(l),f=Math.sin(m),d=Math.cos(m),y=h(i);let M;if(Math.abs(m)<1e-8)M=c+y;else{const e=y/f,t=o(c/e),r=Math.PI-m-t;M=e*Math.sin(r)}const j=d*c,b=c*c*(f*f),x=u*u*b,T=M-j,w=T*T,C=x*(x+w-i[1]*i[1]);if(C<0)return g(a.eye,i,M/y),a.tilt=0,ae(a,e);const R=Math.sqrt(C),S=i[1]*T,U=x+w;let P;if(P=u>0?-R+S:R+S,Math.abs(U)<1e-8)return y<1e-8?(a.eye[0]=0,a.eye[1]=0,a.eye[2]=c):g(a.eye,i,M/y),a.tilt=0,ne(a.eye),ae(a,e);a.eye[1]=P/U;const q=p*p*b,H=f*c,I=u*H*a.eye[1],A=a.eye[1]*a.eye[1],E=1-A,k=Math.sqrt(E),F=x*A+q-2*I*k*T+E*w;return Math.abs(F)<1e-8?(g(a.eye,i,M/y),a.tilt=0,ne(a.eye),ae(a,e)):(a.eye[0]=(E*(M*i[0]-j*i[0])-H*k*(i[0]*a.eye[1]*u+i[2]*p))/F,a.eye[2]=(E*(M*i[2]-j*i[2])-H*k*(i[2]*a.eye[1]*u-i[0]*p))/F,g(a.eye,a.eye,M),ne(a.eye),ae(a,e))}function ne(e){const t=e[1];e[1]=-e[2],e[2]=t}function ae(e,t){const r=re(t,e.heading,e.tilt);return e.up=r.up,e}function ie(e,t,s){const n=h(t),a=Math.sqrt(s*s+n*n-2*s*n*Math.cos(Math.PI-e)),i=o(s/(a/Math.sin(e)));return r(e-i)}function ce(e,r,s){const n=t(e),a=h(r);return o(s/(a/Math.sin(n)))+n}function le(o,s,n,a,i){let c,l,m,p;const u=s.latitude,f=U(o.spatialReference).radius,h=s.longitude,g=V(u,n,f)/2;c=h-g,l=h+g;const d=t(u),y=(1+Math.sin(d))/(1-Math.sin(d)),M=(y+1)*Math.tan(a/f/2),j=M*M;function b(t){const r=Math.PI/2;return(t=e.normalize(t,-r))>r&&(t=Math.PI-t),t}if(m=1.5*Math.PI-2*Math.atan(.5*(M+Math.sqrt(4*y+j))),p=m+a/f,m=b(m),p=b(p),p<m){const e=p;p=m,m=e}if(m=Math.max(r(m),-90),p=Math.min(r(p),90),l=k.monotonic(c,l),l-c>180){const e=(l-c-180)/2;c+=e,l-=e}const v=o.spatialReference&&o.spatialReference.isGeographic?o.spatialReference:H.WGS84;return i?(i.xmin=c,i.ymin=m,i.xmax=l,i.ymax=p,i.spatialReference=v):i=new P(c,m,l,p,v),o.spatialReference&&o.spatialReference.isWebMercator&&L(i,!1,i),i}function me(e,t){const{renderCoordsHelper:r}=e,o=e.state.camera.clone(),a=new N(r);o.near=B,a.update(o);const i=r.getAltitude(t),c=e.spatialReference,l=r.referenceEllipsoid.radius,m=o.eye,p=1+d(m,t)/(l+i),u=Math.sqrt(p*p-1),{minCurvature:f,maxCurvature:h,minSamples:g,maxSamples:j}=ge,b=he(e),v=n((u-f)/(h-f),0,1),R=Math.round(s(g,j,v)),S=o.aboveGround,U=a.planes[5],P=[],H=F(x,de,_()),I=F(x,ye,_());w(Te,0,0,0,0);const A=e=>{};for(let n=0;n<4;n++){const e=1===n&&!S||3===n&&S?1-b:0,t=1===n&&S||3===n&&!S?b:1,o=a.lines[n],c=a.lines[3===n?0:n+1];for(let a=0;a<R;a++){const l=a/R,p=0===a?0:s(e,t,1===n?1-(1-l)**2:3===n?l**2:l),u=y(je,o.origin,c.origin,p),f=X(o.direction,c.direction,p,Me);r.intersectManifoldClosestSilhouette(D(u,f),i,be),Q(be,m,be,U),P.push(T(be)),0!==P.length&&A(M(P.at(-1),be));const h=(z(H,be)?1:0)|(z(I,be)?2:0);Te[h]=1}}P.length>2&&A(M(P[0],P.at(-1)));const E=pe(C(Te)>1?ue(fe(P,H),I):[P],r,c);return new q({rings:E,spatialReference:c})}function pe(e,t,r){const o=2*S();return e.map(e=>{const s=[];let n=!1;for(const a of e)t.fromRenderCoords(a,be,r),Math.abs(a[0])<o&&Math.abs(a[1])<o?(s.push([null,be[1]]),s.push([null,be[1]]),n=!0):s.push([be[0],be[1]]);if(n)for(let t=0;t<s.length;t++){const e=s[t];if(null!=e[0])continue;const r=s[t+1],o=s.at(0===t?-1:t-1);e[0]=o[0],t++;const n=s.at(t===s.length-1?0:t+1);r[0]=n[0]}return s.push(s[0]),I(s)||s.reverse(),s})}function ue(e,t){const r=[];for(const o of e)r.push(...fe(o,t));return r}function fe(e,t){const r=[],o=[],s=S();for(let a=0;a<e.length;a++){const n=e[a],i=a===e.length-1?e[0]:e[a+1],c=A(n,i,xe),l=G(t,c.origin,c.vector,0,be);switch(l){case 2:r.push(n);break;case 3:o.push(n);break;case 0:case 1:{const[e,a,i]=0===l?[1,r,o]:[-1,o,r],c=W(t),m=j(v(),be,c,e*s),p=j(v(),be,c,e*-s);a.push(n),a.push(m),i.push(p)}}}const n=[];return r.length&&n.push(r),o.length&&n.push(o),n}function he(e){const{renderCoordsHelper:t,state:r}=e,o=Math.abs(t.getAltitude(r.camera.center));return ve.radius=t.referenceEllipsoid.radius+o,r.camera.sphereFrustumCoverage(ve,t)}const ge={minCurvature:t(5),maxCurvature:t(50),minSamples:1,maxSamples:6},de=b(1,0,0),ye=b(0,1,0),Me=v(),je=v(),be=v(),ve=new O,xe=E(),Te=R(),we=Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:oe,eyeForCenterWithHeadingTilt:se,eyeTiltToLookAtTilt:ce,headingTiltToDirectionUp:re,lookAtTiltToEyeTilt:ie,toArea:me,toExtent:le},Symbol.toStringTag,{value:"Module"}));export{ce as a,me as b,we as c,oe as d,se as e,re as h,ie as l,le as t};
|
package/chunks/vec32.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{create as t}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as n,RANDOM as a}from"../core/libs/gl-matrix-2/math/common.js";function r(t){const n=t[0],a=t[1],r=t[2];return Math.sqrt(n*n+a*a+r*r)}function s(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function o(t,n,a,r){return t[0]=n,t[1]=a,t[2]=r,t}function u(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t}function c(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t}function e(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t}function i(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[2],t}function h(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function M(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function f(t,n){return t[0]=Math.abs(n[0]),t[1]=Math.abs(n[1]),t[2]=Math.abs(n[2]),t}function m(t,n){return t[0]=Math.sign(n[0]),t[1]=Math.sign(n[1]),t[2]=Math.sign(n[2]),t}function l(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t}function d(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t}function b(t,n=0,a=1){return t[0]=Math.min(Math.max(t[0],n),a),t[1]=Math.min(Math.max(t[1],n),a),t[2]=Math.min(Math.max(t[2],n),a),t}function x(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function g(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t}function q(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t}function p(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2];return Math.sqrt(a*a+r*r+s*s)}function v(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2];return a*a+r*r+s*s}function j(t){const n=t[0],a=t[1],r=t[2];return n*n+a*a+r*r}function y(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function z(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function A(t,n){const a=n[0],r=n[1],s=n[2];let o=a*a+r*r+s*s;return o>0&&(o=1/Math.sqrt(o),t[0]=n[0]*o,t[1]=n[1]*o,t[2]=n[2]*o),t}function P(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function _(t,n,a){const r=n[0],s=n[1],o=n[2],u=a[0],c=a[1],e=a[2];return t[0]=s*e-o*c,t[1]=o*u-r*e,t[2]=r*c-s*u,t}function D(t,n,a){const r=n[0],s=n[1],o=n[2],u=a[0],c=a[1],e=a[2],i=s*e-o*c,h=o*u-r*e,M=r*c-s*u,f=Math.sqrt(i*i+h*h+M*M);return t[0]=i/f,t[1]=h/f,t[2]=M/f,t}function I(t,n,a,r){const s=n[0],o=n[1],u=n[2];return t[0]=s+r*(a[0]-s),t[1]=o+r*(a[1]-o),t[2]=u+r*(a[2]-u),t}function L(t,n,a,r,s,o){const u=o*o,c=u*(2*o-3)+1,e=u*(o-2)+o,i=u*(o-1),h=u*(3-2*o);return t[0]=n[0]*c+a[0]*e+r[0]*i+s[0]*h,t[1]=n[1]*c+a[1]*e+r[1]*i+s[1]*h,t[2]=n[2]*c+a[2]*e+r[2]*i+s[2]*h,t}function O(t,n,a,r,s,o){const u=1-o,c=u*u,e=o*o,i=c*u,h=3*o*c,M=3*e*u,f=e*o;return t[0]=n[0]*i+a[0]*h+r[0]*M+s[0]*f,t[1]=n[1]*i+a[1]*h+r[1]*M+s[1]*f,t[2]=n[2]*i+a[2]*h+r[2]*M+s[2]*f,t}function S(t,n=1){const r=a,s=2*r()*Math.PI,o=2*r()-1,u=Math.sqrt(1-o*o)*n;return t[0]=Math.cos(s)*u,t[1]=Math.sin(s)*u,t[2]=o*n,t}function E(t,n,a){const r=n[0],s=n[1],o=n[2];return t[0]=a[0]*r+a[4]*s+a[8]*o+a[12],t[1]=a[1]*r+a[5]*s+a[9]*o+a[13],t[2]=a[2]*r+a[6]*s+a[10]*o+a[14],t}function N(t,n,a){const r=n[0],s=n[1],o=n[2];return t[0]=r*a[0]+s*a[3]+o*a[6],t[1]=r*a[1]+s*a[4]+o*a[7],t[2]=r*a[2]+s*a[5]+o*a[8],t}function Q(t,n,a){const r=a[0],s=a[1],o=a[2],u=a[3],c=n[0],e=n[1],i=n[2],h=s*i-o*e,M=o*c-r*i,f=r*e-s*c,m=s*f-o*M,l=o*h-r*f,d=r*M-s*h,b=2*u;return t[0]=c+h*b+2*m,t[1]=e+M*b+2*l,t[2]=i+f*b+2*d,t}function T(t,n,a,r){const s=[],o=[];return s[0]=n[0]-a[0],s[1]=n[1]-a[1],s[2]=n[2]-a[2],o[0]=s[0],o[1]=s[1]*Math.cos(r)-s[2]*Math.sin(r),o[2]=s[1]*Math.sin(r)+s[2]*Math.cos(r),t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function k(t,n,a,r){const s=[],o=[];return s[0]=n[0]-a[0],s[1]=n[1]-a[1],s[2]=n[2]-a[2],o[0]=s[2]*Math.sin(r)+s[0]*Math.cos(r),o[1]=s[1],o[2]=s[2]*Math.cos(r)-s[0]*Math.sin(r),t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function w(t,n,a,r){const s=[],o=[];return s[0]=n[0]-a[0],s[1]=n[1]-a[1],s[2]=n[2]-a[2],o[0]=s[0]*Math.cos(r)-s[1]*Math.sin(r),o[1]=s[0]*Math.sin(r)+s[1]*Math.cos(r),o[2]=s[2],t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function B(t,n){A(C,t),A(F,n);const a=P(C,F);return a>1?0:a<-1?Math.PI:Math.acos(a)}const C=t(),F=t();function G(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function H(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function J(t,a){if(t===a)return!0;const r=t[0],s=t[1],o=t[2],u=a[0],c=a[1],e=a[2],i=n();return Math.abs(r-u)<=i*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(o-e)<=i*Math.max(1,Math.abs(o),Math.abs(e))}function K(t,n,a){const r=a[0]-n[0],s=a[1]-n[1],o=a[2]-n[2];let u=r*r+s*s+o*o;return u>0?(u=1/Math.sqrt(u),t[0]=r*u,t[1]=s*u,t[2]=o*u,t):(t[0]=0,t[1]=0,t[2]=0,t)}const R=c,U=e,V=i,W=p,X=v,Y=r,Z=j,$=Object.freeze(Object.defineProperty({__proto__:null,abs:f,add:u,angle:B,bezier:O,ceil:h,clamp:b,copy:s,cross:_,crossAndNormalize:D,direction:K,dist:W,distance:p,div:V,divide:i,dot:P,equals:J,exactEquals:H,floor:M,hermite:L,inverse:z,len:Y,length:r,lerp:I,max:d,min:l,mul:U,multiply:e,negate:y,normalize:A,random:S,rotateX:T,rotateY:k,rotateZ:w,round:x,scale:g,scaleAndAdd:q,set:o,sign:m,sqrDist:X,sqrLen:Z,squaredDistance:v,squaredLength:j,str:G,sub:R,subtract:c,transformMat3:N,transformMat4:E,transformQuat:Q},Symbol.toStringTag,{value:"Module"}));export{
|
|
5
|
+
import{create as t}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as n,RANDOM as a}from"../core/libs/gl-matrix-2/math/common.js";function r(t){const n=t[0],a=t[1],r=t[2];return Math.sqrt(n*n+a*a+r*r)}function s(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function o(t,n,a,r){return t[0]=n,t[1]=a,t[2]=r,t}function u(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t}function c(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t}function e(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t}function i(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[2],t}function h(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function M(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function f(t,n){return t[0]=Math.abs(n[0]),t[1]=Math.abs(n[1]),t[2]=Math.abs(n[2]),t}function m(t,n){return t[0]=Math.sign(n[0]),t[1]=Math.sign(n[1]),t[2]=Math.sign(n[2]),t}function l(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t}function d(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t}function b(t,n=0,a=1){return t[0]=Math.min(Math.max(t[0],n),a),t[1]=Math.min(Math.max(t[1],n),a),t[2]=Math.min(Math.max(t[2],n),a),t}function x(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function g(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t}function q(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t}function p(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2];return Math.sqrt(a*a+r*r+s*s)}function v(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2];return a*a+r*r+s*s}function j(t){const n=t[0],a=t[1],r=t[2];return n*n+a*a+r*r}function y(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function z(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function A(t,n){const a=n[0],r=n[1],s=n[2];let o=a*a+r*r+s*s;return o>0&&(o=1/Math.sqrt(o),t[0]=n[0]*o,t[1]=n[1]*o,t[2]=n[2]*o),t}function P(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function _(t,n,a){const r=n[0],s=n[1],o=n[2],u=a[0],c=a[1],e=a[2];return t[0]=s*e-o*c,t[1]=o*u-r*e,t[2]=r*c-s*u,t}function D(t,n,a){const r=n[0],s=n[1],o=n[2],u=a[0],c=a[1],e=a[2],i=s*e-o*c,h=o*u-r*e,M=r*c-s*u,f=Math.sqrt(i*i+h*h+M*M);return t[0]=i/f,t[1]=h/f,t[2]=M/f,t}function I(t,n,a,r){const s=n[0],o=n[1],u=n[2];return t[0]=s+r*(a[0]-s),t[1]=o+r*(a[1]-o),t[2]=u+r*(a[2]-u),t}function L(t,n,a,r,s,o){const u=o*o,c=u*(2*o-3)+1,e=u*(o-2)+o,i=u*(o-1),h=u*(3-2*o);return t[0]=n[0]*c+a[0]*e+r[0]*i+s[0]*h,t[1]=n[1]*c+a[1]*e+r[1]*i+s[1]*h,t[2]=n[2]*c+a[2]*e+r[2]*i+s[2]*h,t}function O(t,n,a,r,s,o){const u=1-o,c=u*u,e=o*o,i=c*u,h=3*o*c,M=3*e*u,f=e*o;return t[0]=n[0]*i+a[0]*h+r[0]*M+s[0]*f,t[1]=n[1]*i+a[1]*h+r[1]*M+s[1]*f,t[2]=n[2]*i+a[2]*h+r[2]*M+s[2]*f,t}function S(t,n=1){const r=a,s=2*r()*Math.PI,o=2*r()-1,u=Math.sqrt(1-o*o)*n;return t[0]=Math.cos(s)*u,t[1]=Math.sin(s)*u,t[2]=o*n,t}function E(t,n,a){const r=n[0],s=n[1],o=n[2];return t[0]=a[0]*r+a[4]*s+a[8]*o+a[12],t[1]=a[1]*r+a[5]*s+a[9]*o+a[13],t[2]=a[2]*r+a[6]*s+a[10]*o+a[14],t}function N(t,n,a){const r=n[0],s=n[1],o=n[2];return t[0]=r*a[0]+s*a[3]+o*a[6],t[1]=r*a[1]+s*a[4]+o*a[7],t[2]=r*a[2]+s*a[5]+o*a[8],t}function Q(t,n,a){const r=a[0],s=a[1],o=a[2],u=a[3],c=n[0],e=n[1],i=n[2],h=s*i-o*e,M=o*c-r*i,f=r*e-s*c,m=s*f-o*M,l=o*h-r*f,d=r*M-s*h,b=2*u;return t[0]=c+h*b+2*m,t[1]=e+M*b+2*l,t[2]=i+f*b+2*d,t}function T(t,n,a,r){const s=[],o=[];return s[0]=n[0]-a[0],s[1]=n[1]-a[1],s[2]=n[2]-a[2],o[0]=s[0],o[1]=s[1]*Math.cos(r)-s[2]*Math.sin(r),o[2]=s[1]*Math.sin(r)+s[2]*Math.cos(r),t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function k(t,n,a,r){const s=[],o=[];return s[0]=n[0]-a[0],s[1]=n[1]-a[1],s[2]=n[2]-a[2],o[0]=s[2]*Math.sin(r)+s[0]*Math.cos(r),o[1]=s[1],o[2]=s[2]*Math.cos(r)-s[0]*Math.sin(r),t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function w(t,n,a,r){const s=[],o=[];return s[0]=n[0]-a[0],s[1]=n[1]-a[1],s[2]=n[2]-a[2],o[0]=s[0]*Math.cos(r)-s[1]*Math.sin(r),o[1]=s[0]*Math.sin(r)+s[1]*Math.cos(r),o[2]=s[2],t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function B(t,n){A(C,t),A(F,n);const a=P(C,F);return a>1?0:a<-1?Math.PI:Math.acos(a)}const C=t(),F=t();function G(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function H(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function J(t,a){if(t===a)return!0;const r=t[0],s=t[1],o=t[2],u=a[0],c=a[1],e=a[2],i=n();return Math.abs(r-u)<=i*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(o-e)<=i*Math.max(1,Math.abs(o),Math.abs(e))}function K(t,n,a){const r=a[0]-n[0],s=a[1]-n[1],o=a[2]-n[2];let u=r*r+s*s+o*o;return u>0?(u=1/Math.sqrt(u),t[0]=r*u,t[1]=s*u,t[2]=o*u,t):(t[0]=0,t[1]=0,t[2]=0,t)}const R=c,U=e,V=i,W=p,X=v,Y=r,Z=j,$=Object.freeze(Object.defineProperty({__proto__:null,abs:f,add:u,angle:B,bezier:O,ceil:h,clamp:b,copy:s,cross:_,crossAndNormalize:D,direction:K,dist:W,distance:p,div:V,divide:i,dot:P,equals:J,exactEquals:H,floor:M,hermite:L,inverse:z,len:Y,length:r,lerp:I,max:d,min:l,mul:U,multiply:e,negate:y,normalize:A,random:S,rotateX:T,rotateY:k,rotateZ:w,round:x,scale:g,scaleAndAdd:q,set:o,sign:m,sqrDist:X,sqrLen:Z,squaredDistance:v,squaredLength:j,str:G,sub:R,subtract:c,transformMat3:N,transformMat4:E,transformQuat:Q},Symbol.toStringTag,{value:"Module"}));export{m as A,e as B,i as C,p as D,K as E,j as F,J as G,W as H,$ as I,M as J,w as K,h as L,b as M,x as N,D as O,L as P,O as Q,S as R,T as S,k as T,G as U,U as V,V as W,R as a,r as b,q as c,s as d,c as e,_ as f,P as g,o as h,u as i,g as j,B as k,I as l,H as m,A as n,z as o,E as p,y as q,Q as r,v as s,N as t,Y as u,f as v,X as w,Z as x,d as y,l as z};
|
package/config.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.
|
|
5
|
+
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.46";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{create as t}from"../factories/mat3f64.js";import{create as n}from"../factories/quatf64.js";import{fromValues as s,create as o}from"../factories/vec3f64.js";import{getEpsilon as a,RANDOM as r}from"./common.js";import{g as e,f as c,
|
|
5
|
+
import{create as t}from"../factories/mat3f64.js";import{create as n}from"../factories/quatf64.js";import{fromValues as s,create as o}from"../factories/vec3f64.js";import{getEpsilon as a,RANDOM as r}from"./common.js";import{g as e,f as c,u as i,n as u}from"../../../../chunks/vec32.js";import{c as h,a as M,n as f,f as l,i as m,s as p,h as q,l as j,j as d,d as g,e as P}from"../../../../chunks/vec42.js";function I(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function v(t,n,s){s*=.5;const o=Math.sin(s);return t[0]=o*n[0],t[1]=o*n[1],t[2]=o*n[2],t[3]=Math.cos(s),t}function x(t,n){const s=2*Math.acos(n[3]),o=Math.sin(s/2);return o>a()?(t[0]=n[0]/o,t[1]=n[1]/o,t[2]=n[2]/o):(t[0]=1,t[1]=0,t[2]=0),s}function y(t,n,s){const o=n[0],a=n[1],r=n[2],e=n[3],c=s[0],i=s[1],u=s[2],h=s[3];return t[0]=o*h+e*c+a*u-r*i,t[1]=a*h+e*i+r*c-o*u,t[2]=r*h+e*u+o*i-a*c,t[3]=e*h-o*c-a*i-r*u,t}function A(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+e*c,t[1]=a*i+r*c,t[2]=r*i-a*c,t[3]=e*i-o*c,t}function b(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i-r*c,t[1]=a*i+e*c,t[2]=r*i+o*c,t[3]=e*i-a*c,t}function _(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+a*c,t[1]=a*i-o*c,t[2]=r*i+e*c,t[3]=e*i-r*c,t}function k(t,n){const s=n[0],o=n[1],a=n[2];return t[0]=s,t[1]=o,t[2]=a,t[3]=Math.sqrt(Math.abs(1-s*s-o*o-a*a)),t}function z(t,n,s,o){const r=n[0],e=n[1],c=n[2],i=n[3];let u,h,M,f,l,m=s[0],p=s[1],q=s[2],j=s[3];return h=r*m+e*p+c*q+i*j,h<0&&(h=-h,m=-m,p=-p,q=-q,j=-j),1-h>a()?(u=Math.acos(h),M=Math.sin(u),f=Math.sin((1-o)*u)/M,l=Math.sin(o*u)/M):(f=1-o,l=o),t[0]=f*r+l*m,t[1]=f*e+l*p,t[2]=f*c+l*q,t[3]=f*i+l*j,t}function E(t){const n=r,s=n(),o=n(),a=n(),e=Math.sqrt(1-s),c=Math.sqrt(s);return t[0]=e*Math.sin(2*Math.PI*o),t[1]=e*Math.cos(2*Math.PI*o),t[2]=c*Math.sin(2*Math.PI*a),t[3]=c*Math.cos(2*Math.PI*a),t}function L(t,n){const s=n[0],o=n[1],a=n[2],r=n[3],e=s*s+o*o+a*a+r*r,c=e?1/e:0;return t[0]=-s*c,t[1]=-o*c,t[2]=-a*c,t[3]=r*c,t}function O(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function S(t,n){const s=n[0]+n[4]+n[8];let o;if(s>0)o=Math.sqrt(s+1),t[3]=.5*o,o=.5/o,t[0]=(n[5]-n[7])*o,t[1]=(n[6]-n[2])*o,t[2]=(n[1]-n[3])*o;else{let s=0;n[4]>n[0]&&(s=1),n[8]>n[3*s+s]&&(s=2);const a=(s+1)%3,r=(s+2)%3;o=Math.sqrt(n[3*s+s]-n[3*a+a]-n[3*r+r]+1),t[s]=.5*o,o=.5/o,t[3]=(n[3*a+r]-n[3*r+a])*o,t[a]=(n[3*a+s]+n[3*s+a])*o,t[r]=(n[3*r+s]+n[3*s+r])*o}return t}function T(t,n,s,o){const a=.5*Math.PI/180;n*=a,s*=a,o*=a;const r=Math.sin(n),e=Math.cos(n),c=Math.sin(s),i=Math.cos(s),u=Math.sin(o),h=Math.cos(o);return t[0]=r*i*h-e*c*u,t[1]=e*c*h+r*i*u,t[2]=e*i*u-r*c*h,t[3]=e*i*h+r*c*u,t}function W(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}const X=l,Y=h,Z=m,w=y,B=p,C=q,D=j,F=d,G=F,H=g,J=H,K=f,N=M,Q=P;function R(t,n,s){const o=e(n,s);return o<-.999999?(c(U,V,n),i(U)<1e-6&&c(U,$,n),u(U,U),v(t,U,Math.PI),t):o>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(c(U,n,s),t[0]=U[0],t[1]=U[1],t[2]=U[2],t[3]=1+o,K(t,t))}const U=o(),V=s(1,0,0),$=s(0,1,0);function tt(t,n,s,o,a,r){return z(nt,n,a,r),z(st,s,o,r),z(t,nt,st,2*r*(1-r)),t}const nt=n(),st=n();function ot(t,n,s,o){const a=at;return a[0]=s[0],a[3]=s[1],a[6]=s[2],a[1]=o[0],a[4]=o[1],a[7]=o[2],a[2]=-n[0],a[5]=-n[1],a[8]=-n[2],K(t,S(t,a))}const at=t(),rt=Object.freeze(Object.defineProperty({__proto__:null,add:Z,calculateW:k,conjugate:O,copy:X,dot:C,equals:Q,exactEquals:N,fromEuler:T,fromMat3:S,getAxisAngle:x,identity:I,invert:L,len:G,length:F,lerp:D,mul:w,multiply:y,normalize:K,random:E,rotateX:A,rotateY:b,rotateZ:_,rotationTo:R,scale:B,set:Y,setAxes:ot,setAxisAngle:v,slerp:z,sqlerp:tt,sqrLen:J,squaredLength:H,str:W},Symbol.toStringTag,{value:"Module"}));export{Z as add,k as calculateW,O as conjugate,X as copy,C as dot,Q as equals,N as exactEquals,T as fromEuler,S as fromMat3,x as getAxisAngle,I as identity,L as invert,G as len,F as length,D as lerp,w as mul,y as multiply,K as normalize,rt as q,E as random,A as rotateX,b as rotateY,_ as rotateZ,R as rotationTo,B as scale,Y as set,ot as setAxes,v as setAxisAngle,z as slerp,tt as sqlerp,J as sqrLen,H as squaredLength,W as str};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../factories/vec3f64.js";import"./common.js";export{
|
|
5
|
+
import"../factories/vec3f64.js";import"./common.js";export{v as abs,i as add,k as angle,Q as bezier,L as ceil,M as clamp,d as copy,f as cross,O as crossAndNormalize,E as direction,H as dist,D as distance,W as div,C as divide,g as dot,G as equals,m as exactEquals,J as floor,P as hermite,o as inverse,u as len,b as length,l as lerp,y as max,z as min,V as mul,B as multiply,q as negate,n as normalize,R as random,S as rotateX,T as rotateY,K as rotateZ,N as round,j as scale,c as scaleAndAdd,h as set,A as sign,w as sqrDist,x as sqrLen,s as squaredDistance,F as squaredLength,U as str,a as sub,e as subtract,t as transformMat3,p as transformMat4,r as transformQuat}from"../../../../chunks/vec32.js";
|
package/geometry/FlatGeometry.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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__addDisposableResource as t,__disposeResources as e}from"tslib";import r from"./SpatialReference.js";import{empty as s,expandWithExtent as n}from"./support/aaBoundingBox.js";import{empty as i,expandExtentInPlace as a}from"./support/aaBoundingRect.js";import{isPoint as o,isMultipoint as h,isPolyline as u,isGeometryWithM as l,isGeometryWithZ as c}from"./support/jsonUtils.js";import{equals as f}from"./support/spatialReferenceUtils.js";import{interpolateCircle as g}from"./support/curves/circleUtils.js";import{deriveCircleFromCircularArc as m}from"./support/curves/circularArcUtils.js";import{curveExtent as p}from"./support/curves/curveExtent.js";import{getEndpoint as x,isCurvedGeometry as v,isEllipticArc7 as d,isCircularArc as y,isEllipticArc4 as C,isBezierCurve as M}from"./support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as E}from"./support/curves/ellipticArc4Utils.js";import{deriveEllipse as O,interpolateEllipse as S}from"./support/curves/ellipticArc7Utils.js";import Z from"../layers/graphics/OptimizedGeometry.js";class _{constructor({type:t,spatialReference:e,vertexCount:r,vertexXY:s,vertexZ:n,vertexM:i,partCount:a,partOffsets:o,partFlags:h,segmentFlags:u,segmentIndices:l,segmentParams:c,segmentCountArc:f,segmentCountBezier:g}){this.segmentCountArc=0,this.segmentCountBezier=0,this.type=t,this.spatialReference=e,this.vertexCount=r,this.vertexXY=s,this.vertexZ=n,this.vertexM=i,this.partCount=a,this.partOffsets=o,this.partFlags=h,this.segmentFlags=u,this.segmentIndices=l,this.segmentParams=c,this.segmentCountArc=f,this.segmentCountBezier=g}get segmentParamCount(){return z(4)*this.segmentCountArc+z(2)*this.segmentCountBezier}get segmentCountLine(){const{segmentCount:t,segmentCountArc:e,segmentCountBezier:r}=this;return t&&t-e-r}get segmentCount(){return"polyline"===this.type?this.vertexCount-this.partCount:"polygon"===this.type?this.vertexCount:0}get hasZ(){return null!=this.vertexZ}get hasM(){return null!=this.vertexM}get hasCurves(){return null!=this.segmentFlags}get isMultipart(){return"polyline"===this.type||"polygon"===this.type}toGeometryJSON(){const t=T(this),{vertexCount:e,partCount:r,hasZ:s,hasM:n}=this,i=L(this);if("point"===this.type){const[t,e]=this.vertexXY,r=this.vertexZ?.[0],s=this.vertexM?.[0];return{x:t,y:e,z:r,m:s,spatialReference:i}}let a=0;if("multipoint"===this.type){const r=[];for(;a<e;)r.push(t(a++));return{points:r,spatialReference:i,hasZ:s,hasM:n}}const o="polygon"===this.type;if(!this.hasCurves){const e=new Array;for(let s=0;s<r;++s){const r=this.partOffsets[s+1],n=new Array;for(;a<r;)n.push(t(a++));o&&n.length>0&&n.push(n[0]),e.push(n)}return o?{rings:e,hasZ:s,hasM:n,spatialReference:i}:{paths:e,hasZ:s,hasM:n,spatialReference:i}}const h=new Array;for(const{segments:u,startVertex:l}of this.parts){const t=[l];for(const{curve:e}of u)t.push(e);h.push(t)}return o?{rings:[],curveRings:h,hasZ:s,hasM:n,spatialReference:i}:{paths:[],curvePaths:h,hasZ:s,hasM:n,spatialReference:i}}toOptimizedGeometry(){const{vertexCount:t,vertexXY:e,vertexZ:r,vertexM:s,partOffsets:n,hasZ:i,hasM:a}=this,o=new Z([],[],i,a),h=Math.max(this.partCount,1),u="polygon"===this.type;let l=0;for(let c=0;c<h;++c){const h=n?.[c+1]??t,f=o.coords.length;for(let t=l;t<h;++t)o.coords.push(e[2*t],e[2*t+1]),i&&o.coords.push(r[t]),a&&o.coords.push(s[t]);if(u){const t=l;o.coords.push(e[2*t],e[2*t+1]),i&&o.coords.push(r[t]),a&&o.coords.push(s[t])}o.lengths.push((o.coords.length-f)/o.stride),l=h}return"point"===this.type&&(o.lengths.length=0),o}clone(){const{type:t,vertexCount:e,partCount:r,hasZ:s,hasM:n,hasCurves:i,segmentCountArc:a,segmentCountBezier:o}=this,h=j(t,e,r,s,n,i,a,o);h.spatialReference=this.spatialReference;const{vertexXY:u,vertexZ:l,vertexM:c}=this;h.vertexXY.set(u.subarray(0,2*e),0),h.vertexZ?.set(l.subarray(0,e),0),h.vertexM?.set(c.subarray(0,e),0);const{partOffsets:f,partFlags:g}=this;h.partFlags?.set(g.subarray(0,r+1)),h.partOffsets?.set(f.subarray(0,r+1));const{segmentFlags:m,segmentIndices:p,segmentParams:x,segmentParamCount:v}=this;return h.segmentFlags?.set(m.subarray(0,e),0),h.segmentIndices?.set(p.subarray(0,e),0),h.segmentParams?.set(x.subarray(0,v),0),h}equals(t){return this.equalsWithinTolerance(t,0)}equalsWithinTolerance(t,e){if(null==t)return!1;if(this===t)return!0;if(!f(this.spatialReference,t.spatialReference))return!1;if(this.vertexCount!==t.vertexCount||this.partCount!==t.partCount)return!1;if(this.hasZ!==t.hasZ||this.hasM!==t.hasM)return!1;if(this.hasCurves!==t.hasCurves||this.segmentCountArc!==t.segmentCountArc||this.segmentCountBezier!==t.segmentCountBezier)return!1;const r=0===e?(t,e)=>t!==e||isNaN(t)!==isNaN(e):(t,r)=>Math.abs(t-r)>e||isNaN(t)!==isNaN(r);for(let s=0;s<this.vertexCount;++s)if(r(this.vertexXY[2*s],t.vertexXY[2*s])||r(this.vertexXY[2*s+1],t.vertexXY[2*s+1]))return!1;if(this.hasZ)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexZ[s],t.vertexZ[s]))return!1;if(this.hasM)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexM[s],t.vertexM[s]))return!1;for(let s=0;s<this.partCount;++s)if(this.partFlags[s]!==t.partFlags[s]||this.partOffsets[s]!==t.partOffsets[s])return!1;if(this.hasCurves){for(let e=0;e<this.vertexCount;++e)if(this.segmentFlags[e]!==t.segmentFlags[e]||this.segmentIndices[e]!==t.segmentIndices[e])return!1;for(let e=0;e<this.segmentParamCount;++e)if(r(this.segmentParams[e],t.segmentParams[e]))return!1}return!0}get parts(){return new Y(this)}}class Y{constructor(t){this.geometry=t,this.value=new P(t)}get done(){return this.value.index>=this.geometry.partCount}next(){return++this.value.index,this}[Symbol.iterator](){return this}}class P{constructor(t){this.geometry=t,this.index=-1,this._readVertex=T(t),this._segments=new R(this)}get segments(){return this._segments.reset(),this._segments}get startVertex(){return this._readVertex(this.geometry.partOffsets[this.index])}get vertexCount(){const t=this.geometry.partOffsets;return t[this.index+1]-t[this.index]}}class R{constructor(t){this._part=t,this._partStart=0,this._partEnd=0,this._isPolygon="polygon"===t.geometry.type,this.value=new A(t.geometry)}get done(){return this.value.indexOfStartVertex>this._partEnd}next(){++this.value.indexOfStartVertex;const t=this.value.indexOfStartVertex>=this._partEnd;return this.value.indexOfEndVertex=t&&this._isPolygon?this._partStart:this.value.indexOfStartVertex+1,this}[Symbol.iterator](){return this}reset(){const{index:t}=this._part,e=this._part.geometry.partOffsets;this._partStart=e[t],this._partEnd=e[t+1]-(this._isPolygon?1:2),this.value.indexOfStartVertex=this._partStart-1}}class A{constructor(t){this.geometry=t,this.indexOfStartVertex=-1,this.indexOfEndVertex=-1,this._readVertex=T(t)}get xStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex]}get yStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex+1]}get zStart(){return this.geometry.vertexZ[this.indexOfStartVertex]}get mStart(){return this.geometry.vertexM[this.indexOfStartVertex]}get xEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex]}get yEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex+1]}get zEnd(){return this.geometry.vertexZ[this.indexOfEndVertex]}get mEnd(){return this.geometry.vertexM[this.indexOfEndVertex]}get start(){return this._readVertex(this.indexOfStartVertex)}get end(){return this._readVertex(this.indexOfEndVertex)}get curve(){const t=this.geometry.segmentFlags?.[this.indexOfStartVertex]??1;if(1===t)return this.end;const e=this.geometry.segmentParams;let r=this.geometry.segmentIndices[this.indexOfStartVertex];if(2===t){const t=e[r++],s=e[r++],n=e[r++],i=e[r++];return{b:[this.end,[t,s],[n,i]]}}const s=e[r++],n=e[r++],i=e[r++],a=e[r++],o=e[r++],h=e[r++];r++,r++;const u=e[r++],l=e[r++];if(!(4&s)&&1===i)return{c:[this.end,[u,l]]};const c=2&s?0:1,f=1&s?0:1;return{a:[this.end,[o,h],c,f,a,n,i]}}}function F(r){let s;const{hasCurves:n,vertexCount:a,vertexXY:o,vertexZ:h,vertexM:u}=r,l=L(r);if(n){const n={stack:[],error:void 0,hasError:!1};try{t(n,new N(r,["vertexZ","vertexM"]),!1);const e=i();for(const t of r.parts){let r=t.startVertex;for(const{curve:s}of t.segments)p(e,r,s),r=x(s)}const[a,o,h,u]=e;s={xmin:a,ymin:o,xmax:h,ymax:u,spatialReference:l}}catch(c){n.error=c,n.hasError=!0}finally{e(n)}}else{let t,e,r,n;t=e=1/0,r=n=-1/0;for(let s=0;s<a;++s){const i=o[2*s],a=o[2*s+1];t=Math.min(t,i),r=Math.max(r,i),e=Math.min(e,a),n=Math.max(n,a)}s={xmin:t,ymin:e,xmax:r,ymax:n,spatialReference:l}}if(h){let t=1/0,e=-1/0;for(const r of h)t=Math.min(t,r),e=Math.max(e,r);s.zmin=t,s.zmax=e}if(u){let t=1/0,e=-1/0;for(const r of u)t=Math.min(t,r),e=Math.max(e,r);s.mmin=t,s.mmax=e}return s}function V(r,s){const n={stack:[],error:void 0,hasError:!1};try{s??=i();t(n,new N(r,["vertexZ","vertexM","spatialReference"]),!1);return a(s,F(r)),s}catch(o){n.error=o,n.hasError=!0}finally{e(n)}}function w(r,i){const a={stack:[],error:void 0,hasError:!1};try{i??=s();t(a,new N(r,["vertexM","spatialReference"]),!1);return n(i,F(r)),i}catch(o){a.error=o,a.hasError=!0}finally{e(a)}}function X(t){let e,r,s;if(o(t)){s="point";const{x:n,y:i,z:a,m:o}=t,h=[n,i];null!=a&&h.push(a),null!=o&&h.push(o),r=[[h]],e=1}else h(t)?(s="multipoint",r=[t.points],e=t.points.length):u(t)?(s="polyline",r=t.curvePaths??t.paths,e=r.reduce((t,e)=>t+e.length,0)):(s="polygon",r=t.curveRings??t.rings,e=r.reduce((t,e)=>t+e.length-k(e),0));const n=j(s,e,s.includes("point")?0:r.length,c(t),l(t),v(t));function i(t){n.vertexXY[2*f]=t[0],n.vertexXY[2*f+1]=t[1],n.hasZ&&(n.vertexZ[f]=t[2]),n.hasM&&(n.vertexM[f]=t[a]),++f}n.spatialReference=t.spatialReference??void 0;const a=n.hasZ?3:2;let f=0;if(!n.isMultipart){if(!n.hasZ&&!n.hasM){for(const[t,e]of r[0])n.vertexXY[2*f]=t,n.vertexXY[2*f+1]=e;return n}for(const t of r[0])i(t);return n}const p="polygon"===n.type;let Z=0;if(!n.hasCurves){for(const t of r){n.partOffsets[Z++]=f;let e=t.length;if(p&&(e-=k(t)),n.hasZ||n.hasM)for(let r=0;r<e;++r)i(t[r]);else for(let r=0;r<e;++r){const[e,s]=t[r];n.vertexXY[2*f]=e,n.vertexXY[2*f+1]=s,++f}}return n.partOffsets[Z]=f,n}function _(t){const e=f-1;n.segmentFlags[e]=t;const r=z(t);n.segmentIndices[e]=0===r?U:Y,4===t?++n.segmentCountArc:2===t&&++n.segmentCountBezier;const s=Y+r;if(s<=(n.segmentParams?.length??0))return;let i=s*W;i=20*Math.ceil(i/20);const a=n.segmentParams;if(n.segmentParams=new Float64Array(i),null!=a)for(let o=0;o<a.length;++o)n.segmentParams[o]=a[o]}let Y=0;for(const o of r){n.partOffsets[Z++]=f,i(o[0]);let t=o.length;p&&(t-=k(o));for(let e=1;e<t;++e){const t=o[e];if(d(t)){_(4);const r=n.segmentParams,[s,[a,h],u,l,c,f,g]=t.a;let m=4;l||(m|=1),u||(m|=2);const p=O(x(o[e-1]),t),[v,d]=S(p,.5);r[Y++]=m,r[Y++]=f,r[Y++]=g,r[Y++]=c,r[Y++]=a,r[Y++]=h,r[Y++]=p.u2-p.u1,r[Y++]=p.u1,r[Y++]=v,r[Y++]=d,i(s);continue}if(y(t)||C(t)){_(4);const r=n.segmentParams,s=x(t),a=y(t)?m(x(o[e-1]),t):E(x(o[e-1]),t),{cx:h,cy:u,thetaStart:l,thetaEnd:c,radius:f}=a,p=Math.abs(c-l)<Math.PI,v=l>c;let d=C(t)?4:0;v||(d|=1),p||(d|=2);const[M,O]=y(t)?t.c[1]:g(a,.5);r[Y++]=d,r[Y++]=f,r[Y++]=1,r[Y++]=0,r[Y++]=h,r[Y++]=u,r[Y++]=c-l,r[Y++]=l,r[Y++]=M,r[Y++]=O,i(s);continue}if(M(t)){_(2);const e=n.segmentParams,[r,[s,a],[o,h]]=t.b;e[Y++]=s,e[Y++]=a,e[Y++]=o,e[Y++]=h,i(r);continue}_(1),i(t)}}return n.partOffsets[Z]=f,n}function b(t,{lengths:e,coords:r,hasZ:s,hasM:n},i){const a=t.includes("point")?0:e.length,o="polygon"===t,h="point"===t?1:e.reduce((t,e)=>t+e,0)-(o?a:0);s??=!1,n??=!1;const u=j(t,h,a,s,n,!1,0,0);if(u.spatialReference=i??void 0,!u.isMultipart){for(let t=0,e=0;t<h;++t)u.vertexXY[2*t]=r[e++],u.vertexXY[2*t+1]=r[e++],s&&(u.vertexZ[t]=r[e++]),n&&(u.vertexM[t]=r[e++]);return u}const l=2+Number(s)+Number(n);let c=0,f=0;u.partOffsets[0]=0;for(const g of e){const t=u.partOffsets[f],e=t+g-Number(o);u.partOffsets[++f]=e;for(let i=t;i<e;++i)u.vertexXY[2*i]=r[c++],u.vertexXY[2*i+1]=r[c++],s&&(u.vertexZ[i]=r[c++]),n&&(u.vertexM[i]=r[c++]);o&&(c+=l)}return u}function I(t,e){return"getSpatialReference"in t&&(e=B(t.getSpatialReference()),t=t.getGeometry()),new _({...t.toFlatGeometry(),spatialReference:e})}function B(t){if(null==t)return;const e=t.getText()||void 0,r=t.isCustomWkid()?0:t.getOldID();if(r<=0)return{wkt:e};let s=t.getLatestID();(s<=0||s===r)&&(s=void 0);const n=t.getVCS();if(null==n)return{wkid:r,latestWkid:s,wkt:e};const i=n.isCustomWkid()?0:n.getOldID();if(i<=0)return{wkt:e};let a=t.getLatestVerticalID();return(a<=0||a===i)&&(a=void 0),{wkid:r,wkt:e,latestWkid:s,vcsWkid:i,latestVcsWkid:a}}class N{constructor(t,e){this.target=t,this.keys=e,this.oldValues=e.map(e=>t[e]);for(const r of e)t[r]=void 0}[Symbol.dispose](){this.keys.map((t,e)=>{this.target[t]=this.oldValues[e]})}}function L({spatialReference:t}){return t instanceof r?t.toJSON():t}function T({vertexXY:t,vertexZ:e,vertexM:r}){return e?r?s=>[t[2*s],t[2*s+1],e[s],r[s]]:r=>[t[2*r],t[2*r+1],e[r]]:r?e=>[t[2*e],t[2*e+1],r[e]]:e=>[t[2*e],t[2*e+1]]}function z(t){switch(t){case 1:return 0;case 4:return 10;case 2:return 4}}function k(t){if(t.length>0){const e=t[0],r=x(t.at(-1));return e.every((t,e)=>t===r[e])?1:0}return 0}function j(t,e,r,s,n,i,a,o){const h=null!=a&&null!=o;a??=0,o??=0;const u=new _({type:t,vertexCount:e,vertexXY:null,vertexZ:void 0,vertexM:void 0,partCount:r,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:a,segmentCountBezier:o});let l=2*Float64Array.BYTES_PER_ELEMENT*e;s&&(l+=Float64Array.BYTES_PER_ELEMENT*e),n&&(l+=Float64Array.BYTES_PER_ELEMENT*e),u.isMultipart&&(l+=(r+1)*Int32Array.BYTES_PER_ELEMENT,l+=(r+1)*Int8Array.BYTES_PER_ELEMENT),i&&(l+=e*Int8Array.BYTES_PER_ELEMENT,l+=e*Int32Array.BYTES_PER_ELEMENT,h&&(l+=u.segmentParamCount*Float64Array.BYTES_PER_ELEMENT));const c=new ArrayBuffer(l);let f=0;if(u.vertexXY=new Float64Array(c,f,2*e),f+=u.vertexXY.byteLength,s&&(u.vertexZ=new Float64Array(c,f,e),f+=u.vertexZ.byteLength),n&&(u.vertexM=new Float64Array(c,f,e),f+=u.vertexM.byteLength),i&&(h&&(u.segmentParams=new Float64Array(c,f,u.segmentParamCount),f+=u.segmentParams.byteLength),u.segmentIndices=new Int32Array(c,f,e),u.segmentIndices.fill(U),f+=u.segmentIndices.byteLength),u.isMultipart&&(u.partOffsets=new Int32Array(c,f,r+1),f+=u.partOffsets.byteLength,u.partFlags=new Int8Array(c,f,r+1),f+=u.partFlags.byteLength),i&&(u.segmentFlags=new Int8Array(c,f,e),u.segmentFlags.fill(1),f+=u.segmentFlags.byteLength),"polygon"===u.type)for(let g=0;g<r;++g)u.partFlags[g]=1;return u}const W=1.61803,U=-1;export{_ as FlatGeometry,X as convertGeometryToFlat,I as convertGeometryxToFlat,b as convertOptimizedGeometryToFlat,w as getBoundingBox,V as getBoundingRect,F as getExtentJSON};
|
|
5
|
+
import{__addDisposableResource as t,__disposeResources as e}from"tslib";import r from"./SpatialReference.js";import{empty as s,expandWithExtent as n}from"./support/aaBoundingBox.js";import{empty as i,expandExtentInPlace as a}from"./support/aaBoundingRect.js";import{isPoint as o,isMultipoint as h,isPolyline as u,isGeometryWithM as l,isGeometryWithZ as c}from"./support/jsonUtils.js";import{equals as f}from"./support/spatialReferenceUtils.js";import{interpolateCircle as g}from"./support/curves/circleUtils.js";import{deriveCircleFromCircularArc as m}from"./support/curves/circularArcUtils.js";import{curveExtent as p}from"./support/curves/curveExtent.js";import{isCurvedGeometry as x,isEllipticArc7 as v,getEndpoint as d,isEllipticArc4 as y,isBezierCurve as C,isCircularArc as M}from"./support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as E}from"./support/curves/ellipticArc4Utils.js";import{deriveEllipse as O,interpolateEllipse as S}from"./support/curves/ellipticArc7Utils.js";import Z from"../layers/graphics/OptimizedGeometry.js";class _{constructor({type:t,spatialReference:e,vertexCount:r,vertexXY:s,vertexZ:n,vertexM:i,partCount:a,partOffsets:o,partFlags:h,segmentFlags:u,segmentIndices:l,segmentParams:c,segmentCountArc:f,segmentCountBezier:g}){this.segmentCountArc=0,this.segmentCountBezier=0,this.type=t,this.spatialReference=e,this.vertexCount=r,this.vertexXY=s,this.vertexZ=n,this.vertexM=i,this.partCount=a,this.partOffsets=o,this.partFlags=h,this.segmentFlags=u,this.segmentIndices=l,this.segmentParams=c,this.segmentCountArc=f,this.segmentCountBezier=g}get segmentParamCount(){return z(4)*this.segmentCountArc+z(2)*this.segmentCountBezier}get segmentCountLine(){const{segmentCount:t,segmentCountArc:e,segmentCountBezier:r}=this;return t&&t-e-r}get segmentCount(){return"polyline"===this.type?this.vertexCount-this.partCount:"polygon"===this.type?this.vertexCount:0}get hasZ(){return null!=this.vertexZ}get hasM(){return null!=this.vertexM}get hasCurves(){return null!=this.segmentFlags}get isMultipart(){return"polyline"===this.type||"polygon"===this.type}toGeometryJSON(){const t=T(this),{vertexCount:e,partCount:r,hasZ:s,hasM:n}=this,i=L(this);if("point"===this.type){const[t,e]=this.vertexXY,r=this.vertexZ?.[0],s=this.vertexM?.[0];return{x:t,y:e,z:r,m:s,spatialReference:i}}let a=0;if("multipoint"===this.type){const r=[];for(;a<e;)r.push(t(a++));return{points:r,spatialReference:i,hasZ:s,hasM:n}}const o="polygon"===this.type;if(!this.hasCurves){const e=new Array;for(let s=0;s<r;++s){const r=this.partOffsets[s+1],n=new Array;for(;a<r;)n.push(t(a++));o&&n.length>0&&n.push(n[0]),e.push(n)}return o?{rings:e,hasZ:s,hasM:n,spatialReference:i}:{paths:e,hasZ:s,hasM:n,spatialReference:i}}const h=new Array;for(const{segments:u,startVertex:l}of this.parts){const t=[l];for(const{curve:e}of u)t.push(e);h.push(t)}return o?{rings:[],curveRings:h,hasZ:s,hasM:n,spatialReference:i}:{paths:[],curvePaths:h,hasZ:s,hasM:n,spatialReference:i}}toOptimizedGeometry(){const{vertexCount:t,vertexXY:e,vertexZ:r,vertexM:s,partOffsets:n,hasZ:i,hasM:a}=this,o=new Z([],[],i,a),h=Math.max(this.partCount,1),u="polygon"===this.type;let l=0;for(let c=0;c<h;++c){const h=n?.[c+1]??t,f=o.coords.length;for(let t=l;t<h;++t)o.coords.push(e[2*t],e[2*t+1]),i&&o.coords.push(r[t]),a&&o.coords.push(s[t]);if(u){const t=l;o.coords.push(e[2*t],e[2*t+1]),i&&o.coords.push(r[t]),a&&o.coords.push(s[t])}o.lengths.push((o.coords.length-f)/o.stride),l=h}return"point"===this.type&&(o.lengths.length=0),o}clone(){const{type:t,vertexCount:e,partCount:r,hasZ:s,hasM:n,hasCurves:i,segmentCountArc:a,segmentCountBezier:o}=this,h=j(t,e,r,s,n,i,a,o);h.spatialReference=this.spatialReference;const{vertexXY:u,vertexZ:l,vertexM:c}=this;h.vertexXY.set(u.subarray(0,2*e),0),h.vertexZ?.set(l.subarray(0,e),0),h.vertexM?.set(c.subarray(0,e),0);const{partOffsets:f,partFlags:g}=this;h.partFlags?.set(g.subarray(0,r+1)),h.partOffsets?.set(f.subarray(0,r+1));const{segmentFlags:m,segmentIndices:p,segmentParams:x,segmentParamCount:v}=this;return h.segmentFlags?.set(m.subarray(0,e),0),h.segmentIndices?.set(p.subarray(0,e),0),h.segmentParams?.set(x.subarray(0,v),0),h}equals(t){return this.equalsWithinTolerance(t,0)}equalsWithinTolerance(t,e){if(null==t)return!1;if(this===t)return!0;if(!f(this.spatialReference,t.spatialReference))return!1;if(this.vertexCount!==t.vertexCount||this.partCount!==t.partCount)return!1;if(this.hasZ!==t.hasZ||this.hasM!==t.hasM)return!1;if(this.hasCurves!==t.hasCurves||this.segmentCountArc!==t.segmentCountArc||this.segmentCountBezier!==t.segmentCountBezier)return!1;const r=0===e?(t,e)=>t!==e||isNaN(t)!==isNaN(e):(t,r)=>Math.abs(t-r)>e||isNaN(t)!==isNaN(r);for(let s=0;s<this.vertexCount;++s)if(r(this.vertexXY[2*s],t.vertexXY[2*s])||r(this.vertexXY[2*s+1],t.vertexXY[2*s+1]))return!1;if(this.hasZ)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexZ[s],t.vertexZ[s]))return!1;if(this.hasM)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexM[s],t.vertexM[s]))return!1;for(let s=0;s<this.partCount;++s)if(this.partFlags[s]!==t.partFlags[s]||this.partOffsets[s]!==t.partOffsets[s])return!1;if(this.hasCurves){for(let e=0;e<this.vertexCount;++e)if(this.segmentFlags[e]!==t.segmentFlags[e]||this.segmentIndices[e]!==t.segmentIndices[e])return!1;for(let e=0;e<this.segmentParamCount;++e)if(r(this.segmentParams[e],t.segmentParams[e]))return!1}return!0}get parts(){return new Y(this)}}class Y{constructor(t){this.geometry=t,this.value=new P(t)}get done(){return this.value.index>=this.geometry.partCount}next(){return++this.value.index,this}[Symbol.iterator](){return this}}class P{constructor(t){this.geometry=t,this.index=-1,this._readVertex=T(t),this._segments=new R(this)}get segments(){return this._segments.reset(),this._segments}get startVertex(){return this._readVertex(this.geometry.partOffsets[this.index])}get vertexCount(){const t=this.geometry.partOffsets;return t[this.index+1]-t[this.index]}}class R{constructor(t){this._part=t,this._partStart=0,this._partEnd=0,this._isPolygon="polygon"===t.geometry.type,this.value=new A(t.geometry)}get done(){return this.value.indexOfStartVertex>this._partEnd}next(){++this.value.indexOfStartVertex;const t=this.value.indexOfStartVertex>=this._partEnd;return this.value.indexOfEndVertex=t&&this._isPolygon?this._partStart:this.value.indexOfStartVertex+1,this}[Symbol.iterator](){return this}reset(){const{index:t}=this._part,e=this._part.geometry.partOffsets;this._partStart=e[t],this._partEnd=e[t+1]-(this._isPolygon?1:2),this.value.indexOfStartVertex=this._partStart-1}}class A{constructor(t){this.geometry=t,this.indexOfStartVertex=-1,this.indexOfEndVertex=-1,this._readVertex=T(t)}get xStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex]}get yStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex+1]}get zStart(){return this.geometry.vertexZ[this.indexOfStartVertex]}get mStart(){return this.geometry.vertexM[this.indexOfStartVertex]}get xEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex]}get yEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex+1]}get zEnd(){return this.geometry.vertexZ[this.indexOfEndVertex]}get mEnd(){return this.geometry.vertexM[this.indexOfEndVertex]}get start(){return this._readVertex(this.indexOfStartVertex)}get end(){return this._readVertex(this.indexOfEndVertex)}get curve(){const t=this.geometry.segmentFlags?.[this.indexOfStartVertex]??1;if(1===t)return this.end;const e=this.geometry.segmentParams;let r=this.geometry.segmentIndices[this.indexOfStartVertex];if(2===t){const t=e[r++],s=e[r++],n=e[r++],i=e[r++];return{b:[this.end,[t,s],[n,i]]}}const s=e[r++],n=e[r++],i=e[r++],a=e[r++],o=e[r++],h=e[r++];r++,r++;const u=e[r++],l=e[r++];if(!Boolean(4&s)&&1===i)return{c:[this.end,[u,l]]};const c=2&s?0:1,f=1&s?0:1;return{a:[this.end,[o,h],c,f,a,n,i]}}}function F(r){let s;const{hasCurves:n,vertexCount:a,vertexXY:o,vertexZ:h,vertexM:u}=r,l=L(r);if(n){const n={stack:[],error:void 0,hasError:!1};try{t(n,new N(r,["vertexZ","vertexM"]),!1);const e=i();for(const t of r.parts){let r=t.startVertex;for(const{curve:s}of t.segments)p(e,r,s),r=d(s)}const[a,o,h,u]=e;s={xmin:a,ymin:o,xmax:h,ymax:u,spatialReference:l}}catch(c){n.error=c,n.hasError=!0}finally{e(n)}}else{let t,e,r,n;t=e=1/0,r=n=-1/0;for(let s=0;s<a;++s){const i=o[2*s],a=o[2*s+1];t=Math.min(t,i),r=Math.max(r,i),e=Math.min(e,a),n=Math.max(n,a)}s={xmin:t,ymin:e,xmax:r,ymax:n,spatialReference:l}}if(h){let t=1/0,e=-1/0;for(const r of h)t=Math.min(t,r),e=Math.max(e,r);s.zmin=t,s.zmax=e}if(u){let t=1/0,e=-1/0;for(const r of u)t=Math.min(t,r),e=Math.max(e,r);s.mmin=t,s.mmax=e}return s}function V(r,s){const n={stack:[],error:void 0,hasError:!1};try{s??=i();t(n,new N(r,["vertexZ","vertexM","spatialReference"]),!1);return a(s,F(r)),s}catch(o){n.error=o,n.hasError=!0}finally{e(n)}}function w(r,i){const a={stack:[],error:void 0,hasError:!1};try{i??=s();t(a,new N(r,["vertexM","spatialReference"]),!1);return n(i,F(r)),i}catch(o){a.error=o,a.hasError=!0}finally{e(a)}}function X(t){let e,r,s;if(o(t)){s="point";const{x:n,y:i,z:a,m:o}=t,h=[n,i];null!=a&&h.push(a),null!=o&&h.push(o),r=[[h]],e=1}else h(t)?(s="multipoint",r=[t.points],e=t.points.length):u(t)?(s="polyline",r=t.curvePaths??t.paths,e=r.reduce((t,e)=>t+e.length,0)):(s="polygon",r=t.curveRings??t.rings,e=r.reduce((t,e)=>t+e.length-k(e),0));const n=j(s,e,s.includes("point")?0:r.length,c(t),l(t),x(t));function i(t){n.vertexXY[2*f]=t[0],n.vertexXY[2*f+1]=t[1],n.hasZ&&(n.vertexZ[f]=t[2]),n.hasM&&(n.vertexM[f]=t[a]),++f}n.spatialReference=t.spatialReference??void 0;const a=n.hasZ?3:2;let f=0;if(!n.isMultipart){if(!n.hasZ&&!n.hasM){for(const[t,e]of r[0])n.vertexXY[2*f]=t,n.vertexXY[2*f+1]=e,++f;return n}for(const t of r[0])i(t);return n}const p="polygon"===n.type;let Z=0;if(!n.hasCurves){for(const t of r){n.partOffsets[Z++]=f;let e=t.length;if(p&&(e-=k(t)),n.hasZ||n.hasM)for(let r=0;r<e;++r)i(t[r]);else for(let r=0;r<e;++r){const[e,s]=t[r];n.vertexXY[2*f]=e,n.vertexXY[2*f+1]=s,++f}}return n.partOffsets[Z]=f,n}function _(t){const e=f-1;n.segmentFlags[e]=t;const r=z(t);n.segmentIndices[e]=0===r?U:Y,4===t?++n.segmentCountArc:2===t&&++n.segmentCountBezier;const s=Y+r;if(s<=(n.segmentParams?.length??0))return;let i=s*W;i=20*Math.ceil(i/20);const a=n.segmentParams;if(n.segmentParams=new Float64Array(i),null!=a)for(let o=0;o<a.length;++o)n.segmentParams[o]=a[o]}let Y=0;for(const o of r){n.partOffsets[Z++]=f,i(o[0]);let t=o.length;p&&(t-=k(o));for(let e=1;e<t;++e){const t=o[e];if(v(t)){_(4);const r=n.segmentParams,[s,[a,h],u,l,c,f,g]=t.a;let m=4;l||(m|=1),u||(m|=2);const p=O(d(o[e-1]),t),[x,v]=S(p,.5);r[Y++]=m,r[Y++]=f,r[Y++]=g,r[Y++]=c,r[Y++]=a,r[Y++]=h,r[Y++]=p.u2-p.u1,r[Y++]=p.u1,r[Y++]=x,r[Y++]=v,i(s);continue}const r=M(t);if(y(t)||r){_(4);const s=n.segmentParams,a=d(t),h=r?m(d(o[e-1]),t):E(d(o[e-1]),t),{cx:u,cy:l,thetaStart:c,thetaEnd:f,radius:p}=h;let x=r?0:4;c>f||(x|=1),Math.abs(f-c)<=Math.PI||(x|=2);const[v,y]=r?t.c[1]:g(h,.5);s[Y++]=x,s[Y++]=p,s[Y++]=1,s[Y++]=0,s[Y++]=u,s[Y++]=l,s[Y++]=f-c,s[Y++]=c,s[Y++]=v,s[Y++]=y,i(a);continue}if(C(t)){_(2);const e=n.segmentParams,[r,[s,a],[o,h]]=t.b;e[Y++]=s,e[Y++]=a,e[Y++]=o,e[Y++]=h,i(r);continue}_(1),i(t)}}return n.partOffsets[Z]=f,n}function b(t,{lengths:e,coords:r,hasZ:s,hasM:n},i){const a=t.includes("point")?0:e.length,o="polygon"===t,h="point"===t?1:e.reduce((t,e)=>t+e,0)-(o?a:0);s??=!1,n??=!1;const u=j(t,h,a,s,n,!1,0,0);if(u.spatialReference=i??void 0,!u.isMultipart){for(let t=0,e=0;t<h;++t)u.vertexXY[2*t]=r[e++],u.vertexXY[2*t+1]=r[e++],s&&(u.vertexZ[t]=r[e++]),n&&(u.vertexM[t]=r[e++]);return u}const l=2+Number(s)+Number(n);let c=0,f=0;u.partOffsets[0]=0;for(const g of e){const t=u.partOffsets[f],e=t+g-Number(o);u.partOffsets[++f]=e;for(let i=t;i<e;++i)u.vertexXY[2*i]=r[c++],u.vertexXY[2*i+1]=r[c++],s&&(u.vertexZ[i]=r[c++]),n&&(u.vertexM[i]=r[c++]);o&&(c+=l)}return u}function I(t,e){return"getSpatialReference"in t&&(e=B(t.getSpatialReference()),t=t.getGeometry()),new _({...t.toFlatGeometry(),spatialReference:e})}function B(t){if(null==t)return;const e=t.getText()||void 0,r=t.isCustomWkid()?0:t.getOldID();if(r<=0)return{wkt:e};let s=t.getLatestID();(s<=0||s===r)&&(s=void 0);const n=t.getVCS();if(null==n)return{wkid:r,latestWkid:s,wkt:e};const i=n.isCustomWkid()?0:n.getOldID();if(i<=0)return{wkt:e};let a=t.getLatestVerticalID();return(a<=0||a===i)&&(a=void 0),{wkid:r,wkt:e,latestWkid:s,vcsWkid:i,latestVcsWkid:a}}class N{constructor(t,e){this.target=t,this.keys=e,this.oldValues=e.map(e=>t[e]);for(const r of e)t[r]=void 0}[Symbol.dispose](){this.keys.map((t,e)=>{this.target[t]=this.oldValues[e]})}}function L({spatialReference:t}){return t instanceof r?t.toJSON():t}function T({vertexXY:t,vertexZ:e,vertexM:r}){return e?r?s=>[t[2*s],t[2*s+1],e[s],r[s]]:r=>[t[2*r],t[2*r+1],e[r]]:r?e=>[t[2*e],t[2*e+1],r[e]]:e=>[t[2*e],t[2*e+1]]}function z(t){switch(t){case 1:return 0;case 4:return 10;case 2:return 4}}function k(t){if(t.length>0){const e=t[0],r=d(t.at(-1));return e.every((t,e)=>t===r[e])?1:0}return 0}function j(t,e,r,s,n,i,a,o){a??=0,o??=0;const h=new _({type:t,vertexCount:e,vertexXY:null,vertexZ:void 0,vertexM:void 0,partCount:r,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:a,segmentCountBezier:o});let u=2*Float64Array.BYTES_PER_ELEMENT*e;s&&(u+=Float64Array.BYTES_PER_ELEMENT*e),n&&(u+=Float64Array.BYTES_PER_ELEMENT*e),h.isMultipart&&(u+=(r+1)*Int32Array.BYTES_PER_ELEMENT,u+=(r+1)*Int8Array.BYTES_PER_ELEMENT),i&&(u+=e*Int8Array.BYTES_PER_ELEMENT,u+=e*Int32Array.BYTES_PER_ELEMENT,u+=h.segmentParamCount*Float64Array.BYTES_PER_ELEMENT);const l=new ArrayBuffer(u);let c=0;if(h.vertexXY=new Float64Array(l,c,2*e),c+=h.vertexXY.byteLength,s&&(h.vertexZ=new Float64Array(l,c,e),c+=h.vertexZ.byteLength),n&&(h.vertexM=new Float64Array(l,c,e),c+=h.vertexM.byteLength),i&&(h.segmentParams=new Float64Array(l,c,h.segmentParamCount),c+=h.segmentParams.byteLength,h.segmentIndices=new Int32Array(l,c,e),h.segmentIndices.fill(U),c+=h.segmentIndices.byteLength),h.isMultipart&&(h.partOffsets=new Int32Array(l,c,r+1),c+=h.partOffsets.byteLength,h.partFlags=new Int8Array(l,c,r+1),c+=h.partFlags.byteLength),i&&(h.segmentFlags=new Int8Array(l,c,e),h.segmentFlags.fill(1),c+=h.segmentFlags.byteLength),"polygon"===h.type)for(let f=0;f<r;++f)h.partFlags[f]=1;return h}const W=1.61803,U=-1;export{_ as FlatGeometry,X as convertGeometryToFlat,I as convertGeometryxToFlat,b as convertOptimizedGeometryToFlat,w as getBoundingBox,V as getBoundingRect,F as getExtentJSON};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{P as e}from"../../../chunks/Point2D.js";import"../../../chunks/Envelope2D.js";import{G as t}from"../../../chunks/Geometry.js";import{E as n,P as
|
|
5
|
+
import{P as e}from"../../../chunks/Point2D.js";import"../../../chunks/Envelope2D.js";import{G as t}from"../../../chunks/Geometry.js";import{E as n,P as a}from"../../../chunks/Envelope.js";import{M as s}from"../../../chunks/MultiPathImpl.js";import r from"../../Extent.js";import o from"../../Multipoint.js";import u from"../../Point.js";import i from"../../Polygon.js";import c from"../../Polyline.js";import"./initNoPeFactory.js";import{fromGeometryToGXGeometry as l,fromGeometryToGXGeometryUsingImportOperator as h,fromSpatialReference as m,toGeometry as f}from"./jsonConverter.js";const p="_gxVersion",g=2,y=1;function C(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function M(e){switch(e.type){case"point":return v(e);case"multipoint":return x(e);case"polyline":return Z(e);case"polygon":return P(e);case"extent":return V(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function V(e){if(!e.getCacheValue(p)){const t=new n;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(g,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(y,0,e.zmin,e.zmax),e.setCacheValue(p,t)}return e.getCacheValue(p)}function x(e){if(!e.getCacheValue(p)){const t=new s,n=new a,r=e.points,o=e.hasM,u=e.hasZ,i=u?3:2;for(let e=0,a=r.length;e<a;e++){const a=r[e];n.setXYCoords(a[0],a[1]),u&&n.setZ(a[2]??0),o&&n.setM(a[i]??NaN),t.add(n)}e.setCacheValue(p,t)}return e.getCacheValue(p)}function v(e){if(!e.getCacheValue(p)){const t=new a;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(p,t)}return e.getCacheValue(p)}function P(e){if(!e.getCacheValue(p)){const{curveRings:t,hasM:n,hasZ:a,rings:s}=e,r=l({curveRings:t,hasM:n,hasZ:a,rings:s});e.setCacheValue(p,r)}return e.getCacheValue(p)}function Z(e){if(!e.getCacheValue(p)){const{curvePaths:t,hasM:n,hasZ:a,paths:s}=e,r=l({curvePaths:t,hasM:n,hasZ:a,paths:s});e.setCacheValue(p,r)}return e.getCacheValue(p)}function j(e){if(!e.getCacheValue(p)){const{curvePaths:t,hasM:n,hasZ:a,paths:s}=e,r=h({curvePaths:t,hasM:n,hasZ:a,paths:s});e.setCacheValue(p,r)}return e.getCacheValue(p)}function w(e){return m(e)}function E(e,n){if(e)switch(e.getGeometryType()){case t.enumPoint:return z(e,n);case t.enumEnvelope:return R(e,n);case t.enumMultiPoint:return d(e,n);case t.enumPolyline:return Y(e,n);case t.enumPolygon:return X(e,n)}return null}function R(e,t){if(e.isEmpty())return null;const n=new r({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),a=e.getDescription();if(a.hasM()){const t=e.queryInterval(g,0);n.mmin=t.vmin,n.mmax=t.vmax}if(a.hasZ()){const t=e.queryInterval(y,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(p,e),n}function d(e,t){if(e.isEmpty())return null;const n=e.getDescription(),s=n.hasM(),r=n.hasZ(),u=[],i=new a;for(let a=0,o=e.getPointCount();a<o;a++){e.getPointByVal(a,i);const t=[i.getX(),i.getY()];r&&t.push(i.getZ()),s&&t.push(i.getM()),u.push(t)}const c=new o({hasM:s,hasZ:r,points:u,spatialReference:t});return c.setCacheValue(p,e),c}function z(t,n){if(t instanceof e)return new u({x:t.x,y:t.y,spatialReference:n});if(t.isEmpty())return null;const a=new u({x:t.getX(),y:t.getY(),spatialReference:n}),s=t.getDescription();return s.hasM()&&(a.m=t.getM()),s.hasZ()&&(a.z=t.getZ()),a.setCacheValue(p,t),a}function X(e,t){if(e.isEmpty())return null;const n=i.fromJSON({...f(e,null),spatialReference:t});return n.setCacheValue(p,e),n}function Y(e,t){if(e.isEmpty())return null;const n=c.fromJSON({...f(e,null),spatialReference:t});return n.setCacheValue(p,e),n}export{V as fromExtent,M as fromGeometry,x as fromMultipoint,v as fromPoint,P as fromPolygon,Z as fromPolyline,j as fromPolylineUsingImportOperator,w as fromSpatialReference,C as getSpatialReference,R as toExtent,E as toGeometry,d as toMultipoint,z as toPoint,X as toPolygon,Y as toPolyline};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{d as e,a as t,g as n,q as r,p as i,G as s,t as a}from"../../../chunks/Geometry.js";import{aJ as o,i as u,d as m,P as l,b as c,aK as d,m as _}from"../../../chunks/Point2D.js";import{q as h,b as f,p,aX as k,c as b,e as y,a as N,f as T,aY as g}from"../../../chunks/UnitFactory.js";import{a2 as v,a5 as x,P as A,E as S,a0 as w,a1 as C,a6 as D,a7 as F,Y as j}from"../../../chunks/Envelope.js";import{a as O,P as z,S as I,M as E,J as P,a5 as B,a6 as R,a7 as V,a8 as M,a9 as U}from"../../../chunks/MultiPathImpl.js";import W from"../../SpatialReference.js";import"./initNoPeFactory.js";function X(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function Y(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class L{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:X}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:Y}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=o()&&this.m_currentValue<=u()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;e("unrecognized json element type")}return e("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt64Value(){return n(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&t("invalid token"),this.m_currentValue}isError(){return 0}}class G{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){n(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class q{constructor(t){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==t.sz?(this.m_sz=t.sz,t.buffer?(this.m_sz<0&&r("size out of range"),this.m_buffer=t.buffer,this.m_offset=void 0!==t.offset?t.offset:0,this.m_view=void 0!==t.offset?new DataView(t.buffer,t.offset,t.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&r("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):t.move?(this.m_sz=t.move.m_sz,this.m_buffer=t.move.m_buffer,this.m_view=t.move.m_view,this.m_bOwnsBuffer=t.move.m_bOwnsBuffer,this.m_bLittleEndian=t.move.m_bLittleEndian,t.move.m_buffer=null,t.move.m_view=null,t.move.m_sz=0,void(t.move.m_bOwnsBuffer=!0)):void e("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===q.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===q.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||i("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){n(e>=0&&e<=this.m_sz),this.m_sz=e}}function K(e,r,i,a,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,N=!1,T=!1,g=!1,w=!1,C=!1,D=!1,F=!1,j=!1,O=!1,z=!1,I=!1,E=!1,P=!1,B=Number.NaN,R=Number.NaN,V=Number.NaN,M=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,Y=Number.NaN,L=Number.NaN,G=Number.NaN,q=Number.NaN,K=Number.NaN,J=Number.NaN,re=0,ie=0,se=!1,ae=!1,oe=null,ue=null,me=null,le=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?le=Q(i):10!==i.currentToken()&&t("failed to parse spatial reference: object or null is expected");continue}}else if(a)if("hasZ"===u){if(!l){l=!0,se=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,ae=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==s.enumUnknown&&e!==s.enumPolygon)){_=!0,({geometry:ce,as:oe,bs:ue}=Z(!0,!1,r,i));continue}}else if("curveRings"===u){if(!h&&(e===s.enumUnknown||e===s.enumPolygon)){h=!0,({geometry:ce,as:oe,bs:ue}=Z(!0,!0,r,i));continue}}else if("paths"===u){if(!(f||p||e!==s.enumUnknown&&e!==s.enumPolyline)){f=!0,({geometry:ce,as:oe,bs:ue}=Z(!1,!1,r,i));continue}}else if("curvePaths"===u){if(!p&&(e===s.enumUnknown||e===s.enumPolyline)){p=!0,({geometry:ce,as:oe,bs:ue}=Z(!1,!0,r,i));continue}}else if("points"===u){if(!k&&(e===s.enumUnknown||e===s.enumMultiPoint)){k=!0,({geometry:ce,as:oe,bs:ue}=H(r,i));continue}}else if("ids"===u){if(!d){d=!0,me=$(r,i);continue}}else if("x"===u){if(!b&&(e===s.enumUnknown||e===s.enumPoint)){b=!0,B=ee(i);continue}}else if("y"===u){if(!y&&(e===s.enumUnknown||e===s.enumPoint)){y=!0,R=ee(i);continue}}else if("z"===u){if(!N&&(e===s.enumUnknown||e===s.enumPoint)){N=!0,V=ee(i);continue}}else if("m"===u){if(!T&&(e===s.enumUnknown||e===s.enumPoint)){T=!0,M=ee(i);continue}}else if("id"===u){if(!g&&(e===s.enumUnknown||e===s.enumPoint)){g=!0,U=te(i);continue}}else if("xmin"===u){if(!w&&(e===s.enumUnknown||e===s.enumEnvelope)){w=!0,W=ee(i);continue}}else if("ymin"===u){if(!C&&(e===s.enumUnknown||e===s.enumEnvelope)){C=!0,X=ee(i);continue}}else if("mmin"===u){if(!z&&(e===s.enumUnknown||e===s.enumEnvelope)){z=!0,K=ee(i);continue}}else if("zmin"===u){if(!j&&(e===s.enumUnknown||e===s.enumEnvelope)){j=!0,G=ee(i);continue}}else if("idmin"===u){if(!E&&(e===s.enumUnknown||e===s.enumEnvelope)){E=!0,re=te(i);continue}}else if("xmax"===u){if(!D&&(e===s.enumUnknown||e===s.enumEnvelope)){D=!0,Y=ee(i);continue}}else if("ymax"===u){if(!F&&(e===s.enumUnknown||e===s.enumEnvelope)){F=!0,L=ee(i);continue}}else if("mmax"===u){if(!I&&(e===s.enumUnknown||e===s.enumEnvelope)){I=!0,J=ee(i);continue}}else if("zmax"===u){if(!O&&(e===s.enumUnknown||e===s.enumEnvelope)){O=!0,q=ee(i);continue}}else if("idmax"===u){if(!P&&(e===s.enumUnknown||e===s.enumEnvelope)){P=!0,ie=te(i);continue}}else"materials"===u&&n(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;se&&(ce.addAttribute(1),e=oe,e||(e=v(n.getPointCount(),Number.NaN))),ae&&(ce.addAttribute(2),t=se?ue:oe),null!=me&&ce.addAttribute(3),se&&null!=e&&n.setAttributeStreamRef(1,e),ae&&null!=t&&n.setAttributeStreamRef(2,t),null!=me&&ne(n,me)}else if(b||y||T||N||g){x(B,R)||t("failed to parse point: x and y must be finite or nan"),(Number.isNaN(R)||Number.isNaN(B))&&(B=Number.NaN,R=Number.NaN);const e=new A({x:B,y:R});N&&e.setZ(V),T&&e.setM(M),g&&e.setID(U),ce=e}else if(w||C||D||F||j||O||z||I||E||P){(Number.isNaN(X)||Number.isNaN(Y)||Number.isNaN(L))&&(W=Number.NaN);const e=new S({xmin:W,ymin:X,xmax:Y,ymax:L});j&&O&&e.setInterval(1,0,G,q),z&&I&&e.setInterval(2,0,K,J),E&&P&&e.setInterval(3,0,re,ie),ce=e}return{...ce?{geom:ce}:{},...le?{sr:le}:{}}}function J(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function Q(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,g=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,O=0,z=0,I=0,E=0,P=0,B=0,R=0,V=0,M="",U="",W=null;for(;3!==e.nextToken();){const h=e.currentString();e.nextToken(),"wkid"===h?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===h?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===h?s||(s=!0,6===e.currentToken()&&(M=e.currentString())):"wkt2"===h?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===h?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===h?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===h?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===h?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===h?m||(m=!0,a=!0,O=e.currentDoubleValue()):"falseX"===h?l||(l=!0,a=!0,P=e.currentDoubleValue()):"falseY"===h?c||(c=!0,a=!0,B=e.currentDoubleValue()):"falseZ"===h?d||(d=!0,a=!0,R=e.currentDoubleValue()):"falseM"===h?_||(_=!0,a=!0,V=e.currentDoubleValue()):"xyUnits"===h?g||(g=!0,a=!0,z=e.currentDoubleValue()):"zUnits"===h?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===h?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===h?A||(A=!0,W=J(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let X=null,Y=!0;if(0!==M.length&&(Y=!1,h(M)&&(X=f(M))),X||0===U.length||(Y=!1,h(U)&&(X=f(U))),!X&&w>0&&(Y=!1,p(w)&&(D<=0||k())&&(X=b(w,D))),!X&&S>0&&(Y=!1,p(S)&&(C<=0||k())&&(X=b(S,C))),Y&&(X=y(W)),a&&X){const e=new N;X.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,O),g&&l&&c&&e.setGridParams(P,B,z),v&&d&&e.setZParams(R,I),x&&_&&e.setMParams(V,E),X=T(X,e)}return X}function Z(e,n,r,i){2!==i.currentToken()&&t("failed to parse multipath: array of array of vertices is expected");const s=e?new O:new z,a=s,o=w(0),u=v(2,0),_=C(0);let h=null,f=null,p=null,k=null,b=null,y=0,N=0,T=0;const g=new I,x=l.getNAN();let A=0,S=0;const F=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&t("failed to parse multipath: ring/path array is expected");let r=2,s=0,j=!0;const O=4;let z=0,I=0;const E=l.getNAN(),P=m(O,Number.NaN),B=m(O,Number.NaN);let R=!1;for(i.nextToken();4!==i.currentToken();){if(n&&1===i.currentToken())j&&t("failed to parse multipath: starting vertex array is expected"),p||(p=C(A-1,1),k=w(A-1,-1),b=v(0)),R=!0,r=1,({segFlag:T,toPointSz:z}=me(g,P,x,i));else{for(R=!1,2!==i.currentToken()&&t("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),z=0;4!==i.nextToken();)z===O&&t("failed to parse multipath: each vertex array has to have at most 4 elements"),P[z++]=ee(i);z<2&&t("failed to parse multipath: each vertex array has to have at least 2 elements"),D(P[0],P[1])||t("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*A&&u.resize(re(A)),u.writePoint2D(2*A,E.setCoords(P[0],P[1])),h&&h.size()===A&&h.resize(ie(A)),z>2?(h||(h=v(A+1,Number.NaN)),h.write(A,P[2])):h&&h.write(A,Number.NaN),f&&f.size()===A&&f.resize(ie(A)),z>3?(f||(f=v(A+1,Number.NaN)),f.write(A,P[3])):f&&f.write(A,Number.NaN),j)S++,o.add(A),_.add(F),j=!1,I=z,c(B,P,0,0,I);else if(null!==p)if(R){const e=U(T),t=b.size();b.resize(t+e),p.add(T),k.add(y),g.get().writeInBufferStream(b,y),y+=e,a.incCurveType(T,1),N++}else p.add(1),k.add(-1);A++,s++,x.setCoords(P[0],P[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&z===I&&0===d(P,B,z)?(A--,s--):null!==p&&(p.add(1),k.add(-1)))}return A&&(o.resize(S),_.resize(S),A>0&&(o.add(A),_.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(_),a.setPathStreamRef(o),null!==p&&(a.updateCurveCounter(N),a.setSegmentData(k,b,p,y)),a.notifyModifiedFlags(65535)),{geometry:s,as:h,bs:f}}function H(e,n){2!==n.currentToken()&&t("failed to parse multipoint: array of vertices is expected");let r=0;const i=new E,s=v(2,0);let a=0;const o=4,u=m(o,Number.NaN),c=new l;let d=null,_=null;for(;4!==n.nextToken();){for(2!==n.currentToken()&&t("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==n.nextToken();)a===o&&t("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=ee(n);a<2&&t("failed to parse multipoint: each vertex array has to have at least 2 elements"),D(u[0],u[1])||t("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(re(r)),s.writePoint2D(2*r,c.setCoords(u[0],u[1])),d&&d.size()===r&&d.resize(ie(r)),a>2?(d||(d=v(r+1,Number.NaN)),d.write(r,u[2])):d&&d.write(r,Number.NaN),_&&_.size()===r&&_.resize(ie(r)),a>3?(_||(_=v(r+1,Number.NaN)),_.write(r,u[3])):_&&_.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:d,bs:_}}function $(e,n){2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected");const r=F(2,0);let i=0,s=-1;for(;4!==n.nextToken();){const e=i;r.size()===i&&r.resize(ie(i)),i++;let a=0;for(-1===s?s=2===n.currentToken()?1:0:1===s&&2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(ie(i)),r.write(i,te(n)),a++,i++);4!==n.nextToken();)r.size()===i&&r.resize(ie(i)),r.write(i,te(n)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function ee(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function te(e){return e.currentInt32Value()}function ne(t,n){if(t.isEmpty())return;const r=F(2,0),i=t.getGeometryType();let s=0;i===E.type?s=1:i===z.type||i===O.type?s=t.getPathCount():e("not implemented"),r.resize(t.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===E.type?m=t.getPointCount():i===z.type||i===O.type?(m=t.getPathSize(o),l=t.getPathStart(o)):e("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}t.getImpl().setAttributeStreamRef(3,r)}function re(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function ie(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function se(e,t,n,i,s){s>=i.size()&&r("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=l.getNAN();a.x=i.readDouble(s),a.y=i.readDouble(s+8);const o=i.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),!1;let u=!!(64&o);const m=!!(128&o);let c=!!(32&o);const d=!!(8&o),_=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,c=!0),c&&h&&(u=!0,c=!1,a.setCoords(0,0)),u||(m?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):V(e,t,n,a,d,_)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,M(e,Number.NaN,d,_),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),R(e),!0}function ae(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,M(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),R(e),!0}function oe(e,t,r,i,s){return n(s+32<=i.size()),e.m_cp=_(l,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=r.x,e.m_YEnd=r.y,!0}function ue(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function me(e,n,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),m=u[0];for((1!==u.length||"a"!==m&&"b"!==m&&"c"!==m&&"n"!==m&&"q"!==m)&&t('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&t("failed to parse curve: vertex array cannot have more than 4 elements"),n[a.toPointSz++]=ee(i);a.toPointSz<2&&t("failed to parse curve: vertex array must have at least 2 elements");const c=l.construct(n[0],n[1]),d=l.getNAN();let _=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[l.getNAN(),l.getNAN(),l.getNAN()],N=l.getNAN();if("a"===m){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for center point"),d.setCoords(e,n),o=i.nextToken(),_=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=ee(i),o=i.nextToken(),k=ee(i),o=i.nextToken(),b=ee(i),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===m){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===m){{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,n)}o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);y[1].setCoords(e,n),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===m){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for interior point"),N.setCoords(e,n),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&t("failed to parse curve: end object is expected for curve"),"a"===m)if(e.createEllipticArc(),f){const t=!0;le(e.get(),r,c,d,t,_,h)}else ce(e.get(),r,c,d,_,h,p,k,b);else if("b"===m)e.createCubicBezier(),de(e.get(),r,c,y);else if("n"===m)e.createQuadraticRationalBezier(),_e(e.get(),r,c,y[0],y[1].x,y[1].y,y[2].x);else if("q"===m)e.createQuadraticBezier(),e.get().construct(r,y[0],c);else{e.createEllipticArc();const t=!1;le(e.get(),r,c,N,t,-1,-1)}return a}function le(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new q({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,se(e,t,n,m,0)}function ce(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new q({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,ae(e,t,n,c,0)}function de(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new q({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,oe(e,t,n,a,0)}function _e(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new q({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,ue(e,t,n,m,0)}function he(e,t,n,r,i){const o=e.getGeometryType();if(o===s.enumEllipticArc)return fe(e,t,n,r,i);if(o===s.enumBezier)return pe(e,t,n,r,i);if(o===s.enumRationalBezier2)return ke(e,t,n,r,i);if(o===s.enumBezier2){const s=new P;return s.constructFromQuadraticSegment(e),pe(s,t,n,r,i)}a("")}function fe(e,t,r,i,s){n(!B(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!r;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return be(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s),ye(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;ye(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s);const t=e;ye(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function pe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),be(a,o,s.x,s.y,u,m,r,i),ye(e.m_cp[0].x,e.m_cp[0].y,r,i),ye(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function ke(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),be(a,o,s.x,s.y,u,m,r,i),ye(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function be(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function ye(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class Ne{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){Te(e,t,n,r)}exportSpatialReference(e,t,r,i){n(0)}exportProjectionTransformation(e,t,r,i){n(0)}exportDatumTransformation(e,t,r,i){n(0)}static geometryTypeToString(e){return n(0),""}}function Te(t,r,i,a,o){if(r||i){if(a.startObject(),null!==r){switch(r.getGeometryType()){case s.enumPolygon:ge(!0,t,r,a);break;case s.enumPolyline:ge(!1,t,r,a);break;case s.enumMultiPoint:ve(t,r,a);break;case s.enumPoint:xe(t,r,a);break;case s.enumEnvelope:Ae(t,r,a);break;case s.enumMultipatch:n(0);break;default:e("exportToJSON")}}null!==i&&(a.addFieldName("spatialReference"),we(t,i,a)),a.endObject()}}function ge(e,t,r,i){const s=r.getImpl(),o=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!o,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(r.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const n=r.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const N=new I;let T=null,g=null,v=null;_&&(T=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=j(3,0));for(let t=0;t<n;t++){i.startArray(),d&&f.push(0);const n=r.getPathEnd(t);if(m===n){i.endArray();continue}const s=r.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;Ce(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,O=S,z=w;let I=!1,E=0,P=Number.NaN,B=Number.NaN,R=0;for(let t=m+1,r=m,V=s?n+1:n;t<V;t++,r++){const s=null!==T?31&T.read(r):1;let m,V;if(t<n?(m=p.read(2*t),V=p.read(2*t+1),l&&(P=k.read(t)),c&&(B=b.read(t)),d&&(R=y.read(t))):(m=D,V=F,P=j,B=O,R=z),1!==s){I=!0,4===s?N.createEllipticArc():2===s?N.createCubicBezier():16===s?N.createQuadraticBezier():8===s?N.createQuadraticRationalBezier():a("JSON export.unsupported curve");const t=N.get(),n=g.read(r);t.setStartXYCoords(_,x),t.setEndXYCoords(m,V),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,P)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,B)),t.readFromBufferStream(v,n);he(N.get(),o,u,e,i)&&E++}else Ce(l,c,m,V,P,B,e,i);d&&(h.add(R),f[f.length-1]++),C++,_=m,x=V,A=P,S=B,w=R}I&&0===E||(C<2&&E<1&&(Ce(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(Ce(l,c,D,F,j,O,e,i),C++,_=D,x=F,A=j,S=O,w=z,d&&(h.add(z),f[f.length-1]++))),i.endArray(),m=n}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,r=f.length;t<r;++t){const r=f[t];n(0===r||null!==h&&e+r<=h.size()),i.startArray();for(let t=0;t<r;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function ve(e,t,r){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(r.addFieldName("hasZ"),r.addBool(!0)),a&&(r.addFieldName("hasM"),r.addBool(!0)),r.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())r.startArray(),r.endArray();else{const t=17-(31&e>>13);r.startArray();const n=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=n.read(2*e),u=n.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),Ce(s,a,i,u,l,c,t,r)}r.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),n(0===u||null!==e&&e.size()>=u),r.addFieldName("ids"),r.startArray();for(let t=0;t<u;t++)r.addInt32(e.read(t));r.endArray()}}function xe(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function Ae(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function Se(e,n,r){r.startObject();const i=n.getID();i<=0&&t("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function we(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),Se(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new N;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Ce(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const De={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_r:"r".charCodeAt(0),s_t:"t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Fe{constructor(t){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===t?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):t.jsonString?this.resetParserFromString(t.jsonString):t.jsonStream?a("streaming json parsing not yet impl"):e("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){a("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){a("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return n(0),""}childrenAsString(){return n(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e);return}if(2===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e);return}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}t("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===De.s_backslash&&t.charCodeAt(r+1)===De.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===De.s_backslash&&t.charCodeAt(r+1)===De.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==De.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case De.s_doubleQuote:e+='"';break;case De.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case De.s_backslash:e+="\\";break;case De.s_forwardslash:e+="/";break;case De.s_b:e+="\b";break;case De.s_f:e+="\f";break;case De.s_n:e+="\n";break;case De.s_r:e+="\r";break;case De.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&t("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),n-=2,0===n&&t("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&t("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&t("invalid token");let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),n-=2,0===n&&t("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&t("invalid token"),r}currentInt64Value(){return n(0),0n}currentBoolValue(){return n(0),!1}isError(){return 0}JSONString(){return n(0),""}pushPosition(){return n(0),!1}popPosition(){return n(0),!1}skipCStyleComments_(){n(0)}skipCppStyleComments_(){n(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e===De.s_asterisk?this.skipCStyleComments_():e===De.s_forwardslash?this.skipCppStyleComments_():t("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&t("invalid token");let n=this.m_peekChar();for(;n>=9&&n<=13||32===n;)this.m_increment(),this.m_eof()&&t("invalid token"),n=this.m_peekChar();n===De.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===De.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===De.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&t("invalid token");let e=this.m_peekChar();for(;e!==De.s_doubleQuote;){const n=e===De.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),n)if(this.m_bHasEscapes=!0,e===De.s_doubleQuote||e===De.s_backslash||e===De.s_forwardslash||e===De.s_b||e===De.s_f||e===De.s_n||e===De.s_r||e===De.s_t)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar();else if(e===De.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=De.s_zero&&e<=De.s_nine||e>=De.s_a&&e<=De.s_f||e>=De.s_A&&e<=De.s_F||t("invalid token");else t("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===De.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===De.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):t("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==De.s_doubleQuote&&t("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():t("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():t("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==De.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()}while(e>=De.s_zero&&e<=De.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=De.s_zero&&e<=De.s_nine||t("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e!==De.s_plus&&e!==De.s_minus||(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()),e>=De.s_zero&&e<=De.s_nine||t("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,n=this.m_peekChar();if(n===De.s_minus?(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),n=this.m_peekChar(),e=!0,n>=De.s_zero&&n<=De.s_nine||t("invalid token"),this.int_()):this.int_(),n=this.m_peekChar(),n===De.s_period)this.m_currentTokenType=7,this.frac_(),n=this.m_peekChar(),n!==De.s_e&&n!==De.s_E||this.exp_();else if(n===De.s_e||n===De.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"null"!==e&&t("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"true"!==e&&t("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:n}=this.m_get(6);n&&t("invalid token"),"false"!==e&&t("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:n}=this.m_get(4);n&&t("invalid token"),"NaN"!==e&&t("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===De.s_beginObject?this.valueStartObject_():e===De.s_beginArray?this.valueStartArray_():e===De.s_doubleQuote?this.valueString_():e===De.s_minus||e>=De.s_zero&&e<=De.s_zero+9?this.valueNumber_():e===De.s_n?this.valueNull_():e===De.s_t?this.valueTrue_():e===De.s_f?this.valueFalse_():e===De.s_N?this.valueNan_():t("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==De.s_beginObject&&e!==De.s_beginArray&&t("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class je{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,n,r,i,s,a,o){let u;"string"==typeof r?(u=new Fe({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&t("failed to import map geometry: start of object is expected");const m=K(n,e,u,i,s);return new g(m)}importSpatialReference(t){const n=Q(t);return null===n&&e("failed to import spatial reference"),n}importProjectionTransformation(e,t){return n(0),{}}importDatumTransformation(e,t){return n(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||t("string_to_geometry_type"),e.endsWith("point")?s.enumPoint:e.endsWith("envelope")?s.enumEnvelope:e.endsWith("multipoint")?s.enumMultiPoint:e.endsWith("polyline")?s.enumPolyline:e.endsWith("polygon")?s.enumPolygon:void t("string_to_geometry_type")}}const Oe=new G,ze=new Ne,Ie=new je;function Ee(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Pe(e,t){const{includeGeometry:n=!0,includeSpatialReference:r=!0}=t??{};r&&(e.spatialReference?.latestVcsWkid||e.spatialReference?.vcsWkid)&&(e={...e,spatialReference:{...e.spatialReference}},delete e.spatialReference?.latestVcsWkid,delete e.spatialReference?.vcsWkid);const i=new L(e,{strict:!1});return i.nextToken(),Ie.execute(0,s.enumUnknown,i,n,r)}function Be(e){let t=null;return[e.map(e=>{if(null==t){const n=Re(e);return t=n.getSpatialReference(),n.getGeometry()}return Ve(e)}),t]}function Re(e){if(e.spatialReference instanceof W){const{wkt2:t}=e.spatialReference;e={...e,spatialReference:e.spatialReference.toJSON()},e.spatialReference.wkt2??=t}return Pe(e)}function Ve(e){return Pe(e,{includeSpatialReference:!1}).getGeometry()}function Me(e){if(e instanceof W){const{wkt2:t}=e;e=e.toJSON(),e.wkt2??=t}const t=Pe({x:0,y:0,spatialReference:e},{includeGeometry:!1}).getSpatialReference();return 0!==t?.getCoordinateSystemType()?t:null}function Ue(e,t){return e instanceof g&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(Oe.reset(),ze.execute(0,e,t,Oe),Oe.getObject())}export{Be as fromGeometries,Re as fromGeometry,Ve as fromGeometryToGXGeometry,Me as fromSpatialReference,Ee as getSpatialReference,Ue as toGeometry};
|
|
5
|
+
import{P as e,D as t,A as n,n as r,a2 as i,a5 as s,E as a,a0 as o,a1 as u,a6 as m,a7 as l,Y as c}from"../../../chunks/Envelope.js";import{a as d,P as _,M as h,S as f,J as p,a5 as k,a6 as b,a7 as y,a8 as g,a9 as N}from"../../../chunks/MultiPathImpl.js";import{d as T,a as v,g as x,q as A,p as S,G as w,t as C}from"../../../chunks/Geometry.js";import{aJ as D,i as F,d as j,P as z,b as O,aK as I,m as E}from"../../../chunks/Point2D.js";import{q as P,b as B,p as V,aX as R,c as M,e as U,a as W,f as X,aY as Y}from"../../../chunks/UnitFactory.js";import{convertGeometryxToFlat as G,convertGeometryToFlat as L}from"../../FlatGeometry.js";import q from"../../SpatialReference.js";import"./initNoPeFactory.js";import{isPoint as K,isMultipoint as J,isPolyline as Z,isPolygon as Q}from"../../support/jsonUtils.js";function H({type:i,vertexCount:s,vertexXY:a,vertexZ:o,vertexM:u,partCount:m,partOffsets:l,partFlags:c,segmentFlags:d,segmentIndices:_,segmentParams:f,segmentCountArc:p,segmentCountBezier:k}){const b=new $[i];if(b instanceof e)return b.setXYCoords(a[0],a[1]),o&&b.setZ(o[0]),u&&b.setM(u[0]),b;const y=new t({fromArray:a});if(b.setAttributeStreamRef(0,y),o){const e=new t({fromArray:o});b.setAttributeStreamRef(1,e)}if(u){const e=new t({fromArray:u});b.setAttributeStreamRef(2,e)}if(b instanceof h)return b.resizeNoInit(s),b;{const e=m+1,t=new n({fromArray:l,size:e}),i=new r({fromArray:c,size:e});b.setPathStreamRef(t),b.setPathFlagsStreamRef(i)}if(null==d)return b.resizeImpl(s),b;const g=new r({fromArray:d}),N=new n({fromArray:_}),T=new t({fromArray:f});return b.setSegmentData(N,T,g,f.length),b.incCurveType(4,p),b.incCurveType(2,k),b.modifyCurveCounter(p+k),b.resizeImpl(s),b}const $={point:e,multipoint:h,polyline:_,polygon:d};function ee(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function te(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class ne{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:ee}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:te}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=D()&&this.m_currentValue<=F()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;T("unrecognized json element type")}return T("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&v("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&v("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&v("invalid token"),this.m_currentValue}currentInt64Value(){return x(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&v("invalid token"),this.m_currentValue}isError(){return 0}}class re{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){x(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class ie{constructor(e){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==e.sz?(this.m_sz=e.sz,e.buffer?(this.m_sz<0&&A("size out of range"),this.m_buffer=e.buffer,this.m_offset=void 0!==e.offset?e.offset:0,this.m_view=void 0!==e.offset?new DataView(e.buffer,e.offset,e.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&A("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):e.move?(this.m_sz=e.move.m_sz,this.m_buffer=e.move.m_buffer,this.m_view=e.move.m_view,this.m_bOwnsBuffer=e.move.m_bOwnsBuffer,this.m_bLittleEndian=e.move.m_bLittleEndian,e.move.m_buffer=null,e.move.m_view=null,e.move.m_sz=0,void(e.move.m_bOwnsBuffer=!0)):void T("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===ie.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===ie.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||S("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){x(e>=0&&e<=this.m_sz),this.m_sz=e}}function se(t,n,r,o,u,m){let l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,g=!1,N=!1,T=!1,A=!1,S=!1,C=!1,D=!1,F=!1,j=!1,z=!1,O=!1,I=!1,E=!1,P=!1,B=Number.NaN,V=Number.NaN,R=Number.NaN,M=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,Y=Number.NaN,G=Number.NaN,L=Number.NaN,q=Number.NaN,K=Number.NaN,J=Number.NaN,Z=0,Q=0,H=!1,$=!1,ee=null,te=null,ne=null,re=null,ie=null;for(;3!==r.nextToken();){const e=r.currentString();if(r.nextToken(),"spatialReference"===e){if(u&&!l){l=!0,1===r.currentToken()?re=oe(r):10!==r.currentToken()&&v("failed to parse spatial reference: object or null is expected");continue}}else if(o)if("hasZ"===e){if(!c){c=!0,H=11===r.currentToken();continue}}else if("hasM"===e){if(!d){d=!0,$=11===r.currentToken();continue}}else if("rings"===e){if(!(h||f||t!==w.enumUnknown&&t!==w.enumPolygon)){h=!0,({geometry:ie,as:ee,bs:te}=ue(!0,!1,n,r));continue}}else if("curveRings"===e){if(!f&&(t===w.enumUnknown||t===w.enumPolygon)){f=!0,({geometry:ie,as:ee,bs:te}=ue(!0,!0,n,r));continue}}else if("paths"===e){if(!(p||k||t!==w.enumUnknown&&t!==w.enumPolyline)){p=!0,({geometry:ie,as:ee,bs:te}=ue(!1,!1,n,r));continue}}else if("curvePaths"===e){if(!k&&(t===w.enumUnknown||t===w.enumPolyline)){k=!0,({geometry:ie,as:ee,bs:te}=ue(!1,!0,n,r));continue}}else if("points"===e){if(!b&&(t===w.enumUnknown||t===w.enumMultiPoint)){b=!0,({geometry:ie,as:ee,bs:te}=me(n,r));continue}}else if("ids"===e){if(!_){_=!0,ne=le(n,r);continue}}else if("x"===e){if(!y&&(t===w.enumUnknown||t===w.enumPoint)){y=!0,B=ce(r);continue}}else if("y"===e){if(!g&&(t===w.enumUnknown||t===w.enumPoint)){g=!0,V=ce(r);continue}}else if("z"===e){if(!N&&(t===w.enumUnknown||t===w.enumPoint)){N=!0,R=ce(r);continue}}else if("m"===e){if(!T&&(t===w.enumUnknown||t===w.enumPoint)){T=!0,M=ce(r);continue}}else if("id"===e){if(!A&&(t===w.enumUnknown||t===w.enumPoint)){A=!0,U=de(r);continue}}else if("xmin"===e){if(!S&&(t===w.enumUnknown||t===w.enumEnvelope)){S=!0,W=ce(r);continue}}else if("ymin"===e){if(!C&&(t===w.enumUnknown||t===w.enumEnvelope)){C=!0,X=ce(r);continue}}else if("mmin"===e){if(!O&&(t===w.enumUnknown||t===w.enumEnvelope)){O=!0,K=ce(r);continue}}else if("zmin"===e){if(!j&&(t===w.enumUnknown||t===w.enumEnvelope)){j=!0,L=ce(r);continue}}else if("idmin"===e){if(!E&&(t===w.enumUnknown||t===w.enumEnvelope)){E=!0,Z=de(r);continue}}else if("xmax"===e){if(!D&&(t===w.enumUnknown||t===w.enumEnvelope)){D=!0,Y=ce(r);continue}}else if("ymax"===e){if(!F&&(t===w.enumUnknown||t===w.enumEnvelope)){F=!0,G=ce(r);continue}}else if("mmax"===e){if(!I&&(t===w.enumUnknown||t===w.enumEnvelope)){I=!0,J=ce(r);continue}}else if("zmax"===e){if(!z&&(t===w.enumUnknown||t===w.enumEnvelope)){z=!0,q=ce(r);continue}}else if("idmax"===e){if(!P&&(t===w.enumUnknown||t===w.enumEnvelope)){P=!0,Q=de(r);continue}}else"materials"===e&&x(0);r.skipChildren()}if(h||f||p||k||b){let e=null,t=null;const n=ie;H&&(ie.addAttribute(1),e=ee,e||(e=i(n.getPointCount(),Number.NaN))),$&&(ie.addAttribute(2),t=H?te:ee),null!=ne&&ie.addAttribute(3),H&&null!=e&&n.setAttributeStreamRef(1,e),$&&null!=t&&n.setAttributeStreamRef(2,t),null!=ne&&_e(n,ne)}else if(y||g||T||N||A){s(B,V)||v("failed to parse point: x and y must be finite or nan"),(Number.isNaN(V)||Number.isNaN(B))&&(B=Number.NaN,V=Number.NaN);const t=new e({x:B,y:V});N&&t.setZ(R),T&&t.setM(M),A&&t.setID(U),ie=t}else if(S||C||D||F||j||z||O||I||E||P){(Number.isNaN(X)||Number.isNaN(Y)||Number.isNaN(G))&&(W=Number.NaN);const e=new a({xmin:W,ymin:X,xmax:Y,ymax:G});j&&z&&e.setInterval(1,0,L,q),O&&I&&e.setInterval(2,0,K,J),E&&P&&e.setInterval(3,0,Z,Q),ie=e}return{...ie?{geom:ie}:{},...re?{sr:re}:{}}}function ae(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function oe(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=-1,y=-1,g=-1,N=-1,T=0,v=0,x=0,A=0,S=0,w=0,C=0,D=0,F=0,j=0,z="",O="",I=null;for(;3!==e.nextToken();){const E=e.currentString();e.nextToken(),"wkid"===E?t||(t=!0,8===e.currentToken()&&(b=e.currentInt32Value())):"latestWkid"===E?n||(n=!0,8===e.currentToken()&&(y=e.currentInt32Value())):"wkt"===E?s||(s=!0,6===e.currentToken()&&(z=e.currentString())):"wkt2"===E?s||6===e.currentToken()&&(O=e.currentString()):"vcsWkid"===E?r||(r=!0,8===e.currentToken()&&(g=e.currentInt32Value())):"latestVcsWkid"===E?i||(i=!0,8===e.currentToken()&&(N=e.currentInt32Value())):"xyTolerance"===E?o||(o=!0,a=!0,T=e.currentDoubleValue()):"zTolerance"===E?u||(u=!0,a=!0,v=e.currentDoubleValue()):"mTolerance"===E?m||(m=!0,a=!0,x=e.currentDoubleValue()):"falseX"===E?l||(l=!0,a=!0,C=e.currentDoubleValue()):"falseY"===E?c||(c=!0,a=!0,D=e.currentDoubleValue()):"falseZ"===E?d||(d=!0,a=!0,F=e.currentDoubleValue()):"falseM"===E?_||(_=!0,a=!0,j=e.currentDoubleValue()):"xyUnits"===E?h||(h=!0,a=!0,A=e.currentDoubleValue()):"zUnits"===E?f||(f=!0,a=!0,S=e.currentDoubleValue()):"mUnits"===E?p||(p=!0,a=!0,w=e.currentDoubleValue()):"unit"===E?k||(k=!0,I=ae(e)):e.skipChildren()}N<=0&&g>0&&(N=g),g<=0&&N>0&&(g=N);let E=null,Y=!0;if(0!==z.length&&(Y=!1,P(z)&&(E=B(z))),E||0===O.length||(Y=!1,P(O)&&(E=B(O))),!E&&y>0&&(Y=!1,V(y)&&(N<=0||R())&&(E=M(y,N))),!E&&b>0&&(Y=!1,V(b)&&(g<=0||R())&&(E=M(b,g))),Y&&(E=U(I)),a&&E){const e=new W;E.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,T),u&&e.setTolerance(1,v),m&&e.setTolerance(2,x),h&&l&&c&&e.setGridParams(C,D,A),f&&d&&e.setZParams(F,S),p&&_&&e.setMParams(j,w),E=X(E,e)}return E}function ue(e,t,n,r){2!==r.currentToken()&&v("failed to parse multipath: array of array of vertices is expected");const s=e?new d:new _,a=s,l=o(0),c=i(2,0),h=u(0);let p=null,k=null,b=null,y=null,g=null,T=0,x=0,A=0;const S=new f,w=z.getNAN();let C=0,D=0;const F=e?1:0;for(;4!==r.nextToken();){2!==r.currentToken()&&v("failed to parse multipath: ring/path array is expected");let n=2,s=0,d=!0;const _=4;let f=0,E=0;const P=z.getNAN(),B=j(_,Number.NaN),V=j(_,Number.NaN);let R=!1;for(r.nextToken();4!==r.currentToken();){if(t&&1===r.currentToken())d&&v("failed to parse multipath: starting vertex array is expected"),b||(b=u(C-1,1),y=o(C-1,-1),g=i(0)),R=!0,n=1,({segFlag:A,toPointSz:f}=ge(S,B,w,r));else{for(R=!1,2!==r.currentToken()&&v("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),f=0;4!==r.nextToken();)f===_&&v("failed to parse multipath: each vertex array has to have at most 4 elements"),B[f++]=ce(r);f<2&&v("failed to parse multipath: each vertex array has to have at least 2 elements"),m(B[0],B[1])||v("failed to parse multipath: x and y must be finite")}r.nextToken();do{if(c.size()===2*C&&c.resize(he(C)),c.writePoint2D(2*C,P.setCoords(B[0],B[1])),p&&p.size()===C&&p.resize(fe(C)),f>2?(p||(p=i(C+1,Number.NaN)),p.write(C,B[2])):p&&p.write(C,Number.NaN),k&&k.size()===C&&k.resize(fe(C)),f>3?(k||(k=i(C+1,Number.NaN)),k.write(C,B[3])):k&&k.write(C,Number.NaN),d)D++,l.add(C),h.add(F),d=!1,E=f,O(V,B,0,0,E);else if(null!==b)if(R){const e=N(A),t=g.size();g.resize(t+e),b.add(A),y.add(T),S.get().writeInBufferStream(g,T),T+=e,a.incCurveType(A,1),x++}else b.add(1),y.add(-1);C++,s++,w.setCoords(B[0],B[1])}while(s<n&&4===r.currentToken())}0!==s&&(e&&s>n&&f===E&&0===I(B,V,f)?(C--,s--):null!==b&&(b.add(1),y.add(-1)))}return C&&(l.resize(D),h.resize(D),C>0&&(l.add(C),h.add(0)),a.setAttributeStreamRef(0,c),a.setPathFlagsStreamRef(h),a.setPathStreamRef(l),null!==b&&(a.updateCurveCounter(x),a.setSegmentData(y,g,b,T)),a.notifyModifiedFlags(65535)),{geometry:s,as:p,bs:k}}function me(e,t){2!==t.currentToken()&&v("failed to parse multipoint: array of vertices is expected");let n=0;const r=new h,s=i(2,0);let a=0;const o=4,u=j(o,Number.NaN),l=new z;let c=null,d=null;for(;4!==t.nextToken();){for(2!==t.currentToken()&&v("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==t.nextToken();)a===o&&v("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=ce(t);a<2&&v("failed to parse multipoint: each vertex array has to have at least 2 elements"),m(u[0],u[1])||v("failed to parse multipoint: x and y must be finite"),s.size()===2*n&&s.resize(he(n)),s.writePoint2D(2*n,l.setCoords(u[0],u[1])),c&&c.size()===n&&c.resize(fe(n)),a>2?(c||(c=i(n+1,Number.NaN)),c.write(n,u[2])):c&&c.write(n,Number.NaN),d&&d.size()===n&&d.resize(fe(n)),a>3?(d||(d=i(n+1,Number.NaN)),d.write(n,u[3])):d&&d.write(n,Number.NaN),n++}if(n){const e=r.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(n),e.notifyModifiedFlags(65535)}return{geometry:r,as:c,bs:d}}function le(e,t){2!==t.currentToken()&&v("failed to parse array of IDs: array of array of integers is expected");const n=l(2,0);let r=0,i=-1;for(;4!==t.nextToken();){const e=r;n.size()===r&&n.resize(fe(r)),r++;let s=0;for(-1===i?i=2===t.currentToken()?1:0:1===i&&2!==t.currentToken()&&v("failed to parse array of IDs: array of array of integers is expected"),0===i&&(n.size()===r&&n.resize(fe(r)),n.write(r,de(t)),s++,r++);4!==t.nextToken();)n.size()===r&&n.resize(fe(r)),n.write(r,de(t)),s++,r++;if(n.write(e,s),0===i)break}return n.resize(r),n}function ce(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function de(e){return e.currentInt32Value()}function _e(e,t){if(e.isEmpty())return;const n=l(2,0),r=e.getGeometryType();let i=0;r===h.type?i=1:r===_.type||r===d.type?i=e.getPathCount():T("not implemented"),n.resize(e.getPointCount(),0);let s=0;for(let a=0;a<i;++a){const i=t.read(s);s++;const o=s+i;let u=0,m=0;r===h.type?u=e.getPointCount():r===_.type||r===d.type?(u=e.getPathSize(a),m=e.getPathStart(a)):T("not implemented");for(let e=0,r=Math.min(i,u);e<r;++e)n.write(m,t.read(s)),s++,m++;s=o}e.getImpl().setAttributeStreamRef(3,n)}function he(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function fe(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function pe(e,t,n,r,i){i>=r.size()&&A("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const s=z.getNAN();s.x=r.readDouble(i),s.y=r.readDouble(i+8);const a=r.readInt32(i+16);if(!!(1&a))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(s),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,b(e),!1;let o=!!(64&a);const u=!!(128&a);let m=!!(32&a);const l=!!(8&a),c=!!(16&a),d=t.equals(n);return o&&!d&&(o=!1,m=!0),m&&d&&(o=!0,m=!1,s.setCoords(0,0)),o||(u?m?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(s),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,s),d&&l===e.isClockwise()&&e.reverse()):m?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,b(e),e.queryCoord2D(.5,e.m_interior)):y(e,t,n,s,l,c)),o&&(e.m_center.assign(t),e.m_startAngle=s.x,e.m_sweepAngle=s.y,g(e,Number.NaN,l,c),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),b(e),!0}function ke(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,g(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,b(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),b(e),!0}function be(e,t,n,r,i){return x(i+32<=r.size()),e.m_cp=E(z,2),e.m_cp[0].x=r.readDouble(i),e.m_cp[0].y=r.readDouble(i+8),e.m_cp[1].x=r.readDouble(i+16),e.m_cp[1].y=r.readDouble(i+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function ye(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function ge(e,t,n,r,i){const s={segFlag:0,toPointSz:0};let a=r.currentToken();a=r.nextToken();const o=r.currentString(),u=o[0];for((1!==o.length||"a"!==u&&"b"!==u&&"c"!==u&&"n"!==u&&"q"!==u)&&v('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for curve parameters"),a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for to point"),s.toPointSz=0;4!==r.nextToken();)4===s.toPointSz&&v("failed to parse curve: vertex array cannot have more than 4 elements"),t[s.toPointSz++]=ce(r);s.toPointSz<2&&v("failed to parse curve: vertex array must have at least 2 elements");const m=z.construct(t[0],t[1]),l=z.getNAN();let c=-1,d=-1,_=!1,h=Number.NaN,f=Number.NaN,p=Number.NaN;const k=[z.getNAN(),z.getNAN(),z.getNAN()],b=z.getNAN();if("a"===u){a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for center point"),a=r.nextToken();const e=ce(r);a=r.nextToken();const t=ce(r);a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for center point"),l.setCoords(e,t),a=r.nextToken(),c=r.currentInt32Value(),a=r.nextToken(),d=r.currentInt32Value(),a=r.nextToken(),4!==a?(_=!1,h=ce(r),a=r.nextToken(),f=ce(r),a=r.nextToken(),p=ce(r),a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for curve parameters")):_=!0,s.segFlag=4}else if("b"===u){for(let e=0;e<2;e++){a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for control point"),a=r.nextToken();const t=ce(r);a=r.nextToken();const n=ce(r);a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for control point"),k[e].setCoords(t,n)}a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for curve parameters"),s.segFlag=2}else if("n"===u){{a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for control point"),a=r.nextToken();const e=ce(r);a=r.nextToken();const t=ce(r);a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for control point"),k[0].setCoords(e,t)}a=r.nextToken();const e=ce(r);a=r.nextToken();const t=ce(r);a=r.nextToken();const n=ce(r);k[1].setCoords(e,t),k[2].setCoords(n,n),a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for curve parameters"),s.segFlag=8}else if("q"===u){for(let e=0;e<1;e++){a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for control point"),a=r.nextToken();const t=ce(r);a=r.nextToken();const n=ce(r);a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for control point"),k[e].setCoords(t,n)}a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for curve parameters"),s.segFlag=16}else{a=r.nextToken(),2!==a&&v("failed to parse curve: start array is expected for interior point"),a=r.nextToken();const e=ce(r);a=r.nextToken();const t=ce(r);a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for interior point"),b.setCoords(e,t),a=r.nextToken(),4!==a&&v("failed to parse curve: end array is expected for curve parameters"),s.segFlag=4}if(a=r.nextToken(),3!==a&&v("failed to parse curve: end object is expected for curve"),"a"===u)if(e.createEllipticArc(),_){const t=!0;Ne(e.get(),n,m,l,t,c,d)}else Te(e.get(),n,m,l,c,d,h,f,p);else if("b"===u)e.createCubicBezier(),ve(e.get(),n,m,k);else if("n"===u)e.createQuadraticRationalBezier(),xe(e.get(),n,m,k[0],k[1].x,k[1].y,k[2].x);else if("q"===u)e.createQuadraticBezier(),e.get().construct(n,k[0],m);else{e.createEllipticArc();const t=!1;Ne(e.get(),n,m,b,t,-1,-1)}return s}function Ne(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new ie({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,pe(e,t,n,m,0)}function Te(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new ie({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,ke(e,t,n,c,0)}function ve(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new ie({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,be(e,t,n,a,0)}function xe(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new ie({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,ye(e,t,n,m,0)}function Ae(e,t,n,r,i){const s=e.getGeometryType();if(s===w.enumEllipticArc)return Se(e,t,n,r,i);if(s===w.enumBezier)return we(e,t,n,r,i);if(s===w.enumRationalBezier2)return Ce(e,t,n,r,i);if(s===w.enumBezier2){const s=new p;return s.constructFromQuadraticSegment(e),we(s,t,n,r,i)}C("")}function Se(e,t,n,r,i){x(!k(e));const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;if(a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return De(a,o,s.x,s.y,u,m,r,i),!0;const l=0===e.projectionBehavior(),c=!!l&&e.isClosed();if(l&&!c)i.startObject(),i.addFieldName("c"),i.startArray(),De(a,o,s.x,s.y,u,m,r,i),Fe(e.m_interior.x,e.m_interior.y,17,i),i.endArray(),i.endObject();else if(l){i.startObject(),i.addFieldName("a"),i.startArray(),De(a,o,s.x,s.y,u,m,r,i);const t=0,n=0;Fe(e.m_center.x+t,e.m_center.y+n,17,i);const l=!e.isMajor();i.addInt32(l?1:0);const c=e.isClockwise();i.addInt32(c?1:0),i.endArray(),i.endObject()}else{i.startObject(),i.addFieldName("a"),i.startArray(),De(a,o,s.x,s.y,u,m,r,i);const t=e;Fe(t.m_center.x,t.m_center.y,17,i);const n=!t.isMajor();i.addInt32(n?1:0);const l=t.isClockwise();i.addInt32(l?1:0),i.addDouble(t.m_rotation,17),i.addDouble(t.m_semiMajorAxis,17),i.addDouble(t.m_minorMajorRatio,17),i.endArray(),i.endObject()}return!1}function we(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),De(a,o,s.x,s.y,u,m,r,i),Fe(e.m_cp[0].x,e.m_cp[0].y,r,i),Fe(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function Ce(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),De(a,o,s.x,s.y,u,m,r,i),Fe(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function De(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function Fe(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class je{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){ze(e,t,n,r)}exportSpatialReference(e,t,n,r){x(0)}exportProjectionTransformation(e,t,n,r){x(0)}exportDatumTransformation(e,t,n,r){x(0)}static geometryTypeToString(e){return x(0),""}}function ze(e,t,n,r,i){if(t||n){if(r.startObject(),null!==t){switch(t.getGeometryType()){case w.enumPolygon:Oe(!0,e,t,r);break;case w.enumPolyline:Oe(!1,e,t,r);break;case w.enumMultiPoint:Ie(e,t,r);break;case w.enumPoint:Ee(e,t,r);break;case w.enumEnvelope:Pe(e,t,r);break;case w.enumMultipatch:x(0);break;default:T("exportToJSON")}}null!==n&&(r.addFieldName("spatialReference"),Ve(e,n,r)),r.endObject()}}function Oe(e,t,n,r){const i=n.getImpl(),s=!!(2&t),a=!!(4&t),o=!!(8&t),u=i.hasAttribute(1)&&!s,m=i.hasAttribute(2)&&!a,l=i.hasAttribute(3)&&!o,d=i.hasNonLinearSegments();u&&(r.addFieldName("hasZ"),r.addBool(!0)),m&&(r.addFieldName("hasM"),r.addBool(!0)),e?d?r.addFieldName("curveRings"):r.addFieldName("rings"):d?r.addFieldName("curvePaths"):r.addFieldName("paths");let _=null;const h=[];if(n.isEmpty())r.startArray(),r.endArray();else{const e=17-(31&t>>13);r.startArray();const o=n.getPathCount();let p=0;const k=i.getAttributeStreamRef(0);let b=null,y=null,g=null;const N=new f;let T=null,v=null,x=null;d&&(T=i.getSegmentFlagsStreamRef(),v=i.getSegmentIndexStreamRef(),x=i.getSegmentDataStreamRef()),u&&(b=i.getAttributeStreamRef(1)),m&&(y=i.getAttributeStreamRef(2)),l&&(g=i.getAttributeStreamRef(3),_=c(3,0));for(let t=0;t<o;t++){r.startArray(),l&&h.push(0);const i=n.getPathEnd(t);if(p===i){r.endArray();continue}const o=n.isClosedPath(t);let c=k.read(2*p),d=k.read(2*p+1),f=u?b.read(p):Number.NaN,A=m?y.read(p):Number.NaN,S=l?g.read(p):0;Re(u,m,c,d,f,A,e,r);let w=1;l&&(_.add(S),h[h.length-1]++);const D=c,F=d,j=f,z=A,O=S;let I=!1,E=0,P=Number.NaN,B=Number.NaN,V=0;for(let t=p+1,n=p,R=o?i+1:i;t<R;t++,n++){const o=null!==T?31&T.read(n):1;let p,R;if(t<i?(p=k.read(2*t),R=k.read(2*t+1),u&&(P=b.read(t)),m&&(B=y.read(t)),l&&(V=g.read(t))):(p=D,R=F,P=j,B=z,V=O),1!==o){I=!0,4===o?N.createEllipticArc():2===o?N.createCubicBezier():16===o?N.createQuadraticBezier():8===o?N.createQuadraticRationalBezier():C("JSON export.unsupported curve");const t=N.get(),i=v.read(n);t.setStartXYCoords(c,d),t.setEndXYCoords(p,R),u&&(t.setStartAttribute(1,0,f),t.setEndAttribute(1,0,P)),m&&(t.setStartAttribute(2,0,A),t.setEndAttribute(2,0,B)),t.readFromBufferStream(x,i);Ae(N.get(),s,a,e,r)&&E++}else Re(u,m,p,R,P,B,e,r);l&&(_.add(V),h[h.length-1]++),w++,c=p,d=R,f=P,A=B,S=V}I&&0===E||(w<2&&E<1&&(Re(u,m,c,d,f,A,e,r),w++,l&&(_.add(S),h[h.length-1]++)),o&&w<3&&E<2&&(Re(u,m,D,F,j,z,e,r),w++,c=D,d=F,f=j,A=z,S=O,l&&(_.add(O),h[h.length-1]++))),r.endArray(),p=i}r.endArray()}if(l){r.addFieldName("ids"),r.startArray();let e=0;for(let t=0,n=h.length;t<n;++t){const n=h[t];x(0===n||null!==_&&e+n<=_.size()),r.startArray();for(let t=0;t<n;++t)r.addInt32(_.read(e)),e++;r.endArray()}r.endArray()}}function Ie(e,t,n){const r=t.getImpl(),i=r.hasAttribute(1)&&!(2&e),s=r.hasAttribute(2)&&!(4&e),a=r.hasAttribute(3)&&!(8&e);i&&(n.addFieldName("hasZ"),n.addBool(!0)),s&&(n.addFieldName("hasM"),n.addBool(!0)),n.addFieldName("points");const o=t.getPointCount();if(t.isEmpty())n.startArray(),n.endArray();else{const t=17-(31&e>>13);n.startArray();const a=r.getAttributeStreamRef(0);let u=null,m=null;i&&(u=r.getAttributeStreamRef(1)),s&&(m=r.getAttributeStreamRef(2));for(let e=0;e<o;e++){const r=a.read(2*e),o=a.read(2*e+1);let l=Number.NaN,c=Number.NaN;i&&(l=u.read(e)),s&&(c=m.read(e)),Re(i,s,r,o,l,c,t,n)}n.endArray()}if(a){let e=null;r.isEmpty()||(e=r.getAttributeStreamRef(3)),x(0===o||null!==e&&e.size()>=o),n.addFieldName("ids"),n.startArray();for(let t=0;t<o;t++)n.addInt32(e.read(t));n.endArray()}}function Ee(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function Pe(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function Be(e,t,n){n.startObject();const r=t.getID();r<=0&&v("cannot export unit that has no valid WKID"),n.addFieldName("uwkid"),n.addInt32(r),n.endObject()}function Ve(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),Be(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new W;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Re(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const Me={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_r:"r".charCodeAt(0),s_t:"t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Ue{constructor(e){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===e?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):e.jsonString?this.resetParserFromString(e.jsonString):e.jsonStream?C("streaming json parsing not yet impl"):T("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){C("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){C("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return x(0),""}childrenAsString(){return x(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e);return}if(2===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e);return}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}v("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===Me.s_backslash&&t.charCodeAt(r+1)===Me.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===Me.s_backslash&&t.charCodeAt(r+1)===Me.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==Me.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case Me.s_doubleQuote:e+='"';break;case Me.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case Me.s_backslash:e+="\\";break;case Me.s_forwardslash:e+="/";break;case Me.s_b:e+="\b";break;case Me.s_f:e+="\f";break;case Me.s_n:e+="\n";break;case Me.s_r:e+="\r";break;case Me.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&v("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),t-=2,0===t&&v("invalid token")}const n=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(n)&&v("invalid token");else if(Number.isNaN(n))return Number.NaN;return n}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&v("invalid token");let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),t-=2,0===t&&v("invalid token"));const n=parseInt(e);return Number.isNaN(n)&&v("invalid token"),n}currentInt64Value(){return x(0),0n}currentBoolValue(){return x(0),!1}isError(){return 0}JSONString(){return x(0),""}pushPosition(){return x(0),!1}popPosition(){return x(0),!1}skipCStyleComments_(){x(0)}skipCppStyleComments_(){x(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar(),e===Me.s_asterisk?this.skipCStyleComments_():e===Me.s_forwardslash?this.skipCppStyleComments_():v("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&v("invalid token");let t=this.m_peekChar();for(;t>=9&&t<=13||32===t;)this.m_increment(),this.m_eof()&&v("invalid token"),t=this.m_peekChar();t===Me.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===Me.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===Me.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&v("invalid token");let e=this.m_peekChar();for(;e!==Me.s_doubleQuote;){const t=e===Me.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar(),t)if(this.m_bHasEscapes=!0,e===Me.s_doubleQuote||e===Me.s_backslash||e===Me.s_forwardslash||e===Me.s_b||e===Me.s_f||e===Me.s_n||e===Me.s_r||e===Me.s_t)this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar();else if(e===Me.s_u)for(let n=0;n<4;n++)this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar(),e>=Me.s_zero&&e<=Me.s_nine||e>=Me.s_a&&e<=Me.s_f||e>=Me.s_A&&e<=Me.s_F||v("invalid token");else v("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===Me.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===Me.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):v("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==Me.s_doubleQuote&&v("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():v("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():v("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==Me.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar()}while(e>=Me.s_zero&&e<=Me.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar(),e>=Me.s_zero&&e<=Me.s_nine||v("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar(),e!==Me.s_plus&&e!==Me.s_minus||(this.m_stepOverChar(),this.m_eof()&&v("invalid token"),e=this.m_peekChar()),e>=Me.s_zero&&e<=Me.s_nine||v("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,t=this.m_peekChar();if(t===Me.s_minus?(this.m_stepOverChar(),this.m_eof()&&v("invalid token"),t=this.m_peekChar(),e=!0,t>=Me.s_zero&&t<=Me.s_nine||v("invalid token"),this.int_()):this.int_(),t=this.m_peekChar(),t===Me.s_period)this.m_currentTokenType=7,this.frac_(),t=this.m_peekChar(),t!==Me.s_e&&t!==Me.s_E||this.exp_();else if(t===Me.s_e||t===Me.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:t}=this.m_get(5);t&&v("invalid token"),"null"!==e&&v("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:t}=this.m_get(5);t&&v("invalid token"),"true"!==e&&v("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:t}=this.m_get(6);t&&v("invalid token"),"false"!==e&&v("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:t}=this.m_get(4);t&&v("invalid token"),"NaN"!==e&&v("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===Me.s_beginObject?this.valueStartObject_():e===Me.s_beginArray?this.valueStartArray_():e===Me.s_doubleQuote?this.valueString_():e===Me.s_minus||e>=Me.s_zero&&e<=Me.s_zero+9?this.valueNumber_():e===Me.s_n?this.valueNull_():e===Me.s_t?this.valueTrue_():e===Me.s_f?this.valueFalse_():e===Me.s_N?this.valueNan_():v("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==Me.s_beginObject&&e!==Me.s_beginArray&&v("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class We{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s,a){let o;"string"==typeof n?(o=new Ue({jsonString:n}),o.nextToken()):o=n,1!==o.currentToken()&&v("failed to import map geometry: start of object is expected");const u=se(t,e,o,r,i);return new Y(u)}importSpatialReference(e){const t=oe(e);return null===t&&T("failed to import spatial reference"),t}importProjectionTransformation(e,t){return x(0),{}}importDatumTransformation(e,t){return x(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||v("string_to_geometry_type"),e.endsWith("point")?w.enumPoint:e.endsWith("envelope")?w.enumEnvelope:e.endsWith("multipoint")?w.enumMultiPoint:e.endsWith("polyline")?w.enumPolyline:e.endsWith("polygon")?w.enumPolygon:void v("string_to_geometry_type")}}const Xe=new re,Ye=new je,Ge=new We;function Le(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function qe(e,t=!1){if(!t&&(K(e)||J(e)||Z(e)||Q(e))){const t=new Y;return t.setGeometry(H(L(e))),t}const n=new ne(e,{strict:!1});return n.nextToken(),Ge.execute(0,w.enumUnknown,n,!0,!1)}function Ke(e){let t=null;return[e.map(e=>{if(null==t){const n=Je(e);return t=n.getSpatialReference(),n.getGeometry()}return Ze(e)}),t]}function Je(e){const t=qe(e),n=He(e.spatialReference);return n&&t.setSpatialReference(n),t}function Ze(e){return qe(e).getGeometry()}function Qe(e){return qe(e,!0).getGeometry()}function He(e){if(null==e)return null;let t=!1;if(e instanceof q){const{wkt2:n}=e;e=e.toJSON(),e.wkt2??=n,t=!0}(e.latestVcsWkid||e.vcsWkid)&&(t||(e={...e}),delete e?.latestVcsWkid,delete e?.vcsWkid);const n=new ne(e,{strict:!1});n.nextToken();const r=Ge.importSpatialReference(n);return 0===r.getCoordinateSystemType()?null:r}function $e(e,t){if(e instanceof Y&&(t=e.getSpatialReference(),e=e.getGeometry()),null==e||e.isEmpty())return null;switch(e.getGeometryType()){case w.enumPoint:case w.enumMultiPoint:case w.enumPolyline:case w.enumPolygon:{const n=G(e,et(t)??void 0).toGeometryJSON();return null==n.spatialReference&&delete n.spatialReference,n}}return Xe.reset(),Ye.execute(0,e,t??null,Xe),Xe.getObject()}function et(e){return null==e||0===e.getCoordinateSystemType()?null:(Xe.reset(),Ye.execute(0,null,e,Xe),Xe.getObject().spatialReference)}export{Ke as fromGeometries,Je as fromGeometry,Ze as fromGeometryToGXGeometry,Qe as fromGeometryToGXGeometryUsingImportOperator,He as fromSpatialReference,Le as getSpatialReference,$e as toGeometry,et as toSpatialReference};
|