@arcgis/core 4.34.0-next.44 → 4.34.0-next.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AttributeBinsGraphic.js +1 -1
- package/PopupTemplate.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/geometry/wkt.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/04cbd3aa9965b2eb71ea.js +1 -0
- package/assets/esri/core/workers/chunks/{42c5d957813080143e5a.js → 09268dc856c3d5ce178f.js} +1 -1
- package/assets/esri/core/workers/chunks/0f20c0eec850a39620a1.js +1 -0
- package/assets/esri/core/workers/chunks/{b40845b45f8d7cd347a1.js → 17df0f766ee1e323d3fa.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf474c055a85bdbfa8d0.js → 19f1bfe815896d4983af.js} +1 -1
- package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +1 -0
- package/assets/esri/core/workers/chunks/{bb23371335ac049861e6.js → 28a85997c9003cacdefb.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d9a7333a968065b53a1.js → 2942ab268f24cea2e722.js} +1 -1
- package/assets/esri/core/workers/chunks/{3a2cbfb03103c402c6c5.js → 2b75212c31145cc07d16.js} +1 -1
- package/assets/esri/core/workers/chunks/{787d281b2fe1edf6cf30.js → 2bb61f80473b495163e3.js} +1 -1
- package/assets/esri/core/workers/chunks/2cda605c302176905e84.js +1 -0
- package/assets/esri/core/workers/chunks/{5958598da96464128aed.js → 2f65081bfedeab44d6cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{78de16f65ea297452a65.js → 31c6e951b99315e8e68a.js} +1 -1
- package/assets/esri/core/workers/chunks/33f3e3d05429f845c139.js +1 -0
- package/assets/esri/core/workers/chunks/3610357c8fa9bec9e0dc.js +1 -0
- package/assets/esri/core/workers/chunks/379a4f664e77ad1fffe9.js +1 -0
- package/assets/esri/core/workers/chunks/45b450c045d5fadf71b6.js +1 -0
- package/assets/esri/core/workers/chunks/{d547b27ac750953a998f.js → 46a470bea2a3601182dc.js} +1 -1
- package/assets/esri/core/workers/chunks/47f2e905ef42e36897aa.js +1 -0
- package/assets/esri/core/workers/chunks/4c6862ad3af947c704f7.js +1 -0
- package/assets/esri/core/workers/chunks/4d544e3e19ce07c2c195.js +1 -0
- package/assets/esri/core/workers/chunks/4f5e72993a4f5180d703.js +1 -0
- package/assets/esri/core/workers/chunks/50d526a16bc86a481055.js +1 -0
- package/assets/esri/core/workers/chunks/516b30778cd54d29e362.js +1 -0
- package/assets/esri/core/workers/chunks/54b1a960bb8c3fe05976.js +1 -0
- package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +1 -0
- package/assets/esri/core/workers/chunks/576792b5e1e13084adba.js +1 -0
- package/assets/esri/core/workers/chunks/{6759319f3fd2d03c446b.js → 5c556468e2a598ab793a.js} +1 -1
- package/assets/esri/core/workers/chunks/5d331f7628514a572f82.js +1 -0
- package/assets/esri/core/workers/chunks/64c31c90e4c589ca2f04.js +1 -0
- package/assets/esri/core/workers/chunks/65e1f5b20a585e04655a.js +1 -0
- package/assets/esri/core/workers/chunks/66db5f77e09d25e33951.js +1 -0
- package/assets/esri/core/workers/chunks/{863e87ac982d7727b435.js → 69e37365c17e7cc4168f.js} +1 -1
- package/assets/esri/core/workers/chunks/6fe738748ce837811ff4.js +1 -0
- package/assets/esri/core/workers/chunks/709dc98379f4ce18a0b5.js +1 -0
- package/assets/esri/core/workers/chunks/719450ccd455f503d81a.js +1 -0
- package/assets/esri/core/workers/chunks/73140c5c0beda7ea3703.js +1 -0
- package/assets/esri/core/workers/chunks/790e97ddbe318bc75415.js +1 -0
- package/assets/esri/core/workers/chunks/7df8c78e36b04ad657d2.js +1 -0
- package/assets/esri/core/workers/chunks/838c7fd37b2e78b1d582.js +1 -0
- package/assets/esri/core/workers/chunks/8736b78256037b145f8b.js +1 -0
- package/assets/esri/core/workers/chunks/{c6da9ba188b627ab3b79.js → 8aa77a5e82c033512b45.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1c2e5e0a70fb5d27da5.js → 8bab4c59c9b644224ecb.js} +1 -1
- package/assets/esri/core/workers/chunks/8c6119dde0eead8d90d9.js +1 -0
- package/assets/esri/core/workers/chunks/{4f3c187a7cb2b1444281.js → 8c81156b1605a16acc29.js} +1 -1
- package/assets/esri/core/workers/chunks/{f4b145feab275b268c2e.js → 8cc700da2ac58849a708.js} +1 -1
- package/assets/esri/core/workers/chunks/8f70650aba8e55eb7a96.js +1 -0
- package/assets/esri/core/workers/chunks/914eaed113dda727eb47.js +1 -0
- package/assets/esri/core/workers/chunks/98175b454e807b1a3c5f.js +1 -0
- package/assets/esri/core/workers/chunks/{44116cf0bd4d6a127c96.js → 99b9392946d776a62997.js} +1 -1
- package/assets/esri/core/workers/chunks/9a20be3b02c9d6349b8d.js +1 -0
- package/assets/esri/core/workers/chunks/9affcf990ea810fa426b.js +1 -0
- package/assets/esri/core/workers/chunks/9b7fee0adffeee8d45ae.js +1 -0
- package/assets/esri/core/workers/chunks/9cbec2ffa445a72d4c33.js +1 -0
- package/assets/esri/core/workers/chunks/9d30fed26e0d84ef893b.js +1 -0
- package/assets/esri/core/workers/chunks/9f178cf73c63caaea190.js +1 -0
- package/assets/esri/core/workers/chunks/a1ff4c252012d5026133.js +1 -0
- package/assets/esri/core/workers/chunks/a34d98abcf958a632b0f.js +1 -0
- package/assets/esri/core/workers/chunks/a3a23a56df4e5ee86bb2.js +1 -0
- package/assets/esri/core/workers/chunks/a6493607b98783bf1ef2.js +1 -0
- package/assets/esri/core/workers/chunks/a69258f34a5eb5a1954f.js +1 -0
- package/assets/esri/core/workers/chunks/a7ff44157b8cf19de37e.js +1 -0
- package/assets/esri/core/workers/chunks/{5ae6e2b3557fe8730072.js → b287624909578d307e07.js} +1 -1
- package/assets/esri/core/workers/chunks/{48514235c32917e43a3f.js → b3e2e826295620b1a9dd.js} +2 -2
- package/assets/esri/core/workers/chunks/{5b91a49202129eedaf00.js → b4304673696fc0774bff.js} +1 -1
- package/assets/esri/core/workers/chunks/bd1c2afaf491d1c79a9e.js +1 -0
- package/assets/esri/core/workers/chunks/{f34739daceab54a280ad.js → beb77cdae0b1b6ad73da.js} +1 -1
- package/assets/esri/core/workers/chunks/{a638f1688ac9525a52a7.js → c2f184e9f579152aa29a.js} +1 -1
- package/assets/esri/core/workers/chunks/c483d2149d9d0099bfdb.js +1 -0
- package/assets/esri/core/workers/chunks/{349da65a8793f7873366.js → c5a0976de958b3b01c70.js} +1 -1
- package/assets/esri/core/workers/chunks/ce569860b170700e9b31.js +1 -0
- package/assets/esri/core/workers/chunks/cf5db995ba88912cf6b7.js +1 -0
- package/assets/esri/core/workers/chunks/cf6330f721c6910d25ff.js +1 -0
- package/assets/esri/core/workers/chunks/{2aac5d560e4c5defe882.js → cff15600d0ec7b19dffb.js} +1 -1
- package/assets/esri/core/workers/chunks/{0faec78b2dd6990a5da0.js → d09ded9fb621491e2466.js} +1 -1
- package/assets/esri/core/workers/chunks/d1842745a7699879a1e1.js +1 -0
- package/assets/esri/core/workers/chunks/{7e99fc78bd0f40a8ba81.js → d1c97fdcba6eb443cb1c.js} +1 -1
- package/assets/esri/core/workers/chunks/d62d41091f7ac5f77f16.js +1 -0
- package/assets/esri/core/workers/chunks/d70e1b8b8bee88a7a5b8.js +353 -0
- package/assets/esri/core/workers/chunks/d8d17e3ecccec7e99f0b.js +1 -0
- package/assets/esri/core/workers/chunks/{14b536e0c1de6c7422bc.js → e408ccee12bfe089c913.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f2bdb8da5c9ffd7d05e.js → e58336aafe8c95bb6831.js} +1 -1
- package/assets/esri/core/workers/chunks/{30b9c131b69297ee186f.js → e59e09766b130a05c617.js} +1 -1
- package/assets/esri/core/workers/chunks/{01ae7d36bda6b6186786.js → eb61b47df99a54a364c8.js} +1 -1
- package/assets/esri/core/workers/chunks/ef02e33ea53b46b566cb.js +1 -0
- package/assets/esri/core/workers/chunks/f0ccd7ac83d94cbf40a5.js +1 -0
- package/assets/esri/core/workers/chunks/{655b8d24ffe5405f8ba1.js → f2a2d3cda4a3dc0a8caf.js} +1 -1
- package/assets/esri/core/workers/chunks/fc6408208c850eec4019.js +1 -0
- package/assets/esri/core/workers/chunks/ff79a8df1b1941ae350d.js +1 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/chunks/NativeLine.glsl.js +5 -14
- package/chunks/bundle.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/chunks/persistableUrlUtils.js +1 -1
- package/colorUtils.js +1 -1
- package/config.js +1 -1
- package/core/BidiEngine.js +1 -1
- package/core/accessorSupport/get.js +1 -1
- package/core/accessorSupport/read.js +1 -1
- package/core/accessorSupport/tracking.js +1 -1
- package/core/screenUtils.js +1 -1
- package/core/sql/DateOnly.js +1 -1
- package/core/urlUtils.js +1 -1
- package/core/uuid.js +1 -1
- package/core/workers/registry.js +1 -1
- package/geometry/operators/json/generalizeOperator.js +5 -0
- package/geometry/operators/json/simplifyOperator.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +5 -0
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/layers/support/rasterDatasets/pixelReader.js +1 -1
- package/libs/maquette-advanced-projector/utils.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/networks/RulesTable.js +1 -1
- package/package.json +1 -1
- package/rest/generateRenderer.js +1 -1
- package/rest/networks/support/TraceResult.js +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMEffects.js +1 -1
- package/symbols/cim/CIMResourceManager.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/effects/CIMEffectHelper.js +1 -1
- package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
- package/symbols/cim/effects/EffectArrow.js +1 -1
- package/symbols/cim/effects/EffectBuffer.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/cim/effects/EffectCut.js +1 -1
- package/symbols/cim/effects/EffectDashes.js +1 -1
- package/symbols/cim/effects/EffectDonut.js +1 -1
- package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
- package/symbols/cim/effects/EffectJog.js +1 -1
- package/symbols/cim/effects/EffectMove.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/symbols/cim/effects/EffectRadial.js +1 -1
- package/symbols/cim/effects/EffectReverse.js +1 -1
- package/symbols/cim/effects/EffectRotate.js +1 -1
- package/symbols/cim/effects/EffectScale.js +1 -1
- package/symbols/cim/effects/EffectSuppress.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/symbols/cim/effects/EffectWave.js +1 -1
- package/symbols/cim/fitVectorMarker.js +1 -1
- package/symbols/cim/placements/CIMMarkerPlacementHelper.js +1 -1
- package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
- package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
- package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/symbols/cim/placements/PlacementOnLine.js +1 -1
- package/symbols/cim/placements/PlacementOnVertices.js +1 -1
- package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/interactive/editingTools/MediaTransformToolsWrapper.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/{DrawManipulator.js → LegacyDrawManipulator.js} +1 -1
- package/views/draw/{DrawTool.js → LegacyDrawTool.js} +1 -1
- package/views/draw/PointDrawAction.js +1 -1
- package/views/draw/PolygonDrawAction.js +1 -1
- package/views/draw/PolylineDrawAction.js +1 -1
- package/views/draw/SegmentDrawAction.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +5 -0
- package/widgets/OrientedImageryViewer/symbols.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Track/TrackViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/assets/esri/core/workers/chunks/03df4668002eb4cb4f98.js +0 -1
- package/assets/esri/core/workers/chunks/087ae1e3e767f0e678e5.js +0 -1
- package/assets/esri/core/workers/chunks/0b45566fad2cbb03fea1.js +0 -1
- package/assets/esri/core/workers/chunks/0d73afce787ee1e76b21.js +0 -1
- package/assets/esri/core/workers/chunks/1acc620bfd2983d6853f.js +0 -1
- package/assets/esri/core/workers/chunks/21dd626a5b5ea6a7e18e.js +0 -1
- package/assets/esri/core/workers/chunks/24e76fa530fc0c495fb5.js +0 -1
- package/assets/esri/core/workers/chunks/28d71e1b866113650c75.js +0 -1
- package/assets/esri/core/workers/chunks/2a26c3fc324d672ebe88.js +0 -1
- package/assets/esri/core/workers/chunks/2c816d3a737e39e6eb84.js +0 -1
- package/assets/esri/core/workers/chunks/2f54776ff86f397adc55.js +0 -1
- package/assets/esri/core/workers/chunks/3984ca7e05f30724adaf.js +0 -1
- package/assets/esri/core/workers/chunks/3af4a410ff0bca7ba2e3.js +0 -1
- package/assets/esri/core/workers/chunks/439128f23fa091633d2d.js +0 -1
- package/assets/esri/core/workers/chunks/489391ed1d443140617d.js +0 -1
- package/assets/esri/core/workers/chunks/4970d439d9648e97fd5a.js +0 -1
- package/assets/esri/core/workers/chunks/774844eea928efa811f2.js +0 -1
- package/assets/esri/core/workers/chunks/7b82ed4cc475c782256b.js +0 -1
- package/assets/esri/core/workers/chunks/7ef29640de297a0cf744.js +0 -1
- package/assets/esri/core/workers/chunks/8867368ab9b005460f19.js +0 -353
- package/assets/esri/core/workers/chunks/8c3c752408fac3db05cf.js +0 -1
- package/assets/esri/core/workers/chunks/8ca95499e00ce8b0af9a.js +0 -1
- package/assets/esri/core/workers/chunks/8f3ce10eacb5bc14a641.js +0 -1
- package/assets/esri/core/workers/chunks/91be247f868ce6596c9e.js +0 -1
- package/assets/esri/core/workers/chunks/97fc21355efc7b289f3b.js +0 -1
- package/assets/esri/core/workers/chunks/9cd9b22354dbdf1b1df0.js +0 -1
- package/assets/esri/core/workers/chunks/a89c060ad302381aaf7d.js +0 -1
- package/assets/esri/core/workers/chunks/aaab7694eb333ad480f5.js +0 -1
- package/assets/esri/core/workers/chunks/af98c7546be409303213.js +0 -1
- package/assets/esri/core/workers/chunks/b01a90ce699058307bc2.js +0 -1
- package/assets/esri/core/workers/chunks/b5f6a0607b620b027cdd.js +0 -1
- package/assets/esri/core/workers/chunks/c110941e87923ba47193.js +0 -1
- package/assets/esri/core/workers/chunks/c6e3d4c6bb02d58d5cfe.js +0 -1
- package/assets/esri/core/workers/chunks/cd6398a2951922e13b86.js +0 -1
- package/assets/esri/core/workers/chunks/ceb63ca9ad473c3f1820.js +0 -1
- package/assets/esri/core/workers/chunks/d392fbbcfac2a1b54bd6.js +0 -1
- package/assets/esri/core/workers/chunks/d93b24e863379116b2aa.js +0 -1
- package/assets/esri/core/workers/chunks/da6f46211551a96dce19.js +0 -1
- package/assets/esri/core/workers/chunks/dd9be173cddc16a354ed.js +0 -1
- package/assets/esri/core/workers/chunks/ddeaf688d72b2873c4ac.js +0 -1
- package/assets/esri/core/workers/chunks/e3f5afdf133c58b3d161.js +0 -1
- package/assets/esri/core/workers/chunks/e5aeb34d918dee539694.js +0 -1
- package/assets/esri/core/workers/chunks/e6d08230adb90b9a2a17.js +0 -1
- package/assets/esri/core/workers/chunks/e7806a57d29bca385f1d.js +0 -1
- package/assets/esri/core/workers/chunks/e799433770e4303fcd9c.js +0 -1
- package/assets/esri/core/workers/chunks/eb7dd722e4cd7f83b3f5.js +0 -1
- package/assets/esri/core/workers/chunks/f1adf8ebc2c1b93857bf.js +0 -1
- package/assets/esri/core/workers/chunks/f1b02c4bd5fde235212b.js +0 -1
- package/assets/esri/core/workers/chunks/f65b2d3a91a0c726fee4.js +0 -1
- package/assets/esri/core/workers/chunks/ff34fdda7899e784ac73.js +0 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/loadGeometryEngine.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{id as e}from"../kernel.js";import{makeAbsolute as t,makeRelative as r,isAbsolute as s,normalize as o,isDataProtocol as l,changeDomain as n,hasSameOrigin as
|
|
5
|
+
import{id as e}from"../kernel.js";import{makeAbsolute as t,makeRelative as r,isAbsolute as s,normalize as o,isDataProtocol as l,changeDomain as n,hasSameOrigin as a,getAppUrl as c,splitPathExtension as i}from"../core/urlUtils.js";import{normalizeArcGISOnlineOrgDomain as u}from"../portal/support/urlUtils.js";function p(e,s){const o=s?.url?.path;if(e&&o&&(e=t(e,o,{preserveProtocolRelative:!0}),s.portalItem&&s.readResourcePaths)){const t=r(e,s.portalItem.itemUrl);null!=t&&t.startsWith(U)&&s.readResourcePaths.push(s.portalItem.resourceFromPath(t).path)}return(e=I(e,s?.portal))&&d.test(e)?R(e):e}function m(e,n,a=0){if(null==(e=e&&d.test(e)?w(e):e))return e;!s(e)&&n?.blockedRelativeUrls&&n.blockedRelativeUrls.push(e);let c=t(e);if(n){const t=n.verifyItemRelativeUrls?.rootPath||n.url?.path;if(t){const s=I(t,n.portal),o=I(c,n.portal);c=r(o,s,s);null!=c&&c!==o&&c!==e&&n.verifyItemRelativeUrls&&n.verifyItemRelativeUrls.writtenUrls.push(c)}}return c=x(c,n?.portal),s(c)&&(c=o(c)),n?.resources&&n?.portalItem&&!s(c)&&!l(c)&&0===a&&n.resources.toKeep.push({resource:n.portalItem.resourceFromPath(c),compress:!1}),c}function f(e,t,r){return p(e,r)}function h(e,t,r,s){const o=m(e,s);void 0!==o&&(t[r]=o)}const d=/\/items\/([^/]+)\/resources\/(.*)/,U="./resources/";function v(e){const t=e?.match(d)??null;return t?.[1]??null}function g(e){const t=e?.match(d)??null;if(null==t)return null;const r=t[2],s=r.lastIndexOf("/");if(-1===s){const{path:e,extension:t}=i(r);return{prefix:null,filename:e,extension:t}}const{path:o,extension:l}=i(r.slice(s+1));return{prefix:r.slice(0,s),filename:o,extension:l}}function x(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?n(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}function I(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const r=`${t.urlKey}.${t.customBaseUrl}`,s=c();return a(s,`${s.scheme}://${r}`)?n(e,t.portalHostname,r):n(e,r,t.portalHostname)}function R(t){if(!t)return t||null;let r=t;return r&&e&&!e.findCredential(r)&&(r=u(r),r=r.replace(/^https?:\/\/www\.arcgis\.com/,"https://cdn.arcgis.com"),r=r.replace(/^https?:\/\/devext\.arcgis\.com/,"https://cdndev.arcgis.com"),r=r.replace(/^https?:\/\/qaext\.arcgis\.com/,"https://cdnqa.arcgis.com")),r}function w(t){if(!t)return t||null;let r=t;return r=r.replace(/^https?:\/\/cdn\.arcgis\.com/,"https://www.arcgis.com"),r=r.replace(/^https?:\/\/cdndev\.arcgis\.com/,"https://devext.arcgis.com"),r=r.replace(/^https?:\/\/cdnqa\.arcgis\.com/,"https://qaext.arcgis.com"),r&&e&&!e.findCredential(r)&&(r=u(r)),r}const y=Object.freeze(Object.defineProperty({__proto__:null,ensureMainOnlineDomain:x,fromCDNUrl:w,fromJSON:p,itemIdFromResourceUrl:v,prefixAndFilenameFromResourceUrl:g,read:f,toCDNUrl:R,toJSON:m,write:h},Symbol.toStringTag,{value:"Module"}));export{R as a,y as b,w as c,x as e,p as f,v as i,g as p,f as r,m as t,h as w};
|
package/colorUtils.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const e={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function r(r){return!!e[r]||!!e[r.toLowerCase()]}function n(r){return e[r]??e[r.toLowerCase()]}function l(e){return[...n(e)]}function
|
|
5
|
+
const e={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function r(r){return!!e[r]||!!e[r.toLowerCase()]}function n(r){return e[r]??e[r.toLowerCase()]}function l(e){return[...n(e)]}function t(e,r,n){n<0&&++n,n>1&&--n;const l=6*n;return l<1?e+(r-e)*l:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e}function a(e,r,n,l=1){const a=(e%360+360)%360/360,i=n<=.5?n*(r+1):n+r-n*r,o=2*n-i;return[Math.round(255*t(o,i,a+1/3)),Math.round(255*t(o,i,a)),Math.round(255*t(o,i,a-1/3)),l]}function i(e){const r=e.length>5,n=r?8:4,l=(1<<n)-1,t=r?1:17,a=r?9===e.length:5===e.length;let i=Number("0x"+e.slice(1));if(isNaN(i))return null;const o=[0,0,0,1];let s;return a&&(s=i&l,i>>=n,o[3]=t*s/255),s=i&l,i>>=n,o[2]=t*s,s=i&l,i>>=n,o[1]=t*s,s=i&l,i>>=n,o[0]=t*s,o}function o(e){if(!e.startsWith("#")||isNaN(Number(`0x${e.slice(1)}`)))return null;switch(e.length){case 4:case 5:{const r=parseInt(e.slice(1,2),16),n=parseInt(e.slice(2,3),16),l=parseInt(e.slice(3,4),16),t=4===e.length?15:parseInt(e.slice(4),16);return[r+16*r,n+16*n,l+16*l,(t+16*t)/255]}case 7:case 9:return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16),(7===e.length?255:parseInt(e.slice(7),16))/255];default:return null}}function s(e){const r=e.toLowerCase().match(/^(rgba?|hsla?)\(([\s.\-,%0-9]+)\)/);if(r){const e=r[2].split(/\s*,\s*/),n=r[1];if("rgb"===n&&3===e.length||"rgba"===n&&4===e.length){if(e[0].endsWith("%")){const r=e.map(e=>2.56*parseFloat(e));return 4===e.length&&(r[3]=parseFloat(e[3])),u(r)}return u(e.map(e=>parseFloat(e)))}if("hsl"===n&&3===e.length||"hsla"===n&&4===e.length)return a(parseFloat(e[0]),parseFloat(e[1])/100,parseFloat(e[2])/100,parseFloat(e[3]??"1"))}return null}function u(e){return e[0]=h(e[0]),e[1]=h(e[1]),e[2]=h(e[2]),e[3]=4===e.length?c(e[3]):1,e}function g(e){let l=r(e)?n(e):null;return l??=s(e),l??=o(e),l}function d(e){const r=g(e);return null!=r?[r[0]/255,r[1]/255,r[2]/255,r[3]]:null}function c(e){return m(e,0,1)}function h(e){return Math.round(m(e,0,255))}function m(e,r,n){return e=Number(e),isNaN(e)?n:e<r?r:e>n?n:e}const p=2.2;export{p as colorGamma,o as cssHexToRgba,s as cssToRgba,n as getNamedColor,l as getNamedColorCopy,i as hexToRgba,a as hslaToRgba,r as isNamedColor,g as parseRgba,d as parseToUnitRgba,c as sanitizeAlpha,h as sanitizeRgbComponent};
|
package/config.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.
|
|
5
|
+
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.46";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
|
package/core/BidiEngine.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{aLefTable as t,feTo06Table as r,impTabRtl as e,impTabLtr as n,ubatB as
|
|
5
|
+
import{aLefTable as t,feTo06Table as r,impTabRtl as e,impTabLtr as n,ubatB as i,arabicAlefBetIntervalsBegine as o,arabicAlefBetIntervalsEnd as a,baseForm as s,medialForm as u,standAlonForm as f,primaryTable as c,unicodeTable as l,tbbase as h,ubatOn as T,ubatAn as L,ubatEn as A,typesNames as d,ubatS as g,ubatWs as m,swapTable as F,ubatR as p,ubatAl as R,ubatL as b,lamAlefInialTableFE as U,lamAlefMedialTableFE as B,finalForm as S,initialForm as w,isolatedForm as _,ubatNsm as v,ubatEt as N}from"./bidiEngineTables.js";class C{constructor(){this.inputFormat="ILYNN",this.outputFormat="VLNNN",this.sourceToTarget=[],this.targetToSource=[],this.levels=[]}bidiTransform(t,r,e){if(this.sourceToTarget=[],this.targetToSource=[],!t)return"";if(it(this.sourceToTarget,this.targetToSource,t.length),!this.checkParameters(r,e))return t;r=this.inputFormat,e=this.outputFormat;let n=t;const i=ct,o=rt(r.charAt(1)),a=rt(e.charAt(1)),s=(r.startsWith("I")?"L":r.charAt(0))+o,u=(e.startsWith("I")?"L":e.charAt(0))+a,f=r.charAt(2)+e.charAt(2);i.defInFormat=s,i.defOutFormat=u,i.defSwap=f;const c=V(t,s,u,f,i);let l=!1;return"R"===e.charAt(1)?l=!0:"C"!==e.charAt(1)&&"D"!==e.charAt(1)||(l="rtl"===this.checkContextual(c)),this.sourceToTarget=st,this.targetToSource=ot(this.sourceToTarget),ut=this.targetToSource,n=r.charAt(3)===e.charAt(3)?c:"S"===e.charAt(3)?I(l,c):W(c,l,!0),this.sourceToTarget=st,this.targetToSource=ut,this.levels=ft,n}_inputFormatSetter(t){if(!At.test(t))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.inputFormat=t}_outputFormatSetter(t){if(!At.test(t))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.outputFormat=t}checkParameters(t,r){return t?this._inputFormatSetter(t):t=this.inputFormat,r?this._outputFormatSetter(r):r=this.outputFormat,t!==r}checkContextual(t){let r=x(t);if("ltr"!==r&&"rtl"!==r){try{r=document.dir.toLowerCase()}catch(e){}"ltr"!==r&&"rtl"!==r&&(r="ltr")}return r}hasBidiChar(t){return dt.test(t)}}function V(t,r,e,n,i){const o=E(t,{inFormat:r,outFormat:e,swap:n},i);if(o.inFormat===o.outFormat)return t;r=o.inFormat,e=o.outFormat,n=o.swap;const a=r.slice(0,1),s=r.slice(1,4),u=e.slice(0,1),f=e.slice(1,4);if(i.inFormat=r,i.outFormat=e,i.swap=n,"L"===a&&"VLTR"===e){if("LTR"===s)return i.dir=Tt,k(t,i);if("RTL"===s)return i.dir=Lt,k(t,i)}if("V"===a&&"V"===u)return i.dir="RTL"===s?Lt:Tt,z(t,i);if("L"===a&&"VRTL"===e)return"LTR"===s?(i.dir=Tt,t=k(t,i)):(i.dir=Lt,t=k(t,i)),z(t);if("VLTR"===r&&"LLTR"===e)return i.dir=Tt,k(t,i);if("V"===a&&"L"===u&&s!==f)return t=z(t),"RTL"===s?V(t,"LLTR","VLTR",n,i):V(t,"LRTL","VRTL",n,i);if("VRTL"===r&&"LRTL"===e)return V(t,"LRTL","VRTL",n,i);if("L"===a&&"L"===u){const r=i.swap;return i.swap=r.slice(0,1)+"N","RTL"===s?(i.dir=Lt,t=k(t,i),i.swap="N"+r.slice(1,3),i.dir=Tt,t=k(t,i)):(i.dir=Tt,t=k(t,i),i.swap="N"+r.slice(1,3),t=V(t,"VLTR","LRTL",i.swap,i)),t}return t}function E(t,r,e){if(void 0===r.inFormat&&(r.inFormat=e.defInFormat),void 0===r.outFormat&&(r.outFormat=e.defOutFormat),void 0===r.swap&&(r.swap=e.defSwap),r.inFormat===r.outFormat)return r;const n=r.inFormat.slice(0,1),i=r.outFormat.slice(0,1);let o,a=r.inFormat.slice(1,4),s=r.outFormat.slice(1,4);return a.startsWith("C")&&(o=x(t),a="ltr"===o||"rtl"===o?o.toUpperCase():"L"===r.inFormat.charAt(2)?"LTR":"RTL",r.inFormat=n+a),s.startsWith("C")&&(o=x(t),"rtl"===o?s="RTL":"ltr"===o?(o=O(t),s=o.toUpperCase()):s="L"===r.outFormat.charAt(2)?"LTR":"RTL",r.outFormat=i+s),r}function I(t,r,e){if(0===r.length)return"";void 0===t&&(t=!0);const n=(r=String(r)).split("");let i=0,o=1,a=n.length;t||(i=n.length-1,o=-1,a=1);const s=j(n,i,o,a);let u="";for(let f=0;f<n.length;f++)M(s,s.length,f)>-1?(at(ut,f,!t,-1),st.splice(f,1)):u+=n[f];return u}function j(t,r,e,n,i){let o=0;const a=[];let s=0;for(let u=r;u*e<n;u+=e)if(Z(t[u])||tt(t[u])){if("ل"===t[u]&&q(t,u+e,e,n)){t[u]=nt(t[u+e],0===o?U:B),u+=e,et(t,u,e,n),a[s]=u,s++,o=0;continue}const r=t[u];1===o?t[u]=$(t,u+e,e,n)?Q(t[u]):X(t[u],S):!0===$(t,u+e,e,n)?t[u]=X(t[u],w):t[u]=X(t[u],_),tt(r)||(o=1),!0===K(r)&&(o=0)}else o=0;return a}function x(t){const r=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(t);return r?r[0]<="z"?"ltr":"rtl":""}function O(t){const r=t.split("");return r.reverse(),x(r.join(""))}function W(e,n,i){if(0===e.length)return"";void 0===n&&(n=!0);let o="";const a=(e=String(e)).split("");for(let s=0;s<e.length;s++){let u=!1;if(a[s]>="ﹰ"&&a[s]<"\ufeff"){const f=e.charCodeAt(s);a[s]>="ﻵ"&&a[s]<="ﻼ"?(n?(s>0&&i&&" "===a[s-1]?o=o.slice(0,-1)+"ل":(o+="ل",u=!0),o+=t[(f-65269)/2]):(o+=t[(f-65269)/2],o+="ل",s+1<e.length&&i&&" "===a[s+1]?s++:u=!0),u&&(at(ut,s,!0,1),st.splice(s,0,st[s]))):o+=r[f-65136]}else o+=a[s]}return o}function k(t,r){const e=t.split(""),n=[];return y(e,n,r),Y(e,n,r),G(2,e,n,r),G(1,e,n,r),ft=n,e.join("")}function y(t,r,o){const a=t.length,s=o.dir?e:n;let u=0,f=-1;const c=[],l=[];o.hiLevel=o.dir,o.lastArabic=!1,o.hasUbatAl=!1,o.hasUbatB=!1,o.hasUbatS=!1;for(let e=0;e<a;e++)c[e]=P(t[e]);for(let e=0;e<a;e++){const n=u,a=H(t,c,l,e,o);l[e]=a,u=s[n][a];const h=240&u;u&=15;const T=s[u][lt];if(r[e]=T,h>0)if(16===h){for(let t=f;t<e;t++)r[t]=1;f=-1}else f=-1;if(s[u][ht])-1===f&&(f=e);else if(f>-1){for(let t=f;t<e;t++)r[t]=T;f=-1}c[e]===i&&(r[e]=0),o.hiLevel|=T}o.hasUbatS&&D(c,r,a,o)}function D(t,r,e,n){for(let i=0;i<e;i++)if(t[i]===g){r[i]=n.dir;for(let e=i-1;e>=0&&t[e]===m;e--)r[e]=n.dir}}function Y(t,r,e){if(0!==e.hiLevel&&e.swap[0]!==e.swap[1])for(let n=0;n<t.length;n++)1===r[n]&&(t[n]=J(t[n]))}function P(t){const r=t.charCodeAt(0),e=c[r>>8];return e<h?e:l[e-h][255&r]}function z(t,r){const e=t.split("");if(r){const t=[];y(e,t,r),ft=t}return e.reverse(),st.reverse(),e.join("")}function M(t,r,e){for(let n=0;n<r;n++)if(t[n]===e)return n;return-1}function Z(t){for(let r=0;r<o.length;r++)if(t>=o[r]&&t<=a[r])return!0;return!1}function $(t,r,e,n){for(;r*e<n&&tt(t[r]);)r+=e;return!!(r*e<n&&Z(t[r]))}function q(r,e,n,i){for(;e*n<i&&tt(r[e]);)e+=n;let o=" ";if(!(e*n<i))return!1;o=r[e];for(let a=0;a<t.length;a++)if(t[a]===o)return!0;return!1}function G(t,r,e,n){if(n.hiLevel<t)return;if(1===t&&n.dir===Lt&&!n.hasUbatB)return r.reverse(),void st.reverse();const i=r.length;let o,a,s,u,f,c=0;for(;c<i;){if(e[c]>=t){for(o=c+1;o<i&&e[o]>=t;)o++;for(a=c,s=o-1;a<s;a++,s--)u=r[a],r[a]=r[s],r[s]=u,f=st[a],st[a]=st[s],st[s]=f;c=o}c++}}function H(t,r,e,n,o){const a=r[n];return{UBAT_L:()=>(o.lastArabic=!1,b),UBAT_R:()=>(o.lastArabic=!1,p),UBAT_ON:()=>T,UBAT_AN:()=>L,UBAT_EN:()=>o.lastArabic?L:A,UBAT_AL:()=>(o.lastArabic=!0,o.hasUbatAl=!0,p),UBAT_WS:()=>T,UBAT_CS:()=>{let t,i;return n<1||n+1>=r.length||(t=e[n-1])!==A&&t!==L||(i=r[n+1])!==A&&i!==L?T:(o.lastArabic&&(i=L),i===t?i:T)},UBAT_ES:()=>(n>0?e[n-1]:i)===A&&n+1<r.length&&r[n+1]===A?A:T,UBAT_ET:()=>{if(n>0&&e[n-1]===A)return A;if(o.lastArabic)return T;let t=n+1;const i=r.length;for(;t<i&&r[t]===N;)t++;return t<i&&r[t]===A?A:T},UBAT_NSM:()=>{if("VLTR"===o.inFormat){const e=r.length;let i=n+1;for(;i<e&&r[i]===v;)i++;if(i<e){const e=t[n].charCodeAt(0),o=e>=1425&&e<=2303||64286===e,a=r[i];if(o&&(a===p||a===R))return p}}return n<1||r[n-1]===i?T:e[n-1]},UBAT_B:()=>(o.lastArabic=!0,o.hasUbatB=!0,o.dir),UBAT_S:()=>(o.hasUbatS=!0,T),UBAT_LRE:()=>(o.lastArabic=!1,T),UBAT_RLE:()=>(o.lastArabic=!1,T),UBAT_LRO:()=>(o.lastArabic=!1,T),UBAT_RLO:()=>(o.lastArabic=!1,T),UBAT_PDF:()=>(o.lastArabic=!1,T),UBAT_BN:()=>T}[d[a]]()}function J(t){let r,e=0,n=F.length-1;for(;e<=n;)if(r=Math.floor((e+n)/2),t<F[r][0])n=r-1;else{if(!(t>F[r][0]))return F[r][1];e=r+1}return t}function K(t){for(let r=0;r<f.length;r++)if(f[r]===t)return!0;return!1}function Q(t){for(let r=0;r<s.length;r++)if(t===s[r])return u[r];return t}function X(t,r){for(let e=0;e<s.length;e++)if(t===s[e])return r[e];return t}function tt(t){return t>="ً"&&t<="ٕ"}function rt(t){return"L"===t?"LTR":"R"===t?"RTL":"C"===t?"CLR":"D"===t?"CRL":""}function et(t,r,e,n){for(;r*e<n&&tt(t[r]);)r+=e;return r*e<n&&(t[r]=" ",!0)}function nt(r,e){for(let n=0;n<t.length;n++)if(r===t[n])return e[n];return r}function it(t,r,e){st=[],ft=[];for(let n=0;n<e;n++)t[n]=n,r[n]=n,st[n]=n}function ot(t){const r=new Array(t.length);for(let e=0;e<t.length;e++)r[t[e]]=e;return r}function at(t,r,e,n){for(let i=0;i<t.length;i++)(t[i]>r||!e&&t[i]===r)&&(t[i]+=n)}let st=[],ut=[],ft=[];const ct={dir:0,defInFormat:"LLTR",defSwap:"YN",inFormat:"LLTR",outFormat:"VLTR",swap:"YN",hiLevel:0,lastArabic:!1,hasUbatAl:!1,defOutFormat:""},lt=5,ht=6,Tt=0,Lt=1,At=/^[(I|V)][(L|RCD)][(Y|N)][(S|N)]N$/,dt=/[\u0591-\u06ff\ufb1d-\ufefc]/;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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{pathToArray as t,getProperties as n,isPropertyDeclared as r}from"./utils.js";function
|
|
5
|
+
import{pathToArray as t,getProperties as n,isPropertyDeclared as r}from"./utils.js";function i(t,i){const e=t.endsWith("?")?t.slice(0,-1):t;if(null!=i.getItemAt||Array.isArray(i)){const t=parseInt(e,10);if(!isNaN(t))return Array.isArray(i)?i[t]:i.at(t)}const u=n(i);return r(u,e)?u.get(e):i[e]}function e(t,n,r){if(null==t)return t;const u=i(n[r],t);return!u&&r<n.length-1?void 0:r===n.length-1?u:e(u,n,r+1)}function u(n,r,u=0){return"string"!=typeof r||r.includes(".")?e(n,t(r),u):i(r,n)}function o(t,n){return u(t,n)}function s(t,n){return void 0!==u(n,t)}export{s as exists,o as get,u as valueOf};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{valueOf as e,exists as t}from"./get.js";import{getProperties as r}from"./utils.js";import{originSpecificReadPropertyDefinition as o,originSpecificPropertyDefinition as
|
|
5
|
+
import{valueOf as e,exists as t}from"./get.js";import{getProperties as r}from"./utils.js";import{originSpecificReadPropertyDefinition as o,originSpecificPropertyDefinition as s}from"./extensions/serializableProperty.js";function n(e,r,o){if(!e?.read||!1===e.read.enabled||!e.read.source)return!1;const s=e.read.source;if("string"==typeof s){if(s===r)return!0;if(s.includes(".")&&s.startsWith(r)&&t(s,o))return!0}else for(const n of s){if(n===r)return!0;if(n.includes(".")&&n.startsWith(r)&&t(n,o))return!0}return!1}function i(e){return e&&(!e.read||!1!==e.read.enabled&&!e.read.source)}function a(e,t,r,s,a){let f=o(t[r],a);i(f)&&(e[r]=!0);for(const i of Object.getOwnPropertyNames(t))f=o(t[i],a),n(f,r,s)&&(e[i]=!0)}function f(e,t,r,o){const n=r.metadata,i=s(n[t],o),a=i?.default;if(void 0===a)return;const f="function"==typeof a?a.call(e,t,o):a;void 0!==f&&r.set(t,f)}const c={origin:"service"};function u(t,s,n=c){if(!s||"object"!=typeof s)return;const i=r(t),u=i.metadata,d={};for(const e of Object.getOwnPropertyNames(s))a(d,u,e,s,n);i.setDefaultOrigin(n.origin);for(const r of Object.getOwnPropertyNames(d)){const a=o(u[r],n).read,f=a?.source;let c;c=f&&"string"==typeof f?e(s,f):s[r],a?.reader&&(c=a.reader.call(t,c,s,n)),void 0!==c&&i.set(r,c)}if(!n||!n.ignoreDefaults){i.setDefaultOrigin("defaults");for(const e of Object.getOwnPropertyNames(u))d[e]||f(t,e,i,n)}i.setDefaultOrigin("user")}function d(e,t,r,o=c){const s={...o,messages:[]};r(s),s.messages?.forEach(t=>{"warning"!==t.type||e.loaded?o?.messages&&o.messages.push(t):e.loadWarnings.push(t)})}export{u as read,d as readLoadable};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../has.js";import t from"../Logger.js";import{pathToArray as n,getProperties as r}from"./utils.js";import{Flags as e}from"./tracking/Flags.js";import{TrackingTarget as i}from"./tracking/TrackingTarget.js";const o=new i,c=[];let s=o;function a(t){s.onAccessed(t)}let l=!1,g=!1;function f(t,n,r){if(l)return p(t,n,r);let e=null;return k(t),e=n.call(r),
|
|
5
|
+
import"../has.js";import t from"../Logger.js";import{pathToArray as n,getProperties as r}from"./utils.js";import{Flags as e}from"./tracking/Flags.js";import{TrackingTarget as i}from"./tracking/TrackingTarget.js";const o=new i,c=[];let s=o;function a(t){s.onAccessed(t)}let l=!1,g=!1;function f(t,n,r){if(l)return p(t,n,r);let e=null;return k(t),e=n.call(r),d(),e}function u(t,n){return f(o,t,n)}function p(n,r,e){const i=l;l=!0,k(n);let o=null;try{o=r.call(e)}catch(c){g&&t.getLogger("esri.core.accessorSupport.tracking").error(c)}return d(),l=i,o}function k(t){s=t,c.push(t)}function d(){const t=c.length;if(t>1){const n=c.pop();s=c[t-2],n.onTrackingEnd()}else if(1===t){const t=c.pop();s=o,t.onTrackingEnd()}else s=o}function m(t,n){if(n.flags&e.DepTrackingInitialized)return;n.flags|=e.DepTrackingInitialized;const r=g;g=!1,n.flags&e.AutoTracked?p(n.trackingTarget,n.metadata.get,t):y(t,n),g=r}const T=[];function y(t,r){r.flags&e.ExplicitlyTracking||(r.flags|=e.ExplicitlyTracking,p(r.trackingTarget,()=>{const e=r.metadata.dependsOn||T;for(const r of e)if("string"!=typeof r||r.includes(".")){const e=n(r);for(let n=0,r=t;n<e.length&&null!=r&&"object"==typeof r;++n)r=h(r,e[n],n!==e.length-1)}else h(t,r,!1)}),r.flags&=~e.ExplicitlyTracking)}function h(t,n,e){const i=n.endsWith("?")?n.slice(0,-1):n;if(null!=t.getItemAt||Array.isArray(t)){const n=parseInt(i,10);if(!isNaN(n))return Array.isArray(t)?t[n]:t.at(n)}const o=r(t);if(o){const n=o.propertiesByName.get(i);n&&(a(n),m(t,n))}return e?t[i]:void 0}export{m as initializeDependencyTracking,f as runTracked,p as runTrackedNoThrow,u as runUntracked,a as trackAccess,y as trackExplicitDependencies};
|
package/core/screenUtils.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const n=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,t="screenUtils.toPt: input not recognized!",r=96;function u(n){return n?n/72*r:0}function e(n){return n?72*n/r:0}function o(r){if("string"==typeof r){const u=r.match(n);if(u){const n=Number(u[1]),t=u[3]&&u[3].toLowerCase(),o="-"
|
|
5
|
+
const n=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,t="screenUtils.toPt: input not recognized!",r=96;function u(n){return n?n/72*r:0}function e(n){return n?72*n/r:0}function o(r){if("string"==typeof r){const u=r.match(n);if(u){const n=Number(u[1]),t=u[3]&&u[3].toLowerCase(),o=r.startsWith("-"),i="px"===t?e(n):n;return o?-i:i}return console.warn(t),null}return r}function i(n=0,t=0){return{x:n,y:t}}function c(n){return n?i(n.x,n.y):null}function f(n=0,t=0){return[n,t]}function s(n=0,t=0){return{x:n,y:t}}function x(n=0,t=0){return l([n,t])}function y(n=0,t=0,r=0){return p([n,t,r])}function l(n){return n}function p(n){return n}function a(n){return n}function d(n,t){return t?(t.x=n[0],t.y=n[1],t):{x:n[0],y:n[1]}}function g(n,t){return t?(t[0]=n.x,t[1]=n.y,t.length>2&&(t[2]=0),t):[n.x,n.y]}export{l as castRenderScreenPointArray,p as castRenderScreenPointArray3,a as castScreenPointArray,c as cloneScreenPoint,s as createRenderScreenPoint,x as createRenderScreenPointArray,y as createRenderScreenPointArray3,i as createScreenPoint,f as createScreenPointArray,u as pt2px,e as px2pt,d as screenPointArrayToObject,g as screenPointObjectToArray,o as toPt};
|
package/core/sql/DateOnly.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createDateTimeZone as t,ArcadeDate as e}from"../../arcade/ArcadeDate.js";import{getLocale as a}from"../../intl/locale.js";import{DateTime as r,FixedOffsetZone as s}from"luxon";function o(t){t=t.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let e="";const a=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of t.match(a)||[])switch(r){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=r;break;default:r.length>=2&&"["
|
|
5
|
+
import{createDateTimeZone as t,ArcadeDate as e}from"../../arcade/ArcadeDate.js";import{getLocale as a}from"../../intl/locale.js";import{DateTime as r,FixedOffsetZone as s}from"luxon";function o(t){t=t.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let e="";const a=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of t.match(a)||[])switch(r){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=r;break;default:r.length>=2&&r.startsWith("[")&&r.endsWith("]")?e+=`'${r.slice(1,-1)}'`:e+=`'${r}'`}return e}const n="esri.core.sql.dateonly";class i{constructor(t,e,a){this._year=t,this._month=e,this._day=a,this.declaredRootClass=n}static isDateOnly(t){return"object"==typeof t&&null!=t&&"declaredRootClass"in t&&t.declaredRootClass===n}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(t){return i.isDateOnly(t)&&t.day===this.day&&t.month===this.month&&t.year===this.year}clone(){return new i(this._year,this._month,this._day)}toDateTime(e){return r.fromObject({day:this.day,month:this.month,year:this.year},{zone:t(e)})}toDateTimeLuxon(e){return r.fromObject({day:this.day,month:this.month,year:this.year},{zone:t(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(t=null,r=!0){if(null===t||""===t)return this.toString();if(r&&(t=o(t)),!t)return"";const s=this.toDateTime("unknown");return e.dateTimeToArcadeDate(s).toFormat(t,{locale:a(),numberingSystem:"latn"})}toArcadeDate(){const t=this.toDateTime("unknown");return e.dateTimeToArcadeDate(t)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(t,e){return i.fromDateTime(this.toUTCDateTime().plus({[t]:e}))}toUTCDateTime(){return r.utc(this.year,this.month,this.day,0,0,0,0)}difference(t,e){switch(e.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(t.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===e?this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(t.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(t.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(t.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(t.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(t.toUTCDateTime(),"years").years}}static fromMilliseconds(t){const e=r.fromMillis(t,{zone:s.utcInstance});return e.isValid?i.fromParts(e.year,e.month,e.day):null}static fromSeconds(t){const e=r.fromSeconds(t,{zone:s.utcInstance});return e.isValid?i.fromParts(e.year,e.month,e.day):null}static fromReader(t){if(!t)return null;const e=t.split("-");return 3!==e.length?null:new i(parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10))}static fromParts(t,e,a){const r=new i(t,e,a);return!1===r.isValid?null:r}static fromDateJS(t){return i.fromParts(t.getFullYear(),t.getMonth()+1,t.getDay())}static fromDateTime(t){return i.fromParts(t.year,t.month,t.day)}static fromSqlTimeStampOffset(t){return this.fromDateTime(t.toDateTime())}static fromString(t,e=null){if(""===t)return null;if(null===t)return null;const a=[];if(e)(e=o(e))&&a.push(e);else if(null===e||""===e){const e=r.fromISO(t,{setZone:!0});return e.isValid?i.fromParts(e.year,e.month,e.day):null}for(const s of a){const a=r.fromFormat(t,e??s);if(a.isValid)return new i(a.year,a.month,a.day)}return null}static fromNow(e="system"){const a=r.fromJSDate(new Date).setZone(t(e));return new i(a.year,a.month,a.day)}}export{i as DateOnly,o as standardizeDateOnlyFormat};
|
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.34/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 s}from"../portal/support/urlUtils.js";import{base64ToArrayBuffer as i,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 s=e[n];"string"==typeof s&&(s=e[n]=[s]),Array.isArray(s)?s.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 s=encodeURIComponent(e)+"=",i=n?.[e];return i?s+encodeURIComponent(i(r)):Array.isArray(r)?r.map(t=>o(t)?s+encodeURIComponent(JSON.stringify(t)):s+encodeURIComponent(t)).join("&"):o(r)?s+encodeURIComponent(JSON.stringify(r)):s+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=S(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 S(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 B(t){return t=(t=Ut(t=Ct(t=S(t).path),!0)).toLowerCase()}function H(t){const n={proxyUrl:t.proxyUrl,urlPrefix:B(t.urlPrefix)},e=c.proxyRules,r=n.urlPrefix;let o=e.length;for(let s=0;s<e.length;s++){const t=e[s].urlPrefix;if(0===r.indexOf(t)){if(r.length===t.length)return-1;o=s;break}0===t.indexOf(r)&&(o=s+1)}return e.splice(o,0,n),o}function T(t){const n=c.proxyRules,e=B(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=s(t),r=s(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=s(t),r=s(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=kt(t),o=kt(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=kt(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(),s=K(n).toLowerCase().replace(/\/+$/,""),i=e?K(e).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))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)===s.slice(0,l)+"/"&&(c=l+1,l!==o.length);)l=u(o,"/",l+1);if(-1===c)return t;if(i&&c<i.length)return t;t=r.slice(c);const f=s.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?i(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 st(t){return t.isBase64?`data:${t.mediaType};base64,${t.data}`:`data:${t.mediaType},${t.data}`}async function it(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=S(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),s=t.indexOf(":",r+2),i=Math.min(o<0?t.length:o,s<0?t.length:s);if(t.slice(r+2,i).toLowerCase()!==n.toLowerCase())return t;return`${t.slice(0,r+2)}${e}${t.slice(i)}`}function vt(t,n){const e=new URL(t);return e.host=n,e.port&&!m.test(n)&&(e.port=""),e.toString()}function Pt(t){return new URL(t).host}function kt(t){return"string"==typeof t?new x(_(t)):(t.scheme||(t.scheme=O.scheme),t)}function Et(t){return Nt.test(t)}function St(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 Bt(t,n,e){const r=I(t),o=r.query||{};return o[n]=String(e),`${r.path}?${v(o)}`}function Ht(t,n){if(!n)return t;const e=I(t),r=e.query||{};for(const[s,i]of Object.entries(n))null!=i&&(r[s]=i);const o=v(r);return o?`${e.path}?${o}`:e.path}function Tt(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 Wt(t){if(null==t)return null;const n=t.match(Jt);return n?n[2]:null}function zt(t){if(null==t)return null;const n=t.match(Jt);return n?{path:n[1],extension:n[2]}:{path:t,extension:null}}async function Dt(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 Jt=/([^.]*)\.([^/]*)$/,Nt=/(^data:image\/svg|\.svg$)/i;export{x as Url,k as addProxy,H as addProxyRule,Bt as addQueryParameter,Ht as addQueryParameters,et as base64UrlEncode,it as blobUrlToBlob,At as changeDomain,vt as changeHost,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,Pt as getHost,N as getInterceptor,X as getOrigin,Wt 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,Et as isSVG,M as isTrustedServer,V as join,_ as makeAbsolute,st as makeData,G as makeRelative,K as normalize,v as objectToQuery,Dt as parseData,A as queryToObject,Rt as removeFile,Tt as removeQueryParameter,St as removeQueryParameters,jt as removeTrailingSlash,zt 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 s}from"../portal/support/urlUtils.js";import{base64ToArrayBuffer as i,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,h=/^\s*http:/i,p=/^\s*https:/i,m=/^\s*file:/i,d=/:\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=W(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 W(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 s=e[n];"string"==typeof s&&(s=e[n]=[s]),Array.isArray(s)?s.push(o):e[n]=o}return e}function A(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 s=encodeURIComponent(e)+"=",i=n?.[e];return i?s+encodeURIComponent(i(r)):Array.isArray(r)?r.map(t=>o(t)?s+encodeURIComponent(JSON.stringify(t)):s+encodeURIComponent(t)).join("&"):o(r)?s+encodeURIComponent(JSON.stringify(r)):s+encodeURIComponent(r)}).filter(t=>t).join("&"):""}function v(t=!1){let n,r=c.proxyUrl;if("string"==typeof t){n=mt(t);const e=H(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 P(t,n=!1){const e=H(t);let r,o;if(e){const t=E(e.proxyUrl);r=t.path,o=t.query?W(t.query):null}else if(n){const n=v(t);r=n.path,o=n.query}if(r){const n=I(t);t=r+"?"+n.path;const e=A({...o,...n.query});e&&(t=`${t}?${e}`)}return t}const k={path:"",query:""};function E(t){const n=t.indexOf("?");return-1!==n?(k.path=t.slice(0,n),k.query=t.slice(n+1)):(k.path=t,k.query=null),k}function S(t){return t=(t=Ut(t=Ct(t=E(t).path),!0)).toLowerCase()}function B(t){const n={proxyUrl:t.proxyUrl,urlPrefix:S(t.urlPrefix)},e=c.proxyRules,r=n.urlPrefix;let o=e.length;for(let s=0;s<e.length;s++){const t=e[s].urlPrefix;if(r.startsWith(t)){if(r.length===t.length)return-1;o=s;break}t.startsWith(r)&&(o=s+1)}return e.splice(o,0,n),o}function H(t){const n=c.proxyRules,e=S(t);for(let r=0;r<n.length;r++)if(e.startsWith(n[r].urlPrefix))return n[r]}function T(t,n){if(!t||!n)return!1;t=J(t),n=J(n);const e=s(t),r=s(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=s(t),r=s(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=Pt(t),o=Pt(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=Pt(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]||(pt(t)||ht(t)?w[t]=[new x(_(t))]:w[t]=[new x(`http://${t}`),new x(`https://${t}`)]),w[t]}function _(t,n=q,e){return ht(t)?e?.preserveProtocolRelative?t:"http"===O.scheme&&O.authority===X(t).slice(2)?`http:${t}`:`https:${t}`:pt(t)?t:V(t.startsWith("/")?Ot(n):n,t)}function G(t,n=q,e){if(null==t||!Y(t))return t;const r=K(t),o=r.toLowerCase(),s=K(n).toLowerCase().replace(/\/+$/,""),i=e?K(e).toLowerCase().replace(/\/+$/,""):null;if(i&&!s.startsWith(i))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)===s.slice(0,l)+"/"&&(c=l+1,l!==o.length);)l=u(o,"/",l+1);if(-1===c)return t;if(i&&c<i.length)return t;t=r.slice(c);const f=s.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].startsWith("/")&&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&&ht(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 ht(t)||pt(t)}function Z(t){return null!=t&&t.startsWith("blob:")}function tt(t){return null!=t&&t.startsWith("data:")}function nt(t){const n=ot(t);return n?.isBase64?i(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 st(t){return t.isBase64?`data:${t.mediaType};base64,${t.data}`:`data:${t.mediaType},${t.data}`}async function it(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 ht(t){return null!=t&&t.startsWith("/")&&"/"===t[1]}function pt(t){return null!=t&&a.test(t)}function mt(t){return null!=t&&p.test(t)||"https"===O.scheme&&ht(t)}function dt(t){return null!=t&&h.test(t)||"http"===O.scheme&&ht(t)}function yt(t){return null!=t&&m.test(t)}function gt(t){return ht(t)?`http:${t}`:t.replace(p,"http:")}function $t(t){return ht(t)?`https:${t}`:t.replace(h,"https:")}function xt(){return"http"===O.scheme}function wt(){return"https"===O.scheme}function Ut(t,n=!1){return ht(t)?t.slice(2):(t=t.replace(a,""),n&&t.length>1&&t.startsWith("/")&&"/"===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=E(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(!dt(t))return t;const e=t.indexOf("/",7);let r;if(r=-1===e?t:t.slice(0,e),r=r.toLowerCase().slice(7),d.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()&&!H(t))&&(t=$t(t)),t}function Wt(t,n,e){if(!(n&&e&&t&&Y(t)))return t;const r=t.indexOf("//"),o=t.indexOf("/",r+2),s=t.indexOf(":",r+2),i=Math.min(o<0?t.length:o,s<0?t.length:s);if(t.slice(r+2,i).toLowerCase()!==n.toLowerCase())return t;return`${t.slice(0,r+2)}${e}${t.slice(i)}`}function At(t,n){const e=new URL(t);return e.host=n,e.port&&!d.test(n)&&(e.port=""),e.toString()}function vt(t){return new URL(t).host}function Pt(t){return"string"==typeof t?new x(_(t)):(t.scheme||(t.scheme=O.scheme),t)}function kt(t){return Nt.test(t)}function Et(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 St(t,n,e){const r=I(t),o=r.query||{};return o[n]=String(e),`${r.path}?${A(o)}`}function Bt(t,n){if(!n)return t;const e=I(t),r=e.query||{};for(const[s,i]of Object.entries(n))null!=i&&(r[s]=i);const o=A(r);return o?`${e.path}?${o}`:e.path}function Ht(t,n){const{path:e,query:r}=I(t);if(!r)return t;delete r[n];const o=A(r);return o?`${e}?${o}`:e}function Tt(t){if(null==t)return null;const n=t.match(Jt);return n?n[2]:null}function zt(t){if(null==t)return null;const n=t.match(Jt);return n?{path:n[1],extension:n[2]}:{path:t,extension:null}}async function Dt(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 Jt=/([^.]*)\.([^/]*)$/,Nt=/(^data:image\/svg|\.svg$)/i;export{x as Url,P as addProxy,B as addProxyRule,St as addQueryParameter,Bt as addQueryParameters,et as base64UrlEncode,it as blobUrlToBlob,Wt as changeDomain,At as changeHost,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,vt as getHost,N as getInterceptor,X as getOrigin,Tt as getPathExtension,H as getProxyRule,v as getProxyUrl,pt as hasProtocol,z as hasSameCanonicalArcGISOnlinePortal,T as hasSameCanonicalPortal,F as hasSameOrigin,D as hasSamePortal,Y as isAbsolute,wt as isAppHTTPS,Z as isBlobProtocol,tt as isDataProtocol,mt as isHTTPSProtocol,ht as isProtocolRelative,kt as isSVG,M as isTrustedServer,V as join,_ as makeAbsolute,st as makeData,G as makeRelative,K as normalize,A as objectToQuery,Dt as parseData,W as queryToObject,Rt as removeFile,Ht as removeQueryParameter,Et as removeQueryParameters,jt as removeTrailingSlash,zt as splitPathExtension,L as test,gt as toHTTP,$t as toHTTPS,w as trustedServersUrlCache,I as urlToObject};
|
package/core/uuid.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const t="randomUUID"in crypto;function n(){if(t)return crypto.randomUUID();const n=crypto.getRandomValues(new Uint16Array(8));n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;const r=t=>n[t].toString(16).padStart(4,"0");return r(0)+r(1)+"-"+r(2)+"-"+r(3)+"-"+r(4)+"-"+r(5)+r(6)+r(7)}function r(){return`{${n().toUpperCase()}}`}function o(){return`{${n()}}`}function e(t){const n=t.toUpperCase();return"{"
|
|
5
|
+
const t="randomUUID"in crypto;function n(){if(t)return crypto.randomUUID();const n=crypto.getRandomValues(new Uint16Array(8));n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;const r=t=>n[t].toString(16).padStart(4,"0");return r(0)+r(1)+"-"+r(2)+"-"+r(3)+"-"+r(4)+"-"+r(5)+r(6)+r(7)}function r(){return`{${n().toUpperCase()}}`}function o(){return`{${n()}}`}function e(t){const n=t.toUpperCase();return t.startsWith("{")?n:`{${n}}`}export{r as generateBracedUUID,o as generateLowercaseBracedUUID,n as generateUUID,e as normalizeGlobalID};
|
package/core/workers/registry.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const r={statsWorker:()=>import("../../smartMapping/statistics/support/statsWorker.js"),geometryEngineWorker:()=>import("../../geometry/geometryEngineWorker.js"),arcadeGeometryOperatorsWorker:()=>import("../../arcade/geometry/operatorsWorker.js"),CSVSourceWorker:()=>import("../../layers/graphics/sources/support/CSVSourceWorker.js"),EdgeProcessingWorker:()=>import("../../views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker.js"),ElevationSamplerWorker:()=>import("../../geometry/support/meshUtils/ElevationSamplerWorker.js"),FeatureServiceSnappingSourceWorker:()=>import("../../views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js"),GaussianSplatSortWorker:()=>import("../../views/3d/support/GaussianSplatSortWorker.js"),GeoJSONSourceWorker:()=>import("../../layers/graphics/sources/geojson/GeoJSONSourceWorker.js"),LercWorker:()=>import("../../layers/support/LercWorker.js"),MemorySourceWorker:()=>import("../../layers/graphics/sources/support/MemorySourceWorker.js"),PBFDecoderWorker:()=>import("../../views/3d/support/PBFDecoderWorker.js"),FeaturePipelineWorker:()=>import("../../views/2d/layers/features/FeaturePipelineWorker.js"),PointCloudWorker:()=>import("../../views/3d/layers/PointCloudWorker.js"),RasterWorker:()=>import("../../layers/support/RasterWorker.js"),SceneLayerSnappingSourceWorker:()=>import("../../views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js"),SceneLayerWorker:()=>import("../../views/3d/layers/SceneLayerWorker.js"),WFSSourceWorker:()=>import("../../layers/graphics/sources/WFSSourceWorker.js"),WorkerTileHandler:()=>import("../../views/2d/engine/vectorTiles/WorkerTileHandler.js"),Lyr3DWorker:()=>import("../../views/3d/layers/Lyr3DWorker.js"),Feature3DPipelineWorker:()=>import("../../views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js"),TextureCompressionWorker:()=>import("../../views/support/TextureCompressionWorker.js"),FlowWorker:()=>import("../../views/3d/support/flow/FlowWorker.js"),PanoramicMeshWorker:()=>import("../../widgets/PanoramicViewer/support/PanoramicMeshWorker.js")};export{r as registry};
|
|
5
|
+
const r={statsWorker:()=>import("../../smartMapping/statistics/support/statsWorker.js"),geometryEngineWorker:()=>import("../../geometry/geometryEngineWorker.js"),arcadeGeometryOperatorsWorker:()=>import("../../arcade/geometry/operatorsWorker.js"),CSVSourceWorker:()=>import("../../layers/graphics/sources/support/CSVSourceWorker.js"),EdgeProcessingWorker:()=>import("../../views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker.js"),ElevationSamplerWorker:()=>import("../../geometry/support/meshUtils/ElevationSamplerWorker.js"),FeatureServiceSnappingSourceWorker:()=>import("../../views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js"),GaussianSplatSortWorker:()=>import("../../views/3d/support/GaussianSplatSortWorker.js"),GeoJSONSourceWorker:()=>import("../../layers/graphics/sources/geojson/GeoJSONSourceWorker.js"),LercWorker:()=>import("../../layers/support/LercWorker.js"),MemorySourceWorker:()=>import("../../layers/graphics/sources/support/MemorySourceWorker.js"),PBFDecoderWorker:()=>import("../../views/3d/support/PBFDecoderWorker.js"),FeaturePipelineWorker:()=>import("../../views/2d/layers/features/FeaturePipelineWorker.js"),PointCloudWorker:()=>import("../../views/3d/layers/PointCloudWorker.js"),RasterWorker:()=>import("../../layers/support/RasterWorker.js"),SceneLayerSnappingSourceWorker:()=>import("../../views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js"),SceneLayerWorker:()=>import("../../views/3d/layers/SceneLayerWorker.js"),WFSSourceWorker:()=>import("../../layers/graphics/sources/WFSSourceWorker.js"),WorkerTileHandler:()=>import("../../views/2d/engine/vectorTiles/WorkerTileHandler.js"),Lyr3DWorker:()=>import("../../views/3d/layers/Lyr3DWorker.js"),Feature3DPipelineWorker:()=>import("../../views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js"),TextureCompressionWorker:()=>import("../../views/support/TextureCompressionWorker.js"),FlowWorker:()=>import("../../views/3d/support/flow/FlowWorker.js"),ParquetSourceWorker:()=>import("../../layers/graphics/sources/support/ParquetSourceWorker.js"),PanoramicMeshWorker:()=>import("../../widgets/PanoramicViewer/support/PanoramicMeshWorker.js")};export{r as registry};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{convertToSpatialReferenceUnit as e}from"../../../core/unitUtils.js";import{execute as t,executeMany as r}from"../gx/operatorGeneralize.js";import{getSpatialReference as n,fromGeometry as o,toGeometry as s,fromGeometries as a}from"../support/jsonConverter.js";function u(r,a,u={}){const{removeDegenerateParts:i=!1,unit:c}=u,m=n(r);c&&m&&(a=e(a,c,m));const p=o(r),l=t(p.getGeometry(),a,i);return null==l?null:s(l,p.getSpatialReference())}function i(t,o,u={}){const{removeDegenerateParts:i=!1,unit:c}=u,m=n(t);c&&m&&(o=e(o,c,m));const[p,l]=a(t);return r(p,o,i).map(e=>s(e,l))}export{u as execute,i as executeMany};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{execute as e,executeMany as t,isSimpleAsFeature as r}from"../gx/operatorSimplify.js";import{fromGeometry as o,toGeometry as n,fromGeometries as c}from"../support/jsonConverter.js";function p(t){const r=o(t),c=r.getSpatialReference();return n(e(r.getGeometry(),c,!1),c)}function a(e){const[r,o]=c(e);return t(r,o,!1).map(e=>n(e,o))}function i(e){const t=o(e);return r(t.getGeometry(),t.getSpatialReference(),!1)}export{p as execute,a as executeMany,i as isSimple};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../config.js";import{id as r}from"../kernel.js";import s from"../request.js";import i from"../core/Error.js";import{Evented as o,EventedAccessor as n}from"../core/Evented.js";import{on as a}from"../core/events.js";import{fixJson as h}from"../core/lang.js";import{getDeepValue as l}from"../core/object.js";import{createResolver as c,onAbort as d,isAborted as u}from"../core/promiseUtils.js";import{urlToObject as p,hasSameOrigin as _,Url as f,queryToObject as g,base64UrlEncode as m,objectToQuery as v,normalize as S,getProxyRule as w,makeAbsolute as I,addQueryParameters as A}from"../core/urlUtils.js";import{property as k}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import U from"./IdentityModal.js";import T from"./OAuthCredential.js";import x from"./OAuthInfo.js";import O from"./ServerInfo.js";import{isSecureProxyService as P,normalizeArcGISOnlineOrgDomain as R}from"../portal/support/urlUtils.js";const C={},D=e=>{const t=new f(e.owningSystemUrl).host,r=new f(e.server).host,s=/.+\.arcgis\.com$/i;return s.test(t)&&s.test(r)},b=(e,t)=>!!(D(e)&&t&&t.some(t=>t.test(e.server)));let q=null,j=null;try{q=window.localStorage,j=window.sessionStorage}catch{}class E extends o{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin="null"!==window.origin?window.origin:window.location.origin,this._appUrlObj=p(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^/]+\/[^/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^/]+).*/i,this._gwItem=/http.+\/items\/([^/]+).*/i,this._gwGroup=/http.+\/groups\/([^/]+).*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getPlatformSelfError=null,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const t=this.serverInfos;t?(e=e.filter(e=>!this.findServerInfo(e.server)),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach(e=>{e.owningSystemUrl&&this._portals.push(e.owningSystemUrl),e.hasPortal&&this._portals.push(e.server)})}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const e=this.findOAuthInfo(r.portalUrl);e&&t.splice(t.indexOf(e),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let s,i=this.findServerInfo(t),o=!0;i||(i=new O,i.server=this._getServerInstanceRoot(t),r?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(t),i.hasPortal=!0),this.registerServers([i])),s=this._findCredential(t),s?(delete e.server,Object.assign(s,e),o=!1):(s=new L({userId:e.userId,server:i.server??void 0,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),s.resources=[t],this.credentials.push(s)),s.emitTokenChange(!1),o||s.refreshServerTokens()}toJSON(){return h({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;"string"==typeof e&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,s=e.credentials;if(t){const e=[];t.forEach(t=>{t.server&&t.tokenServiceUrl&&e.push(t.declaredClass?t:new O(t))}),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach(t=>{t.appId&&e.push(t.declaredClass?t:new x(t))}),e.length&&this.registerOAuthInfos(e)}s&&s.forEach(e=>{e.server&&e.token&&e.expires&&e.expires>Date.now()&&((e=e.declaredClass?e:new L(e)).emitTokenChange(),this.credentials.push(e))})}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){if(!e)return;let r;e=this._sanitizeUrl(e);const s=this._isServerRsrc(e)?"server":"portal";if(t){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&t===i.userId&&i.scope===s){r=i;break}}else for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&-1!==this._getIdenticalSvcIdx(e,i)&&i.scope===s){r=i;break}return r}getCredential(e,t){let r,s=!1,o=!0;t&&(s=!(!t.token&&!t.credential),r=t.error,o=!1!==t.prompt),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,a=c();if(t.signal&&d(t.signal,()=>{n.abort()}),d(n,()=>{a.reject(new i("identity-manager:user-aborted","ABORTED"))}),u(n))return a.promise;t.signal=n.signal;const h=this._isAdminResource(e),l=s?this.findCredential(e):null;let p;if(l&&498===r?.details?.httpStatus)l.destroy();else if(l)return p=new i("identity-manager:not-authorized","You are currently signed in as: '"+l.userId+"'. You do not have access to this resource: "+e,{error:r}),a.reject(p),a.promise;const f=this._findCredential(e,t);if(f)return a.resolve(f),a.promise;let g=this.findServerInfo(e);if(g)!g.hasPortal&&g.server&&g.owningSystemUrl&&this._hasSameServerInstance(g.server,g.owningSystemUrl)&&(g.hasPortal=!0),!g.hasServer&&this._isServerRsrc(e)&&(g._restInfoPms=this._getTokenSvcUrl(e),g.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return p=new i("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),a.reject(p),a.promise;g=new O,g.server=this._getServerInstanceRoot(e),"string"==typeof t?(g.tokenServiceUrl=t,g.hasPortal=!0):(g._restInfoPms=t,g.hasServer=!0),this.registerServers([g])}return g.hasPortal&&void 0===g._selfReq&&(o||_(g.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(e=>e.tokenServiceUrl===g.tokenServiceUrl))&&(g._selfReq={owningTenant:t?.owningTenant,selfDfd:this._getPortalSelf(g.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,g,t,a,h)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const o=this._rePortalTokenSvc.test(e.tokenServiceUrl),n=new f(this._appOrigin),a=e.shortLivedTokenValidity;let h,l,c,d,u,p,g,m;t&&(m=this.tokenValidity||a||this._defaultTokenValidity,m>a&&a>0&&(m=a)),r&&(h=r.isAdmin,l=r.serverUrl,c=r.token,p=r.signal,g=r.ssl,e.customParameters=r.customParameters),h?d=e.adminTokenServiceUrl:(d=e.tokenServiceUrl,u=new f(d.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!g&&"http"===n.scheme&&(_(n.uri,d,!0)||"https"===u.scheme&&n.host===u.host&&"7080"===n.port&&"7443"===u.port)&&(d=d.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const v={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:l,token:c,expiration:m,referer:h||o?this._appOrigin:null,client:h?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:p,...r?.ioArgs};o||(v.withCredentials=!1);return s(d,v).then(r=>{const s=r.data;if(!s?.token)return new i("identity-manager:authentication-failed","Unable to generate token");const o=e.server;return C[o]||(C[o]={}),t&&(C[o][t.username]=t.password),s.validity=m,s})}isBusy(){return!!this._busy}async checkSignInStatus(e){return(await this.checkAppAccess(e,"")).credential}checkAppAccess(e,t,r){let o=!1;return this.getCredential(e,{prompt:!1}).then(n=>{let a;const h={f:"json"};if("portal"===n.scope)if(t&&(this._doPortalSignIn(e)||r?.force))a=n.server+"/sharing/rest/oauth2/validateAppAccess",h.client_id=t;else{if(!n.token)return{credential:n};a=n.server+"/sharing/rest"}else{if(!n.token)return{credential:n};a=n.server+"/rest/services"}return n.token&&(h.token=n.token),s(a,{query:h,authMode:"anonymous"}).then(e=>{if(!1===e.data.valid)throw new i("identity-manager:not-authorized",`You are currently signed in as: '${n.userId}'.`,e.data);return o=!!e.data.viewOnlyUserTypeApp,{credential:n}}).catch(e=>{if("identity-manager:not-authorized"===e.name)throw e;const t=e.details?.httpStatus;if(498===t)throw n.destroy(),new i("identity-manager:not-authenticated","User is not signed in.");if(400===t)throw new i("identity-manager:invalid-request","Bad request");return{credential:n}})}).then(e=>({credential:e.credential,viewOnly:o}))}setOAuthResponseHash(e){e&&("#"===e.charAt(0)&&(e=e.slice(1)),this._processOAuthPopupParams(g(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const s=c(),o=()=>{h?.remove(),l?.remove(),this.dialog?.destroy(),this.dialog=h=l=null},n=()=>{o(),this._oAuthDfd=null,s.reject(new i("identity-manager:user-aborted","ABORTED"))};r.signal&&d(r.signal,()=>{n()});const a=new U({open:!0,resource:this.getResourceName(e),server:t.server});this.dialog=a,this.emit("dialog-create");let h=a.on("cancel",n),l=a.on("submit",e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then(i=>{o();const n=new L({userId:e.username,server:t.server??void 0,token:i.token,expires:null!=i.expires?Number(i.expires):null,ssl:!!i.ssl,isAdmin:r.isAdmin,validity:i.validity});s.resolve(n)}).catch(e=>{a.error=e,a.signingIn=!1})});return s.promise}oAuthSignIn(e,t,r,s){this._oAuthDfd=c();const o=this._oAuthDfd;let n;s?.signal&&d(s.signal,()=>{const e=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;e&&!e.closed?e.close():this.dialog&&u()}),o.resUrl_=e,o.sinfo_=t,o.oinfo_=r;const a=r._oAuthCred;if(a.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&t.currentVersion>=8.4)){let e=crypto.getRandomValues(new Uint8Array(32));n=m(e),a.codeVerifier=n,e=crypto.getRandomValues(new Uint8Array(32)),a.stateUID=m(e),a.save()||(a.codeVerifier=n=null)}else a.codeVerifier=null;let h,l;this._getCodeChallenge(n).then(i=>{const o=!s||!1!==s.oAuthPopupConfirmation;if(!r.popup||!o)return void this._doOAuthSignIn(e,t,r,i);const n=new U({oAuthPrompt:!0,server:t.server,open:!0});this.dialog=n,this.emit("dialog-create"),h=n.on("cancel",u),l=n.on("submit",()=>{p(),this._doOAuthSignIn(e,t,r,i)})});const u=()=>{p(),this._oAuthDfd=null,o.reject(new i("identity-manager:user-aborted","ABORTED"))},p=()=>{h?.remove(),l?.remove(),this.dialog?.destroy(),this.dialog=null};return o.promise}destroyCredentials(){if(this.credentials){this.credentials.slice().forEach(e=>{e.destroy()})}this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=a(window,"message",t=>{if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&"arcgis:auth:requestCredential"===t.data?.type){const r=t.source;this.getCredential(e).then(e=>{r.postMessage({type:"arcgis:auth:credential",credential:{expires:e.expires,server:e.server,ssl:e.ssl,token:e.token,userId:e.userId}},t.origin)}).catch(e=>{r.postMessage({type:"arcgis:auth:error",error:{name:e.name,message:e.message}},t.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){"#"===e.charAt(0)&&(e=e.slice(1));const t=g(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),"access_denied"===t.error&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let t=window.location.search;if(t){"?"===t.charAt(0)&&(t=t.slice(1));const e=g(t);let r=!1;if(e.code&&e.state)try{e.state=JSON.parse(e.state),e.state.portalUrl&&e.state.uid&&(this._oAuthLocationParams=e,r=!0)}catch{}else if(e.error&&e.error_description&&(console.log("IdentityManager OAuth Error: ",e.error," - ",e.error_description),"access_denied"===e.error&&(r=!0,e.state)))try{e.state=JSON.parse(e.state)}catch{}if(r){const t={...e};["code","error","error_description","message_code","persist","state"].forEach(e=>{delete t[e]});const r=v(t),s=window.location.pathname+(r?`?${r}`:"")+(e.state?.hash||"");window.history.replaceState(window.history.state,"",s)}}}_getOAuthToken(e,t,r,i,o){return e=e.replace(/^http:/i,"https:"),s(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:i&&o?{grant_type:"authorization_code",code:t,redirect_uri:i,client_id:r,code_verifier:o}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then(e=>e.data)}async _getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t);return m(new Uint8Array(r))}return null}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const e=new i("identity-manager:user-aborted","ABORTED");this._errbackFunc(e)}}_findCredential(e,t){let r,s,i,o,n=-1;const a=t?.token,h=t?.resource,l=this._isServerRsrc(e)?"server":"portal",c=this.credentials.filter(t=>this._hasSameServerInstance(t.server,e)&&t.scope===l);if(e=h||e,c.length)if(1===c.length){if(r=c[0],i=this.findServerInfo(r.server),s=i?.owningSystemUrl,o=s?this.findCredential(s,r.userId):void 0,n=this._getIdenticalSvcIdx(e,r),!a)return-1===n&&r.resources.push(e),this._addResource(e,o),r;-1!==n&&(r.resources.splice(n,1),this._removeResource(e,o))}else{let t,r;if(c.some(a=>(r=this._getIdenticalSvcIdx(e,a),-1!==r&&(t=a,i=this.findServerInfo(t.server),s=i?.owningSystemUrl,o=s?this.findCredential(s,t.userId):void 0,n=r,!0))),a)t&&(t.resources.splice(n,1),this._removeResource(e,o));else if(t)return this._addResource(e,o),t}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t)for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}return t}_addResource(e,t){t&&-1===this._getIdenticalSvcIdx(e,t)&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return t?.isAdmin&&!_(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&"10.1"===String(e.currentVersion)&&!_(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new f(e);return t.scheme+"://"+t.host+(null!=t.port?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return-1===r&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),-1!==r||P(t)||(r=t.indexOf("/sharing")),-1===r&&t.endsWith("/")&&(r=t.length-1),r>-1?e.slice(0,r):e}_hasSameServerInstance(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=R(e),t=R(t),(e=e.slice(Math.max(0,e.indexOf(":"))))===(t=t.slice(Math.max(0,t.indexOf(":"))))}_sanitizeUrl(e){const r=(t.request.proxyUrl||"").toLowerCase(),s=r?e.toLowerCase().indexOf(r+"?"):-1;return-1!==s&&(e=e.slice(s+r.length+1)),e=S(e),p(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const s=this._getSuffix(e).toLowerCase(),i=this._getSuffix(t).toLowerCase();if(r=s===i,!r){const e=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=s.replaceAll(e,"$1")===i.replaceAll(e,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const r=new f(e.toLowerCase()),s=this._portalConfig;let i=this._gwDomains.some(e=>e.regex.test(r.uri));return!i&&s&&(i=this._hasSameServerInstance(this._getServerInstanceRoot(s.restBaseUrl),r.uri)),i||t.portalUrl&&(i=_(r,t.portalUrl,!0)),i||(i=this._portals.some(e=>this._hasSameServerInstance(e,r.uri))),i=i||this._agsPortal.test(r.path),i}_isIdProvider(e,t){let r=-1,s=-1;this._gwDomains.forEach((i,o)=>{-1===r&&i.regex.test(e)&&(r=o),-1===s&&i.regex.test(t)&&(s=o)});let i=!1;if(r>-1&&s>-1&&(0===r||4===r?0!==s&&4!==s||(i=!0):1===r?1!==s&&2!==s||(i=!0):2===r?2===s&&(i=!0):3===r&&3===s&&(i=!0)),!i){const r=this.findServerInfo(t),s=r?.owningSystemUrl;s&&D(r)&&this._isPortalDomain(s)&&this._isIdProvider(e,s)&&(i=!0)}return i}_getIdenticalSvcIdx(e,t){let r=-1;for(let s=0;s<t.resources.length;s++){const i=t.resources[s];if(this._isIdenticalService(e,i)){r=s;break}}return r}_getSuffix(e){return e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"$1")}_getTokenSvcUrl(e){let t,r,i;if(this._isRESTService(e)||this._isAdminResource(e)){const i=this._getServerInstanceRoot(e);return t=i+"/admin/generateToken",r=s(e=i+"/rest/info",{query:{f:"json"}}).then(e=>e.data),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let t="";if(this._gwDomains.some(r=>(r.regex.test(e)&&(t=r.tokenServiceUrl),!!t)),t||this._portals.some(r=>(this._hasSameServerInstance(r,e)&&(t=r+this._gwTokenUrl),!!t)),t||(i=e.toLowerCase().indexOf("/sharing"),-1!==i&&(t=e.slice(0,i)+this._gwTokenUrl)),t||(t=this._getOrigin(e)+this._gwTokenUrl),t){const r=new f(e).port;/^http:\/\//i.test(e)&&"7080"===r&&(t=t.replace(/:7080/i,":7443")),t=t.replace(/http:/i,"https:")}return t}}_processOAuthResponseParams(e,t,r){const s=t._oAuthCred;if(e.code){const i=s.codeVerifier;return s.codeVerifier=null,s.stateUID=null,s.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),i).then(i=>{const o=new L({userId:i.username,server:r.server??void 0,token:i.access_token,expires:Date.now()+1e3*i.expires_in,ssl:i.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=o.userId,s.storage=i.persist?q:j,s.refreshToken=i.refresh_token,s.token=null,s.expires=i.refresh_token_expires_in?Date.now()+1e3*i.refresh_token_expires_in:null,s.userId=o.userId,s.ssl=o.ssl,s.save(),o})}const i=new L({userId:e.username,server:r.server??void 0,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:"true"===e.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=i.userId,s.storage=e.persist?q:j,s.refreshToken=null,s.token=i.token,s.expires=i.expires,s.userId=i.userId,s.ssl=i.ssl,s.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r="access_denied"===e.error,s=new i(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(s)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then(e=>{t.resolve(e)}).catch(e=>{t.reject(e)})}_setOAuthResponseQueryString(e){e&&("?"===e.charAt(0)&&(e=e.slice(1)),this._processOAuthPopupParams(g(e)))}async _exchangeToken(e,t,r){return(await s(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}})).data.token}async _getPlatformSelf(e,t){if(this._getPlatformSelfError&&Date.now()-this._getPlatformSelfError[1]<1e3)throw this._getPlatformSelfError[0];e=e.replace(/^http:/i,"https:");try{const r=await s(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0});return this._getPlatformSelfError=null,r.data}catch(r){throw"OAUTH_0066"===r.details?.messageCode&&(this._getPlatformSelfError=[r,Date.now()]),r}}_getPortalSelf(e,t){let r;if(this._gwDomains.some(t=>(t.regex.test(e)&&(r=t.customBaseUrl),!!r)),r)return Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0});this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080"));return s(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(e=>e.data)}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,s=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(s?s.hasPortal||s.owningSystemUrl&&this._isPortalDomain(s.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||_(r,e,!0)))}_checkProtocol(e,t,r,s){let o=!0;const n=s?t.adminTokenServiceUrl:t.tokenServiceUrl;if(n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&w(n)&&(o=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!o)){r(new i("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection."))}return o}_enqueue(e,t,r,s,i,o){return s||(s=c()),s.resUrl_=e,s.sinfo_=t,s.options_=r,s.admin_=i,s.refresh_=o,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(s)):this._xoReqs.push(s):this._doSignIn(s),s.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=t=>{const r=e.options_?.resource,s=e.resUrl_,i=e.refresh_;let o=!1;this.credentials.includes(t)||(i&&this.credentials.includes(i)?(i.userId=t.userId,i.token=t.token,i.expires=t.expires,i.validity=t.validity,i.ssl=t.ssl,i.creationTime=t.creationTime,o=!0,t=i):this.credentials.push(t)),t.resources||(t.resources=[]),t.resources.includes(r||s)||t.resources.push(r||s),t.scope=this._isServerRsrc(s)?"server":"portal",t.emitTokenChange();const n=this._soReqs,a={};this._soReqs=[],n.forEach(e=>{if(!this._isIdenticalService(s,e.resUrl_)){const r=this._getSuffix(e.resUrl_);a[r]||(a[r]=!0,t.resources.push(e.resUrl_))}}),e.resolve(t),n.forEach(e=>{this._hasSameServerInstance(this._getServerInstanceRoot(s),e.resUrl_)?e.resolve(t):this._soReqs.push(e)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,o||this.emit("credential-create",{credential:t}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=t=>{e.reject(t),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},s=(o,n,h,l)=>{const c=e.sinfo_,u=!e.options_||!1!==e.options_.prompt,p=c.hasPortal&&this._findOAuthInfo(e.resUrl_);let f,g;if(o)t(new L({userId:o,server:c.server??void 0,token:h??void 0,expires:null!=l?Number(l):null,ssl:!!n}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const s=a(window,"message",e=>{e.source===window.parent&&e.data&&("arcgis:auth:credential"===e.data.type?(s.remove(),e.data.credential.expires<Date.now()?r(new i("identity-manager:credential-request-failed","Parent application's token has expired.")):t(new L(e.data.credential))):"arcgis:auth:error"===e.data.type&&(s.remove(),"tokenExpiredError"===e.data.error.name?r(new i("identity-manager:credential-request-failed","Parent application's token has expired.")):r(i.fromJSON(e.data.error))))});d(e.options_?.signal,()=>{s.remove()})}else if(p){let o=p._oAuthCred;if(!o){const e=new T(p,q),t=new T(p,j);e.isValid()&&t.isValid()?e.expires>t.expires?(o=e,t.destroy()):(o=t,e.destroy()):o=e.isValid()?e:t,p._oAuthCred=o}if(o.isValid()){f=new L({userId:o.userId??void 0,server:c.server??void 0,token:o.token??void 0,expires:o.expires,ssl:o.ssl??void 0,_oAuthCred:o});const i=p.appId!==o.appId&&this._doPortalSignIn(e.resUrl_);i||o.refreshToken?(e._pendingDfd=o.refreshToken?this._getOAuthToken(c.server,o.refreshToken,o.appId).then(e=>(f.expires=Date.now()+1e3*e.expires_in,f.token=e.access_token,f)):Promise.resolve(f),e._pendingDfd.then(e=>i?this._exchangeToken(e.server,p.appId,e.token).then(t=>(e.token=t,e)).catch(()=>e):e).then(e=>{t(e)}).catch(e=>{const t=e.details?.httpStatus;t>0&&404!==t?(o.destroy(),s()):r(e)})):t(f)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(p.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===o.stateUID&&o.codeVerifier)){const s=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(s,p,c).then(e=>{t(e)}).catch(r)}else{const s=()=>{u?e._pendingDfd=this.oAuthSignIn(e.resUrl_,c,p,e.options_).then(t,r):(g=new i("identity-manager:not-authenticated","User is not signed in."),r(g))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(c.server,p.appId).then(e=>{_(e.portalUrl,this._appOrigin,!0)?(f=new L({userId:e.username,server:c.server??void 0,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(f)):s()}).catch(s):s()}}else if(u){if(this._checkProtocol(e.resUrl_,c,r,e.admin_)){let s=e.options_;e.admin_&&(s=s||{},s.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,c,s).then(t,r)}}else g=new i("identity-manager:not-authenticated","User is not signed in."),r(g)},o=()=>{const s=e.sinfo_,i=s.owningSystemUrl,o=e.options_;let n,a,h,l;if(o&&(n=o.token,a=o.error,h=o.prompt),l=this._findCredential(i,{token:n,resource:e.resUrl_}),!l)for(const e of this.credentials)if(this._isIdProvider(i,e.server)){l=e;break}if(l){const i=this.findCredential(e.resUrl_,l.userId);if(i)t(i);else if(b(s,this._legacyFed)){const e=l.toJSON();e.server=s.server,e.resources=null,t(new L(e))}else{(e._pendingDfd=this.generateToken(this.findServerInfo(l.server),null,{serverUrl:e.resUrl_,token:l.token,signal:e.options_.signal,ssl:l.ssl})).then(r=>{t(new L({userId:l?.userId,server:s.server??void 0,token:r.token,expires:null!=r.expires?Number(r.expires):null,ssl:!!r.ssl,isAdmin:e.admin_,validity:r.validity}))},r)}}else{this._busy=null,n&&(e.options_.token=null);(e._pendingDfd=this.getCredential(i.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:s.owningTenant,signal:e.options_.signal,token:n,error:a,prompt:h})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},t=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(t)})}};this._errbackFunc=r;const n=e.sinfo_.owningSystemUrl,h=this._isServerRsrc(e.resUrl_),c=e.sinfo_._restInfoPms;c?c.promise.then(t=>{const r=e.sinfo_;if(r._restInfoPms){r.adminTokenServiceUrl=r._restInfoPms.adminUrl,r._restInfoPms=null,r.tokenServiceUrl=(l("authInfo.tokenServicesUrl",t)||l("authInfo.tokenServiceUrl",t)||l("tokenServiceUrl",t))??null,r.shortLivedTokenValidity=l("authInfo.shortLivedTokenValidity",t)??null,r.currentVersion=t.currentVersion,r.owningTenant=t.owningTenant;const e=r.owningSystemUrl=t.owningSystemUrl;e&&this._portals.push(e)}h&&r.owningSystemUrl?o():s()},()=>{e.sinfo_._restInfoPms=null;const t=new i("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(t)}):h&&n?o():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(t=>{const r={};let s,i,o,n;return t&&(s=t.user?.username,r.username=s,r.allSSL=t.allSSL,i=t.supportsOAuth,n=parseFloat(t.currentVersion),"multitenant"===t.portalMode&&(o=t.customBaseUrl),e.sinfo_.currentVersion=n),e.sinfo_.webTierAuth=!!s,s&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:r.allSSL}).catch(()=>null).then(e=>(r.portalToken=e?.token,r.tokenExpiration=e?.expires,r)):!s&&i&&n>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:o,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>r):r}).catch(()=>null).then(t=>{e.sinfo_._selfReq=null,t?s(t.username,t.allSSL,t.portalToken,t.tokenExpiration):s()}):s()}_generateOAuthInfo(e){let t,r=null,i=e.portalUrl;const o=e.customBaseUrl,n=e.owningTenant,a=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){r=this._appUrlObj.path;const e=r.search(/\/(apps|home)\//);r=e>-1?r.slice(0,e):null}return a&&r?(this._hasTestedIfAppIsOnPortal=!0,t=s(r+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new x({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})})):t=Promise.resolve(),t.then(()=>{if(this._defaultOAuthInfo)return i=i.replace(/^http:/i,"https:"),s(i+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:I(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(e=>{if(e.data.valid){const t=this._defaultOAuthInfo.clone();e.data.urlKey&&o?t.portalUrl="https://"+e.data.urlKey.toLowerCase()+"."+o:t.portalUrl=i,t.popup=window!==window.top||!(_(i,this._appOrigin)||this._gwDomains.some(e=>e.regex.test(i)&&e.regex.test(this._appOrigin))),this.oAuthInfos.push(t)}})})}_doOAuthSignIn(e,t,r,s){const o=r._oAuthCred,n={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),o.stateUID&&(n.uid=o.stateUID);const h={client_id:r.appId,response_type:o.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!o.codeVerifier)};r.forceLogin&&(h.force_login=!0),r.forceUserId&&r.userId&&(h.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(h.redirectToUserOrgUrl=!0),o.codeVerifier&&(h.code_challenge=s||o.codeVerifier,h.code_challenge_method=s?"S256":"plain");const l=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",c=l+"?"+v(h);if(r.popup){const e=window.open(c,"esriJSAPIOAuth",r.popupWindowFeatures);if(e)e.focus(),this._oAuthDfd.oAuthWin_=e,this._oAuthIntervalId=setInterval(()=>{if(e.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const e=this._oAuthDfd;if(e){const t=new i("identity-manager:user-aborted","ABORTED");e.reject(t)}}},500),this._oAuthOnPopupHandle=a(window,["arcgis:auth:hash","arcgis:auth:location:search"],e=>{"arcgis:auth:hash"===e.type?this.setOAuthResponseHash(e.detail):this._setOAuthResponseQueryString(e.detail)});else{const e=new i("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(e)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:h,authorizeUrl:l,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=c}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return I(e.popupCallbackUrl);if(t){const e=p(r);return e.query&&["code","error","error_description","message_code","persist","state"].forEach(t=>{delete e.query[t]}),A(e.path,e.query)}return r}}E.prototype.declaredClass="esri.identity.IdentityManagerBase";let L=class extends n{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e?._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],null==this.creationTime&&(this.creationTime=Date.now())}refreshToken(){const e=r,t=e.findServerInfo(this.server),s=t?.owningSystemUrl,i=!!s&&"server"===this.scope,o=i&&b(t,e._legacyFed),n=t.webTierAuth,a=n&&e.normalizeWebTierAuth,h=C[this.server],l=h?.[this.userId];let c,d=this.resources&&this.resources[0],u=i?e.findServerInfo(s):null,p={username:this.userId,password:l};if(n&&!a)return;i&&!u&&e.serverInfos.some(t=>(e._isIdProvider(s,t.server)&&(u=t),!!u));const _=u?e.findCredential(u.server,this.userId):null;if(!i||_){if(!o){if(i)c={serverUrl:d,token:_?.token,ssl:_?.ssl};else if(a)p=null,c={ssl:this.ssl};else{if(!l){let r;return d&&(d=e._sanitizeUrl(d),this._enqueued=1,r=e._enqueue(d,t,null,null,this.isAdmin,this),r.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),r}this.isAdmin&&(c={isAdmin:!0})}return e.generateToken(i?u:t,i?null:p,c).then(e=>{this.token=e.token,this.expires=null!=e.expires?Number(e.expires):null,this.creationTime=Date.now(),this.validity=e.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}_?.refreshToken()}}refreshServerTokens(){if("portal"===this.scope){const e=r;e.credentials.forEach(t=>{const r=e.findServerInfo(t.server),s=r?.owningSystemUrl;t!==this&&t.userId===this.userId&&s&&"server"===t.scope&&(e._hasSameServerInstance(this.server,s)||e._isIdProvider(s,this.server))&&(b(r,e._legacyFed)?(t.token=this.token,t.expires=this.expires,t.creationTime=this.creationTime,t.validity=this.validity,t.emitTokenChange()):t.refreshToken())})}}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=r,s=this.server?t.findServerInfo(this.server):null,i=s?.owningSystemUrl,o=i?t.findServerInfo(i):null;!1===e||i&&"portal"!==this.scope&&(!o?.webTierAuth||t.normalizeWebTierAuth)||null==this.expires&&null==this.validity||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const e=r,t=e.credentials.indexOf(this);t>-1&&e.credentials.splice(t,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=h({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),t=this.resources;return t&&t.length>0&&(e.resources=t.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,t=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>t&&(r=t),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};e([k()],L.prototype,"creationTime",void 0),e([k()],L.prototype,"expires",void 0),e([k()],L.prototype,"isAdmin",void 0),e([k()],L.prototype,"oAuthState",void 0),e([k()],L.prototype,"resources",void 0),e([k()],L.prototype,"scope",void 0),e([k()],L.prototype,"server",void 0),e([k()],L.prototype,"ssl",void 0),e([k()],L.prototype,"token",void 0),e([k()],L.prototype,"tokenRefreshBuffer",void 0),e([k()],L.prototype,"userId",void 0),e([k()],L.prototype,"validity",void 0),L=e([y("esri.identity.Credential")],L);export{L as Credential,E as IdentityManagerBase};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../config.js";import{id as r}from"../kernel.js";import s from"../request.js";import i from"../core/Error.js";import{Evented as o,EventedAccessor as n}from"../core/Evented.js";import{on as a}from"../core/events.js";import{fixJson as h}from"../core/lang.js";import{getDeepValue as l}from"../core/object.js";import{createResolver as c,onAbort as d,isAborted as u}from"../core/promiseUtils.js";import{urlToObject as p,hasSameOrigin as _,Url as f,queryToObject as g,base64UrlEncode as m,objectToQuery as v,normalize as S,getProxyRule as w,makeAbsolute as I,addQueryParameters as k}from"../core/urlUtils.js";import{property as A}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import U from"./IdentityModal.js";import T from"./OAuthCredential.js";import x from"./OAuthInfo.js";import O from"./ServerInfo.js";import{isSecureProxyService as P,normalizeArcGISOnlineOrgDomain as R}from"../portal/support/urlUtils.js";const C={},D=e=>{const t=new f(e.owningSystemUrl).host,r=new f(e.server).host,s=/.+\.arcgis\.com$/i;return s.test(t)&&s.test(r)},b=(e,t)=>!!(D(e)&&t&&t.some(t=>t.test(e.server)));let q=null,j=null;try{q=window.localStorage,j=window.sessionStorage}catch{}class E extends o{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin="null"!==window.origin?window.origin:window.location.origin,this._appUrlObj=p(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^/]+\/[^/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^/]+).*/i,this._gwItem=/http.+\/items\/([^/]+).*/i,this._gwGroup=/http.+\/groups\/([^/]+).*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getPlatformSelfError=null,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const t=this.serverInfos;t?(e=e.filter(e=>!this.findServerInfo(e.server)),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach(e=>{e.owningSystemUrl&&this._portals.push(e.owningSystemUrl),e.hasPortal&&this._portals.push(e.server)})}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const e=this.findOAuthInfo(r.portalUrl);e&&t.splice(t.indexOf(e),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let s,i=this.findServerInfo(t),o=!0;i||(i=new O,i.server=this._getServerInstanceRoot(t),r?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(t),i.hasPortal=!0),this.registerServers([i])),s=this._findCredential(t),s?(delete e.server,Object.assign(s,e),o=!1):(s=new L({userId:e.userId,server:i.server??void 0,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),s.resources=[t],this.credentials.push(s)),s.emitTokenChange(!1),o||s.refreshServerTokens()}toJSON(){return h({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;"string"==typeof e&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,s=e.credentials;if(t){const e=[];t.forEach(t=>{t.server&&t.tokenServiceUrl&&e.push(t.declaredClass?t:new O(t))}),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach(t=>{t.appId&&e.push(t.declaredClass?t:new x(t))}),e.length&&this.registerOAuthInfos(e)}s&&s.forEach(e=>{e.server&&e.token&&e.expires&&e.expires>Date.now()&&((e=e.declaredClass?e:new L(e)).emitTokenChange(),this.credentials.push(e))})}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){if(!e)return;let r;e=this._sanitizeUrl(e);const s=this._isServerRsrc(e)?"server":"portal";if(t){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&t===i.userId&&i.scope===s){r=i;break}}else for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&-1!==this._getIdenticalSvcIdx(e,i)&&i.scope===s){r=i;break}return r}getCredential(e,t){let r,s=!1,o=!0;t&&(s=!(!t.token&&!t.credential),r=t.error,o=!1!==t.prompt),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,a=c();if(t.signal&&d(t.signal,()=>{n.abort()}),d(n,()=>{a.reject(new i("identity-manager:user-aborted","ABORTED"))}),u(n))return a.promise;t.signal=n.signal;const h=this._isAdminResource(e),l=s?this.findCredential(e):null;let p;if(l&&498===r?.details?.httpStatus)l.destroy();else if(l)return p=new i("identity-manager:not-authorized","You are currently signed in as: '"+l.userId+"'. You do not have access to this resource: "+e,{error:r}),a.reject(p),a.promise;const f=this._findCredential(e,t);if(f)return a.resolve(f),a.promise;let g=this.findServerInfo(e);if(g)!g.hasPortal&&g.server&&g.owningSystemUrl&&this._hasSameServerInstance(g.server,g.owningSystemUrl)&&(g.hasPortal=!0),!g.hasServer&&this._isServerRsrc(e)&&(g._restInfoPms=this._getTokenSvcUrl(e),g.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return p=new i("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),a.reject(p),a.promise;g=new O,g.server=this._getServerInstanceRoot(e),"string"==typeof t?(g.tokenServiceUrl=t,g.hasPortal=!0):(g._restInfoPms=t,g.hasServer=!0),this.registerServers([g])}return g.hasPortal&&void 0===g._selfReq&&(o||_(g.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(e=>e.tokenServiceUrl===g.tokenServiceUrl))&&(g._selfReq={owningTenant:t?.owningTenant,selfDfd:this._getPortalSelf(g.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,g,t,a,h)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const o=this._rePortalTokenSvc.test(e.tokenServiceUrl),n=new f(this._appOrigin),a=e.shortLivedTokenValidity;let h,l,c,d,u,p,g,m;t&&(m=this.tokenValidity||a||this._defaultTokenValidity,m>a&&a>0&&(m=a)),r&&(h=r.isAdmin,l=r.serverUrl,c=r.token,p=r.signal,g=r.ssl,e.customParameters=r.customParameters),h?d=e.adminTokenServiceUrl:(d=e.tokenServiceUrl,u=new f(d.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!g&&"http"===n.scheme&&(_(n.uri,d,!0)||"https"===u.scheme&&n.host===u.host&&"7080"===n.port&&"7443"===u.port)&&(d=d.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const v={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:l,token:c,expiration:m,referer:h||o?this._appOrigin:null,client:h?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:p,...r?.ioArgs};o||(v.withCredentials=!1);return s(d,v).then(r=>{const s=r.data;if(!s?.token)return new i("identity-manager:authentication-failed","Unable to generate token");const o=e.server;return C[o]||(C[o]={}),t&&(C[o][t.username]=t.password),s.validity=m,s})}isBusy(){return!!this._busy}async checkSignInStatus(e){return(await this.checkAppAccess(e,"")).credential}checkAppAccess(e,t,r){let o=!1;return this.getCredential(e,{prompt:!1}).then(n=>{let a;const h={f:"json"};if("portal"===n.scope)if(t&&(this._doPortalSignIn(e)||r?.force))a=n.server+"/sharing/rest/oauth2/validateAppAccess",h.client_id=t;else{if(!n.token)return{credential:n};a=n.server+"/sharing/rest"}else{if(!n.token)return{credential:n};a=n.server+"/rest/services"}return n.token&&(h.token=n.token),s(a,{query:h,authMode:"anonymous"}).then(e=>{if(!1===e.data.valid)throw new i("identity-manager:not-authorized",`You are currently signed in as: '${n.userId}'.`,e.data);return o=!!e.data.viewOnlyUserTypeApp,{credential:n}}).catch(e=>{if("identity-manager:not-authorized"===e.name)throw e;const t=e.details?.httpStatus;if(498===t)throw n.destroy(),new i("identity-manager:not-authenticated","User is not signed in.");if(400===t)throw new i("identity-manager:invalid-request","Bad request");return{credential:n}})}).then(e=>({credential:e.credential,viewOnly:o}))}setOAuthResponseHash(e){e&&(e.startsWith("#")&&(e=e.slice(1)),this._processOAuthPopupParams(g(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const s=c(),o=()=>{h?.remove(),l?.remove(),this.dialog?.destroy(),this.dialog=h=l=null},n=()=>{o(),this._oAuthDfd=null,s.reject(new i("identity-manager:user-aborted","ABORTED"))};r.signal&&d(r.signal,()=>{n()});const a=new U({open:!0,resource:this.getResourceName(e),server:t.server});this.dialog=a,this.emit("dialog-create");let h=a.on("cancel",n),l=a.on("submit",e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then(i=>{o();const n=new L({userId:e.username,server:t.server??void 0,token:i.token,expires:null!=i.expires?Number(i.expires):null,ssl:!!i.ssl,isAdmin:r.isAdmin,validity:i.validity});s.resolve(n)}).catch(e=>{a.error=e,a.signingIn=!1})});return s.promise}oAuthSignIn(e,t,r,s){this._oAuthDfd=c();const o=this._oAuthDfd;let n;s?.signal&&d(s.signal,()=>{const e=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;e&&!e.closed?e.close():this.dialog&&u()}),o.resUrl_=e,o.sinfo_=t,o.oinfo_=r;const a=r._oAuthCred;if(a.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&t.currentVersion>=8.4)){let e=crypto.getRandomValues(new Uint8Array(32));n=m(e),a.codeVerifier=n,e=crypto.getRandomValues(new Uint8Array(32)),a.stateUID=m(e),a.save()||(a.codeVerifier=n=null)}else a.codeVerifier=null;let h,l;this._getCodeChallenge(n).then(i=>{const o=!s||!1!==s.oAuthPopupConfirmation;if(!r.popup||!o)return void this._doOAuthSignIn(e,t,r,i);const n=new U({oAuthPrompt:!0,server:t.server,open:!0});this.dialog=n,this.emit("dialog-create"),h=n.on("cancel",u),l=n.on("submit",()=>{p(),this._doOAuthSignIn(e,t,r,i)})});const u=()=>{p(),this._oAuthDfd=null,o.reject(new i("identity-manager:user-aborted","ABORTED"))},p=()=>{h?.remove(),l?.remove(),this.dialog?.destroy(),this.dialog=null};return o.promise}destroyCredentials(){if(this.credentials){this.credentials.slice().forEach(e=>{e.destroy()})}this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=a(window,"message",t=>{if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&"arcgis:auth:requestCredential"===t.data?.type){const r=t.source;this.getCredential(e).then(e=>{r.postMessage({type:"arcgis:auth:credential",credential:{expires:e.expires,server:e.server,ssl:e.ssl,token:e.token,userId:e.userId}},t.origin)}).catch(e=>{r.postMessage({type:"arcgis:auth:error",error:{name:e.name,message:e.message}},t.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){e.startsWith("#")&&(e=e.slice(1));const t=g(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),"access_denied"===t.error&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let t=window.location.search;if(t){t.startsWith("?")&&(t=t.slice(1));const e=g(t);let r=!1;if(e.code&&e.state)try{e.state=JSON.parse(e.state),e.state.portalUrl&&e.state.uid&&(this._oAuthLocationParams=e,r=!0)}catch{}else if(e.error&&e.error_description&&(console.log("IdentityManager OAuth Error: ",e.error," - ",e.error_description),"access_denied"===e.error&&(r=!0,e.state)))try{e.state=JSON.parse(e.state)}catch{}if(r){const t={...e};["code","error","error_description","message_code","persist","state"].forEach(e=>{delete t[e]});const r=v(t),s=window.location.pathname+(r?`?${r}`:"")+(e.state?.hash||"");window.history.replaceState(window.history.state,"",s)}}}_getOAuthToken(e,t,r,i,o){return e=e.replace(/^http:/i,"https:"),s(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:i&&o?{grant_type:"authorization_code",code:t,redirect_uri:i,client_id:r,code_verifier:o}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then(e=>e.data)}async _getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t);return m(new Uint8Array(r))}return null}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const e=new i("identity-manager:user-aborted","ABORTED");this._errbackFunc(e)}}_findCredential(e,t){let r,s,i,o,n=-1;const a=t?.token,h=t?.resource,l=this._isServerRsrc(e)?"server":"portal",c=this.credentials.filter(t=>this._hasSameServerInstance(t.server,e)&&t.scope===l);if(e=h||e,c.length)if(1===c.length){if(r=c[0],i=this.findServerInfo(r.server),s=i?.owningSystemUrl,o=s?this.findCredential(s,r.userId):void 0,n=this._getIdenticalSvcIdx(e,r),!a)return-1===n&&r.resources.push(e),this._addResource(e,o),r;-1!==n&&(r.resources.splice(n,1),this._removeResource(e,o))}else{let t,r;if(c.some(a=>(r=this._getIdenticalSvcIdx(e,a),-1!==r&&(t=a,i=this.findServerInfo(t.server),s=i?.owningSystemUrl,o=s?this.findCredential(s,t.userId):void 0,n=r,!0))),a)t&&(t.resources.splice(n,1),this._removeResource(e,o));else if(t)return this._addResource(e,o),t}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t)for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}return t}_addResource(e,t){t&&-1===this._getIdenticalSvcIdx(e,t)&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return t?.isAdmin&&!_(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&"10.1"===String(e.currentVersion)&&!_(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new f(e);return t.scheme+"://"+t.host+(null!=t.port?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return-1===r&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),-1!==r||P(t)||(r=t.indexOf("/sharing")),-1===r&&t.endsWith("/")&&(r=t.length-1),r>-1?e.slice(0,r):e}_hasSameServerInstance(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=R(e),t=R(t),(e=e.slice(Math.max(0,e.indexOf(":"))))===(t=t.slice(Math.max(0,t.indexOf(":"))))}_sanitizeUrl(e){const r=(t.request.proxyUrl||"").toLowerCase(),s=r?e.toLowerCase().indexOf(r+"?"):-1;return-1!==s&&(e=e.slice(s+r.length+1)),e=S(e),p(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const s=this._getSuffix(e).toLowerCase(),i=this._getSuffix(t).toLowerCase();if(r=s===i,!r){const e=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=s.replaceAll(e,"$1")===i.replaceAll(e,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const r=new f(e.toLowerCase()),s=this._portalConfig;let i=this._gwDomains.some(e=>e.regex.test(r.uri));return!i&&s&&(i=this._hasSameServerInstance(this._getServerInstanceRoot(s.restBaseUrl),r.uri)),i||t.portalUrl&&(i=_(r,t.portalUrl,!0)),i||(i=this._portals.some(e=>this._hasSameServerInstance(e,r.uri))),i=i||this._agsPortal.test(r.path),i}_isIdProvider(e,t){let r=-1,s=-1;this._gwDomains.forEach((i,o)=>{-1===r&&i.regex.test(e)&&(r=o),-1===s&&i.regex.test(t)&&(s=o)});let i=!1;if(r>-1&&s>-1&&(0===r||4===r?0!==s&&4!==s||(i=!0):1===r?1!==s&&2!==s||(i=!0):2===r?2===s&&(i=!0):3===r&&3===s&&(i=!0)),!i){const r=this.findServerInfo(t),s=r?.owningSystemUrl;s&&D(r)&&this._isPortalDomain(s)&&this._isIdProvider(e,s)&&(i=!0)}return i}_getIdenticalSvcIdx(e,t){let r=-1;for(let s=0;s<t.resources.length;s++){const i=t.resources[s];if(this._isIdenticalService(e,i)){r=s;break}}return r}_getSuffix(e){return e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"$1")}_getTokenSvcUrl(e){let t,r,i;if(this._isRESTService(e)||this._isAdminResource(e)){const i=this._getServerInstanceRoot(e);return t=i+"/admin/generateToken",r=s(e=i+"/rest/info",{query:{f:"json"}}).then(e=>e.data),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let t="";if(this._gwDomains.some(r=>(r.regex.test(e)&&(t=r.tokenServiceUrl),!!t)),t||this._portals.some(r=>(this._hasSameServerInstance(r,e)&&(t=r+this._gwTokenUrl),!!t)),t||(i=e.toLowerCase().indexOf("/sharing"),-1!==i&&(t=e.slice(0,i)+this._gwTokenUrl)),t||(t=this._getOrigin(e)+this._gwTokenUrl),t){const r=new f(e).port;/^http:\/\//i.test(e)&&"7080"===r&&(t=t.replace(/:7080/i,":7443")),t=t.replace(/http:/i,"https:")}return t}}_processOAuthResponseParams(e,t,r){const s=t._oAuthCred;if(e.code){const i=s.codeVerifier;return s.codeVerifier=null,s.stateUID=null,s.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),i).then(i=>{const o=new L({userId:i.username,server:r.server??void 0,token:i.access_token,expires:Date.now()+1e3*i.expires_in,ssl:i.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=o.userId,s.storage=i.persist?q:j,s.refreshToken=i.refresh_token,s.token=null,s.expires=i.refresh_token_expires_in?Date.now()+1e3*i.refresh_token_expires_in:null,s.userId=o.userId,s.ssl=o.ssl,s.save(),o})}const i=new L({userId:e.username,server:r.server??void 0,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:"true"===e.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=i.userId,s.storage=e.persist?q:j,s.refreshToken=null,s.token=i.token,s.expires=i.expires,s.userId=i.userId,s.ssl=i.ssl,s.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r="access_denied"===e.error,s=new i(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(s)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then(e=>{t.resolve(e)}).catch(e=>{t.reject(e)})}_setOAuthResponseQueryString(e){e&&(e.startsWith("?")&&(e=e.slice(1)),this._processOAuthPopupParams(g(e)))}async _exchangeToken(e,t,r){return(await s(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}})).data.token}async _getPlatformSelf(e,t){if(this._getPlatformSelfError&&Date.now()-this._getPlatformSelfError[1]<1e3)throw this._getPlatformSelfError[0];e=e.replace(/^http:/i,"https:");try{const r=await s(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0});return this._getPlatformSelfError=null,r.data}catch(r){throw"OAUTH_0066"===r.details?.messageCode&&(this._getPlatformSelfError=[r,Date.now()]),r}}_getPortalSelf(e,t){let r;if(this._gwDomains.some(t=>(t.regex.test(e)&&(r=t.customBaseUrl),!!r)),r)return Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0});this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080"));return s(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(e=>e.data)}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,s=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(s?s.hasPortal||s.owningSystemUrl&&this._isPortalDomain(s.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||_(r,e,!0)))}_checkProtocol(e,t,r,s){let o=!0;const n=s?t.adminTokenServiceUrl:t.tokenServiceUrl;if(n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&w(n)&&(o=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!o)){r(new i("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection."))}return o}_enqueue(e,t,r,s,i,o){return s||(s=c()),s.resUrl_=e,s.sinfo_=t,s.options_=r,s.admin_=i,s.refresh_=o,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(s)):this._xoReqs.push(s):this._doSignIn(s),s.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=t=>{const r=e.options_?.resource,s=e.resUrl_,i=e.refresh_;let o=!1;this.credentials.includes(t)||(i&&this.credentials.includes(i)?(i.userId=t.userId,i.token=t.token,i.expires=t.expires,i.validity=t.validity,i.ssl=t.ssl,i.creationTime=t.creationTime,o=!0,t=i):this.credentials.push(t)),t.resources||(t.resources=[]),t.resources.includes(r||s)||t.resources.push(r||s),t.scope=this._isServerRsrc(s)?"server":"portal",t.emitTokenChange();const n=this._soReqs,a={};this._soReqs=[],n.forEach(e=>{if(!this._isIdenticalService(s,e.resUrl_)){const r=this._getSuffix(e.resUrl_);a[r]||(a[r]=!0,t.resources.push(e.resUrl_))}}),e.resolve(t),n.forEach(e=>{this._hasSameServerInstance(this._getServerInstanceRoot(s),e.resUrl_)?e.resolve(t):this._soReqs.push(e)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,o||this.emit("credential-create",{credential:t}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=t=>{e.reject(t),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},s=(o,n,h,l)=>{const c=e.sinfo_,u=!e.options_||!1!==e.options_.prompt,p=c.hasPortal&&this._findOAuthInfo(e.resUrl_);let f,g;if(o)t(new L({userId:o,server:c.server??void 0,token:h??void 0,expires:null!=l?Number(l):null,ssl:!!n}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const s=a(window,"message",e=>{e.source===window.parent&&e.data&&("arcgis:auth:credential"===e.data.type?(s.remove(),e.data.credential.expires<Date.now()?r(new i("identity-manager:credential-request-failed","Parent application's token has expired.")):t(new L(e.data.credential))):"arcgis:auth:error"===e.data.type&&(s.remove(),"tokenExpiredError"===e.data.error.name?r(new i("identity-manager:credential-request-failed","Parent application's token has expired.")):r(i.fromJSON(e.data.error))))});d(e.options_?.signal,()=>{s.remove()})}else if(p){let o=p._oAuthCred;if(!o){const e=new T(p,q),t=new T(p,j);e.isValid()&&t.isValid()?e.expires>t.expires?(o=e,t.destroy()):(o=t,e.destroy()):o=e.isValid()?e:t,p._oAuthCred=o}if(o.isValid()){f=new L({userId:o.userId??void 0,server:c.server??void 0,token:o.token??void 0,expires:o.expires,ssl:o.ssl??void 0,_oAuthCred:o});const i=p.appId!==o.appId&&this._doPortalSignIn(e.resUrl_);i||o.refreshToken?(e._pendingDfd=o.refreshToken?this._getOAuthToken(c.server,o.refreshToken,o.appId).then(e=>(f.expires=Date.now()+1e3*e.expires_in,f.token=e.access_token,f)):Promise.resolve(f),e._pendingDfd.then(e=>i?this._exchangeToken(e.server,p.appId,e.token).then(t=>(e.token=t,e)).catch(()=>e):e).then(e=>{t(e)}).catch(e=>{const t=e.details?.httpStatus;t>0&&404!==t?(o.destroy(),s()):r(e)})):t(f)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(p.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===o.stateUID&&o.codeVerifier)){const s=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(s,p,c).then(e=>{t(e)}).catch(r)}else{const s=()=>{u?e._pendingDfd=this.oAuthSignIn(e.resUrl_,c,p,e.options_).then(t,r):(g=new i("identity-manager:not-authenticated","User is not signed in."),r(g))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(c.server,p.appId).then(e=>{_(e.portalUrl,this._appOrigin,!0)?(f=new L({userId:e.username,server:c.server??void 0,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(f)):s()}).catch(s):s()}}else if(u){if(this._checkProtocol(e.resUrl_,c,r,e.admin_)){let s=e.options_;e.admin_&&(s=s||{},s.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,c,s).then(t,r)}}else g=new i("identity-manager:not-authenticated","User is not signed in."),r(g)},o=()=>{const s=e.sinfo_,i=s.owningSystemUrl,o=e.options_;let n,a,h,l;if(o&&(n=o.token,a=o.error,h=o.prompt),l=this._findCredential(i,{token:n,resource:e.resUrl_}),!l)for(const e of this.credentials)if(this._isIdProvider(i,e.server)){l=e;break}if(l){const i=this.findCredential(e.resUrl_,l.userId);if(i)t(i);else if(b(s,this._legacyFed)){const e=l.toJSON();e.server=s.server,e.resources=null,t(new L(e))}else{(e._pendingDfd=this.generateToken(this.findServerInfo(l.server),null,{serverUrl:e.resUrl_,token:l.token,signal:e.options_.signal,ssl:l.ssl})).then(r=>{t(new L({userId:l?.userId,server:s.server??void 0,token:r.token,expires:null!=r.expires?Number(r.expires):null,ssl:!!r.ssl,isAdmin:e.admin_,validity:r.validity}))},r)}}else{this._busy=null,n&&(e.options_.token=null);(e._pendingDfd=this.getCredential(i.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:s.owningTenant,signal:e.options_.signal,token:n,error:a,prompt:h})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},t=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(t)})}};this._errbackFunc=r;const n=e.sinfo_.owningSystemUrl,h=this._isServerRsrc(e.resUrl_),c=e.sinfo_._restInfoPms;c?c.promise.then(t=>{const r=e.sinfo_;if(r._restInfoPms){r.adminTokenServiceUrl=r._restInfoPms.adminUrl,r._restInfoPms=null,r.tokenServiceUrl=(l("authInfo.tokenServicesUrl",t)||l("authInfo.tokenServiceUrl",t)||l("tokenServiceUrl",t))??null,r.shortLivedTokenValidity=l("authInfo.shortLivedTokenValidity",t)??null,r.currentVersion=t.currentVersion,r.owningTenant=t.owningTenant;const e=r.owningSystemUrl=t.owningSystemUrl;e&&this._portals.push(e)}h&&r.owningSystemUrl?o():s()},()=>{e.sinfo_._restInfoPms=null;const t=new i("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(t)}):h&&n?o():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(t=>{const r={};let s,i,o,n;return t&&(s=t.user?.username,r.username=s,r.allSSL=t.allSSL,i=t.supportsOAuth,n=parseFloat(t.currentVersion),"multitenant"===t.portalMode&&(o=t.customBaseUrl),e.sinfo_.currentVersion=n),e.sinfo_.webTierAuth=!!s,s&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:r.allSSL}).catch(()=>null).then(e=>(r.portalToken=e?.token,r.tokenExpiration=e?.expires,r)):!s&&i&&n>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:o,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>r):r}).catch(()=>null).then(t=>{e.sinfo_._selfReq=null,t?s(t.username,t.allSSL,t.portalToken,t.tokenExpiration):s()}):s()}_generateOAuthInfo(e){let t,r=null,i=e.portalUrl;const o=e.customBaseUrl,n=e.owningTenant,a=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){r=this._appUrlObj.path;const e=r.search(/\/(apps|home)\//);r=e>-1?r.slice(0,e):null}return a&&r?(this._hasTestedIfAppIsOnPortal=!0,t=s(r+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new x({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})})):t=Promise.resolve(),t.then(()=>{if(this._defaultOAuthInfo)return i=i.replace(/^http:/i,"https:"),s(i+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:I(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(e=>{if(e.data.valid){const t=this._defaultOAuthInfo.clone();e.data.urlKey&&o?t.portalUrl="https://"+e.data.urlKey.toLowerCase()+"."+o:t.portalUrl=i,t.popup=window!==window.top||!(_(i,this._appOrigin)||this._gwDomains.some(e=>e.regex.test(i)&&e.regex.test(this._appOrigin))),this.oAuthInfos.push(t)}})})}_doOAuthSignIn(e,t,r,s){const o=r._oAuthCred,n={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),o.stateUID&&(n.uid=o.stateUID);const h={client_id:r.appId,response_type:o.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!o.codeVerifier)};r.forceLogin&&(h.force_login=!0),r.forceUserId&&r.userId&&(h.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(h.redirectToUserOrgUrl=!0),o.codeVerifier&&(h.code_challenge=s||o.codeVerifier,h.code_challenge_method=s?"S256":"plain");const l=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",c=l+"?"+v(h);if(r.popup){const e=window.open(c,"esriJSAPIOAuth",r.popupWindowFeatures);if(e)e.focus(),this._oAuthDfd.oAuthWin_=e,this._oAuthIntervalId=setInterval(()=>{if(e.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const e=this._oAuthDfd;if(e){const t=new i("identity-manager:user-aborted","ABORTED");e.reject(t)}}},500),this._oAuthOnPopupHandle=a(window,["arcgis:auth:hash","arcgis:auth:location:search"],e=>{"arcgis:auth:hash"===e.type?this.setOAuthResponseHash(e.detail):this._setOAuthResponseQueryString(e.detail)});else{const e=new i("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(e)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:h,authorizeUrl:l,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=c}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return I(e.popupCallbackUrl);if(t){const e=p(r);return e.query&&["code","error","error_description","message_code","persist","state"].forEach(t=>{delete e.query[t]}),k(e.path,e.query)}return r}}E.prototype.declaredClass="esri.identity.IdentityManagerBase";let L=class extends n{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e?._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],null==this.creationTime&&(this.creationTime=Date.now())}refreshToken(){const e=r,t=e.findServerInfo(this.server),s=t?.owningSystemUrl,i=!!s&&"server"===this.scope,o=i&&b(t,e._legacyFed),n=t.webTierAuth,a=n&&e.normalizeWebTierAuth,h=C[this.server],l=h?.[this.userId];let c,d=this.resources&&this.resources[0],u=i?e.findServerInfo(s):null,p={username:this.userId,password:l};if(n&&!a)return;i&&!u&&e.serverInfos.some(t=>(e._isIdProvider(s,t.server)&&(u=t),!!u));const _=u?e.findCredential(u.server,this.userId):null;if(!i||_){if(!o){if(i)c={serverUrl:d,token:_?.token,ssl:_?.ssl};else if(a)p=null,c={ssl:this.ssl};else{if(!l){let r;return d&&(d=e._sanitizeUrl(d),this._enqueued=1,r=e._enqueue(d,t,null,null,this.isAdmin,this),r.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),r}this.isAdmin&&(c={isAdmin:!0})}return e.generateToken(i?u:t,i?null:p,c).then(e=>{this.token=e.token,this.expires=null!=e.expires?Number(e.expires):null,this.creationTime=Date.now(),this.validity=e.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}_?.refreshToken()}}refreshServerTokens(){if("portal"===this.scope){const e=r;e.credentials.forEach(t=>{const r=e.findServerInfo(t.server),s=r?.owningSystemUrl;t!==this&&t.userId===this.userId&&s&&"server"===t.scope&&(e._hasSameServerInstance(this.server,s)||e._isIdProvider(s,this.server))&&(b(r,e._legacyFed)?(t.token=this.token,t.expires=this.expires,t.creationTime=this.creationTime,t.validity=this.validity,t.emitTokenChange()):t.refreshToken())})}}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=r,s=this.server?t.findServerInfo(this.server):null,i=s?.owningSystemUrl,o=i?t.findServerInfo(i):null;!1===e||i&&"portal"!==this.scope&&(!o?.webTierAuth||t.normalizeWebTierAuth)||null==this.expires&&null==this.validity||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const e=r,t=e.credentials.indexOf(this);t>-1&&e.credentials.splice(t,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=h({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),t=this.resources;return t&&t.length>0&&(e.resources=t.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,t=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>t&&(r=t),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};e([A()],L.prototype,"creationTime",void 0),e([A()],L.prototype,"expires",void 0),e([A()],L.prototype,"isAdmin",void 0),e([A()],L.prototype,"oAuthState",void 0),e([A()],L.prototype,"resources",void 0),e([A()],L.prototype,"scope",void 0),e([A()],L.prototype,"server",void 0),e([A()],L.prototype,"ssl",void 0),e([A()],L.prototype,"token",void 0),e([A()],L.prototype,"tokenRefreshBuffer",void 0),e([A()],L.prototype,"userId",void 0),e([A()],L.prototype,"validity",void 0),L=e([y("esri.identity.Credential")],L);export{L as Credential,E as IdentityManagerBase};
|
package/interfaces.d.ts
CHANGED
|
@@ -29835,7 +29835,7 @@ declare namespace __esri {
|
|
|
29835
29835
|
*
|
|
29836
29836
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ParquetLayer.html#geometryType Read more...}
|
|
29837
29837
|
*/
|
|
29838
|
-
geometryType: "point" | "polygon" | "polyline" | "multipoint";
|
|
29838
|
+
geometryType: "point" | "polygon" | "polyline" | "multipoint" | nullish;
|
|
29839
29839
|
/**
|
|
29840
29840
|
* Indicates whether to display labels for this layer.
|
|
29841
29841
|
*
|
|
@@ -30067,7 +30067,7 @@ declare namespace __esri {
|
|
|
30067
30067
|
*
|
|
30068
30068
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ParquetLayer.html#geometryType Read more...}
|
|
30069
30069
|
*/
|
|
30070
|
-
geometryType?: "point" | "polygon" | "polyline" | "multipoint";
|
|
30070
|
+
geometryType?: "point" | "polygon" | "polyline" | "multipoint" | nullish;
|
|
30071
30071
|
/**
|
|
30072
30072
|
* The label definition for this layer, specified as an array of {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html LabelClass}.
|
|
30073
30073
|
*
|
|
@@ -37481,7 +37481,7 @@ declare namespace __esri {
|
|
|
37481
37481
|
urls: Collection<string>;
|
|
37482
37482
|
fields?: Field[];
|
|
37483
37483
|
encoding?: ParquetEncodingWkb | ParquetEncodingLocation | nullish;
|
|
37484
|
-
geometryType?: "point" | "polygon" | "polyline" | "multipoint";
|
|
37484
|
+
geometryType?: "point" | "polygon" | "polyline" | "multipoint" | nullish;
|
|
37485
37485
|
objectIdField?: string;
|
|
37486
37486
|
spatialReference?: SpatialReference;
|
|
37487
37487
|
}
|
package/kernel.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.
|
|
5
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.46",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|