@arcgis/core 4.34.0-next.44 → 4.34.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/AttributeBinsGraphic.js +1 -1
- package/PopupTemplate.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/geometry/wkt.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/04cbd3aa9965b2eb71ea.js +1 -0
- package/assets/esri/core/workers/chunks/{42c5d957813080143e5a.js → 09268dc856c3d5ce178f.js} +1 -1
- package/assets/esri/core/workers/chunks/0f20c0eec850a39620a1.js +1 -0
- package/assets/esri/core/workers/chunks/{b40845b45f8d7cd347a1.js → 17df0f766ee1e323d3fa.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf474c055a85bdbfa8d0.js → 19f1bfe815896d4983af.js} +1 -1
- package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +1 -0
- package/assets/esri/core/workers/chunks/{bb23371335ac049861e6.js → 28a85997c9003cacdefb.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d9a7333a968065b53a1.js → 2942ab268f24cea2e722.js} +1 -1
- package/assets/esri/core/workers/chunks/{3a2cbfb03103c402c6c5.js → 2b75212c31145cc07d16.js} +1 -1
- package/assets/esri/core/workers/chunks/{787d281b2fe1edf6cf30.js → 2bb61f80473b495163e3.js} +1 -1
- package/assets/esri/core/workers/chunks/2cda605c302176905e84.js +1 -0
- package/assets/esri/core/workers/chunks/{5958598da96464128aed.js → 2f65081bfedeab44d6cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{78de16f65ea297452a65.js → 31c6e951b99315e8e68a.js} +1 -1
- package/assets/esri/core/workers/chunks/33f3e3d05429f845c139.js +1 -0
- package/assets/esri/core/workers/chunks/3610357c8fa9bec9e0dc.js +1 -0
- package/assets/esri/core/workers/chunks/379a4f664e77ad1fffe9.js +1 -0
- package/assets/esri/core/workers/chunks/45b450c045d5fadf71b6.js +1 -0
- package/assets/esri/core/workers/chunks/{d547b27ac750953a998f.js → 46a470bea2a3601182dc.js} +1 -1
- package/assets/esri/core/workers/chunks/47f2e905ef42e36897aa.js +1 -0
- package/assets/esri/core/workers/chunks/4c6862ad3af947c704f7.js +1 -0
- package/assets/esri/core/workers/chunks/4d544e3e19ce07c2c195.js +1 -0
- package/assets/esri/core/workers/chunks/4f5e72993a4f5180d703.js +1 -0
- package/assets/esri/core/workers/chunks/50d526a16bc86a481055.js +1 -0
- package/assets/esri/core/workers/chunks/516b30778cd54d29e362.js +1 -0
- package/assets/esri/core/workers/chunks/54b1a960bb8c3fe05976.js +1 -0
- package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +1 -0
- package/assets/esri/core/workers/chunks/576792b5e1e13084adba.js +1 -0
- package/assets/esri/core/workers/chunks/{6759319f3fd2d03c446b.js → 5c556468e2a598ab793a.js} +1 -1
- package/assets/esri/core/workers/chunks/5d331f7628514a572f82.js +1 -0
- package/assets/esri/core/workers/chunks/64c31c90e4c589ca2f04.js +1 -0
- package/assets/esri/core/workers/chunks/65e1f5b20a585e04655a.js +1 -0
- package/assets/esri/core/workers/chunks/66db5f77e09d25e33951.js +1 -0
- package/assets/esri/core/workers/chunks/{863e87ac982d7727b435.js → 69e37365c17e7cc4168f.js} +1 -1
- package/assets/esri/core/workers/chunks/6fe738748ce837811ff4.js +1 -0
- package/assets/esri/core/workers/chunks/709dc98379f4ce18a0b5.js +1 -0
- package/assets/esri/core/workers/chunks/719450ccd455f503d81a.js +1 -0
- package/assets/esri/core/workers/chunks/73140c5c0beda7ea3703.js +1 -0
- package/assets/esri/core/workers/chunks/790e97ddbe318bc75415.js +1 -0
- package/assets/esri/core/workers/chunks/7df8c78e36b04ad657d2.js +1 -0
- package/assets/esri/core/workers/chunks/838c7fd37b2e78b1d582.js +1 -0
- package/assets/esri/core/workers/chunks/8736b78256037b145f8b.js +1 -0
- package/assets/esri/core/workers/chunks/{c6da9ba188b627ab3b79.js → 8aa77a5e82c033512b45.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1c2e5e0a70fb5d27da5.js → 8bab4c59c9b644224ecb.js} +1 -1
- package/assets/esri/core/workers/chunks/8c6119dde0eead8d90d9.js +1 -0
- package/assets/esri/core/workers/chunks/{4f3c187a7cb2b1444281.js → 8c81156b1605a16acc29.js} +1 -1
- package/assets/esri/core/workers/chunks/{f4b145feab275b268c2e.js → 8cc700da2ac58849a708.js} +1 -1
- package/assets/esri/core/workers/chunks/8f70650aba8e55eb7a96.js +1 -0
- package/assets/esri/core/workers/chunks/914eaed113dda727eb47.js +1 -0
- package/assets/esri/core/workers/chunks/98175b454e807b1a3c5f.js +1 -0
- package/assets/esri/core/workers/chunks/{44116cf0bd4d6a127c96.js → 99b9392946d776a62997.js} +1 -1
- package/assets/esri/core/workers/chunks/9a20be3b02c9d6349b8d.js +1 -0
- package/assets/esri/core/workers/chunks/9affcf990ea810fa426b.js +1 -0
- package/assets/esri/core/workers/chunks/9b7fee0adffeee8d45ae.js +1 -0
- package/assets/esri/core/workers/chunks/9cbec2ffa445a72d4c33.js +1 -0
- package/assets/esri/core/workers/chunks/9d30fed26e0d84ef893b.js +1 -0
- package/assets/esri/core/workers/chunks/9f178cf73c63caaea190.js +1 -0
- package/assets/esri/core/workers/chunks/a1ff4c252012d5026133.js +1 -0
- package/assets/esri/core/workers/chunks/a34d98abcf958a632b0f.js +1 -0
- package/assets/esri/core/workers/chunks/a3a23a56df4e5ee86bb2.js +1 -0
- package/assets/esri/core/workers/chunks/a6493607b98783bf1ef2.js +1 -0
- package/assets/esri/core/workers/chunks/a69258f34a5eb5a1954f.js +1 -0
- package/assets/esri/core/workers/chunks/a7ff44157b8cf19de37e.js +1 -0
- package/assets/esri/core/workers/chunks/{5ae6e2b3557fe8730072.js → b287624909578d307e07.js} +1 -1
- package/assets/esri/core/workers/chunks/{48514235c32917e43a3f.js → b3e2e826295620b1a9dd.js} +2 -2
- package/assets/esri/core/workers/chunks/{5b91a49202129eedaf00.js → b4304673696fc0774bff.js} +1 -1
- package/assets/esri/core/workers/chunks/bd1c2afaf491d1c79a9e.js +1 -0
- package/assets/esri/core/workers/chunks/{f34739daceab54a280ad.js → beb77cdae0b1b6ad73da.js} +1 -1
- package/assets/esri/core/workers/chunks/{a638f1688ac9525a52a7.js → c2f184e9f579152aa29a.js} +1 -1
- package/assets/esri/core/workers/chunks/c483d2149d9d0099bfdb.js +1 -0
- package/assets/esri/core/workers/chunks/{349da65a8793f7873366.js → c5a0976de958b3b01c70.js} +1 -1
- package/assets/esri/core/workers/chunks/ce569860b170700e9b31.js +1 -0
- package/assets/esri/core/workers/chunks/cf5db995ba88912cf6b7.js +1 -0
- package/assets/esri/core/workers/chunks/cf6330f721c6910d25ff.js +1 -0
- package/assets/esri/core/workers/chunks/{2aac5d560e4c5defe882.js → cff15600d0ec7b19dffb.js} +1 -1
- package/assets/esri/core/workers/chunks/{0faec78b2dd6990a5da0.js → d09ded9fb621491e2466.js} +1 -1
- package/assets/esri/core/workers/chunks/d1842745a7699879a1e1.js +1 -0
- package/assets/esri/core/workers/chunks/{7e99fc78bd0f40a8ba81.js → d1c97fdcba6eb443cb1c.js} +1 -1
- package/assets/esri/core/workers/chunks/d62d41091f7ac5f77f16.js +1 -0
- package/assets/esri/core/workers/chunks/d70e1b8b8bee88a7a5b8.js +353 -0
- package/assets/esri/core/workers/chunks/d8d17e3ecccec7e99f0b.js +1 -0
- package/assets/esri/core/workers/chunks/{14b536e0c1de6c7422bc.js → e408ccee12bfe089c913.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f2bdb8da5c9ffd7d05e.js → e58336aafe8c95bb6831.js} +1 -1
- package/assets/esri/core/workers/chunks/{30b9c131b69297ee186f.js → e59e09766b130a05c617.js} +1 -1
- package/assets/esri/core/workers/chunks/{01ae7d36bda6b6186786.js → eb61b47df99a54a364c8.js} +1 -1
- package/assets/esri/core/workers/chunks/ef02e33ea53b46b566cb.js +1 -0
- package/assets/esri/core/workers/chunks/f0ccd7ac83d94cbf40a5.js +1 -0
- package/assets/esri/core/workers/chunks/{655b8d24ffe5405f8ba1.js → f2a2d3cda4a3dc0a8caf.js} +1 -1
- package/assets/esri/core/workers/chunks/fc6408208c850eec4019.js +1 -0
- package/assets/esri/core/workers/chunks/ff79a8df1b1941ae350d.js +1 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/chunks/NativeLine.glsl.js +5 -14
- package/chunks/bundle.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/chunks/persistableUrlUtils.js +1 -1
- package/colorUtils.js +1 -1
- package/config.js +1 -1
- package/core/BidiEngine.js +1 -1
- package/core/accessorSupport/get.js +1 -1
- package/core/accessorSupport/read.js +1 -1
- package/core/accessorSupport/tracking.js +1 -1
- package/core/screenUtils.js +1 -1
- package/core/sql/DateOnly.js +1 -1
- package/core/urlUtils.js +1 -1
- package/core/uuid.js +1 -1
- package/core/workers/registry.js +1 -1
- package/geometry/operators/json/generalizeOperator.js +5 -0
- package/geometry/operators/json/simplifyOperator.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +5 -0
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/layers/support/rasterDatasets/pixelReader.js +1 -1
- package/libs/maquette-advanced-projector/utils.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/networks/RulesTable.js +1 -1
- package/package.json +1 -1
- package/rest/generateRenderer.js +1 -1
- package/rest/networks/support/TraceResult.js +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMEffects.js +1 -1
- package/symbols/cim/CIMResourceManager.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/effects/CIMEffectHelper.js +1 -1
- package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
- package/symbols/cim/effects/EffectArrow.js +1 -1
- package/symbols/cim/effects/EffectBuffer.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/cim/effects/EffectCut.js +1 -1
- package/symbols/cim/effects/EffectDashes.js +1 -1
- package/symbols/cim/effects/EffectDonut.js +1 -1
- package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
- package/symbols/cim/effects/EffectJog.js +1 -1
- package/symbols/cim/effects/EffectMove.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/symbols/cim/effects/EffectRadial.js +1 -1
- package/symbols/cim/effects/EffectReverse.js +1 -1
- package/symbols/cim/effects/EffectRotate.js +1 -1
- package/symbols/cim/effects/EffectScale.js +1 -1
- package/symbols/cim/effects/EffectSuppress.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/symbols/cim/effects/EffectWave.js +1 -1
- package/symbols/cim/fitVectorMarker.js +1 -1
- package/symbols/cim/placements/CIMMarkerPlacementHelper.js +1 -1
- package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
- package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
- package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/symbols/cim/placements/PlacementOnLine.js +1 -1
- package/symbols/cim/placements/PlacementOnVertices.js +1 -1
- package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/interactive/editingTools/MediaTransformToolsWrapper.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/{DrawManipulator.js → LegacyDrawManipulator.js} +1 -1
- package/views/draw/{DrawTool.js → LegacyDrawTool.js} +1 -1
- package/views/draw/PointDrawAction.js +1 -1
- package/views/draw/PolygonDrawAction.js +1 -1
- package/views/draw/PolylineDrawAction.js +1 -1
- package/views/draw/SegmentDrawAction.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +5 -0
- package/widgets/OrientedImageryViewer/symbols.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Track/TrackViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/assets/esri/core/workers/chunks/03df4668002eb4cb4f98.js +0 -1
- package/assets/esri/core/workers/chunks/087ae1e3e767f0e678e5.js +0 -1
- package/assets/esri/core/workers/chunks/0b45566fad2cbb03fea1.js +0 -1
- package/assets/esri/core/workers/chunks/0d73afce787ee1e76b21.js +0 -1
- package/assets/esri/core/workers/chunks/1acc620bfd2983d6853f.js +0 -1
- package/assets/esri/core/workers/chunks/21dd626a5b5ea6a7e18e.js +0 -1
- package/assets/esri/core/workers/chunks/24e76fa530fc0c495fb5.js +0 -1
- package/assets/esri/core/workers/chunks/28d71e1b866113650c75.js +0 -1
- package/assets/esri/core/workers/chunks/2a26c3fc324d672ebe88.js +0 -1
- package/assets/esri/core/workers/chunks/2c816d3a737e39e6eb84.js +0 -1
- package/assets/esri/core/workers/chunks/2f54776ff86f397adc55.js +0 -1
- package/assets/esri/core/workers/chunks/3984ca7e05f30724adaf.js +0 -1
- package/assets/esri/core/workers/chunks/3af4a410ff0bca7ba2e3.js +0 -1
- package/assets/esri/core/workers/chunks/439128f23fa091633d2d.js +0 -1
- package/assets/esri/core/workers/chunks/489391ed1d443140617d.js +0 -1
- package/assets/esri/core/workers/chunks/4970d439d9648e97fd5a.js +0 -1
- package/assets/esri/core/workers/chunks/774844eea928efa811f2.js +0 -1
- package/assets/esri/core/workers/chunks/7b82ed4cc475c782256b.js +0 -1
- package/assets/esri/core/workers/chunks/7ef29640de297a0cf744.js +0 -1
- package/assets/esri/core/workers/chunks/8867368ab9b005460f19.js +0 -353
- package/assets/esri/core/workers/chunks/8c3c752408fac3db05cf.js +0 -1
- package/assets/esri/core/workers/chunks/8ca95499e00ce8b0af9a.js +0 -1
- package/assets/esri/core/workers/chunks/8f3ce10eacb5bc14a641.js +0 -1
- package/assets/esri/core/workers/chunks/91be247f868ce6596c9e.js +0 -1
- package/assets/esri/core/workers/chunks/97fc21355efc7b289f3b.js +0 -1
- package/assets/esri/core/workers/chunks/9cd9b22354dbdf1b1df0.js +0 -1
- package/assets/esri/core/workers/chunks/a89c060ad302381aaf7d.js +0 -1
- package/assets/esri/core/workers/chunks/aaab7694eb333ad480f5.js +0 -1
- package/assets/esri/core/workers/chunks/af98c7546be409303213.js +0 -1
- package/assets/esri/core/workers/chunks/b01a90ce699058307bc2.js +0 -1
- package/assets/esri/core/workers/chunks/b5f6a0607b620b027cdd.js +0 -1
- package/assets/esri/core/workers/chunks/c110941e87923ba47193.js +0 -1
- package/assets/esri/core/workers/chunks/c6e3d4c6bb02d58d5cfe.js +0 -1
- package/assets/esri/core/workers/chunks/cd6398a2951922e13b86.js +0 -1
- package/assets/esri/core/workers/chunks/ceb63ca9ad473c3f1820.js +0 -1
- package/assets/esri/core/workers/chunks/d392fbbcfac2a1b54bd6.js +0 -1
- package/assets/esri/core/workers/chunks/d93b24e863379116b2aa.js +0 -1
- package/assets/esri/core/workers/chunks/da6f46211551a96dce19.js +0 -1
- package/assets/esri/core/workers/chunks/dd9be173cddc16a354ed.js +0 -1
- package/assets/esri/core/workers/chunks/ddeaf688d72b2873c4ac.js +0 -1
- package/assets/esri/core/workers/chunks/e3f5afdf133c58b3d161.js +0 -1
- package/assets/esri/core/workers/chunks/e5aeb34d918dee539694.js +0 -1
- package/assets/esri/core/workers/chunks/e6d08230adb90b9a2a17.js +0 -1
- package/assets/esri/core/workers/chunks/e7806a57d29bca385f1d.js +0 -1
- package/assets/esri/core/workers/chunks/e799433770e4303fcd9c.js +0 -1
- package/assets/esri/core/workers/chunks/eb7dd722e4cd7f83b3f5.js +0 -1
- package/assets/esri/core/workers/chunks/f1adf8ebc2c1b93857bf.js +0 -1
- package/assets/esri/core/workers/chunks/f1b02c4bd5fde235212b.js +0 -1
- package/assets/esri/core/workers/chunks/f65b2d3a91a0c726fee4.js +0 -1
- package/assets/esri/core/workers/chunks/ff34fdda7899e784ac73.js +0 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/loadGeometryEngine.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isRGB as e}from"../../core/colorUtils.js";import{getFontFamily as t}from"../../core/fontUtils.js";import"../../core/has.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{pt2px as o,px2pt as a}from"../../core/screenUtils.js";import{numericHash as s}from"../../core/string.js";import{checkForAnimations as l,getAnimationParams as n,handleAbsoluteAnchor as p,handleMarker as c,handleRelativeAnchor as m,getFrameTranslation as y,translate as d,getStaticParam as h,shouldUseAnimatedPath as f}from"./animationUtils.js";import{CIMSymbolHelper as u}from"./CIMSymbolHelper.js";import{antialiasingOutlineFillSettings as v}from"./constants.js";import{defaultCIMValues as O}from"./defaultCIMValues.js";import{fitVectorMarker as g}from"./fitVectorMarker.js";import{OverrideHelper as _}from"./OverrideHelper.js";import{getExtent as S,getSDFMetrics as M,getSDFDimensions as k}from"./SDFHelper.js";import{colorToArray as C,normalizeAlpha as b,getSize as x,isCIMMarkerStrokePlacement as P,hasStrokeLayer as z,getTintColor as E,getNumericValue as I,normalizePrimitiveOverrideProps as L,getDefaultCIMValue as V,getEnum as N,getStrokeWidth as R,getFillColor as w,getStrokeColor as A,fromCIMFontDecoration as G,fromCIMFontStyle as T,fromCIMVerticalAlignment as F,fromCIMHorizontalAlignment as X,getTextCasing as j,isValidCIMValue as Y,uncapitalize as W}from"./utils.js";import{CIMEffectHelper as D}from"./effects/CIMEffectHelper.js";import{rasterizedVectorMarkerMinSize as U,randomInsidePolygonTextureSize as H}from"../../views/2d/engine/webgl/definitions.js";const J=()=>i.getLogger("esri.symbols.cim.cimAnalyzer");function B(e){const t=e.markerPlacement;return t&&t.angleToLine?1:0}class q{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],this._hasTextStringTemplates=!1,e&&(this._resourceManager=e)}analyzeSymbolReference(t,r,i){if(this._cimLayers=i??[],!t)return this._cimLayers;if(this._reset(),this._hasTextStringTemplates=t.hasTextStringTemplates??!1,t.primitiveOverrides){this._primitiveOverrides=t.primitiveOverrides;for(const t of this._primitiveOverrides){const r=t.valueExpressionInfo;if(r)this._setPoMap(t.primitiveName,t.propertyName,r);else if(null!=t.value){let r=t.value;t.propertyName.includes("Color")&&(e(r)&&(r=C(r)),r=b(r)),this._setPoMap(t.primitiveName,t.propertyName,r)}}}return this._analyzeSymbol(t.symbol,r),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const r=e?.symbolLayers;if(!r)return;for(let l=0;l<r.length;l++){const e=r[l];"CIMVectorMarker"===e.type&&(r[l]=g(e,this._resourceManager.geometryEngine))}const i=e.effects;let o=0;const a=x(e)??0;if("CIMPointSymbol"===e.type&&"Map"===e.angleAlignment&&(o=1),re(r,i))return this._analyzeCompositeOutlineFill(r,i,a);let s={transform:[0,0,0,1],fromColor:[1,1,1,1],toColor:[1,1,1,1],colorMix:[0,0,0,0],toOpacity:[1,1,1,1],opacityMix:[0,0,0,0],shift:[1,1,1,1],hasAnimations:l(e),hasShiftAnimation:!1,hasMotionAnimations:!1};s=n(this._poMap,e,s);const p="CIMPolygonSymbol"===e.type;let c=r.length;for(;c--;){const l=r[c];if(!l||!1===l.enable)continue;let n;i?.length&&(n=[...i]);const m=l.effects;m?.length&&(i?n.push(...m):n=[...m]);let y=null;if(n){y=[];for(const e of n){const t=_.findEffectOverrides(e,this._primitiveOverrides);t&&y.push(t)}}const d=[];switch(_.findApplicableOverrides(l,this._primitiveOverrides,d),l.type){case"CIMSolidFill":this._analyzeSolidFill(l,y,s,z(r));break;case"CIMPictureFill":this._analyzePictureFill(l,y,s);break;case"CIMHatchFill":this._analyzeHatchFill(l,y);break;case"CIMGradientFill":this._analyzeGradientFill(l,y);break;case"CIMSolidStroke":this._analyzeSolidStroke(l,y,p,a,s);break;case"CIMPictureStroke":this._analyzePictureStroke(l,y,p,a,s);break;case"CIMGradientStroke":this._analyzeGradientStroke(l,y,p,a);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{"CIMLineSymbol"!==e.type&&"CIMPolygonSymbol"!==e.type||(o=B(l));const r=[],i=l.primitiveName;i&&r.push(i);const n=p&&P(l.markerPlacement);this._analyzeMarker(l,y,null,r,o,a,t,[],s,!1,n);break}default:J().error("Cannot analyze CIM layer",l.type)}}}_analyzeSolidFill(e,t,r,i){const{primitiveName:o,type:a}=e,s=b(e.color),l=n(this._poMap,e,r);if(!i&&t?.some(e=>"CIMGeometricEffectTaperedPolygon"===e.effect.type)){const r=this._getValueOrOverrideExpression(a,o,"Color",s);return void this._cimLayers.push({type:"outlineFill",colorLocked:!!e.colorLocked,color:r,effects:t,outlineColor:r,outlineColorLocked:!!e.colorLocked,...v,outlineEffects:t})}this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(a,o,"Color",s),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1,animationParams:oe(l)})}_analyzePictureFill(e,t,r){const{primitiveName:i,type:o}=e,a=E(e),s=I(e.height,O.CIMPictureFill.height);let l=I(e.scaleX,1);if("width"in e&&"number"==typeof e.width){const t=e.width;let r=1;const i=this._resourceManager.getResource(e.url);null!=i&&(r=i.width/i.height),l/=r*(s/t)}const p={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(i,o)},c=n(this._poMap,e,r);this._cimLayers.push({type:"fill",spriteRasterizationParam:p,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,i,"TintColor",a),height:this._getValueOrOverrideExpression(o,i,"Height",s),scaleX:this._getValueOrOverrideExpression(o,i,"ScaleX",l),angle:this._getValueOrOverrideExpression(o,i,"Rotation",I(e.rotation)),offsetX:this._getValueOrOverrideExpression(o,i,"OffsetX",I(e.offsetX)),offsetY:this._getValueOrOverrideExpression(o,i,"OffsetY",I(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1,animationParams:oe(c)})}_analyzeHatchFill(e,t){const{primitiveName:r,type:i}=e,o=this._analyzeMaterialOverrides(r,["Rotation","OffsetX","OffsetY"]),a=L(o);let s=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(const p of e.lineSymbol.symbolLayers){if("CIMSolidStroke"!==p.type)continue;const e=p.primitiveName??r;l||!e||p.colorLocked||null==this._poMap[e]?.Color&&null==this._poMap[e]?.StrokeColor||(s=b(p.color),s=this._maybeGetValueOrOverrideExpression(e,"StrokeColor")??this._getValueOrOverrideExpression(i,e,"Color",s),l=!0);const t=this._maybeGetValueOrOverrideExpression(e,"StrokeWidth");if(t){let r=null,o=null;"number"==typeof t?r=t:o=t.valueExpressionInfo;let s=a.find(e=>"strokeWidth"===e.propertyName);s?s.propertyName="width":(s={type:"CIMPrimitiveOverride",primitiveName:e,propertyName:"width",valueExpressionInfo:o,value:r,defaultValue:V(i,"width")},a.push(s))}}const n={type:"sprite-rasterization-param",resource:e,overrides:a};this._cimLayers.push({type:"fill",spriteRasterizationParam:n,colorLocked:!!e.colorLocked,effects:t,color:s,height:this._getValueOrOverrideExpression(i,r,"Separation",I(e.separation,O.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(i,r,"Rotation",I(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,r,"OffsetX",I(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,r,"OffsetY",I(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l})}_analyzeGradientFill(e,t){const{angle:r,gradientMethod:i,gradientSize:o,gradientSizeUnits:a,gradientType:s,interval:l,primitiveName:n,type:p}=e,c=O.CIMGradientFill,m=e.colorRamp;this._cimLayers.push({type:"gradientFill",spriteRasterizationParam:{type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(n,p)},colorLocked:!1,effects:t,color:[255,255,255,1],gradientMethod:this._getValueOrOverrideExpression(p,n,"GradientMethod",i??"Linear"),angle:this._getValueOrOverrideExpression(p,n,"Angle",I(r,c.angle)),gradientType:this._getValueOrOverrideExpression(p,n,"GradientType",s??c.gradientType),interval:this._getValueOrOverrideExpression(p,n,"Interval",I(l,"CIMFixedColorRamp"===m.type?m.colors.length:c.interval)),gradientSize:this._getValueOrOverrideExpression(p,n,"GradientSize",I(o,c.gradientSize)),gradientSizeUnits:"Absolute"===a?1:"Relative"===a?0:c.gradientSizeUnits})}_analyzeCompositeOutlineFill(e,t,r){const i=e.find(e=>"CIMSolidFill"===e.type),o=e.find(e=>"CIMSolidStroke"===e.type);if(null==i||null==o)return;const a=[...t??[],...i.effects??[]].map(e=>_.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>null!=e),s=[...t??[],...o.effects??[]].map(e=>_.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>null!=e),l=I(o.width,O.CIMSolidStroke.width),n=N(o.capStyle,O.CIMSolidStroke.capstyle),p=N(o.joinStyle,O.CIMSolidStroke.joinstyle),c=o.miterLimit;this._cimLayers.push({type:"outlineFill",colorLocked:!!i.colorLocked,color:this._getValueOrOverrideExpression(i.type,i.primitiveName,"Color",b(i.color)),effects:a,outlineColorLocked:!!o.colorLocked,outlineColor:this._getValueOrOverrideExpression(o.type,o.primitiveName,"Color",b(o.color)),outlineWidth:this._getValueOrOverrideExpression(o.type,o.primitiveName,"Width",l),cap:this._getValueOrOverrideExpression(o.type,o.primitiveName,"CapStyle",n),join:this._getValueOrOverrideExpression(o.type,o.primitiveName,"JoinStyle",p),miterLimit:c&&this._getValueOrOverrideExpression(o.type,o.primitiveName,"MiterLimit",c),referenceWidth:r,outlineEffects:s})}_analyzeSolidStroke(e,t,r,i,o){const{primitiveName:a,type:s}=e,l=b(e.color),p=I(e.width,O.CIMSolidStroke.width),c=N(e.capStyle,O.CIMSolidStroke.capstyle),m=N(e.joinStyle,O.CIMSolidStroke.joinstyle),y=e.miterLimit;let d,h,f,u,v=[];if(this._analyzePrimitiveOverrides(a,t,null,null)&&(v=this._getPrimitiveMaterialOverrides(a,s)),t&&Array.isArray(t)&&t.length>0){const e=t[t.length-1].effect;e&&"CIMGeometricEffectDashes"===e.type&&"NoConstraint"===e.lineDashEnding&&(d=e.dashTemplate,h=e.scaleDash,f=e.offsetAlongLine,u=e.primitiveName,(t=[...t]).pop())}null!=u&&v.push(...this._getPrimitiveMaterialOverrides(u,s).filter(e=>"dashTemplate"===e.propertyName));const g=void 0!==d?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:d,primitiveName:u},overrides:v}:null,_=n(this._poMap,e,o);this._cimLayers.push({type:"line",spriteRasterizationParam:g,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"Color",l),width:this._getValueOrOverrideExpression(s,a,"Width",p),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",c),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",m),miterLimit:y&&this._getValueOrOverrideExpression(s,a,"MiterLimit",y),referenceWidth:i,zOrder:Q(e.name),dashTemplate:this._maybeGetValueOrOverrideExpression(u,"DashTemplate")??d,offsetAlongLine:this._getValueOrOverrideExpression(s,u,"OffsetAlongLine",f??0),scaleDash:h,sampleAlphaOnly:!0,animationParams:oe(_)})}_analyzePictureStroke(e,t,r,i,o){const{primitiveName:a,type:s}=e,l=E(e),p=I(e.width,O.CIMPictureStroke.width),c=N(e.capStyle,O.CIMPictureStroke.capstyle),m=N(e.joinStyle,O.CIMPictureStroke.joinstyle),y=e.miterLimit,d={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(a,s)},h=n(this._poMap,e,o);this._cimLayers.push({type:"line",spriteRasterizationParam:d,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"TintColor",l),width:this._getValueOrOverrideExpression(s,a,"Width",p),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",c),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",m),miterLimit:y&&this._getValueOrOverrideExpression(s,a,"MiterLimit",y),referenceWidth:i,zOrder:Q(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1,animationParams:oe(h)})}_analyzeGradientStroke(e,t,r,i){const{gradientMethod:o,gradientSize:a,gradientSizeUnits:s,gradientType:l,interval:n,primitiveName:p,type:c}=e,m=O.CIMGradientStroke,y=I(e.width,m.width),d=N(e.capStyle,m.capstyle),h=N(e.joinStyle,m.joinstyle),f=e.miterLimit,u=e.colorRamp;this._cimLayers.push({type:"gradientStroke",spriteRasterizationParam:{type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(p,c)},colorLocked:!!e.colorLocked,effects:t,color:[255,255,255,1],width:this._getValueOrOverrideExpression(c,p,"Width",y),cap:this._getValueOrOverrideExpression(c,p,"CapStyle",d),join:this._getValueOrOverrideExpression(c,p,"JoinStyle",h),miterLimit:f&&this._getValueOrOverrideExpression(c,p,"MiterLimit",f),referenceWidth:i,isOutline:r,gradientMethod:this._getValueOrOverrideExpression(c,p,"GradientMethod",o??m.gradientMethod),gradientType:this._getValueOrOverrideExpression(c,p,"GradientType",l??m.gradientType),interval:this._getValueOrOverrideExpression(c,p,"Interval",I(n,"CIMFixedColorRamp"===u.type?u.colors.length:m.interval)),gradientSize:this._getValueOrOverrideExpression(c,p,"GradientSize",I(a,m.gradientSize)),gradientSizeUnits:"Absolute"===s?1:"Relative"===s?0:m.gradientSizeUnits})}_analyzeMarker(e,t,r,i,o,a,s,l,y,d=!1,h=!1){d||=!!e.colorLocked;let f=y;if(f=p(e,f),f=c(this._poMap,e,f),f=m(e,f),f=n(this._poMap,e,f),this._analyzeMarkerInsidePolygon(e,t,d,f))return;const u=I(e.size,O.CIMVectorMarker.size),v=I(e.rotation),g=I(e.offsetX),_=I(e.offsetY),{primitiveName:S,type:M}=e,k=this._getValueOrOverrideExpression(M,S,"Size",u),C=this._getValueOrOverrideExpression(M,S,"Rotation",v),b=this._getValueOrOverrideExpression(M,S,"OffsetX",g),x=this._getValueOrOverrideExpression(M,S,"OffsetY",_);switch(e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,r,i,o,a,k,C,b,x,l,f,d,h);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,r,i,o,a,k,C,b,x,l,f,s,d,h)}}_analyzeMarkerInsidePolygon(e,t,r,i){const{markerPlacement:o,type:s}=e;if(!o||"CIMMarkerPlacementInsidePolygon"!==o.type||i.hasMotionAnimations)return!1;if("CIMVectorMarker"===s||"CIMPictureMarker"===s){const r=e.primitiveName;if(r&&this._analyzePrimitiveOverrides([r],t,null,null))return!1;const i=o.primitiveName;if(i&&this._analyzePrimitiveOverrides([i],t,null,null))return!1;if("CIMVectorMarker"===s){const{markerGraphics:t}=e;if(t)for(const e of t){const{symbol:t}=e;if("CIMPolygonSymbol"===t?.type&&t.symbolLayers){const{symbolLayers:e}=t;for(const t of e)if("CIMSolidStroke"===t.type)return!1}}}else{const{animatedSymbolProperties:t}=e;if(t)return!1}}const l=Math.abs(o.stepX),n=Math.abs(o.stepY);if(0===l||0===n)return!0;let p,c;if("Random"===o.gridType){const e=a(H),t=Math.max(Math.floor(e/l),1);p=n*Math.max(Math.floor(e/n),1);c=t*l/p}else o.shiftOddRows?(p=2*n,c=l/n*.5):(p=n,c=l/n);const m=E(e),y="CIMCharacterMarker"===e.type?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:y,colorLocked:r,effects:t,color:m,height:p,scaleX:c,angle:o.gridAngle,offsetX:I(o.offsetX),offsetY:I(o.offsetY),applyRandomOffset:"Random"===o.gridType,sampleAlphaOnly:"CIMPictureMarker"!==e.type,hasUnresolvedReplacementColor:!0,animationParams:oe(i)}),!0}_analyzePictureMarker(e,t,i,o,a,l,n,p,c,m,y,d,h,f){const{animatedSymbolProperties:u,primitiveName:v,type:O}=e;let g=I(e.scaleX,1);const _=E(e);i||(i=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const S=this._createGIFAnimatedSymbolPropertiesOverrideExpression(u),M=e.anchorPoint??{x:0,y:0};if("width"in e&&"number"==typeof e.width){const t=e.width;let r=1;const i=this._resourceManager.getResource(e.url);null!=i&&(r=i.width/i.height);g/=r*(I(e.size)/t)}const k=[...o];let C;e.primitiveName&&k.push(e.primitiveName),u||S?C={type:"animated",url:e.url,urlHash:"H"+s(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(C=r(e),C.markerPlacement=null);const b={type:"sprite-rasterization-param",resource:C,overrides:this._getMaterialOverrides(k,O)};S&&b.overrides.push(...S.overrides);const x=n;this._cimLayers.push({type:"marker",spriteRasterizationParam:b,colorLocked:h,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(O,v,"ScaleX",g),rotation:p,offsetX:c,offsetY:m,transform:{type:"cim-marker-transform-param",params:y},color:this._getValueOrOverrideExpression(O,v,"TintColor",_),anchorPoint:{x:M.x,y:M.y},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:1,isOutline:f,markerPlacement:i,animationParams:oe(d),baseSize:x})}_analyzeVectorMarker(e,t,r,i,o,a,s,l,p,c,m,f,u,v,O){const g=e.markerGraphics;if(!g)return;const _=e.frame;let S=0;S=_?_.ymax-_.ymin:a;const M=!!e.scaleSymbolsProportionally;if(S){const t={offsetX:p,offsetY:c,rotation:l,size:s,frameHeight:S,rotateClockWise:!!e.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:M};m=[...m,t]}r||(r=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const k of g)if(k){const s=k.symbol;if(!s)continue;const l=k.primitiveName;l&&i.push(l);let p,c=f;if(("CIMPointSymbol"===s.type||"CIMTextSymbol"===s.type)&&_){let t=0,r=0;const i=k.geometry;"x"in i&&"y"in i&&(t+=i.x-.5*(_.xmin+_.xmax),r+=i.y-.5*(_.ymin+_.ymax));const o=e.anchorPoint;let a=!1;o&&("Absolute"===e.anchorPointUnits?(t-=o.x,r-=o.y,a=!0):_&&(t-=(_.xmax-_.xmin)*o.x,r-=(_.ymax-_.ymin)*o.y));const s={offsetX:t,offsetY:r,rotation:0,size:0,frameHeight:0,rotateClockWise:!1,absoluteAnchorPoint:a,scaleSymbolsProportionally:M};p=[...m,s]}const g=k.geometry,[C,b]=y(g,_);switch(0===C&&0===b||(c=d(c,C,b)),"CIMPointSymbol"===s.type&&(c=n(this._poMap,s,c)),s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":u||ee(s)?(c={...c,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:h([0,0]),rotation:h(0),scale:h(S),parent:f.transform}},this._analyzeMultiLayerGraphicNonSDF(e,t,r,k,i,o,a,p??m,c,S,v,O)):this._analyzeMultiLayerGraphic(e,t,r,k,i,o,a,p??m,c,S,v,O);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,r,k,i,o,a,p??m,v)}l&&i.pop()}}_analyzeMultiLayerGraphic(e,t,r,i,o,a,s,l,n,p,c,m){const y=i.symbol.symbolLayers;y&&(!$(y)||f(n)?te(y)?this._analyzeMultiLayerGraphicNonSDF(e,t,r,i,o,a,s,l,n,p,!!c,m):this._analyzeMarkerGraphicSymbolLayers(e,t,r,i,o,a,s,l,n,p,c,m):this._analyzeCompositeMarkerGraphic(e,t,r,i,y,a,s,l,p,c,m))}_analyzeMarkerGraphicSymbolLayers(e,t,r,i,o,a,s,l,p,c,m,y){const d=i.symbol,h=d.symbolLayers;if(!h)return;const f=this._resourceManager.geometryEngine,u=D.applyEffects(d.effects,i.geometry,f);if(!u)return;let v=h.length;for(;v--;){const d=h[v];if(!d||!1===d.enable)continue;const g=d.primitiveName;switch(g&&o.push(g),d.type){case"CIMSolidFill":case"CIMSolidStroke":{const o=D.applyEffects(d.effects,u,f),h=S(o);if(!h)continue;const v="Relative"!==e.anchorPointUnits,_=R(d)??0,{frameSizeRatio:C,anchorX:x,anchorY:P,widthRatio:z,sdfPaddingRatio:E}=M(h,e.frame,e.size,e.anchorPoint,v,_,e.scaleSymbolsProportionally),L="CIMSolidFill"===d.type,V={type:"sdf",geom:o,sdfPaddingRatio:E,asFill:L},{path:N}=d,G=L?b(w(d)):null==N?b(A(d)):[0,0,0,0],T=L?[0,0,0,0]:b(A(d));if(!L&&!_)break;const F=i.primitiveName;let X=null;L&&!d.colorLocked&&(X=this._maybeGetValueOrOverrideExpression(F,"FillColor"));let j=null;L||d.colorLocked||(j=this._maybeGetValueOrOverrideExpression(F,"StrokeColor"));const Y=X??this._getValueOrOverrideExpression(d.type,g,"Color",G),W=j??this._getValueOrOverrideExpression(d.type,g,"Color",T),U=this._maybeGetValueOrOverrideExpression(F,"StrokeWidth")??this._getValueOrOverrideExpression(d.type,g,"Width",_),H=N?{type:"sprite-rasterization-param",resource:{type:"path",path:N,asFill:L},overrides:[]}:{type:"sprite-rasterization-param",resource:V,overrides:[]},J=n(this._poMap,d,p),B=I(e.size,O.CIMVectorMarker.size),q=this._getValueOrOverrideExpression(e.type,e.primitiveName,"Size",B);this._cimLayers.push({type:"marker",spriteRasterizationParam:H,colorLocked:!!d.colorLocked||!!m,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x,y:P},isAbsoluteAnchorPoint:v,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:c,widthRatio:z,rotateClockwise:!1,referenceSize:s,sizeRatio:C,color:Y,outlineColor:W,outlineWidth:U,isOutline:y,markerPlacement:r,animationParams:oe(J),isStroke:"CIMSolidFill"!==d.type,baseSize:q,...k(o,E)});break}case"CIMPictureMarker":case"CIMVectorMarker":if(d.markerPlacement){J().error("Error analyzing CIM, got unexpected marker placement");break}this._analyzeMarker(d,t,r,o,a,s,!1,l,p,m,y)}g&&o.pop()}}_analyzeTextGraphic(e,r,i,o,a,s,l,n){const p=[];_.findApplicableOverrides(i,this._primitiveOverrides,p);const c=i.geometry;if(!("x"in c)||!("y"in c))return;const m=i.symbol,y=G(m),d=T(m.fontStyleName),h=t(m.fontFamilyName);m.font={family:h,decoration:y,...d};const f=I(m.height,O.CIMTextSymbol.height),u=I(m.angle),v=I(m.offsetX),g=I(m.offsetY),{haloSymbol:S}=m,M=I(m.haloSize,0);let k=[0,0,0,0];if(S?.symbolLayers?.length){const e=S.symbolLayers;for(const t of e)if(t.color){k=this._getValueOrOverrideExpression(m?.haloSymbol?.type??"CIMPolygonSymbol",t.primitiveName,"Color",b(t.color));break}}const C=i.primitiveName;let x=[0,0,0,1],P=[0,0,0,0],z=0,E=!1;if(m.symbol?.symbolLayers)for(const t of m.symbol.symbolLayers){const e=t.primitiveName;if("CIMSolidStroke"===t.type)P=this._getValueOrOverrideExpression("CIMSolidStroke",e,"Color",b(t.color)),z=this._getValueOrOverrideExpression("CIMSolidStroke",e,"Width",R(t)??0);else if("CIMSolidFill"===t.type){const r=b(t.color);E=E??!!t.colorLocked,x=this._getValueOrOverrideExpression("CIMSolidFill",e??C,"Color",r)}}let L=null,V=null,N=null,w=null,A=null;C&&(L=this._maybeGetValueOrOverrideExpression(C,"TextSize"),V=this._maybeGetValueOrOverrideExpression(C,"TextAngle"),N=this._maybeGetValueOrOverrideExpression(C,"TextOffsetX"),w=this._maybeGetValueOrOverrideExpression(C,"TextOffsetY"),E||(A=this._maybeGetValueOrOverrideExpression(C,"FillColor")));const j=A??x;let Y=null,W=null,D=0;if(m.callout&&"CIMBackgroundCallout"===m.callout.type){const e=m.callout;if(e.backgroundSymbol){const t=e.backgroundSymbol.symbolLayers;if(t)for(const e of t)"CIMSolidFill"===e.type?Y=b(e.color):"CIMSolidStroke"===e.type&&(W=b(e.color),D=I(e.width,O.CIMSolidStroke.width))}}const U=this._getValueOrOverrideExpression(m.type,i.primitiveName,"TextString",i.textString??"");if(null==U)return;const{fontStyleName:H}=m,J=h+(H?"-"+H.toLowerCase():"-regular"),B=this._getMaterialOverrides(o,m.type);B.push(...this._getPrimitiveMaterialOverrides(i.primitiveName,m.type)),this._collectDictionaryTemplateOverrides(B,i);const q={type:"text-rasterization-param",resource:{type:"text",textString:i.textString??"",font:m.font,symbol:m,primitiveName:i.primitiveName},overrides:B};this._cimLayers.push({type:"text",lineWidth:m.lineWidth,textRasterizationParam:q,colorLocked:!!n||!!E,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:J,decoration:y,haloSize:M,haloColor:k,weight:d.weight,style:d.style,size:L??f,angle:V??u,offsetX:N??v,offsetY:w??g,transform:{type:"cim-marker-transform-param",params:l},horizontalAlignment:X(m.horizontalAlignment),verticalAlignment:F(m.verticalAlignment),text:U,color:j,outlineColor:P,outlineSize:z,backgroundColor:Y,borderLineColor:W,borderLineWidth:D,referenceSize:s,sizeRatio:1,markerPlacement:r})}_collectDictionaryTemplateOverrides(e,t){if(t.textString&&this._hasTextStringTemplates){const r=j(t.symbol);e.push({propertyName:"textString",defaultValue:"",valueExpressionInfo:{type:"dictionary-template",textCase:r,template:t.textString},primitiveName:t.primitiveName})}}_analyzeMultiLayerGraphicNonSDF(e,t,r,i,a,s,l,n,p,c,m,y){const d=K(e,i),h=e.primitiveName,f=this._analyzeMaterialOverrides(h,["Rotation","OffsetX","OffsetY"]),v=L(f),[g,_,S]=u.getTextureAnchor(d,this._resourceManager,U),M=this._getMaterialOverrides(a,e.type);M.push(...v);const k={type:"sprite-rasterization-param",resource:{...d,avoidSDFRasterization:!0},overrides:M},C=I(e.size,O.CIMVectorMarker.size),b=this._getValueOrOverrideExpression(e.type,h,"Size",C);this._cimLayers.push({type:"marker",spriteRasterizationParam:k,colorLocked:m,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:s,anchorPoint:{x:g,y:_},isAbsoluteAnchorPoint:!1,size:c,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:n},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:c,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:S/o(e.size),isOutline:y,markerPlacement:r,animationParams:oe(p),baseSize:b})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return _.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-param",placement:e,overrides:ie(t)}}_createGIFAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return _.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-gif-animation-params",animation:e,overrides:ie(t)}}_analyzeCompositeMarkerGraphic(e,t,r,i,o,a,s,l,n,p,c){const m=i.geometry,y=o[0],d=o[1],h=S(m);if(!h)return;const f="Relative"!==e.anchorPointUnits,u=I(y.width,O.CIMSolidStroke.width),{frameSizeRatio:v,anchorX:g,anchorY:_,widthRatio:k,sdfPaddingRatio:C}=M(h,e.frame,e.size,e.anchorPoint,f,u,e.scaleSymbolsProportionally),{path:x}=d,P=d.primitiveName,z=y.primitiveName,E=i.primitiveName;let L=null;d.colorLocked||p||(L=this._maybeGetValueOrOverrideExpression(E,"FillColor"));const V=L??this._getValueOrOverrideExpression(d.type,P,"Color",b(d.color));let N=null;y.colorLocked||p||(N=this._maybeGetValueOrOverrideExpression(E,"StrokeColor"));const R=N??this._getValueOrOverrideExpression(y.type,z,"Color",b(y.color)),w=this._maybeGetValueOrOverrideExpression(E,"StrokeWidth")??this._getValueOrOverrideExpression(y.type,z,"Width",u),A={type:"sprite-rasterization-param",resource:x?{type:"path",path:x,asFill:!0}:{type:"sdf",geom:m,sdfPaddingRatio:C,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:A,colorLocked:p,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:g,y:_},isAbsoluteAnchorPoint:f,size:n,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:n,widthRatio:k,rotateClockwise:!1,referenceSize:s,sizeRatio:v,color:V,outlineColor:R,outlineWidth:w,isOutline:c,markerPlacement:r})}_setPoMap(e,t,r){let i;this._poMap[e]?i=this._poMap[e]:(i={},this._poMap[e]=i),i[t]=r}_maybeGetValueOrOverrideExpression(e,t,r){return this._getValueOrOverrideExpression("",e,t,r,!1)}_getValueOrOverrideExpression(e,t,r,i,o=!0){if(o&&!Y(i)&&(i=V(e,r.toLowerCase())),null==t)return i;const a=this._poMap[t];if(null==a)return i;const s=a[r];return"string"==typeof s||"number"==typeof s||Array.isArray(s)?s:s?{valueExpressionInfo:s,defaultValue:i}:i}_analyzePrimitiveOverrides(e,t,r,i){if(null==e)return!1;"string"==typeof e&&(e=[e]);for(const o of this._primitiveOverrides)if(e.includes(o.primitiveName)&&o.valueExpressionInfo)return!0;if(null!=t)for(const o of t)if(o?.overrides.length>0)return!0;if(null!=r)for(const o of r)if(o?.overrides.length>0)return!0;if(null!=i)for(const o of i)if(o?.overrides.length>0)return!0;return!1}_getMaterialOverrides(e,t){if(!e)return[];const r=[];for(const i of e)r.push(...this._getPrimitiveMaterialOverrides(i,t));return r}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const r=L(this._primitiveOverrides.filter(t=>t.primitiveName===e));return r.forEach(e=>e.defaultValue=V(t,e.propertyName.toLowerCase())),r}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(r=>r.primitiveName!==e||!t.includes(r.propertyName))}}function K(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}function Q(e){if(e&&0===e.indexOf("Level_")){const t=parseInt(e.slice(6),10);if(!isNaN(t))return t}return 0}function Z(e,t){if(!t||0===t.length)return e;const i=r(e);return _.applyOverrides(i,t),i}const $=e=>e&&2===e.length&&e[0].enable&&e[1].enable&&"CIMSolidStroke"===e[0].type&&"CIMSolidFill"===e[1].type&&null==e[0].path&&null==e[1].path&&!e[0].effects&&!e[1].effects&&!e[0].animations&&!e[1].animations;function ee(e){const t=e.symbolLayers;if(!t)return!1;const r=t.find(e=>e.effects?.find(e=>"CIMGeometricEffectDashes"===e.type&&null!=e.dashTemplate)),i=t.find(e=>e.effects?.find(e=>"CIMGeometricEffectAddControlPoints"===e.type));return!!r||!!i}function te(e){return e.some(e=>"CIMSolidFill"!==e.type&&"CIMSolidStroke"!==e.type&&("CIMVectorMarker"!==e.type&&"CIMPictureMarker"!==e.type||null!=e.markerPlacement))}function re(e,t){if(t?.some(e=>"CIMGeometricEffectRadial"===e.type)&&t?.some(e=>"CIMGeometricEffectTaperedPolygon"===e.type)&&2===e.length){const t=e.find(e=>"CIMSolidFill"===e.type),r=e.find(e=>"CIMSolidStroke"===e.type),i=r?.effects?.some(e=>"CIMGeometricEffectDashes"===e.type);if(null!=t&&null!=r&&!i)return!0}return!1}function ie(e){return r(e).map(e=>({...e,propertyName:W(e.propertyName)}))}function oe(e){return f(e)?{type:"animation-params",params:e}:null}export{q as CIMAnalyzer,Z as analyzeCIMResource};
|
|
5
|
+
import{isRGB as e}from"../../core/colorUtils.js";import{getFontFamily as t}from"../../core/fontUtils.js";import"../../core/has.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{pt2px as o,px2pt as a}from"../../core/screenUtils.js";import{numericHash as s}from"../../core/string.js";import{checkForAnimations as l,getAnimationParams as n,handleAbsoluteAnchor as p,handleMarker as c,handleRelativeAnchor as m,getFrameTranslation as y,translate as d,getStaticParam as h,shouldUseAnimatedPath as f}from"./animationUtils.js";import{CIMSymbolHelper as u}from"./CIMSymbolHelper.js";import{antialiasingOutlineFillSettings as v}from"./constants.js";import{defaultCIMValues as O}from"./defaultCIMValues.js";import{fitVectorMarker as g}from"./fitVectorMarker.js";import{OverrideHelper as _}from"./OverrideHelper.js";import{getExtent as S,getSDFMetrics as M,getSDFDimensions as k}from"./SDFHelper.js";import{colorToArray as C,normalizeAlpha as b,getSize as x,isCIMMarkerStrokePlacement as P,hasStrokeLayer as z,getTintColor as I,getNumericValue as E,normalizePrimitiveOverrideProps as L,getDefaultCIMValue as V,getEnum as N,getStrokeWidth as R,getFillColor as w,getStrokeColor as A,fromCIMFontDecoration as G,fromCIMFontStyle as T,fromCIMVerticalAlignment as F,fromCIMHorizontalAlignment as X,getTextCasing as j,isValidCIMValue as W,uncapitalize as Y}from"./utils.js";import{CIMEffectHelper as D}from"./effects/CIMEffectHelper.js";import{rasterizedVectorMarkerMinSize as U,randomInsidePolygonTextureSize as H}from"../../views/2d/engine/webgl/definitions.js";const J=()=>i.getLogger("esri.symbols.cim.cimAnalyzer");function B(e){const t=e.markerPlacement;return t&&t.angleToLine?1:0}class q{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],this._hasTextStringTemplates=!1,e&&(this._resourceManager=e)}analyzeSymbolReference(t,r,i){if(this._cimLayers=i??[],!t)return this._cimLayers;if(this._reset(),this._hasTextStringTemplates=t.hasTextStringTemplates??!1,t.primitiveOverrides){this._primitiveOverrides=t.primitiveOverrides;for(const t of this._primitiveOverrides){const r=t.valueExpressionInfo;if(r)this._setPoMap(t.primitiveName,t.propertyName,r);else if(null!=t.value){let r=t.value;t.propertyName.includes("Color")&&(e(r)&&(r=C(r)),r=b(r)),this._setPoMap(t.primitiveName,t.propertyName,r)}}}return this._analyzeSymbol(t.symbol,r),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const r=e?.symbolLayers;if(!r)return;for(let l=0;l<r.length;l++){const e=r[l];"CIMVectorMarker"===e.type&&(r[l]=g(e))}const i=e.effects;let o=0;const a=x(e)??0;if("CIMPointSymbol"===e.type&&"Map"===e.angleAlignment&&(o=1),re(r,i))return this._analyzeCompositeOutlineFill(r,i,a);let s={transform:[0,0,0,1],fromColor:[1,1,1,1],toColor:[1,1,1,1],colorMix:[0,0,0,0],toOpacity:[1,1,1,1],opacityMix:[0,0,0,0],shift:[1,1,1,1],hasAnimations:l(e),hasShiftAnimation:!1,hasMotionAnimations:!1};s=n(this._poMap,e,s);const p="CIMPolygonSymbol"===e.type;let c=r.length;for(;c--;){const l=r[c];if(!l||!1===l.enable)continue;let n;i?.length&&(n=[...i]);const m=l.effects;m?.length&&(i?n.push(...m):n=[...m]);let y=null;if(n){y=[];for(const e of n){const t=_.findEffectOverrides(e,this._primitiveOverrides);t&&y.push(t)}}const d=[];switch(_.findApplicableOverrides(l,this._primitiveOverrides,d),l.type){case"CIMSolidFill":this._analyzeSolidFill(l,y,s,z(r));break;case"CIMPictureFill":this._analyzePictureFill(l,y,s);break;case"CIMHatchFill":this._analyzeHatchFill(l,y);break;case"CIMGradientFill":this._analyzeGradientFill(l,y);break;case"CIMSolidStroke":this._analyzeSolidStroke(l,y,p,a,s);break;case"CIMPictureStroke":this._analyzePictureStroke(l,y,p,a,s);break;case"CIMGradientStroke":this._analyzeGradientStroke(l,y,p,a);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{"CIMLineSymbol"!==e.type&&"CIMPolygonSymbol"!==e.type||(o=B(l));const r=[],i=l.primitiveName;i&&r.push(i);const n=p&&P(l.markerPlacement);this._analyzeMarker(l,y,null,r,o,a,t,[],s,!1,n);break}default:J().error("Cannot analyze CIM layer",l.type)}}}_analyzeSolidFill(e,t,r,i){const{primitiveName:o,type:a}=e,s=b(e.color),l=n(this._poMap,e,r);if(!i&&t?.some(e=>"CIMGeometricEffectTaperedPolygon"===e.effect.type)){const r=this._getValueOrOverrideExpression(a,o,"Color",s);return void this._cimLayers.push({type:"outlineFill",colorLocked:!!e.colorLocked,color:r,effects:t,outlineColor:r,outlineColorLocked:!!e.colorLocked,...v,outlineEffects:t})}this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(a,o,"Color",s),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1,animationParams:oe(l)})}_analyzePictureFill(e,t,r){const{primitiveName:i,type:o}=e,a=I(e),s=E(e.height,O.CIMPictureFill.height);let l=E(e.scaleX,1);if("width"in e&&"number"==typeof e.width){const t=e.width;let r=1;const i=this._resourceManager.getResource(e.url);null!=i&&(r=i.width/i.height),l/=r*(s/t)}const p={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(i,o)},c=n(this._poMap,e,r);this._cimLayers.push({type:"fill",spriteRasterizationParam:p,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,i,"TintColor",a),height:this._getValueOrOverrideExpression(o,i,"Height",s),scaleX:this._getValueOrOverrideExpression(o,i,"ScaleX",l),angle:this._getValueOrOverrideExpression(o,i,"Rotation",E(e.rotation)),offsetX:this._getValueOrOverrideExpression(o,i,"OffsetX",E(e.offsetX)),offsetY:this._getValueOrOverrideExpression(o,i,"OffsetY",E(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1,animationParams:oe(c)})}_analyzeHatchFill(e,t){const{primitiveName:r,type:i}=e,o=this._analyzeMaterialOverrides(r,["Rotation","OffsetX","OffsetY"]),a=L(o);let s=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(const p of e.lineSymbol.symbolLayers){if("CIMSolidStroke"!==p.type)continue;const e=p.primitiveName??r;l||!e||p.colorLocked||null==this._poMap[e]?.Color&&null==this._poMap[e]?.StrokeColor||(s=b(p.color),s=this._maybeGetValueOrOverrideExpression(e,"StrokeColor")??this._getValueOrOverrideExpression(i,e,"Color",s),l=!0);const t=this._maybeGetValueOrOverrideExpression(e,"StrokeWidth");if(t){let r=null,o=null;"number"==typeof t?r=t:o=t.valueExpressionInfo;let s=a.find(e=>"strokeWidth"===e.propertyName);s?s.propertyName="width":(s={type:"CIMPrimitiveOverride",primitiveName:e,propertyName:"width",valueExpressionInfo:o,value:r,defaultValue:V(i,"width")},a.push(s))}}const n={type:"sprite-rasterization-param",resource:e,overrides:a};this._cimLayers.push({type:"fill",spriteRasterizationParam:n,colorLocked:!!e.colorLocked,effects:t,color:s,height:this._getValueOrOverrideExpression(i,r,"Separation",E(e.separation,O.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(i,r,"Rotation",E(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,r,"OffsetX",E(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,r,"OffsetY",E(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l})}_analyzeGradientFill(e,t){const{angle:r,gradientMethod:i,gradientSize:o,gradientSizeUnits:a,gradientType:s,interval:l,primitiveName:n,type:p}=e,c=O.CIMGradientFill,m=e.colorRamp;this._cimLayers.push({type:"gradientFill",spriteRasterizationParam:{type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(n,p)},colorLocked:!1,effects:t,color:[255,255,255,1],gradientMethod:this._getValueOrOverrideExpression(p,n,"GradientMethod",i??"Linear"),angle:this._getValueOrOverrideExpression(p,n,"Angle",E(r,c.angle)),gradientType:this._getValueOrOverrideExpression(p,n,"GradientType",s??c.gradientType),interval:this._getValueOrOverrideExpression(p,n,"Interval",E(l,"CIMFixedColorRamp"===m.type?m.colors.length:c.interval)),gradientSize:this._getValueOrOverrideExpression(p,n,"GradientSize",E(o,c.gradientSize)),gradientSizeUnits:"Absolute"===a?1:"Relative"===a?0:c.gradientSizeUnits})}_analyzeCompositeOutlineFill(e,t,r){const i=e.find(e=>"CIMSolidFill"===e.type),o=e.find(e=>"CIMSolidStroke"===e.type);if(null==i||null==o)return;const a=[...t??[],...i.effects??[]].map(e=>_.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>null!=e),s=[...t??[],...o.effects??[]].map(e=>_.findEffectOverrides(e,this._primitiveOverrides)).filter(e=>null!=e),l=E(o.width,O.CIMSolidStroke.width),n=N(o.capStyle,O.CIMSolidStroke.capstyle),p=N(o.joinStyle,O.CIMSolidStroke.joinstyle),c=o.miterLimit;this._cimLayers.push({type:"outlineFill",colorLocked:!!i.colorLocked,color:this._getValueOrOverrideExpression(i.type,i.primitiveName,"Color",b(i.color)),effects:a,outlineColorLocked:!!o.colorLocked,outlineColor:this._getValueOrOverrideExpression(o.type,o.primitiveName,"Color",b(o.color)),outlineWidth:this._getValueOrOverrideExpression(o.type,o.primitiveName,"Width",l),cap:this._getValueOrOverrideExpression(o.type,o.primitiveName,"CapStyle",n),join:this._getValueOrOverrideExpression(o.type,o.primitiveName,"JoinStyle",p),miterLimit:c&&this._getValueOrOverrideExpression(o.type,o.primitiveName,"MiterLimit",c),referenceWidth:r,outlineEffects:s})}_analyzeSolidStroke(e,t,r,i,o){const{primitiveName:a,type:s}=e,l=b(e.color),p=E(e.width,O.CIMSolidStroke.width),c=N(e.capStyle,O.CIMSolidStroke.capstyle),m=N(e.joinStyle,O.CIMSolidStroke.joinstyle),y=e.miterLimit;let d,h,f,u,v=[];if(this._analyzePrimitiveOverrides(a,t,null,null)&&(v=this._getPrimitiveMaterialOverrides(a,s)),t&&Array.isArray(t)&&t.length>0){const e=t[t.length-1].effect;e&&"CIMGeometricEffectDashes"===e.type&&"NoConstraint"===e.lineDashEnding&&(d=e.dashTemplate,h=e.scaleDash,f=e.offsetAlongLine,u=e.primitiveName,(t=[...t]).pop())}null!=u&&v.push(...this._getPrimitiveMaterialOverrides(u,s).filter(e=>"dashTemplate"===e.propertyName));const g=void 0!==d?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:d,primitiveName:u},overrides:v}:null,_=n(this._poMap,e,o);this._cimLayers.push({type:"line",spriteRasterizationParam:g,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"Color",l),width:this._getValueOrOverrideExpression(s,a,"Width",p),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",c),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",m),miterLimit:y&&this._getValueOrOverrideExpression(s,a,"MiterLimit",y),referenceWidth:i,zOrder:Q(e.name),dashTemplate:this._maybeGetValueOrOverrideExpression(u,"DashTemplate")??d,offsetAlongLine:this._getValueOrOverrideExpression(s,u,"OffsetAlongLine",f??0),scaleDash:h,sampleAlphaOnly:!0,animationParams:oe(_)})}_analyzePictureStroke(e,t,r,i,o){const{primitiveName:a,type:s}=e,l=I(e),p=E(e.width,O.CIMPictureStroke.width),c=N(e.capStyle,O.CIMPictureStroke.capstyle),m=N(e.joinStyle,O.CIMPictureStroke.joinstyle),y=e.miterLimit,d={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(a,s)},h=n(this._poMap,e,o);this._cimLayers.push({type:"line",spriteRasterizationParam:d,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"TintColor",l),width:this._getValueOrOverrideExpression(s,a,"Width",p),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",c),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",m),miterLimit:y&&this._getValueOrOverrideExpression(s,a,"MiterLimit",y),referenceWidth:i,zOrder:Q(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1,animationParams:oe(h)})}_analyzeGradientStroke(e,t,r,i){const{gradientMethod:o,gradientSize:a,gradientSizeUnits:s,gradientType:l,interval:n,primitiveName:p,type:c}=e,m=O.CIMGradientStroke,y=E(e.width,m.width),d=N(e.capStyle,m.capstyle),h=N(e.joinStyle,m.joinstyle),f=e.miterLimit,u=e.colorRamp;this._cimLayers.push({type:"gradientStroke",spriteRasterizationParam:{type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(p,c)},colorLocked:!!e.colorLocked,effects:t,color:[255,255,255,1],width:this._getValueOrOverrideExpression(c,p,"Width",y),cap:this._getValueOrOverrideExpression(c,p,"CapStyle",d),join:this._getValueOrOverrideExpression(c,p,"JoinStyle",h),miterLimit:f&&this._getValueOrOverrideExpression(c,p,"MiterLimit",f),referenceWidth:i,isOutline:r,gradientMethod:this._getValueOrOverrideExpression(c,p,"GradientMethod",o??m.gradientMethod),gradientType:this._getValueOrOverrideExpression(c,p,"GradientType",l??m.gradientType),interval:this._getValueOrOverrideExpression(c,p,"Interval",E(n,"CIMFixedColorRamp"===u.type?u.colors.length:m.interval)),gradientSize:this._getValueOrOverrideExpression(c,p,"GradientSize",E(a,m.gradientSize)),gradientSizeUnits:"Absolute"===s?1:"Relative"===s?0:m.gradientSizeUnits})}_analyzeMarker(e,t,r,i,o,a,s,l,y,d=!1,h=!1){d||=!!e.colorLocked;let f=y;if(f=p(e,f),f=c(this._poMap,e,f),f=m(e,f),f=n(this._poMap,e,f),this._analyzeMarkerInsidePolygon(e,t,d,f))return;const u=E(e.size,O.CIMVectorMarker.size),v=E(e.rotation),g=E(e.offsetX),_=E(e.offsetY),{primitiveName:S,type:M}=e,k=this._getValueOrOverrideExpression(M,S,"Size",u),C=this._getValueOrOverrideExpression(M,S,"Rotation",v),b=this._getValueOrOverrideExpression(M,S,"OffsetX",g),x=this._getValueOrOverrideExpression(M,S,"OffsetY",_);switch(e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,r,i,o,a,k,C,b,x,l,f,d,h);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,r,i,o,a,k,C,b,x,l,f,s,d,h)}}_analyzeMarkerInsidePolygon(e,t,r,i){const{markerPlacement:o,type:s}=e;if(!o||"CIMMarkerPlacementInsidePolygon"!==o.type||i.hasMotionAnimations)return!1;if("CIMVectorMarker"===s||"CIMPictureMarker"===s){const r=e.primitiveName;if(r&&this._analyzePrimitiveOverrides([r],t,null,null))return!1;const i=o.primitiveName;if(i&&this._analyzePrimitiveOverrides([i],t,null,null))return!1;if("CIMVectorMarker"===s){const{markerGraphics:t}=e;if(t)for(const e of t){const{symbol:t}=e;if("CIMPolygonSymbol"===t?.type&&t.symbolLayers){const{symbolLayers:e}=t;for(const t of e)if("CIMSolidStroke"===t.type)return!1}}}else{const{animatedSymbolProperties:t}=e;if(t)return!1}}const l=Math.abs(o.stepX),n=Math.abs(o.stepY);if(0===l||0===n)return!0;let p,c;if("Random"===o.gridType){const e=a(H),t=Math.max(Math.floor(e/l),1);p=n*Math.max(Math.floor(e/n),1);c=t*l/p}else o.shiftOddRows?(p=2*n,c=l/n*.5):(p=n,c=l/n);const m=I(e),y="CIMCharacterMarker"===e.type?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:y,colorLocked:r,effects:t,color:m,height:p,scaleX:c,angle:o.gridAngle,offsetX:E(o.offsetX),offsetY:E(o.offsetY),applyRandomOffset:"Random"===o.gridType,sampleAlphaOnly:"CIMPictureMarker"!==e.type,hasUnresolvedReplacementColor:!0,animationParams:oe(i)}),!0}_analyzePictureMarker(e,t,i,o,a,l,n,p,c,m,y,d,h,f){const{animatedSymbolProperties:u,primitiveName:v,type:O}=e;let g=E(e.scaleX,1);const _=I(e);i||(i=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const S=this._createGIFAnimatedSymbolPropertiesOverrideExpression(u),M=e.anchorPoint??{x:0,y:0};if("width"in e&&"number"==typeof e.width){const t=e.width;let r=1;const i=this._resourceManager.getResource(e.url);null!=i&&(r=i.width/i.height);g/=r*(E(e.size)/t)}const k=[...o];let C;e.primitiveName&&k.push(e.primitiveName),u||S?C={type:"animated",url:e.url,urlHash:"H"+s(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(C=r(e),C.markerPlacement=null);const b={type:"sprite-rasterization-param",resource:C,overrides:this._getMaterialOverrides(k,O)};S&&b.overrides.push(...S.overrides);const x=n;this._cimLayers.push({type:"marker",spriteRasterizationParam:b,colorLocked:h,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(O,v,"ScaleX",g),rotation:p,offsetX:c,offsetY:m,transform:{type:"cim-marker-transform-param",params:y},color:this._getValueOrOverrideExpression(O,v,"TintColor",_),anchorPoint:{x:M.x,y:M.y},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:1,isOutline:f,markerPlacement:i,animationParams:oe(d),baseSize:x})}_analyzeVectorMarker(e,t,r,i,o,a,s,l,p,c,m,f,u,v,O){const g=e.markerGraphics;if(!g)return;const _=e.frame;let S=0;S=_?_.ymax-_.ymin:a;const M=!!e.scaleSymbolsProportionally;if(S){const t={offsetX:p,offsetY:c,rotation:l,size:s,frameHeight:S,rotateClockWise:!!e.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:M};m=[...m,t]}r||(r=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const k of g)if(k){const s=k.symbol;if(!s)continue;const l=k.primitiveName;l&&i.push(l);let p,c=f;if(("CIMPointSymbol"===s.type||"CIMTextSymbol"===s.type)&&_){let t=0,r=0;const i=k.geometry;"x"in i&&"y"in i&&(t+=i.x-.5*(_.xmin+_.xmax),r+=i.y-.5*(_.ymin+_.ymax));const o=e.anchorPoint;let a=!1;o&&("Absolute"===e.anchorPointUnits?(t-=o.x,r-=o.y,a=!0):_&&(t-=(_.xmax-_.xmin)*o.x,r-=(_.ymax-_.ymin)*o.y));const s={offsetX:t,offsetY:r,rotation:0,size:0,frameHeight:0,rotateClockWise:!1,absoluteAnchorPoint:a,scaleSymbolsProportionally:M};p=[...m,s]}const g=k.geometry,[C,b]=y(g,_);switch(0===C&&0===b||(c=d(c,C,b)),"CIMPointSymbol"===s.type&&(c=n(this._poMap,s,c)),s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":u||ee(s)?(c={...c,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:h([0,0]),rotation:h(0),scale:h(S),parent:f.transform}},this._analyzeMultiLayerGraphicNonSDF(e,t,r,k,i,o,a,p??m,c,S,v,O)):this._analyzeMultiLayerGraphic(e,t,r,k,i,o,a,p??m,c,S,v,O);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,r,k,i,o,a,p??m,v)}l&&i.pop()}}_analyzeMultiLayerGraphic(e,t,r,i,o,a,s,l,n,p,c,m){const y=i.symbol.symbolLayers;y&&(!$(y)||f(n)?te(y)?this._analyzeMultiLayerGraphicNonSDF(e,t,r,i,o,a,s,l,n,p,!!c,m):this._analyzeMarkerGraphicSymbolLayers(e,t,r,i,o,a,s,l,n,p,c,m):this._analyzeCompositeMarkerGraphic(e,t,r,i,y,a,s,l,p,c,m))}_analyzeMarkerGraphicSymbolLayers(e,t,r,i,o,a,s,l,p,c,m,y){const d=i.symbol,h=d.symbolLayers;if(!h)return;const f=D.applyEffects(d.effects,i.geometry);if(!f)return;let u=h.length;for(;u--;){const d=h[u];if(!d||!1===d.enable)continue;const v=d.primitiveName;switch(v&&o.push(v),d.type){case"CIMSolidFill":case"CIMSolidStroke":{const o=D.applyEffects(d.effects,f),h=S(o);if(!h)continue;const u="Relative"!==e.anchorPointUnits,g=R(d)??0,{frameSizeRatio:_,anchorX:C,anchorY:x,widthRatio:P,sdfPaddingRatio:z}=M(h,e.frame,e.size,e.anchorPoint,u,g,e.scaleSymbolsProportionally),I="CIMSolidFill"===d.type,L={type:"sdf",geom:o,sdfPaddingRatio:z,asFill:I},{path:V}=d,N=I?b(w(d)):null==V?b(A(d)):[0,0,0,0],G=I?[0,0,0,0]:b(A(d));if(!I&&!g)break;const T=i.primitiveName;let F=null;I&&!d.colorLocked&&(F=this._maybeGetValueOrOverrideExpression(T,"FillColor"));let X=null;I||d.colorLocked||(X=this._maybeGetValueOrOverrideExpression(T,"StrokeColor"));const j=F??this._getValueOrOverrideExpression(d.type,v,"Color",N),W=X??this._getValueOrOverrideExpression(d.type,v,"Color",G),Y=this._maybeGetValueOrOverrideExpression(T,"StrokeWidth")??this._getValueOrOverrideExpression(d.type,v,"Width",g),U=V?{type:"sprite-rasterization-param",resource:{type:"path",path:V,asFill:I},overrides:[]}:{type:"sprite-rasterization-param",resource:L,overrides:[]},H=n(this._poMap,d,p),J=E(e.size,O.CIMVectorMarker.size),B=this._getValueOrOverrideExpression(e.type,e.primitiveName,"Size",J);this._cimLayers.push({type:"marker",spriteRasterizationParam:U,colorLocked:!!d.colorLocked||!!m,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:C,y:x},isAbsoluteAnchorPoint:u,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:c,widthRatio:P,rotateClockwise:!1,referenceSize:s,sizeRatio:_,color:j,outlineColor:W,outlineWidth:Y,isOutline:y,markerPlacement:r,animationParams:oe(H),isStroke:"CIMSolidFill"!==d.type,baseSize:B,...k(o,z)});break}case"CIMPictureMarker":case"CIMVectorMarker":if(d.markerPlacement){J().error("Error analyzing CIM, got unexpected marker placement");break}this._analyzeMarker(d,t,r,o,a,s,!1,l,p,m,y)}v&&o.pop()}}_analyzeTextGraphic(e,r,i,o,a,s,l,n){const p=[];_.findApplicableOverrides(i,this._primitiveOverrides,p);const c=i.geometry;if(!("x"in c)||!("y"in c))return;const m=i.symbol,y=G(m),d=T(m.fontStyleName),h=t(m.fontFamilyName);m.font={family:h,decoration:y,...d};const f=E(m.height,O.CIMTextSymbol.height),u=E(m.angle),v=E(m.offsetX),g=E(m.offsetY),{haloSymbol:S}=m,M=E(m.haloSize,0);let k=[0,0,0,0];if(S?.symbolLayers?.length){const e=S.symbolLayers;for(const t of e)if(t.color){k=this._getValueOrOverrideExpression(m?.haloSymbol?.type??"CIMPolygonSymbol",t.primitiveName,"Color",b(t.color));break}}const C=i.primitiveName;let x=[0,0,0,1],P=[0,0,0,0],z=0,I=!1;if(m.symbol?.symbolLayers)for(const t of m.symbol.symbolLayers){const e=t.primitiveName;if("CIMSolidStroke"===t.type)P=this._getValueOrOverrideExpression("CIMSolidStroke",e,"Color",b(t.color)),z=this._getValueOrOverrideExpression("CIMSolidStroke",e,"Width",R(t)??0);else if("CIMSolidFill"===t.type){const r=b(t.color);I=I??!!t.colorLocked,x=this._getValueOrOverrideExpression("CIMSolidFill",e??C,"Color",r)}}let L=null,V=null,N=null,w=null,A=null;C&&(L=this._maybeGetValueOrOverrideExpression(C,"TextSize"),V=this._maybeGetValueOrOverrideExpression(C,"TextAngle"),N=this._maybeGetValueOrOverrideExpression(C,"TextOffsetX"),w=this._maybeGetValueOrOverrideExpression(C,"TextOffsetY"),I||(A=this._maybeGetValueOrOverrideExpression(C,"FillColor")));const j=A??x;let W=null,Y=null,D=0;if(m.callout&&"CIMBackgroundCallout"===m.callout.type){const e=m.callout;if(e.backgroundSymbol){const t=e.backgroundSymbol.symbolLayers;if(t)for(const e of t)"CIMSolidFill"===e.type?W=b(e.color):"CIMSolidStroke"===e.type&&(Y=b(e.color),D=E(e.width,O.CIMSolidStroke.width))}}const U=this._getValueOrOverrideExpression(m.type,i.primitiveName,"TextString",i.textString??"");if(null==U)return;const{fontStyleName:H}=m,J=h+(H?"-"+H.toLowerCase():"-regular"),B=this._getMaterialOverrides(o,m.type);B.push(...this._getPrimitiveMaterialOverrides(i.primitiveName,m.type)),this._collectDictionaryTemplateOverrides(B,i);const q={type:"text-rasterization-param",resource:{type:"text",textString:i.textString??"",font:m.font,symbol:m,primitiveName:i.primitiveName},overrides:B};this._cimLayers.push({type:"text",lineWidth:m.lineWidth,textRasterizationParam:q,colorLocked:!!n||!!I,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:J,decoration:y,haloSize:M,haloColor:k,weight:d.weight,style:d.style,size:L??f,angle:V??u,offsetX:N??v,offsetY:w??g,transform:{type:"cim-marker-transform-param",params:l},horizontalAlignment:X(m.horizontalAlignment),verticalAlignment:F(m.verticalAlignment),text:U,color:j,outlineColor:P,outlineSize:z,backgroundColor:W,borderLineColor:Y,borderLineWidth:D,referenceSize:s,sizeRatio:1,markerPlacement:r})}_collectDictionaryTemplateOverrides(e,t){if(t.textString&&this._hasTextStringTemplates){const r=j(t.symbol);e.push({propertyName:"textString",defaultValue:"",valueExpressionInfo:{type:"dictionary-template",textCase:r,template:t.textString},primitiveName:t.primitiveName})}}_analyzeMultiLayerGraphicNonSDF(e,t,r,i,a,s,l,n,p,c,m,y){const d=K(e,i),h=e.primitiveName,f=this._analyzeMaterialOverrides(h,["Rotation","OffsetX","OffsetY"]),v=L(f),[g,_,S]=u.getTextureAnchor(d,this._resourceManager,U),M=this._getMaterialOverrides(a,e.type);M.push(...v);const k={type:"sprite-rasterization-param",resource:{...d,avoidSDFRasterization:!0},overrides:M},C=E(e.size,O.CIMVectorMarker.size),b=this._getValueOrOverrideExpression(e.type,h,"Size",C);this._cimLayers.push({type:"marker",spriteRasterizationParam:k,colorLocked:m,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:s,anchorPoint:{x:g,y:_},isAbsoluteAnchorPoint:!1,size:c,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:n},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:c,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:S/o(e.size),isOutline:y,markerPlacement:r,animationParams:oe(p),baseSize:b})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return _.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-param",placement:e,overrides:ie(t)}}_createGIFAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return _.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-gif-animation-params",animation:e,overrides:ie(t)}}_analyzeCompositeMarkerGraphic(e,t,r,i,o,a,s,l,n,p,c){const m=i.geometry,y=o[0],d=o[1],h=S(m);if(!h)return;const f="Relative"!==e.anchorPointUnits,u=E(y.width,O.CIMSolidStroke.width),{frameSizeRatio:v,anchorX:g,anchorY:_,widthRatio:k,sdfPaddingRatio:C}=M(h,e.frame,e.size,e.anchorPoint,f,u,e.scaleSymbolsProportionally),{path:x}=d,P=d.primitiveName,z=y.primitiveName,I=i.primitiveName;let L=null;d.colorLocked||p||(L=this._maybeGetValueOrOverrideExpression(I,"FillColor"));const V=L??this._getValueOrOverrideExpression(d.type,P,"Color",b(d.color));let N=null;y.colorLocked||p||(N=this._maybeGetValueOrOverrideExpression(I,"StrokeColor"));const R=N??this._getValueOrOverrideExpression(y.type,z,"Color",b(y.color)),w=this._maybeGetValueOrOverrideExpression(I,"StrokeWidth")??this._getValueOrOverrideExpression(y.type,z,"Width",u),A={type:"sprite-rasterization-param",resource:x?{type:"path",path:x,asFill:!0}:{type:"sdf",geom:m,sdfPaddingRatio:C,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:A,colorLocked:p,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:g,y:_},isAbsoluteAnchorPoint:f,size:n,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:n,widthRatio:k,rotateClockwise:!1,referenceSize:s,sizeRatio:v,color:V,outlineColor:R,outlineWidth:w,isOutline:c,markerPlacement:r})}_setPoMap(e,t,r){let i;this._poMap[e]?i=this._poMap[e]:(i={},this._poMap[e]=i),i[t]=r}_maybeGetValueOrOverrideExpression(e,t,r){return this._getValueOrOverrideExpression("",e,t,r,!1)}_getValueOrOverrideExpression(e,t,r,i,o=!0){if(o&&!W(i)&&(i=V(e,r.toLowerCase())),null==t)return i;const a=this._poMap[t];if(null==a)return i;const s=a[r];return"string"==typeof s||"number"==typeof s||Array.isArray(s)?s:s?{valueExpressionInfo:s,defaultValue:i}:i}_analyzePrimitiveOverrides(e,t,r,i){if(null==e)return!1;"string"==typeof e&&(e=[e]);for(const o of this._primitiveOverrides)if(e.includes(o.primitiveName)&&o.valueExpressionInfo)return!0;if(null!=t)for(const o of t)if(o?.overrides.length>0)return!0;if(null!=r)for(const o of r)if(o?.overrides.length>0)return!0;if(null!=i)for(const o of i)if(o?.overrides.length>0)return!0;return!1}_getMaterialOverrides(e,t){if(!e)return[];const r=[];for(const i of e)r.push(...this._getPrimitiveMaterialOverrides(i,t));return r}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const r=L(this._primitiveOverrides.filter(t=>t.primitiveName===e));return r.forEach(e=>e.defaultValue=V(t,e.propertyName.toLowerCase())),r}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(r=>r.primitiveName!==e||!t.includes(r.propertyName))}}function K(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}function Q(e){if(e&&e.startsWith("Level_")){const t=parseInt(e.slice(6),10);if(!isNaN(t))return t}return 0}function Z(e,t){if(!t||0===t.length)return e;const i=r(e);return _.applyOverrides(i,t),i}const $=e=>e&&2===e.length&&e[0].enable&&e[1].enable&&"CIMSolidStroke"===e[0].type&&"CIMSolidFill"===e[1].type&&null==e[0].path&&null==e[1].path&&!e[0].effects&&!e[1].effects&&!e[0].animations&&!e[1].animations;function ee(e){const t=e.symbolLayers;if(!t)return!1;const r=t.find(e=>e.effects?.find(e=>"CIMGeometricEffectDashes"===e.type&&null!=e.dashTemplate)),i=t.find(e=>e.effects?.find(e=>"CIMGeometricEffectAddControlPoints"===e.type));return!!r||!!i}function te(e){return e.some(e=>"CIMSolidFill"!==e.type&&"CIMSolidStroke"!==e.type&&("CIMVectorMarker"!==e.type&&"CIMPictureMarker"!==e.type||null!=e.markerPlacement))}function re(e,t){if(t?.some(e=>"CIMGeometricEffectRadial"===e.type)&&t?.some(e=>"CIMGeometricEffectTaperedPolygon"===e.type)&&2===e.length){const t=e.find(e=>"CIMSolidFill"===e.type),r=e.find(e=>"CIMSolidStroke"===e.type),i=r?.effects?.some(e=>"CIMGeometricEffectDashes"===e.type);if(null!=t&&null!=r&&!i)return!0}return!1}function ie(e){return r(e).map(e=>({...e,propertyName:Y(e.propertyName)}))}function oe(e){return f(e)?{type:"animation-params",params:e}:null}export{q as CIMAnalyzer,Z as analyzeCIMResource};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectMultipath as e}from"../../../geometry/geometryCursorCollectUtils.js";import{SimpleEffectCursor as o}from"../CIMEffects.js";import{getEffectOperator as r}from"../CIMOperators.js";import{getEffectsInflateSize as s}from"../CIMSymbolHelper.js";const n=96/72;class l{static executeEffects(t,e,l,c
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectMultipath as e}from"../../../geometry/geometryCursorCollectUtils.js";import{SimpleEffectCursor as o}from"../CIMEffects.js";import{getEffectOperator as r}from"../CIMOperators.js";import{getEffectsInflateSize as s}from"../CIMSymbolHelper.js";const n=96/72;class l{static executeEffects(t,e,l,c){const f=n,m=s(t);let p=new o(e);for(const o of t){const t=r(o);t&&(p=t.execute(p,o,f,l,m,c))}return p}static applyEffects(n,l){if(!n)return l;const c=s(n);let f,m=new o(t.fromJSONCIM(l));for(const t of n){const e=r(t);e&&(m=e.execute(m,t,1,null,c,!1))}const p=[];let u=null;for(;f=m.next();)p.push(...e(f)),u=f.geometryType;return 0===p.length||null===u?null:"esriGeometryPolygon"===u?{rings:p}:{paths:p}}}export{l as CIMEffectHelper};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(e,s
|
|
5
|
+
class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(e,s){return new t(e,s)}}class t{constructor(e,t){this._inputGeometries=e,this._angleTolerance=void 0!==t.angleTolerance?t.angleTolerance:120,this._maxCosAngle=Math.cos((1-Math.abs(this._angleTolerance)/180)*Math.PI)}next(){let e=this._inputGeometries.next();if(!e)return null;for(;e;){if("esriGeometryPolygon"===e.geometryType)this._isClosed=!0;else if("esriGeometryPolyline"===e.geometryType)this._isClosed=!1;else{if("esriGeometryEnvelope"!==e.geometryType){e=this._inputGeometries.next();continue}if(this._maxCosAngle)return e;this._isClosed=!0}for(;e.nextPath();)this._processPath(e);return e.reset(),e}return null}_processPath(e){if(e.nextPoint()){const t=e.x,s=e.y;let n=t,i=s,o=e.pathSize,l=0,r=0,a=0,h=0,c=0,_=0;this._isClosed&&++o;for(let u=1;e.nextPoint()||u<o;++u){let x,m;this._isClosed&&u===o-1?(x=t,m=s):(x=e.x,m=e.y);const y=x-n,g=m-i,C=Math.sqrt(y*y+g*g);if(u>1&&C>0&&a>0){(l*y+r*g)/C/a<=this._maxCosAngle&&e.setControlPointAt(u-1)}1===u&&(h=y,c=g,_=C),C>0&&(n=x,i=m,l=y,r=g,a=C)}if(this._isClosed&&a>0&&_>0){(l*h+r*c)/_/a<=this._maxCosAngle&&e.setControlPointAt(0)}}}}export{e as EffectAddControlPoints};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectPath as e}from"../../../geometry/geometryCursorCollectUtils.js";import{PathEffectCursor as r}from"../CIMCursor.js";import{CurveHelper as n,pixelTolerance as o}from"../CurveHelper.js";const s=1.7320508075688772,i=5,c="OpenEnded";class u{static{this.instance=null}static local(){return null===u.instance&&(u.instance=new u),u.instance}execute(t,e,r
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectPath as e}from"../../../geometry/geometryCursorCollectUtils.js";import{PathEffectCursor as r}from"../CIMCursor.js";import{CurveHelper as n,pixelTolerance as o}from"../CurveHelper.js";const s=1.7320508075688772,i=5,c="OpenEnded";class u{static{this.instance=null}static local(){return null===u.instance&&(u.instance=new u),u.instance}execute(t,e,r){return new h(t,e,r)}}class h extends r{constructor(t,e,r){super(t,!1,!0),this._curveHelper=new n,this._width=(void 0!==e.width?e.width:i)*r,this._arrowType=void 0!==e.geometricEffectArrowType?e.geometricEffectArrowType:void 0!==e.arrowType?e.arrowType:c,this._offsetFlattenError=o*r}processPath(e){const r=t.createEmptyOptimizedCIM(e.geometryType);switch(this._arrowType){case"OpenEnded":default:this._constructSimpleArrow(r,e,!0);break;case"Block":this._constructSimpleArrow(r,e,!1);break;case"Crossed":this._constructCrossedArrow(r,e)}return r}_constructSimpleArrow(t,r,n){const o=r.pathLength();let s=this._width;o<2*s&&(s=o/2);const i=this._curveHelper.getSubCurve(r,0,o-s);if(!i||!i.nextPath())return;i.seekPathStart();const c=s/2;if(this._curveHelper.isEmpty(i))return;const u=e(i),h=this._constructOffset(u,-c);if(!h)return;const P=this._constructOffset(u,c);if(!P)return;const l=this._constructArrowBasePoint(h,-c/2);if(!l)return;const p=this._constructArrowBasePoint(P,c/2);if(!p)return;r.seekInPath(r.pathSize-1);const a=[r.x,r.y];t.pushPath(P),t.nextPath(),t.nextPoint(),t.setControlPoint(),t.pushPoint(p),t.nextPoint(),t.setControlPoint(),t.pushPoint(a),t.nextPoint(),t.setControlPoint(),t.pushPoint(l),t.nextPoint(),t.setControlPoint(),t.pushPoints(h.reverse()),t.setControlPoint(),n||(t.setControlPointAt(0),t.setControlPointAt(t.pathSize-1),t.pushPoint(P[0])),t.reset()}_constructCrossedArrow(t,r){const n=r.pathLength();let o=this._width;n<o*(1+s+1)&&(o=n/(1+s+1)),r.seekPathStart();const i=this._curveHelper.getSubCurve(r,0,n-o*(1+s));if(!i)return;i.nextPath();const c=o/2;if(this._curveHelper.isEmpty(i))return;const u=e(i),h=this._constructOffset(u,c);if(!h)return;const P=this._constructOffset(u,-c);if(!P)return;const l=this._curveHelper.getSubCurve(r,0,n-o);if(!l)return;if(l.nextPath(),this._curveHelper.isEmpty(l))return;const p=e(l),a=this._constructOffset(p,c);if(!a)return;const f=this._constructOffset(p,-c);if(!f)return;const _=a[a.length-1],C=this._constructArrowBasePoint(a,c/2);if(!C)return;const w=f[f.length-1],m=this._constructArrowBasePoint(f,-c/2);if(!m)return;r.seekInPath(r.pathSize-1);const x=[r.x,r.y];t.pushPath(h),t.nextPath(),t.nextPoint(),t.setControlPoint(),t.pushPoint(w),t.nextPoint(),t.setControlPoint(),t.pushPoint(m),t.nextPoint(),t.setControlPoint(),t.pushPoint(x),t.nextPoint(),t.setControlPoint(),t.pushPoint(C),t.nextPoint(),t.setControlPoint(),t.pushPoint(_),t.nextPoint(),t.setControlPoint(),t.pushPoints(P.reverse()),t.nextPoint(),t.setControlPoint(),t.reset()}_constructOffset(t,e){return this._curveHelper.offset(t,e,"Rounded",4,this._offsetFlattenError)}_constructArrowBasePoint(t,e){if(!t||t.length<2)return null;const r=t[t.length-2],n=t[t.length-1],o=[n[0]-r[0],n[1]-r[1]];return this._curveHelper.normalize(o),[n[0]+o[1]*e,n[1]-o[0]*e]}}export{u as EffectArrow};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{collectMultipath as t}from"../../../geometry/geometryCursorCollectUtils.js";import i from"../../../geometry/SpatialReference.js";import{clipCursorToTileExtent as s}from"../CIMEffects.js";import{CurveHelper as
|
|
5
|
+
import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{collectMultipath as t}from"../../../geometry/geometryCursorCollectUtils.js";import i from"../../../geometry/SpatialReference.js";import{clipCursorToTileExtent as s,lazyBufferOperator as r}from"../CIMEffects.js";import{CurveHelper as n,pixelTolerance as o}from"../CurveHelper.js";class m{static{this.instance=null}static local(){return null===m.instance&&(m.instance=new m),m.instance}execute(e,t,i,s,r,n){return new l(e,t,i,s,r,n)}}class l{constructor(e,t,i,s,r,m){this._preventClipping=m,this._inputGeometries=e,this._tileKey=s,this._curveHelper=new n,this._size=(void 0!==t.size?t.size:1)*i,this._maxInflateSize=r*i,this._offsetFlattenError=o*i}next(){let n;for(;n=this._inputGeometries.next();){if(0===this._size)return n;if("esriGeometryEnvelope"===n.geometryType)if(this._size>0){const i=e.createEmptyOptimizedCIM(n.geometryType),s=t(n)[0],r=this._curveHelper.offset(s,this._size,"Rounded",4,this._offsetFlattenError);if(r)return i.pushPath(r),i}else if(this._size<0){const t=n.asJSON();if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._size>0)return e.fromJSONCIM({xmin:t.xmin-this._size,xmax:t.xmax+this._size,ymin:t.ymin-this._size,ymax:t.ymax+this._size})}const o=!this._preventClipping&&this._tileKey?s(n,this._maxInflateSize,!0):n;if(!o)continue;const m=r.module,l={...o.asJSON(),spatialReference:{wkid:i.WebMercator.wkid}},a=m.execute(l,this._size);return a?e.fromJSONCIM(a):null}return null}}export{m as EffectBuffer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as s}from"../../../geometry/GeometryCursor.js";import{collectMultipath as t}from"../../../geometry/geometryCursorCollectUtils.js";import{getPathLength as i}from"../../../geometry/support/coordsUtils.js";import{setId as h}from"../CIMCursor.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(s,t,i,h,e){return new r(s,t,i)}}class r{constructor(s,t,i){this._defaultPointSize=20,this._inputGeometries=s,this._geomUnitsPerPoint=i,this._rule=t.rule??"FullGeometry",this._defaultSize=this._defaultPointSize*i}next(){let i;for(;i=this._inputGeometries.next();){const h=this._processGeom(t(i));if(h?.length)return s.fromJSONCIM({paths:h})}return null}_clone(s){return[s[0],s[1]]}_mid(s,t){return[(s[0]+t[0])/2,(s[1]+t[1])/2]}_mix(s,t,i,h){return[s[0]*t+i[0]*h,s[1]*t+i[1]*h]}_add(s,t){return[s[0]+t[0],s[1]+t[1]]}_add2(s,t,i){return[s[0]+t,s[1]+i]}_sub(s,t){return[s[0]-t[0],s[1]-t[1]]}_dist(s,t){return Math.sqrt((s[0]-t[0])*(s[0]-t[0])+(s[1]-t[1])*(s[1]-t[1]))}_norm(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}_normalize(s,t=1){const i=t/this._norm(s);s[0]*=i,s[1]*=i}_leftPerpendicular(s){const t=-s[1],i=s[0];s[0]=t,s[1]=i}_leftPerp(s){return[-s[1],s[0]]}_rightPerpendicular(s){const t=s[1],i=-s[0];s[0]=t,s[1]=i}_rightPerp(s){return[s[1],-s[0]]}_dotProduct(s,t){return s[0]*t[0]+s[1]*t[1]}_crossProduct(s,t){return s[0]*t[1]-s[1]*t[0]}_rotateDirect(s,t,i){const h=s[0]*t-s[1]*i,e=s[0]*i+s[1]*t;s[0]=h,s[1]=e}_makeCtrlPt(s){const t=[s[0],s[1]];return h(t,1),t}_addAngledTicks(s,t,i,h){const e=this._sub(i,t);this._normalize(e);const r=this._crossProduct(e,this._sub(h,t));let _;_=r>0?this._rightPerp(e):this._leftPerp(e);const c=Math.abs(r)/2,u=[];u.push([t[0]+(_[0]-e[0])*c,t[1]+(_[1]-e[1])*c]),u.push(t),u.push(i),u.push([i[0]+(_[0]+e[0])*c,i[1]+(_[1]+e[1])*c]),s.push(u)}_addBezier2(s,t,i,h,e){if(0===e--)return void s.push(h);const r=this._mid(t,i),_=this._mid(i,h),c=this._mid(r,_);this._addBezier2(s,t,r,c,e),this._addBezier2(s,c,_,h,e)}_addBezier3(s,t,i,h,e,r){if(0===r--)return void s.push(e);const _=this._mid(t,i),c=this._mid(i,h),u=this._mid(h,e),o=this._mid(_,c),a=this._mid(c,u),n=this._mid(o,a);this._addBezier3(s,t,_,o,n,r),this._addBezier3(s,n,a,u,e,r)}_add90DegArc(s,t,i,h,e){const r=e??this._crossProduct(this._sub(i,t),this._sub(h,t))>0,_=this._mid(t,i),c=this._sub(_,t);r?this._leftPerpendicular(c):this._rightPerpendicular(c),_[0]+=c[0],_[1]+=c[1],this._addBezier3(s,t,this._mix(t,.33333,_,.66667),this._mix(i,.33333,_,.66667),i,4)}_addArrow(s,t,i){const h=t[0],e=t[1],r=t[t.length-1],_=this._sub(h,e),c=this._norm(_);this._normalize(_);const u=Math.abs(this._crossProduct(_,this._sub(r,e)));let o=this._dotProduct(_,this._sub(r,e));o<.05*c?o=.05*c:o>.95*c&&(o=.95*c);const a=.5*u,n=this._leftPerp(_),p=[e[0]+_[0]*o,e[1]+_[1]*o],d=t.length-1,l=[];l.push(i?[-n[0],-n[1]]:n);let b=[-_[0],-_[1]];for(let P=1;P<d-1;P++){const s=this._sub(t[P+1],t[P]);this._normalize(s);const i=this._dotProduct(s,b),h=this._crossProduct(s,b),e=Math.sqrt((1+i)/2),r=this._sub(s,b);this._normalize(r),r[0]/=e,r[1]/=e,l.push(h<0?[-r[0],-r[1]]:r),b=s}l.push(this._rightPerp(b));for(let P=l.length-1;P>0;P--)s.push([t[P][0]+l[P][0]*a,t[P][1]+l[P][1]*a]);s.push([p[0]+l[0][0]*a,p[1]+l[0][1]*a]),s.push([p[0]+l[0][0]*u,p[1]+l[0][1]*u]),s.push(h),s.push([p[0]-l[0][0]*u,p[1]-l[0][1]*u]),s.push([p[0]-l[0][0]*a,p[1]-l[0][1]*a]);for(let P=1;P<l.length;P++)s.push([t[P][0]-l[P][0]*a,t[P][1]-l[P][1]*a])}_addDash(s,t,i){const h=this._norm(i)/7;this._normalize(i);let e=[];for(let r=0;r<=7;r++)e.push([t[0]+i[0]*r*h,t[1]+i[1]*r*h]),1&r&&(s.push(e),e=[])}_cp2(s,t,i){return s.length>=2?s[1]:this._add2(s[0],t*this._defaultSize,i*this._defaultSize)}_cp3(s,t,i,h){if(s.length>=3)return s[2];const e=this._mix(s[0],1-i,t,i),r=this._sub(t,s[0]);return this._normalize(r),this._rightPerpendicular(r),[e[0]+r[0]*h*this._defaultSize,e[1]+r[1]*h*this._defaultSize]}_arrowPath(s){if(s.length>2)return s;const t=s[0],i=this._cp2(s,-4,0),h=this._sub(t,i);this._normalize(h);const e=this._rightPerp(h);return[t,i,[t[0]+(e[0]-h[0])*this._defaultSize,t[1]+(e[1]-h[1])*this._defaultSize]]}_arrowLastSeg(s){const t=s[0],i=this._cp2(s,-4,0);let h;if(s.length>=3)h=s[s.length-1];else{const s=this._sub(t,i);this._normalize(s);const e=this._rightPerp(s);h=[t[0]+(e[0]-s[0])*this._defaultSize,t[1]+(e[1]-s[1])*this._defaultSize]}return[i,h]}_processGeom(s){if(!s)return null;const t=[];for(const e of s){const s=e.length>1&&i(e)<this._defaultSize;if(!e||0===e.length||s)continue;const r=e.length;let _=e[0];switch(this._rule){case"PerpendicularFromFirstSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,4),h=[];h.push(i),h.push(this._mid(_,s)),t.push(h);break}case"ReversedFirstSegment":{const s=this._cp2(e,0,-1);t.push([s,_]);break}case"PerpendicularToSecondSegment":{if(e.length<3)return[];const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=[];h.push(this._mid(s,i)),h.push(_),t.push(h);break}case"SecondSegmentWithTicks":{if(e.length<3)return[];const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=this._sub(i,s);let r;r=this._crossProduct(h,this._sub(_,s))>0?this._rightPerp(h):this._leftPerp(h);const c=[];c.push([s[0]+(r[0]-h[0])/3,s[1]+(r[1]-h[1])/3]),c.push(s),c.push(i),c.push([i[0]+(r[0]+h[0])/3,i[1]+(r[1]+h[1])/3]),t.push(c);break}case"DoublePerpendicular":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,3),h=this._mid(_,s),r=this._sub(h,i);this._normalize(r);const c=this._crossProduct(r,this._sub(_,i));this._leftPerpendicular(r);const u=[];u.push(_),u.push([i[0]+r[0]*c,i[1]+r[1]*c]),t.push(u);const o=[];o.push([i[0]-r[0]*c,i[1]-r[1]*c]),o.push(s),t.push(o);break}case"OppositeToFirstSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,3),h=this._mid(_,s),r=this._sub(h,i);this._normalize(r);const c=this._crossProduct(r,this._sub(_,i));this._leftPerpendicular(r);const u=[];u.push([i[0]+r[0]*c,i[1]+r[1]*c]),u.push([i[0]-r[0]*c,i[1]-r[1]*c]),t.push(u);break}case"TriplePerpendicular":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,4),h=this._mid(_,s),r=this._sub(h,i);this._normalize(r);const c=this._crossProduct(r,this._sub(_,i));this._leftPerpendicular(r);const u=[];u.push([i[0]+r[0]*c*.8,i[1]+r[1]*c*.8]),u.push([h[0]+.8*(_[0]-h[0]),h[1]+.8*(_[1]-h[1])]),t.push(u),t.push([i,h]);const o=[];o.push([i[0]-r[0]*c*.8,i[1]-r[1]*c*.8]),o.push([h[0]+.8*(s[0]-h[0]),h[1]+.8*(s[1]-h[1])]),t.push(o);break}case"HalfCircleFirstSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,4),h=this._mid(_,s);let r=this._sub(s,_);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),o=Math.sqrt((1+c)/2),a=Math.sqrt((1-c)/2),n=[];let p;this._crossProduct(r,this._sub(i,_))>0?(n.push(_),r=this._sub(_,h),p=s):(n.push(s),r=this._sub(s,h),p=_),this._rotateDirect(r,o,a),r[0]/=o,r[1]/=o;for(let t=1;t<=18;t++)n.push(this._add(h,r)),this._rotateDirect(r,c,u);n.push(p),t.push(n);break}case"HalfCircleSecondSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,1,-1);let h=this._sub(_,s);this._normalize(h);const r=this._crossProduct(h,this._sub(i,s))/2;this._leftPerpendicular(h);const c=[s[0]+h[0]*r,s[1]+h[1]*r];h=this._sub(s,c);const u=Math.cos(Math.PI/18);let o=Math.sin(Math.PI/18);r>0&&(o=-o);const a=[s];for(let t=1;t<=18;t++)this._rotateDirect(h,u,o),a.push(this._add(c,h));t.push(a);break}case"HalfCircleExtended":{const s=this._cp2(e,0,-2),i=this._cp3(e,s,1,-1);let h;if(r>=4)h=e[3];else{const t=this._sub(_,s);h=this._add(i,t)}const c=this._dist(s,i)/2/.75,u=this._sub(s,_);this._normalize(u,c);const o=this._sub(i,h);this._normalize(o,c);const a=[h,i];t.push(a);const n=[this._clone(i)];this._addBezier3(n,i,this._add(i,o),this._add(s,u),s,4),n.push(_),t.push(n);break}case"OpenCircle":{const s=this._cp2(e,-2,0),i=this._sub(s,_),h=Math.cos(Math.PI/18),r=-Math.sin(Math.PI/18),c=[s];for(let t=1;t<=33;t++)this._rotateDirect(i,h,r),c.push(this._add(_,i));t.push(c);break}case"CoverageEdgesWithTicks":{const s=this._cp2(e,0,-1);let i,h;if(r>=3)i=e[2];else{const t=this._sub(s,_),h=this._leftPerp(t);i=[_[0]+h[0]-.25*t[0],_[1]+h[1]-.25*t[1]]}if(r>=4)h=e[3];else{const t=this._mid(_,s),e=this._sub(_,s);this._normalize(e),this._leftPerpendicular(e);const r=this._crossProduct(e,this._sub(i,t));this._rightPerpendicular(e),h=[i[0]+e[0]*r*2,i[1]+e[1]*r*2]}const c=this._sub(s,_);let u,o;u=this._crossProduct(c,this._sub(i,_))>0?this._rightPerp(c):this._leftPerp(c),o=[],o.push(i),o.push(_),o.push([_[0]+(u[0]-c[0])/3,_[1]+(u[1]-c[1])/3]),t.push(o),u=this._crossProduct(c,this._sub(h,s))>0?this._rightPerp(c):this._leftPerp(c),o=[],o.push([s[0]+(u[0]+c[0])/3,s[1]+(u[1]+c[1])/3]),o.push(s),o.push(h),t.push(o);break}case"GapExtentWithDoubleTicks":{const s=this._cp2(e,0,2),i=this._cp3(e,s,0,1);let h;if(r>=4)h=e[3];else{const t=this._sub(s,_);h=this._add(i,t)}this._addAngledTicks(t,_,s,this._mid(i,h)),this._addAngledTicks(t,i,h,this._mid(_,s));break}case"GapExtentMidline":{const s=this._cp2(e,2,0),i=this._cp3(e,s,0,1);let h;if(r>=4)h=e[3];else{const t=this._sub(s,_);h=this._add(i,t)}const c=[];c.push(this._mid(_,i)),c.push(this._mid(s,h)),t.push(c);break}case"Chevron":{const s=this._cp2(e,-1,-1);let i;if(r>=3)i=e[2];else{const t=this._sub(s,_);this._leftPerpendicular(t),i=this._add(_,t)}t.push([s,this._makeCtrlPt(_),i]);break}case"PerpendicularWithArc":{const s=this._cp2(e,0,-2),i=this._cp3(e,s,.5,-1),h=this._sub(s,_),c=this._norm(h);h[0]/=c,h[1]/=c;const u=this._crossProduct(h,this._sub(i,_));let o=this._dotProduct(h,this._sub(i,_));o<.05*c?o=.05*c:o>.95*c&&(o=.95*c);const a=[_[0]+h[0]*o,_[1]+h[1]*o];let n=this._leftPerp(h),p=[];if(p.push([a[0]-n[0]*u,a[1]-n[1]*u]),p.push([a[0]+n[0]*u,a[1]+n[1]*u]),t.push(p),r>=4){const s=e[3];let i=this._dotProduct(h,this._sub(s,_));i<.1*c?i=.1*c:i>.9*c&&(i=.9*c);const r=[_[0]+h[0]*i,_[1]+h[1]*i],u=this._crossProduct(h,this._sub(s,_)),o=[];o.push([r[0]-n[0]*u,r[1]-n[1]*u]),o.push([r[0]+n[0]*u,r[1]+n[1]*u]),t.push(o)}const d=[s[0]+n[0]*u,s[1]+n[1]*u];n=this._sub(s,d);const l=Math.cos(Math.PI/18);let b=Math.sin(Math.PI/18);u<0&&(b=-b),p=[_,s];for(let t=1;t<=9;t++)this._rotateDirect(n,l,b),p.push(this._add(d,n));t.push(p);break}case"ClosedHalfCircle":{const s=this._cp2(e,2,0),i=this._mid(_,s),h=this._sub(s,i),r=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[_,s];for(let t=1;t<=18;t++)this._rotateDirect(h,r,c),u.push(this._add(i,h));t.push(u);break}case"TripleParallelExtended":{const s=this._cp2(e,0,-2),i=this._cp3(e,s,1,-2),r=this._mid(_,s),c=this._sub(i,s);this._normalize(c);const u=Math.abs(this._crossProduct(c,this._sub(r,s)))/2,o=this._dist(s,i),a=[s,_];a.push([_[0]+c[0]*o*.5,_[1]+c[1]*o*.5]),t.push(a);const n=[];n.push([r[0]-c[0]*u,r[1]-c[1]*u]),n.push([r[0]+c[0]*o*.375,r[1]+c[1]*o*.375]),h(n[n.length-1],1),n.push([r[0]+c[0]*o*.75,r[1]+c[1]*o*.75]),t.push(n);const p=[s,i];t.push(p);break}case"ParallelWithTicks":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(i,s);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h),this._addAngledTicks(t,_,s,i),this._addAngledTicks(t,this._mix(_,1,h,r),this._mix(s,1,h,r),this._mid(_,s));break}case"Parallel":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._leftPerp(h),c=this._crossProduct(h,this._sub(i,_));let u=[_,s];t.push(u),u=[],u.push([_[0]+r[0]*c,_[1]+r[1]*c]),u.push([s[0]+r[0]*c,s[1]+r[1]*c]),t.push(u);break}case"PerpendicularToFirstSegment":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._mid(_,s),r=this._sub(s,_);this._normalize(r);const c=this._crossProduct(r,this._sub(i,_));this._leftPerpendicular(r);const u=[];u.push([h[0]-r[0]*c*.25,h[1]-r[1]*c*.25]),u.push([h[0]+r[0]*c*1.25,h[1]+r[1]*c*1.25]),t.push(u);break}case"ParallelOffset":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h);const c=[];c.push([_[0]-h[0]*r,_[1]-h[1]*r]),c.push([s[0]-h[0]*r,s[1]-h[1]*r]),t.push(c);const u=[];u.push([_[0]+h[0]*r,_[1]+h[1]*r]),u.push([s[0]+h[0]*r,s[1]+h[1]*r]),t.push(u);break}case"OffsetOpposite":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h);const c=[];c.push([_[0]-h[0]*r,_[1]-h[1]*r]),c.push([s[0]-h[0]*r,s[1]-h[1]*r]),t.push(c);break}case"OffsetSame":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h);const c=[];c.push([_[0]+h[0]*r,_[1]+h[1]*r]),c.push([s[0]+h[0]*r,s[1]+h[1]*r]),t.push(c);break}case"CircleWithArc":{let s=this._cp2(e,3,0);const i=this._cp3(e,s,.5,-1);let c,u;if(r>=4)c=e[3],u=this._crossProduct(this._sub(c,s),this._sub(i,s))>0;else{c=s,u=this._crossProduct(this._sub(c,_),this._sub(i,_))>0;const t=24*this._geomUnitsPerPoint,h=this._sub(c,_);this._normalize(h,t);const e=Math.sqrt(2)/2;this._rotateDirect(h,e,u?e:-e),s=this._add(_,h)}const o=this._sub(s,_),a=Math.cos(Math.PI/18),n=Math.sin(Math.PI/18),p=[s];for(let t=1;t<=36;t++)this._rotateDirect(o,a,n),p.push(this._add(_,o));this._add90DegArc(p,s,c,i,u),h(p[p.length-8],1),t.push(p);break}case"DoubleJog":{let s,i=this._cp2(e,-3,1),h=this._cp3(e,i,-1,-.5);if(r>=4)s=e[3];else{const t=_;_=i,s=h;const e=this._dist(_,t),r=this._dist(s,t);let c=30*this._geomUnitsPerPoint;.5*e<c&&(c=.5*e),.5*r<c&&(c=.5*r),i=this._mix(_,c/e,t,(e-c)/e),h=this._mix(s,c/r,t,(r-c)/r)}const c=this._mid(_,i),u=this._mid(s,h),o=this._dist(_,i),a=this._dist(h,s);let n=Math.min(o,a)/8;n=Math.min(n,24*this._geomUnitsPerPoint);const p=Math.cos(Math.PI/4);let d=this._sub(_,i);this._normalize(d,n),this._crossProduct(d,this._sub(s,i))>0?this._rotateDirect(d,p,-p):this._rotateDirect(d,p,p);let l=[];l.push(i),l.push(this._add(c,d)),l.push(this._sub(c,d)),l.push(_),t.push(l),d=this._sub(s,h),this._normalize(d,n),this._crossProduct(d,this._sub(_,h))<0?this._rotateDirect(d,p,p):this._rotateDirect(d,p,-p),l=[],l.push(h),l.push(this._add(u,d)),l.push(this._sub(u,d)),l.push(s),t.push(l);break}case"PerpendicularOffset":{const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=this._sub(i,s);this._crossProduct(h,this._sub(_,s))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const r=[h[0]/8,h[1]/8],c=this._sub(this._mid(s,i),r);t.push([c,_]);break}case"LineExcludingLastSegment":{const s=this._arrowPath(e),i=[];let h=s.length-2;for(;h--;)i.push(s[h]);t.push(i);break}case"MultivertexArrow":{const s=this._arrowPath(e),i=[];this._addArrow(i,s,!1),t.push(i);break}case"CrossedArrow":{const s=this._arrowPath(e),i=[];this._addArrow(i,s,!0),t.push(i);break}case"ChevronArrow":{const[s,i]=this._arrowLastSeg(e),h=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);const u=this._crossProduct(r,this._sub(i,s));let o=this._dotProduct(r,this._sub(i,s));o<.05*c?o=.05*c:o>.95*c-h&&(o=.95*c-h);const a=[s[0]+r[0]*o,s[1]+r[1]*o],n=this._leftPerp(r),p=[];p.push([a[0]+n[0]*u+r[0]*h,a[1]+n[1]*u+r[1]*h]),p.push(_),p.push([a[0]-n[0]*u+r[0]*h,a[1]-n[1]*u+r[1]*h]),t.push(p);break}case"ChevronArrowOffset":{const[s,i]=this._arrowLastSeg(e),h=this._sub(_,s),r=this._norm(h);this._normalize(h);const c=this._crossProduct(h,this._sub(i,s));let u=this._dotProduct(h,this._sub(i,s));u<.05*r?u=.05*r:u>.95*r&&(u=.95*r);const o=[s[0]+h[0]*u,s[1]+h[1]*u];this._leftPerpendicular(h);const a=[];a.push([o[0]+h[0]*c*.5,o[1]+h[1]*c*.5]),a.push(this._mid(o,_)),a.push([o[0]-h[0]*c*.5,o[1]-h[1]*c*.5]),t.push(a);break}case"PartialFirstSegment":{const[s,i]=this._arrowLastSeg(e),h=this._sub(_,s),r=this._norm(h);this._normalize(h);let c=this._dotProduct(h,this._sub(i,s));c<.05*r?c=.05*r:c>.95*r&&(c=.95*r);const u=[s[0]+h[0]*c,s[1]+h[1]*c];t.push([s,u]);break}case"Arch":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,1),h=this._sub(_,s),r=this._mix(i,1,h,.55),c=this._mix(i,1,h,-.55),u=[_];this._addBezier2(u,_,r,i,4),this._addBezier2(u,i,c,s,4),t.push(u);break}case"CurvedParallelTicks":{const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=this._sub(i,s);this._crossProduct(h,this._sub(_,s))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const r=[h[0]/8,h[1]/8],c=this._sub(this._mid(s,i),r),u=this._sub(this._mix(s,.75,i,.25),r),o=this._sub(this._mix(s,.25,i,.75),r),a=[s];this._addBezier2(a,s,u,c,3),this._addBezier2(a,c,o,i,3),t.push(a);for(let e=0;e<8;e++){const s=a[2*e+1],i=[this._clone(s)];i.push(this._add(s,[h[0]/4,h[1]/4])),t.push(i)}break}case"Arc90Degrees":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,1),h=[s];this._add90DegArc(h,s,_,i),t.push(h);break}case"TipWithPerpendicularAndTicks":{const[s,i]=this._arrowLastSeg(e),h=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);let u=this._crossProduct(r,this._sub(i,s)),o=this._dotProduct(r,this._sub(i,s));o<.05*c?o=.05*c:o>.95*c-h&&(o=.95*c-h);const a=this._leftPerp(r),n=[_[0]-r[0]*h,_[1]-r[1]*h],p=.5*Math.max(c-o-h,h);u=Math.abs(u);const d=[];d.push([n[0]+a[0]*(u+p)-r[0]*p,n[1]+a[1]*(u+p)-r[1]*p]),d.push([n[0]+a[0]*u,n[1]+a[1]*u]),d.push([n[0]-a[0]*u,n[1]-a[1]*u]),d.push([n[0]-a[0]*(u+p)-r[0]*p,n[1]-a[1]*(u+p)-r[1]*p]),t.push(d),t.push([n,_]);break}case"ConcentricCircles":{const s=this._cp2(e,1,0),i=this._cp3(e,s,2,0),c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18);let o=this._dist(s,_),a=[o,0],n=[];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,u);if(t.push(n),r>=4){n=[];const s=e[3];o=this._dist(s,_),a=[o,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),0===t&&(n.push(this._add(_,a)),h(n[1],1)),this._rotateDirect(a,c,u);t.push(n)}n=[],o=this._dist(i,_),a=[o,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,u);t.push(n);break}case"DoubleJogArrow":{_=this._arrowPath(e)[0];const[s,i]=this._arrowLastSeg(e),h=this._sub(_,s),r=this._norm(h);this._normalize(h);const c=Math.abs(this._crossProduct(h,this._sub(i,_)));let u=Math.abs(this._dotProduct(h,this._sub(i,_)));u<.05*r?u=.05*r:u>.95*r&&(u=.95*r);const o=Math.max(c,u),a=this._leftPerp(h);let n=[];const p=[_[0]-h[0]*u*.5+a[0]*c*.5,_[1]-h[1]*u*.5+a[1]*c*.5];n.push([p[0],p[1]]),p[0]+=h[0]*o*.5+a[0]*o*.4,p[1]+=h[1]*o*.5+a[1]*o*.4,n.push([p[0],p[1]]),p[0]-=a[0]*o*.25,p[1]-=a[1]*o*.25,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5+a[0]*o*.4,p[1]+=h[1]*o*.5+a[1]*o*.4,n.push([p[0],p[1]]),t.push(n),n=[],p[0]=_[0]-h[0]*u*.5-a[0]*c*.5,p[1]=_[1]-h[1]*u*.5-a[1]*c*.5,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5-a[0]*o*.4,p[1]+=h[1]*o*.5-a[1]*o*.4,n.push([p[0],p[1]]),p[0]+=a[0]*o*.25,p[1]+=a[1]*o*.25,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5-a[0]*o*.4,p[1]+=h[1]*o*.5-a[1]*o*.4,n.push([p[0],p[1]]),t.push(n);break}case"LinkedChevrons":{const s=this._cp2(e,-5,0),i=this._cp3(e,s,-.2,1),h=this._sub(_,s);this._normalize(h);const r=this._leftPerp(h),c=Math.abs(this._crossProduct(h,this._sub(i,s)));t.push([s,_]);const u=[];u.push([_[0]-h[0]*c+r[0]*c,_[1]-h[1]*c+r[1]*c]),u.push(_),u.push([_[0]-h[0]*c-r[0]*c,_[1]-h[1]*c-r[1]*c]),t.push(u),this._addDash(t,s,[-h[0]*c+r[0]*c,-h[1]*c+r[1]*c]),this._addDash(t,s,[-h[0]*c-r[0]*c,-h[1]*c-r[1]*c]);break}case"SegmentThenHalfCircle":{const s=this._cp2(e,2,0),i=this._cp3(e,s,1.5,0);let h;h=r>=4?e[3]:this._cp3(e,s,1.25,-.5);const c=this._sub(s,_);this._normalize(c);const u=.5*this._dist(s,i),o=this._crossProduct(c,this._sub(h,_))>0,a=Math.cos(Math.PI/18);let n=Math.sin(Math.PI/18);o&&(n=-n);const p=[_,s];c[0]*=u,c[1]*=u;const d=this._add(s,c);c[0]=-c[0],c[1]=-c[1];for(let t=1;t<=18;t++)this._rotateDirect(c,a,n),p.push(this._add(d,c));t.push(p);break}case"LineWithStraightTicks":{const s=this._cp2(e,-2,1),i=this._cp3(e,s,-1,-.5),h=this._sub(i,s);this._normalize(h);const r=this._dotProduct(h,this._sub(s,_)),c=this._dotProduct(h,this._sub(i,_));let u=[_];u.push([_[0]+h[0]*r,_[1]+h[1]*r]),u.push(s),t.push(u),u=[_],u.push([_[0]+h[0]*c,_[1]+h[1]*c]),u.push(i),t.push(u);break}case"DoubleCurve":{const s=this._cp2(e,-5,-1),i=this._cp3(e,s,2,0),r=Math.atan2(1,5),c=Math.cos(r),u=Math.sin(r),o=this._sub(s,_),a=this._dist(_,s);this._normalize(o),this._rotateDirect(o,c,-u);const n=[_];n.push([_[0]+o[0]*a*.5,_[1]+o[1]*a*.5]),h(n[1],1),n.push([_[0]+o[0]*a*.8,_[1]+o[1]*a*.8]),this._addBezier2(n,n[2],[_[0]+o[0]*a,_[1]+o[1]*a],s,3);const p=this._sub(i,s),d=this._dist(s,i);this._normalize(p),this._rotateDirect(p,c,-u),this._addBezier2(n,s,[i[0]-p[0]*d,i[1]-p[1]*d],[i[0]-p[0]*d*.8,i[1]-p[1]*d*.8],3),n.push(i),t.push(n);break}case"ParallelWithTicksByWidth":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,3),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h),r>0?(this._addAngledTicks(t,_,[_[0]+h[0]*r,_[1]+h[1]*r],s),this._addAngledTicks(t,s,[s[0]+h[0]*r,s[1]+h[1]*r],_)):(this._addAngledTicks(t,[_[0]+h[0]*r,_[1]+h[1]*r],_,s),this._addAngledTicks(t,[s[0]+h[0]*r,s[1]+h[1]*r],_,s));break}case"EnclosingRoundedRectangle":{const s=this._cp2(e,3,-2),t=[Math.min(_[0],s[0]),Math.max(_[1],s[1])],i=[Math.max(_[0],s[0]),Math.min(_[1],s[1])],h=i[0]-t[0],r=t[1]-i[1],c=Math.min(h,r)/10,u=[];u.push([t[0]+c+.75*(h-2*c),t[1]]),u.push([i[0]-c,t[1]]),this._add90DegArc(u,[i[0]-c,t[1]],[i[0],t[1]-c],[i[0],t[1]]),u.push([i[0],i[1]+c]),this._add90DegArc(u,[i[0],i[1]+c],[i[0]-c,i[1]],i),u.push([t[0]+c,i[1]]),this._add90DegArc(u,[t[0]+c,i[1]],[t[0],i[1]+c],[t[0],i[1]]),u.push([t[0],t[1]-c]),this._add90DegArc(u,[t[0],t[1]-c],[t[0]+c,t[1]],t),u.push([t[0]+c+.75*(h-2*c),t[1]]);break}default:t.push(e)}}return t}}export{e as EffectControlMeasureLine};
|
|
5
|
+
import{GeometryCursor as s}from"../../../geometry/GeometryCursor.js";import{collectMultipath as t}from"../../../geometry/geometryCursorCollectUtils.js";import{getPathLength as i}from"../../../geometry/support/coordsUtils.js";import{setId as h}from"../CIMCursor.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(s,t,i){return new r(s,t,i)}}class r{constructor(s,t,i){this._defaultPointSize=20,this._inputGeometries=s,this._geomUnitsPerPoint=i,this._rule=t.rule??"FullGeometry",this._defaultSize=this._defaultPointSize*i}next(){let i;for(;i=this._inputGeometries.next();){const h=this._processGeom(t(i));if(h?.length)return s.fromJSONCIM({paths:h})}return null}_clone(s){return[s[0],s[1]]}_mid(s,t){return[(s[0]+t[0])/2,(s[1]+t[1])/2]}_mix(s,t,i,h){return[s[0]*t+i[0]*h,s[1]*t+i[1]*h]}_add(s,t){return[s[0]+t[0],s[1]+t[1]]}_add2(s,t,i){return[s[0]+t,s[1]+i]}_sub(s,t){return[s[0]-t[0],s[1]-t[1]]}_dist(s,t){return Math.sqrt((s[0]-t[0])*(s[0]-t[0])+(s[1]-t[1])*(s[1]-t[1]))}_norm(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}_normalize(s,t=1){const i=t/this._norm(s);s[0]*=i,s[1]*=i}_leftPerpendicular(s){const t=-s[1],i=s[0];s[0]=t,s[1]=i}_leftPerp(s){return[-s[1],s[0]]}_rightPerpendicular(s){const t=s[1],i=-s[0];s[0]=t,s[1]=i}_rightPerp(s){return[s[1],-s[0]]}_dotProduct(s,t){return s[0]*t[0]+s[1]*t[1]}_crossProduct(s,t){return s[0]*t[1]-s[1]*t[0]}_rotateDirect(s,t,i){const h=s[0]*t-s[1]*i,e=s[0]*i+s[1]*t;s[0]=h,s[1]=e}_makeCtrlPt(s){const t=[s[0],s[1]];return h(t,1),t}_addAngledTicks(s,t,i,h){const e=this._sub(i,t);this._normalize(e);const r=this._crossProduct(e,this._sub(h,t));let _;_=r>0?this._rightPerp(e):this._leftPerp(e);const c=Math.abs(r)/2,u=[];u.push([t[0]+(_[0]-e[0])*c,t[1]+(_[1]-e[1])*c]),u.push(t),u.push(i),u.push([i[0]+(_[0]+e[0])*c,i[1]+(_[1]+e[1])*c]),s.push(u)}_addBezier2(s,t,i,h,e){if(0===e--)return void s.push(h);const r=this._mid(t,i),_=this._mid(i,h),c=this._mid(r,_);this._addBezier2(s,t,r,c,e),this._addBezier2(s,c,_,h,e)}_addBezier3(s,t,i,h,e,r){if(0===r--)return void s.push(e);const _=this._mid(t,i),c=this._mid(i,h),u=this._mid(h,e),o=this._mid(_,c),a=this._mid(c,u),n=this._mid(o,a);this._addBezier3(s,t,_,o,n,r),this._addBezier3(s,n,a,u,e,r)}_add90DegArc(s,t,i,h,e){const r=e??this._crossProduct(this._sub(i,t),this._sub(h,t))>0,_=this._mid(t,i),c=this._sub(_,t);r?this._leftPerpendicular(c):this._rightPerpendicular(c),_[0]+=c[0],_[1]+=c[1],this._addBezier3(s,t,this._mix(t,.33333,_,.66667),this._mix(i,.33333,_,.66667),i,4)}_addArrow(s,t,i){const h=t[0],e=t[1],r=t[t.length-1],_=this._sub(h,e),c=this._norm(_);this._normalize(_);const u=Math.abs(this._crossProduct(_,this._sub(r,e)));let o=this._dotProduct(_,this._sub(r,e));o<.05*c?o=.05*c:o>.95*c&&(o=.95*c);const a=.5*u,n=this._leftPerp(_),p=[e[0]+_[0]*o,e[1]+_[1]*o],d=t.length-1,l=[];l.push(i?[-n[0],-n[1]]:n);let b=[-_[0],-_[1]];for(let P=1;P<d-1;P++){const s=this._sub(t[P+1],t[P]);this._normalize(s);const i=this._dotProduct(s,b),h=this._crossProduct(s,b),e=Math.sqrt((1+i)/2),r=this._sub(s,b);this._normalize(r),r[0]/=e,r[1]/=e,l.push(h<0?[-r[0],-r[1]]:r),b=s}l.push(this._rightPerp(b));for(let P=l.length-1;P>0;P--)s.push([t[P][0]+l[P][0]*a,t[P][1]+l[P][1]*a]);s.push([p[0]+l[0][0]*a,p[1]+l[0][1]*a]),s.push([p[0]+l[0][0]*u,p[1]+l[0][1]*u]),s.push(h),s.push([p[0]-l[0][0]*u,p[1]-l[0][1]*u]),s.push([p[0]-l[0][0]*a,p[1]-l[0][1]*a]);for(let P=1;P<l.length;P++)s.push([t[P][0]-l[P][0]*a,t[P][1]-l[P][1]*a])}_addDash(s,t,i){const h=this._norm(i)/7;this._normalize(i);let e=[];for(let r=0;r<=7;r++)e.push([t[0]+i[0]*r*h,t[1]+i[1]*r*h]),1&r&&(s.push(e),e=[])}_cp2(s,t,i){return s.length>=2?s[1]:this._add2(s[0],t*this._defaultSize,i*this._defaultSize)}_cp3(s,t,i,h){if(s.length>=3)return s[2];const e=this._mix(s[0],1-i,t,i),r=this._sub(t,s[0]);return this._normalize(r),this._rightPerpendicular(r),[e[0]+r[0]*h*this._defaultSize,e[1]+r[1]*h*this._defaultSize]}_arrowPath(s){if(s.length>2)return s;const t=s[0],i=this._cp2(s,-4,0),h=this._sub(t,i);this._normalize(h);const e=this._rightPerp(h);return[t,i,[t[0]+(e[0]-h[0])*this._defaultSize,t[1]+(e[1]-h[1])*this._defaultSize]]}_arrowLastSeg(s){const t=s[0],i=this._cp2(s,-4,0);let h;if(s.length>=3)h=s[s.length-1];else{const s=this._sub(t,i);this._normalize(s);const e=this._rightPerp(s);h=[t[0]+(e[0]-s[0])*this._defaultSize,t[1]+(e[1]-s[1])*this._defaultSize]}return[i,h]}_processGeom(s){if(!s)return null;const t=[];for(const e of s){const s=e.length>1&&i(e)<this._defaultSize;if(!e||0===e.length||s)continue;const r=e.length;let _=e[0];switch(this._rule){case"PerpendicularFromFirstSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,4),h=[];h.push(i),h.push(this._mid(_,s)),t.push(h);break}case"ReversedFirstSegment":{const s=this._cp2(e,0,-1);t.push([s,_]);break}case"PerpendicularToSecondSegment":{if(e.length<3)return[];const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=[];h.push(this._mid(s,i)),h.push(_),t.push(h);break}case"SecondSegmentWithTicks":{if(e.length<3)return[];const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=this._sub(i,s);let r;r=this._crossProduct(h,this._sub(_,s))>0?this._rightPerp(h):this._leftPerp(h);const c=[];c.push([s[0]+(r[0]-h[0])/3,s[1]+(r[1]-h[1])/3]),c.push(s),c.push(i),c.push([i[0]+(r[0]+h[0])/3,i[1]+(r[1]+h[1])/3]),t.push(c);break}case"DoublePerpendicular":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,3),h=this._mid(_,s),r=this._sub(h,i);this._normalize(r);const c=this._crossProduct(r,this._sub(_,i));this._leftPerpendicular(r);const u=[];u.push(_),u.push([i[0]+r[0]*c,i[1]+r[1]*c]),t.push(u);const o=[];o.push([i[0]-r[0]*c,i[1]-r[1]*c]),o.push(s),t.push(o);break}case"OppositeToFirstSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,3),h=this._mid(_,s),r=this._sub(h,i);this._normalize(r);const c=this._crossProduct(r,this._sub(_,i));this._leftPerpendicular(r);const u=[];u.push([i[0]+r[0]*c,i[1]+r[1]*c]),u.push([i[0]-r[0]*c,i[1]-r[1]*c]),t.push(u);break}case"TriplePerpendicular":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,4),h=this._mid(_,s),r=this._sub(h,i);this._normalize(r);const c=this._crossProduct(r,this._sub(_,i));this._leftPerpendicular(r);const u=[];u.push([i[0]+r[0]*c*.8,i[1]+r[1]*c*.8]),u.push([h[0]+.8*(_[0]-h[0]),h[1]+.8*(_[1]-h[1])]),t.push(u),t.push([i,h]);const o=[];o.push([i[0]-r[0]*c*.8,i[1]-r[1]*c*.8]),o.push([h[0]+.8*(s[0]-h[0]),h[1]+.8*(s[1]-h[1])]),t.push(o);break}case"HalfCircleFirstSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,4),h=this._mid(_,s);let r=this._sub(s,_);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),o=Math.sqrt((1+c)/2),a=Math.sqrt((1-c)/2),n=[];let p;this._crossProduct(r,this._sub(i,_))>0?(n.push(_),r=this._sub(_,h),p=s):(n.push(s),r=this._sub(s,h),p=_),this._rotateDirect(r,o,a),r[0]/=o,r[1]/=o;for(let t=1;t<=18;t++)n.push(this._add(h,r)),this._rotateDirect(r,c,u);n.push(p),t.push(n);break}case"HalfCircleSecondSegment":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,1,-1);let h=this._sub(_,s);this._normalize(h);const r=this._crossProduct(h,this._sub(i,s))/2;this._leftPerpendicular(h);const c=[s[0]+h[0]*r,s[1]+h[1]*r];h=this._sub(s,c);const u=Math.cos(Math.PI/18);let o=Math.sin(Math.PI/18);r>0&&(o=-o);const a=[s];for(let t=1;t<=18;t++)this._rotateDirect(h,u,o),a.push(this._add(c,h));t.push(a);break}case"HalfCircleExtended":{const s=this._cp2(e,0,-2),i=this._cp3(e,s,1,-1);let h;if(r>=4)h=e[3];else{const t=this._sub(_,s);h=this._add(i,t)}const c=this._dist(s,i)/2/.75,u=this._sub(s,_);this._normalize(u,c);const o=this._sub(i,h);this._normalize(o,c);const a=[h,i];t.push(a);const n=[this._clone(i)];this._addBezier3(n,i,this._add(i,o),this._add(s,u),s,4),n.push(_),t.push(n);break}case"OpenCircle":{const s=this._cp2(e,-2,0),i=this._sub(s,_),h=Math.cos(Math.PI/18),r=-Math.sin(Math.PI/18),c=[s];for(let t=1;t<=33;t++)this._rotateDirect(i,h,r),c.push(this._add(_,i));t.push(c);break}case"CoverageEdgesWithTicks":{const s=this._cp2(e,0,-1);let i,h;if(r>=3)i=e[2];else{const t=this._sub(s,_),h=this._leftPerp(t);i=[_[0]+h[0]-.25*t[0],_[1]+h[1]-.25*t[1]]}if(r>=4)h=e[3];else{const t=this._mid(_,s),e=this._sub(_,s);this._normalize(e),this._leftPerpendicular(e);const r=this._crossProduct(e,this._sub(i,t));this._rightPerpendicular(e),h=[i[0]+e[0]*r*2,i[1]+e[1]*r*2]}const c=this._sub(s,_);let u,o;u=this._crossProduct(c,this._sub(i,_))>0?this._rightPerp(c):this._leftPerp(c),o=[],o.push(i),o.push(_),o.push([_[0]+(u[0]-c[0])/3,_[1]+(u[1]-c[1])/3]),t.push(o),u=this._crossProduct(c,this._sub(h,s))>0?this._rightPerp(c):this._leftPerp(c),o=[],o.push([s[0]+(u[0]+c[0])/3,s[1]+(u[1]+c[1])/3]),o.push(s),o.push(h),t.push(o);break}case"GapExtentWithDoubleTicks":{const s=this._cp2(e,0,2),i=this._cp3(e,s,0,1);let h;if(r>=4)h=e[3];else{const t=this._sub(s,_);h=this._add(i,t)}this._addAngledTicks(t,_,s,this._mid(i,h)),this._addAngledTicks(t,i,h,this._mid(_,s));break}case"GapExtentMidline":{const s=this._cp2(e,2,0),i=this._cp3(e,s,0,1);let h;if(r>=4)h=e[3];else{const t=this._sub(s,_);h=this._add(i,t)}const c=[];c.push(this._mid(_,i)),c.push(this._mid(s,h)),t.push(c);break}case"Chevron":{const s=this._cp2(e,-1,-1);let i;if(r>=3)i=e[2];else{const t=this._sub(s,_);this._leftPerpendicular(t),i=this._add(_,t)}t.push([s,this._makeCtrlPt(_),i]);break}case"PerpendicularWithArc":{const s=this._cp2(e,0,-2),i=this._cp3(e,s,.5,-1),h=this._sub(s,_),c=this._norm(h);h[0]/=c,h[1]/=c;const u=this._crossProduct(h,this._sub(i,_));let o=this._dotProduct(h,this._sub(i,_));o<.05*c?o=.05*c:o>.95*c&&(o=.95*c);const a=[_[0]+h[0]*o,_[1]+h[1]*o];let n=this._leftPerp(h),p=[];if(p.push([a[0]-n[0]*u,a[1]-n[1]*u]),p.push([a[0]+n[0]*u,a[1]+n[1]*u]),t.push(p),r>=4){const s=e[3];let i=this._dotProduct(h,this._sub(s,_));i<.1*c?i=.1*c:i>.9*c&&(i=.9*c);const r=[_[0]+h[0]*i,_[1]+h[1]*i],u=this._crossProduct(h,this._sub(s,_)),o=[];o.push([r[0]-n[0]*u,r[1]-n[1]*u]),o.push([r[0]+n[0]*u,r[1]+n[1]*u]),t.push(o)}const d=[s[0]+n[0]*u,s[1]+n[1]*u];n=this._sub(s,d);const l=Math.cos(Math.PI/18);let b=Math.sin(Math.PI/18);u<0&&(b=-b),p=[_,s];for(let t=1;t<=9;t++)this._rotateDirect(n,l,b),p.push(this._add(d,n));t.push(p);break}case"ClosedHalfCircle":{const s=this._cp2(e,2,0),i=this._mid(_,s),h=this._sub(s,i),r=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[_,s];for(let t=1;t<=18;t++)this._rotateDirect(h,r,c),u.push(this._add(i,h));t.push(u);break}case"TripleParallelExtended":{const s=this._cp2(e,0,-2),i=this._cp3(e,s,1,-2),r=this._mid(_,s),c=this._sub(i,s);this._normalize(c);const u=Math.abs(this._crossProduct(c,this._sub(r,s)))/2,o=this._dist(s,i),a=[s,_];a.push([_[0]+c[0]*o*.5,_[1]+c[1]*o*.5]),t.push(a);const n=[];n.push([r[0]-c[0]*u,r[1]-c[1]*u]),n.push([r[0]+c[0]*o*.375,r[1]+c[1]*o*.375]),h(n[n.length-1],1),n.push([r[0]+c[0]*o*.75,r[1]+c[1]*o*.75]),t.push(n);const p=[s,i];t.push(p);break}case"ParallelWithTicks":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(i,s);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h),this._addAngledTicks(t,_,s,i),this._addAngledTicks(t,this._mix(_,1,h,r),this._mix(s,1,h,r),this._mid(_,s));break}case"Parallel":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._leftPerp(h),c=this._crossProduct(h,this._sub(i,_));let u=[_,s];t.push(u),u=[],u.push([_[0]+r[0]*c,_[1]+r[1]*c]),u.push([s[0]+r[0]*c,s[1]+r[1]*c]),t.push(u);break}case"PerpendicularToFirstSegment":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._mid(_,s),r=this._sub(s,_);this._normalize(r);const c=this._crossProduct(r,this._sub(i,_));this._leftPerpendicular(r);const u=[];u.push([h[0]-r[0]*c*.25,h[1]-r[1]*c*.25]),u.push([h[0]+r[0]*c*1.25,h[1]+r[1]*c*1.25]),t.push(u);break}case"ParallelOffset":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h);const c=[];c.push([_[0]-h[0]*r,_[1]-h[1]*r]),c.push([s[0]-h[0]*r,s[1]-h[1]*r]),t.push(c);const u=[];u.push([_[0]+h[0]*r,_[1]+h[1]*r]),u.push([s[0]+h[0]*r,s[1]+h[1]*r]),t.push(u);break}case"OffsetOpposite":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h);const c=[];c.push([_[0]-h[0]*r,_[1]-h[1]*r]),c.push([s[0]-h[0]*r,s[1]-h[1]*r]),t.push(c);break}case"OffsetSame":{const s=this._cp2(e,3,0),i=this._cp3(e,s,.5,-1),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h);const c=[];c.push([_[0]+h[0]*r,_[1]+h[1]*r]),c.push([s[0]+h[0]*r,s[1]+h[1]*r]),t.push(c);break}case"CircleWithArc":{let s=this._cp2(e,3,0);const i=this._cp3(e,s,.5,-1);let c,u;if(r>=4)c=e[3],u=this._crossProduct(this._sub(c,s),this._sub(i,s))>0;else{c=s,u=this._crossProduct(this._sub(c,_),this._sub(i,_))>0;const t=24*this._geomUnitsPerPoint,h=this._sub(c,_);this._normalize(h,t);const e=Math.sqrt(2)/2;this._rotateDirect(h,e,u?e:-e),s=this._add(_,h)}const o=this._sub(s,_),a=Math.cos(Math.PI/18),n=Math.sin(Math.PI/18),p=[s];for(let t=1;t<=36;t++)this._rotateDirect(o,a,n),p.push(this._add(_,o));this._add90DegArc(p,s,c,i,u),h(p[p.length-8],1),t.push(p);break}case"DoubleJog":{let s,i=this._cp2(e,-3,1),h=this._cp3(e,i,-1,-.5);if(r>=4)s=e[3];else{const t=_;_=i,s=h;const e=this._dist(_,t),r=this._dist(s,t);let c=30*this._geomUnitsPerPoint;.5*e<c&&(c=.5*e),.5*r<c&&(c=.5*r),i=this._mix(_,c/e,t,(e-c)/e),h=this._mix(s,c/r,t,(r-c)/r)}const c=this._mid(_,i),u=this._mid(s,h),o=this._dist(_,i),a=this._dist(h,s);let n=Math.min(o,a)/8;n=Math.min(n,24*this._geomUnitsPerPoint);const p=Math.cos(Math.PI/4);let d=this._sub(_,i);this._normalize(d,n),this._crossProduct(d,this._sub(s,i))>0?this._rotateDirect(d,p,-p):this._rotateDirect(d,p,p);let l=[];l.push(i),l.push(this._add(c,d)),l.push(this._sub(c,d)),l.push(_),t.push(l),d=this._sub(s,h),this._normalize(d,n),this._crossProduct(d,this._sub(_,h))<0?this._rotateDirect(d,p,p):this._rotateDirect(d,p,-p),l=[],l.push(h),l.push(this._add(u,d)),l.push(this._sub(u,d)),l.push(s),t.push(l);break}case"PerpendicularOffset":{const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=this._sub(i,s);this._crossProduct(h,this._sub(_,s))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const r=[h[0]/8,h[1]/8],c=this._sub(this._mid(s,i),r);t.push([c,_]);break}case"LineExcludingLastSegment":{const s=this._arrowPath(e),i=[];let h=s.length-2;for(;h--;)i.push(s[h]);t.push(i);break}case"MultivertexArrow":{const s=this._arrowPath(e),i=[];this._addArrow(i,s,!1),t.push(i);break}case"CrossedArrow":{const s=this._arrowPath(e),i=[];this._addArrow(i,s,!0),t.push(i);break}case"ChevronArrow":{const[s,i]=this._arrowLastSeg(e),h=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);const u=this._crossProduct(r,this._sub(i,s));let o=this._dotProduct(r,this._sub(i,s));o<.05*c?o=.05*c:o>.95*c-h&&(o=.95*c-h);const a=[s[0]+r[0]*o,s[1]+r[1]*o],n=this._leftPerp(r),p=[];p.push([a[0]+n[0]*u+r[0]*h,a[1]+n[1]*u+r[1]*h]),p.push(_),p.push([a[0]-n[0]*u+r[0]*h,a[1]-n[1]*u+r[1]*h]),t.push(p);break}case"ChevronArrowOffset":{const[s,i]=this._arrowLastSeg(e),h=this._sub(_,s),r=this._norm(h);this._normalize(h);const c=this._crossProduct(h,this._sub(i,s));let u=this._dotProduct(h,this._sub(i,s));u<.05*r?u=.05*r:u>.95*r&&(u=.95*r);const o=[s[0]+h[0]*u,s[1]+h[1]*u];this._leftPerpendicular(h);const a=[];a.push([o[0]+h[0]*c*.5,o[1]+h[1]*c*.5]),a.push(this._mid(o,_)),a.push([o[0]-h[0]*c*.5,o[1]-h[1]*c*.5]),t.push(a);break}case"PartialFirstSegment":{const[s,i]=this._arrowLastSeg(e),h=this._sub(_,s),r=this._norm(h);this._normalize(h);let c=this._dotProduct(h,this._sub(i,s));c<.05*r?c=.05*r:c>.95*r&&(c=.95*r);const u=[s[0]+h[0]*c,s[1]+h[1]*c];t.push([s,u]);break}case"Arch":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,1),h=this._sub(_,s),r=this._mix(i,1,h,.55),c=this._mix(i,1,h,-.55),u=[_];this._addBezier2(u,_,r,i,4),this._addBezier2(u,i,c,s,4),t.push(u);break}case"CurvedParallelTicks":{const s=this._cp2(e,-4,1),i=this._cp3(e,s,.882353,-1.94),h=this._sub(i,s);this._crossProduct(h,this._sub(_,s))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const r=[h[0]/8,h[1]/8],c=this._sub(this._mid(s,i),r),u=this._sub(this._mix(s,.75,i,.25),r),o=this._sub(this._mix(s,.25,i,.75),r),a=[s];this._addBezier2(a,s,u,c,3),this._addBezier2(a,c,o,i,3),t.push(a);for(let e=0;e<8;e++){const s=a[2*e+1],i=[this._clone(s)];i.push(this._add(s,[h[0]/4,h[1]/4])),t.push(i)}break}case"Arc90Degrees":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,1),h=[s];this._add90DegArc(h,s,_,i),t.push(h);break}case"TipWithPerpendicularAndTicks":{const[s,i]=this._arrowLastSeg(e),h=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);let u=this._crossProduct(r,this._sub(i,s)),o=this._dotProduct(r,this._sub(i,s));o<.05*c?o=.05*c:o>.95*c-h&&(o=.95*c-h);const a=this._leftPerp(r),n=[_[0]-r[0]*h,_[1]-r[1]*h],p=.5*Math.max(c-o-h,h);u=Math.abs(u);const d=[];d.push([n[0]+a[0]*(u+p)-r[0]*p,n[1]+a[1]*(u+p)-r[1]*p]),d.push([n[0]+a[0]*u,n[1]+a[1]*u]),d.push([n[0]-a[0]*u,n[1]-a[1]*u]),d.push([n[0]-a[0]*(u+p)-r[0]*p,n[1]-a[1]*(u+p)-r[1]*p]),t.push(d),t.push([n,_]);break}case"ConcentricCircles":{const s=this._cp2(e,1,0),i=this._cp3(e,s,2,0),c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18);let o=this._dist(s,_),a=[o,0],n=[];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,u);if(t.push(n),r>=4){n=[];const s=e[3];o=this._dist(s,_),a=[o,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),0===t&&(n.push(this._add(_,a)),h(n[1],1)),this._rotateDirect(a,c,u);t.push(n)}n=[],o=this._dist(i,_),a=[o,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,u);t.push(n);break}case"DoubleJogArrow":{_=this._arrowPath(e)[0];const[s,i]=this._arrowLastSeg(e),h=this._sub(_,s),r=this._norm(h);this._normalize(h);const c=Math.abs(this._crossProduct(h,this._sub(i,_)));let u=Math.abs(this._dotProduct(h,this._sub(i,_)));u<.05*r?u=.05*r:u>.95*r&&(u=.95*r);const o=Math.max(c,u),a=this._leftPerp(h);let n=[];const p=[_[0]-h[0]*u*.5+a[0]*c*.5,_[1]-h[1]*u*.5+a[1]*c*.5];n.push([p[0],p[1]]),p[0]+=h[0]*o*.5+a[0]*o*.4,p[1]+=h[1]*o*.5+a[1]*o*.4,n.push([p[0],p[1]]),p[0]-=a[0]*o*.25,p[1]-=a[1]*o*.25,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5+a[0]*o*.4,p[1]+=h[1]*o*.5+a[1]*o*.4,n.push([p[0],p[1]]),t.push(n),n=[],p[0]=_[0]-h[0]*u*.5-a[0]*c*.5,p[1]=_[1]-h[1]*u*.5-a[1]*c*.5,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5-a[0]*o*.4,p[1]+=h[1]*o*.5-a[1]*o*.4,n.push([p[0],p[1]]),p[0]+=a[0]*o*.25,p[1]+=a[1]*o*.25,n.push([p[0],p[1]]),p[0]+=h[0]*o*.5-a[0]*o*.4,p[1]+=h[1]*o*.5-a[1]*o*.4,n.push([p[0],p[1]]),t.push(n);break}case"LinkedChevrons":{const s=this._cp2(e,-5,0),i=this._cp3(e,s,-.2,1),h=this._sub(_,s);this._normalize(h);const r=this._leftPerp(h),c=Math.abs(this._crossProduct(h,this._sub(i,s)));t.push([s,_]);const u=[];u.push([_[0]-h[0]*c+r[0]*c,_[1]-h[1]*c+r[1]*c]),u.push(_),u.push([_[0]-h[0]*c-r[0]*c,_[1]-h[1]*c-r[1]*c]),t.push(u),this._addDash(t,s,[-h[0]*c+r[0]*c,-h[1]*c+r[1]*c]),this._addDash(t,s,[-h[0]*c-r[0]*c,-h[1]*c-r[1]*c]);break}case"SegmentThenHalfCircle":{const s=this._cp2(e,2,0),i=this._cp3(e,s,1.5,0);let h;h=r>=4?e[3]:this._cp3(e,s,1.25,-.5);const c=this._sub(s,_);this._normalize(c);const u=.5*this._dist(s,i),o=this._crossProduct(c,this._sub(h,_))>0,a=Math.cos(Math.PI/18);let n=Math.sin(Math.PI/18);o&&(n=-n);const p=[_,s];c[0]*=u,c[1]*=u;const d=this._add(s,c);c[0]=-c[0],c[1]=-c[1];for(let t=1;t<=18;t++)this._rotateDirect(c,a,n),p.push(this._add(d,c));t.push(p);break}case"LineWithStraightTicks":{const s=this._cp2(e,-2,1),i=this._cp3(e,s,-1,-.5),h=this._sub(i,s);this._normalize(h);const r=this._dotProduct(h,this._sub(s,_)),c=this._dotProduct(h,this._sub(i,_));let u=[_];u.push([_[0]+h[0]*r,_[1]+h[1]*r]),u.push(s),t.push(u),u=[_],u.push([_[0]+h[0]*c,_[1]+h[1]*c]),u.push(i),t.push(u);break}case"DoubleCurve":{const s=this._cp2(e,-5,-1),i=this._cp3(e,s,2,0),r=Math.atan2(1,5),c=Math.cos(r),u=Math.sin(r),o=this._sub(s,_),a=this._dist(_,s);this._normalize(o),this._rotateDirect(o,c,-u);const n=[_];n.push([_[0]+o[0]*a*.5,_[1]+o[1]*a*.5]),h(n[1],1),n.push([_[0]+o[0]*a*.8,_[1]+o[1]*a*.8]),this._addBezier2(n,n[2],[_[0]+o[0]*a,_[1]+o[1]*a],s,3);const p=this._sub(i,s),d=this._dist(s,i);this._normalize(p),this._rotateDirect(p,c,-u),this._addBezier2(n,s,[i[0]-p[0]*d,i[1]-p[1]*d],[i[0]-p[0]*d*.8,i[1]-p[1]*d*.8],3),n.push(i),t.push(n);break}case"ParallelWithTicksByWidth":{const s=this._cp2(e,0,-1),i=this._cp3(e,s,.5,3),h=this._sub(s,_);this._normalize(h);const r=this._crossProduct(h,this._sub(i,_));this._leftPerpendicular(h),r>0?(this._addAngledTicks(t,_,[_[0]+h[0]*r,_[1]+h[1]*r],s),this._addAngledTicks(t,s,[s[0]+h[0]*r,s[1]+h[1]*r],_)):(this._addAngledTicks(t,[_[0]+h[0]*r,_[1]+h[1]*r],_,s),this._addAngledTicks(t,[s[0]+h[0]*r,s[1]+h[1]*r],_,s));break}case"EnclosingRoundedRectangle":{const s=this._cp2(e,3,-2),t=[Math.min(_[0],s[0]),Math.max(_[1],s[1])],i=[Math.max(_[0],s[0]),Math.min(_[1],s[1])],h=i[0]-t[0],r=t[1]-i[1],c=Math.min(h,r)/10,u=[];u.push([t[0]+c+.75*(h-2*c),t[1]]),u.push([i[0]-c,t[1]]),this._add90DegArc(u,[i[0]-c,t[1]],[i[0],t[1]-c],[i[0],t[1]]),u.push([i[0],i[1]+c]),this._add90DegArc(u,[i[0],i[1]+c],[i[0]-c,i[1]],i),u.push([t[0]+c,i[1]]),this._add90DegArc(u,[t[0]+c,i[1]],[t[0],i[1]+c],[t[0],i[1]]),u.push([t[0],t[1]-c]),this._add90DegArc(u,[t[0],t[1]-c],[t[0]+c,t[1]],t),u.push([t[0]+c+.75*(h-2*c),t[1]]);break}default:t.push(e)}}return t}}export{e as EffectControlMeasureLine};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{PathEffectCursor as t}from"../CIMCursor.js";import{CurveHelper as i}from"../CurveHelper.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(e,t,i
|
|
5
|
+
import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{PathEffectCursor as t}from"../CIMCursor.js";import{CurveHelper as i}from"../CurveHelper.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(e,t,i){return new u(e,t,i)}}class u extends t{constructor(e,t,r){super(e,!0,!0),this._curveHelper=new i,this._beginCut=(void 0!==t.beginCut?t.beginCut:1)*r,this._endCut=(void 0!==t.endCut?t.endCut:1)*r,this._middleCut=(void 0!==t.middleCut?t.middleCut:0)*r,this._invert=void 0!==t.invert&&t.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(t){const{_beginCut:i,_endCut:r,_middleCut:u}=this,s=t.pathLength(),n=e.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(0!==i||0!==r||0!==u)if(i+r+u>=s)for(n.startPath();t.nextPoint();)n.pushXY(t.x,t.y);else this._curveHelper.appendSubCurve(n,t,0,i),this._curveHelper.appendSubCurve(n,t,.5*(s-u),.5*(s+u)),this._curveHelper.appendSubCurve(n,t,s-r,r)}else if(0===i&&0===r&&0===u)for(n.startPath();t.nextPoint();)n.pushXY(t.x,t.y);else i+r+u<s&&(0===u?this._curveHelper.appendSubCurve(n,t,i,s-r):(this._curveHelper.appendSubCurve(n,t,i,.5*(s-u)),this._curveHelper.appendSubCurve(n,t,.5*(s+u),s-r)));return 0===n.totalSize?null:n}}export{r as EffectCut};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectPath as e}from"../../../geometry/geometryCursorCollectUtils.js";import{PathEffectCursor as s}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as r}from"../GeometryWalker.js";import{normalizeDashEffectTemplate as a}from"../utils.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectPath as e}from"../../../geometry/geometryCursorCollectUtils.js";import{PathEffectCursor as s}from"../CIMCursor.js";import{GeometryWalker as i,DashPattern as r}from"../GeometryWalker.js";import{normalizeDashEffectTemplate as a}from"../utils.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,s){return new h(t,e,s)}}class h extends s{constructor(t,e,s){super(t,!0,!0),this._firstCurve=null,this._walker=new i,this._walker.updateTolerance(s),this._endings=e.lineDashEnding,this._customDashPos=-(e.offsetAlongLine??0)*s,this._offsetAtEnd=(e.customEndingOffset??0)*s;let n=a(e).dashTemplate;null==n&&(n=[]),n.length%2&&(n=[...n,...n]),this._pattern=new r,this._pattern.init(n,!0),this._pattern.scale(s)}processPath(s){if(0===this._pattern.length()){this.iteratePath=!1;const i=e(s);return t.fromJSONCIM({paths:[i]})}if(!this.iteratePath){let i=!0;switch(this._endings){case"HalfPattern":case"HalfGap":default:this._pattern.extPtGap=0;break;case"FullPattern":this.isClosed||(this._pattern.extPtGap=.5*this._pattern.firstValue());break;case"FullGap":this.isClosed||(this._pattern.extPtGap=.5*this._pattern.lastValue());break;case"NoConstraint":this.isClosed||(i=!1);break;case"Custom":this.isClosed||(this._pattern.extPtGap=.5*this._offsetAtEnd)}const r=s.pathLength();if(this._pattern.isEmpty()||r<.1*this._pattern.length()){const i=e(s);return t.fromJSONCIM({paths:[i]})}if(!this._walker.init(s,this._pattern,i)){const i=e(s);return t.fromJSONCIM({paths:[i]})}}let i;if(this.iteratePath)i=this._pattern.nextValue();else{let t;switch(this._endings){case"HalfPattern":default:t=.5*this._pattern.firstValue();break;case"HalfGap":t=.5*-this._pattern.lastValue();break;case"FullGap":t=-this._pattern.lastValue();break;case"FullPattern":t=0;break;case"NoConstraint":case"Custom":t=-this._customDashPos}let e=t/this._pattern.length();e-=Math.floor(e),t=e*this._pattern.length(),this._pattern.reset(),i=this._pattern.nextValue();let s=!1;for(;t>=i;)t-=i,i=this._pattern.nextValue(),s=!s;i-=t,s?(this._walker.nextPosition(i),i=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(i),i=this._pattern.nextValue(),this._walker.nextPosition(i),i=this._pattern.nextValue())}let r=this._walker.nextCurve(i);if(r)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)r.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else i=this._pattern.nextValue(),!this._walker.nextPosition(i)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(r.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,r=this._firstCurve,this._firstCurve=null;return r?.reset(),r}}export{n as EffectDashes};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import i from"../../../geometry/SpatialReference.js";import{clipCursorToTileExtent as
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import i from"../../../geometry/SpatialReference.js";import{lazyBufferOperator as e,clipCursorToTileExtent as n}from"../CIMEffects.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,i,e,n,s,h){return new r(t,i,e,n,s,h)}}class r{constructor(t,i,e,n,s,r){this._preventClipping=r,this._inputGeometries=t,this._tileKey=n,this._maxInflateSize=s*e,this._width=(void 0!==i.width?i.width:2)*e,i.method,this._option=i.option}next(){let s;for(;s=this._inputGeometries.next();){if("esriGeometryEnvelope"===s.geometryType&&this._width>0){const i=s.asJSON();return Math.min(i.xmax-i.xmin,i.ymax-i.ymin)-2*this._width<0?s:t.fromJSONCIM({paths:[[[i.xmin+this._width,i.ymin+this._width],[i.xmax-this._width,i.ymin+this._width],[i.xmax-this._width,i.ymax-this._width],[i.xmin+this._width,i.ymax-this._width],[i.xmin+this._width,i.ymin+this._width]],[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]})}if("esriGeometryPolygon"===s.geometryType){if(0===this._width)return s.clone();const t=e.module,r=!this._preventClipping&&this._tileKey?n(s,this._maxInflateSize,!0):s.clone();if(!r)continue;const h={...r.asJSON(),spatialReference:{wkid:i.WebMercator.wkid}},o=t.execute(h,-this._width);if(o)for(const i of o.rings)if(i){r.startPath();for(const t of i.reverse())r.pushXY(t[0],r.yFactor*t[1])}return r}}return null}}export{s as EffectDonut};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import t from"../../../geometry/SpatialReference.js";import{getCursorBoundsXY as
|
|
5
|
+
import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import t from"../../../geometry/SpatialReference.js";import{getCursorBoundsXY as r}from"../../../geometry/support/boundsUtils.js";import{lazyConvexHullOperator as n}from"../CIMEffects.js";class o{static{this.instance=null}static local(){return null===o.instance&&(o.instance=new o),o.instance}execute(e,t){return new s(e,t)}}class s{constructor(e,t){this._inputGeometries=e,this._medhod=t.method}next(){let e=this._inputGeometries.next();const t=this._medhod;for(;null!=e;){if(e.totalSize>0)switch(t){case"RectangularBox":return i(e);case"ConvexHull":return this._constructConvexHull(e);default:return u(e)}e=this._inputGeometries.next()}return null}_constructConvexHull(r){switch(r.geometryType){case"esriGeometryPolyline":case"esriGeometryPolygon":{const o=n.module,s={...r.asJSON(),spatialReference:{wkid:t.WebMercator.wkid}},i=o.execute(s);return i?e.fromJSONCIM(i):null}case"esriGeometryEnvelope":return r;default:return null}}}function i(t){const n=r(t),o={xmin:n[0],ymin:n[1],xmax:n[2],ymax:n[3]};return e.fromJSONCIM(o)}function u(t){switch(t.geometryType){case"esriGeometryPolyline":{const r=[];for(;t.nextPath();)l(t,r);return e.fromJSONCIM({rings:r})}case"esriGeometryPolygon":case"esriGeometryEnvelope":return t;default:return null}}function l(e,t){if(e.seekPathStart(),!e.nextPoint())return;const r=e.x,n=e.y,o=[[r,n]];for(t.push(o);e.nextPoint();)o.push([e.x,e.y]);o.push([r,n])}export{o as EffectEnclosingPolygon};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{PathEffectCursor as i}from"../CIMCursor.js";import{CurveHelper as s}from"../CurveHelper.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(t,i,s
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{PathEffectCursor as i}from"../CIMCursor.js";import{CurveHelper as s}from"../CurveHelper.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(t,i,s){return new n(t,i,s)}}class n extends i{constructor(t,i,e){super(t,!1,!0),this._curveHelper=new s,this._length=(void 0!==i.length?i.length:20)*e,this._angle=void 0!==i.angle?i.angle:225,this._position=void 0!==i.position?i.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(i){const s=t.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(i))return null;i.seekInPath(0);const e=i.x,n=i.y;i.seekInPath(i.pathSize-1);const o=i.x,r=i.y,h=[o-e,r-n];this._curveHelper.normalize(h);const l=e+(o-e)*this._position/100,a=n+(r-n)*this._position/100,_=Math.cos((90-this._angle)/180*Math.PI);let p=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(p=-p),this._mirror=!this._mirror;const c=[l-this._length/2*_,a-this._length/2*p],m=[l+this._length/2*_,a+this._length/2*p];return s.pushPath([[e,n],c,m,[o,r]]),s}}export{e as EffectJog};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class t{static{this.instance=null}static local(){return null===t.instance&&(t.instance=new t),t.instance}execute(t,s,n
|
|
5
|
+
class t{static{this.instance=null}static local(){return null===t.instance&&(t.instance=new t),t.instance}execute(t,s,n){return new e(t,s,n)}}class e{constructor(t,e,s){this._inputGeometries=t,this._offsetX=void 0!==e.offsetX?e.offsetX*s:0,this._offsetY=void 0!==e.offsetY?e.offsetY*s:0}next(){let t=this._inputGeometries.next();for(;t;){if(t.totalSize>0)return this._move(t.clone(),this._offsetX,this._offsetY);t=this._inputGeometries.next()}return null}_move(t,e,s){for(;t.nextPath();)for(;t.nextPoint();)t.x=t.x+e,t.y=t.y+s;return t.reset(),t}}export{t as EffectMove};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectPath as e}from"../../../geometry/geometryCursorCollectUtils.js";import
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectPath as e}from"../../../geometry/geometryCursorCollectUtils.js";import r from"../../../geometry/SpatialReference.js";import{isExtent as s}from"../../../geometry/support/jsonUtils.js";import{clipCursorToTileExtent as i,lazyOffsetOperator as o}from"../CIMEffects.js";import{CurveHelper as n,pixelTolerance as f}from"../CurveHelper.js";const m=10;class a{static{this.instance=null}static local(){return null===a.instance&&(a.instance=new a),a.instance}execute(t,e,r,s,i,o){return new l(t,e,r,s,i,o)}}class l{constructor(t,e,r,s,i,o){this._preventClipping=o,this._inputGeometries=t,this._tileKey=s,this._curveHelper=new n,this._offset=(e.offset??1)*r,this._method=e.method,this._maxInflateSize=Math.max(Math.abs(i*r),m),this._option=e.option,this._offsetFlattenError=f*r}next(){let n;for(;n=this._inputGeometries.next();){if(0===this._offset)return n.clone();if("esriGeometryEnvelope"===n.geometryType){if("Rounded"===this._method&&this._offset>0){const r=e(n),s=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(s){const e=t.createEmptyOptimizedCIM(n.geometryType);return e.pushPath(s),e}return null}const r=n.asJSON();if(s(r)&&Math.min(r.xmax-r.xmin,r.ymax-r.ymin)+2*this._offset>0)return t.fromJSONCIM({xmin:r.xmin-this._offset,xmax:r.xmax+this._offset,ymin:r.ymin-this._offset,ymax:r.ymax+this._offset})}const f=!this._preventClipping&&this._tileKey?i(n,this._maxInflateSize,!0):n.clone();if(!f)continue;const m=o.module,a={...f.asJSON(),spatialReference:{wkid:r.WebMercator.wkid}},l=m.execute(a,-this._offset,{joins:h(this._method),flattenError:this._offsetFlattenError,miterLimit:4});return l?t.fromJSONCIM(l):null}return null}}function h(t){switch(t){case"Rounded":return"round";case"Bevelled":return"bevel";case"Mitered":return"miter";case"Square":return"square"}}export{a as EffectOffset};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{ringsCentroidCursor as e}from"../../../geometry/support/centroid.js";import{defaultCIMValues as i}from"../defaultCIMValues.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,i
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{ringsCentroidCursor as e}from"../../../geometry/support/centroid.js";import{defaultCIMValues as i}from"../defaultCIMValues.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,i){return new r(t,e,i)}}class r{constructor(t,e,n){this._inputGeometries=t,this._length=(void 0!==e.length?e.length:i.CIMGeometricEffectRadial.length)*n,this._angle=void 0!==e.angle?e.angle*Math.PI/180:i.CIMGeometricEffectRadial.angle,this._lx=Math.cos(this._angle)*this._length,this._ly=Math.sin(this._angle)*this._length}next(){let i=this._inputGeometries.next();for(;i;){if("esriGeometryPoint"===i.geometryType||"esriGeometryMultipoint"===i.geometryType){const e=t.createEmptyOptimizedCIM("esriGeometryPolyline");return i.nextPath()&&i.nextPoint()&&e.pushPath([[i.x,i.y],[i.x+this._lx,i.y+this._ly]]),e}if("esriGeometryPolygon"===i.geometryType){const n=e(i);if(!n)return null;const r=t.createEmptyOptimizedCIM("esriGeometryPolyline");return r.pushPath([[n[0],n[1]],[n[0]+this._lx,n[1]+this._ly]]),r}i=this._inputGeometries.next()}return null}}export{n as EffectRadial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(e,n,r
|
|
5
|
+
class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(e,n,r){return new t(e,n,r)}}class t{constructor(e,t,n){this._inputGeometries=e,this._reverse=void 0===t.reverse||t.reverse}next(){let e=this._inputGeometries.next();for(;e;){if(!this._reverse)return e;if("esriGeometryPolyline"===e.geometryType)return n(e.clone());e=this._inputGeometries.next()}return null}}function n(e){for(;e.nextPath();)for(let t=0;t<e.pathSize/2;t++){e.seekInPath(t);const n=e.x,r=e.y;e.seekInPath(e.pathSize-t-1);const s=e.x,i=e.y;e.x=n,e.y=r,e.seekInPath(t),e.x=s,e.y=i}return e.reset(),e}export{e as EffectReverse};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getCursorBoundsXY as t}from"../../../geometry/support/boundsUtils.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(t,e,r
|
|
5
|
+
import{getCursorBoundsXY as t}from"../../../geometry/support/boundsUtils.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(t,e,r){return new n(t,e,r)}}class n{constructor(t,e,n){this._inputGeometries=t,this._rotateAngle=void 0!==e.angle?e.angle*Math.PI/180:0}next(){let e=this._inputGeometries.next();for(;e;){if(0===this._rotateAngle||"esriGeometryPoint"===e.geometryType)return e;if(e.totalSize>0){const n=t(e),r=(n[2]+n[0])/2,s=(n[3]+n[1])/2;return e.reset(),this._rotate(e.clone(),r,s)}e=this._inputGeometries.next()}return null}_rotate(t,e,n){const r=Math.cos(this._rotateAngle),s=Math.sin(this._rotateAngle);for(;t.nextPath();)for(;t.nextPoint();){const o=t.x-e,i=t.y-n;t.x=e+o*r-i*s,t.y=n+o*s+i*r}return t.reset(),t}}export{e as EffectRotate};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getCursorBoundsXY as t}from"../../../geometry/support/boundsUtils.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(t,e,s
|
|
5
|
+
import{getCursorBoundsXY as t}from"../../../geometry/support/boundsUtils.js";class e{static{this.instance=null}static local(){return null===e.instance&&(e.instance=new e),e.instance}execute(t,e,s){return new r(t,e,s)}}class r{constructor(t,e,r){this._inputGeometries=t,this._xFactor=void 0!==e.xScaleFactor?e.xScaleFactor:1.15,this._yFactor=void 0!==e.yScaleFactor?e.yScaleFactor:1.15}next(){const e=this._inputGeometries.next();if(e){if(1===this._xFactor&&1===this._yFactor)return e;if("esriGeometryPoint"===e.geometryType)return e;if(e.totalSize>0){const r=t(e),s=(r[2]+r[0])/2,o=(r[3]+r[1])/2;return e.reset(),this._scaleCursor(e.clone(),s,o)}}return null}_scaleCursor(t,e,r){for(;t.nextPath();)for(;t.nextPoint();)t.x=e+(t.x-e)*this._xFactor,t.y=r+(t.y-r)*this._yFactor;return t.reset(),t}}export{e as EffectScale};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import e from"../../../geometry/support/PolylineBuilder.js";import{PathEffectCursor as n}from"../CIMCursor.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,e,n
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import e from"../../../geometry/support/PolylineBuilder.js";import{PathEffectCursor as n}from"../CIMCursor.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,e,n){return new s(t,e,n)}}class s extends n{constructor(t,e,n){super(t,!1,!0),this._suppress=void 0!==e.suppress&&e.suppress,this._invert=void 0!==e.invert&&e.invert}processPath(n){if(n.totalSize<=0)return null;if(!this._suppress){const e=t.createEmptyOptimizedCIM("esriGeometryPolygon",!1,!1,n.yFactor);for(n.seekPathEnd();n.nextPoint();)e.pushXY(n.x,n.y);return e}const r=[],s=new Array(n.pathSize);let o=0;for(n.seekPathStart();n.nextPoint();)s[o++]=n.getControlPoint(),r.push([n.x,n.y]);let i=!0,l=!0,h=!1,p=!this._invert;o=0;const u=new e;let c=r[0];for(;o<r.length;){const t=r[o+1],e=s[o],n=s[o+1];o++,l&&(p=e||n?this._invert:!this._invert,l=!1),p?(u.addSegment(c,t,i),i=!1):h=!0,c=t,n&&(p?(p=!1,i=!0):p=!0)}const a=u.getGeometry();if(0===a.length)return null;if(!h&&r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]){const e=a[a.length-1];return e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]||e.push([e[0][0],e[0][1]]),t.fromJSONCIM({paths:a})}const g=a[a.length-1];return u.getPointCount()>1&&"esriGeometryPolygon"===n.geometryType&&g[0][0]===g[g.length-1][0]&&g[0][1]===g[g.length-1][1]&&a.length>1&&(a[a.length-1].push(...a[0]),a.splice(0,1)),t.fromJSONCIM({paths:a})}}export{r as EffectSuppress};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import e from"../../../core/Error.js";import t from"../../../core/Logger.js";import{GeometryCursor as s}from"../../../geometry/GeometryCursor.js";import o from"../../../geometry/SpatialReference.js";import{isPolygon as i,isPolyline as l}from"../../../geometry/support/jsonUtils.js";import r from"../../../geometry/support/PolylineBuilder.js";import{Point as n}from"../../../geometry/support/TileClipper.js";import{PathEffectCursor as h}from"../CIMCursor.js";import{lazyGeneralizeOperator as a,lazyLengthOperator as c,lazySimplifyOperator as _}from"../CIMEffects.js";const p=()=>t.getLogger("esri.symbols.cim.effects.EffectTaperedPolygon");class y{static{this.instance=null}static local(){return null===y.instance&&(y.instance=new y),y.instance}execute(e,t,s){return new f(e,t,s)}}class f extends h{constructor(e,t,s){super(e,!1,!0),this._slopeS=0,this._slopeC=1,this._lastTangent1=new n(NaN,NaN),this._lastWidth=0,this._geomUnitsPerPoint=s,this._halfFromWidth=Math.abs(void 0!==t.fromWidth?t.fromWidth:0)*s*.5,this._halfToWidth=Math.abs(void 0!==t.toWidth?t.toWidth:1)*s*.5,this._originalLength=(void 0!==t.length?t.length:0)*s,this._length=0}processPath(t){if(t.totalSize<=0)return null;if(this._halfFromWidth<=0&&this._halfToWidth<=0){const e=s.createEmptyOptimizedCIM("esriGeometryPolygon",!1,!1,t.yFactor);for(t.seekPathEnd();t.prevPoint();)e.pushXY(t.x,t.y);for(t.seekPathStart();t.nextPoint();)e.pushXY(t.x,t.y);return e}const n=t.asJSON();t.seekPath(t.totalSize-1);const h=a.module.execute(n,.25*this._geomUnitsPerPoint,{removeDegenerateParts:!0}),y=null==h?null:i(h)?h.rings:l(h)?h.paths:null;if(!y)return p().error(new e("mapview-bad-resource","Unable to process geometry")),null;const f=c.module.execute(h);if((0===this._originalLength||this._originalLength>f)&&f>0){this._length=f;const e=(this._halfToWidth-this._halfFromWidth)/this._length;if(Math.abs(e)<1){const t=e*e;this._slopeC=Math.sqrt(1/(1+t)),this._slopeS=Math.sqrt(t/(1+t)),e<0&&(this._slopeS=-this._slopeS)}else this._slopeC=this._slopeS=.7071}else this._length=this._originalLength,this._slopeC=1,this._slopeS=0;const m=[];for(const e of y){const t=new r,s=new r;let o=0;this._setFromOffset(e.slice(0,2),t,s);for(let r=0,n=3;n<=e.length;++r,++n)o=this._setOffset(e.slice(r,n),o,t,s);this._setToOffset(e.slice(-2),o,t,s);const[i]=t.getGeometry(),[l]=s.getGeometry();m.push([...i,...l.reverse()])}const x={rings:m,spatialReference:{wkid:o.WebMercator.wkid}},d=_.module.execute(x);return s.fromJSONCIM(d)}_setFromOffset([[e,t],[s,o]],i,l){const r=this._halfFromWidth,h=new n(s-e,o-t).normalize().scale(r);i.beginPath([e-h.y,t+h.x]),l.beginPath([e+h.y,t-h.x])}_setToOffset([[e,t],[s,o]],i,l,r){let h;h=(i+=Math.sqrt((s-e)**2+(o-t)**2))>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*i/this._length;const a=new n(s-e,o-t).normalize().scale(h);l.lineTo([s-a.y,o+a.x]),r.lineTo([s+a.y,o-a.x])}_setOffset([[t,s],[o,i],[l,r]],h,a,c){const _=Math.sqrt((o-t)**2+(i-s)**2);let y;y=h+_>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*(h+_)/this._length,h+=_;const f=new n(o,i),m=new n(o-t,i-s).normalize(),x=new n(l-o,r-i).normalize(),d=n.sub(x,m),g=a.getPointCount(),u=c.getPointCount();m.leftPerpendicular(),x.leftPerpendicular();const T=m.x*x.x+m.y*x.y;if(T>.99){const e=n.add(m,x).scale(y/2),t=e.clone().rotate(this._slopeC,this._slopeS);a.lineTo([f.x+t.x,f.y+t.y]);const s=e.rotateReverse(this._slopeC,this._slopeS);c.lineTo([f.x-s.x,f.y-s.y])}else{const o=m.x*x.y-m.y*x.x;if(d.scale(1/o),o<0){d.scale(-y).rotateReverse(this._slopeC,this._slopeS);const t=c.getXY(u-1);t||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=n.add(f,d).sub(n.fromArray(t));if(m.x*s.y-m.y*s.x>0){const e=m.clone().scale(-y).rotateReverse(this._slopeC,this._slopeS),t=x.clone().scale(-y).rotateReverse(this._slopeC,this._slopeS);c.lineTo([f.x+e.x,f.y+e.y]),c.lineTo([f.x,f.y]),c.lineTo([f.x+t.x,f.y+t.y])}else c.lineTo([f.x+d.x,f.y+d.y])}else{d.scale(y).rotate(this._slopeC,this._slopeS);const t=a.getXY(g-1);t||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=n.add(f,d).sub(n.fromArray(t));if(m.x*s.y-m.y*s.x>0){const e=m.clone().scale(y).rotate(this._slopeC,this._slopeS),t=x.clone().scale(y).rotate(this._slopeC,this._slopeS);a.lineTo([f.x+e.x,f.y+e.y]),a.lineTo([f.x,f.y]),a.lineTo([f.x+t.x,f.y+t.y])}else a.lineTo([f.x+d.x,f.y+d.y])}const i=Math.acos(T);let l=1;if(y>.25){const e=2*Math.acos(1-.25/y);e<i&&(l=Math.round(i/e))}const r=Math.cos(i/l),h=Math.sin(i/l),_=m.clone();if(o<0){_.rotate(this._slopeC,this._slopeS);const o=a.getXY(g-1);o||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const i=n.add(f,_.clone().scale(this._lastWidth)),l=n.sub(i,n.fromArray(o)),r=m.x*l.y-m.y*l.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&r>0){const e=new n(t,s),o=this._lastTangent1.clone().scale(this._lastWidth);o.rotate(this._slopeC,this._slopeS);const i=m.clone().scale(this._lastWidth);i.rotate(this._slopeC,this._slopeS),a.lineTo([e.x+o.x,e.y+o.y]),a.lineTo([e.x,e.y]),a.lineTo([e.x+i.x,e.y+i.y])}}else{_.scale(-1).rotateReverse(this._slopeC,this._slopeS);const o=c.getXY(u-1);o||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const i=n.add(f,_.clone().scale(this._lastWidth)),l=n.sub(i,n.fromArray(o)),r=m.x*l.y-m.y*l.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&r>0){const e=new n(t,s),o=this._lastTangent1.clone().scale(-this._lastWidth);o.rotateReverse(this._slopeC,this._slopeS);const i=m.clone().scale(-this._lastWidth);i.rotateReverse(this._slopeC,this._slopeS),c.lineTo([e.x+o.x,e.y+o.y]),c.lineTo([e.x,e.y]),c.lineTo([e.x+i.x,e.y+i.y])}}_.scale(y);for(let e=0;e<=l;e++)o<0?(a.lineTo([f.x+_.x,f.y+_.y]),_.rotateReverse(r,h)):(c.lineTo([f.x+_.x,f.y+_.y]),_.rotate(r,h))}return this._lastTangent1.setCoords(m.x,m.y),this._lastWidth=y,h}}export{y as EffectTaperedPolygon};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{DashPattern as e,GeometryWalker as i,Pos as s}from"../GeometryWalker.js";class h{static{this.instance=null}static local(){return null===h.instance&&(h.instance=new h),h.instance}execute(t,e,i
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{DashPattern as e,GeometryWalker as i,Pos as s}from"../GeometryWalker.js";class h{static{this.instance=null}static local(){return null===h.instance&&(h.instance=new h),h.instance}execute(t,e,i){return new n(t,e,i)}}class n{constructor(t,s,h){this._inputGeometries=t,this._height=(void 0!==s.amplitude?s.amplitude:2)*h,this._period=(void 0!==s.period?s.period:3)*h,this._style=s.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new e,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new i,this._walker.updateTolerance(h)}next(){let t=this._inputGeometries.next();for(;t;){if(0===this._height||0===this._period)return t;const e=this._processGeom(t);if(e)return e;t=this._inputGeometries.next()}return null}_processGeom(e){const i=t.createEmptyOptimizedCIM(e.geometryType);for(;e.nextPath();){i.startPath();const t=e.pathLength();if(this._walker.init(e,this._pattern))switch(this._style){case"Sinus":default:this._constructCurve(i,t,!1);break;case"Square":this._constructSquare(i,t);break;case"Triangle":this._constructTriangle(i,t);break;case"Random":this._constructCurve(i,t,!0)}else for(;e.nextPoint();)i.pushXY(e.x,e.y)}return i}_constructCurve(t,e,i){let h=Math.round(e/this._period);0===h&&(h=1);const n=h*16+1,r=e/h,a=this._period/16,o=1/n,p=2*Math.PI*e/r,_=2*Math.PI*Math.random(),c=2*Math.PI*Math.random(),l=2*Math.PI*Math.random(),u=.75-Math.random()/2,d=.75-Math.random()/2,g=new s;this._walker.curPointAndAngle(g),t.pushPoint(g.pt);let w=0;for(;;){if(!this._walker.nextPointAndAngle(a,g)){t.pushPoint(this._walker.getPathEnd());break}{const e=w;let s;if(w+=o,i){const t=this._height/2*(1+.3*Math.sin(u*p*e+_));s=t*Math.sin(p*e+c),s+=t*Math.sin(d*p*e+l),s/=2}else s=.5*this._height*Math.sin(.5*p*e);t.pushXY(g.pt[0]-s*g.sa,g.pt[1]+s*g.ca)}}}_constructSquare(t,e){Math.round(e/this._period);let i=!0;for(;;){let e=!1;if(this._walker.curPositionIsValid()){const h=new s;this._walker.curPointAndAngle(h);const n=new s;if(this._walker.nextPointAndAngle(this._period,n)){const r=new s;this._walker.nextPointAndAngle(this._period,r)&&(i?(t.pushPoint(h.pt),i=!1):t.pushPoint(h.pt),t.pushXY(h.pt[0]-this._height/2*h.sa,h.pt[1]+this._height/2*h.ca),t.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),t.pushXY(n.pt[0]+this._height/2*n.sa,n.pt[1]-this._height/2*n.ca),t.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),e=!0)}}if(!e){t.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(t,e){Math.round(e/this._period);let i=!0;for(;;){let e=!1;if(this._walker.curPositionIsValid()){const h=new s;this._walker.curPointAndAngle(h);const n=new s;if(this._walker.nextPointAndAngle(this._period/2,n)){const r=new s;this._walker.nextPointAndAngle(this._period,r)&&(this._walker.nextPosition(this._period/2)&&(i?(t.pushPoint(h.pt),i=!1):t.pushPoint(h.pt),t.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),t.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca)),e=!0)}}if(!e){t.pushPoint(this._walker.getPathEnd());break}}}}export{h as EffectWave};
|