@arcgis/core 4.25.0-next.20220705 → 4.25.0-next.20220708
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/TimeExtent.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0703495557b0df6878c5.js +1 -0
- package/assets/esri/core/workers/chunks/1570676351a313f1841b.js +1 -0
- package/assets/esri/core/workers/chunks/{695f90305478f5024fa7.js → 1ecbf642debc2207b762.js} +1 -1
- package/assets/esri/core/workers/chunks/{30dbdf2aa1bc8e61cad4.js → 268e7b46202fc1decf9f.js} +1 -1
- package/assets/esri/core/workers/chunks/{47d78b4f7117554acecf.js → 357a27203f5d8fa152de.js} +1 -1
- package/assets/esri/core/workers/chunks/35dfba25a9077ab5dbaf.js +982 -0
- package/assets/esri/core/workers/chunks/377354a81e402edf3077.js +1 -0
- package/assets/esri/core/workers/chunks/3a42d96ea3b59d33bfe8.js +1 -0
- package/assets/esri/core/workers/chunks/3a61e4ab83183f5526a7.js +1 -0
- package/assets/esri/core/workers/chunks/{3790f0362b6f27ee798b.js → 3ee5e8d00cd3bc47a9fa.js} +1 -1
- package/assets/esri/core/workers/chunks/425d1fabc713a598139c.js +1 -0
- package/assets/esri/core/workers/chunks/425e16862feccb467191.js +1 -0
- package/assets/esri/core/workers/chunks/{bbe51b49fe7093e47306.js → 48c8ac9a22190c2b890c.js} +1 -1
- package/assets/esri/core/workers/chunks/4a364bc073fdc7c1b563.js +1 -0
- package/assets/esri/core/workers/chunks/4ca6ada7a4ccde5b5a24.js +1 -0
- package/assets/esri/core/workers/chunks/{905130ff0118962c8140.js → 61b71b8e028eda10ccab.js} +1 -1
- package/assets/esri/core/workers/chunks/{b34cffd5c45d3a8134bc.js → 69f57ad2227e59b323e8.js} +1 -1
- package/assets/esri/core/workers/chunks/{290899b47a52f8b28a9c.js → 791220164501a791b2cd.js} +1 -1
- package/assets/esri/core/workers/chunks/792b4b0a43b4bbbc14ab.js +1 -0
- package/assets/esri/core/workers/chunks/7b32b8e8ebe48ae0dae2.js +1 -0
- package/assets/esri/core/workers/chunks/7f00125b02bb7211de43.js +1 -0
- package/assets/esri/core/workers/chunks/81074accfce5f109f909.js +1 -0
- package/assets/esri/core/workers/chunks/{594d7fdb80ad9cdedb85.js → 823e25dbc70e71257b6e.js} +1 -1
- package/assets/esri/core/workers/chunks/92e43e05265dfc8173a0.js +1 -0
- package/assets/esri/core/workers/chunks/{40fa9b28ca882a70813a.js → 92f7415c2e40e320addc.js} +1 -1
- package/assets/esri/core/workers/chunks/{9520b32d5d53ea9cd0d3.js → 9341e9e1fe0f6800aa44.js} +1 -1
- package/assets/esri/core/workers/chunks/95451d6405729a9f50c7.js +1 -0
- package/assets/esri/core/workers/chunks/{910a2ffb4328f8ee7a0d.js → 95cb9cd08941c28ebd85.js} +1 -1
- package/assets/esri/core/workers/chunks/{97f32af5893c86f6444c.js → 9b9a40b84640f00a1dcb.js} +1 -1
- package/assets/esri/core/workers/chunks/{77c6ba5ea85915d9078c.js → ac07c732aca6e67232f8.js} +1 -1
- package/assets/esri/core/workers/chunks/ae8e87da97411cff3783.js +1 -0
- package/assets/esri/core/workers/chunks/{65161a874595b0a34aa1.js → b312dd3027492007d75e.js} +1 -1
- package/assets/esri/core/workers/chunks/{83c9da68d6dbc77f60e5.js → beead2b06c994b4e61af.js} +1 -1
- package/assets/esri/core/workers/chunks/{5e20fd8b7c9497f2da1f.js → bfb08d3e2208c6178af9.js} +1 -1
- package/assets/esri/core/workers/chunks/{04e5486f0d8d4c6bd8a2.js → c3236a7058e64ea3b939.js} +1 -1
- package/assets/esri/core/workers/chunks/c4e9c71be6299c60c539.js +1 -0
- package/assets/esri/core/workers/chunks/c705f907ce60a646d9aa.js +1 -0
- package/assets/esri/core/workers/chunks/ce6abfafa0171b9c8d81.js +1 -0
- package/assets/esri/core/workers/chunks/{08a5c5a33a7c7c6852e5.js → d00b0f8236f1526099d4.js} +1 -1
- package/assets/esri/core/workers/chunks/d13951412a57e1af6208.js +1 -0
- package/assets/esri/core/workers/chunks/ecaf8f030026e41e1d1a.js +1 -0
- package/assets/esri/core/workers/chunks/f328a6cd4b7d8c653fc7.js +1 -0
- package/assets/esri/core/workers/chunks/f6a6178d4df029ff010d.js +1 -0
- package/assets/esri/core/workers/chunks/fde2301c6cd97a3cfb86.js +1 -0
- package/assets/esri/core/workers/chunks/fe84bcdfd9028b5e7ef6.js +1 -0
- package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +4 -0
- package/assets/esri/themes/base/widgets/_LayerList.scss +4 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/CheckerBoard.glsl.js +2 -2
- package/chunks/ColorMaterial.glsl.js +9 -9
- package/chunks/ComponentShader.glsl.js +33 -33
- package/chunks/DefaultMaterial.glsl.js +35 -35
- package/chunks/HUDMaterial.glsl.js +11 -11
- package/chunks/ImageMaterial.glsl.js +5 -5
- package/chunks/LineMarker.glsl.js +17 -17
- package/chunks/NativeLine.glsl.js +3 -3
- package/chunks/Path.glsl.js +28 -28
- package/chunks/Pattern.glsl.js +9 -9
- package/chunks/PointRenderer.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +4 -4
- package/chunks/RibbonLine.glsl.js +1 -1
- package/chunks/ShadedColorMaterial.glsl.js +1 -1
- package/chunks/SimpleAtmosphere.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +92 -92
- package/chunks/WaterSurface.glsl.js +22 -22
- package/chunks/common.js +1 -1
- package/chunks/mat2.js +1 -1
- package/chunks/mat2d.js +1 -1
- package/chunks/mat3.js +1 -1
- package/chunks/mat4.js +1 -1
- package/chunks/quat.js +1 -1
- package/chunks/quat2.js +1 -1
- package/chunks/vec2.js +1 -1
- package/chunks/vec3.js +1 -1
- package/chunks/vec4.js +1 -1
- package/core/Message.js +1 -1
- package/core/accessorSupport/tracking.js +1 -1
- package/core/libs/gl-matrix-2/math/common.js +1 -1
- package/core/libs/gl-matrix-2/math/vec2.js +1 -1
- package/core/pbf.js +1 -1
- package/core/quantity.js +0 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/support/scaleUtils.js +1 -1
- package/identity/IdentityForm.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/identity/OAuthCredential.js +1 -1
- package/interfaces.d.ts +3347 -190
- package/intl/date.js +1 -1
- package/intl/duration.js +1 -1
- package/intl/messages.js +1 -1
- package/intl/substitute.js +1 -1
- package/kernel.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/support/ControlPointsGeoreference.d.ts +4 -0
- package/layers/support/ControlPointsGeoreference.js +5 -0
- package/layers/support/CornersGeoreference.js +1 -1
- package/layers/support/ElevationSamplerData.js +5 -0
- package/layers/support/ElevationTile.js +1 -1
- package/layers/support/ExportImageServiceParameters.js +1 -1
- package/layers/support/MediaElementBase.js +1 -1
- package/layers/support/imageryRendererUtils.js +1 -1
- package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
- package/package.json +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/request.js +1 -1
- package/rest/route/utils.js +1 -1
- package/rest/serviceArea.js +1 -1
- package/rest/support/ServiceAreaParameters.js +1 -1
- package/rest/support/ServiceAreaSolveResult.js +1 -1
- package/smartMapping/raster/renderers/classBreaks.js +1 -1
- package/smartMapping/raster/renderers/uniqueValue.js +1 -1
- package/support/apiKeyUtils.js +1 -1
- package/support/requestUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/MapNotesLayerView2D.js +1 -1
- package/views/2d/navigation/actions/Pinch.js +1 -1
- package/views/2d/tiling/TileCache.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
- package/views/3d/environment/CloudsCompositionTechnique.js +1 -1
- package/views/3d/environment/CloudsTechnique.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/FogTechnique.js +1 -1
- package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/environment/PrecipitationTechnique.js +1 -1
- package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
- package/views/3d/environment/SimpleAtmosphereTechniqueConfiguration.js +1 -1
- package/views/3d/environment/StarsTechnique.js +1 -1
- package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/ImageryLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +5 -0
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/LaserlinePathData.js +1 -1
- package/views/3d/support/ResourceController.js +1 -1
- package/views/3d/terrain/BlendLayersTechnique.js +1 -1
- package/views/3d/terrain/ElevationData.js +1 -1
- package/views/3d/terrain/GeometryState.js +1 -1
- package/views/3d/terrain/OverlayRenderTarget.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
- package/views/3d/terrain/TerrainConst.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputConfiguration.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +11 -11
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +55 -55
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/BlendWeightsTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/BlurTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/EdgeDetectTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/RenderContext.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/TransparencyPassType.js +5 -0
- package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightApplyTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightBlurTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightDownsampleTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.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/3d/webgl-engine/shaders/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRendererTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingConstraint.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/interactive/support/viewUtils.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/support/geometry2dUtils.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom/ZoomConditions3D.js +1 -1
- package/widgets/Zoom/ZoomViewModel.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/support/widgetUtils.js +1 -1
- package/assets/esri/core/workers/chunks/06a7f58260225f52f8e6.js +0 -1
- package/assets/esri/core/workers/chunks/0e00741d35cdbf48e72d.js +0 -1
- package/assets/esri/core/workers/chunks/1ebb29ceabc81509646c.js +0 -1
- package/assets/esri/core/workers/chunks/24f7a3df08c3a2d3795c.js +0 -1
- package/assets/esri/core/workers/chunks/39a754713a48d46618bd.js +0 -1
- package/assets/esri/core/workers/chunks/462163f31fa134b7b216.js +0 -1
- package/assets/esri/core/workers/chunks/4bfcb7350ca492767a45.js +0 -1
- package/assets/esri/core/workers/chunks/5470cb0c3f670957c22c.js +0 -1
- package/assets/esri/core/workers/chunks/6889d698a2c796ed1ce6.js +0 -1
- package/assets/esri/core/workers/chunks/869310ef4c98542bf9df.js +0 -1
- package/assets/esri/core/workers/chunks/8ebaad46e2fe8925e3b0.js +0 -1
- package/assets/esri/core/workers/chunks/98c519ac806cc55bc19b.js +0 -1
- package/assets/esri/core/workers/chunks/9d07969fbea13aa5b03c.js +0 -1
- package/assets/esri/core/workers/chunks/9e6ce879ec0da884b9b8.js +0 -1
- package/assets/esri/core/workers/chunks/abd1bd74ba571e39ab5a.js +0 -1
- package/assets/esri/core/workers/chunks/b26ea76e3f41b45756e0.js +0 -1
- package/assets/esri/core/workers/chunks/c2286d97539066c8549a.js +0 -1
- package/assets/esri/core/workers/chunks/c495a66978d67c7e17f3.js +0 -1
- package/assets/esri/core/workers/chunks/c7fa92daca3f6e91734e.js +0 -987
- package/assets/esri/core/workers/chunks/c9e890b4be9d01c13efe.js +0 -1
- package/assets/esri/core/workers/chunks/dda5ea7f8d35e257815c.js +0 -1
- package/assets/esri/core/workers/chunks/e153e89c8a15c2f036ef.js +0 -1
- package/assets/esri/core/workers/chunks/e201ffcca7321771ee20.js +0 -1
- package/assets/esri/core/workers/chunks/e5b5b93e707173a4c883.js +0 -1
- package/assets/esri/core/workers/chunks/f7d1f75b6aa3ef566d74.js +0 -1
- package/assets/esri/core/workers/chunks/fde9e9683335fa6c8236.js +0 -1
- package/core/queryUtils.js +0 -5
- package/views/3d/layers/graphics/Graphics3DFilterVisibility.js +0 -5
- package/views/3d/layers/support/HeatmapFilterVisibility.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputOptions.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/HeaderComment.glsl.js +0 -10
- package/views/3d/webgl-engine/lib/RenderPass.js +0 -5
package/chunks/vec2.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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{R as t,g as n}from"./common.js";function a(t,n){return t[0]=n[0],t[1]=n[1],t}function r(t,n,a){return t[0]=n,t[1]=a,t}function s(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t}function o(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t}function u(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t}function e(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t}function c(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t}function i(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t}function f(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t}function M(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t}function h(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t}function l(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t}function d(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t}function m(t,n){const a=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(a*a+r*r)}function b(t,n){const a=n[0]-t[0],r=n[1]-t[1];return a*a+r*r}function q(t){const n=t[0],a=t[1];return Math.sqrt(n*n+a*a)}function p(t){const n=t[0],a=t[1];return n*n+a*a}function g(t,n){return t[0]=-n[0],t[1]=-n[1],t}function x(t,n){return t[0]=1/n[0],t[1]=1/n[1],t}function v(t,n){const a=n[0],r=n[1];let s=a*a+r*r;return s>0&&(s=1/Math.sqrt(s),t[0]=n[0]*s,t[1]=n[1]*s),t}function j(t,n){return t[0]*n[0]+t[1]*n[1]}function y(t,n,a){const r=n[0]*a[1]-n[1]*a[0];return t[0]=t[1]=0,t[2]=r,t}function A(t,n,a,r){const s=n[0],o=n[1];return t[0]=s+r*(a[0]-s),t[1]=o+r*(a[1]-o),t}function P(n,a){a=a||1;const r=2*t()*Math.PI;return n[0]=Math.cos(r)*a,n[1]=Math.sin(r)*a,n}function _(t,n,a){const r=n[0],s=n[1];return t[0]=a[0]*r+a[2]*s,t[1]=a[1]*r+a[3]*s,t}function z(t,n,a){const r=n[0],s=n[1];return t[0]=a[0]*r+a[2]*s+a[4],t[1]=a[1]*r+a[3]*s+a[5],t}function D(t,n,a){const r=n[0],s=n[1];return t[0]=a[0]*r+a[3]*s+a[6],t[1]=a[1]*r+a[4]*s+a[7],t}function I(t,n,a){const r=n[0],s=n[1];return t[0]=a[0]*r+a[4]*s+a[12],t[1]=a[1]*r+a[5]*s+a[13],t}function L(t,n,a,r){const s=n[0]-a[0],o=n[1]-a[1],u=Math.sin(r),e=Math.cos(r);return t[0]=s*e-o*u+a[0],t[1]=s*u+o*e+a[1],t}function O(t,n){const a=t[0],r=t[1],s=n[0],o=n[1];let u=a*a+r*r;u>0&&(u=1/Math.sqrt(u));let e=s*s+o*o;e>0&&(e=1/Math.sqrt(e));const c=(a*s+r*o)*u*e;return c>1?0:c<-1?Math.PI:Math.acos(c)}function S(t){return"vec2("+t[0]+", "+t[1]+")"}function E(t,n){return t[0]===n[0]&&t[1]===n[1]}function k(t,a){const r=t[0],s=t[1],o=a[0],u=a[1],e=n();return Math.abs(r-o)<=e*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(s-u)<=e*Math.max(1,Math.abs(s),Math.abs(u))}function w(t,n,a,r,s){let o=n[0]-a[0],u=n[1]-a[1];const e=(r[0]*o+r[1]*u)*(s-1);return o=r[0]*e,u=r[1]*e,t[0]=n[0]+o,t[1]=n[1]+u,t}const B=q,C=o,F=u,G=e,H=m,J=b,K=p,N=Object.freeze(Object.defineProperty({__proto__:null,copy:a,set:r,add:s,subtract:o,multiply:u,divide:e,ceil:c,floor:i,min:f,max:M,round:h,scale:l,scaleAndAdd:d,distance:m,squaredDistance:b,length:q,squaredLength:p,negate:g,inverse:x,normalize:v,dot:j,cross:y,lerp:A,random:P,transformMat2:_,transformMat2d:z,transformMat3:D,transformMat4:I,rotate:L,angle:O,str:S,exactEquals:E,equals:k,projectAndScale:w,len:B,sub:C,mul:F,div:G,dist:H,sqrDist:J,sqrLen:K},Symbol.toStringTag,{value:"Module"}));export{e as A,c as B,i as C,h as D,x as E,P as F,D as G,I as H,O as I,S as J,k as K,B as L,F as M,G as N,J as O,K as P,o as a,l as b,a as c,m as d,C as e,v as f,y as g,j as h,q as i,s as j,b as k,A as l,E as m,g as n,H as o,_ as p,w as q,L as r,r as s,z as t,p as u,d as v,N as w,f as x,M as y,u as z};
|
package/chunks/vec3.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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{c as t}from"./vec3f64.js";import{
|
|
5
|
+
import{c as t}from"./vec3f64.js";import{g as n,R as a}from"./common.js";function s(t){const n=t[0],a=t[1],s=t[2];return Math.sqrt(n*n+a*a+s*s)}function r(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function o(t,n,a,s){return t[0]=n,t[1]=a,t[2]=s,t}function u(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t}function e(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t}function c(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t}function i(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[2],t}function h(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function M(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function f(t,n){return t[0]=Math.abs(n[0]),t[1]=Math.abs(n[1]),t[2]=Math.abs(n[2]),t}function l(t,n){return t[0]=Math.sign(n[0]),t[1]=Math.sign(n[1]),t[2]=Math.sign(n[2]),t}function m(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t}function d(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t}function b(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function g(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t}function q(t,n,a,s){return t[0]=n[0]+a[0]*s,t[1]=n[1]+a[1]*s,t[2]=n[2]+a[2]*s,t}function x(t,n){const a=n[0]-t[0],s=n[1]-t[1],r=n[2]-t[2];return Math.sqrt(a*a+s*s+r*r)}function p(t,n){const a=n[0]-t[0],s=n[1]-t[1],r=n[2]-t[2];return a*a+s*s+r*r}function v(t){const n=t[0],a=t[1],s=t[2];return n*n+a*a+s*s}function j(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function y(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function z(t,n){const a=n[0],s=n[1],r=n[2];let o=a*a+s*s+r*r;return o>0&&(o=1/Math.sqrt(o),t[0]=n[0]*o,t[1]=n[1]*o,t[2]=n[2]*o),t}function P(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function _(t,n,a){const s=n[0],r=n[1],o=n[2],u=a[0],e=a[1],c=a[2];return t[0]=r*c-o*e,t[1]=o*u-s*c,t[2]=s*e-r*u,t}function A(t,n,a,s){const r=n[0],o=n[1],u=n[2];return t[0]=r+s*(a[0]-r),t[1]=o+s*(a[1]-o),t[2]=u+s*(a[2]-u),t}function D(t,n,a,s,r,o){const u=o*o,e=u*(2*o-3)+1,c=u*(o-2)+o,i=u*(o-1),h=u*(3-2*o);return t[0]=n[0]*e+a[0]*c+s[0]*i+r[0]*h,t[1]=n[1]*e+a[1]*c+s[1]*i+r[1]*h,t[2]=n[2]*e+a[2]*c+s[2]*i+r[2]*h,t}function I(t,n,a,s,r,o){const u=1-o,e=u*u,c=o*o,i=e*u,h=3*o*e,M=3*c*u,f=c*o;return t[0]=n[0]*i+a[0]*h+s[0]*M+r[0]*f,t[1]=n[1]*i+a[1]*h+s[1]*M+r[1]*f,t[2]=n[2]*i+a[2]*h+s[2]*M+r[2]*f,t}function L(t,n){n=n||1;const s=a,r=2*s()*Math.PI,o=2*s()-1,u=Math.sqrt(1-o*o)*n;return t[0]=Math.cos(r)*u,t[1]=Math.sin(r)*u,t[2]=o*n,t}function O(t,n,a){const s=n[0],r=n[1],o=n[2];return t[0]=a[0]*s+a[4]*r+a[8]*o+a[12],t[1]=a[1]*s+a[5]*r+a[9]*o+a[13],t[2]=a[2]*s+a[6]*r+a[10]*o+a[14],t}function S(t,n,a){const s=n[0],r=n[1],o=n[2];return t[0]=s*a[0]+r*a[3]+o*a[6],t[1]=s*a[1]+r*a[4]+o*a[7],t[2]=s*a[2]+r*a[5]+o*a[8],t}function E(t,n,a){const s=a[0],r=a[1],o=a[2],u=a[3],e=n[0],c=n[1],i=n[2];let h=r*i-o*c,M=o*e-s*i,f=s*c-r*e,l=r*f-o*M,m=o*h-s*f,d=s*M-r*h;const b=2*u;return h*=b,M*=b,f*=b,l*=2,m*=2,d*=2,t[0]=e+h+l,t[1]=c+M+m,t[2]=i+f+d,t}function Q(t,n,a,s){const r=[],o=[];return r[0]=n[0]-a[0],r[1]=n[1]-a[1],r[2]=n[2]-a[2],o[0]=r[0],o[1]=r[1]*Math.cos(s)-r[2]*Math.sin(s),o[2]=r[1]*Math.sin(s)+r[2]*Math.cos(s),t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function R(t,n,a,s){const r=[],o=[];return r[0]=n[0]-a[0],r[1]=n[1]-a[1],r[2]=n[2]-a[2],o[0]=r[2]*Math.sin(s)+r[0]*Math.cos(s),o[1]=r[1],o[2]=r[2]*Math.cos(s)-r[0]*Math.sin(s),t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function T(t,n,a,s){const r=[],o=[];return r[0]=n[0]-a[0],r[1]=n[1]-a[1],r[2]=n[2]-a[2],o[0]=r[0]*Math.cos(s)-r[1]*Math.sin(s),o[1]=r[0]*Math.sin(s)+r[1]*Math.cos(s),o[2]=r[2],t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function k(t,n){r(w,t),r(B,n),z(w,w),z(B,B);const a=P(w,B);return a>1?0:a<-1?Math.PI:Math.acos(a)}const w=t(),B=t();function C(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function F(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function G(t,a){if(t===a)return!0;const s=t[0],r=t[1],o=t[2],u=a[0],e=a[1],c=a[2],i=n();return Math.abs(s-u)<=i*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(r-e)<=i*Math.max(1,Math.abs(r),Math.abs(e))&&Math.abs(o-c)<=i*Math.max(1,Math.abs(o),Math.abs(c))}function H(t,n,a){const s=a[0]-n[0],r=a[1]-n[1],o=a[2]-n[2];let u=s*s+r*r+o*o;return u>0?(u=1/Math.sqrt(u),t[0]=s*u,t[1]=r*u,t[2]=o*u,t):(t[0]=0,t[1]=0,t[2]=0,t)}const J=e,K=c,N=i,U=x,X=p,Y=s,Z=v,V=Object.freeze(Object.defineProperty({__proto__:null,length:s,copy:r,set:o,add:u,subtract:e,multiply:c,divide:i,ceil:h,floor:M,abs:f,sign:l,min:m,max:d,round:b,scale:g,scaleAndAdd:q,distance:x,squaredDistance:p,squaredLength:v,negate:j,inverse:y,normalize:z,dot:P,cross:_,lerp:A,hermite:D,bezier:I,random:L,transformMat4:O,transformMat3:S,transformQuat:E,rotateX:Q,rotateY:R,rotateZ:T,angle:k,str:C,exactEquals:F,equals:G,direction:H,sub:J,mul:K,div:N,dist:U,sqrDist:X,len:Y,sqrLen:Z},Symbol.toStringTag,{value:"Module"}));export{f as A,m as B,q as C,l as D,c as E,V as F,M as G,i as H,T as I,h as J,d as K,b as L,y as M,D as N,I as O,L as P,Q,R,C as S,K as T,N as U,u as a,e as b,r as c,p as d,P as e,_ as f,g,A as h,x as i,U as j,F as k,s as l,O as m,z as n,j as o,v as p,E as q,H as r,o as s,S as t,Y as u,k as v,J as w,Z as x,X as y,G as z};
|
package/chunks/vec4.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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{g as t,R as n}from"./common.js";function a(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function r(t,n,a,r,s){return t[0]=n,t[1]=a,t[2]=r,t[3]=s,t}function s(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t}function o(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t}function u(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t[3]=n[3]*a[3],t}function e(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[2],t[3]=n[3]/a[3],t}function c(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t[3]=Math.ceil(n[3]),t}function i(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t[3]=Math.floor(n[3]),t}function h(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t[3]=Math.min(n[3],a[3]),t}function M(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t[3]=Math.max(n[3],a[3]),t}function f(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t[3]=Math.round(n[3]),t}function l(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t}function m(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t}function d(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2],o=n[3]-t[3];return Math.sqrt(a*a+r*r+s*s+o*o)}function b(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2],o=n[3]-t[3];return a*a+r*r+s*s+o*o}function x(t){const n=t[0],a=t[1],r=t[2],s=t[3];return Math.sqrt(n*n+a*a+r*r+s*s)}function q(t){const n=t[0],a=t[1],r=t[2],s=t[3];return n*n+a*a+r*r+s*s}function p(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=-n[3],t}function g(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t[3]=1/n[3],t}function v(t,n){const a=n[0],r=n[1],s=n[2],o=n[3];let u=a*a+r*r+s*s+o*o;return u>0&&(u=1/Math.sqrt(u),t[0]=a*u,t[1]=r*u,t[2]=s*u,t[3]=o*u),t}function y(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function j(t,n,a,r){const s=n[0],o=n[1],u=n[2],e=n[3];return t[0]=s+r*(a[0]-s),t[1]=o+r*(a[1]-o),t[2]=u+r*(a[2]-u),t[3]=e+r*(a[3]-e),t}function _(t,a){const r=n;let s,o,u,e,c,i;a=a||1;do{s=2*r()-1,o=2*r()-1,c=s*s+o*o}while(c>=1);do{u=2*r()-1,e=2*r()-1,i=u*u+e*e}while(i>=1);const h=Math.sqrt((1-c)/i);return t[0]=a*s,t[1]=a*o,t[2]=a*u*h,t[3]=a*e*h,t}function w(t,n,a){const r=n[0],s=n[1],o=n[2],u=n[3];return t[0]=a[0]*r+a[4]*s+a[8]*o+a[12]*u,t[1]=a[1]*r+a[5]*s+a[9]*o+a[13]*u,t[2]=a[2]*r+a[6]*s+a[10]*o+a[14]*u,t[3]=a[3]*r+a[7]*s+a[11]*o+a[15]*u,t}function z(t,n,a){const r=n[0],s=n[1],o=n[2],u=a[0],e=a[1],c=a[2],i=a[3],h=i*r+e*o-c*s,M=i*s+c*r-u*o,f=i*o+u*s-e*r,l=-u*r-e*s-c*o;return t[0]=h*i+l*-u+M*-c-f*-e,t[1]=M*i+l*-e+f*-u-h*-c,t[2]=f*i+l*-c+h*-e-M*-u,t[3]=n[3],t}function A(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function D(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function E(n,a){const r=n[0],s=n[1],o=n[2],u=n[3],e=a[0],c=a[1],i=a[2],h=a[3],M=t();return Math.abs(r-e)<=M*Math.max(1,Math.abs(r),Math.abs(e))&&Math.abs(s-c)<=M*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(o-i)<=M*Math.max(1,Math.abs(o),Math.abs(i))&&Math.abs(u-h)<=M*Math.max(1,Math.abs(u),Math.abs(h))}const L=o,O=u,S=e,k=d,B=b,C=x,F=q,G=Object.freeze(Object.defineProperty({__proto__:null,copy:a,set:r,add:s,subtract:o,multiply:u,divide:e,ceil:c,floor:i,min:h,max:M,round:f,scale:l,scaleAndAdd:m,distance:d,squaredDistance:b,length:x,squaredLength:q,negate:p,inverse:g,normalize:v,dot:y,lerp:j,random:_,transformMat4:w,transformQuat:z,str:A,exactEquals:D,equals:E,sub:L,mul:O,div:S,dist:k,sqrDist:B,len:C,sqrLen:F},Symbol.toStringTag,{value:"Module"}));export{_ as A,z as B,A as C,L as D,O as E,S as F,k as G,B as H,C as I,F as J,s as a,l as b,a as c,y as d,x as e,q as f,D as g,E as h,b as i,o as j,e as k,j as l,u as m,v as n,c as o,i as p,h as q,M as r,r as s,w as t,f as u,G as v,m as w,d as x,p as y,g as z};
|
package/core/Message.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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getDeepValue as t}from"./object.js";function e(e,
|
|
5
|
+
import{getDeepValue as t}from"./object.js";function e(e,r){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,((e,s)=>{if(""===s)return"$";const n=t(s,r),i=n??"";if(void 0===i)throw new Error(`could not find key "${s}" in template`);return i.toString()}))}class r{constructor(t,s,n){this.name=t,this.details=n,this instanceof r&&(this.message=(s&&e(s,n))??"")}toString(){return"["+this.name+"]: "+this.message}}export{r 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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../has.js";import t from"../Logger.js";import{pathToArray as n,getProperties as
|
|
5
|
+
import"../has.js";import t from"../Logger.js";import{pathToArray as n,getProperties as e}from"./utils.js";import{Flags as r}from"./tracking/Flags.js";const o={onObservableAccessed:()=>{},onTrackingEnd:()=>{}},c=[];let i=o;function s(t){i.onObservableAccessed(t)}let l=!1,a=!1;function f(t,n,e){if(l)return u(t,n,e);p(t);const r=n.call(e);return d(),r}function g(t,n){return f(o,t,n)}function u(n,e,r){const o=l;l=!0,p(n);let c=null;try{c=e.call(r)}catch(i){a&&t.getLogger("esri.core.accessorSupport.tracking").error(i)}return d(),l=o,c}function p(t){i=t,c.push(t)}function d(){const t=c.length;if(t>1){const n=c.pop();i=c[t-2],n.onTrackingEnd()}else if(1===t){const t=c.pop();i=o,t.onTrackingEnd()}else i=o}function m(t,n){if(n.flags&r.DepTrackingInitialized)return;const e=a;a=!1,n.flags&r.AutoTracked?u(n,n.metadata.get,t):y(t,n),a=e}const k=[];function y(t,e){e.flags&r.ExplicitlyTracking||(e.flags|=r.ExplicitlyTracking,u(e,(()=>{const r=e.metadata.dependsOn||k;for(const e of r)if("string"!=typeof e||e.includes(".")){const r=n(e);for(let n=0,e=t;n<r.length&&null!=e&&"object"==typeof e;++n)e=A(e,r[n],n!==r.length-1)}else A(t,e,!1)})),e.flags&=~r.ExplicitlyTracking)}function A(t,n,r){const o="?"===n[n.length-1]?n.slice(0,-1):n;if(null!=t.getItemAt||Array.isArray(t)){const n=parseInt(o,10);if(!isNaN(n))return Array.isArray(t)?t[n]:t.getItemAt(n)}const c=e(t)?.properties.get(o);return c&&(s(c),m(t,c)),r?t[o]:void 0}export{m as initializeDependencyTracking,f as runTracked,u as runTrackedNoThrow,g as runUntracked,s as trackAccess,y as trackExplicitDependencies};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
export{
|
|
5
|
+
export{R as RANDOM,e as equals,g as getEpsilon,s as setEpsilon,a as toDegree,t as toRadian}from"../../../../chunks/common.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../chunks/common.js";export{
|
|
5
|
+
import"../../../../chunks/common.js";export{j as add,I as angle,B as ceil,c as copy,g as cross,o as dist,d as distance,N as div,A as divide,h as dot,K as equals,m as exactEquals,C as floor,E as inverse,L as len,i as length,l as lerp,y as max,x as min,M as mul,z as multiply,n as negate,f as normalize,q as projectAndScale,F as random,r as rotate,D as round,b as scale,v as scaleAndAdd,s as set,O as sqrDist,P as sqrLen,k as squaredDistance,u as squaredLength,J as str,e as sub,a as subtract,p as transformMat2,t as transformMat2d,G as transformMat3,H as transformMat4}from"../../../../chunks/vec2.js";
|
package/core/pbf.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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"./has.js";import t from"./ObjectPool.js";var e;!function(t){t[t.varint=0]="varint",t[t.fixed64=1]="fixed64",t[t.delimited=2]="delimited",t[t.fixed32=5]="fixed32",t[t.unknown=99]="unknown"}(e||(e={}));const i=4294967296,s=new TextDecoder("utf-8"),r=has("safari")||has("ios")?6:has("ff")?12:32;class n{constructor(t,i,s=0,r=(t?t.byteLength:0)){this._tag=0,this._dataType=e.unknown,this._init(t,i,s,r)}_init(t,e,i,s){this._data=t,this._dataView=e,this._pos=i,this._end=s}clone(){return new n(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(t){this._pos=t}nextTag(t){for(;;){if(this._pos===this._end)return!1;const e=this._decodeVarint();if(this._tag=e>>3,this._dataType=7&e,!t||t===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const t=this._decodeVarint();return this._tag=t>>3,this._dataType=7&t,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let t=4294967295;return t=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?t:(t=(t|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?t:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const t=this.getUInt32();return t>>>1^-(1&t)|0}getSInt64(){return this._decodeSVarint()}getBool(){const t=0!==this._data[this._pos];return this._skip(1),t}getEnum(){return this._decodeVarint()}getFixed64(){const t=this._dataView,e=this._pos,s=t.getUint32(e,!0)+t.getUint32(e+4,!0)*i;return this._skip(8),s}getSFixed64(){const t=this._dataView,e=this._pos,s=t.getUint32(e,!0)+t.getInt32(e+4,!0)*i;return this._skip(8),s}getDouble(){const t=this._dataView.getFloat64(this._pos,!0);return this._skip(8),t}getFixed32(){const t=this._dataView.getUint32(this._pos,!0);return this._skip(4),t}getSFixed32(){const t=this._dataView.getInt32(this._pos,!0);return this._skip(4),t}getFloat(){const t=this._dataView.getFloat32(this._pos,!0);return this._skip(4),t}getString(){const t=this._getLength(),e=this._pos,i=this._toString(this._data,e,e+t);return this._skip(t),i}getBytes(){const t=this._getLength(),e=this._pos,i=this._toBytes(this._data,e,e+t);return this._skip(t),i}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(t,e,i,s){const r=this.getMessage(),n=t(r,e,i,s);return r.release(),n}processMessage(t){const e=this.getMessage(),i=t(e);return e.release(),i}getMessage(){const t=this._getLength(),e=n.pool.acquire();return e._init(this._data,this._dataView,this._pos,this._pos+t),this._skip(t),e}release(){n.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case e.varint:this._decodeVarint();break;case e.fixed64:this._skip(8);break;case e.delimited:this._skip(this._getLength());break;case e.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(t){this._skip(t)}_skip(t){if(this._pos+t>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=t}_decodeVarint(){const t=this._data;let e
|
|
5
|
+
import has from"./has.js";import t from"./ObjectPool.js";var e;!function(t){t[t.varint=0]="varint",t[t.fixed64=1]="fixed64",t[t.delimited=2]="delimited",t[t.fixed32=5]="fixed32",t[t.unknown=99]="unknown"}(e||(e={}));const i=4294967296,s=new TextDecoder("utf-8"),r=has("safari")||has("ios")?6:has("ff")?12:32;class n{constructor(t,i,s=0,r=(t?t.byteLength:0)){this._tag=0,this._dataType=e.unknown,this._init(t,i,s,r)}_init(t,e,i,s){this._data=t,this._dataView=e,this._pos=i,this._end=s}clone(){return new n(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(t){this._pos=t}nextTag(t){for(;;){if(this._pos===this._end)return!1;const e=this._decodeVarint();if(this._tag=e>>3,this._dataType=7&e,!t||t===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const t=this._decodeVarint();return this._tag=t>>3,this._dataType=7&t,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let t=4294967295;return t=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?t:(t=(t|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?t:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const t=this.getUInt32();if(void 0!==t)return t>>>1^-(1&t)|0}getSInt64(){return this._decodeSVarint()}getBool(){const t=0!==this._data[this._pos];return this._skip(1),t}getEnum(){return this._decodeVarint()}getFixed64(){const t=this._dataView,e=this._pos,s=t.getUint32(e,!0)+t.getUint32(e+4,!0)*i;return this._skip(8),s}getSFixed64(){const t=this._dataView,e=this._pos,s=t.getUint32(e,!0)+t.getInt32(e+4,!0)*i;return this._skip(8),s}getDouble(){const t=this._dataView.getFloat64(this._pos,!0);return this._skip(8),t}getFixed32(){const t=this._dataView.getUint32(this._pos,!0);return this._skip(4),t}getSFixed32(){const t=this._dataView.getInt32(this._pos,!0);return this._skip(4),t}getFloat(){const t=this._dataView.getFloat32(this._pos,!0);return this._skip(4),t}getString(){const t=this._getLength(),e=this._pos,i=this._toString(this._data,e,e+t);return this._skip(t),i}getBytes(){const t=this._getLength(),e=this._pos,i=this._toBytes(this._data,e,e+t);return this._skip(t),i}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(t,e,i,s){const r=this.getMessage(),n=t(r,e,i,s);return r.release(),n}processMessage(t){const e=this.getMessage(),i=t(e);return e.release(),i}getMessage(){const t=this._getLength(),e=n.pool.acquire();return e._init(this._data,this._dataView,this._pos,this._pos+t),this._skip(t),e}release(){n.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case e.varint:this._decodeVarint();break;case e.fixed64:this._skip(8);break;case e.delimited:this._skip(this._getLength());break;case e.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(t){this._skip(t)}_skip(t){if(this._pos+t>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=t}_decodeVarint(){const t=this._data;let e=this._pos,i=0,s=0;if(this._end-e>=10)do{if(s=t[e++],i|=127&s,0==(128&s))break;if(s=t[e++],i|=(127&s)<<7,0==(128&s))break;if(s=t[e++],i|=(127&s)<<14,0==(128&s))break;if(s=t[e++],i|=(127&s)<<21,0==(128&s))break;if(s=t[e++],i+=268435456*(127&s),0==(128&s))break;if(s=t[e++],i+=34359738368*(127&s),0==(128&s))break;if(s=t[e++],i+=4398046511104*(127&s),0==(128&s))break;if(s=t[e++],i+=562949953421312*(127&s),0==(128&s))break;if(s=t[e++],i+=72057594037927940*(127&s),0==(128&s))break;if(s=t[e++],i+=0x8000000000000000*(127&s),0==(128&s))break;throw new Error("Varint too long!")}while(0);else{let r=1;for(;e!==this._end&&(s=t[e],0!=(128&s));)++e,i+=(127&s)*r,r*=128;if(e===this._end)throw new Error("Varint overrun!");++e,i+=s*r}return this._pos=e,i}_decodeSVarint(){const t=this._decodeVarint();return t%2?-(t+1)/2:t/2}_getLength(){if(this._dataType!==e.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(t,e,i){if((i=Math.min(this._end,i))-e>r){const r=t.subarray(e,i);return s.decode(r)}let n="",a="";for(let s=e;s<i;++s){const e=t[s];128&e?a+="%"+e.toString(16):(n+=decodeURIComponent(a)+String.fromCharCode(e),a="")}return a.length&&(n+=decodeURIComponent(a)),n}_toBytes(t,e,i){return i=Math.min(this._end,i),new Uint8Array(t.buffer,e,i-e)}}n.pool=new t(n,void 0,(t=>{t._data=null,t._dataView=null}));export{n as default};
|
package/core/quantity.js
CHANGED
package/core/sql/WhereClause.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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../has.js";import{isAggregate as e,aggregateFunction as t}from"./AggregateFunctions.js";import{SqlInterval as a,isStandardized as r,evaluateFunction as s}from"./StandardizedFunctions.js";import{WhereGrammar as n}from"./WhereGrammar.js";const i=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,l=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2}(\.[0-9]+)?)$/,u=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2}(\.[0-9]+)?)(\+|\-)(\d{1,2}):(\d{1,2})$/,o=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})(\+|\-)(\d{1,2}):(\d{1,2})$/,c=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/,h=new Set(["current_timestamp","current_date","current_time"]);function d(e,t){return(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e}function p(e,t,a="0",r="0",s="0",n="0",i="",l="0",u="0"){if("+"===i||"-"===i){const o=`${d(parseInt(e,10),4)}-${d(parseInt(t,10),2)}-${d(parseInt(a,10),2)}`;let c="";parseFloat(n)<10&&(c="0");const h=`${d(parseInt(r,10),2)}:${d(parseInt(s,10),2)}:${c+parseFloat(n).toString()}`,p=`${i}${d(parseInt(l,10),2)}:${d(parseInt(u,10),2)}`;return new Date(o+"T"+h+p)}return new Date(parseInt(e,10),parseInt(t,10)-1,parseInt(a,10),parseInt(r,10),parseInt(s,10),parseFloat(n))}class v{static makeBool(e){return g(e)}static featureValue(e,t,a,r){return M(e,t,a,r)}static equalsNull(e){return null===e}static applyLike(e,t,a){return D(e,t,a)}static ensureArray(e){return T(e)}static applyIn(e,t){return y(e,t)}static currentDate(){const e=new Date;return e.setHours(0,0,0,0),e}static makeSqlInterval(e,t,r){return a.createFromValueAndQualifer(e,t,r)}static convertInterval(e){return e instanceof a?e.valueInMilliseconds():e}static currentTimestamp(){return new Date}static compare(e,t,a){return E(e,t,a)}static calculate(e,t,a){return x(e,t,a)}static makeComparable(e){return b(e)}static evaluateFunction(e,t){return s(e,t)}static lookup(e,t){const a=t[e];return void 0===a?null:a}static between(e,t){return null==e||null==t[0]||null==t[1]?null:e>=t[0]&&e<=t[1]}static notbetween(e,t){return null==e||null==t[0]||null==t[1]?null:e<t[0]||e>t[1]}static ternaryNot(e){return _(e)}static ternaryAnd(e,t){return S(e,t)}static ternaryOr(e,t){return w(e,t)}}class f{constructor(e,t){this.fieldsIndex=t,this.datefields={},this.parameters={},this._hasDateFunctions=void 0,this.parseTree=n.parse(e);const{isStandardized:a,isAggregate:r,referencedFieldNames:s}=this._extractExpressionInfo(t);this.referencedFieldNames=s,this.isStandardized=a,this.isAggregate=r}static create(e,t){return new f(e,t)}get fieldNames(){return this.referencedFieldNames}testSet(e,t=O){const a={};for(const r of this.fieldNames)a[r]=e.map((e=>t.getAttribute(e,r)));return!!this._evaluateNode(this.parseTree,{attributes:a},O)}calculateValue(e,t=O){const r=this._evaluateNode(this.parseTree,e,t);return r instanceof a?r.valueInMilliseconds()/864e5:r}calculateValueCompiled(e,t=O){return null!=this.parseTree._compiledVersion?this.parseTree._compiledVersion(e,this.parameters,t,this.datefields):has("esri-csp-restrictions")?this.calculateValue(e,t):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,t,this.datefields))}testFeature(e,t=O){return!!this._evaluateNode(this.parseTree,e,t)}testFeatureCompiled(e,t=O){return null!=this.parseTree._compiledVersion?!!this.parseTree._compiledVersion(e,this.parameters,t,this.datefields):has("esri-csp-restrictions")?this.testFeature(e,t):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,t,this.datefields))}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,this._visitAll(this.parseTree,(e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||h.has(e.name.toLowerCase()))}))),this._hasDateFunctions}getFunctions(){const e=new Set;return this._visitAll(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return this._visitAll(this.parseTree,(t=>{if("function"===t.type){const a=t.name.toLowerCase(),r=t.args.value[0];if("column-reference"===r.type){const t=r.column,s=`${a}-${t}`;e.has(s)||e.set(s,{aggregateType:a,field:t})}}})),[...e.values()]}getVariables(){const e=new Set;return this._visitAll(this.parseTree,(t=>{"parameter"===t.type&&e.add(t.value.toLowerCase())})),Array.from(e)}_compileMe(){const e="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","datefields",e).bind(v)}_extractExpressionInfo(t){const a=[],s=new Set;let n=!0,i=!0;return this._visitAll(this.parseTree,(l=>{switch(l.type){case"column-reference":{const e=t.get(l.column);let r,n;e?r=n=e.name:(n=l.column,r=n.toLowerCase()),!e||"date"!==e.type&&"esriFieldTypeDate"!==e.type||(this.datefields[e.name]=1),s.has(r)||(s.add(r),a.push(n)),l.column=n;break}case"function":{const{name:t,args:a}=l,s=a.value.length;n&&(n=r(t,s)),i&&(i=e(t,s));break}}})),{referencedFieldNames:Array.from(a),isStandardized:n,isAggregate:i}}_visitAll(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":this._visitAll(e.operand,t),this._visitAll(e.value,t);break;case"case-expression":for(const a of e.clauses)this._visitAll(a,t);"simple"===e.format&&this._visitAll(e.operand,t),null!==e.else&&this._visitAll(e.else,t);break;case"expression-list":for(const a of e.value)this._visitAll(a,t);break;case"unary-expression":this._visitAll(e.expr,t);break;case"binary-expression":this._visitAll(e.left,t),this._visitAll(e.right,t);break;case"function":this._visitAll(e.args,t)}}evaluateNodeToJavaScript(e){switch(e.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(e.value)+", "+JSON.stringify(e.qualifier)+","+JSON.stringify(e.op)+")";case"case-expression":{let t="";if("simple"===e.format){const a="this.makeComparable("+this.evaluateNodeToJavaScript(e.operand)+")";t="( ";for(let r=0;r<e.clauses.length;r++)t+=" ("+a+" === this.makeComparable("+this.evaluateNodeToJavaScript(e.clauses[r].operand)+")) ? ("+this.evaluateNodeToJavaScript(e.clauses[r].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}else{t="( ";for(let a=0;a<e.clauses.length;a++)t+=" this.makeBool("+this.evaluateNodeToJavaScript(e.clauses[a].operand)+")===true ? ("+this.evaluateNodeToJavaScript(e.clauses[a].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}return t}case"parameter":return"this.lookup("+JSON.stringify(e.value.toLowerCase())+",lookups)";case"expression-list":{let t="[";for(const a of e.value)"["!==t&&(t+=","),t+=this.evaluateNodeToJavaScript(a);return t+="]",t}case"unary-expression":return"this.ternaryNot("+this.evaluateNodeToJavaScript(e.expr)+")";case"binary-expression":switch(e.operator){case"AND":return"this.ternaryAnd("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"OR":return"this.ternaryOr("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"IS":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return"this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")";case"ISNOT":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return"(!(this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")))";case"IN":return"this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+"))";case"NOT IN":return"this.ternaryNot(this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+")))";case"BETWEEN":return"this.between("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+")";case"NOTBETWEEN":return"this.notbetween("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+")";case"LIKE":return"this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+")";case"NOT LIKE":return"this.ternaryNot(this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+"))";case"<>":case"<":case">":case">=":case"<=":case"=":return"this.compare("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+")";case"*":case"-":case"+":case"/":return"this.calculate("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+")"}throw new Error("Not Supported Operator "+e.operator);case"null":case"boolean":case"string":case"number":return JSON.stringify(e.value);case"date":return"(new Date("+N(e.value).getTime().toString()+"))";case"timestamp":return"(new Date("+m(e.value).getTime().toString()+"))";case"current-time":return"date"===e.mode?"this.currentDate()":"this.currentTimestamp()";case"column-reference":return"this.featureValue(feature,"+JSON.stringify(e.column)+",datefields,attributeAdapter)";case"function":return"this.evaluateFunction("+JSON.stringify(e.name)+","+this.evaluateNodeToJavaScript(e.args)+")"}throw new Error("Unsupported sql syntax "+e.type)}_evaluateNode(e,r,n){switch(e.type){case"interval":{const t=this._evaluateNode(e.value,r,n);return a.createFromValueAndQualifer(t,e.qualifier,e.op)}case"case-expression":if("simple"===e.format){const t=b(this._evaluateNode(e.operand,r,n));for(let a=0;a<e.clauses.length;a++)if(t===b(this._evaluateNode(e.clauses[a].operand,r,n)))return this._evaluateNode(e.clauses[a].value,r,n);if(null!==e.else)return this._evaluateNode(e.else,r,n)}else{for(let t=0;t<e.clauses.length;t++)if(g(this._evaluateNode(e.clauses[t].operand,r,n)))return this._evaluateNode(e.clauses[t].value,r,n);if(null!==e.else)return this._evaluateNode(e.else,r,n)}return null;case"parameter":return this.parameters[e.value.toLowerCase()];case"expression-list":{const t=[];for(const a of e.value)t.push(this._evaluateNode(a,r,n));return t}case"unary-expression":return _(this._evaluateNode(e.expr,r,n));case"binary-expression":switch(e.operator){case"AND":return S(this._evaluateNode(e.left,r,n),this._evaluateNode(e.right,r,n));case"OR":return w(this._evaluateNode(e.left,r,n),this._evaluateNode(e.right,r,n));case"IS":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return null===this._evaluateNode(e.left,r,n);case"ISNOT":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return null!==this._evaluateNode(e.left,r,n);case"IN":{const t=T(this._evaluateNode(e.right,r,n));return y(this._evaluateNode(e.left,r,n),t)}case"NOT IN":{const t=T(this._evaluateNode(e.right,r,n));return _(y(this._evaluateNode(e.left,r,n),t))}case"BETWEEN":{const t=this._evaluateNode(e.left,r,n),a=this._evaluateNode(e.right,r,n);return null==t||null==a[0]||null==a[1]?null:t>=b(a[0])&&t<=b(a[1])}case"NOTBETWEEN":{const t=this._evaluateNode(e.left,r,n),a=this._evaluateNode(e.right,r,n);return null==t||null==a[0]||null==a[1]?null:t<b(a[0])||t>b(a[1])}case"LIKE":return D(this._evaluateNode(e.left,r,n),this._evaluateNode(e.right,r,n),e.escape);case"NOT LIKE":return _(D(this._evaluateNode(e.left,r,n),this._evaluateNode(e.right,r,n),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return E(e.operator,this._evaluateNode(e.left,r,n),this._evaluateNode(e.right,r,n));case"-":case"+":case"*":case"/":return x(e.operator,this._evaluateNode(e.left,r,n),this._evaluateNode(e.right,r,n))}case"null":case"boolean":case"string":case"number":return e.value;case"date":return N(e.value);case"timestamp":return m(e.value);case"current-time":{const t=new Date;return"date"===e.mode&&t.setHours(0,0,0,0),t}case"column-reference":return M(r,e.column,this.datefields,n);case"function":{const a=this._evaluateNode(e.args,r,n);return this.isAggregate?t(e.name,a):s(e.name,a)}}throw new Error("Unsupported sql syntax "+e.type)}}function m(e){let t=l.exec(e);if(null!==t){const[,e,a,r,s,n,i]=t;return p(e,a,r,s,n,i)}if(t=u.exec(e),null!==t){const[,e,a,r,s,n,i,l,u,o]=t;return p(e,a,r,s,n,i,l,u,o)}if(t=o.exec(e),null!==t){const[,e,a,r,s,n,i,l,u]=t;return p(e,a,r,s,n,"0",i,l,u)}if(t=c.exec(e),null!==t){const[,e,a,r,s,n]=t;return p(e,a,r,s,n)}if(t=i.exec(e),null!==t){const[,e,a,r]=t;return p(e,a,r)}throw new Error("SQL Invalid Timestamp")}function N(e){const t=i.exec(e);if(null===t)throw new Error("SQL Invalid Date");const[,a,r,s]=t;return new Date(parseInt(a,10),parseInt(r,10)-1,parseInt(s,10))}function g(e){return!0===e}function T(e){return Array.isArray(e)?e:[e]}function _(e){return null!==e?!0!==e:null}function S(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function w(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function y(e,t){if(null==e)return null;let a=!1;for(const r of t)if(null==r)a=null;else if(e===r){a=!0;break}return a}const I="-[]/{}()*+?.\\^$|";var J;function A(e,t){const a=t;let r="",s=J.Normal;for(let n=0;n<e.length;n++){const t=e.charAt(n);switch(s){case J.Normal:t===a?s=J.Escaped:I.includes(t)?r+="\\"+t:r+="%"===t?".*":"_"===t?".":t;break;case J.Escaped:I.includes(t)?r+="\\"+t:r+=t,s=J.Normal}}return new RegExp("^"+r+"$","m")}function D(e,t,a){if(null==e)return null;return A(t,a).test(e)}function b(e){return e instanceof Date?e.valueOf():e}function E(e,t,a){if(null==t||null==a)return null;const r=b(t),s=b(a);switch(e){case"<>":return r!==s;case"=":return r===s;case">":return r>s;case"<":return r<s;case">=":return r>=s;case"<=":return r<=s}}function x(e,t,r){if(t instanceof a)if(r instanceof Date)switch(e){case"+":return new Date(t.valueInMilliseconds()+r.getTime());case"-":return t.valueInMilliseconds()-r.getTime();case"*":return t.valueInMilliseconds()*r.getTime();case"/":return t.valueInMilliseconds()/r.getTime()}else if(r instanceof a)switch(e){case"+":return a.createFromMilliseconds(t.valueInMilliseconds()+r.valueInMilliseconds());case"-":return a.createFromMilliseconds(t.valueInMilliseconds()-r.valueInMilliseconds());case"*":return t.valueInMilliseconds()*r.valueInMilliseconds();case"/":return t.valueInMilliseconds()/r.valueInMilliseconds()}else t=t.valueInMilliseconds();else if(r instanceof a)if(t instanceof Date)switch(e){case"+":return new Date(r.valueInMilliseconds()+t.getTime());case"-":return new Date(t.getTime()-r.valueInMilliseconds());case"*":return t.getTime()*r.valueInMilliseconds();case"/":return t.getTime()/r.valueInMilliseconds()}else r=r.valueInMilliseconds();else if(t instanceof Date&&"number"==typeof r)switch(r=24*r*60*60*1e3,t=t.getTime(),e){case"+":return new Date(t+r);case"-":return new Date(t-r);case"*":return new Date(t*r);case"/":return new Date(t/r)}else if(r instanceof Date&&"number"==typeof t)switch(t=24*t*60*60*1e3,r=r.getTime(),e){case"+":return new Date(t+r);case"-":return new Date(t-r);case"*":return new Date(t*r);case"/":return new Date(t/r)}switch(e){case"+":return t+r;case"-":return t-r;case"*":return t*r;case"/":return t/r}}function F(e){return e&&"object"==typeof e.attributes}function M(e,t,a,r){const s=r.getAttribute(e,t);return null!=s&&1===a[t]?new Date(s):s}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(J||(J={}));const O={getAttribute:(e,t)=>(F(e)?e.attributes:e)[t]};export{f as WhereClause,O as defaultAttributeAdapter};
|
|
5
|
+
import has from"../has.js";import{isAggregate as e,aggregateFunction as t}from"./AggregateFunctions.js";import{SqlInterval as a,isStandardized as r,evaluateFunction as s}from"./StandardizedFunctions.js";import{WhereGrammar as n}from"./WhereGrammar.js";const i=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,l=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2}(\.[0-9]+)?)$/,u=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2}(\.[0-9]+)?)(\+|\-)(\d{1,2}):(\d{1,2})$/,o=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})(\+|\-)(\d{1,2}):(\d{1,2})$/,c=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/,h=new Set(["current_timestamp","current_date","current_time"]);function d(e,t){return(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e}function p(e,t,a="0",r="0",s="0",n="0",i="",l="0",u="0"){if("+"===i||"-"===i){const o=`${d(parseInt(e,10),4)}-${d(parseInt(t,10),2)}-${d(parseInt(a,10),2)}`;let c="";parseFloat(n)<10&&(c="0");const h=`${d(parseInt(r,10),2)}:${d(parseInt(s,10),2)}:${c+parseFloat(n).toString()}`,p=`${i}${d(parseInt(l,10),2)}:${d(parseInt(u,10),2)}`;return new Date(o+"T"+h+p)}return new Date(parseInt(e,10),parseInt(t,10)-1,parseInt(a,10),parseInt(r,10),parseInt(s,10),parseFloat(n))}class v{static makeBool(e){return g(e)}static featureValue(e,t,a,r){return M(e,t,a,r)}static equalsNull(e){return null===e}static applyLike(e,t,a){return D(e,t,a)}static ensureArray(e){return T(e)}static applyIn(e,t){return y(e,t)}static currentDate(){const e=new Date;return e.setHours(0,0,0,0),e}static makeSqlInterval(e,t,r){return a.createFromValueAndQualifer(e,t,r)}static convertInterval(e){return e instanceof a?e.valueInMilliseconds():e}static currentTimestamp(){return new Date}static compare(e,t,a){return E(e,t,a)}static calculate(e,t,a){return x(e,t,a)}static makeComparable(e){return b(e)}static evaluateFunction(e,t){return s(e,t)}static lookup(e,t){const a=t[e];return void 0===a?null:a}static between(e,t){return null==e||null==t[0]||null==t[1]?null:e>=t[0]&&e<=t[1]}static notbetween(e,t){return null==e||null==t[0]||null==t[1]?null:e<t[0]||e>t[1]}static ternaryNot(e){return _(e)}static ternaryAnd(e,t){return S(e,t)}static ternaryOr(e,t){return w(e,t)}}class f{constructor(e,t){this.fieldsIndex=t,this.datefields={},this.parameters={},this._hasDateFunctions=void 0,this.parseTree=n.parse(e);const{isStandardized:a,isAggregate:r,referencedFieldNames:s}=this._extractExpressionInfo(t);this.referencedFieldNames=s,this.isStandardized=a,this.isAggregate=r}static create(e,t){return new f(e,t)}get fieldNames(){return this.referencedFieldNames}testSet(e,t=O){const a={};for(const r of this.fieldNames)a[r]=e.map((e=>t.getAttribute(e,r)));return!!this._evaluateNode(this.parseTree,{attributes:a},O)}calculateValue(e,t=O){const r=this._evaluateNode(this.parseTree,e,t);return r instanceof a?r.valueInMilliseconds()/864e5:r}calculateValueCompiled(e,t=O){return null!=this.parseTree._compiledVersion?this.parseTree._compiledVersion(e,this.parameters,t,this.datefields):has("esri-csp-restrictions")?this.calculateValue(e,t):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,t,this.datefields))}testFeature(e,t=O){return!!this._evaluateNode(this.parseTree,e,t)}testFeatureCompiled(e,t=O){return null!=this.parseTree._compiledVersion?!!this.parseTree._compiledVersion(e,this.parameters,t,this.datefields):has("esri-csp-restrictions")?this.testFeature(e,t):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,t,this.datefields))}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,this._visitAll(this.parseTree,(e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||h.has(e.name.toLowerCase()))}))),this._hasDateFunctions}getFunctions(){const e=new Set;return this._visitAll(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return this._visitAll(this.parseTree,(t=>{if("function"===t.type){const a=t.name.toLowerCase(),r=t.args.value[0];if("column-reference"===r.type){const t=r.column,s=`${a}-${t}`;e.has(s)||e.set(s,{aggregateType:a,field:t})}}})),[...e.values()]}getVariables(){const e=new Set;return this._visitAll(this.parseTree,(t=>{"parameter"===t.type&&e.add(t.value.toLowerCase())})),Array.from(e)}_compileMe(){const e="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","datefields",e).bind(v)}_extractExpressionInfo(t){const a=[],s=new Set;let n=!0,i=!0;return this._visitAll(this.parseTree,(l=>{switch(l.type){case"column-reference":{const e=t.get(l.column);let r,n;e?r=n=e.name??"":(n=l.column,r=n.toLowerCase()),e&&e.name&&("date"===e.type||"esriFieldTypeDate"===e.type)&&(this.datefields[e.name]=1),s.has(r)||(s.add(r),a.push(n)),l.column=n;break}case"function":{const{name:t,args:a}=l,s=a.value.length;n&&(n=r(t,s)),i&&(i=e(t,s));break}}})),{referencedFieldNames:Array.from(a),isStandardized:n,isAggregate:i}}_visitAll(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":this._visitAll(e.operand,t),this._visitAll(e.value,t);break;case"case-expression":for(const a of e.clauses)this._visitAll(a,t);"simple"===e.format&&this._visitAll(e.operand,t),null!==e.else&&this._visitAll(e.else,t);break;case"expression-list":for(const a of e.value)this._visitAll(a,t);break;case"unary-expression":this._visitAll(e.expr,t);break;case"binary-expression":this._visitAll(e.left,t),this._visitAll(e.right,t);break;case"function":this._visitAll(e.args,t)}}evaluateNodeToJavaScript(e){switch(e.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(e.value)+", "+JSON.stringify(e.qualifier)+","+JSON.stringify(e.op)+")";case"case-expression":{let t="";if("simple"===e.format){const a="this.makeComparable("+this.evaluateNodeToJavaScript(e.operand)+")";t="( ";for(let r=0;r<e.clauses.length;r++)t+=" ("+a+" === this.makeComparable("+this.evaluateNodeToJavaScript(e.clauses[r].operand)+")) ? ("+this.evaluateNodeToJavaScript(e.clauses[r].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}else{t="( ";for(let a=0;a<e.clauses.length;a++)t+=" this.makeBool("+this.evaluateNodeToJavaScript(e.clauses[a].operand)+")===true ? ("+this.evaluateNodeToJavaScript(e.clauses[a].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}return t}case"parameter":return"this.lookup("+JSON.stringify(e.value.toLowerCase())+",lookups)";case"expression-list":{let t="[";for(const a of e.value)"["!==t&&(t+=","),t+=this.evaluateNodeToJavaScript(a);return t+="]",t}case"unary-expression":return"this.ternaryNot("+this.evaluateNodeToJavaScript(e.expr)+")";case"binary-expression":switch(e.operator){case"AND":return"this.ternaryAnd("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"OR":return"this.ternaryOr("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"IS":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return"this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")";case"ISNOT":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return"(!(this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")))";case"IN":return"this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+"))";case"NOT IN":return"this.ternaryNot(this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+")))";case"BETWEEN":return"this.between("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+")";case"NOTBETWEEN":return"this.notbetween("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+")";case"LIKE":return"this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+")";case"NOT LIKE":return"this.ternaryNot(this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+"))";case"<>":case"<":case">":case">=":case"<=":case"=":return"this.compare("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+")";case"*":case"-":case"+":case"/":return"this.calculate("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+")"}throw new Error("Not Supported Operator "+e.operator);case"null":case"boolean":case"string":case"number":return JSON.stringify(e.value);case"date":return"(new Date("+N(e.value).getTime().toString()+"))";case"timestamp":return"(new Date("+m(e.value).getTime().toString()+"))";case"current-time":return"date"===e.mode?"this.currentDate()":"this.currentTimestamp()";case"column-reference":return"this.featureValue(feature,"+JSON.stringify(e.column)+",datefields,attributeAdapter)";case"function":return"this.evaluateFunction("+JSON.stringify(e.name)+","+this.evaluateNodeToJavaScript(e.args)+")"}throw new Error("Unsupported sql syntax "+e.type)}_evaluateNode(e,r,n){switch(e.type){case"interval":{const t=this._evaluateNode(e.value,r,n);return a.createFromValueAndQualifer(t,e.qualifier,e.op)}case"case-expression":if("simple"===e.format){const t=b(this._evaluateNode(e.operand,r,n));for(let a=0;a<e.clauses.length;a++)if(t===b(this._evaluateNode(e.clauses[a].operand,r,n)))return this._evaluateNode(e.clauses[a].value,r,n);if(null!==e.else)return this._evaluateNode(e.else,r,n)}else{for(let t=0;t<e.clauses.length;t++)if(g(this._evaluateNode(e.clauses[t].operand,r,n)))return this._evaluateNode(e.clauses[t].value,r,n);if(null!==e.else)return this._evaluateNode(e.else,r,n)}return null;case"parameter":return this.parameters[e.value.toLowerCase()];case"expression-list":{const t=[];for(const a of e.value)t.push(this._evaluateNode(a,r,n));return t}case"unary-expression":return _(this._evaluateNode(e.expr,r,n));case"binary-expression":switch(e.operator){case"AND":return S(this._evaluateNode(e.left,r,n),this._evaluateNode(e.right,r,n));case"OR":return w(this._evaluateNode(e.left,r,n),this._evaluateNode(e.right,r,n));case"IS":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return null===this._evaluateNode(e.left,r,n);case"ISNOT":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return null!==this._evaluateNode(e.left,r,n);case"IN":{const t=T(this._evaluateNode(e.right,r,n));return y(this._evaluateNode(e.left,r,n),t)}case"NOT IN":{const t=T(this._evaluateNode(e.right,r,n));return _(y(this._evaluateNode(e.left,r,n),t))}case"BETWEEN":{const t=this._evaluateNode(e.left,r,n),a=this._evaluateNode(e.right,r,n);return null==t||null==a[0]||null==a[1]?null:t>=b(a[0])&&t<=b(a[1])}case"NOTBETWEEN":{const t=this._evaluateNode(e.left,r,n),a=this._evaluateNode(e.right,r,n);return null==t||null==a[0]||null==a[1]?null:t<b(a[0])||t>b(a[1])}case"LIKE":return D(this._evaluateNode(e.left,r,n),this._evaluateNode(e.right,r,n),e.escape);case"NOT LIKE":return _(D(this._evaluateNode(e.left,r,n),this._evaluateNode(e.right,r,n),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return E(e.operator,this._evaluateNode(e.left,r,n),this._evaluateNode(e.right,r,n));case"-":case"+":case"*":case"/":return x(e.operator,this._evaluateNode(e.left,r,n),this._evaluateNode(e.right,r,n))}case"null":case"boolean":case"string":case"number":return e.value;case"date":return N(e.value);case"timestamp":return m(e.value);case"current-time":{const t=new Date;return"date"===e.mode&&t.setHours(0,0,0,0),t}case"column-reference":return M(r,e.column,this.datefields,n);case"function":{const a=this._evaluateNode(e.args,r,n);return this.isAggregate?t(e.name,a):s(e.name,a)}}throw new Error("Unsupported sql syntax "+e.type)}}function m(e){let t=l.exec(e);if(null!==t){const[,e,a,r,s,n,i]=t;return p(e,a,r,s,n,i)}if(t=u.exec(e),null!==t){const[,e,a,r,s,n,i,l,u,o]=t;return p(e,a,r,s,n,i,l,u,o)}if(t=o.exec(e),null!==t){const[,e,a,r,s,n,i,l,u]=t;return p(e,a,r,s,n,"0",i,l,u)}if(t=c.exec(e),null!==t){const[,e,a,r,s,n]=t;return p(e,a,r,s,n)}if(t=i.exec(e),null!==t){const[,e,a,r]=t;return p(e,a,r)}throw new Error("SQL Invalid Timestamp")}function N(e){const t=i.exec(e);if(null===t)throw new Error("SQL Invalid Date");const[,a,r,s]=t;return new Date(parseInt(a,10),parseInt(r,10)-1,parseInt(s,10))}function g(e){return!0===e}function T(e){return Array.isArray(e)?e:[e]}function _(e){return null!==e?!0!==e:null}function S(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function w(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function y(e,t){if(null==e)return null;let a=!1;for(const r of t)if(null==r)a=null;else if(e===r){a=!0;break}return a}const I="-[]/{}()*+?.\\^$|";var J;function A(e,t){const a=t;let r="",s=J.Normal;for(let n=0;n<e.length;n++){const t=e.charAt(n);switch(s){case J.Normal:t===a?s=J.Escaped:I.includes(t)?r+="\\"+t:r+="%"===t?".*":"_"===t?".":t;break;case J.Escaped:I.includes(t)?r+="\\"+t:r+=t,s=J.Normal}}return new RegExp("^"+r+"$","m")}function D(e,t,a){if(null==e)return null;return A(t,a).test(e)}function b(e){return e instanceof Date?e.valueOf():e}function E(e,t,a){if(null==t||null==a)return null;const r=b(t),s=b(a);switch(e){case"<>":return r!==s;case"=":return r===s;case">":return r>s;case"<":return r<s;case">=":return r>=s;case"<=":return r<=s}}function x(e,t,r){if(t instanceof a)if(r instanceof Date)switch(e){case"+":return new Date(t.valueInMilliseconds()+r.getTime());case"-":return t.valueInMilliseconds()-r.getTime();case"*":return t.valueInMilliseconds()*r.getTime();case"/":return t.valueInMilliseconds()/r.getTime()}else if(r instanceof a)switch(e){case"+":return a.createFromMilliseconds(t.valueInMilliseconds()+r.valueInMilliseconds());case"-":return a.createFromMilliseconds(t.valueInMilliseconds()-r.valueInMilliseconds());case"*":return t.valueInMilliseconds()*r.valueInMilliseconds();case"/":return t.valueInMilliseconds()/r.valueInMilliseconds()}else t=t.valueInMilliseconds();else if(r instanceof a)if(t instanceof Date)switch(e){case"+":return new Date(r.valueInMilliseconds()+t.getTime());case"-":return new Date(t.getTime()-r.valueInMilliseconds());case"*":return t.getTime()*r.valueInMilliseconds();case"/":return t.getTime()/r.valueInMilliseconds()}else r=r.valueInMilliseconds();else if(t instanceof Date&&"number"==typeof r)switch(r=24*r*60*60*1e3,t=t.getTime(),e){case"+":return new Date(t+r);case"-":return new Date(t-r);case"*":return new Date(t*r);case"/":return new Date(t/r)}else if(r instanceof Date&&"number"==typeof t)switch(t=24*t*60*60*1e3,r=r.getTime(),e){case"+":return new Date(t+r);case"-":return new Date(t-r);case"*":return new Date(t*r);case"/":return new Date(t/r)}switch(e){case"+":return t+r;case"-":return t-r;case"*":return t*r;case"/":return t/r}}function F(e){return e&&"object"==typeof e.attributes}function M(e,t,a,r){const s=r.getAttribute(e,t);return null!=s&&1===a[t]?new Date(s):s}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(J||(J={}));const O={getAttribute:(e,t)=>(F(e)?e.attributes:e)[t]};export{f as WhereClause,O as defaultAttributeAdapter};
|
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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../config.js";import n from"./Error.js";import e from"./Logger.js";import{assumeNonNull as r,isSome as o,isNone as i}from"./maybe.js";const s=e.getLogger("esri.core.urlUtils"),u=t.request,c="esri/config: esriConfig.request.proxyUrl is not set.",l=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,a=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,d=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{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=r(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=r(this.authority.match(m)),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 $={},x=new y(t.applicationUrl);let w=x;const O=q();let U=O;const b=()=>w,C=()=>U;function q(){const t=r(w.path),n=t.substring(0,t.lastIndexOf(t.split("/")[t.split("/").length-1]));return`${`${w.scheme}://${w.host}${null!=w.port?`:${w.port}`:""}`}${n}`}const R={setAppUrl:t=>w=t,setAppBaseUrl:t=>U=t,restoreUrls:()=>{w=x,U=O}};function j(t){const n={path:null,query:null},e=new y(t),r=t.indexOf("?");return null===e.query?n.path=t:(n.path=t.substring(0,r),n.query=v(e.query)),e.fragment&&(n.hash=e.fragment,null===e.query&&(n.path=n.path.substring(0,n.path.length-(e.fragment.length+1)))),n}function v(t){const n=t.split("&"),e={};for(const r of n){if(!r)continue;const t=r.indexOf("=");let n,o;t<0?(n=decodeURIComponent(r),o=""):(n=decodeURIComponent(r.slice(0,t)),o=decodeURIComponent(r.slice(t+1)));let i=e[n];"string"==typeof i&&(i=e[n]=[i]),Array.isArray(i)?i.push(o):e[n]=o}return e}function L(t){return t&&"object"==typeof t&&"toJSON"in t&&"function"==typeof t.toJSON}function I(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 o=encodeURIComponent(e)+"=",i=n&&n[e];return i?o+encodeURIComponent(i(r)):Array.isArray(r)?r.map((t=>L(t)?o+encodeURIComponent(JSON.stringify(t)):o+encodeURIComponent(t))).join("&"):L(r)?o+encodeURIComponent(JSON.stringify(r)):o+encodeURIComponent(r)})).filter((t=>t)).join("&"):""}function A(t=!1){let e,r=u.proxyUrl;if("string"==typeof t){e=ht(t);const n=J(t);n&&(r=n.proxyUrl)}else e=!!t;if(!r)throw s.warn(c),new n("urlutils:proxy-not-set",c);e&&$t()&&(r=mt(r));return j(r)}function S(t){const n=J(t);let e,r;if(n){const t=P(n.proxyUrl);e=t.path,r=t.query?v(t.query):null}if(e){const n=j(t);t=e+"?"+n.path;const o=I({...r,...n.query});o&&(t=`${t}?${o}`)}return t}const B={path:"",query:""};function P(t){const n=t.indexOf("?");return-1!==n?(B.path=t.slice(0,n),B.query=t.slice(n+1)):(B.path=t,B.query=null),B}function k(t){return t=(t=xt(t=bt(t=P(t).path),!0)).toLowerCase()}function E(t){const n={proxyUrl:t.proxyUrl,urlPrefix:k(t.urlPrefix)},e=u.proxyRules,r=n.urlPrefix;let o=e.length;for(let i=0;i<e.length;i++){const t=e[i].urlPrefix;if(0===r.indexOf(t)){if(r.length===t.length)return-1;o=i;break}0===t.indexOf(r)&&(o=i+1)}return e.splice(o,0,n),o}function J(t){const n=u.proxyRules,e=k(t);for(let r=0;r<n.length;r++)if(0===e.indexOf(n[r].urlPrefix))return n[r]}function N(t,n){return t=T(t),n=T(n),xt(t)===xt(n)}function T(t){const n=(t=F(t)).indexOf("/sharing");return n>0?t.substring(0,n):t.replace(/\/+$/,"")}function W(t){const n=n=>null==n||n instanceof RegExp&&n.test(t)||"string"==typeof n&&t.startsWith(n),e=u.interceptors;if(e)for(const r of e)if(Array.isArray(r.urls)){if(r.urls.some(n))return r}else if(n(r.urls))return r;return null}function z(t,n,e=!1){const r=Lt(t),o=Lt(n);return!(!e&&r.scheme!==o.scheme)&&(null!=r.host&&null!=o.host&&(r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port))}function D(t){if("string"==typeof t){if(!K(t))return!0;t=Lt(t)}if(z(t,w))return!0;const n=u.trustedServers||[];for(let e=0;e<n.length;e++){const r=M(n[e]);for(let n=0;n<r.length;n++)if(z(t,r[n]))return!0}return!1}function M(t){return $[t]||(at(t)||ft(t)?$[t]=[new y(Q(t))]:$[t]=[new y(`http://${t}`),new y(`https://${t}`)]),$[t]}function Q(t,n=U,e){return ft(t)?e&&e.preserveProtocolRelative?t:"http"===w.scheme&&w.authority===H(t).slice(2)?`http:${t}`:`https:${t}`:at(t)?t:r(G("/"===t[0]?wt(n):n,t))}function _(t,n=U,e){if(!K(t))return t;const r=F(t),o=r.toLowerCase(),i=F(n).toLowerCase().replace(/\/+$/,""),s=e?F(e).toLowerCase().replace(/\/+$/,""):null;if(s&&0!==i.indexOf(s))return t;const u=(t,n,e)=>-1===(e=t.indexOf(n,e))?t.length:e;let c=u(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===i.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=u(o,"/",c+1);if(-1===l)return t;if(s&&l<s.length)return t;t=r.slice(l);const f=i.slice(l-1).replace(/[^/]+/g,"").length;if(f>0)for(let a=0;a<f;a++)t=`../${t}`;else t=`./${t}`;return t}function F(t){return t=jt(t=Rt(t=qt(t=Q(t=t.trim()))))}function G(...t){const n=t.filter(o);if(!n||!n.length)return;const e=[];if(K(n[0])){const t=n[0],r=t.indexOf("//");-1!==r&&(e.push(t.slice(0,r+1)),dt(n[0])&&(e[0]+="/"),n[0]=t.slice(r+2))}else"/"===n[0][0]&&e.push("");const r=n.reduce(((t,n)=>n?t.concat(n.split("/")):t),[]);for(let o=0;o<r.length;o++){const t=r[o];".."===t&&e.length>0&&".."!==e[e.length-1]?e.pop():(!t&&o===r.length-1||t&&("."!==t||0===e.length))&&e.push(t)}return e.join("/")}function H(t,n=!1){if(V(t)||X(t))return null;let e=t.indexOf("://");if(-1===e&&ft(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=xt(t,!0)),t}function K(t){return ft(t)||at(t)}function V(t){return null!=t&&"blob:"===t.slice(0,5)}function X(t){return"data:"===t.slice(0,5)}function Y(t){const n=nt(t);if(!n||!n.isBase64)return null;const e=atob(n.data),r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e.charCodeAt(o);return r.buffer}function Z(t){return btoa(String.fromCharCode.apply(null,t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const tt=/^data:(.*?)(;base64)?,(.*)$/;function nt(t){const n=t.match(tt);if(!n)return null;const[,e,r,o]=n;return{mediaType:e,isBase64:!!r,data:o}}function et(t){return t.isBase64?`data:${t.mediaType};base64,${t.data}`:`data:${t.mediaType},${t.data}`}function rt(t){const n=Y(t);if(!n)return null;const e=nt(t);return new Blob([n],{type:e.mediaType})}function ot(t,n){st(t,n)||ct(t,n)}function it(t,n){ut(t,n)||lt(t,n)}function st(t,n){const e=rt(t);return!!e&&ut(e,n)}function ut(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 ct(t,n){const e=rt(t);return!!e&<(e,n)}function lt(t,n){return!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(t,n)}function ft(t){return null!=t&&void 0!==t&&"/"===t[0]&&"/"===t[1]}function at(t){return l.test(t)}function ht(t){return a.test(t)||"https"===w.scheme&&ft(t)}function pt(t){return f.test(t)||"http"===w.scheme&&ft(t)}function dt(t){return h.test(t)}function gt(t){return ft(t)?`http:${t}`:t.replace(a,"http:")}function mt(t){return ft(t)?`https:${t}`:t.replace(f,"https:")}function yt(){return"http"===w.scheme}function $t(){return"https"===w.scheme}function xt(t,n=!1){return ft(t)?t.slice(2):(t=t.replace(l,""),n&&t.length>1&&"/"===t[0]&&"/"===t[1]&&(t=t.slice(2)),t)}function wt(t){const n=t.indexOf("//"),e=t.indexOf("/",n+2);return-1===e?t:t.slice(0,e)}function Ot(t){let n=0;if(K(t)){const e=t.indexOf("//");-1!==e&&(n=e+2)}const e=t.lastIndexOf("/");return e<n?t:t.slice(0,e+1)}function Ut(t,n){if(!t)return"";const e=j(t).path.replace(/\/+$/,""),r=e.substring(e.lastIndexOf("/")+1);if(!n?.length)return r;const o=new RegExp(`.(${n.join("|")})$`,"ig");return r.replace(o,"")}function bt(t){return t&&"/"===t[t.length-1]?t:`${t}/`}function Ct(t){return t.replace(/\/+$/,"")}function qt(t){if(/^https?:\/\//i.test(t)){const n=P(t);t=(t=n.path.replace(/\/{2,}/g,"/")).replace("/","//"),n.query&&(t+=`?${n.query}`)}return t}function Rt(t){return t.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}function jt(t){const n=u.httpsDomains;if(!pt(t))return t;const e=t.indexOf("/",7);let r;if(r=-1===e?t:t.slice(0,e),r=r.toLowerCase().slice(7),p.test(r)){if(!r.endsWith(":80"))return t;r=r.slice(0,-3),t=t.replace(":80","")}return yt()&&r===w.authority&&!d.test(t)||($t()&&r===w.authority||n&&n.some((t=>r===t||r.endsWith(`.${t}`)))||$t()&&!J(t))&&(t=mt(t)),t}function vt(t,n,e){if(!(n&&e&&t&&K(t)))return t;const r=t.indexOf("//"),o=t.indexOf("/",r+2),i=t.indexOf(":",r+2),s=Math.min(o<0?t.length:o,i<0?t.length:i);if(t.slice(r+2,s).toLowerCase()!==n.toLowerCase())return t;return`${t.slice(0,r+2)}${e}${t.slice(s)}`}function Lt(t){return"string"==typeof t?new y(Q(t)):(t.scheme||(t.scheme=w.scheme),t)}function It(t){return Jt.test(t)}function At(t,n){const e=j(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=j(t),o=r.query||{};return o[n]=String(e),`${r.path}?${I(o)}`}function Bt(t,n){const e=j(t),r=e.query||{};for(const i in n)r[i]=n[i];const o=I(r);return o?`${e.path}?${o}`:e.path}function Pt(t,n){const{path:e,query:r}=j(t);if(!r)return t;delete r[n];const o=I(r);return o?`${e}?${o}`:e}function kt(t){if(i(t))return null;const n=t.match(Et);return n?n[1]:null}const Et=/.*?\.([^\/]*)$/,Jt=/(^data:image\/svg|\.svg$)/i;export{y as Url,S as addProxy,E as addProxyRule,St as addQueryParameter,Bt as addQueryParameters,Z as base64UrlEncode,vt as changeDomain,nt as dataComponents,Y as dataToArrayBuffer,rt as dataToBlob,it as downloadBlobAsFile,ot as downloadDataAsFile,C as getAppBaseUrl,b as getAppUrl,Ut as getFilename,W as getInterceptor,H as getOrigin,kt as getPathExtension,J as getProxyRule,A as getProxyUrl,at as hasProtocol,z as hasSameOrigin,N as hasSamePortal,K as isAbsolute,$t as isAppHTTPS,V as isBlobProtocol,X as isDataProtocol,ht as isHTTPSProtocol,ft as isProtocolRelative,It as isSVG,D as isTrustedServer,G as join,Q as makeAbsolute,et as makeData,_ as makeRelative,F as normalize,I as objectToQuery,v as queryToObject,Ot as removeFile,Pt as removeQueryParameter,At as removeQueryParameters,Ct as removeTrailingSlash,R as test,gt as toHTTP,mt as toHTTPS,$ as trustedServersUrlCache,j as urlToObject};
|
|
5
|
+
import t from"../config.js";import n from"./Error.js";import e from"./Logger.js";import{assumeNonNull as r,isSome as o,isNone as i}from"./maybe.js";const s=e.getLogger("esri.core.urlUtils"),u=t.request,c="esri/config: esriConfig.request.proxyUrl is not set.",l=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,a=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,d=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{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=r(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=r(this.authority.match(m)),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 $={},x=new y(t.applicationUrl);let w=x;const O=q();let U=O;const b=()=>w,C=()=>U;function q(){const t=r(w.path),n=t.substring(0,t.lastIndexOf(t.split("/")[t.split("/").length-1]));return`${`${w.scheme}://${w.host}${null!=w.port?`:${w.port}`:""}`}${n}`}const R={setAppUrl:t=>w=t,setAppBaseUrl:t=>U=t,restoreUrls:()=>{w=x,U=O}};function j(t){const n={path:null,query:null},e=new y(t),r=t.indexOf("?");return null===e.query?n.path=t:(n.path=t.substring(0,r),n.query=v(e.query)),e.fragment&&(n.hash=e.fragment,null===e.query&&(n.path=n.path.substring(0,n.path.length-(e.fragment.length+1)))),n}function v(t){const n=t.split("&"),e={};for(const r of n){if(!r)continue;const t=r.indexOf("=");let n,o;t<0?(n=decodeURIComponent(r),o=""):(n=decodeURIComponent(r.slice(0,t)),o=decodeURIComponent(r.slice(t+1)));let i=e[n];"string"==typeof i&&(i=e[n]=[i]),Array.isArray(i)?i.push(o):e[n]=o}return e}function L(t){return t&&"object"==typeof t&&"toJSON"in t&&"function"==typeof t.toJSON}function I(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 o=encodeURIComponent(e)+"=",i=n&&n[e];return i?o+encodeURIComponent(i(r)):Array.isArray(r)?r.map((t=>L(t)?o+encodeURIComponent(JSON.stringify(t)):o+encodeURIComponent(t))).join("&"):L(r)?o+encodeURIComponent(JSON.stringify(r)):o+encodeURIComponent(r)})).filter((t=>t)).join("&"):""}function A(t=!1){let e,r=u.proxyUrl;if("string"==typeof t){e=ht(t);const n=J(t);n&&(r=n.proxyUrl)}else e=!!t;if(!r)throw s.warn(c),new n("urlutils:proxy-not-set",c);e&&$t()&&(r=mt(r));return j(r)}function S(t){const n=J(t);let e,r;if(n){const t=P(n.proxyUrl);e=t.path,r=t.query?v(t.query):null}if(e){const n=j(t);t=e+"?"+n.path;const o=I({...r,...n.query});o&&(t=`${t}?${o}`)}return t}const B={path:"",query:""};function P(t){const n=t.indexOf("?");return-1!==n?(B.path=t.slice(0,n),B.query=t.slice(n+1)):(B.path=t,B.query=null),B}function k(t){return t=(t=xt(t=bt(t=P(t).path),!0)).toLowerCase()}function E(t){const n={proxyUrl:t.proxyUrl,urlPrefix:k(t.urlPrefix)},e=u.proxyRules,r=n.urlPrefix;let o=e.length;for(let i=0;i<e.length;i++){const t=e[i].urlPrefix;if(0===r.indexOf(t)){if(r.length===t.length)return-1;o=i;break}0===t.indexOf(r)&&(o=i+1)}return e.splice(o,0,n),o}function J(t){const n=u.proxyRules,e=k(t);for(let r=0;r<n.length;r++)if(0===e.indexOf(n[r].urlPrefix))return n[r]}function N(t,n){return t=T(t),n=T(n),xt(t)===xt(n)}function T(t){const n=(t=F(t)).indexOf("/sharing");return n>0?t.substring(0,n):t.replace(/\/+$/,"")}function W(t){const n=n=>null==n||n instanceof RegExp&&n.test(t)||"string"==typeof n&&t.startsWith(n),e=u.interceptors;if(e)for(const r of e)if(Array.isArray(r.urls)){if(r.urls.some(n))return r}else if(n(r.urls))return r;return null}function z(t,n,e=!1){if(!t||!n)return!1;const r=Lt(t),o=Lt(n);return!(!e&&r.scheme!==o.scheme)&&(null!=r.host&&null!=o.host&&(r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port))}function D(t){if("string"==typeof t){if(!K(t))return!0;t=Lt(t)}if(z(t,w))return!0;const n=u.trustedServers||[];for(let e=0;e<n.length;e++){const r=M(n[e]);for(let n=0;n<r.length;n++)if(z(t,r[n]))return!0}return!1}function M(t){return $[t]||(at(t)||ft(t)?$[t]=[new y(Q(t))]:$[t]=[new y(`http://${t}`),new y(`https://${t}`)]),$[t]}function Q(t,n=U,e){return ft(t)?e&&e.preserveProtocolRelative?t:"http"===w.scheme&&w.authority===H(t).slice(2)?`http:${t}`:`https:${t}`:at(t)?t:r(G("/"===t[0]?wt(n):n,t))}function _(t,n=U,e){if(!K(t))return t;const r=F(t),o=r.toLowerCase(),i=F(n).toLowerCase().replace(/\/+$/,""),s=e?F(e).toLowerCase().replace(/\/+$/,""):null;if(s&&0!==i.indexOf(s))return t;const u=(t,n,e)=>-1===(e=t.indexOf(n,e))?t.length:e;let c=u(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===i.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=u(o,"/",c+1);if(-1===l)return t;if(s&&l<s.length)return t;t=r.slice(l);const f=i.slice(l-1).replace(/[^/]+/g,"").length;if(f>0)for(let a=0;a<f;a++)t=`../${t}`;else t=`./${t}`;return t}function F(t){return t=jt(t=Rt(t=qt(t=Q(t=t.trim()))))}function G(...t){const n=t.filter(o);if(!n||!n.length)return;const e=[];if(K(n[0])){const t=n[0],r=t.indexOf("//");-1!==r&&(e.push(t.slice(0,r+1)),dt(n[0])&&(e[0]+="/"),n[0]=t.slice(r+2))}else"/"===n[0][0]&&e.push("");const r=n.reduce(((t,n)=>n?t.concat(n.split("/")):t),[]);for(let o=0;o<r.length;o++){const t=r[o];".."===t&&e.length>0&&".."!==e[e.length-1]?e.pop():(!t&&o===r.length-1||t&&("."!==t||0===e.length))&&e.push(t)}return e.join("/")}function H(t,n=!1){if(V(t)||X(t))return null;let e=t.indexOf("://");if(-1===e&&ft(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=xt(t,!0)),t}function K(t){return ft(t)||at(t)}function V(t){return null!=t&&"blob:"===t.slice(0,5)}function X(t){return"data:"===t.slice(0,5)}function Y(t){const n=nt(t);if(!n||!n.isBase64)return null;const e=atob(n.data),r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e.charCodeAt(o);return r.buffer}function Z(t){return btoa(String.fromCharCode.apply(null,t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const tt=/^data:(.*?)(;base64)?,(.*)$/;function nt(t){const n=t.match(tt);if(!n)return null;const[,e,r,o]=n;return{mediaType:e,isBase64:!!r,data:o}}function et(t){return t.isBase64?`data:${t.mediaType};base64,${t.data}`:`data:${t.mediaType},${t.data}`}function rt(t){const n=Y(t);if(!n)return null;const e=nt(t);return new Blob([n],{type:e.mediaType})}function ot(t,n){st(t,n)||ct(t,n)}function it(t,n){ut(t,n)||lt(t,n)}function st(t,n){const e=rt(t);return!!e&&ut(e,n)}function ut(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 ct(t,n){const e=rt(t);return!!e&<(e,n)}function lt(t,n){return!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(t,n)}function ft(t){return null!=t&&void 0!==t&&"/"===t[0]&&"/"===t[1]}function at(t){return l.test(t)}function ht(t){return a.test(t)||"https"===w.scheme&&ft(t)}function pt(t){return f.test(t)||"http"===w.scheme&&ft(t)}function dt(t){return h.test(t)}function gt(t){return ft(t)?`http:${t}`:t.replace(a,"http:")}function mt(t){return ft(t)?`https:${t}`:t.replace(f,"https:")}function yt(){return"http"===w.scheme}function $t(){return"https"===w.scheme}function xt(t,n=!1){return ft(t)?t.slice(2):(t=t.replace(l,""),n&&t.length>1&&"/"===t[0]&&"/"===t[1]&&(t=t.slice(2)),t)}function wt(t){const n=t.indexOf("//"),e=t.indexOf("/",n+2);return-1===e?t:t.slice(0,e)}function Ot(t){let n=0;if(K(t)){const e=t.indexOf("//");-1!==e&&(n=e+2)}const e=t.lastIndexOf("/");return e<n?t:t.slice(0,e+1)}function Ut(t,n){if(!t)return"";const e=j(t).path.replace(/\/+$/,""),r=e.substring(e.lastIndexOf("/")+1);if(!n?.length)return r;const o=new RegExp(`.(${n.join("|")})$`,"ig");return r.replace(o,"")}function bt(t){return t&&"/"===t[t.length-1]?t:`${t}/`}function Ct(t){return t.replace(/\/+$/,"")}function qt(t){if(/^https?:\/\//i.test(t)){const n=P(t);t=(t=n.path.replace(/\/{2,}/g,"/")).replace("/","//"),n.query&&(t+=`?${n.query}`)}return t}function Rt(t){return t.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}function jt(t){const n=u.httpsDomains;if(!pt(t))return t;const e=t.indexOf("/",7);let r;if(r=-1===e?t:t.slice(0,e),r=r.toLowerCase().slice(7),p.test(r)){if(!r.endsWith(":80"))return t;r=r.slice(0,-3),t=t.replace(":80","")}return yt()&&r===w.authority&&!d.test(t)||($t()&&r===w.authority||n&&n.some((t=>r===t||r.endsWith(`.${t}`)))||$t()&&!J(t))&&(t=mt(t)),t}function vt(t,n,e){if(!(n&&e&&t&&K(t)))return t;const r=t.indexOf("//"),o=t.indexOf("/",r+2),i=t.indexOf(":",r+2),s=Math.min(o<0?t.length:o,i<0?t.length:i);if(t.slice(r+2,s).toLowerCase()!==n.toLowerCase())return t;return`${t.slice(0,r+2)}${e}${t.slice(s)}`}function Lt(t){return"string"==typeof t?new y(Q(t)):(t.scheme||(t.scheme=w.scheme),t)}function It(t){return Jt.test(t)}function At(t,n){const e=j(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=j(t),o=r.query||{};return o[n]=String(e),`${r.path}?${I(o)}`}function Bt(t,n){const e=j(t),r=e.query||{};for(const i in n)r[i]=n[i];const o=I(r);return o?`${e.path}?${o}`:e.path}function Pt(t,n){const{path:e,query:r}=j(t);if(!r)return t;delete r[n];const o=I(r);return o?`${e}?${o}`:e}function kt(t){if(i(t))return null;const n=t.match(Et);return n?n[1]:null}const Et=/.*?\.([^\/]*)$/,Jt=/(^data:image\/svg|\.svg$)/i;export{y as Url,S as addProxy,E as addProxyRule,St as addQueryParameter,Bt as addQueryParameters,Z as base64UrlEncode,vt as changeDomain,nt as dataComponents,Y as dataToArrayBuffer,rt as dataToBlob,it as downloadBlobAsFile,ot as downloadDataAsFile,C as getAppBaseUrl,b as getAppUrl,Ut as getFilename,W as getInterceptor,H as getOrigin,kt as getPathExtension,J as getProxyRule,A as getProxyUrl,at as hasProtocol,z as hasSameOrigin,N as hasSamePortal,K as isAbsolute,$t as isAppHTTPS,V as isBlobProtocol,X as isDataProtocol,ht as isHTTPSProtocol,ft as isProtocolRelative,It as isSVG,D as isTrustedServer,G as join,Q as makeAbsolute,et as makeData,_ as makeRelative,F as normalize,I as objectToQuery,v as queryToObject,Ot as removeFile,Pt as removeQueryParameter,At as removeQueryParameters,Ct as removeTrailingSlash,R as test,gt as toHTTP,mt as toHTTPS,$ as trustedServersUrlCache,j as urlToObject};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{inchesPerMeter as t,getMetersPerUnitForSR as n}from"../../core/unitUtils.js";const e=96;function
|
|
5
|
+
import{inchesPerMeter as t,getMetersPerUnitForSR as n}from"../../core/unitUtils.js";const e=96;function i(i,r){const o=r||i.extent,c=i.width,d=n(o&&o.spatialReference);return o&&c?o.width/c*d*t*e:0}function r(i,r){return i/(n(r)*t*e)}function o(n){return n/(t*e)}function c(i,r){return i*(n(r)*t*e)}function d(t,n){const e=t.extent,i=t.width-(t.padding?t.padding.left+t.padding.right:0),o=r(n,e.spatialReference);return e.clone().expand(o*i/e.width)}export{d as getExtentForScale,r as getResolutionForScale,o as getResolutionInMetersForScale,i as getScale,c as getScaleForResolution};
|
package/identity/IdentityForm.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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as s}from"../chunks/tslib.es6.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as t}from"../core/accessorSupport/decorators/subclass.js";import{substitute as r}from"../intl/substitute.js";import o from"../widgets/Widget.js";import{storeNode as i}from"../widgets/support/widgetUtils.js";import{messageBundle as n}from"../widgets/support/decorators/messageBundle.js";import{tsx as u}from"../widgets/support/jsxFactory.js";const a={base:"esri-identity-form",group:"esri-identity-form__group",label:"esri-identity-form__label",footer:"esri-identity-form__footer",esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"},
|
|
5
|
+
import{_ as s}from"../chunks/tslib.es6.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as t}from"../core/accessorSupport/decorators/subclass.js";import{substitute as r}from"../intl/substitute.js";import o from"../widgets/Widget.js";import{storeNode as i}from"../widgets/support/widgetUtils.js";import{messageBundle as n}from"../widgets/support/decorators/messageBundle.js";import{tsx as u}from"../widgets/support/jsxFactory.js";const a={base:"esri-identity-form",group:"esri-identity-form__group",label:"esri-identity-form__label",footer:"esri-identity-form__footer",esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"},p="ArcGIS Online";let l=class extends o{constructor(s,e){super(s,e),this._usernameInputNode=null,this._passwordInputNode=null,this.signingIn=!1,this.server=null,this.resource=null,this.error=null,this.oAuthPrompt=!1}render(){const{error:s,server:e,resource:t,signingIn:o,oAuthPrompt:n,messages:l}=this,d=u("div",{class:a.group},r(n?l.oAuthInfo:l.info,{server:e&&/\.arcgis\.com/i.test(e)?p:e,resource:`(${t||l.lblItem})`})),c=n?null:u("div",{class:a.group,key:"username"},u("label",{class:a.label},l.lblUser,u("input",{value:"",required:!0,autocomplete:"off",spellcheck:!1,type:"text",bind:this,afterCreate:i,"data-node-ref":"_usernameInputNode",class:a.esriInput}))),m=n?null:u("div",{class:a.group,key:"password"},u("label",{class:a.label},l.lblPwd,u("input",{value:"",required:!0,type:"password",bind:this,afterCreate:i,"data-node-ref":"_passwordInputNode",class:a.esriInput}))),h=u("div",{class:this.classes(a.group,a.footer)},u("input",{type:"submit",disabled:!!o,value:o?l.lblSigning:l.lblOk,class:a.esriButton}),u("input",{type:"button",value:l.lblCancel,bind:this,onclick:this._cancel,class:this.classes(a.esriButton,a.esriButtonSecondary)})),b=s?u("div",null,s.details&&s.details.httpStatus?l.invalidUser:l.noAuthService):null;return u("form",{class:a.base,bind:this,onsubmit:this._submit},d,b,c,m,h)}_cancel(){this._set("signingIn",!1),this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(s){s.preventDefault(),this._set("signingIn",!0);const e=this.oAuthPrompt?{}:{username:this._usernameInputNode&&this._usernameInputNode.value,password:this._passwordInputNode&&this._passwordInputNode.value};this.emit("submit",e)}};s([e(),n("esri/identity/t9n/identity")],l.prototype,"messages",void 0),s([e()],l.prototype,"signingIn",void 0),s([e()],l.prototype,"server",void 0),s([e()],l.prototype,"resource",void 0),s([e()],l.prototype,"error",void 0),s([e()],l.prototype,"oAuthPrompt",void 0),l=s([t("esri.identity.IdentityForm")],l);const d=l;export{d 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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import{makeHandle as e}from"../core/handleUtils.js";import{watch as o}from"../core/reactiveUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import r from"../widgets/Widget.js";import{isWidget as n}from"../widgets/support/widget.js";import{createFocusTrap as a}from"focus-trap";import{messageBundle as c}from"../widgets/support/decorators/messageBundle.js";import{tsx as d}from"../widgets/support/jsxFactory.js";const l={base:"esri-identity-modal",open:"esri-identity-modal--open",closed:"esri-identity-modal--closed",title:"esri-identity-modal__title",dialog:"esri-identity-modal__dialog",content:"esri-identity-modal__content",closeButton:"esri-identity-modal__close-button",iconClose:"esri-icon-close"};let p=class extends r{constructor(t,e){super(t,e),this.container=document.createElement("div"),this.content=null,this.open=!1,this._close=()=>{this.open=!1},document.body.appendChild(this.container),this.addHandles(o((()=>this.open),(()=>this._toggleFocusTrap())))}destroy(){this._destroyFocusTrap()}render(){const t=this.id,{open:e,content:o,title:s,messages:i}=this,r=e&&!!o,n={[l.open]:r,[l.closed]:!r},a=d("button",{class:l.closeButton,"aria-label":i.close,title:i.close,bind:this,onclick:this._close,type:"button"},d("span",{"aria-hidden":"true",class:l.iconClose})),c=`${t}_title`,p=`${t}_content`,u=s?d("h1",{id:c,class:l.title},s):null,m=r?d("div",{bind:this,class:l.dialog,role:"dialog","aria-labelledby":c,"aria-describedby":p,afterCreate:this._createFocusTrap},a,u,this._renderContent(p)):null;return d("div",{tabIndex:-1,class:this.classes(l.base,n)},m)}_destroyFocusTrap(){this._focusTrap?.deactivate({onDeactivate:
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import{makeHandle as e}from"../core/handleUtils.js";import{watch as o}from"../core/reactiveUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import r from"../widgets/Widget.js";import{isWidget as n}from"../widgets/support/widget.js";import{createFocusTrap as a}from"focus-trap";import{messageBundle as c}from"../widgets/support/decorators/messageBundle.js";import{tsx as d}from"../widgets/support/jsxFactory.js";const l={base:"esri-identity-modal",open:"esri-identity-modal--open",closed:"esri-identity-modal--closed",title:"esri-identity-modal__title",dialog:"esri-identity-modal__dialog",content:"esri-identity-modal__content",closeButton:"esri-identity-modal__close-button",iconClose:"esri-icon-close"};let p=class extends r{constructor(t,e){super(t,e),this.container=document.createElement("div"),this.content=null,this.open=!1,this._focusTrap=null,this._close=()=>{this.open=!1},document.body.appendChild(this.container),this.addHandles(o((()=>this.open),(()=>this._toggleFocusTrap())))}destroy(){this._destroyFocusTrap()}get title(){return this.messages?.auth.signIn}render(){const t=this.id,{open:e,content:o,title:s,messages:i}=this,r=e&&!!o,n={[l.open]:r,[l.closed]:!r},a=d("button",{class:l.closeButton,"aria-label":i.close,title:i.close,bind:this,onclick:this._close,type:"button"},d("span",{"aria-hidden":"true",class:l.iconClose})),c=`${t}_title`,p=`${t}_content`,u=s?d("h1",{id:c,class:l.title},s):null,m=r?d("div",{bind:this,class:l.dialog,role:"dialog","aria-labelledby":c,"aria-describedby":p,afterCreate:this._createFocusTrap},a,u,this._renderContent(p)):null;return d("div",{tabIndex:-1,class:this.classes(l.base,n)},m)}_destroyFocusTrap(){this._focusTrap?.deactivate({onDeactivate:()=>{}}),this._focusTrap=null}_toggleFocusTrap(){const{_focusTrap:t,open:e}=this;t&&(e?t.activate():t.deactivate())}_createFocusTrap(t){this._destroyFocusTrap();const o=requestAnimationFrame((()=>{this._focusTrap=a(t,{initialFocus:"input",onDeactivate:this._close}),this._toggleFocusTrap()}));this.addHandles(e((()=>cancelAnimationFrame(o))))}_renderContent(t){const e=this.content;return"string"==typeof e?d("div",{class:l.content,id:t,innerHTML:e}):n(e)?d("div",{class:l.content,id:t},e.render()):e instanceof HTMLElement?d("div",{class:l.content,id:t,bind:e,afterCreate:this._attachToNode}):null}_attachToNode(t){const e=this;t.appendChild(e)}};t([s({readOnly:!0})],p.prototype,"container",void 0),t([s()],p.prototype,"content",void 0),t([s()],p.prototype,"open",void 0),t([s(),c("esri/t9n/common")],p.prototype,"messages",void 0),t([s()],p.prototype,"title",null),p=t([i("esri.identity.IdentityModal")],p);const u=p;export{u 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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const t="esriJSAPIOAuth";class e{constructor(t,e){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=t,this.storage=e,this._init()}isValid(){let t=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token))if(null==this.expires&&this.refreshToken)t=!0;else{const e=Date.now();if(this.expires>e){(this.expires-e)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(t=!0)}}return t}save(){if(!this.storage)return!1;const e=this._load(),s=this.oAuthInfo;if(s&&s.authNamespace&&s.portalUrl){let r=e[s.authNamespace];r||(r=e[s.authNamespace]={}),this.appId||(this.appId=s.appId),r[s.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(t,JSON.stringify(e))}catch(i){return console.warn(i),!1}return!0}return!1}destroy(){const e=this._load(),s=this.oAuthInfo;if(s&&s.appId&&s.portalUrl&&(null==this.expires||this.expires>Date.now())&&(this.refreshToken||this.token)){const t=s.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",e=new FormData;if(e.append("f","json"),e.append("auth_token",this.refreshToken||this.token),e.append("client_id",s.appId),e.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),"function"==typeof navigator.sendBeacon)navigator.sendBeacon(t,e);else{const s=new XMLHttpRequest;s.open("POST",t),s.send(e)}}if(s&&s.authNamespace&&s.portalUrl&&this.storage){const r=e[s.authNamespace];if(r){delete r[s.portalUrl];try{this.storage.setItem(t,JSON.stringify(e))}catch(i){console.log(i)}}}s&&(s._oAuthCred=null,this.oAuthInfo=null)}_init(){const t=this._load(),e=this.oAuthInfo;if(e&&e.authNamespace&&e.portalUrl){let s=t[e.authNamespace];s&&(s=s[e.portalUrl],s&&(this.appId=s.appId,this.codeVerifier=s.codeVerifier,this.expires=s.expires,this.refreshToken=s.refreshToken,this.ssl=s.ssl,this.stateUID=s.stateUID,this.token=s.token,this.userId=s.userId))}}_load(){let e={};if(this.storage){const i=this.storage.getItem(t);if(i)try{e=JSON.parse(i)}catch(s){console.warn(s)}}return e}}e.prototype.declaredClass="esri.identity.OAuthCredential";export{e as default};
|
|
5
|
+
const t="esriJSAPIOAuth";class e{constructor(t,e){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=t,this.storage=e,this._init()}isValid(){let t=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token))if(null==this.expires&&this.refreshToken)t=!0;else if(this.expires){const e=Date.now();if(this.expires>e){(this.expires-e)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(t=!0)}}return t}save(){if(!this.storage)return!1;const e=this._load(),s=this.oAuthInfo;if(s&&s.authNamespace&&s.portalUrl){let r=e[s.authNamespace];r||(r=e[s.authNamespace]={}),this.appId||(this.appId=s.appId),r[s.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(t,JSON.stringify(e))}catch(i){return console.warn(i),!1}return!0}return!1}destroy(){const e=this._load(),s=this.oAuthInfo;if(s&&s.appId&&s.portalUrl&&(null==this.expires||this.expires>Date.now())&&(this.refreshToken||this.token)){const t=s.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",e=new FormData;if(e.append("f","json"),e.append("auth_token",this.refreshToken||this.token),e.append("client_id",s.appId),e.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),"function"==typeof navigator.sendBeacon)navigator.sendBeacon(t,e);else{const s=new XMLHttpRequest;s.open("POST",t),s.send(e)}}if(s&&s.authNamespace&&s.portalUrl&&this.storage){const r=e[s.authNamespace];if(r){delete r[s.portalUrl];try{this.storage.setItem(t,JSON.stringify(e))}catch(i){console.log(i)}}}s&&(s._oAuthCred=null,this.oAuthInfo=null)}_init(){const t=this._load(),e=this.oAuthInfo;if(e&&e.authNamespace&&e.portalUrl){let s=t[e.authNamespace];s&&(s=s[e.portalUrl],s&&(this.appId=s.appId,this.codeVerifier=s.codeVerifier,this.expires=s.expires,this.refreshToken=s.refreshToken,this.ssl=s.ssl,this.stateUID=s.stateUID,this.token=s.token,this.userId=s.userId))}}_load(){let e={};if(this.storage){const i=this.storage.getItem(t);if(i)try{e=JSON.parse(i)}catch(s){console.warn(s)}}return e}}e.prototype.declaredClass="esri.identity.OAuthCredential";export{e as default};
|