@arcgis/core 4.33.0-next.20250513 → 4.33.0-next.20250515
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/Graphic.js +1 -1
- package/Map.js +1 -1
- package/WebScene.js +1 -1
- package/applications/Components/SelectionOperation.js +1 -1
- package/arcade/functions/centroid.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/geometry/operators.js +1 -1
- package/arcade/geometry/operatorsWorker.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/assets/components/assets/combobox/t9n/messages.en.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.json +1 -1
- package/assets/components/assets/icon/calendarHeatChart16.json +1 -0
- package/assets/components/assets/icon/calendarHeatChart24.json +1 -0
- package/assets/components/assets/icon/calendarHeatChart32.json +1 -0
- package/assets/components/assets/icon/matrixHeatChart16.json +1 -0
- package/assets/components/assets/icon/matrixHeatChart24.json +1 -0
- package/assets/components/assets/icon/matrixHeatChart32.json +1 -0
- package/assets/components/assets/icon/progressBarChart16.json +1 -0
- package/assets/components/assets/icon/progressBarChart24.json +1 -0
- package/assets/components/assets/icon/progressBarChart32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualization16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualization24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualization32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOpen16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOpen24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOpen32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlined16F.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlined24F.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlined32F.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedColorLocked16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedColorLocked24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedColorLocked32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpen16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpen24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpen32.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpenColorLocked16.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpenColorLocked24.json +1 -0
- package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpenColorLocked32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/009730713ed9bc7c7388.js +1 -0
- package/assets/esri/core/workers/chunks/02853ab923245459b32e.js +1 -0
- package/assets/esri/core/workers/chunks/0624ae07d3af8d5f1ac8.js +1 -0
- package/assets/esri/core/workers/chunks/0817ddd885ce8b2459cb.js +1 -0
- package/assets/esri/core/workers/chunks/{69e8aabe5a1eb2d1e414.js → 0832bd5195b5791dd803.js} +1 -1
- package/assets/esri/core/workers/chunks/{4deeeceb784e4390441d.js → 0a4cece5e96fb7e8a57b.js} +1 -1
- package/assets/esri/core/workers/chunks/0d23610475c85385fbff.js +1 -0
- package/assets/esri/core/workers/chunks/{b4f38fe9cc948a39ad87.js → 0fd6d80393722132e044.js} +2 -2
- package/assets/esri/core/workers/chunks/{0766ecb677d667e5fb83.js.LICENSE.txt → 0fd6d80393722132e044.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/1051a5a57b2fb843a555.js +1 -0
- package/assets/esri/core/workers/chunks/12e99071f6582f6caeaf.js +1 -0
- package/assets/esri/core/workers/chunks/133e4bde346828d4510b.js +1 -0
- package/assets/esri/core/workers/chunks/1991f0d0f0a12175f849.js +1 -0
- package/assets/esri/core/workers/chunks/19a58adc75a34f84b0ef.js +1 -0
- package/assets/esri/core/workers/chunks/1d7f2abfccc54659d6f2.js +1 -0
- package/assets/esri/core/workers/chunks/{339e7a900e2bba9d3647.js → 1f19bd3ef795c6765384.js} +1 -1
- package/assets/esri/core/workers/chunks/{837f886f759fc6f0489d.js → 1f4fd9e3849f4e593375.js} +1 -1
- package/assets/esri/core/workers/chunks/1f9c6fbcd4d0eae1e574.js +1 -0
- package/assets/esri/core/workers/chunks/234117cc5cb7c6863313.js +1 -0
- package/assets/esri/core/workers/chunks/{07695960aa0344dbfbf3.js → 28d9e2ffc3059a55311e.js} +1 -1
- package/assets/esri/core/workers/chunks/{1c025beaaac5ec7c04fb.js → 2adf558cd8d8155d07d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{47f64a340b5d56bf9e59.js → 2cf82d3645c75d311e99.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7ab3511f6627f467796.js → 377a7f0f7d304ff9fe5b.js} +1 -1
- package/assets/esri/core/workers/chunks/3b4b4f84d594db8945f9.js +1 -0
- package/assets/esri/core/workers/chunks/3bf1cf6c3cba172e2f6d.js +1 -0
- package/assets/esri/core/workers/chunks/{b3ca65d6112079fb1d00.js → 3ce5d7ad16e41eea05be.js} +1 -1
- package/assets/esri/core/workers/chunks/465f2db4ab8aa9c9f907.js +1 -0
- package/assets/esri/core/workers/chunks/{1e13e03aad422f9e871e.js → 47fe2379f2214bf50036.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c45603af279ad7fed8c.js → 4954e0cf4a40e45d237f.js} +1 -1
- package/assets/esri/core/workers/chunks/4a362a35bcdb8405a53a.js +1 -0
- package/assets/esri/core/workers/chunks/4f8ebd9f0758b801835c.js +1 -0
- package/assets/esri/core/workers/chunks/5228d39c05d660a135b6.js +1 -0
- package/assets/esri/core/workers/chunks/{736cb9f74bf050b70f4c.js → 52a3d0e041717da7697e.js} +1 -1
- package/assets/esri/core/workers/chunks/54ea93f416ab52b413c1.js +1 -0
- package/assets/esri/core/workers/chunks/554a8bf4626336e68798.js +1 -0
- package/assets/esri/core/workers/chunks/55f087bca75c3f2a4515.js +1 -0
- package/assets/esri/core/workers/chunks/56569d0c2cf5c5167651.js +1 -0
- package/assets/esri/core/workers/chunks/{bbaadce582df7e20397b.js → 56d2a20c1b143697aa19.js} +1 -1
- package/assets/esri/core/workers/chunks/57211c35a9646f088d86.js +1 -0
- package/assets/esri/core/workers/chunks/58526def64536b6581ab.js +1 -0
- package/assets/esri/core/workers/chunks/5890740d5a761b038560.js +1 -0
- package/assets/esri/core/workers/chunks/{9a641fb94819574e48f6.js → 5a73d8b7b01758ed4fdd.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba3193ea145960a50e87.js → 5c8d52b72a3bea4202ac.js} +1 -1
- package/assets/esri/core/workers/chunks/5dbd8d81d94cfda5bb32.js +1 -0
- package/assets/esri/core/workers/chunks/5e52c1c076a1502f9fe4.js +1 -0
- package/assets/esri/core/workers/chunks/609c7c9b7046b3a7acde.js +1 -0
- package/assets/esri/core/workers/chunks/{30f3014c0ac6e2bc14bf.js → 622c0552ca3cd674d46c.js} +1 -1
- package/assets/esri/core/workers/chunks/62798f66872dc32e77d6.js +346 -0
- package/assets/esri/core/workers/chunks/6409160d226a0bea5ac6.js +1 -0
- package/assets/esri/core/workers/chunks/65fd971d0574d69cbc26.js +1 -0
- package/assets/esri/core/workers/chunks/6993a59cbb78bc26f029.js +1 -0
- package/assets/esri/core/workers/chunks/6b23ca6570357f9fb724.js +1 -0
- package/assets/esri/core/workers/chunks/6c37a5bd00d255d1337a.js +1 -0
- package/assets/esri/core/workers/chunks/{2b01e3bce78541620a86.js → 6cbe8205a4e0f62da519.js} +1 -1
- package/assets/esri/core/workers/chunks/6ce4327f63e6eb92bba8.js +1 -0
- package/assets/esri/core/workers/chunks/6f9b8df290b0ce09beae.js +1 -0
- package/assets/esri/core/workers/chunks/{fef1a5f8a6fd3502b33b.js → 6fa1a5b7276a037dbd6a.js} +67 -89
- package/assets/esri/core/workers/chunks/7c819b3e6d69c526f4b2.js +1 -0
- package/assets/esri/core/workers/chunks/7df147da40474b028705.js +1 -0
- package/assets/esri/core/workers/chunks/{0766ecb677d667e5fb83.js → 7e1dc8e5e18f18dd21e2.js} +2 -2
- package/assets/esri/core/workers/chunks/{b4f38fe9cc948a39ad87.js.LICENSE.txt → 7e1dc8e5e18f18dd21e2.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{e662c86b8bafc5512d3d.js → 847e88e1d6da1e74cdc8.js} +1 -1
- package/assets/esri/core/workers/chunks/{6f5ec9bf7cf8a36d8e8b.js → 87eca6de502d18d8b7eb.js} +1 -1
- package/assets/esri/core/workers/chunks/{a73c6b4bc5baf440f85a.js → 88b7265270feede80e1d.js} +1 -1
- package/assets/esri/core/workers/chunks/{10e6dffa57aa1a626708.js → 8a6aac37b3133de74cce.js} +1 -1
- package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{243dc74ec62891ba1ef7.js → 8e82acd1f730571680f4.js} +1 -1
- package/assets/esri/core/workers/chunks/8f1fbfdac04e694f621d.js +1 -0
- package/assets/esri/core/workers/chunks/91cd29f53f07bc38fe75.js +1 -0
- package/assets/esri/core/workers/chunks/{5583d18032ed8bc17c74.js → 938f1eebc48871be64e9.js} +1 -1
- package/assets/esri/core/workers/chunks/97c148adf0347c69a79c.js +1 -0
- package/assets/esri/core/workers/chunks/{029a118e6dfb3f544a5c.js → 98ef17d15517368d2383.js} +1 -1
- package/assets/esri/core/workers/chunks/9c8224ca29475556e5ea.js +1 -0
- package/assets/esri/core/workers/chunks/9d5eac3bd1526e2b33e3.js +1 -0
- package/assets/esri/core/workers/chunks/{38f5e6a202ce292edd9f.js → 9eb9c8db2510154c09cc.js} +1 -1
- package/assets/esri/core/workers/chunks/a036503087baa1f9fd00.js +1 -0
- package/assets/esri/core/workers/chunks/a09b5700c92bb76c3234.js +1 -0
- package/assets/esri/core/workers/chunks/a673128da9e6656ead2e.js +1 -0
- package/assets/esri/core/workers/chunks/{90ae15ce22a49bd84876.js → ab9614555a15f04396f6.js} +2 -2
- package/assets/esri/core/workers/chunks/{90ae15ce22a49bd84876.js.LICENSE.txt → ab9614555a15f04396f6.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/ae733c963d61065faa54.js +1 -0
- package/assets/esri/core/workers/chunks/b0522dffa5600345c07e.js +1 -0
- package/assets/esri/core/workers/chunks/b06cb23048c32940f5de.js +1 -0
- package/assets/esri/core/workers/chunks/{079434fe765c53d304f2.js → b1e275607d9754079f60.js} +1 -1
- package/assets/esri/core/workers/chunks/{d1f7bfb8daf11ecada9f.js → b4273381dc069f4e1fa2.js} +1 -1
- package/assets/esri/core/workers/chunks/{fb2e28e6a87956267d1c.js → b92a34f88569c481ed10.js} +1 -1
- package/assets/esri/core/workers/chunks/{352b7dcd1633e0c98194.js → ba940ebdae84b174a7be.js} +1 -1
- package/assets/esri/core/workers/chunks/bf9b6b74654d303a6dae.js +1 -0
- package/assets/esri/core/workers/chunks/c07c1bb7ae09136dc1f6.js +1 -0
- package/assets/esri/core/workers/chunks/c938f5d269ba202d10ef.js +1 -0
- package/assets/esri/core/workers/chunks/cbbca011f8b176d4b5db.js +1 -0
- package/assets/esri/core/workers/chunks/ce321fd8fc5551e190ec.js +1 -0
- package/assets/esri/core/workers/chunks/ce53ddda04e09ba2f860.js +1 -0
- package/assets/esri/core/workers/chunks/d166f805990353578494.js +1 -0
- package/assets/esri/core/workers/chunks/{b816b608f31954128246.js → d21d9e8b8c8a2e0485d5.js} +1 -1
- package/assets/esri/core/workers/chunks/d9a23fb0c6c936d5e8ec.js +1 -0
- package/assets/esri/core/workers/chunks/da3c62a851a4332f6dda.js +1 -0
- package/assets/esri/core/workers/chunks/db3f710d770adf631b28.js +2 -0
- package/assets/esri/core/workers/chunks/{aa82925ffb00babb0543.js.LICENSE.txt → db3f710d770adf631b28.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{6805e7b43d6ecf3ea93c.js → dcf5719f38ad40b92941.js} +1 -1
- package/assets/esri/core/workers/chunks/e2cada6644c49b1b6e79.js +1 -0
- package/assets/esri/core/workers/chunks/e2fb4bebce3aee406efa.js +1 -0
- package/assets/esri/core/workers/chunks/e3638f9d4c0fda238f4b.js +1 -0
- package/assets/esri/core/workers/chunks/e85f892ea44d67d53ff0.js +2 -0
- package/assets/esri/core/workers/chunks/{3596540ef49e5330ceb2.js.LICENSE.txt → e85f892ea44d67d53ff0.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/e89345c7af9d3d4d8452.js +1 -0
- package/assets/esri/core/workers/chunks/{a31658f544ac6e1801d6.js → ead5d4e271effc04def3.js} +1 -1
- package/assets/esri/core/workers/chunks/ece68a25651ef03fc95d.js +1 -0
- package/assets/esri/core/workers/chunks/f218a190015de1444018.js +1 -0
- package/assets/esri/core/workers/chunks/f229044615af3142bcb0.js +1 -0
- package/assets/esri/core/workers/chunks/f2692f25ef693cf12ce0.js +1 -0
- package/assets/esri/core/workers/chunks/f4c6ea630cecf0f260d7.js +2 -0
- package/assets/esri/core/workers/chunks/{e0dc8794343c2a949ffb.js.LICENSE.txt → f4c6ea630cecf0f260d7.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/f718cb847c4eb1e43ad9.js +1 -0
- package/assets/esri/core/workers/chunks/f8fb0c7eaf73709bd855.js +1 -0
- package/assets/esri/core/workers/chunks/faa40ef04604c7cce706.js +1 -0
- package/assets/esri/core/workers/chunks/{218a66d53f7cf4f285aa.js → fbd2f45d5adce4ca323f.js} +2 -2
- package/assets/esri/core/workers/chunks/{218a66d53f7cf4f285aa.js.LICENSE.txt → fbd2f45d5adce4ca323f.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/ffaa977cd97a2b7190c5.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BuildingPhasePicker.scss +17 -10
- package/assets/esri/themes/base/widgets/_SelectionList.scss +7 -3
- package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +5 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/Jpg.js +1 -1
- package/chunks/LineSeries.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorDefinitions.js +5 -0
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/ShadowCastAccumulate.glsl.js +7 -5
- package/chunks/ShadowCastVisualize.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +8 -7
- package/chunks/Transformation2D.js +1 -1
- package/chunks/arcade.js +1 -1
- package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
- package/chunks/arcgis-knowledge-client-core.js +1 -1
- package/chunks/basis_encoder.js +1 -1
- package/chunks/basis_transcoder.js +1 -1
- package/chunks/bundle.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/chunks/dxt_encoder.js +1 -1
- package/chunks/geometryEngineBase.js +1 -1
- package/chunks/i3s.js +1 -1
- package/chunks/lclayout.js +1 -1
- package/chunks/libtess-asm.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/chunks/vec4.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/core/Accessor.js +1 -1
- package/core/accessorSupport/Lifecycle.js +5 -0
- package/core/accessorSupport/Properties.js +1 -1
- package/core/accessorSupport/decorators/subclass.js +1 -1
- package/core/accessorSupport/tracking/Flags.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/image/apng.js +1 -1
- package/core/image/gif.js +1 -1
- package/core/mapCollectionUtils.js +1 -1
- package/core/mathUtils.js +1 -1
- package/core/urlUtils.js +1 -1
- package/core/workers/Connection.js +1 -1
- package/geometry/operators/densifyOperator.d.ts +0 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorSimplifyOGC.js +1 -1
- package/geometry/operators/simplifyOGCOperator.js +1 -1
- package/geometry/support/meshProperties.js +1 -1
- package/geometry/support/normalizeUtilsSync.js +1 -1
- package/interfaces.d.ts +463 -2595
- package/intl/date.js +1 -1
- package/intl/number.js +1 -1
- package/layers/BingMapsLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/graphics/OptimizedFeatureSet.js +1 -1
- package/layers/graphics/controllers/StreamController.js +1 -1
- package/layers/graphics/data/FeatureIdInfo.js +5 -0
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/StreamFeatureManager.js +1 -1
- package/layers/graphics/data/createFeatureId.js +5 -0
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/graphics/sources/WFSSourceWorker.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/MemorySourceWorker.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/ogc/ogcFeatureUtils.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/core/utils.js +1 -1
- package/layers/orientedImagery/queries.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/support/LercWorker.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/layers/support/rasterFunctions/stretchUtils.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/layers/support/wmsUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/package.json +1 -1
- package/rest/networks/support/Association.js +1 -1
- package/rest/networks/support/NetworkElement.js +1 -1
- package/rest/networks/support/QueryAssociationsParameters.js +1 -1
- package/rest/networks/support/TelecomNetworkElement.js +1 -1
- package/rest/networks/support/TraceResult.js +1 -1
- package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
- package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
- package/rest/query/operations/queryRelatedRecords.js +1 -1
- package/smartMapping/statistics/uniqueValues.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/support/layerUtils.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/cim/effects/EffectRadial.js +1 -1
- package/versionManagement/versionAdapters/FeatureLayerVersionAdapter.js +1 -1
- package/versionManagement/versionAdapters/NetworkVersionAdapter.js +1 -1
- package/versionManagement/versionAdapters/SubTypeGroupLayerVersionAdapter.js +1 -1
- package/views/2d/engine/ManagedCanvas.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/webgl/TileContainer.js +1 -1
- package/views/2d/engine/webgl/grouping.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/featureServiceUtils.js +1 -1
- package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/FocusAreasView.js +5 -0
- package/views/3d/analysis/AnalysisViewManager3D.js +1 -1
- package/views/3d/analysis/DimensionAnalysisView3D.d.ts +4 -0
- package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolManipulatorUtils.js +1 -1
- package/views/3d/camera/constraintUtils/common.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/DimensionLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
- package/views/3d/layers/Lyr3DWasm.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/ViewshedLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
- package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/QueryEngine.js +1 -1
- package/views/3d/layers/graphics/focusAreaStyle.js +5 -0
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
- package/views/3d/layers/i3s/I3SQueryResultGeometry.js +1 -1
- package/views/3d/layers/i3s/PagedNodeIndex.js +1 -1
- package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
- package/views/3d/layers/i3s/meshUtils.js +5 -0
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/LayerViewAnalysisViewManager.js +5 -0
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileAgent.js +1 -1
- package/views/3d/terrain/TileTexture.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IndexRange/ComponentRange.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +3 -25
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Texture2DShadowBindUniform.js +5 -0
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +3 -3
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
- package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
- package/views/3d/webgl.js +1 -1
- package/views/FocusArea.js +1 -1
- package/views/FocusAreas.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/layers/BuildingComponentSublayerView.js +1 -1
- package/views/layers/BuildingSceneLayerView.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/support/TextureCompressionWorkerHandle.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/TextureDescriptor.js +1 -1
- package/views/webgl/textureUtils.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
- package/widgets/ElevationProfile/support/profileUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +5 -0
- package/widgets/OrientedImageryViewer/components/NavigationUIViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/imageNavigationUtils.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +5 -0
- package/widgets/OrientedImageryViewer/navigation/NavigationManagerPanoramic.js +5 -0
- package/widgets/OrientedImageryViewer/navigation/errors.js +5 -0
- package/widgets/OrientedImageryViewer/navigation/queries.js +5 -0
- package/widgets/OrientedImageryViewer/navigation/utils.js +5 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utils/createAssociation.js +1 -1
- package/assets/esri/core/workers/chunks/009dbddfc6499e2cee4f.js +0 -1
- package/assets/esri/core/workers/chunks/0516bd18334d3af6c555.js +0 -1
- package/assets/esri/core/workers/chunks/0d8a635c1f9aeaf7564c.js +0 -1
- package/assets/esri/core/workers/chunks/0f57b6a3a85a47ebd9d0.js +0 -346
- package/assets/esri/core/workers/chunks/1abd026ed12c863e1d94.js +0 -1
- package/assets/esri/core/workers/chunks/1b8cc83aa1179245b2dc.js +0 -1
- package/assets/esri/core/workers/chunks/1c6542315390037053a6.js +0 -1
- package/assets/esri/core/workers/chunks/201db423e3c6f947b77c.js +0 -1
- package/assets/esri/core/workers/chunks/23de8aeed5b82c682cbe.js +0 -1
- package/assets/esri/core/workers/chunks/26ebb7816dd8c8cd4f3b.js +0 -1
- package/assets/esri/core/workers/chunks/2abce00d812c7f6b542d.js +0 -1
- package/assets/esri/core/workers/chunks/2e0af748eba93f3ea6cb.js +0 -1
- package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js +0 -2
- package/assets/esri/core/workers/chunks/3604a77c93cf2927787b.js +0 -1
- package/assets/esri/core/workers/chunks/391b1c3e736a62befbaf.js +0 -1
- package/assets/esri/core/workers/chunks/40e556a0645af8658658.js +0 -1
- package/assets/esri/core/workers/chunks/4402336db7210cd583e0.js +0 -1
- package/assets/esri/core/workers/chunks/47cd99ab3ed11a931084.js +0 -1
- package/assets/esri/core/workers/chunks/4bd5cbf6e0be2fc7e84d.js +0 -1
- package/assets/esri/core/workers/chunks/4c8052e81916579841f4.js +0 -1
- package/assets/esri/core/workers/chunks/4c9aa1dafdc0d9537231.js +0 -1
- package/assets/esri/core/workers/chunks/4feb774f123da26e9f2a.js +0 -1
- package/assets/esri/core/workers/chunks/51b5dfc7085272d26b89.js +0 -1
- package/assets/esri/core/workers/chunks/51d9eaeeb781fd1d1162.js +0 -1
- package/assets/esri/core/workers/chunks/5228fc7fcdf57f44781e.js +0 -1
- package/assets/esri/core/workers/chunks/566c2ce50af225e556ac.js +0 -1
- package/assets/esri/core/workers/chunks/5ddf463c85c33428e807.js +0 -1
- package/assets/esri/core/workers/chunks/61032b5050464cb48056.js +0 -1
- package/assets/esri/core/workers/chunks/63dade3e1cc7f5b76846.js +0 -1
- package/assets/esri/core/workers/chunks/6e12900a9f4c3c9941ec.js +0 -1
- package/assets/esri/core/workers/chunks/6e5d8a6b29c06a27998c.js +0 -1
- package/assets/esri/core/workers/chunks/6f506303017903b9a06f.js +0 -1
- package/assets/esri/core/workers/chunks/71e46e866c23372b0b58.js +0 -1
- package/assets/esri/core/workers/chunks/75fa861b5757551f8fdc.js +0 -1
- package/assets/esri/core/workers/chunks/7c49a8877bd744daa3d5.js +0 -1
- package/assets/esri/core/workers/chunks/7ea5bbb52e84be9a608e.js +0 -1
- package/assets/esri/core/workers/chunks/83e13baab4b90a88d967.js +0 -1
- package/assets/esri/core/workers/chunks/86138c297095af1ac604.js +0 -1
- package/assets/esri/core/workers/chunks/8b74b609de4f70e1a75c.js +0 -1
- package/assets/esri/core/workers/chunks/8e6301006abdf47cc88d.js +0 -1
- package/assets/esri/core/workers/chunks/90f93091fe088875f80f.js +0 -1
- package/assets/esri/core/workers/chunks/91a02ee91f61cf841111.js +0 -1
- package/assets/esri/core/workers/chunks/93cc26e5636040fdc0b8.js +0 -1
- package/assets/esri/core/workers/chunks/9baeb3b5733acdda4e7c.js +0 -1
- package/assets/esri/core/workers/chunks/a1d697e2be1e892a666a.js +0 -1
- package/assets/esri/core/workers/chunks/a1f27c4f4b5ef3e359f7.js +0 -1
- package/assets/esri/core/workers/chunks/a348ff2dd936c6bf9399.js +0 -1
- package/assets/esri/core/workers/chunks/a8430e1e2142f1ce9b92.js +0 -1
- package/assets/esri/core/workers/chunks/aa82925ffb00babb0543.js +0 -2
- package/assets/esri/core/workers/chunks/b64f708f821dd2bb51cd.js +0 -1
- package/assets/esri/core/workers/chunks/bf453744067267e84d1b.js +0 -1
- package/assets/esri/core/workers/chunks/c1175477dfcdee90a453.js +0 -1
- package/assets/esri/core/workers/chunks/c17c269cc30e7e1d0bfb.js +0 -1
- package/assets/esri/core/workers/chunks/c3f144ca69995dca34a9.js +0 -1
- package/assets/esri/core/workers/chunks/c4e2b75b9135920babc3.js +0 -1
- package/assets/esri/core/workers/chunks/cb80b7ddc9acf625d754.js +0 -1
- package/assets/esri/core/workers/chunks/d22f91bc16a7641bcbef.js +0 -1
- package/assets/esri/core/workers/chunks/d52cf7b795ee52034f9e.js +0 -1
- package/assets/esri/core/workers/chunks/d551f70560a2b1ef5696.js +0 -1
- package/assets/esri/core/workers/chunks/d971571a957de70d5a8d.js +0 -1
- package/assets/esri/core/workers/chunks/d9d9d4f99140e579eabb.js +0 -1
- package/assets/esri/core/workers/chunks/dc3a6beb3028009b3c23.js +0 -1
- package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js +0 -2
- package/assets/esri/core/workers/chunks/e483d2f169e51a361742.js +0 -1
- package/assets/esri/core/workers/chunks/e613df03ceb39e29befa.js +0 -1
- package/assets/esri/core/workers/chunks/e697dd4508f02dcfe329.js +0 -1
- package/assets/esri/core/workers/chunks/e9b1349a2b3a3f300808.js +0 -1
- package/assets/esri/core/workers/chunks/eabfab23246d4a052ea3.js +0 -1
- package/assets/esri/core/workers/chunks/ec8e8048b3df2c92008d.js +0 -1
- package/assets/esri/core/workers/chunks/ed6d0fea159dea638c2f.js +0 -1
- package/assets/esri/core/workers/chunks/f5fcba6ca6f43bf1d65d.js +0 -1
- package/assets/esri/core/workers/chunks/f92d76b694ff0cdb212c.js +0 -1
- package/chunks/NetworkElement.js +0 -5
- package/core/accessorSupport/interfaces.js +0 -5
- package/views/FocusAreasUtils.js +0 -5
- package/views/FocusAreasView.js +0 -5
- package/views/analysis/DimensionAnalysisView.d.ts +0 -4
- package/views/analysis/DimensionAnalysisView.js +0 -5
package/core/image/gif.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{Milliseconds as e}from"../time.js";var r,t={},n={},i={};function a(){if(r)return i;r=1,Object.defineProperty(i,"__esModule",{value:!0}),i.loop=i.conditional=i.parse=void 0;var e=function e(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(t))t.forEach((function(t){return e(r,t,n,i)}));else if("function"==typeof t)t(r,n,i,e);else{var a=Object.keys(t)[0];Array.isArray(t[a])?(i[a]={},e(r,t[a],n,i[a])):i[a]=t[a](r,n,i,e)}return n};i.parse=e;var t=function(e,r){return function(t,n,i,a){r(t,n,i)&&a(t,e,n,i)}};i.conditional=t;var n=function(e,r){return function(t,n,i,a){for(var o=[],d=t.pos;r(t,n,i);){var s={};if(a(t,e,n,s),t.pos===d)break;d=t.pos,o.push(s)}return o}};return i.loop=n,i}var o,d,s={};function u(){if(o)return s;o=1,Object.defineProperty(s,"__esModule",{value:!0}),s.readBits=s.readArray=s.readUnsigned=s.readString=s.peekBytes=s.readBytes=s.peekByte=s.readByte=s.buildStream=void 0;var e=function(e){return{data:e,pos:0}};s.buildStream=e;var r=function(){return function(e){return e.data[e.pos++]}};s.readByte=r;var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(r){return r.data[r.pos+e]}};s.peekByte=t;var n=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};s.readBytes=n;var i=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};s.peekBytes=i;var a=function(e){return function(r){return Array.from(n(e)(r)).map((function(e){return String.fromCharCode(e)})).join("")}};s.readString=a;var d=function(e){return function(r){var t=n(2)(r);return e?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};s.readUnsigned=d;var u=function(e,r){return function(t,i,a){for(var o="function"==typeof r?r(t,i,a):r,d=n(e),s=new Array(o),u=0;u<o;u++)s[u]=d(t);return s}};s.readArray=u;var c=function(e,r,t){for(var n=0,i=0;i<t;i++)n+=e[r+i]&&Math.pow(2,t-i-1);return n},f=function(e){return function(t){for(var n=r()(t),i=new Array(8),a=0;a<8;a++)i[7-a]=!!(n&1<<a);return Object.keys(e).reduce((function(r,t){var n=e[t];return n.length?r[t]=c(i,n.index,n.length):r[t]=i[n.index],r}),{})}};return s.readBits=f,s}function c(){return d||(d=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(),t=u(),n={blocks:function(e){for(var r=0,n=[],i=e.data.length,a=0,o=(0,t.readByte)()(e);o!==r&&o;o=(0,t.readByte)()(e)){if(e.pos+o>=i){var d=i-e.pos;n.push((0,t.readBytes)(d)(e)),a+=d;break}n.push((0,t.readBytes)(o)(e)),a+=o}for(var s=new Uint8Array(a),u=0,c=0;c<n.length;c++)s.set(n[c],u),u+=n[c].length;return s}},i=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&249===r[1]})),o=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,(function(e,r,t){return Math.pow(2,t.descriptor.lct.size+1)}))},(function(e,r,t){return t.descriptor.lct.exists})),{data:[{minCodeSize:(0,t.readByte)()},n]}]},(function(e){return 44===(0,t.peekByte)()(e)})),d=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(e,r,n){return(0,t.readBytes)(n.text.blockSize)(e)}},n]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&1===r[1]})),s=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(e,r,n){return(0,t.readString)(n.blockSize)(e)}},n]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&255===r[1]})),c=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},n]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&254===r[1]})),f=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,(function(e,r){return Math.pow(2,r.lsd.gct.size+1)}))},(function(e,r){return r.lsd.gct.exists})),{frames:(0,r.loop)([i,s,c,o,d],(function(e){var r=(0,t.peekByte)()(e);return 33===r||44===r}))}];e.default=f}(n)),n}var f,l={};function p(){if(f)return l;f=1,Object.defineProperty(l,"__esModule",{value:!0}),l.deinterlace=void 0;var e=function(e,r){for(var t=new Array(e.length),n=e.length/r,i=function(n,i){var a=e.slice(i*r,(i+1)*r);t.splice.apply(t,[n*r,r].concat(a))},a=[0,4,2,1],o=[8,8,4,2],d=0,s=0;s<4;s++)for(var u=a[s];u<n;u+=o[s])i(u,d),d++;return t};return l.deinterlace=e,l}var g,y,h={};function v(){if(g)return h;g=1,Object.defineProperty(h,"__esModule",{value:!0}),h.lzw=void 0;var e=function(e,r,t){var n,i,a,o,d,s,u,c,f,l,p,g,y,h,v,m,w=4096,x=-1,B=t,b=new Array(t),k=new Array(w),A=new Array(w),U=new Array(w+1);for(d=(i=1<<(l=e))+1,n=i+2,u=x,a=(1<<(o=l+1))-1,c=0;c<i;c++)k[c]=0,A[c]=c;for(p=g=y=h=v=m=0,f=0;f<B;){if(0===h){if(g<o){p+=r[m]<<g,g+=8,m++;continue}if(c=p&a,p>>=o,g-=o,c>n||c==d)break;if(c==i){a=(1<<(o=l+1))-1,n=i+2,u=x;continue}if(u==x){U[h++]=A[c],u=c,y=c;continue}for(s=c,c==n&&(U[h++]=y,c=u);c>i;)U[h++]=A[c],c=k[c];y=255&A[c],U[h++]=y,n<w&&(k[n]=u,A[n]=y
|
|
5
|
+
import{Milliseconds as e}from"../time.js";var r,t={},n={},i={};function a(){if(r)return i;r=1,Object.defineProperty(i,"__esModule",{value:!0}),i.loop=i.conditional=i.parse=void 0;var e=function e(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(t))t.forEach((function(t){return e(r,t,n,i)}));else if("function"==typeof t)t(r,n,i,e);else{var a=Object.keys(t)[0];Array.isArray(t[a])?(i[a]={},e(r,t[a],n,i[a])):i[a]=t[a](r,n,i,e)}return n};i.parse=e;var t=function(e,r){return function(t,n,i,a){r(t,n,i)&&a(t,e,n,i)}};i.conditional=t;var n=function(e,r){return function(t,n,i,a){for(var o=[],d=t.pos;r(t,n,i);){var s={};if(a(t,e,n,s),t.pos===d)break;d=t.pos,o.push(s)}return o}};return i.loop=n,i}var o,d,s={};function u(){if(o)return s;o=1,Object.defineProperty(s,"__esModule",{value:!0}),s.readBits=s.readArray=s.readUnsigned=s.readString=s.peekBytes=s.readBytes=s.peekByte=s.readByte=s.buildStream=void 0;var e=function(e){return{data:e,pos:0}};s.buildStream=e;var r=function(){return function(e){return e.data[e.pos++]}};s.readByte=r;var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(r){return r.data[r.pos+e]}};s.peekByte=t;var n=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};s.readBytes=n;var i=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};s.peekBytes=i;var a=function(e){return function(r){return Array.from(n(e)(r)).map((function(e){return String.fromCharCode(e)})).join("")}};s.readString=a;var d=function(e){return function(r){var t=n(2)(r);return e?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};s.readUnsigned=d;var u=function(e,r){return function(t,i,a){for(var o="function"==typeof r?r(t,i,a):r,d=n(e),s=new Array(o),u=0;u<o;u++)s[u]=d(t);return s}};s.readArray=u;var c=function(e,r,t){for(var n=0,i=0;i<t;i++)n+=e[r+i]&&Math.pow(2,t-i-1);return n},f=function(e){return function(t){for(var n=r()(t),i=new Array(8),a=0;a<8;a++)i[7-a]=!!(n&1<<a);return Object.keys(e).reduce((function(r,t){var n=e[t];return n.length?r[t]=c(i,n.index,n.length):r[t]=i[n.index],r}),{})}};return s.readBits=f,s}function c(){return d||(d=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(),t=u(),n={blocks:function(e){for(var r=0,n=[],i=e.data.length,a=0,o=(0,t.readByte)()(e);o!==r&&o;o=(0,t.readByte)()(e)){if(e.pos+o>=i){var d=i-e.pos;n.push((0,t.readBytes)(d)(e)),a+=d;break}n.push((0,t.readBytes)(o)(e)),a+=o}for(var s=new Uint8Array(a),u=0,c=0;c<n.length;c++)s.set(n[c],u),u+=n[c].length;return s}},i=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&249===r[1]})),o=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,(function(e,r,t){return Math.pow(2,t.descriptor.lct.size+1)}))},(function(e,r,t){return t.descriptor.lct.exists})),{data:[{minCodeSize:(0,t.readByte)()},n]}]},(function(e){return 44===(0,t.peekByte)()(e)})),d=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(e,r,n){return(0,t.readBytes)(n.text.blockSize)(e)}},n]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&1===r[1]})),s=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(e,r,n){return(0,t.readString)(n.blockSize)(e)}},n]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&255===r[1]})),c=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},n]},(function(e){var r=(0,t.peekBytes)(2)(e);return 33===r[0]&&254===r[1]})),f=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,(function(e,r){return Math.pow(2,r.lsd.gct.size+1)}))},(function(e,r){return r.lsd.gct.exists})),{frames:(0,r.loop)([i,s,c,o,d],(function(e){var r=(0,t.peekByte)()(e);return 33===r||44===r}))}];e.default=f}(n)),n}var f,l={};function p(){if(f)return l;f=1,Object.defineProperty(l,"__esModule",{value:!0}),l.deinterlace=void 0;var e=function(e,r){for(var t=new Array(e.length),n=e.length/r,i=function(n,i){var a=e.slice(i*r,(i+1)*r);t.splice.apply(t,[n*r,r].concat(a))},a=[0,4,2,1],o=[8,8,4,2],d=0,s=0;s<4;s++)for(var u=a[s];u<n;u+=o[s])i(u,d),d++;return t};return l.deinterlace=e,l}var g,y,h={};function v(){if(g)return h;g=1,Object.defineProperty(h,"__esModule",{value:!0}),h.lzw=void 0;var e=function(e,r,t){var n,i,a,o,d,s,u,c,f,l,p,g,y,h,v,m,w=4096,x=-1,B=t,b=new Array(t),k=new Array(w),A=new Array(w),U=new Array(w+1);for(d=(i=1<<(l=e))+1,n=i+2,u=x,a=(1<<(o=l+1))-1,c=0;c<i;c++)k[c]=0,A[c]=c;for(p=g=y=h=v=m=0,f=0;f<B;){if(0===h){if(g<o){p+=r[m]<<g,g+=8,m++;continue}if(c=p&a,p>>=o,g-=o,c>n||c==d)break;if(c==i){a=(1<<(o=l+1))-1,n=i+2,u=x;continue}if(u==x){U[h++]=A[c],u=c,y=c;continue}for(s=c,c==n&&(U[h++]=y,c=u);c>i;)U[h++]=A[c],c=k[c];y=255&A[c],U[h++]=y,n<w&&(k[n]=u,A[n]=y,0===(++n&a)&&n<w&&(o++,a+=n)),u=s}h--,b[v++]=U[h],f++}for(f=v;f<B;f++)b[f]=0;return b};return h.lzw=e,h}function m(){if(y)return t;y=1,Object.defineProperty(t,"__esModule",{value:!0}),t.decompressFrames=t.decompressFrame=t.parseGIF=void 0;var e=d(c()),r=a(),n=u(),i=p(),o=v();function d(e){return e&&e.__esModule?e:{default:e}}var s=function(t){var i=new Uint8Array(t);return(0,r.parse)((0,n.buildStream)(i),e.default)};t.parseGIF=s;var f=function(e){for(var r=e.pixels.length,t=new Uint8ClampedArray(4*r),n=0;n<r;n++){var i=4*n,a=e.pixels[n],o=e.colorTable[a]||[0,0,0];t[i]=o[0],t[i+1]=o[1],t[i+2]=o[2],t[i+3]=a!==e.transparentIndex?255:0}return t},l=function(e,r,t){if(e.image){var n=e.image,a=n.descriptor.width*n.descriptor.height,d=(0,o.lzw)(n.data.minCodeSize,n.data.blocks,a);n.descriptor.lct.interlaced&&(d=(0,i.deinterlace)(d,n.descriptor.width));var s={pixels:d,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?s.colorTable=n.lct:s.colorTable=r,e.gce&&(s.delay=10*(e.gce.delay||10),s.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(s.transparentIndex=e.gce.transparentColorIndex)),t&&(s.patch=f(s)),s}console.warn("gif frame does not have associated image.")};t.decompressFrame=l;var g=function(e,r){return e.frames.filter((function(e){return e.image})).map((function(t){return l(t,e.gct,r)}))};return t.decompressFrames=g,t}var w=m();let x,B,b;function k(e,r){return x??=document.createElement("canvas"),x.width=e,x.height=r,x.getContext("2d",{willReadFrequently:!0})}async function A(r,t){const n=w.parseGIF(r),i=w.decompressFrames(n,!0),{width:a,height:o}=n.lsd,d=k(a,o),s=[],u=[];let c=0;for(const f of i){const r=e(f.delay||100);u.push(r),c+=r;const t=U(new ImageData(f.patch,f.dims.width,f.dims.height)),n=3===f.disposalType?d.getImageData(f.dims.left,f.dims.top,f.dims.width,f.dims.height):void 0;d.drawImage(t,f.dims.left,f.dims.top);const i=d.getImageData(0,0,a,o);s.push(i),1===f.disposalType||(2===f.disposalType?d.clearRect(f.dims.left,f.dims.top,f.dims.width,f.dims.height):3===f.disposalType&&d.putImageData(n,f.dims.left,f.dims.top))}return{frameCount:i.length,duration:c,frameDurations:u,getFrame:e=>s[e],width:a,height:o}}function U(e){return B??=document.createElement("canvas"),b??=B.getContext("2d",{willReadFrequently:!0}),B.width=e.width,B.height=e.height,b.putImageData(e,0,0),B}const S=[71,73,70];function I(e){const r=new Uint8Array(e);return!S.some(((e,t)=>e!==r[t]))}function z(e){if(!I(e))return!1;const r=new DataView(e),t=r.getUint8(10);let n=13+(128&t?3*2**(1+(7&t)):0),i=0,a=!1;for(;!a;){switch(r.getUint8(n++)){case 33:if(!o())return!1;break;case 44:d();break;case 59:a=!0;break;default:return!1}if(i>1)return!0}function o(){switch(r.getUint8(n++)){case 249:s();break;case 1:u();break;case 254:c();break;case 255:f();break;default:return!1}return!0}function d(){i++,n+=8;const e=r.getUint8(n++);n+=128&e?3*2**(1+(7&e)):0,n++,l()}function s(){n++,n+=4,l()}function u(){i++,n++,n+=12,l()}function c(){l()}function f(){n++,n+=8,n+=3,l()}function l(){let e;for(;e=r.getUint8(n++);)n+=e}return!1}export{z as isAnimatedGIF,I as isGIF,A as parseGif};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createTask as e}from"./asyncUtils.js";import t from"./Collection.js";import{
|
|
5
|
+
import{createTask as e}from"./asyncUtils.js";import t from"./Collection.js";import{destroyHandle as o,removeIfHandle as s}from"./handleUtils.js";import{ignoreAbortErrors as r,isAborted as n,createAbortError as i}from"./promiseUtils.js";import{on as a}from"./reactiveUtils.js";function c(e,o,s){const r=s?.createCollection?.()??new t,n=!!s?.recycleItems?new d:null,i=(e,t=0)=>{if(!e?.length)return;const o=r.splice(t,e.length);n?n.processRemoved(e):o.forEach(m)},c=(e,t=0)=>{if(!e?.length)return;const s=[];for(const r of e){const e=n?.use(r);if(e)s.push(e);else{const e=o(r);n?.register(r,e),s.push(e)}}r.addMany(s,t)},l=a(e,"after-splice",(({added:e,start:t,removed:o})=>{i(o,t),c(e,t)}),{sync:!0,onListenerRemove:e=>i(e.items),onListenerAdd:e=>c(e.items)});return r.addHandles(l),r}class d{constructor(){this._originalToMapped=new Map,this._removedItemCandidates=new Set,this._garbageCollectionQueued=!1}processRemoved(e){if(!e?.length)return;const{_removedItemCandidates:t}=this;for(const o of e)this._getItem(o)?.markRemoved()&&(t.add(o),this._queueGarbageCollection())}use(e){const t=this._getItem(e);return t&&(t.removed=!1),t?.item}register(e,t){this._originalToMapped.set(e,new l(t))}_getItem(e){return this._originalToMapped.get(e)}_queueGarbageCollection(){this._garbageCollectionQueued||(this._garbageCollectionQueued=!0,queueMicrotask((()=>this._garbageCollectCandidates())))}_garbageCollectCandidates(){this._garbageCollectionQueued=!1;const{_removedItemCandidates:e}=this,t=Array.from(e);e.clear(),t.forEach((e=>this._garbageCollectIfRemoved(e)))}_garbageCollectIfRemoved(e){const{_originalToMapped:t}=this,o=this._getItem(e);o?.removed&&(m(o.item),t.delete(e))}}class l{constructor(e){this.item=e,this.removed=!1}markRemoved(){return this.removed=!0,!0}}function m(e){"object"==typeof e&&e&&("destroy"in e&&"function"==typeof e.destroy?e.destroy():s(e))}function u(s,a,d){const l=new t,u=c(s,(t=>e((async e=>{const o=await a(t,e);if(n(e))throw m(o),i();return o}))),d),f=()=>null,g=async e=>{const t=await e.promise,o=u.indexOf(e);o<0||l.splice(o,1,t)};l.addMany(u.items.map(f));for(const e of u)r(g(e));const h=u.on("after-splice",(({added:e,start:t,deleteCount:o})=>{const s=l.splice(t,o);for(const r of s)m(r);if(e?.length){l.addMany(e.map(f),t);for(const t of e)r(g(t))}}));return l.addHandles([o(u),h]),l}export{c as mapCollection,u as mapCollectionAsync};
|
package/core/mathUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const t=new Float32Array(1);function n(t){--t;for(let n=1;n<32;n<<=1)t|=t>>n;return t+1}function r(t,n,r){return Math.min(Math.max(t,n),r)}function e(t,n){return 0===n?0:Math.round(t/n)*n}function u(t){return!(t&t-1)}function i(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}function a(t){return 10**Math.ceil(Math.LOG10E*Math.log(t))}function o(t,n,r){return t+(n-t)*r}function f(t,n){const r=-t*t/(2*n);return 1/Math.sqrt(2*Math.PI*n)*Math.exp(r)}function c(t,n,r,e,u){return o(e,u,(t-n)/(r-n))}function s(t){return t*Math.PI/180}function M(t){return 180*t/Math.PI}function h(t,n=1e-6){return(t<0?-1:1)/Math.max(Math.abs(t),n)}function b(t){return Math.acos(r(t,-1,1))}function l(t){return Math.asin(r(t,-1,1))}function m(t,n,r=1e-6){if(t===n)return!0;if(!Number.isFinite(t)||!Number.isFinite(n))return!1;return(t>n?t-n:n-t)<=r}function N(t,n,r=1e-6){return!m(t,n,r)&&t>n}function F(t,n,r=1e-6){return!m(t,n,r)&&t<n}function g(t,n,r=1e-6){return m(t,n,r)||t>n}function E(t,n,r=1e-6){return m(t,n,r)||t<n}const I=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function p(t){return I.setFloat64(0,t),I.getBigInt64(0)}function x(t){return I.setBigInt64(0,t),I.getFloat64(0)}const B=BigInt("1000000"),w=y(1);function y(t){const n=p(t=Math.abs(t)),r=x(n<=B?B:n-B);return Math.abs(t-r)}function P(t,n,r=w){if(t===n)return!0;if(!Number.isFinite(t)||!Number.isFinite(n))return!1;if(null!=r){if(y(Math.min(Math.abs(t),Math.abs(n)))<r)return Math.abs(t-n)<=r}const e=p(t),u=p(n);if(e<0!=u<0)return!1;return!((e<u?u-e:e-u)>B)}function A(t,n,r=1e-6){if(t===n)return!0;if(!Number.isFinite(t)||!Number.isFinite(n))return!1;const e=Math.abs(t-n),u=Math.abs(t),i=Math.abs(n);if(0===t||0===n||u<1e-12&&i<1e-12){if(e>.01*r)return!1}else if(e/(u+i)>r)return!1;return!0}function S(t){return d(Math.max(-q,Math.min(t,q)))}function d(n){return t[0]=n,t[0]}function L(t,n,e){const u=r((e-t)/(n-t),0,1);return u*u*(3-2*u)}function T(t){const n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],e=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(m(n,1)&&m(r,1)&&m(e,1))}function _(t,n){return(t%n+n)%n}const q=d(34028234663852886e22);function v(t,n,r){if(void 0===r||0
|
|
5
|
+
const t=new Float32Array(1);function n(t){--t;for(let n=1;n<32;n<<=1)t|=t>>n;return t+1}function r(t,n,r){return Math.min(Math.max(t,n),r)}function e(t,n){return 0===n?0:Math.round(t/n)*n}function u(t){return!(t&t-1)}function i(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}function a(t){return 10**Math.ceil(Math.LOG10E*Math.log(t))}function o(t,n,r){return t+(n-t)*r}function f(t,n){const r=-t*t/(2*n);return 1/Math.sqrt(2*Math.PI*n)*Math.exp(r)}function c(t,n,r,e,u){return o(e,u,(t-n)/(r-n))}function s(t){return t*Math.PI/180}function M(t){return 180*t/Math.PI}function h(t,n=1e-6){return(t<0?-1:1)/Math.max(Math.abs(t),n)}function b(t){return Math.acos(r(t,-1,1))}function l(t){return Math.asin(r(t,-1,1))}function m(t,n,r=1e-6){if(t===n)return!0;if(!Number.isFinite(t)||!Number.isFinite(n))return!1;return(t>n?t-n:n-t)<=r}function N(t,n,r=1e-6){return!m(t,n,r)&&t>n}function F(t,n,r=1e-6){return!m(t,n,r)&&t<n}function g(t,n,r=1e-6){return m(t,n,r)||t>n}function E(t,n,r=1e-6){return m(t,n,r)||t<n}const I=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function p(t){return I.setFloat64(0,t),I.getBigInt64(0)}function x(t){return I.setBigInt64(0,t),I.getFloat64(0)}const B=BigInt("1000000"),w=y(1);function y(t){const n=p(t=Math.abs(t)),r=x(n<=B?B:n-B);return Math.abs(t-r)}function P(t,n,r=w){if(t===n)return!0;if(!Number.isFinite(t)||!Number.isFinite(n))return!1;if(null!=r){if(y(Math.min(Math.abs(t),Math.abs(n)))<r)return Math.abs(t-n)<=r}const e=p(t),u=p(n);if(e<0!=u<0)return!1;return!((e<u?u-e:e-u)>B)}function A(t,n,r=1e-6){if(t===n)return!0;if(!Number.isFinite(t)||!Number.isFinite(n))return!1;const e=Math.abs(t-n),u=Math.abs(t),i=Math.abs(n);if(0===t||0===n||u<1e-12&&i<1e-12){if(e>.01*r)return!1}else if(e/(u+i)>r)return!1;return!0}function S(t){return d(Math.max(-q,Math.min(t,q)))}function d(n){return t[0]=n,t[0]}function L(t,n,e){const u=r((e-t)/(n-t),0,1);return u*u*(3-2*u)}function T(t){const n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],e=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(m(n,1)&&m(r,1)&&m(e,1))}function _(t,n){return(t%n+n)%n}const q=d(34028234663852886e22);function v(t,n,r){if(void 0===r||0===+r)return Math[t](n);if(n=+n,r=+r,isNaN(n)||"number"!=typeof r||r%1!=0)return NaN;let e=n.toString().split("e");return e=(n=Math[t](+(e[0]+"e"+(e[1]?+e[1]-r:-r)))).toString().split("e"),+(e[0]+"e"+(e[1]?+e[1]+r:r))}export{b as acosClamped,l as asinClamped,r as clamp,S as clampFloat32,v as decimalAdjust,s as deg2rad,m as floatEqualAbsolute,A as floatEqualRelative,P as floatEqualUlp,N as floatGreaterThan,g as floatGreaterThanOrEqual,F as floatLessThan,E as floatLessThanOrEqual,f as gauss,T as hasScaling,u as isPowerOfTwo,o as lerp,_ as moduloPositive,a as nextHighestPowerOfTen,n as nextHighestPowerOfTwo,i as nextPowerOfTwo,q as numberMaxFloat32,M as rad2deg,h as reciprocalClamped,e as roundToNearest,c as scale,L as smoothstep};
|
package/core/urlUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../config.js";import{isSome as n}from"./arrayUtils.js";import e from"./Error.js";import r from"./Logger.js";import{isSerializable as o}from"./support/jsonUtils.js";import{parseKnownArcGISOnlineDomain as i}from"../portal/support/urlUtils.js";import{base64ToArrayBuffer as s,arrayBufferToBase64 as u}from"../support/base64Utils.js";const l=()=>r.getLogger("esri.core.urlUtils"),c=t.request,f="esri/config: esriConfig.request.proxyUrl is not set.",a=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,p=/^\s*http:/i,h=/^\s*https:/i,d=/^\s*file:/i,m=/:\d+$/,y=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),$=new RegExp("^((([^[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^[:]*))(:([0-9]+))?$");class x{constructor(t=""){this.uri=t,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let n=this.uri.match(g);this.scheme=n[2]||(n[1]?"":null),this.authority=n[4]||(n[3]?"":null),this.path=n[5],this.query=n[7]||(n[6]?"":null),this.fragment=n[9]||(n[8]?"":null),null!=this.authority&&(n=this.authority.match($),this.user=n[3]||null,this.password=n[4]||null,this.host=n[6]||n[7],this.port=n[9]||null)}toString(){return this.uri}}const w={},U=new x(t.applicationUrl);let O=U;const R=b();let q=R;const C=()=>O,j=()=>q;function b(){const t=O.path,n=t.slice(0,t.lastIndexOf("/")+1);return`${`${O.scheme}://${O.host}${null!=O.port?`:${O.port}`:""}`}${n}`}const L={setAppUrl:t=>O=t,setAppBaseUrl:t=>q=t,restoreUrls:()=>{O=U,q=R}};function I(t){if(!t)return null;const n={path:null,query:null},e=new x(t),r=t.indexOf("?");return null===e.query?n.path=t:(n.path=t.slice(0,r),n.query=A(e.query)),e.fragment&&(n.hash=e.fragment,null===e.query&&(n.path=n.path.slice(0,n.path.length-(e.fragment.length+1)))),n}function A(t){const n=t.split("&"),e={};for(const r of n){if(!r)continue;const t=r.indexOf("=");let n,o;t<0?(n=decodeURIComponent(r),o=""):(n=decodeURIComponent(r.slice(0,t)),o=decodeURIComponent(r.slice(t+1)));let i=e[n];"string"==typeof i&&(i=e[n]=[i]),Array.isArray(i)?i.push(o):e[n]=o}return e}function v(t,n){return t?n&&"function"==typeof n?Object.keys(t).map((e=>encodeURIComponent(e)+"="+encodeURIComponent(n(e,t[e])))).join("&"):Object.keys(t).map((e=>{const r=t[e];if(null==r)return"";const i=encodeURIComponent(e)+"=",s=n?.[e];return s?i+encodeURIComponent(s(r)):Array.isArray(r)?r.map((t=>o(t)?i+encodeURIComponent(JSON.stringify(t)):i+encodeURIComponent(t))).join("&"):o(r)?i+encodeURIComponent(JSON.stringify(r)):i+encodeURIComponent(r)})).filter((t=>t)).join("&"):""}function P(t=!1){let n,r=c.proxyUrl;if("string"==typeof t){n=dt(t);const e=T(t);e&&(r=e.proxyUrl)}else n=!!t;if(!r)throw l().warn(f),new e("urlUtils:proxy-not-set",f);n&&wt()&&(r=$t(r));return I(r)}function k(t,n=!1){const e=T(t);let r,o;if(e){const t=B(e.proxyUrl);r=t.path,o=t.query?A(t.query):null}else if(n){const n=P(t);r=n.path,o=n.query}if(r){const n=I(t);t=r+"?"+n.path;const e=v({...o,...n.query});e&&(t=`${t}?${e}`)}return t}const E={path:"",query:""};function B(t){const n=t.indexOf("?");return-1!==n?(E.path=t.slice(0,n),E.query=t.slice(n+1)):(E.path=t,E.query=null),E}function S(t){return t=(t=Ut(t=Ct(t=B(t).path),!0)).toLowerCase()}function H(t){const n={proxyUrl:t.proxyUrl,urlPrefix:S(t.urlPrefix)},e=c.proxyRules,r=n.urlPrefix;let o=e.length;for(let i=0;i<e.length;i++){const t=e[i].urlPrefix;if(0===r.indexOf(t)){if(r.length===t.length)return-1;o=i;break}0===t.indexOf(r)&&(o=i+1)}return e.splice(o,0,n),o}function T(t){const n=c.proxyRules,e=S(t);for(let r=0;r<n.length;r++)if(0===e.indexOf(n[r].urlPrefix))return n[r]}function W(t,n){if(!t||!n)return!1;t=J(t),n=J(n);const e=i(t),r=i(n);return null!=e&&null!=r?e.portalHostname===r.portalHostname:null==e&&null==r&&F(t,n,!0)}function z(t,n){if(!t||!n)return!1;t=J(t),n=J(n);const e=i(t),r=i(n);return null!=e&&null!=r&&e.portalHostname===r.portalHostname}function D(t,n){return t=J(t),n=J(n),Ut(t)===Ut(n)}function J(t){const n=(t=K(t)).indexOf("/sharing");return n>0?t.slice(0,n):t.replace(/\/+$/,"")}function N(t,n=c.interceptors){const e=n=>null==n||n instanceof RegExp&&n.test(t)||"string"==typeof n&&t.startsWith(n);if(n)for(const r of n)if(Array.isArray(r.urls)){if(r.urls.some(e))return r}else if(e(r.urls))return r;return null}function F(t,n,e=!1){if(!t||!n)return!1;const r=vt(t),o=vt(n);return!(!e&&r.scheme!==o.scheme)&&(null!=r.host&&null!=o.host&&(r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port))}function M(t){if("string"==typeof t){if(!Y(t))return!0;t=vt(t)}if(F(t,O))return!0;const n=c.trustedServers||[];for(let e=0;e<n.length;e++){const r=Q(n[e]);for(let n=0;n<r.length;n++)if(F(t,r[n]))return!0}return!1}function Q(t){return w[t]||(ht(t)||pt(t)?w[t]=[new x(_(t))]:w[t]=[new x(`http://${t}`),new x(`https://${t}`)]),w[t]}function _(t,n=q,e){return pt(t)?e?.preserveProtocolRelative?t:"http"===O.scheme&&O.authority===X(t).slice(2)?`http:${t}`:`https:${t}`:ht(t)?t:V("/"===t[0]?Ot(n):n,t)}function G(t,n=q,e){if(null==t||!Y(t))return t;const r=K(t),o=r.toLowerCase(),i=K(n).toLowerCase().replace(/\/+$/,""),s=e?K(e).toLowerCase().replace(/\/+$/,""):null;if(s&&0!==i.indexOf(s))return t;const u=(t,n,e)=>-1===(e=t.indexOf(n,e))?t.length:e;let l=u(o,"/",o.indexOf("//")+2),c=-1;for(;o.slice(0,l+1)===i.slice(0,l)+"/"&&(c=l+1,l!==o.length);)l=u(o,"/",l+1);if(-1===c)return t;if(s&&c<s.length)return t;t=r.slice(c);const f=i.slice(c-1).replaceAll(/[^/]+/g,"").length;if(f>0)for(let a=0;a<f;a++)t=`../${t}`;else t=`./${t}`;return t}function K(t){return t=It(t=Lt(t=bt(t=_(t=t.trim()))))}function V(...t){const e=t.filter(n);if(!e?.length)return;const r=[];if(Y(e[0])){const t=e[0],n=t.indexOf("//");-1!==n&&(r.push(t.slice(0,n+1)),yt(e[0])&&(r[0]+="/"),e[0]=t.slice(n+2))}else"/"===e[0][0]&&r.push("");const o=e.reduce(((t,n)=>n?t.concat(n.split("/")):t),[]);for(let n=0;n<o.length;n++){const t=o[n];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&n===o.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function X(t,n=!1){if(null==t||Z(t)||tt(t))return null;let e=t.indexOf("://");if(-1===e&&pt(t))e=2;else{if(-1===e)return null;e+=3}const r=t.indexOf("/",e);return-1!==r&&(t=t.slice(0,r)),n&&(t=Ut(t,!0)),t}function Y(t){return pt(t)||ht(t)}function Z(t){return null!=t&&"blob:"===t.slice(0,5)}function tt(t){return null!=t&&"data:"===t.slice(0,5)}function nt(t){const n=ot(t);return n?.isBase64?s(n.data):null}function et(t){return u(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const rt=/^data:(.*?)(;base64)?,(.*)$/;function ot(t){const n=t.match(rt);if(!n)return null;const[,e,r,o]=n;return{mediaType:e,isBase64:!!r,data:o}}function it(t){return t.isBase64?`data:${t.mediaType};base64,${t.data}`:`data:${t.mediaType},${t.data}`}async function st(t){return(await fetch(t)).blob()}function ut(t){const n=nt(t);if(!n)return null;const e=ot(t);return new Blob([n],{type:e.mediaType})}function lt(t,n){ft(t,n)}function ct(t,n){at(t,n)}function ft(t,n){const e=ut(t);return!!e&&at(e,n)}function at(t,n){if(!t)return!1;const e=document.createElement("a");if(!("download"in e))return!1;const r=URL.createObjectURL(t);return e.download=n,e.href=r,e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e),URL.revokeObjectURL(r),!0}function pt(t){return null!=t&&"/"===t[0]&&"/"===t[1]}function ht(t){return null!=t&&a.test(t)}function dt(t){return null!=t&&h.test(t)||"https"===O.scheme&&pt(t)}function mt(t){return null!=t&&p.test(t)||"http"===O.scheme&&pt(t)}function yt(t){return null!=t&&d.test(t)}function gt(t){return pt(t)?`http:${t}`:t.replace(h,"http:")}function $t(t){return pt(t)?`https:${t}`:t.replace(p,"https:")}function xt(){return"http"===O.scheme}function wt(){return"https"===O.scheme}function Ut(t,n=!1){return pt(t)?t.slice(2):(t=t.replace(a,""),n&&t.length>1&&"/"===t[0]&&"/"===t[1]&&(t=t.slice(2)),t)}function Ot(t){const n=t.indexOf("//"),e=t.indexOf("/",n+2);return-1===e?t:t.slice(0,e)}function Rt(t){let n=0;if(Y(t)){const e=t.indexOf("//");-1!==e&&(n=e+2)}const e=t.lastIndexOf("/");return e<n?t:t.slice(0,e+1)}function qt(t,n){if(!t)return"";const e=I(t).path.replace(/\/+$/,""),r=e.slice(e.lastIndexOf("/")+1);if(!n?.length)return r;const o=new RegExp(`\\.(${n.join("|")})$`,"i");return r.replace(o,"")}function Ct(t){return t.endsWith("/")?t:`${t}/`}function jt(t){return t.replace(/\/+$/,"")}function bt(t){if(/^https?:\/\//i.test(t)){const n=B(t);t=(t=n.path.replaceAll(/\/{2,}/g,"/")).replace("/","//"),n.query&&(t+=`?${n.query}`)}return t}function Lt(t){return t.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}function It(t){const n=c.httpsDomains;if(!mt(t))return t;const e=t.indexOf("/",7);let r;if(r=-1===e?t:t.slice(0,e),r=r.toLowerCase().slice(7),m.test(r)){if(!r.endsWith(":80"))return t;r=r.slice(0,-3),t=t.replace(":80","")}return xt()&&r===O.authority&&!y.test(t)||(wt()&&r===O.authority||n&&n.some((t=>r===t||r.endsWith(`.${t}`)))||wt()&&!T(t))&&(t=$t(t)),t}function At(t,n,e){if(!(n&&e&&t&&Y(t)))return t;const r=t.indexOf("//"),o=t.indexOf("/",r+2),i=t.indexOf(":",r+2),s=Math.min(o<0?t.length:o,i<0?t.length:i);if(t.slice(r+2,s).toLowerCase()!==n.toLowerCase())return t;return`${t.slice(0,r+2)}${e}${t.slice(s)}`}function vt(t){return"string"==typeof t?new x(_(t)):(t.scheme||(t.scheme=O.scheme),t)}function Pt(t){return Dt.test(t)}function kt(t,n){const e=I(t),r=Object.keys(e.query||{});return r.length>0&&n&&n.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),e.path}function Et(t,n,e){const r=I(t),o=r.query||{};return o[n]=String(e),`${r.path}?${v(o)}`}function Bt(t,n){if(!n)return t;const e=I(t),r=e.query||{};for(const[i,s]of Object.entries(n))null!=s&&(r[i]=s);const o=v(r);return o?`${e.path}?${o}`:e.path}function St(t,n){const{path:e,query:r}=I(t);if(!r)return t;delete r[n];const o=v(r);return o?`${e}?${o}`:e}function Ht(t){if(null==t)return null;const n=t.match(zt);return n?n[2]:null}function Tt(t){if(null==t)return null;const n=t.match(zt);return n?{path:n[1],extension:n[2]}:{path:t,extension:null}}async function Wt(t){if("string"==typeof t){return ot(t)??{data:t}}return new Promise(((n,e)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>n(ot(r.result)),r.onerror=t=>e(t)}))}const zt=/([^.]*)\.([^/]*)$/,Dt=/(^data:image\/svg|\.svg$)/i;export{x as Url,k as addProxy,H as addProxyRule,Et as addQueryParameter,Bt as addQueryParameters,et as base64UrlEncode,st as blobUrlToBlob,At as changeDomain,ot as dataComponents,nt as dataToArrayBuffer,ut as dataToBlob,ct as downloadBlobAsFile,lt as downloadDataAsFile,Ct as ensureTrailingSlash,j as getAppBaseUrl,C as getAppUrl,qt as getFilename,N as getInterceptor,X as getOrigin,Ht as getPathExtension,T as getProxyRule,P as getProxyUrl,ht as hasProtocol,z as hasSameCanonicalArcGISOnlinePortal,W as hasSameCanonicalPortal,F as hasSameOrigin,D as hasSamePortal,Y as isAbsolute,wt as isAppHTTPS,Z as isBlobProtocol,tt as isDataProtocol,dt as isHTTPSProtocol,pt as isProtocolRelative,Pt as isSVG,M as isTrustedServer,V as join,_ as makeAbsolute,it as makeData,G as makeRelative,K as normalize,v as objectToQuery,Wt as parseData,A as queryToObject,Rt as removeFile,St as removeQueryParameter,kt as removeQueryParameters,jt as removeTrailingSlash,Tt as splitPathExtension,L as test,gt as toHTTP,$t as toHTTPS,w as trustedServersUrlCache,I as urlToObject};
|
|
5
|
+
import t from"../config.js";import{isSome as n}from"./arrayUtils.js";import e from"./Error.js";import r from"./Logger.js";import{isSerializable as o}from"./support/jsonUtils.js";import{parseKnownArcGISOnlineDomain as i}from"../portal/support/urlUtils.js";import{base64ToArrayBuffer as s,arrayBufferToBase64 as u}from"../support/base64Utils.js";const l=()=>r.getLogger("esri.core.urlUtils"),c=t.request,f="esri/config: esriConfig.request.proxyUrl is not set.",a=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,p=/^\s*http:/i,h=/^\s*https:/i,d=/^\s*file:/i,m=/:\d+$/,y=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),$=new RegExp("^((([^[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^[:]*))(:([0-9]+))?$");class x{constructor(t=""){this.uri=t,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let n=this.uri.match(g);this.scheme=n[2]||(n[1]?"":null),this.authority=n[4]||(n[3]?"":null),this.path=n[5],this.query=n[7]||(n[6]?"":null),this.fragment=n[9]||(n[8]?"":null),null!=this.authority&&(n=this.authority.match($),this.user=n[3]||null,this.password=n[4]||null,this.host=n[6]||n[7],this.port=n[9]||null)}toString(){return this.uri}}const w={},U=new x(t.applicationUrl);let O=U;const R=b();let q=R;const C=()=>O,j=()=>q;function b(){const t=O.path,n=t.slice(0,t.lastIndexOf("/")+1);return`${`${O.scheme}://${O.host}${null!=O.port?`:${O.port}`:""}`}${n}`}const L={setAppUrl:t=>O=t,setAppBaseUrl:t=>q=t,restoreUrls:()=>{O=U,q=R}};function I(t){if(!t)return null;const n={path:null,query:null},e=new x(t),r=t.indexOf("?");return null===e.query?n.path=t:(n.path=t.slice(0,r),n.query=A(e.query)),e.fragment&&(n.hash=e.fragment,null===e.query&&(n.path=n.path.slice(0,n.path.length-(e.fragment.length+1)))),n}function A(t){const n=t.split("&"),e={};for(const r of n){if(!r)continue;const t=r.indexOf("=");let n,o;t<0?(n=decodeURIComponent(r),o=""):(n=decodeURIComponent(r.slice(0,t)),o=decodeURIComponent(r.slice(t+1)));let i=e[n];"string"==typeof i&&(i=e[n]=[i]),Array.isArray(i)?i.push(o):e[n]=o}return e}function v(t,n){return t?n&&"function"==typeof n?Object.keys(t).map((e=>encodeURIComponent(e)+"="+encodeURIComponent(n(e,t[e])))).join("&"):Object.keys(t).map((e=>{const r=t[e];if(null==r)return"";const i=encodeURIComponent(e)+"=",s=n?.[e];return s?i+encodeURIComponent(s(r)):Array.isArray(r)?r.map((t=>o(t)?i+encodeURIComponent(JSON.stringify(t)):i+encodeURIComponent(t))).join("&"):o(r)?i+encodeURIComponent(JSON.stringify(r)):i+encodeURIComponent(r)})).filter((t=>t)).join("&"):""}function P(t=!1){let n,r=c.proxyUrl;if("string"==typeof t){n=dt(t);const e=T(t);e&&(r=e.proxyUrl)}else n=!!t;if(!r)throw l().warn(f),new e("urlUtils:proxy-not-set",f);n&&wt()&&(r=$t(r));return I(r)}function k(t,n=!1){const e=T(t);let r,o;if(e){const t=B(e.proxyUrl);r=t.path,o=t.query?A(t.query):null}else if(n){const n=P(t);r=n.path,o=n.query}if(r){const n=I(t);t=r+"?"+n.path;const e=v({...o,...n.query});e&&(t=`${t}?${e}`)}return t}const E={path:"",query:""};function B(t){const n=t.indexOf("?");return-1!==n?(E.path=t.slice(0,n),E.query=t.slice(n+1)):(E.path=t,E.query=null),E}function S(t){return t=(t=Ut(t=Ct(t=B(t).path),!0)).toLowerCase()}function H(t){const n={proxyUrl:t.proxyUrl,urlPrefix:S(t.urlPrefix)},e=c.proxyRules,r=n.urlPrefix;let o=e.length;for(let i=0;i<e.length;i++){const t=e[i].urlPrefix;if(0===r.indexOf(t)){if(r.length===t.length)return-1;o=i;break}0===t.indexOf(r)&&(o=i+1)}return e.splice(o,0,n),o}function T(t){const n=c.proxyRules,e=S(t);for(let r=0;r<n.length;r++)if(0===e.indexOf(n[r].urlPrefix))return n[r]}function W(t,n){if(!t||!n)return!1;t=J(t),n=J(n);const e=i(t),r=i(n);return null!=e&&null!=r?e.portalHostname===r.portalHostname:null==e&&null==r&&F(t,n,!0)}function z(t,n){if(!t||!n)return!1;t=J(t),n=J(n);const e=i(t),r=i(n);return null!=e&&null!=r&&e.portalHostname===r.portalHostname}function D(t,n){return t=J(t),n=J(n),Ut(t)===Ut(n)}function J(t){const n=(t=K(t)).indexOf("/sharing");return n>0?t.slice(0,n):t.replace(/\/+$/,"")}function N(t,n=c.interceptors){const e=n=>n instanceof RegExp?n.test(t):"string"==typeof n?t.startsWith(n):null==n;if(n)for(const r of n)if(Array.isArray(r.urls)){if(r.urls.some(e))return r}else if(e(r.urls))return r;return null}function F(t,n,e=!1){if(!t||!n)return!1;const r=vt(t),o=vt(n);return!(!e&&r.scheme!==o.scheme)&&(null!=r.host&&null!=o.host&&(r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port))}function M(t){if("string"==typeof t){if(!Y(t))return!0;t=vt(t)}if(F(t,O))return!0;const n=c.trustedServers||[];for(let e=0;e<n.length;e++){const r=Q(n[e]);for(let n=0;n<r.length;n++)if(F(t,r[n]))return!0}return!1}function Q(t){return w[t]||(ht(t)||pt(t)?w[t]=[new x(_(t))]:w[t]=[new x(`http://${t}`),new x(`https://${t}`)]),w[t]}function _(t,n=q,e){return pt(t)?e?.preserveProtocolRelative?t:"http"===O.scheme&&O.authority===X(t).slice(2)?`http:${t}`:`https:${t}`:ht(t)?t:V("/"===t[0]?Ot(n):n,t)}function G(t,n=q,e){if(null==t||!Y(t))return t;const r=K(t),o=r.toLowerCase(),i=K(n).toLowerCase().replace(/\/+$/,""),s=e?K(e).toLowerCase().replace(/\/+$/,""):null;if(s&&0!==i.indexOf(s))return t;const u=(t,n,e)=>-1===(e=t.indexOf(n,e))?t.length:e;let l=u(o,"/",o.indexOf("//")+2),c=-1;for(;o.slice(0,l+1)===i.slice(0,l)+"/"&&(c=l+1,l!==o.length);)l=u(o,"/",l+1);if(-1===c)return t;if(s&&c<s.length)return t;t=r.slice(c);const f=i.slice(c-1).replaceAll(/[^/]+/g,"").length;if(f>0)for(let a=0;a<f;a++)t=`../${t}`;else t=`./${t}`;return t}function K(t){return t=It(t=Lt(t=bt(t=_(t=t.trim()))))}function V(...t){const e=t.filter(n);if(!e?.length)return;const r=[];if(Y(e[0])){const t=e[0],n=t.indexOf("//");-1!==n&&(r.push(t.slice(0,n+1)),yt(e[0])&&(r[0]+="/"),e[0]=t.slice(n+2))}else"/"===e[0][0]&&r.push("");const o=e.reduce(((t,n)=>n?t.concat(n.split("/")):t),[]);for(let n=0;n<o.length;n++){const t=o[n];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&n===o.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function X(t,n=!1){if(null==t||Z(t)||tt(t))return null;let e=t.indexOf("://");if(-1===e&&pt(t))e=2;else{if(-1===e)return null;e+=3}const r=t.indexOf("/",e);return-1!==r&&(t=t.slice(0,r)),n&&(t=Ut(t,!0)),t}function Y(t){return pt(t)||ht(t)}function Z(t){return null!=t&&"blob:"===t.slice(0,5)}function tt(t){return null!=t&&"data:"===t.slice(0,5)}function nt(t){const n=ot(t);return n?.isBase64?s(n.data):null}function et(t){return u(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const rt=/^data:(.*?)(;base64)?,(.*)$/;function ot(t){const n=t.match(rt);if(!n)return null;const[,e,r,o]=n;return{mediaType:e,isBase64:!!r,data:o}}function it(t){return t.isBase64?`data:${t.mediaType};base64,${t.data}`:`data:${t.mediaType},${t.data}`}async function st(t){return(await fetch(t)).blob()}function ut(t){const n=nt(t);if(!n)return null;const e=ot(t);return new Blob([n],{type:e.mediaType})}function lt(t,n){ft(t,n)}function ct(t,n){at(t,n)}function ft(t,n){const e=ut(t);return!!e&&at(e,n)}function at(t,n){if(!t)return!1;const e=document.createElement("a");if(!("download"in e))return!1;const r=URL.createObjectURL(t);return e.download=n,e.href=r,e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e),URL.revokeObjectURL(r),!0}function pt(t){return null!=t&&"/"===t[0]&&"/"===t[1]}function ht(t){return null!=t&&a.test(t)}function dt(t){return null!=t&&h.test(t)||"https"===O.scheme&&pt(t)}function mt(t){return null!=t&&p.test(t)||"http"===O.scheme&&pt(t)}function yt(t){return null!=t&&d.test(t)}function gt(t){return pt(t)?`http:${t}`:t.replace(h,"http:")}function $t(t){return pt(t)?`https:${t}`:t.replace(p,"https:")}function xt(){return"http"===O.scheme}function wt(){return"https"===O.scheme}function Ut(t,n=!1){return pt(t)?t.slice(2):(t=t.replace(a,""),n&&t.length>1&&"/"===t[0]&&"/"===t[1]&&(t=t.slice(2)),t)}function Ot(t){const n=t.indexOf("//"),e=t.indexOf("/",n+2);return-1===e?t:t.slice(0,e)}function Rt(t){let n=0;if(Y(t)){const e=t.indexOf("//");-1!==e&&(n=e+2)}const e=t.lastIndexOf("/");return e<n?t:t.slice(0,e+1)}function qt(t,n){if(!t)return"";const e=I(t).path.replace(/\/+$/,""),r=e.slice(e.lastIndexOf("/")+1);if(!n?.length)return r;const o=new RegExp(`\\.(${n.join("|")})$`,"i");return r.replace(o,"")}function Ct(t){return t.endsWith("/")?t:`${t}/`}function jt(t){return t.replace(/\/+$/,"")}function bt(t){if(/^https?:\/\//i.test(t)){const n=B(t);t=(t=n.path.replaceAll(/\/{2,}/g,"/")).replace("/","//"),n.query&&(t+=`?${n.query}`)}return t}function Lt(t){return t.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}function It(t){const n=c.httpsDomains;if(!mt(t))return t;const e=t.indexOf("/",7);let r;if(r=-1===e?t:t.slice(0,e),r=r.toLowerCase().slice(7),m.test(r)){if(!r.endsWith(":80"))return t;r=r.slice(0,-3),t=t.replace(":80","")}return xt()&&r===O.authority&&!y.test(t)||(wt()&&r===O.authority||n&&n.some((t=>r===t||r.endsWith(`.${t}`)))||wt()&&!T(t))&&(t=$t(t)),t}function At(t,n,e){if(!(n&&e&&t&&Y(t)))return t;const r=t.indexOf("//"),o=t.indexOf("/",r+2),i=t.indexOf(":",r+2),s=Math.min(o<0?t.length:o,i<0?t.length:i);if(t.slice(r+2,s).toLowerCase()!==n.toLowerCase())return t;return`${t.slice(0,r+2)}${e}${t.slice(s)}`}function vt(t){return"string"==typeof t?new x(_(t)):(t.scheme||(t.scheme=O.scheme),t)}function Pt(t){return Dt.test(t)}function kt(t,n){const e=I(t),r=Object.keys(e.query||{});return r.length>0&&n&&n.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),e.path}function Et(t,n,e){const r=I(t),o=r.query||{};return o[n]=String(e),`${r.path}?${v(o)}`}function Bt(t,n){if(!n)return t;const e=I(t),r=e.query||{};for(const[i,s]of Object.entries(n))null!=s&&(r[i]=s);const o=v(r);return o?`${e.path}?${o}`:e.path}function St(t,n){const{path:e,query:r}=I(t);if(!r)return t;delete r[n];const o=v(r);return o?`${e}?${o}`:e}function Ht(t){if(null==t)return null;const n=t.match(zt);return n?n[2]:null}function Tt(t){if(null==t)return null;const n=t.match(zt);return n?{path:n[1],extension:n[2]}:{path:t,extension:null}}async function Wt(t){if("string"==typeof t){return ot(t)??{data:t}}return new Promise(((n,e)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>n(ot(r.result)),r.onerror=t=>e(t)}))}const zt=/([^.]*)\.([^/]*)$/,Dt=/(^data:image\/svg|\.svg$)/i;export{x as Url,k as addProxy,H as addProxyRule,Et as addQueryParameter,Bt as addQueryParameters,et as base64UrlEncode,st as blobUrlToBlob,At as changeDomain,ot as dataComponents,nt as dataToArrayBuffer,ut as dataToBlob,ct as downloadBlobAsFile,lt as downloadDataAsFile,Ct as ensureTrailingSlash,j as getAppBaseUrl,C as getAppUrl,qt as getFilename,N as getInterceptor,X as getOrigin,Ht as getPathExtension,T as getProxyRule,P as getProxyUrl,ht as hasProtocol,z as hasSameCanonicalArcGISOnlinePortal,W as hasSameCanonicalPortal,F as hasSameOrigin,D as hasSamePortal,Y as isAbsolute,wt as isAppHTTPS,Z as isBlobProtocol,tt as isDataProtocol,dt as isHTTPSProtocol,pt as isProtocolRelative,Pt as isSVG,M as isTrustedServer,V as join,_ as makeAbsolute,it as makeData,G as makeRelative,K as normalize,v as objectToQuery,Wt as parseData,A as queryToObject,Rt as removeFile,St as removeQueryParameter,kt as removeQueryParameters,jt as removeTrailingSlash,Tt as splitPathExtension,L as test,gt as toHTTP,$t as toHTTPS,w as trustedServersUrlCache,I as urlToObject};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{handlesGroup as e}from"../handleUtils.js";import"../has.js";import{isPromiseLike as t,createAbortError as s,createResolver as i,throwIfAborted as n}from"../promiseUtils.js";import o from"../Queue.js";import{unregister as r}from"./connectionRegistry.js";import{createInvokeProxy as l}from"./InvokeHandler.js";import h from"./RemoteClient.js";class c{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new o}destroy(){this.close()}get closed(){return!this._clients?.length}open(e,s){return new Promise(((i,o)=>{let r=!0;const l=e=>{n(s.signal),r&&(r=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let n=0;n<e.length;++n){const r=e[n];t(r)?this._clientPromises[n]=r.then((e=>(this._clients[n]=new h(e,s,this._ongoingJobsQueue),l(i),this._clients[n])),(()=>(l(o),null))):(this._clients[n]=new h(r,s,this._ongoingJobsQueue),this._clientPromises[n]=Promise.resolve(this._clients[n]),l(i))}}))}broadcast(e,t,s){const i=new Array(this._clientPromises.length);for(let n=0;n<this._clientPromises.length;++n){const o=this._clientPromises[n];i[n]=o.then((i=>i?.invoke(e,t,s)))}return i}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.resolver.reject(s(`Worker closing, aborting job calling '${e.methodName}'`));for(const t of this._clientPromises)t.then((e=>e?.close()));this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0,r(this)}invoke(e,t,s){return this.apply(e,[t],s)}apply(e,t,s){const n=i();this._ongoingJobsQueue.push({methodName:e,data:t,invokeOptions:s,resolver:n});for(let i=0;i<this._clientPromises.length;i++){const e=this._clients[i];e?e.jobAdded():this._clientPromises[i].then((e=>e?.jobAdded()))}return n.promise}createInvokeProxy(e){return l(this,e)}on(t,s){return Promise.all(this._clientPromises).then((()=>e(this._clients.map((e=>e.on(t,s))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let s=t.length;for(let i=0;i<this._clientPromises.length;++i){this._clientPromises[i].then((n=>{n&&(t[i]=n.openPort()),0
|
|
5
|
+
import{handlesGroup as e}from"../handleUtils.js";import"../has.js";import{isPromiseLike as t,createAbortError as s,createResolver as i,throwIfAborted as n}from"../promiseUtils.js";import o from"../Queue.js";import{unregister as r}from"./connectionRegistry.js";import{createInvokeProxy as l}from"./InvokeHandler.js";import h from"./RemoteClient.js";class c{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new o}destroy(){this.close()}get closed(){return!this._clients?.length}open(e,s){return new Promise(((i,o)=>{let r=!0;const l=e=>{n(s.signal),r&&(r=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let n=0;n<e.length;++n){const r=e[n];t(r)?this._clientPromises[n]=r.then((e=>(this._clients[n]=new h(e,s,this._ongoingJobsQueue),l(i),this._clients[n])),(()=>(l(o),null))):(this._clients[n]=new h(r,s,this._ongoingJobsQueue),this._clientPromises[n]=Promise.resolve(this._clients[n]),l(i))}}))}broadcast(e,t,s){const i=new Array(this._clientPromises.length);for(let n=0;n<this._clientPromises.length;++n){const o=this._clientPromises[n];i[n]=o.then((i=>i?.invoke(e,t,s)))}return i}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.resolver.reject(s(`Worker closing, aborting job calling '${e.methodName}'`));for(const t of this._clientPromises)t.then((e=>e?.close()));this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0,r(this)}invoke(e,t,s){return this.apply(e,[t],s)}apply(e,t,s){const n=i();this._ongoingJobsQueue.push({methodName:e,data:t,invokeOptions:s,resolver:n});for(let i=0;i<this._clientPromises.length;i++){const e=this._clients[i];e?e.jobAdded():this._clientPromises[i].then((e=>e?.jobAdded()))}return n.promise}createInvokeProxy(e){return l(this,e)}on(t,s){return Promise.all(this._clientPromises).then((()=>e(this._clients.map((e=>e.on(t,s))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let s=t.length;for(let i=0;i<this._clientPromises.length;++i){this._clientPromises[i].then((n=>{n&&(t[i]=n.openPort()),0===--s&&e(t)}))}}))}get test(){}}export{c as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{G as e,S as t}from"../../../chunks/SimpleGeometryCursor.js";import{r as s,G as r,c as i}from"../../../chunks/Geometry.js";import{E as m,n as o}from"../../../chunks/QuadraticBezier.js";import{Envelope2D as n}from"../../../chunks/Envelope2D.js";import{c as h,P as a}from"../../../chunks/Envelope.js";import{am as _,an as p,ao as u,
|
|
5
|
+
import{G as e,S as t}from"../../../chunks/SimpleGeometryCursor.js";import{r as s,G as r,c as i}from"../../../chunks/Geometry.js";import{E as m,n as o}from"../../../chunks/QuadraticBezier.js";import{Envelope2D as n}from"../../../chunks/Envelope2D.js";import{c as h,P as a}from"../../../chunks/Envelope.js";import{am as _,an as p,ao as u,m as l,l as c,n as y,ap as G,aq as g,C as d,ar as f}from"../../../chunks/ProjectionTransformation.js";class x{getOperatorType(){return 10009}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,r=0){return new T(e,t,s,r)}}class T extends e{constructor(e,t,r,i){super(),this.m_shape=new m,this.m_currentGeom=o,this.m_progressCounter=0,this.m_geomIndex=-1,this.m_geomTypeIndex=-1,this.m_index=-1,this.m_bBuilt=!1,this.m_bOutputOnlyModified=!1,this.m_bSimplifyPolygons=!1,this.m_bSnapToSr=!1,this.m_progressTracker=r,this.m_inputGeometries=e,this.m_sr=t,this.m_options=i,1===i||2===i?(this.m_bOutputOnlyModified=!0,this.m_options=0,this.m_bSimplifyPolygons=!0,this.m_bSnapToSr=null!=t&&2===i,this.m_bSnapToSr&&!_()&&s("PE is required for snapping to spatial reference operation")):0===i&&(this.m_bSimplifyPolygons=!0)}progress_(e=!1){}tock(){return!0}getRank(){return 1}moveToNextGeom(){for(;;){if(this.m_bBuilt?this.m_currentGeom=this.m_shape.getNextGeometry(this.m_currentGeom):(this.m_currentGeom=this.m_shape.getFirstGeometry(),this.m_bBuilt=!0),this.m_currentGeom!==o){let e=!1;if(this.m_bSimplifyPolygons&&this.m_shape.getGeometryType(this.m_currentGeom)===r.enumPolygon&&(e=p(this.m_shape,this.m_currentGeom,-1,!1,o,this.m_progressTracker)),this.m_bOutputOnlyModified&&!e&&!this.m_shape.getGeometryModified(this.m_currentGeom))continue}break}}next(){if(this.m_bBuilt)this.moveToNextGeom();else{this.m_geomIndex=this.m_shape.createGeometryUserIndex();const e=new n;for(let o=this.m_inputGeometries.next();null!=o;o=this.m_inputGeometries.next()){this.progress_(),i(o);let t=!1;this.m_bSnapToSr&&(o=o.clone(),t=u(this.m_sr,o));const s=this.m_shape.addGeometry(o);this.m_shape.setGeometryUserIndex(s,this.m_geomIndex,this.m_inputGeometries.getGeometryID());const m=o.getGeometryType();m===r.enumPoint&&(-1===this.m_geomTypeIndex&&(this.m_geomTypeIndex=this.m_shape.createGeometryUserIndex()),this.m_shape.setGeometryUserIndex(s,this.m_geomTypeIndex,m));const h=new n;o.queryLooseEnvelope(h),e.mergeEnvelope2D(h),t&&this.m_shape.setGeometryModified(s,!0)}const t=h(this.m_sr,e,!0),s=h(this.m_sr,e,!1);e.inflate(10*t.total()),this.m_shape.forceSetEnvelope2D(e);let m=null,a=0,_=0;if(this.m_shape.hasCurves()){m=new d;const s=l(t.total(),e);a=c(t.total()),_=f(s,a),y(this.m_shape,s,t.total(),12e3,m,null,this.m_progressTracker)}if(G(this.m_shape,s,this.m_progressTracker)){if(g(this.m_shape,t.add(_),this.m_progressTracker,0===this.m_options,this.m_bOutputOnlyModified),null!==m){if(this.m_bSimplifyPolygons){for(let e=this.m_shape.getFirstGeometry();e!==o;e=this.m_shape.getNextGeometry(e))if(this.m_shape.getGeometryType(e)===r.enumPolygon){p(this.m_shape,e,-1,!1,o,this.m_progressTracker)&&this.m_shape.setGeometryModified(e,!0)}this.m_bSimplifyPolygons=!1}m.stitchCurves(this.m_shape,o,a,!0),m.clearStitcher(this.m_shape)}}else this.m_bSimplifyPolygons=!1,null!==m&&(m.stitchCurves(this.m_shape,o,a,!0),m.clearStitcher(this.m_shape));this.moveToNextGeom()}if(this.m_currentGeom!==o){if(this.m_index=this.m_shape.getGeometryUserIndex(this.m_currentGeom,this.m_geomIndex),-1!==this.m_geomTypeIndex&&this.m_shape.getGeometryUserIndex(this.m_currentGeom,this.m_geomTypeIndex)===r.enumPoint){const e=new a({vd:this.m_shape.getVertexDescription()});return this.m_shape.queryPointGeometryOnly(this.m_currentGeom,e),this.m_bSnapToSr&&u(this.m_sr,e),e}{const e=this.m_shape.getGeometry(this.m_currentGeom);return this.m_bSnapToSr&&u(this.m_sr,e),e}}return null}getGeometryID(){return this.m_index}}const S=new x;function b(e,s,r){const i=S.executeMany(new t(e),s,null,r);return Array.from(i)}function I(){return S.supportsCurves()}export{b as executeMany,I as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{G as t,S as s}from"../../../chunks/SimpleGeometryCursor.js";import{b as e}from"../../../chunks/Envelope.js";import{c as i,a as n,G as o,f as h,t as r}from"../../../chunks/Geometry.js";import{P as m,a,d as f}from"../../../chunks/QuadraticBezier.js";import{P as _,o as c,p as d,t as P,e as u}from"../../../chunks/Point2D.js";function l(t,s,e,o,h,r){if(null===t&&n(""),t.getDimension()<1&&n(""),h>0||n(""),i(t),0===s||t.isEmpty())return t;const m=new A(r);return m.m_bUseZ=t.hasAttribute(1),m.m_bUseM=t.hasAttribute(2),m.m_inputGeometry=t,m.m_distance=s,m.m_tolerance=h,m.m_joins=e,m.m_miterLimit=o>1?o:1,m.m_progressCounter=0,m.constructOffset()}const y=1.4142135623730951,x=.017453292519943295,p=256,b=512,M=1024;class g{static construct(t,s,e){const i=new g;return i.x=t.x,i.y=t.y,i.m_next=-1,i.m_prev=-1,i.z=s,i.m=e,i.type=0,i}clone(){const t=new g;return t.x=this.x,t.y=this.y,t.m_next=this.m_next,t.m_prev=this.m_prev,t.z=this.z,t.m=this.m,t.type=this.type,t}asPoint2D(){return new _(this.x,this.y)}}function C(){return{pt:new g,bAtExistingPt:!1}}class A{constructor(t){this.m_distance=-1,this.m_tolerance=-1,this.m_miterLimit=10,this.m_joins=0,this.m_progressCounter=0,this.m_bUseZ=!1,this.m_bUseM=!1,this.m_srcPts=[],this.m_srcPtCount=0,this.m_offsetPts=[],this.m_offsetPtCount=0,this.m_a1=0,this.m_a2=0,this.m_progressTracker=t}constructOffset(){const t=this.m_inputGeometry.getGeometryType();if(t===o.enumLine)return this.offsetLine();if(t===o.enumEnvelope)return this.offsetEnvelope();if(h(t)){const t=new m;return t.addSegment(this.m_inputGeometry,!0),this.m_inputGeometry=t,this.constructOffset()}if(t===o.enumPolyline){const t=new m;return this.offsetMultiPath(t),t}if(t===o.enumPolygon){const t=new a;return this.offsetMultiPath(t),t}r("")}offsetLine(){const t=this.m_inputGeometry,s=t.getStartXY(),e=t.getEndXY(),i=new _;i.setSub(e,s),i.normalize(),i.leftPerpendicularThis(),i.scale(this.m_distance),s.addThis(i),e.addThis(i);const n=t.clone();return n.setStartXY(s),n.setEndXY(e),n}offsetEnvelope(){const t=this.m_inputGeometry;if(this.m_distance>0&&2!==this.m_joins){const s=new a;return s.addEnvelope(t,!1),this.m_inputGeometry=s,this.constructOffset()}const s=t.clone();return s.inflateCoords(this.m_distance,this.m_distance),s}progress(){}static buildPoint(t,s,e,i){i.x=t.x+s*Math.cos(e),i.y=t.y+s*Math.sin(e),i.type=t.type,i.z=t.z,i.m=t.m,i.m_next=-1,i.m_prev=-1}addPoint(t){this.m_offsetPts.push(t.clone()),this.m_offsetPtCount++}addPointEx(t,s){if(0===this.m_offsetPtCount)return void this.addPoint(t);const e=this.m_srcPtCount,i=this.m_srcPts[0===s?e-1:s-1],n=this.m_srcPts[s],o=A.dotSign(i,n,this.m_offsetPts[this.m_offsetPtCount-1],t);if(o>0)this.addPoint(t);else if(o<0)if(A.dotSign(i,n,n,this.m_offsetPts[this.m_offsetPtCount-1])>0){const n=new g;let o;o=0===s?e-2:1===s?e-1:s-2;const h=this.m_srcPts[o],r=Math.atan2(i.y-h.y,i.x-h.x);if(A.buildPoint(i,this.m_distance,r-c,n),this.m_offsetPts[this.m_offsetPtCount-1]=n,1===this.m_joins||2===this.m_joins){n.x=.5*(n.x+i.x),n.y=.5*(n.y+i.y),this.addPoint(n),A.buildPoint(i,this.m_distance,this.m_a1+c,n);const t=n.clone();t.x=.5*(t.x+i.x),t.y=.5*(t.y+i.y),t.type|=p,this.addPoint(t),this.addPoint(n)}else A.buildPoint(i,this.m_distance,this.m_a1+c,n),n.type|=p,this.addPoint(n);this.addPointEx(t,s)}else{const t=new g;if(A.buildPoint(n,this.m_distance,this.m_a1+c,t),this.addPoint(t),1===this.m_joins||2===this.m_joins){t.x=.5*(t.x+n.x),t.y=.5*(t.y+n.y),this.addPoint(t),A.buildPoint(n,this.m_distance,this.m_a2-c,t);const s=t.clone();s.x=.5*(s.x+n.x),s.y=.5*(s.y+n.y),s.type|=p,this.addPoint(s),this.addPoint(t)}else A.buildPoint(n,this.m_distance,this.m_a2-c,t),t.type|=p,this.addPoint(t)}}buildOffset(){const t=new g,s=this.m_srcPtCount;this.m_offsetPtCount=0;const e=.5*this.m_tolerance;let i=0,n=0;for(let o=0;o<s;o++){const h=this.m_srcPts[o],r=0===o?this.m_srcPts[s-1]:this.m_srcPts[o-1],m=o===s-1?this.m_srcPts[0]:this.m_srcPts[o+1];let a,f,P=0;{const t=r.x-h.x,s=r.y-h.y,e=m.x-h.x,c=m.y-h.y;a=Math.atan2(s,t),f=Math.atan2(c,e),this.m_a1=a,this.m_a2=f,0===o&&(i=a,n=f),P=_.orientationRobust(h.asPoint2D(),r.asPoint2D(),m.asPoint2D())}const u=f;if(f<a&&(f+=d),P*this.m_distance>0)if(1===this.m_joins||2===this.m_joins){A.buildPoint(h,this.m_distance,a+c,t),this.addPoint(t);const s=.001;t.x=h.x+(t.x-h.x)*s,t.y=h.y+(t.y-h.y)*s,this.addPoint(t),A.buildPoint(h,this.m_distance,f-c,t);const e=t.clone();e.x=h.x+(e.x-h.x)*s,e.y=h.y+(e.y-h.y)*s,e.type|=p,this.addPoint(e),this.addPoint(t)}else{const s=.5*(f-a),e=0===s?this.m_distance:this.m_distance/Math.abs(Math.sin(s));A.buildPoint(h,e,.5*(a+f),t),this.addPointEx(t,o)}else if(h.type&b){const s=1-e/Math.abs(this.m_distance);let i=1,n=this.m_distance<0?-Math.PI:Math.PI;if(s>-1&&s<1){let t=2*Math.acos(s);t<x&&(t=x),i=Math.trunc(Math.PI/t+1.5),i>1&&(n/=i)}i<=1&&(i=2,n/=2);let r=a+c;A.buildPoint(h,this.m_distance,r,t),0===o&&(t.type|=M),this.addPointEx(t,o);const m=this.m_distance/Math.cos(n/2);for(r+=n/2,A.buildPoint(h,m,r,t),t.type|=M,this.addPoint(t);--i>0;)r+=n,A.buildPoint(h,m,r,t),t.type|=M,this.addPoint(t);A.buildPoint(h,this.m_distance,f-c,t),t.type|=M,this.addPoint(t)}else if(1!==this.m_joins)if(0!==this.m_joins)if(2!==this.m_joins){let s;if(f=u,this.m_distance>0?(f>a&&(f-=d),s=a-f<c):(f<a&&(f+=d),s=f-a<c),s){const s=this.m_distance*y;let e;e=s<0?a+.25*Math.PI:a+3*Math.PI*.25,A.buildPoint(h,s,e,t),this.addPointEx(t,o),e=s<0?f-.25*Math.PI:f-3*Math.PI*.25,A.buildPoint(h,s,e,t),this.addPoint(t)}else{const s=.5*(f-a),e=this.m_distance/Math.abs(Math.sin(s));f<a&&(f+=d),A.buildPoint(h,e,(a+f)/2,t),this.addPointEx(t,o)}}else{const s=r.x-h.x,e=r.y-h.y,i=m.x-h.x,n=m.y-h.y,c=(s*i+e*n)/Math.sqrt(s*s+e*e)/Math.sqrt(i*i+n*n);if(c>1-1e-8){A.buildPoint(h,y*this.m_distance,f-.25*Math.PI,t),this.addPointEx(t,o),A.buildPoint(h,y*this.m_distance,f+.25*Math.PI,t),this.addPoint(t);continue}const d=Math.abs(this.m_distance/Math.sin(.5*Math.acos(c))),P=Math.abs(this.m_miterLimit*this.m_distance);if(d>P){const s=.5*(f-a),e=this.m_distance/Math.abs(Math.sin(s));A.buildPoint(h,e,.5*(a+f),t);const i=_.construct(t.x,t.y),n=_.construct(h.x,h.y),r=new _;r.setSub(i,n);const m=new _;m.setScaleAdd(P/r.length(),r,n);const c=Math.sqrt(d*d-this.m_distance*this.m_distance),u=(d-P)*Math.abs(this.m_distance)/c;this.m_distance>0?r.leftPerpendicularThis():r.rightPerpendicularThis(),r.scale(u/r.length());const l=new _;l.setAdd(m,r);const y=new _;y.setSub(m,r),t.x=l.x,t.y=l.y,this.addPointEx(t,o),t.x=y.x,t.y=y.y,this.addPoint(t);continue}const u=.5*(f-a),l=this.m_distance/Math.abs(Math.sin(u));A.buildPoint(h,l,.5*(a+f),t),this.addPointEx(t,o)}else{const s=1-e/Math.abs(this.m_distance);let i=1,n=f-c-(a+c);if(s>-1&&s<1){let t=2*Math.acos(s);t<x&&(t=x),i=Math.trunc(Math.abs(n)/t+1.5),i>1&&(n/=i)}const r=this.m_distance/Math.cos(.5*n);let m=a+c+.5*n;for(A.buildPoint(h,r,m,t),this.addPointEx(t,o);--i>0;)m+=n,A.buildPoint(h,r,m,t),this.addPoint(t)}else A.buildPoint(h,this.m_distance,a+c,t),this.addPointEx(t,o),A.buildPoint(h,this.m_distance,f-c,t),this.addPoint(t)}return this.m_a1=i,this.m_a2=n,this.addPointEx(this.m_offsetPts[0],0),this.m_offsetPts[0]=this.m_offsetPts[this.m_offsetPtCount-1].clone(),this.removeBadSegsFast()}removeBadSegsFast(){let t=!1;for(let e=0;e<this.m_offsetPtCount;e++){const t=this.m_offsetPts[e];t.m_next=e+1,t.m_prev=e-1}this.m_offsetPts[0].m_prev=this.m_offsetPtCount-2,this.m_offsetPts[this.m_offsetPtCount-2].m_next=0;let s=0;for(let e=0;e<this.m_offsetPtCount;e++)if(this.m_offsetPts[s].type&p){const e=this.deleteClosedSeg(s);if(-1===e){t=!0;break}s=e}else s=this.m_offsetPts[s].m_next;return!t&&(this.compressOffsetArray(s),!0)}deleteClosedSeg(t){const s=this.m_offsetPtCount-1;let e,i,n=t;for(let o=1;o<=s-2;o++){n=this.m_offsetPts[n].m_next,e=n,i=t;for(let t=1;t<=o;t++){if(i=this.m_offsetPts[i].m_prev,!(this.m_offsetPts[i].type&p||this.m_offsetPts[e].type&p)){const t=this.handleClosedIntersection(i,e);if(-1!==t)return t}e=this.m_offsetPts[e].m_prev}}return-1}handleClosedIntersection(t,s){const e=this.m_offsetPts[this.m_offsetPts[t].m_prev],i=this.m_offsetPts[t],n=this.m_offsetPts[this.m_offsetPts[s].m_prev],o=this.m_offsetPts[s];if(!this.sectGraphicRect(e,i,n,o))return-1;const h=C();if(((i.x-e.x)*(o.y-n.y)-(i.y-e.y)*(o.x-n.x))*this.m_distance<0){if(this.findIntersection(e,i,n,o,h)&&!h.bAtExistingPt){const r=1e-8,m=Math.sqrt((i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y)),a=(i.x-e.x)/m,f=(i.y-e.y)/m,_=Math.sqrt((o.x-n.x)*(o.x-n.x)+(o.y-n.y)*(o.y-n.y)),c=(o.x-n.x)/_,d=(o.y-n.y)/_;let P=!1;const u=h.pt.clone();u.x+=(a+c)*r,u.y+=(f+d)*r;let l=n,y=h.pt,x=this.m_offsetPts[t].m_prev;for(;y.y>u.y!=l.y>u.y&&u.x<(l.x-y.x)*(u.y-y.y)/(l.y-y.y)+y.x&&(P=!P),l=y,x=this.m_offsetPts[x].m_next,x!==s;)y=this.m_offsetPts[x];if(P)return-1;const p=this.m_offsetPts[t].m_prev;return h.pt.type=i.type,h.pt.m_next=s,h.pt.m_prev=p,this.m_offsetPts[t]=h.pt,this.m_offsetPts[s].m_prev=t,s}}return-1}sectGraphicRect(t,s,e,i){return Math.max(t.x,s.x)>=Math.min(e.x,i.x)&&Math.max(e.x,i.x)>=Math.min(t.x,s.x)&&Math.max(t.y,s.y)>=Math.min(e.y,i.y)&&Math.max(e.y,i.y)>=Math.min(t.y,s.y)}findIntersection(t,s,e,i,n){let o,h,r,m;return n.bAtExistingPt=!1,o=(s.y-t.y)*(i.x-e.x)-(s.x-t.x)*(i.y-e.y),h=(e.y-t.y)*(s.x-t.x)-(e.x-t.x)*(s.y-t.y),r=0===o?2:h/o,r>=0&&r<=1&&(m=r,o=(i.y-e.y)*(s.x-t.x)-(i.x-e.x)*(s.y-t.y),h=(t.y-e.y)*(i.x-e.x)-(t.x-e.x)*(i.y-e.y),r=0===o?2:h/o,r>=0&&r<=1)&&(n.pt.x=t.x+r*(s.x-t.x),n.pt.y=t.y+r*(s.y-t.y),this.m_bUseZ&&(n.pt.z=e.z+m*(i.z-e.z)),this.m_bUseM&&(n.pt.m=e.m+m*(i.m-e.m)),0!==m&&1!==m||0!==r&&1!==r||(n.bAtExistingPt=!0),!((0===m||1===m)&&r>0&&r<1||(0===r||1===r)&&m>0&&m<1))}compressOffsetArray(t){for(;this.m_offsetPts[t].m_prev<t;)t=this.m_offsetPts[t].m_prev;let s=0,e=t;do{const t=this.m_offsetPts[e].clone();this.m_offsetPts[s]=t,e=t.m_next,s++}while(e!==t);this.m_offsetPts[s]=this.m_offsetPts[0].clone(),this.m_offsetPtCount=s+1}addPart(t,s){if(!(s<2))for(let e=0;e<s;e++){const s=this.m_offsetPts[t+e];if(e?this.m_bUseZ?this.m_resultPath.lineTo3DCoords(s.x,s.y,s.z):this.m_resultPath.lineToCoords(s.x,s.y):this.m_bUseZ?this.m_resultPath.startPath3DCoords(s.x,s.y,s.z):this.m_resultPath.startPathCoords(s.x,s.y),this.m_bUseM){const t=this.m_resultPath.getPointCount()-1;this.m_resultPath.setAttribute(2,t,0,s.m)}}}offsetMultiPath(t){const s=f(this.m_inputGeometry,0,this.m_tolerance,0,this.m_progressTracker,12e3),e=s.querySegmentIterator();e.resetToFirstPath();let i=-1;for(;e.nextPath();)i++,this.offsetPath(s,i,t)}offsetPath(t,s,e){let i=t.getPathStart(s),n=t.getPathEnd(s);if(this.m_resultPath=e,t.isClosedPath(s)){const s=t.getXY(i);for(;n>i&&t.getXY(n-1).equals(s);)n--;if(n-i>=2){this.m_srcPtCount=n-i,this.m_srcPts.length=this.m_srcPtCount;for(let s=i;s<n;s++)this.progress(),this.m_srcPts[s-i]=g.construct(t.getXY(s),this.m_bUseZ?t.getAttributeAsDbl(1,s,0):0,this.m_bUseM?t.getAttributeAsDbl(2,s,0):0);this.buildOffset()&&this.addPart(0,this.m_offsetPtCount-1)}}else{const s=t.getXY(i);for(;i<n-1&&t.getXY(i+1).equals(s);)i++;const e=t.getXY(n-1);for(;i<n-1&&t.getXY(n-2).equals(e);)n--;if(n-i>=2){this.m_srcPtCount=2*(n-i)-2,this.m_srcPts.length=this.m_srcPtCount;let e=g.construct(s,this.m_bUseZ?t.getAttributeAsDbl(1,i,0):0,this.m_bUseM?t.getAttributeAsDbl(2,i,0):0);e.type|=b+M,this.m_srcPts[0]=e;let o=1,h=this.m_srcPtCount-1;for(let s=i+1;s<n-1;s++,o++,h--)this.progress(),e=g.construct(t.getXY(s),this.m_bUseZ?t.getAttributeAsDbl(1,s,0):0,this.m_bUseM?t.getAttributeAsDbl(2,s,0):0),this.m_srcPts[o]=e.clone(),e.type|=M,this.m_srcPts[h]=e.clone();if(e=g.construct(t.getXY(n-1),this.m_bUseZ?t.getAttributeAsDbl(1,n-1,0):0,this.m_bUseM?t.getAttributeAsDbl(2,n-1,0):0),e.type|=b,this.m_srcPts[o]=e.clone(),this.buildOffset())if(this.m_offsetPts.length>=2){let t=-1,s=-1,e=!!(this.m_offsetPts[this.m_offsetPtCount-1].type&M);e||(t=0);for(let i=1;i<this.m_offsetPtCount;i++){this.progress();const n=!!(this.m_offsetPts[i].type&M);n?e||(s=i-1,s-t+1>1&&this.addPart(t,s-t+1)):e&&(t=i-1),e=n}e||(s=this.m_offsetPtCount-1,s-t+1>1&&this.addPart(t,s-t+1))}else{const t=0,s=this.m_offsetPtCount-1;s-t>=1&&this.addPart(t,s-t+1)}}}this.m_srcPts.length=0,this.m_srcPtCount=0,this.m_offsetPts.length=0,this.m_offsetPtCount=0}static dotSign(t,s,e,i){const n=s.x-t.x,o=s.y-t.y,h=i.x-e.x,r=i.y-e.y,m=P(n,o,h,r);return u(m)}}class E{getOperatorType(){return 10108}accelerateGeometry(t,s,e){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!0}executeMany(t,s,e,i,n,o,h){return new v(t,s,e,i,n,o,h)}execute(t,s,e,i,n,o,h){return new v(null,s,e,i,n,o,h).offset(t)}}class v extends t{constructor(t,s,e,i,n,o,h){super(),this.m_progressTracker=h,this.m_index=-1,this.m_inputGeoms=t,this.m_spatialReference=s,this.m_distance=e,this.m_joins=i,this.m_miterLimit=n,this.m_flattenError=o}tock(){return!0}getRank(){return 1}next(){if(!this.m_inputGeoms)return null;let t;for(;t=this.m_inputGeoms.next();)return this.m_index=this.m_inputGeoms.getGeometryID(),this.offset(t);return null}getGeometryID(){return this.m_index}offset(t){let s;return i(t),s=this.m_flattenError<=0?e(this.m_spatialReference,t,!0).total():this.m_flattenError,l(t,this.m_distance,this.m_joins,this.m_miterLimit,s,this.m_progressTracker)}}const G=new E;function w(t,s,e,i,n,o){return G.execute(t,s,e,i,n,o,null)}function j(t,e,i,n,o,h){const r=G.executeMany(new s(t),e,i,n,o,h,null);return Array.from(r)}function D(){return G.supportsCurves()}export{w as execute,j as executeMany,D as supportsCurves};
|
|
5
|
+
import{G as t,S as s}from"../../../chunks/SimpleGeometryCursor.js";import{b as e}from"../../../chunks/Envelope.js";import{c as i,a as n,G as o,f as h,t as r}from"../../../chunks/Geometry.js";import{P as m,a,d as f}from"../../../chunks/QuadraticBezier.js";import{P as _,o as c,p as d,t as P,e as u}from"../../../chunks/Point2D.js";function l(t,s,e,o,h,r){if(null===t&&n(""),t.getDimension()<1&&n(""),h>0||n(""),i(t),0===s||t.isEmpty())return t;const m=new A(r);return m.m_bUseZ=t.hasAttribute(1),m.m_bUseM=t.hasAttribute(2),m.m_inputGeometry=t,m.m_distance=s,m.m_tolerance=h,m.m_joins=e,m.m_miterLimit=o>1?o:1,m.m_progressCounter=0,m.constructOffset()}const y=1.4142135623730951,x=.017453292519943295,p=256,b=512,M=1024;class g{static construct(t,s,e){const i=new g;return i.x=t.x,i.y=t.y,i.m_next=-1,i.m_prev=-1,i.z=s,i.m=e,i.type=0,i}clone(){const t=new g;return t.x=this.x,t.y=this.y,t.m_next=this.m_next,t.m_prev=this.m_prev,t.z=this.z,t.m=this.m,t.type=this.type,t}asPoint2D(){return new _(this.x,this.y)}}function C(){return{pt:new g,bAtExistingPt:!1}}class A{constructor(t){this.m_distance=-1,this.m_tolerance=-1,this.m_miterLimit=10,this.m_joins=0,this.m_progressCounter=0,this.m_bUseZ=!1,this.m_bUseM=!1,this.m_srcPts=[],this.m_srcPtCount=0,this.m_offsetPts=[],this.m_offsetPtCount=0,this.m_a1=0,this.m_a2=0,this.m_progressTracker=t}constructOffset(){const t=this.m_inputGeometry.getGeometryType();if(t===o.enumLine)return this.offsetLine();if(t===o.enumEnvelope)return this.offsetEnvelope();if(h(t)){const t=new m;return t.addSegment(this.m_inputGeometry,!0),this.m_inputGeometry=t,this.constructOffset()}if(t===o.enumPolyline){const t=new m;return this.offsetMultiPath(t),t}if(t===o.enumPolygon){const t=new a;return this.offsetMultiPath(t),t}r("")}offsetLine(){const t=this.m_inputGeometry,s=t.getStartXY(),e=t.getEndXY(),i=new _;i.setSub(e,s),i.normalize(),i.leftPerpendicularThis(),i.scale(this.m_distance),s.addThis(i),e.addThis(i);const n=t.clone();return n.setStartXY(s),n.setEndXY(e),n}offsetEnvelope(){const t=this.m_inputGeometry;if(this.m_distance>0&&2!==this.m_joins){const s=new a;return s.addEnvelope(t,!1),this.m_inputGeometry=s,this.constructOffset()}const s=t.clone();return s.inflateCoords(this.m_distance,this.m_distance),s}progress(){}static buildPoint(t,s,e,i){i.x=t.x+s*Math.cos(e),i.y=t.y+s*Math.sin(e),i.type=t.type,i.z=t.z,i.m=t.m,i.m_next=-1,i.m_prev=-1}addPoint(t){this.m_offsetPts.push(t.clone()),this.m_offsetPtCount++}addPointEx(t,s){if(0===this.m_offsetPtCount)return void this.addPoint(t);const e=this.m_srcPtCount,i=this.m_srcPts[0===s?e-1:s-1],n=this.m_srcPts[s],o=A.dotSign(i,n,this.m_offsetPts[this.m_offsetPtCount-1],t);if(o>0)this.addPoint(t);else if(o<0)if(A.dotSign(i,n,n,this.m_offsetPts[this.m_offsetPtCount-1])>0){const n=new g;let o;o=0===s?e-2:1===s?e-1:s-2;const h=this.m_srcPts[o],r=Math.atan2(i.y-h.y,i.x-h.x);if(A.buildPoint(i,this.m_distance,r-c,n),this.m_offsetPts[this.m_offsetPtCount-1]=n,1===this.m_joins||2===this.m_joins){n.x=.5*(n.x+i.x),n.y=.5*(n.y+i.y),this.addPoint(n),A.buildPoint(i,this.m_distance,this.m_a1+c,n);const t=n.clone();t.x=.5*(t.x+i.x),t.y=.5*(t.y+i.y),t.type|=p,this.addPoint(t),this.addPoint(n)}else A.buildPoint(i,this.m_distance,this.m_a1+c,n),n.type|=p,this.addPoint(n);this.addPointEx(t,s)}else{const t=new g;if(A.buildPoint(n,this.m_distance,this.m_a1+c,t),this.addPoint(t),1===this.m_joins||2===this.m_joins){t.x=.5*(t.x+n.x),t.y=.5*(t.y+n.y),this.addPoint(t),A.buildPoint(n,this.m_distance,this.m_a2-c,t);const s=t.clone();s.x=.5*(s.x+n.x),s.y=.5*(s.y+n.y),s.type|=p,this.addPoint(s),this.addPoint(t)}else A.buildPoint(n,this.m_distance,this.m_a2-c,t),t.type|=p,this.addPoint(t)}}buildOffset(){const t=new g,s=this.m_srcPtCount;this.m_offsetPtCount=0;const e=.5*this.m_tolerance;let i=0,n=0;for(let o=0;o<s;o++){const h=this.m_srcPts[o],r=0===o?this.m_srcPts[s-1]:this.m_srcPts[o-1],m=o===s-1?this.m_srcPts[0]:this.m_srcPts[o+1];let a,f,P=0;{const t=r.x-h.x,s=r.y-h.y,e=m.x-h.x,c=m.y-h.y;a=Math.atan2(s,t),f=Math.atan2(c,e),this.m_a1=a,this.m_a2=f,0===o&&(i=a,n=f),P=_.orientationRobust(h.asPoint2D(),r.asPoint2D(),m.asPoint2D())}const u=f;if(f<a&&(f+=d),P*this.m_distance>0)if(1===this.m_joins||2===this.m_joins){A.buildPoint(h,this.m_distance,a+c,t),this.addPoint(t);const s=.001;t.x=h.x+(t.x-h.x)*s,t.y=h.y+(t.y-h.y)*s,this.addPoint(t),A.buildPoint(h,this.m_distance,f-c,t);const e=t.clone();e.x=h.x+(e.x-h.x)*s,e.y=h.y+(e.y-h.y)*s,e.type|=p,this.addPoint(e),this.addPoint(t)}else{const s=.5*(f-a),e=0===s?this.m_distance:this.m_distance/Math.abs(Math.sin(s));A.buildPoint(h,e,.5*(a+f),t),this.addPointEx(t,o)}else if(h.type&b){const s=1-e/Math.abs(this.m_distance);let i=1,n=this.m_distance<0?-Math.PI:Math.PI;if(s>-1&&s<1){let t=2*Math.acos(s);t<x&&(t=x),i=Math.trunc(Math.PI/t+1.5),i>1&&(n/=i)}i<=1&&(i=2,n/=2);let r=a+c;A.buildPoint(h,this.m_distance,r,t),0===o&&(t.type|=M),this.addPointEx(t,o);const m=this.m_distance/Math.cos(n/2);for(r+=n/2,A.buildPoint(h,m,r,t),t.type|=M,this.addPoint(t);--i>0;)r+=n,A.buildPoint(h,m,r,t),t.type|=M,this.addPoint(t);A.buildPoint(h,this.m_distance,f-c,t),t.type|=M,this.addPoint(t)}else if(1!==this.m_joins)if(0!==this.m_joins)if(2!==this.m_joins){let s;if(f=u,this.m_distance>0?(f>a&&(f-=d),s=a-f<c):(f<a&&(f+=d),s=f-a<c),s){const s=this.m_distance*y;let e;e=s<0?a+.25*Math.PI:a+3*Math.PI*.25,A.buildPoint(h,s,e,t),this.addPointEx(t,o),e=s<0?f-.25*Math.PI:f-3*Math.PI*.25,A.buildPoint(h,s,e,t),this.addPoint(t)}else{const s=.5*(f-a),e=this.m_distance/Math.abs(Math.sin(s));f<a&&(f+=d),A.buildPoint(h,e,(a+f)/2,t),this.addPointEx(t,o)}}else{const s=r.x-h.x,e=r.y-h.y,i=m.x-h.x,n=m.y-h.y,c=(s*i+e*n)/Math.sqrt(s*s+e*e)/Math.sqrt(i*i+n*n);if(c>1-1e-8){A.buildPoint(h,y*this.m_distance,f-.25*Math.PI,t),this.addPointEx(t,o),A.buildPoint(h,y*this.m_distance,f+.25*Math.PI,t),this.addPoint(t);continue}const d=Math.abs(this.m_distance/Math.sin(.5*Math.acos(c))),P=Math.abs(this.m_miterLimit*this.m_distance);if(d>P){const s=.5*(f-a),e=this.m_distance/Math.abs(Math.sin(s));A.buildPoint(h,e,.5*(a+f),t);const i=_.construct(t.x,t.y),n=_.construct(h.x,h.y),r=new _;r.setSub(i,n);const m=new _;m.setScaleAdd(P/r.length(),r,n);const c=Math.sqrt(d*d-this.m_distance*this.m_distance),u=(d-P)*Math.abs(this.m_distance)/c;this.m_distance>0?r.leftPerpendicularThis():r.rightPerpendicularThis(),r.scale(u/r.length());const l=new _;l.setAdd(m,r);const y=new _;y.setSub(m,r),t.x=l.x,t.y=l.y,this.addPointEx(t,o),t.x=y.x,t.y=y.y,this.addPoint(t);continue}const u=.5*(f-a),l=this.m_distance/Math.abs(Math.sin(u));A.buildPoint(h,l,.5*(a+f),t),this.addPointEx(t,o)}else{const s=1-e/Math.abs(this.m_distance);let i=1,n=f-c-(a+c);if(s>-1&&s<1){let t=2*Math.acos(s);t<x&&(t=x),i=Math.trunc(Math.abs(n)/t+1.5),i>1&&(n/=i)}const r=this.m_distance/Math.cos(.5*n);let m=a+c+.5*n;for(A.buildPoint(h,r,m,t),this.addPointEx(t,o);--i>0;)m+=n,A.buildPoint(h,r,m,t),this.addPoint(t)}else A.buildPoint(h,this.m_distance,a+c,t),this.addPointEx(t,o),A.buildPoint(h,this.m_distance,f-c,t),this.addPoint(t)}return this.m_a1=i,this.m_a2=n,this.addPointEx(this.m_offsetPts[0],0),this.m_offsetPts[0]=this.m_offsetPts[this.m_offsetPtCount-1].clone(),this.removeBadSegsFast()}removeBadSegsFast(){let t=!1;for(let e=0;e<this.m_offsetPtCount;e++){const t=this.m_offsetPts[e];t.m_next=e+1,t.m_prev=e-1}this.m_offsetPts[0].m_prev=this.m_offsetPtCount-2,this.m_offsetPts[this.m_offsetPtCount-2].m_next=0;let s=0;for(let e=0;e<this.m_offsetPtCount;e++)if(this.m_offsetPts[s].type&p){const e=this.deleteClosedSeg(s);if(-1===e){t=!0;break}s=e}else s=this.m_offsetPts[s].m_next;return!t&&(this.compressOffsetArray(s),!0)}deleteClosedSeg(t){const s=this.m_offsetPtCount-1;let e,i,n=t;for(let o=1;o<=s-2;o++){n=this.m_offsetPts[n].m_next,e=n,i=t;for(let t=1;t<=o;t++){if(i=this.m_offsetPts[i].m_prev,0===(this.m_offsetPts[i].type&p)&&0===(this.m_offsetPts[e].type&p)){const t=this.handleClosedIntersection(i,e);if(-1!==t)return t}e=this.m_offsetPts[e].m_prev}}return-1}handleClosedIntersection(t,s){const e=this.m_offsetPts[this.m_offsetPts[t].m_prev],i=this.m_offsetPts[t],n=this.m_offsetPts[this.m_offsetPts[s].m_prev],o=this.m_offsetPts[s];if(!this.sectGraphicRect(e,i,n,o))return-1;const h=C();if(((i.x-e.x)*(o.y-n.y)-(i.y-e.y)*(o.x-n.x))*this.m_distance<0){if(this.findIntersection(e,i,n,o,h)&&!h.bAtExistingPt){const r=1e-8,m=Math.sqrt((i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y)),a=(i.x-e.x)/m,f=(i.y-e.y)/m,_=Math.sqrt((o.x-n.x)*(o.x-n.x)+(o.y-n.y)*(o.y-n.y)),c=(o.x-n.x)/_,d=(o.y-n.y)/_;let P=!1;const u=h.pt.clone();u.x+=(a+c)*r,u.y+=(f+d)*r;let l=n,y=h.pt,x=this.m_offsetPts[t].m_prev;for(;y.y>u.y!=l.y>u.y&&u.x<(l.x-y.x)*(u.y-y.y)/(l.y-y.y)+y.x&&(P=!P),l=y,x=this.m_offsetPts[x].m_next,x!==s;)y=this.m_offsetPts[x];if(P)return-1;const p=this.m_offsetPts[t].m_prev;return h.pt.type=i.type,h.pt.m_next=s,h.pt.m_prev=p,this.m_offsetPts[t]=h.pt,this.m_offsetPts[s].m_prev=t,s}}return-1}sectGraphicRect(t,s,e,i){return Math.max(t.x,s.x)>=Math.min(e.x,i.x)&&Math.max(e.x,i.x)>=Math.min(t.x,s.x)&&Math.max(t.y,s.y)>=Math.min(e.y,i.y)&&Math.max(e.y,i.y)>=Math.min(t.y,s.y)}findIntersection(t,s,e,i,n){let o,h,r,m;return n.bAtExistingPt=!1,o=(s.y-t.y)*(i.x-e.x)-(s.x-t.x)*(i.y-e.y),h=(e.y-t.y)*(s.x-t.x)-(e.x-t.x)*(s.y-t.y),r=0===o?2:h/o,r>=0&&r<=1&&(m=r,o=(i.y-e.y)*(s.x-t.x)-(i.x-e.x)*(s.y-t.y),h=(t.y-e.y)*(i.x-e.x)-(t.x-e.x)*(i.y-e.y),r=0===o?2:h/o,r>=0&&r<=1)&&(n.pt.x=t.x+r*(s.x-t.x),n.pt.y=t.y+r*(s.y-t.y),this.m_bUseZ&&(n.pt.z=e.z+m*(i.z-e.z)),this.m_bUseM&&(n.pt.m=e.m+m*(i.m-e.m)),0!==m&&1!==m||0!==r&&1!==r||(n.bAtExistingPt=!0),!((0===m||1===m)&&r>0&&r<1||(0===r||1===r)&&m>0&&m<1))}compressOffsetArray(t){for(;this.m_offsetPts[t].m_prev<t;)t=this.m_offsetPts[t].m_prev;let s=0,e=t;do{const t=this.m_offsetPts[e].clone();this.m_offsetPts[s]=t,e=t.m_next,s++}while(e!==t);this.m_offsetPts[s]=this.m_offsetPts[0].clone(),this.m_offsetPtCount=s+1}addPart(t,s){if(!(s<2))for(let e=0;e<s;e++){const s=this.m_offsetPts[t+e];if(e?this.m_bUseZ?this.m_resultPath.lineTo3DCoords(s.x,s.y,s.z):this.m_resultPath.lineToCoords(s.x,s.y):this.m_bUseZ?this.m_resultPath.startPath3DCoords(s.x,s.y,s.z):this.m_resultPath.startPathCoords(s.x,s.y),this.m_bUseM){const t=this.m_resultPath.getPointCount()-1;this.m_resultPath.setAttribute(2,t,0,s.m)}}}offsetMultiPath(t){const s=f(this.m_inputGeometry,0,this.m_tolerance,0,this.m_progressTracker,12e3),e=s.querySegmentIterator();e.resetToFirstPath();let i=-1;for(;e.nextPath();)i++,this.offsetPath(s,i,t)}offsetPath(t,s,e){let i=t.getPathStart(s),n=t.getPathEnd(s);if(this.m_resultPath=e,t.isClosedPath(s)){const s=t.getXY(i);for(;n>i&&t.getXY(n-1).equals(s);)n--;if(n-i>=2){this.m_srcPtCount=n-i,this.m_srcPts.length=this.m_srcPtCount;for(let s=i;s<n;s++)this.progress(),this.m_srcPts[s-i]=g.construct(t.getXY(s),this.m_bUseZ?t.getAttributeAsDbl(1,s,0):0,this.m_bUseM?t.getAttributeAsDbl(2,s,0):0);this.buildOffset()&&this.addPart(0,this.m_offsetPtCount-1)}}else{const s=t.getXY(i);for(;i<n-1&&t.getXY(i+1).equals(s);)i++;const e=t.getXY(n-1);for(;i<n-1&&t.getXY(n-2).equals(e);)n--;if(n-i>=2){this.m_srcPtCount=2*(n-i)-2,this.m_srcPts.length=this.m_srcPtCount;let e=g.construct(s,this.m_bUseZ?t.getAttributeAsDbl(1,i,0):0,this.m_bUseM?t.getAttributeAsDbl(2,i,0):0);e.type|=b+M,this.m_srcPts[0]=e;let o=1,h=this.m_srcPtCount-1;for(let s=i+1;s<n-1;s++,o++,h--)this.progress(),e=g.construct(t.getXY(s),this.m_bUseZ?t.getAttributeAsDbl(1,s,0):0,this.m_bUseM?t.getAttributeAsDbl(2,s,0):0),this.m_srcPts[o]=e.clone(),e.type|=M,this.m_srcPts[h]=e.clone();if(e=g.construct(t.getXY(n-1),this.m_bUseZ?t.getAttributeAsDbl(1,n-1,0):0,this.m_bUseM?t.getAttributeAsDbl(2,n-1,0):0),e.type|=b,this.m_srcPts[o]=e.clone(),this.buildOffset())if(this.m_offsetPts.length>=2){let t=-1,s=-1,e=0!==(this.m_offsetPts[this.m_offsetPtCount-1].type&M);e||(t=0);for(let i=1;i<this.m_offsetPtCount;i++){this.progress();const n=0!==(this.m_offsetPts[i].type&M);n?e||(s=i-1,s-t+1>1&&this.addPart(t,s-t+1)):e&&(t=i-1),e=n}e||(s=this.m_offsetPtCount-1,s-t+1>1&&this.addPart(t,s-t+1))}else{const t=0,s=this.m_offsetPtCount-1;s-t>=1&&this.addPart(t,s-t+1)}}}this.m_srcPts.length=0,this.m_srcPtCount=0,this.m_offsetPts.length=0,this.m_offsetPtCount=0}static dotSign(t,s,e,i){const n=s.x-t.x,o=s.y-t.y,h=i.x-e.x,r=i.y-e.y,m=P(n,o,h,r);return u(m)}}class E{getOperatorType(){return 10108}accelerateGeometry(t,s,e){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!0}executeMany(t,s,e,i,n,o,h){return new v(t,s,e,i,n,o,h)}execute(t,s,e,i,n,o,h){return new v(null,s,e,i,n,o,h).offset(t)}}class v extends t{constructor(t,s,e,i,n,o,h){super(),this.m_progressTracker=h,this.m_index=-1,this.m_inputGeoms=t,this.m_spatialReference=s,this.m_distance=e,this.m_joins=i,this.m_miterLimit=n,this.m_flattenError=o}tock(){return!0}getRank(){return 1}next(){if(!this.m_inputGeoms)return null;let t;for(;t=this.m_inputGeoms.next();)return this.m_index=this.m_inputGeoms.getGeometryID(),this.offset(t);return null}getGeometryID(){return this.m_index}offset(t){let s;return i(t),s=this.m_flattenError<=0?e(this.m_spatialReference,t,!0).total():this.m_flattenError,l(t,this.m_distance,this.m_joins,this.m_miterLimit,s,this.m_progressTracker)}}const G=new E;function w(t,s,e,i,n,o){return G.execute(t,s,e,i,n,o,null)}function j(t,e,i,n,o,h){const r=G.executeMany(new s(t),e,i,n,o,h,null);return Array.from(r)}function D(){return G.supportsCurves()}export{w as execute,j as executeMany,D as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{O as t,S as e}from"../../../chunks/SimpleGeometryCursor.js";import{a as s,c as i,G as r,g as h}from"../../../chunks/Geometry.js";import{Envelope2D as n}from"../../../chunks/Envelope2D.js";import{c as o}from"../../../chunks/Envelope.js";import{E as a,k as m,n as p}from"../../../chunks/QuadraticBezier.js";import{C as _,
|
|
5
|
+
import{O as t,S as e}from"../../../chunks/SimpleGeometryCursor.js";import{a as s,c as i,G as r,g as h}from"../../../chunks/Geometry.js";import{Envelope2D as n}from"../../../chunks/Envelope2D.js";import{c as o}from"../../../chunks/Envelope.js";import{E as a,k as m,n as p}from"../../../chunks/QuadraticBezier.js";import{C as _,m as c,l as u,ar as l,n as g,ap as d,aq as G,an as C,at as y,au as I,av as x}from"../../../chunks/ProjectionTransformation.js";import{v as f}from"../../../chunks/Point2D.js";function k(t){t&&t.checkProgress()}class v{getOperatorType(){return 10012}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!0}executeMany(t,e,s,i){return new S(t,e,s,i)}}class S extends t{constructor(t,e,i,r){super(),this.m_shape=null,this.m_topoGraph=null,this.m_curveStitcher=null,this.m_stitchMaxDeviation=0,this.m_chainStack=[],this.m_bitsetToChains=null,this.m_chainsLists=null,this.m_visitedChainsIndex=-1,this.m_index=-1,this.m_geometryIndex=-1,this.m_progressCounter=0,this.m_currentIds=[],this.m_currentEdgeIds=[],t||s(""),this.m_progressTracker=r,this.m_options=0!==i?i:3,(this.m_options<=0||this.m_options>63)&&s("options"),this.m_inputGeometryCursor=t,this.m_sr=e}tock(){return!0}getRank(){return 1}next(){if(-1===this.m_index){this.m_shape=new a;const t=new n;t.setEmpty(),this.m_geometryIndex=this.m_shape.createGeometryUserIndex();for(let o=this.m_inputGeometryCursor.next();null!==o;o=this.m_inputGeometryCursor.next()){i(o);const e=this.m_shape.addGeometry(o);o.getGeometryType()!==r.enumPolygon&&s("Polygon Overlay only supports Polygons"),this.m_shape.setGeometryUserIndex(e,this.m_geometryIndex,this.m_inputGeometryCursor.getGeometryID());const h=this.m_inputGeometryCursor.getRank();h>m&&this.m_shape.assignRankToGeometryVertices(e,h);const a=new n;o.queryLooseEnvelope(a),t.mergeEnvelope2D(a),k(this.m_progressTracker)}this.m_inputGeometryCursor=null;const e=o(this.m_sr,t,!0),h=o(this.m_sr,t,!1);t.inflate(10*e.total()),this.m_shape.forceSetEnvelope2D(t),this.m_stitchMaxDeviation=0;let x=0;if(this.m_shape.hasCurves()){this.m_curveStitcher=new _;const s=c(e.total(),t);this.m_stitchMaxDeviation=u(e.total()),x=l(s,this.m_stitchMaxDeviation),g(this.m_shape,s,e.total(),12e3,this.m_curveStitcher,null,this.m_progressTracker)}if(d(this.m_shape,h,this.m_progressTracker)){G(this.m_shape,e.add(x),this.m_progressTracker,!0,!1);for(let t=this.m_shape.getFirstGeometry();t!==p;t=this.m_shape.getNextGeometry(t))this.m_shape.getGeometryType(t)===r.enumPolygon&&C(this.m_shape,t,-1,!1,p,this.m_progressTracker)}this.m_topoGraph=new y,this.m_topoGraph.buildGeometryParentageSets(),this.m_topoGraph.setEditShape(this.m_shape,this.m_progressTracker);const f=this.m_topoGraph.getFirstChain();for(let s=this.m_topoGraph.getChainFirstIsland(f);s!==p;s=this.m_topoGraph.getChainNextInParent(s))for(let t=this.m_topoGraph.getChainFirstIsland(s);t!==p;t=this.m_topoGraph.getChainNextInParent(t))this.m_chainStack.push(t);if(16&this.m_options){this.m_visitedChainsIndex=this.m_topoGraph.createUserIndexForChains(),this.m_bitsetToChains=new Map,this.m_chainsLists=new I;const t=[],e=this.m_topoGraph.getFirstChain();for(t.push(e);t.length>0;){const e=t.at(-1);t.pop();for(let s=this.m_topoGraph.getChainFirstIsland(e);s!==p;s=this.m_topoGraph.getChainNextInParent(s))for(let e=this.m_topoGraph.getChainFirstIsland(s);e!==p;e=this.m_topoGraph.getChainNextInParent(e)){const s=this.m_topoGraph.getChainBitSet(e);if(null!==s&&!s.isZero()){let t;this.m_bitsetToChains.has(s)?t=this.m_bitsetToChains.get(s):(t=this.m_chainsLists.createList(),this.m_bitsetToChains.set(s,t)),this.m_chainsLists.addElement(t,e)}t.push(e)}}}}return this.makeNextGeometry()}getGeometryID(){return this.m_index}getGeometryIDs(){return this.m_currentIds.slice()}getBoundaryIDs(){return this.m_currentEdgeIds.slice()}buildIdsFromBitset(t,e){if(!t)return;const s=this.m_topoGraph.getGeometriesFromBits(t);if(s.length>0){for(let t=0,i=s.length;t<i;t++)e.push(this.m_shape.getGeometryUserIndex(s[t],this.m_geometryIndex));f(e)}}makeGeometryFromChainSinglePart(t){this.m_index++;const e=new a;null!==this.m_curveStitcher&&e.setCurveStitcherPointer(this.m_curveStitcher);const s=this.m_topoGraph.extractPolygonFromChainAndIslands(e,p,t,p);return null!==this.m_curveStitcher&&this.m_curveStitcher.stitchCurves(e,s,this.m_stitchMaxDeviation,!1),e.getGeometry(s)}makeGeometryFromChainMultiPart(t,e){this.m_index++;const s=new a;null!==this.m_curveStitcher&&s.setCurveStitcherPointer(this.m_curveStitcher);const i=this.m_bitsetToChains.has(e);h(i);const r=this.m_bitsetToChains.get(e);let n=p;for(let h=this.m_chainsLists.getFirst(r);h!==I.st_nullNode();h=this.m_chainsLists.getNext(h)){const t=this.m_chainsLists.getElement(h);n=this.m_topoGraph.extractPolygonFromChainAndIslands(s,n,t,p),this.m_topoGraph.setChainUserIndex(t,this.m_visitedChainsIndex,1)}return null!==this.m_curveStitcher&&this.m_curveStitcher.stitchCurves(s,n,this.m_stitchMaxDeviation,!1),s.getGeometry(n)}makeNextGeometry(){for(k(this.m_progressTracker);this.m_chainStack.length>0;){this.m_currentIds.length=0,this.m_currentEdgeIds.length=0;const t=this.m_chainStack.at(-1);this.m_chainStack.pop();const e=this.m_topoGraph.getChainArea(t);if(0!==e)if(e<0)for(let s=this.m_topoGraph.getChainFirstIsland(t);s!==p;s=this.m_topoGraph.getChainNextInParent(s))this.m_topoGraph.getChainArea(s)>0&&this.m_chainStack.push(s);else{for(let i=this.m_topoGraph.getChainFirstIsland(t);i!==p;i=this.m_topoGraph.getChainNextInParent(i))this.m_topoGraph.getChainArea(i)<0&&this.m_chainStack.push(i);if(-1!==this.m_visitedChainsIndex&&1===this.m_topoGraph.getChainUserIndex(t,this.m_visitedChainsIndex))continue;const e=t=>{const e=t.getUnorderedBitIterator();let s=0;for(;e.next()!==x.npos();)if(s++,s>1)return s;return s},s=e(this.m_topoGraph.getChainBitSet(t));if(s>0){if(1===s&&2&this.m_options||s>1&&1&this.m_options){const e=this.m_topoGraph.getChainBitSet(t);return this.buildIdsFromBitset(e,this.m_currentIds),16&this.m_options?this.makeGeometryFromChainMultiPart(t,e):this.makeGeometryFromChainSinglePart(t)}}else{if(!(12&~this.m_options)){if(32&this.m_options){const e=this.m_topoGraph.getChainBoundaryBitSet(t);this.buildIdsFromBitset(e,this.m_currentEdgeIds)}return this.makeGeometryFromChainSinglePart(t)}if(4&this.m_options){const s=this.m_topoGraph.getChainBoundaryBitSet(t);if(e(s)>1)return 32&this.m_options&&this.buildIdsFromBitset(s,this.m_currentEdgeIds),this.makeGeometryFromChainSinglePart(t);continue}if(8&this.m_options){const s=this.m_topoGraph.getChainBoundaryBitSet(t);if(1===e(s))return 32&this.m_options&&this.buildIdsFromBitset(s,this.m_currentEdgeIds),this.makeGeometryFromChainSinglePart(t);continue}}}}return null}}const F=new v;function P(t,s,i){return F.executeMany(new e(t),s,i,null)}function T(){return F.supportsCurves()}export{P as executeMany,T as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{G as t,S as e}from"../../../chunks/SimpleGeometryCursor.js";import{a as s,g as r}from"../../../chunks/Geometry.js";import{Envelope2D as n}from"../../../chunks/Envelope2D.js";import{T as i}from"../../../chunks/Transformation2D.js";import{l as o,q as a,o as u,p as l,P as h,t as m,E as c,n as p,a as _,u as g}from"../../../chunks/QuadraticBezier.js";import{K as f,k as y,E as d,m as x,P as T,c as A,q as E}from"../../../chunks/Point2D.js";import{P as v,b as N}from"../../../chunks/Envelope.js";import{O as S}from"../../../chunks/OperatorClip.js";import{O as w}from"../../../chunks/OperatorMultiPartToSinglePart.js";import{O as C}from"../../../chunks/OperatorCut.js";function k(t,e,s,r,n){return new j(n).findSlicesByArea(t,e,s,r)}function X(t,e,s,r,n){return new j(n).sliceIntoStrips(t,e,s,r)}function H(t,e,s,r){return new j(r).recursiveSliceEqualArea(t,e,s)}function P(t){this.currentX=this.calcX(t)}function b(t){if(null===this.curve){const e=(t-this.y0)/(this.y1-this.y0);return E(this.x0,this.x1,e)}return this.curve.intersectionOfYMonotonicWithAxisX(t,this.x0)}function Y(){return{x0:Number.NaN,y0:Number.NaN,x1:Number.NaN,y1:Number.NaN,currentX:Number.NaN,nextAET:null,prevAET:null,startNodeNext:null,nextInChain:null,curve:null,advance:P,calcX:b}}function I(t,e){const s=Y();return s.x0=t.getStartX(),s.y0=t.getStartY(),s.x1=t.getEndX(),s.y1=t.getEndY(),e&&(s.y0=A(s.x0,s.x0=s.y0),s.y1=A(s.x1,s.x1=s.y1)),s.y1<s.y0&&(s.y1=A(s.y0,s.y0=s.y1),s.x1=A(s.x0,s.x0=s.x1)),s.currentX=Number.NaN,s.nextAET=null,s.prevAET=null,s.startNodeNext=null,s.nextInChain=null,s.curve=null,s}function O(t){const e=Y();return e.x0=t.getStartX(),e.y0=t.getStartY(),e.x1=t.getEndX(),e.y1=t.getEndY(),e.curve=t,e.y1<e.y0&&(e.y1=A(e.y0,e.y0=e.y1),e.x1=A(e.x0,e.x0=e.x1)),e.currentX=Number.NaN,e.nextAET=null,e.prevAET=null,e.startNodeNext=null,e.nextInChain=null,e}function q(t){if(this.x===t.x&&this.y===t.y){const e=null!==this.endEdge,s=null!==t.startEdge;return e&&s?-1:1}return this.y!==t.y?this.y-t.y:this.x-t.x}function R(){return{x:Number.NaN,y:Number.NaN,startEdge:null,endEdge:null,compare:q}}function D(t,e){return{y:t,startingEdges:e}}class M{constructor(t,e,s,r,n,i){this.m_parent=t,this.m_y0=e,this.m_y1=s,this.m_t0=r,this.m_area=i}getMaxDerivative(){return 1}getValue(t,e){return 1===t?0:this.getArea(e)-this.m_area}getError(t){return r(0),0}getArea(t){const e=.5*(this.m_parent.m_sumBase-this.m_parent.m_sumA),s=this.m_y1-this.m_y0;let r=(this.m_parent.m_sumBase-e*(t+this.m_t0))*s*(t-this.m_t0),n=!1;for(let i=this.m_parent.m_AETHead;null!==i;i=i.nextAET)if(n=!n,n&&(null!==i.curve||null!==i.nextAET.curve)){const e=this.m_y0+s*this.m_t0,n=this.m_y0+s*t;i.curve&&(r+=V(i.curve,this.m_y0+s*this.m_t0,this.m_y0+s*t)),i.nextAET.curve&&(r-=V(i.nextAET.curve,this.m_y0+s*this.m_t0,this.m_y0+s*t));r+=(n-e)*(i.nextAET.calcX(e)-i.calcX(e)+(i.nextAET.calcX(n)-i.calcX(n)))*.5}return r}}function B(t,e,s){return{polygon:t,from:e,to:s}}function V(t,e,s){const n=[0,0],i=t.intersectionWithAxis2D(!0,e,null,n);r(1===i);const o=n[0],a=t.intersectionWithAxis2D(!0,s,null,n);r(1===a);const u=n[0],l=x(T,4);g(t,l,!0);const h=l[3],m=l[2],c=l[1],p=t.getCoordX(o)-t.getStartX(),_=t.getCoordY(o)-t.getStartY(),f=t=>{const e=t*t;return e*t*(10*(m.x*c.y-m.y*c.x)-15*t*(h.y*c.x-h.x*c.y)+6*e*(m.y*h.x-h.y*m.x))/60},y=t=>(-t*(c.y+t*(m.y+h.y*t))*p+t*(c.x+t*(m.x+h.x*t))*_)/2;return f(u)-f(o)-(y(u)-y(o))}class z extends t{constructor(t){super(),this.m_geoms=[],this.m_index=-1,this.m_id=-1,this.m_geoms=t}tock(){return!0}getRank(){return 1}next(){return this.m_index++,this.m_index>=this.m_geoms.length?null:(this.m_id=this.m_geoms[this.m_index].second,this.m_geoms[this.m_index].first)}getGeometryID(){return this.m_id}}class j{constructor(t){this.m_edges=[],this.m_curves=[],this.m_sortedNodes=[],this.m_sortHelper=[],this.m_cuts=[],this.m_cutAreas=[],this.m_totalAreaOfTraps=new f(0),this.m_areaTracking=0,this.m_splitArea=0,this.m_sumBase=0,this.m_sumA=0,this.m_numberOfCuts=0,this.m_currentScan=0,this.m_progressCounter=0,this.m_AETHead=null,this.m_bHorizontalSweep=!1,this.m_bPolygonHasCurves=!1,this.m_progressTracker=t}findSlicesByArea(t,e,r,n){n<0&&s("remainingArea");let i=t,a=null;i.hasNonLinearSegments()&&(this.m_bPolygonHasCurves=!0,a=o(t,1e-16,!0),G(a),i=a);const u=Math.abs(i.calculateArea2D());return 0===u||0===r||n>=u||1===r&&0===n?[]:(this.m_splitArea=(u-n)/r,this.m_numberOfCuts=r-1,n>0&&this.m_numberOfCuts++,this.m_edges.length=0,this.m_sortedNodes.length=0,this.m_cuts.length=0,this.m_areaTracking=0,this.m_totalAreaOfTraps.reset(),this.m_curves.length=0,this.buildEdges(i),this.buildScanNodes(),this.trapezoidation(),this.m_cuts)}sliceIntoStrips(t,s,r,i){if(0===i)return new e([t]);const o=new n;t.queryLooseEnvelope(o);const a=o.width()+o.height();return new z(this.splitPolygon(t,s,o.xmin-a-1+1,o.xmax+a+1,r,i))}recursiveSliceEqualArea(t,s,o){if(o<=1||t.isEmpty())return new e([t]);{const e=[],a=[];a.push(y(t.clone(),o));let u=0,l=0;for(;a.length>0;){r(l++<2*o);const t=a.at(-1);if(a.pop(),1===t.second){e.push(y(t.first,u++));continue}const h=new n;t.first.queryEnvelope(h);const m=h.width()+h.height(),c=new i;c.setIdentity(),h.width()>h.height()&&(c.setRotateCcw90(),t.first.applyTransformation(c),c.transformEnvInPlace(h));const p=t.first.calculateArea2D(),_=p/t.second,g=p-Math.trunc(t.second/2)*_,f=new j(this.m_progressTracker).findSlicesByArea(t.first,s,1,g),d=new j(this.m_progressTracker).splitPolygon(t.first,s,h.xmin-m-1+1,h.xmax+m+1,f,1),x=d.length;if(r(x>0&&x<=2),!c.isIdentity()){const t=new i;t.setRotateCw90(),d[0].first.applyTransformation(t),2===x&&d[1].first.applyTransformation(t)}2===x?(a.push(y(d[1].first,t.second-Math.trunc(t.second/2))),a.push(y(d[0].first,Math.trunc(t.second/2)))):a.push(y(d[0].first,t.second))}return new z(e)}}recursiveSliceEqualAreaImpl(t,e,s,n){return r(0),{}}processTraps(t,e,s){s?this.processTrapsCurves(t,e):this.processTrapsLinear(t,e)}processTrapsLinear(t,e){let s=0,r=1;const n=.5*(this.m_sumBase-this.m_sumA),i=e-t,o=(this.m_sumBase-n*(r+s))*i*(r-s);if(o+this.m_areaTracking<this.m_splitArea)return this.m_totalAreaOfTraps.pe(o),void(this.m_areaTracking+=o);const u=new f(o),l=new d(0,1);let h=!1;for(;s<1;){const e=this.m_splitArea-this.m_areaTracking,m=[Number.NaN,Number.NaN];if(!(a(-n*i,this.m_sumBase*i,(n*s-this.m_sumBase)*i*s-e,l,!1,m)>0)){h?this.m_areaTracking=u.getResult():this.m_areaTracking+=o;break}{h=!0,r=m[0],this.m_areaTracking=0,s=r,u.me(e);const n=r*i+t;if(this.m_cuts.push(n),this.m_cutAreas.push(this.m_totalAreaOfTraps.getResult()+o-u.getResult()),this.m_cuts.length===this.m_numberOfCuts)return void this.m_totalAreaOfTraps.pe(o-u.getResult())}}this.m_totalAreaOfTraps.pe(o)}processTrapsCurves(t,e){let s=0,r=1;const n=new M(this,t,e,0,1,0).getArea(1);if(n+this.m_areaTracking<this.m_splitArea)return this.m_totalAreaOfTraps.pe(n),void(this.m_areaTracking+=n);const i=e-t,o=new f(n);let a=!1;for(;s<1;){const l=this.m_splitArea-this.m_areaTracking,h=new M(this,t,e,s,1,l),m=[0],c=new d(s,1);if(!(u(h,c,1,m)>0)){a?this.m_areaTracking=o.getResult():this.m_areaTracking+=n;break}{a=!0,r=m[0],this.m_areaTracking=0,s=r,o.me(l);const e=r*i+t;if(this.m_cuts.push(e),this.m_cutAreas.push(this.m_totalAreaOfTraps.getResult()+n-o.getResult()),this.m_cuts.length===this.m_numberOfCuts)return void this.m_totalAreaOfTraps.pe(n-o.getResult())}}this.m_totalAreaOfTraps.pe(n)}advanceAET(){const t=this.m_sortedNodes[this.m_currentScan-1].y,e=this.m_sortedNodes[this.m_currentScan];let s=!1,r=!1;const n=new f(0);for(let a=this.m_AETHead;null!==a;a=a.nextAET){const t=a.prevAET;s=!s,null!==a.nextAET&&s&&(this.m_bPolygonHasCurves&&(a.curve||a.nextAET.curve)||n.pe(a.nextAET.currentX-a.currentX)),a.advance(e.y),null!==t&&a.currentX<t.currentX&&(r=!0)}this.m_sumBase=n.getResult(),r&&this.sortAET();const i=new f(0);s=!1;let o=!1;for(let a=this.m_AETHead;null!==a;a=a.nextAET){o=o||null!==a.curve;s=!s,null!==a.prevAET&&(s||this.m_bPolygonHasCurves&&(a.curve||a.prevAET.curve)||i.pe(a.currentX-a.prevAET.currentX))}this.m_sumA=i.getResult(),this.processTraps(t,e.y,o);for(let a=this.m_AETHead;null!=a;){const t=a.prevAET,s=a.nextAET;if(e.y===a.y1)if(a.prevAET=null,a.nextAET=null,null!==a.nextInChain){const e=a.currentX;a=a.nextInChain,a.currentX=e,a.prevAET=t,t?t.nextAET=a:this.m_AETHead=a,a.nextAET=s,s&&(s.prevAET=a)}else t?t.nextAET=s:this.m_AETHead=s,s&&(s.prevAET=t);a=s}}mergeNewEdgesToAET(){for(let r=this.m_sortedNodes[this.m_currentScan].startingEdges;null!==r;r=r.startNodeNext)Number.isNaN(r.currentX)&&(this.m_sortHelper.push(r),r.currentX=r.x0);if(!this.m_sortHelper.length)return;this.sortHelper();let t=this.m_AETHead,e=0,s=t;for(;null!==t&&e<this.m_sortHelper.length;)t.currentX>this.m_sortHelper[e].currentX?(this.m_sortHelper[e].prevAET=t.prevAET,t.prevAET?t.prevAET.nextAET=this.m_sortHelper[e]:this.m_AETHead=this.m_sortHelper[e],this.m_sortHelper[e].nextAET=t,t.prevAET=this.m_sortHelper[e],e++):(s=t,t=t.nextAET);for(;e<this.m_sortHelper.length;)this.m_sortHelper[e].prevAET=s,null!==s?s.nextAET=this.m_sortHelper[e]:this.m_AETHead=this.m_sortHelper[e],this.m_sortHelper[e].nextAET=null,s=this.m_sortHelper[e],e++;this.m_sortHelper.length=0}sortAET(){for(let e=this.m_AETHead;null!==e;e=e.nextAET)this.m_sortHelper.push(e);this.sortHelper(),this.m_AETHead=null;let t=null;for(const e of this.m_sortHelper)e.prevAET=t,t?t.nextAET=e:this.m_AETHead=e,e.nextAET=null,t=e;this.m_sortHelper.length=0}sortHelper(){this.m_sortHelper.sort(((t,e)=>t.currentX-e.currentX))}trapezoidation(){for(this.m_currentScan=0,this.mergeNewEdgesToAET(),this.m_currentScan++;this.m_currentScan<this.m_sortedNodes.length&&(this.progress(),this.advanceAET(),this.m_cuts.length!==this.m_numberOfCuts);)this.mergeNewEdgesToAET(),this.m_currentScan++}buildEdges(t){const e=t.querySegmentIterator();for(e.stripAttributes();e.nextPath();)for(;e.hasNextSegment();){const t=e.nextSegment();if(t.isCurve()){const e=t;if(l(e),this.m_bHorizontalSweep){const t=x(T,4);e.queryControlPoints(t);for(const e of t)e.y=A(e.x,e.x=e.y);e.constructPoints(t)}const s=e.getStartY(),r=e.getEndY();if(r===s)continue;r<s&&e.reverse(),this.m_curves.push(e.clone()),this.m_edges.push(O(this.m_curves.at(-1)))}else{const e=this.m_bHorizontalSweep?t.getStartX():t.getStartY();if((this.m_bHorizontalSweep?t.getEndX():t.getEndY())===e)continue;this.m_edges.push(I(t,this.m_bHorizontalSweep))}}this.m_edges.sort(((t,e)=>t.y0===e.y0?t.x0-e.x0:t.y0-e.y0))}buildScanNodes(){const t=[];for(const n of this.m_edges){const e=R();e.x=n.x0,e.y=n.y0,e.startEdge=n,e.endEdge=null,t.push(e);const s=R();s.x=n.x1,s.y=n.y1,s.startEdge=null,s.endEdge=n,t.push(s)}t.sort(((t,e)=>t.compare(e)));let e=0,s=t[e].y;this.m_sortedNodes.push(D(s,t[e].startEdge));let r=e;for(e++;e!==t.length;++e){t[e].y!==s&&(this.m_sortedNodes.push(D(t[e].y,null)),s=t[e].y);const n=t[e].startEdge;if(n){const t=this.m_sortedNodes.at(-1);n.startNodeNext=t.startingEdges,t.startingEdges=n}if(t[r].x!==t[e].x||t[r].y!==t[e].y){if(e-r==2){let e=r;e++,null!==t[r].endEdge&&null!==t[e].startEdge&&(t[r].endEdge.nextInChain=t[e].startEdge)}r=e}}}progress(){}splitPolygonLinear(t,s,i,o,a,u){const l=[];l.push([t,0,u]);const m=[],c=new h;for(c.startPathCoords(i,0),c.lineToCoords(o,0);l.length>0;){const h=l.at(-1);l.pop();const p=h[0],_=h[1],g=h[2],f=(new w).executeMany(new e([p]),s,this.m_progressTracker);for(let e=f.next();null!==e;e=f.next()){const h=e,p=new n;h.queryLooseEnvelope(p);let f=_,d=g;for(let t=_,e=g-1;t<g;++t,--e)p.ymin>=a[t]&&(f=t+1),p.ymax<=a[e]&&(d=e);if(f!==g)if(d!==_)if(f!==d)if(this.isYMonotone(h))this.splitYMonotone(m,h,s,a,f,d);else{const e=Math.trunc((f+d)/2);c.setXYCoords(0,i,a[e]),c.setXYCoords(1,o,a[e]);const _=(new C).execute(!1,h,c,null,this.m_progressTracker),g=_.next(),x=_.next(),T=_.next();if(null!==g){if(g.isEmpty()||(e===d-1?(m.push(y(g,e)),r(L(m.at(-1).first,s,t,m.at(-1).second,a,u))):l.push([g,e+1,d])),x.isEmpty()||(e===f?(m.push(y(x,e-1)),r(L(m.at(-1).first,s,t,m.at(-1).second,a,u))):l.push([x,f,e])),null!==T&&!T.isEmpty()){const t=new n;T.queryLooseEnvelope(t),t.ymin>=a[e]?l.push([T,e+1,d]):t.ymax<=a[e]?l.push([T,f,e]):l.push([T,f,d])}}else e+1===d?(a[e]-p.ymin<p.ymax-a[e]?m.push(y(h,e)):m.push(y(h,e+1)),r(L(m.at(-1).first,s,t,m.at(-1).second,a,u))):l.push([h,e+1,d])}else m.push(y(e,f-1));else m.push(y(e,_-1));else m.push(y(e,g-1))}}return m}splitPolygon(t,e,s,r,i,o){const a=new n;t.queryLooseEnvelope(a),a.inflateCoords(0,Math.max(a.width(),a.height()));const u=[],l=[];for(l.push(B(t,0,o));l.length;){const o={...l.at(-1)};if(l.pop(),o.polygon.hasNonLinearSegments()){const t=Math.trunc((o.to+o.from)/2),h=i[t],m=new n(s,a.ymin,r,h),c=(new S).execute(o.polygon,m,e,this.m_progressTracker);c.isEmpty()||(t-o.from==0?u.push(y(c,t-1)):l.push(B(c,o.from,t)));const p=new n(s,h,r,a.ymax),_=(new S).execute(o.polygon,p,e,this.m_progressTracker);_.isEmpty()||(o.to-t==1?u.push(y(_,t)):l.push(B(_,t+1,o.to)))}else{const n=this.splitPolygonLinear(t,e,s,r,i.slice(o.from),o.to-o.from);u.push(...n)}}u.sort(((t,e)=>t.second-e.second));const h=[];return m(u,((t,e)=>t.second===e.second),((t,e)=>{const s=new _;for(let r=t;r!==e;++r)s.add(u[r].first,!1);h.push(y(s,u[t].second))})),h}isYMonotone(t){if(1!==t.getPathCount())return!1;const e=t.getXY(0);let s=0,r=0;const n=new T;for(let i=1,o=t.getPointCount();i<=o;i++){t.queryXY(i===o?0:i,n);const a=n.y>e.y?1:n.y<e.y?-1:0;if(e.setCoordsPoint2D(n),s!==a&&0!==a){if(0!==s&&(r++,r>2))return!1;s=a}}return!0}splitYMonotone(t,e,s,n,i,o){const a=new c;a.addGeometry(e);const u=a.getFirstPath(a.getFirstGeometry()),l=a.getFirstVertex(u),h=new T,m=new T;let _=l,g=l;{const t=a.getXY(l);h.setCoordsPoint2D(t),m.setCoordsPoint2D(t)}let f=a.getNextVertex(l);const d=new T;for(let r=0,c=a.getPathSize(u);r<c;r++,f=a.getNextVertex(f))a.queryXY(f,d),d.compare(h)<0?(_=f,h.setCoordsPoint2D(d)):d.compare(m)>0&&(g=f,m.setCoordsPoint2D(d));let x=_,A=_,E=x,v=A,N=!1,S=!1,w=i,C=h.y,k=h.y,X=!1;for(;w<o;)if(n[w]<=h.y)w++;else{if(n[w]>=m.y)break;if(!N){const t=a.getNextVertex(x),e=a.getY(t);if(e<C)break;const s=n[w];C<=s&&e>=s?N=!0:(C=e,x=t)}if(!S){const t=a.getPrevVertex(A),e=a.getY(t);if(e<k)break;const s=n[w];k<=s&&e>=s?S=!0:(k=e,A=t)}if(N&&S){X=!0;let e=a.getXY(x);const s=a.getNextVertex(x);let i=a.getXY(s),o=p;if(i.y===e.y)o=i.x<e.x?x:s;else{const t=(n[w]-e.y)/(i.y-e.y);if(0===t)o=x;else if(1===t)o=s;else{const e=a.splitSegmentAxisAware(x,[t],1,null,-1);r(1===e),o=a.getNextVertex(x),a.getY(o)!==n[w]&&a.setXYCoords(o,a.getX(o),n[w])}}const u=a.getPrevVertex(A);e=a.getXY(u),i=a.getXY(A);let l=p;if(i.y===e.y)l=i.x<e.x?A:u;else{const t=(n[w]-e.y)/(i.y-e.y);if(0===t)l=u;else if(1===t)l=A;else{const e=a.splitSegmentAxisAware(u,[t],1,null,-1);r(1===e),l=a.getNextVertex(u),a.getY(l)!==n[w]&&a.setXYCoords(l,a.getX(l),n[w])}}t.push(y(this.extractTrapezoid(a,E,o,v,l),w-1)),E=o,v=l,x=o,A=l,C=k=n[w],N=!1,S=!1,w++}}X?t.push(y(this.extractTrapezoid(a,E,g,v,g),w-1)):t.push(y(e,w))}extractTrapezoid(t,e,s,r,n){const i=new _({vd:t.getVertexDescription()}),o=new v;let a=!0;for(let u=e;;u=t.getNextVertex(u)){const e=t.getSegment(u);if(e?i.addSegment(e,a):(t.queryPoint(u,o),a?i.startPathPoint(o):i.lineToPoint(o)),a=!1,u===s)break}s!==n&&(t.queryPoint(n,o),i.lineToPoint(o)),a=!0;for(let u=n;;u=t.getNextVertex(u)){const s=t.getSegment(u);if(s?i.addSegment(s,a):a||u===e||(t.queryPoint(u,o),i.lineToPoint(o)),a=!1,u===r)break}return i}}function G(t){return t.getImpl().ensureXYMonotoneSegments()}function L(t,e,s,r,i,o){const a=new n;t.queryEnvelope(a);const u=4*N(e,s,!0).total();return(!(r>=0)||a.ymin+u>=i[r])&&!(r+1<o&&a.ymax>i[r+1]+u)}class F{getOperatorType(){return 10011}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!0}sliceIntoStrips(t,e,s,r,n,i){return new W(0,t,e,s,n,0,i)}findSlicesByArea(t,e,s,r,n,i){if(!n||n.isIdentity())return k(t,e,s,r,i);{const o=t.clone();return o.applyTransformation(n),k(o,e,s,r,i)}}recursiveSliceEqualArea(t,e,s,r,n){return new W(1,t,e,null,r,s,n)}}class W extends t{constructor(t,e,s,r,n,i,o){super(),this.m_resultCursor=null,this.m_method=t,this.m_polygon=e,this.m_sr=s,this.m_ySplits=r?.slice()??null,this.m_transform=n,this.m_bReversePaths=n?.isReflective()??!1,this.m_inverseTransform=n?n.clone().invertThis():null,this.m_partCount=i,this.m_tracker=o}tock(){return!0}getRank(){return 1}next(){this.m_resultCursor||(this.m_method?this.recursiveSliceEqualArea():this.sliceIntoStrips());const t=this.m_resultCursor.next();return t?(this.m_inverseTransform&&!this.m_inverseTransform.isIdentity()&&(t.applyTransformation(this.m_inverseTransform),this.m_bReversePaths&&t.reverseAllPaths()),t):t}getGeometryID(){return this.m_resultCursor?this.m_resultCursor.getGeometryID():-1}sliceIntoStrips(){if(!this.m_transform||this.m_transform.isIdentity())this.m_resultCursor=X(this.m_polygon,this.m_sr,this.m_ySplits,this.m_ySplits.length,this.m_tracker);else{const t=this.m_polygon.clone();t.applyTransformation(this.m_transform),this.m_bReversePaths&&t.reverseAllPaths(),this.m_resultCursor=X(t,this.m_sr,this.m_ySplits,this.m_ySplits.length,this.m_tracker)}}recursiveSliceEqualArea(){if(!this.m_transform||this.m_transform.isIdentity())this.m_resultCursor=H(this.m_polygon,this.m_sr,this.m_partCount,this.m_tracker);else{const t=this.m_polygon.clone();t.applyTransformation(this.m_transform),this.m_bReversePaths&&t.reverseAllPaths(),this.m_resultCursor=H(t,this.m_sr,this.m_partCount,this.m_tracker)}}}const K=new F;function Q(t,e,s,r,n){return K.findSlicesByArea(t,e,s,r,n,null)}function J(t,e,s,r){const n=K.recursiveSliceEqualArea(t,e,s,r,null);return Array.from(n)}function U(t,e,s,r){const n=K.sliceIntoStrips(t,e,s,0,r,null);return Array.from(n)}function Z(){return K.supportsCurves()}export{Q as findSlicesByArea,J as recursiveSliceEqualArea,U as sliceIntoStrips,Z as supportsCurves};
|
|
5
|
+
import{G as t,S as e}from"../../../chunks/SimpleGeometryCursor.js";import{a as s,g as r}from"../../../chunks/Geometry.js";import{Envelope2D as n}from"../../../chunks/Envelope2D.js";import{T as i}from"../../../chunks/Transformation2D.js";import{l as o,q as a,o as u,p as l,P as h,t as m,E as c,n as p,a as _,u as g}from"../../../chunks/QuadraticBezier.js";import{K as f,k as y,E as d,m as x,P as T,c as A,q as E}from"../../../chunks/Point2D.js";import{P as v,b as N}from"../../../chunks/Envelope.js";import{O as S}from"../../../chunks/OperatorClip.js";import{O as w}from"../../../chunks/OperatorMultiPartToSinglePart.js";import{O as C}from"../../../chunks/OperatorCut.js";function k(t,e,s,r,n){return new j(n).findSlicesByArea(t,e,s,r)}function X(t,e,s,r,n){return new j(n).sliceIntoStrips(t,e,s,r)}function H(t,e,s,r){return new j(r).recursiveSliceEqualArea(t,e,s)}function P(t){this.currentX=this.calcX(t)}function b(t){if(null===this.curve){const e=(t-this.y0)/(this.y1-this.y0);return E(this.x0,this.x1,e)}return this.curve.intersectionOfYMonotonicWithAxisX(t,this.x0)}function Y(){return{x0:Number.NaN,y0:Number.NaN,x1:Number.NaN,y1:Number.NaN,currentX:Number.NaN,nextAET:null,prevAET:null,startNodeNext:null,nextInChain:null,curve:null,advance:P,calcX:b}}function I(t,e){const s=Y();return s.x0=t.getStartX(),s.y0=t.getStartY(),s.x1=t.getEndX(),s.y1=t.getEndY(),e&&(s.y0=A(s.x0,s.x0=s.y0),s.y1=A(s.x1,s.x1=s.y1)),s.y1<s.y0&&(s.y1=A(s.y0,s.y0=s.y1),s.x1=A(s.x0,s.x0=s.x1)),s.currentX=Number.NaN,s.nextAET=null,s.prevAET=null,s.startNodeNext=null,s.nextInChain=null,s.curve=null,s}function O(t){const e=Y();return e.x0=t.getStartX(),e.y0=t.getStartY(),e.x1=t.getEndX(),e.y1=t.getEndY(),e.curve=t,e.y1<e.y0&&(e.y1=A(e.y0,e.y0=e.y1),e.x1=A(e.x0,e.x0=e.x1)),e.currentX=Number.NaN,e.nextAET=null,e.prevAET=null,e.startNodeNext=null,e.nextInChain=null,e}function q(t){if(this.x===t.x&&this.y===t.y){const e=null!==this.endEdge,s=null!==t.startEdge;return e&&s?-1:1}return this.y!==t.y?this.y-t.y:this.x-t.x}function R(){return{x:Number.NaN,y:Number.NaN,startEdge:null,endEdge:null,compare:q}}function D(t,e){return{y:t,startingEdges:e}}class M{constructor(t,e,s,r,n,i){this.m_parent=t,this.m_y0=e,this.m_y1=s,this.m_t0=r,this.m_area=i}getMaxDerivative(){return 1}getValue(t,e){return 1===t?0:this.getArea(e)-this.m_area}getError(t){return r(0),0}getArea(t){const e=.5*(this.m_parent.m_sumBase-this.m_parent.m_sumA),s=this.m_y1-this.m_y0;let r=(this.m_parent.m_sumBase-e*(t+this.m_t0))*s*(t-this.m_t0),n=!1;for(let i=this.m_parent.m_AETHead;null!==i;i=i.nextAET)if(n=!n,n&&(null!==i.curve||null!==i.nextAET.curve)){const e=this.m_y0+s*this.m_t0,n=this.m_y0+s*t;i.curve&&(r+=V(i.curve,this.m_y0+s*this.m_t0,this.m_y0+s*t)),i.nextAET.curve&&(r-=V(i.nextAET.curve,this.m_y0+s*this.m_t0,this.m_y0+s*t));r+=(n-e)*(i.nextAET.calcX(e)-i.calcX(e)+(i.nextAET.calcX(n)-i.calcX(n)))*.5}return r}}function B(t,e,s){return{polygon:t,from:e,to:s}}function V(t,e,s){const n=[0,0],i=t.intersectionWithAxis2D(!0,e,null,n);r(1===i);const o=n[0],a=t.intersectionWithAxis2D(!0,s,null,n);r(1===a);const u=n[0],l=x(T,4);g(t,l,!0);const h=l[3],m=l[2],c=l[1],p=t.getCoordX(o)-t.getStartX(),_=t.getCoordY(o)-t.getStartY(),f=t=>{const e=t*t;return e*t*(10*(m.x*c.y-m.y*c.x)-15*t*(h.y*c.x-h.x*c.y)+6*e*(m.y*h.x-h.y*m.x))/60},y=t=>(-t*(c.y+t*(m.y+h.y*t))*p+t*(c.x+t*(m.x+h.x*t))*_)/2;return f(u)-f(o)-(y(u)-y(o))}class z extends t{constructor(t){super(),this.m_geoms=[],this.m_index=-1,this.m_id=-1,this.m_geoms=t}tock(){return!0}getRank(){return 1}next(){return this.m_index++,this.m_index>=this.m_geoms.length?null:(this.m_id=this.m_geoms[this.m_index].second,this.m_geoms[this.m_index].first)}getGeometryID(){return this.m_id}}class j{constructor(t){this.m_edges=[],this.m_curves=[],this.m_sortedNodes=[],this.m_sortHelper=[],this.m_cuts=[],this.m_cutAreas=[],this.m_totalAreaOfTraps=new f(0),this.m_areaTracking=0,this.m_splitArea=0,this.m_sumBase=0,this.m_sumA=0,this.m_numberOfCuts=0,this.m_currentScan=0,this.m_progressCounter=0,this.m_AETHead=null,this.m_bHorizontalSweep=!1,this.m_bPolygonHasCurves=!1,this.m_progressTracker=t}findSlicesByArea(t,e,r,n){n<0&&s("remainingArea");let i=t,a=null;i.hasNonLinearSegments()&&(this.m_bPolygonHasCurves=!0,a=o(t,1e-16,!0),G(a),i=a);const u=Math.abs(i.calculateArea2D());return 0===u||0===r||n>=u||1===r&&0===n?[]:(this.m_splitArea=(u-n)/r,this.m_numberOfCuts=r-1,n>0&&this.m_numberOfCuts++,this.m_edges.length=0,this.m_sortedNodes.length=0,this.m_cuts.length=0,this.m_areaTracking=0,this.m_totalAreaOfTraps.reset(),this.m_curves.length=0,this.buildEdges(i),this.buildScanNodes(),this.trapezoidation(),this.m_cuts)}sliceIntoStrips(t,s,r,i){if(0===i)return new e([t]);const o=new n;t.queryLooseEnvelope(o);const a=o.width()+o.height();return new z(this.splitPolygon(t,s,o.xmin-a-1+1,o.xmax+a+1,r,i))}recursiveSliceEqualArea(t,s,o){if(o<=1||t.isEmpty())return new e([t]);{const e=[],a=[];a.push(y(t.clone(),o));let u=0,l=0;for(;a.length>0;){r(l++<2*o);const t=a.at(-1);if(a.pop(),1===t.second){e.push(y(t.first,u++));continue}const h=new n;t.first.queryEnvelope(h);const m=h.width()+h.height(),c=new i;c.setIdentity(),h.width()>h.height()&&(c.setRotateCcw90(),t.first.applyTransformation(c),c.transformEnvInPlace(h));const p=t.first.calculateArea2D(),_=p/t.second,g=p-Math.trunc(t.second/2)*_,f=new j(this.m_progressTracker).findSlicesByArea(t.first,s,1,g),d=new j(this.m_progressTracker).splitPolygon(t.first,s,h.xmin-m-1+1,h.xmax+m+1,f,1),x=d.length;if(r(x>0&&x<=2),!c.isIdentity()){const t=new i;t.setRotateCw90(),d[0].first.applyTransformation(t),2===x&&d[1].first.applyTransformation(t)}2===x?(a.push(y(d[1].first,t.second-Math.trunc(t.second/2))),a.push(y(d[0].first,Math.trunc(t.second/2)))):a.push(y(d[0].first,t.second))}return new z(e)}}recursiveSliceEqualAreaImpl(t,e,s,n){return r(0),{}}processTraps(t,e,s){s?this.processTrapsCurves(t,e):this.processTrapsLinear(t,e)}processTrapsLinear(t,e){let s=0,r=1;const n=.5*(this.m_sumBase-this.m_sumA),i=e-t,o=(this.m_sumBase-n*(r+s))*i*(r-s);if(o+this.m_areaTracking<this.m_splitArea)return this.m_totalAreaOfTraps.pe(o),void(this.m_areaTracking+=o);const u=new f(o),l=new d(0,1);let h=!1;for(;s<1;){const e=this.m_splitArea-this.m_areaTracking,m=[Number.NaN,Number.NaN];if(!(a(-n*i,this.m_sumBase*i,(n*s-this.m_sumBase)*i*s-e,l,!1,m)>0)){h?this.m_areaTracking=u.getResult():this.m_areaTracking+=o;break}{h=!0,r=m[0],this.m_areaTracking=0,s=r,u.me(e);const n=r*i+t;if(this.m_cuts.push(n),this.m_cutAreas.push(this.m_totalAreaOfTraps.getResult()+o-u.getResult()),this.m_cuts.length===this.m_numberOfCuts)return void this.m_totalAreaOfTraps.pe(o-u.getResult())}}this.m_totalAreaOfTraps.pe(o)}processTrapsCurves(t,e){let s=0,r=1;const n=new M(this,t,e,0,1,0).getArea(1);if(n+this.m_areaTracking<this.m_splitArea)return this.m_totalAreaOfTraps.pe(n),void(this.m_areaTracking+=n);const i=e-t,o=new f(n);let a=!1;for(;s<1;){const l=this.m_splitArea-this.m_areaTracking,h=new M(this,t,e,s,1,l),m=[0],c=new d(s,1);if(!(u(h,c,1,m)>0)){a?this.m_areaTracking=o.getResult():this.m_areaTracking+=n;break}{a=!0,r=m[0],this.m_areaTracking=0,s=r,o.me(l);const e=r*i+t;if(this.m_cuts.push(e),this.m_cutAreas.push(this.m_totalAreaOfTraps.getResult()+n-o.getResult()),this.m_cuts.length===this.m_numberOfCuts)return void this.m_totalAreaOfTraps.pe(n-o.getResult())}}this.m_totalAreaOfTraps.pe(n)}advanceAET(){const t=this.m_sortedNodes[this.m_currentScan-1].y,e=this.m_sortedNodes[this.m_currentScan];let s=!1,r=!1;const n=new f(0);for(let a=this.m_AETHead;null!==a;a=a.nextAET){const t=a.prevAET;s=!s,null!==a.nextAET&&s&&(this.m_bPolygonHasCurves&&(a.curve||a.nextAET.curve)||n.pe(a.nextAET.currentX-a.currentX)),a.advance(e.y),null!==t&&a.currentX<t.currentX&&(r=!0)}this.m_sumBase=n.getResult(),r&&this.sortAET();const i=new f(0);s=!1;let o=!1;for(let a=this.m_AETHead;null!==a;a=a.nextAET){o=o||null!==a.curve;s=!s,null!==a.prevAET&&(s||this.m_bPolygonHasCurves&&(a.curve||a.prevAET.curve)||i.pe(a.currentX-a.prevAET.currentX))}this.m_sumA=i.getResult(),this.processTraps(t,e.y,o);for(let a=this.m_AETHead;null!=a;){const t=a.prevAET,s=a.nextAET;if(e.y===a.y1)if(a.prevAET=null,a.nextAET=null,null!==a.nextInChain){const e=a.currentX;a=a.nextInChain,a.currentX=e,a.prevAET=t,t?t.nextAET=a:this.m_AETHead=a,a.nextAET=s,s&&(s.prevAET=a)}else t?t.nextAET=s:this.m_AETHead=s,s&&(s.prevAET=t);a=s}}mergeNewEdgesToAET(){for(let r=this.m_sortedNodes[this.m_currentScan].startingEdges;null!==r;r=r.startNodeNext)Number.isNaN(r.currentX)&&(this.m_sortHelper.push(r),r.currentX=r.x0);if(!this.m_sortHelper.length)return;this.sortHelper();let t=this.m_AETHead,e=0,s=t;for(;null!==t&&e<this.m_sortHelper.length;)t.currentX>this.m_sortHelper[e].currentX?(this.m_sortHelper[e].prevAET=t.prevAET,t.prevAET?t.prevAET.nextAET=this.m_sortHelper[e]:this.m_AETHead=this.m_sortHelper[e],this.m_sortHelper[e].nextAET=t,t.prevAET=this.m_sortHelper[e],e++):(s=t,t=t.nextAET);for(;e<this.m_sortHelper.length;)this.m_sortHelper[e].prevAET=s,null!==s?s.nextAET=this.m_sortHelper[e]:this.m_AETHead=this.m_sortHelper[e],this.m_sortHelper[e].nextAET=null,s=this.m_sortHelper[e],e++;this.m_sortHelper.length=0}sortAET(){for(let e=this.m_AETHead;null!==e;e=e.nextAET)this.m_sortHelper.push(e);this.sortHelper(),this.m_AETHead=null;let t=null;for(const e of this.m_sortHelper)e.prevAET=t,t?t.nextAET=e:this.m_AETHead=e,e.nextAET=null,t=e;this.m_sortHelper.length=0}sortHelper(){this.m_sortHelper.sort(((t,e)=>t.currentX-e.currentX))}trapezoidation(){for(this.m_currentScan=0,this.mergeNewEdgesToAET(),this.m_currentScan++;this.m_currentScan<this.m_sortedNodes.length&&(this.progress(),this.advanceAET(),this.m_cuts.length!==this.m_numberOfCuts);)this.mergeNewEdgesToAET(),this.m_currentScan++}buildEdges(t){const e=t.querySegmentIterator();for(e.stripAttributes();e.nextPath();)for(;e.hasNextSegment();){const t=e.nextSegment();if(t.isCurve()){const e=t;if(l(e),this.m_bHorizontalSweep){const t=x(T,4);e.queryControlPoints(t);for(const e of t)e.y=A(e.x,e.x=e.y);e.constructPoints(t)}const s=e.getStartY(),r=e.getEndY();if(r===s)continue;r<s&&e.reverse(),this.m_curves.push(e.clone()),this.m_edges.push(O(this.m_curves.at(-1)))}else{const e=this.m_bHorizontalSweep?t.getStartX():t.getStartY();if((this.m_bHorizontalSweep?t.getEndX():t.getEndY())===e)continue;this.m_edges.push(I(t,this.m_bHorizontalSweep))}}this.m_edges.sort(((t,e)=>t.y0===e.y0?t.x0-e.x0:t.y0-e.y0))}buildScanNodes(){const t=[];for(const n of this.m_edges){const e=R();e.x=n.x0,e.y=n.y0,e.startEdge=n,e.endEdge=null,t.push(e);const s=R();s.x=n.x1,s.y=n.y1,s.startEdge=null,s.endEdge=n,t.push(s)}t.sort(((t,e)=>t.compare(e)));let e=0,s=t[e].y;this.m_sortedNodes.push(D(s,t[e].startEdge));let r=e;for(e++;e!==t.length;++e){t[e].y!==s&&(this.m_sortedNodes.push(D(t[e].y,null)),s=t[e].y);const n=t[e].startEdge;if(n){const t=this.m_sortedNodes.at(-1);n.startNodeNext=t.startingEdges,t.startingEdges=n}if(t[r].x!==t[e].x||t[r].y!==t[e].y){if(e-r===2){let e=r;e++,null!==t[r].endEdge&&null!==t[e].startEdge&&(t[r].endEdge.nextInChain=t[e].startEdge)}r=e}}}progress(){}splitPolygonLinear(t,s,i,o,a,u){const l=[];l.push([t,0,u]);const m=[],c=new h;for(c.startPathCoords(i,0),c.lineToCoords(o,0);l.length>0;){const h=l.at(-1);l.pop();const p=h[0],_=h[1],g=h[2],f=(new w).executeMany(new e([p]),s,this.m_progressTracker);for(let e=f.next();null!==e;e=f.next()){const h=e,p=new n;h.queryLooseEnvelope(p);let f=_,d=g;for(let t=_,e=g-1;t<g;++t,--e)p.ymin>=a[t]&&(f=t+1),p.ymax<=a[e]&&(d=e);if(f!==g)if(d!==_)if(f!==d)if(this.isYMonotone(h))this.splitYMonotone(m,h,s,a,f,d);else{const e=Math.trunc((f+d)/2);c.setXYCoords(0,i,a[e]),c.setXYCoords(1,o,a[e]);const _=(new C).execute(!1,h,c,null,this.m_progressTracker),g=_.next(),x=_.next(),T=_.next();if(null!==g){if(g.isEmpty()||(e===d-1?(m.push(y(g,e)),r(L(m.at(-1).first,s,t,m.at(-1).second,a,u))):l.push([g,e+1,d])),x.isEmpty()||(e===f?(m.push(y(x,e-1)),r(L(m.at(-1).first,s,t,m.at(-1).second,a,u))):l.push([x,f,e])),null!==T&&!T.isEmpty()){const t=new n;T.queryLooseEnvelope(t),t.ymin>=a[e]?l.push([T,e+1,d]):t.ymax<=a[e]?l.push([T,f,e]):l.push([T,f,d])}}else e+1===d?(a[e]-p.ymin<p.ymax-a[e]?m.push(y(h,e)):m.push(y(h,e+1)),r(L(m.at(-1).first,s,t,m.at(-1).second,a,u))):l.push([h,e+1,d])}else m.push(y(e,f-1));else m.push(y(e,_-1));else m.push(y(e,g-1))}}return m}splitPolygon(t,e,s,r,i,o){const a=new n;t.queryLooseEnvelope(a),a.inflateCoords(0,Math.max(a.width(),a.height()));const u=[],l=[];for(l.push(B(t,0,o));l.length;){const o={...l.at(-1)};if(l.pop(),o.polygon.hasNonLinearSegments()){const t=Math.trunc((o.to+o.from)/2),h=i[t],m=new n(s,a.ymin,r,h),c=(new S).execute(o.polygon,m,e,this.m_progressTracker);c.isEmpty()||(t-o.from===0?u.push(y(c,t-1)):l.push(B(c,o.from,t)));const p=new n(s,h,r,a.ymax),_=(new S).execute(o.polygon,p,e,this.m_progressTracker);_.isEmpty()||(o.to-t===1?u.push(y(_,t)):l.push(B(_,t+1,o.to)))}else{const n=this.splitPolygonLinear(t,e,s,r,i.slice(o.from),o.to-o.from);u.push(...n)}}u.sort(((t,e)=>t.second-e.second));const h=[];return m(u,((t,e)=>t.second===e.second),((t,e)=>{const s=new _;for(let r=t;r!==e;++r)s.add(u[r].first,!1);h.push(y(s,u[t].second))})),h}isYMonotone(t){if(1!==t.getPathCount())return!1;const e=t.getXY(0);let s=0,r=0;const n=new T;for(let i=1,o=t.getPointCount();i<=o;i++){t.queryXY(i===o?0:i,n);const a=n.y>e.y?1:n.y<e.y?-1:0;if(e.setCoordsPoint2D(n),s!==a&&0!==a){if(0!==s&&(r++,r>2))return!1;s=a}}return!0}splitYMonotone(t,e,s,n,i,o){const a=new c;a.addGeometry(e);const u=a.getFirstPath(a.getFirstGeometry()),l=a.getFirstVertex(u),h=new T,m=new T;let _=l,g=l;{const t=a.getXY(l);h.setCoordsPoint2D(t),m.setCoordsPoint2D(t)}let f=a.getNextVertex(l);const d=new T;for(let r=0,c=a.getPathSize(u);r<c;r++,f=a.getNextVertex(f))a.queryXY(f,d),d.compare(h)<0?(_=f,h.setCoordsPoint2D(d)):d.compare(m)>0&&(g=f,m.setCoordsPoint2D(d));let x=_,A=_,E=x,v=A,N=!1,S=!1,w=i,C=h.y,k=h.y,X=!1;for(;w<o;)if(n[w]<=h.y)w++;else{if(n[w]>=m.y)break;if(!N){const t=a.getNextVertex(x),e=a.getY(t);if(e<C)break;const s=n[w];C<=s&&e>=s?N=!0:(C=e,x=t)}if(!S){const t=a.getPrevVertex(A),e=a.getY(t);if(e<k)break;const s=n[w];k<=s&&e>=s?S=!0:(k=e,A=t)}if(N&&S){X=!0;let e=a.getXY(x);const s=a.getNextVertex(x);let i=a.getXY(s),o=p;if(i.y===e.y)o=i.x<e.x?x:s;else{const t=(n[w]-e.y)/(i.y-e.y);if(0===t)o=x;else if(1===t)o=s;else{const e=a.splitSegmentAxisAware(x,[t],1,null,-1);r(1===e),o=a.getNextVertex(x),a.getY(o)!==n[w]&&a.setXYCoords(o,a.getX(o),n[w])}}const u=a.getPrevVertex(A);e=a.getXY(u),i=a.getXY(A);let l=p;if(i.y===e.y)l=i.x<e.x?A:u;else{const t=(n[w]-e.y)/(i.y-e.y);if(0===t)l=u;else if(1===t)l=A;else{const e=a.splitSegmentAxisAware(u,[t],1,null,-1);r(1===e),l=a.getNextVertex(u),a.getY(l)!==n[w]&&a.setXYCoords(l,a.getX(l),n[w])}}t.push(y(this.extractTrapezoid(a,E,o,v,l),w-1)),E=o,v=l,x=o,A=l,C=k=n[w],N=!1,S=!1,w++}}X?t.push(y(this.extractTrapezoid(a,E,g,v,g),w-1)):t.push(y(e,w))}extractTrapezoid(t,e,s,r,n){const i=new _({vd:t.getVertexDescription()}),o=new v;let a=!0;for(let u=e;;u=t.getNextVertex(u)){const e=t.getSegment(u);if(e?i.addSegment(e,a):(t.queryPoint(u,o),a?i.startPathPoint(o):i.lineToPoint(o)),a=!1,u===s)break}s!==n&&(t.queryPoint(n,o),i.lineToPoint(o)),a=!0;for(let u=n;;u=t.getNextVertex(u)){const s=t.getSegment(u);if(s?i.addSegment(s,a):a||u===e||(t.queryPoint(u,o),i.lineToPoint(o)),a=!1,u===r)break}return i}}function G(t){return t.getImpl().ensureXYMonotoneSegments()}function L(t,e,s,r,i,o){const a=new n;t.queryEnvelope(a);const u=4*N(e,s,!0).total();return(!(r>=0)||a.ymin+u>=i[r])&&!(r+1<o&&a.ymax>i[r+1]+u)}class F{getOperatorType(){return 10011}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}supportsCurves(){return!0}sliceIntoStrips(t,e,s,r,n,i){return new W(0,t,e,s,n,0,i)}findSlicesByArea(t,e,s,r,n,i){if(!n||n.isIdentity())return k(t,e,s,r,i);{const o=t.clone();return o.applyTransformation(n),k(o,e,s,r,i)}}recursiveSliceEqualArea(t,e,s,r,n){return new W(1,t,e,null,r,s,n)}}class W extends t{constructor(t,e,s,r,n,i,o){super(),this.m_resultCursor=null,this.m_method=t,this.m_polygon=e,this.m_sr=s,this.m_ySplits=r?.slice()??null,this.m_transform=n,this.m_bReversePaths=n?.isReflective()??!1,this.m_inverseTransform=n?n.clone().invertThis():null,this.m_partCount=i,this.m_tracker=o}tock(){return!0}getRank(){return 1}next(){this.m_resultCursor||(this.m_method?this.recursiveSliceEqualArea():this.sliceIntoStrips());const t=this.m_resultCursor.next();return t?(this.m_inverseTransform&&!this.m_inverseTransform.isIdentity()&&(t.applyTransformation(this.m_inverseTransform),this.m_bReversePaths&&t.reverseAllPaths()),t):t}getGeometryID(){return this.m_resultCursor?this.m_resultCursor.getGeometryID():-1}sliceIntoStrips(){if(!this.m_transform||this.m_transform.isIdentity())this.m_resultCursor=X(this.m_polygon,this.m_sr,this.m_ySplits,this.m_ySplits.length,this.m_tracker);else{const t=this.m_polygon.clone();t.applyTransformation(this.m_transform),this.m_bReversePaths&&t.reverseAllPaths(),this.m_resultCursor=X(t,this.m_sr,this.m_ySplits,this.m_ySplits.length,this.m_tracker)}}recursiveSliceEqualArea(){if(!this.m_transform||this.m_transform.isIdentity())this.m_resultCursor=H(this.m_polygon,this.m_sr,this.m_partCount,this.m_tracker);else{const t=this.m_polygon.clone();t.applyTransformation(this.m_transform),this.m_bReversePaths&&t.reverseAllPaths(),this.m_resultCursor=H(t,this.m_sr,this.m_partCount,this.m_tracker)}}}const K=new F;function Q(t,e,s,r,n){return K.findSlicesByArea(t,e,s,r,n,null)}function J(t,e,s,r){const n=K.recursiveSliceEqualArea(t,e,s,r,null);return Array.from(n)}function U(t,e,s,r){const n=K.sliceIntoStrips(t,e,s,0,r,null);return Array.from(n)}function Z(){return K.supportsCurves()}export{Q as findSlicesByArea,J as recursiveSliceEqualArea,U as sliceIntoStrips,Z as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{S as
|
|
5
|
+
import{S as r}from"../../../chunks/SimpleGeometryCursor.js";import{O as n}from"../../../chunks/OperatorSimplifyOGC.js";const e=new n;function t(r,n,t){return e.execute(r,n,t,null)}function u(n,t,u){const o=e.executeMany(new r(n),t,u,null);return Array.from(o)}function o(r,n,t,u){return e.isSimple(r,n,t,u,null)}function s(){return e.supportsCurves()}export{t as execute,u as executeMany,o as isSimple,s as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{isSimple as r,supportsCurves as t,execute as n,executeMany as o}from"./gx/operatorSimplifyOGC.js";import{fromSpatialReference as e,getSpatialReference as s,fromGeometry as p,toGeometry as u}from"./support/apiConverter.js";function i(r){const t=s(r);return u(n(p(r),e(t),!1),t)}function a(r){const t=r.map(p),n=s(r);return o(t,e(n),!1).map((r=>u(r,n)))}function c(t,n){return r(p(t),e(s(t)),null!=n,n??null)}const m=t();export{i as execute,a as executeMany,c as isSimple,m as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function e(e,n,r,t){const{loggerTag:o,stride:f}=n;return e.length%f
|
|
5
|
+
function e(e,n,r,t){const{loggerTag:o,stride:f}=n;return e.length%f!==0?(t.error(o,`Invalid array length, expected a multiple of ${f}`),new r([])):e}function n(n,r,t,o,f){if(!n)return n;if(n instanceof r)return e(n,o,r,f);for(const i of t)if(n instanceof i)return e(new r(n),o,r,f);if(Array.isArray(n))return e(new r(n),o,r,f);{const e=t.map((e=>`'${e.name}'`));return f.error(`Failed to set property, expected one of ${e}, but got ${n.constructor.name}`),new r([])}}function r(e,n,r){n[r]=t(e)}function t(e){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r];return n}export{n as castArray,r as writeTypedArray};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSerializable as t}from"../../core/support/jsonUtils.js";import{create as i}from"./aaBoundingRect.js";import{getBoundsXY as s}from"./boundsUtils.js";import{closeRings as n}from"./coordsUtils.js";import{isPoint as e,isMultipoint as h,isExtent as o,isPolygon as u,isPolyline as r}from"./jsonUtils.js";import{cutParams as m,updatePolyGeometry as x,offsetMagnitude as l}from"./normalizeUtilsCommon.js";import{getInfo as _,isWebMercator as c}from"./spatialReferenceUtils.js";function p(t){return f(t,!0)}function a(t){return f(t,!1)}function f(i,n){if(null==i)return null;const p=i.spatialReference,a=_(p),f=t(i)?i.toJSON():i;if(!a)return f;const I=c(p)?102100:4326,g=m[I].maxX,v=m[I].minX;if(e(f))return y(f,g,v);if(h(f))return f.points=f.points.map((t=>y(t,g,v))),f;if(o(f))return d(f,a);if(u(f)||r(f)){const t=s(T,f),i={xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]},e=l(i.xmin,v)*(2*g),h=0===e?f:x(f,e);return i.xmin+=e,i.xmax+=e,i.xmax>g?C(h,g,n):i.xmin<v?C(h,v,n):h}return f}function d(t,i){if(!i)return t;const s=I(t,i).map((t=>t.extent));return s.length<2?s[0]||t:s.length>2?(t.xmin=i.valid[0],t.xmax=i.valid[1],t):{rings:s.map((t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]))}}function y(t,i,s){if(Array.isArray(t)){const n=t[0];if(n>i){const s=l(n,i);t[0]=n+s*(-2*i)}else if(n<s){const i=l(n,s);t[0]=n+i*(-2*s)}}else{const n=t.x;if(n>i){const s=l(n,i);t.x+=s*(-2*i)}else if(n<s){const i=l(n,s);t.x+=i*(-2*s)}}return t}function I(t,i){const s=[],{ymin:n,ymax:e,xmin:h,xmax:o}=t,u=t.xmax-t.xmin,[r,m]=i.valid,{x,frameId:l}=g(t.xmin,i),{x:_,frameId:c}=g(t.xmax,i),p=x===_&&u>0;if(u>2*m){const t={xmin:h<o?x:_,ymin:n,xmax:m,ymax:e},i={xmin:r,ymin:n,xmax:h<o?_:x,ymax:e},u={xmin:0,ymin:n,xmax:m,ymax:e},p={xmin:r,ymin:n,xmax:0,ymax:e},a=[],f=[];v(t,u)&&a.push(l),v(t,p)&&f.push(l),v(i,u)&&a.push(c),v(i,p)&&f.push(c);for(let s=l+1;s<c;s++)a.push(s),f.push(s);s.push(new P(t,[l]),new P(i,[c]),new P(u,a),new P(p,f))}else x>_||p?s.push(new P({xmin:x,ymin:n,xmax:m,ymax:e},[l]),new P({xmin:r,ymin:n,xmax:_,ymax:e},[c])):s.push(new P({xmin:x,ymin:n,xmax:_,ymax:e},[l]));return s}function g(t,i){const[s,n]=i.valid,e=2*n;let h,o=0;return t>n?(h=Math.ceil(Math.abs(t-n)/e),t-=h*e,o=h):t<s&&(h=Math.ceil(Math.abs(t-s)/e),t+=h*e,o=-h),{x:t,frameId:o}}function v(t,i){const{xmin:s,ymin:n,xmax:e,ymax:h}=i;return O(t,s,n)&&O(t,s,h)&&O(t,e,h)&&O(t,e,n)}function O(t,i,s){return i>=t.xmin&&i<=t.xmax&&s>=t.ymin&&s<=t.ymax}function C(t,i,s=!0){const e=!r(t);if(e&&n(t),s){return(new S).cut(t,i)}const h=e?t.rings:t.paths,o=e?4:2,u=h.length,m=-2*i;for(let n=0;n<u;n++){const t=h[n];if(t&&t.length>=o){const i=[];for(const s of t)i.push([s[0]+m,s[1]]);h.push(i)}}return e?t.rings=h:t.paths=h,t}class P{constructor(t,i){this.extent=t,this.frameIds=i}}const T=i();class S{constructor(){this._linesIn=[],this._linesOut=[]}cut(t,i){let s;if(this._xCut=i,t.rings)this._closed=!0,s=t.rings,this._minPts=4;else{if(!t.paths)return null;this._closed=!1,s=t.paths,this._minPts=2}for(const e of s){if(!e||e.length<this._minPts)continue;let t=!0;for(const i of e)t?(this.moveTo(i),t=!1):this.lineTo(i);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),s=[];for(const e of this._linesIn)e&&e.length>=this._minPts&&s.push(e);const n=-2*this._xCut;for(const e of this._linesOut)if(e&&e.length>=this._minPts){for(const t of e)t[0]+=n;s.push(e)}return this._closed?t.rings=s:t.paths=s,t}moveTo(t){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(t[0]),this._moveTo(t[0],t[1],this._prevSide),this._prevPt=t,this._firstPt=t}lineTo(t){const i=this._side(t[0]);if(i*this._prevSide
|
|
5
|
+
import{isSerializable as t}from"../../core/support/jsonUtils.js";import{create as i}from"./aaBoundingRect.js";import{getBoundsXY as s}from"./boundsUtils.js";import{closeRings as n}from"./coordsUtils.js";import{isPoint as e,isMultipoint as h,isExtent as o,isPolygon as u,isPolyline as r}from"./jsonUtils.js";import{cutParams as m,updatePolyGeometry as x,offsetMagnitude as l}from"./normalizeUtilsCommon.js";import{getInfo as _,isWebMercator as c}from"./spatialReferenceUtils.js";function p(t){return f(t,!0)}function a(t){return f(t,!1)}function f(i,n){if(null==i)return null;const p=i.spatialReference,a=_(p),f=t(i)?i.toJSON():i;if(!a)return f;const I=c(p)?102100:4326,g=m[I].maxX,v=m[I].minX;if(e(f))return y(f,g,v);if(h(f))return f.points=f.points.map((t=>y(t,g,v))),f;if(o(f))return d(f,a);if(u(f)||r(f)){const t=s(T,f),i={xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]},e=l(i.xmin,v)*(2*g),h=0===e?f:x(f,e);return i.xmin+=e,i.xmax+=e,i.xmax>g?C(h,g,n):i.xmin<v?C(h,v,n):h}return f}function d(t,i){if(!i)return t;const s=I(t,i).map((t=>t.extent));return s.length<2?s[0]||t:s.length>2?(t.xmin=i.valid[0],t.xmax=i.valid[1],t):{rings:s.map((t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]))}}function y(t,i,s){if(Array.isArray(t)){const n=t[0];if(n>i){const s=l(n,i);t[0]=n+s*(-2*i)}else if(n<s){const i=l(n,s);t[0]=n+i*(-2*s)}}else{const n=t.x;if(n>i){const s=l(n,i);t.x+=s*(-2*i)}else if(n<s){const i=l(n,s);t.x+=i*(-2*s)}}return t}function I(t,i){const s=[],{ymin:n,ymax:e,xmin:h,xmax:o}=t,u=t.xmax-t.xmin,[r,m]=i.valid,{x,frameId:l}=g(t.xmin,i),{x:_,frameId:c}=g(t.xmax,i),p=x===_&&u>0;if(u>2*m){const t={xmin:h<o?x:_,ymin:n,xmax:m,ymax:e},i={xmin:r,ymin:n,xmax:h<o?_:x,ymax:e},u={xmin:0,ymin:n,xmax:m,ymax:e},p={xmin:r,ymin:n,xmax:0,ymax:e},a=[],f=[];v(t,u)&&a.push(l),v(t,p)&&f.push(l),v(i,u)&&a.push(c),v(i,p)&&f.push(c);for(let s=l+1;s<c;s++)a.push(s),f.push(s);s.push(new P(t,[l]),new P(i,[c]),new P(u,a),new P(p,f))}else x>_||p?s.push(new P({xmin:x,ymin:n,xmax:m,ymax:e},[l]),new P({xmin:r,ymin:n,xmax:_,ymax:e},[c])):s.push(new P({xmin:x,ymin:n,xmax:_,ymax:e},[l]));return s}function g(t,i){const[s,n]=i.valid,e=2*n;let h,o=0;return t>n?(h=Math.ceil(Math.abs(t-n)/e),t-=h*e,o=h):t<s&&(h=Math.ceil(Math.abs(t-s)/e),t+=h*e,o=-h),{x:t,frameId:o}}function v(t,i){const{xmin:s,ymin:n,xmax:e,ymax:h}=i;return O(t,s,n)&&O(t,s,h)&&O(t,e,h)&&O(t,e,n)}function O(t,i,s){return i>=t.xmin&&i<=t.xmax&&s>=t.ymin&&s<=t.ymax}function C(t,i,s=!0){const e=!r(t);if(e&&n(t),s){return(new S).cut(t,i)}const h=e?t.rings:t.paths,o=e?4:2,u=h.length,m=-2*i;for(let n=0;n<u;n++){const t=h[n];if(t&&t.length>=o){const i=[];for(const s of t)i.push([s[0]+m,s[1]]);h.push(i)}}return e?t.rings=h:t.paths=h,t}class P{constructor(t,i){this.extent=t,this.frameIds=i}}const T=i();class S{constructor(){this._linesIn=[],this._linesOut=[]}cut(t,i){let s;if(this._xCut=i,t.rings)this._closed=!0,s=t.rings,this._minPts=4;else{if(!t.paths)return null;this._closed=!1,s=t.paths,this._minPts=2}for(const e of s){if(!e||e.length<this._minPts)continue;let t=!0;for(const i of e)t?(this.moveTo(i),t=!1):this.lineTo(i);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),s=[];for(const e of this._linesIn)e&&e.length>=this._minPts&&s.push(e);const n=-2*this._xCut;for(const e of this._linesOut)if(e&&e.length>=this._minPts){for(const t of e)t[0]+=n;s.push(e)}return this._closed?t.rings=s:t.paths=s,t}moveTo(t){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(t[0]),this._moveTo(t[0],t[1],this._prevSide),this._prevPt=t,this._firstPt=t}lineTo(t){const i=this._side(t[0]);if(i*this._prevSide===-1){const s=this._intersect(this._prevPt,t);this._lineTo(this._xCut,s,0),this._prevSide=0,this._lineTo(t[0],t[1],i)}else this._lineTo(t[0],t[1],i);this._prevSide=i,this._prevPt=t}close(){const t=this._firstPt,i=this._prevPt;t[0]===i[0]&&t[1]===i[1]||this.lineTo(t),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(t,i,s){this._closed?(this._lineIn.push([s<=0?t:this._xCut,i]),this._lineOut.push([s>=0?t:this._xCut,i])):(s<=0&&this._lineIn.push([t,i]),s>=0&&this._lineOut.push([t,i]))}_lineTo(t,i,s){this._closed?(j(this._lineIn,s<=0?t:this._xCut,i),j(this._lineOut,s>=0?t:this._xCut,i)):s<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([t,i])):s>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([t,i])):this._prevSide<0?(this._lineIn.push([t,i]),this._lineOut.push([t,i])):this._prevSide>0&&(this._lineOut.push([t,i]),this._lineIn.push([t,i]))}_checkClosingPt(t){const i=t.length;i>3&&t[0][0]===this._xCut&&t[i-2][0]===this._xCut&&t[1][0]===this._xCut&&(t[0][1]=t[i-2][1],t.pop())}_side(t){return t<this._xCut?-1:t>this._xCut?1:0}_intersect(t,i){const s=(this._xCut-t[0])/(i[0]-t[0]);return t[1]+s*(i[1]-t[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}function j(t,i,s){const n=t.length;n>1&&t[n-1][0]===i&&t[n-2][0]===i?t[n-1][1]=s:t.push([i,s])}export{S as CutVertical,a as normalizeCentralMeridianForDisplay,p as normalizeCentralMeridianSync};
|